Esempio n. 1
0
 private void tabControl1_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
 {
     if (tabControl1.SelectedTab.Equals(ti6) || tabControl1.SelectedTab.Equals(ti12))
         linkLabel1.Enabled = false;
     else
         linkLabel1.Enabled = true;
 }
Esempio n. 2
0
 private void tabControl1_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
 {
     if (FLocked)
     {
         return;
     }
     FCurrentPreview = tabControl.SelectedTab as PreviewTab;
     if (FCurrentPreview != null && !FCurrentPreview.Fake)
     {
         Report.SetPreparedPages(FCurrentPreview.PreparedPages);
         outlineControl.PreparedPages = FCurrentPreview.PreparedPages;
         OutlineVisible = !FCurrentPreview.PreparedPages.Outline.IsEmpty;
         UpdateZoom(FCurrentPreview.Zoom);
         UpdatePageNumbers(FCurrentPreview.PageNo, FCurrentPreview.PageCount);
     }
 }
Esempio n. 3
0
 private void TabctrlFrm_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
 {
     try
     {
         foreach (Form frm in this.MdiChildren)
         {
             if (frm.IsMdiContainer != true)
             {
                 if (tabctrlFrm.SelectedTab.Text == frm.Text)
                 {
                     frm.BringToFront();
                     break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 切换分类树
 /// </summary>
 /// <param name="sender">事件发送者</param>
 /// <param name="e">事件参数</param>
 private void tabControl3_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
 {
     documentManager.SwitchClass();
 }
Esempio n. 5
0
        private void tabControl1_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
        {
            //add by cuiwei 07.8.23
            try
            {
                if (e.NewTab != null && e.NewTab.Visible)
                {
                    if (e.NewTab.Tag != null && e.NewTab.Tag is PropertyGrid)
                    {
                        LoadPageDBClass(((PropertyGrid)e.NewTab.Tag));                        
                    }
                }                
            }
            catch
            {

            }
            //add end

            // 切换TAB页
            if (e.NewTab != null && e.NewTab.Visible)
            {
                if (e.NewTab.Tag != null && e.NewTab.Tag is PropertyGrid)
                {
                    if (((PropertyGrid)e.NewTab.Tag).SelectedObject != null)
                    {
                        DBCustomClass dbClass = (DBCustomClass)(((PropertyGrid)e.NewTab.Tag).SelectedObject);
                        //传递参数 NewRecord
                        if (dbClass.ExistLuaFunction("onselecttabchanged"))
                        {
                            dbClass.CallLuaFunction("onselecttabchanged", new object[] { dbClass });
                        }
                    }
                }
            }

            // 预览相关
            // 设置活动scene
            int preview_index = this.tabControl1.SelectedTabIndex; // 1-based
            if (preview_index > 0 && m_3DEngie != null)
            {
                m_3DEngie.ActivateScene(ModelName + "[" + preview_index.ToString() + "]");
            }
            // 设置预览的preview_panels的可见性。
            if (preview_panels != null)
            {
                foreach (MyPanelEx pvp in preview_panels)
                {
                    pvp.Visible = false;
                }
                preview_panels[preview_index - 1].Visible = true;
            }
        }
Esempio n. 6
0
		private void tabControlAdNotes_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
		{
			FormAdNotes_Load(null, null);
		}
Esempio n. 7
0
 private void tabv_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
 {
     try
     {
         Gib.nowmmap = (TreeGX) (tabv.SelectedTab.AttachedControl.Controls[0]);
         nowfile.Text = Path.GetFileName(Gib.tabfile[(int)Gib.nowmmap.Tag]);
         //filestatus.Text = Gib.allsaved[(int)Gib.nowmmap.Tag] == true ? "已保存" : "已修改";
         nowfile.Refresh();
         statusbar.Refresh();
         //filestatus.Refresh();
     }
     catch
     {
         //throw;
     }
 }
Esempio n. 8
0
 private void tabControlMain_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
 {
     if (tabControlMain.SelectedTabIndex == 0)
     {
         tabControlMain.CloseButtonVisible = false;
     }
     else
     {
         tabControlMain.CloseButtonVisible = true;
     }
 }
Esempio n. 9
0
 private void TabDockItemsSelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
 {
     UpdateCloseButtonVisibility();
     OnBarStateChanged(new BarStateChangedEventArgs(this, eBarStateChange.SelectedDockTabChanged, this.SelectedDockContainerItem));
 }
Esempio n. 10
0
		internal void InternalTabsCleared()
		{
			HideToolTip();
            OnTabsCleared(new EventArgs());
			if(m_SelectedTab!=null)
			{
				if(SelectedTabChanged!=null)
				{
					TabStripTabChangedEventArgs eventData=new TabStripTabChangedEventArgs(m_SelectedTab,null,eEventSource.Code);
					SelectedTabChanged(this,eventData);
				}
				m_SelectedTab=null;
			}
		}
Esempio n. 11
0
		public void InternalOnMouseDown(MouseEventArgs e)
		{
			HideToolTip();
			if(this.HasNavigationBox && m_TabSystemBox.Visible && m_TabSystemBox.DisplayRectangle.Contains(e.X,e.Y))
			{
				m_TabSystemBox.MouseDown(e);
				return;
			}
            _MouseDownPoint = new Point(e.X, e.Y);
			if(e.Button==MouseButtons.Left)
			{
				Rectangle rSelected=this.GetSelectedTabRectangle();
				foreach(TabItem tab in m_Tabs)
				{
					if((tab.DisplayRectangle.Contains(new Point(e.X,e.Y)) || rSelected.Contains(e.X,e.Y)) && tab.Visible)
					{
						TabItem newSelected=tab;
						if(rSelected.Contains(e.X,e.Y))
							newSelected=m_SelectedTab;
                        
						if(m_SelectedTab!=newSelected)
						{
							TabItem oldTab=m_SelectedTab;
							if(SelectedTabChanging!=null)
							{
								TabStripTabChangingEventArgs eventData=new TabStripTabChangingEventArgs(m_SelectedTab,newSelected,eEventSource.Mouse);
								SelectedTabChanging(this,eventData);
								if(eventData.Cancel)
									break;
							}
							
							this.InvokeBeforeTabDisplay(newSelected);
							
							if(m_SelectedTab.AttachedItem is DockContainerItem && ((DockContainerItem)m_SelectedTab.AttachedItem).Control!=null && ((DockContainerItem)m_SelectedTab.AttachedItem).Control.Focused)
							{
								this.Focus();
							}
							if(m_SelectedTab.AttachedItem!=null)
								m_SelectedTab.AttachedItem.Displayed=false;
							else if(m_SelectedTab.AttachedControl!=null && !m_MdiTabbedDocuments)
							{
								//if(!(this.IsDesignMode && m_SelectedTab.AttachedControl is TabControlPanel))
									m_SelectedTab.AttachedControl.Visible=false;
							}
							m_SelectedTab=newSelected;
							m_NeedRecalcSize=true;
							EnsureVisible(m_SelectedTab);
							if(m_SelectedTab.AttachedItem!=null)
							{
								m_SelectedTab.AttachedItem.Displayed=true;
								if(m_SelectedTab.AttachedItem is DockContainerItem && ((DockContainerItem)m_SelectedTab.AttachedItem).Control!=null)
								{
                                    if(m_AutoSelectAttachedControl)
									    ((DockContainerItem)m_SelectedTab.AttachedItem).Control.Select();
								}
							}
							else if(m_SelectedTab.AttachedControl!=null)
							{
								if(!m_MdiTabbedDocuments)
								{
									//if(!(this.IsDesignMode && m_SelectedTab.AttachedControl is TabControlPanel))
										m_SelectedTab.AttachedControl.Visible=true;
                                    if (m_AutoSelectAttachedControl)
										m_SelectedTab.AttachedControl.Select();

								}
								else if(m_SelectedTab.AttachedControl is Form)
								{
									MdiClient client=this.GetMdiClient(m_MdiForm);
									bool bSetRedraw=false;
									Form oldActive=m_MdiForm.ActiveMdiChild;

									if(client!=null && m_MdiNoFormActivateFlicker && m_SelectedTab.AttachedControl is Form && (((Form)m_SelectedTab.AttachedControl).WindowState==FormWindowState.Maximized || oldActive!=null && oldActive.WindowState==FormWindowState.Maximized))
									{
										NativeFunctions.SendMessage(client.Handle,NativeFunctions.WM_SETREDRAW,0,0);
										bSetRedraw=true;
									}

									((Form)m_SelectedTab.AttachedControl).Activate();
									//if(m_TabSystemBox!=null)
									//	m_TabSystemBox.CloseVisible=((Form)m_SelectedTab.AttachedControl).ControlBox;

									if(bSetRedraw)
									{
										NativeFunctions.SendMessage(client.Handle,NativeFunctions.WM_SETREDRAW,1,0);
										client.Refresh();
									}

									if(oldActive!=null && oldActive.WindowState==FormWindowState.Normal)
									{
										if(BarFunctions.ThemedOS)
										{
											// This will force repaint of Title bar since there were some repainting issues with it...
                                            string s = oldActive.Text; // GetFormText(oldActive);
											oldActive.Text=s+" ";
											oldActive.Text=s;
										}
									}
								}
							}

							this.Invalidate();

							if(SelectedTabChanged!=null)
							{
								TabStripTabChangedEventArgs eventData=new TabStripTabChangedEventArgs(oldTab,m_SelectedTab,eEventSource.Mouse);
								SelectedTabChanged(this,eventData);
							}
						}
                        else if (m_SelectedTab != null && m_SelectedTab.AttachedItem is DockContainerItem && m_SelectedTab.AttachedItem.ContainerControl is Bar && ((Bar)m_SelectedTab.AttachedItem.ContainerControl).DockSide == eDockSide.Document &&
                            ((DockContainerItem)m_SelectedTab.AttachedItem).Control != null)
                        {
                            if (m_AutoSelectAttachedControl)
                                ((DockContainerItem)m_SelectedTab.AttachedItem).Control.Select();
                        }
                        
						break;
					}
				}
			}

            // Invoke TabItem events.
            TabItem tabAt = HitTest(e.X, e.Y);
            if (tabAt != null)
            {
                tabAt.InvokeMouseDown(e);
            }
		}
Esempio n. 12
0
		private void SelectTab(TabItem value, eEventSource eventSource)
		{
			if(m_SelectedTab==value)
				return;
			TabItem oldTab=m_SelectedTab;

			if(SelectedTabChanging!=null)
			{
                TabStripTabChangingEventArgs eventData = new TabStripTabChangingEventArgs(m_SelectedTab, value, eventSource);
				SelectedTabChanging(this,eventData);
				if(eventData.Cancel)
					return;
			}

			InvokeBeforeTabDisplay(value);

			Control hideControl=null;

			if(m_SelectedTab!=null && m_SelectedTab.AttachedItem!=null)
				m_SelectedTab.AttachedItem.Displayed=false;
			else if(m_SelectedTab!=null && m_SelectedTab.AttachedControl!=null)
			{
				if(!m_MdiTabbedDocuments)
					hideControl=m_SelectedTab.AttachedControl;
			}
					
			m_SelectedTab=value;
			m_NeedRecalcSize=true;

			EnsureVisible(m_SelectedTab);

			if(m_SelectedTab!=null && m_SelectedTab.AttachedItem!=null)
			{
				m_SelectedTab.AttachedItem.Displayed=true;
				if(m_SelectedTab.AttachedItem is DockContainerItem && ((DockContainerItem)m_SelectedTab.AttachedItem).Control!=null)
				{
                    if(m_AutoSelectAttachedControl)
					    ((DockContainerItem)m_SelectedTab.AttachedItem).Control.Select();
				}
			}
			else if(m_SelectedTab!=null && m_SelectedTab.AttachedControl!=null)
			{
				if(!m_MdiTabbedDocuments)
				{
					//if(!(this.IsDesignMode && m_SelectedTab.AttachedControl is TabControlPanel))
						m_SelectedTab.AttachedControl.Visible=true;
                        if (m_AutoSelectAttachedControl && !(this.TabStop && this.Parent is TabControl && this.Focused && eventSource == eEventSource.Keyboard))
                            m_SelectedTab.AttachedControl.Select();
					if(hideControl==m_SelectedTab.AttachedControl)
						hideControl=null;
				}
				else if(m_SelectedTab.AttachedControl is Form)
				{
					MdiClient client=this.GetMdiClient(m_MdiForm);
					bool bSetRedraw=false;
					Form oldActive=m_MdiForm.ActiveMdiChild;

					if(client!=null && m_MdiNoFormActivateFlicker && m_SelectedTab.AttachedControl is Form && (((Form)m_SelectedTab.AttachedControl).WindowState==FormWindowState.Maximized || oldActive!=null && oldActive.WindowState==FormWindowState.Maximized))
					{
						NativeFunctions.SendMessage(client.Handle,NativeFunctions.WM_SETREDRAW,0,0);
						bSetRedraw=true;
					}

					((Form)m_SelectedTab.AttachedControl).Activate();
					//if(m_TabSystemBox!=null)
					//	m_TabSystemBox.CloseVisible=((Form)m_SelectedTab.AttachedControl).ControlBox;

					if(bSetRedraw)
					{
						NativeFunctions.SendMessage(client.Handle,NativeFunctions.WM_SETREDRAW,1,0);
						client.Refresh();
					}

					if(oldActive!=null && oldActive.WindowState==FormWindowState.Normal)
					{
						if(BarFunctions.ThemedOS)
						{
							// This will force repaint of Title bar since there were some repainting issues with it...
                            string s = oldActive.Text; // GetFormText(oldActive);
							oldActive.Text=s+" ";
							oldActive.Text=s;
						}
					}
				}
			}
			if(hideControl!=null)
			{
				//if(!(this.IsDesignMode && hideControl is TabControlPanel))
					hideControl.Visible=false;
			}
			this.Invalidate();
			
			if(SelectedTabChanged!=null)
			{
                TabStripTabChangedEventArgs eventData = new TabStripTabChangedEventArgs(oldTab, m_SelectedTab, eventSource);
				SelectedTabChanged(this,eventData);
			}
		}