X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd71308fc89eac2dd212b715eba68a993fa78f53..b068c4e8a1f4919360329c345eae36ff95ab5a10:/include/wx/stubs/window.h diff --git a/include/wx/stubs/window.h b/include/wx/stubs/window.h index 5f75da3346..b94c1afe41 100644 --- a/include/wx/stubs/window.h +++ b/include/wx/stubs/window.h @@ -27,6 +27,7 @@ #include "wx/list.h" #include "wx/region.h" #include "wx/accel.h" +#include "wx/intl.h" #define wxKEY_SHIFT 1 #define wxKEY_CTRL 2 @@ -53,7 +54,7 @@ class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxColourMap; class WXDLLEXPORT wxFont; class WXDLLEXPORT wxMenu; -class WXDLLEXPORT wxRectangle; +class WXDLLEXPORT wxRect; class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxSizer; class WXDLLEXPORT wxList; @@ -81,6 +82,33 @@ WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr; WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; +//----------------------------------------------------------------------------- +// wxClientData +//----------------------------------------------------------------------------- + +class wxClientData +{ +public: + wxClientData() { } + virtual ~wxClientData() { } +}; + +//----------------------------------------------------------------------------- +// wxStringClientData +//----------------------------------------------------------------------------- + +class wxStringClientData: public wxClientData +{ +public: + wxStringClientData() { } + wxStringClientData( wxString &data ) { m_data = data; } + void SetData( wxString &data ) { m_data = data; } + wxString GetData() const { return m_data; } + +private: + wxString m_data; +}; + class WXDLLEXPORT wxWindow: public wxEvtHandler { DECLARE_ABSTRACT_CLASS(wxWindow) @@ -203,6 +231,18 @@ public: // Accept files for dragging virtual void DragAcceptFiles(bool accept); + // tooltips + // create a tooltip with this text + void SetToolTip(const wxString& tip); + + // TODO +#if 0 + // pointer may be NULL to remove the tooltip + void SetToolTip(wxToolTip *tooltip); + // get the current tooltip (may return NULL if none) + wxToolTip* GetToolTip() const { return m_tooltip; } +#endif + // Update region access virtual wxRegion GetUpdateRegion() const; virtual bool IsExposed(int x, int y, int w, int h) const; @@ -228,7 +268,7 @@ public: virtual bool PopupMenu(wxMenu *menu, int x, int y); // Send the window a refresh event - virtual void Refresh(bool eraseBack = TRUE, const wxRectangle *rect = NULL); + virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); // New functions that will replace the above. virtual void SetScrollbar(int orient, int pos, int thumbVisible, @@ -239,7 +279,7 @@ public: virtual int GetScrollRange(int orient) const; virtual int GetScrollThumb(int orient) const; - virtual void ScrollWindow(int dx, int dy, const wxRectangle *rect = NULL); + virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL); // Caret manipulation virtual void CreateCaret(int w, int h); @@ -269,11 +309,11 @@ public: inline wxWindow *GetParent() const; inline void SetParent(wxWindow *p) ; inline wxWindow *GetGrandParent() const; - inline wxList *GetChildren() const; + inline wxList& GetChildren() const; // Set/get the window's font virtual void SetFont(const wxFont& f); - inline virtual wxFont *GetFont() const; + inline virtual wxFont& GetFont() const; // Set/get the window's validator void SetValidator(const wxValidator& validator); @@ -363,6 +403,8 @@ public: void OnEraseBackground(wxEraseEvent& event); void OnChar(wxKeyEvent& event); + void OnKeyDown(wxKeyEvent& event); + void OnKeyUp(wxKeyEvent& event); void OnPaint(wxPaintEvent& event); void OnIdle(wxIdleEvent& event); @@ -505,8 +547,8 @@ inline void wxWindow::SetId(int id) { m_windowId = id; } inline wxWindow *wxWindow::GetParent() const { return m_windowParent; } inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; } inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); } -inline wxList *wxWindow::GetChildren() const { return m_children; } -inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; } +inline wxList& wxWindow::GetChildren() const { return (wxList&) * m_children; } +inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; } inline wxString wxWindow::GetName() const { return m_windowName; } inline void wxWindow::SetName(const wxString& name) { m_windowName = name; } inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }