Additions and fixes for AUI class interfaces

This commit is contained in:
Robin Dunn
2016-10-27 18:48:52 -07:00
parent 90059c0cf9
commit aaa1a51a59
5 changed files with 368 additions and 4 deletions

View File

@@ -148,6 +148,10 @@ enum wxAuiToolBarToolTextOrientation
class wxAuiToolBarEvent : public wxNotifyEvent class wxAuiToolBarEvent : public wxNotifyEvent
{ {
public: public:
wxAuiToolBarEvent(wxEventType commandType = wxEVT_NULL,
int winId = 0);
wxAuiToolBarEvent(const wxAuiToolBarEvent& c);
/** /**
Returns whether the drop down menu has been clicked. Returns whether the drop down menu has been clicked.
*/ */
@@ -167,8 +171,20 @@ public:
Returns the wxAuiToolBarItem identifier. Returns the wxAuiToolBarItem identifier.
*/ */
int GetToolId() const; int GetToolId() const;
void SetDropDownClicked(bool c);
void SetClickPoint(const wxPoint& p);
void SetItemRect(const wxRect& r);
void SetToolId(int toolId);
}; };
wxEventType wxEVT_AUITOOLBAR_TOOL_DROPDOWN;
wxEventType wxEVT_AUITOOLBAR_OVERFLOW_CLICK;
wxEventType wxEVT_AUITOOLBAR_RIGHT_CLICK;
wxEventType wxEVT_AUITOOLBAR_MIDDLE_CLICK;
wxEventType wxEVT_AUITOOLBAR_BEGIN_DRAG;
/** /**
@class wxAuiToolBarItem @class wxAuiToolBarItem

View File

@@ -5,6 +5,32 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
enum wxAuiNotebookOption
{
wxAUI_NB_TOP = 1 << 0,
wxAUI_NB_LEFT = 1 << 1, // not implemented yet
wxAUI_NB_RIGHT = 1 << 2, // not implemented yet
wxAUI_NB_BOTTOM = 1 << 3,
wxAUI_NB_TAB_SPLIT = 1 << 4,
wxAUI_NB_TAB_MOVE = 1 << 5,
wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6,
wxAUI_NB_TAB_FIXED_WIDTH = 1 << 7,
wxAUI_NB_SCROLL_BUTTONS = 1 << 8,
wxAUI_NB_WINDOWLIST_BUTTON = 1 << 9,
wxAUI_NB_CLOSE_BUTTON = 1 << 10,
wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 11,
wxAUI_NB_CLOSE_ON_ALL_TABS = 1 << 12,
wxAUI_NB_MIDDLE_CLICK_CLOSE = 1 << 13,
wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP |
wxAUI_NB_TAB_SPLIT |
wxAUI_NB_TAB_MOVE |
wxAUI_NB_SCROLL_BUTTONS |
wxAUI_NB_CLOSE_ON_ACTIVE_TAB |
wxAUI_NB_MIDDLE_CLICK_CLOSE
};
/** /**
@class wxAuiNotebook @class wxAuiNotebook
@@ -20,9 +46,9 @@
splitter configurations, and toggle through different themes to customize splitter configurations, and toggle through different themes to customize
the control's look and feel. the control's look and feel.
The appearance of this class is configurable and can be changed by calling The default theme that is used is wxAuiDefaultTabArt, which provides a modern,
wxAuiNotebook::SetArtProvider(). By default, native art provider is used if glossy look and feel.
available (currently only in wxGTK and wxMSW) and wxAuiGenericTabArt otherwise. The theme can be changed by calling wxAuiNotebook::SetArtProvider.
@beginStyleTable @beginStyleTable
@style{wxAUI_NB_DEFAULT_STYLE} @style{wxAUI_NB_DEFAULT_STYLE}
@@ -270,7 +296,7 @@ public:
@since 2.9.3 @since 2.9.3
*/ */
virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text, virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
bool select=false, int imageId=NO_IMAGE); bool select, int imageId);
/** /**
Removes a page, without deleting the window pointer. Removes a page, without deleting the window pointer.
@@ -375,6 +401,27 @@ public:
bool ShowWindowMenu(); bool ShowWindowMenu();
}; };
/**
@class wxAuiNotebookPage
A simple class which holds information about the notebook's pages and their state.
@library{wxaui}
@category{aui}
*/
class wxAuiNotebookPage
{
public:
wxWindow* window; // page's associated window
wxString caption; // caption displayed on the tab
wxString tooltip; // tooltip displayed when hovering over tab title
wxBitmap bitmap; // tab's bitmap
wxRect rect; // tab's hit rectangle
bool active; // true if the page is currently active
};
/** /**
@class wxAuiTabContainerButton @class wxAuiTabContainerButton

View File

@@ -281,3 +281,102 @@ public:
virtual void SetMetric(int id, int new_val) = 0; virtual void SetMetric(int id, int new_val) = 0;
}; };
/**
@class wxAuiDefaultDockArt
This is the default art provider for @ref wxAuiManager. Dock art
can be customized by creating a class derived from this one,
or replacing this class entirely.
*/
class wxAuiDefaultDockArt : public wxAuiDockArt
{
public:
wxAuiDefaultDockArt();
int GetMetric(int metricId);
void SetMetric(int metricId, int newVal);
wxColour GetColour(int id);
void SetColour(int id, const wxColour& colour);
void SetFont(int id, const wxFont& font);
wxFont GetFont(int id);
void DrawSash(wxDC& dc,
wxWindow *window,
int orientation,
const wxRect& rect);
void DrawBackground(wxDC& dc,
wxWindow *window,
int orientation,
const wxRect& rect);
void DrawCaption(wxDC& dc,
wxWindow *window,
const wxString& text,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawGripper(wxDC& dc,
wxWindow *window,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawBorder(wxDC& dc,
wxWindow *window,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawPaneButton(wxDC& dc,
wxWindow *window,
int button,
int buttonState,
const wxRect& rect,
wxAuiPaneInfo& pane);
void DrawIcon(wxDC& dc,
const wxRect& rect,
wxAuiPaneInfo& pane);
protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
void InitBitmaps();
protected:
wxPen m_borderPen;
wxBrush m_sashBrush;
wxBrush m_backgroundBrush;
wxBrush m_gripperBrush;
wxFont m_captionFont;
wxBitmap m_inactiveCloseBitmap;
wxBitmap m_inactivePinBitmap;
wxBitmap m_inactiveMaximizeBitmap;
wxBitmap m_inactiveRestoreBitmap;
wxBitmap m_activeCloseBitmap;
wxBitmap m_activePinBitmap;
wxBitmap m_activeMaximizeBitmap;
wxBitmap m_activeRestoreBitmap;
wxPen m_gripperPen1;
wxPen m_gripperPen2;
wxPen m_gripperPen3;
wxColour m_baseColour;
wxColour m_activeCaptionColour;
wxColour m_activeCaptionGradientColour;
wxColour m_activeCaptionTextColour;
wxColour m_inactiveCaptionColour;
wxColour m_inactiveCaptionGradientColour;
wxColour m_inactiveCaptionTextColour;
int m_borderSize;
int m_captionSize;
int m_sashSize;
int m_buttonSize;
int m_gripperSize;
int m_gradientType;
};

View File

@@ -1032,3 +1032,65 @@ wxEventType wxEVT_AUI_PANE_RESTORE;
wxEventType wxEVT_AUI_PANE_ACTIVATED; wxEventType wxEVT_AUI_PANE_ACTIVATED;
wxEventType wxEVT_AUI_RENDER; wxEventType wxEVT_AUI_RENDER;
wxEventType wxEVT_AUI_FIND_MANAGER; wxEventType wxEVT_AUI_FIND_MANAGER;
class wxAuiDockInfo
{
public:
wxAuiDockInfo();
wxAuiDockInfo(const wxAuiDockInfo& c);
wxAuiDockInfo& operator=(const wxAuiDockInfo& c);
bool IsOk() const;
bool IsHorizontal() const;
bool IsVertical() const;
wxAuiPaneInfoPtrArray panes; // array of panes
wxRect rect; // current rectangle
int dock_direction; // dock direction (top, bottom, left, right, center)
int dock_layer; // layer number (0 = innermost layer)
int dock_row; // row number on the docking bar (0 = first row)
int size; // size of the dock
int min_size; // minimum size of a dock (0 if there is no min)
bool resizable; // flag indicating whether the dock is resizable
bool toolbar; // flag indicating dock contains only toolbars
bool fixed; // flag indicating that the dock operates on
// absolute coordinates as opposed to proportional
bool reserved1;
};
class wxAuiDockUIPart
{
public:
enum
{
typeCaption,
typeGripper,
typeDock,
typeDockSizer,
typePane,
typePaneSizer,
typeBackground,
typePaneBorder,
typePaneButton
};
int type; // ui part type (see enum above)
int orientation; // orientation (either wxHORIZONTAL or wxVERTICAL)
wxAuiDockInfo* dock; // which dock the item is associated with
wxAuiPaneInfo* pane; // which pane the item is associated with
wxAuiPaneButton* button; // which pane button the item is associated with
wxSizer* cont_sizer; // the part's containing sizer
wxSizerItem* sizer_item; // the sizer item of the part
wxRect rect; // client coord rectangle of the part itself
};
class wxAuiPaneButton
{
public:
int button_id; // id of the button (e.g. buttonClose)
};

140
interface/wx/aui/tabmdi.h Normal file
View File

@@ -0,0 +1,140 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/tabmdi.h
// Purpose: Documentation of wxAui MDI classes.
// Created: 2016-10-27
// Copyright: (c) 2016 wxWidgets development team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
class wxAuiMDIParentFrame : public wxFrame
{
public:
wxAuiMDIParentFrame();
wxAuiMDIParentFrame(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
~wxAuiMDIParentFrame();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
void SetArtProvider(wxAuiTabArt* provider);
wxAuiTabArt* GetArtProvider();
wxAuiNotebook* GetNotebook() const;
wxMenu* GetWindowMenu() const;
void SetWindowMenu(wxMenu* pMenu);
virtual void SetMenuBar(wxMenuBar *pMenuBar);
void SetChildMenuBar(wxAuiMDIChildFrame *pChild);
wxAuiMDIChildFrame *GetActiveChild() const;
void SetActiveChild(wxAuiMDIChildFrame* pChildFrame);
wxAuiMDIClientWindow *GetClientWindow() const;
virtual wxAuiMDIClientWindow *OnCreateClient();
virtual void Cascade();
virtual void Tile(wxOrientation orient = wxHORIZONTAL);
virtual void ArrangeIcons();
virtual void ActivateNext();
virtual void ActivatePrevious();
};
class wxAuiMDIChildFrame : public wxPanel
{
public:
wxAuiMDIChildFrame();
wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxAuiMDIChildFrame();
bool Create(wxAuiMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual void SetMenuBar(wxMenuBar *menuBar);
virtual wxMenuBar *GetMenuBar() const;
virtual void SetTitle(const wxString& title);
virtual wxString GetTitle() const;
virtual void SetIcons(const wxIconBundle& icons);
virtual const wxIconBundle& GetIcons() const;
virtual void SetIcon(const wxIcon& icon);
virtual const wxIcon& GetIcon() const;
virtual void Activate();
virtual bool Destroy();
virtual bool Show(bool show = true);
// no status bars
virtual wxStatusBar* CreateStatusBar(int number = 1,
long style = 1,
wxWindowID winid = 1,
const wxString& name = wxEmptyString);
virtual wxStatusBar *GetStatusBar() const;
virtual void SetStatusText( const wxString &text, int number=0 );
virtual void SetStatusWidths( int n, const int widths_field[] );
// no toolbar bars
virtual wxToolBar* CreateToolBar(long style,
wxWindowID winid,
const wxString& name);
virtual wxToolBar *GetToolBar() const;
// no maximize etc
virtual void Maximize(bool maximize = true);
virtual void Restore();
virtual void Iconize(bool iconize = true);
virtual bool IsMaximized() const;
virtual bool IsIconized() const;
virtual bool ShowFullScreen(bool show, long style);
virtual bool IsFullScreen() const;
virtual bool IsTopLevel() const;
void SetMDIParentFrame(wxAuiMDIParentFrame* parent);
wxAuiMDIParentFrame* GetMDIParentFrame() const;
};
class wxAuiMDIClientWindow : public wxAuiNotebook
{
public:
wxAuiMDIClientWindow();
wxAuiMDIClientWindow(wxAuiMDIParentFrame *parent, long style = 0);
virtual bool CreateClient(wxAuiMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL);
virtual int SetSelection(size_t page);
virtual wxAuiMDIChildFrame* GetActiveChild();
virtual void SetActiveChild(wxAuiMDIChildFrame* pChildFrame);
};