public ascx_Panel_With_Inspector()
        {
            try
            {
                this.Width = 800;
                this.Height = 600;

                var controls = this.add_1x1("Panel", "Inspector", false, 200);

                panel = controls[0].add_Panel();

                //graph.testGraph();
                inspector = controls[1].add_Script();

                if (inspector.isNull())
                {
                    "[ascx_Panel_With_Inspector] add_Script failed, inspector variable was null".error();
                    return;
                }
                inspector.defaultCode = "//var topPanel = \"{name}\".popupWindow(700,400);".line() +
                                         "var topPanel = panel.clear().add_Panel();".line() +                   // so that we don't get an autosave for this test code
                                        "var textBox = topPanel.add_TextBox(true);".line() +
                                        "textBox.set_Text(\"hello world\");";
                inspector.Code = inspector.defaultCode;
                inspector.InvocationParameters.Add("panel", panel);
                inspector.showLogViewer();
                inspector.compile();
                //inspector.InvocationParameters.Add("inspector", inspector);
                //inspector.enableCodeComplete();
            }
            catch (Exception ex)
            {
                ex.log();
            }
        }
        public ascx_Panel_With_Inspector()
        {
            try
            {
                this.Width  = 800;
                this.Height = 600;

                var controls = this.add_1x1("Panel", "Inspector", false, 200);

                panel = controls[0].add_Panel();

                //graph.testGraph();
                inspector = controls[1].add_Script();

                if (inspector.isNull())
                {
                    "[ascx_Panel_With_Inspector] add_Script failed, inspector variable was null".error();
                    return;
                }
                inspector.defaultCode = "//var topPanel = \"{name}\".popupWindow(700,400);".line() +
                                        "var topPanel = panel.clear().add_Panel();".line() +                    // so that we don't get an autosave for this test code
                                        "var textBox = topPanel.add_TextBox(true);".line() +
                                        "textBox.set_Text(\"hello world\");";
                inspector.Code = inspector.defaultCode;
                inspector.InvocationParameters.Add("panel", panel);
                inspector.showLogViewer();
                inspector.compile();
                //inspector.InvocationParameters.Add("inspector", inspector);
                //inspector.enableCodeComplete();
            }
            catch (Exception ex)
            {
                ex.log();
            }
        }
Exemplo n.º 3
0
 public ScriptUI()
 {
     InitializeComponent();
     ascx_Simple_Script_Editor ScriptEditor = new ascx_Simple_Script_Editor();
     //SourceCodeEditor ScriptEditor = new SourceCodeEditor();
     ScriptEditor.Parent = this;
     ScriptEditor.Dock = DockStyle.Fill;
     ScriptEditor.Show();
 }
        public static ascx_Simple_Script_Editor startControl_NoCodeComplete()
        {
            var host = O2Gui.load <Panel>("O2 Simple Script Editor", 700, 300);

            return(host.invokeOnThread(
                       () =>
            {
                var scriptEditor = new ascx_Simple_Script_Editor(false);
                scriptEditor.fill();
                host.add_Control(scriptEditor);
                return scriptEditor;
            }));
        }
 public static ascx_Simple_Script_Editor startControl_NoCodeComplete()
 {
     var host = O2Gui.load<Panel>("O2 Simple Script Editor", 700, 300);
     return host.invokeOnThread(
         () =>
         {
             var scriptEditor = new ascx_Simple_Script_Editor(false);
             scriptEditor.fill();
             host.add_Control(scriptEditor);
             return scriptEditor;
         });
 }