📄 uprooption.pas
字号:
unit UProOption;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, Buttons, ExtCtrls;
type
TProjOption = class(TForm)
Panel1: TPanel;
OkButton: TButton;
CancelButton: TButton;
HelpButton: TButton;
DefaultOpts: TCheckBox;
Panel2: TPanel;
PageControl1: TPageControl;
FormsPage: TTabSheet;
Bevel1: TBevel;
Label11: TLabel;
Label6: TLabel;
Label12: TLabel;
AddSelected: TSpeedButton;
AddAll: TSpeedButton;
RemoveSelected: TSpeedButton;
RemoveAll: TSpeedButton;
AvailableForms: TListBox;
AutoCreateForms: TListBox;
cbMainForm: TComboBox;
ApplicationPage: TTabSheet;
GroupBox13: TGroupBox;
AppHelpFileLbl: TLabel;
AppTitleLbl: TLabel;
Label7: TLabel;
IconPanel: TPanel;
IconImage: TImage;
LoadIconBtn: TButton;
bpBrowseHelp: TButton;
AppHelpFile: TEdit;
AppTitle: TEdit;
GroupBox15: TGroupBox;
Label19: TLabel;
AppFileExt: TEdit;
CompilerPage: TTabSheet;
GroupBox5: TGroupBox;
cbShowHints: TCheckBox;
cbShowWarnings: TCheckBox;
GroupBox4: TGroupBox;
cbDebugInfo: TCheckBox;
cbLocalSymbols: TCheckBox;
cbSymbolInfo: TCheckBox;
cbAssertions: TCheckBox;
GroupBox3: TGroupBox;
cbVarStrCheck: TCheckBox;
cbFullBoolEval: TCheckBox;
cbExtSyntax: TCheckBox;
cbTypedPointers: TCheckBox;
cbOpenParameters: TCheckBox;
cbHugeStrings: TCheckBox;
cbAssignConst: TCheckBox;
GroupBox2: TGroupBox;
cbRangeCheck: TCheckBox;
cbInOutCheck: TCheckBox;
cbOverflowCheck: TCheckBox;
GroupBox1: TGroupBox;
cbOptimization: TCheckBox;
cbRecordAlign: TCheckBox;
cbStackFrames: TCheckBox;
cbPentiumSafe: TCheckBox;
LinkerPage: TTabSheet;
GroupBox9: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label13: TLabel;
ecStackSize: TEdit;
ecImageBase: TEdit;
ecMaxStackSize: TEdit;
GroupBox8: TGroupBox;
cbExtDebug: TCheckBox;
cbConsoleApp: TCheckBox;
GroupBox7: TGroupBox;
rbGenerateBPUs: TRadioButton;
rbGenerateObjs: TRadioButton;
GroupBox6: TGroupBox;
rbMapFileOff: TRadioButton;
rbMapSegOnly: TRadioButton;
rbMapSegPubs: TRadioButton;
rbMapDetailed: TRadioButton;
GroupBox14: TGroupBox;
Label14: TLabel;
ecExeDescription: TEdit;
DirCondPage: TTabSheet;
GroupBox11: TGroupBox;
Label8: TLabel;
ddConditionals: TComboBox;
GroupBox10: TGroupBox;
Label3: TLabel;
Label4: TLabel;
Label16: TLabel;
Label15: TLabel;
ddOutputDir: TComboBox;
ddSearchPath: TComboBox;
ddUnitOutput: TComboBox;
ddDebugSourcePath: TComboBox;
GroupBox12: TGroupBox;
Label10: TLabel;
ddUnitAliases: TComboBox;
VersionInfo: TTabSheet;
Label18: TLabel;
PakListSheet: TTabSheet;
Label17: TLabel;
OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cbMainFormChange(Sender: TObject);
procedure OkButtonClick(Sender: TObject);
procedure RemoveAllClick(Sender: TObject);
procedure AddAllClick(Sender: TObject);
procedure AddSelectedClick(Sender: TObject);
procedure RemoveSelectedClick(Sender: TObject);
procedure bpBrowseHelpClick(Sender: TObject);
procedure LoadIconBtnClick(Sender: TObject);
private
{ Private declarations }
procedure GetAutoCreateForms;
public
{ Public declarations }
end;
var
ProjOption: TProjOption;
implementation
uses Uconst;
{$R *.DFM}
procedure TProjOption.FormCreate(Sender: TObject);
begin
PageControl1.ActivePage:= FormsPage;
AppTitle.Text:=Application.Title;
cbMainForm.Items.Assign(ProjectInfo.FormItems);
GetAutoCreateForms;
cbMainForm.Text:=AutoCreateForms.Items[0];
AppTitle.Text:=ProjectInfo.Title;
AppHelpFile.Text:=ProjectInfo.HelpFile;
end;
procedure TProjOption.FormShow(Sender: TObject);
var
I:Integer;
begin
for I:=cbMainForm.Items.Count-1 downto 0 do
if cbMainForm.Items[I]='' then cbMainForm.Items.Delete(I);
for I:=AvailableForms.Items.Count-1 downto 0 do
if AvailableForms.Items[I]='' then AvailableForms.Items.Delete(I);
end;
procedure TProjOption.GetAutoCreateForms;
var
I,J,K: Integer;
Find:Boolean;
begin
for K:=0 to ProjectInfo.ProjectSource.Count-1 do
begin
if Pos('{$R *.RES}',ProjectInfo.ProjectSource[K])>0 then Break;
end;
for J:=0 to ProjectInfo.FormItems.Count-1 do begin
Find:=False;
for I:=K to ProjectInfo.ProjectSource.Count-1 do
begin
if Pos(ProjectInfo.FormItems[J],ProjectInfo.ProjectSource[I])>0 then begin
AutoCreateForms.Items.Add(ProjectInfo.FormItems[J]);
Find:=True;
Break;
end;
end;
if not Find then AvailableForms.Items.Add(ProjectInfo.FormItems[J]);
end;
end;
procedure TProjOption.cbMainFormChange(Sender: TObject);
begin
AutoCreateForms.Items.Insert(0,cbMainForm.Text);
end;
procedure TProjOption.OkButtonClick(Sender: TObject);
begin
ProjectInfo.Title:= AppTitle.Text;
ProjectInfo.HelpFile:= AppHelpFile.Text;
end;
procedure TProjOption.RemoveAllClick(Sender: TObject);
begin
AvailableForms.Items.AddStrings(AutoCreateForms.Items);
AutoCreateForms.Items.Clear;
end;
procedure TProjOption.AddAllClick(Sender: TObject);
begin
AutoCreateForms.Items.AddStrings(AvailableForms.Items);
AvailableForms.Items.Clear;
end;
procedure TProjOption.AddSelectedClick(Sender: TObject);
begin
if AvailableForms.ItemIndex=-1 then Exit;
AutoCreateForms.Items.Add(AvailableForms.Items[AvailableForms.ItemIndex]);
AvailableForms.Items.Delete(AvailableForms.ItemIndex);
end;
procedure TProjOption.RemoveSelectedClick(Sender: TObject);
begin
if AutoCreateForms.ItemIndex=-1 then Exit;
AvailableForms.Items.Add(AutoCreateForms.Items[AutoCreateForms.ItemIndex]);
AutoCreateForms.Items.Delete(AutoCreateForms.ItemIndex);
end;
procedure TProjOption.bpBrowseHelpClick(Sender: TObject);
begin
OpenDialog1.Filter:='档框富 颇老(*.hlp)|*.hlp|葛电 颇老|*.*';
if OpenDialog1.Execute then AppHelpFile.Text:=OpenDialog1.FileName;
end;
procedure TProjOption.LoadIconBtnClick(Sender: TObject);
begin
OpenDialog1.Filter:='酒捞能 颇老(*.ico)|*.ico|葛电 颇老|*.*';
if OpenDialog1.Execute then IconImage.Picture.LoadFromFile(OpenDialog1.FileName);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -