initial commit

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2025-10-31 23:37:30 +01:00
commit bf6b52fd94
9654 changed files with 4035664 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,422 @@
/////////////////////////////////////////////////////////////////////////////
// Name: aui/dockart.h
// Purpose: interface of wxAuiDockArt
// Author: wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
These are the possible pane dock art settings for wxAuiDefaultDockArt.
@library{wxaui}
@category{aui}
*/
enum wxAuiPaneDockArtSetting
{
/// Customizes the sash size
wxAUI_DOCKART_SASH_SIZE = 0,
/// Customizes the caption size
wxAUI_DOCKART_CAPTION_SIZE = 1,
/// Customizes the gripper size
wxAUI_DOCKART_GRIPPER_SIZE = 2,
/// Customizes the pane border size
wxAUI_DOCKART_PANE_BORDER_SIZE = 3,
/// Customizes the pane button size
wxAUI_DOCKART_PANE_BUTTON_SIZE = 4,
/// Customizes the background colour, which corresponds to the client area.
wxAUI_DOCKART_BACKGROUND_COLOUR = 5,
/// Customizes the sash colour
wxAUI_DOCKART_SASH_COLOUR = 6,
/// Customizes the active caption colour
wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR = 7,
/// Customizes the active caption gradient colour
wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR = 8,
/// Customizes the inactive caption colour
wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR = 9,
/// Customizes the inactive gradient caption colour
wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR = 10,
/// Customizes the active caption text colour
wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR = 11,
/// Customizes the inactive caption text colour
wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR = 12,
/// Customizes the border colour
wxAUI_DOCKART_BORDER_COLOUR = 13,
/// Customizes the gripper colour
wxAUI_DOCKART_GRIPPER_COLOUR = 14,
/// Customizes the caption font
wxAUI_DOCKART_CAPTION_FONT = 15,
/// Customizes the gradient type (no gradient, vertical or horizontal)
wxAUI_DOCKART_GRADIENT_TYPE = 16
};
/**
These are the possible gradient dock art settings for wxAuiDefaultDockArt
*/
enum wxAuiPaneDockArtGradients
{
/// No gradient on the captions, in other words a solid colour
wxAUI_GRADIENT_NONE = 0,
/// Vertical gradient on the captions, in other words a gradual change in colours from top to bottom
wxAUI_GRADIENT_VERTICAL = 1,
/// Horizontal gradient on the captions, in other words a gradual change in colours from left to right
wxAUI_GRADIENT_HORIZONTAL = 2
};
/**
These are the possible pane button / wxAuiNotebook button / wxAuiToolBar button states.
*/
enum wxAuiPaneButtonState
{
/// Normal button state
wxAUI_BUTTON_STATE_NORMAL = 0,
/// Hovered button state
wxAUI_BUTTON_STATE_HOVER = 1 << 1,
/// Pressed button state
wxAUI_BUTTON_STATE_PRESSED = 1 << 2,
/// Disabled button state
wxAUI_BUTTON_STATE_DISABLED = 1 << 3,
/// Hidden button state
wxAUI_BUTTON_STATE_HIDDEN = 1 << 4,
/// Checked button state
wxAUI_BUTTON_STATE_CHECKED = 1 << 5
};
/**
These are the possible pane button / wxAuiNotebook button / wxAuiToolBar button identifiers.
*/
enum wxAuiButtonId
{
/// Shows a close button on the pane
wxAUI_BUTTON_CLOSE = 101,
/// Shows a maximize/restore button on the pane
wxAUI_BUTTON_MAXIMIZE_RESTORE = 102,
/// Shows a minimize button on the pane
wxAUI_BUTTON_MINIMIZE = 103,
/**
Shows a pin button on the pane
*/
wxAUI_BUTTON_PIN = 104,
/**
Shows an option button on the pane (not implemented)
*/
wxAUI_BUTTON_OPTIONS = 105,
/**
Shows a window list button on the pane (for wxAuiNotebook)
*/
wxAUI_BUTTON_WINDOWLIST = 106,
/**
Shows a left button on the pane (for wxAuiNotebook)
*/
wxAUI_BUTTON_LEFT = 107,
/**
Shows a right button on the pane (for wxAuiNotebook)
*/
wxAUI_BUTTON_RIGHT = 108,
/**
Shows an up button on the pane (not implemented)
*/
wxAUI_BUTTON_UP = 109,
/**
Shows a down button on the pane (not implemented)
*/
wxAUI_BUTTON_DOWN = 110,
/**
Shows one of three possible custom buttons on the pane (not implemented)
*/
wxAUI_BUTTON_CUSTOM1 = 201,
/**
Shows one of three possible custom buttons on the pane (not implemented)
*/
wxAUI_BUTTON_CUSTOM2 = 202,
/**
Shows one of three possible custom buttons on the pane (not implemented)
*/
wxAUI_BUTTON_CUSTOM3 = 203
};
/**
@class wxAuiDockArt
wxAuiDockArt is part of the wxAUI class framework.
See also @ref overview_aui.
wxAuiDockArt is the art provider: provides all drawing functionality to the
wxAui dock manager. This allows the dock manager to have a pluggable look-and-feel.
By default, a wxAuiManager uses an instance of this class called
wxAuiDefaultDockArt which provides bitmap art and a colour scheme that is
adapted to the major platforms' look. You can either derive from that class
to alter its behaviour or write a completely new dock art class.
Call wxAuiManager::SetArtProvider to force wxAUI to use your new dock art provider.
@library{wxaui}
@category{aui}
@see wxAuiManager, wxAuiPaneInfo
*/
class wxAuiDockArt
{
public:
/**
Constructor.
*/
wxAuiDockArt();
/**
Destructor.
*/
virtual ~wxAuiDockArt();
/**
Create a copy of this wxAuiDockArt instance.
*/
virtual wxAuiDockArt* Clone() = 0;
/**
Draws a background.
*/
virtual void DrawBackground(wxDC& dc, wxWindow* window, int orientation,
const wxRect& rect) = 0;
/**
Draws a border.
*/
virtual void DrawBorder(wxDC& dc, wxWindow* window, const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
/**
Draws a caption.
*/
virtual void DrawCaption(wxDC& dc, wxWindow* window, const wxString& text,
const wxRect& rect, wxAuiPaneInfo& pane) = 0;
/**
Draws a gripper.
*/
virtual void DrawGripper(wxDC& dc, wxWindow* window, const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
/**
Draws a button in the pane's title bar.
@a button can be one of the values of @b wxAuiButtonId.
@a button_state can be one of the values of @b wxAuiPaneButtonState.
*/
virtual void DrawPaneButton(wxDC& dc, wxWindow* window, int button,
int button_state, const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
/**
Draws a sash between two windows.
*/
virtual void DrawSash(wxDC& dc, wxWindow* window, int orientation,
const wxRect& rect) = 0;
/**
Get the colour of a certain setting.
@a id can be one of the colour values of @b wxAuiPaneDockArtSetting.
*/
virtual wxColour GetColour(int id) = 0;
/**
Get a font setting.
*/
virtual wxFont GetFont(int id) = 0;
/**
Get the value of a certain setting.
@a id can be one of the size values of @b wxAuiPaneDockArtSetting.
This function returns the same value that was set by SetMetric(), use
GetMetricForWindow() to get the value appropriate for the given window
for metrics that express sizes.
*/
virtual int GetMetric(int id) = 0;
/**
Get metric value scaled by the DPI of the given window if appropriate.
Call this function instead of GetMetric() to get the metric value
scaled by the window DPI for the metrics that are expressed in pixels
and must be scaled.
The default implementation doesn't scale ::wxAUI_DOCKART_SASH_SIZE and
::wxAUI_DOCKART_PANE_BORDER_SIZE metrics in order to allow setting them
to just a single pixel (which is the default value for the latter in
wxAuiDefaultDockArt) even in high DPI. You may override this function
in your custom art implementation to scale these metrics too if you
prefer to have thicker borders in high DPI.
Note that values of ::wxAUI_DOCKART_GRADIENT_TYPE are not expressed in
pixels and so should never be scaled by this function.
@since 3.3.0
*/
virtual int GetMetricForWindow(int id, wxWindow* window);
/**
Set a certain setting with the value @e colour.
@a id can be one of the colour values of @b wxAuiPaneDockArtSetting.
*/
virtual void SetColour(int id, const wxColour& colour) = 0;
/**
Set a font setting.
*/
virtual void SetFont(int id, const wxFont& font) = 0;
/**
Set a certain setting with the value @e new_val.
@a id can be one of the size values of @b wxAuiPaneDockArtSetting.
The interpretation of @a new_val depends on the metric being set, see
GetMetricForWindow().
*/
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();
virtual wxAuiDockArt* Clone();
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);
/**
@deprecated Not intended for the public API.
*/
void DrawIcon(wxDC& dc,
const wxRect& rect,
wxAuiPaneInfo& pane);
protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
void DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane);
void InitBitmaps();
protected:
wxPen m_borderPen;
wxBrush m_sashBrush;
wxBrush m_backgroundBrush;
wxBrush m_gripperBrush;
wxFont m_captionFont;
wxBitmapBundle m_inactiveCloseBitmap;
wxBitmapBundle m_inactivePinBitmap;
wxBitmapBundle m_inactiveMaximizeBitmap;
wxBitmapBundle m_inactiveRestoreBitmap;
wxBitmapBundle m_activeCloseBitmap;
wxBitmapBundle m_activePinBitmap;
wxBitmapBundle m_activeMaximizeBitmap;
wxBitmapBundle 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

@@ -0,0 +1,37 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/floatpane.h
// Purpose: wxaui: wx advanced user interface - docking window manager
// Author: Benjamin I. Williams
// Created: 2005-05-17
// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
class wxAuiFloatingFrame : public wxFrame
{
public:
wxAuiFloatingFrame(wxWindow* parent,
wxAuiManager* ownerMgr,
const wxAuiPaneInfo& pane,
wxWindowID id = wxID_ANY,
long style = wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT |
wxCLIP_CHILDREN
);
virtual ~wxAuiFloatingFrame();
void SetPaneWindow(const wxAuiPaneInfo& pane);
wxAuiManager* GetOwnerManager() const;
/**
Returns the embedded wxAuiManager managing this floating pane's contents.
@since 3.1.5
*/
wxAuiManager& GetAuiManager();
protected:
virtual void OnMoveStart();
virtual void OnMoving(const wxRect& windowRect, wxDirection dir);
virtual void OnMoveFinished();
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,437 @@
/////////////////////////////////////////////////////////////////////////////
// Name: aui/serializer.h
// Purpose: Documentation of wxAuiSerializer and wxAuiDeserializer.
// Author: Vadim Zeitlin
// Created: 2024-02-20
// Copyright: (c) 2024 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
Description of a docked element layout.
The fields in this struct are shared by wxAuiPaneLayoutInfo and
wxAuiTabLayoutInfo and contain information about the layout of a docked
pane or tab layout.
Note that when saving the objects of this type, fields that have the value
of 0 can be omitted, as this is their default value in any case (except for
`dock_direction` which is never 0), to make the serialized representation
more compact.
@since 3.3.0
*/
struct wxAuiDockLayoutInfo
{
/// Direction of the dock containing the pane.
int dock_direction = wxAUI_DOCK_LEFT;
/// Layer of the dock containing the pane.
int dock_layer = 0;
/// Row of the dock containing the pane.
int dock_row = 0;
/// Position of the pane in the dock containing it.
int dock_pos = 0;
/// Relative proportion of the dock allocated to this pane.
int dock_proportion = 0;
/// Size of the containing dock.
int dock_size = 0;
};
/**
Contains information about the layout of a tab control in a wxAuiNotebook.
This includes where it is docked, via the fields inherited from
wxAuiDockLayoutInfo, and, optionally, the order of pages in it if it was
changed as well as pinned pages indices, if any.
@since 3.3.0
*/
struct wxAuiTabLayoutInfo : wxAuiDockLayoutInfo
{
/**
Indices of the pages in this tab control in their order on screen.
If this vector is empty, it means that the tab control contains all
notebook pages in natural order.
*/
std::vector<int> pages;
/**
Indices of the pinned pages in this tab control.
This vector can be empty if there are no pinned pages in this tab
control. Otherwise it should be a subset of the `pages` vector if it is
not empty.
*/
std::vector<int> pinned;
/**
Index of the currently selected page in this tab control.
Note that the value of this field is a page index in the notebook, not
the position of the active tab in this tab control, and should be one
of the elements of the `pages` vector if it is not empty.
*/
int active = 0;
};
/**
Description of user-modifiable pane layout information.
This struct is used with wxAuiSerializer and wxAuiDeserializer to store the
pane layout. Its fields, including the inherited ones from
wxAuiDockLayoutInfo, have the same meaning as the corresponding fields in
wxAuiPaneInfo (with the exception of `is_maximized` and `is_hidden`, which
rather correspond to the individual bits of its state field), but it
doesn't contain the fields that it wouldn't make sense to serialize.
@since 3.3.0
*/
struct wxAuiPaneLayoutInfo : wxAuiDockLayoutInfo
{
/**
Ctor sets the name, which is always required.
*/
explicit wxAuiPaneLayoutInfo(wxString name);
/// Unique name of the pane.
wxString name;
/// Position of the pane when floating, may be invalid.
wxPoint floating_pos = wxDefaultPosition;
/// Size of the pane when floating, may be invalid.
wxSize floating_size = wxDefaultSize;
/// True if the pane is currently maximized.
bool is_maximized = false;
/// True if the pane is currently hidden.
bool is_hidden = false;
};
/**
@class wxAuiBookSerializer
wxAuiBookSerializer is used for serializing wxAuiNotebook layout.
This includes the tab controls layout and the order of pages in them.
It can be used standalone with wxAuiNotebook::SaveLayout() or as base class
of wxAuiSerializer for saving and restoring the entire layout.
@library{wxaui}
@category{aui}
@since 3.3.0
*/
class wxAuiBookSerializer
{
public:
/// Trivial default ctor.
wxAuiBookSerializer() = default;
/// Trivial but virtual destructor.
virtual ~wxAuiBookSerializer() = default;
/**
Called before starting to save information about the tabs in the
notebook in the AUI pane with the given name.
This function needs to be overridden to keep record of the notebook for
which SaveNotebookTabControl() will be called next.
If this class is used as a base class of wxAuiSerializer, saving
notebook layout may be unnecessary, e.g. because the program doesn't
use wxAuiNotebook at all, and the implementation can be trivial and
just do nothing because it is not going to be called at all if there
are no notebooks in the full layout.
When using wxAuiNotebook::SaveLayout() directly, this function is
always called and is the first function of this class to be called.
*/
virtual void BeforeSaveNotebook(const wxString& name) = 0;
/**
Called to save information about a single tab control in the given
notebook.
This function will be called for all tab controls in the notebook after
BeforeSaveNotebook().
As with that function, it has to be implemented, but can simply do
nothing if saving notebook layout is not necessary.
*/
virtual void SaveNotebookTabControl(const wxAuiTabLayoutInfo& tab) = 0;
/**
Called after saving information about all the pages of the notebook in
the AUI pane with the given name.
Does nothing by default.
*/
virtual void AfterSaveNotebook();
};
/**
@class wxAuiSerializer
wxAuiSerializer is used by wxAuiManager::SaveLayout() to store layout
information.
This is an abstract base class, you need to inherit from it and override its
pure virtual functions, including those inherited from its base
wxAuiBookSerializer class, in your derived class.
In particular, SavePane() must be overridden and will be called by
wxAuiManager for each pane and dock present in the layout. Most of the
other functions don't need to be overridden, but it is often convenient to
perform some actions before or after starting to save the objects of the
given type or at the beginning or end of the whole saving process, so this
class provides hooks for doing it.
If any of the functions of the derived class throw an exception, it is
propagated out of wxAuiManager::SaveLayout() and it's callers responsibility
to handle it.
@library{wxaui}
@category{aui}
@since 3.3.0
*/
class wxAuiSerializer : public wxAuiBookSerializer
{
public:
/// Trivial default ctor.
wxAuiSerializer() = default;
/**
Called before doing anything else.
Does nothing by default.
*/
virtual void BeforeSave();
/**
Called before starting to save information about the panes.
Does nothing by default.
*/
virtual void BeforeSavePanes();
/**
Save information about the given pane.
This function will be called for all panes and must be implemented to
save their data in a format from which it can be restored later using a
matching wxAuiDeserializer implementation.
Note that all sizes and positions in @a pane are using DIPs, i.e.
resolution-independent pixels, when it is passed to this function, so
it does _not_ need to perform any scaling itself to ensure that the
stored values are restored correctly if the resolution changes.
*/
virtual void SavePane(const wxAuiPaneLayoutInfo& pane) = 0;
/**
Called after the last call to SavePane().
Does nothing by default.
*/
virtual void AfterSavePanes();
/**
Called before starting to save information about the notebooks.
Does nothing by default.
Note that this function is called after AfterSavePanes() but may not be
called at all if there are no panes containing wxAuiNotebook.
wxAuiBookSerializer member functions will be called after this function
if it is called at all.
*/
virtual void BeforeSaveNotebooks();
/**
Called after the last call to SaveNotebook().
Does nothing by default.
This function is called after all wxAuiBookSerializer member functions
*/
virtual void AfterSaveNotebooks();
/**
Called after saving everything.
Does nothing by default.
*/
virtual void AfterSave();
};
/**
wxAuiBookDeserializer is used for deserializing wxAuiNotebook layout.
Similarly to wxAuiBookSerializer, it can be used standalone with
wxAuiNotebook::LoadLayout() or as base class of wxAuiDeserializer.
@library{wxaui}
@category{aui}
@since 3.3.0
*/
class wxAuiBookDeserializer
{
public:
/// Trivial default ctor.
wxAuiBookDeserializer() = default;
/// Trivial but virtual destructor.
virtual ~wxAuiBookDeserializer() = default;
/**
Load information about the notebook tabs previously saved by
wxAuiBookSerializer::SaveNotebookTabControl().
When using this class as a base class of wxAuiDeserializer, this
function is called by wxAuiManager::LoadLayout() after loading the pane
with the name @a name if it is a wxAuiNotebook. Otherwise, i.e. when
using wxAuiNotebook::LoadLayout() directly, this function is called
with the same @a name as was passed to that function.
If restoring the notebook layout is not necessary, this function can
just return an empty vector which is interpreted as meaning that the
default notebook layout should be used.
*/
virtual std::vector<wxAuiTabLayoutInfo>
LoadNotebookTabs(const wxString& name) = 0;
/**
Determine what should be done with the pages not attached to any tab
control after restoring the pages order.
It is possible that the data returned by LoadNotebookTabs() doesn't
contain the layout information for all the currently existing pages,
e.g. because data saved by an earlier program version is being loaded
into a newer version in which new pages were added. In this case, this
function is called for each @a page that wasn't assigned to any tab
after restoring the pages order and can be overridden to determine what
should be done with it.
The default implementation of this function just returns @true without
modifying the output arguments, which results in the page being
appended to the main tab control. The overridden version may return
@true but modify @a tabCtrl and @a tabIndex arguments to change where
the page should be inserted, e.g. by setting @a tabIndex to 0 to insert
the new pages at the beginning instead of appending them.
Finally, the overridden function may return @false to indicate that the
page should be removed from the notebook.
@note The @a book parameter can be used to retrieve the total number of
pages or to call functions such as wxAuiNotebook::GetMainTabCtrl()
or wxAuiNotebook::GetAllTabCtrls() on it, but this function must
not attempt to modify it by adding or removing pages to/from it.
*/
virtual bool
HandleOrphanedPage(wxAuiNotebook& book,
int page,
wxAuiTabCtrl** tabCtrl,
int* tabIndex);
};
/**
@class wxAuiDeserializer
wxAuiDeserializer is used by wxAuiManager::LoadLayout() to restore layout
information saved by wxAuiManager::SaveLayout().
As wxAuiSerializer, this is an abstract base class, you need to inherit from
it and override its pure virtual functions in your derived class.
Derived class function also may throw and, if any of them other than
AfterLoad() does, the existing layout is not changed, i.e.
wxAuiManager::LoadLayout() is exception-safe.
@library{wxaui}
@category{aui}
@since 3.3.0
*/
class wxAuiDeserializer : public wxAuiBookDeserializer
{
public:
/**
Constructor taking the manager for which we're restoring the layout.
The manager remains valid for the lifetime of this object.
*/
explicit wxAuiDeserializer(wxAuiManager& manager);
/// Trivial but virtual destructor.
virtual ~wxAuiDeserializer() = default;
/**
Called before doing anything else.
Does nothing by default.
*/
virtual void BeforeLoad();
/**
Load information about all the panes previously saved by
wxAuiSerializer::SavePane().
Unlike the serializer function, this one is called only once and should
return all the panes in the layout.
Just as the serializer function, this one doesn't need to perform any
scaling itself as this will be done, if necessary, by wxAuiManager
itself.
If some pane in the returned vector doesn't already exist, i.e. there
is no pane with the matching name, CreatePaneWindow() is called to
allow creating it on the fly.
*/
virtual std::vector<wxAuiPaneLayoutInfo> LoadPanes() = 0;
/**
Create the window to be managed by the given pane if necessary.
This function is called if any of the panes returned by LoadPanes()
doesn't exist in the existing layout and allows to create windows on
the fly.
If this function returns @NULL, as it does by default, the pane is not
added to the manager.
If the function does create a new window, it should typically modify @a
pane parameter to fill in the fields such as `caption` or `icon` that
wouldn't normally be serialized and so wouldn't be restored by
LoadPanes().
*/
virtual wxWindow* CreatePaneWindow(wxAuiPaneInfo& pane);
/**
Called after restoring everything.
Default implementation calls wxAuiManager::Update(). Override this
function and do _not_ call the base class version if you want to
prevent this from happening, e.g. if you need to make further changes
to the restored layout before updating it.
*/
virtual void AfterLoad();
protected:
/// The manager for which we're restoring the layout.
wxAuiManager& m_manager;
};

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);
};