Exemplo n.º 1
0
 protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
 {
     if (PanelClick != null)
     {
         PanelClick(this, e);
     }
 }
Exemplo n.º 2
0
 // The user clicked on the status bar.
 // If the status bar has just one panel (e.g. Selectable), display
 // the dialog associated with that panel.
 // If the status bar has multiple panels, display a context menu to let the
 // user choose which dialog to display (Selectable, Editable, Drawable).
 private void statusBarPanelClick(
     object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
 {
     if (_selectFilter != null && _editFilter == null && _insertFilter == null)
     {
         MenuItemSelect_Click(null, null);
     }
     else if (_selectFilter == null && _editFilter != null && _insertFilter == null)
     {
         MenuItemEdit_Click(null, null);
     }
     else if (_selectFilter == null && _editFilter == null && _insertFilter != null)
     {
         MenuItemInsert_Click(null, null);
     }
     else
     {
         contextMenu.MenuItems.Clear();
         if (_selectFilter != null)
         {
             contextMenu.MenuItems.Add(_menuItemSelect);
         }
         if (_editFilter != null)
         {
             contextMenu.MenuItems.Add(_menuItemEdit);
         }
         if (_insertFilter != null)
         {
             contextMenu.MenuItems.Add(_menuItemInsert);
         }
         contextMenu.Show(this, new Point(e.X, e.Y));
     }
 }
Exemplo n.º 3
0
 private void statusBar_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
 {
     if (e.StatusBarPanel == statusBarPanelLogo)
     {
         System.Diagnostics.Process.Start(lukeURL);
     }
 }
Exemplo n.º 4
0
        public void StatusBar_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
        {
            // determine if left or right mouse click
            bool LeftClick = true; if (e.Button.ToString().ToUpper() == "RIGHT")

            {
                LeftClick = false;
            }

            switch (mainStatusBar.Panels.IndexOf(e.StatusBarPanel))
            {
            case 0:
                if (LeftClick)
                {
                    MessageBox.Show("You have clicked Panel One - LEFT Click");
                }
                if (!LeftClick)
                {
                    MessageBox.Show("You have clicked Panel One - RIGHT Click");
                }
                break;

            case 1:
                if (LeftClick)
                {
                    MessageBox.Show("You have clicked Panel Two - LEFT Click");
                }
                if (!LeftClick)
                {
                    MessageBox.Show("You have clicked Panel Two - RIGHT Click");
                }
                break;
            }
        }
Exemplo n.º 5
0
        protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
        {
            StatusBarPanelClickEventHandler eh = (StatusBarPanelClickEventHandler)(Events [PanelClickEvent]);

            if (eh != null)
            {
                eh(this, e);
            }
        }
Exemplo n.º 6
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            int left = 0;

            for (int i = 0; i < panels.Count; i++)
            {
                if (e.X >= left && e.X < left + panels[i].Width)
                {
                    StatusBarPanelClickEventArgs args = new StatusBarPanelClickEventArgs(panels[i], e.Button, e.Clicks, e.X, e.Y);
                    OnPanelClick(args);
                }
                left += panels[i].Width + 2;
            }
            base.OnMouseUp(e);
        }
Exemplo n.º 7
0
        private void statusBar_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
        {
            string sTxt = e.StatusBarPanel.Text;

            if (sTxt.Equals("Show Log") || sTxt.Equals("Hide Log"))
            {
                txtMsg_ShowHide();
            }
            else if (sTxt.Equals("Clear Log"))
            {
                txtMsg.Clear();
                statusBrush = new SolidBrush(Color.Black);
                statusBar.Refresh();
            }
        }
Exemplo n.º 8
0
        private void Main_SBar_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (e.Clicks == 2)
                {
                    switch (e.StatusBarPanel.Text)
                    {
                    case "Program Options":
                        IsdalMainOptions_Click(sender, e);
                        break;

                    case "Finished Scanning":
                        IsdalMainRefresh_Click(sender, e);
                        break;
                    }
                }
            }
        }
