Пример #1
0
        static void Main(string[] args)
        {
#if WINDOWS
            // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
            int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);
            Debug.Assert(oleres == 0);
#endif

            Console.WriteLine("Sciter: " + SciterX.Version);

            // Create the window
            var wnd = new SciterWindow();
            wnd.CreateMainWindow(1500, 800);
            wnd.CenterTopLevelWindow();
            wnd.Title = "Sciter Bootstrap";
#if WINDOWS
            wnd.Icon = Properties.Resources.IconMain;
#endif

            // Prepares SciterHost and then load the page
            var host = new Host();
            host.SetupWindow(wnd);
            host.RegisterBehaviorHandler(typeof(DrawBitmapBehavior), "DrawBitmap");
            host.RegisterBehaviorHandler(typeof(DrawTextBehavior), "DrawText");
            host.RegisterBehaviorHandler(typeof(DrawGeometryBehavior), "DrawGeometry");
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");

            // Show window and Run message loop
            wnd.Show();
            PInvokeUtils.RunMsgLoop();

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
            int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);

            Debug.Assert(oleres == 0);

            // Create the window
            var wnd = new SciterWindow();

            wnd.CreateMainWindow(1500, 800);
            wnd.CenterTopLevelWindow();
            wnd.Title = "SciterBootstrap";
            wnd.Icon  = Properties.Resources.IconMain;

            // Prepares SciterHost and then load the page
            var host = new Host();

            host.Setup(wnd);
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");

            // Show window and Run message loop
            wnd.Show();
            PInvokeUtils.RunMsgLoop();
        }
Пример #3
0
        public Host(SciterWindow wnd)
            : base(wnd)
        {
            RegisterBehaviorHandler(typeof(ImgDrawBehavior));

            wnd.LoadPage("file:///Users/midiway/Documents/SciterSharp/Tests/TestOSX/res/index.html");
            wnd.CenterTopLevelWindow();
            wnd.Show();
        }
Пример #4
0
        public Host(SciterWindow wnd)
        {
            SetupWindow(wnd);
            RegisterBehaviorHandler(typeof(ImgDrawBehavior));

            wnd.LoadPage("/Users/midiway/Documents/SciterSharp/Tests/TestOSX/res/index.html");
            wnd.CallFunction("CallMe", new SciterValue((args) =>
            {
                return(new SciterValue(123));
            }));
            wnd.CenterTopLevelWindow();
            wnd.Show();
        }
Пример #5
0
        public static void Run()
        {
#if X64
            SciterX.Use3264DLLNaming = true;
#endif
            PInvokeWindows.OleInitialize(IntPtr.Zero);
            var window = new SciterWindow();
            window.CreateMainWindow(500, 500);
            window.CenterTopLevelWindow();
            var host = new AppHost(window);
            window.LoadPage("archive://app/acrylic-window/acrylic-window-sketch.htm");
            window.Show();
            PInvokeUtils.RunMsgLoop();
        }
Пример #6
0
        public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
        {
            wnd = new SciterWindow();
            wnd.CreateMainWindow(500, 500);
            wnd.CenterTopLevelWindow();
            wnd.Title = "SciterSharp from OSX";

            host = new Host();
            host.SetupWindow(wnd);
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");
            host.DebugInspect();

            wnd.Show();
        }
Пример #7
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            wnd = new SciterWindow();
            wnd.CreateMainWindow(800, 500);
            wnd.CenterTopLevelWindow();
            wnd.Title = "SciterSharp from OSX";

            host = new Host();
            host.SetupWindow(wnd);
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");
            //host.DebugInspect();

            wnd.Show();
        }
Пример #8
0
        public static void Run()
        {
            IsRunning = true;
            AppWindow = new SciterWindow();

            AppWindow.CreateMainWindow(1280, 720);
            AppWindow.CenterTopLevelWindow();
            AppWindow.Title = Reference.NAME;
            Win32.EnableWindowBlur(AppWindow._hwnd);

            AppHost = new Host(AppWindow);

            PInvokeUtils.RunMsgLoop();
            IsRunning = false;
        }