IDE: allowing negative font height

git-svn-id: trunk@15812 -
This commit is contained in:
mattias 2008-07-18 08:08:06 +00:00
parent ec306d185d
commit 194d128c0f
2 changed files with 10 additions and 10 deletions

View File

@ -601,7 +601,6 @@ begin
then then
// class already parsed // class already parsed
exit; exit;
DebugLn(['TPascalParserTool.BuildSubTreeForClass AAA1']);
// avoid endless loop // avoid endless loop
ClassNode.SubDesc:=ClassNode.SubDesc and (not ctnsNeedJITParsing); ClassNode.SubDesc:=ClassNode.SubDesc and (not ctnsNeedJITParsing);
OldPhase:=CurrentPhase; OldPhase:=CurrentPhase;

View File

@ -758,7 +758,6 @@ const
lshJScript lshJScript
); );
function ShowEditorOptionsDialog: TModalResult; function ShowEditorOptionsDialog: TModalResult;
var var
EditorOptionsForm: TEditorOptionsForm; EditorOptionsForm: TEditorOptionsForm;
@ -772,6 +771,13 @@ begin
end; end;
end; end;
procedure RepairEditorFontHeight(var FontHeight: integer);
begin
if ((FontHeight>=0) and (FontHeight<=5))
or ((FontHeight<0) and (FontHeight>=-5)) then
FontHeight:=12;
end;
function CheckGroupItemChecked(CheckGroup: TCheckGroup; function CheckGroupItemChecked(CheckGroup: TCheckGroup;
const Caption: string): Boolean; const Caption: string): Boolean;
begin begin
@ -1570,8 +1576,7 @@ begin
XMLConfig.GetValue('EditorOptions/Display/EditorFont', 'courier'); XMLConfig.GetValue('EditorOptions/Display/EditorFont', 'courier');
fEditorFontHeight := fEditorFontHeight :=
XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight', 12); XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight', 12);
if fEditorFontHeight<=0 then RepairEditorFontHeight(fEditorFontHeight);
fEditorFontHeight:=12;
fExtraCharSpacing := fExtraCharSpacing :=
XMLConfig.GetValue('EditorOptions/Display/ExtraCharSpacing', 0); XMLConfig.GetValue('EditorOptions/Display/ExtraCharSpacing', 0);
fExtraLineSpacing := fExtraLineSpacing :=
@ -2669,8 +2674,7 @@ begin
begin begin
Font.Name := EditorFontComboBox.Text; Font.Name := EditorFontComboBox.Text;
NewHeight := StrToIntDef(EditorFontHeightComboBox.Text, PreviewEdits[1].Font.Height); NewHeight := StrToIntDef(EditorFontHeightComboBox.Text, PreviewEdits[1].Font.Height);
if NewHeight<=0 then RepairEditorFontHeight(NewHeight);
NewHeight:=12;
Font.Height := NewHeight; Font.Height := NewHeight;
Options := Options + [fdApplyButton]; Options := Options + [fdApplyButton];
OnApplyClicked := @FontDialogApplyClicked; OnApplyClicked := @FontDialogApplyClicked;
@ -2727,10 +2731,7 @@ begin
begin begin
NewVal := StrToIntDef(EditorFontHeightComboBox.Text, NewVal := StrToIntDef(EditorFontHeightComboBox.Text,
PreviewEdits[1].Font.Height); PreviewEdits[1].Font.Height);
if (NewVal <= 6) then RepairEditorFontHeight(NewVal);
NewVal := 6;
if (NewVal > 40) then
NewVal := 40;
SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal)); SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal));
for a := Low(PreviewEdits) to High(PreviewEdits) do for a := Low(PreviewEdits) to High(PreviewEdits) do
if PreviewEdits[a] <> Nil then if PreviewEdits[a] <> Nil then