/// <summary> /// Called when item container has changed. If you override this method you must call the base implementation to allow default processing to occur. /// </summary> /// <param name="objOldContainer">Previous container of the item.</param> protected internal override void OnContainerChanged(object objOldContainer) { base.OnContainerChanged(objOldContainer); if(!m_Localized) { m_Localized=true; using(LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { m_Tooltip=lm.GetLocalizedString(LocalizationKeys.OverlfowDisplayMoreTooltip); } } }
/// <summary> /// Loads the resources (text) used by this item. /// </summary> protected virtual void LoadResources() { if(!m_Localized) { if(this.GetOwner()!=null) m_Localized=true; using(LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { m_ThisToolTip=lm.GetLocalizedString(LocalizationKeys.CustomizeItemTooltip); this.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeItemAddRemove); m_CustomizeStr = lm.GetLocalizedString(LocalizationKeys.CustomizeItemCustomize); m_ResetStr=lm.GetLocalizedString(LocalizationKeys.CustomizeItemReset); } } }
/// <summary> /// Create new instance of DisplayMoreItem object. /// </summary> public DisplayMoreItem() { this.GlobalItem=false; m_MouseOver=false; m_PopupSubItemsOnMenu=false; m_Tooltip="More Buttons"; m_SystemItem=true; this.CanCustomize=false; m_ShouldSerialize=false; // Localization loading will repeat in OnContainerChanged becouse at this time // DotNetBarManager owner is not known and LocalizeString event cannot be invoked using(LocalizationManager lm=new LocalizationManager(null)) { m_Tooltip=lm.GetLocalizedString(LocalizationKeys.OverlfowDisplayMoreTooltip); } }
public frmCustomize(DotNetBarManager ctrl) { // // Required for Windows Form Designer support // InitializeComponent(); m_DotNetBar=ctrl; this.StartPosition=FormStartPosition.CenterScreen; m_ItemDrag=false; try { m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR"); m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR"); m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR"); } catch(Exception) { m_MoveCursor=null; m_CopyCursor=null; m_NACursor=null; } m_DesignTimeProvider=null; m_DragCopy=false; m_EditItem=null; // Load localized strings... using(LocalizationManager lm=new LocalizationManager(m_DotNetBar)) { this.cmdNew.Text=lm.GetLocalizedString(this.cmdNew.Text); this.tabPage1.Text=lm.GetLocalizedString(this.tabPage1.Text); this.cmdReset.Text=lm.GetLocalizedString(this.cmdReset.Text); this.cmdRename.Text=lm.GetLocalizedString(this.cmdRename.Text); this.cmdDelete.Text=lm.GetLocalizedString(this.cmdDelete.Text); this.label1.Text=lm.GetLocalizedString(this.label1.Text); this.tabPage2.Text=lm.GetLocalizedString(this.tabPage2.Text); this.label4.Text=lm.GetLocalizedString(this.label4.Text); this.label3.Text=lm.GetLocalizedString(this.label3.Text); this.label2.Text=lm.GetLocalizedString(this.label2.Text); this.tabPage3.Text=lm.GetLocalizedString(this.tabPage3.Text); this.cmdKeyboard.Text=lm.GetLocalizedString(this.cmdKeyboard.Text); this.cmdClose.Text=lm.GetLocalizedString(this.cmdClose.Text); this.label5.Text=lm.GetLocalizedString(this.label5.Text); this.chkShowFullMenus.Text=lm.GetLocalizedString(this.chkShowFullMenus.Text); this.chkFullAfterDelay.Text=lm.GetLocalizedString(this.chkFullAfterDelay.Text); this.label6.Text=lm.GetLocalizedString(this.label6.Text); this.button1.Text=lm.GetLocalizedString(this.button1.Text); this.chkShowScreenTips.Text=lm.GetLocalizedString(this.chkShowScreenTips.Text); this.chkTipsShowShortcuts.Text=lm.GetLocalizedString(this.chkTipsShowShortcuts.Text); this.label7.Text=lm.GetLocalizedString(this.label7.Text); this.comboItem1.Text=lm.GetLocalizedString(this.comboItem1.Text); this.comboItem2.Text=lm.GetLocalizedString(this.comboItem2.Text); this.comboItem3.Text=lm.GetLocalizedString(this.comboItem3.Text); this.comboItem4.Text=lm.GetLocalizedString(this.comboItem4.Text); this.comboItem5.Text=lm.GetLocalizedString(this.comboItem5.Text); this.comboItem6.Text=lm.GetLocalizedString(this.comboItem6.Text); this.Text=lm.GetLocalizedString(this.Text); } this.cmdReset.Visible=m_DotNetBar.ShowResetButton; //If we don't run on XP use Flat Style Buttons // W2K and gang // if(Environment.OSVersion.Version.Major==5 && Environment.OSVersion.Version.Minor<1 || Environment.OSVersion.Version.Major<5) // { // this.cmdReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.cmdRename.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.cmdDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.cmdNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.cmdKeyboard.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // this.cmdClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; // } cmdKeyboard.Visible=false; this.KeyPreview=true; if(!BarFunctions.SupportsAnimation) { cboAnimations.Visible=false; this.label7.Visible=false; } lstCommands.Style=m_DotNetBar.Style; }
private void LocalizeDialog(ColorPickerItem.CustomColorDialogMetro d) { if (this.GetOwner() != null) m_Localized = true; using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { string s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogOKButton); if (s != "") d.buttonOK.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogCancelButton); if (s != "") d.buttonCancel.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogNewColorLabel); if (s != "") d.labelNewColor.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogCurrentColorLabel); if (s != "") d.labelCurrentColor.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogStandardColorsLabel); if (s != "") d.labelStandardColors.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogCustomColorsLabel); if (s != "") d.labelCustomColors.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogGreenLabel); if (s != "") d.labelGreen.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogBlueLabel); if (s != "") d.labelBlue.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogRedLabel); if (s != "") d.labelRed.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerTabStandard); if (s != "") d.tabItemStandard.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerTabCustom); if (s != "") d.tabItemCustom.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerCaption); if (s != "") d.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogColorModelLabel); if (s != "") d.labelColorModel.Text = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerDialogRgbLabel); if (s != "") d.comboColorModel.Items[0] = s; } }
private void DeleteBar(object sender, System.EventArgs e) { if(lstBars.SelectedIndex<0) return; Bar bar=lstBars.SelectedItem as Bar; if(bar==null || !bar.CustomBar) return; using(LocalizationManager lm=new LocalizationManager(m_DotNetBar)) { if(MessageBox.Show(lm.GetLocalizedString(LocalizationKeys.CustomizeDialogOptionsConfirmDelete).Replace("<barname>","'"+bar.Text+"'"),this.Text,MessageBoxButtons.YesNo)==DialogResult.Yes) { lstBars.Items.Remove(bar); m_DotNetBar.Bars.Remove(bar); ((IOwner)m_DotNetBar).InvokeUserCustomize(bar,new EventArgs()); ((IOwner)m_DotNetBar).InvokeEndUserCustomize(bar,new EndUserCustomizeEventArgs(eEndUserCustomizeAction.BarDeleted)); bar.Dispose(); } } }
public void DesignTimeContextMenu(BaseItem objItem) { using(LocalizationManager lm=new LocalizationManager(m_DotNetBar)) { ButtonItem btn; m_EditItem=objItem; if(m_PopupMenu!=null) m_PopupMenu.Dispose(); m_PopupMenu=new ButtonItem("syscustomizepopupmenu"); m_PopupMenu.Style=objItem.Style; btn=new ButtonItem("reset"); btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuReset); btn.Click+=new EventHandler(this.ResetItemClick); m_PopupMenu.SubItems.Add(btn); btn=new ButtonItem("delete"); btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuDelete); btn.Click+=new System.EventHandler(this.DeleteClick); m_PopupMenu.SubItems.Add(btn); TextBoxItem tx=new TextBoxItem("name"); tx.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuChangeName); tx.BeginGroup=true; tx.ControlText=objItem.Text; tx.LostFocus+=new System.EventHandler(this.ItemNameLostFocus); m_PopupMenu.SubItems.Add(tx); if(m_EditItem is ButtonItem) { ButtonItem objButton=m_EditItem as ButtonItem; btn=new ButtonItem("defaultstyle"); btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuDefaultStyle); btn.BeginGroup=true; btn.Click+=new System.EventHandler(this.ButtonStyleClick); if(objButton.ButtonStyle==eButtonStyle.Default) btn.Checked=true; m_PopupMenu.SubItems.Add(btn); btn=new ButtonItem("textonly"); btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuTextOnly); btn.Click+=new System.EventHandler(this.ButtonStyleClick); if(objButton.ButtonStyle==eButtonStyle.TextOnlyAlways) btn.Checked=true; m_PopupMenu.SubItems.Add(btn); btn=new ButtonItem("imageandtext"); btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuImageAndText); btn.Click+=new System.EventHandler(this.ButtonStyleClick); if(objButton.ButtonStyle==eButtonStyle.ImageAndText) btn.Checked=true; m_PopupMenu.SubItems.Add(btn); } btn=new ButtonItem("begingroup"); btn.BeginGroup=true; btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuBeginGroup); btn.Checked=m_EditItem.BeginGroup; btn.Click+=new System.EventHandler(this.BeginGroupClick); m_PopupMenu.SubItems.Add(btn); m_DotNetBar.OnCustomizeContextMenu(this,m_PopupMenu); //m_DotNetBar.RegisterPopup(m_PopupMenu); m_PopupMenu.SetOwner(m_DotNetBar); m_PopupMenu.PopupMenu(Control.MousePosition); } }
private string GetMinuteText() { using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { string s = lm.GetLocalizedString(LocalizationKeys.TimeSelectorMinuteLabel); if (s != "") return s; } return _MinuteText; }
private void NewBar(object sender, System.EventArgs e) { ToolbarName nt=new ToolbarName(); nt.txtName.Text="Custom Bar"; using(LocalizationManager lm=new LocalizationManager(m_DotNetBar)) { nt.txtName.Text=lm.GetLocalizedString("sys_custombar"); } nt.StartPosition=FormStartPosition.CenterParent; if(nt.ShowDialog(this)==DialogResult.OK) { Bar bar=new Bar(nt.txtName.Text); bar.CustomBar=true; bar.CanHide=true; bar.SetDesignMode(true); bar.GrabHandleStyle=eGrabHandleStyle.StripeFlat; string name="userBar"; int i=0; while(m_DotNetBar.Bars.Contains(name+i.ToString())) i++; bar.Name=name+i.ToString(); m_DotNetBar.Bars.Add(bar); bar.DockSide=eDockSide.None; lstBars.Items.Add(bar,CheckState.Checked); if(m_DotNetBar.AllowUserBarCustomize) bar.Items.Add(new CustomizeItem()); ((IOwner)m_DotNetBar).InvokeUserCustomize(bar,new EventArgs()); ((IOwner)m_DotNetBar).InvokeEndUserCustomize(bar,new EndUserCustomizeEventArgs(eEndUserCustomizeAction.NewBarCreated)); } nt.Close(); nt.Dispose(); }
private void OnLoad(object sender, System.EventArgs e) { // Load localized strings... DotNetBarManager manager=null; if(this.Owner is frmCustomize) manager=((frmCustomize)this.Owner).GetDotNetBarManager(); using(LocalizationManager lm=new LocalizationManager(manager)) { foreach(Control ctrl in this.Controls) { if(ctrl is TextBox) continue; ctrl.Text=lm.GetLocalizedString(ctrl.Text); } if(this.RenameDialog) this.Text=lm.GetLocalizedString(LocalizationKeys.RenameBarDialogCaption); else this.Text=lm.GetLocalizedString(this.Text); } manager=null; }
protected override void OnTooltip(bool bShow) { base.OnTooltip(bShow); if(!bShow || this.IsSystemIcon) return; Point p=System.Windows.Forms.Control.MousePosition; System.Windows.Forms.Control ctrl=this.ContainerControl as System.Windows.Forms.Control; if(ctrl!=null) p=ctrl.PointToClient(p); SystemButton btn=this.GetButton(p.X,p.Y); using(LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { if(btn==SystemButton.Minimize) { this.Tooltip=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMinimizeTooltip); //"Minimize"; } else if(btn==SystemButton.Restore) { this.Tooltip=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemRestoreTooltip); //"Restore Down"; } else if (btn == SystemButton.Maximize) { this.Tooltip = lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuMaximize); } else if(btn==SystemButton.Close) { this.Tooltip=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemCloseTooltip); //"Close"; } else this.Tooltip=""; } }
private string GetClearButtonText() { string s = ""; using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) s = lm.GetLocalizedString(LocalizationKeys.MonthCalendarClearButtonText); if (s == "") s = "Clear"; return s; }
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(); }
internal void InternalMouseHover() { if (!m_MoveWindow) { if (Control.MouseButtons == MouseButtons.Left) { Point pClient = this.PointToClient(Control.MousePosition); if (!this.ClientRectangle.Contains(pClient)) { IOwnerMenuSupport menu = this.Owner as IOwnerMenuSupport; if (menu != null) { if (menu.RelayMouseHover()) return; } } } m_ItemContainer.InternalMouseHover(); if (m_SystemButtons.MouseOverAutoHide) { using (LocalizationManager lm = new LocalizationManager(m_Owner as IOwnerLocalize)) { string tip = lm.GetLocalizedString(LocalizationKeys.BarAutoHideButtonTooltip); if (tip != "") ShowToolTip(tip); } } else if (m_SystemButtons.MouseOverCustomize) { using (LocalizationManager lm = new LocalizationManager(m_Owner as IOwnerLocalize)) { string tip = lm.GetLocalizedString(LocalizationKeys.BarCustomizeButtonTooltip); if (tip != "") ShowToolTip(tip); } } else if (m_SystemButtons.MouseOverClose) { using (LocalizationManager lm = new LocalizationManager(m_Owner as IOwnerLocalize)) { string tip = lm.GetLocalizedString(LocalizationKeys.BarCloseButtonTooltip); if (tip != "") ShowToolTip(tip); } } } }
void IOwnerBarSupport.BarContextMenu(Control bar, MouseEventArgs e) { if(!ShowCustomizeContextMenu || m_frmCustomize!=null || this.DesignMode) return; // Create popup menu that lets users hide/show bars... m_ContextMenu=new ButtonItem("sys_customizecontextnmenu"); ButtonItem btn; eDotNetBarStyle style=eDotNetBarStyle.OfficeXP; if(m_Bars.Count>0) style=m_Bars[0].Style; m_ContextMenu.Style=style; foreach(Bar b in m_Bars) { if (b.LayoutType == eLayoutType.DockContainer && b.Items.Count == 0) continue; // TODO: Menu Merge implementation //if(b.CanHide && (!m_ParentForm.IsMdiChild || !b.MergeEnabled )) if(b.CanHide && (b.LayoutType==eLayoutType.DockContainer && b.CanCustomize || b.LayoutType!=eLayoutType.DockContainer) && b.Text!="") { btn=new ButtonItem(); btn.Text=b.Text; btn.Checked=b.Visible || b.AutoHide; btn.SetSystemItem(true); btn.Tag=b; btn.Click+=new System.EventHandler(this.CustomizeItemClick); m_ContextMenu.SubItems.Add(btn); } } btn=new ButtonItem("customize"); if(m_ContextMenu.SubItems.Count>0) btn.BeginGroup=true; using(LocalizationManager lm=new LocalizationManager(this)) { btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeItemCustomize); } btn.SetSystemItem(true); btn.Style=style; btn.Click+=new System.EventHandler(this.CustomizeItemClick); m_ContextMenu.SubItems.Add(btn); OnCustomizeContextMenu(this, (ButtonItem)m_ContextMenu); this.RegisterPopup(m_ContextMenu); m_ContextMenu.PopupMenu(bar.PointToScreen(new Point(e.X,e.Y))); }
private void CreateSystemMenu() { using(LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { this.SubItems.Clear(); this.PopupType=ePopupType.Menu; ButtonItem btn=new ButtonItem("dotnetbarsysmenurestore"); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuRestore); //"Restore"; btn.Image=GetSysImage(SystemButton.Restore); btn.Click+=new System.EventHandler(this.MenuClick); btn.Enabled=m_RestoreEnabled; this.SubItems.Add(btn); btn=new ButtonItem(); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuMove); //"Move"; btn.Enabled=false; this.SubItems.Add(btn); btn=new ButtonItem(); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuSize); //"Size"; btn.Enabled=false; this.SubItems.Add(btn); btn=new ButtonItem("dotnetbarsysmenuminimize"); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuMinimize); //"Minimize"; btn.Image=GetSysImage(SystemButton.Minimize); btn.Click+=new System.EventHandler(this.MenuClick); btn.Enabled=m_MinimizeEnabled; this.SubItems.Add(btn); btn=new ButtonItem(); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuMaximize); //"Maximize"; btn.Image=GetSysImage(SystemButton.Maximize); btn.Enabled=false; this.SubItems.Add(btn); btn=new ButtonItem("dotnetbarsysmenuclose"); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuClose); //"Close"; btn.Image=GetSysImage(SystemButton.Close); btn.BeginGroup=true; btn.Click+=new System.EventHandler(this.MenuClick); btn.Shortcuts.Add(eShortcut.CtrlF4); btn.Enabled=m_CloseEnabled; this.SubItems.Add(btn); btn=new ButtonItem("dotnetbarsysmenunext"); btn.GlobalItem = false; btn.Text=lm.GetLocalizedString(LocalizationKeys.MdiSystemItemMenuNext); //"Next"; btn.BeginGroup=true; btn.Shortcuts.Add(eShortcut.CtrlF6); btn.Click+=new System.EventHandler(this.MenuClick); this.SubItems.Add(btn); } }
private void LoadResources() { if (!m_Localized) { if (this.GetOwner() != null) m_Localized = true; using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { string s = lm.GetLocalizedString(LocalizationKeys.ColorPickerThemeColorsLabel); if (s != "") m_ThemeColorsLabel = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerStandardColorsLabel); if (s != "") m_StandardColorsLabel = s; s = lm.GetLocalizedString(LocalizationKeys.ColorPickerMoreColorsMenuItem); if (s != "") m_MoreColorsLabel = s; } } }
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; }
/// <summary> /// Gets localized tooltip text for this instance of the item. /// </summary> /// <returns>Tooltip text.</returns> protected override string GetTooltipText() { string s = ""; using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) s = lm.GetLocalizedString(LocalizationKeys.QatCustomizeTooltip); if (s == "") s = this.Tooltip; return s; }
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 OnOK(object sender, System.ComponentModel.CancelEventArgs e) { if(txtName.Text.Trim()=="") { DotNetBarManager manager=null; if(this.Owner is frmCustomize) manager=((frmCustomize)this.Owner).GetDotNetBarManager(); using(LocalizationManager lm=new LocalizationManager(manager)) { MessageBox.Show(lm.GetLocalizedString(LocalizationKeys.BarEditDialogInvalidNameMessage)); } manager=null; e.Cancel=true; } }
private string GetClearText() { using (LocalizationManager lm = new LocalizationManager(this.GetOwner() as IOwnerLocalize)) { string s = lm.GetLocalizedString(LocalizationKeys.TimeSelectorClearButton); if (s != "") return s; } return _ClearText; }