diff --git a/Ini.pas b/Ini.pas index 788fb20..280c9ee 100644 --- a/Ini.pas +++ b/Ini.pas @@ -249,6 +249,7 @@ TContestDefinition = record Duration: integer = 30; RunMode: TRunMode = rmStop; + DefaultRunMode: TRunMode = rmPileUp; HiScore: integer; CompDuration: integer = 60; @@ -385,6 +386,8 @@ procedure FromIni(cb : TErrMessageCallback); MainForm.CheckBox6.Checked := ReadBool(SEC_BND, 'Lids', Lids); MainForm.ReadCheckBoxes; + V := ReadInteger(SEC_TST, 'DefaultRunMode', Ord(DefaultRunMode)); + MainForm.SetDefaultRunMode(Max(Ord(rmPileUp), Min(Ord(rmHst), V))); Duration := ReadInteger(SEC_TST, 'Duration', Duration); MainForm.SpinEdit2.Value := Duration; HiScore := ReadInteger(SEC_TST, 'HiScore', HiScore); @@ -480,6 +483,7 @@ procedure ToIni; WriteBool(SEC_BND, 'Flutter', Flutter); WriteBool(SEC_BND, 'Lids', Lids); + WriteInteger(SEC_TST, 'DefaultRunMode', Ord(DefaultRunMode)); WriteInteger(SEC_TST, 'Duration', Duration); WriteInteger(SEC_TST, 'HiScore', HiScore); WriteInteger(SEC_TST, 'CompetitionDuration', CompDuration); diff --git a/Main.dfm b/Main.dfm index f034720..617df4f 100644 --- a/Main.dfm +++ b/Main.dfm @@ -1584,7 +1584,7 @@ object MainForm: TMainForm Left = 384 Top = 176 Bitmap = { - 494C01010A00D800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C01010B00D800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000003000000001002000000000000030 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -1606,105 +1606,105 @@ object MainForm: TMainForm 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000FFFF000000000000000000007F7F7F007F7F7F007F7F 7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F - 7F007F7F7F007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 7F007F7F7F007F7F7F00FFFFFF0000000000000000002B1BEE00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF007F7F 7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F 7F007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED002B1BEE00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CEE00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00FFFFFF000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00251DED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00FFFFFF000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00FFFFFF000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CEE00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00FFFFFF000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00000000000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 00007F7F7F0000000000FFFF000000000000000000007F7F7F00FFFFFF000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F00FFFFFF000000000000000000241CED00241CED00241C + ED00241CED00241CEC00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF0000000000FFFF000000000000000000007F7F7F00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF - FF00FFFFFF007F7F7F00FFFFFF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF00FFFFFF007F7F7F00FFFFFF0000000000000000002A1BEE00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000FFFF000000000000000000007F7F7F007F7F7F007F7F 7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F - 7F007F7F7F007F7F7F0000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 7F007F7F7F007F7F7F00000000000000000000000000241CED00241CED00241C + ED00241CED00241CED00241CED00241CED00241CED00241CED00241CED00241C + ED00241CED00241CED0000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FFFF 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF @@ -1972,11 +1972,11 @@ object MainForm: TMainForm 7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F 7F007F7F7F00000000000000000000000000424D3E000000000000003E000000 2800000040000000300000000100010000000000800100000000000000000000 - 000000000000000000000000FFFFFF00FFFFFFFF000000000001C00100000000 - 000180010000000000019FF9000000001FF19FF9000000001FF19C1900000000 - 1831981900000000183198190000000018319819000000001831981900000000 - 18319839000000001FF19FF9000000001FF19FF9000000000001800100000000 - 00018003000000000001FFFF00000000FFFFC001FFFFFFFF800380020001C001 + 000000000000000000000000FFFFFF00FFFFFFFFFFFF00000001C00180010000 + 000180018001000000019FF9800100001FF19FF9800100001FF19C1980010000 + 1831981980010000183198198001000018319819800100001831981980010000 + 18319839800100001FF19FF9800100001FF19FF9800100000001800180010000 + 00018003800100000001FFFFFFFF0000FFFFC001FFFFFFFF800380020001C001 00013924000180010001382400019FF9000138041FF19FF90001380C1FF19E39 0001200018319C19000100001831981900010FF01831981900010FF018319839 00010FF018319C7900010FF01FF19FF900010FF01FF19FF900010FF000018001 diff --git a/Main.pas b/Main.pas index 2e42aaa..de4e68d 100644 --- a/Main.pas +++ b/Main.pas @@ -400,6 +400,7 @@ TMainForm = class(TForm) procedure Advance; procedure SetContest(AContestNum: TSimContest); function SetMyExchange(const AExchange: string) : Boolean; + procedure SetDefaultRunMode(V : Integer); procedure SetMySerialNR; procedure SetQsk(Value: boolean); procedure SetWpm(AWpm : integer); @@ -1197,6 +1198,21 @@ procedure TMainForm.UpdateTitleBar; end; +procedure TMainForm.SetDefaultRunMode(V : Integer); +begin + if (V >= Ord(rmPileUp)) and (V <= Ord(rmHst)) then + DefaultRunMode := TRunMode(V) + else + DefaultRunMode := rmPileUp; + + assert(PopupMenu1.Items[0].Tag = Ord(rmPileUp)); + assert(PopupMenu1.Items[1].Tag = Ord(rmSingle)); + assert(PopupMenu1.Items[2].Tag = Ord(rmWpx)); + assert(PopupMenu1.Items[3].Tag = Ord(rmHst)); + PopupMenu1.Items[Ord(DefaultRunMode)-1].Default := True; +end; + + procedure TMainForm.SetMySerialNR; begin assert(Tst.Me.SentExchTypes.Exch2 = etSerialNr); @@ -1648,7 +1664,8 @@ procedure TMainForm.Edit1Change(Sender: TObject); procedure TMainForm.RunMNUClick(Sender: TObject); begin - Run(TRunMode((Sender as TComponent).Tag)); + SetDefaultRunMode((Sender as TComponent).Tag); + Run(DefaultRunMode); end; @@ -1762,6 +1779,8 @@ procedure TMainForm.Run(Value: TRunMode); EnableCtl(ExchangeEdit, BStop and ActiveContest.ExchFieldEditable); EnableCtl(SpinEdit2, BStop); SetToolbuttonDown(ToolButton1, not BStop); + ToolButton1.Caption := IfThen(BStop, 'Run', 'Stop'); + ToolButton1.ImageIndex := IfThen(BStop, 0, 10); //condition checkboxes EnableCtl(CheckBox2, not BCompet); @@ -1881,7 +1900,7 @@ procedure TMainForm.Run(Value: TRunMode); procedure TMainForm.RunBtnClick(Sender: TObject); begin if RunMode = rmStop then - Run(rmPileUp) + Run(DefaultRunMode) else Tst.FStopPressed := true; end;