Contents Up Previous Next

wxNewBitmapButton

This is an alternative class to wxBitmapButton. It is used in the implementation of dynamic toolbars.

Derived from

wxPanel

Include files

<wx/fl/newbmpbtn.h>

Data structures

Members

wxNewBitmapButton::wxNewBitmapButton
wxNewBitmapButton::~wxNewBitmapButton
wxNewBitmapButton::DestroyLabels
wxNewBitmapButton::DrawDecorations
wxNewBitmapButton::DrawLabel
wxNewBitmapButton::DrawShade
wxNewBitmapButton::GetStateLabel
wxNewBitmapButton::IsInWindow
wxNewBitmapButton::OnEraseBackground
wxNewBitmapButton::OnKillFocus
wxNewBitmapButton::OnLButtonDown
wxNewBitmapButton::OnLButtonUp
wxNewBitmapButton::OnMouseMove
wxNewBitmapButton::OnPaint
wxNewBitmapButton::OnSize
wxNewBitmapButton::RenderAllLabelImages
wxNewBitmapButton::RenderLabelImage
wxNewBitmapButton::RenderLabelImages
wxNewBitmapButton::Reshape
wxNewBitmapButton::SetAlignments
wxNewBitmapButton::SetLabel


wxNewBitmapButton::wxNewBitmapButton

wxNewBitmapButton(const wxBitmap& labelBitmap = wxNullBitmap, const wxString& labelText = "", int alignText = NB_ALIGN_TEXT_BOTTOM, bool isFlat = TRUE, int firedEventType = wxEVT_COMMAND_MENU_SELECTED, int marginX = 2, int marginY = 2, int textToLabelGap = 2, bool isSticky = FALSE)

Constructor.

wxNewBitmapButton(const wxString& bitmapFileName, const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP, const wxString& labelText = "", int alignText = NB_ALIGN_TEXT_BOTTOM, bool isFlat = TRUE, 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::~wxNewBitmapButton

~wxNewBitmapButton()

Destructor.


wxNewBitmapButton::DestroyLabels

void DestroyLabels()

Internal function for destroying labels.


wxNewBitmapButton::DrawDecorations

void DrawDecorations(wxDC& dc)

Draws the decorations.


wxNewBitmapButton::DrawLabel

void DrawLabel(wxDC& dc)

Draws the label.


wxNewBitmapButton::DrawShade

void DrawShade(int outerLevel, wxDC& dc, wxPen& upperLeftSidePen, wxPen& lowerRightSidePen)

Draws shading on the button.


wxNewBitmapButton::GetStateLabel

wxBitmap* GetStateLabel()

Returns the label that matches the current button state.


wxNewBitmapButton::IsInWindow

bool IsInWindow(int x, int y)

Returns TRUE if the given point is in the window.


wxNewBitmapButton::OnEraseBackground

void OnEraseBackground(wxEraseEvent& event)

Responds to an erase background event.


wxNewBitmapButton::OnKillFocus

void OnKillFocus(wxFocusEvent& event)

Responds to a kill focus event.


wxNewBitmapButton::OnLButtonDown

void OnLButtonDown(wxMouseEvent& event)

Responds to a left mouse button down event.


wxNewBitmapButton::OnLButtonUp

void OnLButtonUp(wxMouseEvent& event)

Responds to a left mouse button up event.


wxNewBitmapButton::OnMouseMove

void OnMouseMove(wxMouseEvent& event)

Responds to a mouse move event.


wxNewBitmapButton::OnPaint

void OnPaint(wxPaintEvent& event)

Responds to a paint event.


wxNewBitmapButton::OnSize

void OnSize(wxSizeEvent& event)

Responds to a size event.


wxNewBitmapButton::RenderAllLabelImages

void RenderAllLabelImages()

Renders label images.


wxNewBitmapButton::RenderLabelImage

void RenderLabelImage(wxBitmap*& destBmp, wxBitmap* srcBmp, bool isEnabled = TRUE, bool isPressed = FALSE)

Renders the label image.


wxNewBitmapButton::RenderLabelImages

void RenderLabelImages()

Renders label images.


wxNewBitmapButton::Reshape

void Reshape()

This function should be called after Create. It renders the labels, having reloaded the button image if necessary.


wxNewBitmapButton::SetAlignments

void SetAlignments(int alignText = NB_ALIGN_TEXT_BOTTOM, int marginX = 2, int marginY = 2, int textToLabelGap = 2)

Sets the text alignment and margins.


wxNewBitmapButton::SetLabel

void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = "")

Sets the label and optionally label text.