Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        public void TestODH()
        {
            TestableDOH odh = new TestableDOH();

            SciterWindow wnd = new SciterWindow();

            wnd.CreateMainWindow(1500, 800);
            wnd.Title = "Wtf";
            bool res = wnd.LoadHtml(@"
<html>
<style>
	body { wtf: 123; }
</style>

<script type='text/tiscript'>
</script>
</html>
");

            Assert.IsTrue(res);

            PInvokeWindows.MSG msg;
            while (PInvokeWindows.GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
            {
                wnd.Show();
                PInvokeWindows.TranslateMessage(ref msg);
                PInvokeWindows.DispatchMessage(ref msg);
            }

            Assert.IsTrue(odh.msgs.Count == 1);
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
        public void TestThings()
        {
            SciterWindow wnd = new SciterWindow();

            wnd.CreateMainWindow(1500, 800);
            wnd.Title = "Wtf";

            SciterHost host = new SciterHost(wnd);

            wnd.LoadHtml("<html></html>");

            var sv = wnd.EvalScript("Utils.readStreamToEnd");

            Assert.IsTrue(!sv.IsUndefined);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            Debug.WriteLine(SciterX.Version);
            SciterX.API.SciterSetOption(IntPtr.Zero, SciterXDef.SCITER_RT_OPTIONS.SCITER_SET_GFX_LAYER, new IntPtr((int)SciterXDef.GFX_LAYER.GFX_LAYER_CG));

            NSApplication.Init();

            SciterWindow wnd = new SciterWindow();

            wnd.CreateMainWindow(800, 600);
            host = new Host(wnd);
            //host.DebugInspect();

            NSApplication.Main(args);
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            SciterX.API.SciterSetOption(IntPtr.Zero, SciterXDef.SCITER_RT_OPTIONS.SCITER_SET_GFX_LAYER, new IntPtr((int)SciterXDef.GFX_LAYER.GFX_LAYER_CG));

            NSApplication.Init();

            //var a = File.ReadAllBytes("/Users/midiway/Dropbox/Things/213.png");
            //var img = new SciterImage(a);

            SciterWindow wnd = new SciterWindow();

            wnd.CreateMainWindow(800, 600);
            host = new Host(wnd);

            NSApplication.Main(args);
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            // TODO: think Andrew corrected child window creation
            PInvokeWindows.OleInitialize(IntPtr.Zero);

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

            wnd.CreateMainWindow(1500, 800);
            var r = wnd.RootElement;

            wnd.Icon = Properties.Resources.Icon1;
            //wnd.EnableDwmClientArea();


            //wnd.CenterTopLevelWindow();
            //wnd.AfterWindowCreate();
            //wnd.Title = "Sciter Bootstrap";

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

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

            // get the page <body>
            var se_body = wnd.RootElement.SelectFirst("body");

            // append a <h1> header to it
            se_body.TransformHTML("<h1>Wow, this header was created natively!</h1>", SciterXDom.SET_ELEMENT_HTML.SIH_INSERT_AT_START);

            // set <h1> color to blue
            se_body[0].SetStyle("color", "#00F");


            /*SciterWindow wnd_popup = new SciterWindow();
             * wnd_popup.CreatePopupAlphaWindow(400, 400, wnd._hwnd);
             * wnd_popup.LoadHtml("<html><body><style>html { background: red; }</style></body></html>");
             * wnd_popup.Show();*/

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