/* * override internal void setKeyList(List<ONKEY_EVENT> keyList, List<ON_ACTION_EVENT> actionList, UIContext currContext) * { * * foreach (ONKEY_EVENT a in keyList) * { * if (Convert.ToInt32(a.KEY) == FGLUtils.getKeyCodeFromKeyName(Action)) * { * // The action is really a fake keypress... * onActionID = a.ID; * * * * break; * } * } * * } */ private void createWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl) { this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl); pb = new PictureBoxCompat(); #region SetImageFromFile if (configSettings.ContainsKey("FILENAME")) { string dir; Gizmox.WebGUI.Common.Resources.ResourceHandle obj; obj = FGLWebUtils.getImageFromName((string)configSettings["FILENAME"]); //pb.BackColor = Color.AliceBlue; if (obj != null) { pb.Image = obj; } else { dir = "c:/images"; //Properties. Resources.ImageDirectory; if (!dir.EndsWith("/") && !dir.EndsWith("\\")) { dir = dir + "/"; } try { pb.Load(dir + "/" + (string)configSettings["FILENAME"]); } catch (Exception) { ; } } ContextTypeChanged(); } #endregion SizeControl(ma, index, pb); pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.Visible = true; pb.Location = GuiLayout.getPoint(ma, index, column - 1, row); }
private void AubitMessageBox_Load(object sender, EventArgs e) { lbltext.Text = winQuestion.TEXT; this.Text = winQuestion.TITLE; if (winQuestion.ICON != "") { this.lblPb.Image = FGLWebUtils.getImageFromName(winQuestion.ICON); } string[] s = winQuestion.POS.Split('|'); for (int a = 0; a < s.Length; a++) { Button b; b = new Button(); b.Text = s[a]; b.Click += new EventHandler(b_Click); if (s[a] == winQuestion.DEFAULT) { b.Select(); } buttonBox.Controls.Add(b); } }
private void createComboBoxWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, string txt) { this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl); p = new Panel(); l = new Label(); pb = new Button(); t = new Gizmox.WebGUI.Forms.TextBox(); l.TextAlign = ContentAlignment.MiddleLeft; onActionID = ""; string[] str = config.Split(' '); fakeKeyId = -1; if (str.Length == 2) { Gizmox.WebGUI.Common.Resources.ResourceHandle i; i = FGLWebUtils.getImageFromName(str[0]); if (i == null) { i = FGLWebUtils.getImageFromName("zoom"); } if (i != null) { //pb.AutoSize = true; pb.Image = i; pb.AutoSizeMode = AutoSizeMode.GrowAndShrink; pb.AutoSize = true; fakeKeyId = FGLUtils.getKeyCodeFromKeyName(str[1]); } } if (txt != null && txt.Length > 0) { pb.Text = txt; } if (str.Length == 1) { Gizmox.WebGUI.Common.Resources.ResourceHandle i; i = FGLWebUtils.getImageFromName("zoom"); if (i != null) { pb.Image = i; } fakeKeyId = FGLUtils.getKeyCodeFromKeyName(str[0]); } pb.Click += new EventHandler(pb_Click); pb.Dock = DockStyle.Right; pb.Margin = new Padding(0, 0, 0, 0); pb.Padding = new Padding(0, 0, 0, 0); p.Margin = new Padding(0, 0, 0, 0); p.Padding = new Padding(0, 0, 0, 0); l.Margin = new Padding(0, 0, 0, 0); l.Padding = new Padding(0, 0, 0, 0); t.Margin = new Padding(0, 0, 0, 0); t.Padding = new Padding(0, 0, 0, 0); t.Visible = true; t.Enabled = true; pb.Visible = true; pb.TabStop = false; SizeControl(ma, index, p); t.Height = p.Size.Height; t.Width = p.Size.Width - pb.Width; t.TextChanged += new EventHandler(t_TextChanged); // Any columns used for the button must be subtracted from the length of the // textbox.. /* * if (columns > 2) * { * p.Width = GuiLayout.get_gui_w(columns + 1); * } * else * { * p.Width = GuiLayout.get_gui_w(3); * } */ t.MaxLength = columns; l.Size = t.Size; l.BorderStyle = BorderStyle.Fixed3D; // l.Dock = DockStyle.Fill; p.Controls.Add(t); p.Controls.Add(l); p.Controls.Add(pb); // p.Size = l.Size; t.GotFocus += new EventHandler(t_GotFocus); //t.Click += new EventHandler(t_Click); this.id = id; adjustDisplayPropertiesForContext(); }
private void createTextWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, bool buttonEdit, string buttonImage) { int bcol = 0; int totalWidth = 0; this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl); p = new Panel(); l = new Label(); p.BorderStyle = BorderStyle.None; if (rows > 1) { l.TextAlign = ContentAlignment.TopLeft; } else { l.TextAlign = ContentAlignment.MiddleLeft; } t = new Gizmox.WebGUI.Forms.TextBox(); if (thisAttribute.ATTRIB_INVISIBLE != null) { t.PasswordChar = '*'; } p.Margin = new Padding(0, 0, 0, 0); p.Padding = new Padding(0, 0, 0, 0); l.Margin = new Padding(0, 0, 0, 0); l.Padding = new Padding(0, 0, 0, 0); t.Margin = new Padding(0, 0, 0, 0); t.Padding = new Padding(0, 0, 0, 0); p.Name = "TWP_" + tabcol; t.Name = "TWT_" + tabcol; l.Name = "TWL_" + tabcol; if (buttonEdit) { if (configSettings["BUTTONWIDTH"] != null) { bcol = Convert.ToInt32((string)configSettings["BUTTONWIDTH"]); } else { bcol = 1; } } t.Visible = true; t.Enabled = true; SizeControl(ma, index, p); if (bcol > 0) { p.Size = new Size(GuiLayout.get_gui_w(columns + bcol + 1) + 5, GuiLayout.get_gui_h(rows)); } if (rows > 1) { t.Multiline = true; } else { t.Multiline = false; } // Any columns used for the button must be subtracted from the length of the // textbox.. // t.Size = new Size(GuiLayout.get_gui_w(columns), GuiLayout.get_gui_h(rows)); //l.Size = new Size(GuiLayout.get_gui_w(columns), GuiLayout.get_gui_h(rows)); t.Height = GuiLayout.get_gui_h(rows); if (columns > 2 || true) { totalWidth = GuiLayout.get_gui_w(columns + 1); } else { totalWidth = GuiLayout.get_gui_w(4); } if (rows == 1) { this.MaxLength = columns; } else { this.MaxLength = columns * rows; } if (Upshift) { t.CharacterCasing = CharacterCasing.Upper; } if (Downshift) { t.CharacterCasing = CharacterCasing.Lower; } l.Visible = true; l.BorderStyle = BorderStyle.Fixed3D; //l.BackColor = Color.Red; if (buttonEdit) { b = new Button(); b.TabStop = false; if (configSettings["TEXT"] != null) { b.Text = (string)configSettings["TEXT"]; } else { b.Text = "!"; } //b.Size = new Size(GuiLayout.get_gui_w(bcol), GuiLayout.get_gui_h(rows)-4); b.Top = 0; if (bcol > 0) { //reservedButtonWidth = bcol; b.Size = new System.Drawing.Size(GuiLayout.get_gui_w(bcol + 1), GuiLayout.get_gui_h(1)); } else { //reservedButtonWidth = 1; b.Size = new System.Drawing.Size(GuiLayout.get_gui_w(2), GuiLayout.get_gui_h(1)); } if (configSettings["IMAGE"] == null) { b.Image = FGLWebUtils.getImageFromName("zoom.png"); } else { b.Image = FGLWebUtils.getImageFromName((string)configSettings["IMAGE"]); } if (bcol > 0) { t.Width = totalWidth; // -(GuiLayout.get_gui_w(bcol) + 5); b.Left = totalWidth; // -b.Width; } else { t.Width = totalWidth; //-(b.Width +5); b.Left = totalWidth; // -b.Width; } //b.Left = GuiLayout.get_gui_x(column) ; /* thats 2 pixels - not 2 characters */ b.Visible = true; } else { b = null; t.Width = totalWidth; } p.Height = GuiLayout.get_gui_h(rows); l.Left = 0; l.Top = 0; l.Size = t.Size; p.Controls.Add(t); p.Controls.Add(l); if (b != null) { p.Controls.Add(b); } // p.Size = l.Size; //t.KeyDown += new KeyEventHandler(t_KeyDown); //t.KeyPress += new KeyPressEventHandler(t_KeyPress); t.Enter += new EventHandler(t_GotFocus); t.TextChanged += new EventHandler(t_TextChanged); if (b != null) { b.Click += new EventHandler(t_Click); } else { t.Click += new EventHandler(t_Click); } t.ReadOnly = true; t.Visible = true; this.id = id; this.ContextType = FGLContextType.ContextNone; adjustDisplayPropertiesForContext(); }
private void createTextWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, bool buttonEdit, string buttonImage) { int bcol = 0; this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl); p = new Panel(); p.BorderStyle = BorderStyle.Fixed3D; tNullable = new NullableDateTimePicker(); tNullable.Format = DateTimePickerFormat.Custom; tNullable.CustomFormat = FGLUtils.DBDATEFormat_dotnet; tNullable.Visible = true; tNullable.Enabled = true; p.Margin = new Padding(0, 0, 0, 0); p.Padding = new Padding(0, 0, 0, 0); tNullable.Margin = new Padding(0, 0, 0, 0); tNullable.Padding = new Padding(0, 0, 0, 0); tNullable.Visible = true; tNullable.Enabled = true; tNullable.Value = null; SizeControl(ma, index, p); //p.Location = new System.Drawing.Point(GuiLayout.get_gui_x(column), GuiLayout.get_gui_y(row)); p.AutoSize = true; p.Name = "DTPP_" + tabcol; tNullable.Name = "DTPT_" + tabcol; //t.BackColor = Color.Red; //l.BackColor = Color.Blue; // Any columns used for the button must be subtracted from the length of the // textbox.. tNullable.Size = new Size(GuiLayout.get_gui_w(columns - bcol), GuiLayout.get_gui_h(rows)); p.Size = new Size(GuiLayout.get_gui_w(columns), GuiLayout.get_gui_h(rows)); if (columns > 2) { tNullable.Width = GuiLayout.get_gui_w(columns + 1); } else { tNullable.Width = GuiLayout.get_gui_w(3); } //t.KeyDown += new KeyEventHandler(t_KeyDown); //t.KeyPress += new KeyPressEventHandler(t_KeyPress); if (buttonEdit) { b = new Button(); b.TabStop = false; if (configSettings["TEXT"] != null) { b.Text = (string)configSettings["TEXT"]; } else { b.Text = "!"; } b.Size = new Size(GuiLayout.get_gui_w(bcol), GuiLayout.get_gui_h(rows) - 4); b.Top = 0; if (configSettings["IMAGE"] == null) { b.Image = FGLWebUtils.getImageFromName("zoom"); } else { b.Image = FGLWebUtils.getImageFromName((string)configSettings["IMAGE"]); } b.Left = tNullable.Width + 1; //b.Left = GuiLayout.get_gui_x(column) ; /* thats 2 pixels - not 2 characters */ b.Visible = true; } else { b = null; } p.Controls.Add(tNullable); if (b != null) { p.Controls.Add(b); } // p.Size = l.Size; tNullable.KeyDown += new KeyEventHandler(t_KeyDown); tNullable.KeyPress += new KeyPressEventHandler(t_KeyPress); tNullable.Enter += new EventHandler(t_GotFocus); tNullable.TextChanged += new EventHandler(t_TextChanged); if (b != null) { b.Click += new EventHandler(t_Click); } else { tNullable.Click += new EventHandler(t_Click); } tNullable.Visible = true; this.id = id; this.ContextType = FGLContextType.ContextNone; adjustDisplayPropertiesForContext(); }