Inheritance: System.Windows.Forms.IWin32Window
Example #1
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);
        }
Example #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 = "Sciter Bootstrap";
            wnd.Icon = Properties.Resources.IconMain;

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

            // Show window and Run message loop
            wnd.Show();
            PInvokeUtils.RunMsgLoop();
        }
Example #3
0
        public void SetupWindow(SciterWindow wnd)
        {
            Debug.Assert(wnd != null);
            Debug.Assert(wnd._hwnd != IntPtr.Zero);
            Debug.Assert(_hwnd == IntPtr.Zero, "You already called SetupWindow()");

            SetupWindow(wnd._hwnd);
        }
Example #4
0
 /// <summary>
 /// Show a system message-box owned by this Sciter window. If caption is null, it will be the title of the Sciter window
 /// </summary>
 /// <param name="wnd"></param>
 /// <param name="text"></param>
 /// <param name="caption"></param>
 public static void ShowMessageBox(this SciterWindow wnd, string text, string caption = null)
 {
     if (caption == null)
     {
         caption = wnd.Title;
     }
     Show(wnd._hwnd, text, caption);
 }
Example #5
0
        public void SetupWindow(SciterWindow wnd)
        {
            Debug.Assert(wnd != null);
            Debug.Assert(wnd._hwnd != IntPtr.Zero);
            Debug.Assert(_hwnd == IntPtr.Zero, "You already called SetupWindow()");

            _hwnd = wnd._hwnd;

            _cbk = this.HandleNotification;
            _api.SciterSetCallback(_hwnd, Marshal.GetFunctionPointerForDelegate(_cbk), IntPtr.Zero);
        }
Example #6
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();
        }
Example #7
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
            #if GTKMONO
            PInvokeGTK.gtk_init(IntPtr.Zero, IntPtr.Zero);
            #endif

            DbgHandler = new DebugHandlerGTK();

            /*
                NOTE:
                In Linux, if you are getting a System.TypeInitializationException below, it is because you don't have 'libsciter-gtk-64.so' in your LD_LIBRARY_PATH.
                Run 'sudo bash install-libsciter.sh' contained in this package to install it in your system.
            */

            // Check minimum Sciter version required for this app
            if(SciterX.API.SciterVersion(1) < 0x00030003 || SciterX.API.SciterVersion(0) < 0x00010002)
                throw new Exception("Sciter shared library is outdated.");

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

            // Prepares SciterHost and then load the page
            var host = new Host();
            host.SetupWindow(wnd);
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");
            host.DebugInspect();
            HostInstance = host;

            FontLister.Data.GAPI.Setup();

            // Show window and Run message loop
            wnd.Show();
            PInvokeUtils.RunMsgLoop();
        }
Example #8
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);
            wnd.Title = "Sciter Bootstrap";
            wnd.CenterTopLevelWindow();
            wnd.Icon = Properties.Resources.Icon1;

            //wnd.EnableDwmClientArea();
            //wnd.AfterWindowCreate();

            // 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();
        }
Example #9
0
 // : base(wnd._hwnd)
 public DebugHandler(SciterWindow wnd)
 {
 }
Example #10
0
 public void SetupWindow(SciterWindow wnd)
 {
     _wnd = wnd;
     SetupCallback(wnd._hwnd);
 }
Example #11
0
 public SciterHost(SciterWindow wnd)
 {
     SetupWindow(wnd._hwnd);
 }
Example #12
0
 public new void SetupWindow(SciterWindow wnd)
 {
     _wnd = wnd;
     SetupWindow(wnd._hwnd);
 }
Example #13
0
 public SciterHost(SciterWindow wnd)
 {
     SetupWindow(wnd._hwnd);
 }
Example #14
0
        public void SetupWindow(SciterWindow wnd)
        {
            Debug.Assert(wnd != null);
            Debug.Assert(wnd._hwnd != IntPtr.Zero);
            Debug.Assert(_hwnd == IntPtr.Zero, "You already called SetupWindow()");

            _hwnd = wnd._hwnd;

            _cbk = this.HandleNotification;
            _api.SciterSetCallback(_hwnd, Marshal.GetFunctionPointerForDelegate(_cbk), IntPtr.Zero);
        }