Exemplo n.º 1
0
        protected virtual void Build()
        {
            Gui.Initialize((Widget)this);
            this.Name           = "Gtk.ColorPickerDialog";
            this.Title          = Catalog.GetString("dialog1");
            this.WindowPosition = WindowPosition.CenterOnParent;
            this.Resizable      = false;
            VBox vbox = this.VBox;

            vbox.Name                    = "dialog1_VBox";
            vbox.BorderWidth             = 2U;
            this.eventbox_bg             = new EventBox();
            this.eventbox_bg.Name        = "eventbox_bg";
            this.eventbox_bg.BorderWidth = 12U;
            vbox.Add((Widget)this.eventbox_bg);
            ((Box.BoxChild)vbox[(Widget)this.eventbox_bg]).Position = 0;
            HButtonBox actionArea = this.ActionArea;

            actionArea.Name                = "dialog1_ActionArea";
            actionArea.Spacing             = 10;
            actionArea.BorderWidth         = 5U;
            actionArea.LayoutStyle         = ButtonBoxStyle.End;
            this.buttonCancel              = new Button();
            this.buttonCancel.CanDefault   = true;
            this.buttonCancel.CanFocus     = true;
            this.buttonCancel.Name         = "buttonCancel";
            this.buttonCancel.UseStock     = true;
            this.buttonCancel.UseUnderline = true;
            this.buttonCancel.Label        = "gtk-cancel";
            this.AddActionWidget((Widget)this.buttonCancel, -6);
            ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel];
            buttonBoxChild1.Expand     = false;
            buttonBoxChild1.Fill       = false;
            this.buttonOk              = new Button();
            this.buttonOk.CanDefault   = true;
            this.buttonOk.CanFocus     = true;
            this.buttonOk.Name         = "buttonOk";
            this.buttonOk.UseStock     = true;
            this.buttonOk.UseUnderline = true;
            this.buttonOk.Label        = "gtk-ok";
            this.AddActionWidget((Widget)this.buttonOk, -5);
            ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonOk];
            buttonBoxChild2.Position = 1;
            buttonBoxChild2.Expand   = false;
            buttonBoxChild2.Fill     = false;
            if (this.Child != null)
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 535;
            this.DefaultHeight = 294;
            this.Show();
        }
Exemplo n.º 2
0
 public ColorPickerDialog(Color initColor)
 {
     this.Build();
     this.buttonOk.Name     = "MainButton";
     this.buttonOk.HasFocus = true;
     this.SetToDialogStyle((Window)null, true, true, true);
     if (Platform.IsWindows)
     {
         HButtonBox actionArea = this.ActionArea;
         ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonOk];
         ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel];
         buttonBoxChild1.Position = 0;
         buttonBoxChild2.Position = 1;
     }
     this.ColorPicker = new ColorSelection();
     this.ColorPicker.PreviousColor     = initColor;
     this.ColorPicker.CurrentColor      = initColor;
     this.ColorPicker.HasOpacityControl = false;
     this.eventbox_bg.Add((Widget)this.ColorPicker);
     this.ColorPicker.ShowAll();
     this.InitKeys();
     this.InitMultiLanguage();
 }
Exemplo n.º 3
0
        private void ChangeBtnPosion()
        {
            HButtonBox actionArea = this.ActionArea;

            ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonYes];
            ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel];
            ButtonBox.ButtonBoxChild buttonBoxChild3 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonNo];
            if (Platform.IsWindows)
            {
                buttonBoxChild1.Position = 0;
                buttonBoxChild3.Position = 1;
                buttonBoxChild2.Position = 2;
            }
            else
            {
                if (!Platform.IsMac)
                {
                    return;
                }
                buttonBoxChild3.Position = 0;
                buttonBoxChild2.Position = 1;
                buttonBoxChild1.Position = 2;
            }
        }
