]>
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"
23 WXLOWIN_MENU_LARGER
= 12000,
25 WXLOWIN_MENU_UNDERLINE
,
29 WXLOWIN_MENU_TYPEWRITER
,
30 WXLOWIN_MENU_SANSSERIF
,
37 class wxLayoutWindow
: public wxScrolledWindow
41 @param parent parent window to display this panel in
43 wxLayoutWindow(wxWindow
*parent
);
45 /* Returns a reference to the wxLayoutList object.
48 wxLayoutList
& GetLayoutList(void) { return m_llist
; }
50 // clears the window and sets default parameters:
51 void Clear(int family
= wxROMAN
, int size
=12, int style
=wxNORMAL
, int weight
=wxNORMAL
,
52 int underline
=0, char const *fg
="black", char const
55 GetLayoutList().Clear(family
,size
,style
,weight
,underline
,fg
,bg
);
56 SetBackgroundColour( *GetLayoutList().GetDefaults()->GetBGColour());
62 // NB: these functions are used as event handlers and must not be virtual
63 void OnPaint(wxPaintEvent
&event
);
65 void OnLeftMouseClick(wxMouseEvent
& event
)
66 { OnMouse(WXLOWIN_MENU_LCLICK
, event
); }
67 void OnRightMouseClick(wxMouseEvent
& event
)
68 { OnMouse(WXLOWIN_MENU_RCLICK
, event
); }
69 void OnMouseDblClick(wxMouseEvent
& event
)
70 { OnMouse(WXLOWIN_MENU_DBLCLICK
, event
); }
72 void OnChar(wxKeyEvent
& event
);
73 void OnMenu(wxCommandEvent
& event
);
75 void EnablePopup(bool enable
= true) { m_DoPopupMenu
= enable
; }
76 /// gets called by either Update() or OnPaint()
77 void DoPaint(wxDC
&dc
);
80 virtual long MSWGetDlgCode();
83 void UpdateScrollbars(void);
85 wxMenu
* wxLayoutWindow::MakeFormatMenu(void);
87 /// if the flag is true, we send events when user clicks on embedded objects
88 inline void SetMouseTracking(bool doIt
= true) { m_doSendEvents
= doIt
; }
90 virtual ~wxLayoutWindow() { if(m_PopupMenu
) delete m_PopupMenu
; }
93 bool IsDirty() const { return m_llist
.IsDirty(); }
94 void ResetDirty() { m_llist
.ResetDirty(); }
97 /// generic function for mouse events processing
98 void OnMouse(int eventId
, wxMouseEvent
& event
);
100 /// repaint if needed
103 /// for sending events
107 /// the layout list to be displayed
108 wxLayoutList m_llist
;
110 /// have we already set the scrollbars?
111 bool m_ScrollbarsSet
;
112 /// Where does the current view start?
113 int m_ViewStartX
; int m_ViewStartY
;
115 /// do we have unsaved data?
118 /// do we handle clicks of the right mouse button?
121 wxMenu
* m_PopupMenu
;
123 DECLARE_EVENT_TABLE()