当前位置: 首页>>代码示例>>C++>>正文


C++ CurrentSelection函数代码示例

本文整理汇总了C++中CurrentSelection函数的典型用法代码示例。如果您正苦于以下问题:C++ CurrentSelection函数的具体用法?C++ CurrentSelection怎么用?C++ CurrentSelection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CurrentSelection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CurrentSelection

void
RosterView::RemoveSelected()
{
	if (CurrentItemSelection())
	{
		int32       selected = CurrentSelection();
		RosterItem *item     = CurrentItemSelection();
		if (item == NULL) return;
		RemoveItem(CurrentSelection());
		if (ItemAt(selected)) Select(selected);
		else if (ItemAt(selected - 1)) Select(selected - 1);
	}
}
开发者ID:devaspot,项目名称:chat,代码行数:13,代码来源:RosterView.cpp

示例2: msg

void
SearchListView::ItemInvoked(void)
{
	BIntegerField* pageField = (BIntegerField*)CurrentSelection()->GetField(0);

    if (pageField == nullptr)
        return;
	
	BMessage msg(MSG_HIGHLIGHT_RECT);
	msg.AddInt32("page", pageField->Value() - 1);
	msg.AddRect("rect", fRectVec[IndexOf(CurrentSelection())]);
    Window()->PostMessage(&msg);
    
    BColumnListView::ItemInvoked();	
}
开发者ID:humdingerb,项目名称:DocumentViewer,代码行数:15,代码来源:SearchView.cpp

示例3: ContextPopUp

void
FavView::_ShowPopUpMenu(BPoint screen)
{
	if (fShowingPopUpMenu)
		return;

	ContextPopUp* menu = new ContextPopUp("PopUpMenu", this);
	FavItem *currentFav = dynamic_cast<FavItem *>(ItemAt(CurrentSelection()));
	BMessage* msg = NULL;

	msg = new BMessage(FAV_EDIT);
	msg->AddPointer("fav", currentFav);
	BMenuItem* item = new BMenuItem(B_TRANSLATE("Edit title"), msg);
	menu->AddItem(item);

	msg = new BMessage(FAV_DELETE);
	msg->AddPointer("fav", currentFav);
	item = new BMenuItem(B_TRANSLATE("Remove favorite"),msg);
	menu->AddItem(item);

	msg = new BMessage(PASTE_SPRUNGE);
	msg->AddPointer("fav", currentFav);
	item = new BMenuItem(B_TRANSLATE("Paste to Sprunge.us"), msg);
	menu->AddItem(item);

	menu->SetTargetForItems(Looper());
	menu->Go(screen, true, true, true);
	fShowingPopUpMenu = true;
}
开发者ID:humdingerb,项目名称:clipdinger,代码行数:29,代码来源:FavView.cpp

示例4: path

void
HEventList::SelectionChanged()
{
	BColumnListView::SelectionChanged();

	HEventRow* row = (HEventRow*)CurrentSelection();
	if (row != NULL) {
		entry_ref ref;
		BMediaFiles().GetRefFor(fType, row->Name(), &ref);

		BPath path(&ref);
		if (path.InitCheck() == B_OK || ref.name == NULL
			|| strcmp(ref.name, "") == 0) {
			row->SetPath(path.Path());
			UpdateRow(row);
		} else {
			printf("name %s\n", ref.name);
			BMediaFiles().RemoveRefFor(fType, row->Name(), ref);
			BAlert* alert = new BAlert("alert",
				B_TRANSLATE("No such file or directory"), B_TRANSLATE("OK"));
			alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
			alert->Go();
			return;
		}
		BMessage msg(M_EVENT_CHANGED);
		msg.AddString("name", row->Name());
		msg.AddString("path", row->Path());
		Window()->PostMessage(&msg);
	}
}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:30,代码来源:HEventList.cpp

示例5: ContextPopUp

void
ClipView::_ShowPopUpMenu(BPoint screen)
{
	if (fShowingPopUpMenu)
		return;

	ContextPopUp* menu = new ContextPopUp("PopUpMenu", this);
	ClipItem* currentClip = dynamic_cast<ClipItem *>(ItemAt(CurrentSelection()));
	BMessage* msg = NULL;

	msg = new BMessage(PASTE_SPRUNGE);
	msg->AddPointer("clip", currentClip);
	BMenuItem* item = new BMenuItem(B_TRANSLATE("Paste to Sprunge.us"), msg, 'P');
	menu->AddItem(item);

	msg = new BMessage(FAV_ADD);
	msg->AddPointer("clip", currentClip);
	item = new BMenuItem(B_TRANSLATE("Add to favorites"), msg, 'A');
	menu->AddItem(item);

	msg = new BMessage(DELETE);
	msg->AddPointer("clip", currentClip);
	item = new BMenuItem(B_TRANSLATE("Remove"), msg);
	menu->AddItem(item);

	menu->SetTargetForItems(Looper());
	menu->Go(screen, true, true, true);
	fShowingPopUpMenu = true;
}
开发者ID:humdingerb,项目名称:clipdinger,代码行数:29,代码来源:ClipView.cpp

示例6: _

