Example #1
0
        private void DrawHeaderPanel(Graphics gfx, Rectangle rc, Color clrStart, Color clrEnd)
        {
            rc.Inflate(-1, -1);
            using (GraphicsPath pathMenuPanel = VistaMenuControl.RoundRect((RectangleF)rc, 7, 7, 7, 7))
            {
                using (LinearGradientBrush lgb = new LinearGradientBrush(rc, clrStart, clrEnd, 90f))
                {
                    gfx.SmoothingMode      = SmoothingMode.HighQuality;
                    gfx.CompositingQuality = CompositingQuality.HighQuality;

                    gfx.FillPath(lgb, pathMenuPanel);

                    if (CurrentItemState == eSettingItem_State.Selected || CurrentItemState == eSettingItem_State.Hover)
                    {
                        Rectangle rcItem = rc;
                        rcItem.X      = 5;
                        rcItem.Y      = 4;
                        rcItem.Width  = rc.Width - 2;
                        rcItem.Height = this.pnlHeader.Height;

                        Rectangle rcUpRect   = rcItem;
                        Rectangle rcDownRect = rcItem;

                        rcUpRect.Height   /= 2;
                        rcDownRect.Height /= 2;
                        rcDownRect.Y       = rcUpRect.Height + 3;

                        VistaMenuControl.FillMenuItem(gfx, rcUpRect, rcDownRect, _clrSelectionStartColor, _clrSelectionEndColor,
                                                      _clrSelectionStartColorStart, _clrSelectionEndColorEnd, 7);
                    }
                }
            }
        }
Example #2
0
        protected virtual void OnPaintHeaderPanel(object sender, PaintEventArgs e)
        {
            DrawHeaderPanel(e.Graphics, this.ClientRectangle, _clrPanelStart, _clrPanelEnd);

            VistaMenuControl.DrawInnerBorder(e.Graphics, this.pnlHeader.ClientRectangle, _clrInnerBorder);
            VistaMenuControl.DrawOuterBorder(e.Graphics, this.pnlHeader.ClientRectangle, _clrOuterBorder);
        }
Example #3
0
 public VistaMenuItems(
     VistaMenuControl c
     )
     : base()
 {
     this.owner = c;
 }
Example #4
0
        public SyncMenuItem(VistaMenuControl owner, ImageList imgList)
            : base(owner)
        {
            PrevState = eSyncStatus.Unknow;

            _imgList = imgList;

            State <eSyncStatus> unknowState             = new State <eSyncStatus>(eSyncStatus.Unknow, ChangeStateHandler);
            State <eSyncStatus> readyState              = new State <eSyncStatus>(eSyncStatus.Ready, ChangeStateHandler);
            State <eSyncStatus> canceledState           = new State <eSyncStatus>(eSyncStatus.Canceled, ChangeStateHandler);
            State <eSyncStatus> conflicState            = new State <eSyncStatus>(eSyncStatus.UnresolvedConflict, ChangeStateHandler);
            State <eSyncStatus> inProgressState         = new State <eSyncStatus>(eSyncStatus.InProgress, ChangeStateHandler);
            State <eSyncStatus> failState               = new State <eSyncStatus>(eSyncStatus.Failed, ChangeStateHandler);
            State <eSyncStatus> readyProgressState      = new State <eSyncStatus>(eSyncStatus.ReadyProgress, ChangeStateHandler);
            State <eSyncStatus> okState                 = new State <eSyncStatus>(eSyncStatus.Ok, ChangeStateHandler);
            State <eSyncStatus> skippedChangeItemsState = new State <eSyncStatus>(eSyncStatus.SkipedChangesDetected, ChangeStateHandler);

            var allStates = new State <eSyncStatus>[] { okState, readyState, canceledState, conflicState, inProgressState,
                                                        failState, readyState, unknowState, readyProgressState, skippedChangeItemsState };

            //Пока позаоляем переход из любого состояни в любое
            foreach (State <eSyncStatus> state in allStates)
            {
                state.AvailTransitions.AddRange(allStates);
            }

            _syncStatusSM = new StateMachine <eSyncStatus>(unknowState);
            _syncStatusSM.RegisteredStates.AddRange(allStates);

            _animatedTimer          = new Timer();
            _animatedTimer.Interval = 150;
            _animatedTimer.Tick    += animatedTimer_Tick;
            _animatedTimer.Enabled  = false;
        }
