]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/include/wx/fl/newbmpbtn.h
wx/wxprec.h already includes wx/defs.h (with other minor cleaning).
[wxWidgets.git] / contrib / include / wx / fl / newbmpbtn.h
index 882b29f745c1f3e105154247d48c00540c2bc61e..29c8cc91278d6a4c76125da1dfc6a9525313daab 100644 (file)
 #ifndef __NEWBMPBTN_G__
 #define __NEWBMPBTN_G__
 
-#if defined(__GNUG__) && !defined(__APPLE__)
-    #pragma interface "newbmpbtn.h"
-#endif
-
 #include "wx/button.h"
 #include "wx/string.h"
 #include "wx/fl/fldefs.h"
@@ -32,8 +28,8 @@
 
 // classes declared in this header file
 
-class WXFL_DECLSPEC wxNewBitmapButton;
-class WXFL_DECLSPEC wxBorderLessBitmapButton;
+class WXDLLIMPEXP_FL wxNewBitmapButton;
+class WXDLLIMPEXP_FL wxBorderLessBitmapButton;
 
 /*
 This is an alternative class to wxBitmapButton. It is used
@@ -63,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;
@@ -74,6 +70,7 @@ protected:
     bool      mDragStarted;
     bool      mIsPressed;
     bool      mIsInFocus;
+    bool      mIsToggled;
 
     bool      mHasFocusedBmp;
 
@@ -103,22 +100,26 @@ 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   = 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
@@ -126,13 +127,13 @@ public:
                            const wxBitmapType     bitmapFileType = wxBITMAP_TYPE_BMP,
                            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.
@@ -145,6 +146,11 @@ public:
         // 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,
@@ -159,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();
@@ -171,6 +177,9 @@ 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 );