X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a57d600f1aa4bae88f4c9b8d89a35332c412939e..db60c20db8321d7fb0604e33fe7288ddb38c496e:/src/msw/combo.cpp diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 92711ac9d6..c51a4bc77e 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combo.cpp +// Name: src/msw/combo.cpp // Purpose: wxMSW wxComboCtrl // Author: Jaakko Salli // Modified by: @@ -119,13 +119,13 @@ bool wxComboCtrl::Create(wxWindow *parent, // create main window if ( !wxComboCtrlBase::Create(parent, - id, - value, - wxDefaultPosition, - wxDefaultSize, - style | wxFULL_REPAINT_ON_RESIZE, - wxDefaultValidator, - name) ) + id, + value, + pos, + size, + style | wxFULL_REPAINT_ON_RESIZE, + wxDefaultValidator, + name) ) return false; if ( style & wxCC_STD_BUTTON ) @@ -140,8 +140,8 @@ bool wxComboCtrl::Create(wxWindow *parent, // Prepare background for double-buffering SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - // SetSize should be called last - SetSize(pos.x,pos.y,size.x,size.y); + // SetBestSize should be called last + SetBestSize(size); return true; } @@ -239,9 +239,12 @@ static void wxMSWDrawFocusRect( wxDC& dc, const wxRect& rect ) } // draw focus background on area in a way typical on platform -void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) +void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) const { wxUxThemeEngine* theme = (wxUxThemeEngine*) NULL; + + // Constructor only calls GetHWND() const, so it should be safe + // to cast "this" to const. wxUxThemeHandle hTheme(this, L"COMBOBOX"); //COLORREF cref; @@ -448,7 +451,7 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) &r); drawButBg = false; - } + } // Standard button rendering DrawButton(dc,rectb,drawButBg);