public OpenLocationDialog() : base(Catalog.GetString("Open Location")) { var location_box = new HBox() { Spacing = 6 }; address_entry = ComboBoxEntry.NewText(); address_entry.Entry.Activated += (o, e) => Respond(ResponseType.Ok); var browse_button = new Button(Catalog.GetString("Browse...")); browse_button.Clicked += OnBrowseClicked; location_box.PackStart(address_entry, true, true, 0); location_box.PackStart(browse_button, false, false, 0); VBox.Spacing = 6; VBox.PackStart(new Label() { Xalign = 0.0f, Text = Catalog.GetString( "Enter the address of the file you would like to open:") }, false, false, 0); VBox.PackStart(location_box, false, false, 0); VBox.ShowAll(); AddStockButton(Stock.Cancel, ResponseType.Cancel); AddStockButton(Stock.Open, ResponseType.Ok, true); LoadHistory(); address_entry.Entry.HasFocus = true; }
public OpenRemoteServer() : base(Catalog.GetString("Open remote DAAP server"), null) { VBox.Spacing = 6; VBox.PackStart(new Label() { Xalign = 0.0f, Text = Catalog.GetString("Enter server IP address and port:") }, true, true, 0); HBox box = new HBox(); box.Spacing = 12; VBox.PackStart(box, false, false, 0); address_entry = ComboBoxEntry.NewText(); address_entry.Entry.Activated += OnEntryActivated; address_entry.Entry.WidthChars = 30; address_entry.Show(); port_entry = new SpinButton(1d, 65535d, 1d); port_entry.Value = 3689; port_entry.Show(); box.PackStart(address_entry, true, true, 0); box.PackEnd(port_entry, false, false, 0); address_entry.HasFocus = true; VBox.ShowAll(); AddStockButton(Stock.Cancel, ResponseType.Cancel); AddStockButton(Stock.Add, ResponseType.Ok, true); LoadHistory(); }
public StationDialog(Stations stations, Station station) { glade = new Glade.XML(null, "radio.glade", "StationDialog", "banshee"); glade.Autoconnect(this); dialog = (Dialog)glade.GetWidget("StationDialog"); Banshee.Base.IconThemeUtils.SetWindowIcon(dialog); if (station == null) { is_new = true; station = new Station(); } this.stations = stations; this.station = station; link_store = new LinkStore(station); view = new NodeView(link_store); view.HeadersVisible = true; CellRendererToggle active_renderer = new CellRendererToggle(); active_renderer.Activatable = true; active_renderer.Radio = true; active_renderer.Toggled += OnLinkToggled; view.AppendColumn(Catalog.GetString("Active"), active_renderer, ActiveDataFunc); view.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), TypeDataFunc); view.AppendColumn(Catalog.GetString("Title"), EditTextRenderer(), "text", 1); view.AppendColumn(Catalog.GetString("URI"), EditTextRenderer(), "text", 2); view.Show(); (glade["link_view_container"] as ScrolledWindow).Add(view); group_combo = ComboBoxEntry.NewText(); group_combo.Show(); (glade["group_combo_container"] as Box).PackStart(group_combo, true, true, 0); title_entry.Text = station.Title == null ? String.Empty : station.Title; description_entry.Text = station.Description == null ? String.Empty : station.Description; group_combo.Entry.Text = station.Group == null ? String.Empty : station.Group; foreach (string group in stations.Groups) { group_combo.AppendText(group); } }
public OpenLocationDialog() : base("OpenLocationDialog") { address_entry = ComboBoxEntry.NewText(); address_entry.Show(); address_entry.Entry.Activated += OnEntryActivated; browse_button = new Button(Catalog.GetString("Browse...")); browse_button.Clicked += OnBrowseClicked; browse_button.Show(); location_box.PackStart(address_entry, true, true, 0); location_box.PackStart(browse_button, false, false, 0); Dialog.Response += OnResponse; LoadHistory(); address_entry.Entry.HasFocus = true; }
public EntryComBoxEditorWidget() { this.table1 = new Table(1U, 4U, false); this.table1.Name = "table1"; this.table1.RowSpacing = 6U; this.table1.ColumnSpacing = 6U; this.comboboxentry1 = ComboBoxEntry.NewText(); this.comboboxentry1.WidthRequest = 40; this.comboboxentry1.Name = "comboboxentry1"; this.table1.Add((Widget)this.comboboxentry1); Table.TableChild tableChild1 = (Table.TableChild) this.table1[(Widget)this.comboboxentry1]; tableChild1.LeftAttach = 1U; tableChild1.RightAttach = 2U; tableChild1.YOptions = AttachOptions.Fill; this.comboboxentry2 = ComboBoxEntry.NewText(); this.comboboxentry2.WidthRequest = 40; this.comboboxentry2.Name = "comboboxentry2"; this.table1.Add((Widget)this.comboboxentry2); Table.TableChild tableChild2 = (Table.TableChild) this.table1[(Widget)this.comboboxentry2]; tableChild2.LeftAttach = 3U; tableChild2.RightAttach = 4U; tableChild2.YOptions = AttachOptions.Fill; this.labelOne = new Label(); this.labelOne.Name = "labelOne"; this.labelOne.Xalign = 1f; this.labelOne.LabelProp = Catalog.GetString("label1"); this.table1.Add((Widget)this.labelOne); Table.TableChild tableChild3 = (Table.TableChild) this.table1[(Widget)this.labelOne]; tableChild3.XOptions = AttachOptions.Fill; tableChild3.YOptions = AttachOptions.Fill; this.labelTwo = new Label(); this.labelTwo.Name = "labelTwo"; this.labelTwo.Xalign = 1f; this.labelTwo.LabelProp = Catalog.GetString("label2"); this.table1.Add((Widget)this.labelTwo); Table.TableChild tableChild4 = (Table.TableChild) this.table1[(Widget)this.labelTwo]; tableChild4.LeftAttach = 2U; tableChild4.RightAttach = 3U; tableChild4.XOptions = AttachOptions.Fill; tableChild4.YOptions = AttachOptions.Fill; this.Add((Widget)this.table1); if (this.Child != null) { this.Child.ShowAll(); } this.Hide(); this.ReadLanuageConfigFile(); this.labelOne.Text = "W"; this.labelTwo.Text = "H"; ListStore listStore = new ListStore(new Type[1] { typeof(string) }); foreach (int combox in this.comboxList) { listStore.AppendValues(new object[1] { (object)combox.ToString() }); } this.comboboxentry1.Model = (TreeModel)listStore; CellRendererText cellRendererText = new CellRendererText(); this.comboboxentry1.PackStart((CellRenderer)cellRendererText, true); this.comboboxentry2.Model = (TreeModel)listStore; this.comboboxentry2.PackStart((CellRenderer)cellRendererText, true); this.comboboxentry1.Entry.MaxLength = 8; this.comboboxentry2.Entry.MaxLength = 8; this.comboboxentry2.HeightRequest = 25; }
void Build() { DefaultWidth = 470; DefaultHeight = 380; BorderWidth = 6; Resizable = false; VBox.Spacing = 6; buttonCancel = new Button(Gtk.Stock.Cancel); AddActionWidget(buttonCancel, ResponseType.Cancel); buttonOk = new Button(Gtk.Stock.Ok); AddActionWidget(buttonOk, ResponseType.Ok); var table = new Table(3, 2, false) { ColumnSpacing = 6, RowSpacing = 6 }; nameEntry = new Entry { WidthRequest = 350 }; viewEngineCombo = ComboBox.NewText(); templateCombo = ComboBox.NewText(); var nameLabel = new Label(GettextCatalog.GetString("_Name")) { MnemonicWidget = nameEntry, Xalign = 0 }; var templateLabel = new Label(GettextCatalog.GetString("_Template:")) { MnemonicWidget = nameEntry, Xalign = 0 }; var engineLabel = new Label(GettextCatalog.GetString("_View Engine:")) { MnemonicWidget = nameEntry, Xalign = 0 }; const AttachOptions expandFill = AttachOptions.Expand | AttachOptions.Fill; const AttachOptions fill = AttachOptions.Fill; table.Attach(nameLabel, 0, 1, 0, 1, fill, 0, 0, 0); table.Attach(nameEntry, 1, 2, 0, 1, expandFill, 0, 0, 0); table.Attach(templateLabel, 0, 1, 1, 2, fill, 0, 0, 0); table.Attach(templateCombo, 1, 2, 1, 2, expandFill, 0, 0, 0); table.Attach(engineLabel, 0, 1, 2, 3, fill, 0, 0, 0); table.Attach(viewEngineCombo, 1, 2, 2, 3, expandFill, 0, 0, 0); VBox.PackStart(table, false, false, 0); var frame = new Frame(GettextCatalog.GetString("Options")) { BorderWidth = 2 }; var optionsVBox = new VBox { Spacing = 6 }; var optionsAlignment = new Alignment(0.5f, 0.5f, 1f, 1f) { Child = optionsVBox, TopPadding = 4, BottomPadding = 4, RightPadding = 4, LeftPadding = 4 }; frame.Add(optionsAlignment); partialCheck = new CheckButton(GettextCatalog.GetString("_Partial view")) { UseUnderline = true }; stronglyTypedCheck = new CheckButton(GettextCatalog.GetString("_Strongly typed")) { UseUnderline = true }; masterCheck = new CheckButton(GettextCatalog.GetString("Has _master page or layout")) { UseUnderline = true }; dataClassCombo = ComboBoxEntry.NewText(); masterEntry = new Entry { WidthRequest = 250 }; placeholderCombo = ComboBoxEntry.NewText(); masterButton = new Button("..."); optionsVBox.PackStart(partialCheck); optionsVBox.PackStart(stronglyTypedCheck); typePanel = WithLabelAndLeftPadding(dataClassCombo, GettextCatalog.GetString("_Data class:"), true, 24); optionsVBox.PackStart(typePanel); optionsVBox.PackStart(masterCheck); var masterLabel = new Label(GettextCatalog.GetString("_File:")) { MnemonicWidget = masterEntry, Xalign = 0, UseUnderline = true }; placeholderLabel = new Label(GettextCatalog.GetString("P_rimary placeholder:")) { MnemonicWidget = placeholderCombo, Xalign = 0, UseUnderline = true }; var masterTable = new Table(2, 3, false) { RowSpacing = 6, ColumnSpacing = 6 }; masterTable.Attach(masterLabel, 0, 1, 0, 1, fill, 0, 0, 0); masterTable.Attach(masterEntry, 1, 3, 0, 1, expandFill, 0, 0, 0); masterTable.Attach(placeholderLabel, 0, 1, 1, 2, expandFill, 0, 0, 0); masterTable.Attach(placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0); masterTable.Attach(masterButton, 2, 3, 1, 2, fill, 0, 0, 0); masterPanel = new Alignment(0.5f, 0.5f, 1f, 1f) { LeftPadding = 24, Child = masterTable }; optionsVBox.PackStart(masterPanel); VBox.PackStart(frame, false, false, 0); Child.ShowAll(); viewEngineCombo.Changed += ViewEngineChanged; templateCombo.Changed += Validate; nameEntry.Changed += Validate; partialCheck.Toggled += UpdateMasterPanelSensitivity; stronglyTypedCheck.Toggled += UpdateTypePanelSensitivity; dataClassCombo.Changed += DataClassChanged; masterCheck.Toggled += UpdateMasterPanelSensitivity; masterEntry.Changed += MasterChanged; masterButton.Clicked += ShowMasterSelectionDialog; placeholderCombo.Changed += Validate; }
protected virtual void Build() { // Widget BizeeBirdBoarding.Ui.AppointmentDialog Name = "BizeeBirdBoarding.Ui.AppointmentDialog"; Title = "New Appointment"; WindowPosition = WindowPosition.CenterOnParent; // Internal child BizeeBirdBoarding.Ui.AppointmentDialog.VBox VBox w1 = VBox; w1.Name = "topLevelVbox"; w1.BorderWidth = 2; // Container child topLevelVbox.Box+BoxChild topLevelTable = new Table(7, 2, false); topLevelTable.Name = "topLevelTable"; topLevelTable.RowSpacing = 6; topLevelTable.ColumnSpacing = 6; // Container child topLevelTable.Table+TableChild birdLabel = new Label(); birdLabel.Name = "birdLabel"; birdLabel.LabelProp = "Bird"; topLevelTable.Add(birdLabel); Table.TableChild w2 = (Table.TableChild)topLevelTable[birdLabel]; w2.TopAttach = 1; w2.BottomAttach = 2; w2.XOptions = AttachOptions.Fill; w2.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild birdScrolledWindow = new ScrolledWindow(); birdScrolledWindow.HeightRequest = 125; birdScrolledWindow.CanFocus = true; birdScrolledWindow.Name = "birdScrolledWindow"; birdScrolledWindow.VscrollbarPolicy = PolicyType.Never; birdScrolledWindow.ShadowType = ShadowType.In; // Container child birdScrolledWindow.Container+ContainerChild Viewport w3 = new Viewport(); w3.ShadowType = ShadowType.None; // Container child GtkViewport.Container+ContainerChild birdHBox = new HBox(); birdHBox.Name = "birdHBox"; birdHBox.Spacing = 6; w3.Add(birdHBox); birdScrolledWindow.Add(w3); topLevelTable.Add(birdScrolledWindow); Table.TableChild w6 = (Table.TableChild)topLevelTable[birdScrolledWindow]; w6.TopAttach = 1; w6.BottomAttach = 2; w6.LeftAttach = 1; w6.RightAttach = 2; w6.XOptions = AttachOptions.Fill; w6.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild boardingRateEntry = new Entry(); boardingRateEntry.Sensitive = false; boardingRateEntry.CanFocus = true; boardingRateEntry.Name = "boardingRateEntry"; boardingRateEntry.IsEditable = true; topLevelTable.Add(boardingRateEntry); Table.TableChild w7 = (Table.TableChild)topLevelTable[boardingRateEntry]; w7.TopAttach = 2; w7.BottomAttach = 3; w7.LeftAttach = 1; w7.RightAttach = 2; w7.XOptions = AttachOptions.Fill; w7.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild boardingRateLabel = new Label(); boardingRateLabel.Name = "boardingRateLabel"; boardingRateLabel.LabelProp = "Boarding Rate"; topLevelTable.Add(boardingRateLabel); Table.TableChild w8 = (Table.TableChild)topLevelTable[boardingRateLabel]; w8.TopAttach = 2; w8.BottomAttach = 3; w8.XOptions = AttachOptions.Fill; w8.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild customerCombobox = ComboBoxEntry.NewText(); customerCombobox.Name = "customerCombobox"; topLevelTable.Add(customerCombobox); Table.TableChild w9 = (Table.TableChild)topLevelTable[customerCombobox]; w9.LeftAttach = 1; w9.RightAttach = 2; w9.XOptions = AttachOptions.Fill; w9.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild customerLabel = new Label(); customerLabel.Name = "customerLabel"; customerLabel.LabelProp = "Customer"; topLevelTable.Add(customerLabel); Table.TableChild w10 = (Table.TableChild)topLevelTable[customerLabel]; w10.XOptions = AttachOptions.Fill; w10.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild endDateContainer = new Alignment(0.5F, 0.5F, 1F, 1F); endDateContainer.Name = "endDateContainer"; topLevelTable.Add(endDateContainer); Table.TableChild w11 = (Table.TableChild)topLevelTable[endDateContainer]; w11.TopAttach = 4; w11.BottomAttach = 5; w11.LeftAttach = 1; w11.RightAttach = 2; w11.XOptions = AttachOptions.Fill; w11.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild endDateLabel = new Label(); endDateLabel.Name = "endDateLabel"; endDateLabel.LabelProp = "End Date"; topLevelTable.Add(endDateLabel); Table.TableChild w12 = (Table.TableChild)topLevelTable[endDateLabel]; w12.TopAttach = 4; w12.BottomAttach = 5; w12.XOptions = AttachOptions.Fill; w12.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild notesLabel = new Label(); notesLabel.Name = "notesLabel"; notesLabel.LabelProp = "Notes"; topLevelTable.Add(notesLabel); Table.TableChild w13 = (Table.TableChild)topLevelTable[notesLabel]; w13.TopAttach = 6; w13.BottomAttach = 7; w13.XOptions = AttachOptions.Fill; w13.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild notesScrolledWindow = new ScrolledWindow(); notesScrolledWindow.Name = "notesScrolledWindow"; notesScrolledWindow.ShadowType = ShadowType.In; // Container child notesScrolledWindow.Container+ContainerChild notesTextView = new TextView(); notesTextView.CanFocus = true; notesTextView.Name = "notesTextView"; notesScrolledWindow.Add(notesTextView); topLevelTable.Add(notesScrolledWindow); Table.TableChild w15 = (Table.TableChild)topLevelTable[notesScrolledWindow]; w15.TopAttach = 6; w15.BottomAttach = 7; w15.LeftAttach = 1; w15.RightAttach = 2; w15.XOptions = ((AttachOptions)(7)); // Container child topLevelTable.Table+TableChild startDateContainer = new Alignment(0.5F, 0.5F, 1F, 1F); startDateContainer.Name = "startDateContainer"; topLevelTable.Add(startDateContainer); Table.TableChild w16 = (Table.TableChild)topLevelTable[startDateContainer]; w16.TopAttach = 3; w16.BottomAttach = 4; w16.LeftAttach = 1; w16.RightAttach = 2; w16.XOptions = AttachOptions.Fill; w16.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild startDateLabel = new Label(); startDateLabel.Name = "startDateLabel"; startDateLabel.LabelProp = "Start Date"; topLevelTable.Add(startDateLabel); Table.TableChild w17 = (Table.TableChild)topLevelTable[startDateLabel]; w17.TopAttach = 3; w17.BottomAttach = 4; w17.XOptions = AttachOptions.Fill; w17.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild statusCombobox = ComboBox.NewText(); statusCombobox.AppendText("Scheduled"); statusCombobox.AppendText("Checked In"); statusCombobox.AppendText("Checked Out"); statusCombobox.AppendText("Cancelled"); statusCombobox.AppendText("No-Show"); statusCombobox.Name = "statusCombobox"; statusCombobox.Active = 0; topLevelTable.Add(statusCombobox); Table.TableChild w18 = (Table.TableChild)topLevelTable[statusCombobox]; w18.TopAttach = 5; w18.BottomAttach = 6; w18.LeftAttach = 1; w18.RightAttach = 2; w18.YOptions = AttachOptions.Fill; // Container child topLevelTable.Table+TableChild statusLabel = new Label(); statusLabel.Name = "statusLabel"; statusLabel.LabelProp = "Status"; topLevelTable.Add(statusLabel); Table.TableChild w19 = (Table.TableChild)topLevelTable[statusLabel]; w19.TopAttach = 5; w19.BottomAttach = 6; w19.XOptions = AttachOptions.Fill; w19.YOptions = AttachOptions.Fill; w1.Add(topLevelTable); Box.BoxChild w20 = (Box.BoxChild)w1[topLevelTable]; w20.Position = 0; // Internal child BizeeBirdBoarding.Ui.AppointmentDialog.ActionArea HButtonBox w21 = ActionArea; w21.Name = "actionArea"; w21.Spacing = 10; w21.BorderWidth = 5; w21.LayoutStyle = ButtonBoxStyle.End; // Container child actionArea.ButtonBox+ButtonBoxChild buttonCancel = new Button(); buttonCancel.CanDefault = true; buttonCancel.CanFocus = true; buttonCancel.Name = "buttonCancel"; buttonCancel.UseStock = true; buttonCancel.UseUnderline = true; buttonCancel.Label = "gtk-cancel"; AddActionWidget(buttonCancel, -6); ButtonBox.ButtonBoxChild w22 = (ButtonBox.ButtonBoxChild)w21[buttonCancel]; w22.Expand = false; w22.Fill = false; // Container child actionArea.ButtonBox+ButtonBoxChild buttonOk = new Button(); buttonOk.CanDefault = true; buttonOk.CanFocus = true; buttonOk.Name = "buttonOk"; buttonOk.UseStock = true; buttonOk.UseUnderline = true; buttonOk.Label = "gtk-ok"; AddActionWidget(buttonOk, -5); ButtonBox.ButtonBoxChild w23 = (ButtonBox.ButtonBoxChild)w21[buttonOk]; w23.Position = 1; w23.Expand = false; w23.Fill = false; if (Child != null) { Child.ShowAll(); } DefaultWidth = 400; DefaultHeight = 684; Show(); customerCombobox.Changed += new System.EventHandler(onCustomerComboChanged); buttonCancel.Clicked += new System.EventHandler(onCancelButtonClicked); buttonOk.Clicked += new System.EventHandler(onOkButtonClicked); }
public StationEditor(DatabaseTrackInfo track) : base() { AccelGroup accel_group = new AccelGroup(); AddAccelGroup(accel_group); Title = String.Empty; SkipTaskbarHint = true; Modal = true; this.track = track; string title = track == null ? Catalog.GetString("Add new radio station") : Catalog.GetString("Edit radio station"); BorderWidth = 6; HasSeparator = false; DefaultResponse = ResponseType.Ok; Modal = true; VBox.Spacing = 6; HBox split_box = new HBox(); split_box.Spacing = 12; split_box.BorderWidth = 6; Image image = new Image(); image.IconSize = (int)IconSize.Dialog; image.IconName = "radio"; image.Yalign = 0.0f; image.Show(); VBox main_box = new VBox(); main_box.BorderWidth = 5; main_box.Spacing = 10; Label header = new Label(); header.Markup = String.Format("<big><b>{0}</b></big>", GLib.Markup.EscapeText(title)); header.Xalign = 0.0f; header.Show(); Label message = new Label(); message.Text = Catalog.GetString("Enter the Genre, Title and URL of the radio station you wish to add. A description is optional."); message.Xalign = 0.0f; message.Wrap = true; message.Show(); table = new Table(5, 2, false); table.RowSpacing = 6; table.ColumnSpacing = 6; genre_entry = ComboBoxEntry.NewText(); foreach (string genre in ServiceManager.DbConnection.QueryEnumerable <string> ("SELECT DISTINCT Genre FROM CoreTracks ORDER BY Genre")) { if (!String.IsNullOrEmpty(genre)) { genre_entry.AppendText(genre); } } if (track != null && !String.IsNullOrEmpty(track.Genre)) { genre_entry.Entry.Text = track.Genre; } AddRow(Catalog.GetString("Station Genre:"), genre_entry); name_entry = AddEntryRow(Catalog.GetString("Station Name:")); stream_entry = AddEntryRow(Catalog.GetString("Stream URL:")); creator_entry = AddEntryRow(Catalog.GetString("Station Creator:")); description_entry = AddEntryRow(Catalog.GetString("Description:")); rating_entry = new RatingEntry(); HBox rating_box = new HBox(); rating_box.PackStart(rating_entry, false, false, 0); AddRow(Catalog.GetString("Rating:"), rating_box); table.ShowAll(); main_box.PackStart(header, false, false, 0); main_box.PackStart(message, false, false, 0); main_box.PackStart(table, false, false, 0); main_box.Show(); split_box.PackStart(image, false, false, 0); split_box.PackStart(main_box, true, true, 0); split_box.Show(); VBox.PackStart(split_box, true, true, 0); Button cancel_button = new Button(Stock.Cancel); cancel_button.CanDefault = false; cancel_button.UseStock = true; cancel_button.Show(); AddActionWidget(cancel_button, ResponseType.Close); cancel_button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape, 0, Gtk.AccelFlags.Visible); save_button = new Button(Stock.Save); save_button.CanDefault = true; save_button.UseStock = true; save_button.Sensitive = false; save_button.Show(); AddActionWidget(save_button, ResponseType.Ok); save_button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 0, Gtk.AccelFlags.Visible); name_entry.HasFocus = true; if (track != null) { if (!String.IsNullOrEmpty(track.TrackTitle)) { name_entry.Text = track.TrackTitle; } if (!String.IsNullOrEmpty(track.Uri.AbsoluteUri)) { stream_entry.Text = track.Uri.AbsoluteUri; } if (!String.IsNullOrEmpty(track.Comment)) { description_entry.Text = track.Comment; } if (!String.IsNullOrEmpty(track.ArtistName)) { creator_entry.Text = track.ArtistName; } rating_entry.Value = track.Rating; } error_container = new Alignment(0.0f, 0.0f, 1.0f, 1.0f); error_container.TopPadding = 6; HBox error_box = new HBox(); error_box.Spacing = 4; Image error_image = new Image(); error_image.Stock = Stock.DialogError; error_image.IconSize = (int)IconSize.Menu; error_image.Show(); error = new Label(); error.Xalign = 0.0f; error.Show(); error_box.PackStart(error_image, false, false, 0); error_box.PackStart(error, true, true, 0); error_box.Show(); error_container.Add(error_box); table.Attach(error_container, 0, 2, 4, 5, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); genre_entry.Entry.Changed += OnFieldsChanged; name_entry.Changed += OnFieldsChanged; stream_entry.Changed += OnFieldsChanged; OnFieldsChanged(this, EventArgs.Empty); }
private void CreateToolBars() { mainToolbar.ToolbarStyle = ToolbarStyle.Icons; toolsPaneBar.ToolbarStyle = ToolbarStyle.Icons; toolsPaneBar.Orientation = Orientation.Vertical; toolsToolbar.ToolbarStyle = ToolbarStyle.Icons; toolsToolbar.IconSize = IconSize.Menu; ToolButton T = new ToolButton(Stock.New); T.Clicked += (s, e) => TheVM.CreateNewFile(); mainToolbar.Add(T); T = new ToolButton(Stock.Open); T.ButtonPressEvent += (s, e) => TheVM.Open(); mainToolbar.Add(T); T = new ToolButton(Stock.Save); T.ButtonPressEvent += (s, e) => TheVM.Save(); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Copy); mainToolbar.Add(T); T = new ToolButton(Stock.Cut); mainToolbar.Add(T); T = new ToolButton(Stock.Paste); mainToolbar.Add(T); T = new ToolButton(Stock.Undo); mainToolbar.Add(T); T = new ToolButton(Stock.Redo); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Execute); mainToolbar.Add(T); T.Clicked += (s, e) => TheVM.TheDocument.Recompile(); T = cmdAbortCompile = new ToolButton(Stock.Cancel); T.Clicked += (s, e) => TheCompiler.Instance.AbortCompilation(); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Quit); T.Clicked += (s, e) => Application.Quit(); mainToolbar.Add(T); T = new ToolButton(Stock.Home); toolsPaneBar.Add(T); T = new ToolButton(Stock.Index); toolsPaneBar.Add(T); T = new ToolButton(Stock.Execute); toolsPaneBar.Add(T); // tools toolbar /*RadioToolButton RT0 = null; * RadioToolButton RT; * RT0 = RT = new RadioToolButton(RT0); * RT.IconWidget = Properties.Resources.base_cursor.ToImage(); * toolsToolbar.Add(RT); * RT = new RadioToolButton(RT0); * RT.IconWidget = Properties.Resources.bmpvert.ToImage(); * toolsToolbar.Add(RT); * RT = new RadioToolButton(null, Stock.Add); * //RT.IconWidget = Properties.Resources.bmpvert.ToImage(); * RT.Label = "jhgjhgJH"; * toolsToolbar.Add(RT);*/ T = new ToolButton(Properties.Resources.base_cursor.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.bmpvert.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.edge.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.path.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Bezier.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Smooth.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.arc.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.arcedit.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Rectangle.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Ellipse.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.grid.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); ToolButtons.Each((b, i) => { OverlayToolType t = (OverlayToolType)i; b.Clicked += (s, e) => TheVM.CurrentTool = t; }); ToolItem it = new ToolItem(); it.Add(new Label("Node style:")); toolsToolbar.Add(it); it = new ToolItem() { WidthRequest = 100 }; it.Add(cmbNodeStyle = ComboBoxEntry.NewText()); toolsToolbar.Add(it); it = new ToolItem(); it.Add(new Label("Edge style:")); toolsToolbar.Add(it); it = new ToolItem() { WidthRequest = 100 }; it.Add(cmbEdgeStyle = ComboBoxEntry.NewText()); toolsToolbar.Add(it); toolsToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Properties.Resources.radial.ToImage(), ""); toolsToolbar.Add(T); }
private void OnSignupEvent(Hashtable form) { if (((string)form["action"]).Equals("msg")) { new AlertDialog(this.MainWindow, AlertType.Info, (string)form["title"], (string)form["msg"]); } else { this.signupdata = form; Dialog dlg = new Dialog(); dlg.Modal = true; dlg.Title = (string)form["title"]; dlg.SetSizeRequest(500, -1); HBox split = new HBox(); dlg.VBox.Add(split); VBox left = new VBox(true, 0); VBox right = new VBox(true, 0); split.PackStart(left, false, false, 5); split.PackEnd(right, true, true, 10); NameValueCollection fields = (NameValueCollection)form["fields"]; Hashtable data = (Hashtable)form["data"]; foreach (string Key in fields.AllKeys) { Hashtable fd = (Hashtable)data[Key]; string Name = Key.Substring(0, 1).ToUpper() + Key.Substring(1) + ":"; Label lbl = new Label(Name); lbl.SetAlignment(0, (float)0.5); left.PackStart(lbl, false, false, 5); if (fields[Key].Equals("TextEditView")) { Entry ent = new Entry(); ent.Name = Key; ent.ActivatesDefault = true; if (fd["isPassword"] != null) { ent.Visibility = false; } if (fd["value"] != null) { ent.Text = (string)fd["value"]; } right.PackStart(ent, false, false, 5); } else if (fields[Key].Equals("PopupButtonView")) { ComboBox cbox = ComboBox.NewText(); cbox.WrapWidth = 5; cbox.Name = Key; if (fd["menuItems"] != null) { string menuItems = (string)fd["menuItems"]; foreach (string Value in menuItems.Split(',')) { cbox.AppendText(Value); } if (fd["value"] != null && (string)fd["value"] != String.Empty) { cbox.Active = Convert.ToInt32(fd["value"]) - 1; } else { cbox.Active = 0; } } right.PackStart(cbox, false, false, 5); } else if (fields[Key].Equals("ComboControlView")) { ComboBoxEntry cboxe = ComboBoxEntry.NewText(); cboxe.WrapWidth = 5; cboxe.Name = Key; if (fd["menuItems"] != null) { string menuItems = (string)fd["menuItems"]; foreach (string Value in menuItems.Split(',')) { cboxe.AppendText(Value); } } if (fd["value"] != null) { ((Entry)cboxe.Child).Text = (string)fd["value"]; } right.PackStart(cboxe, false, false, 5); } else if (fields[Key].Equals("CheckboxView")) { CheckButton cbtn = new CheckButton(); cbtn.Name = Key; if (fd["value"] != null && (string)fd["value"] != String.Empty) { int v = Convert.ToInt32((string)fd["value"]); cbtn.Active = v == 1; } right.PackStart(cbtn, false, false, 5); } } dlg.AddActionWidget(new Button("Cancel"), ResponseType.Cancel); Button btn = new Button("Next"); btn.CanDefault = true; dlg.AddActionWidget(btn, ResponseType.Ok); dlg.DefaultResponse = ResponseType.Ok; dlg.Response += new ResponseHandler(OnSignupResponse); dlg.TransientFor = this.MainWindow; dlg.SetPosition(WindowPosition.CenterOnParent); dlg.ShowAll(); if (form["redtext"] != null) { new AlertDialog(dlg, AlertType.Warning, (string)form["title"], (string)form["redtext"]); } } }