Example #5
0
        private int _tickCount = 0; //0.1 sec

        #endregion Fields

        #region Constructors

        public SyncMenuItem(VistaMenuControl owner, ImageList imgList)
            : base(owner)
        {
            PrevState = eSyncStatus.Unknow;

            _imgList = imgList;

            State<eSyncStatus> unknowState = new State<eSyncStatus>(eSyncStatus.Unknow, ChangeStateHandler);
            State<eSyncStatus> readyState = new State<eSyncStatus>(eSyncStatus.Ready, ChangeStateHandler);
            State<eSyncStatus> canceledState = new State<eSyncStatus>(eSyncStatus.Canceled, ChangeStateHandler);
            State<eSyncStatus> conflicState = new State<eSyncStatus>(eSyncStatus.UnresolvedConflict, ChangeStateHandler);
            State<eSyncStatus> inProgressState = new State<eSyncStatus>(eSyncStatus.InProgress, ChangeStateHandler);
            State<eSyncStatus> failState = new State<eSyncStatus>(eSyncStatus.Failed, ChangeStateHandler);
            State<eSyncStatus> readyProgressState = new State<eSyncStatus>(eSyncStatus.ReadyProgress, ChangeStateHandler);
            State<eSyncStatus> okState = new State<eSyncStatus>(eSyncStatus.Ok, ChangeStateHandler);
            State<eSyncStatus> skippedChangeItemsState = new State<eSyncStatus>(eSyncStatus.SkipedChangesDetected, ChangeStateHandler);

            var allStates = new State<eSyncStatus>[] { okState, readyState, canceledState, conflicState, inProgressState,
                                                       failState, readyState, unknowState, readyProgressState, skippedChangeItemsState };
            //Пока позаоляем переход из любого состояни в любое
            foreach (State<eSyncStatus> state in allStates)
            {
                state.AvailTransitions.AddRange(allStates);
            }

            _syncStatusSM = new StateMachine<eSyncStatus>(unknowState);
            _syncStatusSM.RegisteredStates.AddRange(allStates);

            _animatedTimer = new Timer();
            _animatedTimer.Interval = 150;
            _animatedTimer.Tick += animatedTimer_Tick;
            _animatedTimer.Enabled = false;
        }
Example #6
0
        public FormSyncItem()
            : base()
        {
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer
                          | ControlStyles.DoubleBuffer
                          | ControlStyles.AllPaintingInWmPaint, true);

            InitializeComponent();

            this.SuspendLayout();
            _vistaMenuCtrl = new VistaMenuControl();
            _vistaMenuCtrl.BackImageAlign = System.Drawing.ContentAlignment.TopRight;
            _vistaMenuCtrl.BackMenuImage = null;
            _vistaMenuCtrl.CheckOnClick = false;
            _vistaMenuCtrl.FlatSeparators = false;
            _vistaMenuCtrl.FlatSeparatorsColor = System.Drawing.Color.Silver;
            _vistaMenuCtrl.ItemHeight = 48;
            _vistaMenuCtrl.ItemWidth = 150;
            _vistaMenuCtrl.MenuOrientation = VistaMenuControl.VistaMenuOrientation.Vertical;
            _vistaMenuCtrl.MenuStartColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
            _vistaMenuCtrl.MinimumSize = new System.Drawing.Size(300, 46);
            _vistaMenuCtrl.Name = "_vistaMenuCtrl";
            _vistaMenuCtrl.RenderSeparators = true;
            _vistaMenuCtrl.SelectedItem = -1;
            _vistaMenuCtrl.SideBarBitmap = null;
            _vistaMenuCtrl.SideBarFont = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            _vistaMenuCtrl.SideBarFontColor = System.Drawing.Color.White;
            _vistaMenuCtrl.MenuStartColor = Color.FromArgb(239, 239, 239);
            _vistaMenuCtrl.MenuEndColor = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.MenuInnerBorderColor = Color.FromArgb(254, 254, 254);
            _vistaMenuCtrl.MenuOuterBorderColor = Color.FromArgb(192, 192, 192);

            _vistaMenuCtrl.SideBar = true;
            _vistaMenuCtrl.SideBarCaption = Resources.FromSyncMenuSidebar_Caption;
            _vistaMenuCtrl.SideBarEndGradient = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.SideBarStartGradient = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.SideBarFontColor = Color.Black;

            _vistaMenuCtrl.Dock = DockStyle.Fill;
            _vistaMenuCtrl.VistaMenuItemClick += vistaMenuCtrl_itemclick;
            _vistaMenuCtrl.MouseMove += vistaMenuCtrl_mouseMove;
            _vistaMenuCtrl.MouseLeave += vistaMenuCtrl_mouseLeave;

            this.panel1.Controls.Add(_vistaMenuCtrl);

            this.ResumeLayout(false);
        }
