author | KUDr |
Sat, 10 Mar 2007 08:53:59 +0000 | |
branch | cpp_gui |
changeset 6295 | a88d8c2cff6e |
parent 6292 | 272c690043e3 |
child 6301 | e0251f797d59 |
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 |
#include "../stdafx.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
3 |
#include <stdarg.h> |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
4 |
#include "../openttd.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
5 |
#include "../debug.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
6 |
#include "../functions.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
7 |
#include "../map.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
8 |
#include "../player.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
9 |
#include "../window.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
10 |
#include "../gfx.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
11 |
#include "../viewport.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
12 |
#include "../console.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
13 |
#include "../variables.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
14 |
#include "../table/sprites.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
15 |
#include "../genworld.h" |
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
16 |
#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
|
17 |
#include "window_events.hpp" |
6289 | 18 |
#include "widget_types.h" |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
19 |
|
6289 | 20 |
namespace gui { |
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
diff
changeset
|
21 |
|
6289 | 22 |
/*virtual*/ void StickyBox::OnCreate(EvtCreate &ev) |
23 |
{ |
|
24 |
// move itself to the right side of the parent |
|
25 |
Rect16 rc = m_container->GetRect(); |
|
26 |
rc.SetLeft(rc.Right() - (DEFAULT_WIDTH - 1)); |
|
27 |
rc.SetBottom(rc.Top() + (DEFAULT_HEIGHT - 1)); |
|
28 |
SetRect(rc); |
|
29 |
||
30 |
SetAnchors(PIN_TOP | PIN_RIGHT); |
|
31 |
super::OnCreate(ev); |
|
32 |
} |
|
33 |
||
34 |
/*virtual*/ void StickyBox::OnLeftClick(EvtLeftClick &ev) |
|
35 |
{ |
|
36 |
BaseWindow *w = GetWindow(); |
|
37 |
assert(w != NULL); |
|
38 |
||
39 |
w->m_feature_flags = (w->m_feature_flags & ~FF_STICKED) | (m_pushed ? FF_STICKED : FF_NONE); |
|
40 |
} |
|
41 |
||
42 |
}; // namespace gui |
|
43 |