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 WXWidget
GetHandle() const { return m_widget
; }
602 // the window handle (for the underlying windowing system) and the window
603 // id - a number which uniquely identifies a window among its siblings
607 // we have 2 common names for this member, one for MSW and the other
608 // for the rest of the world
613 wxWindowID m_windowId
;
615 // the parent window of this window (or NULL) and the list of the children
618 wxWindowList m_children
;
620 // the minimal allowed size for the window (no minimal size if variable(s)
622 int m_minWidth
, m_minHeight
, m_maxWidth
, m_maxHeight
;
624 // event handler for this window: usually is just 'this' but may be
625 // changed with SetEventHandler()
626 wxEvtHandler
*m_eventHandler
;
628 // associated validator or NULL if none
629 wxValidator
*m_windowValidator
;
631 #if wxUSE_DRAG_AND_DROP
632 wxDropTarget
*m_dropTarget
;
633 #endif // wxUSE_DRAG_AND_DROP
635 // visual window attributes
638 wxColour m_backgroundColour
, m_foregroundColour
;
640 // the region which should be repainted in response to paint event
641 wxRegion m_updateRegion
;
643 // the accelerator table for the window which translates key strokes into
645 wxAcceleratorTable m_acceleratorTable
;
647 // user data associated with the window: either an object which will be
648 // deleted by the window when it's deleted or some raw pointer which we do
650 wxClientData
*m_clientObject
;
653 // the tooltip for this window (may be NULL)
655 wxToolTip
*m_tooltip
;
656 #endif // wxUSE_TOOLTIPS
658 // constraints and sizers
659 #if wxUSE_CONSTRAINTS
660 // the constraints for this window or NULL
661 wxLayoutConstraints
*m_constraints
;
663 // constraints this window is involved in
664 wxWindowList
*m_constraintsInvolvedIn
;
666 // top level and the parent sizers
667 // TODO what's this and how does it work?)
668 wxSizer
*m_windowSizer
;
669 wxWindowBase
*m_sizerParent
;
671 // Layout() window automatically when its size changes?
673 #endif // wxUSE_CONSTRAINTS
678 bool m_isBeingDeleted
:1;
682 wxString m_windowName
;
685 // common part of all ctors: it is not virtual because it is called from
689 // get the default size for the new window if no explicit size given
690 // FIXME why 20 and not 30, 10 or ...?
691 static int WidthDefault(int w
) { return w
== -1 ? 20 : w
; }
692 static int HeightDefault(int h
) { return h
== -1 ? 20 : h
; }
694 // more pure virtual functions
695 // ---------------------------
697 // NB: we must have DoSomething() function when Something() is an overloaded
698 // method: indeed, we can't just have "virtual Something()" in case when
699 // the function is overloaded because then we'd have to make virtual all
700 // the variants (otherwise only the virtual function may be called on a
701 // pointer to derived class according to C++ rules) which is, in
702 // general, absolutely not needed. So instead we implement all
703 // overloaded Something()s in terms of DoSomething() which will be the
704 // only one to be virtual.
706 // retrieve the position/size of the window
707 virtual void DoGetPosition( int *x
, int *y
) const = 0;
708 virtual void DoGetSize( int *width
, int *height
) const = 0;
709 virtual void DoGetClientSize( int *width
, int *height
) const = 0;
711 // this is the virtual function to be overriden in any derived class which
712 // wants to change how SetSize() or Move() works - it is called by all
713 // versions of these functions in the base class
714 virtual void DoSetSize(int x
, int y
,
715 int width
, int height
,
716 int sizeFlags
= wxSIZE_AUTO
) = 0;
718 // same as DoSetSize() for the client size
719 virtual void DoSetClientSize(int width
, int height
) = 0;
722 virtual void DoSetToolTip( wxToolTip
*tip
);
723 #endif // wxUSE_TOOLTIPS
726 // contains the last id generated by NewControlId
727 static int ms_lastControlId
;
729 DECLARE_EVENT_TABLE()
732 // ----------------------------------------------------------------------------
733 // now include the declaration of wxWindow class
734 // ----------------------------------------------------------------------------
736 #if defined(__WXMSW__)
737 #include "wx/msw/window.h"
738 #elif defined(__WXMOTIF__)
739 #include "wx/motif/window.h"
740 #elif defined(__WXGTK__)
741 #include "wx/gtk/window.h"
742 #elif defined(__WXQT__)
743 #include "wx/qt/window.h"
744 #elif defined(__WXMAC__)
745 #include "wx/mac/window.h"
748 // ----------------------------------------------------------------------------
749 // inline functions which couldn't be declared in the class body because of
750 // forward dependencies
751 // ----------------------------------------------------------------------------
753 wxWindow
*wxWindowBase::GetGrandParent() const
755 return m_parent
? m_parent
->GetParent() : (wxWindow
*)NULL
;
758 // ----------------------------------------------------------------------------
760 // ----------------------------------------------------------------------------
762 extern wxWindow
* WXDLLEXPORT
wxGetActiveWindow();
763 inline int WXDLLEXPORT
NewControlId() { return wxWindowBase::NewControlId(); }
766 // _WX_WINDOW_H_BASE_