28#include <wx/statbmp.h>
35 const wxBitmapBundle& aCheckedBitmap,
36 const wxBitmapBundle& aUncheckedBitmap,
bool aChecked ) :
37 wxPanel( aParent, aId ),
38 m_checked( aChecked ),
39 m_unchecked_bitmap( aUncheckedBitmap ),
40 m_checked_bitmap( aCheckedBitmap ),
43 wxBoxSizer* sizer =
new wxBoxSizer( wxHORIZONTAL );
48 m_bitmap =
new wxStaticBitmap(
this, aId, bundle, wxDefaultPosition );
53 [&]( wxMouseEvent& event )
55 wxLongLong now = wxGetLocalTimeMillis();
64 wxCommandEvent command( TOGGLE_CHANGED );
66 command.SetEventObject(
this );
67 wxPostEvent(
this, command );
71 [&]( wxEvent& aEvent )
73 wxPostEvent(
this, aEvent );
76 m_bitmap->Bind( wxEVT_RIGHT_DOWN, passOnEvent );
77 m_bitmap->Bind( wxEVT_RIGHT_UP, passOnEvent );
wxDEFINE_EVENT(TOGGLE_CHANGED, wxCommandEvent)
wxStaticBitmap * m_bitmap
wxBitmapBundle m_unchecked_bitmap
void SetValue(bool aValue)
Read the checkbox state.
wxBitmapBundle m_checked_bitmap