author | KUDr |
Sun, 04 Mar 2007 22:36:22 +0000 | |
branch | cpp_gui |
changeset 6289 | be3d8bd9fb02 |
parent 6288 | f8e3bd806871 |
child 6295 | a88d8c2cff6e |
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" |
6289 | 19 |
#include "widget_types.h" |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
20 |
|
6286 | 21 |
namespace gui { |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
22 |
|
6286 | 23 |
/*virtual*/ void Label::DrawBackground(EvtPaint &ev) |
24 |
{ |
|
6288
f8e3bd806871
(svn r9008) [cpp_gui] -Fix: fixed comparison in Label widget (reported by TrueBrian)
miham
parents:
6286
diff
changeset
|
25 |
if ((m_feature_flags & FF_TRANSPARENT) == FF_NONE) { |
6286 | 26 |
DrawFrameRect(m_color, FR_BG_ONLY); |
27 |
} |
|
28 |
} |
|
29 |
||
30 |
/*virtual*/ void Label::OnPaint(EvtPaint &ev) |
|
31 |
{ |
|
32 |
DrawBackground(ev); |
|
33 |
Point center = CenterPt(); |
|
34 |
DrawStringCentered(center.x, center.y - 5, m_text, 0); |
|
35 |
ev.SetHandled(); |
|
36 |
} |
|
37 |
||
38 |
}; // namespace gui |
|
39 |