?? uprooption.pas
字號(hào):
unit UProOption;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, Buttons, ExtCtrls, checklst, Menus, Grids, Mask;
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;
GroupBox16: TGroupBox;
DesignPackageList: TCheckListBox;
Panel3: TPanel;
LabelPackageFile: TLabel;
AddButton: TButton;
RemoveButton: TButton;
EditButton: TButton;
ButtonComponents: TButton;
GroupBox17: TGroupBox;
EditPackages: TEdit;
ModifyRuntimeButton: TButton;
RuntimePackages: TCheckBox;
PackageNameDialog: TOpenDialog;
Panel4: TPanel;
ModVerGroup: TGroupBox;
Label5: TLabel;
Label9: TLabel;
Label20: TLabel;
Label21: TLabel;
MVN1: TMaskEdit;
MVN2: TMaskEdit;
MVN3: TMaskEdit;
MVN4: TMaskEdit;
UD4: TUpDown;
UD3: TUpDown;
UD2: TUpDown;
UD1: TUpDown;
cbIncBuildNum: TCheckBox;
ModAttrGroup: TGroupBox;
DebugBuild: TCheckBox;
PreRelease: TCheckBox;
PrivateBuild: TCheckBox;
SpecialBuild: TCheckBox;
DLL: TCheckBox;
ValueGrid: TStringGrid;
LangGroup: TGroupBox;
LangIDLbl: TLabel;
LangLbl: TLabel;
LangID: TComboBox;
cbIncludeVerInfo: TCheckBox;
PopupMenu1: TPopupMenu;
AddKey1: TMenuItem;
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);
procedure HelpButtonClick(Sender: TObject);
procedure AddButtonClick(Sender: TObject);
procedure DesignPackageListClick(Sender: TObject);
private
{ Private declarations }
procedure GetAutoCreateForms;
public
{ Public declarations }
procedure LoadKnownPackages;
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;
if AutoCreateForms.Items.Count > 0 then
cbMainForm.Text:= AutoCreateForms.Items[0];
AppTitle.Text:=ProjectInfo.Title;
AppHelpFile.Text:=ProjectInfo.HelpFile;
end;
procedure TProjOption.FormShow(Sender: TObject);
var
I:Integer;
begin
if PageCOntrol1.PageCount <= 1 then Exit;
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:='Help files(*.hlp)|*.hlp|All files|*.*';
if OpenDialog1.Execute then AppHelpFile.Text:=OpenDialog1.FileName;
end;
procedure TProjOption.LoadIconBtnClick(Sender: TObject);
begin
OpenDialog1.Filter:='Icon files(*.ico)|*.ico|All files|*.*';
if OpenDialog1.Execute then IconImage.Picture.LoadFromFile(OpenDialog1.FileName);
end;
procedure TProjOption.HelpButtonClick(Sender: TObject);
var
KeyWord:string;
begin
KeyWord:= 'Project Options dialog box';
Application.HelpCommand(HELP_KEY,longint(KeyWord));
end;
procedure TProjOption.LoadKnownPackages;
var
PackageList:TStringList;
I:Integer;
PackageName, PackageDescrip:string;
begin
PackageList:= TStringList.Create;
IniFile.ReadSectionValues('KnownPackages',PackageList);
DesignPackageList.Clear;
for I:=0 to PackageList.Count - 1 do begin
PackageName:= PackageList.Names[I];
PackageDescrip:= PackageList.Values[PackageName];
if PackageDescrip <> 'None' then DesignPackageList.Items.Add(PackageDescrip)
else DesignPackageList.Items.Add(PackageName);
end;
end;
procedure TProjOption.AddButtonClick(Sender: TObject);
var
PackageName:string;
begin
if PackageNameDialog.Execute then begin
PackageName:= PackageNameDialog.FileName;
DesignPackageList.Items.Add(PackageName);
IniFile.WriteString('KnownPackages', PackageName, 'None');
end;
end;
procedure TProjOption.DesignPackageListClick(Sender: TObject);
begin
//LabelPackageFile.Caption:=
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -