21#include <wx/odcombo.h>
22#include <wx/textctrl.h>
25 const wxPoint& pos,
const wxSize& size,
int n,
26 const wxString choices[],
long style,
28 wxBitmapComboBox( parent, id, value, pos, size, n, choices, style,
validator,
name )
34void WX_BITMAP_COMBOBOX::DoShowPopup(
const wxRect& aRect,
int aFlags )
36 wxBitmapComboBox::DoShowPopup( aRect, aFlags );
37 holdPopupMouseCapture();
41void WX_BITMAP_COMBOBOX::holdPopupMouseCapture()
43 wxComboPopup* popup = GetPopupControl();
44 wxWindow* list = popup ? popup->GetControl() :
nullptr;
45 wxWindow* popupWindow = GetPopupWindow();
47 if( !list || !popupWindow || popupWindow == m_hookedPopupWindow )
50 m_hookedPopupWindow = popupWindow;
53 popupWindow->Bind( wxEVT_IDLE,
54 [list]( wxIdleEvent& )
58 if( list->IsShownOnScreen() && !wxWindow::GetCapture() )
67 wxSize size = wxBitmapComboBox::DoGetBestSize();
70 wxSize bmpSize = GetBitmapSize();
80 int overhead = size.y - GetCharHeight();
81 size.y = std::max( size.y, bmpSize.y + overhead + 4 );
89 size.x += bmpSize.x + 4;
92#if !wxCHECK_VERSION( 3, 2, 9 )
95 wxTextCtrl dummyCtrl( m_parent, wxID_ANY );
98 size.y = std::max( size.y, dummyCtrl.GetBestHeight( dummyWidth ) + 4 );
wxSize DoGetBestSize() const override
WX_BITMAP_COMBOBOX(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxASCII_STR(wxBitmapComboBoxNameStr))
JSON_SCHEMA_VALIDATOR validator(schema)