2 CLASS(VoretInputBox) EXTENDS(InputBox)
\r
3 METHOD(VoretInputBox, configureVoretInputBox, void(entity, float, string))
\r
4 METHOD(VoretInputBox, focusLeave, void(entity))
\r
5 METHOD(VoretInputBox, setText, void(entity, string))
\r
6 ATTRIB(VoretInputBox, fontSize, float, SKINFONTSIZE_NORMAL)
\r
7 ATTRIB(VoretInputBox, image, string, SKINGFX_INPUTBOX)
\r
8 ATTRIB(VoretInputBox, onChange, void(entity, entity), SUB_Null)
\r
9 ATTRIB(VoretInputBox, onChangeEntity, entity, NULL)
\r
10 ATTRIB(VoretInputBox, onEnter, void(entity, entity), SUB_Null)
\r
11 ATTRIB(VoretInputBox, onEnterEntity, entity, NULL)
\r
12 ATTRIB(VoretInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS)
\r
13 ATTRIB(VoretInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS)
\r
14 ATTRIB(VoretInputBox, color, vector, SKINCOLOR_INPUTBOX_N)
\r
15 ATTRIB(VoretInputBox, colorF, vector, SKINCOLOR_INPUTBOX_F)
\r
17 ATTRIB(VoretInputBox, alpha, float, SKINALPHA_TEXT)
\r
19 ATTRIB(VoretInputBox, cvarName, string, string_null)
\r
20 METHOD(VoretInputBox, loadCvars, void(entity))
\r
21 METHOD(VoretInputBox, saveCvars, void(entity))
\r
22 METHOD(VoretInputBox, keyDown, float(entity, float, float, float))
\r
23 ENDCLASS(VoretInputBox)
\r
24 entity makeVoretInputBox(float, string);
\r
27 #ifdef IMPLEMENTATION
\r
28 entity makeVoretInputBox(float doEditColorCodes, string theCvar)
\r
31 me = spawnVoretInputBox();
\r
32 me.configureVoretInputBox(me, doEditColorCodes, theCvar);
\r
35 void configureVoretInputBoxVoretInputBox(entity me, float doEditColorCodes, string theCvar)
\r
37 me.configureInputBox(me, "", 0, me.fontSize, me.image);
\r
38 me.editColorCodes = doEditColorCodes;
\r
41 me.cvarName = theCvar;
\r
42 me.tooltip = getZonedTooltipForIdentifier(theCvar);
\r
45 me.cursorPos = strlen(me.text);
\r
47 void focusLeaveVoretInputBox(entity me)
\r
51 void setTextVoretInputBox(entity me, string new)
\r
55 setTextInputBox(me, new);
\r
56 me.onChange(me, me.onChangeEntity);
\r
59 setTextInputBox(me, new);
\r
61 void loadCvarsVoretInputBox(entity me)
\r
65 setTextInputBox(me, cvar_string(me.cvarName));
\r
67 void saveCvarsVoretInputBox(entity me)
\r
71 cvar_set(me.cvarName, me.text);
\r
73 float keyDownVoretInputBox(entity me, float key, float ascii, float shift)
\r
84 me.onEnter(me, me.onEnterEntity);
\r
86 if(keyDownInputBox(me, key, ascii, shift))
\r