public MainWindow(InvoiceDirectory idir_) : base(WindowType.Toplevel) { idir = idir_; SetSizeRequest(500, 500); Title = "Fakturering 2.6"; maingroup = new HBox(false, 0); buttons = new VButtonBox(); scrolledhd = new ScrolledWindow(); create = Button.NewWithLabel("Skapa ny faktura"); edit = Button.NewWithLabel("Redigera faktura"); delete = Button.NewWithLabel("Radera faktura"); showbut = Button.NewWithLabel("Visa faktura"); printbut = Button.NewWithLabel("Skriv ut faktura"); CreateListView(); Add(maingroup); maingroup.PackStart(scrolledhd, true, true, 0); maingroup.PackStart(buttons, false, false, 0); buttons.Layout = ButtonBoxStyle.Start; buttons.PackStart(create, false, false, 0); buttons.PackStart(edit, false, false, 0); buttons.PackStart(showbut, false, false, 0); buttons.PackStart(printbut, false, false, 0); buttons.PackStart(delete, false, false, 0); scrolledhd.AddWithViewport(listview); scrolledhd.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); UpdateHDList(); create.Clicked += new EventHandler(Create); edit.Clicked += new EventHandler(Edit); delete.Clicked += new EventHandler(DeleteInvoice); showbut.Clicked += new EventHandler(ShowInvoice); printbut.Clicked += new EventHandler(PrintInvoice); maingroup.ShowAll(); //Den här måste vara här då storleken inte är känd innan ScrollToEnd(scrolledhd); DeleteEvent += new Gtk.DeleteEventHandler(DeleteWindow); }
private void Initialize() { Title = Catalog.GetString ("New Smart Playlist"); VBox.Spacing = 8; AddStockButton (Stock.Cancel, ResponseType.Cancel); ok_button = AddStockButton (Stock.Save, ResponseType.Ok, true); var builder_box = new VBox () { BorderWidth = 5, Spacing = 10 }; var name_box = new HBox () { Spacing = 2 }; name_box.PackStart (new Label () { Text = Catalog.GetString ("Playlist _Name:"), UseUnderline = true }, false, false, 0); name_box.PackStart (name_entry = new Entry (), true, true, 0); name_entry.Changed += HandleNameChanged; builder_box.PackStart (name_box, false, false, 0); builder_box.PackStart (builder = new BansheeQueryBox (), true, true, 0); builder.Show (); builder.Spacing = 4; var expander = new Expander (Catalog.GetString ("Predefined Smart Playlists")); var hbox = new HBox () { Spacing = 8 }; var scrolled_window = new ScrolledWindow () { HscrollbarPolicy = PolicyType.Never, VscrollbarPolicy = PolicyType.Automatic, ShadowType = ShadowType.In }; var button_box = new VButtonBox () { Spacing = 2, LayoutStyle = ButtonBoxStyle.Start }; button_box.PackStart (adv_use_button = new Button (Catalog.GetString ("Open in editor")), false, false, 0); button_box.PackStart (adv_add_button = new Button (Catalog.GetString ("Create and save")), false, false, 0); scrolled_window.Add (adv_tree_view = new TreeView () { HeightRequest = 150, HeadersVisible = false }); hbox.PackStart (scrolled_window, true, true, 0); hbox.PackStart (button_box, false, false, 0); expander.Add (hbox); VBox.PackStart (builder_box, true, true, 0); VBox.PackStart (expander, false, false, 0); // Model is Name, SmartPlaylistDefinition ListStore list_model = new ListStore (typeof(string), typeof(SmartPlaylistDefinition)); bool have_any_predefined = false; foreach (SmartPlaylistDefinition def in primary_source.PredefinedSmartPlaylists) { list_model.AppendValues ( String.Format ("<b>{0}</b>\n<small>{1}</small>", def.Name, def.Description), def ); have_any_predefined = true; } adv_tree_view.Selection.Mode = SelectionMode.Multiple; adv_tree_view.Model = list_model; CellRendererText renderer = new CellRendererText (); renderer.Ellipsize = Pango.EllipsizeMode.End; adv_tree_view.AppendColumn ("title", renderer, "markup", 0); adv_tree_view.Selection.Changed += HandleAdvSelectionChanged; UpdateAdvButtons (0); adv_add_button.Clicked += HandleAdvAdd; adv_use_button.Clicked += HandleAdvUse; if (!have_any_predefined) { expander.NoShowAll = true; expander.Hide (); } Update (); name_entry.GrabFocus (); ShowAll (); }
// Page 3 // Extension Preferences public Gtk.Widget MakeAddinsPane () { Gtk.VBox vbox = new Gtk.VBox (false, 6); vbox.BorderWidth = 6; Gtk.Label l = new Gtk.Label (Catalog.GetString ( "The following add-ins are installed")); l.Xalign = 0; l.Show (); vbox.PackStart (l, false, false, 0); Gtk.HBox hbox = new Gtk.HBox (false, 6); // TreeView of Add-ins Gtk.TreeView tree = new Gtk.TreeView (); addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree); tree.Show (); Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow (); sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Automatic; sw.ShadowType = Gtk.ShadowType.In; sw.Add (tree); sw.Show (); Gtk.LinkButton get_more_link = new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList", Catalog.GetString ("Get More Add-Ins...")); get_more_link.Show (); Gtk.VBox tree_box = new Gtk.VBox (false, 0); tree_box.Add (sw); tree_box.PackEnd (get_more_link, false, false, 5); tree_box.Show (); hbox.PackStart (tree_box, true, true, 0); // Action Buttons (right of TreeView) Gtk.VButtonBox button_box = new Gtk.VButtonBox (); button_box.Spacing = 4; button_box.Layout = Gtk.ButtonBoxStyle.Start; // TODO: In a future version, add in an "Install Add-ins..." button // TODO: In a future version, add in a "Repositories..." button enable_addin_button = new Gtk.Button (Catalog.GetString ("_Enable")); enable_addin_button.Sensitive = false; enable_addin_button.Clicked += OnEnableAddinButton; enable_addin_button.Show (); disable_addin_button = new Gtk.Button (Catalog.GetString ("_Disable")); disable_addin_button.Sensitive = false; disable_addin_button.Clicked += OnDisableAddinButton; disable_addin_button.Show (); addin_prefs_button = new Gtk.Button (Gtk.Stock.Preferences); addin_prefs_button.Sensitive = false; addin_prefs_button.Clicked += OnAddinPrefsButton; addin_prefs_button.Show (); addin_info_button = new Gtk.Button (Gtk.Stock.Info); addin_info_button.Sensitive = false; addin_info_button.Clicked += OnAddinInfoButton; addin_info_button.Show (); button_box.PackStart (enable_addin_button); button_box.PackStart (disable_addin_button); button_box.PackStart (addin_prefs_button); button_box.PackStart (addin_info_button); button_box.Show (); hbox.PackStart (button_box, false, false, 0); hbox.Show (); vbox.PackStart (hbox, true, true, 0); vbox.Show (); tree.Selection.Changed += OnAddinTreeSelectionChanged; LoadAddins (); return vbox; }
void BuildGui() { CellRendererText cellId = new CellRendererText(); TreeViewColumn idColumn = new TreeViewColumn(); idColumn.Title = GettextCatalog.GetString("ID"); idColumn.PackStart(cellId, false); idColumn.AddAttribute(cellId, "text", 0); CellRendererText cellTitle = new CellRendererText(); TreeViewColumn titleColumn = new TreeViewColumn(); titleColumn.Title = "Title"; titleColumn.Expand = true; titleColumn.Sizing = TreeViewColumnSizing.Fixed; titleColumn.PackStart(cellTitle, true); titleColumn.AddAttribute(cellTitle, "text", 1); CellRendererCombo cellAction = new CellRendererCombo(); TreeViewColumn actionColumn = new TreeViewColumn(); actionColumn.Title = "Action"; actionColumn.PackStart(cellAction, false); actionColumn.AddAttribute(cellAction, "text", 2); cellAction.Editable = true; cellAction.Model = checkinActions; cellAction.TextColumn = 0; cellAction.HasEntry = false; cellAction.Edited += OnActionChanged; //checkinActions.AppendValues(WorkItemCheckinAction.None.ToString()); checkinActions.AppendValues(WorkItemCheckinAction.Associate.ToString()); //checkinActions.AppendValues(WorkItemCheckinAction.Resolve.ToString()); workItemsView.AppendColumn(idColumn); workItemsView.AppendColumn(titleColumn); workItemsView.AppendColumn(actionColumn); workItemsView.Model = workItemStore; workItemsView.WidthRequest = 300; workItemsView.HeightRequest = 120; this.PackStart(workItemsView, true, true, 3); VButtonBox buttonBox = new VButtonBox(); Button addButton = new Button(); addButton.Label = GettextCatalog.GetString("Add Work Item"); addButton.Clicked += OnAddWorkItem; removeButton.Label = GettextCatalog.GetString("Remove Work Item"); removeButton.Sensitive = false; removeButton.Clicked += OnRemoveWorkItem; addButton.WidthRequest = removeButton.WidthRequest = 150; buttonBox.PackStart(addButton); buttonBox.PackStart(removeButton); buttonBox.Layout = ButtonBoxStyle.Start; this.PackStart(buttonBox, false, false, 3); this.ShowAll(); }