Пример #1
0
        bool hiddenmarkershouldbeshown = false; // if to show it now

        public ExtPanelRollUp()
        {
            SuspendLayout();

            pinbutton                       = new ExtCheckBox();
            pinbutton.Appearance            = Appearance.Normal;
            pinbutton.FlatStyle             = FlatStyle.Popup;
            pinbutton.Size                  = new Size(32, 32);
            pinbutton.Image                 = ExtendedControls.Properties.Resources.pindownwhite2; //colours 222 and 255 used
            pinbutton.ImageUnchecked        = ExtendedControls.Properties.Resources.pinupwhite2;
            pinbutton.ImageLayout           = ImageLayout.Stretch;
            pinbutton.Checked               = true;
            pinbutton.CheckedChanged       += Pinbutton_CheckedChanged;
            pinbutton.TickBoxReductionRatio = 1;
            pinbutton.Name                  = "RUP Pinbutton";

            hiddenmarker1               = new ExtButtonDrawn();
            hiddenmarker1.Name          = "Hidden marker";
            hiddenmarker1.ImageSelected = ExtButtonDrawn.ImageType.Bars;
            hiddenmarker1.Visible       = false;
            hiddenmarker1.Padding       = new Padding(0);
            hiddenmarker1.Click        += Hiddenmarker_Click;

            hiddenmarker2               = new ExtButtonDrawn();
            hiddenmarker2.Name          = "Hidden marker";
            hiddenmarker2.ImageSelected = ExtButtonDrawn.ImageType.Bars;
            hiddenmarker2.Visible       = false;
            hiddenmarker2.Padding       = new Padding(0);
            hiddenmarker2.Click        += Hiddenmarker_Click;

            Controls.Add(pinbutton);
            Controls.Add(hiddenmarker1);
            Controls.Add(hiddenmarker2);

            ResumeLayout();

            mode        = Mode.Down;
            timer       = new Timer();
            timer.Tick += Timer_Tick;

            SetPin(false);
        }
Пример #2
0
        bool hiddenmarkershouldbeshown = false; // if to show it now

        public ExtPanelRollUp()
        {
            SuspendLayout();

            this.Height = UnrolledHeight;

            pinbutton                 = new ExtCheckBox();
            pinbutton.Appearance      = Appearance.Normal;
            pinbutton.FlatStyle       = FlatStyle.Popup;
            pinbutton.Size            = new Size(24, 24);
            pinbutton.Image           = ExtendedControls.Properties.Resources.pindownwhite2; //colours 222 and 255 used
            pinbutton.ImageUnchecked  = ExtendedControls.Properties.Resources.pinupwhite2;
            pinbutton.Checked         = true;
            pinbutton.CheckedChanged += Pinbutton_CheckedChanged;
            pinbutton.Name            = "RUP Pinbutton";

            hiddenmarker1               = new ExtDrawnPanelNoTheme();
            hiddenmarker1.Name          = "Hidden marker";
            hiddenmarker1.ImageSelected = ExtPanelDrawn.ImageType.Bars;
            hiddenmarker1.Visible       = false;
            hiddenmarker1.Padding       = new Padding(0);
            hiddenmarker1.Click        += Hiddenmarker_Click;

            hiddenmarker2               = new ExtDrawnPanelNoTheme();
            hiddenmarker2.Name          = "Hidden marker";
            hiddenmarker2.ImageSelected = ExtPanelDrawn.ImageType.Bars;
            hiddenmarker2.Visible       = false;
            hiddenmarker2.Padding       = new Padding(0);
            hiddenmarker2.Click        += Hiddenmarker_Click;

            Controls.Add(pinbutton);
            Controls.Add(hiddenmarker1);
            Controls.Add(hiddenmarker2);

            ResumeLayout();

            mode        = Mode.None;
            timer       = new Timer();
            timer.Tick += Timer_Tick;

            pinbutton.Visible = false;
        }
        protected override void CheckChangedEvent(ExtCheckBox cb, ItemCheckEventArgs e) // we get a chance to operate group options
        {
            if (e.NewValue == CheckState.Checked)                                       // all or none set all of them
            {
                if (e.Index < groupoptions.Count())
                {
                    bool shift = Control.ModifierKeys.HasFlag(Keys.Control);

                    if (!shift)
                    {
                        SetCheckedFromToEnd(groupoptions.Count(), false);   // if not shift, we clear all, and apply this tag
                    }
                    string tag = groupoptions[e.Index].Tag;
                    if (tag == "All")
                    {
                        SetCheckedFromToEnd(groupoptions.Count(), true);
                    }
                    else if (tag == "None")
                    {
                        SetCheckedFromToEnd(groupoptions.Count(), false);
                    }
                    else
                    {
                        SetChecked(tag);
                    }
                }
            }
            else
            {
                if (e.Index < groupoptions.Count())        // off on this clears the entries of it only
                {
                    string tag = groupoptions[e.Index].Tag;
                    if (tag != "All" && tag != "None ")
                    {
                        SetChecked(tag, false);
                    }
                }
            }

            SetGroupOptions();
        }
Пример #4
0
        // Sent after the change, so cb.CheckState is the new state
        private void CheckedIconListBoxForm_CheckedChanged(object sender, EventArgs e)
        {
            if (!ignorechangeevent)
            {
                ExtCheckBox cb    = sender as ExtCheckBox;
                int         index = (int)cb.Tag;

                var prevstate = cb.Checked ? CheckState.Unchecked : CheckState.Checked;

                ItemCheckEventArgs i = new ItemCheckEventArgs(index, cb.CheckState, prevstate);
                CheckChangedEvent(cb, i);       // derived classes first.
                CheckedChanged?.Invoke(this, i, Tag);

                if (CloseOnChange)
                {
                    Close();
                }
                else if (HideOnChange)
                {
                    Hide();
                }
            }
        }
Пример #5
0
 protected virtual void CheckChangedEvent(ExtCheckBox cb, ItemCheckEventArgs e)
 {
 }