示例#1
0
 private void InitScrollButtons()
 {
     _leftScrollButton          = new TabBarScrollButton();
     _leftScrollButton._isRight = false;
     _leftScrollButton.Enabled  = false;
     _leftScrollButton.Width    = SCROLLBUTTON_SIZE;
     _leftScrollButton.Height   = SCROLLBUTTON_SIZE;
     _leftScrollButton.BringToFront();
     _leftScrollButton.Click += new EventHandler(OnLeftScrollButtonClicked);
     this.Controls.Add(_leftScrollButton);
     _rightScrollButton          = new TabBarScrollButton();
     _rightScrollButton._isRight = true;
     _rightScrollButton.Enabled  = false;
     _rightScrollButton.Width    = SCROLLBUTTON_SIZE;
     _rightScrollButton.Height   = SCROLLBUTTON_SIZE;
     _rightScrollButton.BringToFront();
     _rightScrollButton.Click += new EventHandler(OnRightScrollButtonClicked);
     this.Controls.Add(_rightScrollButton);
 }
示例#2
0
        private void ArrangeButtonsForMultiRowStyle()
        {
            if (_leftScrollButton != null)
            {
                this.Controls.Remove(_leftScrollButton);
                this.Controls.Remove(_rightScrollButton);
                _leftScrollButton = _rightScrollButton = null;
            }

            int x = 2;
            int y = 3;
            int i = 0;

            foreach (Control c in Controls)
            {
                TabBarButton button = c as TabBarButton;
                if (button == null)
                {
                    continue;
                }

                SetButtonText(button, i, (ConnectionTag)button.Tag);
                if (x + button.Width >= this.Width)
                {
                    x  = 2;
                    y += UNITHEIGHT;
                }
                button.Left    = x;
                button.Width   = GetNecessaryButtonWidth((ConnectionTag)button.Tag);
                x             += button.Width + BUTTON_MARGIN;
                button.Top     = y;
                button.Visible = true;
                button.Height  = UNITHEIGHT - 4;
                button.Invalidate();
                i++;
            }
            this.Height = y + UNITHEIGHT;
        }
示例#3
0
 private void InitScrollButtons()
 {
     _leftScrollButton = new TabBarScrollButton();
     _leftScrollButton._isRight = false;
     _leftScrollButton.Enabled = false;
     _leftScrollButton.Width = SCROLLBUTTON_SIZE;
     _leftScrollButton.Height = SCROLLBUTTON_SIZE;
     _leftScrollButton.BringToFront();
     _leftScrollButton.Click += new EventHandler(OnLeftScrollButtonClicked);
     this.Controls.Add(_leftScrollButton);
     _rightScrollButton = new TabBarScrollButton();
     _rightScrollButton._isRight = true;
     _rightScrollButton.Enabled = false;
     _rightScrollButton.Width = SCROLLBUTTON_SIZE;
     _rightScrollButton.Height = SCROLLBUTTON_SIZE;
     _rightScrollButton.BringToFront();
     _rightScrollButton.Click += new EventHandler(OnRightScrollButtonClicked);
     this.Controls.Add(_rightScrollButton);
 }
示例#4
0
        private void ArrangeButtonsForMultiRowStyle()
        {
            if(_leftScrollButton!=null) {
                this.Controls.Remove(_leftScrollButton);
                this.Controls.Remove(_rightScrollButton);
                _leftScrollButton = _rightScrollButton = null;
            }

            int x = 2;
            int y = 3;
            int i = 0;
            foreach(Control c in Controls) {
                TabBarButton button = c as TabBarButton;
                if(button==null) continue;

                SetButtonText(button, i, (ConnectionTag)button.Tag);
                if(x + button.Width >= this.Width) {
                    x = 2;
                    y += UNITHEIGHT;
                }
                button.Left = x;
                button.Width = GetNecessaryButtonWidth((ConnectionTag)button.Tag);
                x += button.Width + BUTTON_MARGIN;
                button.Top = y;
                button.Visible = true;
                button.Height = UNITHEIGHT - 4;
                button.Invalidate();
                i++;
            }
            this.Height = y + UNITHEIGHT;
        }