public VistaMenuItemClickArgs( VistaMenuItem item ) : base() { i = item; }
protected override void OnSetComplete(int index, object oldValue, object newValue) { VistaMenuItem btn = (VistaMenuItem)newValue; btn.Owner = this.owner; owner.CalcMenuSize(); base.OnSetComplete(index, oldValue, newValue); }
protected override void OnInsertComplete(int index, object value) { VistaMenuItem btn = (VistaMenuItem)value; btn.Owner = this.owner; owner.CalcMenuSize(); base.OnInsertComplete(index, value); }
public VistaMenuItem Add( string sText ) { VistaMenuItem aclb = new VistaMenuItem(owner); aclb.Text = sText; InnerList.Add(aclb); owner.CalcMenuSize(); return aclb; }
public VistaMenuItem Add( string sText ) { VistaMenuItem aclb = new VistaMenuItem(owner); aclb.Text = sText; InnerList.Add(aclb); owner.CalcMenuSize(); return(aclb); }
public VistaMenuItem Add( string sText, string sDescription ) { VistaMenuItem aclb = new VistaMenuItem(owner); aclb.Text = sText; aclb.Description = sDescription; InnerList.Add(aclb); owner.CalcMenuSize(); return aclb; }
public VistaMenuItem Add( string sText, string sDescription ) { VistaMenuItem aclb = new VistaMenuItem(owner); aclb.Text = sText; aclb.Description = sDescription; InnerList.Add(aclb); owner.CalcMenuSize(); return(aclb); }
public VistaMenuItem Add( string sText, Image img ) { VistaMenuItem btn = new VistaMenuItem(owner); btn.Text = sText; btn.Image = img; InnerList.Add(btn); owner.CalcMenuSize(); return(btn); }
/// <summary> /// Hittest function used when sidebar is rendered. /// </summary> /// <param name="x"> Mouse x coordinate</param> /// <param name="y"> Mouse y coordinate</param> /// <returns></returns> private int HitTestItem( int x, int y ) { int code = -1; VistaMenuItem item = null; if ((x > m_lBarWidth) && (x <= this.ClientRectangle.Width)) { if ((y >= 2) && (y <= this.ClientRectangle.Height)) { for (int idx = 0; idx < items.Count; idx++) { item = items[idx]; if (y >= item.Top) { if (y < item.Top + m_lItemHeight) { code = idx; break; } } } } } if (code == -1) { // cursor inside side bar: for (int i = 0; i < items.Count; i++) { // unhover any hovering item: items[i].Hovering = false; Cursor = Cursors.Default; Invalidate(); } } return(code); }
public VistaMenuItem Add( string sText, string sDescription, Image img ) { VistaMenuItem btn = new VistaMenuItem(owner); btn.Text = sText; btn.Description = sDescription; btn.Image = img; InnerList.Add(btn); owner.CalcMenuSize(); return btn; }
public void Add(VistaMenuItem btn) { List.Add(btn); btn.Owner = this.owner; owner.CalcMenuSize(); }
private void SetCurrentSettingPage(VistaMenuItem menuItem) { if (_settingPagesMapping == null) throw new ArgumentNullException("not initialized"); foreach (KeyValuePair<VistaMenuItem, Control> pageSettingMap in _settingPagesMapping) { bool selected = pageSettingMap.Key == menuItem; //Меняем высоту в соотв с содержимым if (pageSettingMap.Key == menuItem) { CtrlListItemContainer container = pageSettingMap.Value as CtrlListItemContainer; if (container != null) { int newHeight = Math.Max(this.panel3.Height + container.ItemsHeight, _minHeight); int delta = newHeight - this.panel1.Height; this.Height += delta; } } pageSettingMap.Value.Visible = selected; } }
private VistaMenuItem CreateSettingMenuItem(eMenuSettings_Icon settingImgIndex) { VistaMenuItem retVal = new VistaMenuItem(_vistaMenuCtrl); retVal.SelectionStartColor = Color.FromArgb(152, 193, 233); retVal.SelectionEndColor = Color.FromArgb(134, 186, 237); retVal.SelectionStartColorStart = Color.FromArgb(104, 169, 234); retVal.SelectionEndColorEnd = Color.FromArgb(169, 232, 255); retVal.CheckedStartColor = Color.FromArgb(152, 193, 233); retVal.CheckedEndColor = Color.FromArgb(134, 186, 237); retVal.CheckedStartColorStart = Color.FromArgb(104, 169, 234); retVal.CheckedEndColorEnd = Color.FromArgb(169, 232, 255); retVal.InnerBorder = Color.FromArgb(254, 254, 254); retVal.OuterBorder = Color.FromArgb(231, 231, 231); retVal.CaptionFont = new Font("Tahoma", 10, FontStyle.Bold); retVal.ContentFont = new Font("Tahoma", 7); retVal.CaptionColor = Color.Black; retVal.ContentColor = Color.Black; retVal.Image = this.imageList48.Images[(int)settingImgIndex]; retVal.ItemTag = settingImgIndex; return retVal; }
private CtrlListItemContainer CreateSettingCtrlPage(VistaMenuItem menuItem) { CtrlListItemContainer retVal = new CtrlListItemContainer(); switch ((eMenuSettings_Icon)menuItem.ItemTag) { case eMenuSettings_Icon.Connection: CtrlSyncConnection ctrSettingConnection = new CtrlSyncConnection(imageList32); ctrSettingConnection.Header.Caption = Resources.FormSetting_Connection_Caption; retVal.AddItem(ctrSettingConnection); break; case eMenuSettings_Icon.SyncItems: foreach (Outlook.OlItemType itemType in AvailSettingTypes) { CtrlExtendedListItemBase listItem = CreateSyncItemSetting(itemType); if (listItem != null) { retVal.AddItem(listItem); retVal.SelectedItem = listItem; } } break; } if (retVal != null) { if (_settingPagesMapping == null) { _settingPagesMapping = new Dictionary<VistaMenuItem, Control>(); } _settingPagesMapping.Add(menuItem, retVal); } return retVal; }