public ScrolledView() : base() { ScrolledWindow = new ScrolledWindow (null, null); this.Put (ScrolledWindow, 0, 0); ScrolledWindow.Show (); //ebox = new BlendBox (); ControlBox = new EventBox (); this.Put (ControlBox, 0, 0); ControlBox.ShowAll (); hide = new DelayedOperation (2000, new GLib.IdleHandler (HideControls)); this.Destroyed += HandleDestroyed; }
public PhotoView(IBrowsableCollection query) { Query = query; commit_delay = new DelayedOperation (1000, new GLib.IdleHandler (CommitPendingChanges)); Destroyed += HandleDestroy; Name = "ImageContainer"; Box vbox = new VBox (false, 6); Add (vbox); background = new EventBox (); Frame frame = new Frame (); background.Add (frame); frame.ShadowType = ShadowType.In; vbox.PackStart (background, true, true, 0); inner_vbox = new VBox (false , 2); inner_hbox = new HBox (false , 2); frame.Add (inner_hbox); BrowsablePointer bp = new BrowsablePointer (query, -1); View = new PhotoImageView (bp); filmstrip = new Filmstrip (bp); filmstrip.ThumbOffset = 1; filmstrip.Spacing = 4; filmstrip.ThumbSize = 75; PlaceFilmstrip ((Orientation) Preferences.Get <int> (Preferences.FILMSTRIP_ORIENTATION), true); View.PhotoChanged += HandlePhotoChanged; photo_view_scrolled = new ScrolledWindow (null, null); photo_view_scrolled.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); photo_view_scrolled.ShadowType = ShadowType.None; photo_view_scrolled.Add (View); photo_view_scrolled.Child.ButtonPressEvent += HandleButtonPressEvent; View.AddEvents ((int) EventMask.KeyPressMask); inner_vbox.PackStart (photo_view_scrolled, true, true, 0); inner_hbox.PackStart (inner_vbox, true, true, 0); HBox lower_hbox = new HBox (false, 2); //inner_hbox.BorderWidth = 6; tag_view = new TagView (); lower_hbox.PackStart (tag_view, false, true, 0); Label comment = new Label (Catalog.GetString ("Description:")); lower_hbox.PackStart (comment, false, false, 0); description_entry = new Entry (); lower_hbox.PackStart (description_entry, true, true, 0); description_entry.Changed += HandleDescriptionChanged; rating = new RatingEntry { HasFrame = false, AlwaysShowEmptyStars = true }; lower_hbox.PackStart (rating, false, false, 0); rating.Changed += HandleRatingChanged; SetColors (); inner_vbox.PackStart (lower_hbox, false, true, 0); vbox.ShowAll (); Realized += (o, e) => SetColors(); Preferences.SettingChanged += OnPreferencesChanged; }
public ThreadProgressDialog(Thread thread, int total) { /* if (parent_window) this.TransientFor = parent_window; */ this.Title = thread.Name; this.thread = thread; HasSeparator = false; BorderWidth = 6; SetDefaultSize (300, -1); message_label = new Gtk.Label (String.Empty); VBox.PackStart (message_label, true, true, 12); progress_bar = new Gtk.ProgressBar (); VBox.PackStart (progress_bar, true, true, 6); retry_button = new Gtk.Button (Mono.Unix.Catalog.GetString ("Retry")); retry_button.Clicked += new EventHandler (HandleRetryClicked); skip_button = new Gtk.Button (Mono.Unix.Catalog.GetString ("Skip")); skip_button.Clicked += new EventHandler (HandleSkipClicked); ActionArea.Add (retry_button); ActionArea.Add (skip_button); button_label = Gtk.Stock.Cancel; button = (Gtk.Button) AddButton (button_label, (int)Gtk.ResponseType.Cancel); delay = new DelayedOperation (new GLib.IdleHandler (HandleUpdate)); Response += HandleResponse; Destroyed += HandleDestroy; }
public ControlOverlay(Gtk.Widget host) : base(WindowType.Popup) { this.host = host; Decorated = false; DestroyWithParent = true; Name = "FullscreenContainer"; AllowGrow = true; //AllowShrink = true; KeepAbove = true; host_toplevel = (Gtk.Window) host.Toplevel; TransientFor = host_toplevel; host_toplevel.ConfigureEvent += HandleHostConfigure; host_toplevel.SizeAllocated += HandleHostSizeAllocated; AddEvents ((int) (Gdk.EventMask.PointerMotionMask)); hide = new DelayedOperation (2000, HideControls); fade = new DelayedOperation (40, FadeToTarget); dismiss = new DelayedOperation (2000, delegate { /* do nothing */ return false; }); }
protected virtual void BuildUI() { SetFancyStyle (this); TransientFor = (Gtk.Window) view.Toplevel; SkipPagerHint = true; SkipTaskbarHint = true; //view.MotionNotifyEvent += HandleImageViewMotion; view.Item.Changed += HandleItemChanged; view.ZoomChanged += HandleViewZoomChanged; SetSamplePoint (Gdk.Point.Zero); AddEvents ((int) (EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask)); ButtonPressEvent += HandleButtonPressEvent; ButtonReleaseEvent += HandleButtonReleaseEvent; MotionNotifyEvent += HandleMotionNotifyEvent; KeyPressEvent += HandleKeyPressEvent; drag = new DelayedOperation (20, new GLib.IdleHandler (DragUpdate)); // Update the cursor appropriate to indicate dragability/dragging bool inside = false, pressed = false; EnterNotifyEvent += (o, args) => { inside = true; if (!pressed) GdkWindow.Cursor = opened_hand_cursor; }; LeaveNotifyEvent += (o, args) => { inside = false; if (!pressed) GdkWindow.Cursor = null; }; ButtonPressEvent += (o, args) => { pressed = true; if (null != GdkWindow) GdkWindow.Cursor = closed_hand_cursor; }; ButtonReleaseEvent += (o, args) => { pressed = false; GdkWindow.Cursor = inside ? opened_hand_cursor : null; }; }
public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog") { TransientFor = parent_window; Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name); preview_pixbuf = t.Icon; Cms.Profile screen_profile; if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) { preview_image.Pixbuf = preview_pixbuf.Copy (); ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile); } else preview_image.Pixbuf = preview_pixbuf; query = new FSpot.PhotoQuery (db.Photos); if (db.Tags.Hidden != null) query.Terms = FSpot.OrTerm.FromTags (new Tag [] {t}); else query.Terms = new FSpot.Literal (t); image_view = new PhotoImageView (query) {CropHelpers = false}; image_view.SelectionXyRatio = 1.0; image_view.SelectionChanged += HandleSelectionChanged; image_view.PhotoChanged += HandlePhotoChanged; external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"), Gtk.FileChooserAction.Open); external_photo_chooser.Filter = new FileFilter(); external_photo_chooser.Filter.AddPixbufFormats(); external_photo_chooser.LocalOnly = false; external_photo_chooser_hbox.PackStart (external_photo_chooser); external_photo_chooser.Show (); external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged; photo_scrolled_window.Add (image_view); if (query.Count > 0) { photo_spin_button.Wrap = true; photo_spin_button.Adjustment.Lower = 1.0; photo_spin_button.Adjustment.Upper = (double) query.Count; photo_spin_button.Adjustment.StepIncrement = 1.0; photo_spin_button.ValueChanged += HandleSpinButtonChanged; image_view.Item.Index = 0; } else { from_photo_label.Markup = String.Format (Catalog.GetString ( "\n<b>From Photo</b>\n" + " You can use one of your library photos as an icon for this tag.\n" + " However, first you must have at least one photo associated\n" + " with this tag. Please tag a photo as '{0}' and return here\n" + " to use it as an icon."), t.Name); photo_scrolled_window.Visible = false; photo_label.Visible = false; photo_spin_button.Visible = false; } icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf)); icon_view = new Gtk.IconView (icon_store); icon_view.PixbufColumn = 1; icon_view.SelectionMode = SelectionMode.Single; icon_view.SelectionChanged += HandleIconSelectionChanged; icon_scrolled_window.Add (icon_view); icon_view.Show(); image_view.Show (); DelayedOperation fill_delay = new DelayedOperation (FillIconView); fill_delay.Start (); }
public Manipulator(GroupSelector selector) { this.selector = selector; timer = new DelayedOperation (50, new GLib.IdleHandler (DragTimeout)); }
public GroupSelector() : base() { SetFlag (WidgetFlags.NoWindow); background = Rectangle.Zero; glass = new Glass (this); min_limit = new Limit (this, Limit.LimitType.Min); max_limit = new Limit (this, Limit.LimitType.Max); left = new Gtk.Button (); //left.Add (new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Button)); left.Add (new Gtk.Arrow (Gtk.ArrowType.Left, Gtk.ShadowType.None)); left.Relief = Gtk.ReliefStyle.None; //left.Clicked += HandleScrollLeft; left.Pressed += HandleLeftPressed; left.ButtonReleaseEvent += HandleScrollReleaseEvent; left_delay = new DelayedOperation (50, new GLib.IdleHandler (HandleScrollLeft)); right = new Gtk.Button (); //right.Add (new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Button)); right.Add (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None)); right.Relief = Gtk.ReliefStyle.None; right.Pressed += HandleRightPressed; right.ButtonReleaseEvent += HandleScrollReleaseEvent; right_delay = new DelayedOperation (50, new GLib.IdleHandler (HandleScrollRight)); //right.Clicked += HandleScrollRight; this.Put (left, 0, 0); this.Put (right, 100, 0); left.Show (); right.Show (); CanFocus = true; Mode = RangeType.Min; UpdateButtons (); }
// Constructor. public InfoBox() : base(false, 0) { ContextSwitchStrategy = new MRUInfoBoxContextSwitchStrategy (); ContextChanged += HandleContextChanged; SetupWidgets (); update_delay = new DelayedOperation (Update); update_delay.Start (); histogram_delay = new DelayedOperation (DelayedUpdateHistogram); BorderWidth = 2; Hide (); }
public MetadataDisplayWidget() { main_vbox = new VBox (); main_vbox.Spacing = 6; metadata_message = new Label (String.Empty); metadata_message.UseMarkup = true; metadata_message.LineWrap = true; metadata_vbox = new VBox (); metadata_vbox.Spacing = 6; main_vbox.PackStart (metadata_vbox, false, false, 0); AddWithViewport (metadata_message); ((Viewport)Child).ShadowType = ShadowType.None; BorderWidth = 3; display = State.message; ExposeEvent += HandleExposeEvent; open_list = new List<string> (); // Create Expander and TreeView for // extended metadata var tree_view = new TreeView (); tree_view.HeadersVisible = false; tree_view.RulesHint = true; var col = new TreeViewColumn (); col.Sizing = TreeViewColumnSizing.Autosize; CellRenderer colr = new CellRendererText (); col.PackStart (colr, false); col.AddAttribute (colr, "markup", 0); tree_view.AppendColumn (col); extended_metadata = new ListStore (typeof(string)); tree_view.Model = extended_metadata; var expander = new Expander (String.Format ("<span weight=\"bold\"><small>{0}</small></span>", Catalog.GetString ("Extended Metadata"))); expander.UseMarkup = true; expander.Add (tree_view); expander.Expanded = true; main_vbox.PackStart (expander, false, false, 6); expander.ShowAll (); update_delay = new DelayedOperation (Update); update_delay.Start (); }
public SlideShow(BrowsablePointer item, uint interval_ms, bool init) : base() { this.item = item; DoubleBuffered = false; AppPaintable = true; CanFocus = true; item.Changed += HandleItemChanged; foreach (TransitionNode transition in AddinManager.GetExtensionNodes ("/FSpot/SlideShow")) { if (this.transition == null) this.transition = transition.Transition; transitions.Add (transition.Transition); } flip = new DelayedOperation (interval_ms, delegate {item.MoveNext (true); return true;}); animation = new DoubleAnimation (0, 1, new TimeSpan (0, 0, 2), HandleProgressChanged, GLib.Priority.Default); if (init) { HandleItemChanged (null, null); } }
public FullScreenView(IBrowsableCollection collection, Gtk.Window parent) : base("Full Screen Mode") { //going fullscreen on the same screen the parent window Gdk.Screen screen = Screen; int monitor = screen.GetMonitorAtWindow (parent.GdkWindow); Gdk.Rectangle bounds = screen.GetMonitorGeometry (monitor); Move (bounds.X, bounds.Y); string style = "style \"test\" {\n" + "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" + "}\n" + "class \"GtkToolbar\" style \"test\""; Gtk.Rc.ParseString (style); Name = "FullscreenContainer"; try { //scroll = new Gtk.ScrolledWindow (null, null); actions = new ActionGroup ("joe"); actions.Add (new ActionEntry [] { new ActionEntry (HideToolbar, Stock.Close, Catalog.GetString ("Hide"), null, Catalog.GetString ("Hide toolbar"), HideToolbarAction)}); actions.Add (new ToggleActionEntry [] { new ToggleActionEntry (Info, Stock.Info, Catalog.GetString ("Info"), null, Catalog.GetString ("Image information"), InfoAction, false)}); Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen, Catalog.GetString ("Exit fullscreen"), null, null); exit_full_screen.IconName = "view-restore"; exit_full_screen.Activated += ExitAction; actions.Add (exit_full_screen); Gtk.Action slide_show = new Gtk.Action (SlideShow, Catalog.GetString ("Slideshow"), Catalog.GetString ("Start slideshow"), null); slide_show.IconName = "media-playback-start"; slide_show.Activated += SlideShowAction; actions.Add (slide_show); new WindowOpacityFader (this, 1.0, 600); notebook = new Notebook (); notebook.ShowBorder = false; notebook.ShowTabs = false; notebook.Show (); scroll = new ScrolledView (); scroll.ScrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Never); view = new PhotoImageView (collection); // FIXME this should be handled by the new style setting code view.ModifyBg (Gtk.StateType.Normal, this.Style.Black); this.Add (notebook); view.Show (); view.MotionNotifyEvent += HandleViewMotion; view.PointerMode = PointerMode.Scroll; scroll.ScrolledWindow.Add (view); Toolbar tbar = new Toolbar (); tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz; tbar.ShowArrow = false; tbar.BorderWidth = 15; ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem () as ToolItem; t_item.IsImportant = true; tbar.Insert (t_item, -1); Gtk.Action action = new PreviousPictureAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); play_pause_button = (actions [SlideShow]).CreateToolItem () as ToolButton; tbar.Insert (play_pause_button, -1); action = new NextPictureAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); t_item = new ToolItem (); t_item.Child = new Label (Catalog.GetString ("Slide transition:")); tbar.Insert (t_item, -1); display = new SlideShow (view.Item); display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask)); display.ModifyBg (Gtk.StateType.Normal, this.Style.Black); display.MotionNotifyEvent += HandleViewMotion; display.Show (); t_item = new ToolItem (); ComboBox combo = ComboBox.NewText (); foreach (var transition in display.Transitions) combo.AppendText (transition.Name); combo.Active = 0; combo.Changed += HandleTransitionChanged; t_item.Child = combo; tbar.Insert (t_item, -1); action = new RotateLeftAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); action = new RotateRightAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); info_button = (ToggleToolButton) ((actions [Info]).CreateToolItem () as ToolItem); tbar.Insert (info_button, -1); tbar.Insert ((actions [HideToolbar]).CreateToolItem () as ToolItem, -1); notebook.AppendPage (scroll, null); notebook.AppendPage (display, null); tbar.ShowAll (); scroll.Show (); this.Decorated = false; this.Fullscreen (); this.ButtonPressEvent += HandleButtonPressEvent; view.Item.Changed += HandleItemChanged; view.GrabFocus (); hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor)); hide_cursor_delay.Start (); controls = new ControlOverlay (this); controls.Add (tbar); controls.Dismiss (); notebook.CurrentPage = 0; } catch (System.Exception e) { Log.Exception (e); } }