public MacroControl(string name) { CanMove = true; _hotkeyBox = new HotkeyBox(); _hotkeyBox.HotkeyChanged += BoxOnHotkeyChanged; _hotkeyBox.HotkeyCancelled += BoxOnHotkeyCancelled; Add(_hotkeyBox); Add(new NiceButton(0, _hotkeyBox.Height + 3, 170, 25, ButtonAction.Activate, "+ Create macro button", 0, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT) { ButtonParameter = 2, IsSelectable = false }); Add(new NiceButton(0, _hotkeyBox.Height + 30, 50, 25, ButtonAction.Activate, "Add") { IsSelectable = false }); Add(new NiceButton(52, _hotkeyBox.Height + 30, 50, 25, ButtonAction.Activate, "Remove") { ButtonParameter = 1, IsSelectable = false }); Add(_collection = new MacroCollectionControl(name, 280, 280) { Y = _hotkeyBox.Height + 50 + 10 }); SetupKeyByDefault(); }
public MacroControl(string name) { CanMove = true; HotkeyBox box = new HotkeyBox(); box.HotkeyChanged += BoxOnHotkeyChanged; box.HotkeyCancelled += BoxOnHotkeyCancelled; Add(box); Add(new NiceButton(0, box.Height + 3, 170, 25, ButtonAction.Activate, "+ Create macro button", 0, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT) { ButtonParameter = 2, IsSelectable = false }); Add(new NiceButton(0, box.Height + 30, 50, 25, ButtonAction.Activate, "Add") { IsSelectable = false }); Add(new NiceButton(52, box.Height + 30, 50, 25, ButtonAction.Activate, "Remove") { ButtonParameter = 1, IsSelectable = false }); Add(_collection = new MacroCollectionControl(name, 280, 280) { Y = box.Height + 50 + 10 }); if (_collection.Macro.Key != SDL.SDL_Keycode.SDLK_UNKNOWN) { SDL.SDL_Keymod mod = SDL.SDL_Keymod.KMOD_NONE; if (_collection.Macro.Alt) { mod |= SDL.SDL_Keymod.KMOD_ALT; } if (_collection.Macro.Shift) { mod |= SDL.SDL_Keymod.KMOD_SHIFT; } if (_collection.Macro.Ctrl) { mod |= SDL.SDL_Keymod.KMOD_CTRL; } box.SetKey(_collection.Macro.Key, mod); } }
public MacroControl(string name) { CanMove = true; HotkeyBox box = new HotkeyBox(); box.HotkeyChanged += BoxOnHotkeyChanged; box.HotkeyCancelled += BoxOnHotkeyCancelled; Add(box); Add(new NiceButton(0, box.Height + 3, 50, 25, ButtonAction.Activate, "Add") { IsSelectable = false }); Add(new NiceButton(52, box.Height + 3, 50, 25, ButtonAction.Activate, "Remove") { ToPage = 1, IsSelectable = false }); Add(_collection = new MacroCollectionControl(name, 280, 280) { Y = box.Height + 25 + 10 }); if (_collection.Macro.Key != SDL.SDL_Keycode.SDLK_UNKNOWN) { SDL.SDL_Keymod mod = SDL.SDL_Keymod.KMOD_NONE; if (_collection.Macro.Alt) { mod |= SDL.SDL_Keymod.KMOD_LALT; } if (_collection.Macro.Shift) { mod |= SDL.SDL_Keymod.KMOD_LSHIFT; } if (_collection.Macro.Ctrl) { mod |= SDL.SDL_Keymod.KMOD_LCTRL; } box.SetKey(_collection.Macro.Key, mod); } }
public MacroControl(string name) { CanMove = true; _hotkeyBox = new HotkeyBox(); _hotkeyBox.HotkeyChanged += BoxOnHotkeyChanged; _hotkeyBox.HotkeyCancelled += BoxOnHotkeyCancelled; Add(_hotkeyBox); Add(new NiceButton(0, _hotkeyBox.Height + 3, 170, 25, ButtonAction.Activate, LanguageManager.Current.UI_AddMacroButton, 0, IO.Resources.TEXT_ALIGN_TYPE.TS_LEFT) { ButtonParameter = 2, IsSelectable = false }); Add(new NiceButton(0, _hotkeyBox.Height + 30, 50, 25, ButtonAction.Activate, LanguageManager.Current.UI_Add) { IsSelectable = false }); Add(new NiceButton(52, _hotkeyBox.Height + 30, 50, 25, ButtonAction.Activate, LanguageManager.Current.UI_Remove) { ButtonParameter = 1, IsSelectable = false }); Add(_collection = new MacroCollectionControl(name, 280, 280) { Y = _hotkeyBox.Height + 50 + 10 }); SetupKeyByDefault(); _checkbox = new Checkbox(0x00D2, 0x00D3, LanguageManager.Current.UI_Macro_Repeat, 0xFF, 999) { IsChecked = _collection.Macro.Repeat }; _checkbox.X = 0; _checkbox.Y = _hotkeyBox.Height + 60; _checkbox.ValueChanged += Ischecked; Add(_checkbox); _delaybar = new HSliderBar(50, _hotkeyBox.Height + 85, 150, 100, 5000, _collection.Macro.Delay, HSliderBarStyle.MetalWidgetRecessedBar, true, 0xff, 999); _delaybar.ValueChanged += Delaychanged; Add(_delaybar); }