1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWindowBase class - the interface of wxWindowBase
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_WINDOW_H_BASE_
13 #define _WX_WINDOW_H_BASE_
15 // ----------------------------------------------------------------------------
16 // headers which we must include here
17 // ----------------------------------------------------------------------------
19 #include "wx/event.h" // the base class
21 #include "wx/list.h" // defines wxWindowList
23 #include "wx/cursor.h" // we have member variables of these classes
24 #include "wx/font.h" // so we can't do without them
25 #include "wx/colour.h"
26 #include "wx/region.h"
29 // ----------------------------------------------------------------------------
30 // forward declarations
31 // ----------------------------------------------------------------------------
33 class WXDLLEXPORT wxClientData
;
34 class WXDLLEXPORT wxControl
;
35 class WXDLLEXPORT wxCursor
;
36 class WXDLLEXPORT wxDc
;
37 class WXDLLEXPORT wxDropTarget
;
38 class WXDLLEXPORT wxItemResource
;
39 class WXDLLEXPORT wxLayoutConstraints
;
40 class WXDLLEXPORT wxResourceTable
;
41 class WXDLLEXPORT wxSizer
;
42 class WXDLLEXPORT wxToolTip
;
43 class WXDLLEXPORT wxValidator
;
44 class WXDLLEXPORT wxWindowBase
;
45 class WXDLLEXPORT wxWindow
;
47 // ----------------------------------------------------------------------------
48 // (pseudo)template list classes
49 // ----------------------------------------------------------------------------
51 WX_DECLARE_LIST_3(wxWindow
, wxWindowBase
, wxWindowList
, wxWindowListNode
);
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 WXDLLEXPORT_DATA(extern wxWindowList
) wxTopLevelWindows
;
59 // ----------------------------------------------------------------------------
60 // helper classes used by [SG]etClientObject/Data
62 // TODO move into a separate header?
63 // ----------------------------------------------------------------------------
69 virtual ~wxClientData() { }
72 class wxStringClientData
: public wxClientData
75 wxStringClientData() { }
76 wxStringClientData( const wxString
&data
) : m_data(data
) { }
77 void SetData( const wxString
&data
) { m_data
= data
; }
78 const wxString
& GetData() const { return m_data
; }
84 // ----------------------------------------------------------------------------
85 // wxWindowBase is the base class for all GUI controls/widgets, this is the public
86 // interface of this class.
88 // Event handler: windows have themselves as their event handlers by default,
89 // but their event handlers could be set to another object entirely. This
90 // separation can reduce the amount of derivation required, and allow
91 // alteration of a window's functionality (e.g. by a resource editor that
92 // temporarily switches event handlers).
93 // ----------------------------------------------------------------------------
95 class WXDLLEXPORT wxWindowBase
: public wxEvtHandler
97 DECLARE_ABSTRACT_CLASS(wxWindowBase
);
100 // creating the window
101 // -------------------
104 wxWindowBase() { InitBase(); }
106 // pseudo ctor (can't be virtual, called from ctor)
107 bool CreateBase(wxWindowBase
*parent
,
109 const wxPoint
& pos
= wxDefaultPosition
,
110 const wxSize
& size
= wxDefaultSize
,
112 const wxString
& name
= wxPanelNameStr
);
114 virtual ~wxWindowBase();
116 #if wxUSE_WX_RESOURCES
117 // these functions are implemented in resource.cpp and resourc2.cpp
118 virtual bool LoadFromResource(wxWindow
*parent
,
119 const wxString
& resourceName
,
120 const wxResourceTable
*table
= (const wxResourceTable
*) NULL
);
121 virtual wxControl
*CreateItem(const wxItemResource
* childResource
,
122 const wxItemResource
* parentResource
,
123 const wxResourceTable
*table
= (const wxResourceTable
*) NULL
);
124 #endif // wxUSE_WX_RESOURCES
126 // deleting the window
127 // -------------------
129 // ask the window to close itself, return TRUE if the event handler
130 // honoured our request
131 bool Close( bool force
= FALSE
);
133 // the following functions delete the C++ objects (the window itself
134 // or its children) as well as the GUI windows and normally should
135 // never be used directly
137 // delete window unconditionally (dangerous!), returns TRUE if ok
138 virtual bool Destroy();
139 // delete all children of this window, returns TRUE if ok
140 bool DestroyChildren();
142 // is the window being deleted?
143 bool IsBeingDeleted() const { return m_isBeingDeleted
; }
148 // the title (or label, see below) of the window: the text which the
150 virtual void SetTitle( const wxString
& WXUNUSED(title
) ) { }
151 virtual wxString
GetTitle() const { return ""; }
153 // label is just the same as the title (but for, e.g., buttons it
154 // makes more sense to speak about labels)
155 wxString
GetLabel() const { return GetTitle(); }
157 // the window name is used for ressource setting in X, it is not the
158 // same as the window title/label
159 virtual void SetName( const wxString
&name
) { m_windowName
= name
; }
160 virtual wxString
GetName() const { return m_windowName
; }
162 // window id uniquely identifies the window among its siblings unless
163 // it is -1 which means "don't care"
164 void SetId( wxWindowID id
) { m_windowId
= id
; }
165 wxWindowID
GetId() const { return m_windowId
; }
167 // generate a control id for the controls which were not given one by
169 static int NewControlId() { return ++ms_lastControlId
; }
174 // set the window size and/or position
175 void SetSize( int x
, int y
, int width
, int height
,
176 int sizeFlags
= wxSIZE_AUTO
)
177 { DoSetSize(x
, y
, width
, height
, sizeFlags
); }
179 void SetSize( int width
, int height
)
180 { DoSetSize( -1, -1, width
, height
, wxSIZE_USE_EXISTING
); }
182 void SetSize( const wxSize
& size
)
183 { SetSize( size
.x
, size
.y
); }
185 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
186 { DoSetSize(rect
.x
, rect
.y
, rect
.width
, rect
.height
, sizeFlags
); }
188 void Move( int x
, int y
)
189 { DoSetSize( x
, y
, -1, -1, wxSIZE_USE_EXISTING
); }
191 void Move(const wxPoint
& pt
)
192 { Move(pt
.x
, pt
.y
); }
195 virtual void Raise() = 0;
196 virtual void Lower() = 0;
198 // client size is the size of area available for subwindows
199 void SetClientSize( int width
, int height
)
200 { DoSetClientSize(width
, height
); }
202 void SetClientSize( const wxSize
& size
)
203 { DoSetClientSize(size
.x
, size
.y
); }
205 void SetClientSize(const wxRect
& rect
)
206 { SetClientSize( rect
.width
, rect
.height
); }
208 // get the window position and/or size (pointers may be NULL)
209 void GetPosition( int *x
, int *y
) const { DoGetPosition(x
, y
); }
210 wxPoint
GetPosition() const
213 DoGetPosition(&w
, &h
);
215 return wxPoint(w
, h
);
218 void GetSize( int *w
, int *h
) const { DoGetSize(w
, h
); }
219 wxSize
GetSize() const
226 wxRect
GetRect() const
229 GetPosition(& x
, & y
);
232 return wxRect(x
, y
, w
, h
);
235 void GetClientSize( int *w
, int *h
) const { DoGetClientSize(w
, h
); }
236 wxSize
GetClientSize() const
239 DoGetClientSize(& w
, & h
);
244 // centre with respect to the the parent window
245 void Centre( int direction
= wxHORIZONTAL
);
246 void Center( int direction
= wxHORIZONTAL
) { Centre(direction
); }
248 // set window size to wrap around its children
251 // set min/max size of the window
252 virtual void SetSizeHints( int minW
, int minH
,
253 int maxW
= -1, int maxH
= -1,
254 int incW
= -1, int incH
= -1 );
259 // returns TRUE if window was shown/hidden, FALSE if the nothing was
260 // done (window was already shown/hidden)
261 virtual bool Show( bool show
= TRUE
);
262 bool Hide() { return Show(FALSE
); }
264 // returns TRUE if window was enabled/disabled, FALSE if nothing done
265 virtual bool Enable( bool enable
= TRUE
);
266 bool Disable() { return Enable(FALSE
); }
268 bool IsShown() const { return m_isShown
; }
269 bool IsEnabled() const { return m_isEnabled
; }
271 // get/set window style (setting style won't update the window and so
272 // is only useful for internal usage)
273 virtual void SetWindowStyleFlag( long style
) { m_windowStyle
= style
; }
274 virtual long GetWindowStyleFlag() const { return m_windowStyle
; }
276 // just some (somewhat shorter) synonims
277 void SetWindowStyle( long style
) { SetWindowStyleFlag(style
); }
278 long GetWindowStyle() const { return GetWindowStyleFlag(); }
280 bool HasFlag(int flag
) const { return (m_windowStyle
& flag
) != 0; }
282 virtual bool IsRetained() const
283 { return (m_windowStyle
& wxRETAINED
) != 0; }
285 // make the window modal (all other windows unresponsive)
286 virtual void MakeModal(bool modal
= TRUE
);
291 // set focus to this window
292 virtual void SetFocus() = 0;
294 // return the window which currently has the focus or NULL
295 static wxWindow
*FindFocus() /* = 0: implement in derived classes */;
297 // can this window have focus?
298 virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); }
300 // parent/children relations
301 // -------------------------
303 // get the list of children
304 const wxWindowList
& GetChildren() const { return m_children
; }
305 wxWindowList
& GetChildren() { return m_children
; }
307 // get the parent or the parent of the parent
308 wxWindow
*GetParent() const { return m_parent
; }
309 inline wxWindow
*GetGrandParent() const;
311 // is this window a top level one?
312 bool IsTopLevel() const { return m_parent
!= 0; }
314 // it doesn't really change parent, use ReParent() instead
315 void SetParent( wxWindowBase
*parent
) { m_parent
= (wxWindow
*)parent
; }
316 // change the real parent of this window, return TRUE if the parent
317 // was changed, FALSE otherwise (error or newParent == oldParent)
318 virtual bool Reparent( wxWindowBase
*newParent
);
320 // find window among the descendants of this one either by id or by
321 // name (return NULL if not found)
322 wxWindow
*FindWindow( long id
);
323 wxWindow
*FindWindow( const wxString
& name
);
325 // implementation mostly
326 virtual void AddChild( wxWindowBase
*child
);
327 virtual void RemoveChild( wxWindowBase
*child
);
329 // event handler stuff
330 // -------------------
332 // get the current event handler
333 wxEvtHandler
*GetEventHandler() const { return m_eventHandler
; }
335 // replace the event handler (allows to completely subclass the
337 void SetEventHandler( wxEvtHandler
*handler
) { m_eventHandler
= handler
; }
339 // push/pop event handler: allows to chain a custom event handler to
340 // alreasy existing ones
341 void PushEventHandler( wxEvtHandler
*handler
);
342 wxEvtHandler
*PopEventHandler( bool deleteHandler
= FALSE
);
344 // validators and client data
345 // --------------------------
347 // a window may have an associated validator which is used to control
349 virtual void SetValidator( const wxValidator
&validator
);
350 virtual wxValidator
*GetValidator() { return m_windowValidator
; }
352 // each window may have associated client data: either a pointer to
353 // wxClientData object in which case it is managed by the window (i.e.
354 // it will delete the data when it's destroyed) or an untyped pointer
355 // which won't be deleted by the window
356 virtual void SetClientObject( wxClientData
*data
)
358 if ( m_clientObject
)
359 delete m_clientObject
;
361 m_clientObject
= data
;
363 virtual wxClientData
*GetClientObject() const { return m_clientObject
; }
365 virtual void SetClientData( void *data
) { m_clientData
= data
; }
366 virtual void *GetClientData() const { return m_clientData
; }
368 // dialog oriented functions
369 // -------------------------
371 // validate the correctness of input, return TRUE if ok
372 virtual bool Validate();
374 // transfer data between internal and GUI representations
375 virtual bool TransferDataToWindow();
376 virtual bool TransferDataFromWindow();
378 virtual void InitDialog();
382 virtual void SetAcceleratorTable( const wxAcceleratorTable
& accel
)
383 { m_acceleratorTable
= accel
; }
384 wxAcceleratorTable
*GetAcceleratorTable()
385 { return &m_acceleratorTable
; }
387 // dialog units translations
388 // -------------------------
390 wxPoint
ConvertPixelsToDialog( const wxPoint
& pt
);
391 wxPoint
ConvertDialogToPixels( const wxPoint
& pt
);
392 wxSize
ConvertPixelsToDialog( const wxSize
& sz
)
394 wxPoint
pt(ConvertPixelsToDialog(wxPoint(sz
.x
, sz
.y
)));
396 return wxSize(pt
.x
, pt
.y
);
399 wxSize
ConvertDialogToPixels( const wxSize
& sz
)
401 wxPoint
pt(ConvertDialogToPixels(wxPoint(sz
.x
, sz
.y
)));
403 return wxSize(pt
.x
, pt
.y
);
409 // move the mouse to the specified position
410 virtual void WarpPointer(int x
, int y
) = 0;
412 // start or end mouse capture
413 virtual void CaptureMouse() = 0;
414 virtual void ReleaseMouse() = 0;
416 // painting the window
417 // -------------------
419 // mark the specified rectangle (or the whole window) as "dirty" so it
421 virtual void Refresh( bool eraseBackground
= TRUE
,
422 const wxRect
*rect
= (const wxRect
*) NULL
) = 0;
423 // clear the window entirely
424 virtual void Clear() = 0;
426 // adjust DC for drawing on this window
427 virtual void PrepareDC( wxDC
&dc
) { }
429 // the update region of the window contains the areas which must be
430 // repainted by the program
431 const wxRegion
& GetUpdateRegion() const { return m_updateRegion
; }
432 wxRegion
& GetUpdateRegion() { return m_updateRegion
; }
434 // these functions verify whether the given point/rectangle belongs to
435 // (or at least intersects with) the update region
436 bool IsExposed( int x
, int y
) const;
437 bool IsExposed( int x
, int y
, int w
, int h
) const;
439 bool IsExposed( const wxPoint
& pt
) const
440 { return IsExposed(pt
.x
, pt
.y
); }
441 bool IsExposed( const wxRect
& rect
) const
442 { return IsExposed(rect
.x
, rect
.y
, rect
.width
, rect
.height
); }
444 // colours, fonts and cursors
445 // --------------------------
447 // set/retrieve the window colours (system defaults are used by
448 // default): Set functions return TRUE if colour was changed
449 virtual bool SetBackgroundColour( const wxColour
&colour
);
450 virtual bool SetForegroundColour( const wxColour
&colour
);
452 wxColour
GetBackgroundColour() const { return m_backgroundColour
; }
453 wxColour
GetForegroundColour() const { return m_foregroundColour
; }
455 // set/retrieve the cursor for this window (SetCursor() returns TRUE
456 // if the cursor was really changed)
457 virtual bool SetCursor( const wxCursor
&cursor
);
458 const wxCursor
& GetCursor() const { return m_cursor
; }
459 wxCursor
& GetCursor() { return m_cursor
; }
461 // set/retrieve the font for the window (SetFont() returns TRUE if the
462 // font really changed)
463 virtual bool SetFont( const wxFont
&font
) = 0;
464 const wxFont
& GetFont() const { return m_font
; }
465 wxFont
& GetFont() { return m_font
; }
467 // get the (average) character size for the current font
468 virtual int GetCharHeight() const = 0;
469 virtual int GetCharWidth() const = 0;
471 // get the width/height/... of the text using current or specified
473 virtual void GetTextExtent(const wxString
& string
,
475 int *descent
= (int *) NULL
,
476 int *externalLeading
= (int *) NULL
,
477 const wxFont
*theFont
= (const wxFont
*) NULL
)
480 // translate to/from screen/client coordinates (pointers may be NULL)
481 virtual void ClientToScreen( int *x
, int *y
) const = 0;
482 virtual void ScreenToClient( int *x
, int *y
) const = 0;
487 void UpdateWindowUI();
489 virtual bool PopupMenu( wxMenu
*menu
, int x
, int y
) = 0;
494 // configure the window scrollbars
495 virtual void SetScrollbar( int orient
,
499 bool refresh
= TRUE
) = 0;
500 virtual void SetScrollPos( int orient
, int pos
, bool refresh
= TRUE
) = 0;
501 virtual int GetScrollPos( int orient
) const = 0;
502 virtual int GetScrollThumb( int orient
) const = 0;
503 virtual int GetScrollRange( int orient
) const = 0;
505 // scroll window to the specified position
506 virtual void ScrollWindow( int dx
, int dy
,
507 const wxRect
* rect
= (wxRect
*) NULL
) = 0;
512 // the easiest way to set a tooltip for a window is to use this method
513 void SetToolTip( const wxString
&tip
);
514 // attach a tooltip to the window
515 void SetToolTip( wxToolTip
*tip
) { DoSetToolTip(tip
); }
516 // get the associated tooltip or NULL if none
517 wxToolTip
* GetToolTip() const { return m_tooltip
; }
518 #endif // wxUSE_TOOLTIPS
522 #if wxUSE_DRAG_AND_DROP
523 // set/retrieve the drop target associated with this window (may be
524 // NULL; it's owned by the window and will be deleted by it)
525 virtual void SetDropTarget( wxDropTarget
*dropTarget
) = 0;
526 virtual wxDropTarget
*GetDropTarget() const { return m_dropTarget
; }
527 #endif // wxUSE_DRAG_AND_DROP
529 // constraints and sizers
530 // ----------------------
531 #if wxUSE_CONSTRAINTS
532 // set the constraints for this window or retrieve them (may be NULL)
533 void SetConstraints( wxLayoutConstraints
*constraints
);
534 wxLayoutConstraints
*GetConstraints() const { return m_constraints
; }
536 // when using constraints, it makes sense to update children positions
537 // automatically whenever the window is resized - this is done if
539 void SetAutoLayout( bool autoLayout
) { m_autoLayout
= autoLayout
; }
540 bool GetAutoLayout() const { return m_autoLayout
; }
542 // do layout the window and its children
543 virtual bool Layout();
545 // implementation only
546 void UnsetConstraints(wxLayoutConstraints
*c
);
547 wxWindowList
*GetConstraintsInvolvedIn() const
548 { return m_constraintsInvolvedIn
; }
549 void AddConstraintReference(wxWindowBase
*otherWin
);
550 void RemoveConstraintReference(wxWindowBase
*otherWin
);
551 void DeleteRelatedConstraints();
552 void ResetConstraints();
554 // these methods may be overriden for special layout algorithms
555 virtual void SetConstraintSizes(bool recurse
= TRUE
);
556 virtual bool LayoutPhase1(int *noChanges
);
557 virtual bool LayoutPhase2(int *noChanges
);
558 virtual bool DoPhase(int);
560 // these methods are virtual but normally won't be overridden
561 virtual void TransformSizerToActual(int *x
, int *y
) const ;
562 virtual void SetSizeConstraint(int x
, int y
, int w
, int h
);
563 virtual void MoveConstraint(int x
, int y
);
564 virtual void GetSizeConstraint(int *w
, int *h
) const ;
565 virtual void GetClientSizeConstraint(int *w
, int *h
) const ;
566 virtual void GetPositionConstraint(int *x
, int *y
) const ;
569 // TODO: what are they and how do they work??
570 void SetSizer( wxSizer
*sizer
);
571 wxSizer
*GetSizer() const { return m_windowSizer
; }
573 void SetSizerParent( wxWindowBase
*win
) { m_sizerParent
= win
; }
574 wxWindowBase
*GetSizerParent() const { return m_sizerParent
; }
576 virtual void SizerSetSize(int x
, int y
, int w
, int h
);
577 virtual void SizerMove(int x
, int y
);
578 #endif // wxUSE_CONSTRAINTS
580 // backward compatibility
581 // ----------------------
582 #if WXWIN_COMPATIBILITY
583 bool Enabled() const { return IsEnabled(); }
585 void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
586 void SetLabelFont(const wxFont
& font
) { SetFont(font
); }
587 wxFont
& GetLabelFont() { return GetFont(); };
588 wxFont
& GetButtonFont() { return GetFont(); };
589 #endif // WXWIN_COMPATIBILITY
595 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
596 void OnInitDialog( wxInitDialogEvent
&event
);
599 What is this doing in the platform independent part?
602 WXWidget GetHandle() const { return m_widget; }
604 // the window handle (for the underlying windowing system) and the window
605 // id - a number which uniquely identifies a window among its siblings
609 // we have 2 common names for this member, one for MSW and the other
610 // for the rest of the world
616 wxWindowID m_windowId
;
618 // the parent window of this window (or NULL) and the list of the children
621 wxWindowList m_children
;
623 // the minimal allowed size for the window (no minimal size if variable(s)
625 int m_minWidth
, m_minHeight
, m_maxWidth
, m_maxHeight
;
627 // event handler for this window: usually is just 'this' but may be
628 // changed with SetEventHandler()
629 wxEvtHandler
*m_eventHandler
;
631 // associated validator or NULL if none
632 wxValidator
*m_windowValidator
;
634 #if wxUSE_DRAG_AND_DROP
635 wxDropTarget
*m_dropTarget
;
636 #endif // wxUSE_DRAG_AND_DROP
638 // visual window attributes
641 wxColour m_backgroundColour
, m_foregroundColour
;
643 // the region which should be repainted in response to paint event
644 wxRegion m_updateRegion
;
646 // the accelerator table for the window which translates key strokes into
648 wxAcceleratorTable m_acceleratorTable
;
650 // user data associated with the window: either an object which will be
651 // deleted by the window when it's deleted or some raw pointer which we do
653 wxClientData
*m_clientObject
;
656 // the tooltip for this window (may be NULL)
658 wxToolTip
*m_tooltip
;
659 #endif // wxUSE_TOOLTIPS
661 // constraints and sizers
662 #if wxUSE_CONSTRAINTS
663 // the constraints for this window or NULL
664 wxLayoutConstraints
*m_constraints
;
666 // constraints this window is involved in
667 wxWindowList
*m_constraintsInvolvedIn
;
669 // top level and the parent sizers
670 // TODO what's this and how does it work?)
671 wxSizer
*m_windowSizer
;
672 wxWindowBase
*m_sizerParent
;
674 // Layout() window automatically when its size changes?
676 #endif // wxUSE_CONSTRAINTS
681 bool m_isBeingDeleted
:1;
685 wxString m_windowName
;
688 // common part of all ctors: it is not virtual because it is called from
692 // get the default size for the new window if no explicit size given
693 // FIXME why 20 and not 30, 10 or ...?
694 static int WidthDefault(int w
) { return w
== -1 ? 20 : w
; }
695 static int HeightDefault(int h
) { return h
== -1 ? 20 : h
; }
697 // more pure virtual functions
698 // ---------------------------
700 // NB: we must have DoSomething() function when Something() is an overloaded
701 // method: indeed, we can't just have "virtual Something()" in case when
702 // the function is overloaded because then we'd have to make virtual all
703 // the variants (otherwise only the virtual function may be called on a
704 // pointer to derived class according to C++ rules) which is, in
705 // general, absolutely not needed. So instead we implement all
706 // overloaded Something()s in terms of DoSomething() which will be the
707 // only one to be virtual.
709 // retrieve the position/size of the window
710 virtual void DoGetPosition( int *x
, int *y
) const = 0;
711 virtual void DoGetSize( int *width
, int *height
) const = 0;
712 virtual void DoGetClientSize( int *width
, int *height
) const = 0;
714 // this is the virtual function to be overriden in any derived class which
715 // wants to change how SetSize() or Move() works - it is called by all
716 // versions of these functions in the base class
717 virtual void DoSetSize(int x
, int y
,
718 int width
, int height
,
719 int sizeFlags
= wxSIZE_AUTO
) = 0;
721 // same as DoSetSize() for the client size
722 virtual void DoSetClientSize(int width
, int height
) = 0;
725 virtual void DoSetToolTip( wxToolTip
*tip
);
726 #endif // wxUSE_TOOLTIPS
729 // contains the last id generated by NewControlId
730 static int ms_lastControlId
;
732 DECLARE_EVENT_TABLE()
735 // ----------------------------------------------------------------------------
736 // now include the declaration of wxWindow class
737 // ----------------------------------------------------------------------------
739 #if defined(__WXMSW__)
740 #include "wx/msw/window.h"
741 #elif defined(__WXMOTIF__)
742 #include "wx/motif/window.h"
743 #elif defined(__WXGTK__)
744 #include "wx/gtk/window.h"
745 #elif defined(__WXQT__)
746 #include "wx/qt/window.h"
747 #elif defined(__WXMAC__)
748 #include "wx/mac/window.h"
751 // ----------------------------------------------------------------------------
752 // inline functions which couldn't be declared in the class body because of
753 // forward dependencies
754 // ----------------------------------------------------------------------------
756 inline wxWindow
*wxWindowBase::GetGrandParent() const
758 return m_parent
? m_parent
->GetParent() : (wxWindow
*)NULL
;
761 // ----------------------------------------------------------------------------
763 // ----------------------------------------------------------------------------
765 extern wxWindow
* WXDLLEXPORT
wxGetActiveWindow();
766 inline int WXDLLEXPORT
NewControlId() { return wxWindowBase::NewControlId(); }
769 // _WX_WINDOW_H_BASE_