Commit ffe55ff5 authored by Xavier de Blas's avatar Xavier de Blas

Edit run allows changing type, distance and time; speed changes automatically.

EditJumpRj widget fixed (is the same gui as edit run)
parent 45b5d047
CHANGELOG:
12 jan 2006
edit run allows changing type, distance and time; speed changes automatically.
EditJumpRj widget fixed (is the same gui as edit run)
11 jan 2006
edit jump, jumpRj allow to change lot of data of the jump. Also some rows
hidden. Do the same with runs
......
No preview for this file type
......@@ -5587,6 +5587,31 @@ weight</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property>
<child>
<widget class="GtkLabel" id="label_header">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table4">
<property name="visible">True</property>
......@@ -8820,6 +8845,31 @@ best's</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property>
<child>
<widget class="GtkLabel" id="label_header">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table15">
<property name="visible">True</property>
......@@ -8887,35 +8937,7 @@ comments</property>
</child>
<child>
<widget class="GtkLabel" id="label_distance_value">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</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">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label116">
<widget class="GtkLabel" id="label_time_name">
<property name="visible">True</property>
<property name="label" translatable="yes">Time</property>
<property name="use_underline">False</property>
......@@ -8942,34 +8964,6 @@ comments</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_time_value">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</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">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label118">
<property name="visible">True</property>
......@@ -9054,34 +9048,6 @@ comments</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_type_value">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<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="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label122">
<property name="visible">True</property>
......@@ -9117,7 +9083,7 @@ comments</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHBox" id="hbox_combo">
<widget class="GtkHBox" id="hbox_combo_runner">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
......@@ -9200,7 +9166,7 @@ comments</property>
</child>
<child>
<widget class="GtkLabel" id="label127">
<widget class="GtkLabel" id="label_limited_name">
<property name="visible">True</property>
<property name="label" translatable="yes">Limited by</property>
<property name="use_underline">False</property>
......@@ -9292,6 +9258,70 @@ comments</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry_time">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
<signal name="changed" handler="on_entry_time_changed" last_modification_time="Wed, 11 Jan 2006 23:43:20 GMT"/>
</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="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox_combo_runType">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
</widget>
<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="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry_distance">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
<signal name="changed" handler="on_entry_distance_changed" last_modification_time="Thu, 12 Jan 2006 14:54:11 GMT"/>
</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="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......
......@@ -3,6 +3,7 @@ CHRONOJUMP ROADMAP
chronojump 0.5
--------------
- when a person is selected in treeview persons, a row in treeviews jump, jumpRj, run, runInterval should be created (if is not already) and selected
- hability of creating a jump or run in a selected value (if was obtained with mini, by example) do a simulate, and later edit with a edit jump widget with more power [DONE]
- print rjevolution consecutives in colors in the stats treeview
- Chronojump will be a tool for training, not only for showing the results of train:
......
......@@ -2230,7 +2230,7 @@ public class ChronoJump
Console.WriteLine(myRun);
//4.- edit this run
editRunWin = EditRunWindow.Show(app1, myRun);
editRunWin = EditRunWindow.Show(app1, myRun, prefsDigitsNumber);
editRunWin.Button_accept.Clicked += new EventHandler(on_edit_selected_run_accepted);
}
}
......@@ -2246,7 +2246,7 @@ public class ChronoJump
Console.WriteLine(myRun);
//4.- edit this run
editRunIntervalWin = EditRunIntervalWindow.Show(app1, myRun);
editRunIntervalWin = EditRunIntervalWindow.Show(app1, myRun, prefsDigitsNumber);
editRunIntervalWin.Button_accept.Clicked += new EventHandler(on_edit_selected_run_interval_accepted);
}
}
......
......@@ -37,6 +37,7 @@ public class EditJumpWindow
{
[Widget] Gtk.Window edit_jump;
[Widget] Gtk.Button button_accept;
[Widget] Gtk.Label label_header;
[Widget] Gtk.Label label_jump_id_value;
[Widget] Gtk.Entry entry_tv_value;
[Widget] Gtk.Entry entry_tc_value;
......@@ -44,10 +45,12 @@ public class EditJumpWindow
[Widget] Gtk.Entry entry_weight_value;
[Widget] Gtk.Label label_limited_title;
[Widget] Gtk.Label label_limited_value;
[Widget] Gtk.Box hbox_combo_jumpType;
[Widget] Gtk.Combo combo_jumpType;
[Widget] Gtk.Box hbox_combo_jumper;
[Widget] Gtk.Combo combo_jumpTypes;
[Widget] Gtk.Combo combo_jumpers;
[Widget] Gtk.TextView textview_description;
static EditJumpWindow EditJumpWindowBox;
......@@ -67,6 +70,10 @@ public class EditJumpWindow
gladeXML.Autoconnect(this);
this.parent = parent;
System.Globalization.NumberFormatInfo localeInfo = new System.Globalization.NumberFormatInfo();
localeInfo = System.Globalization.NumberFormatInfo.CurrentInfo;
label_header.Text = string.Format(Catalog.GetString("Use this window for edit a jump\n(decimal separator: '{0}')"), localeInfo.NumberDecimalSeparator);
}
static public EditJumpWindow Show (Gtk.Window parent, Jump myJump, int pDN)
......@@ -120,17 +127,17 @@ public class EditJumpWindow
tb.SetText(myJump.Description);
textview_description.Buffer = tb;
combo_jumpTypes = new Combo ();
combo_jumpType = new Combo ();
string [] jumpTypes;
if (myJump.TypeHasFall) {
jumpTypes = SqliteJumpType.SelectJumpTypes("", "TC", true); //don't show allJumpsName row, TC jumps, only select name
} else {
jumpTypes = SqliteJumpType.SelectJumpTypes("", "nonTC", true); //don't show allJumpsName row, nonTC jumps, only select name
}
combo_jumpTypes.PopdownStrings = jumpTypes;
combo_jumpType.PopdownStrings = jumpTypes;
foreach (string jumpType in jumpTypes) {
if (jumpType == myJump.Type) {
combo_jumpTypes.Entry.Text = jumpType;
combo_jumpType.Entry.Text = jumpType;
}
}
......@@ -146,7 +153,7 @@ public class EditJumpWindow
oldPersonID = myJump.PersonID;
hbox_combo_jumpType.PackStart(combo_jumpTypes, true, true, 0);
hbox_combo_jumpType.PackStart(combo_jumpType, true, true, 0);
hbox_combo_jumpType.ShowAll();
hbox_combo_jumper.PackStart(combo_jumpers, true, true, 0);
hbox_combo_jumper.ShowAll();
......@@ -221,7 +228,7 @@ public class EditJumpWindow
oldPersonWeight, jumpWeightInKg, newPersonWeight, jumpPercentWeightForNewPerson);
}
SqliteJump.Update(jumpID, combo_jumpTypes.Entry.Text, entryTv, entryTc, entryFall, Convert.ToInt32 (myJumperFull[0]), jumpPercentWeightForNewPerson, myDesc);
SqliteJump.Update(jumpID, combo_jumpType.Entry.Text, entryTv, entryTc, entryFall, Convert.ToInt32 (myJumperFull[0]), jumpPercentWeightForNewPerson, myDesc);
EditJumpWindowBox.edit_jump.Hide();
EditJumpWindowBox = null;
......@@ -243,6 +250,7 @@ public class EditJumpRjWindow
{
[Widget] Gtk.Window edit_jump;
[Widget] Gtk.Button button_accept;
[Widget] Gtk.Label label_header;
[Widget] Gtk.Label label_jump_id_value;
[Widget] Gtk.Label label_tc_title;
[Widget] Gtk.Label label_tv_title;
......@@ -251,6 +259,7 @@ public class EditJumpRjWindow
[Widget] Gtk.Entry entry_fall_value;
[Widget] Gtk.Entry entry_weight_value;
[Widget] Gtk.Label label_limited_value;
[Widget] Gtk.Box hbox_combo_jumpType;
[Widget] Gtk.Box hbox_combo_jumper;
[Widget] Gtk.Combo combo_jumpers;
[Widget] Gtk.TextView textview_description;
......@@ -268,6 +277,10 @@ public class EditJumpRjWindow
gladeXML.Autoconnect(this);
this.parent = parent;
System.Globalization.NumberFormatInfo localeInfo = new System.Globalization.NumberFormatInfo();
localeInfo = System.Globalization.NumberFormatInfo.CurrentInfo;
label_header.Text = string.Format(Catalog.GetString("Use this window for edit a reactive jump\n(decimal separator: '{0}')"), localeInfo.NumberDecimalSeparator);
}
static public EditJumpRjWindow Show (Gtk.Window parent, JumpRj myJump, int pDN)
......@@ -290,7 +303,6 @@ public class EditJumpRjWindow
private void fillDialog (JumpRj myJump)
{
label_jump_id_value.Text = myJump.UniqueID.ToString();
//label_type_value.Text = myJump.Type;
//hide tc and tv data
label_tc_title.Hide();
......@@ -326,12 +338,15 @@ public class EditJumpRjWindow
combo_jumpers.Entry.Text = jumper;
}
}
oldPersonID = myJump.PersonID;
hbox_combo_jumper.PackStart(combo_jumpers, true, true, 0);
hbox_combo_jumper.ShowAll();
Gtk.Label label_jumpType = new Label();
label_jumpType.Text = myJump.Type;
hbox_combo_jumpType.PackStart(label_jumpType, false, false, 0);
hbox_combo_jumpType.ShowAll();
oldPersonID = myJump.PersonID;
}
//this is never called, created here for compatibility with editjump class
......
......@@ -37,17 +37,28 @@ public class EditRunWindow
{
[Widget] Gtk.Window edit_run;
[Widget] Gtk.Button button_accept;
[Widget] Gtk.Label label_header;
[Widget] Gtk.Label label_run_id_value;
[Widget] Gtk.Label label_type_value;
[Widget] Gtk.Label label_distance_value;
[Widget] Gtk.Label label_time_value;
[Widget] Gtk.Entry entry_distance;
[Widget] Gtk.Entry entry_time;
[Widget] Gtk.Label label_speed_value;
[Widget] Gtk.Box hbox_combo;
[Widget] Gtk.Box hbox_combo_runType;
[Widget] Gtk.Combo combo_runType;
[Widget] Gtk.Box hbox_combo_runner;
[Widget] Gtk.Combo combo_runners;
[Widget] Gtk.TextView textview_description;
[Widget] Gtk.Label label_limited_name;
[Widget] Gtk.Label label_limited_value;
static EditRunWindow EditRunWindowBox;
Gtk.Window parent;
int pDN;
string entryDistance; //contains a entry that is a Number. If changed the entry as is not a number, recuperate this
string entryTime;
string type;
EditRunWindow (Gtk.Window parent) {
......@@ -55,14 +66,20 @@ public class EditRunWindow
gladeXML.Autoconnect(this);
this.parent = parent;
System.Globalization.NumberFormatInfo localeInfo = new System.Globalization.NumberFormatInfo();
localeInfo = System.Globalization.NumberFormatInfo.CurrentInfo;
label_header.Text = string.Format(Catalog.GetString("Use this window for edit a run\n(decimal separator: '{0}')"), localeInfo.NumberDecimalSeparator);
}
static public EditRunWindow Show (Gtk.Window parent, Run myRun)
static public EditRunWindow Show (Gtk.Window parent, Run myRun, int pDN)
{
if (EditRunWindowBox == null) {
EditRunWindowBox = new EditRunWindow (parent);
}
EditRunWindowBox.pDN = pDN;
EditRunWindowBox.edit_run.Show ();
EditRunWindowBox.fillDialog (myRun);
......@@ -74,15 +91,37 @@ public class EditRunWindow
private void fillDialog (Run myRun)
{
label_run_id_value.Text = myRun.UniqueID.ToString();
label_type_value.Text = myRun.Type;
label_distance_value.Text = myRun.Distance.ToString();
label_time_value.Text = myRun.Time.ToString();
label_speed_value.Text = myRun.Speed.ToString();
entryDistance = myRun.Distance.ToString();
entry_distance.Text = Util.TrimDecimals(entryDistance, pDN);
//if the jumptype hasnot a predefined distance, make the widget sensitive
RunType myRunType = new RunType (myRun.Type);
if(myRunType.Distance == 0) {
entry_distance.Sensitive = true;
} else {
entry_distance.Sensitive = false;
}
entryTime = myRun.Time.ToString();
entry_time.Text = Util.TrimDecimals(entryTime, pDN);
label_speed_value.Text = Util.TrimDecimals(myRun.Speed.ToString(), pDN);
TextBuffer tb = new TextBuffer (new TextTagTable());
tb.SetText(myRun.Description);
textview_description.Buffer = tb;
combo_runType = new Combo ();
string [] runTypes = SqliteRunType.SelectRunTypes("", true); //don't show allRunsName row, only select name
combo_runType.PopdownStrings = runTypes;
foreach (string runType in runTypes) {
if (runType == myRun.Type) {
combo_runType.Entry.Text = runType;
}
}
combo_runType.Entry.Changed += new EventHandler (on_combo_runType_changed);
hbox_combo_runType.PackStart(combo_runType, true, true, 0);
hbox_combo_runType.ShowAll();
string [] runners = SqlitePersonSession.SelectCurrentSession(myRun.SessionID, false); //not reversed
combo_runners = new Combo();
combo_runners.PopdownStrings = runners;
......@@ -93,9 +132,53 @@ public class EditRunWindow
}
}
hbox_combo.PackStart(combo_runners, true, true, 0);
hbox_combo.ShowAll();
hbox_combo_runner.PackStart(combo_runners, true, true, 0);
hbox_combo_runner.ShowAll();
label_limited_name.Hide();
label_limited_value.Hide();
}
private void on_entry_time_changed (object o, EventArgs args) {
if(Util.IsNumber(entry_time.Text.ToString())){
entryTime = entry_time.Text.ToString();
label_speed_value.Text = Util.TrimDecimals(
Util.GetSpeed (entryDistance, entryTime) , pDN);
} else {
entry_time.Text = "";
entry_time.Text = entryTime;
}
}
private void on_entry_distance_changed (object o, EventArgs args) {
if(Util.IsNumber(entry_distance.Text.ToString())){
entryDistance = entry_distance.Text.ToString();
label_speed_value.Text = Util.TrimDecimals(
Util.GetSpeed (entryDistance, entryTime) , pDN);
} else {
entry_distance.Text = "";
entry_distance.Text = entryDistance;
}
}
private void on_combo_runType_changed (object o, EventArgs args) {
//if the distance of the new runType is fixed, put this distance
//if not conserve the old
RunType myRunType = new RunType (combo_runType.Entry.Text);
if(myRunType.Distance != 0) {
entryDistance = myRunType.Distance.ToString();
entry_distance.Text = "";
entry_distance.Text = Util.TrimDecimals(entryDistance, pDN);
entry_distance.Sensitive = false;
} else {
entry_distance.Sensitive = true;
}
label_speed_value.Text = Util.TrimDecimals(
Util.GetSpeed (entryDistance, entryTime) , pDN);
}
void on_button_cancel_clicked (object o, EventArgs args)
......@@ -118,7 +201,7 @@ public class EditRunWindow
string myDesc = textview_description.Buffer.Text;
SqliteRun.Update(runID, Convert.ToInt32 (myRunnerFull[0]), myDesc);
SqliteRun.Update(runID, combo_runType.Entry.Text, entryDistance, entryTime, Convert.ToInt32 (myRunnerFull[0]), myDesc);
EditRunWindowBox.edit_run.Hide();
EditRunWindowBox = null;
......@@ -136,18 +219,21 @@ public class EditRunIntervalWindow
{
[Widget] Gtk.Window edit_run;
[Widget] Gtk.Button button_accept;
[Widget] Gtk.Label label_header;
[Widget] Gtk.Label label_run_id_value;
[Widget] Gtk.Label label_type_value;
[Widget] Gtk.Label label_distance_value;
[Widget] Gtk.Label label_time_value;
[Widget] Gtk.Entry entry_distance;
[Widget] Gtk.Label label_time_name;
[Widget] Gtk.Entry entry_time;
[Widget] Gtk.Label label_speed_value;
[Widget] Gtk.Label label_limited_value;
[Widget] Gtk.Box hbox_combo;
[Widget] Gtk.Box hbox_combo_runType;
[Widget] Gtk.Box hbox_combo_runner;
[Widget] Gtk.Combo combo_runners;
[Widget] Gtk.TextView textview_description;
static EditRunIntervalWindow EditRunIntervalWindowBox;
Gtk.Window parent;
int pDN;
string type;
EditRunIntervalWindow (Gtk.Window parent) {
......@@ -155,15 +241,21 @@ public class EditRunIntervalWindow
gladeXML.Autoconnect(this);
this.parent = parent;
System.Globalization.NumberFormatInfo localeInfo = new System.Globalization.NumberFormatInfo();
localeInfo = System.Globalization.NumberFormatInfo.CurrentInfo;
label_header.Text = string.Format(Catalog.GetString("Use this window for edit a intervalic run\n(decimal separator: '{0}')"), localeInfo.NumberDecimalSeparator);
}
static public EditRunIntervalWindow Show (Gtk.Window parent, RunInterval myRun)
static public EditRunIntervalWindow Show (Gtk.Window parent, RunInterval myRun, int pDN)
{
Console.WriteLine(myRun);
if (EditRunIntervalWindowBox == null) {
EditRunIntervalWindowBox = new EditRunIntervalWindow (parent);
}
EditRunIntervalWindowBox.pDN = pDN;
EditRunIntervalWindowBox.edit_run.Show ();
EditRunIntervalWindowBox.fillDialog (myRun);
......@@ -175,13 +267,19 @@ public class EditRunIntervalWindow
private void fillDialog (RunInterval myRun)
{
label_run_id_value.Text = myRun.UniqueID.ToString();
label_type_value.Text = myRun.Type;
label_distance_value.Text = myRun.DistanceInterval.ToString() +
entry_distance.Text = myRun.DistanceInterval.ToString() +
"x" + myRun.Limited;
label_time_value.Text = myRun.TimeTotal.ToString();
label_speed_value.Text = Util.GetSpeed(
myRun.DistanceTotal.ToString(),
myRun.TimeTotal.ToString() );
entry_distance.Sensitive = false;
label_time_name.Text = Catalog.GetString("Totaltime");
entry_time.Text = myRun.TimeTotal.ToString();
//don't allow to change totaltime in rjedit
entry_time.Sensitive = false;
label_speed_value.Text = Util.TrimDecimals(
Util.GetSpeed(
myRun.DistanceTotal.ToString(),
myRun.TimeTotal.ToString() ), pDN);
label_limited_value.Text = myRun.Limited;
......@@ -201,9 +299,21 @@ public class EditRunIntervalWindow
}
}
hbox_combo.PackStart(combo_runners, true, true, 0);
hbox_combo.ShowAll();
hbox_combo_runner.PackStart(combo_runners, true, true, 0);
hbox_combo_runner.ShowAll();
Gtk.Label label_runType = new Label();
label_runType.Text = myRun.Type;
hbox_combo_runType.PackStart(label_runType, false, false, 0);
hbox_combo_runType.ShowAll();
}
private void on_entry_time_changed (object o, EventArgs args) {
//do nothing, this is never called in reactive jumps
}
private void on_entry_distance_changed (object o, EventArgs args) {
//do nothing, this is never called in reactive jumps
}
void on_button_cancel_clicked (object o, EventArgs args)
......
......@@ -29,6 +29,7 @@ public class RunType
protected double distance;
protected bool tracksLimited;
protected int fixedValue;
protected bool isPredefined;
protected bool unlimited;
public RunType() {
......@@ -38,6 +39,8 @@ public class RunType
public RunType(string name) {
this.name = name;
this.isPredefined = false;
unlimited = false; //default value
//if this changes, sqlite/runType.cs initialize tables should change
......@@ -48,69 +51,82 @@ public class RunType
distance = 0;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "20m") {
hasIntervals = false;
distance = 20;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "100m") {
hasIntervals = false;
distance = 100;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "200m") {
hasIntervals = false;
distance = 200;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "400m") {
hasIntervals = false;
distance = 400;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "1000m") {
hasIntervals = false;
distance = 1000;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} else if(name == "2000m") {
hasIntervals = false;
distance = 2000;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
} //interval
else if(name == "byLaps") {
hasIntervals = true;