+ m_windowStyle = style;
+ m_noItems = n;
+ // m_backgroundColour = parent->GetBackgroundColour();
+ m_backgroundColour = * wxWHITE;
+ m_foregroundColour = parent->GetForegroundColour();
+
+ SetName(name);
+ SetValidator(validator);
+
+ if (parent) parent->AddChild(this);
+
+ m_windowId = ( id == -1 ) ? (int)NewControlId() : id;
+
+ Widget parentWidget = (Widget) parent->GetClientWidget();
+
+ Arg args[3];
+ int count;
+ XtSetArg (args[0], XmNlistSizePolicy, XmCONSTANT);
+ if (m_windowStyle & wxLB_MULTIPLE)
+ XtSetArg (args[1], XmNselectionPolicy, XmMULTIPLE_SELECT);
+ else if (m_windowStyle & wxLB_EXTENDED)
+ XtSetArg (args[1], XmNselectionPolicy, XmEXTENDED_SELECT);
+ else
+ XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
+ if (m_windowStyle & wxLB_ALWAYS_SB)
+ {
+ XtSetArg (args[2], XmNscrollBarDisplayPolicy, XmSTATIC);
+ count = 3;
+ }
+ else
+ count = 2;
+
+ Widget listWidget = XmCreateScrolledList(parentWidget,
+ (char*)name.c_str(), args, count);
+
+ m_mainWidget = (WXWidget) listWidget;
+
+ Set(n, choices);
+
+ XtManageChild (listWidget);
+
+ long width = size.x;
+ long height = size.y;
+ if (width == -1)
+ width = 150;
+ if (height == -1)
+ height = 80;
+
+ XtAddCallback (listWidget,
+ XmNbrowseSelectionCallback,
+ (XtCallbackProc) wxListBoxCallback,
+ (XtPointer) this);
+ XtAddCallback (listWidget,
+ XmNextendedSelectionCallback,
+ (XtCallbackProc) wxListBoxCallback,
+ (XtPointer) this);
+ XtAddCallback (listWidget,
+ XmNmultipleSelectionCallback,
+ (XtCallbackProc) wxListBoxCallback,
+ (XtPointer) this);
+ XtAddCallback (listWidget,
+ XmNdefaultActionCallback,
+ (XtCallbackProc) wxListBoxCallback,
+ (XtPointer) this);
+
+ m_font = parent->GetFont();
+ ChangeFont(FALSE);
+
+ SetCanAddEventHandler(TRUE);
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, width, height);
+
+ ChangeBackgroundColour();
+
+ return TRUE;