]> git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlwindow.h
-somewhat more elegant method, supporting the src subdir (-Markus)
[wxWidgets.git] / user / wxLayout / wxlwindow.h
1 /*-*- c++ -*-********************************************************
2 * wxLwindow.h : a scrolled Window for displaying/entering rich text*
3 * *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
5 * *
6 * $Id$
7 *******************************************************************/
8 #ifndef WXLWINDOW_H
9 #define WXLWINDOW_H
10
11 #ifdef __GNUG__
12 # pragma interface "wxlwindow.h"
13 #endif
14
15 #ifndef USE_PCH
16 # include <wx/wx.h>
17 #endif
18
19 #include "wxllist.h"
20
21 class wxLayoutWindow : public wxScrolledWindow
22 {
23 public:
24 wxLayoutWindow(wxWindow *parent);
25
26 wxLayoutList & GetLayoutList(void) { return m_llist; }
27
28 // clears the window and sets default parameters:
29 void Clear(int family = wxROMAN, int size=12, int style=wxNORMAL, int weight=wxNORMAL,
30 int underline=0, char const *fg="black", char const
31 *bg="white")
32 {
33 GetLayoutList().Clear(family,size,style,weight,underline,fg,bg);
34 SetBackgroundColour( *GetLayoutList().GetDefaults()->GetBGColour());
35 }
36
37 // callbacks
38 // NB: these functions are used as event handlers and must not be virtual
39 //void OnDraw(wxDC &dc);
40 void OnPaint(wxPaintEvent &WXUNUSED(event));
41 void OnMouse(wxMouseEvent& event);
42 void OnChar(wxKeyEvent& event);
43
44 #ifdef __WXMSW__
45 virtual long MSWGetDlgCode();
46 #endif //MSW
47
48 void UpdateScrollbars(void);
49 void Print(void);
50 void SetEventId(int id) { m_EventId = id; }
51 // what for? Caller doesn't even know object's positions in window
52 //wxPoint const &GetClickPosition(void) const { return m_ClickPosition; }
53 virtual ~wxLayoutWindow() {}
54 private:
55 /// for sending events
56 wxWindow *m_Parent;
57 int m_EventId;
58 /// the layout list to be displayed
59 wxLayoutList m_llist;
60 /// have we already set the scrollbars?
61 bool m_ScrollbarsSet;
62 /// if we want to find an object:
63 wxPoint m_FindPos;
64 wxLayoutObjectBase *m_FoundObject;
65 wxPoint m_ClickPosition;
66
67 DECLARE_EVENT_TABLE()
68 };
69
70 #endif