Exemple #1
0
 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, 0, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl);
     pb = new ProgressBar();
     SizeControl(ma, index, pb);
     pb.Click += new EventHandler(b_Click);
 }
Exemple #2
0
        internal ATTRIB createAttribForWidget(AubitDesktop.Xml.XMLForm.FormField ff)
        {
            ATTRIB a = new ATTRIB();


            if (ff.noEntry != null)
            {
                a.ATTRIB_NOENTRY = new ATTRIB_NOENTRY();
            }
            if (ff.required != null)
            {
                a.ATTRIB_REQUIRED = new ATTRIB_REQUIRED();
            }

            if (ff.hidden != null)
            {
                a.ATTRIB_INVISIBLE = new ATTRIB_INVISIBLE();
            }
            if (ff.sqlType != null)
            {
                a.DATATYPE      = decode_datatype(ff.sqlType).ToString();
                a.DATATYPE_SIZE = decode_datatype_size(ff.sqlType).ToString();
            }
            a.ATTRIBUTE_NO = ff.fieldId;



            if (ff.defaultValue != null)
            {
                a.ATTRIB_DEFAULT      = new ATTRIB_DEFAULT();
                a.ATTRIB_DEFAULT.Text = ff.defaultValue;
            }

            return(a);
        }
        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, string txt)
        {
            this.SetWidget(thisAttribute, ma, row, index, column, 1, columns, widget, config, id, tabcol, action, attributeNo, incl);
            p             = new Panel();
            p.BorderStyle = BorderStyle.None;

            p.Margin  = new Padding(0, 0, 0, 0);
            p.Padding = new Padding(0, 0, 0, 0);
            p.Name    = "TWP_" + tabcol;

            btn = new Button();
            SizeControl(ma, index, btn);

            btn.Visible  = true;
            btn.AutoSize = true;


            if (txt != null && txt.Length > 0)
            {
                this.Text = txt;
            }
            if (configSettings.ContainsKey("TEXT"))
            {
                this.Text = (string)configSettings["TEXT"];
            }
            btn.Click  += new EventHandler(b_Click);
            p.BackColor = Color.Transparent;
            p.Width     = 1;
            p.Height    = 1;


            p.Controls.Add(btn);
            p.AutoSize = true;
            ContextTypeChanged();
        }
        private void createCheckBoxWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, string cbText)
        {
            int bcol = 1;

            this.SetWidget(thisAttribute, ma, row, index, column, 1, columns, widget, config, id, tabcol, action, attributeNo, incl);

            cbFieldWidget = new CheckBox();

            p             = new Panel();
            p.BorderStyle = BorderStyle.None;

            p.Margin  = new Padding(0, 0, 0, 0);
            p.Padding = new Padding(0, 0, 0, 0);
            p.Name    = "TWP_" + tabcol;
            if (bcol > 0)
            {
                //   p.Size = new Size(GuiLayout.get_gui_w(columns + bcol + 1) - 5, GuiLayout.get_gui_h(1));
            }

            SizeControl(ma, index, cbFieldWidget);
            if (cbText != null)
            {
                cbFieldWidget.Text = cbText;
            }
            cbFieldWidget.AutoCheck = true;
            cbFieldWidget.Visible   = true;
            cbFieldWidget.AutoSize  = true;
            cbFieldWidget.Padding   = new Padding(1, 1, 0, 1);
            setFocusColor(false);
            //cbFieldWidget.Text = "#";
            //cb.Location = new System.Drawing.Point(GuiLayout.get_gui_x(column), GuiLayout.get_gui_y(row));

            cbFieldWidget.CausesValidation = true;
            cbFieldWidget.Validating      += new System.ComponentModel.CancelEventHandler(t_Validating);
            cbFieldWidget.Enter           += new EventHandler(t_GotFocus);
            cbFieldWidget.Leave           += new EventHandler(cbFieldWidget_Leave);
            cbFieldWidget.TabStop          = true;
            cbFieldWidget.Click           += new EventHandler(t_Click);

            // cbFieldWidget.KeyPress += new KeyPressEventHandler(cbFieldWidget_KeyPress);

            //p.Height = GuiLayout.get_gui_h(row);
            p.BackColor = Color.Transparent;
            p.Width     = 1;
            p.Height    = 1;


            p.Controls.Add(cbFieldWidget);
            p.AutoSize = true;
            this.id    = id;
        }
