mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-09 14:58:25 +02:00
Debugger: Disassembler: follow font settings of EditorOpts. issue #0020039 / requires rev 32046 #8bf8857a40
git-svn-id: trunk@32047 -
This commit is contained in:
parent
8bf8857a40
commit
c325a7e547
@ -126,6 +126,7 @@ type
|
|||||||
procedure SetTopLine(ALine: Integer);
|
procedure SetTopLine(ALine: Integer);
|
||||||
function IndexOfAddr(const AAddr: TDBGPtr): Integer;
|
function IndexOfAddr(const AAddr: TDBGPtr): Integer;
|
||||||
procedure UpdateLocation(const AAddr: TDBGPtr);
|
procedure UpdateLocation(const AAddr: TDBGPtr);
|
||||||
|
procedure DoEditorOptsChanged(Sender: TObject; Restore: boolean);
|
||||||
protected
|
protected
|
||||||
function GetSourceCodeLine(SrcFileName: string; SrcLineNumber: Integer): string;
|
function GetSourceCodeLine(SrcFileName: string; SrcLineNumber: Integer): string;
|
||||||
procedure InitializeWnd; override;
|
procedure InitializeWnd; override;
|
||||||
@ -215,6 +216,7 @@ begin
|
|||||||
|
|
||||||
Caption := lisDisAssAssembler;
|
Caption := lisDisAssAssembler;
|
||||||
|
|
||||||
|
EditorOpts.AddHandlerAfterWrite(@DoEditorOptsChanged);
|
||||||
pbAsm.Font.Height := EditorOpts.EditorFontHeight;
|
pbAsm.Font.Height := EditorOpts.EditorFontHeight;
|
||||||
pbAsm.Font.Name := EditorOpts.EditorFont;
|
pbAsm.Font.Name := EditorOpts.EditorFont;
|
||||||
Caption := lisMenuViewAssembler;
|
Caption := lisMenuViewAssembler;
|
||||||
@ -254,6 +256,7 @@ end;
|
|||||||
|
|
||||||
destructor TAssemblerDlg.Destroy;
|
destructor TAssemblerDlg.Destroy;
|
||||||
begin
|
begin
|
||||||
|
EditorOpts.RemoveHandlerAfterWrite(@DoEditorOptsChanged);
|
||||||
SetDisassembler(nil);
|
SetDisassembler(nil);
|
||||||
SetDebugger(nil);
|
SetDebugger(nil);
|
||||||
FDisassemblerNotification.OnChange := nil;
|
FDisassemblerNotification.OnChange := nil;
|
||||||
@ -421,17 +424,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAssemblerDlg.InitializeWnd;
|
procedure TAssemblerDlg.InitializeWnd;
|
||||||
var
|
|
||||||
TM: TTextMetric;
|
|
||||||
begin
|
begin
|
||||||
inherited InitializeWnd;
|
inherited InitializeWnd;
|
||||||
|
DoEditorOptsChanged(nil, False);
|
||||||
GetTextMetrics(pbAsm.Canvas.Handle, TM);
|
|
||||||
FCharWidth := EditorOpts.ExtraCharSpacing + TM.tmMaxCharWidth;
|
|
||||||
sbHorizontal.SmallChange := FCHarWidth;
|
|
||||||
|
|
||||||
FLineHeight := EditorOpts.ExtraLineSpacing + TM.tmHeight;
|
|
||||||
SetLineCount(pbAsm.Height div FLineHeight);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAssemblerDlg.pbAsmMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure TAssemblerDlg.pbAsmMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
@ -680,6 +675,25 @@ begin
|
|||||||
UpdateView;
|
UpdateView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAssemblerDlg.DoEditorOptsChanged(Sender: TObject; Restore: boolean);
|
||||||
|
var
|
||||||
|
TM: TTextMetric;
|
||||||
|
begin
|
||||||
|
pbAsm.Font.Height := EditorOpts.EditorFontHeight;
|
||||||
|
pbAsm.Font.Name := EditorOpts.EditorFont;
|
||||||
|
if EditorOpts.DisableAntialiasing then
|
||||||
|
pbAsm.Font.Quality := fqNonAntialiased
|
||||||
|
else
|
||||||
|
pbAsm.Font.Quality := fqDefault;
|
||||||
|
|
||||||
|
GetTextMetrics(pbAsm.Canvas.Handle, TM);
|
||||||
|
FCharWidth := TM.tmMaxCharWidth; // EditorOpts.ExtraCharSpacing +
|
||||||
|
sbHorizontal.SmallChange := FCHarWidth;
|
||||||
|
|
||||||
|
FLineHeight := EditorOpts.ExtraLineSpacing + TM.tmHeight;
|
||||||
|
SetLineCount(pbAsm.Height div FLineHeight);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TAssemblerDlg.SetLocation(ADebugger: TDebugger; const AAddr: TDBGPtr);
|
procedure TAssemblerDlg.SetLocation(ADebugger: TDebugger; const AAddr: TDBGPtr);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user