]> git.saurik.com Git - wxWidgets.git/blame - interface/sashwin.h
don't allow editing listbox entries; better handling of scrollbar styles (#9084)
[wxWidgets.git] / interface / sashwin.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: sashwin.h
e54c96f1 3// Purpose: interface of wxSashWindow
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxSashWindow
11 @wxheader{sashwin.h}
7c913512 12
23324ae1
FM
13 wxSashWindow allows any of its edges to have a sash which can be dragged
14 to resize the window. The actual content window will be created by the
15 application
16 as a child of wxSashWindow. The window (or an ancestor) will be notified of a
17 drag
18 via a wxSashEvent notification.
7c913512 19
23324ae1 20 @beginStyleTable
8c6791e4 21 @style{wxSW_3D}
23324ae1 22 Draws a 3D effect sash and border.
8c6791e4 23 @style{wxSW_3DSASH}
23324ae1 24 Draws a 3D effect sash.
8c6791e4 25 @style{wxSW_3DBORDER}
23324ae1 26 Draws a 3D effect border.
8c6791e4 27 @style{wxSW_BORDER}
23324ae1
FM
28 Draws a thin black border.
29 @endStyleTable
7c913512 30
1f1d2182 31 @beginEventTable{wxSashEvent}
8c6791e4 32 @event{EVT_SASH_DRAGGED(id, func)}
23324ae1
FM
33 Process a wxEVT_SASH_DRAGGED event, when the user has finished
34 dragging a sash.
8c6791e4 35 @event{EVT_SASH_DRAGGED_RANGE(id1, id2, func)}
23324ae1
FM
36 Process a wxEVT_SASH_DRAGGED_RANGE event, when the user has
37 finished dragging a sash. The event handler is called when windows
38 with ids in the given range have their sashes dragged.
39 @endEventTable
7c913512 40
23324ae1
FM
41 @library{wxadv}
42 @category{miscwnd}
7c913512 43
1f1d2182 44 @see wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandling
23324ae1
FM
45*/
46class wxSashWindow : public wxWindow
47{
48public:
49 //@{
50 /**
51 Constructs a sash window, which can be a child of a frame, dialog or any other
52 non-control window.
3c4f71cc 53
7c913512 54 @param parent
4cc4bfaf 55 Pointer to a parent window.
7c913512 56 @param id
4cc4bfaf 57 Window identifier. If -1, will automatically create an identifier.
7c913512 58 @param pos
4cc4bfaf 59 Window position. wxDefaultPosition is (-1, -1) which indicates that
23324ae1 60 wxSashWindows
4cc4bfaf
FM
61 should generate a default position for the window. If using the
62 wxSashWindow class directly, supply
63 an actual position.
7c913512 64 @param size
4cc4bfaf
FM
65 Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows
66 should generate a default size for the window.
7c913512 67 @param style
4cc4bfaf 68 Window style. For window styles, please see wxSashWindow.
7c913512 69 @param name
4cc4bfaf 70 Window name.
23324ae1
FM
71 */
72 wxSashWindow();
7c913512
FM
73 wxSashWindow(wxWindow* parent, wxWindowID id,
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
4cc4bfaf 76 long style = wxCLIP_CHILDREN | wxSW_3D,
7c913512 77 const wxString& name = "sashWindow");
23324ae1
FM
78 //@}
79
80 /**
81 Destructor.
82 */
83 ~wxSashWindow();
84
85 /**
86 Gets the maximum window size in the x direction.
87 */
328f5751 88 int GetMaximumSizeX() const;
23324ae1
FM
89
90 /**
91 Gets the maximum window size in the y direction.
92 */
328f5751 93 int GetMaximumSizeY() const;
23324ae1
FM
94
95 /**
96 Gets the minimum window size in the x direction.
97 */
98 int GetMinimumSizeX();
99
100 /**
101 Gets the minimum window size in the y direction.
102 */
328f5751 103 int GetMinimumSizeY() const;
23324ae1
FM
104
105 /**
106 Returns @true if a sash is visible on the given edge, @false otherwise.
3c4f71cc 107
7c913512 108 @param edge
4cc4bfaf 109 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
3c4f71cc 110
4cc4bfaf 111 @see SetSashVisible()
23324ae1 112 */
328f5751 113 bool GetSashVisible(wxSashEdgePosition edge) const;
23324ae1
FM
114
115 /**
116 Returns @true if the sash has a border, @false otherwise.
117 This function is obsolete since the sash border property is unused.
3c4f71cc 118
7c913512 119 @param edge
4cc4bfaf 120 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
3c4f71cc 121
4cc4bfaf 122 @see SetSashBorder()
23324ae1 123 */
328f5751 124 bool HasBorder(wxSashEdgePosition edge) const;
23324ae1
FM
125
126 /**
127 Sets the maximum window size in the x direction.
128 */
129 void SetMaximumSizeX(int min);
130
131 /**
132 Sets the maximum window size in the y direction.
133 */
134 void SetMaximumSizeY(int min);
135
136 /**
137 Sets the minimum window size in the x direction.
138 */
139 void SetMinimumSizeX(int min);
140
141 /**
142 Sets the minimum window size in the y direction.
143 */
144 void SetMinimumSizeY(int min);
145
146 /**
147 Call this function to give the sash a border, or remove the border.
148 This function is obsolete since the sash border property is unused.
3c4f71cc 149
7c913512 150 @param edge
4cc4bfaf 151 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
7c913512 152 @param hasBorder
4cc4bfaf 153 @true to give the sash a border visible, @false to remove it.
23324ae1
FM
154 */
155 void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
156
157 /**
158 Call this function to make a sash visible or invisible on a particular edge.
3c4f71cc 159
7c913512 160 @param edge
4cc4bfaf 161 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
7c913512 162 @param visible
4cc4bfaf 163 @true to make the sash visible, @false to make it invisible.
3c4f71cc 164
4cc4bfaf 165 @see GetSashVisible()
23324ae1
FM
166 */
167 void SetSashVisible(wxSashEdgePosition edge, bool visible);
168};
169
170
e54c96f1 171
23324ae1
FM
172/**
173 @class wxSashEvent
174 @wxheader{sashwin.h}
7c913512 175
23324ae1
FM
176 A sash event is sent when the sash of a wxSashWindow has been
177 dragged by the user.
7c913512 178
23324ae1
FM
179 @library{wxadv}
180 @category{FIXME}
7c913512 181
e54c96f1 182 @see wxSashWindow, @ref overview_eventhandlingoverview
23324ae1
FM
183*/
184class wxSashEvent : public wxCommandEvent
185{
186public:
187 /**
188 Constructor.
189 */
190 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
191
192 /**
193 Returns the rectangle representing the new size the window would be if the
194 resize was applied. It is
195 up to the application to set the window size if required.
196 */
328f5751 197 wxRect GetDragRect() const;
23324ae1
FM
198
199 /**
200 Returns the status of the sash: one of wxSASH_STATUS_OK,
201 wxSASH_STATUS_OUT_OF_RANGE.
202 If the drag caused the notional bounding box of the window to flip over, for
203 example, the drag will be out of rage.
204 */
328f5751 205 wxSashDragStatus GetDragStatus() const;
23324ae1
FM
206
207 /**
208 Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT,
209 wxSASH_BOTTOM, wxSASH_LEFT.
210 */
328f5751 211 wxSashEdgePosition GetEdge() const;
23324ae1 212};
e54c96f1 213