Example #1
0
 protected void InitializeRibbon(ToolStrip toolStripAero, Control contentControl = null)
 {
     this.InitializeAero(toolStripAero);
     this.AeroContainer.MouseUp    += new MouseEventHandler(AeroContainer_MouseUp);
     this.AeroContainer.MouseMove  += new MouseEventHandler(AeroContainer_MouseMove);
     this.AeroContainer.MouseDown  += new MouseEventHandler(AeroContainer_MouseDown);
     this.AeroContainer.MouseLeave += new EventHandler(AeroContainer_MouseLeave);
     this.container      = new RibbonContainer(this);
     this.contentControl = contentControl;
     if (this.contentControl != null)
     {
         this.AeroContainer.Controls.Add(this.contentControl);
     }
 }
Example #2
0
        private RibbonDropDownMenu CreateOpenMenu(RibbonContainer container)
        {
            string[] resources = typeof(TurtleIdeForm).Assembly.GetManifestResourceNames()
                                 .Where(s => s.EndsWith(".turtle.txt"))
                                 .ToArray();
            RibbonMenu menu = new RibbonMenu();

            foreach (string resource in resources)
            {
                RibbonMenuButton button = new RibbonMenuButton();
                button.SmallImage = TurtleIdeRibbon.New;
                button.Name       = resource.Substring("VlTurtle.Sample.NativeX.".Length);
                button.Executed  += new EventHandler(ribbonOpenSample_Click);
                menu.MenuItems.Add(button);
            }
            return(new RibbonDropDownMenu(container)
            {
                Menu = menu
            });
        }
Example #3
0
 Point IRibbonInputCallback.GetLocationInScreen(RibbonContainer ribbonContainer)
 {
     return(this.AeroContainer.PointToScreen(new Point(0, 0)));
 }
Example #4
0
 protected override void OnClosed(EventArgs e)
 {
     base.OnClosed(e);
     this.container.Dispose();
     this.container = null;
 }