Пример #1
0
        public void AddOkCancelButtons(out KryptonButton buttonOK, out KryptonButton buttonCancel)
        {
            buttonCancel          = new KryptonButton();
            buttonCancel.Size     = DpiHelper.Default.ScaleValue(new Size(94, 26));
            buttonCancel.Text     = "Cancel";
            buttonCancel.Anchor   = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonCancel.Location = new Point(Size - buttonCancel.Size - new Size(10, 10));
            buttonCancel.Click   += (s, e) => ParentHolder.Close(false);
            Controls.Add(buttonCancel);

            buttonOK          = new KryptonButton();
            buttonOK.Size     = DpiHelper.Default.ScaleValue(new Size(94, 26));
            buttonOK.Text     = "OK";
            buttonOK.Anchor   = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonOK.Location = new Point(Width - buttonCancel.Width - buttonOK.Width - 20,
                                          Height - buttonOK.Height - 10);
            buttonOK.Click += (s, e) => ParentHolder.Close(true);
            Controls.Add(buttonOK);

            Height += buttonCancel.Height + 10;

            buttonOK.Text     = EditorLocalization.Translate("General", buttonOK.Text);
            buttonCancel.Text = EditorLocalization.Translate("General", buttonCancel.Text);
        }
Пример #2
0
        public void ToggleDropDown(HCDropDownControl control, Control parentControl)
        {
            if (dropDownHolder == null)
            {
                if (control.UseFormDropDownHolder)
                {
                    dropDownHolder = new HCFormDropDownHolder(control);
                }
                else
                {
                    dropDownHolder = new HCToolStripDropDownHolder(control);
                }

                dropDownHolder.Show(parentControl);
                dropDownHolder.HolderClosed += DropDownHolder_Closed;
            }
            else
            {
                dropDownHolder.Close();
            }
        }
Пример #3
0
        public void ToggleDropDown(HCDropDownControl control, HCItemProperty itemProperty)
        {
            if (dropDownHolder == null)
            {
                if (control.SpecialHolder)
                {
                    dropDownHolder = new HCFormDropDownHolder(control);
                }
                else
                {
                    dropDownHolder = new HCToolStripDropDownHolder(control);
                }

                dropDownHolder.Show(itemProperty.CreatedControlInsidePropertyItemControl);
                dropDownHolder.HolderClosed += DropDownHolder_Closed;
            }
            else
            {
                dropDownHolder.Close();
            }
        }