Hugintrunk
0.1
|
#include <SplitButton.h>
Public Member Functions | |
SplitButton () | |
constructor More... | |
SplitButton (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &label=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=wxT("splitbutton")) | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &label=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=wxT("splitbutton")) |
for two-step creation More... | |
~SplitButton () | |
wxMenu * | GetSplitButtonMenu () |
returns a pointer to the drop down menu More... | |
bool | Enable (bool enable=true) override |
enable or disable the control More... | |
wxBitmap | GetBitmap () const |
returns the currently active bitmap More... | |
void | SetBitmap (const wxBitmap &bitmap) |
sets bitmap and direction More... | |
wxMenu * | LoadMenu (const wxString &name) |
loads the drop down menu from the XRC ressource More... | |
void | SetLabel (const wxString &label) |
set the label string More... | |
wxString | GetLabel () const |
return the label of the button More... | |
Protected Member Functions | |
void | OnKillFocus (wxFocusEvent &event) |
some event handler to mimic default mouse over behaviour More... | |
void | OnMouseLeave (wxMouseEvent &event) |
void | OnMouseEnter (wxMouseEvent &event) |
void | OnLeftButtonUp (wxMouseEvent &event) |
handle left mouse button on button and drop down button More... | |
void | OnLeftButtonDown (wxMouseEvent &event) |
void | OnPaint (wxPaintEvent &WXUNUSED(event)) |
paint handler to draw to the button More... | |
bool | HasBitmap () const |
return true if buttons has a bitmap assigned More... | |
void | UpdateMinSize () |
update the internal size calculation More... | |
Private Attributes | |
int | m_stateButton = 0 |
int | m_stateMenu = 0 |
bool | m_IsEnabled = true |
const int | m_arrowButtonWidth = 20 |
wxString | m_label |
wxMenu * | m_dropDownMenu = nullptr |
wxBitmap | m_bitmap |
Definition at line 29 of file SplitButton.h.
|
inline |
constructor
Definition at line 33 of file SplitButton.h.
|
inline |
Definition at line 34 of file SplitButton.h.
References Create().
SplitButton::~SplitButton | ( | ) |
Definition at line 58 of file SplitButton.cpp.
References m_dropDownMenu.
bool SplitButton::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxString & | label = wxEmptyString , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
const wxString & | name = wxT("splitbutton") |
||
) |
for two-step creation
Definition at line 34 of file SplitButton.cpp.
References m_dropDownMenu, m_label, OnKillFocus(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseEnter(), OnMouseLeave(), OnPaint(), and UpdateMinSize().
Referenced by SplitButton().
|
override |
enable or disable the control
Definition at line 224 of file SplitButton.cpp.
References m_IsEnabled, m_stateButton, and m_stateMenu.
Referenced by GLPreviewFrame::panoramaChanged().
wxBitmap SplitButton::GetBitmap | ( | ) | const |
returns the currently active bitmap
Definition at line 243 of file SplitButton.cpp.
References HasBitmap(), and m_bitmap.
wxString SplitButton::GetLabel | ( | ) | const |
wxMenu * SplitButton::GetSplitButtonMenu | ( | ) |
returns a pointer to the drop down menu
Definition at line 64 of file SplitButton.cpp.
References m_dropDownMenu.
Referenced by GLPreviewFrame::AddUserDefinedAssistant(), GLPreviewFrame::AddUserDefinedSequence(), and GLPreviewFrame::GLPreviewFrame().
|
protected |
return true if buttons has a bitmap assigned
Definition at line 194 of file SplitButton.cpp.
References m_bitmap.
Referenced by GetBitmap(), OnPaint(), and UpdateMinSize().
wxMenu * SplitButton::LoadMenu | ( | const wxString & | name | ) |
loads the drop down menu from the XRC ressource
Definition at line 259 of file SplitButton.cpp.
References m_dropDownMenu.
Referenced by GLPreviewFrame::GLPreviewFrame().
|
protected |
some event handler to mimic default mouse over behaviour
Definition at line 69 of file SplitButton.cpp.
References m_stateButton, and m_stateMenu.
Referenced by Create().
|
protected |
Definition at line 123 of file SplitButton.cpp.
References m_arrowButtonWidth, m_dropDownMenu, m_stateButton, and m_stateMenu.
Referenced by Create().
|
protected |
handle left mouse button on button and drop down button
Definition at line 96 of file SplitButton.cpp.
References m_arrowButtonWidth, m_stateButton, and m_stateMenu.
Referenced by Create().
|
protected |
Definition at line 87 of file SplitButton.cpp.
References m_stateButton, and m_stateMenu.
Referenced by Create().
|
protected |
Definition at line 78 of file SplitButton.cpp.
References m_stateButton, and m_stateMenu.
Referenced by Create().
|
protected |
paint handler to draw to the button
Definition at line 158 of file SplitButton.cpp.
References HasBitmap(), m_arrowButtonWidth, m_bitmap, m_IsEnabled, m_label, m_stateButton, and m_stateMenu.
Referenced by Create().
void SplitButton::SetBitmap | ( | const wxBitmap & | bitmap | ) |
sets bitmap and direction
Definition at line 252 of file SplitButton.cpp.
References m_bitmap, and UpdateMinSize().
Referenced by GLPreviewFrame::GLPreviewFrame().
void SplitButton::SetLabel | ( | const wxString & | label | ) |
set the label string
Definition at line 266 of file SplitButton.cpp.
References m_label, and UpdateMinSize().
Referenced by GLPreviewFrame::panoramaChanged().
|
protected |
update the internal size calculation
Definition at line 199 of file SplitButton.cpp.
References HasBitmap(), m_arrowButtonWidth, m_bitmap, m_label, and celeste::max().
Referenced by Create(), SetBitmap(), and SetLabel().
|
private |
Definition at line 87 of file SplitButton.h.
Referenced by OnLeftButtonDown(), OnLeftButtonUp(), OnPaint(), and UpdateMinSize().
|
private |
Definition at line 90 of file SplitButton.h.
Referenced by GetBitmap(), HasBitmap(), OnPaint(), SetBitmap(), and UpdateMinSize().
|
private |
Definition at line 89 of file SplitButton.h.
Referenced by Create(), GetSplitButtonMenu(), LoadMenu(), OnLeftButtonDown(), and ~SplitButton().
|
private |
Definition at line 86 of file SplitButton.h.
|
private |
Definition at line 88 of file SplitButton.h.
Referenced by Create(), GetLabel(), OnPaint(), SetLabel(), and UpdateMinSize().
|
private |
Definition at line 84 of file SplitButton.h.
Referenced by Enable(), OnKillFocus(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseEnter(), OnMouseLeave(), and OnPaint().
|
private |
Definition at line 85 of file SplitButton.h.
Referenced by Enable(), OnKillFocus(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseEnter(), OnMouseLeave(), and OnPaint().