Beispiel #1
0
 private void OnButtonPressed(BottomBarButton aButton)
 {
     if (this.ButtonClick != null)
     {
         this.ButtonClick(this, aButton);
     }
 }
Beispiel #2
0
 public ControlBottomBar(IParentControl aParent)
 {
     this.m_Parent = aParent;
     this.m_Font = new System.Drawing.Font(FontFamily.GenericSerif, 10f, FontStyle.Bold);
     BottomBarButton button = new BottomBarButton("Today");
     button.Type = Resco.Controls.OutlookControls.ButtonType.Today;
     this.m_Buttons.Add(button);
     BottomBarButton button2 = new BottomBarButton("None");
     button2.Type = Resco.Controls.OutlookControls.ButtonType.None;
     this.m_Buttons.Add(button2);
 }
Beispiel #3
0
 private void ControlBottomBar_ButtonClick(object sender, BottomBarButton aButton)
 {
     if (aButton.Type == Resco.Controls.OutlookControls.ButtonType.None)
     {
         this.OnNoneButtonPressed();
     }
     else if (aButton.Type == Resco.Controls.OutlookControls.ButtonType.Today)
     {
         this.OnTodayButtonPressed();
     }
 }
Beispiel #4
0
        public ControlBottomBar(IParentControl aParent)
        {
            this.m_Parent = aParent;
            this.m_Font   = new System.Drawing.Font(FontFamily.GenericSerif, 10f, FontStyle.Bold);
            BottomBarButton button = new BottomBarButton("Today");

            button.Type = Resco.Controls.OutlookControls.ButtonType.Today;
            this.m_Buttons.Add(button);
            BottomBarButton button2 = new BottomBarButton("None");

            button2.Type = Resco.Controls.OutlookControls.ButtonType.None;
            this.m_Buttons.Add(button2);
        }
Beispiel #5
0
        private int GetSelectedButtonsIndex(MouseEventArgs e)
        {
            int x = e.X;
            int y = e.Y;

            for (int i = 0; i < this.m_Buttons.Count; i++)
            {
                BottomBarButton button = this.m_Buttons[i];
                if (button.Visible && button.ClientRectangle.Contains(x, y))
                {
                    return(i);
                }
            }
            return(-1);
        }
Beispiel #6
0
        public void DrawControl(Graphics gr)
        {
            Region region = new Region(this.ClientRectangle);

            gr.Clip = region;
            Rectangle clientRectangle = this.ClientRectangle;
            int       num             = 0;

            for (int i = 0; i < this.m_Buttons.Count; i++)
            {
                if (this.m_Buttons[i].Visible)
                {
                    num++;
                }
            }
            int x      = this.m_Location.X + this.KMargin;
            int y      = this.m_Location.Y + this.KMargin;
            int width  = ((this.Width - this.KMargin) / num) - this.KMargin;
            int height = this.Height - (this.KMargin * 2);
            int num7   = 0;

            for (int j = 0; j < this.m_Buttons.Count; j++)
            {
                BottomBarButton aButton = this.m_Buttons[j];
                if (aButton.Visible)
                {
                    this.m_Buttons[j].ClientRectangle = new Rectangle(x, y, width, height);
                    this.DrawButton(gr, aButton);
                    num7++;
                    if (num7 == num)
                    {
                        x += this.Width - (this.KMargin + width);
                    }
                    else
                    {
                        x += this.KMargin + width;
                    }
                }
            }
            gr.ResetClip();
            region.Dispose();
            region = null;
        }
Beispiel #7
0
        private void DrawButton(Graphics gr, BottomBarButton aButton)
        {
            Color color = aButton.Pressed ? aButton.ForeColorSelected : aButton.ForeColor;

            if (aButton.Pressed)
            {
                Color     color2          = aButton.Pressed ? aButton.BackColorSelected : aButton.BackColor;
                Rectangle clientRectangle = aButton.ClientRectangle;
                clientRectangle.Width--;
                clientRectangle.Height--;
                using (Pen pen = new Pen(color2))
                {
                    TouchDTPRenderer.DrawRoundedRect(gr, pen, color2, clientRectangle, this.KWindowFrameRoundSize);
                }
            }
            StringFormat format = new StringFormat();

            format.LineAlignment = StringAlignment.Center;
            format.Alignment     = StringAlignment.Center;
            using (SolidBrush brush = new SolidBrush(color))
            {
                gr.DrawString(aButton.Text, this.Font, brush, aButton.ClientRectangle, format);
            }
        }
Beispiel #8
0
 private void OnButtonPressed(BottomBarButton aButton)
 {
     if (this.ButtonClick != null)
     {
         this.ButtonClick(this, aButton);
     }
 }
Beispiel #9
0
 private void DrawButton(Graphics gr, BottomBarButton aButton)
 {
     Color color = aButton.Pressed ? aButton.ForeColorSelected : aButton.ForeColor;
     if (aButton.Pressed)
     {
         Color color2 = aButton.Pressed ? aButton.BackColorSelected : aButton.BackColor;
         Rectangle clientRectangle = aButton.ClientRectangle;
         clientRectangle.Width--;
         clientRectangle.Height--;
         using (Pen pen = new Pen(color2))
         {
             TouchDTPRenderer.DrawRoundedRect(gr, pen, color2, clientRectangle, this.KWindowFrameRoundSize);
         }
     }
     StringFormat format = new StringFormat();
     format.LineAlignment = StringAlignment.Center;
     format.Alignment = StringAlignment.Center;
     using (SolidBrush brush = new SolidBrush(color))
     {
         gr.DrawString(aButton.Text, this.Font, brush, aButton.ClientRectangle, format);
     }
 }
 private void ControlBottomBar_ButtonClick(object sender, BottomBarButton aButton)
 {
     if (aButton.Type == Resco.Controls.OutlookControls.ButtonType.None)
     {
         this.OnNoneButtonPressed();
     }
     else if (aButton.Type == Resco.Controls.OutlookControls.ButtonType.Today)
     {
         this.OnTodayButtonPressed();
     }
 }