Exemplo n.º 4
0
        protected virtual void Build()
        {
            Gui.Initialize((Widget)this);
            this.Name           = "Gtk.MessageBoxDialog";
            this.WindowPosition = WindowPosition.CenterOnParent;
            this.Resizable      = false;
            this.AllowGrow      = false;
            VBox vbox = this.VBox;

            vbox.Name                  = "dialog1_VBox";
            vbox.BorderWidth           = 2U;
            this.vbox_main             = new VBox();
            this.vbox_main.Name        = "vbox_main";
            this.vbox_main.Spacing     = 6;
            this.vbox_main.BorderWidth = 15U;
            this.vbox_top              = new VBox();
            this.vbox_top.Name         = "vbox_top";
            this.vbox_top.Spacing      = 6;
            this.vbox_main.Add((Widget)this.vbox_top);
            ((Box.BoxChild) this.vbox_main[(Widget)this.vbox_top]).Position = 0;
            this.alignment_label               = new Alignment(0.5f, 0.5f, 1f, 1f);
            this.alignment_label.Name          = "alignment_label";
            this.alignment_label.TopPadding    = 18U;
            this.alignment_label.BottomPadding = 18U;
            this.labelInfo           = new Label();
            this.labelInfo.Name      = "labelInfo";
            this.labelInfo.LabelProp = Catalog.GetString("label1");
            this.labelInfo.Wrap      = true;
            this.alignment_label.Add((Widget)this.labelInfo);
            this.vbox_main.Add((Widget)this.alignment_label);
            Box.BoxChild boxChild = (Box.BoxChild) this.vbox_main[(Widget)this.alignment_label];
            boxChild.Position        = 1;
            boxChild.Expand          = false;
            boxChild.Fill            = false;
            this.vbox_bottom         = new VBox();
            this.vbox_bottom.Name    = "vbox_bottom";
            this.vbox_bottom.Spacing = 6;
            this.vbox_main.Add((Widget)this.vbox_bottom);
            ((Box.BoxChild) this.vbox_main[(Widget)this.vbox_bottom]).Position = 2;
            vbox.Add((Widget)this.vbox_main);
            ((Box.BoxChild)vbox[(Widget)this.vbox_main]).Position = 0;
            HButtonBox actionArea = this.ActionArea;

            actionArea.Name                = "dialog1_ActionArea";
            actionArea.Spacing             = 10;
            actionArea.BorderWidth         = 5U;
            actionArea.LayoutStyle         = ButtonBoxStyle.End;
            this.buttonCancel              = new Button();
            this.buttonCancel.CanDefault   = true;
            this.buttonCancel.CanFocus     = true;
            this.buttonCancel.Name         = "buttonCancel";
            this.buttonCancel.UseStock     = true;
            this.buttonCancel.UseUnderline = true;
            this.buttonCancel.Label        = "gtk-cancel";
            this.AddActionWidget((Widget)this.buttonCancel, -6);
            ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel];
            buttonBoxChild1.Expand     = false;
            buttonBoxChild1.Fill       = false;
            this.buttonNo              = new Button();
            this.buttonNo.CanFocus     = true;
            this.buttonNo.Name         = "buttonNo";
            this.buttonNo.UseStock     = true;
            this.buttonNo.UseUnderline = true;
            this.buttonNo.Label        = "gtk-no";
            this.AddActionWidget((Widget)this.buttonNo, -9);
            ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonNo];
            buttonBoxChild2.Position    = 1;
            buttonBoxChild2.Expand      = false;
            buttonBoxChild2.Fill        = false;
            this.buttonYes              = new Button();
            this.buttonYes.CanDefault   = true;
            this.buttonYes.CanFocus     = true;
            this.buttonYes.Name         = "buttonYes";
            this.buttonYes.UseStock     = true;
            this.buttonYes.UseUnderline = true;
            this.buttonYes.Label        = "gtk-yes";
            this.AddActionWidget((Widget)this.buttonYes, -8);
            ButtonBox.ButtonBoxChild buttonBoxChild3 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonYes];
            buttonBoxChild3.Position = 2;
            buttonBoxChild3.Expand   = false;
            buttonBoxChild3.Fill     = false;
            if (this.Child != null)
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 244;
            this.DefaultHeight = 160;
            this.Show();
        }