X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1aff4201c36daec702cabc869c0bf899c56ba8cc..d642db66a5efc82d374b813022c72ba88bc50839:/include/wx/ribbon/gallery.h diff --git a/include/wx/ribbon/gallery.h b/include/wx/ribbon/gallery.h index 6916be51fc..08cd76b0aa 100644 --- a/include/wx/ribbon/gallery.h +++ b/include/wx/ribbon/gallery.h @@ -20,7 +20,7 @@ class wxRibbonGalleryItem; -WX_DEFINE_USER_EXPORTED_ARRAY(wxRibbonGalleryItem*, wxArrayRibbonGalleryItem, class WXDLLIMPEXP_RIBBON); +WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonGalleryItem*, wxArrayRibbonGalleryItem, class WXDLLIMPEXP_RIBBON); class WXDLLIMPEXP_RIBBON wxRibbonGallery : public wxRibbonControl { @@ -69,6 +69,7 @@ public: virtual bool Layout(); virtual bool ScrollLines(int lines); + bool ScrollPixels(int pixels); void EnsureVisible(const wxRibbonGalleryItem* item); protected: @@ -84,8 +85,10 @@ protected: void OnMouseLeave(wxMouseEvent& evt); void OnMouseDown(wxMouseEvent& evt); void OnMouseUp(wxMouseEvent& evt); + void OnMouseDClick(wxMouseEvent& evt); void OnPaint(wxPaintEvent& evt); void OnSize(wxSizeEvent& evt); + int GetScrollLineSize() const; virtual wxSize DoGetBestSize() const; virtual wxSize DoGetNextSmallerSize(wxOrientation direction, @@ -157,9 +160,9 @@ private: #ifndef SWIG -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, wxRibbonGalleryEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_COMMAND_RIBBONGALLERY_SELECTED, wxRibbonGalleryEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_COMMAND_RIBBONGALLERY_CLICKED, wxRibbonGalleryEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_RIBBONGALLERY_HOVER_CHANGED, wxRibbonGalleryEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_RIBBONGALLERY_SELECTED, wxRibbonGalleryEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_RIBBON, wxEVT_RIBBONGALLERY_CLICKED, wxRibbonGalleryEvent); typedef void (wxEvtHandler::*wxRibbonGalleryEventFunction)(wxRibbonGalleryEvent&); @@ -167,23 +170,28 @@ typedef void (wxEvtHandler::*wxRibbonGalleryEventFunction)(wxRibbonGalleryEvent& wxEVENT_HANDLER_CAST(wxRibbonGalleryEventFunction, func) #define EVT_RIBBONGALLERY_HOVER_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, winid, wxRibbonGalleryEventHandler(fn)) + wx__DECLARE_EVT1(wxEVT_RIBBONGALLERY_HOVER_CHANGED, winid, wxRibbonGalleryEventHandler(fn)) #define EVT_RIBBONGALLERY_SELECTED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_RIBBONGALLERY_SELECTED, winid, wxRibbonGalleryEventHandler(fn)) + wx__DECLARE_EVT1(wxEVT_RIBBONGALLERY_SELECTED, winid, wxRibbonGalleryEventHandler(fn)) #define EVT_RIBBONGALLERY_CLICKED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_RIBBONGALLERY_CLICKED, winid, wxRibbonGalleryEventHandler(fn)) + wx__DECLARE_EVT1(wxEVT_RIBBONGALLERY_CLICKED, winid, wxRibbonGalleryEventHandler(fn)) #else // wxpython/swig event work -%constant wxEventType wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED; -%constant wxEventType wxEVT_COMMAND_RIBBONGALLERY_SELECTED; +%constant wxEventType wxEVT_RIBBONGALLERY_HOVER_CHANGED; +%constant wxEventType wxEVT_RIBBONGALLERY_SELECTED; %pythoncode { - EVT_RIBBONGALLERY_HOVER_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, 1 ) - EVT_RIBBONGALLERY_SELECTED = wx.PyEventBinder( wxEVT_COMMAND_RIBBONGALLERY_SELECTED, 1 ) + EVT_RIBBONGALLERY_HOVER_CHANGED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_HOVER_CHANGED, 1 ) + EVT_RIBBONGALLERY_SELECTED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_SELECTED, 1 ) } #endif // SWIG +// old wxEVT_COMMAND_* constants +#define wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED wxEVT_RIBBONGALLERY_HOVER_CHANGED +#define wxEVT_COMMAND_RIBBONGALLERY_SELECTED wxEVT_RIBBONGALLERY_SELECTED +#define wxEVT_COMMAND_RIBBONGALLERY_CLICKED wxEVT_RIBBONGALLERY_CLICKED + #endif // wxUSE_RIBBON #endif // _WX_RIBBON_GALLERY_H_