public override Gtk.Widget CreatePanelWidget() { bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine(ConfiguredProject, out byDefault, out require); if (require) { return(null); } var box = new Xwt.VBox { Spacing = 6, Margin = 12 }; box.PackStart(new Xwt.Label { Markup = "<b>Build Engine</b>" }); checkMSBuild = new Xwt.CheckBox(byDefault ? GettextCatalog.GetString("Use MSBuild build engine (recommended for this project type)") : GettextCatalog.GetString("Use MSBuild build engine (unsupported for this project type)")) { Active = ConfiguredProject.UseMSBuildEngine ?? byDefault }; var hbox = new Xwt.HBox { MarginLeft = 18, Spacing = 6 }; hbox.PackStart(checkMSBuild); box.PackStart(hbox); box.Show(); return(box.ToGtkWidget()); }
public override Gtk.Widget CreatePanelWidget () { bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require); if (require) return null; var box = new Xwt.VBox { Spacing = 6, Margin = 12 }; box.PackStart (new Xwt.Label { Markup = "<b>Build Engine</b>" }); checkMSBuild = new Xwt.CheckBox (byDefault ? GettextCatalog.GetString ("Use MSBuild build engine (recommended for this project type)") : GettextCatalog.GetString ("Use MSBuild build engine (unsupported for this project type)")) { Active = ConfiguredProject.UseMSBuildEngine ?? byDefault }; var hbox = new Xwt.HBox { MarginLeft = 18, Spacing = 6 }; hbox.PackStart (checkMSBuild); box.PackStart (hbox); box.Show (); return box.ToGtkWidget (); }
public PadWidget() { jitter = new DocumentJitter(); var box = new Xwt.VBox(); combo = new Xwt.ComboBox(); combo.Items.Add(Jitter.Mono, "Mono JIT"); combo.Items.Add(Jitter.MonoAOT, "Mono AOT"); combo.SelectedIndex = 0; box.PackStart(combo); btn = new Xwt.Button("JIT"); btn.Clicked += ButtonClicked; box.PackStart(btn); textView = new Xwt.RichTextView { MinHeight = 400, MinWidth = 400 }; box.PackStart(textView, true, true); Content = box; }
public ConvertToEnumDialog(string proposedEnumName, List <VariableInitializer> variables, List <VariableInitializer> defaultActiveVariables, Dictionary <string, string> newNames) { this.variables = variables; Title = GettextCatalog.GetString("Convert fields to enumeration"); Xwt.VBox vbox = new Xwt.VBox(); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Name of enum"))); enumNameEntry = new Xwt.TextEntry(); enumNameEntry.Text = proposedEnumName; vbox.PackStart(enumNameEntry); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Variables to include"))); variableList = new Xwt.ListView(); enabledField = new Xwt.DataField <bool> (); oldNameField = new Xwt.DataField <string> (); newNameField = new Xwt.DataField <string> (); variableStore = new Xwt.ListStore(enabledField, oldNameField, newNameField); variableList.DataSource = variableStore; enabledColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Included"), new Xwt.CheckBoxCellView(enabledField) { Editable = true }); variableList.Columns.Add(enabledColumn); oldNameColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Field name"), new Xwt.TextCellView(oldNameField) { Editable = false }); variableList.Columns.Add(oldNameColumn); newNameColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Enum name"), new Xwt.TextCellView(newNameField) { Editable = true, }); variableList.Columns.Add(newNameColumn); for (int i = 0; i < variables.Count; ++i) { var variable = variables[i]; variableStore.AddRow(); variableStore.SetValue(i, enabledField, defaultActiveVariables.Contains(variable)); variableStore.SetValue(i, oldNameField, variable.Name); variableStore.SetValue(i, newNameField, newNames [variable.Name]); } vbox.PackStart(variableList, true, true); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Warning: This may take a while..."))); Content = vbox; Buttons.Add(new Xwt.DialogButton(Xwt.Command.Ok)); Buttons.Add(new Xwt.DialogButton(Xwt.Command.Cancel)); }
public swtMainWindow() { box.PackStart(fraMain); fraMain.Content = fraMainBox; fraMain.Label = Locale.GetString("swtMainWindow"); chkShowToolBar.Label = Locale.GetString("SWTMWtoolbar"); chkDiskButtons.Label = Locale.GetString("SWTMWdiskbuttons"); chkDiskListBox.Label = Locale.GetString("SWTMWdisklistbox"); chkPanelTitle.Label = Locale.GetString("SWTMWpaneltitle"); chkTableCollumns.Label = Locale.GetString("SWTMWtablecollumns"); chkInfoBar.Label = Locale.GetString("SWTMWinfobar"); chkCmdLine.Label = Locale.GetString("SWTMWcmdline"); chkKeybHelp.Label = Locale.GetString("SWTMWkeybhelp"); lblBookmarks.Text = Locale.GetString("SWTMWbookmars"); chkDiskButtons.State = CBSfromBool(fcmd.Properties.Settings.Default.ShowDiskList); chkPanelTitle.State = CBSfromBool(fcmd.Properties.Settings.Default.ShowPanelUrlbox); chkTableCollumns.State = CBSfromBool(fcmd.Properties.Settings.Default.ShowPanelTableCaptions); chkInfoBar.State = CBSfromBool(fcmd.Properties.Settings.Default.ShowFileInfo); chkKeybHelp.State = CBSfromBool(fcmd.Properties.Settings.Default.ShowKeybrdHelp); txtBookmarks.Text = fcmd.Properties.Settings.Default.BookmarksFile ?? ""; fraMainBox.PackStart(chkShowToolBar); fraMainBox.PackStart(chkDiskButtons); fraMainBox.PackStart(chkDiskListBox); fraMainBox.PackStart(chkPanelTitle); fraMainBox.PackStart(chkTableCollumns); fraMainBox.PackStart(chkInfoBar); fraMainBox.PackStart(chkCmdLine); fraMainBox.PackStart(chkKeybHelp); fraMainBox.PackStart(lblBookmarks); fraMainBox.PackStart(txtBookmarks); }
public GeneralOptionsPanel() { this.Build(); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always ask for conversion")); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Leave line endings as is")); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always convert line endings")); this.comboboxLineEndings.Active = (int)DefaultSourceEditorOptions.Instance.LineEndingConversion; var newEditorOptionsBox = new Xwt.VBox(); wordWrapCheckBox = new Xwt.CheckBox(GettextCatalog.GetString("_Word wrap")); wordWrapCheckBox.Active = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.WordWrap); wordWrapCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart(wordWrapCheckBox); wordWrapVisualGlyphsCheckBox = new Xwt.CheckBox(GettextCatalog.GetString("Show visible glyphs for word wrap")); wordWrapVisualGlyphsCheckBox.MarginLeft = 18; wordWrapVisualGlyphsCheckBox.Active = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.VisibleGlyphs); wordWrapVisualGlyphsCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart(wordWrapVisualGlyphsCheckBox); if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk) { vbox4.PackStart((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget(newEditorOptionsBox), false, false, 0); } else { LoggingService.LogError("GeneralOptionsPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk - currently unsupported"); } HandleNewEditorOptionToggled(this, EventArgs.Empty); SetupAccessibility(); }
Xwt.Widget CreateItem(string title, Xwt.Drawing.Image image) { if (image.Size.Width > 150 || image.Size.Height > 150) { image = image.WithBoxSize(150); } var vbox = new Xwt.VBox(); RegisterFocusHandlers(vbox); vbox.PackStart(new Xwt.Label(title) { HorizontalPlacement = Xwt.WidgetPlacement.Center, TextAlignment = Xwt.Alignment.Center, CanGetFocus = false, }); vbox.PackStart(new Xwt.ImageView(image) { HorizontalPlacement = Xwt.WidgetPlacement.Center, CanGetFocus = false, }); return(vbox); }
/// <summary>(Re)builds the "Layout" vbox</summary> public void BuildLayout() { Layout.Clear(); Layout.PackStart(PluginBody, true, Xwt.WidgetPlacement.Fill, Xwt.WidgetPlacement.Fill); Layout.PackStart(CommandBox, false, Xwt.WidgetPlacement.Fill, Xwt.WidgetPlacement.Fill, 0, -6); if (fcmd.Properties.Settings.Default.ShowKeybrdHelp) { Layout.PackStart(KeyBoardHelp, false, Xwt.WidgetPlacement.Fill, Xwt.WidgetPlacement.Fill, 0, -6); } //the values -12, -6 and 6 are need for 0px margins, and found experimentally. //as those experiments showed, at 90dpi these values is measured in pixels, but (in WPF) at >90dpi //or if the Windows user theme has large fonts the values works as need, with "scaling". Live and learn! this.Resizable = true; //fix for some stupid xwt toolkits. mucss.Selector sel = s.CSS["VE"]; try { this.Height = (sel.Declarations["height"].Value == "auto" ? fcmd.Properties.Settings.Default.VEWinHeight : Convert.ToDouble(sel.Declarations["height"].Value)); this.Width = (sel.Declarations["width"].Value == "auto" ? fcmd.Properties.Settings.Default.VEWinWidth : Convert.ToDouble(sel.Declarations["width"].Value)); } catch { } //a dirty workaround for a Xwt.WPF bug (""-1" не является допустимым значением для свойства "Width"." (System.ArgumentException)) if (sel.Declarations["background-color"].Value != "inherit") { Layout.BackgroundColor = pluginner.Utilities.GetXwtColor( sel.Declarations["background-color"].Value ); } this.PaddingTop = PaddingBottom = PaddingLeft = PaddingRight = 0; }
public AboutMonoDevelopTabPage () { BorderWidth = 0; var aboutFile = BrandingService.GetFile ("AboutImage.png"); if (aboutFile != null) imageSep = Xwt.Drawing.Image.FromFile (aboutFile); else imageSep = Xwt.Drawing.Image.FromResource ("AboutImage.png"); PackStart (new ImageView (imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox (); Xwt.FrameBox mbox = new Xwt.FrameBox (infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart (mbox.ToGtkWidget (), false, false, 0); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Version"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("License"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Copyright"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("© 2011-" + DateTime.Now.Year + " ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Xamarin Inc."), Uri = new Uri ("http://www.xamarin.com") }); infoBox.PackStart (cbox); infoBox.PackStart (new Xwt.Label () { Text = "© 2004-" + DateTime.Now.Year + " MonoDevelop contributors", MarginLeft = 12 }); this.ShowAll (); }
public GeneralOptionsPanel() { this.Build(); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always ask for conversion")); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Leave line endings as is")); this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always convert line endings")); this.comboboxLineEndings.Active = (int)DefaultSourceEditorOptions.Instance.LineEndingConversion; var newEditorOptionsBox = new Xwt.VBox(); var newEditorLearnMoreLink = new Xwt.LinkLabel { MarginBottom = 6, MarginTop = 6, Text = GettextCatalog.GetString("Learn more about the New Editor"), Uri = new Uri("https://aka.ms/vs/mac/editor/learn-more") }; newEditorOptionsBox.PackStart(newEditorLearnMoreLink); newEditorCheckBox = new Xwt.CheckBox(GettextCatalog.GetString("Open C# files in the New Editor")); newEditorCheckBox.Active = DefaultSourceEditorOptions.Instance.EnableNewEditor; newEditorCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart(newEditorCheckBox); wordWrapCheckBox = new Xwt.CheckBox(GettextCatalog.GetString("_Word wrap")); wordWrapCheckBox.MarginLeft = 18; wordWrapCheckBox.Active = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.WordWrap); wordWrapCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart(wordWrapCheckBox); wordWrapVisualGlyphsCheckBox = new Xwt.CheckBox(GettextCatalog.GetString("Show visible glyphs for word wrap")); wordWrapVisualGlyphsCheckBox.MarginLeft = 36; wordWrapVisualGlyphsCheckBox.Active = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.VisibleGlyphs); wordWrapVisualGlyphsCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart(wordWrapVisualGlyphsCheckBox); if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk) { experimentalSection.PackStart((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget(newEditorOptionsBox), false, false, 0); } else { LoggingService.LogError("GeneralOptionsPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk - currently unsupported"); } HandleNewEditorOptionToggled(this, EventArgs.Empty); SetupAccessibility(); }
public ConvertToEnumDialog(string proposedEnumName, List<VariableInitializer> variables, List<VariableInitializer> defaultActiveVariables, Dictionary<string, string> newNames) { this.variables = variables; Title = GettextCatalog.GetString("Convert fields to enumeration"); Xwt.VBox vbox = new Xwt.VBox (); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Name of enum"))); enumNameEntry = new Xwt.TextEntry (); enumNameEntry.Text = proposedEnumName; vbox.PackStart (enumNameEntry); vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Variables to include"))); variableList = new Xwt.ListView (); enabledField = new Xwt.DataField<bool> (); oldNameField = new Xwt.DataField<string> (); newNameField = new Xwt.DataField<string> (); variableStore = new Xwt.ListStore (enabledField, oldNameField, newNameField); variableList.DataSource = variableStore; enabledColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Included"), new Xwt.CheckBoxCellView(enabledField) { Editable = true }); variableList.Columns.Add (enabledColumn); oldNameColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Field name"), new Xwt.TextCellView(oldNameField) { Editable = false }); variableList.Columns.Add (oldNameColumn); newNameColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Enum name"), new Xwt.TextCellView(newNameField) { Editable = true, }); variableList.Columns.Add (newNameColumn); for (int i = 0; i < variables.Count; ++i) { var variable = variables[i]; variableStore.AddRow (); variableStore.SetValue (i, enabledField, defaultActiveVariables.Contains(variable)); variableStore.SetValue (i, oldNameField, variable.Name); variableStore.SetValue (i, newNameField, newNames [variable.Name]); } vbox.PackStart (variableList, true, true); vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Warning: This may take a while..."))); Content = vbox; Buttons.Add (new Xwt.DialogButton(Xwt.Command.Ok)); Buttons.Add (new Xwt.DialogButton(Xwt.Command.Cancel)); }
/// <summary>Initialize FileProcessDialog with four-row label</summary> public FileProcessDialog() { Localizator locale = new Localizator(); this.Title = locale.GetString("FileProgressDialogTitle"); cmdCancel.Label = locale.GetString("Cancel"); //this.Decorated = false; this.Resizable = false; Layout.PackStart(lblStatus, true, true); Layout.PackStart(pbrProgress, true, true); Layout.PackStart(cmdCancel, false, false); this.Content = Layout; this.InitialLocation = Xwt.WindowLocation.Manual; }
public swtViewerEditor() { //prepare UI fraView.Content = fraViewBox; fraView.Label = Locale.GetString("SWTVEviewer"); optInternalViewer.Group = ViewerSelection; optInternalViewer.Label = Locale.GetString("SWTVEinternalv"); optExternalViewer.Group = ViewerSelection; optExternalViewer.Label = Locale.GetString("SWTVEexternalv"); cmdVEsetup.Label = Locale.GetString("SWTVEvesetup"); cmdVEsetup.Clicked += (o, ea) => { new VEsettings().Run(); }; fraViewBox.PackStart(optInternalViewer); fraViewBox.PackStart(optExternalViewer); fraViewBox.PackStart(txtExternalViewer, true, Xwt.WidgetPlacement.Start, Xwt.WidgetPlacement.Start, 24); fraEdit.Content = fraEditBox; fraEdit.Label = Locale.GetString("SWTVEeditor"); optInternalEditor.Group = EditorSelection; optInternalEditor.Label = Locale.GetString("SWTVEinternaleditor"); optExternalEditor.Group = EditorSelection; optExternalEditor.Label = Locale.GetString("SWTVEexternaleditor"); txtExternalViewer.Sensitive = false; //set default value... txtExternalEditor.Sensitive = false; //...later, it will be confirmed ViewerSelection.ActiveRadioButtonChanged += (o, ea) => { txtExternalViewer.Sensitive = optExternalViewer.Active; }; EditorSelection.ActiveRadioButtonChanged += (o, ea) => { txtExternalEditor.Sensitive = optExternalEditor.Active; }; fraEditBox.PackStart(optInternalEditor); fraEditBox.PackStart(optExternalEditor); fraEditBox.PackStart(txtExternalEditor, true, Xwt.WidgetPlacement.Start, Xwt.WidgetPlacement.Start, 24); box.PackStart(fraView); box.PackStart(fraEdit); box.PackStart(cmdVEsetup); //write settings on UI optExternalViewer.Active = fcmd.Properties.Settings.Default.UseExternalViewer; optExternalEditor.Active = fcmd.Properties.Settings.Default.UseExternalEditor; txtExternalEditor.Text = fcmd.Properties.Settings.Default.ExternalEditor; txtExternalViewer.Text = fcmd.Properties.Settings.Default.ExternalViewer; txtExternalEditor.PlaceholderText = "vim $"; txtExternalViewer.PlaceholderText = "cat $ | less"; }
public VEsettings() { this.Title = Locale.GetString("FCVES_Title"); this.Content = Layout; this.Buttons.Add(new Xwt.Command("Ok"), new Xwt.Command("Cancel")); this.Buttons[0].Clicked += (o, ea) => { Save(); }; this.Buttons[1].Clicked += (o, ea) => { this.Hide(); }; chkShowToolbar.Label = Locale.GetString("FCVES_ShowToolbar"); chkShowToolbar.State = CBSfromBool(Properties.Settings.Default.VE_ShowToolbar); chkShowCmdBar.Label = Locale.GetString("FCVES_ShowCmdBar"); chkShowCmdBar.State = CBSfromBool(Properties.Settings.Default.VE_ShowCmdBar); Layout.PackStart(chkShowToolbar); Layout.PackStart(chkShowCmdBar); }
/// <summary>Builds the InputBox dialog</summary> private void Build() { box.PackStart(lblQuestion); box.PackStart(txtAnwser); if (OtherWidgets.Placements.Count > 0) { box.PackStart(OtherWidgets); } this.Content = box; this.ShowInTaskbar = false; this.Resizable = false; this.Title = System.Windows.Forms.Application.ProductName; this.CloseRequested += (o, ea) => { this.Hide(); }; foreach (Xwt.DialogButton dbtn in this.Buttons) { dbtn.Clicked += (o, ea) => { this.Hide(); }; } }
public override Gtk.Widget CreatePanelWidget () { Xwt.VBox box = new Xwt.VBox (); box.Spacing = 6; box.Margin = 12; disableVersionControl = new Xwt.CheckBox (GettextCatalog.GetString ("Disable Version Control for this solution")) { Active = VersionControlService.IsSolutionDisabled ((Solution)DataObject), }; box.PackStart (disableVersionControl); box.Show (); return box.ToGtkWidget (); }
public override Gtk.Widget CreatePanelWidget () { Xwt.VBox box = new Xwt.VBox (); box.Spacing = 6; box.Margin = 12; disableVersionControl = new Xwt.CheckBox (GettextCatalog.GetString ("Disable Version Control globally")) { Active = VersionControlService.ConfigurationGlobalDisabled, }; box.PackStart (disableVersionControl); box.Show (); return box.ToGtkWidget (); }
public swtMainWindowInfobar() { fraInfobar.Label = Locale.GetString("SWTMWinfobar").Replace(" ", ""); fraInfobar.Content = Layout; Layout.PackStart(new Xwt.Label( Locale.GetString("SWTMWItext1") )); Layout.PackStart(txtText1); Layout.PackStart(new Xwt.Label( Locale.GetString("SWTMWItext2") )); Layout.PackStart(txtText2); Layout.PackStart(new Xwt.Label( Locale.GetString("SWTMWIhelp") ) { Wrap = Xwt.WrapMode.Word } ); txtText1.Text = fcmd.Properties.Settings.Default.InfoBarContent1; txtText2.Text = fcmd.Properties.Settings.Default.InfoBarContent2; }
public override Gtk.Widget CreatePanelWidget() { Xwt.VBox box = new Xwt.VBox(); box.Spacing = 6; box.Margin = 12; disableVersionControl = new Xwt.CheckBox(GettextCatalog.GetString("Disable Version Control globally")) { Active = VersionControlService.IsGloballyDisabled, }; box.PackStart(disableVersionControl); box.Show(); return(box.ToGtkWidget()); }
public override Control CreatePanelWidget() { Xwt.VBox box = new Xwt.VBox(); box.Spacing = 6; box.Margin = 12; disableVersionControl = new Xwt.CheckBox(GettextCatalog.GetString("Disable Version Control for this solution")) { Active = VersionControlService.IsSolutionDisabled((Solution)DataObject), }; box.PackStart(disableVersionControl); box.Show(); return(box.ToGtkWidget()); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; var aboutFile = BrandingService.GetFile(AboutDialogImage.Name); if (aboutFile != null) { imageSep = Xwt.Drawing.Image.FromFile(aboutFile); } else { imageSep = Xwt.Drawing.Image.FromResource(AboutDialogImage.Name); } PackStart(new ImageView(imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(mbox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Version"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("License"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("License is available at ") }); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("http://xamarin.com/xamarin-studio-license"), Uri = new Uri("http://xamarin.com/xamarin-studio-license") }); infoBox.PackStart(cbox); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Copyright"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("© 2011-" + DateTime.Now.Year + " ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Xamarin Inc."), Uri = new Uri("http://www.xamarin.com") }); infoBox.PackStart(cbox); infoBox.PackStart(new Xwt.Label() { Text = "© 2004-" + DateTime.Now.Year + " MonoDevelop contributors", MarginLeft = 12 }); this.ShowAll(); }
public swtMainWindowColumns() { box.PackStart(fraExtensions); box.PackStart(fraTabs); box.PackStart(fraOther); fraExtensions.Content = fraExtensionsBox; fraExtensions.Label = Locale.GetString("SWTMWCFileExtView"); fraTabs.Content = fraTabsBox; fraTabs.Label = Locale.GetString("SWTMWCCollumns"); fraOther.Content = fraOtherBox; optDisplayExtTogether.Group = rbgExtensionDisplayStyle; optDisplayExtFar.Group = rbgExtensionDisplayStyle; optDisplayExtTogether.Label = Locale.GetString("SWTMWCExtTogether"); optDisplayExtFar.Label = Locale.GetString("SWTMWCExtFar"); fraExtensionsBox.PackStart(optDisplayExtTogether); fraExtensionsBox.PackStart(optDisplayExtFar); fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCExt")), 0, 0); fraTabsBox.Add(txtTabExtension, 1, 0); fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCSize")), 0, 1); fraTabsBox.Add(txtTabSize, 1, 1); fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCDate")), 0, 2); fraTabsBox.Add(txtTabDate, 1, 2); fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCFileMode")), 0, 3); fraTabsBox.Add(txtTabFilemode, 1, 3); chkExpandName.Label = Locale.GetString("SWTMWCExpandName"); chkShowCentury.Label = Locale.GetString("SWTMWCShowCentury"); chkShowTimeAs12h.Label = Locale.GetString("SWTMWCShowTimeAs12h"); chkShowDirsInStatus.Label = Locale.GetString("SWTMWCShowDirsInStatus"); fraOtherBox.Add(chkExpandName, 0, 0); fraOtherBox.Add(chkShowCentury, 0, 1); fraOtherBox.Add(chkShowTimeAs12h, 0, 2); fraOtherBox.Add(chkShowDirsInStatus, 0, 3); cmbPanelSizeDisplay.Items.Add("000", Locale.GetString("SizeDisplayPolicy000")); cmbPanelSizeDisplay.Items.Add("100", Locale.GetString("SizeDisplayPolicy100")); cmbPanelSizeDisplay.Items.Add("200", Locale.GetString("SizeDisplayPolicy200")); cmbPanelSizeDisplay.Items.Add("111", Locale.GetString("SizeDisplayPolicy111")); cmbPanelSizeDisplay.Items.Add("222", Locale.GetString("SizeDisplayPolicy222")); cmbPanelSizeDisplay.Items.Add("110", Locale.GetString("SizeDisplayPolicy110")); cmbPanelSizeDisplay.Items.Add("220", Locale.GetString("SizeDisplayPolicy220")); /* * SizeDisplayPolicy000=bytes * SizeDisplayPolicy100=kbytes * SizeDisplayPolicy200=kbytes (x.xx KB) * SizeDisplayPolicy111=dynamic (x.x К/М/Г) * SizeDisplayPolicy222=dynamic (x.xx К/М/Г) * SizeDisplayPolicy110=dynamic (x.x К/М) * SizeDisplayPolicy220=dynamic (x.xx K/M) */ fraOtherBox.Add(new Xwt.Label(Locale.GetString("SWTMWCSizeDisplay")), 0, 4); fraOtherBox.Add(cmbPanelSizeDisplay, 1, 4); fraOtherBox.Add(new Xwt.Label(Locale.GetString("SWTMWCMaxHumanSizeStatus")), 0, 5); fraOtherBox.Add(txtMaxHumanySizeInStatus, 1, 5); //load settings switch (fcmd.Properties.Settings.Default.SizeShorteningPolicy) { case "000": cmbPanelSizeDisplay.SelectedIndex = 0; break; case "100": cmbPanelSizeDisplay.SelectedIndex = 1; break; case "200": cmbPanelSizeDisplay.SelectedIndex = 2; break; case "111": cmbPanelSizeDisplay.SelectedIndex = 3; break; case "222": cmbPanelSizeDisplay.SelectedIndex = 4; break; case "110": cmbPanelSizeDisplay.SelectedIndex = 5; break; case "220": cmbPanelSizeDisplay.SelectedIndex = 6; break; } }
KeyboardHelpButton[] KeybHelpButtons = new KeyboardHelpButton[11]; //одна лишняя, которая нумбер [0] public MainWindow() { this.Title = "File Commander"; this.MainMenu = WindowMenu; //build user interface MainMenu.Items.Add(mnuFile); MainMenu.Items.Add(mnuView); MainMenu.Items.Add(mnuNavigate); MainMenu.Items.Add(mnuTools); MainMenu.Items.Add(mnuHelp); mnuFile.SubMenu = new Xwt.Menu(); mnuFile.SubMenu.Items.Add(mnuFileUserMenu); mnuFile.SubMenu.Items.Add(mnuFileView); mnuFile.SubMenu.Items.Add(mnuFileEdit); mnuFile.SubMenu.Items.Add(mnuFileCompare); mnuFile.SubMenu.Items.Add(mnuFileCopy); mnuFile.SubMenu.Items.Add(mnuFileMove); mnuFile.SubMenu.Items.Add(mnuFileNewDir); mnuFile.SubMenu.Items.Add(mnuFileRemove); mnuFile.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuFile.SubMenu.Items.Add(mnuFileAtributes); mnuFile.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuFile.SubMenu.Items.Add(mnuFileQuickSelect); mnuFile.SubMenu.Items.Add(mnuFileQuickUnselect); mnuFile.SubMenu.Items.Add(mnuFileSelectAll); mnuFile.SubMenu.Items.Add(mnuFileUnselect); mnuFile.SubMenu.Items.Add(mnuFileInvertSelection); mnuFile.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuFile.SubMenu.Items.Add(mnuFileExit); mnuView.SubMenu = new Xwt.Menu(); mnuView.SubMenu.Items.Add(mnuViewShort); mnuView.SubMenu.Items.Add(mnuViewDetails); mnuView.SubMenu.Items.Add(mnuViewIcons); mnuView.SubMenu.Items.Add(mnuViewThumbs); mnuView.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuView.SubMenu.Items.Add(mnuViewQuickView); mnuView.SubMenu.Items.Add(mnuViewTree); mnuView.SubMenu.Items.Add(mnuViewPCPCconnect); mnuView.SubMenu.Items.Add(mnuViewPCNETPCconnect); mnuView.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuView.SubMenu.Items.Add(mnuViewByName); mnuView.SubMenu.Items.Add(mnuViewByType); mnuView.SubMenu.Items.Add(mnuViewByDate); mnuView.SubMenu.Items.Add(mnuViewBySize); mnuView.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuView.SubMenu.Items.Add(mnuViewNoFilter); mnuView.SubMenu.Items.Add(mnuViewWithFilter); mnuView.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuView.SubMenu.Items.Add(mnuViewKeybrdHelp); //these checkboxes are don't work, because no code was written mnuView.SubMenu.Items.Add(mnuViewInfobar); mnuView.SubMenu.Items.Add(mnuViewDiskButtons); mnuNavigate.SubMenu = new Xwt.Menu(); mnuNavigate.SubMenu.Items.Add(mnuNavigateTree); mnuNavigate.SubMenu.Items.Add(mnuNavigateHistory); mnuNavigate.SubMenu.Items.Add(mnuNavigateFind); mnuNavigate.SubMenu.Items.Add(mnuNavigateReload); mnuTools.SubMenu = new Xwt.Menu(); mnuTools.SubMenu.Items.Add(mnuToolsOptions); mnuTools.SubMenu.Items.Add(mnuToolsPluginManager); mnuTools.SubMenu.Items.Add(mnuToolsEditUserMenu); mnuTools.SubMenu.Items.Add(mnuToolsKeychains); mnuTools.SubMenu.Items.Add(mnuToolsConfigEdit); mnuTools.SubMenu.Items.Add(new Xwt.SeparatorMenuItem()); mnuTools.SubMenu.Items.Add(mnuToolsDiskLabel); mnuTools.SubMenu.Items.Add(mnuToolsFormat); mnuTools.SubMenu.Items.Add(mnuToolsSysInfo); mnuHelp.SubMenu = new Xwt.Menu(); mnuHelp.SubMenu.Items.Add(mnuHelpHelpMe); mnuHelp.SubMenu.Items.Add(mnuHelpDebug); mnuHelp.SubMenu.Items.Add(mnuHelpAbout); TranslateMenu(MainMenu); this.CloseRequested += new Xwt.CloseRequestedHandler(MainWindow_CloseRequested); PanelLayout.KeyReleased += new EventHandler <Xwt.KeyEventArgs>(PanelLayout_KeyReleased); mnuFileView.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F3, Xwt.ModifierKeys.None, false, 0)); }; mnuFileEdit.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F4, Xwt.ModifierKeys.None, false, 0)); }; mnuFileCopy.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F5, Xwt.ModifierKeys.None, false, 0)); }; mnuFileMove.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F6, Xwt.ModifierKeys.None, false, 0)); }; mnuFileNewDir.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F7, Xwt.ModifierKeys.None, false, 0)); }; mnuFileRemove.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.F8, Xwt.ModifierKeys.None, false, 0)); }; mnuFileSelectAll.Clicked += (o, ea) => { ActivePanel.ListingView.Select(null); }; mnuFileUnselect.Clicked += (o, ea) => { ActivePanel.ListingView.Unselect(); }; mnuFileInvertSelection.Clicked += (o, ea) => { ActivePanel.ListingView.InvertSelection(); }; mnuFileQuickSelect.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.NumPadAdd, Xwt.ModifierKeys.None, false, 0)); }; mnuFileQuickUnselect.Clicked += (o, ea) => { PanelLayout_KeyReleased(o, new Xwt.KeyEventArgs(Xwt.Key.NumPadSubtract, Xwt.ModifierKeys.None, false, 0)); }; mnuFileExit.Clicked += (o, ea) => { this.Close(); }; mnuViewNoFilter.Clicked += (o, ea) => { ActivePanel.LoadDir(); }; mnuViewWithFilter.Clicked += new EventHandler(mnuViewWithFilter_Clicked); mnuNavigateReload.Clicked += new EventHandler(mnuNavigateReload_Clicked); mnuToolsOptions.Clicked += new EventHandler(mnuToolsOptions_Clicked); mnuHelpDebug.Clicked += ShowDebugInfo; mnuHelpAbout.Clicked += new EventHandler(mnuHelpAbout_Clicked); Layout.PackStart(PanelLayout, true, Xwt.WidgetPlacement.Fill, Xwt.WidgetPlacement.Fill, -12, -6, -12, 12); Layout.PackStart(KeyBoardHelp, false, Xwt.WidgetPlacement.End, Xwt.WidgetPlacement.Fill, -12, -12, -12); this.Content = Layout; //check settings if (fcmd.Properties.Settings.Default.UserTheme != null) { if (fcmd.Properties.Settings.Default.UserTheme != "") { if (File.Exists(fcmd.Properties.Settings.Default.UserTheme)) { stylist = new pluginner.Stylist(fcmd.Properties.Settings.Default.UserTheme); } else { Xwt.MessageDialog.ShowError(Locale.GetString("ThemeNotFound"), fcmd.Properties.Settings.Default.UserTheme); Xwt.Application.Exit(); } } } //load bookmarks string BookmarksStore = null; if (fcmd.Properties.Settings.Default.BookmarksFile != null && fcmd.Properties.Settings.Default.BookmarksFile.Length > 0) { BookmarksStore = File.ReadAllText(fcmd.Properties.Settings.Default.BookmarksFile, Encoding.UTF8); } //build panels PanelLayout.Panel1.Content = new pluginner.FileListPanel(BookmarksStore, fcmd.Properties.Settings.Default.UserTheme, Properties.Settings.Default.InfoBarContent1, Properties.Settings.Default.InfoBarContent2); //Левая, правая где сторона? Улица, улица, ты, брат, пьяна! PanelLayout.Panel2.Content = new pluginner.FileListPanel(BookmarksStore, fcmd.Properties.Settings.Default.UserTheme, Properties.Settings.Default.InfoBarContent1, Properties.Settings.Default.InfoBarContent2); p1 = (PanelLayout.Panel1.Content as pluginner.FileListPanel); p2 = (PanelLayout.Panel2.Content as pluginner.FileListPanel); p1.OpenFile += new pluginner.TypedEvent <string>(Panel_OpenFile); p2.OpenFile += new pluginner.TypedEvent <string>(Panel_OpenFile); List <pluginner.ListView2.CollumnInfo> LVCols = new List <pluginner.ListView2.CollumnInfo>(); LVCols.Add(new pluginner.ListView2.CollumnInfo() { Title = "", Tag = "Icon", Width = 16, Visible = true }); LVCols.Add(new pluginner.ListView2.CollumnInfo() { Title = "URL", Tag = "Path", Width = 0, Visible = false }); LVCols.Add(new pluginner.ListView2.CollumnInfo() { Title = Locale.GetString("FName"), Tag = "FName", Width = 100, Visible = true }); LVCols.Add(new pluginner.ListView2.CollumnInfo() { Title = Locale.GetString("FSize"), Tag = "FSize", Width = 50, Visible = true }); LVCols.Add(new pluginner.ListView2.CollumnInfo() { Title = Locale.GetString("FDate"), Tag = "FDate", Width = 50, Visible = true }); p1.FS = new base_plugins.fs.localFileSystem(); p1.ListingView.Collumns = LVCols.ToArray(); p2.FS = new base_plugins.fs.localFileSystem(); p2.ListingView.Collumns = LVCols.ToArray(); p1.GotFocus += (o, ea) => { SwitchPanel(p1); }; p2.GotFocus += (o, ea) => { SwitchPanel(p2); }; //build keyboard help bar for (int i = 1; i < 11; i++) { KeybHelpButtons[i] = new KeyboardHelpButton(); KeybHelpButtons[i].FKey = "F" + i; KeybHelpButtons[i].Text = Locale.GetString("FCF" + i); KeybHelpButtons[i].CanGetFocus = false; KeyBoardHelp.PackStart(KeybHelpButtons[i], true, Xwt.WidgetPlacement.Fill, Xwt.WidgetPlacement.Fill, 0, -6, 0, -3); } KeybHelpButtons[1].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F1, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[2].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F2, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[3].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F3, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[4].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F4, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[5].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F5, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[6].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F6, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[7].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F7, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[8].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F8, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[9].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F9, Xwt.ModifierKeys.None, false, 0)); }; KeybHelpButtons[10].Clicked += (o, ea) => { this.PanelLayout_KeyReleased(this, new Xwt.KeyEventArgs(Xwt.Key.F10, Xwt.ModifierKeys.None, false, 0)); }; //todo: replace this shit-code with huge using of KeybHelpButtons[n].Tag property (note that it's difficult to be realized due to c# restrictions) //apply user's settings //window size this.Width = fcmd.Properties.Settings.Default.WinWidth; this.Height = fcmd.Properties.Settings.Default.WinHeight; //file size display policy char[] Policies = fcmd.Properties.Settings.Default.SizeShorteningPolicy.ToCharArray(); //default directories if (Properties.Settings.Default.Panel1URL.Length != 0) { p1.LoadDir(Properties.Settings.Default.Panel1URL, ConvertSDP(Policies[0]), ConvertSDP(Policies[1]), ConvertSDP(Policies[2])); } else { p1.LoadDir("file://" + System.Windows.Forms.Application.StartupPath, ConvertSDP(Policies[0]), ConvertSDP(Policies[1]), ConvertSDP(Policies[2])); } if (Properties.Settings.Default.Panel2URL.Length != 0) { p2.LoadDir(Properties.Settings.Default.Panel2URL, ConvertSDP(Policies[0]), ConvertSDP(Policies[1]), ConvertSDP(Policies[2])); } else { p2.LoadDir("file://" + System.Windows.Forms.Application.StartupPath, ConvertSDP(Policies[0]), ConvertSDP(Policies[1]), ConvertSDP(Policies[2])); } //default panel switch (fcmd.Properties.Settings.Default.LastActivePanel) { case 1: p1.ListingView.SetFocus(); ActivePanel = p1; PassivePanel = p2; break; case 2: p2.ListingView.SetFocus(); ActivePanel = p2; PassivePanel = p1; break; default: p1.ListingView.SetFocus(); ActivePanel = p1; PassivePanel = p2; break; } //this.Show(); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; var aboutFile = BrandingService.GetFile("AboutImage.png"); if (aboutFile != null) { imageSep = Xwt.Drawing.Image.FromFile(aboutFile); } else { imageSep = Xwt.Drawing.Image.FromResource("AboutImage.png"); } PackStart(new ImageView(imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(mbox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Version"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("License"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Copyright"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("© 2011-" + DateTime.Now.Year + " ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Xamarin Inc."), Uri = new Uri("http://www.xamarin.com") }); infoBox.PackStart(cbox); infoBox.PackStart(new Xwt.Label() { Text = "© 2004-" + DateTime.Now.Year + " MonoDevelop contributors", MarginLeft = 12 }); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons by ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Yusuke Kamiyamane"), Uri = new Uri("http://p.yusukekamiyamane.com") }); infoBox.PackStart(cbox); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons from the ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Silk icon set"), Uri = new Uri("http://www.famfamfam.com/") }); infoBox.PackStart(cbox); this.ShowAll(); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; using (var stream = BrandingService.GetStream("AboutImage.png", true)) imageSep = new Pixbuf(stream); PackStart(new Gtk.Image(imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(infoBox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Version"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("License"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Copyright"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("© 2011-2012 ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Xamarin Inc."), Uri = new Uri("http://www.xamarin.com") }); infoBox.PackStart(cbox); infoBox.PackStart(new Xwt.Label() { Text = "© 2004-2012 MonoDevelop contributors", MarginLeft = 12 }); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons by ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Yusuke Kamiyamane"), Uri = new Uri("http://p.yusukekamiyamane.com") }); infoBox.PackStart(cbox); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons from the ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Silk icon set"), Uri = new Uri("http://www.famfamfam.com/") }); infoBox.PackStart(cbox); this.ShowAll(); }
public GitSelectRevisionDialog(GitRepository repo) { Title = GettextCatalog.GetString("Select a revision"); var vbox = new Xwt.VBox(); vbox.MinHeight = 400; vbox.MinWidth = 600; vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Tag Name"))); tagNameEntry = new Xwt.TextEntry(); tagNameEntry.Changed += delegate { CheckSensitive(); }; vbox.PackStart(tagNameEntry); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Tag Message"))); tagMessageEntry = new Xwt.TextEntry(); vbox.PackStart(tagMessageEntry); revisionList = new Xwt.ListView(); messageField = new Xwt.DataField <string> (); dateField = new Xwt.DataField <string> (); authorField = new Xwt.DataField <string> (); shaField = new Xwt.DataField <string> (); revisionField = new Xwt.DataField <Revision> (); revisionStore = new Xwt.ListStore(messageField, dateField, authorField, shaField, revisionField); revisionList.DataSource = revisionStore; messageColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Message"), new Xwt.TextCellView(messageField) { Ellipsize = Xwt.EllipsizeMode.End }); revisionList.Columns.Add(messageColumn); dateColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Date"), new Xwt.TextCellView(dateField)); revisionList.Columns.Add(dateColumn); authorColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Author"), new Xwt.TextCellView(authorField)); revisionList.Columns.Add(authorColumn); shaColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Revision"), new Xwt.TextCellView(shaField)); revisionList.Columns.Add(shaColumn); var history = repo.GetHistory(repo.RootPath, null); var min = Math.Min(history.Length, 150); for (int i = 0; i < min; ++i) { var rev = history [i]; // Convert to foreach and use i = AddRow (); revisionStore.AddRow(); revisionStore.SetValue(i, messageField, rev.ShortMessage); revisionStore.SetValue(i, dateField, ParseDate(rev.Time)); revisionStore.SetValue(i, authorField, rev.Author); revisionStore.SetValue(i, shaField, ((GitRevision)rev).ShortName); revisionStore.SetValue(i, revisionField, rev); } revisionList.SelectionChanged += delegate { CheckSensitive(); }; vbox.PackStart(revisionList, true, true); Content = vbox; buttonOk = new Xwt.DialogButton(Xwt.Command.Ok) { Sensitive = false }; Buttons.Add(buttonOk); Buttons.Add(new Xwt.DialogButton(Xwt.Command.Cancel)); }
public AboutMonoDevelopTabPage () { BorderWidth = 0; var aboutFile = BrandingService.GetFile ("AboutImage.png"); if (aboutFile != null) imageSep = Xwt.Drawing.Image.FromFile (aboutFile); else imageSep = Xwt.Drawing.Image.FromResource ("AboutImage.png"); PackStart (new ImageView (imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox (); Xwt.FrameBox mbox = new Xwt.FrameBox (infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart (mbox.ToGtkWidget (), false, false, 0); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Version"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("License"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Copyright"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("© 2014 ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Joshua Granick"), Uri = new Uri ("http://www.joshuagranick.com") }); infoBox.PackStart (cbox); infoBox.PackStart (new Xwt.Label () { Text = "© 2004-2013 MonoDevelop contributors", MarginLeft = 12 }); cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("Some icons by ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Yusuke Kamiyamane"), Uri = new Uri ("http://p.yusukekamiyamane.com") }); infoBox.PackStart (cbox); cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("Some icons from the ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Silk icon set"), Uri = new Uri ("http://www.famfamfam.com/") }); infoBox.PackStart (cbox); this.ShowAll (); }
public GitSelectRevisionDialog (GitRepository repo) { Title = GettextCatalog.GetString ("Select a revision"); var vbox = new Xwt.VBox (); vbox.MinHeight = 400; vbox.MinWidth = 800; vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name"))); tagNameEntry = new Xwt.TextEntry { Name = "tagNameEntry" }; tagNameEntry.Changed += delegate { CheckSensitive (); }; vbox.PackStart (tagNameEntry); vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Tag Message"))); tagMessageEntry = new Xwt.TextEntry { Name = "tagMessageEntry" }; vbox.PackStart (tagMessageEntry); revisionList = new Xwt.ListView (); messageField = new Xwt.DataField<string> (); dateField = new Xwt.DataField<string> (); authorField = new Xwt.DataField<string> (); shaField = new Xwt.DataField<string> (); revisionField = new Xwt.DataField<Revision> (); revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField); revisionList.DataSource = revisionStore; messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add (messageColumn); dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add (dateColumn); authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add (authorColumn); shaColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Revision"), new Xwt.TextCellView (shaField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add (shaColumn); Task.Factory.StartNew (async () => { const int sliceSize = 150; var history = repo.GetHistory (repo.RootPath, null); int slices = history.Length / sliceSize; for (int i = 0; i < slices; ++i) { await Runtime.RunInMainThread (() => { for (int n = 0; n < sliceSize; ++n) { if (cts.IsCancellationRequested) return; int row = revisionStore.AddRow (); var rev = history [row]; revisionStore.SetValue (row, messageField, rev.ShortMessage); revisionStore.SetValue (row, dateField, ParseDate (rev.Time)); revisionStore.SetValue (row, authorField, rev.Author); revisionStore.SetValue (row, shaField, ((GitRevision)rev).ShortName); revisionStore.SetValue (row, revisionField, rev); } }); } }, cts.Token); revisionList.SelectionChanged += delegate { CheckSensitive (); }; vbox.PackStart (revisionList, true, true); Content = vbox; buttonOk = new Xwt.DialogButton (Xwt.Command.Ok) { Sensitive = false }; Buttons.Add (buttonOk); Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel)); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; var aboutFile = BrandingService.GetFile(AboutDialogImage.Name); if (aboutFile != null) { imageSep = Xwt.Drawing.Image.FromFile(aboutFile); } else { imageSep = Xwt.Drawing.Image.FromResource(AboutDialogImage.Name); } PackStart(new ImageView(imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(mbox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Version")), MarginTop = 6, }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("License")), MarginTop = 6, }); var cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; var linkLabel = new Xwt.Label { Markup = "<span underline='true'>License Terms</span>", Cursor = Xwt.CursorType.Hand, }; if (IdeTheme.UserInterfaceTheme == Theme.Light) { linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); } linkLabel.ButtonReleased += (sender, e) => { var binDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); string licensePath = System.IO.Path.Combine(binDir, "branding", "License.txt"); if (Platform.IsMac) { var appDir = System.IO.Path.GetFullPath(System.IO.Path.Combine(binDir, "..", "..", "..", "..", "..")); if (appDir.EndsWith(".app", StringComparison.Ordinal)) { licensePath = System.IO.Path.Combine(appDir, "Contents", "License.txt"); } } if (!File.Exists(licensePath)) { MessageService.ShowError("License file is missing"); } else { DesktopService.OpenFile(licensePath); } }; cbox.PackStart(linkLabel); infoBox.PackStart(cbox); linkLabel = new Xwt.Label { Markup = string.Format("<span underline='true'>{0}</span>", GettextCatalog.GetString("Privacy Statement")), Cursor = Xwt.CursorType.Hand, MarginLeft = 12 }; //TODO: factor out const string PRIVACY_URL = "https://go.microsoft.com/fwlink/?LinkID=824704"; if (IdeTheme.UserInterfaceTheme == Theme.Light) { linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); } linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl(PRIVACY_URL); infoBox.PackStart(linkLabel); infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Copyright")), MarginTop = 6, }); infoBox.PackStart(new Xwt.Label() { Text = (DateTime.Now.Year == 2016 ? "© 2016" : "© 2016–" + DateTime.Now.Year) + " Microsoft Corp.", MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = "© 2004–" + DateTime.Now.Year + " Xamarin Inc.", MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = "© 2004–" + DateTime.Now.Year + " MonoDevelop contributors", MarginLeft = 12 }); this.ShowAll(); }
public GitSelectRevisionDialog(GitRepository repo) { Title = GettextCatalog.GetString("Select a revision"); var vbox = new Xwt.VBox(); vbox.MinHeight = 400; vbox.MinWidth = 800; vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Tag Name"))); tagNameEntry = new Xwt.TextEntry { Name = "tagNameEntry" }; tagNameEntry.Changed += delegate { CheckSensitive(); }; vbox.PackStart(tagNameEntry); vbox.PackStart(new Xwt.Label(GettextCatalog.GetString("Tag Message"))); tagMessageEntry = new Xwt.TextEntry { Name = "tagMessageEntry" }; vbox.PackStart(tagMessageEntry); revisionList = new Xwt.ListView(); messageField = new Xwt.DataField <string> (); dateField = new Xwt.DataField <string> (); authorField = new Xwt.DataField <string> (); shaField = new Xwt.DataField <string> (); revisionField = new Xwt.DataField <Revision> (); revisionStore = new Xwt.ListStore(messageField, dateField, authorField, shaField, revisionField); revisionList.DataSource = revisionStore; messageColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Message"), new Xwt.TextCellView(messageField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add(messageColumn); dateColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Date"), new Xwt.TextCellView(dateField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add(dateColumn); authorColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Author"), new Xwt.TextCellView(authorField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add(authorColumn); shaColumn = new Xwt.ListViewColumn(GettextCatalog.GetString("Revision"), new Xwt.TextCellView(shaField)) { CanResize = true, Alignment = Xwt.Alignment.Center, }; revisionList.Columns.Add(shaColumn); Task.Factory.StartNew(async() => { const int sliceSize = 150; var history = repo.GetHistory(repo.RootPath, null); int slices = history.Length / sliceSize; for (int i = 0; i < slices; ++i) { await Runtime.RunInMainThread(() => { for (int n = 0; n < sliceSize; ++n) { if (cts.IsCancellationRequested) { return; } int row = revisionStore.AddRow(); var rev = history [row]; revisionStore.SetValue(row, messageField, rev.ShortMessage); revisionStore.SetValue(row, dateField, ParseDate(rev.Time)); revisionStore.SetValue(row, authorField, rev.Author); revisionStore.SetValue(row, shaField, ((GitRevision)rev).ShortName); revisionStore.SetValue(row, revisionField, rev); } }); } }, cts.Token); revisionList.SelectionChanged += delegate { CheckSensitive(); }; vbox.PackStart(revisionList, true, true); Content = vbox; buttonOk = new Xwt.DialogButton(Xwt.Command.Ok) { Sensitive = false }; Buttons.Add(buttonOk); Buttons.Add(new Xwt.DialogButton(Xwt.Command.Cancel)); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; var aboutFile = BrandingService.GetFile(AboutDialogImage.Name); if (aboutFile != null) { imageSep = Xwt.Drawing.Image.FromFile(aboutFile); } else { imageSep = Xwt.Drawing.Image.FromResource(AboutDialogImage.Name); } var iv = new ImageView(imageSep); iv.SetCommonAccessibilityAttributes("AboutImage", BrandingService.ApplicationLongName, ""); PackStart(iv, false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(mbox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Version")), MarginTop = 6, }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); if (BrandingService.LicenseTermsUrl != null) { infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("License")), MarginTop = 6, }); var linkLabel = new Xwt.Label { Markup = "<span underline='true'>License Terms</span>", Cursor = Xwt.CursorType.Hand, MarginLeft = 12 }; if (IdeTheme.UserInterfaceTheme == Theme.Light) { linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); } linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl(BrandingService.LicenseTermsUrl); infoBox.PackStart(linkLabel); if (BrandingService.PrivacyStatementUrl != null) { linkLabel = new Xwt.Label { Markup = string.Format("<span underline='true'>{0}</span>", GettextCatalog.GetString("Privacy Statement")), Cursor = Xwt.CursorType.Hand, MarginLeft = 12 }; if (IdeTheme.UserInterfaceTheme == Theme.Light) { linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); } linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl(BrandingService.PrivacyStatementUrl); infoBox.PackStart(linkLabel); } } infoBox.PackStart(new Xwt.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Copyright")), MarginTop = 6, }); infoBox.PackStart(new Xwt.Label() { Text = (DateTime.Now.Year == 2016 ? "© 2016" : "© 2016–" + DateTime.Now.Year) + " Microsoft Corp.", MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = "© 2004–" + DateTime.Now.Year + " Xamarin Inc.", MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = "© 2004–" + DateTime.Now.Year + " MonoDevelop contributors", MarginLeft = 12 }); this.ShowAll(); }
public AboutMonoDevelopTabPage () { BorderWidth = 0; using (var stream = BrandingService.GetStream ("AboutImage.png", true)) imageSep = new Pixbuf (stream); PackStart (new Gtk.Image (imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox (); Xwt.FrameBox mbox = new Xwt.FrameBox (infoBox); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart (mbox.ToGtkWidget (), false, false, 0); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Version"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("License"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart (new Xwt.Label () { Text = GettextCatalog.GetString ("Copyright"), Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("© 2011-2013 ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Xamarin Inc."), Uri = new Uri ("http://www.xamarin.com") }); infoBox.PackStart (cbox); infoBox.PackStart (new Xwt.Label () { Text = "© 2004-2013 MonoDevelop contributors", MarginLeft = 12 }); cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("Some icons by ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Yusuke Kamiyamane"), Uri = new Uri ("http://p.yusukekamiyamane.com") }); infoBox.PackStart (cbox); cbox = new Xwt.HBox () { Spacing = 0, MarginLeft = 12 }; cbox.PackStart (new Xwt.Label ("Some icons from the ")); cbox.PackStart (new Xwt.LinkLabel () { Text = string.Format ("Silk icon set"), Uri = new Uri ("http://www.famfamfam.com/") }); infoBox.PackStart (cbox); this.ShowAll (); }
public GitSelectRevisionDialog (GitRepository repo) { Title = GettextCatalog.GetString ("Select a revision"); var vbox = new Xwt.VBox (); vbox.MinHeight = 400; vbox.MinWidth = 600; vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name"))); tagNameEntry = new Xwt.TextEntry (); tagNameEntry.Changed += delegate { CheckSensitive (); }; vbox.PackStart (tagNameEntry); vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Tag Message"))); tagMessageEntry = new Xwt.TextEntry (); vbox.PackStart (tagMessageEntry); revisionList = new Xwt.ListView (); messageField = new Xwt.DataField<string> (); dateField = new Xwt.DataField<string> (); authorField = new Xwt.DataField<string> (); shaField = new Xwt.DataField<string> (); revisionField = new Xwt.DataField<Revision> (); revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField); revisionList.DataSource = revisionStore; messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField) { Ellipsize = Xwt.EllipsizeMode.End }); revisionList.Columns.Add (messageColumn); dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField)); revisionList.Columns.Add (dateColumn); authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField)); revisionList.Columns.Add (authorColumn); shaColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Revision"), new Xwt.TextCellView (shaField)); revisionList.Columns.Add (shaColumn); var history = repo.GetHistory (repo.RootPath, null); var min = Math.Min (history.Length, 150); for (int i = 0; i < min; ++i) { var rev = history [i]; // Convert to foreach and use i = AddRow (); revisionStore.AddRow (); revisionStore.SetValue (i, messageField, rev.ShortMessage); revisionStore.SetValue (i, dateField, ParseDate (rev.Time)); revisionStore.SetValue (i, authorField, rev.Author); revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName); revisionStore.SetValue (i, revisionField, rev); } revisionList.SelectionChanged += delegate { CheckSensitive (); }; vbox.PackStart (revisionList, true, true); Content = vbox; buttonOk = new Xwt.DialogButton (Xwt.Command.Ok) { Sensitive = false }; Buttons.Add (buttonOk); Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel)); }