📄 uoptions.pas
字号:
unit UOptions;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, Buttons, ColorGrd, Menus;
type
TOptions = class(TForm)
Panel1: TPanel;
HelpButton: TButton;
OKButton: TButton;
Button2: TButton;
Panel2: TPanel;
PageControl1: TPageControl;
PrefPage: TTabSheet;
GroupBox1: TGroupBox;
rbDesktopOnly: TRadioButton;
rbSaveSymbols: TRadioButton;
GroupBox2: TGroupBox;
cbASEditor: TCheckBox;
cbASDesktop: TCheckBox;
GroupBox3: TGroupBox;
lbGridX: TLabel;
lbGridY: TLabel;
cbDisplayGrid: TCheckBox;
cbSnapToGrid: TCheckBox;
ecGridSizeX: TEdit;
ecGridSizeY: TEdit;
cbShowComponentCaptions: TCheckBox;
GroupBox4: TGroupBox;
cbIntegratedDebugging: TCheckBox;
cbDebugMainBlock: TCheckBox;
cbBreakOnException: TCheckBox;
GroupBox17: TGroupBox;
lbReposDir: TLabel;
ComplierPath: TEdit;
RepositoryBtn: TButton;
GroupBox12: TGroupBox;
cbShowProgress: TCheckBox;
cbWarnPackageRebuild: TCheckBox;
cbMinimizeOnRun: TCheckBox;
cbHideDesigners: TCheckBox;
LibPage: TTabSheet;
EditorPage: TTabSheet;
lbUndo: TLabel;
Label5: TLabel;
lbBlockInd: TLabel;
Label6: TLabel;
Label21: TLabel;
GroupBox5: TGroupBox;
eoIndent: TCheckBox;
eoInsert: TCheckBox;
eoUseTabChar: TCheckBox;
eoOptimalFill: TCheckBox;
eoOutdent: TCheckBox;
eoCursorInTabs: TCheckBox;
eoGroupUndo: TCheckBox;
eoCursorBeyondEOF: TCheckBox;
eoUndoAfterSave: TCheckBox;
eoKeepTrailingBlanks: TCheckBox;
eoBriefRegExp: TCheckBox;
eoPersistentBlocks: TCheckBox;
eoOverwriteBlocks: TCheckBox;
eoDoubleClickLine: TCheckBox;
eoFindTextAtCursor: TCheckBox;
eoHighlight: TCheckBox;
eoForceCutCopyEnabled: TCheckBox;
eoSmartTab: TCheckBox;
eoBlockIndent: TComboBox;
eoUndoLimit: TComboBox;
eoTabRack: TComboBox;
eoHighlightExts: TComboBox;
SpeedSetting: TComboBox;
EdDispPage: TTabSheet;
Label4: TLabel;
Label7: TLabel;
Label11: TLabel;
Label16: TLabel;
GroupBox11: TGroupBox;
lbRightMargin: TLabel;
lbGutterWidth: TLabel;
eoLineOnMargin: TCheckBox;
eoRightMargin: TComboBox;
eoGutterWidth: TComboBox;
eoVisibleGutter: TCheckBox;
GroupBox10: TGroupBox;
eoBriefCursors: TCheckBox;
eoCreateBackup: TCheckBox;
eoPreserveLineEnds: TCheckBox;
eoFullZoom: TCheckBox;
FontName: TComboBox;
FontSize: TComboBox;
eoBindingList: TListBox;
FontSample: TPanel;
EdColorPage: TTabSheet;
Label8: TLabel;
Label9: TLabel;
EditControlHere: TLabel;
Label22: TLabel;
ElementList: TListBox;
GroupBox6: TGroupBox;
Bold: TCheckBox;
Italic: TCheckBox;
Underline: TCheckBox;
GroupBox7: TGroupBox;
DefaultFore: TCheckBox;
DefaultBack: TCheckBox;
ColorSpeedSetting: TComboBox;
ColorGrid: TColorGrid;
PalPage: TTabSheet;
PageLabel: TLabel;
ToolLabel: TLabel;
PageListBox: TListBox;
AddButton: TButton;
DeleteButton: TButton;
RenameButton: TButton;
ResetPaletteBtn: TButton;
ToolListPanel: TPanel;
ToolListHeader: THeaderControl;
ToolListBox: TListBox;
MoveUp: TButton;
MoveDn: TButton;
BrowPage: TTabSheet;
GroupBox8: TGroupBox;
cbConstants: TCheckBox;
cbTypes: TCheckBox;
cbVariables: TCheckBox;
cbFunctions: TCheckBox;
cbProperties: TCheckBox;
cbInherited: TCheckBox;
cbNonVirtual: TCheckBox;
cbPrivate: TCheckBox;
cbProtected: TCheckBox;
cbPublic: TCheckBox;
cbPublished: TCheckBox;
GroupBox15: TGroupBox;
rbObjects: TRadioButton;
rbUnits: TRadioButton;
rbGlobals: TRadioButton;
GroupBox9: TGroupBox;
cbQualifiedSymbols: TCheckBox;
cbSortAlways: TCheckBox;
GroupBox16: TGroupBox;
Label12: TLabel;
CollapseNodes: TComboBox;
CodeInsight: TTabSheet;
GroupBox14: TGroupBox;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
cbCodeCompletion: TCheckBox;
DelayAmount: TTrackBar;
cbCodeParameters: TCheckBox;
cbEvalHints: TCheckBox;
GroupBox13: TGroupBox;
Label1: TLabel;
CodeLabel: TLabel;
TemplateBevel: TBevel;
CodeList: TListView;
AddTemplateBtn: TButton;
EditTemplateBtn: TButton;
DeleteTemplateBtn: TButton;
EnvDlgPopup: TPopupMenu;
dNextPage: TMenuItem;
dPrevPage: TMenuItem;
CodePopup: TPopupMenu;
AddItem: TMenuItem;
DeleteItem: TMenuItem;
OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure btnOKClick(Sender: TObject);
procedure RepositoryBtnClick(Sender: TObject);
private
{ Private declarations }
procedure GetFontNames;
public
{ Public declarations }
end;
var
Options: TOptions;
implementation
uses Uconst;
{$R *.DFM}
procedure TOptions.FormCreate(Sender: TObject);
begin
PageControl1.ActivePage:= PrefPage;
ComplierPath.Text:=IniFile.ReadString('SYSTEM','COMPLIER','');
// DesktopPath.Text:=IniFile.ReadString('SYSTEM','DESKTOP','');
// FontName.Text:= IniFile.ReadString('DISPLAY','FONTNAME','官帕眉');
// cbFontSize.Text:= IntToStr(IniFile.ReadInteger('DISPLAY','FONTSIZE',10));
// FontDisplay.Font.Name:= IniFile.ReadString('DISPLAY','FONTNAME','官帕眉');
// FontDisplay.Font.Size:= IniFile.ReadInteger('DISPLAY','FONTSIZE',10);
GetFontNames;
end;
procedure TOptions.btnOKClick(Sender: TObject);
begin
with IniFile do begin
WriteString('SYSTEM','COMPLIER',ComplierPath.Text);
// WriteString('SYSTEM','DESKTOP',DesktopPath.Text);
// WriteString('DISPLAY','FONTNAME',FontName.Text);
// WriteInteger('DISPLAY','FONTSIZE',StrToInt(cbFontSize.Text));
end;
end;
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
FontType: Integer; Data: Pointer): Integer; stdcall;
begin
TStrings(Data).Add(LogFont.lfFaceName);
Result := 1;
end;
procedure TOptions.GetFontNames;
var
DC: HDC;
begin
DC := GetDC(0);
EnumFonts(DC, nil, @EnumFontsProc, Pointer(FontName.Items));
ReleaseDC(0, DC);
FontName.Sorted := True;
end;
procedure TOptions.RepositoryBtnClick(Sender: TObject);
begin
if OpenDialog1.Execute then
ComplierPath.Text:=ExtractFilePath(OpenDialog1.FileName);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -