+WXWidget wxListBox::GetTopWidget() const
+{
+ return (WXWidget) XtParent( (Widget) m_mainWidget );
+}
+
+void wxListBox::ChangeBackgroundColour()
+{
+ wxWindow::ChangeBackgroundColour();
+
+ Widget parent = XtParent ((Widget) m_mainWidget);
+ Widget hsb, vsb;
+
+ XtVaGetValues (parent,
+ XmNhorizontalScrollBar, &hsb,
+ XmNverticalScrollBar, &vsb,
+ NULL);
+
+ /* TODO: should scrollbars be affected? Should probably have separate
+ * function to change them (by default, taken from wxSystemSettings)
+ */
+ wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+ wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, true);
+ wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, true);
+
+ XtVaSetValues (hsb,
+ XmNtroughColor, backgroundColour.AllocColour(XtDisplay(hsb)),
+ NULL);
+ XtVaSetValues (vsb,
+ XmNtroughColor, backgroundColour.AllocColour(XtDisplay(vsb)),
+ NULL);
+
+ // MBN: why change parent's background? It looks really ugly.
+ // wxDoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
+}
+
+void wxListBox::ChangeForegroundColour()
+{
+ wxWindow::ChangeForegroundColour();
+
+ Widget parent = XtParent ((Widget) m_mainWidget);
+ Widget hsb, vsb;
+
+ XtVaGetValues(parent,
+ XmNhorizontalScrollBar, &hsb,
+ XmNverticalScrollBar, &vsb,
+ NULL);
+
+ /* TODO: should scrollbars be affected? Should probably have separate
+ function to change them (by default, taken from wxSystemSettings)
+
+ wxDoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
+ wxDoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
+ wxDoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
+ */
+}
+
+unsigned int wxListBox::GetCount() const
+{
+ return m_noItems;
+}
+
+#define LIST_SCROLL_SPACING 6
+
+wxSize wxDoGetListBoxBestSize( Widget listWidget, const wxWindow* window )