X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6ba4e8acebbb8fd6a255bf78c8833b8378d9dd01..41ca191f4b76957735a885b620d54c5f51524522:/user/wxLayout/wxlwindow.h diff --git a/user/wxLayout/wxlwindow.h b/user/wxLayout/wxlwindow.h index 22df9e617b..0cce930123 100644 --- a/user/wxLayout/wxlwindow.h +++ b/user/wxLayout/wxlwindow.h @@ -38,7 +38,8 @@ enum WXLOWIN_MENU_RCLICK, WXLOWIN_MENU_LCLICK, WXLOWIN_MENU_DBLCLICK, - WXLOWIN_MENU_LAST = WXLOWIN_MENU_DBLCLICK + WXLOWIN_MENU_MOUSEMOVE, + WXLOWIN_MENU_LAST = WXLOWIN_MENU_MOUSEMOVE }; /** @@ -63,15 +64,29 @@ public: int style=wxNORMAL, int weight=wxNORMAL, int underline=0, - char const *fg="black", - char const *bg="white") + wxColour *fg=NULL, + wxColour *bg=NULL) { GetLayoutList()->Clear(family,size,style,weight,underline,fg,bg); - SetBackgroundColour(*GetLayoutList()->GetDefaults()->GetBGColour()); + SetBackgroundColour(GetLayoutList()->GetDefaults()->GetBGColour()); + ResizeScrollbars(true); SetDirty(); - DoPaint(); + SetModified(false); + wxRect r; + int w,h; + r.x = r.y = 0; GetSize(&w,&h); + r.width = w; + r.height = h; + DoPaint(&r); + } + /** Sets a background image, only used on screen, not on printouts. + @param bitmap a pointer to a wxBitmap or NULL to remove it + */ + void SetBackgroundBitmap(wxBitmap *bitmap = NULL) + { + if(m_BGbitmap) delete m_BGbitmap; + m_BGbitmap = bitmap; } - /// Enable or disable editing, i.e. processing of keystrokes. void SetEditable(bool toggle) { m_Editable = toggle; } /// Query whether list can be edited by user. @@ -91,10 +106,8 @@ public: /** Redraws the window. Internally, this stores the parameter and calls a refresh on wxMSW, draws directly on wxGTK. - @param scrollToCursor if true, scroll the window so that the - cursor becomes visible */ - void DoPaint(bool scrollToCursor = false); + void DoPaint(const wxRect *updateRect); #ifdef __WXMSW__ virtual long MSWGetDlgCode(); @@ -119,6 +132,7 @@ public: void OnLeftMouseClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_LCLICK, event); } void OnRightMouseClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_RCLICK, event); } void OnMouseDblClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_DBLCLICK, event); } + void OnMouseMove(wxMouseEvent &event) { OnMouse(WXLOWIN_MENU_MOUSEMOVE, event) ; } void OnSetFocus(wxFocusEvent &ev); void OnKillFocus(wxFocusEvent &ev); //@} @@ -135,7 +149,13 @@ public: void ResetDirty(void) { m_Dirty = false; } //@} /// Redraws the window, used by DoPaint() or OnPaint(). - void InternalPaint(void); + void InternalPaint(const wxRect *updateRect); + + /// Has list been modified/edited? + bool IsModified(void) const { return m_Modified; } + /// Mark list as modified or unchanged. + void SetModified(bool modified = true) { m_Modified = modified; } + protected: /// generic function for mouse events processing void OnMouse(int eventId, wxMouseEvent& event); @@ -152,6 +172,8 @@ protected: bool m_DoPopupMenu; /// Should InternalPaint() scroll to cursor. bool m_ScrollToCursor; + /// Do we currently have a non-standard cursor? + bool m_HandCursor; /// the menu wxMenu * m_PopupMenu; /// for derived classes, set when mouse is clicked @@ -163,17 +185,21 @@ protected: private: /// The layout list to be displayed. wxLayoutList *m_llist; - /// Can user edit the window? bool m_Editable; + /// Are we currently building a selection with the keyboard? + bool m_Selecting; /// wrap margin CoordType m_WrapMargin; - /// Is list dirty? + /// Is list dirty (for redraws, internal use)? bool m_Dirty; + /// Has list been edited? + bool m_Modified; wxMemoryDC *m_memDC; wxBitmap *m_bitmap; wxPoint m_bitmapSize; - + /// a pointer to a bitmap for the background + wxBitmap *m_BGbitmap; DECLARE_EVENT_TABLE() };