X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9b3393e48488d37af26cd833ca435b87bc24d73..ff1865910312d960737474a75a77737d5ce94864:/include/wx/window.h?ds=inline diff --git a/include/wx/window.h b/include/wx/window.h index f1534578e3..734e518ca7 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 // ---------------------- @@ -957,6 +975,10 @@ protected: 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; @@ -993,7 +1015,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 @@ -1001,8 +1023,6 @@ private: #define sm_classwxWindowMGL sm_classwxWindow #endif // wxUniv #include "wx/mgl/window.h" -#elif defined(__WXQT__) - #include "wx/qt/window.h" #elif defined(__WXMAC__) #ifdef __WXUNIVERSAL__ #define wxWindowNative wxWindowMac