Exemplo n.º 9
0
        // check if the clicked element is refresh or logout
        // Sync thread calls the startProfileSync
        public void statusBar1_PanelClick(object sender, StatusBarPanelClickEventArgs e) {

            if (e.StatusBarPanel.Name == "refresh")
            {
                if (userName == null || password == null)
                {
                    MessageBox.Show("User not loggedin");
                }
                else {

                    ProfileSyncDao profileSyncDao = new ProfileSyncDao();                  
                    Thread thread = new Thread(() => profileSyncDao.startProfileSync());                 
                    thread.Start();   
                }

               
            }

            if (e.StatusBarPanel.Name == "logout")
            {
                if (userName == null || password == null)
                {
                    MessageBox.Show("User not loggedin");
                }
                else {

                    DialogResult dialogResult = MessageBox.Show("Do you want to logout ?", "", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        logout();
                    }
                    else if (dialogResult == DialogResult.No)
                    {
                        //do something else
                    }

                   
                }
            }
        }
Exemplo n.º 10
0
        private void sbr_PanelClick(object sender, StatusBarPanelClickEventArgs e)
        {
            if ( e.Clicks!=2 )
                return;

            if ( e.StatusBarPanel == sbpDate || e.StatusBarPanel == sbpTime )
                Global.runSA("control.exe", "date/time");
            else if ( e.StatusBarPanel == sbpSpeaker )
                System.Diagnostics.Process.Start( "sndvol32.exe" );
            else if ( e.StatusBarPanel == sbpIkon )
                if ( _camera.IsConnected )
                {
                    if ( Global.askMsgBox( this, "Koppla ur?", false ) == DialogResult.Yes )
                    {
                        _camera.Disconnect();
                        displayCameraInfo( null );
                    }
                }
                else
                    initCamera();
        }
Exemplo n.º 11
0
        /// <include file='doc\StatusBar.uex' path='docs/doc[@for="StatusBar.WmNotifyNMClick"]/*' />
        /// <internalonly/>
        /// <devdoc>
        /// </devdoc>
        private void WmNotifyNMClick(NativeMethods.NMHDR note) {

            if (!showPanels) {
                return;
            }

            int size = panels.Count;
            int currentOffset = 0;
            int index = -1;
            for (int i = 0; i < size; i++) {
                StatusBarPanel panel = (StatusBarPanel) panels[i];
                currentOffset += panel.Width;
                if (lastClick.X < currentOffset) {
                    // this is where the mouse was clicked.
                    index = i;
                    break;
                }
            }
            if (index != -1) {
                MouseButtons button = MouseButtons.Left;
                int clicks = 0;
                switch (note.code) {
                    case NativeMethods.NM_CLICK:
                        button = MouseButtons.Left;
                        clicks = 1;
                        break;
                    case NativeMethods.NM_RCLICK:
                        button = MouseButtons.Right;
                        clicks = 1;
                        break;
                    case NativeMethods.NM_DBLCLK:
                        button = MouseButtons.Left;
                        clicks = 2;
                        break;
                    case NativeMethods.NM_RDBLCLK:
                        button = MouseButtons.Right;
                        clicks = 2;
                        break;
                }

                Point pt = lastClick;
                StatusBarPanel panel = (StatusBarPanel) panels[index];

                StatusBarPanelClickEventArgs sbpce = new StatusBarPanelClickEventArgs(panel,
                                                                                      button, clicks, pt.X, pt.Y);
                OnPanelClick(sbpce);
            }
        }
Exemplo n.º 12
0
 /// <include file='doc\StatusBar.uex' path='docs/doc[@for="StatusBar.OnPanelClick"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Raises the <see cref='System.Windows.Forms.StatusBar.OnPanelClick'/> event.
 ///    </para>
 /// </devdoc>
 protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e) {
     StatusBarPanelClickEventHandler handler = (StatusBarPanelClickEventHandler)Events[EVENT_PANELCLICK];
     if (handler != null) handler(this,e);
 }
Exemplo n.º 13
0
		protected virtual void OnPanelClick (StatusBarPanelClickEventArgs e) {
			StatusBarPanelClickEventHandler eh = (StatusBarPanelClickEventHandler)(Events [PanelClickEvent]);
			if (eh != null)
				eh (this, e);
		}
Exemplo n.º 14
0
 private void _statusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e)
 {
 }
Exemplo n.º 15
0
 private void statusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e)
 {
     this.statusBar.ContextMenuStrip = null;
     if (this.BoolSendGuard && ((e.StatusBarPanel.Name == "stPnlSendGuard") && (e.Button == MouseButtons.Right)))
     {
         this.statusBar.ContextMenuStrip = this.pmnSendGuardOFF;
         this.pmnSendGuardOFF.Show();
     }
 }
