コード例 #1
0
        public Widget ResolveEditor(PropertyItem item = null)
        {
            this.widget = new DefaultEditorGtk();
            HBox      hbox      = new HBox();
            Alignment alignment = new Alignment(0.5f, 0.5f, 1f, 1f);

            alignment.RightPadding = 30U;
            alignment.Add((Widget)this.widget);
            alignment.ShowAll();
            this.widget.Show();
            hbox.Add((Widget)alignment);
            Box.BoxChild boxChild = hbox[(Widget)alignment] as Box.BoxChild;
            boxChild.Position = 1;
            boxChild.Expand   = true;
            boxChild.Fill     = true;
            hbox.ShowAll();
            if (item.DiaplayName == "Display_LabelFirstChar")
            {
                this.widget.MaxLength = 1;
            }
            this.SetControl();
            this.widget.KeyReleaseEvent += new KeyReleaseEventHandler(this.widget_KeyReleaseEvent);
            this.widget.FocusOutEvent   += new FocusOutEventHandler(this.widget_FocusOutEvent);
            return((Widget)hbox);
        }
コード例 #2
0
 public PasswordEditorWidget()
 {
     this.table2                          = new Table(1U, 2U, false);
     this.table2.Name                     = "table2";
     this.table2.ColumnSpacing            = 6U;
     this.checkBox_Password               = new CheckButton();
     this.checkBox_Password.CanFocus      = true;
     this.checkBox_Password.Name          = "checkBox_Password";
     this.checkBox_Password.Active        = true;
     this.checkBox_Password.DrawIndicator = true;
     this.checkBox_Password.UseUnderline  = true;
     this.table2.Add((Widget)this.checkBox_Password);
     Table.TableChild tableChild1 = (Table.TableChild) this.table2[(Widget)this.checkBox_Password];
     tableChild1.XOptions            = AttachOptions.Fill;
     tableChild1.YOptions            = AttachOptions.Fill;
     this.txt_Password               = new DefaultEditorGtk();
     this.txt_Password.WidthRequest  = 10;
     this.txt_Password.CanFocus      = true;
     this.txt_Password.Name          = "txt_Password";
     this.txt_Password.IsEditable    = true;
     this.txt_Password.MaxLength     = 1;
     this.txt_Password.InvisibleChar = '●';
     this.table2.Add((Widget)this.txt_Password);
     Table.TableChild tableChild2 = (Table.TableChild) this.table2[(Widget)this.txt_Password];
     tableChild2.TopAttach    = 0U;
     tableChild2.BottomAttach = 1U;
     tableChild2.LeftAttach   = 1U;
     tableChild2.RightAttach  = 2U;
     tableChild2.YOptions     = AttachOptions.Fill;
     this.Add((Widget)this.table2);
     if (this.Child != null)
     {
         this.Child.ShowAll();
     }
     this.Hide();
     this.ReadLanuageConfigFile();
     this.BeforeValueChanged += new System.Action(this.BeforEvent);
     this.AfterValueChanged  += new System.Action(this.AfterEvent);
     this.AfterEvent();
 }