[chronojump] Menu 2.2.2 go to modes



commit fae64a4989a3ba421102ddcfff526ba8360125ab
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu May 26 13:14:55 2022 +0200

    Menu 2.2.2 go to modes

 glade/app1.glade           |  3 ++-
 src/gui/app1/chronojump.cs | 26 ++++++++++++++++++++------
 2 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index bcd7adb68..9c4fd3e50 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5133,13 +5133,14 @@
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkButton" id="button18">
+                                                            <widget class="GtkButton" 
id="button_menu_2_2_2_go">
                                                             <property name="label">Go!</property>
                                                             <property name="width_request">150</property>
                                                             <property name="height_request">100</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_menu_2_2_2_go_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index b4e83a794..5b7d09b7e 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -4425,23 +4425,37 @@ public partial class ChronoJumpWindow
        private void on_button_menu_2_2_2_clicked (object o, EventArgs args)
        {
                string str = "";
-               if(o == (object) radio_menu_2_2_2_jumps)
+               if (o == (object) radio_menu_2_2_2_jumps)
                        str = "Jumps with contact platform";
-               if(o == (object) radio_menu_2_2_2_races)
+               else if (o == (object) radio_menu_2_2_2_races)
                        str = "Races with photocells (Wichro or wired), or RaceAnalyzer";
-               if(o == (object) radio_menu_2_2_2_isometric)
+               else if (o == (object) radio_menu_2_2_2_isometric)
                        str = "Isometric force exercises measured by a force sensor";
-               if(o == (object) radio_menu_2_2_2_elastic)
+               else if (o == (object) radio_menu_2_2_2_elastic)
                        str = "Elastic force exercises measured by a force sensor";
-               if(o == (object) radio_menu_2_2_2_weights)
+               else if (o == (object) radio_menu_2_2_2_weights)
                        str = "Speed/power exercises displacing weights measured by an encoder";
-               if(o == (object) radio_menu_2_2_2_inertial)
+               else if (o == (object) radio_menu_2_2_2_inertial)
                        str = "Speed/power exercises rotating an inertial machine and measured by an encoder";
 
                if (str != "")
                        label_selector_menu_2_2_2.Text = str;
        }
 
+       private void on_button_menu_2_2_2_go_clicked (object o, EventArgs args)
+       {
+/*             if (radio_menu_2_2_2_jumps.Active)
+               else if (radio_menu_2_2_2_races.Active)
+               else */if (radio_menu_2_2_2_isometric.Active)
+                       on_button_selector_start_force_sensor_clicked (new object (), new EventArgs ());
+               else if (radio_menu_2_2_2_elastic.Active)
+                       on_button_selector_start_force_sensor_clicked (new object (), new EventArgs ());
+               else if (radio_menu_2_2_2_weights.Active)
+                       on_button_selector_start_encoder_gravitatory_clicked (new object (), new EventArgs 
());
+               else if (radio_menu_2_2_2_inertial.Active)
+                       on_button_selector_start_encoder_inertial_clicked (new object (), new EventArgs ());
+       }
+
        private void on_button_contacts_capture_save_image_clicked (object o, EventArgs args)
        {
                if(current_mode == Constants.Modes.JUMPSSIMPLE)


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