]> git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlwindow.h
Setting of background colours is now correct.
[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 #include <wx/wx.h>
16
17 #include "wxllist.h"
18
19 #ifdef BROKEN_COMPILER
20 # define virtual
21 #endif
22
23 class wxLayoutWindow : public wxScrolledWindow
24 {
25 public:
26 wxLayoutWindow(wxWindow *parent);
27
28 wxLayoutList & GetLayoutList(void) { return m_llist; }
29
30 // clears the window and sets default parameters:
31 void Clear(int family = wxROMAN, int size=12, int style=wxNORMAL, int weight=wxNORMAL,
32 int underline=0, char const *fg="black", char const
33 *bg="white")
34 {
35 GetLayoutList().Clear(family,size,style,weight,underline,fg,bg);
36 SetBackgroundColour( *GetLayoutList().GetDefaults()->GetBGColour());
37 }
38
39 //virtual void OnDraw(wxDC &dc);
40 void OnPaint(wxPaintEvent &WXUNUSED(event));
41 virtual void OnMouse(wxMouseEvent& event);
42 virtual void OnChar(wxKeyEvent& event);
43 void UpdateScrollbars(void);
44 void Print(void);
45 void Erase(void)
46 { m_llist.Clear(); Clear(); }
47 void SetEventId(int id) { m_EventId = id; }
48 wxPoint const &GetClickPosition(void) const { return
49 m_ClickPosition; }
50 virtual ~wxLayoutList() {} ;
51 private:
52 /// for sending events
53 wxWindow *m_Parent;
54 int m_EventId;
55 /// the layout list to be displayed
56 wxLayoutList m_llist;
57 /// have we already set the scrollbars?
58 bool m_ScrollbarsSet;
59 /// if we want to find an object:
60 wxPoint m_FindPos;
61 wxLayoutObjectBase *m_FoundObject;
62 wxPoint m_ClickPosition;
63 DECLARE_EVENT_TABLE()
64 };
65
66 #ifdef BROKEN_COMPILER
67 #undef virtual
68 #endif
69
70 #endif