using the CC2014.
I would like to add an item to the StdListBoxWidgetN.
Put the code but the item does not appear.
Below ismy source :
.fr widget
================================================
StdListBoxWidgetN
(
kMyListBoxWidgetID, // WidgetId
kSysOwnerDrawListBoxPMRsrcId,// RsrcId
kBindAll, // Frame binding
Frame(-1, 21, 389, 96) // Frame
kTrue, kTrue, // Visible, Enabled
kTrue, // fEraseBeforeDraw
kInterfacePaletteFill,// InterfaceColor to erase to
1,0, // List dimensions
19, // Cell height
1, // Border width
kFalse,kTrue, // Has scroll bar (h,v)
kFalse, // Multiselection
kFalse, // List items can be reordered
kFalse, // Draggable to new/delete buttons
kFalse, // Drag/Dropable to other windows
kFalse, // An item always has to be selected
kFalse, // Don't notify on reselect
kMyListElementResourceID // Fill list box with widgets with this ID (default is 0)
kHideRootNode | kDrawEndLine, // 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 - Not Used
0, // Horizontal Thumb Scroll Increment - Not Used
1, // Items selectable, 0 = No Selection, 1 = Single Selection, 2 = Multiple Selection
kFalse, // Allow children from multiple parents to be selected
kFalse, // Allow discontiguous selection
),
===============================================
dlgObserver
===============================================
void BscDlgDialogObserver::Update
(
const ClassID& theChange,
ISubject* theSubject,
const PMIID &protocol,
void* changedBy
)
{
CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
do
{
InterfacePtr<IPanelControlData> PanelControlData(this, UseDefaultIID());
if (PanelControlData == nil) {
break;
}
IControlView *List = PanelControlData -> FindWidget(kDCRListBoxWidgetID);
if(!List)
break;
// InterfacePtr<IStringListBoxControlData> ListData(List, UseDefaultIID());
// if(!ListData)
// break;
InterfacePtr< IListControlDataOf<PMString> > ListData (List, UseDefaultIID());
if (ListData == nil)
break;
PMString test1("TEST1");
PMString test2("TEST2");
PMString test3("TEST3");
ListData->Add(test1);
ListData->Add(test2);
ListData->Add(test3);
// InterfacePtr<IListBoxController> ListControl(ListData, UseDefaultIID());
// if(!ListControl)
// break;
// int32 SelectedRow = ListControl -> GetSelected();
// PMString MyString = (*ListData)[SelectedRow];
// MyString = PMString("Some New Data");
// ListData -> Replace(MyString, SelectedRow);
ListData -> Refresh();
} while (false);
}
===================================================