Esempio n. 1
0
        private void FillStyleActions(TreeNode top, Parameters parameter, bool withCustom = false)
        {
            TreeNode folder = top.Nodes.Add(ParameterSupport.GetParameterTypeName(parameter));

            // the first entry selects the palette, but limited for one or two parameters where they share a palette
            if (Mode != Modes.Button)             // buttons on palettes don't switch to other palettes
            {
                switch (parameter)
                {
                case Parameters.LineWidth:
                    break;

                default:
                    AddAction(folder, new PaletteAction(parameter), Strings.Item("Config_SwitchToPalette"), "CursorClick");
                    break;
                }
            }
            foreach (int value in ParameterSupport.GetStandardParameterValues(parameter))
            {
                AddAction(folder, Action.Create(parameter, value), ParameterSupport.GetParameterValueName(parameter, value));
            }
            if (withCustom)
            {
                AddAction(folder, new ParameterAction(parameter, 0, true), Strings.Item("Custom_Style_Value"));
            }
        }
Esempio n. 2
0
        private void ReflectAction()
        {
            // Displays the details of the action at the bottom
            pnlActionSelected.SuspendLayout();
            ctrActionColour.Visible  = false;
            chkActionKeyAuto.Visible = false;
            txtActionKey.Visible     = false;
            switch (m_Action.Change)
            {
            case Parameters.LineColour:
            case Parameters.FillColour:
            case Parameters.TextColour:
                ctrActionColour.Visible       = true;
                ctrActionColour.CurrentColour = Color.FromArgb((m_Action as ParameterAction).Value);
                lblActionSelected.Text        = Strings.Item("Button_SelectedAction") + " " + ParameterSupport.GetParameterTypeName(m_Action.Change) + " = ";
                break;

            case Parameters.Action_Key:
            case Parameters.Action_Character:
            case Parameters.Action_Text:
                chkActionKeyAuto.Visible = true;
                txtActionKey.Visible     = true;
                // doesn't use action description because this will include the key as well, which looks odd when it is in the box
                if (m_Action.Change == Parameters.Action_Key)
                {
                    txtActionKey.Text      = GUIUtilities.KeyDescription((m_Action as KeyAction).Key);
                    chkActionKeyAuto.Text  = Strings.Item("Button_ActionKeyAuto");
                    lblActionSelected.Text = Strings.Item("Button_SelectedAction") + " " + Strings.Item("Action_SimulateKey");
                }
                else
                {
                    txtActionKey.Text      = (m_Action as TextAction).Text;
                    chkActionKeyAuto.Text  = Strings.Item("Button_ActionCharacterAuto");
                    lblActionSelected.Text = Strings.Item("Button_SelectedAction") + " " + Strings.Item(m_Action.Change == Parameters.Action_Text ? "Action_TypeText" : "Action_TypeCharacter");
                }
                break;

            default:
                lblActionSelected.Text = Strings.Item("Button_SelectedAction") + " " + m_Action.DescriptionWithoutAccelerator();
                break;
            }
            pnlActionSelected.ResumeLayout();
        }