예제 #1
0
 public VistaMenuItemClickArgs(
     VistaMenuItem item
     )
     : base()
 {
     i = item;
 }
예제 #2
0
        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);
        }
예제 #3
0
        protected override void OnInsertComplete(int index, object value)
        {
            VistaMenuItem btn = (VistaMenuItem)value;

            btn.Owner = this.owner;
            owner.CalcMenuSize();
            base.OnInsertComplete(index, value);
        }
예제 #4
0
 public VistaMenuItem Add(
     string sText
     )
 {
     VistaMenuItem aclb = new VistaMenuItem(owner);
         aclb.Text = sText;
         InnerList.Add(aclb);
         owner.CalcMenuSize();
         return aclb;
 }
예제 #5
0
        public VistaMenuItem Add(
            string sText
            )
        {
            VistaMenuItem aclb = new VistaMenuItem(owner);

            aclb.Text = sText;
            InnerList.Add(aclb);
            owner.CalcMenuSize();
            return(aclb);
        }
예제 #6
0
 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;
 }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        /// <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);
        }
예제 #10
0
        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;
        }
예제 #11
0
 public void Add(VistaMenuItem btn)
 {
     List.Add(btn);
         btn.Owner = this.owner;
         owner.CalcMenuSize();
 }
예제 #12
0
 public VistaMenuItemClickArgs(
     VistaMenuItem item
     )
     : base()
 {
     i = item;
 }
예제 #13
0
        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;
            }
        }
예제 #14
0
        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;
        }
예제 #15
0
        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;
        }
예제 #16
0
 public void Add(VistaMenuItem btn)
 {
     List.Add(btn);
     btn.Owner = this.owner;
     owner.CalcMenuSize();
 }