Exemplo n.º 1
0
        private void Initialize()
        {
            // Pressing enter should save and close the dialog
            //Dialog.DefaultResponse = Gtk.ResponseType.Ok;
            ok_button.HasDefault = true;

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = Dialog.SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            Dialog.SetGeometryHints(Dialog, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            type_combo.RemoveText(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            ok_button.Sensitive = true;
            type_combo.GrabFocus();
        }
Exemplo n.º 2
0
        private void Initialize ()
        {
            DefaultResponse = Gtk.ResponseType.Ok;
            AddStockButton (Stock.Cancel, ResponseType.Cancel);
            AddStockButton (Stock.Ok, ResponseType.Ok, true);

            SetGeometryHints (this, new Gdk.Geometry () {
                    MinWidth = SizeRequest ().Width,
                    MaxWidth = Gdk.Screen.Default.Width,
                    MinHeight = -1,
                    MaxHeight = -1
                }, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            var table = new Table (2, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 6
            };

            table.Attach (new Label () {
                    Text = Catalog.GetString ("Station _Type:"),
                    UseUnderline = true,
                    Xalign = 0.0f
                }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach (arg_label = new Label () {
                    Xalign = 0.0f
                }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach (type_combo = ComboBox.NewText (),
                1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            table.Attach (arg_entry = new Entry (),
                1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            type_combo.RemoveText (0);
            int active_type = 0;
            int i = 0;
            foreach (StationType type in StationType.Types) {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber) {
                    type_combo.AppendText (type.Label);
                    if (source != null && type == source.Type) {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active = active_type;
            type_combo.GrabFocus ();
        }
Exemplo n.º 3
0
        private void Initialize()
        {
            DefaultResponse = Gtk.ResponseType.Ok;
            AddStockButton(Stock.Cancel, ResponseType.Cancel);
            AddStockButton(Stock.Ok, ResponseType.Ok, true);

            SetGeometryHints(this, new Gdk.Geometry()
            {
                MinWidth  = SizeRequest().Width,
                MaxWidth  = Gdk.Screen.Default.Width,
                MinHeight = -1,
                MaxHeight = -1
            }, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            var table = new Table(2, 2, false)
            {
                RowSpacing    = 12,
                ColumnSpacing = 6
            };

            table.Attach(new Label()
            {
                Text         = Catalog.GetString("Station _Type:"),
                UseUnderline = true,
                Xalign       = 0.0f
            }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_label = new Label()
            {
                Xalign = 0.0f
            }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(type_combo = ComboBox.NewText(),
                         1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_entry = new Entry(),
                         1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            VBox.PackStart(table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll();

            type_combo.RemoveText(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            type_combo.GrabFocus();
        }