[longomatch] Add a new date picker component



commit 50faf41e198ddd330bac513766e8d88b6cda4999
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Aug 18 19:15:05 2014 +0200

    Add a new date picker component

 LongoMatch.GUI/Gui/Component/DatePicker.cs         |   49 ++++++++++++++++
 .../gtk-gui/LongoMatch.Gui.Component.DatePicker.cs |   60 ++++++++++++++++++++
 2 files changed, 109 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/DatePicker.cs b/LongoMatch.GUI/Gui/Component/DatePicker.cs
new file mode 100644
index 0000000..f9d7183
--- /dev/null
+++ b/LongoMatch.GUI/Gui/Component/DatePicker.cs
@@ -0,0 +1,49 @@
+//
+//  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;
+
+namespace LongoMatch.Gui.Component
+{
+       [System.ComponentModel.ToolboxItem(true)]
+       public partial class DatePicker : Gtk.Bin
+       {
+               DateTime date;
+               public DatePicker ()
+               {
+                       this.Build ();
+                       datebutton.Clicked += HandleClicked;
+                       Date = DateTime.Now;
+               }
+
+               public DateTime Date {
+                       set {
+                               date = value;
+                               dateentry.Text = value.ToShortDateString ();
+                       }
+                       get {
+                               return date;
+                       }
+               }
+
+               void HandleClicked (object sender, EventArgs e)
+               {
+                       Date = Config.GUIToolkit.SelectDate (Date, this);
+               }
+       }
+}
+
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
new file mode 100644
index 0000000..f5fa8ed
--- /dev/null
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
@@ -0,0 +1,60 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+       public partial class DatePicker
+       {
+               private global::Gtk.HBox hbox2;
+               private global::Gtk.Entry dateentry;
+               private global::Gtk.Button datebutton;
+
+               protected virtual void Build ()
+               {
+                       global::Stetic.Gui.Initialize (this);
+                       // Widget LongoMatch.Gui.Component.DatePicker
+                       global::Stetic.BinContainer.Attach (this);
+                       this.Name = "LongoMatch.Gui.Component.DatePicker";
+                       // Container child LongoMatch.Gui.Component.DatePicker.Gtk.Container+ContainerChild
+                       this.hbox2 = new global::Gtk.HBox ();
+                       this.hbox2.Name = "hbox2";
+                       // Container child hbox2.Gtk.Box+BoxChild
+                       this.dateentry = new global::Gtk.Entry ();
+                       this.dateentry.CanFocus = true;
+                       this.dateentry.Name = "dateentry";
+                       this.dateentry.IsEditable = false;
+                       this.dateentry.InvisibleChar = '•';
+                       this.hbox2.Add (this.dateentry);
+                       global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.dateentry]));
+                       w1.Position = 0;
+                       // Container child hbox2.Gtk.Box+BoxChild
+                       this.datebutton = new global::Gtk.Button ();
+                       this.datebutton.CanFocus = true;
+                       this.datebutton.Name = "datebutton";
+                       this.datebutton.UseUnderline = true;
+                       // Container child datebutton.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-calendar", 
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.datebutton.Add (w2);
+                       this.hbox2.Add (this.datebutton);
+                       global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.datebutton]));
+                       w10.Position = 1;
+                       w10.Expand = false;
+                       w10.Fill = false;
+                       this.Add (this.hbox2);
+                       if ((this.Child != null)) {
+                               this.Child.ShowAll ();
+                       }
+                       this.Hide ();
+               }
+       }
+}


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