]> git.saurik.com Git - wxWidgets.git/blob - include/wx/window.h
Applied patch [ 681921 ] Stray focus rectangle in static text
[wxWidgets.git] / include / wx / window.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/window.h
3 // Purpose: wxWindowBase class - the interface of wxWindow
4 // Author: Vadim Zeitlin
5 // Modified by: Ron Lee
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_WINDOW_H_BASE_
13 #define _WX_WINDOW_H_BASE_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "windowbase.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // headers which we must include here
21 // ----------------------------------------------------------------------------
22
23 #include "wx/event.h" // the base class
24
25 #include "wx/list.h" // defines wxWindowList
26
27 #include "wx/cursor.h" // we have member variables of these classes
28 #include "wx/font.h" // so we can't do without them
29 #include "wx/colour.h"
30 #include "wx/region.h"
31 #include "wx/utils.h"
32
33 #include "wx/validate.h" // for wxDefaultValidator (always include it)
34
35 #if wxUSE_PALETTE
36 #include "wx/palette.h"
37 #endif // wxUSE_PALETTE
38
39 #if wxUSE_ACCEL
40 #include "wx/accel.h"
41 #endif // wxUSE_ACCEL
42
43 #if wxUSE_ACCESSIBILITY
44 #include "wx/access.h"
45 #endif
46
47 // when building wxUniv/Foo we don't want the code for native menu use to be
48 // compiled in - it should only be used when building real wxFoo
49 #ifdef __WXUNIVERSAL__
50 #define wxUSE_MENUS_NATIVE 0
51 #else // __WXMSW__
52 #define wxUSE_MENUS_NATIVE wxUSE_MENUS
53 #endif // __WXUNIVERSAL__/__WXMSW__
54
55 // ----------------------------------------------------------------------------
56 // forward declarations
57 // ----------------------------------------------------------------------------
58
59 class WXDLLEXPORT wxCaret;
60 class WXDLLEXPORT wxControl;
61 class WXDLLEXPORT wxCursor;
62 class WXDLLEXPORT wxDC;
63 class WXDLLEXPORT wxDropTarget;
64 class WXDLLEXPORT wxItemResource;
65 class WXDLLEXPORT wxLayoutConstraints;
66 class WXDLLEXPORT wxResourceTable;
67 class WXDLLEXPORT wxSizer;
68 class WXDLLEXPORT wxToolTip;
69 class WXDLLEXPORT wxWindowBase;
70 class WXDLLEXPORT wxWindow;
71
72 #if wxUSE_ACCESSIBILITY
73 class WXDLLEXPORT wxAccessible;
74 #endif
75
76 // ----------------------------------------------------------------------------
77 // (pseudo)template list classes
78 // ----------------------------------------------------------------------------
79
80 WX_DECLARE_LIST_3(wxWindow, wxWindowBase, wxWindowList, wxWindowListNode, class WXDLLEXPORT);
81
82 // ----------------------------------------------------------------------------
83 // global variables
84 // ----------------------------------------------------------------------------
85
86 WXDLLEXPORT_DATA(extern wxWindowList) wxTopLevelWindows;
87
88 // ----------------------------------------------------------------------------
89 // wxWindowBase is the base class for all GUI controls/widgets, this is the public
90 // interface of this class.
91 //
92 // Event handler: windows have themselves as their event handlers by default,
93 // but their event handlers could be set to another object entirely. This
94 // separation can reduce the amount of derivation required, and allow
95 // alteration of a window's functionality (e.g. by a resource editor that
96 // temporarily switches event handlers).
97 // ----------------------------------------------------------------------------
98
99 class WXDLLEXPORT wxWindowBase : public wxEvtHandler
100 {
101 public:
102 // creating the window
103 // -------------------
104
105 // default ctor
106 wxWindowBase() { InitBase(); }
107
108 // pseudo ctor (can't be virtual, called from ctor)
109 bool CreateBase(wxWindowBase *parent,
110 wxWindowID id,
111 const wxPoint& pos = wxDefaultPosition,
112 const wxSize& size = wxDefaultSize,
113 long style = 0,
114 const wxValidator& validator = wxDefaultValidator,
115 const wxString& name = wxPanelNameStr);
116
117 virtual ~wxWindowBase();
118
119 #if wxUSE_WX_RESOURCES
120 // these functions are implemented in resource.cpp and resourc2.cpp
121 virtual bool LoadFromResource(wxWindow *parent,
122 const wxString& resourceName,
123 const wxResourceTable *table = (const wxResourceTable *) NULL);
124 virtual wxControl *CreateItem(const wxItemResource* childResource,
125 const wxItemResource* parentResource,
126 const wxResourceTable *table = (const wxResourceTable *) NULL);
127 #endif // wxUSE_WX_RESOURCES
128
129 // deleting the window
130 // -------------------
131
132 // ask the window to close itself, return TRUE if the event handler
133 // honoured our request
134 bool Close( bool force = FALSE );
135
136 // the following functions delete the C++ objects (the window itself
137 // or its children) as well as the GUI windows and normally should
138 // never be used directly
139
140 // delete window unconditionally (dangerous!), returns TRUE if ok
141 virtual bool Destroy();
142 // delete all children of this window, returns TRUE if ok
143 bool DestroyChildren();
144
145 // is the window being deleted?
146 bool IsBeingDeleted() const { return m_isBeingDeleted; }
147
148 // window attributes
149 // -----------------
150
151 // NB: in future versions of wxWindows Set/GetTitle() will only work
152 // with the top level windows (such as dialogs and frames) and
153 // Set/GetLabel() only with the other ones (i.e. all controls).
154
155 // the title (or label, see below) of the window: the text which the
156 // window shows
157 virtual void SetTitle( const wxString& WXUNUSED(title) ) {}
158 virtual wxString GetTitle() const { return wxEmptyString; }
159
160 // label is just the same as the title (but for, e.g., buttons it
161 // makes more sense to speak about labels)
162 virtual void SetLabel(const wxString& label) { SetTitle(label); }
163 virtual wxString GetLabel() const { return GetTitle(); }
164
165 // the window name is used for ressource setting in X, it is not the
166 // same as the window title/label
167 virtual void SetName( const wxString &name ) { m_windowName = name; }
168 virtual wxString GetName() const { return m_windowName; }
169
170 // window id uniquely identifies the window among its siblings unless
171 // it is -1 which means "don't care"
172 void SetId( wxWindowID id ) { m_windowId = id; }
173 wxWindowID GetId() const { return m_windowId; }
174
175 // generate a control id for the controls which were not given one by
176 // user
177 static int NewControlId() { return --ms_lastControlId; }
178 // get the id of the control following the one with the given
179 // (autogenerated) id
180 static int NextControlId(int id) { return id - 1; }
181 // get the id of the control preceding the one with the given
182 // (autogenerated) id
183 static int PrevControlId(int id) { return id + 1; }
184
185 // moving/resizing
186 // ---------------
187
188 // set the window size and/or position
189 void SetSize( int x, int y, int width, int height,
190 int sizeFlags = wxSIZE_AUTO )
191 { DoSetSize(x, y, width, height, sizeFlags); }
192
193 void SetSize( int width, int height )
194 { DoSetSize( -1, -1, width, height, wxSIZE_USE_EXISTING ); }
195
196 void SetSize( const wxSize& size )
197 { SetSize( size.x, size.y); }
198
199 void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
200 { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
201
202 void Move(int x, int y, int flags = wxSIZE_USE_EXISTING)
203 { DoSetSize(x, y, -1, -1, flags); }
204
205 void Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING)
206 { Move(pt.x, pt.y, flags); }
207
208 // Z-order
209 virtual void Raise() = 0;
210 virtual void Lower() = 0;
211
212 // client size is the size of area available for subwindows
213 void SetClientSize( int width, int height )
214 { DoSetClientSize(width, height); }
215
216 void SetClientSize( const wxSize& size )
217 { DoSetClientSize(size.x, size.y); }
218
219 void SetClientSize(const wxRect& rect)
220 { SetClientSize( rect.width, rect.height ); }
221
222 // get the window position and/or size (pointers may be NULL)
223 void GetPosition( int *x, int *y ) const { DoGetPosition(x, y); }
224 wxPoint GetPosition() const
225 {
226 int w, h;
227 DoGetPosition(&w, &h);
228
229 return wxPoint(w, h);
230 }
231
232 void GetSize( int *w, int *h ) const { DoGetSize(w, h); }
233 wxSize GetSize() const
234 {
235 int w, h;
236 DoGetSize(& w, & h);
237 return wxSize(w, h);
238 }
239
240 wxRect GetRect() const
241 {
242 int x, y, w, h;
243 GetPosition(& x, & y);
244 GetSize(& w, & h);
245
246 return wxRect(x, y, w, h);
247 }
248
249 void GetClientSize( int *w, int *h ) const { DoGetClientSize(w, h); }
250 wxSize GetClientSize() const
251 {
252 int w, h;
253 DoGetClientSize(& w, & h);
254
255 return wxSize(w, h);
256 }
257
258 // get the origin of the client area of the window relative to the
259 // window top left corner (the client area may be shifted because of
260 // the borders, scrollbars, other decorations...)
261 virtual wxPoint GetClientAreaOrigin() const;
262
263 // get the client rectangle in window (i.e. client) coordinates
264 wxRect GetClientRect() const
265 {
266 return wxRect(GetClientAreaOrigin(), GetClientSize());
267 }
268
269 // get the size best suited for the window (in fact, minimal
270 // acceptable size using which it will still look "nice")
271 wxSize GetBestSize() const { return DoGetBestSize(); }
272 void GetBestSize(int *w, int *h) const
273 {
274 wxSize s = DoGetBestSize();
275 if ( w )
276 *w = s.x;
277 if ( h )
278 *h = s.y;
279 }
280
281 // There are times (and windows) where 'Best' size and 'Min' size
282 // are vastly out of sync. This should be remedied somehow, but in
283 // the meantime, this method will return the larger of BestSize
284 // (the window's smallest legible size), and any user specified
285 // MinSize hint.
286 wxSize GetAdjustedBestSize() const
287 {
288 wxSize s( DoGetBestSize() );
289 return wxSize( wxMax( s.x, GetMinWidth() ), wxMax( s.y, GetMinHeight() ) );
290 }
291
292 // the generic centre function - centers the window on parent by`
293 // default or on screen if it doesn't have parent or
294 // wxCENTER_ON_SCREEN flag is given
295 void Centre( int direction = wxBOTH );
296 void Center( int direction = wxBOTH ) { Centre(direction); }
297
298 // centre on screen (only works for top level windows)
299 void CentreOnScreen(int dir = wxBOTH) { Centre(dir | wxCENTER_ON_SCREEN); }
300 void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); }
301
302 // centre with respect to the the parent window
303 void CentreOnParent(int dir = wxBOTH) { Centre(dir | wxCENTER_FRAME); }
304 void CenterOnParent(int dir = wxBOTH) { CentreOnParent(dir); }
305
306 // set window size to wrap around its children
307 virtual void Fit();
308
309 // set virtual size to satisfy children
310 virtual void FitInside();
311
312 // set min/max size of the window
313 virtual void SetSizeHints( int minW, int minH,
314 int maxW = -1, int maxH = -1,
315 int incW = -1, int incH = -1 );
316
317 virtual void SetVirtualSizeHints( int minW, int minH,
318 int maxW = -1, int maxH = -1 );
319
320 virtual int GetMinWidth() const { return m_minWidth; }
321 virtual int GetMinHeight() const { return m_minHeight; }
322 int GetMaxWidth() const { return m_maxWidth; }
323 int GetMaxHeight() const { return m_maxHeight; }
324
325 // Override this method to control the values given to Sizers etc.
326 virtual wxSize GetMaxSize() const { return wxSize( m_maxWidth, m_maxHeight ); }
327
328 // Methods for accessing the virtual size of a window. For most
329 // windows this is just the client area of the window, but for
330 // some like scrolled windows it is more or less independent of
331 // the screen window size. You may override the DoXXXVirtual
332 // methods below for classes where that is is the case.
333
334 void SetVirtualSize( const wxSize &size ) { DoSetVirtualSize( size.x, size.y ); }
335 void SetVirtualSize( int x, int y ) { DoSetVirtualSize( x, y ); }
336
337 wxSize GetVirtualSize() const { return DoGetVirtualSize(); }
338 void GetVirtualSize( int *x, int *y ) const
339 {
340 wxSize s( DoGetVirtualSize() );
341
342 if( x )
343 *x = s.GetWidth();
344 if( y )
345 *y = s.GetHeight();
346 }
347
348 // Override these methods for windows that have a virtual size
349 // independent of their client size. eg. the virtual area of a
350 // wxScrolledWindow. Default is to alias VirtualSize to ClientSize.
351
352 virtual void DoSetVirtualSize( int x, int y );
353 virtual wxSize DoGetVirtualSize() const; // { return m_virtualSize; }
354
355 // Return the largest of ClientSize and BestSize (as determined
356 // by a sizer, interior children, or other means)
357
358 virtual wxSize GetBestVirtualSize() const
359 {
360 wxSize client( GetClientSize() );
361 wxSize best( GetBestSize() );
362
363 return wxSize( wxMax( client.x, best.x ), wxMax( client.y, best.y ) );
364 }
365
366 // window state
367 // ------------
368
369 // returns TRUE if window was shown/hidden, FALSE if the nothing was
370 // done (window was already shown/hidden)
371 virtual bool Show( bool show = TRUE );
372 bool Hide() { return Show(FALSE); }
373
374 // returns TRUE if window was enabled/disabled, FALSE if nothing done
375 virtual bool Enable( bool enable = TRUE );
376 bool Disable() { return Enable(FALSE); }
377
378 bool IsShown() const { return m_isShown; }
379 bool IsEnabled() const { return m_isEnabled; }
380
381 // get/set window style (setting style won't update the window and so
382 // is only useful for internal usage)
383 virtual void SetWindowStyleFlag( long style ) { m_windowStyle = style; }
384 virtual long GetWindowStyleFlag() const { return m_windowStyle; }
385
386 // just some (somewhat shorter) synonims
387 void SetWindowStyle( long style ) { SetWindowStyleFlag(style); }
388 long GetWindowStyle() const { return GetWindowStyleFlag(); }
389
390 bool HasFlag(int flag) const { return (m_windowStyle & flag) != 0; }
391 virtual bool IsRetained() const { return HasFlag(wxRETAINED); }
392
393 // extra style: the less often used style bits which can't be set with
394 // SetWindowStyleFlag()
395 virtual void SetExtraStyle(long exStyle) { m_exStyle = exStyle; }
396 long GetExtraStyle() const { return m_exStyle; }
397
398 // make the window modal (all other windows unresponsive)
399 virtual void MakeModal(bool modal = TRUE);
400
401 virtual void SetThemeEnabled(bool enableTheme) { m_themeEnabled = enableTheme; }
402 virtual bool GetThemeEnabled() const { return m_themeEnabled; }
403
404 // focus and keyboard handling
405 // ---------------------------
406
407 // set focus to this window
408 virtual void SetFocus() = 0;
409
410 // set focus to this window as the result of a keyboard action
411 virtual void SetFocusFromKbd() { SetFocus(); }
412
413 // return the window which currently has the focus or NULL
414 static wxWindow *FindFocus() /* = 0: implement in derived classes */;
415
416 // can this window have focus?
417 virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); }
418
419 // can this window be given focus by keyboard navigation? if not, the
420 // only way to give it focus (provided it accepts it at all) is to
421 // click it
422 virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); }
423
424 // NB: these methods really don't belong here but with the current
425 // class hierarchy there is no other place for them :-(
426
427 // get the default child of this parent, i.e. the one which is
428 // activated by pressing <Enter>
429 virtual wxWindow *GetDefaultItem() const { return NULL; }
430
431 // set this child as default, return the old default
432 virtual wxWindow *SetDefaultItem(wxWindow * WXUNUSED(child))
433 { return NULL; }
434
435 // set this child as temporary default
436 virtual void SetTmpDefaultItem(wxWindow * WXUNUSED(win)) { }
437
438 // parent/children relations
439 // -------------------------
440
441 // get the list of children
442 const wxWindowList& GetChildren() const { return m_children; }
443 wxWindowList& GetChildren() { return m_children; }
444
445 // get the parent or the parent of the parent
446 wxWindow *GetParent() const { return m_parent; }
447 inline wxWindow *GetGrandParent() const;
448
449 // is this window a top level one?
450 virtual bool IsTopLevel() const;
451
452 // it doesn't really change parent, use ReParent() instead
453 void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; }
454 // change the real parent of this window, return TRUE if the parent
455 // was changed, FALSE otherwise (error or newParent == oldParent)
456 virtual bool Reparent( wxWindowBase *newParent );
457
458 // implementation mostly
459 virtual void AddChild( wxWindowBase *child );
460 virtual void RemoveChild( wxWindowBase *child );
461
462 // looking for windows
463 // -------------------
464
465 // find window among the descendants of this one either by id or by
466 // name (return NULL if not found)
467 wxWindow *FindWindow( long id );
468 wxWindow *FindWindow( const wxString& name );
469
470 // Find a window among any window (all return NULL if not found)
471 static wxWindow *FindWindowById( long id, const wxWindow *parent = NULL );
472 static wxWindow *FindWindowByName( const wxString& name,
473 const wxWindow *parent = NULL );
474 static wxWindow *FindWindowByLabel( const wxString& label,
475 const wxWindow *parent = NULL );
476
477 // event handler stuff
478 // -------------------
479
480 // get the current event handler
481 wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
482
483 // replace the event handler (allows to completely subclass the
484 // window)
485 void SetEventHandler( wxEvtHandler *handler ) { m_eventHandler = handler; }
486
487 // push/pop event handler: allows to chain a custom event handler to
488 // alreasy existing ones
489 void PushEventHandler( wxEvtHandler *handler );
490 wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
491
492 // find the given handler in the event handler chain and remove (but
493 // not delete) it from the event handler chain, return TRUE if it was
494 // found and FALSE otherwise (this also results in an assert failure so
495 // this function should only be called when the handler is supposed to
496 // be there)
497 bool RemoveEventHandler(wxEvtHandler *handler);
498
499 // validators
500 // ----------
501
502 #if wxUSE_VALIDATORS
503 // a window may have an associated validator which is used to control
504 // user input
505 virtual void SetValidator( const wxValidator &validator );
506 virtual wxValidator *GetValidator() { return m_windowValidator; }
507 #endif // wxUSE_VALIDATORS
508
509
510 // dialog oriented functions
511 // -------------------------
512
513 // validate the correctness of input, return TRUE if ok
514 virtual bool Validate();
515
516 // transfer data between internal and GUI representations
517 virtual bool TransferDataToWindow();
518 virtual bool TransferDataFromWindow();
519
520 virtual void InitDialog();
521
522 #if wxUSE_ACCEL
523 // accelerators
524 // ------------
525 virtual void SetAcceleratorTable( const wxAcceleratorTable& accel )
526 { m_acceleratorTable = accel; }
527 wxAcceleratorTable *GetAcceleratorTable()
528 { return &m_acceleratorTable; }
529 #endif // wxUSE_ACCEL
530
531 // dialog units translations
532 // -------------------------
533
534 wxPoint ConvertPixelsToDialog( const wxPoint& pt );
535 wxPoint ConvertDialogToPixels( const wxPoint& pt );
536 wxSize ConvertPixelsToDialog( const wxSize& sz )
537 {
538 wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y)));
539
540 return wxSize(pt.x, pt.y);
541 }
542
543 wxSize ConvertDialogToPixels( const wxSize& sz )
544 {
545 wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y)));
546
547 return wxSize(pt.x, pt.y);
548 }
549
550 // mouse functions
551 // ---------------
552
553 // move the mouse to the specified position
554 virtual void WarpPointer(int x, int y) = 0;
555
556 // start or end mouse capture, these functions maintain the stack of
557 // windows having captured the mouse and after calling ReleaseMouse()
558 // the mouse is not released but returns to the window which had had
559 // captured it previously (if any)
560 void CaptureMouse();
561 void ReleaseMouse();
562
563 // get the window which currently captures the mouse or NULL
564 static wxWindow *GetCapture();
565
566 // does this window have the capture?
567 virtual bool HasCapture() const
568 { return (wxWindow *)this == GetCapture(); }
569
570 // painting the window
571 // -------------------
572
573 // mark the specified rectangle (or the whole window) as "dirty" so it
574 // will be repainted
575 virtual void Refresh( bool eraseBackground = TRUE,
576 const wxRect *rect = (const wxRect *) NULL ) = 0;
577
578 // a less awkward wrapper for Refresh
579 void RefreshRect(const wxRect& rect) { Refresh(TRUE, &rect); }
580
581 // repaint all invalid areas of the window immediately
582 virtual void Update() { }
583
584 // clear the window entirely
585 virtual void Clear() = 0;
586
587 // freeze the window: don't redraw it until it is thawed
588 virtual void Freeze() { }
589
590 // thaw the window: redraw it after it had been frozen
591 virtual void Thaw() { }
592
593 // adjust DC for drawing on this window
594 virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { }
595
596 // the update region of the window contains the areas which must be
597 // repainted by the program
598 const wxRegion& GetUpdateRegion() const { return m_updateRegion; }
599 wxRegion& GetUpdateRegion() { return m_updateRegion; }
600
601 // get the update rectangleregion bounding box in client coords
602 wxRect GetUpdateClientRect() const;
603
604 // these functions verify whether the given point/rectangle belongs to
605 // (or at least intersects with) the update region
606 bool IsExposed( int x, int y ) const;
607 bool IsExposed( int x, int y, int w, int h ) const;
608
609 bool IsExposed( const wxPoint& pt ) const
610 { return IsExposed(pt.x, pt.y); }
611 bool IsExposed( const wxRect& rect ) const
612 { return IsExposed(rect.x, rect.y, rect.width, rect.height); }
613
614 // colours, fonts and cursors
615 // --------------------------
616
617 // set/retrieve the window colours (system defaults are used by
618 // default): Set functions return TRUE if colour was changed
619 virtual bool SetBackgroundColour( const wxColour &colour );
620 virtual bool SetForegroundColour( const wxColour &colour );
621
622 wxColour GetBackgroundColour() const { return m_backgroundColour; }
623 wxColour GetForegroundColour() const { return m_foregroundColour; }
624
625 // set/retrieve the cursor for this window (SetCursor() returns TRUE
626 // if the cursor was really changed)
627 virtual bool SetCursor( const wxCursor &cursor );
628 const wxCursor& GetCursor() const { return m_cursor; }
629 wxCursor& GetCursor() { return m_cursor; }
630
631 // set/retrieve the font for the window (SetFont() returns TRUE if the
632 // font really changed)
633 virtual bool SetFont( const wxFont &font ) = 0;
634 const wxFont& GetFont() const { return m_font; }
635 wxFont& GetFont() { return m_font; }
636
637 #if wxUSE_CARET
638 // associate a caret with the window
639 void SetCaret(wxCaret *caret);
640 // get the current caret (may be NULL)
641 wxCaret *GetCaret() const { return m_caret; }
642 #endif // wxUSE_CARET
643
644 // get the (average) character size for the current font
645 virtual int GetCharHeight() const = 0;
646 virtual int GetCharWidth() const = 0;
647
648 // get the width/height/... of the text using current or specified
649 // font
650 virtual void GetTextExtent(const wxString& string,
651 int *x, int *y,
652 int *descent = (int *) NULL,
653 int *externalLeading = (int *) NULL,
654 const wxFont *theFont = (const wxFont *) NULL)
655 const = 0;
656
657 // client <-> screen coords
658 // ------------------------
659
660 // translate to/from screen/client coordinates (pointers may be NULL)
661 void ClientToScreen( int *x, int *y ) const
662 { DoClientToScreen(x, y); }
663 void ScreenToClient( int *x, int *y ) const
664 { DoScreenToClient(x, y); }
665
666 // wxPoint interface to do the same thing
667 wxPoint ClientToScreen(const wxPoint& pt) const
668 {
669 int x = pt.x, y = pt.y;
670 DoClientToScreen(&x, &y);
671
672 return wxPoint(x, y);
673 }
674
675 wxPoint ScreenToClient(const wxPoint& pt) const
676 {
677 int x = pt.x, y = pt.y;
678 DoScreenToClient(&x, &y);
679
680 return wxPoint(x, y);
681 }
682
683 // test where the given (in client coords) point lies
684 wxHitTest HitTest(wxCoord x, wxCoord y) const
685 { return DoHitTest(x, y); }
686
687 wxHitTest HitTest(const wxPoint& pt) const
688 { return DoHitTest(pt.x, pt.y); }
689
690 // misc
691 // ----
692
693 // get the window border style: uses the current style and falls back to
694 // the default style for this class otherwise (see GetDefaultBorder())
695 wxBorder GetBorder() const;
696
697 void UpdateWindowUI();
698
699 #if wxUSE_MENUS
700 bool PopupMenu( wxMenu *menu, const wxPoint& pos )
701 { return DoPopupMenu(menu, pos.x, pos.y); }
702 bool PopupMenu( wxMenu *menu, int x, int y )
703 { return DoPopupMenu(menu, x, y); }
704 #endif // wxUSE_MENUS
705
706 // scrollbars
707 // ----------
708
709 // does the window have the scrollbar for this orientation?
710 bool HasScrollbar(int orient) const
711 {
712 return (m_windowStyle &
713 (orient == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL)) != 0;
714 }
715
716 // configure the window scrollbars
717 virtual void SetScrollbar( int orient,
718 int pos,
719 int thumbvisible,
720 int range,
721 bool refresh = TRUE ) = 0;
722 virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ) = 0;
723 virtual int GetScrollPos( int orient ) const = 0;
724 virtual int GetScrollThumb( int orient ) const = 0;
725 virtual int GetScrollRange( int orient ) const = 0;
726
727 // scroll window to the specified position
728 virtual void ScrollWindow( int dx, int dy,
729 const wxRect* rect = (wxRect *) NULL ) = 0;
730
731 // scrolls window by line/page: note that not all controls support this
732 //
733 // return TRUE if the position changed, FALSE otherwise
734 virtual bool ScrollLines(int WXUNUSED(lines)) { return FALSE; }
735 virtual bool ScrollPages(int WXUNUSED(pages)) { return FALSE; }
736
737 // convenient wrappers for ScrollLines/Pages
738 bool LineUp() { return ScrollLines(-1); }
739 bool LineDown() { return ScrollLines(1); }
740 bool PageUp() { return ScrollPages(-1); }
741 bool PageDown() { return ScrollPages(1); }
742
743 // context-sensitive help
744 // ----------------------
745
746 // these are the convenience functions wrapping wxHelpProvider methods
747
748 #if wxUSE_HELP
749 // associate this help text with this window
750 void SetHelpText(const wxString& text);
751 // associate this help text with all windows with the same id as this
752 // one
753 void SetHelpTextForId(const wxString& text);
754 // get the help string associated with this window (may be empty)
755 wxString GetHelpText() const;
756 #endif // wxUSE_HELP
757
758 // tooltips
759 // --------
760
761 #if wxUSE_TOOLTIPS
762 // the easiest way to set a tooltip for a window is to use this method
763 void SetToolTip( const wxString &tip );
764 // attach a tooltip to the window
765 void SetToolTip( wxToolTip *tip ) { DoSetToolTip(tip); }
766 // get the associated tooltip or NULL if none
767 wxToolTip* GetToolTip() const { return m_tooltip; }
768 #endif // wxUSE_TOOLTIPS
769
770 // drag and drop
771 // -------------
772 #if wxUSE_DRAG_AND_DROP
773 // set/retrieve the drop target associated with this window (may be
774 // NULL; it's owned by the window and will be deleted by it)
775 virtual void SetDropTarget( wxDropTarget *dropTarget ) = 0;
776 virtual wxDropTarget *GetDropTarget() const { return m_dropTarget; }
777 #endif // wxUSE_DRAG_AND_DROP
778
779 // constraints and sizers
780 // ----------------------
781 #if wxUSE_CONSTRAINTS
782 // set the constraints for this window or retrieve them (may be NULL)
783 void SetConstraints( wxLayoutConstraints *constraints );
784 wxLayoutConstraints *GetConstraints() const { return m_constraints; }
785
786 // implementation only
787 void UnsetConstraints(wxLayoutConstraints *c);
788 wxWindowList *GetConstraintsInvolvedIn() const
789 { return m_constraintsInvolvedIn; }
790 void AddConstraintReference(wxWindowBase *otherWin);
791 void RemoveConstraintReference(wxWindowBase *otherWin);
792 void DeleteRelatedConstraints();
793 void ResetConstraints();
794
795 // these methods may be overriden for special layout algorithms
796 virtual void SetConstraintSizes(bool recurse = TRUE);
797 virtual bool LayoutPhase1(int *noChanges);
798 virtual bool LayoutPhase2(int *noChanges);
799 virtual bool DoPhase(int phase);
800
801 // these methods are virtual but normally won't be overridden
802 virtual void SetSizeConstraint(int x, int y, int w, int h);
803 virtual void MoveConstraint(int x, int y);
804 virtual void GetSizeConstraint(int *w, int *h) const ;
805 virtual void GetClientSizeConstraint(int *w, int *h) const ;
806 virtual void GetPositionConstraint(int *x, int *y) const ;
807
808 #endif // wxUSE_CONSTRAINTS
809
810 // when using constraints or sizers, it makes sense to update
811 // children positions automatically whenever the window is resized
812 // - this is done if autoLayout is on
813 void SetAutoLayout( bool autoLayout ) { m_autoLayout = autoLayout; }
814 bool GetAutoLayout() const { return m_autoLayout; }
815
816 // lay out the window and its children
817 virtual bool Layout();
818
819 // sizers
820 void SetSizer(wxSizer *sizer, bool deleteOld = TRUE );
821 void SetSizerAndFit( wxSizer *sizer, bool deleteOld = TRUE );
822
823 wxSizer *GetSizer() const { return m_windowSizer; }
824
825 // Track if this window is a member of a sizer
826 void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; }
827 wxSizer *GetContainingSizer() const { return m_containingSizer; }
828
829 // accessibility
830 // ----------------------
831 #if wxUSE_ACCESSIBILITY
832 // Override to create a specific accessible object.
833 virtual wxAccessible* CreateAccessible();
834
835 // Sets the accessible object.
836 void SetAccessible(wxAccessible* accessible) ;
837
838 // Returns the accessible object.
839 wxAccessible* GetAccessible() { return m_accessible; };
840
841 // Returns the accessible object, creating if necessary.
842 wxAccessible* GetOrCreateAccessible() ;
843 #endif
844
845 // backward compatibility
846 // ----------------------
847 #if WXWIN_COMPATIBILITY
848 bool Enabled() const { return IsEnabled(); }
849
850 void SetButtonFont(const wxFont& font) { SetFont(font); }
851 void SetLabelFont(const wxFont& font) { SetFont(font); }
852 wxFont& GetLabelFont() { return GetFont(); };
853 wxFont& GetButtonFont() { return GetFont(); };
854 #endif // WXWIN_COMPATIBILITY
855
856 // implementation
857 // --------------
858
859 // event handlers
860 void OnSysColourChanged( wxSysColourChangedEvent& event );
861 void OnInitDialog( wxInitDialogEvent &event );
862 void OnMiddleClick( wxMouseEvent& event );
863 #if wxUSE_HELP
864 void OnHelp(wxHelpEvent& event);
865 #endif // wxUSE_HELP
866
867 // get the haqndle of the window for the underlying window system: this
868 // is only used for wxWin itself or for user code which wants to call
869 // platform-specific APIs
870 virtual WXWidget GetHandle() const = 0;
871
872 #if wxUSE_PALETTE
873 // Store the palette used by DCs in wxWindow so that the dcs can share
874 // a palette. And we can respond to palette messages.
875 wxPalette GetPalette() const { return m_palette; }
876
877 // When palette is changed tell the DC to set the system palette to the
878 // new one.
879 void SetPalette(const wxPalette& pal);
880
881 // return true if we have a specific palette
882 bool HasCustomPalette() const { return m_hasCustomPalette; }
883
884 // return the first parent window with a custom palette or NULL
885 wxWindow *GetAncestorWithCustomPalette() const;
886 #endif // wxUSE_PALETTE
887
888 protected:
889 #if wxUSE_CONSTRAINTS
890 // satisfy the constraints for the windows but don't set the window sizes
891 void SatisfyConstraints();
892 #endif // wxUSE_CONSTRAINTS
893
894 // the window id - a number which uniquely identifies a window among
895 // its siblings unless it is -1
896 wxWindowID m_windowId;
897
898 // the parent window of this window (or NULL) and the list of the children
899 // of this window
900 wxWindow *m_parent;
901 wxWindowList m_children;
902
903 // the minimal allowed size for the window (no minimal size if variable(s)
904 // contain(s) -1)
905 int m_minWidth,
906 m_minHeight,
907 m_maxWidth,
908 m_maxHeight;
909
910 // event handler for this window: usually is just 'this' but may be
911 // changed with SetEventHandler()
912 wxEvtHandler *m_eventHandler;
913
914 #if wxUSE_VALIDATORS
915 // associated validator or NULL if none
916 wxValidator *m_windowValidator;
917 #endif // wxUSE_VALIDATORS
918
919 #if wxUSE_DRAG_AND_DROP
920 wxDropTarget *m_dropTarget;
921 #endif // wxUSE_DRAG_AND_DROP
922
923 // visual window attributes
924 wxCursor m_cursor;
925 wxFont m_font;
926 wxColour m_backgroundColour, m_foregroundColour;
927
928 #if wxUSE_CARET
929 wxCaret *m_caret;
930 #endif // wxUSE_CARET
931
932 // the region which should be repainted in response to paint event
933 wxRegion m_updateRegion;
934
935 #if wxUSE_ACCEL
936 // the accelerator table for the window which translates key strokes into
937 // command events
938 wxAcceleratorTable m_acceleratorTable;
939 #endif // wxUSE_ACCEL
940
941 // the tooltip for this window (may be NULL)
942 #if wxUSE_TOOLTIPS
943 wxToolTip *m_tooltip;
944 #endif // wxUSE_TOOLTIPS
945
946 // constraints and sizers
947 #if wxUSE_CONSTRAINTS
948 // the constraints for this window or NULL
949 wxLayoutConstraints *m_constraints;
950
951 // constraints this window is involved in
952 wxWindowList *m_constraintsInvolvedIn;
953 #endif // wxUSE_CONSTRAINTS
954
955 // this window's sizer
956 wxSizer *m_windowSizer;
957
958 // The sizer this window is a member of, if any
959 wxSizer *m_containingSizer;
960
961 // Layout() window automatically when its size changes?
962 bool m_autoLayout:1;
963
964 // window state
965 bool m_isShown:1;
966 bool m_isEnabled:1;
967 bool m_isBeingDeleted:1;
968
969 // was the window colours/font explicitly changed by user?
970 bool m_hasBgCol:1;
971 bool m_hasFgCol:1;
972 bool m_hasFont:1;
973
974 // window attributes
975 long m_windowStyle,
976 m_exStyle;
977 wxString m_windowName;
978 bool m_themeEnabled;
979
980 #if wxUSE_PALETTE
981 wxPalette m_palette;
982 bool m_hasCustomPalette;
983 #endif // wxUSE_PALETTE
984
985 #if wxUSE_ACCESSIBILITY
986 wxAccessible* m_accessible;
987 #endif
988 // Virtual size (scrolling)
989 wxSize m_virtualSize;
990
991 int m_minVirtualWidth; // VirtualSizeHints
992 int m_minVirtualHeight;
993 int m_maxVirtualWidth;
994 int m_maxVirtualHeight;
995
996 // common part of all ctors: it is not virtual because it is called from
997 // ctor
998 void InitBase();
999
1000 // override this to change the default (i.e. used when no style is
1001 // specified) border for the window class
1002 virtual wxBorder GetDefaultBorder() const;
1003
1004 // get the default size for the new window if no explicit size given
1005 // FIXME why 20 and not 30, 10 or ...?
1006 static int WidthDefault(int w) { return w == -1 ? 20 : w; }
1007 static int HeightDefault(int h) { return h == -1 ? 20 : h; }
1008
1009 // set the best size for the control if the default size was given:
1010 // replaces the fields of size == -1 with the best values for them and
1011 // calls SetSize() if needed
1012 //
1013 // This function is rather unfortunately named.. it's really just a
1014 // smarter SetSize / convenience function for expanding wxDefaultSize.
1015 // Note that it does not influence the value returned by GetBestSize
1016 // at all.
1017 void SetBestSize(const wxSize& size)
1018 {
1019 // the size only needs to be changed if the current size is incomplete,
1020 // i.e. one of the components was specified as default -- so if both
1021 // were given, simply don't do anything
1022 if ( size.x == -1 || size.y == -1 )
1023 {
1024 wxSize sizeBest = DoGetBestSize();
1025 if ( size.x != -1 )
1026 sizeBest.x = size.x;
1027 if ( size.y != -1 )
1028 sizeBest.y = size.y;
1029
1030 SetSize(sizeBest);
1031 }
1032 }
1033
1034 // more pure virtual functions
1035 // ---------------------------
1036
1037 // NB: we must have DoSomething() function when Something() is an overloaded
1038 // method: indeed, we can't just have "virtual Something()" in case when
1039 // the function is overloaded because then we'd have to make virtual all
1040 // the variants (otherwise only the virtual function may be called on a
1041 // pointer to derived class according to C++ rules) which is, in
1042 // general, absolutely not needed. So instead we implement all
1043 // overloaded Something()s in terms of DoSomething() which will be the
1044 // only one to be virtual.
1045
1046 // coordinates translation
1047 virtual void DoClientToScreen( int *x, int *y ) const = 0;
1048 virtual void DoScreenToClient( int *x, int *y ) const = 0;
1049
1050 virtual wxHitTest DoHitTest(wxCoord x, wxCoord y) const;
1051
1052 // capture/release the mouse, used by Capture/ReleaseMouse()
1053 virtual void DoCaptureMouse() = 0;
1054 virtual void DoReleaseMouse() = 0;
1055
1056 // retrieve the position/size of the window
1057 virtual void DoGetPosition( int *x, int *y ) const = 0;
1058 virtual void DoGetSize( int *width, int *height ) const = 0;
1059 virtual void DoGetClientSize( int *width, int *height ) const = 0;
1060
1061 // get the size which best suits the window: for a control, it would be
1062 // the minimal size which doesn't truncate the control, for a panel - the
1063 // same size as it would have after a call to Fit()
1064 virtual wxSize DoGetBestSize() const;
1065
1066 // this is the virtual function to be overriden in any derived class which
1067 // wants to change how SetSize() or Move() works - it is called by all
1068 // versions of these functions in the base class
1069 virtual void DoSetSize(int x, int y,
1070 int width, int height,
1071 int sizeFlags = wxSIZE_AUTO) = 0;
1072
1073 // same as DoSetSize() for the client size
1074 virtual void DoSetClientSize(int width, int height) = 0;
1075
1076 // move the window to the specified location and resize it: this is called
1077 // from both DoSetSize() and DoSetClientSize() and would usually just
1078 // reposition this window except for composite controls which will want to
1079 // arrange themselves inside the given rectangle
1080 virtual void DoMoveWindow(int x, int y, int width, int height) = 0;
1081
1082 #if wxUSE_TOOLTIPS
1083 virtual void DoSetToolTip( wxToolTip *tip );
1084 #endif // wxUSE_TOOLTIPS
1085
1086 #if wxUSE_MENUS
1087 virtual bool DoPopupMenu( wxMenu *menu, int x, int y ) = 0;
1088 #endif // wxUSE_MENUS
1089
1090 // Makes an adjustment to the window position (for example, a frame that has
1091 // a toolbar that it manages itself).
1092 virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) const;
1093
1094
1095 private:
1096
1097 // contains the last id generated by NewControlId
1098 static int ms_lastControlId;
1099
1100 // the stack of windows which have captured the mouse
1101 static struct WXDLLEXPORT wxWindowNext *ms_winCaptureNext;
1102
1103 DECLARE_ABSTRACT_CLASS(wxWindowBase)
1104 DECLARE_NO_COPY_CLASS(wxWindowBase)
1105 DECLARE_EVENT_TABLE()
1106 };
1107
1108 // ----------------------------------------------------------------------------
1109 // now include the declaration of wxWindow class
1110 // ----------------------------------------------------------------------------
1111
1112 // include the declaration of the platform-specific class
1113 #if defined(__WXMSW__)
1114 #ifdef __WXUNIVERSAL__
1115 #define wxWindowNative wxWindowMSW
1116 #else // !wxUniv
1117 #define wxWindowMSW wxWindow
1118 #define sm_classwxWindowMSW sm_classwxWindow
1119 #endif // wxUniv/!wxUniv
1120 #include "wx/msw/window.h"
1121 #elif defined(__WXMOTIF__)
1122 #include "wx/motif/window.h"
1123 #elif defined(__WXGTK__)
1124 #ifdef __WXUNIVERSAL__
1125 #define wxWindowNative wxWindowGTK
1126 #else // !wxUniv
1127 #define wxWindowGTK wxWindow
1128 #define sm_classwxWindowGTK sm_classwxWindow
1129 #endif // wxUniv
1130 #include "wx/gtk/window.h"
1131 #elif defined(__WXX11__)
1132 #ifdef __WXUNIVERSAL__
1133 #define wxWindowNative wxWindowX11
1134 #else // !wxUniv
1135 #define wxWindowX11 wxWindow
1136 #define sm_classwxWindowX11 sm_classwxWindow
1137 #endif // wxUniv
1138 #include "wx/x11/window.h"
1139 #elif defined(__WXMGL__)
1140 #ifdef __WXUNIVERSAL__
1141 #define wxWindowNative wxWindowMGL
1142 #else // !wxUniv
1143 #define wxWindowMGL wxWindow
1144 #define sm_classwxWindowMGL sm_classwxWindow
1145 #endif // wxUniv
1146 #include "wx/mgl/window.h"
1147 #elif defined(__WXMAC__)
1148 #ifdef __WXUNIVERSAL__
1149 #define wxWindowNative wxWindowMac
1150 #else // !wxUniv
1151 #define wxWindowMac wxWindow
1152 #define sm_classwxWindowMac sm_classwxWindow
1153 #endif // wxUniv
1154 #include "wx/mac/window.h"
1155 #elif defined(__WXPM__)
1156 #ifdef __WXUNIVERSAL__
1157 #define wxWindowNative wxWindowOS2
1158 #else // !wxUniv
1159 #define wxWindowOS2 wxWindow
1160 #define sm_classwxWindowOS2 sm_classwxWindow
1161 #endif // wxUniv/!wxUniv
1162 #include "wx/os2/window.h"
1163 #endif
1164
1165 // for wxUniversal, we now derive the real wxWindow from wxWindow<platform>,
1166 // for the native ports we already have defined it above
1167 #if defined(__WXUNIVERSAL__)
1168 #ifndef wxWindowNative
1169 #error "wxWindowNative must be defined above!"
1170 #endif
1171
1172 #include "wx/univ/window.h"
1173 #endif // wxUniv
1174
1175 // ----------------------------------------------------------------------------
1176 // inline functions which couldn't be declared in the class body because of
1177 // forward dependencies
1178 // ----------------------------------------------------------------------------
1179
1180 inline wxWindow *wxWindowBase::GetGrandParent() const
1181 {
1182 return m_parent ? m_parent->GetParent() : (wxWindow *)NULL;
1183 }
1184
1185 // ----------------------------------------------------------------------------
1186 // global functions
1187 // ----------------------------------------------------------------------------
1188
1189 // Find the wxWindow at the current mouse position, also returning the mouse
1190 // position.
1191 WXDLLEXPORT extern wxWindow* wxFindWindowAtPointer(wxPoint& pt);
1192
1193 // Get the current mouse position.
1194 WXDLLEXPORT extern wxPoint wxGetMousePosition();
1195
1196 // get the currently active window of this application or NULL
1197 WXDLLEXPORT extern wxWindow *wxGetActiveWindow();
1198
1199 // get the (first) top level parent window
1200 WXDLLEXPORT wxWindow* wxGetTopLevelParent(wxWindow *win);
1201
1202 // deprecated (doesn't start with 'wx' prefix), use wxWindow::NewControlId()
1203 inline int NewControlId() { return wxWindowBase::NewControlId(); }
1204
1205 #if wxUSE_ACCESSIBILITY
1206 // ----------------------------------------------------------------------------
1207 // accessible object for windows
1208 // ----------------------------------------------------------------------------
1209
1210 class WXDLLEXPORT wxWindowAccessible: public wxAccessible
1211 {
1212 public:
1213 wxWindowAccessible(wxWindow* win): wxAccessible(win) {}
1214 virtual ~wxWindowAccessible() {};
1215
1216 // Overridables
1217
1218 // Can return either a child object, or an integer
1219 // representing the child element, starting from 1.
1220 virtual wxAccStatus HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject);
1221
1222 // Returns the rectangle for this object (id = 0) or a child element (id > 0).
1223 virtual wxAccStatus GetLocation(wxRect& rect, int elementId);
1224
1225 // Navigates from fromId to toId/toObject.
1226 virtual wxAccStatus Navigate(wxNavDir navDir, int fromId,
1227 int* toId, wxAccessible** toObject);
1228
1229 // Gets the name of the specified object.
1230 virtual wxAccStatus GetName(int childId, wxString* name);
1231
1232 // Gets the number of children.
1233 virtual wxAccStatus GetChildCount(int* childId);
1234
1235 // Gets the specified child (starting from 1).
1236 // If *child is NULL and return value is wxACC_OK,
1237 // this means that the child is a simple element and
1238 // not an accessible object.
1239 virtual wxAccStatus GetChild(int childId, wxAccessible** child);
1240
1241 // Gets the parent, or NULL.
1242 virtual wxAccStatus GetParent(wxAccessible** parent);
1243
1244 // Performs the default action. childId is 0 (the action for this object)
1245 // or > 0 (the action for a child).
1246 // Return wxACC_NOT_SUPPORTED if there is no default action for this
1247 // window (e.g. an edit control).
1248 virtual wxAccStatus DoDefaultAction(int childId);
1249
1250 // Gets the default action for this object (0) or > 0 (the action for a child).
1251 // Return wxACC_OK even if there is no action. actionName is the action, or the empty
1252 // string if there is no action.
1253 // The retrieved string describes the action that is performed on an object,
1254 // not what the object does as a result. For example, a toolbar button that prints
1255 // a document has a default action of "Press" rather than "Prints the current document."
1256 virtual wxAccStatus GetDefaultAction(int childId, wxString* actionName);
1257
1258 // Returns the description for this object or a child.
1259 virtual wxAccStatus GetDescription(int childId, wxString* description);
1260
1261 // Returns help text for this object or a child, similar to tooltip text.
1262 virtual wxAccStatus GetHelpText(int childId, wxString* helpText);
1263
1264 // Returns the keyboard shortcut for this object or child.
1265 // Return e.g. ALT+K
1266 virtual wxAccStatus GetKeyboardShortcut(int childId, wxString* shortcut);
1267
1268 // Returns a role constant.
1269 virtual wxAccStatus GetRole(int childId, wxAccRole* role);
1270
1271 // Returns a state constant.
1272 virtual wxAccStatus GetState(int childId, long* state);
1273
1274 // Returns a localized string representing the value for the object
1275 // or child.
1276 virtual wxAccStatus GetValue(int childId, wxString* strValue);
1277
1278 // Selects the object or child.
1279 virtual wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags);
1280
1281 // Gets the window with the keyboard focus.
1282 // If childId is 0 and child is NULL, no object in
1283 // this subhierarchy has the focus.
1284 // If this object has the focus, child should be 'this'.
1285 virtual wxAccStatus GetFocus(int* childId, wxAccessible** child);
1286
1287 // Gets a variant representing the selected children
1288 // of this object.
1289 // Acceptable values:
1290 // - a null variant (IsNull() returns TRUE)
1291 // - a list variant (GetType() == wxT("list")
1292 // - an integer representing the selected child element,
1293 // or 0 if this object is selected (GetType() == wxT("long")
1294 // - a "void*" pointer to a wxAccessible child object
1295 virtual wxAccStatus GetSelections(wxVariant* selections);
1296 };
1297
1298 #endif // wxUSE_ACCESSIBILITY
1299
1300
1301 #endif
1302 // _WX_WINDOW_H_BASE_
1303