private void CreateButtons() { m_ScrollUp = new ButtonItem("sysgalleryscrollup"); m_ScrollUp.Text = "<expand direction=\"top\"/>"; m_ScrollUp.Style = this.Style; m_ScrollUp.ColorTable = eButtonColor.OrangeWithBackground; m_ScrollUp.SetParent(this); m_ScrollUp.Click += new EventHandler(ScrollUp_Click); m_ScrollUp.ClickAutoRepeat = true; m_ScrollUp.ClickRepeatInterval = 200; m_ScrollUp.CanCustomize = false; m_ScrollUp.AutoCollapseOnClick = false; m_ScrollDown = new ButtonItem("sysgalleryscrolldown"); m_ScrollDown.Text = "<expand direction=\"bottom\"/>"; m_ScrollDown.Style = this.Style; m_ScrollDown.ColorTable = eButtonColor.OrangeWithBackground; m_ScrollDown.SetParent(this); m_ScrollDown.Click += new EventHandler(ScrollDown_Click); m_ScrollDown.ClickAutoRepeat = true; m_ScrollDown.ClickRepeatInterval = 200; m_ScrollDown.CanCustomize = false; m_ScrollDown.AutoCollapseOnClick = false; m_PopupGallery = new ButtonItem("sysgallerypopup"); m_PopupGallery.Text = "<expand direction=\"popup\"/>"; m_PopupGallery.ButtonStyle = eButtonStyle.TextOnlyAlways; m_PopupGallery.Style = this.Style; m_PopupGallery.ColorTable = eButtonColor.OrangeWithBackground; m_PopupGallery.SetParent(this); m_PopupGallery.Click += new EventHandler(PopupGallery_Click); m_PopupGallery.CanCustomize = false; m_PopupGallery.PopupOpen += new DotNetBarManager.PopupOpenEventHandler(PopupGallery_PopupOpen); m_PopupGallery.PopupShowing += new EventHandler(PopupGallery_PopupShowing); m_PopupGallery.PopupClose += new EventHandler(PopupGallery_PopupClose); m_PopupGallery.PopupFinalized += new EventHandler(PopupGallery_PopupFinalized); }
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; }