X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af0bb3b161bc687d4a53a83c930c807bfa300a2d..af01f1ba0d697c07173f436ab661b4c833258a91:/include/wx/motif/window.h diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index e174a4538e..e23aeda442 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -16,11 +16,7 @@ #pragma interface "window.h" #endif -// ---------------------------------------------------------------------------- -// A list of rectangles type used by wxWindow -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST(wxRect, wxRectList); +#include "wx/region.h" // ---------------------------------------------------------------------------- // wxWindow class for Motif - see also wxWindowBase @@ -28,8 +24,6 @@ WX_DECLARE_LIST(wxRect, wxRectList); class wxWindow : public wxWindowBase { -DECLARE_DYNAMIC_CLASS(wxWindow) - friend class WXDLLEXPORT wxDC; friend class WXDLLEXPORT wxWindowDC; @@ -37,11 +31,11 @@ public: wxWindow() { Init(); } wxWindow(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPanelNameStr) { Init(); Create(parent, id, pos, size, style, name); @@ -91,8 +85,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual bool PopupMenu( wxMenu *menu, int x, int y ); - virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = TRUE ); virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ); @@ -103,8 +95,8 @@ public: const wxRect* rect = (wxRect *) NULL ); virtual void SetSizeHints(int minW, int minH, - int maxW, int maxH, - int incW, int incH); + int maxW = -1, int maxH = -1, + int incW = -1, int incH = -1); #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); #endif // wxUSE_DRAG_AND_DROP @@ -173,14 +165,18 @@ public: void ClearUpdateRegion() { m_updateRegion.Clear(); } void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; } -protected: - // event handlers (not virtual by design) - void OnIdle(wxIdleEvent& event); + // sets the fore/background colour for the given widget + static void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour); + static void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE); // For implementation purposes - sometimes decorations make the client area // smaller virtual wxPoint GetClientAreaOrigin() const; +protected: + // event handlers (not virtual by design) + void OnIdle(wxIdleEvent& event); + // 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); @@ -205,14 +201,16 @@ protected: bool CanAddEventHandler() const { return m_canAddEventHandler; } void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; } +public: WXPixmap GetBackingPixmap() const { return m_backingPixmap; } + void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; } int GetPixmapWidth() const { return m_pixmapWidth; } int GetPixmapHeight() const { return m_pixmapHeight; } + void SetPixmapWidth(int w) { m_pixmapWidth = w; } + void SetPixmapHeight(int h) { m_pixmapHeight = h; } // Change properties virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden) - virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour); - virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE); // Change background and foreground colour using current background colour // setting (Motif generates foreground based on background) @@ -220,6 +218,7 @@ protected: // Change foreground colour using current foreground colour setting virtual void ChangeForegroundColour(); +protected: // Adds the widget to the hash table and adds event handlers. bool AttachWidget(wxWindow* parent, WXWidget mainWidget, WXWidget formWidget, int x, int y, int width, int height); @@ -237,8 +236,10 @@ protected: // accelerator table, and try to find what menu id or window (beneath it) // has this ID. Then construct an appropriate command // event and send it. +public: virtual bool ProcessAccelerator(wxKeyEvent& event); - + +protected: // unmanage and destroy an X widget f it's !NULL (passing NULL is ok) void UnmanageAndDestroy(WXWidget widget); @@ -313,6 +314,8 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); virtual void DoSetClientSize(int width, int height); + virtual void DoMoveWindow(int x, int y, int width, int height); + virtual bool DoPopupMenu(wxMenu *menu, int x, int y); #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); @@ -322,7 +325,8 @@ private: // common part of all ctors void Init(); - DECLARE_NO_COPY_CLASS(wxWindow); + DECLARE_DYNAMIC_CLASS(wxWindow) + DECLARE_NO_COPY_CLASS(wxWindow) DECLARE_EVENT_TABLE() };