本文整理汇总了C++中BListView::SetTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ BListView::SetTarget方法的具体用法?C++ BListView::SetTarget怎么用?C++ BListView::SetTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListView
的用法示例。
在下文中一共展示了BListView::SetTarget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InsertNewList
void NavigatorEditor::InsertNewList(BListView *source)
{
TRACE();
int32 selection = -1;
BaseListItem *item = NULL;
selection = source->CurrentSelection(0);
if (selection>=0)
{
item =(BaseListItem *) source->ItemAt(selection);
//vorher alle überfüssigen Views löschen
BView *sibling=source->Parent()->NextSibling();
while (sibling != NULL)
{
RemoveChild(sibling);
sibling=source->Parent()->NextSibling();
}
if (item->GetSupportedType() == P_C_CLASS_TYPE)
{
BRect listrect = Bounds();
listrect.left = source->Parent()->Frame().right+5;
listrect.right = listrect.left +400;
if (listrect.right > Bounds().right)
{
ResizeTo(listrect.right+B_V_SCROLL_BAR_WIDTH+5,Bounds().bottom);
}
BListView *list = new MessageListView(doc,listrect,((NodeItem *)item)->GetNode());
BMessage *invoked = new BMessage(N_A_INVOKATION);
invoked->AddPointer("ListView",list);
list->SetInvocationMessage(invoked);
list->SetTarget(this);
AddChild(new BScrollView("root",list,B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM,0,false,true));
}
Invalidate();
}
}
示例2: Window
// Stuff we can only do when the main view is attached to a window
void
OutputFormatView::AttachedToWindow()
{
// Get the window and lock it
the_window = Window();
the_window->Lock();
// Set some size limits on the window
the_window->SetSizeLimits(
200.0,
32767.0,
Bounds().Height() - scroll_view->Bounds().Height() + 50.0,
32767.0);
// Set the target for messages sent to this view
list_view->SetTarget(this);
the_button->SetTarget(this);
// Make the list view the keyboard focus
list_view->MakeFocus();
// Select the first item in the list,
// and make its config view show up
if (list_view->CountItems() > 0)
list_view->Select(0);
else
the_button->SetEnabled(false);
// Unlock the window
the_window->Unlock();
// Call the base class
BView::AttachedToWindow();
}