예제 #1
0
        public void Dispose()
        {
            Destroy();

            Instance = null;
            Host     = null;
        }
예제 #2
0
        public static void ShowDialog()
        {
            var wnd = Instance = new DlgLicense();

            wnd.CreateMainWindow(740, 520,
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_MAIN |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ENABLE_DEBUG |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_POPUP |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TITLEBAR
                                 );
            wnd.CenterTopLevelWindow();
            wnd.Title = Consts.AppName;
#if WINDOWS
            wnd.Icon = Properties.Resources.IconMain;
            new Win32Hwnd(wnd._hwnd).ModifyStyle(0, PInvoke.User32.SetWindowLongFlags.WS_SYSMENU);
#endif

            Host = new DlgLicenseHost(wnd);

            // For testing to work
            wnd.Show();

#if false
            PInvokeWindows.MSG msg;
            while (PInvokeWindows.GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
            {
                PInvokeWindows.TranslateMessage(ref msg);
                PInvokeWindows.DispatchMessage(ref msg);
            }
#else
            wnd.ShowModal();
#endif
        }
예제 #3
0
        public static bool Setup()
        {
            Console.WriteLine("Sciter " + SciterX.Version);

            #region Ion
            if (IonApp.GetStatus() != EIonStatus.ACTIVE || IonApp.IsTrial)
            {
                DlgLicense.ShowDialog();
            }
            if (IonApp.GetStatus() != EIonStatus.ACTIVE)
            {
                return(false);
            }
            UpdateControl.Setup();
            #endregion

            // Create the window
            AppWindow   = new Window();
            AppDebugger = new DebuggerHost();
            AppHost     = new Host(AppWindow);

            State.Setup();

            // Args passing
            var sv = new SciterValue();
            sv["t"] = new SciterValue(App.g_arg_t);
            sv["r"] = new SciterValue(App.g_arg_r);
            AppHost.CallFunction("View_Setup", sv);

            if (!string.IsNullOrEmpty(g_arg_page))
            {
                //MessageBox.ShowMessageBox(AppWindow, g_arg_page);
                State.LoadURL(g_arg_page);
            }

            AppWindow.CenterTopLevelWindow();
            AppWindow.Show();

#if DEBUG
            //AppHost.InvokePost(() => Tests.Run());
#endif
            return(true);
        }