Beispiel #1
0
 void bar1_VisibleChanged(object sender, EventArgs e)
 {
     if (bar1.Visible)
     {
         CustomBarControl control = bar1.GetBarControl();
         control.MouseLeave += control_MouseLeave;
     }
 }
Beispiel #2
0
        private void MainTabUserFm_Load(object sender, EventArgs e)
        {
            CustomBarControl barControl = ((IDockableObject)bar1).BarControl as CustomBarControl;

            barControl.MouseDown += new MouseEventHandler(barControl_MouseDown);

            barAndDockingController.AppearancesBar.Dock.BackColor = Color.FromArgb(86, 198, 184);
            this.BackColor = Color.FromArgb(86, 198, 184);
        }
Beispiel #3
0
        public void CheckChange(CustomBarControl barControl, BarDockControl barDockControl)
        {
            if (BarControlChanged(barControl))
            {
                OnBarControlChanged(barControl);
            }

            if (BarDockControlChanged(barDockControl))
            {
                OnBarDockControlChanged(barDockControl);
            }
        }
Beispiel #4
0
        public MainTabUserFm(bool settingSet)
        {
            InitializeComponent();
            settingsBar.ForceInitialize();
            CustomBarControl barControl = bar1.GetBarControl();

            chartThread = new Thread(new ThreadStart(this.GetPerformanceCounters));
            chartThread.IsBackground = true;
            chartThread.Start();

            realTimeAnalizatorThread = new Thread(new ThreadStart(this.RealTimeAnalizator));
            realTimeAnalizatorThread.IsBackground = true;
            realTimeAnalizatorThread.Start();

            oneMinuteAnalizatorThread = new Thread(new ThreadStart(this.OneMinuteAnalizator));
            oneMinuteAnalizatorThread.IsBackground = true;
            oneMinuteAnalizatorThread.Start();



            using (CustomWaitFm frm = new CustomWaitFm(LoadSetting))
            {
                frm.ShowDialog(this);
            }

            if (settingSet)
            {
            }
            else
            {
                DialogResult dialogResult = MessageBox.Show("Програмны налаштування відсутні. Розпочати налаштування?", "Повідомлення", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.Yes)
                {
                    using (var form = new SettingsUserFm())
                    {
                        var result = form.ShowDialog();
                        if (result == DialogResult.OK)
                        {
                            MessageBox.Show("Збережено параметри користувача", "Повідомлення", MessageBoxButtons.YesNo);
                        }
                        else
                        {
                            MessageBox.Show("Параметри користувача не збережено", "Повідомлення", MessageBoxButtons.YesNo);
                        }
                    }
                }
                else if (dialogResult == DialogResult.No)
                {
                    //do something else
                }
            }
        }
Beispiel #5
0
 private void OnBarControlChanged(CustomBarControl barControl)
 {
     if (_BarControl != null)
     {
         _BarControl.MouseEnter  -= OnMouseEnter;
         _BarControl.MouseLeave  -= OnMouseLeave;
         _BarControl.SizeChanged -= _BarControl_SizeChanged;
     }
     _BarControl = barControl;
     if (_BarControl != null)
     {
         _BarControl.MouseEnter  += OnMouseEnter;
         _BarControl.MouseLeave  += OnMouseLeave;
         _BarControl.SizeChanged += _BarControl_SizeChanged;
     }
 }
        public override void DoDragging(Control control, MouseEventArgs e)
        {
            base.DoDragging(control, e);

            CustomBarControl barControl = control as CustomBarControl;

            if (barControl == null)
            {
                return;
            }

            currentBar = barControl.Bar;
            if (DragObject is BarItemLink && IsItemLinkIsFixed((BarItemLink)DragObject))
            {
                Cursor.Current = (Cursor)Manager.GetController().DragCursors[2];
                Manager.SelectionInfo.DropSelectStyle = LinkDropTargetEnum.None;
            }
        }
Beispiel #7
0
        private void barControl_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            CustomBarControl barControl = (CustomBarControl)sender;
            BarItemLink      link       = barControl.GetLinkByPoint(Control.MousePosition, true);

            if (link != null)
            {
                return;
            }

            ReleaseCapture();
            SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
        }
Beispiel #8
0
 private bool BarControlChanged(CustomBarControl barControl)
 {
     return(barControl != _BarControl);
 }