[chronojump] RaceAnalyzer exercise selection with left/right buttons



commit ce2de0750a029dee2e2296117b689fb1e23725d2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Apr 4 23:03:26 2021 +0200

    RaceAnalyzer exercise selection with left/right buttons

 glade/app1.glade           | 48 +++++++++++++++++++++++++++++++++++++---------
 src/gui/app1/runEncoder.cs | 16 ++++++++++++++++
 2 files changed, 55 insertions(+), 9 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 6b17ccec..5384c246 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -13673,12 +13673,29 @@ EncoderInertialCapture</property>
                                                             <widget class="GtkHBox" id="hbox_run_encoder">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">20</property>
+                                                            <property name="spacing">10</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox332">
+                                                            <widget class="GtkButton" 
id="button_combo_run_encoder_exercise_capture_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_run_encoder_exercise_capture_left_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow41">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
+                                                            <property name="arrow_type">left</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
                                                             <child>
                                                             <widget class="GtkHBox" 
id="hbox_combo_run_encoder_exercise">
                                                             <property name="visible">True</property>
@@ -13688,16 +13705,29 @@ EncoderInertialCapture</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_combo_run_encoder_exercise_capture_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_run_encoder_exercise_capture_right_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow42">
+                                                            <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">0</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index 784af920..1900f097 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -37,6 +37,8 @@ public partial class ChronoJumpWindow
 {
        //[Widget] Gtk.CheckMenuItem menuitem_check_race_encoder_capture_simulate;
 
+       [Widget] Gtk.Button button_combo_run_encoder_exercise_capture_left;
+       [Widget] Gtk.Button button_combo_run_encoder_exercise_capture_right;
        [Widget] Gtk.VBox vbox_run_encoder_capture_buttons;
        [Widget] Gtk.VBox vbox_run_encoder_capture_options;
        [Widget] Gtk.HBox hbox_combo_run_encoder_exercise;
@@ -1564,6 +1566,20 @@ public partial class ChronoJumpWindow
                hbox_combo_run_encoder_exercise.ShowAll();
        }
 
+       //left-right buttons on run_encoder combo exercise selection
+       private void on_button_combo_run_encoder_exercise_capture_left_clicked (object o, EventArgs args)
+       {
+               contacts_exercise_left_button (combo_run_encoder_exercise,
+                               button_combo_run_encoder_exercise_capture_left,
+                               button_combo_run_encoder_exercise_capture_right);
+       }
+       private void on_button_combo_run_encoder_exercise_capture_right_clicked (object o, EventArgs args)
+       {
+               contacts_exercise_right_button (combo_run_encoder_exercise,
+                               button_combo_run_encoder_exercise_capture_left,
+                               button_combo_run_encoder_exercise_capture_right);
+       }
+
        private void on_combo_run_encoder_exercise_changed(object o, EventArgs args)
        {
                setLabelContactsExerciseSelected(Constants.Menuitem_modes.RUNSENCODER);


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