Пример #1
0
        internal void ui_combobox_additem(string name, string text)
        {
            FGLComboEntry ce;

            ce = new FGLComboEntry(name, text);
            t.Items.Add(ce);
        }
 public static FGLComboEntry[] createItems(AubitDesktop.Xml.XMLForm.Item[] items)
 {
     FGLComboEntry [] o;
     if (items != null)
     {
         o = new FGLComboEntry[items.Length];
         for (int a = 0; a < items.Length; a++)
         {
             o[a] = new FGLComboEntry(items[a].name, items[a].text);
         }
     }
     else
     {
         o = new FGLComboEntry[0];
     }
     return(o);
 }
Пример #3
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;
        }