public void CreateUI()
        {
            RibbonControl rc         = Autodesk.Windows.ComponentManager.Ribbon;
            RibbonTab     primaryTab = rc.FindTab(Jpp.Ironstone.Core.Constants.IRONSTONE_TAB_ID);

            RibbonPanel       Panel  = new RibbonPanel();
            RibbonPanelSource source = new RibbonPanelSource();

            source.Title = Properties.Resources.ExtensionApplication_UI_PanelTitle;

            RibbonRowPanel column1 = new RibbonRowPanel();

            column1.IsTopJustified = true;
            column1.Items.Add(UIHelper.CreateWindowToggle(Properties.Resources.ExtensionApplication_UI_SoilMenuButton, Properties.Resources.Earth_Small, RibbonItemSize.Standard, new SoilPropertiesView(), "4c7eae1d-ce9f-4a7a-a397-584aced7983c"));
            column1.Items.Add(new RibbonRowBreak());

            RibbonSplitButton rsb = new RibbonSplitButton();

            rsb.ShowText = true;
            rsb.Items.Add(UIHelper.CreateButton("Add Tree", Properties.Resources.Tree_Small, RibbonItemSize.Standard, "S_TreeRings_New"));
            rsb.Items.Add(UIHelper.CreateButton("Copy Tree", Properties.Resources.Tree_Small, RibbonItemSize.Standard, "S_TreeRings_Copy"));
            rsb.Items.Add(UIHelper.CreateButton("Add Hedge Row", Properties.Resources.Tree_Small, RibbonItemSize.Standard, "S_Hedgerow_New"));
            column1.Items.Add(rsb);

            //Build the UI hierarchy
            source.Items.Add(column1);

            Panel.Source = source;

            primaryTab.Panels.Add(Panel);
        }
Пример #2
0
        public static void InitGeo7Ribbon()
        {
            AppLog.Add("InitGeo7Ribbon()...");
            if (Geo7ToolsTab == null)
            {
                Geo7ToolsTab       = new RibbonTab();
                Geo7ToolsTab.Title = Geo7ToolsApp.AppName;
                Geo7ToolsTab.Id    = Geo7ToolsApp.AppName.Replace(" ", "_");

                if (Ac.Licence.IsValid || Ac.RunWithoutLicense)
                {
                    AppLog.Add("InitGeo7Ribbon():AddBlocksPanel()...");
                    AddBlocksPanel();
                    AppLog.Add("InitGeo7Ribbon():AddDrawPanel()...");
                    AddDrawPanel();
                    AppLog.Add("InitGeo7Ribbon():AddToolsPanel()...");
                    AddToolsPanel();
                }
                AppLog.Add("InitGeo7Ribbon():AddConfigurationPanel()...");
                AddConfigurationPanel();
                AppLog.Add("InitGeo7Ribbon():Done.");
            }

            Autodesk.Windows.RibbonControl ribbon = ComponentManager.Ribbon;
            if (ribbon == null)
            {
                AppLog.Add(AcConsts.RibbonNotFound);
                Ac.WriteLn(AcConsts.RibbonNotFound);
                return;
            }

            if (ribbon.FindTab(Geo7ToolsTab.Id) == null)
            {
                AppLog.Add("InitGeo7Ribbon():ribbon.Tabs.Add(Geo7ToolsTab)...");
                ribbon.Tabs.Add(Geo7ToolsTab);
            }
            AppLog.Add("InitGeo7Ribbon():Done.");
        }
Пример #3
0
 //Get a tab to modify(to add, modify item in this tab)
 public CustomTab GetModifyTab()
 {
     return(Tab(_ribbonControl.FindTab(ContextualTabHelper.IdModifyTab)));
 }