- wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap,
- const wxString& labelText = "",
- int alignText = NB_ALIGN_TEXT_BOTTOM,
- bool isFlat = TRUE,
- // this is the default type of fired events
- int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
- int marginX = 2,
- int marginY = 2,
- int textToLabelGap = 2,
- bool isSticky = FALSE
- );
-
- // use this constructor if buttons have to be persistant
-
- wxNewBitmapButton( const wxString& bitmapFileName,
- const int bitmapFileType = wxBITMAP_TYPE_BMP,
- const wxString& labelText = "",
- int alignText = NB_ALIGN_TEXT_BOTTOM,
- bool isFlat = TRUE,
- // this is the default type of fired events
- int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
- int marginX = 2,
- int marginY = 2,
- int textToLabelGap = 2,
- bool isSticky = FALSE
- );
-
- ~wxNewBitmapButton();
-
- // should be called after Create();
- virtual void Reshape();
-
- // overridables
- virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = "" );
-
- virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM,
- int marginX = 2,
- int marginY = 2,
- int textToLabelGap = 2);
-
- virtual void DrawDecorations( wxDC& dc );
- virtual void DrawLabel( wxDC& dc );
-
- virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
- bool isEnabled = TRUE,
- bool isPressed = FALSE);
-
- virtual void RenderLabelImages();
- virtual void RenderAllLabelImages();
-
- // event handlers
- void OnLButtonDown( wxMouseEvent& event );
- void OnLButtonUp( wxMouseEvent& event );
- void OnMouseMove( wxMouseEvent& event );
- void OnSize( wxSizeEvent& event );
- void OnPaint( wxPaintEvent& event );
- void OnEraseBackground( wxEraseEvent& event );
- void OnKillFocus( wxFocusEvent& event );
-
- DECLARE_EVENT_TABLE()
+ // Constructor.
+ wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap,
+ const wxString& labelText = wxT(""),
+ int alignText = NB_ALIGN_TEXT_BOTTOM,
+ bool isFlat = true,
+ // this is the default type of fired events
+ int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
+ int marginX = NB_DEFAULT_MARGIN,
+ int marginY = NB_DEFAULT_MARGIN,
+ int textToLabelGap = 2,
+ bool isSticky = false
+ );
+
+ // Use this constructor if buttons have to be persistant
+ wxNewBitmapButton( const wxString& bitmapFileName,
+ const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP,
+ const wxString& labelText = wxT(""),
+ int alignText = NB_ALIGN_TEXT_BOTTOM,
+ bool isFlat = true,
+ // this is the default type of fired events
+ int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
+ int marginX = NB_DEFAULT_MARGIN,
+ int marginY = NB_DEFAULT_MARGIN,
+ int textToLabelGap = 2,
+ bool isSticky = false
+ );
+
+ // Destructor.
+ ~wxNewBitmapButton();
+
+ // This function should be called after Create. It renders the labels, having
+ // reloaded the button image if necessary.
+ virtual void Reshape();
+
+ // Sets the label and optionally label text.
+ virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = wxT("") );
+
+ // Unhide method from parents.
+
+ virtual void SetLabel(const wxString& label)
+ { wxPanel::SetLabel(label); };
+
+ // Sets the text alignment and margins.
+ virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM,
+ int marginX = NB_DEFAULT_MARGIN,
+ int marginY = NB_DEFAULT_MARGIN,
+ int textToLabelGap = 2);
+
+ // Draws the decorations.
+ virtual void DrawDecorations( wxDC& dc );
+
+ // Draws the label.
+ virtual void DrawLabel( wxDC& dc );
+
+ // Renders the label image.
+ virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
+ bool isEnabled = true,
+ bool isPressed = false);
+
+ // Renders label images.
+ virtual void RenderLabelImages();
+
+ // Renders label images.
+ virtual void RenderAllLabelImages();
+
+ // Enables/disables button
+ virtual bool Enable(bool enable);
+
+ // Depress button
+ virtual bool Toggle(bool enable);
+
+ // Responds to a left mouse button down event.
+ void OnLButtonDown( wxMouseEvent& event );
+
+ // Responds to a left mouse button up event.
+ void OnLButtonUp( wxMouseEvent& event );
+
+ // Responds to mouse enter to window.
+ void OnMouseEnter( wxMouseEvent& event );
+
+ // Responds to mouse leave from window.
+ void OnMouseLeave( wxMouseEvent& event );
+
+ // Responds to a size event.
+ void OnSize( wxSizeEvent& event );
+
+ // Responds to a paint event.
+ void OnPaint( wxPaintEvent& event );
+
+ // Responds to an erase background event.
+ void OnEraseBackground( wxEraseEvent& event );
+
+ // Responds to a kill focus event.
+ void OnKillFocus( wxFocusEvent& event );
+
+ DECLARE_EVENT_TABLE()