예제 #1
0
        public void SetButtonFromConfig(string buttonName, string buttonValue)
        {
            // lookup from buttonNames to get the right index
            var idx = buttonNames.ToList().IndexOf(buttonName);

            Console.WriteLine("INDEX FOUND: " + idx.ToString());
            if (idx != -1)
            {
                //buttonValues[idx] = buttonValue;
                //currentButtons[idx].NormalCommand = buttonValue;
                selectedButton = currentButtons[idx];
                SetNormCommand(buttonValue);
                SetButtonValue(buttonValue);
                SetButtonText();
            }
        }
예제 #2
0
        public void LoadButtons(Action <object, MouseEventArgs> mouseHandler, TabPage tabPage)
        {
            // remove buttons here
            while (currentButtons.Count > 0)
            {
                BoxButton a = currentButtons[0];
                currentButtons.RemoveAt(0);
                tabPage.Controls.Remove(a);
            }
            for (var i = 0; i < numButtons; i++)
            {
                BoxButton temp = new BoxButton(buttonValues[i], buttonPos[i], i);
                temp.MouseDown += new MouseEventHandler(mouseHandler);

                tabPage.Controls.Add(temp);
                currentButtons.Add(temp);
            }
            mainTab = tabPage;
        }
예제 #3
0
 public void SetSelectedButton(object selected)
 {
     this.selectedButton = selected as BoxButton;
 }