Exemple #5
0
        private void createRadioButtonWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, AubitDesktop.Xml.XMLForm.Radio r)
        {
            this.SetWidget(thisAttribute, ma, row, index, column, 1, columns, widget, config, id, tabcol, action, attributeNo, incl);
            int minWidth = 0;

            p = new FlowLayoutPanel();
            p.FlowDirection = FlowDirection.TopDown;
            p.AutoSize      = true;
            rbFieldWidget   = new RadioButton[r.Items.Length];
            strValues       = new string[r.Items.Length];
            if (r.Items.Length > 0)
            {
                for (int a = 0; a < r.Items.Length; a++)
                {
                    strValues[a] = r.Items[a].name;
                    RadioButton rb = new RadioButton();
                    if (r.Items[a].text != "-")
                    {
                        rb.Text = r.Items[a].text;
                    }
                    rbFieldWidget[a] = rb;
                    p.Controls.Add(rb);
                    rb.AutoSize = true;
                    if (rb.Width > minWidth)
                    {
                        minWidth = rb.Width;
                    }
                    rb.Visible = true;
                    rb.TabStop = true;
                    rb.Enabled = true;
                }
            }

            SizeControl(ma, index, p);

            // p.BackColor = Color.Red;
            p.Visible = true;

            p.MinimumSize = new Size(minWidth, rbFieldWidget[0].Height * r.Items.Length);
            //    p.AutoSize = true;

            p.CausesValidation = true;
            // p.Validating += new System.ComponentModel.CancelEventHandler(t_Validating);
            p.Enter  += new EventHandler(t_GotFocus);
            p.TabStop = true;

            this.id = id;
        }
        /*
         * 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);
        }
        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, string origText)
        {
            this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl);
            l           = new Label();
            l.TextAlign = ContentAlignment.MiddleLeft;
            l.BackColor = System.Drawing.SystemColors.Control;
            l.ForeColor = System.Drawing.SystemColors.ControlText;
            SizeControl(ma, index, l);
            if (origText != "")
            {
                this.Text = origText;
            }

            if (configSettings.ContainsKey("TEXT"))
            {
                this.Text = (string)configSettings["TEXT"];
            }
            //if (this.Text == "") this.Text = tabcol;
            l.Click += new EventHandler(b_Click);
            ContextTypeChanged();
        }
Exemple #9
0
        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, string txt)
        {
            this.SetWidget(thisAttribute, ma, row, index, column, 1, columns, widget, config, id, tabcol, action, attributeNo, incl);

            btn = new Button();
            SizeControl(ma, index, btn);

            btn.Visible  = true;
            btn.AutoSize = true;


            if (txt != null && txt.Length > 0)
            {
                this.Text = txt;
            }
            if (configSettings.ContainsKey("TEXT"))
            {
                this.Text = (string)configSettings["TEXT"];
            }
            btn.Click += new EventHandler(b_Click);
            ContextTypeChanged();
        }
 public FGLPixmapFieldWidget(ATTRIB thisAttribute, int row, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl)
 {
     createWidget(thisAttribute, null, row, 0, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl);
 }
        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 = FGLUtils.getImageFromName("zoom");
                }
                else
                {
                    b.Image = FGLUtils.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.CausesValidation = true;
            tNullable.KeyDown         += new KeyEventHandler(t_KeyDown);
            tNullable.KeyPress        += new KeyPressEventHandler(t_KeyPress);
            tNullable.Validating      += new System.ComponentModel.CancelEventHandler(t_Validating);
            tNullable.Enter           += new EventHandler(t_GotFocus);
            tNullable.TextChanged     += new EventHandler(t_TextChanged);
            //t.Validating += new System.ComponentModel.CancelEventHandler(t_Validating);
            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();
        }
        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();
            //lblInsteadOfTxtBox = new Label();
            p.BorderStyle = BorderStyle.None;

            /*
             * if (rows > 1)
             * {
             *  lblInsteadOfTxtBox.TextAlign = ContentAlignment.TopLeft;
             * }
             * else
             * {
             *  lblInsteadOfTxtBox.TextAlign = ContentAlignment.MiddleLeft;
             * } */

            t = new System.Windows.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);
            // lblInsteadOfTxtBox.Margin = new Padding(0, 0, 0, 0);
            //lblInsteadOfTxtBox.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;
            // lblInsteadOfTxtBox.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;
            }


            if (false)
            {
                // lblInsteadOfTxtBox.Visible = true;
                // lblInsteadOfTxtBox.BorderStyle = BorderStyle.Fixed3D;
            }

            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.Width = GuiLayout.get_gui_w(bcol);     //NOTWEBGUI
                    //WEBGUI b.Size = new System.Drawing.Size( GuiLayout.get_gui_w(bcol+1),  GuiLayout.get_gui_h(1));
                }
                else
                {
                    //reservedButtonWidth = 1;
                    b.Width = GuiLayout.get_gui_w(1); //NOTWEBGUI
                    //WEBGUI b.Size = new System.Drawing.Size( GuiLayout.get_gui_w(2),  GuiLayout.get_gui_h(1));
                }

                if (configSettings["IMAGE"] == null)
                {
                    //WEBGUI b.Image = FGLUtils.getImageFromName("zoom.png");
                    b.Image = FGLUtils.getImageFromName("zoom"); //NOTWEBGUI
                }
                else
                {
                    b.Image = FGLUtils.getImageFromName((string)configSettings["IMAGE"]);
                }


                b.Height = b.Image.Height + 4;  // NOTWEBGUI
                b.Width  = b.Image.Width + 4;   // NOTWEBGUI
                if (b.Image.Height > t.Height)  // NOTWEBGUI
                {                               // NOTWEBGUI
                    b.Height = t.Height;        // NOTWEBGUI
                }                               // NOTWEBGUI


                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);
            // lblInsteadOfTxtBox.Left = 0;
            //lblInsteadOfTxtBox.Top = 0;
            //lblInsteadOfTxtBox.Size = t.Size;
            p.Controls.Add(t);
            // p.Controls.Add(lblInsteadOfTxtBox);
            p.AutoSize = true; //NOTWEBGUI
            if (b != null)
            {
                p.Controls.Add(b);
            }

            // p.Size = l.Size;

            t.CausesValidation = true;
            //t.KeyDown += new KeyEventHandler(t_KeyDown);
            t.KeyPress    += new KeyPressEventHandler(t_KeyPress);
            t.Validating  += new System.ComponentModel.CancelEventHandler(t_Validating);
            t.Enter       += new EventHandler(t_GotFocus);
            t.TextChanged += new EventHandler(t_TextChanged);

            // EventHandler moveNext = new EventHandler(TheMethod);

            //t.Validating += new System.ComponentModel.CancelEventHandler(t_Validating);
            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();
        }
 public FGLTextFieldWidget(ATTRIB thisAttribute, int row, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, bool buttonEdit)
 {
     createTextWidget(thisAttribute, null, row, 0, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl, buttonEdit, "");
 }
