Beispiel #1
0
        public MainRibbon()
        {
            // Sourcemap
            sourcemap = new RibbonMenuItem("SourceMap", this);

            RibbonGroup group = new RibbonGroup("Loading", this);
            Button button = new Button("Load Sourcemap", this);
            button.Selected += new Button.ButtonSelectedEvent(LoadMapEvent);

            Button button2 = new Button("Unload Sourcemap", this);
            button2.Selected += new Button.ButtonSelectedEvent(UnLoadMapEvent);
            group.AddControl(button);
            group.AddControl(button2);
            sourcemap.AddItem(group);

            group = new RibbonGroup("Hags?",this);
            group.AddControl(new Button("Magic Button", this));
            sourcemap.AddItem(group);

            AddItem(sourcemap);

            // Renderer
            renderer = new RibbonMenuItem("Renderer", this);
            group = new RibbonGroup("Screenshot",this);
            button = new Button("Screenshot", this);
            group.AddControl(button);
            renderer.AddItem(group);
            AddItem(renderer);

            // Other
            AddItem(new RibbonMenuItem("Test2", this));
            AddItem(new RibbonMenuItem("Test3", this));
        }
Beispiel #2
0
 public void ToggleShowRibbon()
 {
     ShowRibbon = !ShowRibbon;
     ToggleRibbonButton.label.Text = (ShowRibbon ? "-" : "+");
     if (!ShowRibbon && ActiveItem != null)
         ActiveItem.Showing = false;
     else if (ShowRibbon && ActiveItem != null)
         ActiveItem.Showing = true;
     else if (ShowRibbon && ActiveItem == null)
     {
         if (_Items.Count > 0)
         {
             ActiveItem = _Items[0];
             ActiveItem.Showing = true;
         }
     }
 }
Beispiel #3
0
        public void ShowItem(RibbonMenuItem item)
        {
            if (ActiveItem != null)
                ActiveItem.Showing = false;
            ActiveItem = item;
            ActiveItem.Showing = true;

            if (!ShowRibbon)
                ToggleShowRibbon();
        }
Beispiel #4
0
 public void AddItem(RibbonMenuItem item)
 {
     _Items.Add(item);
     panel.AddControl(item);
 }