#include "wx/accel.h"
#endif // wxUSE_ACCEL
+// when building wxUniv/Foo we don't want the code for native menu use to be
+// compiled in - it should only be used when building real wxFoo
+#ifdef __WXUNIVERSAL__
+ #define wxUSE_MENUS_NATIVE 0
+#else // __WXMSW__
+ #define wxUSE_MENUS_NATIVE wxUSE_MENUS
+#endif // __WXUNIVERSAL__/__WXMSW__
+
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
// window attributes
// -----------------
+ // NB: in future versions of wxWindows Set/GetTitle() will only work
+ // with the top level windows (such as dialogs and frames) and
+ // Set/GetLabel() only with the other ones (i.e. all controls).
+
// the title (or label, see below) of the window: the text which the
// window shows
- virtual void SetTitle( const wxString & WXUNUSED(title) ) { }
- virtual wxString GetTitle() const { return ""; }
+ virtual void SetTitle( const wxString& WXUNUSED(title) ) {}
+ virtual wxString GetTitle() const { return wxEmptyString; }
// label is just the same as the title (but for, e.g., buttons it
// makes more sense to speak about labels)
virtual void SetThemeEnabled(bool enableTheme) { m_themeEnabled = enableTheme; }
virtual bool GetThemeEnabled() const { return m_themeEnabled; }
- // focus handling
- // --------------
+ // focus and keyboard handling
+ // ---------------------------
// set focus to this window
virtual void SetFocus() = 0;
// click it
virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); }
+ // NB: these methods really don't belong here but with the current
+ // class hierarchy there is no other place for them :-(
+
+ // get the default child of this parent, i.e. the one which is
+ // activated by pressing <Enter>
+ virtual wxWindow *GetDefaultItem() const { return NULL; }
+
+ // set this child as default, return the old default
+ virtual wxWindow *SetDefaultItem(wxWindow * WXUNUSED(child))
+ { return NULL; }
+
// parent/children relations
// -------------------------
// clear the window entirely
virtual void Clear() = 0;
+ // freeze the window: don't redraw it until it is thawed
+ virtual void Freeze() { }
+
+ // thaw the window: redraw it after it had been frozen
+ virtual void Thaw() { }
+
// adjust DC for drawing on this window
virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { }
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL ) = 0;
+ // scrolls window by line/page: note that not all controls support this
+ //
+ // return TRUE if the position changed, FALSE otherwise
+ virtual bool ScrollLines(int WXUNUSED(lines)) { return FALSE; }
+ virtual bool ScrollPages(int WXUNUSED(pages)) { return FALSE; }
+
+ // convenient wrappers for ScrollLines/Pages
+ bool LineUp() { return ScrollLines(-1); }
+ bool LineDown() { return ScrollLines(1); }
+ bool PageUp() { return ScrollPages(-1); }
+ bool PageDown() { return ScrollPages(1); }
+
// context-sensitive help
// ----------------------
virtual void DoSetClientData( void *data );
virtual void *DoGetClientData() const;
+ // Makes an adjustment to the window position (for example, a frame that has
+ // a toolbar that it manages itself).
+ virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
+
// what kind of data do we have?
wxClientDataType m_clientDataType;
#define sm_classwxWindowGTK sm_classwxWindow
#endif // wxUniv
#include "wx/gtk/window.h"
-#elif defined(__WXQT__)
- #include "wx/qt/window.h"
+#elif defined(__WXMGL__)
+ #ifdef __WXUNIVERSAL__
+ #define wxWindowNative wxWindowMGL
+ #else // !wxUniv
+ #define wxWindowMGL wxWindow
+ #define sm_classwxWindowMGL sm_classwxWindow
+ #endif // wxUniv
+ #include "wx/mgl/window.h"
#elif defined(__WXMAC__)
+ #ifdef __WXUNIVERSAL__
+ #define wxWindowNative wxWindowMac
+ #else // !wxUniv
+ #define wxWindowMac wxWindow
+ #define sm_classwxWindowMac sm_classwxWindow
+ #endif // wxUniv
#include "wx/mac/window.h"
#elif defined(__WXPM__)
+ #ifdef __WXUNIVERSAL__
+ #define wxWindowNative wxWindowOS2
+ #else // !wxUniv
+ #define wxWindowOS2 wxWindow
+ #define sm_classwxWindowOS2 sm_classwxWindow
+ #endif // wxUniv/!wxUniv
#include "wx/os2/window.h"
#endif
// global functions
// ----------------------------------------------------------------------------
-WXDLLEXPORT extern wxWindow* wxGetActiveWindow();
-
// Find the wxWindow at the current mouse position, also returning the mouse
// position.
WXDLLEXPORT extern wxWindow* wxFindWindowAtPointer(wxPoint& pt);