您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CurrentSelection函数代码示例

51自学网 2021-06-01 20:16:25
  C++
这篇教程C++ CurrentSelection函数代码示例写得很实用,希望能帮到您。

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

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

示例1: CurrentSelection

voidRosterView::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,


示例2: msg

voidSearchListView::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,


示例3: ContextPopUp

voidFavView::_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,


示例4: path

voidHEventList::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,


示例5: ContextPopUp

voidClipView::_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,


示例6: _

// SelectionChangedvoidDragSortableListView::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,


示例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,


示例8: switch

voidClipView::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,


示例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,


示例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,


示例11:

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


示例12: OnDoubleClick

void ConfigurationDialog::OnDoubleClick( wxMouseEvent& event ){    if(CurrentSelection() < 0)        return;    wxCommandEvent e;    OnEditAlarm(e);}
开发者ID:Hakansv,项目名称:watchdog_pi,代码行数:8,


示例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,


示例14: RemoveItemList

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


示例15: while

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


示例16: Looper

bool DraggableListView::InitiateDrag(BPoint point, int32 index, bool wasSelected) {	uint32 buttons = Looper()->CurrentMessage()->FindInt32("buttons");	if (buttons & B_PRIMARY_MOUSE_BUTTON) {		snooze(200000);		BPoint new_point;		uint32 buttons;		GetMouse(&new_point, &buttons);		bool drag = ((new_point != point) && (buttons & B_PRIMARY_MOUSE_BUTTON));		if (drag && list_type == addon) {			if (!wasSelected)				Select(index);			BRect drag_rect;			int32 current_item = CurrentSelection(0);			int32 item_count = CountItems();			drag_rect = ItemFrame(index);			BMessage msg(SM_DRAG_FILTER);			while (current_item < item_count) {				if (ItemAt(current_item)->IsSelected()) {					drag_rect = drag_rect | ItemFrame(current_item);					if (list_type == filter) {						msg.AddString("filter_name", ((FilterItem*)ItemAt(current_item))->Text());						msg.AddInt32("filter_id", ((FilterItem*)ItemAt(current_item))->FilterID());					} else {						msg.AddString("filter_name", ((BStringItem*)ItemAt(current_item))->Text());					}				}				current_item++;			}			DragMessage(&msg, drag_rect);			current_item = CurrentSelection(0);			return true;		} else				if (list_type == filter) {					BMessage app_msg(SM_PREFS_VIEW);					app_msg.AddInt32("filter_id", ((FilterItem*)ItemAt(index))->FilterID());					be_app_messenger.SendMessage(&app_msg, Window());				} else {					BMessage app_msg(SM_ABOUT_VIEW);					app_msg.AddString("addon_name", ((BStringItem*)ItemAt(index))->Text());					be_app_messenger.SendMessage(&app_msg, Window());				}			return false;	} else		return false;}
开发者ID:HaikuArchives,项目名称:SoundMangler,代码行数:45,


示例17: Select

voidBListView::SetListType(list_view_type type){	if (fListType == B_MULTIPLE_SELECTION_LIST &&		type == B_SINGLE_SELECTION_LIST)		Select(CurrentSelection(0));	fListType = type;}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:9,


示例18: CurrentSelection

voidAddPrinterView::Save(){	ProtocolClassItem* item = CurrentSelection();	if (item != NULL) {		fPrinterData->SetProtocolClass(item->GetProtocolClass());		fPrinterData->Save();	}}
开发者ID:looncraz,项目名称:haiku,代码行数:9,


示例19: Pulse

void ColumnListView :: Pulse(){   int32 curSel = CurrentSelection();   if (curSel >= 0)    {      CLVListItem * item = (CLVListItem *) ItemAt(curSel);      item->Pulse(this);   } }
开发者ID:mariuz,项目名称:haiku,代码行数:9,


示例20:

void LinkList2::SelectionChanged(){	LinkItem2 *item = (LinkItem2*)ItemAt(CurrentSelection());		if (item != NULL)		if ((!browse->NewLinksList(item->link)) && !(browse->m_DontUpdateURL))			// si la liste de liens est vide, on ouvre le lien du père			((MainWindow*)Window())->GoTo(item->link->link);}
开发者ID:mmadia,项目名称:behappy-svn_clone,代码行数:9,


示例21: dlg

void ConfigurationDialog::OnEditAlarm( wxCommandEvent& event ){    EditAlarmDialog dlg(this, CurrentAlarm());    if(dlg.ShowModal() == wxID_OK) {        dlg.Save();        UpdateItem(CurrentSelection());        m_bOnEditAlarmOK = true;    } else        m_bOnEditAlarmOK = false;}
开发者ID:Hakansv,项目名称:watchdog_pi,代码行数:10,


示例22: switch

void DraggableListView::KeyDown(const char* bytes, int32 numBytes) {	if (numBytes == 1) {		switch (bytes[0]) {			case B_BACKSPACE: {				if (list_type == filter) {					BMessage msg(SM_REMOVE_FILTER);					msg.AddInt32("filter_id", ((FilterItem*)ItemAt(CurrentSelection()))->FilterID());					be_app_messenger.SendMessage(&msg);					delete RemoveItem(CurrentSelection());				}				break;			}			default: {				BListView::KeyDown(bytes, numBytes);				break;			}		}	}}
开发者ID:HaikuArchives,项目名称:SoundMangler,代码行数:19,


示例23:

// RemoveSelectedvoidDragSortableListView::RemoveSelected(){//	if (fFocusedIndex >= 0)//		return;	BList items;	for (int32 i = 0; BListItem* item = ItemAt(CurrentSelection(i)); i++)		items.AddItem((void*)item);	RemoveItemList(items);}
开发者ID:DonCN,项目名称:haiku,代码行数:12,


示例24: CurrentSelection

voidAudioListView::GetSelectedItems(BList& indices){	for (int32 i = 0; true; i++) {		int32 index = CurrentSelection(i);		if (index < 0)			break;		if (!indices.AddItem((void*)(addr_t)index))			break;	}}
开发者ID:HaikuArchives,项目名称:BurnItNow,代码行数:11,


示例25: CurrentSelection

void SmartTreeListView::MouseUp(BPoint point){    int curSelection = CurrentSelection();    ColumnListView::MouseUp(point);    if (curSelection >= 0 && curSelection != lastSelection)    {        TreeItem *item = (TreeItem *) ItemAt(curSelection);        item->ItemSelected();        lastSelection = curSelection;    }}
开发者ID:HaikuArchives,项目名称:BeServed,代码行数:11,


示例26: CurrentSelection

void SmartColumnListView::KeyUp(const char *bytes, int32 numBytes){	if (*bytes == B_DELETE)	{		int index = CurrentSelection();		if (index >= 0)		{			ListItem *item = (ListItem *) ItemAt(index);			DeleteItem(index, item);		}	}}
开发者ID:HaikuArchives,项目名称:BeServed,代码行数:12,



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


C++ CurrentTime函数代码示例
C++ CurrentHostFrequency函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。