public REPL_Gui buildGui(Control targetControl) { try { TopPanel = targetControl.clear().add_Panel(); Code_Panel = TopPanel.insert_Left("Code"); Output_Panel = TopPanel.add_GroupBox("Invoke and Result") .add_GroupBox("Output").add_Panel(); Execute_Button = Output_Panel.parent().insert_Above(60).add_Button("Execute").fill(); Execute_Button.insert_Below(20).add_Link("stop execution", () => this.stopCurrentExecution()); Output_View_RichTextBox = Output_Panel.add_RichTextBox(); Output_View_Object = Output_Panel.add_Panel(); //set actions Execute_Button.onClick( () => { try { ExecutionThread = O2Thread.mtaThread(() => On_ExecuteCode.invoke()); } catch (Exception ex) { ex.log(); } }); } catch (Exception ex) { ex.log("[REPL_Gui] in buildGui"); } return(this); }
public Win32_Handle_Hijack buildGui() { TopPanel = this.add_Panel(); createToolStrip(); HijackedWindow = TopPanel.add_GroupBox(GroupBoxText).add_Panel(); var groupBox = HijackedWindow.parent();; GroupBoxText = groupBox.get_Text(); groupBox.DoubleClick += (sender, e) => toolStrip_HideShow(); //do this on a seprate thread because the parentForm will be null at this stage (since this is a Control) O2Thread.mtaThread( () => { 1000.sleep(); this.parentForm().onClosed( () => { restore(); }); }); return(this); }