public NotificationMessage (string t, string m) : base (false, 5) { this.Style = style; BorderWidth = 5; icon = new Image (Stock.DialogInfo, IconSize.Dialog); this.PackStart (icon, false, true, 5); VBox vbox = new VBox (false, 5); this.PackStart (vbox, true, true, 0); title = new Label (); title.SetAlignment (0.0f, 0.5f); this.Title = t; vbox.PackStart (title, false, true, 0); message = new Label (); message.LineWrap = true; message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label message.SetAlignment (0.0f, 0.0f); this.Message = m; vbox.PackStart (message, true, true, 0); action_box = new HBox (false, 3); Button hide_button = new Button (Catalog.GetString ("Hide")); hide_button.Clicked += OnHideClicked; action_box.PackEnd (hide_button, false, true, 0); Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); action_align.Add (action_box); vbox.PackStart (action_align, false, true, 0); }
/// <summary> /// xml deserialization /// </summary> /// <param name='reader'> /// Reader. /// </param> protected virtual void doReadXml(XmlReader reader) { StoredWidth = Convert.ToInt32(reader["CurrentWidth"]); StoredHeight = Convert.ToInt32(reader["CurrentHeight"]); Maximized = Convert.ToBoolean(reader["Maximized"]); while (reader.LocalName != "frame" && reader.Read()) { ; } if (reader.LocalName == "frame") { if (!reader.IsEmptyElement) { reader.Read(); String tp = reader.LocalName + "," + reader["assembly"]; Widget w = (Widget)Sharpend.Utils.Reflection.createInstance(System.Type.GetType(tp)); frame = (DockFrame)w; frame.ReadXml(reader); box1.PackEnd(frame, true, true, 0); } else { reader.Read(); //TODO if and else reader.read } } }
public static void ReorderWidgets(Box box) { var items = new ChildPacking[box.Children.Length]; for (int i = 0; i < items.Length; i++) { bool expand, fill; uint padding; PackType packType; box.QueryChildPacking(box.Children[i], out expand, out fill, out padding, out packType); items[i] = new ChildPacking { Expand = expand, Fill = fill, Padding = padding, PackType = packType, Widget = box.Children[i] }; } foreach (var item in items) { box.Remove(item.Widget); } foreach (var item in items) { box.PackEnd(item.Widget); box.SetChildPacking(item.Widget, item.Expand, item.Fill, item.Padding, item.PackType); } }
private void init() { VBox1 = new Gtk.Box(Orientation.Vertical, 0); VBox1.Visible = true; this.Add(VBox1); dock = new DockContainer(null); //xxxdock.Name = "xxxdock"; dock.Visible = true; dock.Expand = true; VBox1.PackEnd(dock, true, true, 0); }
public DockFrame() { paned1 = new Gtk.Paned(Orientation.Horizontal); paned1.Name = "paned1"; paned1.Expand = true; box2 = new Gtk.Box(Orientation.Vertical, 0); box2.Name = "box2"; //box2.Expand = true; box1 = new Gtk.Box(Orientation.Vertical, 0); box1.Name = "box1"; //box1.Expand = true; dock1 = new DockContainer(this); dock2 = new DockContainer(this); dock1.Name = "dock1"; dock2.Name = "dock2"; dock1.Expand = true; dock2.Expand = true; box1.PackEnd(dock1, true, true, 0); box2.PackEnd(dock2, true, true, 0); dock1.Expand = true; dock2.Expand = true; items = new List <DockItemContainer>(100); lastposition = new Dictionary <string, DockFramePosition>(100); paned1.Add1(box1); paned1.Add2(box2); paned1.Position = 400; dock1.OnItemAdded += HandleDock1Added; dock1.OnPageAdded += HandleDock1Added; dock2.OnItemAdded += HandleDock2Added; dock2.OnPageAdded += HandleDock2Added; this.Add(paned1); }
public NotificationMessage(string t, string m) : base(false, 5) { this.Style = style; BorderWidth = 5; icon = new Image(Stock.DialogInfo, IconSize.Dialog); this.PackStart(icon, false, true, 5); VBox vbox = new VBox(false, 5); this.PackStart(vbox, true, true, 0); title = new Label(); title.SetAlignment(0.0f, 0.5f); this.Title = t; vbox.PackStart(title, false, true, 0); message = new Label(); message.LineWrap = true; message.SetSizeRequest(500, -1); // ugh, no way to sanely reflow a gtk label message.SetAlignment(0.0f, 0.0f); this.Message = m; vbox.PackStart(message, true, true, 0); action_box = new HBox(false, 3); Button hide_button = new Button(Catalog.GetString("Hide")); hide_button.Clicked += OnHideClicked; action_box.PackEnd(hide_button, false, true, 0); Alignment action_align = new Alignment(1.0f, 0.5f, 0.0f, 0.0f); action_align.Add(action_box); vbox.PackStart(action_align, false, true, 0); }
public DockFrame() { paned1 = new Gtk.Paned(Orientation.Horizontal); paned1.Name ="paned1"; paned1.Expand = true; box2 = new Gtk.Box(Orientation.Vertical,0); box2.Name ="box2"; //box2.Expand = true; box1 = new Gtk.Box(Orientation.Vertical,0); box1.Name ="box1"; //box1.Expand = true; dock1 = new DockContainer(this); dock2 = new DockContainer(this); dock1.Name = "dock1"; dock2.Name = "dock2"; dock1.Expand = true; dock2.Expand = true; box1.PackEnd(dock1,true,true,0); box2.PackEnd(dock2,true,true,0); dock1.Expand = true; dock2.Expand = true; items = new List<DockItemContainer>(100); lastposition = new Dictionary<string, DockFramePosition>(100); paned1.Add1(box1); paned1.Add2(box2); paned1.Position = 400; dock1.OnItemAdded += HandleDock1Added; dock1.OnPageAdded += HandleDock1Added; dock2.OnItemAdded += HandleDock2Added; dock2.OnPageAdded += HandleDock2Added; this.Add(paned1); }
private void init() { VBox1 = new Gtk.Box(Orientation.Vertical,0); VBox1.Visible =true; this.Add(VBox1); dock = new DockContainer(null); //xxxdock.Name = "xxxdock"; dock.Visible = true; dock.Expand = true; VBox1.PackEnd(dock,true,true,0); }
public MiniMode(BaseClientWindow defaultMainWindow) : base(Catalog.GetString("Banshee Media Player"), "minimode", 0, 0) { default_main_window = defaultMainWindow; glade = new Glade.XML(System.Reflection.Assembly.GetExecutingAssembly(), "minimode.glade", "MiniModeWindow", null); glade.Autoconnect(this); Widget child = glade["mini_mode_contents"]; (child.Parent as Container).Remove(child); Add(child); BorderWidth = 12; Resizable = false; // Playback Buttons Widget previous_button = ActionService.PlaybackActions["PreviousAction"].CreateToolItem(); Widget playpause_button = ActionService.PlaybackActions["PlayPauseAction"].CreateToolItem(); Widget button = ActionService.PlaybackActions["NextAction"].CreateToolItem(); Menu menu = ActionService.PlaybackActions.ShuffleActions.CreateMenu(); MenuButton next_button = new MenuButton(button, menu, true); PlaybackBox.PackStart(previous_button, false, false, 0); PlaybackBox.PackStart(playpause_button, false, false, 0); PlaybackBox.PackStart(next_button, false, false, 0); PlaybackBox.ShowAll(); // Seek Slider/Position Label seek_slider = new ConnectedSeekSlider(); SeekContainer.PackStart(seek_slider, false, false, 0); SeekContainer.ShowAll(); // Volume button volume_button = new ConnectedVolumeButton(); VolumeContainer.PackStart(volume_button, false, false, 0); volume_button.Show(); // Source combobox source_combo_box = new SourceComboBox(); SourceBox.PackStart(source_combo_box, true, true, 0); source_combo_box.Show(); // Track info track_info_display = new ClassicTrackInfoDisplay(); track_info_display.Show(); CoverBox.PackStart(track_info_display, true, true, 0); // Repeat button RepeatActionButton repeat_toggle_button = new RepeatActionButton(); LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0); LowerButtonsBox.ShowAll(); tooltip_host = TooltipSetter.CreateHost(); SetTip(fullmode_button, Catalog.GetString("Switch back to full mode")); SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode")); // Hook up everything ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.Error | PlayerEvent.StateChange | PlayerEvent.TrackInfoUpdated); SetHeightLimit(); }
public MiniMode() : base(Branding.ApplicationLongName) { default_main_window = InterfaceElements.MainWindow; glade = new Glade.XML(null, "minimode.glade", "MiniModeWindow", null); glade.Autoconnect(this); Widget child = glade["mini_mode_contents"]; (child.Parent as Container).Remove(child); Add(child); BorderWidth = 12; Resizable = false; IconThemeUtils.SetWindowIcon(this); DeleteEvent += delegate { Globals.ActionManager["QuitAction"].Activate(); }; // Playback Buttons ActionButton previous_button = new ActionButton(Globals.ActionManager["PreviousAction"]); previous_button.LabelVisible = false; previous_button.Padding = 1; ActionButton next_button = new ActionButton(Globals.ActionManager["NextAction"]); next_button.LabelVisible = false; next_button.Padding = 1; ActionButton playpause_button = new ActionButton(Globals.ActionManager["PlayPauseAction"]); playpause_button.LabelVisible = false; playpause_button.Padding = 1; PlaybackBox.PackStart(previous_button, false, false, 0); PlaybackBox.PackStart(playpause_button, false, false, 0); PlaybackBox.PackStart(next_button, false, false, 0); PlaybackBox.ShowAll(); // Seek Slider/Position Label seek_slider = new SeekSlider(); seek_slider.SetSizeRequest(125, -1); seek_slider.SeekRequested += delegate { PlayerEngineCore.Position = (uint)seek_slider.Value; }; stream_position_label = new StreamPositionLabel(seek_slider); SeekContainer.PackStart(seek_slider, false, false, 0); SeekContainer.PackStart(stream_position_label, false, false, 0); SeekContainer.ShowAll(); // Volume button volume_button = new VolumeButton(); VolumeContainer.PackStart(volume_button, false, false, 0); volume_button.Show(); volume_button.VolumeChanged += delegate(int volume) { PlayerEngineCore.Volume = (ushort)volume; PlayerEngineCore.VolumeSchema.Set(volume); }; // Cover cover_art_thumbnail = new CoverArtThumbnail(90); Gdk.Pixbuf default_pixbuf = Banshee.Base.Branding.DefaultCoverArt; cover_art_thumbnail.NoArtworkPixbuf = default_pixbuf; CoverBox.PackStart(cover_art_thumbnail, false, false, 0); // Source combobox source_combo_box = new SourceComboBox(); SourceBox.PackStart(source_combo_box, true, true, 0); source_combo_box.ShowAll(); // Repeat/Shuffle buttons MultiStateToggleButton shuffle_toggle_button = new MultiStateToggleButton(); shuffle_toggle_button.AddState(typeof(ShuffleDisabledToggleState), Globals.ActionManager["ShuffleAction"] as ToggleAction); shuffle_toggle_button.AddState(typeof(ShuffleEnabledToggleState), Globals.ActionManager["ShuffleAction"] as ToggleAction); shuffle_toggle_button.Relief = ReliefStyle.None; shuffle_toggle_button.ShowLabel = false; try { shuffle_toggle_button.ActiveStateIndex = PlayerWindowSchema.PlaybackShuffle.Get() ? 1 : 0; } catch { shuffle_toggle_button.ActiveStateIndex = 0; } shuffle_toggle_button.ShowAll(); MultiStateToggleButton repeat_toggle_button = new MultiStateToggleButton(); repeat_toggle_button.AddState(typeof(RepeatNoneToggleState), Globals.ActionManager["RepeatNoneAction"] as ToggleAction); repeat_toggle_button.AddState(typeof(RepeatAllToggleState), Globals.ActionManager["RepeatAllAction"] as ToggleAction); repeat_toggle_button.AddState(typeof(RepeatSingleToggleState), Globals.ActionManager["RepeatSingleAction"] as ToggleAction); repeat_toggle_button.Relief = ReliefStyle.None; repeat_toggle_button.ShowLabel = false; try { repeat_toggle_button.ActiveStateIndex = (int)PlayerWindowSchema.PlaybackRepeat.Get(); } catch { repeat_toggle_button.ActiveStateIndex = 0; } repeat_toggle_button.ShowAll(); LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0); LowerButtonsBox.PackEnd(shuffle_toggle_button, false, false, 0); LowerButtonsBox.ShowAll(); // Tooltips toolTips = new Tooltips(); SetTip(previous_button, Catalog.GetString("Play previous song")); SetTip(playpause_button, Catalog.GetString("Play/pause current song")); SetTip(next_button, Catalog.GetString("Play next song")); SetTip(fullmode_button, Catalog.GetString("Switch back to full mode")); SetTip(volume_button, Catalog.GetString("Adjust volume")); SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode")); SetTip(shuffle_toggle_button, Catalog.GetString("Toggle shuffle playback mode")); // Hook up everything PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged; PlayerEngineCore.StateChanged += OnPlayerEngineStateChanged; SetHeightLimit(); }
public MiniMode() { glade = new Glade.XML(null, "minimode.glade", "MiniModeWindow", "banshee"); glade.Autoconnect(this); if (MiniModeWindow == null) { throw new Exception(); // This propagate Glade errors to Banshee's plugin framework } IconThemeUtils.SetWindowIcon(MiniModeWindow); MiniModeWindow.DeleteEvent += delegate { PlayerCore.UserInterface.Quit(); }; // Playback Buttons ActionButton previous_button = new ActionButton(Globals.ActionManager["PreviousAction"]); previous_button.LabelVisible = false; previous_button.Padding = 1; ActionButton next_button = new ActionButton(Globals.ActionManager["NextAction"]); next_button.LabelVisible = false; next_button.Padding = 1; ActionButton playpause_button = new ActionButton(Globals.ActionManager["PlayPauseAction"]); playpause_button.LabelVisible = false; playpause_button.Padding = 1; PlaybackBox.PackStart(previous_button, false, false, 0); PlaybackBox.PackStart(playpause_button, false, false, 0); PlaybackBox.PackStart(next_button, false, false, 0); PlaybackBox.ShowAll(); // Seek Slider/Position Label seek_slider = new SeekSlider(); seek_slider.SetSizeRequest(125, -1); seek_slider.SeekRequested += delegate { PlayerEngineCore.Position = (uint)seek_slider.Value; }; stream_position_label = new StreamPositionLabel(seek_slider); SeekContainer.PackStart(seek_slider, false, false, 0); SeekContainer.PackStart(stream_position_label, false, false, 0); SeekContainer.ShowAll(); // Volume button volumeButton = new VolumeButton(); VolumeContainer.PackStart(volumeButton, false, false, 0); volumeButton.Show(); volumeButton.VolumeChanged += delegate(int volume) { PlayerEngineCore.Volume = (ushort)volume; Globals.Configuration.Set(GConfKeys.Volume, volume); }; // Cover coverArtThumbnail = new CoverArtThumbnail(90); Gdk.Pixbuf default_pixbuf = Banshee.Base.IconThemeUtils.LoadIcon("audio-x-generic", 128); if (default_pixbuf == null) { default_pixbuf = new Gdk.Pixbuf(System.Reflection.Assembly.GetEntryAssembly(), "banshee-logo.png"); } coverArtThumbnail.NoArtworkPixbuf = default_pixbuf; CoverBox.PackStart(coverArtThumbnail, false, false, 0); // Source combobox sourceComboBox = new SourceComboBox(); SourceBox.PackStart(sourceComboBox, true, true, 0); sourceComboBox.ShowAll(); // Repeat/Shuffle buttons MultiStateToggleButton shuffle_toggle_button = new MultiStateToggleButton(); shuffle_toggle_button.AddState(typeof(ShuffleDisabledToggleState), Globals.ActionManager["ShuffleAction"] as ToggleAction); shuffle_toggle_button.AddState(typeof(ShuffleEnabledToggleState), Globals.ActionManager["ShuffleAction"] as ToggleAction); shuffle_toggle_button.Relief = ReliefStyle.None; shuffle_toggle_button.ShowLabel = false; shuffle_toggle_button.ShowAll(); MultiStateToggleButton repeat_toggle_button = new MultiStateToggleButton(); repeat_toggle_button.AddState(typeof(RepeatNoneToggleState), Globals.ActionManager["RepeatNoneAction"] as ToggleAction); repeat_toggle_button.AddState(typeof(RepeatAllToggleState), Globals.ActionManager["RepeatAllAction"] as ToggleAction); repeat_toggle_button.AddState(typeof(RepeatSingleToggleState), Globals.ActionManager["RepeatSingleAction"] as ToggleAction); repeat_toggle_button.Relief = ReliefStyle.None; repeat_toggle_button.ShowLabel = false; repeat_toggle_button.ShowAll(); LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0); LowerButtonsBox.PackEnd(shuffle_toggle_button, false, false, 0); LowerButtonsBox.ShowAll(); // Hook up everything PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged; PlayerEngineCore.StateChanged += OnPlayerEngineStateChanged; }