1 | /************************************************************************
|
---|
2 | filename: CEGUIFrameWindow.h
|
---|
3 | created: 13/4/2004
|
---|
4 | author: Paul D Turner
|
---|
5 |
|
---|
6 | purpose: Interface to base class for FrameWindow
|
---|
7 | *************************************************************************/
|
---|
8 | /*************************************************************************
|
---|
9 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
10 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
11 |
|
---|
12 | This library is free software; you can redistribute it and/or
|
---|
13 | modify it under the terms of the GNU Lesser General Public
|
---|
14 | License as published by the Free Software Foundation; either
|
---|
15 | version 2.1 of the License, or (at your option) any later version.
|
---|
16 |
|
---|
17 | This library is distributed in the hope that it will be useful,
|
---|
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | Lesser General Public License for more details.
|
---|
21 |
|
---|
22 | You should have received a copy of the GNU Lesser General Public
|
---|
23 | License along with this library; if not, write to the Free Software
|
---|
24 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
25 | *************************************************************************/
|
---|
26 | #ifndef _CEGUIFrameWindow_h_
|
---|
27 | #define _CEGUIFrameWindow_h_
|
---|
28 |
|
---|
29 | #include "CEGUIBase.h"
|
---|
30 | #include "CEGUIWindow.h"
|
---|
31 | #include "elements/CEGUIFrameWindowProperties.h"
|
---|
32 |
|
---|
33 |
|
---|
34 | #if defined(_MSC_VER)
|
---|
35 | # pragma warning(push)
|
---|
36 | # pragma warning(disable : 4251)
|
---|
37 | #endif
|
---|
38 |
|
---|
39 |
|
---|
40 | // Start of CEGUI namespace section
|
---|
41 | namespace CEGUI
|
---|
42 | {
|
---|
43 | /*!
|
---|
44 | \brief
|
---|
45 | Abstract base class for a movable, sizable, window with a title-bar and a frame.
|
---|
46 | */
|
---|
47 | class CEGUIEXPORT FrameWindow : public Window
|
---|
48 | {
|
---|
49 | public:
|
---|
50 | static const String EventNamespace; //!< Namespace for global events
|
---|
51 |
|
---|
52 |
|
---|
53 | /*************************************************************************
|
---|
54 | Constants
|
---|
55 | *************************************************************************/
|
---|
56 | // additional event names for this window
|
---|
57 | static const String EventRollupToggled; //!< Fired when the rollup (shade) state of the window changes
|
---|
58 | static const String EventCloseClicked; //!< Fired when the close button for the window is clicked.
|
---|
59 |
|
---|
60 | // other bits
|
---|
61 | static const float DefaultSizingBorderSize; //!< Default size for the sizing border (in pixels)
|
---|
62 |
|
---|
63 |
|
---|
64 | /*!
|
---|
65 | \brief
|
---|
66 | Enumeration that defines the set of possible locations for the mouse on a frame windows sizing border.
|
---|
67 | */
|
---|
68 | enum SizingLocation {
|
---|
69 | SizingNone, //!< Position is not a sizing location.
|
---|
70 | SizingTopLeft, //!< Position will size from the top-left.
|
---|
71 | SizingTopRight, //!< Position will size from the top-right.
|
---|
72 | SizingBottomLeft, //!< Position will size from the bottom left.
|
---|
73 | SizingBottomRight, //!< Position will size from the bottom right.
|
---|
74 | SizingTop, //!< Position will size from the top.
|
---|
75 | SizingLeft, //!< Position will size from the left.
|
---|
76 | SizingBottom, //!< Position will size from the bottom.
|
---|
77 | SizingRight //!< Position will size from the right.
|
---|
78 | };
|
---|
79 |
|
---|
80 | /*!
|
---|
81 | \brief
|
---|
82 | Initialises the Window based object ready for use.
|
---|
83 |
|
---|
84 | \note
|
---|
85 | This must be called for every window created. Normally this is handled automatically by the WindowFactory for each Window type.
|
---|
86 |
|
---|
87 | \return
|
---|
88 | Nothing
|
---|
89 | */
|
---|
90 | virtual void initialise(void);
|
---|
91 |
|
---|
92 |
|
---|
93 | /*!
|
---|
94 | \brief
|
---|
95 | Return whether this window is sizable. Note that this requires that the window have an enabled frame and that sizing itself is enabled
|
---|
96 |
|
---|
97 | \return
|
---|
98 | true if the window can be sized, false if the window can not be sized
|
---|
99 | */
|
---|
100 | bool isSizingEnabled(void) const {return d_sizingEnabled && isFrameEnabled();}
|
---|
101 |
|
---|
102 |
|
---|
103 | /*!
|
---|
104 | \brief
|
---|
105 | Return whether the frame for this window is enabled.
|
---|
106 |
|
---|
107 | \return
|
---|
108 | true if the frame for this window is enabled, false if the frame for this window is disabled.
|
---|
109 | */
|
---|
110 | bool isFrameEnabled(void) const {return d_frameEnabled;}
|
---|
111 |
|
---|
112 |
|
---|
113 | /*!
|
---|
114 | \brief
|
---|
115 | Return whether the title bar for this window is enabled.
|
---|
116 |
|
---|
117 | \return
|
---|
118 | true if the window has a title bar and it is enabled, false if the window has no title bar or if the title bar is disabled.
|
---|
119 | */
|
---|
120 | bool isTitleBarEnabled(void) const {return (d_titlebar != NULL) && !((Window*)d_titlebar)->isDisabled();}
|
---|
121 |
|
---|
122 |
|
---|
123 | /*!
|
---|
124 | \brief
|
---|
125 | Return whether this close button for this window is enabled.
|
---|
126 |
|
---|
127 | \return
|
---|
128 | true if the window has a close button and it is enabled, false if the window either has no close button or if the close button is disabled.
|
---|
129 | */
|
---|
130 | bool isCloseButtonEnabled(void) const {return (d_closeButton != NULL) && !((Window*)d_closeButton)->isDisabled();}
|
---|
131 |
|
---|
132 |
|
---|
133 | /*!
|
---|
134 | \brief
|
---|
135 | Return whether roll up (a.k.a shading) is enabled for this window.
|
---|
136 |
|
---|
137 | \return
|
---|
138 | true if roll up is enabled, false if roll up is disabled.
|
---|
139 | */
|
---|
140 | bool isRollupEnabled(void) const {return d_rollupEnabled;}
|
---|
141 |
|
---|
142 |
|
---|
143 | /*!
|
---|
144 | \brief
|
---|
145 | Return whether the window is currently rolled up (a.k.a shaded).
|
---|
146 |
|
---|
147 | \return
|
---|
148 | true if the window is rolled up, false if the window is not rolled up.
|
---|
149 | */
|
---|
150 | bool isRolledup(void) const {return d_rolledup;}
|
---|
151 |
|
---|
152 |
|
---|
153 | /*!
|
---|
154 | \brief
|
---|
155 | Return the thickness of the sizing border.
|
---|
156 |
|
---|
157 | \return
|
---|
158 | float value describing the thickness of the sizing border in screen pixels.
|
---|
159 | */
|
---|
160 | float getSizingBorderThickness(void) const {return d_borderSize;}
|
---|
161 |
|
---|
162 |
|
---|
163 | /*!
|
---|
164 | \brief
|
---|
165 | Enables or disables sizing for this window.
|
---|
166 |
|
---|
167 | \param setting
|
---|
168 | set to true to enable sizing (also requires frame to be enabled), or false to disable sizing.
|
---|
169 |
|
---|
170 | \return
|
---|
171 | nothing
|
---|
172 | */
|
---|
173 | void setSizingEnabled(bool setting);
|
---|
174 |
|
---|
175 |
|
---|
176 | /*!
|
---|
177 | \brief
|
---|
178 | Enables or disables the frame for this window.
|
---|
179 |
|
---|
180 | \param setting
|
---|
181 | set to true to enable the frame for this window, or false to disable the frame for this window.
|
---|
182 |
|
---|
183 | \return
|
---|
184 | Nothing.
|
---|
185 | */
|
---|
186 | void setFrameEnabled(bool setting);
|
---|
187 |
|
---|
188 |
|
---|
189 | /*!
|
---|
190 | \brief
|
---|
191 | Enables or disables the title bar for the frame window.
|
---|
192 |
|
---|
193 | \param setting
|
---|
194 | set to true to enable the title bar (if one is attached), or false to disable the title bar.
|
---|
195 |
|
---|
196 | \return
|
---|
197 | Nothing.
|
---|
198 | */
|
---|
199 | void setTitleBarEnabled(bool setting);
|
---|
200 |
|
---|
201 |
|
---|
202 | /*!
|
---|
203 | \brief
|
---|
204 | Enables or disables the close button for the frame window.
|
---|
205 |
|
---|
206 | \param setting
|
---|
207 | Set to true to enable the close button (if one is attached), or false to disable the close button.
|
---|
208 |
|
---|
209 | \return
|
---|
210 | Nothing.
|
---|
211 | */
|
---|
212 | void setCloseButtonEnabled(bool setting);
|
---|
213 |
|
---|
214 |
|
---|
215 | /*!
|
---|
216 | \brief
|
---|
217 | Enables or disables roll-up (shading) for this window.
|
---|
218 |
|
---|
219 | \param setting
|
---|
220 | Set to true to enable roll-up for the frame window, or false to disable roll-up.
|
---|
221 |
|
---|
222 | \return
|
---|
223 | Nothing.
|
---|
224 | */
|
---|
225 | void setRollupEnabled(bool setting);
|
---|
226 |
|
---|
227 |
|
---|
228 | /*!
|
---|
229 | \brief
|
---|
230 | Toggles the state of the window between rolled-up (shaded) and normal sizes. This requires roll-up to be enabled.
|
---|
231 |
|
---|
232 | \return
|
---|
233 | Nothing
|
---|
234 | */
|
---|
235 | void toggleRollup(void);
|
---|
236 |
|
---|
237 |
|
---|
238 | /*!
|
---|
239 | \brief
|
---|
240 | Set the size of the sizing border for this window.
|
---|
241 |
|
---|
242 | \param pixels
|
---|
243 | float value specifying the thickness for the sizing border in screen pixels.
|
---|
244 |
|
---|
245 | \return
|
---|
246 | Nothing.
|
---|
247 | */
|
---|
248 | void setSizingBorderThickness(float pixels) {d_borderSize = pixels;}
|
---|
249 |
|
---|
250 |
|
---|
251 | /*!
|
---|
252 | \brief
|
---|
253 | Set the font to use for the title bar text
|
---|
254 |
|
---|
255 | \param name
|
---|
256 | String object holding the name of the font to use.
|
---|
257 |
|
---|
258 | \return
|
---|
259 | Nothing.
|
---|
260 | */
|
---|
261 | void setTitlebarFont(const String& name);
|
---|
262 |
|
---|
263 |
|
---|
264 | /*!
|
---|
265 | \brief
|
---|
266 | Set the font to use for the title bar text
|
---|
267 |
|
---|
268 | \param font
|
---|
269 | Pointer to the font to use.
|
---|
270 |
|
---|
271 | \return
|
---|
272 | Nothing.
|
---|
273 | */
|
---|
274 | void setTitlebarFont(Font* font);
|
---|
275 |
|
---|
276 |
|
---|
277 | /*!
|
---|
278 | \brief
|
---|
279 | Move the window by the pixel offsets specified in \a offset.
|
---|
280 |
|
---|
281 | This is intended for internal system use - it is the method by which the title bar moves the frame window.
|
---|
282 |
|
---|
283 | \param offset
|
---|
284 | Vector2 object containing the offsets to apply (offsets are in screen pixels).
|
---|
285 |
|
---|
286 | \return
|
---|
287 | Nothing.
|
---|
288 | */
|
---|
289 | void offsetPixelPosition(const Vector2& offset);
|
---|
290 |
|
---|
291 |
|
---|
292 | /*!
|
---|
293 | \brief
|
---|
294 | Return whether this FrameWindow can be moved by dragging the title bar.
|
---|
295 |
|
---|
296 | \return
|
---|
297 | true if the Window will move when the user drags the title bar, false if the window will not move.
|
---|
298 | */
|
---|
299 | bool isDragMovingEnabled(void) const {return d_dragMovable;}
|
---|
300 |
|
---|
301 |
|
---|
302 | /*!
|
---|
303 | \brief
|
---|
304 | Set whether this FrameWindow can be moved by dragging the title bar.
|
---|
305 |
|
---|
306 | \param setting
|
---|
307 | true if the Window should move when the user drags the title bar, false if the window should not move.
|
---|
308 |
|
---|
309 | \return
|
---|
310 | Nothing.
|
---|
311 | */
|
---|
312 | void setDragMovingEnabled(bool setting);
|
---|
313 |
|
---|
314 |
|
---|
315 | /*!
|
---|
316 | \brief
|
---|
317 | Return the font being used for the title bar text
|
---|
318 |
|
---|
319 | \return
|
---|
320 | Pointer to the Font being used for the TitleBar on this FrameWindow.
|
---|
321 | */
|
---|
322 | const Font* getTitlebarFont(void) const;
|
---|
323 |
|
---|
324 |
|
---|
325 | /*!
|
---|
326 | \brief
|
---|
327 | Return the current colour used for rendering the caption text
|
---|
328 |
|
---|
329 | \return
|
---|
330 | colour value that specifies the colour used when rendering the title bar caption text.
|
---|
331 | */
|
---|
332 | colour getCaptionColour(void) const;
|
---|
333 |
|
---|
334 |
|
---|
335 | /*!
|
---|
336 | \brief
|
---|
337 | Sets the colour to be used for rendering the caption text.
|
---|
338 |
|
---|
339 | \param col
|
---|
340 | colour value that specifies the colour to be used when rendering the title bar caption text.
|
---|
341 |
|
---|
342 | \return
|
---|
343 | Nothing.
|
---|
344 | */
|
---|
345 | void setCaptionColour(colour col);
|
---|
346 |
|
---|
347 | /*!
|
---|
348 | \brief
|
---|
349 | Return a pointer to the currently set Image to be used for the north-south
|
---|
350 | sizing mouse cursor.
|
---|
351 |
|
---|
352 | \return
|
---|
353 | Pointer to an Image object, or 0 for none.
|
---|
354 | */
|
---|
355 | const Image* getNSSizingCursorImage() const;
|
---|
356 |
|
---|
357 | /*!
|
---|
358 | \brief
|
---|
359 | Return a pointer to the currently set Image to be used for the east-west
|
---|
360 | sizing mouse cursor.
|
---|
361 |
|
---|
362 | \return
|
---|
363 | Pointer to an Image object, or 0 for none.
|
---|
364 | */
|
---|
365 | const Image* getEWSizingCursorImage() const;
|
---|
366 |
|
---|
367 | /*!
|
---|
368 | \brief
|
---|
369 | Return a pointer to the currently set Image to be used for the northwest-southeast
|
---|
370 | sizing mouse cursor.
|
---|
371 |
|
---|
372 | \return
|
---|
373 | Pointer to an Image object, or 0 for none.
|
---|
374 | */
|
---|
375 | const Image* getNWSESizingCursorImage() const;
|
---|
376 |
|
---|
377 | /*!
|
---|
378 | \brief
|
---|
379 | Return a pointer to the currently set Image to be used for the northeast-southwest
|
---|
380 | sizing mouse cursor.
|
---|
381 |
|
---|
382 | \return
|
---|
383 | Pointer to an Image object, or 0 for none.
|
---|
384 | */
|
---|
385 | const Image* getNESWSizingCursorImage() const;
|
---|
386 |
|
---|
387 | /*!
|
---|
388 | \brief
|
---|
389 | Set the Image to be used for the north-south sizing mouse cursor.
|
---|
390 |
|
---|
391 | \param image
|
---|
392 | Pointer to an Image object, or 0 for none.
|
---|
393 |
|
---|
394 | \return
|
---|
395 | Nothing.
|
---|
396 | */
|
---|
397 | void setNSSizingCursorImage(const Image* image);
|
---|
398 |
|
---|
399 | /*!
|
---|
400 | \brief
|
---|
401 | Set the Image to be used for the east-west sizing mouse cursor.
|
---|
402 |
|
---|
403 | \param image
|
---|
404 | Pointer to an Image object, or 0 for none.
|
---|
405 |
|
---|
406 | \return
|
---|
407 | Nothing.
|
---|
408 | */
|
---|
409 | void setEWSizingCursorImage(const Image* image);
|
---|
410 |
|
---|
411 | /*!
|
---|
412 | \brief
|
---|
413 | Set the Image to be used for the northwest-southeast sizing mouse cursor.
|
---|
414 |
|
---|
415 | \param image
|
---|
416 | Pointer to an Image object, or 0 for none.
|
---|
417 |
|
---|
418 | \return
|
---|
419 | Nothing.
|
---|
420 | */
|
---|
421 | void setNWSESizingCursorImage(const Image* image);
|
---|
422 |
|
---|
423 | /*!
|
---|
424 | \brief
|
---|
425 | Set the Image to be used for the northeast-southwest sizing mouse cursor.
|
---|
426 |
|
---|
427 | \param image
|
---|
428 | Pointer to an Image object, or 0 for none.
|
---|
429 |
|
---|
430 | \return
|
---|
431 | Nothing.
|
---|
432 | */
|
---|
433 | void setNESWSizingCursorImage(const Image* image);
|
---|
434 |
|
---|
435 | /*!
|
---|
436 | \brief
|
---|
437 | Set the image to be used for the north-south sizing mouse cursor.
|
---|
438 |
|
---|
439 | \param imageset
|
---|
440 | String holding the name of the Imageset containing the Image to be used.
|
---|
441 |
|
---|
442 | \param image
|
---|
443 | String holding the name of the Image to be used.
|
---|
444 |
|
---|
445 | \return
|
---|
446 | Nothing.
|
---|
447 |
|
---|
448 | \exception UnknownObjectException thrown if either \a imageset or \a image refer to non-existant entities.
|
---|
449 | */
|
---|
450 | void setNSSizingCursorImage(const String& imageset, const String& image);
|
---|
451 |
|
---|
452 | /*!
|
---|
453 | \brief
|
---|
454 | Set the image to be used for the east-west sizing mouse cursor.
|
---|
455 |
|
---|
456 | \param imageset
|
---|
457 | String holding the name of the Imageset containing the Image to be used.
|
---|
458 |
|
---|
459 | \param image
|
---|
460 | String holding the name of the Image to be used.
|
---|
461 |
|
---|
462 | \return
|
---|
463 | Nothing.
|
---|
464 |
|
---|
465 | \exception UnknownObjectException thrown if either \a imageset or \a image refer to non-existant entities.
|
---|
466 | */
|
---|
467 | void setEWSizingCursorImage(const String& imageset, const String& image);
|
---|
468 |
|
---|
469 | /*!
|
---|
470 | \brief
|
---|
471 | Set the image to be used for the northwest-southeast sizing mouse cursor.
|
---|
472 |
|
---|
473 | \param imageset
|
---|
474 | String holding the name of the Imageset containing the Image to be used.
|
---|
475 |
|
---|
476 | \param image
|
---|
477 | String holding the name of the Image to be used.
|
---|
478 |
|
---|
479 | \return
|
---|
480 | Nothing.
|
---|
481 |
|
---|
482 | \exception UnknownObjectException thrown if either \a imageset or \a image refer to non-existant entities.
|
---|
483 | */
|
---|
484 | void setNWSESizingCursorImage(const String& imageset, const String& image);
|
---|
485 |
|
---|
486 | /*!
|
---|
487 | \brief
|
---|
488 | Set the image to be used for the northeast-southwest sizing mouse cursor.
|
---|
489 |
|
---|
490 | \param imageset
|
---|
491 | String holding the name of the Imageset containing the Image to be used.
|
---|
492 |
|
---|
493 | \param image
|
---|
494 | String holding the name of the Image to be used.
|
---|
495 |
|
---|
496 | \return
|
---|
497 | Nothing.
|
---|
498 |
|
---|
499 | \exception UnknownObjectException thrown if either \a imageset or \a image refer to non-existant entities.
|
---|
500 | */
|
---|
501 | void setNESWSizingCursorImage(const String& imageset, const String& image);
|
---|
502 |
|
---|
503 | // overridden from Window class
|
---|
504 | bool isHit(const Point& position) const { return Window::isHit(position) && !d_rolledup; }
|
---|
505 |
|
---|
506 |
|
---|
507 | /*************************************************************************
|
---|
508 | Construction / Destruction
|
---|
509 | *************************************************************************/
|
---|
510 | /*!
|
---|
511 | \brief
|
---|
512 | Constructor for FrameWindow objects.
|
---|
513 | */
|
---|
514 | FrameWindow(const String& name, const String& type);
|
---|
515 |
|
---|
516 | /*!
|
---|
517 | \brief
|
---|
518 | Destructor for FramwWindow objects.
|
---|
519 | */
|
---|
520 | virtual ~FrameWindow(void);
|
---|
521 |
|
---|
522 |
|
---|
523 | protected:
|
---|
524 | /*************************************************************************
|
---|
525 | Implementation Functions
|
---|
526 | *************************************************************************/
|
---|
527 | /*!
|
---|
528 | \brief
|
---|
529 | Create a control based upon the Titlebar base class to be used as the title bar for this window.
|
---|
530 |
|
---|
531 | \param name
|
---|
532 | String object holding the name that must be used when creating the titlebar.
|
---|
533 |
|
---|
534 | \return
|
---|
535 | Pointer to an object who's class derives from Titlebar
|
---|
536 | */
|
---|
537 | virtual Titlebar* createTitlebar(const String& name) const = 0;
|
---|
538 |
|
---|
539 |
|
---|
540 | /*!
|
---|
541 | \brief
|
---|
542 | Create a control based upon the PushButton base class, to be used at the close button for the window.
|
---|
543 |
|
---|
544 | \param name
|
---|
545 | String object holding the name that must be used when creating the close button.
|
---|
546 |
|
---|
547 | \return
|
---|
548 | Pointer to an object who's class derives from PushButton.
|
---|
549 | */
|
---|
550 | virtual PushButton* createCloseButton(const String& name) const = 0;
|
---|
551 |
|
---|
552 |
|
---|
553 | /*!
|
---|
554 | \brief
|
---|
555 | move the window's left edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
|
---|
556 |
|
---|
557 | \param delta
|
---|
558 | float value that specifies the amount to move the window edge, and in which direction. Positive values make window smaller.
|
---|
559 | */
|
---|
560 | void moveLeftEdge(float delta);
|
---|
561 |
|
---|
562 |
|
---|
563 | /*!
|
---|
564 | \brief
|
---|
565 | move the window's right edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
|
---|
566 |
|
---|
567 | \param delta
|
---|
568 | float value that specifies the amount to move the window edge, and in which direction. Positive values make window larger.
|
---|
569 | */
|
---|
570 | void moveRightEdge(float delta);
|
---|
571 |
|
---|
572 |
|
---|
573 | /*!
|
---|
574 | \brief
|
---|
575 | move the window's top edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
|
---|
576 |
|
---|
577 | \param delta
|
---|
578 | float value that specifies the amount to move the window edge, and in which direction. Positive values make window smaller.
|
---|
579 | */
|
---|
580 | void moveTopEdge(float delta);
|
---|
581 |
|
---|
582 |
|
---|
583 | /*!
|
---|
584 | \brief
|
---|
585 | move the window's bottom edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
|
---|
586 |
|
---|
587 | \param delta
|
---|
588 | float value that specifies the amount to move the window edge, and in which direction. Positive values make window larger.
|
---|
589 | */
|
---|
590 | void moveBottomEdge(float delta);
|
---|
591 |
|
---|
592 |
|
---|
593 | /*!
|
---|
594 | \brief
|
---|
595 | check local pixel co-ordinate point 'pt' and return one of the
|
---|
596 | SizingLocation enumerated values depending where the point falls on
|
---|
597 | the sizing border.
|
---|
598 |
|
---|
599 | \param pt
|
---|
600 | Point object describing, in pixels, the window relative offset to check.
|
---|
601 |
|
---|
602 | \return
|
---|
603 | One of the SizingLocation enumerated values that describe which part of
|
---|
604 | the sizing border that \a pt corresponded to, if any.
|
---|
605 | */
|
---|
606 | SizingLocation getSizingBorderAtPoint(const Point& pt) const;
|
---|
607 |
|
---|
608 |
|
---|
609 | /*!
|
---|
610 | \brief
|
---|
611 | return true if given SizingLocation is on left edge.
|
---|
612 |
|
---|
613 | \param loc
|
---|
614 | SizingLocation value to be checked.
|
---|
615 |
|
---|
616 | \return
|
---|
617 | true if \a loc is on the left edge. false if \a loc is not on the left edge.
|
---|
618 | */
|
---|
619 | bool isLeftSizingLocation(SizingLocation loc) const {return ((loc == SizingLeft) || (loc == SizingTopLeft) || (loc == SizingBottomLeft));}
|
---|
620 |
|
---|
621 |
|
---|
622 | /*!
|
---|
623 | \brief
|
---|
624 | return true if given SizingLocation is on right edge.
|
---|
625 |
|
---|
626 | \param loc
|
---|
627 | SizingLocation value to be checked.
|
---|
628 |
|
---|
629 | \return
|
---|
630 | true if \a loc is on the right edge. false if \a loc is not on the right edge.
|
---|
631 | */
|
---|
632 | bool isRightSizingLocation(SizingLocation loc) const {return ((loc == SizingRight) || (loc == SizingTopRight) || (loc == SizingBottomRight));}
|
---|
633 |
|
---|
634 |
|
---|
635 | /*!
|
---|
636 | \brief
|
---|
637 | return true if given SizingLocation is on top edge.
|
---|
638 |
|
---|
639 | \param loc
|
---|
640 | SizingLocation value to be checked.
|
---|
641 |
|
---|
642 | \return
|
---|
643 | true if \a loc is on the top edge. false if \a loc is not on the top edge.
|
---|
644 | */
|
---|
645 | bool isTopSizingLocation(SizingLocation loc) const {return ((loc == SizingTop) || (loc == SizingTopLeft) || (loc == SizingTopRight));}
|
---|
646 |
|
---|
647 |
|
---|
648 | /*!
|
---|
649 | \brief
|
---|
650 | return true if given SizingLocation is on bottom edge.
|
---|
651 |
|
---|
652 | \param loc
|
---|
653 | SizingLocation value to be checked.
|
---|
654 |
|
---|
655 | \return
|
---|
656 | true if \a loc is on the bottom edge. false if \a loc is not on the bottom edge.
|
---|
657 | */
|
---|
658 | bool isBottomSizingLocation(SizingLocation loc) const {return ((loc == SizingBottom) || (loc == SizingBottomLeft) || (loc == SizingBottomRight));}
|
---|
659 |
|
---|
660 |
|
---|
661 | /*!
|
---|
662 | \brief
|
---|
663 | Add frame window specific events
|
---|
664 | */
|
---|
665 | void addFrameWindowEvents(void);
|
---|
666 |
|
---|
667 |
|
---|
668 | /*!
|
---|
669 | \brief
|
---|
670 | Method to respond to close button click events and fire our close event
|
---|
671 | */
|
---|
672 | bool closeClickHandler(const EventArgs& e);
|
---|
673 |
|
---|
674 |
|
---|
675 | /*!
|
---|
676 | \brief
|
---|
677 | Set the appropriate mouse cursor for the given window-relative pixel point.
|
---|
678 | */
|
---|
679 | void setCursorForPoint(const Point& pt) const;
|
---|
680 |
|
---|
681 |
|
---|
682 | /*!
|
---|
683 | \brief
|
---|
684 | Return a Rect that describes, in window relative pixel co-ordinates, the outer edge of the sizing area for this window.
|
---|
685 | */
|
---|
686 | virtual Rect getSizingRect(void) const {return Rect(0, 0, getAbsoluteWidth(), getAbsoluteHeight());}
|
---|
687 |
|
---|
688 |
|
---|
689 | /*!
|
---|
690 | \brief
|
---|
691 | Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.
|
---|
692 |
|
---|
693 | \param class_name
|
---|
694 | The class name that is to be checked.
|
---|
695 |
|
---|
696 | \return
|
---|
697 | true if this window was inherited from \a class_name. false if not.
|
---|
698 | */
|
---|
699 | virtual bool testClassName_impl(const String& class_name) const
|
---|
700 | {
|
---|
701 | if (class_name==(const utf8*)"FrameWindow") return true;
|
---|
702 | return Window::testClassName_impl(class_name);
|
---|
703 | }
|
---|
704 |
|
---|
705 |
|
---|
706 | /*************************************************************************
|
---|
707 | New events for Frame Windows
|
---|
708 | *************************************************************************/
|
---|
709 | /*!
|
---|
710 | \brief
|
---|
711 | Event generated internally whenever the roll-up / shade state of the window
|
---|
712 | changes.
|
---|
713 | */
|
---|
714 | virtual void onRollupToggled(WindowEventArgs& e);
|
---|
715 |
|
---|
716 |
|
---|
717 | /*!
|
---|
718 | \brief
|
---|
719 | Event generated internally whenever the close button is clicked.
|
---|
720 | */
|
---|
721 | virtual void onCloseClicked(WindowEventArgs& e);
|
---|
722 |
|
---|
723 |
|
---|
724 | /*************************************************************************
|
---|
725 | Overridden event handlers
|
---|
726 | *************************************************************************/
|
---|
727 | virtual void onMouseMove(MouseEventArgs& e);
|
---|
728 | virtual void onMouseButtonDown(MouseEventArgs& e);
|
---|
729 | virtual void onMouseButtonUp(MouseEventArgs& e);
|
---|
730 | virtual void onCaptureLost(WindowEventArgs& e);
|
---|
731 | virtual void onTextChanged(WindowEventArgs& e);
|
---|
732 | virtual void onActivated(ActivationEventArgs& e);
|
---|
733 | virtual void onDeactivated(ActivationEventArgs& e);
|
---|
734 |
|
---|
735 |
|
---|
736 | /*************************************************************************
|
---|
737 | Implementation Data
|
---|
738 | *************************************************************************/
|
---|
739 | // frame data
|
---|
740 | bool d_frameEnabled; //!< true if window frame should be drawn.
|
---|
741 |
|
---|
742 | // window roll-up data
|
---|
743 | bool d_rollupEnabled; //!< true if roll-up of window is allowed.
|
---|
744 | bool d_rolledup; //!< true if window is rolled up.
|
---|
745 |
|
---|
746 | // drag-sizing data
|
---|
747 | bool d_sizingEnabled; //!< true if sizing is enabled for this window.
|
---|
748 | bool d_beingSized; //!< true if window is being sized.
|
---|
749 | float d_borderSize; //!< thickness of the sizing border around this window
|
---|
750 | Point d_dragPoint; //!< point window is being dragged at.
|
---|
751 |
|
---|
752 | // composite controls
|
---|
753 | Titlebar* d_titlebar; //!< points to the title bar widget.
|
---|
754 | PushButton* d_closeButton; //!< points to close button widget.
|
---|
755 |
|
---|
756 | // images for cursor when on sizing border
|
---|
757 | const Image* d_nsSizingCursor; //!< North/South sizing cursor image.
|
---|
758 | const Image* d_ewSizingCursor; //!< East/West sizing cursor image.
|
---|
759 | const Image* d_nwseSizingCursor; //!< North-West/South-East cursor image.
|
---|
760 | const Image* d_neswSizingCursor; //!< North-East/South-West cursor image.
|
---|
761 |
|
---|
762 | bool d_dragMovable; //!< true if the window will move when dragged by the title bar.
|
---|
763 |
|
---|
764 |
|
---|
765 | private:
|
---|
766 | /*************************************************************************
|
---|
767 | Static Properties for this class
|
---|
768 | *************************************************************************/
|
---|
769 | static FrameWindowProperties::SizingEnabled d_sizingEnabledProperty;
|
---|
770 | static FrameWindowProperties::FrameEnabled d_frameEnabledProperty;
|
---|
771 | static FrameWindowProperties::TitlebarEnabled d_titlebarEnabledProperty;
|
---|
772 | static FrameWindowProperties::CloseButtonEnabled d_closeButtonEnabledProperty;
|
---|
773 | static FrameWindowProperties::RollUpState d_rollUpStateProperty;
|
---|
774 | static FrameWindowProperties::RollUpEnabled d_rollUpEnabledProperty;
|
---|
775 | static FrameWindowProperties::DragMovingEnabled d_dragMovingEnabledProperty;
|
---|
776 | static FrameWindowProperties::SizingBorderThickness d_sizingBorderThicknessProperty;
|
---|
777 | static FrameWindowProperties::TitlebarFont d_titlebarFontProperty;
|
---|
778 | static FrameWindowProperties::CaptionColour d_captionColourProperty;
|
---|
779 | static FrameWindowProperties::NSSizingCursorImage d_nsSizingCursorProperty;
|
---|
780 | static FrameWindowProperties::EWSizingCursorImage d_ewSizingCursorProperty;
|
---|
781 | static FrameWindowProperties::NWSESizingCursorImage d_nwseSizingCursorProperty;
|
---|
782 | static FrameWindowProperties::NESWSizingCursorImage d_neswSizingCursorProperty;
|
---|
783 |
|
---|
784 |
|
---|
785 | /*************************************************************************
|
---|
786 | Private methods
|
---|
787 | *************************************************************************/
|
---|
788 | void addFrameWindowProperties(void);
|
---|
789 | };
|
---|
790 |
|
---|
791 | } // End of CEGUI namespace section
|
---|
792 |
|
---|
793 | #if defined(_MSC_VER)
|
---|
794 | # pragma warning(pop)
|
---|
795 | #endif
|
---|
796 |
|
---|
797 | #endif // end of guard _CEGUIFrameWindow_h_
|
---|