Mercurial > LightClone
annotate LightClone/Source/GuiEvent.cpp @ 38:2caa7c7e2cb5
Refactored program; Added dialog
author | koryspansel |
---|---|
date | Wed, 21 Sep 2011 21:40:19 -0700 |
parents | b4dc5d674e22 |
children |
rev | line source |
---|---|
21
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
1 /* |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
2 * GuiEvent |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
3 */ |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
4 |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
5 #include "GuiEvent.h" |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
6 |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
7 /* |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
8 * GuiEvent |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
9 */ |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
10 GuiEvent::GuiEvent(const char* pEventName) : kName(pEventName) |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
11 { |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
12 } |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
13 |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
14 /* |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
15 * ~GuiEvent |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
16 */ |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
17 GuiEvent::~GuiEvent() |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
18 { |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
19 for(uint32 i = 0; i < kSubscriptions.Size(); ++i) |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
20 { |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
21 delete kSubscriptions[i]; |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
22 } |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
23 |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
24 kSubscriptions.Clear(); |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
25 } |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
26 |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
27 /* |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
28 * Fire |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
29 */ |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
30 void GuiEvent::Fire(GuiEventArguments& kArguments) |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
31 { |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
32 for(uint32 i = 0; i < kSubscriptions.Size(); ++i) |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
33 { |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
34 (*kSubscriptions[i])(kArguments); |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
35 } |
b4dc5d674e22
Added GUI event system and some support data structures
koryspansel
parents:
diff
changeset
|
36 } |