123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- {
- TIGCC IDE
- Copyright (C) 2000-2004 Sebastian Reichelt
- Copyright (C) 2005 Fréderic Bour
- Copyright (C) 2006 Kevin Kofler
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- }
- unit ProgramOptionsUnit;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, ComCtrls;
- type
- TProgramOptionsForm = class(TForm)
- CloseButton: TButton;
- PageController: TPageControl;
- CalculatorSheet: TTabSheet;
- Label2: TLabel;
- TI89CheckBox: TCheckBox;
- TI92PlusCheckBox: TCheckBox;
- V200CheckBox: TCheckBox;
- Label5: TLabel;
- OSSheet: TTabSheet;
- Label3: TLabel;
- NoStubRadioButton: TRadioButton;
- DoorsRadioButton: TRadioButton;
- PreOSRadioButton: TRadioButton;
- MinAMSCheckBox: TCheckBox;
- MinAMSEdit: TEdit;
- RelocFormatSheet: TTabSheet;
- Panel2: TPanel;
- Label4: TLabel;
- RelocAMSRadioButton: TRadioButton;
- RelocKernelRadioButton: TRadioButton;
- RelocCompressedRadioButton: TRadioButton;
- Panel3: TPanel;
- Label15: TLabel;
- ROMCallDirectRadioButton: TRadioButton;
- ROMCallKernelRadioButton: TRadioButton;
- ROMCallCompressedRadioButton: TRadioButton;
- ROMCallFLineRadioButton: TRadioButton;
- InternalFLineEmulatorCheckBox: TCheckBox;
- BSSFormatSheet: TTabSheet;
- HomeScreenSheet: TTabSheet;
- LCDSaveCheckBox: TCheckBox;
- EnableErrorReturnCheckBox: TCheckBox;
- Label11: TLabel;
- ReturnValueRadioButton: TRadioButton;
- ReturnDoneRadioButton: TRadioButton;
- Label10: TLabel;
- Label7: TLabel;
- Panel1: TPanel;
- Label6: TLabel;
- BSSKernelRadioButton: TRadioButton;
- BSSCompressedRadioButton: TRadioButton;
- BSSMergeRadioButton: TRadioButton;
- Panel4: TPanel;
- Label8: TLabel;
- DataVarKernelRadioButton: TRadioButton;
- DataVarCompressedRadioButton: TRadioButton;
- WelcomeSheet: TTabSheet;
- Label1: TLabel;
- Label9: TLabel;
- OptimizeCalcConstsCheckBox: TCheckBox;
- Label12: TLabel;
- RelocFLineJumpsCheckBox: TCheckBox;
- UnofficialOSSupportCheckBox: TCheckBox;
- RelocFLineJumps4ByteCheckBox: TCheckBox;
- ROMCallOptimizedCheckBox: TCheckBox;
- RelocMlinkRadioButton: TRadioButton;
- ROMCallMlinkRadioButton: TRadioButton;
- BSSMlinkRadioButton: TRadioButton;
- DataVarMlinkRadioButton: TRadioButton;
- procedure FormShow(Sender: TObject);
- procedure ShellRadioButtonClick(Sender: TObject);
- procedure MinAMSCheckBoxClick(Sender: TObject);
- procedure RelocRadioButtonClick(Sender: TObject);
- procedure ItemMouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure CalcCheckBoxClick(Sender: TObject);
- procedure RelocFLineJumpsCheckBoxClick(Sender: TObject);
- private
- public
- end;
- implementation
- uses
- MainUnit;
- {$R *.DFM}
- procedure TProgramOptionsForm.FormShow(Sender: TObject);
- begin
- ActiveControl := PageController;
- CalcCheckBoxClick (Sender);
- ShellRadioButtonClick (Sender);
- MinAMSCheckBoxClick (Sender);
- RelocRadioButtonClick (Sender);
- RelocFLineJumpsCheckBoxClick (Sender);
- end;
- procedure TProgramOptionsForm.ShellRadioButtonClick(Sender: TObject);
- begin
- with LCDSaveCheckBox do begin
- Enabled := NostubRadioButton.Checked;
- if not Enabled then
- Checked := True;
- end;
- with RelocAMSRadioButton do begin
- Enabled := NostubRadioButton.Checked;
- if Checked and not Enabled then
- RelocKernelRadioButton.Checked := True;
- end;
- with RelocMLinkRadioButton do begin
- Enabled := NostubRadioButton.Checked;
- if Checked and not Enabled then
- RelocKernelRadioButton.Checked := True;
- end;
- with RelocKernelRadioButton do begin
- Enabled := not PreOSRadioButton.Checked;
- if Checked and not Enabled then
- RelocCompressedRadioButton.Checked := True;
- end;
- with RelocCompressedRadioButton do begin
- Enabled := not DoorsRadioButton.Checked;
- if Checked and not Enabled then
- RelocKernelRadioButton.Checked := True;
- end;
- with ROMCallDirectRadioButton do begin
- Enabled := NostubRadioButton.Checked;
- if Checked and not Enabled then
- ROMCallKernelRadioButton.Checked := True;
- end;
- with ROMCallMLinkRadioButton do begin
- Enabled := NostubRadioButton.Checked;
- if Checked and not Enabled then
- ROMCallKernelRadioButton.Checked := True;
- end;
- with ROMCallKernelRadioButton do begin
- Enabled := not PreOSRadioButton.Checked;
- if Checked and not Enabled then
- ROMCallCompressedRadioButton.Checked := True;
- end;
- with ROMCallCompressedRadioButton do begin
- Enabled := not DoorsRadioButton.Checked;
- if Checked and not Enabled then
- ROMCallKernelRadioButton.Checked := True;
- end;
- with BSSMLinkRadioButton do begin
- Enabled := NostubRadioButton.Checked;
- if Checked and not Enabled then
- BSSKernelRadioButton.Checked := True;
- end;
- with BSSKernelRadioButton do begin
- Enabled := not PreOSRadioButton.Checked;
- if Checked and not Enabled then
- BSSCompressedRadioButton.Checked := True;
- end;
- with BSSCompressedRadioButton do begin
- Enabled := not DoorsRadioButton.Checked;
- if Checked and not Enabled then
- BSSKernelRadioButton.Checked := True;
- end;
- RelocRadioButtonClick (Sender);
- end;
- procedure TProgramOptionsForm.MinAMSCheckBoxClick(Sender: TObject);
- begin
- MinAMSEdit.Enabled := MinAMSCheckBox.Checked;
- end;
- procedure TProgramOptionsForm.RelocRadioButtonClick(Sender: TObject);
- begin
- with InternalFLineEmulatorCheckBox do begin
- Enabled := (RelocFLineJumpsCheckBox.Checked or ROMCallFLineRadioButton.Checked) and (not RelocFLineJumps4ByteCheckBox.Checked);
- if not Enabled then
- Checked := RelocFLineJumps4ByteCheckBox.Checked;
- end;
- with ROMCallOptimizedCheckBox do begin
- Enabled := (ROMCallDirectRadioButton.Checked or ROMCallFLineRadioButton.Checked) and NostubRadioButton.Checked;
- if not Enabled then
- Checked := False;
- end;
- end;
- procedure TProgramOptionsForm.ItemMouseDown(Sender: TObject;
- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- if Button = mbRight then
- if Sender is TControl then
- with TControl (Sender) do
- MainForm.DocFile.KeywordLookup (Hint);
- end;
- procedure TProgramOptionsForm.CalcCheckBoxClick(Sender: TObject);
- var
- CalcCount: Integer;
- begin
- CalcCount := 0;
- if TI89CheckBox.Checked then
- Inc (CalcCount);
- if TI92PlusCheckBox.Checked then
- Inc (CalcCount);
- if V200CheckBox.Checked then
- Inc (CalcCount);
- with OptimizeCalcConstsCheckBox do begin
- Enabled := CalcCount > 1;
- if not Enabled then
- Checked := CalcCount = 1;
- end;
- end;
- procedure TProgramOptionsForm.RelocFLineJumpsCheckBoxClick(
- Sender: TObject);
- begin
- with RelocFLineJumps4ByteCheckBox do begin
- Enabled := RelocFLineJumpsCheckBox.Checked;
- if not Enabled then
- Checked := False;
- end;
- RelocRadioButtonClick (Sender);
- end;
- end.
|