public void SizeControl(AubitDesktop.Xml.XMLForm.Matrix ma, int index, Control c) { // int coffset = 0; c.Height = GuiLayout.get_gui_h(_rows); if (_columns > 2 || true) { c.Width = GuiLayout.get_gui_w(_columns + 1); // coffset = 1; } else { c.Width = GuiLayout.get_gui_w(3); } if (configSettings.ContainsKey("HEIGHT")) { c.Height = GuiLayout.get_gui_h(Convert.ToInt32((string)configSettings["HEIGHT"])); } if (configSettings.ContainsKey("WIDTH")) { c.Width = GuiLayout.get_gui_w(Convert.ToInt32((string)configSettings["WIDTH"])); } c.Visible = true; c.Location = GuiLayout.getPoint(ma, index, _column, _row); }
/* * 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 PictureBox(); #region SetImageFromFile if (configSettings.ContainsKey("FILENAME")) { string dir; Image obj; // NOTWEBGUI //WEBGUI Gizmox.WebGUI.Common.Resources.ResourceHandle obj; obj = FGLUtils.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 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 WebBrowser(); #region SetImageFromFile if (configSettings.ContainsKey("URL")) { pb.Url = new Uri((string)configSettings["URL"]); } #endregion pb.ScrollBarsEnabled = true; SizeControl(ma, index, pb); pb.Visible = true; pb.Location = GuiLayout.getPoint(ma, index, column, row); }