public void NameTextBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         UserController activeController = UserControllerManager.GetActive();
         if (activeController is ChooseButton)
         {
             ChooseButton button = (ChooseButton)activeController;
             if (!(button is null))
             {
                 button.Text = this.Text;
             }
             e.Handled = true;
             button.Refresh();   // Refresh print of button
         }
         else if (activeController is ToggleSwitch)
         {
             ToggleSwitch toggleSwitch = (ToggleSwitch)activeController;
             if (!(toggleSwitch is null))
             {
                 toggleSwitch.SwitchText = Text;
             }
             e.Handled = true;
             toggleSwitch.Refresh();   // Refresh print of button
         }
     }
 }
        public void NameTextBox_TextChanged(object sender, EventArgs e)
        {
            UserController activeController = UserControllerManager.GetActive();

            if (!(activeController is null))
            {
                activeController.text = this.Text;
                activeController.Refresh();
            }
        }
Example #3
0
        public override void Deselect()
        {
            // TODO: take it to deactivate: base.BackColor = PassiveColor;
            if (selected)
            {
                base.Deselect();
                UserControllerManager.ResetColorPicker();
                selected = false;
            }

            Refresh();
        }
Example #4
0
        public void colorPick_Click(object sender, EventArgs e)
        {
            // Show the color dialog.
            DialogResult result = colorDialog.ShowDialog();

            // See if user pressed ok.
            if (result == DialogResult.OK)
            {
                // Set form background to the selected color.
                base.ForeColor = colorDialog.Color;
                UserControllerManager.SetUserControllerColor(base.ForeColor);
            }
        }
        protected virtual void dragDrop(object sender, DragEventArgs e)
        {
            TreeNode      node       = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");
            TagProperties properties = (TagProperties)node.Tag;

            property = (ControllerProperty)Activator.CreateInstance(properties.PropertyType);

            property.userController = this;
            property.SetPropertyName(node.FullPath.Replace("\\", " - "));

            PropertyPanelManager.SetPropertyPanel(property);
            UserControllerManager.Select(this);
            PropertyPanelManager.SetPropertyName();
            Refresh();
        }
Example #6
0
 private void LeftClick(object sender, MouseEventArgs e)
 {
     if (e.Button.Equals(MouseButtons.Left))
     {
         if (selected)
         {
             PropertyPanelManager.DeselectPropertyPanel();
             selected = false;
             Refresh();
         }
         else
         {
             PropertyPanelManager.SetPropertyPanel(property);
             UserControllerManager.Select(this);
             PropertyPanelManager.SetPropertyName();
             selected = true;
             Refresh();
         }
     }
 }
Example #7
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);

            if (e.Button.Equals(MouseButtons.Left))
            {
                if (!selected)
                {
                    //base.BackColor = ActiveColor;
                    PropertyPanelManager.SetPropertyPanel(property);
                    UserControllerManager.Select(this);
                    PropertyPanelManager.SetPropertyName();
                }
                else
                {
                    Deselect();
                    PropertyPanelManager.DeselectPropertyPanel();
                }
            }
            else if (e.Button.Equals(MouseButtons.Right))
            {
                Switch();
            }
        }
Example #8
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (e.Button.Equals(MouseButtons.Left))
            {
                if (selected)
                {
                    PropertyPanelManager.DeselectPropertyPanel();
                    selected = false;
                }
                else
                {
                    PropertyPanelManager.SetPropertyPanel(property);
                    UserControllerManager.Select(this);
                    PropertyPanelManager.SetPropertyName();
                    selected = true;
                }
                Refresh();
            }

            else if (e.Button.Equals(MouseButtons.Right))
            {
                Switch();
            }
        }
Example #9
0
 public virtual void SetParents(System.Windows.Forms.Panel property_panel)
 {
     this.propertyPanel = property_panel;
     this.Parent        = propertyPanel;
     UserControllerManager.SetColorPicker(ColorPicker);
 }