本文整理汇总了C++中BListView::InvocationCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ BListView::InvocationCommand方法的具体用法?C++ BListView::InvocationCommand怎么用?C++ BListView::InvocationCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListView
的用法示例。
在下文中一共展示了BListView::InvocationCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: str
status_t
PListView::GetProperty(const char *name, PValue *value, const int32 &index) const
{
if (!name || !value)
return B_ERROR;
BString str(name);
PProperty *prop = FindProperty(name,index);
if (!prop)
return B_NAME_NOT_FOUND;
BListView *backend = (BListView*)fView;
if (backend->Window())
backend->Window()->Lock();
if (str.ICompare("PreferredWidth") == 0)
{
if (backend->CountItems() == 0)
((FloatProperty*)prop)->SetValue(100);
else
{
float pw, ph;
backend->GetPreferredSize(&pw, &ph);
if (pw < 10)
pw = 100;
if (ph < 10)
ph = 30;
((FloatProperty*)prop)->SetValue(pw);
}
}
else if (str.ICompare("ItemCount") == 0)
((IntProperty*)prop)->SetValue(backend->CountItems());
else if (str.ICompare("SelectionMessage") == 0)
((IntProperty*)prop)->SetValue(backend->SelectionCommand());
else if (str.ICompare("PreferredHeight") == 0)
{
if (backend->CountItems() == 0)
((FloatProperty*)prop)->SetValue(30);
else
{
float pw, ph;
backend->GetPreferredSize(&pw, &ph);
if (pw < 10)
pw = 100;
if (ph < 10)
ph = 30;
((FloatProperty*)prop)->SetValue(ph);
}
}
else if (str.ICompare("InvocationMessage") == 0)
((IntProperty*)prop)->SetValue(backend->InvocationCommand());
else if (str.ICompare("SelectionType") == 0)
((EnumProperty*)prop)->SetValue(backend->ListType());
else
{
if (backend->Window())
backend->Window()->Unlock();
return PView::GetProperty(name, value, index);
}
if (backend->Window())
backend->Window()->Unlock();
return prop->GetValue(value);
}