📄 umfcompileroptions.pas
字号:
{ JADD - Just Another DelphiDoc: Documentation from Delphi Source Code
Copyright (C) 2002-2008 Gerold Veith
This file is part of JADD - Just Another DelphiDoc.
DelphiDoc is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
DelphiDoc 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, see <http://www.gnu.org/licenses/>.
}
unit UMFCompilerOptions;
{Contains a page to edit the compiler options to use when parsing source code
files. }
interface
uses Classes, Forms, Controls, StdCtrls, ExtCtrls,
UMainFormFrame,
UJADDState;
type
{A page to edit the compiler options to use when parsing source code files.}
TMFCompilerOptions = class(TMainFormFrame)
ButtonCompilerOptions: TButton;
ComboBoxDelphiVersion: TComboBox;
LabelDelphiVersion: TLabel;
procedure ButtonCompilerOptionsClick(Sender: TObject);
procedure ComboBoxDelphiVersionChange(Sender: TObject);
private
protected
public
//Creates the components and shows the version of Deplhi to emulate.
constructor Create(Parent: TWinControl; State: TJADDState); override;
end;
implementation
{$R *.dfm}
uses UEditDefines;
{Creates the components and shows the version of Deplhi to emulate.
~param Parent the component to show the frame in, preferably a TPanel or a
similar component
~param State the state of the program }
constructor TMFCompilerOptions.Create(Parent: TWinControl; State: TJADDState);
begin
inherited Create(Parent, State); //create the page
//show the selected version of Delphi
ComboBoxDelphiVersion.ItemIndex := GetDelphiVersion(State.Defines.PreDefines);
end;
{Called when the button to edit the compiler options is clicked.
~param Sender the sender of the event, ~[link ButtonCompilerOptions] }
procedure TMFCompilerOptions.ButtonCompilerOptionsClick(Sender: TObject);
var NewIndex :Integer; //new index of the version
begin
EditDefines(State.Defines); //edit the compiler options
if ComboBoxDelphiVersion.ItemIndex <> //not the "not change"-item selected?
ComboBoxDelphiVersion.Items.Count - 1 then
begin
//get the new version of Delphi to emulate
NewIndex := GetDelphiVersion(State.Defines.PreDefines);
if NewIndex = -1 then //it is Kylix?
NewIndex := ComboBoxDelphiVersion.Items.Count - 1; //use "no change"-item
ComboBoxDelphiVersion.ItemIndex := NewIndex; //update the version
end;
end;
{Called when another version of Delphi is selected.
~param Sender the sender of the event, ~[link ComboBoxDelphiVersion] }
procedure TMFCompilerOptions.ComboBoxDelphiVersionChange(Sender: TObject);
begin
//set the compiler symbols of the version
SetDelphiVersion(ComboBoxDelphiVersion.ItemIndex, State.Defines.PreDefines);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -