Create a Listbox in Dialog
I want to create a simple Listbox in a dialog and populate it with some dynamic strings. I placed a Treeview in dialog using this code in fr-file:
TreeViewWidget
(
myListID, // fWidgetId
kSysStaticTextPMRsrcId, // fRsrcId, fRsrcPlugin
kBindNone,
Frame( 10, 10, 280, 200 ),
kTrue, // fVisible
kTrue, // fEnabled
kTrue, // fEraseBeforeDraw
kInterfacePaletteFill, // InterfaceColor to erase to
"", // control label
kFalse, // Display Root Node
kFalse, // Use H scroll bar
kTrue, // Use V scroll bar
20, // Vertical Scroll Button increment
20, // Vertical Thumb Scroll increment
0, // Horizontal Scroll Button increment
0, // Horizontal Thumb Scroll increment
1, // Items selectable, 0 = No Selection, 1 = Single Selection, 2 = Multiple Selection
kTrue, // Allow children from multiple parents to be selected
kTrue, // Allow discontiguous selection
{
}
)
In my dialog i see the list box containing entries 0-9. How can i remove these entries and add my own strings? In PanelTreeView and other samples i cant find a solution.
In DialogController::InitializeDialogFields I tried to init the list like this without effect:
IControlView* treeView = pPanelData->FindWidget( myListID );
InterfacePtr<ITreeViewMgr> iTreeMgr(treeView, UseDefaultIID();
iTreeMgr->ClearTree(kTrue);
Is treeview in cs6 the only possiblity for creating a listbox with selectable entries? A Dropdownlist is no option because user must see multipe entries after opening dialog.