MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ConstructEventSupportArray

Function ConstructEventSupportArray

source/script_gui.cpp:89–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89UCHAR **ConstructEventSupportArray()
90{
91 // This is mostly static data, but I haven't figured out how to construct it with just
92 // an array initialiser (other than by using a fixed size for the sub-array, which
93 // wastes space due to ListView and TreeView having many more events than other types).
94 static UCHAR *raises[GUI_CONTROL_TYPE_COUNT];
95 // Not necessary since the array is static and therefore initialised to 0 (NULL):
96 //#define RAISES_NONE(ctrl) \
97 // raises[ctrl] = NULL;
98 #define RAISES(ctrl, ...) { \
99 static UCHAR events[] = { __VA_ARGS__, 0 }; \
100 raises[ctrl] = events; \
101 }
102
103 RAISES(GUI_CONTROL_TEXT, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK)
104 RAISES(GUI_CONTROL_PIC, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK)
105 //RAISES_NONE(GUI_CONTROL_GROUPBOX)
106 RAISES(GUI_CONTROL_BUTTON, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
107 RAISES(GUI_CONTROL_CHECKBOX, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
108 RAISES(GUI_CONTROL_RADIO, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
109 RAISES(GUI_CONTROL_DROPDOWNLIST, GUI_EVENT_CHANGE, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
110 RAISES(GUI_CONTROL_COMBOBOX, GUI_EVENT_CHANGE, GUI_EVENT_DBLCLK, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
111 RAISES(GUI_CONTROL_LISTBOX, GUI_EVENT_CHANGE, GUI_EVENT_DBLCLK, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
112 RAISES(GUI_CONTROL_LISTVIEW, GUI_EVENT_DBLCLK, GUI_EVENT_COLCLK, GUI_EVENT_CLICK, GUI_EVENT_ITEMFOCUS, GUI_EVENT_ITEMSELECT, GUI_EVENT_ITEMCHECK, GUI_EVENT_ITEMEDIT, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
113 RAISES(GUI_CONTROL_TREEVIEW, GUI_EVENT_ITEMSELECT, GUI_EVENT_DBLCLK, GUI_EVENT_CLICK, GUI_EVENT_ITEMEXPAND, GUI_EVENT_ITEMCHECK, GUI_EVENT_ITEMEDIT, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
114 RAISES(GUI_CONTROL_EDIT, GUI_EVENT_CHANGE, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
115 RAISES(GUI_CONTROL_DATETIME, GUI_EVENT_CHANGE, GUI_EVENT_FOCUS, GUI_EVENT_LOSEFOCUS)
116 RAISES(GUI_CONTROL_MONTHCAL, GUI_EVENT_CHANGE)
117 RAISES(GUI_CONTROL_HOTKEY, GUI_EVENT_CHANGE)
118 RAISES(GUI_CONTROL_UPDOWN, GUI_EVENT_CHANGE)
119 RAISES(GUI_CONTROL_SLIDER, GUI_EVENT_CHANGE)
120 //RAISES_NONE(GUI_CONTROL_PROGRESS)
121 RAISES(GUI_CONTROL_TAB, GUI_EVENT_CHANGE)
122 //RAISES(GUI_CONTROL_TAB2, ) // Not used since it is changed to TAB at an early stage.
123 //RAISES(GUI_CONTROL_TAB3, )
124 //RAISES_NONE(GUI_CONTROL_ACTIVEX)
125 RAISES(GUI_CONTROL_LINK, GUI_EVENT_CLICK)
126 //RAISES_NONE(GUI_CONTROL_CUSTOM)
127 RAISES(GUI_CONTROL_STATUSBAR, GUI_EVENT_CLICK, GUI_EVENT_DBLCLK)
128
129 //#undef RAISES_NONE
130 #undef RAISES
131
132 return raises;
133}
134
135UCHAR **GuiControlType::sRaisesEvents = ConstructEventSupportArray();
136

Callers 1

script_gui.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected