Skip to content

Commit

Permalink
Make the application somewhat runnable in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl committed Jul 21, 2024
1 parent 88e1fba commit 438ccb8
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 477 deletions.
22 changes: 17 additions & 5 deletions baseform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,25 @@ implementation
var
ScaleMultiplier, ScaleDivider: integer;

type THackControl = class(TWinControl) end;

procedure CalcPreferredSize(c: TControl; var w: integer; var h: integer);
begin
{ this is the only reason why the project needs to be compiled without -CR
also known as <VerifyObjMethodCallValidity> in LPI XML. }
try
THackControl(c).CalculatePreferredSize(w, h, True);
except
on Exception
do
end;
end;

function ScaleInt(i: integer): integer;
begin
Result:=i*ScaleMultiplier div ScaleDivider;
end;

type THackControl = class(TWinControl) end;

procedure AutoSizeForm(Form: TCustomForm);
var
i, ht, w, h: integer;
Expand All @@ -87,7 +99,7 @@ procedure AutoSizeForm(Form: TCustomForm);
TButtonPanel(C).HandleNeeded;
w:=0;
h:=0;
THackControl(C).CalculatePreferredSize(w, h, True);
CalcPreferredSize(c, w, h);
end
else
h:=Height;
Expand Down Expand Up @@ -174,15 +186,15 @@ procedure TBaseForm.DoScale(C: TControl);
if C.Visible and (C is TCustomLabel) and C.AutoSize and (TLabel(C).Alignment = taLeftJustify) and (C.Anchors*[akLeft, akRight] = [akRight]) then begin
w:=0;
h:=0;
THackControl(C).CalculatePreferredSize(w, h, True);
CalcPreferredSize(C, w, h);
C.Width:=w;
end;
{$ifdef darwin}
// Always use standard button height on OS X for proper theming
if C.Visible and (C is TCustomButton) then begin
w:=0;
h:=0;
THackControl(C).CalculatePreferredSize(w, h, True);
CalcPreferredSize(C, w, h);
C.Height:=h;
end;
// Add extra top spacing for group box
Expand Down
Loading

0 comments on commit 438ccb8

Please sign in to comment.