X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23324ae1c7938ba904770fc456d3c07764b9c5e9..ad51d1c8e95c143eaac1b653ebd2a2124373a4a0:/interface/laywin.h diff --git a/interface/laywin.h b/interface/laywin.h index 4dfe52b28a..a09ff3d194 100644 --- a/interface/laywin.h +++ b/interface/laywin.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: laywin.h -// Purpose: documentation for wxLayoutAlgorithm class +// Purpose: interface of wxLayoutAlgorithm // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -9,7 +9,7 @@ /** @class wxLayoutAlgorithm @wxheader{laywin.h} - + wxLayoutAlgorithm implements layout of subwindows in MDI or SDI frames. It sends a wxCalculateLayoutEvent event to children of the frame, asking them for information about @@ -18,7 +18,7 @@ frames). For SDI (normal) frames, a 'main' window is specified as taking up the remaining space. - + 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 in wxWindow refer to wxLayoutAlgorithm or its events). However, you @@ -26,7 +26,7 @@ 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. - + wxLayoutAlgorithm is typically used in IDE (integrated development environment) applications, where there are several resizable windows in addition to the MDI client window, @@ -34,7 +34,7 @@ other primary editing window. Resizable windows might include toolbars, a project window, and a window for displaying error and warning messages. - + 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 the @@ -43,7 +43,7 @@ which it sends to itself to determine the orientation, alignment and size of the window, which it gets from internal member variables set by the application. - + The algorithm works by starting off with a rectangle equal to the whole frame client area. It iterates through the frame children, generating OnCalculateLayout events @@ -70,7 +70,7 @@ output window take up space at the top and bottom, and then the remaining height in-between is used for the project window. - + wxLayoutAlgorithm is quite independent of the way in which OnCalculateLayout chooses to interpret a window's size and alignment. Therefore you @@ -82,17 +82,15 @@ rather than always assuming stretching. (This could, and probably should, be added to the existing implementation). - + @e Note: wxLayoutAlgorithm has nothing to do with wxLayoutConstraints. It is an alternative way of specifying layouts for which the normal constraint system is unsuitable. - + @library{wxadv} @category{winlayout} - - @seealso - wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandlingoverview "Event - handling overview" + + @see wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandlingoverview */ class wxLayoutAlgorithm : public wxObject { @@ -108,26 +106,23 @@ public: ~wxLayoutAlgorithm(); /** - Lays out the children of a normal frame. @e mainWindow is set to occupy the + Lays out the children of a normal frame. @a mainWindow is set to occupy the remaining space. - This function simply calls LayoutWindow(). */ - bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = @NULL); + bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL) const; /** - Lays out the children of an MDI parent frame. If @e rect is non-@NULL, the + Lays out the children of an MDI parent frame. If @a rect is non-@NULL, the given rectangle will be used as a starting point instead of the frame's client area. - The MDI client window is set to occupy the remaining space. */ - bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = @NULL); + bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL) const; /** Lays out the children of a normal frame or other window. - - @e mainWindow is set to occupy the remaining space. If this is not specified, + @a mainWindow is set to occupy the remaining space. If this is not specified, then the last window that responds to a calculate layout event in query mode will get the remaining space @@ -135,30 +130,29 @@ public: and the window will be set to the remaining size). */ - bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = @NULL); + bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL) const; }; + /** @class wxSashLayoutWindow @wxheader{laywin.h} - + 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. - + @library{wxadv} @category{miscwnd} - - @seealso - wxLayoutAlgorithm, wxSashWindow, @ref overview_eventhandlingoverview "Event - handling overview" + + @see wxLayoutAlgorithm, wxSashWindow, @ref overview_eventhandlingoverview */ class wxSashLayoutWindow : public wxSashWindow { @@ -167,82 +161,74 @@ public: /** Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window. - - @param parent - Pointer to a parent window. - - @param id - Window identifier. If -1, will automatically create an identifier. - - @param pos - Window position. wxDefaultPosition is (-1, -1) which indicates that + + @param parent + Pointer to a parent window. + @param id + Window identifier. If -1, will automatically create an identifier. + @param pos + Window position. wxDefaultPosition is (-1, -1) which indicates that wxSashLayoutWindows - should generate a default position for the window. If using the + should generate a default position for the window. If using the wxSashLayoutWindow class directly, supply - an actual position. - - @param size - Window size. wxDefaultSize is (-1, -1) which indicates that wxSashLayoutWindows - should generate a default size for the window. - - @param style - Window style. For window styles, please see wxSashLayoutWindow. - - @param name - Window name. + an actual position. + @param size + Window size. wxDefaultSize is (-1, -1) which indicates that + wxSashLayoutWindows + should generate a default size for the window. + @param style + Window style. For window styles, please see wxSashLayoutWindow. + @param name + Window name. */ wxSashLayoutWindow(); - wxSashLayoutWindow(wxSashLayoutWindow* parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCLIP_CHILDREN | wxSW_3D, - const wxString& name = "layoutWindow"); + wxSashLayoutWindow(wxSashLayoutWindow* parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxCLIP_CHILDREN | wxSW_3D, + const wxString& name = "layoutWindow"); //@} /** Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window. - - @param parent - Pointer to a parent window. - - @param id - Window identifier. If -1, will automatically create an identifier. - - @param pos - Window position. wxDefaultPosition is (-1, -1) which indicates that + + @param parent + Pointer to a parent window. + @param id + Window identifier. If -1, will automatically create an identifier. + @param pos + Window position. wxDefaultPosition is (-1, -1) which indicates that wxSashLayoutWindows - should generate a default position for the window. If using the + should generate a default position for the window. If using the wxSashLayoutWindow class directly, supply - an actual position. - - @param size - Window size. wxDefaultSize is (-1, -1) which indicates that wxSashLayoutWindows - should generate a default size for the window. - - @param style - Window style. For window styles, please see wxSashLayoutWindow. - - @param name - Window name. + an actual position. + @param size + Window size. wxDefaultSize is (-1, -1) which indicates that + wxSashLayoutWindows + should generate a default size for the window. + @param style + Window style. For window styles, please see wxSashLayoutWindow. + @param name + Window name. */ bool Create(wxSashLayoutWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCLIP_CHILDREN | wxSW_3D, + long style = wxCLIP_CHILDREN | wxSW_3D, const wxString& name = "layoutWindow"); /** Returns the alignment of the window: one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM. */ - wxLayoutAlignment GetAlignment(); + wxLayoutAlignment GetAlignment() const; /** Returns the orientation of the window: one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL. */ - wxLayoutOrientation GetOrientation(); + wxLayoutOrientation GetOrientation() const; /** The default handler for the event that is generated by wxLayoutAlgorithm. The @@ -266,7 +252,7 @@ public: /** Sets the alignment of the window (which edge of the available parent client area the window - is attached to). @e alignment is one of wxLAYOUT_TOP, wxLAYOUT_LEFT, + is attached to). @a alignment is one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM. */ void SetAlignment(wxLayoutAlignment alignment); @@ -282,27 +268,27 @@ public: /** Sets the orientation of the window (the direction the window will stretch in, to fill the available - parent client area). @e orientation is one of wxLAYOUT_HORIZONTAL, + parent client area). @a orientation is one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL. */ void SetOrientation(wxLayoutOrientation orientation); }; + /** @class wxQueryLayoutInfoEvent @wxheader{laywin.h} - + 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. - + @library{wxadv} @category{events} - - @seealso - wxCalculateLayoutEvent, wxSashLayoutWindow, wxLayoutAlgorithm. + + @see wxCalculateLayoutEvent, wxSashLayoutWindow, wxLayoutAlgorithm. */ class wxQueryLayoutInfoEvent : public wxEvent { @@ -318,32 +304,32 @@ public: the window sticks to). One of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM. */ - void GetAlignment(); + void GetAlignment() const; /** Returns the flags associated with this event. Not currently used. */ - int GetFlags(); + int GetFlags() const; /** Returns the orientation that the event handler specified to the event object. May be one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL. */ - wxLayoutOrientation GetOrientation(); + wxLayoutOrientation GetOrientation() const; /** Returns the requested length of the window in the direction of the window orientation. This information is not yet used. */ - int GetRequestedLength(); + int GetRequestedLength() const; /** Returns the size that the event handler specified to the event object as being the requested size of the window. */ - wxSize GetSize(); + wxSize GetSize() const; /** Call this to specify the alignment of the window (which side of the remaining @@ -379,19 +365,19 @@ public: }; + /** @class wxCalculateLayoutEvent @wxheader{laywin.h} - + This event is sent by wxLayoutAlgorithm to calculate the amount of the remaining client area that the window should occupy. - + @library{wxadv} @category{events} - - @seealso - wxQueryLayoutInfoEvent, wxSashLayoutWindow, wxLayoutAlgorithm. + + @see wxQueryLayoutInfoEvent, wxSashLayoutWindow, wxLayoutAlgorithm. */ class wxCalculateLayoutEvent : public wxEvent { @@ -404,7 +390,7 @@ public: /** Returns the flags associated with this event. Not currently used. */ - int GetFlags(); + int GetFlags() const; /** Before the event handler is entered, returns the remaining parent client area @@ -413,7 +399,7 @@ public: parent client rectangle, after the event handler has subtracted the area that its window occupies. */ - wxRect GetRect(); + wxRect GetRect() const; /** Sets the flags associated with this event. Not currently used. @@ -427,3 +413,4 @@ public: */ void SetRect(const wxRect& rect); }; +