Thread: [Gpredict-svn] SF.net SVN: gpredict:[77] trunk/src/gtk-rot-knob.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2008-08-28 18:00:43
|
Revision: 77
http://gpredict.svn.sourceforge.net/gpredict/?rev=77&view=rev
Author: csete
Date: 2008-08-28 18:00:53 +0000 (Thu, 28 Aug 2008)
Log Message:
-----------
Fixed bug that prevented the knob value to be set to min/max.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-08-27 21:16:11 UTC (rev 76)
+++ trunk/src/gtk-rot-knob.c 2008-08-28 18:00:53 UTC (rev 77)
@@ -303,7 +303,11 @@
gtk_rot_knob_set_value (GtkRotKnob *knob, gfloat val)
{
/* set the new value */
- if ((val >= knob->min) && (val <= knob->max))
+ if (val <= knob->min)
+ knob->value = knob->min;
+ else if (val >= knob->max)
+ knob->value = knob->max;
+ else
knob->value = val;
/* update the display */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-03 22:47:57
|
Revision: 83
http://gpredict.svn.sourceforge.net/gpredict/?rev=83&view=rev
Author: csete
Date: 2008-09-03 22:48:06 +0000 (Wed, 03 Sep 2008)
Log Message:
-----------
Disabled debug output.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-09-03 22:46:59 UTC (rev 82)
+++ trunk/src/gtk-rot-knob.c 2008-09-03 22:48:06 UTC (rev 83)
@@ -439,7 +439,7 @@
gtk_rot_knob_update (knob);
- g_print ("VAL: %.2f\n", knob->value);
+ /*g_print ("VAL: %.2f\n", knob->value);*/
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-16 20:38:47
|
Revision: 114
http://gpredict.svn.sourceforge.net/gpredict/?rev=114&view=rev
Author: csete
Date: 2008-09-16 20:38:57 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
Ensure that knob value is within new range when upper or lower limits are modified.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-09-16 01:31:09 UTC (rev 113)
+++ trunk/src/gtk-rot-knob.c 2008-09-16 20:38:57 UTC (rev 114)
@@ -368,8 +368,15 @@
gtk_rot_knob_set_min (GtkRotKnob *knob, gdouble min)
{
/* just som sanity check we have only 3 digits */
- if (min < 1000)
+ if (min < 1000) {
knob->min = min;
+
+ /* ensure that current value is within range */
+ if (knob->value < knob->min) {
+ knob->value = knob->min;
+ gtk_rot_knob_update (knob);
+ }
+ }
}
/** \brief Set the upper limit of the control widget
@@ -380,8 +387,15 @@
gtk_rot_knob_set_max (GtkRotKnob *knob, gdouble max)
{
/* just som sanity check we have only 3 digits */
- if (max < 1000)
+ if (max < 1000) {
knob->max = max;
+
+ /* ensure that current value is within range */
+ if (knob->value > knob->max) {
+ knob->value = knob->max;
+ gtk_rot_knob_update (knob);
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2010-01-11 22:35:24
|
Revision: 586
http://gpredict.svn.sourceforge.net/gpredict/?rev=586&view=rev
Author: csete
Date: 2010-01-11 22:35:18 +0000 (Mon, 11 Jan 2010)
Log Message:
-----------
Applied patch 2929816: Fixes Bound Checking in gtk-rot-knob.c. Thanks to Thanks Charles Suprin AA1VS.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2010-01-07 11:25:44 UTC (rev 585)
+++ trunk/src/gtk-rot-knob.c 2010-01-11 22:35:18 UTC (rev 586)
@@ -453,12 +453,20 @@
GtkRotKnob *knob = GTK_ROT_KNOB (data);
gdouble delta = GPOINTER_TO_INT(g_object_get_data (G_OBJECT (button), "delta")) / 100.0;
- if ((delta > 0.0) && ((knob->value + delta) <= knob->max)) {
+ if ((delta > 0.0) && ((knob->value + delta) <= knob->max+.005)) {
knob->value += delta;
+ if (knob->value>knob->max){
+ knob->value=knob->max;
+ }
}
- else if ((delta < 0.0) && ((knob->value + delta) >= knob->min)) {
+ else if ((delta < 0.0) && ((knob->value + delta) >= knob->min-.005)) {
knob->value += delta;
- }
+ if (knob->value<knob->min){
+ knob->value=knob->min;
+ }
+ } else {
+ g_print("Val: %.2f %.2f %.10f\n",knob->value,delta,knob->value+delta);
+ }
gtk_rot_knob_update (knob);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2011-02-16 12:40:04
|
Revision: 767
http://gpredict.svn.sourceforge.net/gpredict/?rev=767&view=rev
Author: aa1vs
Date: 2011-02-16 12:39:58 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
Eliminate printf when bounds exceeded
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2011-02-16 12:31:41 UTC (rev 766)
+++ trunk/src/gtk-rot-knob.c 2011-02-16 12:39:58 UTC (rev 767)
@@ -465,7 +465,7 @@
knob->value=knob->min;
}
} else {
- g_print("Val: %.2f %.2f %.10f\n",knob->value,delta,knob->value+delta);
+ //g_print("Val: %.2f %.2f %.10f\n",knob->value,delta,knob->value+delta);
}
gtk_rot_knob_update (knob);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2011-07-14 03:45:55
|
Revision: 855
http://gpredict.svn.sourceforge.net/gpredict/?rev=855&view=rev
Author: aa1vs
Date: 2011-07-14 03:45:49 +0000 (Thu, 14 Jul 2011)
Log Message:
-----------
Clean pendantic compiler warning.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2011-07-14 00:46:48 UTC (rev 854)
+++ trunk/src/gtk-rot-knob.c 2011-07-14 03:45:49 UTC (rev 855)
@@ -79,6 +79,7 @@
sizeof (GtkRotKnob),
5, /* n_preallocs */
(GInstanceInitFunc) gtk_rot_knob_init,
+ NULL
};
gtk_rot_knob_type = g_type_register_static (GTK_TYPE_VBOX,
@@ -115,7 +116,8 @@
static void
gtk_rot_knob_init (GtkRotKnob *knob)
{
-
+
+ (void) knob; /* avoid unused parameter warning */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-05 21:57:11
|
Revision: 86
http://gpredict.svn.sourceforge.net/gpredict/?rev=86&view=rev
Author: csete
Date: 2008-09-05 21:57:21 +0000 (Fri, 05 Sep 2008)
Log Message:
-----------
Don't show minus when value is 0.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-09-05 19:00:01 UTC (rev 85)
+++ trunk/src/gtk-rot-knob.c 2008-09-05 21:57:21 UTC (rev 86)
@@ -409,7 +409,7 @@
g_free (buff);
}
- if (knob->value <= 0)
+ if (knob->value < 0)
buff = g_strdup_printf (FMTSTR, '-');
else
buff = g_strdup_printf (FMTSTR, ' ');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-06 13:31:36
|
Revision: 90
http://gpredict.svn.sourceforge.net/gpredict/?rev=90&view=rev
Author: csete
Date: 2008-09-06 13:31:47 +0000 (Sat, 06 Sep 2008)
Log Message:
-----------
Added degree sign.
Modified Paths:
--------------
trunk/src/gtk-rot-knob.c
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-09-06 13:18:31 UTC (rev 89)
+++ trunk/src/gtk-rot-knob.c 2008-09-06 13:31:47 UTC (rev 90)
@@ -137,6 +137,7 @@
{
GtkWidget *widget;
GtkWidget *table;
+ GtkWidget *label;
guint i;
widget = g_object_new (GTK_TYPE_ROT_KNOB, NULL);
@@ -146,7 +147,7 @@
GTK_ROT_KNOB(widget)->value = val;
/* create table */
- table = gtk_table_new (3, 7, FALSE);
+ table = gtk_table_new (3, 8, FALSE);
/* create buttons */
/* +100 deg */
@@ -286,8 +287,13 @@
i, i+1, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
}
+ /* degree sign */
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), "<span size='xx-large'>\302\260</span>");
+ gtk_table_attach (GTK_TABLE (table), label, 7, 8, 1, 2,
+ GTK_SHRINK, GTK_SHRINK, 0, 0);
+
gtk_rot_knob_update (GTK_ROT_KNOB(widget));
-
gtk_container_add (GTK_CONTAINER (widget), table);
gtk_widget_show_all (widget);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|