]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/ribbon/buttonbar.h
Remove connection of MyDllApp::OnIdle() handler in the dll sample.
[wxWidgets.git] / include / wx / ribbon / buttonbar.h
index 9bc070a08c14556927be0b41f6a0004c271f739f..38957d7c5c5bcf36a54e046cbbb888c4fcb3cfd9 100644 (file)
@@ -23,8 +23,8 @@ class wxRibbonButtonBarButtonBase;
 class wxRibbonButtonBarLayout;
 class wxRibbonButtonBarButtonInstance;
 
-WX_DEFINE_USER_EXPORTED_ARRAY(wxRibbonButtonBarLayout*, wxArrayRibbonButtonBarLayout, class WXDLLIMPEXP_RIBBON);
-WX_DEFINE_USER_EXPORTED_ARRAY(wxRibbonButtonBarButtonBase*, wxArrayRibbonButtonBarButtonBase, class WXDLLIMPEXP_RIBBON);
+WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonButtonBarLayout*, wxArrayRibbonButtonBarLayout, class WXDLLIMPEXP_RIBBON);
+WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonButtonBarButtonBase*, wxArrayRibbonButtonBarButtonBase, class WXDLLIMPEXP_RIBBON);
 
 class WXDLLIMPEXP_RIBBON wxRibbonButtonBar : public wxRibbonControl
 {
@@ -66,7 +66,13 @@ public:
                 const wxString& label,
                 const wxBitmap& bitmap,
                 const wxString& help_string = wxEmptyString);
-    
+
+    virtual wxRibbonButtonBarButtonBase* AddToggleButton(
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxString& help_string = wxEmptyString);
+
     virtual wxRibbonButtonBarButtonBase* AddButton(
                 int button_id,
                 const wxString& label,
@@ -75,18 +81,76 @@ public:
                 const wxBitmap& bitmap_disabled = wxNullBitmap,
                 const wxBitmap& bitmap_small_disabled = wxNullBitmap,
                 wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL,
-                const wxString& help_string = wxEmptyString,
-                wxObject* client_data = NULL);
+                const wxString& help_string = wxEmptyString);
+
+    virtual wxRibbonButtonBarButtonBase* InsertButton(
+                size_t pos,
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxString& help_string,
+                wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL);
+
+    virtual wxRibbonButtonBarButtonBase* InsertDropdownButton(
+                size_t pos,
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxString& help_string = wxEmptyString);
+
+    virtual wxRibbonButtonBarButtonBase* InsertHybridButton(
+                size_t pos,
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxString& help_string = wxEmptyString);
+
+    virtual wxRibbonButtonBarButtonBase* InsertToggleButton(
+                size_t pos,
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxString& help_string = wxEmptyString);
+
+    virtual wxRibbonButtonBarButtonBase* InsertButton(
+                size_t pos,
+                int button_id,
+                const wxString& label,
+                const wxBitmap& bitmap,
+                const wxBitmap& bitmap_small = wxNullBitmap,
+                const wxBitmap& bitmap_disabled = wxNullBitmap,
+                const wxBitmap& bitmap_small_disabled = wxNullBitmap,
+                wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL,
+                const wxString& help_string = wxEmptyString);
+
+    void SetItemClientObject(wxRibbonButtonBarButtonBase* item, wxClientData* data);
+    wxClientData* GetItemClientObject(const wxRibbonButtonBarButtonBase* item) const;
+    void SetItemClientData(wxRibbonButtonBarButtonBase* item, void* data);
+    void* GetItemClientData(const wxRibbonButtonBarButtonBase* item) const;
+
+    virtual size_t GetButtonCount() const;
+    virtual wxRibbonButtonBarButtonBase *GetItem(size_t n) const;
+    virtual wxRibbonButtonBarButtonBase *GetItemById(int id) const;
+    virtual int GetItemId(wxRibbonButtonBarButtonBase *button) const;
+
 
     virtual bool Realize();
     virtual void ClearButtons();
     virtual bool DeleteButton(int button_id);
     virtual void EnableButton(int button_id, bool enable = true);
+    virtual void ToggleButton(int button_id, bool checked);
+
+    virtual wxRibbonButtonBarButtonBase *GetActiveItem() const;
+    virtual wxRibbonButtonBarButtonBase *GetHoveredItem() const;
 
     virtual void SetArtProvider(wxRibbonArtProvider* art);
     virtual bool IsSizingContinuous() const;
 
     virtual wxSize GetMinSize() const;
+
+    void SetShowToolTipsForDisabled(bool show);
+    bool GetShowToolTipsForDisabled() const;
+
 protected:
     friend class wxRibbonButtonBarEvent;
     virtual wxSize DoGetBestSize() const;
@@ -113,6 +177,7 @@ protected:
     static wxBitmap MakeDisabledBitmap(const wxBitmap& original);
     void FetchButtonSizeInfo(wxRibbonButtonBarButtonBase* button,
         wxRibbonButtonBarButtonState size, wxDC& dc);
+    virtual void UpdateWindowUI(long flags);
 
     wxArrayRibbonButtonBarLayout m_layouts;
     wxArrayRibbonButtonBarButtonBase m_buttons;
@@ -125,6 +190,7 @@ protected:
     int m_current_layout;
     bool m_layouts_valid;
     bool m_lock_active_state;
+    bool m_show_tooltips_for_disabled;
 
 #ifndef SWIG
     DECLARE_CLASS(wxRibbonButtonBar)
@@ -137,25 +203,30 @@ class WXDLLIMPEXP_RIBBON wxRibbonButtonBarEvent : public wxCommandEvent
 public:
     wxRibbonButtonBarEvent(wxEventType command_type = wxEVT_NULL,
                        int win_id = 0,
-                       wxRibbonButtonBar* bar = NULL)
+                       wxRibbonButtonBar* bar = NULL,
+                       wxRibbonButtonBarButtonBase* button = NULL)
         : wxCommandEvent(command_type, win_id)
-        , m_bar(bar)
+        , m_bar(bar), m_button(button)
     {
     }
 #ifndef SWIG
     wxRibbonButtonBarEvent(const wxRibbonButtonBarEvent& e) : wxCommandEvent(e)
     {
         m_bar = e.m_bar;
+        m_button = e.m_button;
     }
 #endif
     wxEvent *Clone() const { return new wxRibbonButtonBarEvent(*this); }
 
     wxRibbonButtonBar* GetBar() {return m_bar;}
+    wxRibbonButtonBarButtonBase *GetButton() { return m_button; }
     void SetBar(wxRibbonButtonBar* bar) {m_bar = bar;}
+    void SetButton(wxRibbonButtonBarButtonBase* button) { m_button = button; }
     bool PopupMenu(wxMenu* menu);
 
 protected:
     wxRibbonButtonBar* m_bar;
+    wxRibbonButtonBarButtonBase *m_button;
 
 #ifndef SWIG
 private: