[longomatch/newui: 11/104] Add media file chooser component



commit 070ced42639751c4c66f3c52fb0e963d66f969ef
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Aug 18 19:15:26 2014 +0200

    Add media file chooser component

 LongoMatch.GUI/Gui/Component/MediaFileChooser.cs   |   56 ++++++++++++++++++
 .../LongoMatch.Gui.Component.MediaFileChooser.cs   |   60 ++++++++++++++++++++
 2 files changed, 116 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs 
b/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs
new file mode 100644
index 0000000..d9e06d3
--- /dev/null
+++ b/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs
@@ -0,0 +1,56 @@
+//
+//  Copyright (C) 2014 Andoni Morales Alastruey
+//
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using Mono.Unix;
+using LongoMatch.Store;
+using LongoMatch.Gui.Helpers;
+
+namespace LongoMatch.Gui.Component
+{
+       [System.ComponentModel.ToolboxItem(true)]
+       public partial class MediaFileChooser : Gtk.Bin
+       {
+               MediaFile file;
+
+               public MediaFileChooser ()
+               {
+                       this.Build ();
+                       addbutton.Clicked += HandleClicked;
+               }
+
+               public MediaFile File {
+                       get {
+                               return file;
+                       }
+                       set {
+                               file = value;
+                               if (file != null) {
+                                       fileentry.Text = file.FilePath;
+                               } else {
+                                       fileentry.Text = Catalog.GetString ("Select file...");
+                               }
+                       }
+               }
+               
+               void HandleClicked (object sender, EventArgs e)
+               {
+                       File = Misc.OpenFile (this);
+               }
+       }
+}
+
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
new file mode 100644
index 0000000..9a70e96
--- /dev/null
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
@@ -0,0 +1,60 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+       public partial class MediaFileChooser
+       {
+               private global::Gtk.HBox hbox1;
+               private global::Gtk.Entry fileentry;
+               private global::Gtk.Button addbutton;
+
+               protected virtual void Build ()
+               {
+                       global::Stetic.Gui.Initialize (this);
+                       // Widget LongoMatch.Gui.Component.MediaFileChooser
+                       global::Stetic.BinContainer.Attach (this);
+                       this.Name = "LongoMatch.Gui.Component.MediaFileChooser";
+                       // Container child 
LongoMatch.Gui.Component.MediaFileChooser.Gtk.Container+ContainerChild
+                       this.hbox1 = new global::Gtk.HBox ();
+                       this.hbox1.Name = "hbox1";
+                       // Container child hbox1.Gtk.Box+BoxChild
+                       this.fileentry = new global::Gtk.Entry ();
+                       this.fileentry.CanFocus = true;
+                       this.fileentry.Name = "fileentry";
+                       this.fileentry.IsEditable = false;
+                       this.fileentry.InvisibleChar = '•';
+                       this.hbox1.Add (this.fileentry);
+                       global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 
[this.fileentry]));
+                       w1.Position = 0;
+                       // Container child hbox1.Gtk.Box+BoxChild
+                       this.addbutton = new global::Gtk.Button ();
+                       this.addbutton.CanFocus = true;
+                       this.addbutton.Name = "addbutton";
+                       this.addbutton.UseUnderline = true;
+                       // Container child addbutton.Gtk.Container+ContainerChild
+                       global::Gtk.Alignment w2 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       // Container child GtkAlignment.Gtk.Container+ContainerChild
+                       global::Gtk.HBox w3 = new global::Gtk.HBox ();
+                       w3.Spacing = 2;
+                       // Container child GtkHBox.Gtk.Container+ContainerChild
+                       global::Gtk.Image w4 = new global::Gtk.Image ();
+                       w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "longomatch-browse", 
global::Gtk.IconSize.Button);
+                       w3.Add (w4);
+                       // Container child GtkHBox.Gtk.Container+ContainerChild
+                       global::Gtk.Label w6 = new global::Gtk.Label ();
+                       w3.Add (w6);
+                       w2.Add (w3);
+                       this.addbutton.Add (w2);
+                       this.hbox1.Add (this.addbutton);
+                       global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 
[this.addbutton]));
+                       w10.Position = 1;
+                       w10.Expand = false;
+                       w10.Fill = false;
+                       this.Add (this.hbox1);
+                       if ((this.Child != null)) {
+                               this.Child.ShowAll ();
+                       }
+                       this.Hide ();
+               }
+       }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]