[Frugalware-git] frugal-tweak: *added widget calendar *more simple for final user

bouleetbil bouleetbil at frogdev.info
Sun Nov 14 16:32:12 CET 2010


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=9fa1efc9ef7503675ed20e3291f32f7b7d179431

commit 9fa1efc9ef7503675ed20e3291f32f7b7d179431
Author: bouleetbil <bouleetbil at frogdev.info>
Date:   Sun Nov 14 16:27:52 2010 +0100

*added widget calendar
*more simple for final user

diff --git a/frugal-mono-tools/WID_DateTime.cs b/frugal-mono-tools/WID_DateTime.cs
index 50b0140..5ee7ff0 100644
--- a/frugal-mono-tools/WID_DateTime.cs
+++ b/frugal-mono-tools/WID_DateTime.cs
@@ -37,18 +37,31 @@ namespace frugalmonotools
BTN_Apply.Visible=true;
LIB_Root.Visible=false;
}
+			SAI_Date.Visible=false;
SAI_Date.Text=Outils.getoutput("date +%Y%m%d");
SAI_Hours.Text=Outils.getoutput("date +%T ");
}
protected virtual void OnBTNApplyClicked (object sender, System.EventArgs e)
{
-			//TODO :
-			//added calendar widget
+
//date +%Y%m%d+%T -s "20101111 13:09:17"
Outils.Excecute("date"," +%Y%m%d+%T -s '" +SAI_Date.Text+" "+SAI_Hours.Text+"'",false);

}

+		protected virtual void OnCALDateSysDaySelected (object sender, System.EventArgs e)
+		{
+			Gtk.Calendar date = (Gtk.Calendar) sender;
+			SAI_Date.Text=date.Year.ToString()+ToDate(date.Month)+ToDate(date.Day);
+		}
+
+		private string ToDate(int integer)
+		{
+			if (integer<10)
+				return "0"+integer.ToString();
+			else
+				return integer.ToString();
+		}

}
}
diff --git a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs
index 0f9c718..6095c49 100644
--- a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs
+++ b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs
@@ -16,6 +16,8 @@ namespace frugalmonotools

private global::Gtk.Entry SAI_Date;

+		private global::Gtk.Calendar CAL_DateSys;
+
private global::Gtk.HBox hbox4;

