void _treeView_Selection_Changed(object sender, EventArgs e) { var selectedRows = _treeView.Selection.GetSelectedRows(); if (selectedRows != null && selectedRows.Length > 0) { var row = selectedRows [0]; var index = row.Indices [0]; _selectedDocument = _filteredDocuments [index]; _selectedIndex = index; } UpdateSrollPosition(); _searchView.GrabFocus(); _searchView.SelectRegion(_searchView.Text.Length, _searchView.Text.Length); }
private Widget CreateActions() { VBox actionsVBox = new VBox(false, 0); actionsVBox.WidthRequest = 250; Label l = new Label("<span size=\"small\"></span>"); actionsVBox.PackStart(l, false, false, 0); l.UseMarkup = true; l = new Label( string.Format( "<span size=\"x-large\">{0}</span>", Util.GS("Filter"))); actionsVBox.PackStart(l, false, false, 0); l.UseMarkup = true; l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected)); l.Xalign = 0.0F; HBox searchHBox = new HBox(false, 4); actionsVBox.PackStart(searchHBox, false, false, 0); SearchEntry = new Entry(); searchHBox.PackStart(SearchEntry, true, true, 0); SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment(0.5F, 0F); CancelSearchButton = new Button(stopImage); searchHBox.PackEnd(CancelSearchButton, false, false, 0); CancelSearchButton.Relief = ReliefStyle.None; CancelSearchButton.Sensitive = false; CancelSearchButton.Clicked += new EventHandler(OnCancelSearchButton); l = new Label("<span size=\"small\"></span>"); actionsVBox.PackStart(l, false, false, 0); l.UseMarkup = true; l = new Label( string.Format( "<span size=\"x-large\">{0}</span>", Util.GS("General Actions"))); actionsVBox.PackStart(l, false, false, 0); l.UseMarkup = true; l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected)); l.Xalign = 0.0F; HBox spacerHBox = new HBox(false, 0); actionsVBox.PackStart(spacerHBox, false, false, 0); spacerHBox.PackStart(new Label(""), false, false, 4); VBox vbox = new VBox(false, 0); spacerHBox.PackStart(vbox, true, true, 0); HBox hbox = new HBox(false, 0); AddiFolderButton = new Button(hbox); vbox.PackStart(AddiFolderButton, false, false, 0); AddiFolderButton.Relief = ReliefStyle.None; Label buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Upload a folder..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; AddiFolderButton.Clicked += new EventHandler(AddiFolderHandler); hbox = new HBox(false, 0); ShowHideAllFoldersButton = new Button(hbox); vbox.PackStart(ShowHideAllFoldersButton, false, false, 0); ShowHideAllFoldersButton.Relief = ReliefStyle.None; ShowHideAllFoldersButtonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("View available iFolders"))); hbox.PackStart(ShowHideAllFoldersButtonText, false, false, 4); ShowHideAllFoldersButtonText.UseMarkup = true; ShowHideAllFoldersButtonText.UseUnderline = false; ShowHideAllFoldersButtonText.Xalign = 0; ShowHideAllFoldersButton.Clicked += new EventHandler(ShowHideAllFoldersHandler); l = new Label("<span size=\"small\"></span>"); actionsVBox.PackStart(l, false, false, 0); l.UseMarkup = true; SynchronizedFolderTasks = new VBox(false, 0); actionsVBox.PackStart(SynchronizedFolderTasks, false, false, 0); l = new Label( string.Format( "<span size=\"x-large\">{0}</span>", Util.GS("iFolder Actions"))); SynchronizedFolderTasks.PackStart(l, false, false, 0); l.UseMarkup = true; l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected)); l.Xalign = 0.0F; spacerHBox = new HBox(false, 0); SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0); spacerHBox.PackStart(new Label(""), false, false, 4); vbox = new VBox(false, 0); spacerHBox.PackStart(vbox, true, true, 0); hbox = new HBox(false, 0); OpenSynchronizedFolderButton = new Button(hbox); vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0); OpenSynchronizedFolderButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Open..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; OpenSynchronizedFolderButton.Clicked += new EventHandler(OnOpenSynchronizedFolder); hbox = new HBox(false, 0); ResolveConflictsButton = new Button(hbox); vbox.PackStart(ResolveConflictsButton, false, false, 0); ResolveConflictsButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Resolve conflicts..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ResolveConflictsButton.Clicked += new EventHandler(OnResolveConflicts); hbox = new HBox(false, 0); SynchronizeNowButton = new Button(hbox); vbox.PackStart(SynchronizeNowButton, false, false, 0); SynchronizeNowButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Synchronize now"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; SynchronizeNowButton.Clicked += new EventHandler(OnSynchronizeNow); hbox = new HBox(false, 0); ShareSynchronizedFolderButton = new Button(hbox); vbox.PackStart(ShareSynchronizedFolderButton, false, false, 0); ShareSynchronizedFolderButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Share with..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ShareSynchronizedFolderButton.Clicked += new EventHandler(OnShareSynchronizedFolder); hbox = new HBox(false, 0); RemoveiFolderButton = new Button(hbox); vbox.PackStart(RemoveiFolderButton, false, false, 0); RemoveiFolderButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Revert to a normal folder"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; RemoveiFolderButton.Clicked += new EventHandler(RemoveiFolderHandler); hbox = new HBox(false, 0); ViewFolderPropertiesButton = new Button(hbox); vbox.PackStart(ViewFolderPropertiesButton, false, false, 0); ViewFolderPropertiesButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Properties..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ViewFolderPropertiesButton.Clicked += new EventHandler(OnShowFolderProperties); hbox = new HBox(false, 0); DownloadAvailableiFolderButton = new Button(hbox); vbox.PackStart(DownloadAvailableiFolderButton, false, false, 0); DownloadAvailableiFolderButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Download..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; DownloadAvailableiFolderButton.Clicked += new EventHandler(DownloadAvailableiFolderHandler); hbox = new HBox(false, 0); DeleteFromServerButton = new Button(hbox); vbox.PackStart(DeleteFromServerButton, false, false, 0); DeleteFromServerButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Delete from server"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; DeleteFromServerButton.Clicked += new EventHandler(DeleteFromServerHandler); hbox = new HBox(false, 0); RemoveMembershipButton = new Button(hbox); vbox.PackStart(RemoveMembershipButton, false, false, 0); RemoveMembershipButton.Relief = ReliefStyle.None; buttonText = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("Remove my membership"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; RemoveMembershipButton.Clicked += new EventHandler(RemoveMembershipHandler); return actionsVBox; }
private Widget CreateiFolderActionButtonArea() { EventBox buttonArea = new EventBox(); VBox actionsVBox = new VBox(false, 0); actionsVBox.WidthRequest = 100; buttonArea.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal)); buttonArea.Add(actionsVBox); buttontips = new Tooltips(); HBox ButtonControl = new HBox (false, 0); actionsVBox.PackStart(ButtonControl, false, false, 0); Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment(0.5F, 0F); CancelSearchButton = new Button(stopImage); CancelSearchButton.Sensitive = false; CancelSearchButton.Clicked += new EventHandler(OnCancelSearchButton); CancelSearchButton.Visible = false; HBox spacerHBox = new HBox(false, 0); ButtonControl.PackStart(spacerHBox, false, false, 0); HBox vbox = new HBox(false, 0); spacerHBox.PackStart(vbox, true, true, 0); HBox hbox = new HBox(false, 0); AddiFolderButton = new Button(hbox); vbox.PackStart(AddiFolderButton, false, false, 0); Label buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Upload a folder..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; AddiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"))); AddiFolderButton.Clicked += new EventHandler(AddiFolderHandler); buttontips.SetTip(AddiFolderButton, Util.GS("Create iFolder"),""); hbox = new HBox(false, 0); ShowHideAllFoldersButton = new Button(hbox); vbox.PackStart(ShowHideAllFoldersButton, false, false, 0); ShowHideAllFoldersButtonText = new Label( string.Format("<span>{0}</span>", Util.GS("View available iFolders"))); hbox.PackStart(ShowHideAllFoldersButtonText, false, false, 4); ShowHideAllFoldersButtonText.UseMarkup = true; ShowHideAllFoldersButtonText.UseUnderline = false; ShowHideAllFoldersButtonText.Xalign = 0; ShowHideAllFoldersButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"))); ShowHideAllFoldersButton.Clicked += new EventHandler(ShowHideAllFoldersHandler); buttontips.SetTip(ShowHideAllFoldersButton, Util.GS("Show or Hide iFolder"),""); hbox = new HBox(false, 0); DownloadAvailableiFolderButton = new Button(hbox); vbox.PackStart(DownloadAvailableiFolderButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Download..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; DownloadAvailableiFolderButton.Sensitive = false; DownloadAvailableiFolderButton.Image= new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-download48.png"))); DownloadAvailableiFolderButton.Clicked += new EventHandler(DownloadAvailableiFolderHandler); buttontips.SetTip(DownloadAvailableiFolderButton, Util.GS("Download"),""); hbox = new HBox(false, 0); MergeAvailableiFolderButton = new Button(hbox); vbox.PackStart(MergeAvailableiFolderButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Merge"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; MergeAvailableiFolderButton.Sensitive = false; MergeAvailableiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("merge48.png"))); MergeAvailableiFolderButton.Clicked += new EventHandler(MergeAvailableiFolderHandler); buttontips.SetTip(MergeAvailableiFolderButton, Util.GS("Merge"),""); hbox = new HBox(false, 0); RemoveMembershipButton = new Button(hbox); vbox.PackStart(RemoveMembershipButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Remove My Membership"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; RemoveMembershipButton.Sensitive = false; RemoveMembershipButton.Visible = false; RemoveMembershipButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-error48.png"))); RemoveMembershipButton.Clicked += new EventHandler(RemoveMembershipHandler); buttontips.SetTip(RemoveMembershipButton, Util.GS("Remove My Membership"),""); hbox = new HBox(false, 0); DeleteFromServerButton = new Button(hbox); vbox.PackStart(DeleteFromServerButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Delete from server"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; DeleteFromServerButton.Sensitive = false; DeleteFromServerButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("delete_48.png"))); DeleteFromServerButton.Clicked += new EventHandler(DeleteFromServerHandler); buttontips.SetTip(DeleteFromServerButton, Util.GS("Delete from server"),""); hbox = new HBox(false, 0); ShareSynchronizedFolderButton = new Button(hbox); vbox.PackStart(ShareSynchronizedFolderButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Share with..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ShareSynchronizedFolderButton.Sensitive= false; ShareSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder_share48.png"))); ShareSynchronizedFolderButton.Clicked += new EventHandler(OnShareSynchronizedFolder); buttontips.SetTip(ShareSynchronizedFolderButton, Util.GS("Share with"),""); hbox = new HBox(false, 0); ResolveConflictsButton = new Button(hbox); vbox.PackStart(ResolveConflictsButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Resolve conflicts..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ResolveConflictsButton.Sensitive = false; ResolveConflictsButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-conflict48.png"))); ResolveConflictsButton.Clicked += new EventHandler(OnResolveConflicts); buttontips.SetTip(ResolveConflictsButton, Util.GS("Resolve conflicts"),""); SynchronizedFolderTasks = new VBox(false, 0); ButtonControl.PackStart(SynchronizedFolderTasks, false, false, 0); spacerHBox = new HBox(false, 0); SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0); hbox = new HBox(false, 0); OpenSynchronizedFolderButton = new Button(hbox); vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Open..."))); hbox.PackStart(buttonText, false, false, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; OpenSynchronizedFolderButton.Visible = false; OpenSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"))); OpenSynchronizedFolderButton.Clicked += new EventHandler(OnOpenSynchronizedFolder); buttontips.SetTip(OpenSynchronizedFolderButton, Util.GS("Open iFolder"),""); hbox = new HBox(false, 0); SynchronizeNowButton = new Button(hbox); vbox.PackStart(SynchronizeNowButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Synchronize Now"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; SynchronizeNowButton.Sensitive = false; SynchronizeNowButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-sync48.png"))); SynchronizeNowButton.Clicked += new EventHandler(OnSynchronizeNow); buttontips.SetTip(SynchronizeNowButton, Util.GS("Synchronize Now"),""); hbox = new HBox(false, 0); RemoveiFolderButton = new Button(hbox); vbox.PackStart(RemoveiFolderButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Revert to a Normal Folder"))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; RemoveiFolderButton.Sensitive = false; RemoveiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("revert48.png"))); RemoveiFolderButton.Clicked += new EventHandler(RemoveiFolderHandler); buttontips.SetTip(RemoveiFolderButton, Util.GS("Revert to a Normal Folder"),""); hbox = new HBox(false, 0); ViewFolderPropertiesButton = new Button(hbox); vbox.PackStart(ViewFolderPropertiesButton, false, false, 0); buttonText = new Label( string.Format("<span>{0}</span>", Util.GS("Properties..."))); hbox.PackStart(buttonText, true, true, 4); buttonText.UseMarkup = true; buttonText.UseUnderline = false; buttonText.Xalign = 0; ViewFolderPropertiesButton.Visible = false; ViewFolderPropertiesButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"))); ViewFolderPropertiesButton.Clicked += new EventHandler(OnShowFolderProperties); buttontips.SetTip(ViewFolderPropertiesButton, Util.GS("Properties"),""); ButtonControl.PackStart(new Label(""), false, false, 4); HBox searchHBox = new HBox(false, 4); searchHBox.WidthRequest = 110; ButtonControl.PackEnd(searchHBox, false, false, 0); SearchEntry = new Entry(); searchHBox.PackStart(SearchEntry, true, true, 0); SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); Label l = new Label("<span size=\"small\"></span>"); l = new Label( string.Format( "<span size=\"large\">{0}</span>", Util.GS("Filter"))); ButtonControl.PackEnd(l, false, false, 0); l.UseMarkup = true; l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected)); l.Xalign = 0.0F; VBox viewChanger = new VBox(false,0); string[] list = {Util.GS("Open Panel"),Util.GS("Close Panel"),Util.GS("Thumbnail View"),Util.GS("List View") }; viewList = new ComboBoxEntry (list); viewList.Active = 0; viewList.WidthRequest = 110; viewList.Changed += new EventHandler(OnviewListIndexChange); VBox dummyVbox = new VBox(false,0); Label labeldummy = new Label( string.Format( "")); labeldummy.UseMarkup = true; dummyVbox.PackStart(labeldummy,false,true,0); viewChanger.PackStart(dummyVbox,false,true,0); viewChanger.PackStart(viewList,false,true,0); ButtonControl.PackEnd(viewChanger, false, true,0); return buttonArea; }
private void BuildWindow() { DefaultWidth = 475; BorderWidth = 6; ContentArea.Spacing = 12; ActionArea.Layout = Gtk.ButtonBoxStyle.End; HBox box = new HBox(); box.BorderWidth = 6; box.Spacing = 12; Image image = new Image (IconThemeUtils.LoadIcon (48, "podcast")); image.Yalign = 0.0f; box.PackStart(image, false, true, 0); VBox contentBox = new VBox(); contentBox.Spacing = 12; Label header = new Label(); header.Markup = String.Format ( "<big><b>{0}</b></big>", GLib.Markup.EscapeText (Catalog.GetString ("Subscribe to New Podcast")) ); header.Justify = Justification.Left; header.SetAlignment (0.0f, 0.0f); var message = new WrapLabel () { Markup = Catalog.GetString ( "Please enter the URL of the podcast to which you would like to subscribe." ), Wrap = true }; url_entry = new Entry (); url_entry.ActivatesDefault = true; // If the user has copied some text to the clipboard that starts with http, set // our url entry to it and select it Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false)); if (clipboard != null) { string pasted = clipboard.WaitForText (); if (!String.IsNullOrEmpty (pasted)) { if (pasted.StartsWith ("http")) { url_entry.Text = pasted.Trim (); url_entry.SelectRegion (0, url_entry.Text.Length); } } } contentBox.PackStart (header, true, true, 0); contentBox.PackStart (message, true, true, 0); var url_box = new HBox () { Spacing = 12 }; url_box.PackStart (new Label (Catalog.GetString ("URL:")), false, false, 0); url_box.PackStart (url_entry, true, true, 0); contentBox.PackStart (url_box, false, false, 0); var options_label = new Label () { Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (Catalog.GetString ("Subscription Options"))), Xalign = 0f }; download_check = new CheckButton (Catalog.GetString ("Download new episodes")); archive_check = new CheckButton (Catalog.GetString ("Archive all episodes except the newest one")); var options_box = new VBox () { Spacing = 3 }; options_box.PackStart (options_label, false, false, 0); options_box.PackStart (new Gtk.Alignment (0f, 0f, 0f, 0f) { LeftPadding = 12, Child = download_check }, false, false, 0); options_box.PackStart (new Gtk.Alignment (0f, 0f, 0f, 0f) { LeftPadding = 12, Child = archive_check }, false, false, 0); contentBox.PackStart (options_box, false, false, 0); box.PackStart (contentBox, true, true, 0); AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true); AddButton (Catalog.GetString ("Subscribe"), ResponseType.Ok, true); box.ShowAll (); ContentArea.Add (box); }
public static void TextPrompt(string title, string labelText, string entryText, string buttonText, int position, int selectStart, int selectEnd, TextPromptHandler onOk) { Dialog d = new Dialog(); d.Modal = false; d.ActionArea.Layout = ButtonBoxStyle.Spread; d.HasSeparator = false; d.BorderWidth = 10; d.Title = title; Label label = new Label (labelText); label.UseUnderline = false; d.VBox.Add (label); Entry e = new Entry (entryText); e.WidthChars = Math.Min(100, e.Text.Length + 10); e.Activated += new EventHandler (delegate { d.Respond(ResponseType.Ok); }); d.VBox.Add (e); d.AddButton (buttonText, ResponseType.Ok); d.Response += new ResponseHandler(delegate (object obj, ResponseArgs args) { if (args.ResponseId == ResponseType.Ok) { onOk(e.Text); } else { LogError (args.ResponseId); } d.Unrealize (); d.Destroy (); }); d.ShowAll (); e.Position = position; e.SelectRegion(selectStart, selectEnd); }
private void BuildWindow () { DefaultWidth = 475; BorderWidth = 6; VBox.Spacing = 12; ActionArea.Layout = Gtk.ButtonBoxStyle.End; HBox box = new HBox(); box.BorderWidth = 6; box.Spacing = 12; Image image = new Image (IconThemeUtils.LoadIcon (48, "podcast")); image.Yalign = 0.0f; box.PackStart(image, false, true, 0); VBox contentBox = new VBox(); contentBox.Spacing = 12; Label header = new Label(); header.Markup = String.Format ( "<big><b>{0}</b></big>", GLib.Markup.EscapeText (Catalog.GetString ("Subscribe to New Podcast")) ); header.Justify = Justification.Left; header.SetAlignment (0.0f, 0.0f); WrapLabel message = new WrapLabel (); message.Markup = Catalog.GetString ( "Please enter the URL of the podcast to which you would like to subscribe." ); message.Wrap = true; VBox sync_vbox = new VBox (); VBox expander_children = new VBox(); //expander_children.BorderWidth = 6; expander_children.Spacing = 6; Label sync_text = new Label ( Catalog.GetString ("When new episodes are available: ") ); sync_text.SetAlignment (0.0f, 0.0f); sync_text.Justify = Justification.Left; syncCombo = new SyncPreferenceComboBox (); expander_children.PackStart (sync_text, true, true, 0); expander_children.PackStart (syncCombo, true, true, 0); sync_vbox.Add (expander_children); url_entry = new Entry (); url_entry.ActivatesDefault = true; // If the user has copied some text to the clipboard that starts with http, set // our url entry to it and select it Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false)); if (clipboard != null) { string pasted = clipboard.WaitForText (); if (!String.IsNullOrEmpty (pasted)) { if (pasted.StartsWith ("http")) { url_entry.Text = pasted.Trim (); url_entry.SelectRegion (0, url_entry.Text.Length); } } } Table table = new Table (1, 2, false); table.RowSpacing = 6; table.ColumnSpacing = 12; table.Attach ( new Label (Catalog.GetString ("URL:")), 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0 ); table.Attach ( url_entry, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0 ); table.Attach ( sync_vbox, 0, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0 ); contentBox.PackStart (header, true, true, 0); contentBox.PackStart (message, true, true, 0); contentBox.PackStart (table, true, true, 0); box.PackStart (contentBox, true, true, 0); AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true); AddButton (Catalog.GetString ("Subscribe"), ResponseType.Ok, true); box.ShowAll (); VBox.Add (box); }
private void ShowCustomizePage() { Header = CmisSync.Properties_Resources.ResourceManager.GetString("Customize", CultureInfo.CurrentCulture); Label localfolder_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "<b>" + CmisSync.Properties_Resources.ResourceManager.GetString("EnterLocalFolderName", CultureInfo.CurrentCulture) + "</b>" }; Entry localfolder_entry = new Entry() { Text = Controller.SyncingReponame, ActivatesDefault = false }; Label localrepopath_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "<b>" + CmisSync.Properties_Resources.ResourceManager.GetString("ChangeRepoPath", CultureInfo.CurrentCulture) + "</b>" }; Entry localrepopath_entry = new Entry() { Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text) }; localfolder_entry.Changed += delegate { localrepopath_entry.Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text); }; Label localfolder_error_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "" }; Button cancel_button = new Button(cancelText); Button add_button = new Button( CmisSync.Properties_Resources.ResourceManager.GetString("Add", CultureInfo.CurrentCulture) ); Button back_button = new Button( CmisSync.Properties_Resources.ResourceManager.GetString("Back", CultureInfo.CurrentCulture) ); Controller.UpdateAddProjectButtonEvent += delegate(bool button_enabled) { Gtk.Application.Invoke(delegate { add_button.Sensitive = button_enabled; }); }; string error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } localfolder_entry.Changed += delegate { error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } }; error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } localrepopath_entry.Changed += delegate { error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } }; cancel_button.Clicked += delegate { Controller.PageCancelled(); }; back_button.Clicked += delegate { Controller.BackToPage2(); }; add_button.Clicked += delegate { Controller.CustomizePageCompleted(localfolder_entry.Text, localrepopath_entry.Text); }; VBox layout_vertical = new VBox (false, 12); layout_vertical.PackStart (new Label(""), false, false, 0); layout_vertical.PackStart (localfolder_label, true, true, 0); layout_vertical.PackStart (localfolder_entry, true, true, 0); layout_vertical.PackStart (localrepopath_label, true, true, 0); layout_vertical.PackStart (localrepopath_entry, true, true, 0); layout_vertical.PackStart (localfolder_error_label, true, true, 0); Add(layout_vertical); AddButton(back_button); AddButton(add_button); AddButton(cancel_button); // add_button.GrabFocus(); localfolder_entry.GrabFocus(); localfolder_entry.SelectRegion(0, localfolder_entry.Text.Length); }
private void InitializeWidgets() { this.SetDefaultSize (500, 400); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); VBox dialogBox = new VBox(); dialogBox.Spacing = 10; dialogBox.BorderWidth = 10; this.VBox.PackStart(dialogBox, true, true, 0); Label l = new Label( string.Format("<span size=\"large\" weight=\"bold\">{0}</span>", Util.GS("Add users to this iFolder"))); l.Xalign = 0; l.UseMarkup = true; dialogBox.PackStart(l, false, false, 0); HBox selBox = new HBox(false, 10); dialogBox.PackStart(selBox, true, true, 0); VBox vbox = new VBox(false, 0); selBox.PackStart(vbox, false, false, 0); HBox searchHBox = new HBox(false, 4); vbox.PackStart(searchHBox, false, false, 0); Label findLabel = new Label(Util.GS("_Find:")); searchHBox.PackStart(findLabel, false, false, 0); findLabel.Xalign = 0; SearchEntry = new Entry(); searchHBox.PackStart(SearchEntry, true, true, 0); findLabel.MnemonicWidget = SearchEntry; SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment(0.5F, 0F); CancelSearchButton = new Button(stopImage); searchHBox.PackEnd(CancelSearchButton, false, false, 0); CancelSearchButton.Relief = ReliefStyle.None; CancelSearchButton.Sensitive = false; CancelSearchButton.Clicked += new EventHandler(OnCancelSearchButton); memberListModel = new MemberListModel(domainID, simws); memberList = new BigList(memberListModel); ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(memberList); vbox.PackStart(sw, true, true, 0); memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected); memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated); VBox btnBox = new VBox(); btnBox.Spacing = 10; selBox.PackStart(btnBox, false, false, 0); Label spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); HBox buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); Label buttonLabel = new Label(Util.GS("_Add")); buttonHBox.PackStart(buttonLabel, false, false, 0); Image buttonImage = new Image(Stock.GoForward, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserAddButton = new Button(buttonHBox); btnBox.PackStart(UserAddButton, false, true, 0); UserAddButton.Clicked += new EventHandler(OnAddButtonClicked); buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); buttonImage = new Image(Stock.GoBack, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); buttonLabel = new Label(Util.GS("_Remove")); buttonHBox.PackStart(buttonLabel, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserDelButton = new Button(buttonHBox); btnBox.PackStart(UserDelButton, false, true, 0); UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked); spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); vbox = new VBox(false, 0); selBox.PackStart(vbox, true, true, 0); l = new Label(Util.GS("_Users to add:")); l.Xalign = 0; vbox.PackStart(l, false, false, 0); SelTreeView = new TreeView(); ScrolledWindow ssw = new ScrolledWindow(); ssw.ShadowType = Gtk.ShadowType.EtchedIn; ssw.Add(SelTreeView); vbox.PackStart(ssw, true, true, 0); ssw.WidthRequest = 200; l.MnemonicWidget = SelTreeView; SelTreeStore = new ListStore(typeof(MemberInfo)); SelTreeStore.SetSortFunc( 0, new TreeIterCompareFunc(SelTreeStoreSortFunction)); SelTreeStore.SetSortColumnId(0, SortType.Ascending); SelTreeView.Model = SelTreeStore; SelTreeView.HeadersVisible = false; TreeViewColumn selmemberColumn = new TreeViewColumn(); CellRendererText smcrt = new CellRendererText(); selmemberColumn.PackStart(smcrt, false); selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc( UserCellTextDataFunc)); selmemberColumn.Title = Util.GS("Users to Add..."); SelTreeView.AppendColumn(selmemberColumn); SelTreeView.Selection.Mode = SelectionMode.Multiple; SelTreeView.Selection.Changed += new EventHandler( OnSelUserSelectionChanged); this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); this.AddButton(Stock.Help, ResponseType.Help); SetResponseSensitive(ResponseType.Ok, false); SearchiFolderUsers(); }
private void ShowCustomizePage() { Header = CmisSync.Properties_Resources.Customize; string localfoldername = Controller.saved_address.Host.ToString(); foreach (KeyValuePair<String, String> repository in Controller.repositories) { if (repository.Key == Controller.saved_repository) { localfoldername += "/" + repository.Value; break; } } Label localfolder_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "<b>" + CmisSync.Properties_Resources.EnterLocalFolderName + "</b>" }; Entry localfolder_entry = new Entry() { Text = localfoldername, ActivatesDefault = false }; Label localrepopath_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "<b>" + CmisSync.Properties_Resources.ChangeRepoPath + "</b>" }; Entry localrepopath_entry = new Entry() { Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text) }; localfolder_entry.Changed += delegate { try{ localrepopath_entry.Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text); }catch(Exception){} }; Label localfolder_error_label = new Label() { Xalign = 0, UseMarkup = true, Markup = "" }; Button cancel_button = new Button(cancelText); Button add_button = new Button( CmisSync.Properties_Resources.Add ); Button back_button = new Button( CmisSync.Properties_Resources.Back ); Controller.UpdateAddProjectButtonEvent += delegate(bool button_enabled) { Gtk.Application.Invoke(delegate { add_button.Sensitive = button_enabled; }); }; string error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + error + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } localfolder_entry.Changed += delegate { error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + error + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } }; error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + error + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } localrepopath_entry.Changed += delegate { error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text); if (!String.IsNullOrEmpty(error)) { localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" + error + "</span>"; localfolder_error_label.Show(); } else { localfolder_error_label.Hide(); } }; cancel_button.Clicked += delegate { Controller.PageCancelled(); }; back_button.Clicked += delegate { Controller.BackToPage2(); }; add_button.Clicked += delegate { Controller.CustomizePageCompleted(localfolder_entry.Text, localrepopath_entry.Text); }; VBox layout_vertical = new VBox (false, 12); layout_vertical.PackStart (new Label(""), false, false, 0); layout_vertical.PackStart (localfolder_label, true, true, 0); layout_vertical.PackStart (localfolder_entry, true, true, 0); layout_vertical.PackStart (localrepopath_label, true, true, 0); layout_vertical.PackStart (localrepopath_entry, true, true, 0); layout_vertical.PackStart (localfolder_error_label, true, true, 0); Add(layout_vertical); AddButton(back_button); AddButton(cancel_button); AddButton(add_button); // add_button.GrabFocus(); localfolder_entry.GrabFocus(); localfolder_entry.SelectRegion(0, localfolder_entry.Text.Length); }
private void InitializeWidgets() { this.SetDefaultSize (500, 400); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png")); VBox dialogBox = new VBox(); dialogBox.Spacing = 10; dialogBox.BorderWidth = 10; this.VBox.PackStart(dialogBox, true, true, 0); Table findTable = new Table(2, 3, false); dialogBox.PackStart(findTable, false, false, 0); findTable.ColumnSpacing = 20; findTable.RowSpacing = 5; Label findLabel = new Label(Util.GS("Find:")); findLabel.Xalign = 0; findTable.Attach(findLabel, 0, 1, 0, 1, AttachOptions.Shrink, 0, 0, 0); SearchAttribComboBox = ComboBox.NewText(); SearchAttribComboBox.AppendText(Util.GS("First Name")); SearchAttribComboBox.AppendText(Util.GS("Last Name")); SearchAttribComboBox.AppendText(Util.GS("Full Name")); SearchAttribComboBox.Active = 2; SearchAttribComboBox.Changed += new EventHandler(OnSearchAttribComboBoxChanged); findTable.Attach(SearchAttribComboBox, 1, 2, 0, 1, AttachOptions.Shrink, 0, 0, 0); SearchEntry = new Gtk.Entry(Util.GS("<Enter text to find a user>")); SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); findTable.Attach(SearchEntry, 2, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); Label findHelpTextLabel = new Label(Util.GS("(Full or partial name)")); findHelpTextLabel.Xalign = 0; findTable.Attach(findHelpTextLabel, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); HBox selBox = new HBox(); selBox.Spacing = 10; dialogBox.PackStart(selBox, true, true, 0); memberListModel = new MemberListModel(domainID, simws); memberList = new BigList(memberListModel); ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(memberList); selBox.PackStart(sw, true, true, 0); memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected); memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated); VBox btnBox = new VBox(); btnBox.Spacing = 10; selBox.PackStart(btnBox, false, true, 0); UserAddButton = new Button(Util.GS("_Add >>")); btnBox.PackStart(UserAddButton, false, true, 0); UserAddButton.Clicked += new EventHandler(OnAddButtonClicked); UserDelButton = new Button(Util.GS("_Remove")); btnBox.PackStart(UserDelButton, false, true, 0); UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked); SelTreeView = new TreeView(); ScrolledWindow ssw = new ScrolledWindow(); ssw.ShadowType = Gtk.ShadowType.EtchedIn; ssw.Add(SelTreeView); selBox.PackStart(ssw, true, true, 0); SelTreeStore = new ListStore(typeof(MemberInfo)); SelTreeView.Model = SelTreeStore; CellRendererPixbuf smcrp = new CellRendererPixbuf(); TreeViewColumn selmemberColumn = new TreeViewColumn(); selmemberColumn.PackStart(smcrp, false); selmemberColumn.SetCellDataFunc(smcrp, new TreeCellDataFunc( UserCellPixbufDataFunc)); CellRendererText smcrt = new CellRendererText(); selmemberColumn.PackStart(smcrt, false); selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc( UserCellTextDataFunc)); selmemberColumn.Title = Util.GS("Selected Users"); selmemberColumn.Resizable = true; SelTreeView.AppendColumn(selmemberColumn); SelTreeView.Selection.Mode = SelectionMode.Multiple; SelTreeView.Selection.Changed += new EventHandler( OnSelUserSelectionChanged); UserPixBuf = new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png")); this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); this.AddButton(Stock.Help, ResponseType.Help); SearchiFolderUsers(); }
/// <summary> /// Set up the UI inside the Window /// </summary> private void InitializeWidgets() { this.SetDefaultSize(500, 400); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); VBox dialogBox = new VBox(); dialogBox.Spacing = 10; dialogBox.BorderWidth = 10; this.VBox.PackStart(dialogBox, true, true, 0); Label l = new Label( string.Format("<span size=\"large\" weight=\"bold\">{0}</span>", Util.GS("Add users to this iFolder"))); l.Xalign = 0; l.UseMarkup = true; dialogBox.PackStart(l, false, false, 0); //------------------------------ // Selection Area //------------------------------ HBox selBox = new HBox(false, 10); dialogBox.PackStart(selBox, true, true, 0); //------------------------------ // All Users tree //------------------------------ VBox vbox = new VBox(false, 0); selBox.PackStart(vbox, false, false, 0); //------------------------------ // Find Entry //------------------------------ HBox searchHBox = new HBox(false, 4); vbox.PackStart(searchHBox, false, false, 0); Label findLabel = new Label(Util.GS("_Find:")); searchHBox.PackStart(findLabel, false, false, 0); findLabel.Xalign = 0; SearchEntry = new Entry(); searchHBox.PackStart(SearchEntry, true, true, 0); findLabel.MnemonicWidget = SearchEntry; SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment(0.5F, 0F); CancelSearchButton = new Button(stopImage); searchHBox.PackEnd(CancelSearchButton, false, false, 0); CancelSearchButton.Relief = ReliefStyle.None; CancelSearchButton.Sensitive = false; CancelSearchButton.Clicked += new EventHandler(OnCancelSearchButton); memberListModel = new MemberListModel(domainID, simws); memberList = new BigList(memberListModel); // FIXME: Fix up the BigList class to support both horizontal and vertical scrolling and then use the scroll adjustments to construct the ScrolledWindow ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(memberList); vbox.PackStart(sw, true, true, 0); memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected); memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated); //------------------------------ // Buttons //------------------------------ VBox btnBox = new VBox(); btnBox.Spacing = 10; selBox.PackStart(btnBox, false, false, 0); Label spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); HBox buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); Label buttonLabel = new Label(Util.GS("_Add")); buttonHBox.PackStart(buttonLabel, false, false, 0); Image buttonImage = new Image(Stock.GoForward, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserAddButton = new Button(buttonHBox); btnBox.PackStart(UserAddButton, false, true, 0); UserAddButton.Clicked += new EventHandler(OnAddButtonClicked); buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); buttonImage = new Image(Stock.GoBack, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); buttonLabel = new Label(Util.GS("_Remove")); buttonHBox.PackStart(buttonLabel, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserDelButton = new Button(buttonHBox); btnBox.PackStart(UserDelButton, false, true, 0); UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked); spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); //------------------------------ // Selected Users tree //------------------------------ vbox = new VBox(false, 0); selBox.PackStart(vbox, true, true, 0); l = new Label(Util.GS("_Users to add:")); l.Xalign = 0; vbox.PackStart(l, false, false, 0); SelTreeView = new TreeView(); ScrolledWindow ssw = new ScrolledWindow(); ssw.ShadowType = Gtk.ShadowType.EtchedIn; ssw.Add(SelTreeView); vbox.PackStart(ssw, true, true, 0); ssw.WidthRequest = 200; l.MnemonicWidget = SelTreeView; // Set up the iFolder TreeView SelTreeStore = new ListStore(typeof(MemberInfo)); SelTreeStore.SetSortFunc( 0, new TreeIterCompareFunc(SelTreeStoreSortFunction)); SelTreeStore.SetSortColumnId(0, SortType.Ascending); SelTreeView.Model = SelTreeStore; SelTreeView.HeadersVisible = false; // Set up Pixbuf and Text Rendering for "iFolder Users" column TreeViewColumn selmemberColumn = new TreeViewColumn(); CellRendererText smcrt = new CellRendererText(); selmemberColumn.PackStart(smcrt, false); selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc( UserCellTextDataFunc)); selmemberColumn.Title = Util.GS("Users to Add..."); SelTreeView.AppendColumn(selmemberColumn); SelTreeView.Selection.Mode = SelectionMode.Multiple; SelTreeView.Selection.Changed += new EventHandler( OnSelUserSelectionChanged); this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); this.AddButton(Stock.Help, ResponseType.Help); SetResponseSensitive(ResponseType.Ok, false); SearchiFolderUsers(); }
/* private void OnStatusComboKeyPress (object sender, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) { if (PersonManager.Me != null) { Logger.Debug ("FIXME: Set \"my\" status to: {0}", statusComboBoxEntry.ActiveText); PersonManager.Me.Presence.Message = statusComboBoxEntry.ActiveText; } } } */ /* private void OnStatusComboChanged (object sender, EventArgs args) { Logger.Debug ("OnStatusComboChanged"); } */ private Widget CreateSidebarSearchEntry() { VBox vbox = new VBox (false, 0); Label l = new Label ( string.Format ("<span size=\"large\">{0}</span>", Catalog.GetString ("Filter"))); l.UseMarkup = true; l.ModifyFg (StateType.Normal, this.Style.Base (StateType.Selected)); l.Xalign = 0; l.Show (); vbox.PackStart (l, false, false, 0); searchEntry = new Entry (); searchEntry.SelectRegion (0, -1); searchEntry.CanFocus = true; searchEntry.Changed += OnSearchEntryChanged; searchEntry.Show (); Image stopImage = new Image (Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment (0.5F, 0.0F); cancelSearchButton = new Button (stopImage); cancelSearchButton.Relief = ReliefStyle.None; cancelSearchButton.Sensitive = false; cancelSearchButton.Clicked += OnCancelSearchButton; cancelSearchButton.Show (); HBox searchHBox = new HBox (false, 4); searchHBox.PackStart (searchEntry, true, true, 0); searchHBox.PackStart (cancelSearchButton, false, false, 0); searchHBox.Show (); vbox.PackStart (searchHBox, false, false, 0); return vbox; }