// SelectionChanged
void
DragSortableListView::SelectionChanged()
{
//printf("%s::SelectionChanged()", typeid(*this).name());
	// modify global Selection
	if (!fSelection || fSyncingToSelection)
		return;

	fModifyingSelection = true;

	BList selectables;
	for (int32 i = 0; BListItem* item = ItemAt(CurrentSelection(i)); i++) {
		Selectable* selectable = SelectableFor(item);
		if (selectable)
			selectables.AddItem((void*)selectable);
	}

	AutoNotificationSuspender _(fSelection);

	int32 count = selectables.CountItems();
	if (count == 0) {
//printf("  deselecting all\n");
		if (!fSyncingToSelection)
			fSelection->DeselectAll();
	} else {
//printf("  selecting %ld items\n", count);
		for (int32 i = 0; i < count; i++) {
			Selectable* selectable = (Selectable*)selectables.ItemAtFast(i);
			fSelection->Select(selectable, i > 0);
		}
	}

	fModifyingSelection = false;
}
开发者ID:DonCN,项目名称:haiku,代码行数:35,代码来源:ListViews.cpp

示例7: CurrentSelection

void _ArpControllerRangeList::SelectionChanged()
{
	inherited::SelectionChanged();
	int32	selection = CurrentSelection();
	BMessage	update('iupd');
	if (selection >= 0) {
		BListItem*	item;
		for (int32 k = 0; (item = ItemAt(k)); k++) {
			_ArpControllerRangeItem*	ccItem = dynamic_cast<_ArpControllerRangeItem*>(item);
			if (ccItem) {
				if ( IsItemSelected(k) ) {
					update.AddInt32(mSettingsKey.String(), k);
					if ( !ccItem->IsActive() ) {
						ccItem->SetActive(true);
						InvalidateItem(k);
					}
				} else {
					if ( ccItem->IsActive() ) {
						ccItem->SetActive(false);
						InvalidateItem(k);
					}
				}
			}
		}
	}

	if (mTarget) {
		mTarget->Implementation().SendConfiguration(&update);
		mTarget->Settings().Update(update);
	}
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:31,代码来源:ArpControllerRange.cpp

示例8: switch

void
ClipView::KeyDown(const char* bytes, int32 numBytes)
{
	switch (bytes[0]) {
		case B_DELETE:
		{
			ClipItem* currentClip
				= dynamic_cast<ClipItem *>(ItemAt(CurrentSelection()));
			BMessage message(DELETE);
			message.AddPointer("clip", currentClip);
			Looper()->PostMessage(&message);
			break;
		}
		case B_LEFT_ARROW:
		case B_RIGHT_ARROW:
		{
			BMessage message(SWITCHLIST);
			message.AddInt32("listview", (int32)0);
			Looper()->PostMessage(&message);
			break;
		}
		default:
		{
			BListView::KeyDown(bytes, numBytes);
			break;
		}
	}
}
开发者ID:humdingerb,项目名称:clipdinger,代码行数:28,代码来源:ClipView.cpp

示例9: switch

void _OwqList::MessageReceived(BMessage* msg)
{
	switch( msg->what ) {
		case OWQ_INVOKE_ADD:
			OpenAddWindow();
			break;
		case OWQ_ADD:
			Add( msg );
			break;
		case OWQ_CHANGE:
			Change();
			break;
		case OWQ_REMOVE:
			{
				BRow*	selection = CurrentSelection();
				if( selection ) {
					RemoveRow( selection );
					delete selection;
				}
			}
			break;
		default:
			inherited::MessageReceived(msg);
			break;
	}
}
开发者ID:dtbinh,项目名称:Sequitur,代码行数:26,代码来源:SeqPrefWin.cpp

示例10: SelectionChanged

void LinkList::SelectionChanged()
{
	LinkItem *item = (LinkItem*)ItemAt(CurrentSelection());
	
	if ((item != NULL) && !(browseView->m_DontUpdateURL))
		((MainWindow*)Window())->GoTo(item->link);
}
开发者ID:mmadia,项目名称:behappy-svn_clone,代码行数:7,代码来源:BrowseView.cpp

示例11:

void
ListView1::SelectionChanged(void) {

			Window1 *window1=(Window1 *)Window();
			
			((BButton *)window1->view1->iconBAR->ChildViewAt("bar_deleteitem"))->SetEnabled(CurrentSelection()!=NULL);
	//be_app->PostMessage('mm05');
}
开发者ID:carriercomm,项目名称:Helios,代码行数:8,代码来源:ListView1.cpp

示例12: OnDoubleClick

void ConfigurationDialog::OnDoubleClick( wxMouseEvent& event )
{
    if(CurrentSelection() < 0)
        return;

    wxCommandEvent e;
    OnEditAlarm(e);
}
开发者ID:Hakansv,项目名称:watchdog_pi,代码行数:8,代码来源:ConfigurationDialog.cpp

示例13: CurrentSelection

void _OwqList::Change()
{
	_OwqRow*	selection = dynamic_cast<_OwqRow*>( CurrentSelection() );
	if( !selection ) return;
	BMessage	row( SET_PREFS_MSG );
	if( selection->GetPreferences( &row ) == B_OK )
		OpenAddWindow( &row );
}
开发者ID:dtbinh,项目名称:Sequitur,代码行数:8,代码来源:SeqPrefWin.cpp

示例14: RemoveItemList

/*****************************************************************************
 * DragSortableListView::RemoveSelected
 *****************************************************************************/
void
DragSortableListView::RemoveSelected()
{
    BList items;
    for ( int32 i = 0; BListItem* item = ItemAt( CurrentSelection( i ) ); i++ )
        items.AddItem( (void*)item );
    RemoveItemList( items );
}
开发者ID:forthyen,项目名称:SDesk,代码行数:11,代码来源:ListViews.cpp

示例15: while

// CountSelectedItems
int32
DragSortableListView::CountSelectedItems() const
{
	int32 count = 0;
	while (CurrentSelection(count) >= 0)
		count++;
	return count;
}
开发者ID:DonCN,项目名称:haiku,代码行数:9,代码来源:ListViews.cpp


注:本文中的CurrentSelection函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。