]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/sashwin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSashWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 wxSashWindow allows any of its edges to have a sash which can be dragged
13 to resize the window. The actual content window will be created by the
15 as a child of wxSashWindow. The window (or an ancestor) will be notified of a
17 via a wxSashEvent notification.
21 Draws a 3D effect sash and border.
23 Draws a 3D effect sash.
25 Draws a 3D effect border.
27 Draws a thin black border.
30 @beginEventTable{wxSashEvent}
31 @event{EVT_SASH_DRAGGED(id, func)}
32 Process a wxEVT_SASH_DRAGGED event, when the user has finished
34 @event{EVT_SASH_DRAGGED_RANGE(id1, id2, func)}
35 Process a wxEVT_SASH_DRAGGED_RANGE event, when the user has
36 finished dragging a sash. The event handler is called when windows
37 with ids in the given range have their sashes dragged.
43 @see wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandling
45 class wxSashWindow
: public wxWindow
50 Constructs a sash window, which can be a child of a frame, dialog or any other
54 Pointer to a parent window.
56 Window identifier. If -1, will automatically create an identifier.
58 Window position. wxDefaultPosition is (-1, -1) which indicates that
60 should generate a default position for the window. If using the
61 wxSashWindow class directly, supply
64 Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows
65 should generate a default size for the window.
67 Window style. For window styles, please see wxSashWindow.
72 wxSashWindow(wxWindow
* parent
, wxWindowID id
,
73 const wxPoint
& pos
= wxDefaultPosition
,
74 const wxSize
& size
= wxDefaultSize
,
75 long style
= wxCLIP_CHILDREN
| wxSW_3D
,
76 const wxString
& name
= "sashWindow");
85 Gets the maximum window size in the x direction.
87 int GetMaximumSizeX() const;
90 Gets the maximum window size in the y direction.
92 int GetMaximumSizeY() const;
95 Gets the minimum window size in the x direction.
97 int GetMinimumSizeX();
100 Gets the minimum window size in the y direction.
102 int GetMinimumSizeY() const;
105 Returns @true if a sash is visible on the given edge, @false otherwise.
108 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
110 @see SetSashVisible()
112 bool GetSashVisible(wxSashEdgePosition edge
) const;
115 Returns @true if the sash has a border, @false otherwise.
116 This function is obsolete since the sash border property is unused.
119 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
123 bool HasBorder(wxSashEdgePosition edge
) const;
126 Sets the maximum window size in the x direction.
128 void SetMaximumSizeX(int min
);
131 Sets the maximum window size in the y direction.
133 void SetMaximumSizeY(int min
);
136 Sets the minimum window size in the x direction.
138 void SetMinimumSizeX(int min
);
141 Sets the minimum window size in the y direction.
143 void SetMinimumSizeY(int min
);
146 Call this function to give the sash a border, or remove the border.
147 This function is obsolete since the sash border property is unused.
150 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
152 @true to give the sash a border visible, @false to remove it.
154 void SetSashBorder(wxSashEdgePosition edge
, bool hasBorder
);
157 Call this function to make a sash visible or invisible on a particular edge.
160 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
162 @true to make the sash visible, @false to make it invisible.
164 @see GetSashVisible()
166 void SetSashVisible(wxSashEdgePosition edge
, bool visible
);
174 A sash event is sent when the sash of a wxSashWindow has been
180 @see wxSashWindow, @ref overview_eventhandlingoverview
182 class wxSashEvent
: public wxCommandEvent
188 wxSashEvent(int id
= 0, wxSashEdgePosition edge
= wxSASH_NONE
);
191 Returns the rectangle representing the new size the window would be if the
192 resize was applied. It is
193 up to the application to set the window size if required.
195 wxRect
GetDragRect() const;
198 Returns the status of the sash: one of wxSASH_STATUS_OK,
199 wxSASH_STATUS_OUT_OF_RANGE.
200 If the drag caused the notional bounding box of the window to flip over, for
201 example, the drag will be out of rage.
203 wxSashDragStatus
GetDragStatus() const;
206 Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT,
207 wxSASH_BOTTOM, wxSASH_LEFT.
209 wxSashEdgePosition
GetEdge() const;