ProgramOptionsUnit.pas 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. {
  2. TIGCC IDE
  3. Copyright (C) 2000-2004 Sebastian Reichelt
  4. Copyright (C) 2005 Fréderic Bour
  5. Copyright (C) 2006 Kevin Kofler
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software Foundation,
  16. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. }
  18. unit ProgramOptionsUnit;
  19. interface
  20. uses
  21. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  22. StdCtrls, ExtCtrls, ComCtrls;
  23. type
  24. TProgramOptionsForm = class(TForm)
  25. CloseButton: TButton;
  26. PageController: TPageControl;
  27. CalculatorSheet: TTabSheet;
  28. Label2: TLabel;
  29. TI89CheckBox: TCheckBox;
  30. TI92PlusCheckBox: TCheckBox;
  31. V200CheckBox: TCheckBox;
  32. Label5: TLabel;
  33. OSSheet: TTabSheet;
  34. Label3: TLabel;
  35. NoStubRadioButton: TRadioButton;
  36. DoorsRadioButton: TRadioButton;
  37. PreOSRadioButton: TRadioButton;
  38. MinAMSCheckBox: TCheckBox;
  39. MinAMSEdit: TEdit;
  40. RelocFormatSheet: TTabSheet;
  41. Panel2: TPanel;
  42. Label4: TLabel;
  43. RelocAMSRadioButton: TRadioButton;
  44. RelocKernelRadioButton: TRadioButton;
  45. RelocCompressedRadioButton: TRadioButton;
  46. Panel3: TPanel;
  47. Label15: TLabel;
  48. ROMCallDirectRadioButton: TRadioButton;
  49. ROMCallKernelRadioButton: TRadioButton;
  50. ROMCallCompressedRadioButton: TRadioButton;
  51. ROMCallFLineRadioButton: TRadioButton;
  52. InternalFLineEmulatorCheckBox: TCheckBox;
  53. BSSFormatSheet: TTabSheet;
  54. HomeScreenSheet: TTabSheet;
  55. LCDSaveCheckBox: TCheckBox;
  56. EnableErrorReturnCheckBox: TCheckBox;
  57. Label11: TLabel;
  58. ReturnValueRadioButton: TRadioButton;
  59. ReturnDoneRadioButton: TRadioButton;
  60. Label10: TLabel;
  61. Label7: TLabel;
  62. Panel1: TPanel;
  63. Label6: TLabel;
  64. BSSKernelRadioButton: TRadioButton;
  65. BSSCompressedRadioButton: TRadioButton;
  66. BSSMergeRadioButton: TRadioButton;
  67. Panel4: TPanel;
  68. Label8: TLabel;
  69. DataVarKernelRadioButton: TRadioButton;
  70. DataVarCompressedRadioButton: TRadioButton;
  71. WelcomeSheet: TTabSheet;
  72. Label1: TLabel;
  73. Label9: TLabel;
  74. OptimizeCalcConstsCheckBox: TCheckBox;
  75. Label12: TLabel;
  76. RelocFLineJumpsCheckBox: TCheckBox;
  77. UnofficialOSSupportCheckBox: TCheckBox;
  78. RelocFLineJumps4ByteCheckBox: TCheckBox;
  79. ROMCallOptimizedCheckBox: TCheckBox;
  80. RelocMlinkRadioButton: TRadioButton;
  81. ROMCallMlinkRadioButton: TRadioButton;
  82. BSSMlinkRadioButton: TRadioButton;
  83. DataVarMlinkRadioButton: TRadioButton;
  84. procedure FormShow(Sender: TObject);
  85. procedure ShellRadioButtonClick(Sender: TObject);
  86. procedure MinAMSCheckBoxClick(Sender: TObject);
  87. procedure RelocRadioButtonClick(Sender: TObject);
  88. procedure ItemMouseDown(Sender: TObject; Button: TMouseButton;
  89. Shift: TShiftState; X, Y: Integer);
  90. procedure CalcCheckBoxClick(Sender: TObject);
  91. procedure RelocFLineJumpsCheckBoxClick(Sender: TObject);
  92. private
  93. public
  94. end;
  95. implementation
  96. uses
  97. MainUnit;
  98. {$R *.DFM}
  99. procedure TProgramOptionsForm.FormShow(Sender: TObject);
  100. begin
  101. ActiveControl := PageController;
  102. CalcCheckBoxClick (Sender);
  103. ShellRadioButtonClick (Sender);
  104. MinAMSCheckBoxClick (Sender);
  105. RelocRadioButtonClick (Sender);
  106. RelocFLineJumpsCheckBoxClick (Sender);
  107. end;
  108. procedure TProgramOptionsForm.ShellRadioButtonClick(Sender: TObject);
  109. begin
  110. with LCDSaveCheckBox do begin
  111. Enabled := NostubRadioButton.Checked;
  112. if not Enabled then
  113. Checked := True;
  114. end;
  115. with RelocAMSRadioButton do begin
  116. Enabled := NostubRadioButton.Checked;
  117. if Checked and not Enabled then
  118. RelocKernelRadioButton.Checked := True;
  119. end;
  120. with RelocMLinkRadioButton do begin
  121. Enabled := NostubRadioButton.Checked;
  122. if Checked and not Enabled then
  123. RelocKernelRadioButton.Checked := True;
  124. end;
  125. with RelocKernelRadioButton do begin
  126. Enabled := not PreOSRadioButton.Checked;
  127. if Checked and not Enabled then
  128. RelocCompressedRadioButton.Checked := True;
  129. end;
  130. with RelocCompressedRadioButton do begin
  131. Enabled := not DoorsRadioButton.Checked;
  132. if Checked and not Enabled then
  133. RelocKernelRadioButton.Checked := True;
  134. end;
  135. with ROMCallDirectRadioButton do begin
  136. Enabled := NostubRadioButton.Checked;
  137. if Checked and not Enabled then
  138. ROMCallKernelRadioButton.Checked := True;
  139. end;
  140. with ROMCallMLinkRadioButton do begin
  141. Enabled := NostubRadioButton.Checked;
  142. if Checked and not Enabled then
  143. ROMCallKernelRadioButton.Checked := True;
  144. end;
  145. with ROMCallKernelRadioButton do begin
  146. Enabled := not PreOSRadioButton.Checked;
  147. if Checked and not Enabled then
  148. ROMCallCompressedRadioButton.Checked := True;
  149. end;
  150. with ROMCallCompressedRadioButton do begin
  151. Enabled := not DoorsRadioButton.Checked;
  152. if Checked and not Enabled then
  153. ROMCallKernelRadioButton.Checked := True;
  154. end;
  155. with BSSMLinkRadioButton do begin
  156. Enabled := NostubRadioButton.Checked;
  157. if Checked and not Enabled then
  158. BSSKernelRadioButton.Checked := True;
  159. end;
  160. with BSSKernelRadioButton do begin
  161. Enabled := not PreOSRadioButton.Checked;
  162. if Checked and not Enabled then
  163. BSSCompressedRadioButton.Checked := True;
  164. end;
  165. with BSSCompressedRadioButton do begin
  166. Enabled := not DoorsRadioButton.Checked;
  167. if Checked and not Enabled then
  168. BSSKernelRadioButton.Checked := True;
  169. end;
  170. RelocRadioButtonClick (Sender);
  171. end;
  172. procedure TProgramOptionsForm.MinAMSCheckBoxClick(Sender: TObject);
  173. begin
  174. MinAMSEdit.Enabled := MinAMSCheckBox.Checked;
  175. end;
  176. procedure TProgramOptionsForm.RelocRadioButtonClick(Sender: TObject);
  177. begin
  178. with InternalFLineEmulatorCheckBox do begin
  179. Enabled := (RelocFLineJumpsCheckBox.Checked or ROMCallFLineRadioButton.Checked) and (not RelocFLineJumps4ByteCheckBox.Checked);
  180. if not Enabled then
  181. Checked := RelocFLineJumps4ByteCheckBox.Checked;
  182. end;
  183. with ROMCallOptimizedCheckBox do begin
  184. Enabled := (ROMCallDirectRadioButton.Checked or ROMCallFLineRadioButton.Checked) and NostubRadioButton.Checked;
  185. if not Enabled then
  186. Checked := False;
  187. end;
  188. end;
  189. procedure TProgramOptionsForm.ItemMouseDown(Sender: TObject;
  190. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  191. begin
  192. if Button = mbRight then
  193. if Sender is TControl then
  194. with TControl (Sender) do
  195. MainForm.DocFile.KeywordLookup (Hint);
  196. end;
  197. procedure TProgramOptionsForm.CalcCheckBoxClick(Sender: TObject);
  198. var
  199. CalcCount: Integer;
  200. begin
  201. CalcCount := 0;
  202. if TI89CheckBox.Checked then
  203. Inc (CalcCount);
  204. if TI92PlusCheckBox.Checked then
  205. Inc (CalcCount);
  206. if V200CheckBox.Checked then
  207. Inc (CalcCount);
  208. with OptimizeCalcConstsCheckBox do begin
  209. Enabled := CalcCount > 1;
  210. if not Enabled then
  211. Checked := CalcCount = 1;
  212. end;
  213. end;
  214. procedure TProgramOptionsForm.RelocFLineJumpsCheckBoxClick(
  215. Sender: TObject);
  216. begin
  217. with RelocFLineJumps4ByteCheckBox do begin
  218. Enabled := RelocFLineJumpsCheckBox.Checked;
  219. if not Enabled then
  220. Checked := False;
  221. end;
  222. RelocRadioButtonClick (Sender);
  223. end;
  224. end.