Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/vaclgui/multiline.hpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, A System for Syntax Directed Programming | |
3 * Copyright 1997-2002 Parsifal Software. All Rights Reserved. | |
4 * See the file COPYING for license and usage terms. | |
5 * | |
6 * multiline.hpp | |
7 */ | |
8 | |
9 #ifndef MULTILINE_HPP | |
10 #define MULTILINE_HPP | |
11 | |
12 #include <ipainhdr.hpp> | |
13 #include <istattxt.hpp> | |
14 | |
15 #include "agstring.h" | |
16 #include "base.h" | |
17 | |
18 class MultiLineText | |
19 : public IStaticText | |
20 , public IPaintHandler | |
21 { | |
22 private: | |
23 int nLines; | |
24 AgString textString; | |
25 ISize margin; | |
26 int vTab; | |
27 | |
28 public: | |
29 MultiLineText(IWindow *owner, | |
30 IRectangle r = IRectangle(), | |
31 IStaticText::Style s = IStaticText::classDefaultStyle) | |
32 : IStaticText(nextChildId(), owner, owner, r, s) | |
33 , nLines(0) | |
34 , margin(8,8) | |
35 , vTab(0) | |
36 { | |
37 IPaintHandler::handleEventsFor(this); | |
38 } | |
39 ~MultiLineText() { | |
40 IPaintHandler::stopHandlingEventsFor(this); | |
41 } | |
42 MultiLineText &setTextString(AgString s); | |
43 | |
44 // otherwise the compiler complains that this is hidden | |
45 virtual IStaticText &setText(const IResourceId &ir) { | |
46 return IStaticText::setText(ir); | |
47 } | |
48 | |
49 virtual MultiLineText &setText(const char *s); | |
50 Boolean paintWindow(IPaintEvent &event); | |
51 ISize calcMinimumSize() const; | |
52 MultiLineText &setMargin(ISize s) { margin = s; return *this; } | |
53 MultiLineText &setMargin(int w, int h) { margin = ISize(w,h); return *this; } | |
54 MultiLineText &setVTab(int v) { vTab = v; return *this; } | |
55 }; | |
56 | |
57 #endif /* MULTILINE_HPP */ |