X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dcd307ee1f13834bdfe43a0964db657bcd860142..acc0ebd7a871124d4d6b36069340227e6c584f38:/src/os2/listbox.cpp diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index a6909e537f..83a4d9e826 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -30,13 +30,13 @@ #include "wx/dynarray.h" #include "wx/log.h" +#if wxUSE_LISTBOX + #if wxUSE_OWNER_DRAWN #include "wx/ownerdrw.h" #endif -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) -#endif // ============================================================================ // list box item declaration and implementation @@ -80,7 +80,9 @@ bool wxListBox::Create(wxWindow *parent, const wxSize& size, int n, const wxString choices[], long style, +#if wxUSE_VALIDATORS const wxValidator& validator, +#endif const wxString& name) { m_noItems = 0; @@ -88,7 +90,9 @@ bool wxListBox::Create(wxWindow *parent, m_selected = 0; SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif if (parent) parent->AddChild(this); @@ -205,7 +209,7 @@ void wxListBox::Delete(int N) #if wxUSE_OWNER_DRAWN delete m_aItems[N]; - m_aItems.Remove(N); + m_aItems.RemoveAt(N); #else // !wxUSE_OWNER_DRAWN if ( HasClientObjectData() ) { @@ -498,9 +502,9 @@ void wxListBox::SetString(int N, const wxString& s) void *oldData = NULL; wxClientData *oldObjData = NULL; - if ( m_clientDataItemsType == ClientData_Void ) + if ( m_clientDataItemsType == wxClientData_Void ) oldData = GetClientData(N); - else if ( m_clientDataItemsType == ClientData_Object ) + else if ( m_clientDataItemsType == wxClientData_Object ) oldObjData = GetClientObject(N); // TODO: /* @@ -602,7 +606,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s) */ } -wxSize wxListBox::DoGetBestSize() +wxSize wxListBox::DoGetBestSize() const { // find the widest string int wLine; @@ -622,7 +626,7 @@ wxSize wxListBox::DoGetBestSize() // the listbox should be slightly larger than the widest string int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, (wxFont*)&GetFont()); wListbox += 3*cx; @@ -701,7 +705,7 @@ WXHBRUSH wxListBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, backgroundBrush->RealizeResource(); return (WXHBRUSH) backgroundBrush->GetResourceHandle(); */ - reutrn (WXBRUSH)0; + return (WXHBRUSH)0; } // ---------------------------------------------------------------------------- @@ -772,3 +776,5 @@ bool wxListBox::OS2OnDraw(WXDRAWITEMSTRUCT *item) } #endif // wxUSE_OWNER_DRAWN + +#endif //wxUSE_LISTBOX