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
; }
174 // get the id of the control following the one with the given
175 // (autogenerated) id
176 static int NextControlId(int id
) { return id
- 1; }
177 // get the id of the control preceding the one with the given
178 // (autogenerated) id
179 static int PrevControlId(int id
) { return id
+ 1; }
184 // set the window size and/or position
185 void SetSize( int x
, int y
, int width
, int height
,
186 int sizeFlags
= wxSIZE_AUTO
)
187 { DoSetSize(x
, y
, width
, height
, sizeFlags
); }
189 void SetSize( int width
, int height
)
190 { DoSetSize( -1, -1, width
, height
, wxSIZE_USE_EXISTING
); }
192 void SetSize( const wxSize
& size
)
193 { SetSize( size
.x
, size
.y
); }
195 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
196 { DoSetSize(rect
.x
, rect
.y
, rect
.width
, rect
.height
, sizeFlags
); }
198 void Move( int x
, int y
)
199 { DoSetSize( x
, y
, -1, -1, wxSIZE_USE_EXISTING
); }
201 void Move(const wxPoint
& pt
)
202 { Move(pt
.x
, pt
.y
); }
205 virtual void Raise() = 0;
206 virtual void Lower() = 0;
208 // client size is the size of area available for subwindows
209 void SetClientSize( int width
, int height
)
210 { DoSetClientSize(width
, height
); }
212 void SetClientSize( const wxSize
& size
)
213 { DoSetClientSize(size
.x
, size
.y
); }
215 void SetClientSize(const wxRect
& rect
)
216 { SetClientSize( rect
.width
, rect
.height
); }
218 // get the window position and/or size (pointers may be NULL)
219 void GetPosition( int *x
, int *y
) const { DoGetPosition(x
, y
); }
220 wxPoint
GetPosition() const
223 DoGetPosition(&w
, &h
);
225 return wxPoint(w
, h
);
228 void GetSize( int *w
, int *h
) const { DoGetSize(w
, h
); }
229 wxSize
GetSize() const
236 wxRect
GetRect() const
239 GetPosition(& x
, & y
);
242 return wxRect(x
, y
, w
, h
);
245 void GetClientSize( int *w
, int *h
) const { DoGetClientSize(w
, h
); }
246 wxSize
GetClientSize() const
249 DoGetClientSize(& w
, & h
);
254 // centre with respect to the the parent window
255 void Centre( int direction
= wxHORIZONTAL
);
256 void Center( int direction
= wxHORIZONTAL
) { Centre(direction
); }
258 // set window size to wrap around its children
261 // set min/max size of the window
262 virtual void SetSizeHints( int minW
, int minH
,
263 int maxW
= -1, int maxH
= -1,
264 int incW
= -1, int incH
= -1 );
269 // returns TRUE if window was shown/hidden, FALSE if the nothing was
270 // done (window was already shown/hidden)
271 virtual bool Show( bool show
= TRUE
);
272 bool Hide() { return Show(FALSE
); }
274 // returns TRUE if window was enabled/disabled, FALSE if nothing done
275 virtual bool Enable( bool enable
= TRUE
);
276 bool Disable() { return Enable(FALSE
); }
278 bool IsShown() const { return m_isShown
; }
279 bool IsEnabled() const { return m_isEnabled
; }
281 // get/set window style (setting style won't update the window and so
282 // is only useful for internal usage)
283 virtual void SetWindowStyleFlag( long style
) { m_windowStyle
= style
; }
284 virtual long GetWindowStyleFlag() const { return m_windowStyle
; }
286 // just some (somewhat shorter) synonims
287 void SetWindowStyle( long style
) { SetWindowStyleFlag(style
); }
288 long GetWindowStyle() const { return GetWindowStyleFlag(); }
290 bool HasFlag(int flag
) const { return (m_windowStyle
& flag
) != 0; }
292 virtual bool IsRetained() const
293 { return (m_windowStyle
& wxRETAINED
) != 0; }
295 // make the window modal (all other windows unresponsive)
296 virtual void MakeModal(bool modal
= TRUE
);
301 // set focus to this window
302 virtual void SetFocus() = 0;
304 // return the window which currently has the focus or NULL
305 static wxWindow
*FindFocus() /* = 0: implement in derived classes */;
307 // can this window have focus?
308 virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); }
310 // parent/children relations
311 // -------------------------
313 // get the list of children
314 const wxWindowList
& GetChildren() const { return m_children
; }
315 wxWindowList
& GetChildren() { return m_children
; }
317 // get the parent or the parent of the parent
318 wxWindow
*GetParent() const { return m_parent
; }
319 inline wxWindow
*GetGrandParent() const;
321 // is this window a top level one?
322 bool IsTopLevel() const { return m_parent
!= 0; }
324 // it doesn't really change parent, use ReParent() instead
325 void SetParent( wxWindowBase
*parent
) { m_parent
= (wxWindow
*)parent
; }
326 // change the real parent of this window, return TRUE if the parent
327 // was changed, FALSE otherwise (error or newParent == oldParent)
328 virtual bool Reparent( wxWindowBase
*newParent
);
330 // find window among the descendants of this one either by id or by
331 // name (return NULL if not found)
332 wxWindow
*FindWindow( long id
);
333 wxWindow
*FindWindow( const wxString
& name
);
335 // implementation mostly
336 virtual void AddChild( wxWindowBase
*child
);
337 virtual void RemoveChild( wxWindowBase
*child
);
339 // event handler stuff
340 // -------------------
342 // get the current event handler
343 wxEvtHandler
*GetEventHandler() const { return m_eventHandler
; }
345 // replace the event handler (allows to completely subclass the
347 void SetEventHandler( wxEvtHandler
*handler
) { m_eventHandler
= handler
; }
349 // push/pop event handler: allows to chain a custom event handler to
350 // alreasy existing ones
351 void PushEventHandler( wxEvtHandler
*handler
);
352 wxEvtHandler
*PopEventHandler( bool deleteHandler
= FALSE
);
354 // validators and client data
355 // --------------------------
357 // a window may have an associated validator which is used to control
359 virtual void SetValidator( const wxValidator
&validator
);
360 virtual wxValidator
*GetValidator() { return m_windowValidator
; }
362 // each window may have associated client data: either a pointer to
363 // wxClientData object in which case it is managed by the window (i.e.
364 // it will delete the data when it's destroyed) or an untyped pointer
365 // which won't be deleted by the window
366 virtual void SetClientObject( wxClientData
*data
)
368 if ( m_clientObject
)
369 delete m_clientObject
;
371 m_clientObject
= data
;
373 virtual wxClientData
*GetClientObject() const { return m_clientObject
; }
375 virtual void SetClientData( void *data
) { m_clientData
= data
; }
376 virtual void *GetClientData() const { return m_clientData
; }
378 // dialog oriented functions
379 // -------------------------
381 // validate the correctness of input, return TRUE if ok
382 virtual bool Validate();
384 // transfer data between internal and GUI representations
385 virtual bool TransferDataToWindow();
386 virtual bool TransferDataFromWindow();
388 virtual void InitDialog();
392 virtual void SetAcceleratorTable( const wxAcceleratorTable
& accel
)
393 { m_acceleratorTable
= accel
; }
394 wxAcceleratorTable
*GetAcceleratorTable()
395 { return &m_acceleratorTable
; }
397 // dialog units translations
398 // -------------------------
400 wxPoint
ConvertPixelsToDialog( const wxPoint
& pt
);
401 wxPoint
ConvertDialogToPixels( const wxPoint
& pt
);
402 wxSize
ConvertPixelsToDialog( const wxSize
& sz
)
404 wxPoint
pt(ConvertPixelsToDialog(wxPoint(sz
.x
, sz
.y
)));
406 return wxSize(pt
.x
, pt
.y
);
409 wxSize
ConvertDialogToPixels( const wxSize
& sz
)
411 wxPoint
pt(ConvertDialogToPixels(wxPoint(sz
.x
, sz
.y
)));
413 return wxSize(pt
.x
, pt
.y
);
419 // move the mouse to the specified position
420 virtual void WarpPointer(int x
, int y
) = 0;
422 // start or end mouse capture
423 virtual void CaptureMouse() = 0;
424 virtual void ReleaseMouse() = 0;
426 // painting the window
427 // -------------------
429 // mark the specified rectangle (or the whole window) as "dirty" so it
431 virtual void Refresh( bool eraseBackground
= TRUE
,
432 const wxRect
*rect
= (const wxRect
*) NULL
) = 0;
433 // clear the window entirely
434 virtual void Clear() = 0;
436 // adjust DC for drawing on this window
437 virtual void PrepareDC( wxDC
& WXUNUSED(dc
) ) { }
439 // the update region of the window contains the areas which must be
440 // repainted by the program
441 const wxRegion
& GetUpdateRegion() const { return m_updateRegion
; }
442 wxRegion
& GetUpdateRegion() { return m_updateRegion
; }
444 // these functions verify whether the given point/rectangle belongs to
445 // (or at least intersects with) the update region
446 bool IsExposed( int x
, int y
) const;
447 bool IsExposed( int x
, int y
, int w
, int h
) const;
449 bool IsExposed( const wxPoint
& pt
) const
450 { return IsExposed(pt
.x
, pt
.y
); }
451 bool IsExposed( const wxRect
& rect
) const
452 { return IsExposed(rect
.x
, rect
.y
, rect
.width
, rect
.height
); }
454 // colours, fonts and cursors
455 // --------------------------
457 // set/retrieve the window colours (system defaults are used by
458 // default): Set functions return TRUE if colour was changed
459 virtual bool SetBackgroundColour( const wxColour
&colour
);
460 virtual bool SetForegroundColour( const wxColour
&colour
);
462 wxColour
GetBackgroundColour() const { return m_backgroundColour
; }
463 wxColour
GetForegroundColour() const { return m_foregroundColour
; }
465 // set/retrieve the cursor for this window (SetCursor() returns TRUE
466 // if the cursor was really changed)
467 virtual bool SetCursor( const wxCursor
&cursor
);
468 const wxCursor
& GetCursor() const { return m_cursor
; }
469 wxCursor
& GetCursor() { return m_cursor
; }
471 // set/retrieve the font for the window (SetFont() returns TRUE if the
472 // font really changed)
473 virtual bool SetFont( const wxFont
&font
) = 0;
474 const wxFont
& GetFont() const { return m_font
; }
475 wxFont
& GetFont() { return m_font
; }
477 // get the (average) character size for the current font
478 virtual int GetCharHeight() const = 0;
479 virtual int GetCharWidth() const = 0;
481 // get the width/height/... of the text using current or specified
483 virtual void GetTextExtent(const wxString
& string
,
485 int *descent
= (int *) NULL
,
486 int *externalLeading
= (int *) NULL
,
487 const wxFont
*theFont
= (const wxFont
*) NULL
)
490 // translate to/from screen/client coordinates (pointers may be NULL)
491 virtual void ClientToScreen( int *x
, int *y
) const = 0;
492 virtual void ScreenToClient( int *x
, int *y
) const = 0;
497 void UpdateWindowUI();
499 virtual bool PopupMenu( wxMenu
*menu
, int x
, int y
) = 0;
504 // configure the window scrollbars
505 virtual void SetScrollbar( int orient
,
509 bool refresh
= TRUE
) = 0;
510 virtual void SetScrollPos( int orient
, int pos
, bool refresh
= TRUE
) = 0;
511 virtual int GetScrollPos( int orient
) const = 0;
512 virtual int GetScrollThumb( int orient
) const = 0;
513 virtual int GetScrollRange( int orient
) const = 0;
515 // scroll window to the specified position
516 virtual void ScrollWindow( int dx
, int dy
,
517 const wxRect
* rect
= (wxRect
*) NULL
) = 0;
522 // the easiest way to set a tooltip for a window is to use this method
523 void SetToolTip( const wxString
&tip
);
524 // attach a tooltip to the window
525 void SetToolTip( wxToolTip
*tip
) { DoSetToolTip(tip
); }
526 // get the associated tooltip or NULL if none
527 wxToolTip
* GetToolTip() const { return m_tooltip
; }
528 #endif // wxUSE_TOOLTIPS
532 #if wxUSE_DRAG_AND_DROP
533 // set/retrieve the drop target associated with this window (may be
534 // NULL; it's owned by the window and will be deleted by it)
535 virtual void SetDropTarget( wxDropTarget
*dropTarget
) = 0;
536 virtual wxDropTarget
*GetDropTarget() const { return m_dropTarget
; }
537 #endif // wxUSE_DRAG_AND_DROP
539 // constraints and sizers
540 // ----------------------
541 #if wxUSE_CONSTRAINTS
542 // set the constraints for this window or retrieve them (may be NULL)
543 void SetConstraints( wxLayoutConstraints
*constraints
);
544 wxLayoutConstraints
*GetConstraints() const { return m_constraints
; }
546 // when using constraints, it makes sense to update children positions
547 // automatically whenever the window is resized - this is done if
549 void SetAutoLayout( bool autoLayout
) { m_autoLayout
= autoLayout
; }
550 bool GetAutoLayout() const { return m_autoLayout
; }
552 // do layout the window and its children
553 virtual bool Layout();
555 // implementation only
556 void UnsetConstraints(wxLayoutConstraints
*c
);
557 wxWindowList
*GetConstraintsInvolvedIn() const
558 { return m_constraintsInvolvedIn
; }
559 void AddConstraintReference(wxWindowBase
*otherWin
);
560 void RemoveConstraintReference(wxWindowBase
*otherWin
);
561 void DeleteRelatedConstraints();
562 void ResetConstraints();
564 // these methods may be overriden for special layout algorithms
565 virtual void SetConstraintSizes(bool recurse
= TRUE
);
566 virtual bool LayoutPhase1(int *noChanges
);
567 virtual bool LayoutPhase2(int *noChanges
);
568 virtual bool DoPhase(int);
570 // these methods are virtual but normally won't be overridden
571 virtual void TransformSizerToActual(int *x
, int *y
) const ;
572 virtual void SetSizeConstraint(int x
, int y
, int w
, int h
);
573 virtual void MoveConstraint(int x
, int y
);
574 virtual void GetSizeConstraint(int *w
, int *h
) const ;
575 virtual void GetClientSizeConstraint(int *w
, int *h
) const ;
576 virtual void GetPositionConstraint(int *x
, int *y
) const ;
579 // TODO: what are they and how do they work??
580 void SetSizer( wxSizer
*sizer
);
581 wxSizer
*GetSizer() const { return m_windowSizer
; }
583 void SetSizerParent( wxWindowBase
*win
) { m_sizerParent
= win
; }
584 wxWindowBase
*GetSizerParent() const { return m_sizerParent
; }
586 virtual void SizerSetSize(int x
, int y
, int w
, int h
);
587 virtual void SizerMove(int x
, int y
);
588 #endif // wxUSE_CONSTRAINTS
590 // backward compatibility
591 // ----------------------
592 #if WXWIN_COMPATIBILITY
593 bool Enabled() const { return IsEnabled(); }
595 void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
596 void SetLabelFont(const wxFont
& font
) { SetFont(font
); }
597 wxFont
& GetLabelFont() { return GetFont(); };
598 wxFont
& GetButtonFont() { return GetFont(); };
599 #endif // WXWIN_COMPATIBILITY
605 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
606 void OnInitDialog( wxInitDialogEvent
&event
);
608 // get the haqndle of the window for the underlying window system: this
609 // is only used for wxWin itself or for user code which wants to call
610 // platform-specific APIs
611 virtual WXWidget
GetHandle() const = 0;
614 // the window id - a number which uniquely identifies a window among
615 // its siblings unless it is -1
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_NO_COPY_CLASS(wxWindowBase
);
733 DECLARE_EVENT_TABLE()
736 // ----------------------------------------------------------------------------
737 // now include the declaration of wxWindow class
738 // ----------------------------------------------------------------------------
740 #if defined(__WXMSW__)
741 #include "wx/msw/window.h"
742 #elif defined(__WXMOTIF__)
743 #include "wx/motif/window.h"
744 #elif defined(__WXGTK__)
745 #include "wx/gtk/window.h"
746 #elif defined(__WXQT__)
747 #include "wx/qt/window.h"
748 #elif defined(__WXMAC__)
749 #include "wx/mac/window.h"
752 // ----------------------------------------------------------------------------
753 // inline functions which couldn't be declared in the class body because of
754 // forward dependencies
755 // ----------------------------------------------------------------------------
757 inline wxWindow
*wxWindowBase::GetGrandParent() const
759 return m_parent
? m_parent
->GetParent() : (wxWindow
*)NULL
;
762 // ----------------------------------------------------------------------------
764 // ----------------------------------------------------------------------------
766 WXDLLEXPORT
extern wxWindow
* wxGetActiveWindow();
767 inline WXDLLEXPORT
int NewControlId() { return wxWindowBase::NewControlId(); }
770 // _WX_WINDOW_H_BASE_