X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65e508482777277c429b8c522e1ff8050ff5cdc7..93763ad5ba900aecb9220a36ebe7447313ea3e31:/contrib/include/wx/fl/newbmpbtn.h?ds=sidebyside diff --git a/contrib/include/wx/fl/newbmpbtn.h b/contrib/include/wx/fl/newbmpbtn.h index fac871be73..29c8cc9127 100644 --- a/contrib/include/wx/fl/newbmpbtn.h +++ b/contrib/include/wx/fl/newbmpbtn.h @@ -12,12 +12,9 @@ #ifndef __NEWBMPBTN_G__ #define __NEWBMPBTN_G__ -#ifdef __GNUG__ - #pragma interface "newbmpbtn.h" -#endif - #include "wx/button.h" #include "wx/string.h" +#include "wx/fl/fldefs.h" // defaults #define NB_DEFAULT_MARGIN 2 @@ -31,8 +28,8 @@ // classes declared in this header file -class wxNewBitmapButton; -class wxBorderLessBitmapButton; +class WXDLLIMPEXP_FL wxNewBitmapButton; +class WXDLLIMPEXP_FL wxBorderLessBitmapButton; /* This is an alternative class to wxBitmapButton. It is used @@ -62,7 +59,7 @@ protected: // labels for particular state wxBitmap mFocusedBmp; // may not be always present - - // only if mHasFocusedBmp is TRUE + // only if mHasFocusedBmp is true wxBitmap* mpDepressedImg; wxBitmap* mpPressedImg; @@ -73,6 +70,7 @@ protected: bool mDragStarted; bool mIsPressed; bool mIsInFocus; + bool mIsToggled; bool mHasFocusedBmp; @@ -102,36 +100,40 @@ protected: wxPen& upperLeftSidePen, wxPen& lowerRightSidePen ); - // Returns TRUE if the given point is in the window. + // Returns true if the given point is in the window. bool IsInWindow( int x, int y ); + virtual void OnIdle(wxIdleEvent& event); + // (EVT_UPDATE_UI handler) + virtual void DoButtonUpdate(); + public: // Constructor. wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap, - const wxString& labelText = "", + const wxString& labelText = wxT(""), int alignText = NB_ALIGN_TEXT_BOTTOM, - bool isFlat = TRUE, + 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 + 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 = "", + const wxString& labelText = wxT(""), int alignText = NB_ALIGN_TEXT_BOTTOM, - bool isFlat = TRUE, + 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 + bool isSticky = false ); // Destructor. @@ -142,7 +144,12 @@ public: virtual void Reshape(); // Sets the label and optionally label text. - virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = "" ); + 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, @@ -158,8 +165,8 @@ public: // Renders the label image. virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp, - bool isEnabled = TRUE, - bool isPressed = FALSE); + bool isEnabled = true, + bool isPressed = false); // Renders label images. virtual void RenderLabelImages(); @@ -170,15 +177,15 @@ public: // 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 a left mouse button double click. - void OnLButtonDClick( wxMouseEvent& event ); - // Responds to mouse enter to window. void OnMouseEnter( wxMouseEvent& event ); @@ -197,11 +204,6 @@ public: // Responds to a kill focus event. void OnKillFocus( wxFocusEvent& event ); - // Maps bitmap to current system colours on Windows -#ifdef __WXMSW__ - WXHBITMAP MapBitmap(WXHBITMAP bitmap, int width, int height); -#endif - DECLARE_EVENT_TABLE() };