-
Notifications
You must be signed in to change notification settings - Fork 2
/
GUITriggerList.cpp
57 lines (49 loc) · 943 Bytes
/
GUITriggerList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// wxWindows includes
#include <wx/string.h>
#include <wx/arrstr.h>
#include <wx/dynarray.h>
// Statsgen includes
#include "GUITriggerList.h"
#include "GUITriggerItem.h"
void GUITriggerList::Add(GUITriggerItem &triggerItem)
{
triggerList.Add(triggerItem);
}
bool GUITriggerList::PerformTrigger(wxWindow *window)
{
int itemCount;
int itemIndex;
GUITriggerItem triggerItem;
bool triggered;
bool currentlyShown;
bool currentlyEnabled;
currentlyShown=true;
currentlyEnabled=true;
triggered=false;
itemCount=triggerList.GetCount();
for (itemIndex=0;itemIndex<itemCount;itemIndex++)
{
triggerItem=triggerList.Item(itemIndex);
if (triggerItem.PerformTrigger(window,¤tlyShown,¤tlyEnabled))
{
triggered = true;
}
}
if (currentlyEnabled)
{
window->Enable();
}
else
{
window->Disable();
}
if (currentlyShown)
{
window->Show();
}
else
{
window->Hide();
}
return (triggered);
}