]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/listbox.cpp
wxFileCtrl::Update was hiding wxWindow::Update
[wxWidgets.git] / src / os2 / listbox.cpp
index 04dffe2b68b7098a2536f649adc17f01fefab98a..f99ec829ec8f1908f5d3fc98a43a3b01fc258694 100644 (file)
@@ -22,6 +22,7 @@
 #include "wx/font.h"
 #include "wx/dc.h"
 #include "wx/utils.h"
+#include "wx/scrolwin.h"
 #endif
 
 #define INCL_M
@@ -142,6 +143,15 @@ bool wxListBox::Create(
     //
     lStyle |= LS_NOADJUSTPOS;
 
+    //
+    // If the parent is a scrolled window the controls must
+    // have this style or they will overlap the scrollbars
+    //
+    if (pParent)
+        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+            lStyle |= WS_CLIPSIBLINGS;
+
     m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) // Parent
                                        ,WC_LISTBOX          // Default Listbox class
                                        ,"LISTBOX"           // Control's name
@@ -169,7 +179,30 @@ bool wxListBox::Create(
     {
         Append(asChoices[lUi]);
     }
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
+
+    //
+    // Set standard wxWindows colors for Listbox items and highlighting
+    //
+    wxColour                        vColour;
+
+    vColour.Set(wxString("WHITE"));
+
+    LONG                            lColor = (LONG)vColour.GetPixel();
+
+    ::WinSetPresParam( m_hWnd
+                      ,PP_HILITEFOREGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    vColour.Set(wxString("NAVY"));
+    lColor = (LONG)vColour.GetPixel();
+    ::WinSetPresParam( m_hWnd
+                      ,PP_HILITEBACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+
     SetSize( nX
             ,nY
             ,nWidth
@@ -192,7 +225,7 @@ wxListBox::~wxListBox()
 
 void wxListBox::SetupColours()
 {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
     SetForegroundColour(GetParent()->GetForegroundColour());
 } // end of wxListBox::SetupColours