Esempio n. 1
0
        public static void Main(string[] args)
        {
            Toolkit opentk = Core.InitOpenTK();

            Platform platform = Platform.Detect;

            platform.Add <GLSurface.IHandler>(() => new MacGLSurfaceHandler());

            Style.Add <View>(
                "hidecursor",
                view =>
            {
                CG.DisplayHideCursor((CGDirectDisplayID)0);
                CG.AssociateMouseAndMouseCursorPosition(false);
            });

            Style.Add <View>(
                "showcursor",
                view =>
            {
                CG.AssociateMouseAndMouseCursorPosition(true);
                CG.DisplayShowCursor((CGDirectDisplayID)0);
            });

            var application = new Application(platform);

            application.UnhandledException += Core.UnhandledExceptionHandler;

            using (opentk)
            {
                application.Run(new MainForm());
            }
        }
Esempio n. 2
0
        static void Main()
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            var platform = new Platform();

            platform.Add <SortableGridColumn.IHandler>(() => new SortableGridColumnHandler());
            using (App app = new App(platform))
            {
                app.Run();
            }
        }
Esempio n. 3
0
        static void Main()
        {
            var platform = new Platform();

            platform.Add <SortableGridColumn.IHandler>(() => new SortableGridColumnHandler());
            using (App app = new App(platform))
            {
                var handler = (ApplicationHandler)app.Handler;
                handler.AllowClosingMainForm = true;
                app.Run();
            }
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            Toolkit opentk = Core.InitOpenTK();

            Platform platform = Platform.Detect;

            // This project has references to multiple Eto and Eto.Gl platforms,
            // to eliminate the need for separate test GUIs.
            //
            // To avoid the subsequent hassle of unnecessary and potentially
            // irritating to install dependencies, e.g. GtkSharp2 on Windows,
            // those references are conditional, and vary based on what platform
            // is building the code.
            //
            // That in turn means the various handler types, WinGLSurfaceHandler
            // et. al., aren't all available at compile time, leading to this
            // assembly loading acrobatics routine.
            if (platform.IsMac)
            {
                Assembly.Load("Eto.OpenTK.Mac64");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.Mac.MacGLSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }
            else if (platform.IsGtk)
            {
                Assembly.Load("Eto.OpenTK.Gtk2");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.Gtk.GtkGlSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }
            else
            {
                Assembly.Load("Eto.OpenTK.WinForms");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.WinForms.WinGLSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }

            var application = new Application(platform);

            application.UnhandledException += Core.UnhandledExceptionHandler;

            var form = new MainForm();

            var testMenu = new ButtonMenuItem
            {
                Text  = "Test",
                Items =
                {
                    new ButtonMenuItem
                    {
                        Text             = "Get average refresh time",
                        Command          = Commands.CmdAverageRefreshTime,
                        CommandParameter = form
                    },
                    new ButtonMenuItem
                    {
                        Text             = "Count visible triangles",
                        Command          = Commands.CmdVisibleTriangles,
                        CommandParameter = form
                    }
                }
            };

            form.Menu.Items.Add(testMenu);

            using (opentk)
            {
                application.Run(form);
            }
        }
Esempio n. 5
0
 private static void RegisterUIHandlers(Platform platform)
 {
     platform.Add <Notification.IHandler>(() => new Controls.NotificationHandler());
     platform.Add <SyntaxHightlightTextArea.ISyntaxHightlightTextArea>(() => new SyntaxHightlightTextAreaHandler());
 }
Esempio n. 6
0
 public void Initialize(Platform platform)
 {
     platform.Add <IEtoAdapterHandler>(() => new EtoAdapterHandler());
 }
Esempio n. 7
0
 public void Initialize(Platform platform)
 {
     platform.Add <DsBindComboBoxCell.IHandler>(() => new DsBindComboBoxCellHandler());
 }
Esempio n. 8
0
 private static void RegisterUIHandlers(Platform platform)
 {
     platform.Add <SyntaxHightlightTextArea.ISyntaxHightlightTextArea>(() => new SyntaxHightlightTextAreaHandler());
 }