private global::Gtk.Label label2;
@@ -78,11 +80,21 @@ namespace frugalmonotools
this.hbox3.Add (this.SAI_Date);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.SAI_Date]));
w4.Position = 1;
-			this.vbox2.Add (this.hbox3);
-			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox3]));
-			w5.Position = 1;
+			// Container child hbox3.Gtk.Box+BoxChild
+			this.CAL_DateSys = new global::Gtk.Calendar ();
+			this.CAL_DateSys.CanFocus = true;
+			this.CAL_DateSys.Name = "CAL_DateSys";
+			this.CAL_DateSys.DisplayOptions = ((global::Gtk.CalendarDisplayOptions)(35));
+			this.hbox3.Add (this.CAL_DateSys);
+			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.CAL_DateSys]));
+			w5.Position = 2;
w5.Expand = false;
w5.Fill = false;
+			this.vbox2.Add (this.hbox3);
+			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox3]));
+			w6.Position = 1;
+			w6.Expand = false;
+			w6.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4";
@@ -92,24 +104,26 @@ namespace frugalmonotools
this.label2.Name = "label2";
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Hours");
this.hbox4.Add (this.label2);
-			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.label2]));
-			w6.Position = 0;
-			w6.Expand = false;
-			w6.Fill = false;
+			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.label2]));
+			w7.Position = 0;
+			w7.Expand = false;
+			w7.Fill = false;
// Container child hbox4.Gtk.Box+BoxChild
this.SAI_Hours = new global::Gtk.Entry ();
this.SAI_Hours.CanFocus = true;
this.SAI_Hours.Name = "SAI_Hours";
this.SAI_Hours.IsEditable = true;
+			this.SAI_Hours.WidthChars = 8;
+			this.SAI_Hours.MaxLength = 8;
this.SAI_Hours.InvisibleChar = '•';
this.hbox4.Add (this.SAI_Hours);
-			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.SAI_Hours]));
-			w7.Position = 1;
+			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.SAI_Hours]));
+			w8.Position = 1;
this.vbox2.Add (this.hbox4);
-			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox4]));
-			w8.Position = 2;
-			w8.Expand = false;
-			w8.Fill = false;
+			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox4]));
+			w9.Position = 2;
+			w9.Expand = false;
+			w9.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.hbox1 = new global::Gtk.HBox ();
this.hbox1.Name = "hbox1";
@@ -119,47 +133,49 @@ namespace frugalmonotools
this.LIB_Root.Name = "LIB_Root";
this.LIB_Root.LabelProp = global::Mono.Unix.Catalog.GetString ("Can't save, should be started as root");
this.hbox1.Add (this.LIB_Root);
-			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.LIB_Root]));
-			w9.Position = 0;
-			w9.Expand = false;
-			w9.Fill = false;
+			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.LIB_Root]));
+			w10.Position = 0;
+			w10.Expand = false;
+			w10.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.BTN_Apply = new global::Gtk.Button ();
this.BTN_Apply.CanFocus = true;
this.BTN_Apply.Name = "BTN_Apply";
this.BTN_Apply.UseUnderline = true;
// Container child BTN_Apply.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w10 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w11 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w11 = new global::Gtk.HBox ();
-			w11.Spacing = 2;
+			global::Gtk.HBox w12 = new global::Gtk.HBox ();
+			w12.Spacing = 2;
// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w12 = new global::Gtk.Image ();
-			w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", global::Gtk.IconSize.Menu);
-			w11.Add (w12);
+			global::Gtk.Image w13 = new global::Gtk.Image ();
+			w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", global::Gtk.IconSize.Menu);
+			w12.Add (w13);
// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w14 = new global::Gtk.Label ();
-			w14.LabelProp = global::Mono.Unix.Catalog.GetString ("Apply");
-			w14.UseUnderline = true;
-			w11.Add (w14);
-			w10.Add (w11);
-			this.BTN_Apply.Add (w10);
+			global::Gtk.Label w15 = new global::Gtk.Label ();
+			w15.LabelProp = global::Mono.Unix.Catalog.GetString ("Apply");
+			w15.UseUnderline = true;
+			w12.Add (w15);
+			w11.Add (w12);
+			this.BTN_Apply.Add (w11);
this.hbox1.Add (this.BTN_Apply);
-			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.BTN_Apply]));
-			w18.Position = 2;
-			w18.Expand = false;
-			w18.Fill = false;
-			this.vbox2.Add (this.hbox1);
-			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
-			w19.Position = 4;
+			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.BTN_Apply]));
+			w19.Position = 2;
w19.Expand = false;
w19.Fill = false;
+			this.vbox2.Add (this.hbox1);
+			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
+			w20.Position = 4;
+			w20.Expand = false;
+			w20.Fill = false;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
}
+			this.SAI_Date.Hide ();
this.LIB_Root.Hide ();
this.Hide ();
+			this.CAL_DateSys.DaySelected += new global::System.EventHandler (this.OnCALDateSysDaySelected);
this.BTN_Apply.Clicked += new global::System.EventHandler (this.OnBTNApplyClicked);
}
}
diff --git a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Support.cs b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Support.cs
index 55982eb..e605de2 100644
--- a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Support.cs
+++ b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Support.cs
@@ -22,6 +22,8 @@ namespace frugalmonotools

private global::Gtk.Button BTN_Bugs;

+		private global::Gtk.Button BTN_Pastbin;
+
private global::Gtk.Label label8;

