X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49dc8caac934c29f69aed750a412eb60aad84b67..8af27d1dee477e3e52aa60d73b19d46f531374b7:/src/os2/listbox.cpp?ds=sidebyside diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 04dffe2b68..df1b7cc473 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -142,6 +142,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 @@ -170,6 +179,29 @@ bool wxListBox::Create( Append(asChoices[lUi]); } SetFont(pParent->GetFont()); + + // + // 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 +224,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