示例#1
0
 public DotNetScriptTemplate(IZeusContext context)
     : base(context)
 {
     this.ui       = context.Objects["ui"] as Zeus.UserInterface.GuiController;
     this.MyMeta   = context.Objects["MyMeta"] as MyMeta.dbRoot;
     this.DnpUtils = context.Objects["DnpUtils"] as Dnp.Utils.Utils;
 }
示例#2
0
		public DynamicForm(GuiController gui, IZeusFunctionExecutioner executioner)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.guiController = gui;
			this.executioner = executioner;

			if (gui.TabNames.Count > 0) 
			{
				buttonOk = new Button();
				buttonOk.Dock =  DockStyle.Bottom;
				buttonOk.Text = "OK";
				buttonOk.Click += new EventHandler(ButtonOk_Click);
				this.Controls.Add(buttonOk);

				this.tabs = new TabControl();
				this.tabs.Dock = DockStyle.Fill;
				foreach (string name in gui.TabNames) 
				{
					this.tabs.TabPages.Add( new TabPage(name) );
				}
				this.Controls.Add(tabs);

				builder = new FormBuilder(this, tabs);
			}
			else 
			{
				builder = new FormBuilder(this);
			}

			builder.CheckedListBoxChange += new EventHandler(checkedListBoxChanged);
			builder.ListBoxChange += new EventHandler(listBoxChanged);
			builder.ComboBoxChange += new EventHandler(comboBoxChanged);
			builder.ButtonClick += new EventHandler(buttonClicked);
			builder.CheckBoxClick += new EventHandler(checkBoxClicked);
			builder.FormClosing += new EventHandler(formClosing);
			builder.FileSelectorSelect += new EventHandler(fileSelectorSelect);
            builder.TextBoxKeyPress += new EventHandler(textBoxKeyPress);
            builder.ControlOnBlur += new EventHandler(controlOnBlur);
            builder.ControlOnFocus += new EventHandler(controlOnFocus);
		}
		public _DotNetScriptGui(ZeusGuiContext context)
		{
			this.input = context.Input;
			this.objects = context.Objects;
			this.ui = context.Gui;
		}
		public void DynamicGUI_Display(GuiController gui, IZeusFunctionExecutioner executioner) 
		{
			this.Cursor = Cursors.Default;

			try 
			{
				DynamicForm df = new DynamicForm(gui, executioner);
				DialogResult result = df.ShowDialog(this);
				
				if(result == DialogResult.Cancel) 
				{
					gui.IsCanceled = true;
				}
			}
			catch (Exception ex)
			{
				ZeusDisplayError formError = new ZeusDisplayError(ex);
				formError.SetControlsFromException();			
				formError.ShowDialog(this);
			}

			this.Cursor = Cursors.WaitCursor;
		}