[chronojump] Arrows for combo_select_contacts_top. All signals and sensitivity done.



commit 4ed07948401fb294a49be38d5d26b119bd8cc8ac
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jul 30 17:17:26 2021 +0200

    Arrows for combo_select_contacts_top. All signals and sensitivity done.

 glade/app1.glade                 | 63 +++++++++++++++++++++++++++++++++++-----
 src/gui/app1/chronojump.cs       | 31 ++++++++++++++++++--
 src/gui/app1/contactsExercise.cs | 39 ++++++++++++++++++++++++-
 3 files changed, 121 insertions(+), 12 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index ae0938d76..3c3186de1 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5910,6 +5910,33 @@ EncoderInertialCapture</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
+                                                            <widget class="GtkHBox" 
id="hbox_combo_select_contacts_top_with_arrows">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_combo_select_contacts_top_left">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="sensitive">False</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_combo_select_contacts_top_left_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow44">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="arrow_type">left</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_combo_select_contacts_top">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -5920,6 +5947,33 @@ EncoderInertialCapture</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_combo_select_contacts_top_right">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_combo_select_contacts_top_right_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow45">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -5930,6 +5984,7 @@ EncoderInertialCapture</property>
                                                             <property name="spacing">8</property>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_contacts_exercise">
+                                                            <property name="width_request">40</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
@@ -5938,12 +5993,6 @@ EncoderInertialCapture</property>
                                                             <signal name="clicked" 
handler="on_button_contacts_exercise_clicked" swapped="no"/>
                                                             <accelerator key="t" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
-                                                            <widget class="GtkAlignment" id="alignment60">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">1</property>
-                                                            <property name="right_padding">1</property>
-                                                            <child>
                                                             <widget class="GtkImage" 
id="image_contacts_exercise_settings">
                                                             <property name="width_request">24</property>
                                                             <property name="visible">True</property>
@@ -5952,8 +6001,6 @@ EncoderInertialCapture</property>
                                                             </widget>
                                                             </child>
                                                             </widget>
-                                                            </child>
-                                                            </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index b88536f72..6a4b9a40e 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -175,6 +175,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.HBox hbox_combo_select_jumps_rj;
        [Widget] Gtk.HBox hbox_combo_select_runs;
        [Widget] Gtk.HBox hbox_combo_select_runs_interval;
+       [Widget] Gtk.HBox hbox_combo_select_contacts_top_with_arrows;
        [Widget] Gtk.HBox hbox_combo_select_contacts_top;
 
        //auto mode     
@@ -2200,6 +2201,7 @@ public partial class ChronoJumpWindow
                        if(hbox_combo_select_contacts_top.Children.Length > 0)
                                hbox_combo_select_contacts_top.Remove(combo_select_contacts_top);
 
+                       //code for each mode
                        if(current_mode == Constants.Modes.JUMPSSIMPLE)
                        {
                                comboSelectContactsTop = new CjComboSelectJumps (combo_select_contacts_top, 
hbox_combo_select_contacts_top, false);
@@ -2299,6 +2301,13 @@ public partial class ChronoJumpWindow
 
                button_left.Sensitive = (combo.Active > 0);
                button_right.Sensitive = true;
+
+               if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode == 
Constants.Modes.JUMPSREACTIVE ||
+                               current_mode == Constants.Modes.RUNSSIMPLE || current_mode == 
Constants.Modes.RUNSINTERVALLIC)
+               {
+                       button_combo_select_contacts_top_left.Sensitive = (combo.Active > 0);
+                       button_combo_select_contacts_top_right.Sensitive = true;
+               }
        }
        private void contacts_exercise_right_button (Gtk.ComboBox combo, Gtk.Button button_left, Gtk.Button 
button_right)
        {
@@ -2307,6 +2316,13 @@ public partial class ChronoJumpWindow
 
                button_left.Sensitive = true;
                button_right.Sensitive = ! isLast;
+
+               if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode == 
Constants.Modes.JUMPSREACTIVE ||
+                               current_mode == Constants.Modes.RUNSSIMPLE || current_mode == 
Constants.Modes.RUNSINTERVALLIC)
+               {
+                       button_combo_select_contacts_top_left.Sensitive = true;
+                       button_combo_select_contacts_top_right.Sensitive = ! isLast;
+               }
        }
 
 
@@ -2439,6 +2455,8 @@ public partial class ChronoJumpWindow
                //sensitivity of left/right buttons
                button_combo_jumps_exercise_capture_left.Sensitive = (combo_select_jumps.Active > 0);
                button_combo_jumps_exercise_capture_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_jumps);
+               button_combo_select_contacts_top_left.Sensitive = (combo_select_jumps.Active > 0);
+               button_combo_select_contacts_top_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_jumps);
 
                //show extra window options
                on_extra_window_jumps_test_changed(o, args);
@@ -2482,6 +2500,8 @@ public partial class ChronoJumpWindow
                //sensitivity of left/right buttons
                button_combo_jumps_rj_exercise_capture_left.Sensitive = (combo_select_jumps_rj.Active > 0);
                button_combo_jumps_rj_exercise_capture_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_jumps_rj);
+               button_combo_select_contacts_top_left.Sensitive = (combo_select_jumps_rj.Active > 0);
+               button_combo_select_contacts_top_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_jumps_rj);
 
                //show extra window options
                on_extra_window_jumps_rj_test_changed(o, args);
