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() { var box = new Xwt.VBox (); box.Spacing = 6; box.Margin = 12; bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require); if (require) { box.Visible = false; return box.ToGtkWidget (); } 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 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(); }
/// <summary>Converts Xwt.CheckBox selection status into boolean value</summary> private bool BoolFromCBX(Xwt.CheckBox CBX) { switch (CBX.State) { case Xwt.CheckBoxState.On: return(true); case Xwt.CheckBoxState.Off: return(false); } return(false); //fallback }
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 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.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 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(); }
void mnuViewWithFilter_Clicked(object sender, EventArgs e) { string Filter = @"*.*"; InputBox ibx = new InputBox(Locale.GetString("NameFilterQuestion"), Filter); Xwt.CheckBox chkRegExp = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx.OtherWidgets.Add(chkRegExp, 0, 0); if (!ibx.ShowDialog()) { return; } Filter = ibx.Result; if (chkRegExp.State == Xwt.CheckBoxState.Off) { Filter = Filter.Replace(".", @"\."); Filter = Filter.Replace("*", ".*"); Filter = Filter.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter); List <pluginner.DirItem> GoodItems = new List <pluginner.DirItem>(); foreach (pluginner.DirItem di in ActivePanel.FS.DirectoryContent) { if (re.IsMatch(di.TextToShow)) { GoodItems.Add(di); } } ActivePanel.LoadDir( ActivePanel.FS.CurrentDirectory, GoodItems, ActivePanel.CurShortenKB, ActivePanel.CurShortenMB, ActivePanel.CurShortenGB ); ActivePanel.StatusBar.Text = string.Format(Locale.GetString("NameFilterFound"), Filter, GoodItems.Count); } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } }
/// <summary>The entry form's keyboard keypress handler (except commandbar keypresses)</summary> void PanelLayout_KeyReleased(object sender, Xwt.KeyEventArgs e) { #if DEBUG pluginner.FileListPanel p1 = (PanelLayout.Panel1.Content as pluginner.FileListPanel); pluginner.FileListPanel p2 = (PanelLayout.Panel2.Content as pluginner.FileListPanel); Console.WriteLine("KEYBOARD DEBUG: " + e.Modifiers.ToString() + "+" + e.Key.ToString() + " was pressed. Panels focuses: " + (ActivePanel == p1) + " | " + (ActivePanel == p2)); #endif if (e.Key == Xwt.Key.Return) return;//ENTER presses are handled by other event string URL1; if (ActivePanel.ListingView.SelectedRow > -1) { URL1 = ActivePanel.GetValue(ActivePanel.dfURL); } else { URL1 = null; } pluginner.IFSPlugin FS1 = ActivePanel.FS; string URL2; if (PassivePanel.ListingView.SelectedRow > -1) { URL2 = PassivePanel.GetValue(PassivePanel.dfURL); } else { URL2 = null; } pluginner.IFSPlugin FS2 = PassivePanel.FS; switch (e.Key) { case Xwt.Key.NumPadAdd: //[+] gray - add selection string Filter = @"*.*"; InputBox ibx_qs = new InputBox(Locale.GetString("QuickSelect"), Filter); Xwt.CheckBox chkRegExp = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx_qs.OtherWidgets.Add(chkRegExp, 0, 0); if (!ibx_qs.ShowDialog()) return; Filter = ibx_qs.Result; if (chkRegExp.State == Xwt.CheckBoxState.Off) { Filter = Filter.Replace(".", @"\."); Filter = Filter.Replace("*", ".*"); Filter = Filter.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter); int Count = 0; foreach (pluginner.ListView2Item lvi in ActivePanel.ListingView.Items) { if (re.IsMatch(lvi.Data[1].ToString())){ ActivePanel.ListingView.Select(lvi); Count++; } } ActivePanel.StatusBar.Text = string.Format(Locale.GetString("NameFilterFound"), Filter, Count); } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } return; case Xwt.Key.NumPadSubtract: //[-] gray - add selection string Filter_qus = @"*.*"; InputBox ibx_qus = new InputBox(Locale.GetString("QuickUnselect"), Filter_qus); Xwt.CheckBox chkRegExp_qus = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx_qus.OtherWidgets.Add(chkRegExp_qus, 0, 0); if (!ibx_qus.ShowDialog()) return; Filter_qus = ibx_qus.Result; if (chkRegExp_qus.State == Xwt.CheckBoxState.Off) { Filter_qus = Filter_qus.Replace(".", @"\."); Filter_qus = Filter_qus.Replace("*", ".*"); Filter_qus = Filter_qus.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter_qus); int Count_qus = 0; foreach (pluginner.ListView2Item lvi in ActivePanel.ListingView.Items) { if (re.IsMatch(lvi.Data[1].ToString())) { ActivePanel.ListingView.Unselect(lvi); Count_qus++; } } } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } return; //F KEYS case Xwt.Key.F3: //F3: View. Shift+F3: View as text. if (URL1 == null) return; if (!FS1.FileExists(URL1)) { Xwt.MessageDialog.ShowWarning(string.Format(Locale.GetString("FileNotFound"), ActivePanel.GetValue(ActivePanel.dfDisplayName))); return; } VEd V = new VEd(); if (e.Modifiers == Xwt.ModifierKeys.None) { V.LoadFile(URL1, FS1, false); V.Show(); } else if(e.Modifiers == Xwt.ModifierKeys.Shift) { V.LoadFile(URL1, FS1, new base_plugins.ve.PlainText(), false); V.Show(); } //todo: handle Ctrl+F3 (Sort by name). return; case Xwt.Key.F4: //F4: Edit. Shift+F4: Edit as txt. if (URL1 == null) return; if (!FS1.FileExists(URL1)) { Xwt.MessageDialog.ShowWarning(string.Format(Locale.GetString("FileNotFound"), ActivePanel.GetValue(ActivePanel.dfDisplayName))); return; } VEd E = new VEd(); if (e.Modifiers == Xwt.ModifierKeys.None) { E.LoadFile(URL1, FS1, true); E.Show(); } else if(e.Modifiers == Xwt.ModifierKeys.Shift) { E.LoadFile(URL1, FS1, new base_plugins.ve.PlainText(), true); E.Show(); } //todo: handle Ctrl+F4 (Sort by extension). return; case Xwt.Key.F5: //F5: Copy. if (URL1 == null) return; Cp(); //todo: handle Ctrl+F5 (Sort by timestamp). return; case Xwt.Key.F6: //F6: Move/Rename. if (URL1 == null) return; Mv(); //todo: handle Ctrl+F6 (Sort by size). return; case Xwt.Key.F7: //F7: New directory. InputBox ibx = new InputBox(Locale.GetString("NewDirURL"), ActivePanel.FS.CurrentDirectory + Locale.GetString("NewDirTemplate")); if (ibx.ShowDialog()) MkDir(ibx.Result); return; case Xwt.Key.F8: //F8: delete if (URL1 == null) return; Rm(); //todo: move to trash can/recycle bin & handle Shit+F8 (remove completely) return; case Xwt.Key.F10: //F10: Exit //todo: ask user, are it really want to close FC? Xwt.Application.Exit(); //todo: handle Alt+F10 (directory tree) return; } #if DEBUG Console.WriteLine("KEYBOARD DEBUG: the key wasn't handled"); #endif e.Handled = true; }
void mnuViewWithFilter_Clicked(object sender, EventArgs e) { string Filter = @"*.*"; InputBox ibx = new InputBox(Locale.GetString("NameFilterQuestion"), Filter); Xwt.CheckBox chkRegExp = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx.OtherWidgets.Add(chkRegExp, 0, 0); if (!ibx.ShowDialog()) return; Filter = ibx.Result; if (chkRegExp.State == Xwt.CheckBoxState.Off) { Filter = Filter.Replace(".", @"\."); Filter = Filter.Replace("*", ".*"); Filter = Filter.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter); List<pluginner.DirItem> GoodItems = new List<pluginner.DirItem>(); foreach (pluginner.DirItem di in ActivePanel.FS.DirectoryContent) { if (re.IsMatch(di.TextToShow)) GoodItems.Add(di); } ActivePanel.LoadDir( ActivePanel.FS.CurrentDirectory, GoodItems, ActivePanel.CurShortenKB, ActivePanel.CurShortenMB, ActivePanel.CurShortenGB ); ActivePanel.StatusBar.Text = string.Format(Locale.GetString("NameFilterFound"), Filter, GoodItems.Count); } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } }
/// <summary>The entry form's keyboard keypress handler (except commandbar keypresses)</summary> void PanelLayout_KeyReleased(object sender, Xwt.KeyEventArgs e) { #if DEBUG pluginner.FileListPanel p1 = (PanelLayout.Panel1.Content as pluginner.FileListPanel); pluginner.FileListPanel p2 = (PanelLayout.Panel2.Content as pluginner.FileListPanel); Console.WriteLine("KEYBOARD DEBUG: " + e.Modifiers.ToString() + "+" + e.Key.ToString() + " was pressed. Panels focuses: " + (ActivePanel == p1) + " | " + (ActivePanel == p2)); #endif if (e.Key == Xwt.Key.Return) { return; //ENTER presses are handled by other event } string URL1; if (ActivePanel.ListingView.SelectedRow > -1) { URL1 = ActivePanel.GetValue(ActivePanel.dfURL); } else { URL1 = null; } pluginner.IFSPlugin FS1 = ActivePanel.FS; string URL2; if (PassivePanel.ListingView.SelectedRow > -1) { URL2 = PassivePanel.GetValue(PassivePanel.dfURL); } else { URL2 = null; } pluginner.IFSPlugin FS2 = PassivePanel.FS; switch (e.Key) { case Xwt.Key.NumPadAdd: //[+] gray - add selection string Filter = @"*.*"; InputBox ibx_qs = new InputBox(Locale.GetString("QuickSelect"), Filter); Xwt.CheckBox chkRegExp = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx_qs.OtherWidgets.Add(chkRegExp, 0, 0); if (!ibx_qs.ShowDialog()) { return; } Filter = ibx_qs.Result; if (chkRegExp.State == Xwt.CheckBoxState.Off) { Filter = Filter.Replace(".", @"\."); Filter = Filter.Replace("*", ".*"); Filter = Filter.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter); int Count = 0; foreach (pluginner.ListView2Item lvi in ActivePanel.ListingView.Items) { if (re.IsMatch(lvi.Data[1].ToString())) { ActivePanel.ListingView.Select(lvi); Count++; } } ActivePanel.StatusBar.Text = string.Format(Locale.GetString("NameFilterFound"), Filter, Count); } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } return; case Xwt.Key.NumPadSubtract: //[-] gray - add selection string Filter_qus = @"*.*"; InputBox ibx_qus = new InputBox(Locale.GetString("QuickUnselect"), Filter_qus); Xwt.CheckBox chkRegExp_qus = new Xwt.CheckBox(Locale.GetString("NameFilterUseRegExp")); ibx_qus.OtherWidgets.Add(chkRegExp_qus, 0, 0); if (!ibx_qus.ShowDialog()) { return; } Filter_qus = ibx_qus.Result; if (chkRegExp_qus.State == Xwt.CheckBoxState.Off) { Filter_qus = Filter_qus.Replace(".", @"\."); Filter_qus = Filter_qus.Replace("*", ".*"); Filter_qus = Filter_qus.Replace("?", "."); } try { System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(Filter_qus); int Count_qus = 0; foreach (pluginner.ListView2Item lvi in ActivePanel.ListingView.Items) { if (re.IsMatch(lvi.Data[1].ToString())) { ActivePanel.ListingView.Unselect(lvi); Count_qus++; } } } catch (Exception ex) { Xwt.MessageDialog.ShowError(Locale.GetString("NameFilterError"), ex.Message); } return; //F KEYS case Xwt.Key.F3: //F3: View. Shift+F3: View as text. if (URL1 == null) { return; } if (!FS1.FileExists(URL1)) { Xwt.MessageDialog.ShowWarning(string.Format(Locale.GetString("FileNotFound"), ActivePanel.GetValue(ActivePanel.dfDisplayName))); return; } VEd V = new VEd(); if (e.Modifiers == Xwt.ModifierKeys.None) { V.LoadFile(URL1, FS1, false); V.Show(); } else if (e.Modifiers == Xwt.ModifierKeys.Shift) { V.LoadFile(URL1, FS1, new base_plugins.ve.PlainText(), false); V.Show(); } //todo: handle Ctrl+F3 (Sort by name). return; case Xwt.Key.F4: //F4: Edit. Shift+F4: Edit as txt. if (URL1 == null) { return; } if (!FS1.FileExists(URL1)) { Xwt.MessageDialog.ShowWarning(string.Format(Locale.GetString("FileNotFound"), ActivePanel.GetValue(ActivePanel.dfDisplayName))); return; } VEd E = new VEd(); if (e.Modifiers == Xwt.ModifierKeys.None) { E.LoadFile(URL1, FS1, true); E.Show(); } else if (e.Modifiers == Xwt.ModifierKeys.Shift) { E.LoadFile(URL1, FS1, new base_plugins.ve.PlainText(), true); E.Show(); } //todo: handle Ctrl+F4 (Sort by extension). return; case Xwt.Key.F5: //F5: Copy. if (URL1 == null) { return; } Cp(); //todo: handle Ctrl+F5 (Sort by timestamp). return; case Xwt.Key.F6: //F6: Move/Rename. if (URL1 == null) { return; } Mv(); //todo: handle Ctrl+F6 (Sort by size). return; case Xwt.Key.F7: //F7: New directory. InputBox ibx = new InputBox(Locale.GetString("NewDirURL"), ActivePanel.FS.CurrentDirectory + Locale.GetString("NewDirTemplate")); if (ibx.ShowDialog()) { MkDir(ibx.Result); } return; case Xwt.Key.F8: //F8: delete if (URL1 == null) { return; } Rm(); //todo: move to trash can/recycle bin & handle Shit+F8 (remove completely) return; case Xwt.Key.F10: //F10: Exit //todo: ask user, are it really want to close FC? Xwt.Application.Exit(); //todo: handle Alt+F10 (directory tree) return; } #if DEBUG Console.WriteLine("KEYBOARD DEBUG: the key isn't handled"); #endif }