author | KUDr |
Sun, 04 Mar 2007 12:50:21 +0000 | |
branch | cpp_gui |
changeset 6286 | 6e8eec87fa9d |
parent 6264 | 9fc3b5467396 |
child 6288 | f8e3bd806871 |
permissions | -rw-r--r-- |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
1 |
/* $Id$ */ |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
2 |
|
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
3 |
#include "../stdafx.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
4 |
#include <stdarg.h> |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
5 |
#include "../openttd.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
6 |
#include "../debug.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
7 |
#include "../functions.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
8 |
#include "../map.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
9 |
#include "../player.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
10 |
#include "../window.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
11 |
#include "../gfx.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
12 |
#include "../viewport.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
13 |
#include "../console.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
14 |
#include "../variables.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
15 |
#include "../table/sprites.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
16 |
#include "../genworld.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
17 |
#include "../helpers.hpp" |
6264
9fc3b5467396
(svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
KUDr
parents:
6258
diff
changeset
|
18 |
#include "window_events.hpp" |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
19 |
|
6286 | 20 |
namespace gui { |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
21 |
|
6286 | 22 |
/*virtual*/ void Label::DrawBackground(EvtPaint &ev) |
23 |
{ |
|
24 |
if ((m_feature_flags & FF_TRANSPARENT) == FR_NONE) { |
|
25 |
DrawFrameRect(m_color, FR_BG_ONLY); |
|
26 |
} |
|
27 |
} |
|
28 |
||
29 |
/*virtual*/ void Label::OnPaint(EvtPaint &ev) |
|
30 |
{ |
|
31 |
DrawBackground(ev); |
|
32 |
Point center = CenterPt(); |
|
33 |
DrawStringCentered(center.x, center.y - 5, m_text, 0); |
|
34 |
ev.SetHandled(); |
|
35 |
} |
|
36 |
||
37 |
}; // namespace gui |
|
38 |