private void OnNavPaneOptionsClick(object sender, EventArgs e) { BaseItem.CollapseAll(sender as BaseItem); NavPaneOptions options=new NavPaneOptions(); LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize); if (lm != null) { string s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogCancel); if (s != "") options.cmdCancel.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogMoveDown); if (s != "") options.cmdMoveDown.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogMoveUp); if (s != "") options.cmdMoveUp.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogOK); if (s != "") options.cmdOK.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogReset); if (s != "") options.cmdReset.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogTitle); if (s != "") options.Text = s; s = lm.GetDefaultLocalizedString(LocalizationKeys.NavBarDialogListLabel); if (s != "") options.labelListCaption.Text = s; } options.StartPosition=System.Windows.Forms.FormStartPosition.CenterScreen; options.NavBarContainer=this; System.Windows.Forms.DialogResult result=options.ShowDialog(); options.Dispose(); if(result==System.Windows.Forms.DialogResult.OK) { if(this.ContainerControl is BarBaseControl) ((BarBaseControl)this.ContainerControl).RecalcLayout(); } }
private void UpdateExpandButton() { LocalizationManager lm=new LocalizationManager(navBar as IOwnerLocalize); if (m_Expanded) { if (panelTitle.ButtonAlignment == eTitleButtonAlignment.Right || m_TitleImageCollapse!=null) { panelTitle.ExpandChangeButton.Image = GetCollapseImage(false); panelTitle.ExpandChangeButton.HoverImage = GetCollapseImage(true); } else { panelTitle.ExpandChangeButton.Image = GetExpandImage(false); panelTitle.ExpandChangeButton.HoverImage = GetExpandImage(true); } panelTitle.ExpandChangeButton.Tooltip = lm.GetDefaultLocalizedString(LocalizationKeys.NavPaneCollapseButtonTooltip); } else { if (panelTitle.ButtonAlignment == eTitleButtonAlignment.Right || m_TitleImageExpand != null) { panelTitle.ExpandChangeButton.Image = GetExpandImage(false); panelTitle.ExpandChangeButton.HoverImage = GetExpandImage(true); } else { panelTitle.ExpandChangeButton.Image = GetCollapseImage(false); panelTitle.ExpandChangeButton.HoverImage = GetCollapseImage(true); } panelTitle.ExpandChangeButton.Tooltip = lm.GetDefaultLocalizedString(LocalizationKeys.NavPaneExpandButtonTooltip); } panelTitle.UpdateButtonPosition(); }
private void CreateConfigureButton(int y, int height) { if(!m_ConfigureItemVisible) return; if(m_ConfigureItem==null) { LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize); m_ConfigureItem=new ButtonItem(); m_ConfigureItem.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarConfigure.png"); m_ConfigureItem.ImageFixedSize = m_ConfigureItem.Image.Size; m_ConfigureItem.Style=m_Style; m_ConfigureItem.ShowSubItems=false; m_ConfigureItem.SetSystemItem(true); m_ConfigureItem.ContainerState = eContainerState.NavigationPane; // Add Sub-Items ButtonItem item; if(m_ConfigureShowHideVisible) { item=new ButtonItem("sysShowMoreButtons"); item.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarShowMore.png"); item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarShowMoreButtons); item.SetSystemItem(true); item.Click+=new EventHandler(this.OnShowMoreButtonsClick); m_ConfigureItem.SubItems.Add(item); item=new ButtonItem("sysShowFewerButtons"); item.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarShowLess.png"); item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarShowFewerButtons); item.SetSystemItem(true); item.Click+=new EventHandler(this.OnShowFewerButtonsClick); m_ConfigureItem.SubItems.Add(item); } if(m_ConfigureNavOptionsVisible) { item=new ButtonItem("sysNavPaneOptions"); item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarOptions); item.Click+=new EventHandler(this.OnNavPaneOptionsClick); item.SetSystemItem(true); m_ConfigureItem.SubItems.Add(item); } if(m_ConfigureAddRemoveVisible) { CustomizeItem customize=new CustomizeItem(); customize.Name="sysNavPaneAddRemove"; customize.CustomizeItemVisible=false; m_ConfigureItem.SubItems.Add(customize); } m_ConfigureItem.SetParent(this); m_ConfigureItem.Click+=new EventHandler(this.ConfigureItemClick); m_ConfigureItem.ExpandChange+=new EventHandler(this.ConfigureExpandedChanged); m_ConfigureItem.PopupShowing+=new EventHandler(this.ConfigurePopupShowing); m_ConfigureItem.PopupSide=ePopupSide.Right; lm.Dispose(); BarBaseControl ctrl=this.ContainerControl as BarBaseControl; if(ctrl!=null && ctrl.Font!=null) m_ConfigureItem.PopupFont=new Font(ctrl.Font,FontStyle.Regular); else m_ConfigureItem.PopupFont = SystemFonts.MenuFont; } m_ConfigureItem.PopupType=ePopupType.Menu; m_ConfigureItem.Displayed=true; m_ConfigureItem.HeightInternal = height; m_ConfigureItem.RecalcSize(); m_ConfigureItem.LeftInternal=m_Rect.Right-m_ConfigureItem.WidthInternal; m_ConfigureItem.TopInternal=y; m_ConfigureItem.HeightInternal=height; }