예제 #1
0
        private DevComponents.DotNetBar.RibbonTabItem GetRibbonTab(NavigationTabItem tabItem)
        {
            try
            {
                DevComponents.DotNetBar.RibbonTabItem ribbonTabItem = new DevComponents.DotNetBar.RibbonTabItem();
                ribbonTabItem.ButtonStyle            = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                ribbonTabItem.HotFontBold            = true;
                ribbonTabItem.ImagePaddingHorizontal = 8;
                ribbonTabItem.SubItemsExpandWidth    = 14;

                if (tabItem.Tag.Length > 0)
                {
                    ribbonTabItem.Tag    = tabItem.Tag;
                    ribbonTabItem.Click += new System.EventHandler(this.btnNavigation_Click);
                }
                ribbonTabItem.Text    = tabItem.Name;
                ribbonTabItem.KeyTips = tabItem.KeyTips.Length > 0 ? tabItem.KeyTips : null;
                ribbonTabItem.Image   = tabItem.Image.Length > 0 ? (Bitmap)Actemium.WiSSWizard.Properties.Resources.ResourceManager.GetObject(tabItem.Image) : null;

                if (tabItem.Count > 0)
                {
                    DevComponents.DotNetBar.RibbonPanel ribbonPanel = GetRibbonPanel();

                    foreach (NavigationTabBar bar in tabItem)
                    {
                        DevComponents.DotNetBar.RibbonBar ribbonBar = GetRibbonBar(bar);
                        if (ribbonBar.Items.Count > 0)
                        {
                            ribbonPanel.Controls.Add(ribbonBar);
                        }
                    }

                    if (ribbonPanel.Controls.Count > 0)
                    {
                        ribbonControlHeader.Controls.Add(ribbonPanel);
                        ribbonTabItem.Panel = ribbonPanel;
                    }
                }

                ribbonTabItem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Left;
                ribbonTabItem.RecalcSize();

                return(ribbonTabItem);
            }
            catch (Exception ex)
            {
                Trace.WriteError("'({0})", "GetRibbonTab", CLASSNAME, ex, tabItem);
                throw;
            }
        }
 public new NavigationTabItem this[string name]
 {
     get
     {
         IEnumerator enumerator = this.GetEnumerator();
         while (enumerator.MoveNext())
         {
             NavigationTabItem item = (NavigationTabItem)enumerator.Current;
             if (item.Name == name)
             {
                 return(item);
             }
         }
         return(null);
     }
 }
예제 #3
0
        private DevComponents.DotNetBar.ButtonItem GetRibbonButton(NavigationTabItem tabItem, Boolean header)
        {
            try
            {
                DevComponents.DotNetBar.ButtonItem buttonItem = new DevComponents.DotNetBar.ButtonItem();
                buttonItem.ButtonStyle            = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                buttonItem.HotFontBold            = true;
                buttonItem.ImagePaddingHorizontal = 8;
                buttonItem.SubItemsExpandWidth    = 14;

                if (header)
                {
                    buttonItem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Left;
                }
                else
                {
                    buttonItem.FixedSize     = new System.Drawing.Size(90, 30);
                    buttonItem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
                }

                if (tabItem.Tag.Length > 0)
                {
                    buttonItem.Tag    = tabItem.Tag;
                    buttonItem.Click += new System.EventHandler(this.btnNavigation_Click);
                }
                buttonItem.Text    = tabItem.Name;
                buttonItem.KeyTips = tabItem.KeyTips.Length > 0 ? tabItem.KeyTips : null;
                buttonItem.Image   = tabItem.Image.Length > 0 ? (Bitmap)Actemium.WiSSWizard.Properties.Resources.ResourceManager.GetObject(tabItem.Image) : null;

                buttonItem.Enabled = true;

                buttonItem.RecalcSize();

                return(buttonItem);
            }
            catch (Exception ex)
            {
                Trace.WriteError("'({0},{1})", "GetRibbonButton", CLASSNAME, ex, tabItem, header);
                throw;
            }
        }