Exemple #14
0
        internal void SetWidget(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[] configArr;

            //System.Resources.ResourceManager rm = new System.Resources.ResourceManager("ResourceClient.Images", System.Reflection.Assembly.GetExecutingAssembly());
            attrib   = thisAttribute;
            _row     = row;
            _column  = column;
            _rows    = rows;
            _columns = columns;
            _Widget  = widget;
            _Config  = config;
            _id      = id;
            _comment = "";
            if (thisAttribute.ATTRIB_COMMENTS != null)
            {
                _comment = thisAttribute.ATTRIB_COMMENTS.Text;
            }

            includeValues = null;

            this._onUIEvent             = null;
            this._fieldValidationFailed = null;
            this._afterFieldID          = "";
            this._onActionID            = "";
            this._beforeFieldID         = "";
            if (_Config == null)
            {
                _Config = "";
            }

            configSettings = FGLWidgetConfigSettings.GetSettings(_Config);

            //if (thisAttribute)

            string[] f = tabcol.Split('.');
            if (f.Length == 1)
            {
                _TableName  = "";
                _ColumnName = f[0];
            }
            else
            {
                _TableName  = f[0];
                _ColumnName = f[1];
            }

            _Action      = action;
            _attributeNo = attributeNo;

            if (incl != null)
            {
                if (incl.Length > 0)
                {
                    this.includeValues = new List <string>();
                    string[] incvals;
                    incvals = incl.Split('\n');
                    for (int a = 0; a < incvals.Length; a++)
                    {
                        if (incvals[a].Contains("|"))
                        {
                            this.includeValues.AddRange(incvals[a].Split('|'));
                        }
                        else
                        {
                            this.includeValues.Add(incvals[a]);
                        }
                    }
                }
            }
        }
Exemple #15
0
 internal void SetWidget()
 {
     attrib = new ATTRIB();
 }
 public FGLBrowserFieldWidget(ATTRIB thisAttribute, int row, int column, int rows, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl)
 {
     createWidget(thisAttribute, null, row, 0, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl);
     SizeControl(null, 0, pb);
     ContextTypeChanged();
 }
        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();
        }
Exemple #18
0
        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, AubitDesktop.Xml.XMLForm.Item[] items)
        {
            this.SetWidget(thisAttribute, ma, row, index, column, rows, columns, widget, config, id, tabcol, action, attributeNo, incl);

            p           = new Panel();
            l           = new Label();
            l.TextAlign = ContentAlignment.MiddleLeft;
            t           = new Gizmox.WebGUI.Forms.ComboBox();

            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;
            SizeControl(ma, index, p);

            t.Size = p.Size;


            t.TextChanged += new EventHandler(t_TextChanged);

            // Any columns used for the button must be subtracted from the length of the
            // textbox..


            if (columns > 2)
            {
                t.Width = GuiLayout.get_gui_w(columns + 1);
            }
            else
            {
                t.Width = GuiLayout.get_gui_w(3);
            }

            _maxLength = columns;


            l.Size = t.Size;

            /*
             * if (Upshift)
             * {
             *
             *  t.CharacterCasing = CharacterCasing.Upper;
             * }
             *
             * if (Downshift)
             * {
             *  t.CharacterCasing = CharacterCasing.Lower;
             * }
             */


            l.Visible     = true;
            l.BorderStyle = BorderStyle.Fixed3D;

            t.DropDownStyle = ComboBoxStyle.DropDownList;

            p.Controls.Add(t);
            p.Controls.Add(l);


            FGLComboEntry[] cbItems = FGLComboEntry.createItems(items);

            setItems(cbItems);

            // p.Size = l.Size;


            t.CausesValidation = true;
            t.Validating      += new System.ComponentModel.CancelEventHandler(t_Validating);
            t.Enter           += new EventHandler(t_GotFocus);
            t.Click           += new EventHandler(t_Click);
            t.Visible          = true;
            t.Enabled          = true;

            this.id = id;
        }