Add more stuff missing from the ribbon interface

This commit is contained in:
Robin Dunn
2016-06-28 17:11:37 -07:00
parent 95bff5496b
commit c1a1a13032
3 changed files with 350 additions and 1 deletions

View File

@@ -1024,3 +1024,344 @@ public:
*/ */
virtual wxRect GetRibbonHelpButtonArea(const wxRect& rect) = 0; virtual wxRect GetRibbonHelpButtonArea(const wxRect& rect) = 0;
}; };
class wxRibbonMSWArtProvider : public wxRibbonArtProvider
{
public:
wxRibbonMSWArtProvider(bool set_colour_scheme = true);
virtual ~wxRibbonMSWArtProvider();
wxRibbonArtProvider* Clone() const;
void SetFlags(long flags);
long GetFlags() const;
int GetMetric(int id) const;
void SetMetric(int id, int new_val);
void SetFont(int id, const wxFont& font);
wxFont GetFont(int id) const;
wxColour GetColour(int id) const;
void SetColour(int id, const wxColour& colour);
void GetColourScheme(wxColour* primary,
wxColour* secondary,
wxColour* tertiary) const;
void SetColourScheme(const wxColour& primary,
const wxColour& secondary,
const wxColour& tertiary);
int GetTabCtrlHeight(
wxDC& dc,
wxWindow* wnd,
const wxRibbonPageTabInfoArray& pages);
void DrawTabCtrlBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxRibbonPageTabInfo& tab);
void DrawTabSeparator(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
double visibility);
void DrawPageBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawScrollButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
long style);
void DrawPanelBackground(
wxDC& dc,
wxRibbonPanel* wnd,
const wxRect& rect);
void DrawGalleryBackground(
wxDC& dc,
wxRibbonGallery* wnd,
const wxRect& rect);
void DrawGalleryItemBackground(
wxDC& dc,
wxRibbonGallery* wnd,
const wxRect& rect,
wxRibbonGalleryItem* item);
void DrawMinimisedPanel(
wxDC& dc,
wxRibbonPanel* wnd,
const wxRect& rect,
wxBitmap& bitmap);
void DrawButtonBarBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawButtonBarButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
wxRibbonButtonKind kind,
long state,
const wxString& label,
const wxBitmap& bitmap_large,
const wxBitmap& bitmap_small);
void DrawToolBarBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawToolGroupBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawTool(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
const wxBitmap& bitmap,
wxRibbonButtonKind kind,
long state);
void DrawToggleButton(
wxDC& dc,
wxRibbonBar* wnd,
const wxRect& rect,
wxRibbonDisplayMode mode);
void DrawHelpButton(wxDC& dc,
wxRibbonBar* wnd,
const wxRect& rect);
void GetBarTabWidth(
wxDC& dc,
wxWindow* wnd,
const wxString& label,
const wxBitmap& bitmap,
int* ideal,
int* small_begin_need_separator,
int* small_must_have_separator,
int* minimum);
wxSize GetScrollButtonMinimumSize(
wxDC& dc,
wxWindow* wnd,
long style);
wxSize GetPanelSize(
wxDC& dc,
const wxRibbonPanel* wnd,
wxSize client_size,
wxPoint* client_offset);
wxSize GetPanelClientSize(
wxDC& dc,
const wxRibbonPanel* wnd,
wxSize size,
wxPoint* client_offset);
wxRect GetPanelExtButtonArea(
wxDC& dc,
const wxRibbonPanel* wnd,
wxRect rect);
wxSize GetGallerySize(
wxDC& dc,
const wxRibbonGallery* wnd,
wxSize client_size);
wxSize GetGalleryClientSize(
wxDC& dc,
const wxRibbonGallery* wnd,
wxSize size,
wxPoint* client_offset,
wxRect* scroll_up_button,
wxRect* scroll_down_button,
wxRect* extension_button);
wxRect GetPageBackgroundRedrawArea(
wxDC& dc,
const wxRibbonPage* wnd,
wxSize page_old_size,
wxSize page_new_size);
bool GetButtonBarButtonSize(
wxDC& dc,
wxWindow* wnd,
wxRibbonButtonKind kind,
wxRibbonButtonBarButtonState size,
const wxString& label,
wxSize bitmap_size_large,
wxSize bitmap_size_small,
wxSize* button_size,
wxRect* normal_region,
wxRect* dropdown_region);
wxSize GetMinimisedPanelMinimumSize(
wxDC& dc,
const wxRibbonPanel* wnd,
wxSize* desired_bitmap_size,
wxDirection* expanded_panel_direction);
wxSize GetToolSize(
wxDC& dc,
wxWindow* wnd,
wxSize bitmap_size,
wxRibbonButtonKind kind,
bool is_first,
bool is_last,
wxRect* dropdown_region);
wxRect GetBarToggleButtonArea(const wxRect& rect);
wxRect GetRibbonHelpButtonArea(const wxRect& rect);
};
class wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider
{
public:
wxRibbonAUIArtProvider();
virtual ~wxRibbonAUIArtProvider();
wxRibbonArtProvider* Clone() const;
wxColour GetColour(int id) const;
void SetColour(int id, const wxColour& colour);
void SetColourScheme(const wxColour& primary,
const wxColour& secondary,
const wxColour& tertiary);
void SetFont(int id, const wxFont& font);
wxSize GetScrollButtonMinimumSize(
wxDC& dc,
wxWindow* wnd,
long style);
void DrawScrollButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
long style);
wxSize GetPanelSize(
wxDC& dc,
const wxRibbonPanel* wnd,
wxSize client_size,
wxPoint* client_offset);
wxSize GetPanelClientSize(
wxDC& dc,
const wxRibbonPanel* wnd,
wxSize size,
wxPoint* client_offset);
wxRect GetPanelExtButtonArea(
wxDC& dc,
const wxRibbonPanel* wnd,
wxRect rect);
void DrawTabCtrlBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
int GetTabCtrlHeight(
wxDC& dc,
wxWindow* wnd,
const wxRibbonPageTabInfoArray& pages);
void GetBarTabWidth(
wxDC& dc,
wxWindow* wnd,
const wxString& label,
const wxBitmap& bitmap,
int* ideal,
int* small_begin_need_separator,
int* small_must_have_separator,
int* minimum);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxRibbonPageTabInfo& tab);
void DrawTabSeparator(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
double visibility);
void DrawPageBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawPanelBackground(
wxDC& dc,
wxRibbonPanel* wnd,
const wxRect& rect);
void DrawMinimisedPanel(
wxDC& dc,
wxRibbonPanel* wnd,
const wxRect& rect,
wxBitmap& bitmap);
void DrawGalleryBackground(
wxDC& dc,
wxRibbonGallery* wnd,
const wxRect& rect);
void DrawGalleryItemBackground(
wxDC& dc,
wxRibbonGallery* wnd,
const wxRect& rect,
wxRibbonGalleryItem* item);
void DrawButtonBarBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawButtonBarButton(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
wxRibbonButtonKind kind,
long state,
const wxString& label,
const wxBitmap& bitmap_large,
const wxBitmap& bitmap_small);
void DrawToolBarBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawToolGroupBackground(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect);
void DrawTool(
wxDC& dc,
wxWindow* wnd,
const wxRect& rect,
const wxBitmap& bitmap,
wxRibbonButtonKind kind,
long state);
};

View File

@@ -69,7 +69,12 @@ enum wxRibbonButtonBarButtonState
Only applicable to dropdown and hybrid buttons. Only applicable to dropdown and hybrid buttons.
*/ */
wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = 1 << 6, wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = 1 << 6,
/**
A mask to extract active flags
*/
wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE,
/** /**
The button is disabled. Hover flags may still be set when a button The button is disabled. Hover flags may still be set when a button
is disabled, but should be ignored during drawing if the button is is disabled, but should be ignored during drawing if the button is

View File

@@ -52,6 +52,9 @@ public:
void SetPanel(wxRibbonPanel* page); void SetPanel(wxRibbonPanel* page);
}; };
wxEventType wxEVT_RIBBONPANEL_EXTBUTTON_ACTIVATED;
/** /**
@class wxRibbonPanel @class wxRibbonPanel