X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9b3393e48488d37af26cd833ca435b87bc24d73..abb69c6c82d61cf18f14270650a68896a3d8ed47:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index f1534578e3..6e3e82e943 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -170,10 +170,14 @@ public: // 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) @@ -361,8 +365,8 @@ public: 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; @@ -378,6 +382,17 @@ public: // 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 + 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 // ------------------------- @@ -664,13 +679,16 @@ public: const wxRect* rect = (wxRect *) NULL ) = 0; // scrolls window by line/page: note that not all controls support this - virtual void ScrollLines(int WXUNUSED(lines)) { } - virtual void ScrollPages(int WXUNUSED(pages)) { } + // + // return TRUE if the position changed, FALSE otherwise + virtual bool ScrollLines(int WXUNUSED(lines)) { return FALSE; } + virtual bool ScrollPages(int WXUNUSED(pages)) { return FALSE; } - void LineUp() { ScrollLines(-1); } - void LineDown() { ScrollLines(1); } - void PageUp() { ScrollPages(-1); } - void PageDown() { ScrollPages(1); } + // 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 // ---------------------- @@ -993,7 +1011,7 @@ private: #define sm_classwxWindowGTK sm_classwxWindow #endif // wxUniv #include "wx/gtk/window.h" -#elif defined(__WXGL__) +#elif defined(__WXMGL__) #ifdef __WXUNIVERSAL__ #define wxWindowNative wxWindowMGL #else // !wxUniv