Example #7
0
        public FormSyncItem()
            : base()
        {
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer
                          | ControlStyles.DoubleBuffer
                          | ControlStyles.AllPaintingInWmPaint, true);

            InitializeComponent();

            this.SuspendLayout();
            _vistaMenuCtrl = new VistaMenuControl();
            _vistaMenuCtrl.BackImageAlign      = System.Drawing.ContentAlignment.TopRight;
            _vistaMenuCtrl.BackMenuImage       = null;
            _vistaMenuCtrl.CheckOnClick        = false;
            _vistaMenuCtrl.FlatSeparators      = false;
            _vistaMenuCtrl.FlatSeparatorsColor = System.Drawing.Color.Silver;
            _vistaMenuCtrl.ItemHeight          = 48;
            _vistaMenuCtrl.ItemWidth           = 150;
            _vistaMenuCtrl.MenuOrientation     = VistaMenuControl.VistaMenuOrientation.Vertical;
            _vistaMenuCtrl.MenuStartColor      = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
            _vistaMenuCtrl.MinimumSize         = new System.Drawing.Size(300, 46);
            _vistaMenuCtrl.Name                 = "_vistaMenuCtrl";
            _vistaMenuCtrl.RenderSeparators     = true;
            _vistaMenuCtrl.SelectedItem         = -1;
            _vistaMenuCtrl.SideBarBitmap        = null;
            _vistaMenuCtrl.SideBarFont          = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            _vistaMenuCtrl.SideBarFontColor     = System.Drawing.Color.White;
            _vistaMenuCtrl.MenuStartColor       = Color.FromArgb(239, 239, 239);
            _vistaMenuCtrl.MenuEndColor         = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.MenuInnerBorderColor = Color.FromArgb(254, 254, 254);
            _vistaMenuCtrl.MenuOuterBorderColor = Color.FromArgb(192, 192, 192);

            _vistaMenuCtrl.SideBar              = true;
            _vistaMenuCtrl.SideBarCaption       = Resources.FromSyncMenuSidebar_Caption;
            _vistaMenuCtrl.SideBarEndGradient   = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.SideBarStartGradient = Color.FromArgb(202, 202, 202);
            _vistaMenuCtrl.SideBarFontColor     = Color.Black;

            _vistaMenuCtrl.Dock = DockStyle.Fill;
            _vistaMenuCtrl.VistaMenuItemClick += vistaMenuCtrl_itemclick;
            _vistaMenuCtrl.MouseMove          += vistaMenuCtrl_mouseMove;
            _vistaMenuCtrl.MouseLeave         += vistaMenuCtrl_mouseLeave;

            this.panel1.Controls.Add(_vistaMenuCtrl);

            this.ResumeLayout(false);
        }
Example #8
0
 public static void DrawGradientBckground(Graphics gfx, Rectangle rc, Color clrStart, Color clrEnd)
 {
     rc.Inflate(-1, -1);
     using (GraphicsPath pathMenuPanel =
                VistaMenuControl.RoundRect((RectangleF)rc, 7, 7, 7, 7))
     {
         using (LinearGradientBrush lgb =
                    new LinearGradientBrush(
                        rc,
                        clrStart,
                        clrEnd,
                        90f))
         {
             gfx.SmoothingMode      = SmoothingMode.HighQuality;
             gfx.CompositingQuality = CompositingQuality.HighQuality;
             gfx.FillPath(lgb, pathMenuPanel);
         }
     }
 }
 protected void OnPaintBottomPanel(object sender, PaintEventArgs e)
 {
     VistaMenuControl.DrawInnerBorder(e.Graphics, this.pnlBottom.ClientRectangle, _header.BorderColorInner);
     VistaMenuControl.DrawOuterBorder(e.Graphics, this.pnlBottom.ClientRectangle, _header.BorderColorOuter);
 }