private global::Gtk.Button BTN_French;
@@ -123,14 +125,25 @@ namespace frugalmonotools
w8.Expand = false;
w8.Fill = false;
// Container child vbox9.Gtk.Box+BoxChild
+			this.BTN_Pastbin = new global::Gtk.Button ();
+			this.BTN_Pastbin.CanFocus = true;
+			this.BTN_Pastbin.Name = "BTN_Pastbin";
+			this.BTN_Pastbin.UseUnderline = true;
+			this.BTN_Pastbin.Label = global::Mono.Unix.Catalog.GetString ("Pastbin");
+			this.vbox9.Add (this.BTN_Pastbin);
+			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.BTN_Pastbin]));
+			w9.Position = 5;
+			w9.Expand = false;
+			w9.Fill = false;
+			// Container child vbox9.Gtk.Box+BoxChild
this.label8 = new global::Gtk.Label ();
this.label8.Name = "label8";
this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Internationalized Frugalware sites");
this.vbox9.Add (this.label8);
-			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.label8]));
-			w9.Position = 5;
-			w9.Expand = false;
-			w9.Fill = false;
+			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.label8]));
+			w10.Position = 6;
+			w10.Expand = false;
+			w10.Fill = false;
// Container child vbox9.Gtk.Box+BoxChild
this.BTN_French = new global::Gtk.Button ();
this.BTN_French.CanFocus = true;
@@ -138,10 +151,10 @@ namespace frugalmonotools
this.BTN_French.UseUnderline = true;
this.BTN_French.Label = global::Mono.Unix.Catalog.GetString ("French");
this.vbox9.Add (this.BTN_French);
-			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.BTN_French]));
-			w10.Position = 6;
-			w10.Expand = false;
-			w10.Fill = false;
+			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.BTN_French]));
+			w11.Position = 7;
+			w11.Expand = false;
+			w11.Fill = false;
// Container child vbox9.Gtk.Box+BoxChild
this.BTN_Danish = new global::Gtk.Button ();
this.BTN_Danish.CanFocus = true;
@@ -149,10 +162,10 @@ namespace frugalmonotools
this.BTN_Danish.UseUnderline = true;
this.BTN_Danish.Label = global::Mono.Unix.Catalog.GetString ("Danish");
this.vbox9.Add (this.BTN_Danish);
-			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.BTN_Danish]));
-			w11.Position = 7;
-			w11.Expand = false;
-			w11.Fill = false;
+			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.BTN_Danish]));
+			w12.Position = 8;
+			w12.Expand = false;
+			w12.Fill = false;
this.Add (this.vbox9);
if ((this.Child != null)) {
this.Child.ShowAll ();
@@ -164,6 +177,7 @@ namespace frugalmonotools
this.BTN_Forums.Clicked += new global::System.EventHandler (this.OnBTNForumsClicked);
this.BTN_Wiki.Clicked += new global::System.EventHandler (this.OnBTNWikiClicked);
this.BTN_Bugs.Clicked += new global::System.EventHandler (this.OnBTNBugsClicked);
+			this.BTN_Pastbin.Clicked += new global::System.EventHandler (this.OnBTNPastbinClicked);
this.BTN_French.Clicked += new global::System.EventHandler (this.OnBTNFrenchClicked);
this.BTN_Danish.Clicked += new global::System.EventHandler (this.OnBTNDanishClicked);
}
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic
index 04c8ee7..6ffa862 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -3384,6 +3384,7 @@ Public License instead of this License.
<child>
<widget class="Gtk.Entry" id="SAI_Date">
<property name="MemberName" />
+                <property name="Visible">False</property>
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
@@ -3394,10 +3395,11 @@ Public License instead of this License.
</packing>
</child>
<child>
-              <widget class="Gtk.Calendar" id="calendar1">
+              <widget class="Gtk.Calendar" id="CAL_DateSys">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="DisplayOptions">35</property>
+                <signal name="DaySelected" handler="OnCALDateSysDaySelected" />
</widget>
<packing>
<property name="Position">2</property>


More information about the Frugalware-git mailing list