2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: laywin.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxLayoutAlgorithm
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-10-22 16:03:19 -04:00
|
|
|
/**
|
|
|
|
Enumeration used by wxLayoutAlgorithm.
|
|
|
|
*/
|
|
|
|
enum wxLayoutOrientation
|
|
|
|
{
|
|
|
|
wxLAYOUT_HORIZONTAL,
|
|
|
|
wxLAYOUT_VERTICAL
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enumeration used by wxLayoutAlgorithm.
|
|
|
|
*/
|
|
|
|
enum wxLayoutAlignment
|
|
|
|
{
|
|
|
|
wxLAYOUT_NONE,
|
|
|
|
wxLAYOUT_TOP,
|
|
|
|
wxLAYOUT_LEFT,
|
|
|
|
wxLAYOUT_RIGHT,
|
|
|
|
wxLAYOUT_BOTTOM
|
|
|
|
};
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxLayoutAlgorithm
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxLayoutAlgorithm implements layout of subwindows in MDI or SDI frames.
|
2008-10-22 16:03:19 -04:00
|
|
|
It sends a wxCalculateLayoutEvent event to children of the frame, asking them
|
|
|
|
for information about their size. For MDI parent frames, the algorithm allocates
|
|
|
|
the remaining space to the MDI client window (which contains the MDI child frames).
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
For SDI (normal) frames, a 'main' window is specified as taking up the
|
|
|
|
remaining space.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Because the event system is used, this technique can be applied to any windows,
|
|
|
|
which are not necessarily 'aware' of the layout classes (no virtual functions
|
2008-10-22 16:03:19 -04:00
|
|
|
in wxWindow refer to wxLayoutAlgorithm or its events).
|
|
|
|
However, you may wish to use wxSashLayoutWindow for your subwindows since this
|
|
|
|
class provides handlers for the required events, and accessors to specify the
|
|
|
|
desired size of the window. The sash behaviour in the base class can be used,
|
|
|
|
optionally, to make the windows user-resizable.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxLayoutAlgorithm is typically used in IDE (integrated development environment)
|
2008-10-22 16:03:19 -04:00
|
|
|
applications, where there are several resizable windows in addition to the MDI
|
|
|
|
client window, or other primary editing window. Resizable windows might include
|
|
|
|
toolbars, a project window, and a window for displaying error and warning messages.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
When a window receives an OnCalculateLayout event, it should call SetRect in
|
|
|
|
the given event object, to be the old supplied rectangle minus whatever space
|
2008-10-22 16:03:19 -04:00
|
|
|
the window takes up. It should also set its own size accordingly.
|
2008-03-08 08:52:38 -05:00
|
|
|
wxSashLayoutWindow::OnCalculateLayout generates an OnQueryLayoutInfo event
|
|
|
|
which it sends to itself to determine the orientation, alignment and size of
|
2008-10-22 16:03:19 -04:00
|
|
|
the window, which it gets from internal member variables set by the application.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The algorithm works by starting off with a rectangle equal to the whole frame
|
2008-10-22 16:03:19 -04:00
|
|
|
client area. It iterates through the frame children, generating
|
|
|
|
wxLayoutAlgorithm::OnCalculateLayout events which subtract the window size and
|
|
|
|
return the remaining rectangle for the next window to process.
|
|
|
|
It is assumed (by wxSashLayoutWindow::OnCalculateLayout) that a window stretches
|
|
|
|
the full dimension of the frame client, according to the orientation it specifies.
|
|
|
|
For example, a horizontal window will stretch the full width of the remaining
|
|
|
|
portion of the frame client area.
|
2008-03-08 08:52:38 -05:00
|
|
|
In the other orientation, the window will be fixed to whatever size was
|
2008-10-22 16:03:19 -04:00
|
|
|
specified by wxLayoutAlgorithm::OnQueryLayoutInfo. An alignment setting will
|
|
|
|
make the window 'stick' to the left, top, right or bottom of the remaining
|
|
|
|
client area. This scheme implies that order of window creation is important.
|
2008-03-08 08:52:38 -05:00
|
|
|
Say you wish to have an extra toolbar at the top of the frame, a project window
|
2008-10-22 16:03:19 -04:00
|
|
|
to the left of the MDI client window, and an output window above the status bar.
|
|
|
|
You should therefore create the windows in this order: toolbar, output window,
|
|
|
|
project window. This ensures that the toolbar and output window take up space
|
|
|
|
at the top and bottom, and then the remaining height in-between is used for
|
2008-03-08 08:52:38 -05:00
|
|
|
the project window.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxLayoutAlgorithm is quite independent of the way in which
|
2008-10-22 16:03:19 -04:00
|
|
|
wxLayoutAlgorithm::OnCalculateLayout chooses to interpret a window's size and
|
|
|
|
alignment. Therefore you could implement a different window class with a new
|
|
|
|
wxLayoutAlgorithm::OnCalculateLayout event handler, that has a more sophisticated
|
|
|
|
way of laying out the windows. It might allow specification of whether stretching
|
|
|
|
occurs in the specified orientation, for example, rather than always assuming
|
|
|
|
stretching.
|
|
|
|
(This could, and probably should, be added to the existing implementation).
|
|
|
|
|
|
|
|
@note wxLayoutAlgorithm has nothing to do with wxLayoutConstraints.
|
|
|
|
It is an alternative way of specifying layouts for which the normal
|
|
|
|
constraint system is unsuitable.
|
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxQueryLayoutInfoEvent,wxCalculateLayoutEvent}
|
2008-10-22 16:03:19 -04:00
|
|
|
@event{EVT_QUERY_LAYOUT_INFO(func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
Process a @c wxEVT_QUERY_LAYOUT_INFO event, to get size, orientation and
|
2008-10-22 16:03:19 -04:00
|
|
|
alignment from a window. See wxQueryLayoutInfoEvent.
|
|
|
|
@event{EVT_CALCULATE_LAYOUT(func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
Process a @c wxEVT_CALCULATE_LAYOUT event, which asks the window to take a
|
2008-10-22 16:03:19 -04:00
|
|
|
'bite' out of a rectangle provided by the algorithm. See wxCalculateLayoutEvent.
|
|
|
|
@endEventTable
|
|
|
|
|
|
|
|
Note that the algorithm object does not respond to events, but itself generates the
|
|
|
|
previous events in order to calculate window sizes.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{winlayout}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-17 19:19:22 -05:00
|
|
|
@see wxSashEvent, wxSashLayoutWindow, @ref overview_events
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxLayoutAlgorithm : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxLayoutAlgorithm();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxLayoutAlgorithm();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Lays out the children of a normal frame. @a mainWindow is set to occupy the
|
2008-10-22 16:03:19 -04:00
|
|
|
remaining space. This function simply calls LayoutWindow().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Lays out the children of an MDI parent frame. If @a rect is non-@NULL, the
|
2008-03-08 08:52:38 -05:00
|
|
|
given rectangle will be used as a starting point instead of the frame's client
|
2008-10-22 16:03:19 -04:00
|
|
|
area. The MDI client window is set to occupy the remaining space.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Lays out the children of a normal frame or other window.
|
2008-10-22 16:03:19 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@a mainWindow is set to occupy the remaining space. If this is not specified,
|
2008-10-22 16:03:19 -04:00
|
|
|
then the last window that responds to a calculate layout event in query mode will
|
|
|
|
get the remaining space (that is, a non-query OnCalculateLayout event will
|
|
|
|
not be sent to this window and the window will be set to the remaining size).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSashLayoutWindow
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-22 16:03:19 -04:00
|
|
|
wxSashLayoutWindow responds to OnCalculateLayout events generated by wxLayoutAlgorithm.
|
|
|
|
It allows the application to use simple accessors to specify how the window
|
|
|
|
should be laid out, rather than having to respond to events.
|
|
|
|
|
|
|
|
The fact that the class derives from wxSashWindow allows sashes to be used if
|
|
|
|
required, to allow the windows to be user-resizable.
|
|
|
|
|
|
|
|
The documentation for wxLayoutAlgorithm explains the purpose of this class in
|
|
|
|
more detail.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-22 16:03:19 -04:00
|
|
|
For the window styles see wxSashWindow.
|
|
|
|
|
|
|
|
This class handles the EVT_QUERY_LAYOUT_INFO and EVT_CALCULATE_LAYOUT events
|
|
|
|
for you. However, if you use sashes, see wxSashWindow for relevant event information.
|
|
|
|
See also wxLayoutAlgorithm for information about the layout events.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-17 19:19:22 -05:00
|
|
|
@see wxLayoutAlgorithm, wxSashWindow, @ref overview_events
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSashLayoutWindow : public wxSashWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-10-22 16:03:19 -04:00
|
|
|
/**
|
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxSashLayoutWindow();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructs a sash layout window, which can be a child of a frame, dialog or any
|
|
|
|
other non-control window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Pointer to a parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. If -1, will automatically create an identifier.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position. wxDefaultPosition is (-1, -1) which indicates that
|
2008-10-22 16:03:19 -04:00
|
|
|
wxSashLayoutWindows should generate a default position for the window.
|
|
|
|
If using the wxSashLayoutWindow class directly, supply an actual position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Window size. wxDefaultSize is (-1, -1) which indicates that
|
2008-10-22 16:03:19 -04:00
|
|
|
wxSashLayoutWindows should generate a default size for the window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. For window styles, please see wxSashLayoutWindow.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2012-05-29 23:13:27 -04:00
|
|
|
wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxCLIP_CHILDREN | wxSW_3D,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& name = "layoutWindow");
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Initializes a sash layout window, which can be a child of a frame, dialog or
|
|
|
|
any other non-control window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Pointer to a parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. If -1, will automatically create an identifier.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position. wxDefaultPosition is (-1, -1) which indicates that
|
2008-10-22 16:03:19 -04:00
|
|
|
wxSashLayoutWindows should generate a default position for the window.
|
|
|
|
If using the wxSashLayoutWindow class directly, supply an actual position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Window size. wxDefaultSize is (-1, -1) which indicates that
|
2008-10-22 16:03:19 -04:00
|
|
|
wxSashLayoutWindows should generate a default size for the window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. For window styles, please see wxSashLayoutWindow.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxCLIP_CHILDREN | wxSW_3D,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxString& name = "layoutWindow");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the alignment of the window: one of wxLAYOUT_TOP, wxLAYOUT_LEFT,
|
|
|
|
wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxLayoutAlignment GetAlignment() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the orientation of the window: one of wxLAYOUT_HORIZONTAL,
|
|
|
|
wxLAYOUT_VERTICAL.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxLayoutOrientation GetOrientation() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-22 16:03:19 -04:00
|
|
|
The default handler for the event that is generated by wxLayoutAlgorithm.
|
|
|
|
The implementation of this function calls wxCalculateLayoutEvent::SetRect
|
|
|
|
to shrink the provided size according to how much space this window takes up.
|
|
|
|
For further details, see wxLayoutAlgorithm and wxCalculateLayoutEvent.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void OnCalculateLayout(wxCalculateLayoutEvent& event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
The default handler for the event that is generated by OnCalculateLayout to get
|
2008-10-22 16:03:19 -04:00
|
|
|
size, alignment and orientation information for the window.
|
|
|
|
The implementation of this function uses member variables as set by accessors
|
|
|
|
called by the application.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
For further details, see wxLayoutAlgorithm and wxQueryLayoutInfoEvent.
|
|
|
|
*/
|
|
|
|
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the alignment of the window (which edge of the available parent client
|
2008-10-22 16:03:19 -04:00
|
|
|
area the window is attached to). @a alignment is one of wxLAYOUT_TOP, wxLAYOUT_LEFT,
|
2008-03-08 08:52:38 -05:00
|
|
|
wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.
|
|
|
|
*/
|
|
|
|
void SetAlignment(wxLayoutAlignment alignment);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the default dimensions of the window. The dimension other than the
|
2008-10-22 16:03:19 -04:00
|
|
|
orientation will be fixed to this value, and the orientation dimension
|
|
|
|
will be ignored and the window stretched to fit the available space.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetDefaultSize(const wxSize& size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the orientation of the window (the direction the window will stretch in,
|
2008-10-22 16:03:19 -04:00
|
|
|
to fill the available parent client area). @a orientation is one of
|
|
|
|
wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetOrientation(wxLayoutOrientation orientation);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxQueryLayoutInfoEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-22 16:03:19 -04:00
|
|
|
This event is sent when wxLayoutAlgorithm wishes to get the size, orientation
|
|
|
|
and alignment of a window. More precisely, the event is sent by the
|
|
|
|
OnCalculateLayout handler which is itself invoked by wxLayoutAlgorithm.
|
|
|
|
|
|
|
|
@beginEventTable{wxQueryLayoutInfoEvent}
|
|
|
|
@event{EVT_QUERY_LAYOUT_INFO(func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
Process a @c wxEVT_QUERY_LAYOUT_INFO event, to get size, orientation and alignment
|
2008-10-22 16:03:19 -04:00
|
|
|
from a window.
|
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxCalculateLayoutEvent, wxSashLayoutWindow, wxLayoutAlgorithm.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxQueryLayoutInfoEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxQueryLayoutInfoEvent(wxWindowID id = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Specifies the alignment of the window (which side of the remaining parent
|
2008-10-22 16:03:19 -04:00
|
|
|
client area the window sticks to).
|
|
|
|
One of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
wxLayoutAlignment GetAlignment() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the flags associated with this event. Not currently used.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetFlags() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the orientation that the event handler specified to the event object.
|
2008-10-22 16:03:19 -04:00
|
|
|
May be one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxLayoutOrientation GetOrientation() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the requested length of the window in the direction of the window
|
2008-10-22 16:03:19 -04:00
|
|
|
orientation. This information is not yet used.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetRequestedLength() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the size that the event handler specified to the event object as being
|
|
|
|
the requested size of the window.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSize GetSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Call this to specify the alignment of the window (which side of the remaining
|
2008-10-22 16:03:19 -04:00
|
|
|
parent client area the window sticks to).
|
|
|
|
May be one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAlignment(wxLayoutAlignment alignment);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the flags associated with this event. Not currently used.
|
|
|
|
*/
|
|
|
|
void SetFlags(int flags);
|
|
|
|
|
|
|
|
/**
|
2008-10-22 16:03:19 -04:00
|
|
|
Call this to specify the orientation of the window.
|
|
|
|
May be one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetOrientation(wxLayoutOrientation orientation);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the requested length of the window in the direction of the window
|
2008-10-22 16:03:19 -04:00
|
|
|
orientation. This information is not yet used.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetRequestedLength(int length);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Call this to let the calling code know what the size of the window is.
|
|
|
|
*/
|
|
|
|
void SetSize(const wxSize& size);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-05-29 23:13:27 -04:00
|
|
|
wxEventType wxEVT_QUERY_LAYOUT_INFO;
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxCalculateLayoutEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-22 16:03:19 -04:00
|
|
|
This event is sent by wxLayoutAlgorithm to calculate the amount of the
|
|
|
|
remaining client area that the window should occupy.
|
|
|
|
|
|
|
|
@beginEventTable{wxCalculateLayoutEvent}
|
|
|
|
@event{EVT_CALCULATE_LAYOUT(func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
Process a @c wxEVT_CALCULATE_LAYOUT event, which asks the window to take a
|
2008-10-22 16:03:19 -04:00
|
|
|
'bite' out of a rectangle provided by the algorithm.
|
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxQueryLayoutInfoEvent, wxSashLayoutWindow, wxLayoutAlgorithm.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxCalculateLayoutEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxCalculateLayoutEvent(wxWindowID id = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the flags associated with this event. Not currently used.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetFlags() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Before the event handler is entered, returns the remaining parent client area
|
2008-10-22 16:03:19 -04:00
|
|
|
that the window could occupy.
|
|
|
|
|
|
|
|
When the event handler returns, this should contain the remaining parent
|
|
|
|
client rectangle, after the event handler has subtracted the area that its
|
|
|
|
window occupies.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxRect GetRect() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the flags associated with this event. Not currently used.
|
|
|
|
*/
|
|
|
|
void SetFlags(int flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Call this to specify the new remaining parent client area, after the space
|
2008-10-22 16:03:19 -04:00
|
|
|
occupied by the window has been subtracted.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetRect(const wxRect& rect);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2012-05-29 23:13:27 -04:00
|
|
|
wxEventType wxEVT_CALCULATE_LAYOUT;
|
|
|
|
|