Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Oct 9, 2023
1 parent e9489a5 commit d18b36b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Source/colormath/simba.colormath.pas
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ interface
function AsString: String;
end;

TColor = Graphics.TColor;
PColor = ^TColor;

TColorHelper = type helper for TColor
function ToBGRA: TColorBGRA;
function ToRGB: TColorRGB;
Expand Down
11 changes: 11 additions & 0 deletions Source/components/simba.component_menubar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ TSimbaMainMenuBar = class(TCustomControl)
function GetMenus: TPopupMenuArray;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;

property Menus: TPopupMenuArray read GetMenus;
procedure AddMenu(Title: String; APopupMenu: TPopupMenu);
Expand Down Expand Up @@ -235,6 +236,8 @@ procedure TSimbaMainMenuBar.MouseLeave;

procedure TSimbaMainMenuBar.DoMenuClose(Sender: TObject);
begin
if (FTrackTimer = nil) then
Exit;
FTrackTimer.Enabled := False;

Application.QueueAsyncCall(@ClearPopupIndex, 0);
Expand Down Expand Up @@ -286,6 +289,14 @@ constructor TSimbaMainMenuBar.Create(AOwner: TComponent);
CalculateSizes();
end;

destructor TSimbaMainMenuBar.Destroy;
begin
Application.RemoveAsyncCalls(Self);
FTrackTimer := nil;

inherited Destroy();
end;

procedure TSimbaMainMenuBar.AddMenu(Title: String; APopupMenu: TPopupMenu);
var
I: Integer;
Expand Down
10 changes: 4 additions & 6 deletions Source/components/simba.component_statusbar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TSimbaStatusBar = class(TCustomControl)
procedure Paint; override;
procedure PaintPanel(Index: Integer);

procedure InvalidatePanel(Index: Integer);
procedure InvalidatePanelASync(Data: PtrInt);
function PanelRect(Index: Integer): TRect;

procedure CheckIndex(Index: Integer);
Expand Down Expand Up @@ -78,10 +78,9 @@ procedure TSimbaStatusBar.SetPanelText(Index: Integer; Value: String);
begin
if (FPanelText[Index] = Value) then
Exit;

FPanelText[Index] := Value;

InvalidatePanel(Index);
Application.QueueAsyncCall(@InvalidatePanelASync, Index);
end;

procedure TSimbaStatusBar.SetPanelTextMeasure(Index: Integer; Value: String);
Expand Down Expand Up @@ -194,11 +193,11 @@ procedure TSimbaStatusBar.PaintPanel(Index: Integer);
Canvas.TextRect(R, R.Left + 5, R.Top, FPanelText[Index], Style);
end;

procedure TSimbaStatusBar.InvalidatePanel(Index: Integer);
procedure TSimbaStatusBar.InvalidatePanelASync(Data: PtrInt);
var
R: TRect;
begin
R := PanelRect(Index);
R := PanelRect(Data);

InvalidateRect(Handle, @R, False);
end;
Expand Down Expand Up @@ -226,4 +225,3 @@ function TSimbaStatusBar.PanelRect(Index: Integer): TRect;
end;

end.

4 changes: 2 additions & 2 deletions Source/imagebox/simba.imagebox.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
interface

uses
Classes, SysUtils, Forms, Controls, Graphics, ComCtrls, LCLType,
Classes, SysUtils, Forms, Controls, Graphics, GraphType, ComCtrls, LCLType,
simba.mufasatypes, simba.image, simba.dtm, simba.imagebox_image,
simba.colormath;

Expand Down Expand Up @@ -112,7 +112,7 @@ TSimbaImageBox = class(TWinControl)
implementation

uses
Math, GraphType, LCLIntf,
Math, LCLIntf,
simba.finder, simba.image_lazbridge, simba.windowhandle;

procedure TSimbaImageBox_ScrollBox.GetPreferredSize(var PreferredWidth, PreferredHeight: integer; Raw: boolean; WithThemeSpace: boolean);
Expand Down
3 changes: 1 addition & 2 deletions Source/simba.ide_events.pas
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ SimbaIDEEvents = class
class procedure CallOnEditorModified(Sender: TObject);
class procedure CallOnMouseLoggerChange(Sender: TObject);


// Called every 500ms from a script instance while a script is running.
// Called on a seperate thread - synchronize if doing GUI stuff!
// Sender = TSimbaScriptInstance
class procedure CallOnScriptRunning(Sender: TObject);
class procedure RegisterMethodOnScriptRunning(Proc: TNotifyEvent);
class procedure UnRegisterMethodOnScriptRunning(Proc: TNotifyEvent);


class procedure RegisterMethodOnScriptStateChange(Proc: TNotifyEvent);
class procedure RegisterMethodOnScriptTabChange(Proc: TNotifyEvent);
class procedure RegisterOnBeforeTabChange(Proc: TNotifyEvent);
Expand Down

0 comments on commit d18b36b

Please sign in to comment.