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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
#ifndef _TOGGLEBUTTON_H
#define _TOGGLEBUTTON_H
#include <api/script/script.h>
#include <api/script/scriptobj.h>
#include <api/skin/widgets/button.h>
#define TOGGLEBUTTON_PARENT Wasabi::Button
class TgButtonScriptController : public ButtonScriptController {
public:
virtual const wchar_t *getClassName();
virtual const wchar_t *getAncestorClassName();
virtual ScriptObjectController *getAncestorController() { return buttonController; }
virtual int getNumFunctions();
virtual const function_descriptor_struct *getExportedFunctions();
virtual GUID getClassGuid();
virtual ScriptObject *instantiate();
virtual void destroy(ScriptObject *o);
virtual void *encapsulate(ScriptObject *o);
virtual void deencapsulate(void *o);
private:
static function_descriptor_struct exportedFunction[];
};
extern TgButtonScriptController *tgbuttonController;
class ToggleButton : public TOGGLEBUTTON_PARENT {
public:
ToggleButton();
virtual ~ToggleButton();
virtual void onLeftPush(int x, int y);
virtual void onToggle(int i);
virtual int setXuiParam(int _xuihandle, int xmlattributeid, const wchar_t *name, const wchar_t *value);
#ifdef WASABI_COMPILE_CONFIG
virtual int onReloadConfig();
#endif
virtual void autoToggle();
virtual const wchar_t *vcpu_getClassName();
virtual ScriptObjectController *vcpu_getController() { return tgbuttonController; }
virtual int getCurCfgVal();
protected:
/*static */void CreateXMLParameters(int master_handle);
enum {
TOGGLEBUTTON_AUTOTOGGLE=0,
#ifdef WASABI_COMPILE_CONFIG
TOGGLEBUTTON_CFGVAL,
#endif
};
private:
static XMLParamPair params[];
wchar_t *param;
int autotoggle;
#ifdef WASABI_COMPILE_CONFIG
int cfgVal;
#endif
int xuihandle;
public:
static scriptVar script_onToggle(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar is);
static scriptVar script_getCurCfgVal(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
};
extern const wchar_t toggleButtonXuiObjectStr[];
extern char toggleButtonXuiSvcName[];
class ToggleButtonXuiSvc : public XuiObjectSvc<ToggleButton, toggleButtonXuiObjectStr, toggleButtonXuiSvcName> {};
// {80F97426-9A10-472c-82E7-8309AA4789E7}
static const GUID NStatesTgButtonGuid =
{ 0x80f97426, 0x9a10, 0x472c, { 0x82, 0xe7, 0x83, 0x9, 0xaa, 0x47, 0x89, 0xe7 } };
#define NSTATESTGBUTTON_PARENT ToggleButton
class NStatesTgButton : public NSTATESTGBUTTON_PARENT {
public:
NStatesTgButton();
virtual ~NStatesTgButton();
virtual int setXuiParam(int _xuihandle, int xmlattributeid, const wchar_t *paramname, const wchar_t *strvalue);
void setNStates(int n) { nstates = n; }
virtual int onInit();
void setState(int n);
virtual int getActivatedButton();
virtual void autoToggle();
int getState() { return state; }
virtual void setActivatedButton(int a);
virtual int getCurCfgVal();
void setOneVisualState(int v);
protected:
/*static */void CreateXMLParameters(int master_handle);
virtual void setupBitmaps();
enum {
NSTATESTGBUTTON_NSTATES=0,
#ifdef WASABI_COMPILE_CONFIG
NSTATESTGBUTTON_CFGVALS,
#endif
NSTATESTGBUTTON_ONEVSTATE,
};
StringW image, hover, down, active;
int nstates;
int state;
int onevstate;
#ifdef WASABI_COMPILE_CONFIG
StringW cfgvals;
#endif
private:
static XMLParamPair params[];
int xuihandle;
};
extern const wchar_t nStatesTgButtonXuiObjectStr[];
extern char nStatesTgButtonXuiSvcName[];
class nStatesTgButtonXuiSvc : public XuiObjectSvc<NStatesTgButton, nStatesTgButtonXuiObjectStr, nStatesTgButtonXuiSvcName> {};
#endif
|