Esempio n. 1
0
        // Function from file: browser.dm
        public virtual dynamic open(bool?use_onclose = null)
        {
            use_onclose = use_onclose ?? true;

            string window_size = null;
            double i           = 0;

            window_size = "";

            if (Lang13.Bool(this.width) && Lang13.Bool(this.height))
            {
                window_size = "size=" + this.width + "x" + this.height + ";";
            }
            Interface13.Browse(this.user, this.get_content(), "window=" + this.window_id + ";" + window_size + this.window_options);

            if (use_onclose == true)
            {
                Task13.Schedule(0, (Task13.Closure)(() => {
                    foreach (dynamic _a in Lang13.IterateRange(1, 10))
                    {
                        i = _a;


                        if (Lang13.Bool(this.user) && Interface13.WindowExists(this.user, this.window_id))
                        {
                            GlobalFuncs.onclose(this.user, this.window_id, this.v_ref);
                            break;
                        }
                    }
                    return;
                }));
            }
            return(null);
        }
Esempio n. 2
0
        // Function from file: html_interface.dm
        public void show(dynamic hclient = null)
        {
            hclient = this.getClient(hclient, GlobalVars.TRUE);

            if (hclient is HtmlInterfaceClient)
            {
                if (GlobalVars.asset_list.Contains(this.type) && GlobalVars.asset_list[this.type] is ByTable)
                {
                    GlobalFuncs.send_asset_list(hclient.client, GlobalVars.asset_list[this.type], GlobalVars.TRUE);
                }

                if (!Interface13.WindowExists(hclient.client, new Txt("browser_").Ref(this).ToString()))
                {
                    this.createWindow(hclient);
                }
                hclient.is_loaded = GlobalVars.FALSE;
                Interface13.Output(hclient.client, GlobalFuncs.replacetextEx(GlobalFuncs.replacetextEx(File13.Read("html_interface.html"), "[hsrc]", new Txt().Ref(this).ToString()), "</head>", "" + this.head + "</head>"), new Txt("browser_").Ref(this).str(".browser").ToString());
                Interface13.WindowShow(hclient.client, new Txt("browser_").Ref(this).ToString(), GlobalVars.TRUE);

                while (Lang13.Bool(hclient.client) && Lang13.Bool(hclient.active) && !Lang13.Bool(hclient.is_loaded))
                {
                    Task13.Sleep(2);
                }
            }
            return;
        }
Esempio n. 3
0
        // Function from file: browser.dm
        public override dynamic open(bool?use_onclose = null)
        {
            dynamic _default = null;

            string focusedwindow = null;
            double i             = 0;

            this.opentime = Game13.time;

            if (this.stealfocus == true)
            {
                _default = base.open(true);
            }
            else
            {
                focusedwindow = Interface13.WindowGet(this.user, null, "focus");
                _default      = base.open(true);

                foreach (dynamic _a in Lang13.IterateRange(1, 10))
                {
                    i = _a;


                    if (Lang13.Bool(this.user) && Interface13.WindowExists(this.user, this.window_id))
                    {
                        if (Lang13.Bool(focusedwindow))
                        {
                            Interface13.WindowSet(this.user, focusedwindow, "focus=true");
                        }
                        else
                        {
                            Interface13.WindowSet(this.user, "mapwindow", "focus=true");
                        }
                        break;
                    }
                }
            }

            if (Lang13.Bool(this.timeout))
            {
                Task13.Schedule(this.timeout ?? 0, (Task13.Closure)(() => {
                    this.close();
                    return;
                }));
            }
            return(_default);
        }