本文整理汇总了C++中BListView::DeselectAll方法的典型用法代码示例。如果您正苦于以下问题:C++ BListView::DeselectAll方法的具体用法?C++ BListView::DeselectAll怎么用?C++ BListView::DeselectAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListView
的用法示例。
在下文中一共展示了BListView::DeselectAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSelectedItem
/**
* @brief Makes specified item selected.
* @param[in] index item index. if this is -1, no item is selected.
*/
void BeListViewAdapter::SetSelectedItem(SInt32 index)
{
BListView* listView = getListView();
int32 current = listView->CurrentSelection(0);
if (current != index)
{
listView->DeselectAll();
listView->Select(index);
}
}
示例2:
int32_t
PListViewDeselectAll(void *pobject, void *in, void *out, void *extraData)
{
if (!pobject || !in || !out)
return B_ERROR;
PView *parent = static_cast<PView*>(pobject);
if (!parent)
return B_BAD_TYPE;
BListView *backend = (BListView*)parent->GetView();
if (backend->Window())
backend->Window()->Lock();
backend->DeselectAll();
if (backend->Window())
backend->Window()->Unlock();
return B_OK;
}
示例3: directory
void
KeymapWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case B_SIMPLE_DATA:
case B_REFS_RECEIVED:
{
entry_ref ref;
int32 i = 0;
while (message->FindRef("refs", i++, &ref) == B_OK) {
fCurrentMap.Load(ref);
fAppliedMap = fCurrentMap;
}
fKeyboardLayoutView->SetKeymap(&fCurrentMap);
fSystemListView->DeselectAll();
fUserListView->DeselectAll();
break;
}
case B_SAVE_REQUESTED:
{
entry_ref ref;
const char *name;
if (message->FindRef("directory", &ref) == B_OK
&& message->FindString("name", &name) == B_OK) {
BDirectory directory(&ref);
BEntry entry(&directory, name);
entry.GetRef(&ref);
fCurrentMap.SetName(name);
fCurrentMap.Save(ref);
fAppliedMap = fCurrentMap;
_FillUserMaps();
fCurrentMapName = name;
_SelectCurrentMap();
}
break;
}
case kMsgMenuFileOpen:
fOpenPanel->Show();
break;
case kMsgMenuFileSaveAs:
fSavePanel->Show();
break;
case kChangeKeyboardLayout:
{
entry_ref ref;
BPath path;
if (message->FindRef("ref", &ref) == B_OK)
path.SetTo(&ref);
_SetKeyboardLayout(path.Path());
break;
}
case kMsgSwitchShortcuts:
_SwitchShortcutKeys();
break;
case kMsgMenuFontChanged:
{
BMenuItem *item = fFontMenu->FindMarked();
if (item != NULL) {
BFont font;
font.SetFamilyAndStyle(item->Label(), NULL);
fKeyboardLayoutView->SetFont(font);
fTextControl->TextView()->SetFontAndColor(&font);
}
break;
}
case kMsgSystemMapSelected:
case kMsgUserMapSelected:
{
BListView* listView;
BListView* otherListView;
if (message->what == kMsgSystemMapSelected) {
listView = fSystemListView;
otherListView = fUserListView;
} else {
listView = fUserListView;
otherListView = fSystemListView;
}
int32 index = listView->CurrentSelection();
if (index < 0)
break;
// Deselect item in other BListView
otherListView->DeselectAll();
if (index == 0 && listView == fUserListView) {
// we can safely ignore the "(Current)" item
break;
}
KeymapListItem* item
= static_cast<KeymapListItem*>(listView->ItemAt(index));
//.........这里部分代码省略.........
示例4: directory
void
KeymapWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case B_SIMPLE_DATA:
case B_REFS_RECEIVED:
{
entry_ref ref;
int32 i = 0;
while (message->FindRef("refs", i++, &ref) == B_OK) {
fCurrentMap.Load(ref);
fAppliedMap = fCurrentMap;
}
fKeyboardLayoutView->SetKeymap(&fCurrentMap);
fSystemListView->DeselectAll();
fUserListView->DeselectAll();
break;
}
case B_SAVE_REQUESTED:
{
entry_ref ref;
const char* name;
if (message->FindRef("directory", &ref) == B_OK
&& message->FindString("name", &name) == B_OK) {
BDirectory directory(&ref);
BEntry entry(&directory, name);
entry.GetRef(&ref);
fCurrentMap.SetName(name);
fCurrentMap.Save(ref);
fAppliedMap = fCurrentMap;
_FillUserMaps();
fCurrentMapName = name;
_SelectCurrentMap();
}
break;
}
case kMsgMenuFileOpen:
fOpenPanel->Show();
break;
case kMsgMenuFileSaveAs:
fSavePanel->Show();
break;
case kMsgShowModifierKeysWindow:
be_app->PostMessage(kMsgShowModifierKeysWindow);
break;
case kChangeKeyboardLayout:
{
entry_ref ref;
BPath path;
if (message->FindRef("ref", &ref) == B_OK)
path.SetTo(&ref);
_SetKeyboardLayout(path.Path());
break;
}
case kMsgSwitchShortcuts:
_SwitchShortcutKeys();
break;
case kMsgMenuFontChanged:
{
BMenuItem* item = fFontMenu->FindMarked();
if (item != NULL) {
BFont font;
font.SetFamilyAndStyle(item->Label(), NULL);
fKeyboardLayoutView->SetBaseFont(font);
fTextControl->TextView()->SetFontAndColor(&font);
}
break;
}
case kMsgSystemMapSelected:
case kMsgUserMapSelected:
{
BListView* listView;
BListView* otherListView;
if (message->what == kMsgSystemMapSelected) {
listView = fSystemListView;
otherListView = fUserListView;
} else {
listView = fUserListView;
otherListView = fSystemListView;
}
int32 index = listView->CurrentSelection();
if (index < 0)
break;
// Deselect item in other BListView
otherListView->DeselectAll();
if (index == 0 && listView == fUserListView) {
// we can safely ignore the "(Current)" item
break;
}
//.........这里部分代码省略.........