X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fabb57533169f2f75367e0d120c762518548890..0a9f252212bdc4f9eea745a04632748d5544c042:/include/wx/motif/window.h diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index d9010156f4..34e55e106b 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -53,7 +53,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; @@ -244,6 +244,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; @@ -269,18 +281,22 @@ 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, int range, bool refresh = TRUE); + // Helper functions for Motif + void CreateScrollbar(int orientation); + void DestroyScrollbar(int orientation); + virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); virtual int GetScrollPos(int orient) const; 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); @@ -310,13 +326,13 @@ public: inline wxWindow *GetParent() const; inline void SetParent(wxWindow *p) ; inline wxWindow *GetGrandParent() const; - inline wxList *GetChildren() const; + inline wxList& GetChildren() const; // Reparents this window to have the new parent. virtual bool Reparent(wxWindow* parent); // 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); @@ -412,6 +428,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); @@ -622,7 +640,7 @@ public: // For double-click detection long m_lastTS; // last timestamp int m_lastButton; // last pressed button - wxList m_updateRects; // List of wxRectangles representing damaged region + wxList m_updateRects; // List of wxRects representing damaged region bool m_isShown; protected: WXWidget m_mainWidget; @@ -655,8 +673,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; } @@ -686,5 +704,19 @@ wxWindow* WXDLLEXPORT wxGetActiveWindow(); WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; +// A little class to switch off size optimization while an instance of the object +// exists +class WXDLLEXPORT wxNoOptimize: public wxObject +{ +public: + wxNoOptimize(); + ~wxNoOptimize(); + + static bool CanOptimize(); + +protected: + static int m_count; +}; + #endif // _WX_WINDOW_H_