X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..03575f9bd31b449fbe2000f3f31cf2e97e39d6a8:/src/os2/listbox.cpp diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index ec5c2588ed..d5e6bc01fa 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp +// Name: src/os2/listbox.cpp // Purpose: wxListBox // Author: David Webster // Modified by: @@ -192,11 +192,11 @@ bool wxListBox::Create( SetFont(*pTextFont); // - // Set standard wxWidgets colors for Listbox items and highlighting + // Set OS/2 system colours for Listbox items and highlighting // wxColour vColour; - vColour.Set(wxString(wxT("WHITE"))); + vColour = wxSystemSettingsNative::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); LONG lColor = (LONG)vColour.GetPixel(); @@ -205,7 +205,7 @@ bool wxListBox::Create( ,sizeof(LONG) ,(PVOID)&lColor ); - vColour.Set(wxString(wxT("NAVY"))); + vColour = wxSystemSettingsNative::GetColour(wxSYS_COLOUR_HIGHLIGHT); lColor = (LONG)vColour.GetPixel(); ::WinSetPresParam( m_hWnd ,PP_HILITEBACKGROUNDCOLOR @@ -213,6 +213,8 @@ bool wxListBox::Create( ,(PVOID)&lColor ); + SetXComp(0); + SetYComp(0); SetSize( nX ,nY ,nWidth @@ -364,30 +366,6 @@ void wxListBox::DoSetItems( ::WinShowWindow(GetHwnd(), TRUE); } // end of wxListBox::DoSetItems -int wxListBox::FindString( - const wxString& rsString -) const -{ - int nPos; - LONG lTextLength; - PSZ zStr; - - - for (nPos = 0; nPos < m_nNumItems; nPos++) - { - lTextLength = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0)); - zStr = new char[lTextLength + 1]; - ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT(nPos, (SHORT)lTextLength), (MPARAM)zStr); - if (rsString == (wxChar*)zStr) - { - delete [] zStr; - break; - } - delete [] zStr; - } - return nPos; -} // end of wxListBox::FindString - void wxListBox::Clear() { #if wxUSE_OWNER_DRAWN @@ -772,7 +750,7 @@ bool wxListBox::OS2Command( { eEvtType = wxEVT_COMMAND_LISTBOX_SELECTED; } - if (uParam == LN_ENTER) + else if (uParam == LN_ENTER) { eEvtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED; }