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