KiCad PCB EDA Suite
|
Fix some issues with wxCombobox: More...
#include <wx_combobox.h>
Public Member Functions | |
WX_COMBOBOX (wxWindow *aParent, int aId=wxID_ANY, const wxString &aValue=wxEmptyString, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, int n=0, const wxString choices[]=nullptr, long style=0) | |
virtual | ~WX_COMBOBOX () |
void | Append (const wxString &aText, const wxString &aMenuText=wxEmptyString) |
int | GetCharHeight () const override |
Protected Member Functions | |
virtual void | DoSetPopupControl (wxComboPopup *aPopup) override |
virtual void | OnDrawItem (wxDC &aDC, const wxRect &aRect, int aItem, int aFlags) const override |
virtual wxCoord | OnMeasureItem (size_t aItem) const override |
virtual wxCoord | OnMeasureItemWidth (size_t aItem) const override |
void | TryVetoMouse (wxMouseEvent &aEvent) |
Veto a mouseover event if in the separator. | |
void | TryVetoSelect (wxCommandEvent &aEvent, bool aInner) |
Veto a select event for the separator. | |
wxString | GetMenuText (int aItem) const |
Safely get a string for an item, returning wxEmptyString if the item doesn't exist. | |
int | GetSelectionEither (bool aInner) const |
Get selection from either the outer (combo box) or inner (popup) list. | |
void | SetSelectionEither (bool aInner, int aSel) |
Safely set selection for either the outer (combo box) or inner (popup) list, doing nothing for invalid selections. | |
Private Attributes | |
std::map< int, wxString > | m_menuText |
int | m_lastSelection |
Fix some issues with wxCombobox:
Definition at line 32 of file wx_combobox.h.
WX_COMBOBOX::WX_COMBOBOX | ( | wxWindow * | aParent, |
int | aId = wxID_ANY , |
||
const wxString & | aValue = wxEmptyString , |
||
const wxPoint & | aPos = wxDefaultPosition , |
||
const wxSize & | aSize = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = nullptr , |
||
long | style = 0 |
||
) |
Definition at line 30 of file wx_combobox.cpp.
|
virtual |
Definition at line 38 of file wx_combobox.cpp.
void WX_COMBOBOX::Append | ( | const wxString & | aText, |
const wxString & | aMenuText = wxEmptyString |
||
) |
Definition at line 147 of file wx_combobox.cpp.
References m_menuText.
Referenced by DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES().
|
overrideprotectedvirtual |
Definition at line 43 of file wx_combobox.cpp.
References TryVetoMouse(), and TryVetoSelect().
|
override |
Definition at line 93 of file wx_combobox.cpp.
|
protected |
Safely get a string for an item, returning wxEmptyString if the item doesn't exist.
Definition at line 156 of file wx_combobox.cpp.
References m_menuText.
Referenced by OnDrawItem(), OnMeasureItem(), OnMeasureItemWidth(), TryVetoMouse(), and TryVetoSelect().
|
protected |
Get selection from either the outer (combo box) or inner (popup) list.
Definition at line 167 of file wx_combobox.cpp.
Referenced by TryVetoSelect().
|
overrideprotectedvirtual |
Definition at line 61 of file wx_combobox.cpp.
References GetMenuText(), SEPARATOR, and text.
|
overrideprotectedvirtual |
Definition at line 99 of file wx_combobox.cpp.
References GetMenuText(), and SEPARATOR.
|
overrideprotectedvirtual |
Definition at line 108 of file wx_combobox.cpp.
References GetMenuText(), and SEPARATOR.
|
protected |
Safely set selection for either the outer (combo box) or inner (popup) list, doing nothing for invalid selections.
Definition at line 176 of file wx_combobox.cpp.
Referenced by TryVetoSelect().
|
protected |
Veto a mouseover event if in the separator.
Definition at line 117 of file wx_combobox.cpp.
References GetMenuText(), and SEPARATOR.
Referenced by DoSetPopupControl().
|
protected |
Veto a select event for the separator.
aEvent | - the wxCommandEvent caller |
aInner | - true if event was called for the inner list (ie the popup) |
Definition at line 126 of file wx_combobox.cpp.
References GetMenuText(), GetSelectionEither(), m_lastSelection, SEPARATOR, SetSelectionEither(), and text.
Referenced by DoSetPopupControl().
|
private |
Definition at line 80 of file wx_combobox.h.
Referenced by TryVetoSelect().
|
private |
Definition at line 79 of file wx_combobox.h.
Referenced by Append(), and GetMenuText().