Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SplitButton Class Reference

#include <SplitButton.h>

Inheritance diagram for SplitButton:
Inheritance graph

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
 

Detailed Description

Definition at line 29 of file SplitButton.h.

Constructor & Destructor Documentation

SplitButton::SplitButton ( )
inline

constructor

Definition at line 33 of file SplitButton.h.

SplitButton::SplitButton ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  label = wxEmptyString,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
const wxString &  name = wxT("splitbutton") 
)
inline

Definition at line 34 of file SplitButton.h.

References Create().

SplitButton::~SplitButton ( )

Definition at line 58 of file SplitButton.cpp.

References m_dropDownMenu.

Member Function Documentation

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().

bool SplitButton::Enable ( bool  enable = true)
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

return the label of the button

Definition at line 272 of file SplitButton.cpp.

References m_label.

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().

bool SplitButton::HasBitmap ( ) const
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().

void SplitButton::OnKillFocus ( wxFocusEvent &  event)
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().

void SplitButton::OnLeftButtonDown ( wxMouseEvent &  event)
protected

Definition at line 123 of file SplitButton.cpp.

References m_arrowButtonWidth, m_dropDownMenu, m_stateButton, and m_stateMenu.

Referenced by Create().

void SplitButton::OnLeftButtonUp ( wxMouseEvent &  event)
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().

void SplitButton::OnMouseEnter ( wxMouseEvent &  event)
protected

Definition at line 87 of file SplitButton.cpp.

References m_stateButton, and m_stateMenu.

Referenced by Create().

void SplitButton::OnMouseLeave ( wxMouseEvent &  event)
protected

Definition at line 78 of file SplitButton.cpp.

References m_stateButton, and m_stateMenu.

Referenced by Create().

void SplitButton::OnPaint ( wxPaintEvent &  WXUNUSEDevent)
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().

void SplitButton::UpdateMinSize ( )
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().

Member Data Documentation

const int SplitButton::m_arrowButtonWidth = 20
private

Definition at line 87 of file SplitButton.h.

Referenced by OnLeftButtonDown(), OnLeftButtonUp(), OnPaint(), and UpdateMinSize().

wxBitmap SplitButton::m_bitmap
private

Definition at line 90 of file SplitButton.h.

Referenced by GetBitmap(), HasBitmap(), OnPaint(), SetBitmap(), and UpdateMinSize().

wxMenu* SplitButton::m_dropDownMenu = nullptr
private

Definition at line 89 of file SplitButton.h.

Referenced by Create(), GetSplitButtonMenu(), LoadMenu(), OnLeftButtonDown(), and ~SplitButton().

bool SplitButton::m_IsEnabled = true
private

Definition at line 86 of file SplitButton.h.

Referenced by Enable(), and OnPaint().

wxString SplitButton::m_label
private

Definition at line 88 of file SplitButton.h.

Referenced by Create(), GetLabel(), OnPaint(), SetLabel(), and UpdateMinSize().

int SplitButton::m_stateButton = 0
private
int SplitButton::m_stateMenu = 0
private

The documentation for this class was generated from the following files: