Exemplo n.º 1
0
        public FmMacroEdit()
        {
            InitializeComponent();
            this.Icon       = MdSessionData.WindowIcon;
            this.Buttons    = new List <UCMacroButton>();
            this.Data       = new MacroData();
            this.SaveOutput = false;
            for (var i = 0; i < 8; i++)
            {
                var btn = new UCMacroButton();
                btn.KeyIndex = i;
                this.Buttons.Add(btn);
                var tc = new TableCell();
                tc.Control  = btn;
                btn.Visible = false;
                this.TRStack.Cells.Add(tc);

                btn.LeftClick     += (sender, e) => KeyLeft(sender);
                btn.RightClick    += (sender, e) => KeyRight(sender);
                btn.DeleteClick   += (sender, e) => KeyDelete(sender);
                btn.ValueChanged  += (sender, e) => KeyUpdate(sender);
                btn.IsDownChanged += (sender, e) => KeyIsDownChanged(sender);
            }
            this.TRStack.Cells.Add(null);
            EventHook();
            RefreshStack();
        }
Exemplo n.º 2
0
        public FmTapDanceEdit()
        {
            InitializeComponent();
            this.Icon       = MdSessionData.WindowIcon;
            this.Buttons    = new List <UCMacroButton>();
            this.Data       = new ClTapDanceData();
            this.SaveOutput = false;



            this.DDDelay.Items.AddRange(new List <ListItem> {
                "5", "10", "20", "25", "30", "40", "50", "60"
            });
            foreach (var item in this.DDDelay.Items)
            {
                if (Data.Delay == Convert.ToInt32(item.ToString()))
                {
                    this.DDDelay.SelectedValue = item;
                }
            }


            for (var i = 0; i < 8; i++)
            {
                var btn = new UCMacroButton();
                btn.KeyIndex   = i;
                btn.ShowIsDown = false;
                this.Buttons.Add(btn);
                var tc = new TableCell();
                tc.Control  = btn;
                btn.Visible = false;
                this.TRStack.Cells.Add(tc);

                btn.LeftClick    += (sender, e) => KeyLeft(sender);
                btn.RightClick   += (sender, e) => KeyRight(sender);
                btn.DeleteClick  += (sender, e) => KeyDelete(sender);
                btn.ValueChanged += (sender, e) => KeyUpdate(sender);
            }
            this.TRStack.Cells.Add(null);


            EventHook();
            RefreshStack();
        }