Example #10
0
 public VistaMenuItem(VistaMenuControl c)
 {
     owner = c;
 }
Example #11
0
 public VistaMenuItem(VistaMenuControl c)
 {
     owner = c;
 }
Example #12
0
        private void InitializeSettingView()
        {
            _vistaMenuCtrl = new VistaMenuControl();

            this.panelLeft.Controls.Add(_vistaMenuCtrl);
            _vistaMenuCtrl.MaximumSize = new Size(0, 0);
            _vistaMenuCtrl.MinimumSize = new Size(panelLeft.Width - (panelLeft.Padding.Left + panelLeft.Padding.Right),
                                                  panelLeft.Height - (panelLeft.Padding.Top + panelLeft.Padding.Bottom));
            _vistaMenuCtrl.Dock = DockStyle.Fill;

            _vistaMenuCtrl.SideBar = false;
            _vistaMenuCtrl.SideBarCaption = Resources.FormSettingMenuSidebar_Caption;
            _vistaMenuCtrl.SideBarEndGradient = Color.FromArgb(81, 69, 59);
            _vistaMenuCtrl.SideBarStartGradient = Color.DarkOrange;
            _vistaMenuCtrl.SideBarFontColor = Color.Black;

            _vistaMenuCtrl.MenuStartColor = Color.FromArgb(239, 239, 239);
            _vistaMenuCtrl.MenuEndColor = Color.FromArgb(202, 202, 202);

            _vistaMenuCtrl.MenuInnerBorderColor = Color.FromArgb(167, 162, 158);
            _vistaMenuCtrl.MenuOuterBorderColor = Color.FromArgb(47, 37, 28);

            _vistaMenuCtrl.RenderSeparators = false;
            _vistaMenuCtrl.CheckOnClick = true;
            _vistaMenuCtrl.ItemHeight = 48;
            _vistaMenuCtrl.ItemWidth = 48;
            _vistaMenuCtrl.BackImageAlign = System.Drawing.ContentAlignment.TopRight;
            _vistaMenuCtrl.MenuOrientation = VistaMenuControl.VistaMenuOrientation.Vertical;
            _vistaMenuCtrl.SelectedItem = -1;
            _vistaMenuCtrl.SideBarFont = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            _vistaMenuCtrl.SideBarFontColor = System.Drawing.Color.White;

            VistaMenuItem menuItem = CreateSettingMenuItem(eMenuSettings_Icon.Connection);
            CtrlListItemContainer settingPage = CreateSettingCtrlPage(menuItem);
            settingPage.BorderStyle = BorderStyle.None;
            settingPage.Dock = DockStyle.Fill;
            _vistaMenuCtrl.Items.Add(menuItem);
            this.panelRight.Controls.Add(settingPage);

            menuItem = CreateSettingMenuItem(eMenuSettings_Icon.SyncItems);
            settingPage = CreateSettingCtrlPage(menuItem);
            settingPage.BorderStyle = BorderStyle.None;
            settingPage.Dock = DockStyle.Fill;
            _vistaMenuCtrl.Items.Add(menuItem);
            this.panelRight.Controls.Add(settingPage);

            _vistaMenuCtrl.VistaMenuItemClick += vistaMenuCtrl_itemclick;

            this._minHeight = this.panelLeft.Height;
        }
Example #13
0
 public VistaMenuItems(
     VistaMenuControl c
     ) : base()
 {
     this.owner = c;
 }
Example #14
0
 protected void OnPaintExtendedPanel(object sender, PaintEventArgs e)
 {
     VistaMenuControl.DrawGradientBckground(e.Graphics, this.pnlBottom.ClientRectangle, _clrMenuPanelStart, _clrMenuPanelEnd);
     VistaMenuControl.DrawInnerBorder(e.Graphics, this.pnlBottom.ClientRectangle, _header.BorderColorInner);
     VistaMenuControl.DrawOuterBorder(e.Graphics, this.pnlBottom.ClientRectangle, _header.BorderColorOuter);
 }