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_
16 #pragma interface "windowbase.h"
19 // ----------------------------------------------------------------------------
20 // headers which we must include here
21 // ----------------------------------------------------------------------------
23 #include "wx/event.h" // the base class
25 #include "wx/list.h" // defines wxWindowList
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"
33 // ----------------------------------------------------------------------------
34 // forward declarations
35 // ----------------------------------------------------------------------------
37 class WXDLLEXPORT wxClientData
;
38 class WXDLLEXPORT wxControl
;
39 class WXDLLEXPORT wxCursor
;
40 class WXDLLEXPORT wxDC
;
41 class WXDLLEXPORT wxDropTarget
;
42 class WXDLLEXPORT wxItemResource
;
43 class WXDLLEXPORT wxLayoutConstraints
;
44 class WXDLLEXPORT wxResourceTable
;
45 class WXDLLEXPORT wxSizer
;
46 class WXDLLEXPORT wxToolTip
;
47 class WXDLLEXPORT wxValidator
;
48 class WXDLLEXPORT wxWindowBase
;
49 class WXDLLEXPORT wxWindow
;
51 // ----------------------------------------------------------------------------
52 // (pseudo)template list classes
53 // ----------------------------------------------------------------------------
55 WX_DECLARE_LIST_3(wxWindow
, wxWindowBase
, wxWindowList
, wxWindowListNode
);
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
61 WXDLLEXPORT_DATA(extern wxWindowList
) wxTopLevelWindows
;
63 // ----------------------------------------------------------------------------
64 // helper classes used by [SG]etClientObject/Data
66 // TODO move into a separate header?
67 // ----------------------------------------------------------------------------
73 virtual ~wxClientData() { }
76 class wxStringClientData
: public wxClientData
79 wxStringClientData() { }
80 wxStringClientData( const wxString
&data
) : m_data(data
) { }
81 void SetData( const wxString
&data
) { m_data
= data
; }
82 const wxString
& GetData() const { return m_data
; }
88 // ----------------------------------------------------------------------------
89 // wxWindowBase is the base class for all GUI controls/widgets, this is the public
90 // interface of this class.
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 // ----------------------------------------------------------------------------
99 class WXDLLEXPORT wxWindowBase
: public wxEvtHandler
101 DECLARE_ABSTRACT_CLASS(wxWindowBase
);
104 // creating the window
105 // -------------------
108 wxWindowBase() { InitBase(); }
110 // pseudo ctor (can't be virtual, called from ctor)
111 bool CreateBase(wxWindowBase
*parent
,
113 const wxPoint
& pos
= wxDefaultPosition
,
114 const wxSize
& size
= wxDefaultSize
,
116 const wxString
& name
= wxPanelNameStr
);
118 virtual ~wxWindowBase();
120 #if wxUSE_WX_RESOURCES
121 // these functions are implemented in resource.cpp and resourc2.cpp
122 virtual bool LoadFromResource(wxWindow
*parent
,
123 const wxString
& resourceName
,
124 const wxResourceTable
*table
= (const wxResourceTable
*) NULL
);
125 virtual wxControl
*CreateItem(const wxItemResource
* childResource
,
126 const wxItemResource
* parentResource
,
127 const wxResourceTable
*table
= (const wxResourceTable
*) NULL
);
128 #endif // wxUSE_WX_RESOURCES
130 // deleting the window
131 // -------------------
133 // ask the window to close itself, return TRUE if the event handler
134 // honoured our request
135 bool Close( bool force
= FALSE
);
137 // the following functions delete the C++ objects (the window itself
138 // or its children) as well as the GUI windows and normally should
139 // never be used directly
141 // delete window unconditionally (dangerous!), returns TRUE if ok
142 virtual bool Destroy();
143 // delete all children of this window, returns TRUE if ok
144 bool DestroyChildren();
146 // is the window being deleted?
147 bool IsBeingDeleted() const { return m_isBeingDeleted
; }
152 // the title (or label, see below) of the window: the text which the
154 virtual void SetTitle( const wxString
& WXUNUSED(title
) ) { }
155 virtual wxString
GetTitle() const { return ""; }
157 // label is just the same as the title (but for, e.g., buttons it
158 // makes more sense to speak about labels)
159 virtual wxString
GetLabel() const { return GetTitle(); }
161 // the window name is used for ressource setting in X, it is not the
162 // same as the window title/label
163 virtual void SetName( const wxString
&name
) { m_windowName
= name
; }
164 virtual wxString
GetName() const { return m_windowName
; }
166 // window id uniquely identifies the window among its siblings unless
167 // it is -1 which means "don't care"
168 void SetId( wxWindowID id
) { m_windowId
= id
; }
169 wxWindowID
GetId() const { return m_windowId
; }
171 // generate a control id for the controls which were not given one by
173 static int NewControlId() { return --ms_lastControlId
; }
178 // set the window size and/or position
179 void SetSize( int x
, int y
, int width
, int height
,
180 int sizeFlags
= wxSIZE_AUTO
)
181 { DoSetSize(x
, y
, width
, height
, sizeFlags
); }
183 void SetSize( int width
, int height
)
184 { DoSetSize( -1, -1, width
, height
, wxSIZE_USE_EXISTING
); }
186 void SetSize( const wxSize
& size
)
187 { SetSize( size
.x
, size
.y
); }
189 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
190 { DoSetSize(rect
.x
, rect
.y
, rect
.width
, rect
.height
, sizeFlags
); }
192 void Move( int x
, int y
)
193 { DoSetSize( x
, y
, -1, -1, wxSIZE_USE_EXISTING
); }
195 void Move(const wxPoint
& pt
)
196 { Move(pt
.x
, pt
.y
); }
199 virtual void Raise() = 0;
200 virtual void Lower() = 0;
202 // client size is the size of area available for subwindows
203 void SetClientSize( int width
, int height
)
204 { DoSetClientSize(width
, height
); }
206 void SetClientSize( const wxSize
& size
)
207 { DoSetClientSize(size
.x
, size
.y
); }
209 void SetClientSize(const wxRect
& rect
)
210 { SetClientSize( rect
.width
, rect
.height
); }
212 // get the window position and/or size (pointers may be NULL)
213 void GetPosition( int *x
, int *y
) const { DoGetPosition(x
, y
); }
214 wxPoint
GetPosition() const
217 DoGetPosition(&w
, &h
);
219 return wxPoint(w
, h
);
222 void GetSize( int *w
, int *h
) const { DoGetSize(w
, h
); }
223 wxSize
GetSize() const
230 wxRect
GetRect() const
233 GetPosition(& x
, & y
);
236 return wxRect(x
, y
, w
, h
);
239 void GetClientSize( int *w
, int *h
) const { DoGetClientSize(w
, h
); }
240 wxSize
GetClientSize() const
243 DoGetClientSize(& w
, & h
);
248 // centre with respect to the the parent window
249 void Centre( int direction
= wxHORIZONTAL
);
250 void Center( int direction
= wxHORIZONTAL
) { Centre(direction
); }
252 // set window size to wrap around its children
255 // set min/max size of the window
256 virtual void SetSizeHints( int minW
, int minH
,
257 int maxW
= -1, int maxH
= -1,
258 int incW
= -1, int incH
= -1 );
263 // returns TRUE if window was shown/hidden, FALSE if the nothing was
264 // done (window was already shown/hidden)
265 virtual bool Show( bool show
= TRUE
);
266 bool Hide() { return Show(FALSE
); }
268 // returns TRUE if window was enabled/disabled, FALSE if nothing done
269 virtual bool Enable( bool enable
= TRUE
);
270 bool Disable() { return Enable(FALSE
); }
272 bool IsShown() const { return m_isShown
; }
273 bool IsEnabled() const { return m_isEnabled
; }
275 // get/set window style (setting style won't update the window and so
276 // is only useful for internal usage)
277 virtual void SetWindowStyleFlag( long style
) { m_windowStyle
= style
; }
278 virtual long GetWindowStyleFlag() const { return m_windowStyle
; }
280 // just some (somewhat shorter) synonims
281 void SetWindowStyle( long style
) { SetWindowStyleFlag(style
); }
282 long GetWindowStyle() const { return GetWindowStyleFlag(); }
284 bool HasFlag(int flag
) const { return (m_windowStyle
& flag
) != 0; }
286 virtual bool IsRetained() const
287 { return (m_windowStyle
& wxRETAINED
) != 0; }
289 // make the window modal (all other windows unresponsive)
290 virtual void MakeModal(bool modal
= TRUE
);
295 // set focus to this window
296 virtual void SetFocus() = 0;
298 // return the window which currently has the focus or NULL
299 static wxWindow
*FindFocus() /* = 0: implement in derived classes */;
301 // can this window have focus?
302 virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); }
304 // parent/children relations
305 // -------------------------
307 // get the list of children
308 const wxWindowList
& GetChildren() const { return m_children
; }
309 wxWindowList
& GetChildren() { return m_children
; }
311 // get the parent or the parent of the parent
312 wxWindow
*GetParent() const { return m_parent
; }
313 inline wxWindow
*GetGrandParent() const;
315 // is this window a top level one?
316 bool IsTopLevel() const { return m_parent
!= 0; }
318 // it doesn't really change parent, use ReParent() instead
319 void SetParent( wxWindowBase
*parent
) { m_parent
= (wxWindow
*)parent
; }
320 // change the real parent of this window, return TRUE if the parent
321 // was changed, FALSE otherwise (error or newParent == oldParent)
322 virtual bool Reparent( wxWindowBase
*newParent
);
324 // find window among the descendants of this one either by id or by
325 // name (return NULL if not found)
326 wxWindow
*FindWindow( long id
);
327 wxWindow
*FindWindow( const wxString
& name
);
329 // implementation mostly
330 virtual void AddChild( wxWindowBase
*child
);
331 virtual void RemoveChild( wxWindowBase
*child
);
333 // event handler stuff
334 // -------------------
336 // get the current event handler
337 wxEvtHandler
*GetEventHandler() const { return m_eventHandler
; }
339 // replace the event handler (allows to completely subclass the
341 void SetEventHandler( wxEvtHandler
*handler
) { m_eventHandler
= handler
; }
343 // push/pop event handler: allows to chain a custom event handler to
344 // alreasy existing ones
345 void PushEventHandler( wxEvtHandler
*handler
);
346 wxEvtHandler
*PopEventHandler( bool deleteHandler
= FALSE
);
348 // validators and client data
349 // --------------------------
351 // a window may have an associated validator which is used to control
353 virtual void SetValidator( const wxValidator
&validator
);
354 virtual wxValidator
*GetValidator() { return m_windowValidator
; }
356 // each window may have associated client data: either a pointer to
357 // wxClientData object in which case it is managed by the window (i.e.
358 // it will delete the data when it's destroyed) or an untyped pointer
359 // which won't be deleted by the window
360 virtual void SetClientObject( wxClientData
*data
)
362 if ( m_clientObject
)
363 delete m_clientObject
;
365 m_clientObject
= data
;
367 virtual wxClientData
*GetClientObject() const { return m_clientObject
; }
369 virtual void SetClientData( void *data
) { m_clientData
= data
; }
370 virtual void *GetClientData() const { return m_clientData
; }
372 // dialog oriented functions
373 // -------------------------
375 // validate the correctness of input, return TRUE if ok
376 virtual bool Validate();
378 // transfer data between internal and GUI representations
379 virtual bool TransferDataToWindow();
380 virtual bool TransferDataFromWindow();
382 virtual void InitDialog();
386 virtual void SetAcceleratorTable( const wxAcceleratorTable
& accel
)
387 { m_acceleratorTable
= accel
; }
388 wxAcceleratorTable
*GetAcceleratorTable()
389 { return &m_acceleratorTable
; }
391 // dialog units translations
392 // -------------------------
394 wxPoint
ConvertPixelsToDialog( const wxPoint
& pt
);
395 wxPoint
ConvertDialogToPixels( const wxPoint
& pt
);
396 wxSize
ConvertPixelsToDialog( const wxSize
& sz
)
398 wxPoint
pt(ConvertPixelsToDialog(wxPoint(sz
.x
, sz
.y
)));
400 return wxSize(pt
.x
, pt
.y
);
403 wxSize
ConvertDialogToPixels( const wxSize
& sz
)
405 wxPoint
pt(ConvertDialogToPixels(wxPoint(sz
.x
, sz
.y
)));
407 return wxSize(pt
.x
, pt
.y
);
413 // move the mouse to the specified position
414 virtual void WarpPointer(int x
, int y
) = 0;
416 // start or end mouse capture
417 virtual void CaptureMouse() = 0;
418 virtual void ReleaseMouse() = 0;
420 // painting the window
421 // -------------------
423 // mark the specified rectangle (or the whole window) as "dirty" so it
425 virtual void Refresh( bool eraseBackground
= TRUE
,
426 const wxRect
*rect
= (const wxRect
*) NULL
) = 0;
427 // clear the window entirely
428 virtual void Clear() = 0;
430 // adjust DC for drawing on this window
431 virtual void PrepareDC( wxDC
& WXUNUSED(dc
) ) { }
433 // the update region of the window contains the areas which must be
434 // repainted by the program
435 const wxRegion
& GetUpdateRegion() const { return m_updateRegion
; }
436 wxRegion
& GetUpdateRegion() { return m_updateRegion
; }
438 // these functions verify whether the given point/rectangle belongs to
439 // (or at least intersects with) the update region
440 bool IsExposed( int x
, int y
) const;
441 bool IsExposed( int x
, int y
, int w
, int h
) const;
443 bool IsExposed( const wxPoint
& pt
) const
444 { return IsExposed(pt
.x
, pt
.y
); }
445 bool IsExposed( const wxRect
& rect
) const
446 { return IsExposed(rect
.x
, rect
.y
, rect
.width
, rect
.height
); }
448 // colours, fonts and cursors
449 // --------------------------
451 // set/retrieve the window colours (system defaults are used by
452 // default): Set functions return TRUE if colour was changed
453 virtual bool SetBackgroundColour( const wxColour
&colour
);
454 virtual bool SetForegroundColour( const wxColour
&colour
);
456 wxColour
GetBackgroundColour() const { return m_backgroundColour
; }
457 wxColour
GetForegroundColour() const { return m_foregroundColour
; }
459 // set/retrieve the cursor for this window (SetCursor() returns TRUE
460 // if the cursor was really changed)
461 virtual bool SetCursor( const wxCursor
&cursor
);
462 const wxCursor
& GetCursor() const { return m_cursor
; }
463 wxCursor
& GetCursor() { return m_cursor
; }
465 // set/retrieve the font for the window (SetFont() returns TRUE if the
466 // font really changed)
467 virtual bool SetFont( const wxFont
&font
) = 0;
468 const wxFont
& GetFont() const { return m_font
; }
469 wxFont
& GetFont() { return m_font
; }
471 // get the (average) character size for the current font
472 virtual int GetCharHeight() const = 0;
473 virtual int GetCharWidth() const = 0;
475 // get the width/height/... of the text using current or specified
477 virtual void GetTextExtent(const wxString
& string
,
479 int *descent
= (int *) NULL
,
480 int *externalLeading
= (int *) NULL
,
481 const wxFont
*theFont
= (const wxFont
*) NULL
)
484 // translate to/from screen/client coordinates (pointers may be NULL)
485 virtual void ClientToScreen( int *x
, int *y
) const = 0;
486 virtual void ScreenToClient( int *x
, int *y
) const = 0;
491 void UpdateWindowUI();
493 virtual bool PopupMenu( wxMenu
*menu
, int x
, int y
) = 0;
498 // configure the window scrollbars
499 virtual void SetScrollbar( int orient
,
503 bool refresh
= TRUE
) = 0;
504 virtual void SetScrollPos( int orient
, int pos
, bool refresh
= TRUE
) = 0;
505 virtual int GetScrollPos( int orient
) const = 0;
506 virtual int GetScrollThumb( int orient
) const = 0;
507 virtual int GetScrollRange( int orient
) const = 0;
509 // scroll window to the specified position
510 virtual void ScrollWindow( int dx
, int dy
,
511 const wxRect
* rect
= (wxRect
*) NULL
) = 0;
516 // the easiest way to set a tooltip for a window is to use this method
517 void SetToolTip( const wxString
&tip
);
518 // attach a tooltip to the window
519 void SetToolTip( wxToolTip
*tip
) { DoSetToolTip(tip
); }
520 // get the associated tooltip or NULL if none
521 wxToolTip
* GetToolTip() const { return m_tooltip
; }
522 #endif // wxUSE_TOOLTIPS
526 #if wxUSE_DRAG_AND_DROP
527 // set/retrieve the drop target associated with this window (may be
528 // NULL; it's owned by the window and will be deleted by it)
529 virtual void SetDropTarget( wxDropTarget
*dropTarget
) = 0;
530 virtual wxDropTarget
*GetDropTarget() const { return m_dropTarget
; }
531 #endif // wxUSE_DRAG_AND_DROP
533 // constraints and sizers
534 // ----------------------
535 #if wxUSE_CONSTRAINTS
536 // set the constraints for this window or retrieve them (may be NULL)
537 void SetConstraints( wxLayoutConstraints
*constraints
);
538 wxLayoutConstraints
*GetConstraints() const { return m_constraints
; }
540 // when using constraints, it makes sense to update children positions
541 // automatically whenever the window is resized - this is done if
543 void SetAutoLayout( bool autoLayout
) { m_autoLayout
= autoLayout
; }
544 bool GetAutoLayout() const { return m_autoLayout
; }
546 // do layout the window and its children
547 virtual bool Layout();
549 // implementation only
550 void UnsetConstraints(wxLayoutConstraints
*c
);
551 wxWindowList
*GetConstraintsInvolvedIn() const
552 { return m_constraintsInvolvedIn
; }
553 void AddConstraintReference(wxWindowBase
*otherWin
);
554 void RemoveConstraintReference(wxWindowBase
*otherWin
);
555 void DeleteRelatedConstraints();
556 void ResetConstraints();
558 // these methods may be overriden for special layout algorithms
559 virtual void SetConstraintSizes(bool recurse
= TRUE
);
560 virtual bool LayoutPhase1(int *noChanges
);
561 virtual bool LayoutPhase2(int *noChanges
);
562 virtual bool DoPhase(int);
564 // these methods are virtual but normally won't be overridden
565 virtual void TransformSizerToActual(int *x
, int *y
) const ;
566 virtual void SetSizeConstraint(int x
, int y
, int w
, int h
);
567 virtual void MoveConstraint(int x
, int y
);
568 virtual void GetSizeConstraint(int *w
, int *h
) const ;
569 virtual void GetClientSizeConstraint(int *w
, int *h
) const ;
570 virtual void GetPositionConstraint(int *x
, int *y
) const ;
573 // TODO: what are they and how do they work??
574 void SetSizer( wxSizer
*sizer
);
575 wxSizer
*GetSizer() const { return m_windowSizer
; }
577 void SetSizerParent( wxWindowBase
*win
) { m_sizerParent
= win
; }
578 wxWindowBase
*GetSizerParent() const { return m_sizerParent
; }
580 virtual void SizerSetSize(int x
, int y
, int w
, int h
);
581 virtual void SizerMove(int x
, int y
);
582 #endif // wxUSE_CONSTRAINTS
584 // backward compatibility
585 // ----------------------
586 #if WXWIN_COMPATIBILITY
587 bool Enabled() const { return IsEnabled(); }
589 void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
590 void SetLabelFont(const wxFont
& font
) { SetFont(font
); }
591 wxFont
& GetLabelFont() { return GetFont(); };
592 wxFont
& GetButtonFont() { return GetFont(); };
593 #endif // WXWIN_COMPATIBILITY
599 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
600 void OnInitDialog( wxInitDialogEvent
&event
);
602 // get the haqndle of the window for the underlying window system: this
603 // is only used for wxWin itself or for user code which wants to call
604 // platform-specific APIs
605 virtual WXWidget
GetHandle() const = 0;
608 // the window id - a number which uniquely identifies a window among
609 // its siblings unless it is -1
610 wxWindowID m_windowId
;
612 // the parent window of this window (or NULL) and the list of the children
615 wxWindowList m_children
;
617 // the minimal allowed size for the window (no minimal size if variable(s)
619 int m_minWidth
, m_minHeight
, m_maxWidth
, m_maxHeight
;
621 // event handler for this window: usually is just 'this' but may be
622 // changed with SetEventHandler()
623 wxEvtHandler
*m_eventHandler
;
625 // associated validator or NULL if none
626 wxValidator
*m_windowValidator
;
628 #if wxUSE_DRAG_AND_DROP
629 wxDropTarget
*m_dropTarget
;
630 #endif // wxUSE_DRAG_AND_DROP
632 // visual window attributes
635 wxColour m_backgroundColour
, m_foregroundColour
;
637 // the region which should be repainted in response to paint event
638 wxRegion m_updateRegion
;
640 // the accelerator table for the window which translates key strokes into
642 wxAcceleratorTable m_acceleratorTable
;
644 // user data associated with the window: either an object which will be
645 // deleted by the window when it's deleted or some raw pointer which we do
647 wxClientData
*m_clientObject
;
650 // the tooltip for this window (may be NULL)
652 wxToolTip
*m_tooltip
;
653 #endif // wxUSE_TOOLTIPS
655 // constraints and sizers
656 #if wxUSE_CONSTRAINTS
657 // the constraints for this window or NULL
658 wxLayoutConstraints
*m_constraints
;
660 // constraints this window is involved in
661 wxWindowList
*m_constraintsInvolvedIn
;
663 // top level and the parent sizers
664 // TODO what's this and how does it work?)
665 wxSizer
*m_windowSizer
;
666 wxWindowBase
*m_sizerParent
;
668 // Layout() window automatically when its size changes?
670 #endif // wxUSE_CONSTRAINTS
675 bool m_isBeingDeleted
:1;
679 wxString m_windowName
;
682 // common part of all ctors: it is not virtual because it is called from
686 // get the default size for the new window if no explicit size given
687 // FIXME why 20 and not 30, 10 or ...?
688 static int WidthDefault(int w
) { return w
== -1 ? 20 : w
; }
689 static int HeightDefault(int h
) { return h
== -1 ? 20 : h
; }
691 // more pure virtual functions
692 // ---------------------------
694 // NB: we must have DoSomething() function when Something() is an overloaded
695 // method: indeed, we can't just have "virtual Something()" in case when
696 // the function is overloaded because then we'd have to make virtual all
697 // the variants (otherwise only the virtual function may be called on a
698 // pointer to derived class according to C++ rules) which is, in
699 // general, absolutely not needed. So instead we implement all
700 // overloaded Something()s in terms of DoSomething() which will be the
701 // only one to be virtual.
703 // retrieve the position/size of the window
704 virtual void DoGetPosition( int *x
, int *y
) const = 0;
705 virtual void DoGetSize( int *width
, int *height
) const = 0;
706 virtual void DoGetClientSize( int *width
, int *height
) const = 0;
708 // this is the virtual function to be overriden in any derived class which
709 // wants to change how SetSize() or Move() works - it is called by all
710 // versions of these functions in the base class
711 virtual void DoSetSize(int x
, int y
,
712 int width
, int height
,
713 int sizeFlags
= wxSIZE_AUTO
) = 0;
715 // same as DoSetSize() for the client size
716 virtual void DoSetClientSize(int width
, int height
) = 0;
719 virtual void DoSetToolTip( wxToolTip
*tip
);
720 #endif // wxUSE_TOOLTIPS
723 // contains the last id generated by NewControlId
724 static int ms_lastControlId
;
726 DECLARE_NO_COPY_CLASS(wxWindowBase
);
727 DECLARE_EVENT_TABLE()
730 // ----------------------------------------------------------------------------
731 // now include the declaration of wxWindow class
732 // ----------------------------------------------------------------------------
734 #if defined(__WXMSW__)
735 #include "wx/msw/window.h"
736 #elif defined(__WXMOTIF__)
737 #include "wx/motif/window.h"
738 #elif defined(__WXGTK__)
739 #include "wx/gtk/window.h"
740 #elif defined(__WXQT__)
741 #include "wx/qt/window.h"
742 #elif defined(__WXMAC__)
743 #include "wx/mac/window.h"
746 // ----------------------------------------------------------------------------
747 // inline functions which couldn't be declared in the class body because of
748 // forward dependencies
749 // ----------------------------------------------------------------------------
751 inline wxWindow
*wxWindowBase::GetGrandParent() const
753 return m_parent
? m_parent
->GetParent() : (wxWindow
*)NULL
;
756 // ----------------------------------------------------------------------------
758 // ----------------------------------------------------------------------------
760 extern wxWindow
* WXDLLEXPORT
wxGetActiveWindow();
761 inline int WXDLLEXPORT
NewControlId() { return wxWindowBase::NewControlId(); }
764 // _WX_WINDOW_H_BASE_