]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/include/wx/fl/newbmpbtn.h
added wxDC::DrawPolyPolygon() (patch 882189)
[wxWidgets.git] / contrib / include / wx / fl / newbmpbtn.h
index 609923f41797dc6fe2dec5a1427e007af6170014..5f974d0ee99512bc3ba78dcb486a1f7db948f2fa 100644 (file)
 #ifndef __NEWBMPBTN_G__
 #define __NEWBMPBTN_G__
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
     #pragma interface "newbmpbtn.h"
 #endif
 
 #include "wx/button.h"
 #include "wx/string.h"
+#include "wx/fl/fldefs.h"
+
+// defaults
+#define NB_DEFAULT_MARGIN 2
 
 // button label-text alignment types
 
@@ -28,8 +32,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
@@ -70,8 +74,7 @@ protected:
     bool      mDragStarted;
     bool      mIsPressed;
     bool      mIsInFocus;
-    bool      mPrevPressedState;
-    bool      mPrevInFocusState;
+    bool      mIsToggled;
 
     bool      mHasFocusedBmp;
 
@@ -104,17 +107,21 @@ protected:
         // 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,
                        // this is the default type of fired events
                        int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
-                       int marginX        = 2,
-                       int marginY        = 2,
+                       int marginX        = NB_DEFAULT_MARGIN,
+                       int marginY        = NB_DEFAULT_MARGIN,
                        int textToLabelGap = 2,
                        bool isSticky      = FALSE
                      );
@@ -122,13 +129,13 @@ public:
         // 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,
                            // this is the default type of fired events
                            int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
-                           int marginX        = 2,
-                           int marginY        = 2,
+                           int marginX        = NB_DEFAULT_MARGIN,
+                           int marginY        = NB_DEFAULT_MARGIN,
                            int textToLabelGap = 2,
                            bool isSticky      = FALSE
                              );
@@ -141,12 +148,17 @@ 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,
-                                int marginX        = 2,
-                                int marginY        = 2,
+                                int marginX        = NB_DEFAULT_MARGIN,
+                                int marginY        = NB_DEFAULT_MARGIN,
                                 int textToLabelGap = 2);
 
         // Draws the decorations.
@@ -166,14 +178,23 @@ public:
         // 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 a mouse move event.
-    void OnMouseMove( 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 );