Skip to content

Commit

Permalink
themed debugimage
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jan 19, 2024
1 parent 2e3efc5 commit 54ed70b
Show file tree
Hide file tree
Showing 7 changed files with 614 additions and 37 deletions.
6 changes: 3 additions & 3 deletions Source/components/simba.component_statusbar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TSimbaStatusBar = class(TCustomControl)
implementation

uses
LCLIntf,
LCLIntf, ATCanvasPrimitives,
simba.theme;

procedure TSimbaStatusBar.CheckIndex(Index: Integer);
Expand Down Expand Up @@ -154,7 +154,7 @@ procedure TSimbaStatusBar.Paint;
begin
if (FPanelCount = 0) then
begin
Canvas.Pen.Color := SimbaTheme.ColorLine;
Canvas.Pen.Color := ColorBlendHalf(SimbaTheme.ColorFrame, SimbaTheme.ColorLine);
Canvas.Brush.Color := SimbaTheme.ColorFrame;
Canvas.Line(0, 0, Width, 0);
Canvas.FillRect(0, 1, Width, Height);
Expand Down Expand Up @@ -182,7 +182,7 @@ procedure TSimbaStatusBar.PaintPanel(Index: Integer);
Style.Layout := tlCenter;

Canvas.Font.Color := SimbaTheme.ColorFont;
Canvas.Pen.Color := SimbaTheme.ColorLine;
Canvas.Pen.Color := ColorBlendHalf(SimbaTheme.ColorFrame, SimbaTheme.ColorLine);
Canvas.Brush.Color := SimbaTheme.ColorFrame;

R := PanelRect(Index);
Expand Down
17 changes: 9 additions & 8 deletions Source/forms/simba.debugimageform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ interface

uses
classes, sysutils, forms, controls,
simba.imagebox;
simba.imagebox, simba.imagebox_new;

type
TSimbaDebugImageForm = class(TForm)
procedure FormCreate(Sender: TObject);
protected
FImageBox: TSimbaImageBox;
FImageBox: TSimbaImageBoxNew;
FMaxWidth, FMaxHeight: Integer;

procedure ImageDoubleClick(Sender: TObject);
procedure DoDoubleClick(Sender: TObject);
public
procedure Close;

procedure SetMaxSize(AWidth, AHeight: Integer);
procedure SetSize(AWidth, AHeight: Integer; AForce: Boolean; AEnsureVisible: Boolean = True);

property ImageBox: TSimbaImageBox read FImageBox;
property ImageBox: TSimbaImageBoxNew read FImageBox;
end;

var
Expand Down Expand Up @@ -56,15 +56,16 @@ procedure TSimbaDebugImageForm.FormCreate(Sender: TObject);
FMaxWidth := 1500;
FMaxHeight := 1000;

FImageBox := TSimbaImageBox.Create(Self);
FImageBox := TSimbaImageBoxNew.Create(Self);
FImageBox.Parent := Self;
FImageBox.Align := alClient;
FImageBox.OnDblClick := @ImageDoubleClick;
FImageBox.OnDblClick := @DoDoubleCLick;
end;

procedure TSimbaDebugImageForm.ImageDoubleClick(Sender: TObject);
procedure TSimbaDebugImageForm.DoDoubleClick(Sender: TObject);
begin
DebugLn([EDebugLn.FOCUS], 'Debug Image Click: (%d, %d)', [ImageBox.MousePoint.X, ImageBox.MousePoint.Y]);
with TSimbaImageBoxNew(Sender).MousePoint do
DebugLn([EDebugLn.FOCUS], 'Debug Image Click: (%d, %d)', [X, Y]);
end;

procedure TSimbaDebugImageForm.SetSize(AWidth, AHeight: Integer; AForce: Boolean; AEnsureVisible: Boolean);
Expand Down
4 changes: 2 additions & 2 deletions Source/forms/simba.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ procedure TSimbaForm.DoResetDocking;
for I := 0 to Screen.CustomFormCount - 1 do
if (Screen.CustomForms[I].HostDockSite is TCustomForm) then
begin
Screen.CustomForms[I].Hide();

if (DockMaster.GetAnchorSite(Screen.CustomForms[I]) <> nil) then
DockMaster.GetAnchorSite(Screen.CustomForms[I]).Visible := False;
DockMaster.ManualFloat(Screen.CustomForms[I]);
if (DockMaster.GetAnchorSite(Screen.CustomForms[I]) <> nil) then
DockMaster.GetAnchorSite(Screen.CustomForms[I]).Header.Visible := True;
Expand Down
Loading

0 comments on commit 54ed70b

Please sign in to comment.