[Gpredict-svn] SF.net SVN: gpredict:[114] trunk/src/gtk-rot-knob.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
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.
|