#ifdef INTERFACE CLASS(VoretUserbindEditDialog) EXTENDS(VoretDialog) METHOD(VoretUserbindEditDialog, loadUserBind, void(entity, string, string, string)) METHOD(VoretUserbindEditDialog, fill, void(entity)) ATTRIB(VoretUserbindEditDialog, title, string, "User defined key bind") ATTRIB(VoretUserbindEditDialog, color, vector, SKINCOLOR_DIALOG_USERBIND) ATTRIB(VoretUserbindEditDialog, intendedWidth, float, 0.7) ATTRIB(VoretUserbindEditDialog, rows, float, 4) ATTRIB(VoretUserbindEditDialog, columns, float, 3) ATTRIB(VoretUserbindEditDialog, keybindBox, entity, NULL) ATTRIB(VoretUserbindEditDialog, nameBox, entity, NULL) ATTRIB(VoretUserbindEditDialog, commandPressBox, entity, NULL) ATTRIB(VoretUserbindEditDialog, commandReleaseBox, entity, NULL) ENDCLASS(VoretUserbindEditDialog) #endif #ifdef IMPLEMENTATION void VoretUserbindEditDialog_Save(entity btn, entity me) { me.keybindBox.editUserbind(me.keybindBox, me.nameBox.text, me.commandPressBox.text, me.commandReleaseBox.text); Dialog_Close(btn, me); } void loadUserBindVoretUserbindEditDialog(entity me, string theName, string theCommandPress, string theCommandRelease) { me.nameBox.setText(me.nameBox, theName); me.nameBox.keyDown(me.nameBox, K_END, 0, 0); me.commandPressBox.setText(me.commandPressBox, theCommandPress); me.nameBox.keyDown(me.commandPressBox, K_END, 0, 0); me.commandReleaseBox.setText(me.commandReleaseBox, theCommandRelease); me.nameBox.keyDown(me.commandReleaseBox, K_END, 0, 0); } void fillVoretUserbindEditDialog(entity me) { entity e; me.TR(me); me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Name:")); me.TD(me, 1, me.columns - 1, me.nameBox = makeVoretInputBox(0, string_null)); me.TR(me); me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Command when pressed:")); me.TD(me, 1, me.columns - 1, me.commandPressBox = makeVoretInputBox(0, string_null)); me.TR(me); me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Command when released:")); me.TD(me, 1, me.columns - 1, me.commandReleaseBox = makeVoretInputBox(0, string_null)); me.TR(me); me.TD(me, 1, me.columns / 2, e = makeVoretButton("Save", '0 0 0')); e.onClick = VoretUserbindEditDialog_Save; e.onClickEntity = me; me.TD(me, 1, me.columns / 2, e = makeVoretButton("Cancel", '0 0 0')); e.onClick = Dialog_Close; e.onClickEntity = me; } #endif