Beispiel #1
0
        public MainForm()
        {
            Title            = "Rhino.Inside";
            ClientSize       = new Eto.Drawing.Size(400, 400);
            _viewportControl = new Rhino.UI.Controls.ViewportControl();
            Content          = _viewportControl;

            var viewMenu = new Eto.Forms.ButtonMenuItem {
                Text = "&View"
            };

            BuildDisplayModesMenu(viewMenu.Items);
            Menu = new Eto.Forms.MenuBar()
            {
                Items =
                {
                    new Eto.Forms.ButtonMenuItem
                    {
                        Text  = "&File",
                        Items =
                        {
                            new Eto.Forms.ButtonMenuItem(new Eto.Forms.Command((s, e) => OpenFile()))
                            {
                                Text = "Open..."
                            }
                        }
                    },
                    viewMenu
                }
            };
        }
Beispiel #2
0
 void BuildDisplayModesMenu(Eto.Forms.MenuItemCollection collection)
 {
     Rhino.Display.DisplayModeDescription[] modes = Rhino.Display.DisplayModeDescription.GetDisplayModes();
     foreach (var mode in modes)
     {
         var menuitem = new Eto.Forms.ButtonMenuItem((s, e) =>
         {
             _viewportControl.Viewport.DisplayMode = mode;
             _viewportControl.Refresh();
         });
         menuitem.Text = mode.EnglishName;
         collection.Add(menuitem);
     }
 }