Exemplo n.º 16
0
 protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
 {
     throw null;
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// statusbarpanelclickeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this StatusBarPanelClickEventHandler statusbarpanelclickeventhandler, Object sender, StatusBarPanelClickEventArgs e, AsyncCallback callback)
        {
            if(statusbarpanelclickeventhandler == null) throw new ArgumentNullException("statusbarpanelclickeventhandler");

            return statusbarpanelclickeventhandler.BeginInvoke(sender, e, callback, null);
        }
Exemplo n.º 18
0
 private void OnPanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
 {
     //Event handler for status panel clicked
     this.pnlStatus.Text = this.pnlStatus.ToolTipText = "";
 }
Exemplo n.º 19
0
 private void OnPanelClick(object sender, StatusBarPanelClickEventArgs e)
 {
   if (e.StatusBarPanel == iconPanel && sender == this)
   {
     MenuCommand c = menu.TrackPopup(PointToScreen(new Point(0, -90)), false);
     if (c != null)
     {
       switch (c.Text)
       {
         case "Debug":
           MpeLog.Threshold = MpeLogLevel.Debug;
           MpeLog.Debug("Log Level set to Debug");
           break;
         case "Info":
           MpeLog.Threshold = MpeLogLevel.Info;
           MpeLog.Info("Log Level set to Info");
           break;
         case "Warn":
           MpeLog.Threshold = MpeLogLevel.Warn;
           MpeLog.Warn("Log Level set to Warn");
           break;
         case "Error":
           MpeLog.Threshold = MpeLogLevel.Error;
           MpeLog.Error("Log Level set to Error");
           break;
       }
     }
   }
 }
Exemplo n.º 20
0
		protected override void OnMouseUp(MouseEventArgs e)
		{
			int left = 0;

			for (int i=0;i < panels.Count;i++)
			{
				if (e.X >= left && e.X < left + panels[i].Width)
				{
					StatusBarPanelClickEventArgs args = new StatusBarPanelClickEventArgs(panels[i], e.Button, e.Clicks, e.X, e.Y);
					OnPanelClick(args);
				}
				left += panels[i].Width + 2;
			}
			base.OnMouseUp(e);
		}
Exemplo n.º 21
0
		protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
		{
			if (PanelClick != null)
			{
				PanelClick(this, e);
			}
		}
Exemplo n.º 22
0
 private void sb_PanelClick(object sender, StatusBarPanelClickEventArgs e)
 {
     if (e.StatusBarPanel != pnlPresence)
         return;
     mnuPresence.Show(sb, new Point(e.X, e.Y));
 }
        private void WmNotifyNMClick(System.Windows.Forms.NativeMethods.NMHDR note)
        {
            if (this.showPanels)
            {
                int count = this.panels.Count;
                int num2 = 0;
                int num3 = -1;
                for (int i = 0; i < count; i++)
                {
                    StatusBarPanel panel = (StatusBarPanel) this.panels[i];
                    num2 += panel.Width;
                    if (this.lastClick.X < num2)
                    {
                        num3 = i;
                        break;
                    }
                }
                if (num3 != -1)
                {
                    MouseButtons left = MouseButtons.Left;
                    int clicks = 0;
                    switch (note.code)
                    {
                        case -6:
                            left = MouseButtons.Right;
                            clicks = 2;
                            break;

                        case -5:
                            left = MouseButtons.Right;
                            clicks = 1;
                            break;

                        case -3:
                            left = MouseButtons.Left;
                            clicks = 2;
                            break;

                        case -2:
                            left = MouseButtons.Left;
                            clicks = 1;
                            break;
                    }
                    Point lastClick = this.lastClick;
                    StatusBarPanel statusBarPanel = (StatusBarPanel) this.panels[num3];
                    StatusBarPanelClickEventArgs e = new StatusBarPanelClickEventArgs(statusBarPanel, left, clicks, lastClick.X, lastClick.Y);
                    this.OnPanelClick(e);
                }
            }
        }
Exemplo n.º 24
0
 private void gameStatusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e)
 {
     if (e.StatusBarPanel == gameStatusErrors) {
         if(game != null && game.GameErrors.Count > 0){
             SetPauseState(true);
             try {
                 FormError.ShowError(this, game.GameErrors[game.GameErrors.Count - 1]);
             } finally {
                 SetPauseState(false);
             }
         }
     }
 }
Exemplo n.º 25
0
 private void statusBar1_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
 {
 }