本文整理汇总了C++中DataList::AddItem方法的典型用法代码示例。如果您正苦于以下问题:C++ DataList::AddItem方法的具体用法?C++ DataList::AddItem怎么用?C++ DataList::AddItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataList
的用法示例。
在下文中一共展示了DataList::AddItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
break;
case SPECIFIC_COLOR_TEXTVIEW:
{
float leftOffset;
float baseline;
float width;
float height;
if (!StringBoundsBox( myPrefs->TextGadgetLabel,
&width,
&height,
&leftOffset,
&baseline))
{
throw;
}
MyTextView * pholdTextView = new MyTextView( "textView",
NULL,
width,
6 * height,//allow 6 lines visible
pholdDemoLayoutMatrix);
rgb_color textColor;
myPrefs->GetPreferredMyTextViewHighColor(&textColor);
pholdTextView->SetFontAndColor(myPrefs->GetPreferredFont(), B_FONT_ALL, &textColor);
pholdTextView->SetText(myPrefs->TextGadgetLabel);
kindDemo = KIND_MYTEXTVIEW;
pholdDemo = (void *)pholdTextView;
}
break;
case SPECIFIC_COLOR_LISTVIEW:
{
DataList * dataList = new DataList();
DataNode * nodeOne = new DataNode(myPrefs->ListViewSample1);
dataList->AddItem(nodeOne);
DataNode * nodeTwo = new DataNode(myPrefs->ListViewSample2);
dataList->AddItem(nodeTwo);
DataNode * nodeThree = new DataNode(myPrefs->ListViewSample3);
dataList->AddItem(nodeThree);
MyListView * mlv = new MyListView( "mlvTitle",
dataList,
'selc',
'invc',
B_SINGLE_SELECTION_LIST,
pholdDemoLayoutMatrix);
kindDemo = KIND_MYLISTVIEW;
pholdDemo = (void *)mlv;
}
break;
case SPECIFIC_COLOR_INT8GADGET:
{
Int8Gadget * pholdInt8Gadget = new Int8Gadget( MIN_I8,
"int8Gadget",
myPrefs->GetInt8GadgetLabel,
0,
this,
pholdDemoLayoutMatrix);
kindDemo = KIND_INT8GADGET;
pholdDemo = (void *)pholdInt8Gadget;
BMessageFilter * bmfDemo = new BMessageFilter( B_PROGRAMMED_DELIVERY,
B_LOCAL_SOURCE,
'_KYD',
filterIntNumeric);
pholdInt8Gadget->AddFilter(bmfDemo);
}
break;
case SPECIFIC_COLOR_UINT8GADGET: