[chronojump] Fixed: erased drawingarea when bells change
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed: erased drawingarea when bells change
- Date: Wed, 13 Apr 2011 11:39:35 +0000 (UTC)
commit f50b6b0ae6ecf9722faf122363868b19335faeba
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Apr 13 09:52:59 2011 +0200
Fixed: erased drawingarea when bells change
glade/chronojump.glade | 307 +++++++++++++++++++++++++++++------------------
src/gui/chronojump.cs | 4 +
src/gui/eventExecute.cs | 51 ++++++++-
3 files changed, 240 insertions(+), 122 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 05ad117..7de963d 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -13706,6 +13706,7 @@ by you</property>
<child>
<widget class="GtkHBox" id="hbox36">
<property name="visible">True</property>
+ <property name="spacing">2</property>
<child>
<widget class="GtkButton" id="button_persons_up">
<property name="visible">True</property>
@@ -13797,6 +13798,7 @@ by you</property>
<child>
<widget class="GtkHBox" id="hbox16">
<property name="visible">True</property>
+ <property name="spacing">2</property>
<child>
<widget class="GtkButton" id="button_edit_current_person">
<property name="visible">True</property>
@@ -13910,7 +13912,7 @@ by you</property>
<widget class="GtkViewport" id="viewport_mode">
<property name="visible">True</property>
<property name="resize_mode">queue</property>
- <property name="hadjustment">0 0 730 73 657 730</property>
+ <property name="hadjustment">0 0 735 73.5 661.5 735</property>
<property name="shadow_type">out</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox2">
@@ -16096,10 +16098,12 @@ Chronopic</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="extra_window_label_jumps_no_options">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No options</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -16139,55 +16143,6 @@ Chronopic</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox24">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_kg">
- <property name="label">Kg</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_extra_window_jumps_radiobutton_kg_toggled"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_weight">
- <property name="label" translatable="yes">% body
-weight</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">extra_window_jumps_radiobutton_kg</property>
- <signal name="toggled" handler="on_extra_window_jumps_radiobutton_weight_toggled"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
<widget class="GtkCheckButton" id="extra_window_jumps_check_dj_arms">
<property name="label" translatable="yes">Using arms</property>
<property name="visible">True</property>
@@ -16286,7 +16241,44 @@ weight</property>
</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_kg">
+ <property name="label">Kg</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_extra_window_jumps_radiobutton_kg_toggled"/>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_weight">
+ <property name="label" translatable="yes">% body
+weight</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">extra_window_jumps_radiobutton_kg</property>
+ <signal name="toggled" handler="on_extra_window_jumps_radiobutton_weight_toggled"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
</child>
</widget>
<packing>
@@ -16310,10 +16302,12 @@ weight</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="extra_window_label_jumps_rj_no_options">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No options</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -16389,53 +16383,6 @@ weight</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox23">
- <property name="visible">True</property>
- <property name="spacing">11</property>
- <child>
- <widget class="GtkRadioButton" id="extra_window_jumps_rj_radiobutton_kg">
- <property name="label">Kg</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="extra_window_jumps_rj_radiobutton_weight">
- <property name="label" translatable="yes">% body
-weight</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">extra_window_jumps_rj_radiobutton_kg</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
<widget class="GtkHBox" id="hbox28">
<property name="visible">True</property>
<property name="spacing">4</property>
@@ -16520,7 +16467,42 @@ weight</property>
</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkRadioButton" id="extra_window_jumps_rj_radiobutton_kg">
+ <property name="label">Kg</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="extra_window_jumps_rj_radiobutton_weight">
+ <property name="label" translatable="yes">% body
+weight</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">extra_window_jumps_rj_radiobutton_kg</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
</child>
</widget>
<packing>
@@ -16548,10 +16530,12 @@ weight</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="extra_window_label_runs_no_options">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No options</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -16610,6 +16594,7 @@ weight</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="padding">8</property>
<property name="position">1</property>
</packing>
@@ -16635,10 +16620,12 @@ weight</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="extra_window_label_runs_interval_no_options">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No options</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -16804,10 +16791,12 @@ weight</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="extra_window_label_pulses_no_options">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">No options</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -17670,7 +17659,7 @@ Second Chronopic to platforms.</property>
<child>
<widget class="GtkDrawingArea" id="event_execute_drawingarea">
<property name="width_request">300</property>
- <property name="height_request">200</property>
+ <property name="height_request">225</property>
<property name="visible">True</property>
<signal name="expose_event" handler="on_event_execute_drawingarea_expose_event"/>
<signal name="configure_event" handler="on_event_execute_drawingarea_configure_event"/>
@@ -17685,6 +17674,69 @@ Second Chronopic to platforms.</property>
<child>
<widget class="GtkHBox" id="hbox37">
<property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkHBox" id="hbox67">
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkLabel" id="label67">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Width</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox_combo_graph_results_width">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox68">
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkLabel" id="label68">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Height</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox_combo_graph_results_height">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
<child>
<widget class="GtkButton" id="event_execute_button_properties">
<property name="visible">True</property>
@@ -17704,7 +17756,7 @@ Second Chronopic to platforms.</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -17724,9 +17776,8 @@ Second Chronopic to platforms.</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
@@ -17734,6 +17785,7 @@ Second Chronopic to platforms.</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
@@ -17757,6 +17809,8 @@ Second Chronopic to platforms.</property>
</child>
<child>
<widget class="GtkNotebook" id="notebook_results_data">
+ <property name="width_request">250</property>
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
@@ -18092,14 +18146,14 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox222">
+ <widget class="GtkHBox" id="hbox226">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <widget class="GtkLabel" id="label446">
+ <widget class="GtkLabel" id="label448">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">TF</property>
+ <property name="label" translatable="yes">TF / TC</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -18108,10 +18162,12 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox223">
+ <widget class="GtkHBox" id="hbox227">
<property name="visible">True</property>
<child>
- <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_good">
+ <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_tc_good">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18119,7 +18175,9 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_bad">
+ <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_tc_bad">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18139,8 +18197,8 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
@@ -18166,6 +18224,8 @@ Second Chronopic to platforms.</property>
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="event_execute_image_jump_reactive_tc_good">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18174,6 +18234,8 @@ Second Chronopic to platforms.</property>
</child>
<child>
<widget class="GtkImage" id="event_execute_image_jump_reactive_tc_bad">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18200,14 +18262,14 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox226">
+ <widget class="GtkHBox" id="hbox222">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <widget class="GtkLabel" id="label448">
+ <widget class="GtkLabel" id="label446">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">TF / TC</property>
+ <property name="label" translatable="yes">TF</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -18216,10 +18278,12 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox227">
+ <widget class="GtkHBox" id="hbox223">
<property name="visible">True</property>
<child>
- <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_tc_good">
+ <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_good">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18227,7 +18291,9 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_tc_bad">
+ <widget class="GtkImage" id="event_execute_image_jump_reactive_tf_bad">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -18247,8 +18313,8 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
@@ -19281,12 +19347,15 @@ Second Chronopic to platforms.</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox_this_test_buttons">
<property name="visible">True</property>
+ <property name="spacing">2</property>
<child>
<widget class="GtkButton" id="button_video_play_this_test">
<property name="visible">True</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 9d90e02..956cd6d 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -461,6 +461,10 @@ public partial class ChronoJumpWindow
rand = new Random(40);
putNonStandardIcons();
+ eventExecutePutNonStandardIcons();
+ //eventExecuteCreateComboGraphResultsSize();
+
+
/*
if(chronopicPort != Constants.ChronopicDefaultPortWindows &&
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 9c0bb05..af07c27 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -143,7 +143,12 @@ public partial class ChronoJumpWindow
[Widget] Gtk.DrawingArea event_execute_drawingarea;
[Widget] Box event_execute_hbox_drawingarea;
+ [Widget] Gtk.Box hbox_combo_graph_results_width;
+ [Widget] Gtk.Box hbox_combo_graph_results_height;
+ [Widget] Gtk.ComboBox combo_graph_results_width;
+ [Widget] Gtk.ComboBox combo_graph_results_height;
[Widget] Gtk.Alignment event_execute_alignment;
+ //[Widget] Gtk.Alignment event_execute_alignment_drawingarea;
//static Gdk.Pixmap event_execute_pixmap = null;
Gdk.Pixmap event_execute_pixmap = null;
@@ -183,6 +188,10 @@ public partial class ChronoJumpWindow
static EventGraphConfigureWindow eventGraphConfigureWin;
+ private static string [] comboGraphResultsSize = {
+ "100", "200", "300", "400", "500"
+ };
+
//static EventExecuteWindow EventExecuteWindowBox;
/*
@@ -310,9 +319,7 @@ public partial class ChronoJumpWindow
layout = new Pango.Layout (event_execute_drawingarea.PangoContext);
layout.FontDescription = Pango.FontDescription.FromString ("Courier 7");
-
- eventExecutePutNonStandardIcons();
-
+
eventHasEnded = false;
cameraRecordInitiate();
@@ -471,6 +478,39 @@ public partial class ChronoJumpWindow
notebook_results_data.CurrentPage = 5;
}
+ /*
+ private void eventExecuteCreateComboGraphResultsSize() {
+ combo_graph_results_width = ComboBox.NewText ();
+ UtilGtk.ComboUpdate(combo_graph_results_width, comboGraphResultsSize, "");
+ combo_graph_results_width.Active=2; //300
+
+ hbox_combo_graph_results_width.PackStart(combo_graph_results_width, true, true, 0);
+ hbox_combo_graph_results_width.ShowAll();
+ combo_graph_results_width.Sensitive = true;
+
+ combo_graph_results_width.Changed += new EventHandler (on_combo_graph_results_changed);
+
+ combo_graph_results_height = ComboBox.NewText ();
+ UtilGtk.ComboUpdate(combo_graph_results_height, comboGraphResultsSize, "");
+ combo_graph_results_height.Active=1; //200
+
+ hbox_combo_graph_results_height.PackStart(combo_graph_results_height, true, true, 0);
+ hbox_combo_graph_results_height.ShowAll();
+ combo_graph_results_height.Sensitive = true;
+
+ combo_graph_results_height.Changed += new EventHandler (on_combo_graph_results_changed);
+ }
+ */
+
+ /*
+ private void on_combo_graph_results_changed(object o, EventArgs args) {
+ //event_execute_drawingarea.Size(
+ event_execute_alignment_drawingarea.SetSizeRequest(
+ Convert.ToInt32(UtilGtk.ComboGetActive(combo_graph_results_width)),
+ Convert.ToInt32(UtilGtk.ComboGetActive(combo_graph_results_height)));
+ sizeChanged = true;
+ }
+ */
//called for cleaning the graph of a event done before than the current
private void event_execute_clearDrawingArea()
@@ -1220,6 +1260,7 @@ Log.WriteLine("Preparing reactive A");
int alto=drawingarea.Allocation.Height;
+ Log.WriteLine("Painting reactive A");
event_execute_erasePaint(drawingarea);
writeMarginsText(maxValue, minValue, alto);
@@ -1355,6 +1396,10 @@ Log.WriteLine("Preparing reactive A");
event_execute_image_jump_reactive_tf_tc_bad.Show();
}
+ /*
+ * these Log.writeLines are useful to don't "get the thread dead"
+ * without them , sometimes drawingarea is not painted
+ */
event_execute_label_jump_reactive_tc_now.Text = Util.TrimDecimals(lastTc.ToString(), prefsDigitsNumber);
event_execute_label_jump_reactive_tc_avg.Text = Util.TrimDecimals(avgTC.ToString(), prefsDigitsNumber);
event_execute_label_jump_reactive_tf_now.Text = Util.TrimDecimals(lastTv.ToString(), prefsDigitsNumber);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]