X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..222702b112dcc7bebe018d6f4d66fe469fefd02c:/src/os2/listbox.cpp diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 5b80d03fc2..dacc04c2b6 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -6,7 +6,7 @@ // Created: 10/09/99 // RCS-ID: $Id$ // Copyright: (c) David Webster -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -49,14 +49,14 @@ class wxListBoxItem : public wxOwnerDrawn { public: - wxListBoxItem(const wxString& rsStr = ""); + wxListBoxItem(const wxString& rsStr = wxEmptyString); }; wxListBoxItem::wxListBoxItem( const wxString& rsStr ) : wxOwnerDrawn( rsStr - ,FALSE + ,false ) { // @@ -128,7 +128,7 @@ bool wxListBox::Create( wxSystemSettings vSettings; - SetBackgroundColour(vSettings.GetSystemColour(wxSYS_COLOUR_WINDOW)); + SetBackgroundColour(vSettings.GetColour(wxSYS_COLOUR_WINDOW)); SetForegroundColour(pParent->GetForegroundColour()); m_windowId = (vId == -1) ? (int)NewControlId() : vId; @@ -172,7 +172,7 @@ bool wxListBox::Create( ); if (m_hWnd == 0) { - return FALSE; + return false; } // @@ -198,7 +198,7 @@ bool wxListBox::Create( // wxColour vColour; - vColour.Set(wxString("WHITE")); + vColour.Set(wxString(wxT("WHITE"))); LONG lColor = (LONG)vColour.GetPixel(); @@ -207,7 +207,7 @@ bool wxListBox::Create( ,sizeof(LONG) ,(PVOID)&lColor ); - vColour.Set(wxString("NAVY")); + vColour.Set(wxString(wxT("NAVY"))); lColor = (LONG)vColour.GetPixel(); ::WinSetPresParam( m_hWnd ,PP_HILITEBACKGROUNDCOLOR @@ -221,7 +221,7 @@ bool wxListBox::Create( ,nHeight ); delete pTextFont; - return TRUE; + return true; } // end of wxListBox::Create wxListBox::~wxListBox() @@ -380,7 +380,7 @@ int wxListBox::FindString( 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 == (char*)zStr) + if (rsString == (wxChar*)zStr) { delete [] zStr; break; @@ -415,7 +415,7 @@ void wxListBox::Clear() m_nNumItems = 0; } // end of wxListBox::Clear -void wxListBox::SetSelection( +void wxListBox::DoSetSelection( int N , bool bSelect ) @@ -435,7 +435,7 @@ bool wxListBox::IsSelected( int N ) const { - wxCHECK_MSG( N >= 0 && N < m_nNumItems, FALSE, + wxCHECK_MSG( N >= 0 && N < m_nNumItems, false, wxT("invalid index in wxListBox::Selected") ); LONG lItem; @@ -593,14 +593,14 @@ wxString wxListBox::GetString( ) const { LONG lLen = 0; - char* zBuf; + wxChar* zBuf; wxString sResult; - wxCHECK_MSG( N >= 0 && N < m_nNumItems, "", + wxCHECK_MSG( N >= 0 && N < m_nNumItems, wxEmptyString, wxT("invalid index in wxListBox::GetClientData") ); lLen = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)N, (MPARAM)0)); - zBuf = new char[lLen + 1]; + zBuf = new wxChar[lLen + 1]; ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)N, (SHORT)lLen), (MPARAM)zBuf); zBuf[lLen] = '\0'; sResult = zBuf; @@ -725,6 +725,7 @@ wxSize wxListBox::DoGetBestSize() const int nListbox = 0; int nCx; int nCy; + wxFont vFont = (wxFont)GetFont(); for (int i = 0; i < m_nNumItems; i++) { @@ -751,7 +752,7 @@ wxSize wxListBox::DoGetBestSize() const wxGetCharSize( GetHWND() ,&nCx ,&nCy - ,(wxFont*)&GetFont() + ,&vFont ); nListbox += 3 * nCx; @@ -785,7 +786,7 @@ bool wxListBox::OS2Command( // // Some event we're not interested in // - return FALSE; + return false; } wxCommandEvent vEvent( eEvtType ,m_windowId @@ -810,7 +811,7 @@ bool wxListBox::OS2Command( { n = -1; } - vEvent.m_commandInt = n; + vEvent.SetInt(n); return GetEventHandler()->ProcessEvent(vEvent); } // end of wxListBox::OS2Command @@ -873,14 +874,14 @@ bool wxListBox::OS2OnDraw ( // // Only owner-drawn control should receive this message // - wxCHECK(((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE); + wxCHECK(((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false); // // The item may be -1 for an empty listbox // if (lItemID == -1L) - return FALSE; + return false; wxListBoxItem* pData = (wxListBoxItem*)PVOIDFROMMR( ::WinSendMsg( GetHwnd() ,LM_QUERYITEMHANDLE @@ -889,7 +890,7 @@ bool wxListBox::OS2OnDraw ( ) ); - wxCHECK(pData, FALSE ); + wxCHECK(pData, false ); wxDC vDc; wxRect vRect( wxPoint( pDrawStruct->rclItem.xLeft @@ -962,7 +963,7 @@ bool wxListBox::OS2OnDraw ( // For now we don't care about anything else // just ignore the entire message! // - return TRUE; + return true; } } return pData->OnDrawItem( vDc