]>
git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlwindow.h
1 /*-*- c++ -*-********************************************************
2 * wxLwindow.h : a scrolled Window for displaying/entering rich text*
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
12 # pragma interface "wxlwindow.h"
21 class wxLayoutWindow
: public wxScrolledWindow
25 @param parent parent window to display this panel in
27 wxLayoutWindow(wxWindow
*parent
);
29 /* Returns a reference to the wxLayoutList object.
32 wxLayoutList
& GetLayoutList(void) { return m_llist
; }
34 // clears the window and sets default parameters:
35 void Clear(int family
= wxROMAN
, int size
=12, int style
=wxNORMAL
, int weight
=wxNORMAL
,
36 int underline
=0, char const *fg
="black", char const
39 GetLayoutList().Clear(family
,size
,style
,weight
,underline
,fg
,bg
);
40 SetBackgroundColour( *GetLayoutList().GetDefaults()->GetBGColour());
46 // NB: these functions are used as event handlers and must not be virtual
47 void OnPaint(wxPaintEvent
&event
);
49 void OnLeftMouseClick(wxMouseEvent
& event
)
50 { OnMouse(WXMENU_LAYOUT_LCLICK
, event
); }
51 void OnRightMouseClick(wxMouseEvent
& event
)
52 { OnMouse(WXMENU_LAYOUT_RCLICK
, event
); }
53 void OnMouseDblClick(wxMouseEvent
& event
)
54 { OnMouse(WXMENU_LAYOUT_DBLCLICK
, event
); }
56 void OnChar(wxKeyEvent
& event
);
58 /// gets called by either Update() or OnPaint()
59 void DoPaint(wxDC
&dc
);
62 virtual long MSWGetDlgCode();
65 void UpdateScrollbars(void);
68 /// if the flag is true, we send events when user clicks on embedded objects
69 inline void SetMouseTracking(bool doIt
= true) { m_doSendEvents
= doIt
; }
71 virtual ~wxLayoutWindow() { }
74 bool IsDirty() const { return m_llist
.IsDirty(); }
75 void ResetDirty() { m_llist
.ResetDirty(); }
79 /// generic function for mouse events processing
80 void OnMouse(int eventId
, wxMouseEvent
& event
);
85 /// for sending events
89 /// the layout list to be displayed
92 /// have we already set the scrollbars?
94 /// Where does the current view start?
95 int m_ViewStartX
; int m_ViewStartY
;
97 /// do we have unsaved data?
101 DECLARE_EVENT_TABLE()