public PageNavigationEntry (TrackEditorDialog dialog, string completionTable, string completionColumn) { this.dialog = dialog; entry = new TextEntry (completionTable, completionColumn); entry.Changed += OnChanged; entry.Activated += EditNextTitle; entry.KeyPressEvent += delegate (object o, KeyPressEventArgs args) { if ((args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) && (args.Event.State & Gdk.ModifierType.ControlMask) != 0 && dialog.CanGoBackward) { dialog.NavigateBackward (); entry.GrabFocus (); } }; entry.Show (); Spacing = 1; PackStart (entry, true, true, 0); if (dialog.TrackCount > 1) { dialog.Navigated += delegate { forward_button.Sensitive = dialog.CanGoForward; }; forward_button = EditorUtilities.CreateSmallStockButton (Stock.GoForward); object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost (); Hyena.Gui.TooltipSetter.Set (tooltip_host, forward_button, Catalog.GetString ("Advance to the next track and edit its title")); forward_button.Sensitive = dialog.CanGoForward; forward_button.Show (); forward_button.Clicked += EditNextTitle; PackStart (forward_button, false, false, 0); } }
public static TextEntry CreateEntry(int charWidth) { TextEntry entry = new TextEntry (); entry.WidthChars = charWidth; return entry; }