@@ -2513,6 +2533,8 @@ public partial class ChronoJumpWindow
                //sensitivity of left/right buttons
                button_combo_runs_exercise_capture_left.Sensitive = (combo_select_runs.Active > 0);
                button_combo_runs_exercise_capture_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_runs);
+               button_combo_select_contacts_top_left.Sensitive = (combo_select_runs.Active > 0);
+               button_combo_select_contacts_top_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_runs);
 
                //show extra window options
                on_extra_window_runs_test_changed(o, args);
@@ -2544,6 +2566,9 @@ public partial class ChronoJumpWindow
                //sensitivity of left/right buttons
                button_combo_runs_interval_exercise_capture_left.Sensitive = 
(combo_select_runs_interval.Active > 0);
                button_combo_runs_interval_exercise_capture_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_runs_interval);
+               button_combo_select_contacts_top_left.Sensitive = (combo_select_runs_interval.Active > 0);
+               button_combo_select_contacts_top_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_select_runs_interval);
+
                //show extra window options
                on_extra_window_runs_interval_test_changed(o, args);
        }
@@ -3411,7 +3436,7 @@ public partial class ChronoJumpWindow
                vbox_contacts_signal_comment.Visible = false;
                frame_jumps_automatic.Visible = false;
 
-               hbox_combo_select_contacts_top.Visible = false; //TODO: this will be unneded
+               hbox_combo_select_contacts_top_with_arrows.Visible = false; //TODO: this will be unneded
 
                //blank exercise options: useful for changing from jumps or runs to forceSensor, runEncoder, 
reaction time, other
                label_contacts_exercise_selected_name.Visible = true; //will not be visible when all the 
contacts_top combo is implemented
@@ -3486,7 +3511,7 @@ public partial class ChronoJumpWindow
 
                        createComboSelectContactsTop (true);
                        label_contacts_exercise_selected_name.Visible = false;
-                       hbox_combo_select_contacts_top.Visible = true; //this will be unneded
+                       hbox_combo_select_contacts_top_with_arrows.Visible = true; //this will be unneded
 
                        /*
                        if(radio_mode_contacts_jumps_profile.Active || 
radio_mode_contacts_jumps_dj_optimal_fall.Active ||
@@ -3551,7 +3576,7 @@ public partial class ChronoJumpWindow
 
                        createComboSelectContactsTop (true);
                        label_contacts_exercise_selected_name.Visible = false;
-                       hbox_combo_select_contacts_top.Visible = true; //this will be unneded
+                       hbox_combo_select_contacts_top_with_arrows.Visible = true; //this will be unneded
 
 
                        pixbufModeGrid = new Pixbuf (null, Util.GetImagePath(false) + "image_modes_run.png");
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index 050325bf8..daa5bf6c1 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -21,11 +21,15 @@
 
 using System;
 using Gtk;
+using Glade;
 using Gdk;
 using Mono.Unix;
 
 public partial class ChronoJumpWindow 
 {
+       [Widget] Gtk.Button button_combo_select_contacts_top_left;
+       [Widget] Gtk.Button button_combo_select_contacts_top_right;
+
        private void on_button_contacts_exercise_clicked (object o, EventArgs args)
        {
                menus_and_mode_sensitive(false);
@@ -255,5 +259,38 @@ public partial class ChronoJumpWindow
        }
        */
 
-       //hbox_combo_select_contacts_top ...
+       private void on_button_combo_select_contacts_top_left_clicked (object o, EventArgs args)
+       {
+               if(current_mode == Constants.Modes.JUMPSSIMPLE)
+                       contacts_exercise_left_button (combo_select_jumps,
+                                       button_combo_jumps_exercise_capture_left, 
button_combo_jumps_exercise_capture_right);
+               else if(current_mode == Constants.Modes.JUMPSREACTIVE)
+                       contacts_exercise_left_button (combo_select_jumps_rj,
+                                       button_combo_jumps_rj_exercise_capture_left, 
button_combo_jumps_rj_exercise_capture_right);
+               else if(current_mode == Constants.Modes.RUNSSIMPLE)
+                       contacts_exercise_left_button (combo_select_runs,
+                                       button_combo_runs_exercise_capture_left,
+                                       button_combo_runs_exercise_capture_right);
+               else if(current_mode == Constants.Modes.RUNSINTERVALLIC)
+                       contacts_exercise_left_button (combo_select_runs_interval,
+                                       button_combo_runs_interval_exercise_capture_left,
+                                       button_combo_runs_interval_exercise_capture_right);
+       }
+       private void on_button_combo_select_contacts_top_right_clicked (object o, EventArgs args)
+       {
+               if(current_mode == Constants.Modes.JUMPSSIMPLE)
+                       contacts_exercise_right_button (combo_select_jumps,
+                                       button_combo_jumps_exercise_capture_left, 
button_combo_jumps_exercise_capture_right);
+               else if(current_mode == Constants.Modes.JUMPSREACTIVE)
+                       contacts_exercise_right_button (combo_select_jumps_rj,
+                                       button_combo_jumps_rj_exercise_capture_left, 
button_combo_jumps_rj_exercise_capture_right);
+               else if(current_mode == Constants.Modes.RUNSSIMPLE)
+                       contacts_exercise_right_button (combo_select_runs,
+                                       button_combo_runs_exercise_capture_left,
+                                       button_combo_runs_exercise_capture_right);
+               else if(current_mode == Constants.Modes.RUNSINTERVALLIC)
+                       contacts_exercise_right_button (combo_select_runs_interval,
+                                       button_combo_runs_interval_exercise_capture_left,
+                                       button_combo_runs_interval_exercise_capture_right);
+       }
 }


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