Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Feb 13, 2024
1 parent 0649632 commit c694d12
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 112 deletions.
42 changes: 42 additions & 0 deletions Examples/form_imagebox.simba
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Simple form example doing random things.

procedure ImgBoxPaint(Sender: TImageBox; Canvas: TImageBoxCanvas; R: TLazRect);
begin
Canvas.DrawCircle(Sender.MousePoint, 5, Colors.YELLOW);

// if 300,300 is visible in the paint rect
if (300 >= R.Left) and (300 >= R.Top) and (300 <= R.Right) and (300 <= R.Bottom) then
Canvas.DrawBoxFilled([300,300,350,350], Colors.LIME);
end;

procedure ImgBoxMouseMove(Sender: TImageBox; Shift: TLazShiftState; X, Y: Integer);
begin
Sender.Repaint();
end;

var
Form: TLazForm;

procedure ShowMyForm;
var
ImgBox: TImageBox;
begin
Form := TLazForm.Create();
Form.SetCaption('ImageBox example');
Form.SetWidth(700);
Form.SetHeight(500);
Form.SetPosition(poScreenCenter);

ImgBox := TImageBox.Create(Form);
ImgBox.SetParent(Form);
ImgBox.SetAlign(alClient);
ImgBox.SetBackgroundFromTarget(Target);
ImgBox.SetOnImgPaint(@ImgBoxPaint);
ImgBox.SetOnImgMouseMove(@ImgBoxMouseMove);

Form.ShowModal();
end;

begin
RunInMainThread(@ShowMyForm);
end.
5 changes: 3 additions & 2 deletions Source/Simba.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<TextDesc Value=""/>
</XPManifest>
<Icon Value="0"/>
<Resources Count="12">
<Resources Count="13">
<Resource_0 FileName="..\Examples\array.simba" Type="RCDATA" ResourceName="EXAMPLE_ARRAY"/>
<Resource_1 FileName="..\Examples\function.simba" Type="RCDATA" ResourceName="EXAMPLE_FUNCTION"/>
<Resource_2 FileName="..\Examples\loop.simba" Type="RCDATA" ResourceName="EXAMPLE_LOOP"/>
Expand All @@ -30,14 +30,15 @@
<Resource_9 FileName="..\Examples\form.simba" Type="RCDATA" ResourceName="EXAMPLE_FORM"/>
<Resource_10 FileName="..\Examples\irc.simba" Type="RCDATA" ResourceName="EXAMPLE_IRC"/>
<Resource_11 FileName="..\Examples\image_drawtext.simba" Type="RCDATA" ResourceName="EXAMPLE_DRAWTEXT"/>
<Resource_12 FileName="..\Examples\form_imagebox.simba" Type="RCDATA" ResourceName="EXAMPLE_IMAGEBOX"/>
</Resources>
</General>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<Language Value="0809"/>
<CharSet Value="04B0"/>
<StringTable CompanyName="villavu.com" FileDescription="Simba: http://wizzup.org/simba/" OriginalFilename="Simba.exe" ProductName="Simba" ProductVersion="2.0"/>
<StringTable FileDescription="https://github.com/Villavu/Simba" OriginalFilename="Simba.exe" ProductName="Simba" ProductVersion="2.0"/>
</VersionInfo>
<BuildModes Count="7">
<Item1 Name="DEBUG" Default="True"/>
Expand Down
Binary file modified Source/Simba.res
Binary file not shown.
1 change: 1 addition & 0 deletions Source/forms/simba.openexampleform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ procedure TSimbaOpenExampleForm.FormCreate(Sender: TObject);
AddNode('Static Method', 'EXAMPLE_STATIC_METHOD' );
AddNode('JSON', 'EXAMPLE_JSON' );
AddNode('Form', 'EXAMPLE_FORM' );
AddNode('Image Box', 'EXAMPLE_IMAGEBOX' );
AddNode('IRC', 'EXAMPLE_IRC' );
AddNode('Draw Text', 'EXAMPLE_DRAWTEXT' );
end;
Expand Down
4 changes: 2 additions & 2 deletions Source/image/simba.image.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ procedure TSimbaImage._DrawPolygonFilledAlpha(Points: TPointArray; Color: TColor
BGRA := Color.ToBGRA();
BGRA.A := Alpha;

_BuildPolygonFilled(Points, TRect.Create(0, 0, FWidth-1, FHeight-1));
_BuildPolygonFilled(Points, TRect.Create(0, 0, FWidth-1, FHeight-1), TPoint.ZERO);
end;

procedure TSimbaImage._DrawPolygonFilled(Points: TPointArray; Color: TColor);
Expand All @@ -2719,7 +2719,7 @@ procedure TSimbaImage._DrawPolygonFilled(Points: TPointArray; Color: TColor);
BGRA := Color.ToBGRA();
BGRA.A := ALPHA_OPAQUE;

_BuildPolygonFilled(Points, TRect.Create(0, 0, FWidth-1, FHeight-1));
_BuildPolygonFilled(Points, TRect.Create(0, 0, FWidth-1, FHeight-1), TPoint.ZERO);
end;

procedure TSimbaImage._DrawImage(Image: TSimbaImage; P: TPoint);
Expand Down
4 changes: 2 additions & 2 deletions Source/imagebox/simba.imagebox.pas
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ PixelRGBA = record R,G,B,A: Byte; end;

ScreenRect.Left := topLeft.X;
ScreenRect.Top := topLeft.Y;
ScreenRect.Right := ScreenRect.Left + ClientWidth;
ScreenRect.Bottom := ScreenRect.Top + ClientHeight;
ScreenRect.Right := ScreenRect.Left + ClientWidth + FZoomPixels;
ScreenRect.Bottom := ScreenRect.Top + ClientHeight + FZoomPixels;

if (FZoomLevel = 100) then
LocalRect := ScreenRect
Expand Down
11 changes: 6 additions & 5 deletions Source/imagebox/simba.imagebox_canvas.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface
simba.base, simba.image_lazbridge, simba.imagebox_drawers;

type
PSimbaImageBoxCanvas = ^TSimbaImageBoxCanvas;
TSimbaImageBoxCanvas = class
protected
FBitmap: TBitmap;
Expand Down Expand Up @@ -50,8 +51,8 @@ TSimbaImageBoxCanvas = class
procedure DrawPoly(Poly: TPointArray; Connect: Boolean; Color: TColor);
procedure DrawPolyFilled(Poly: TPointArray; Color: TColor);

procedure DrawQuad(Quad: TQuad; Connect: Boolean; Color: TColor);
procedure DrawQuadFilled(Quad: TQuad; Connect: Boolean; Color: TColor);
procedure DrawQuad(Quad: TQuad; Color: TColor);
procedure DrawQuadFilled(Quad: TQuad; Color: TColor);

procedure DrawPoint(Point: TPoint; Color: TColor);
procedure DrawPoints(TPA: TPointArray; Color: TColor);
Expand All @@ -67,7 +68,7 @@ implementation

uses
Math,
simba.colormath, simba.box;
simba.colormath, simba.box, simba.array_point;

function TSimbaImageBoxCanvas.GetDrawInfo(Color: TColor): TDrawInfo;
begin
Expand Down Expand Up @@ -250,15 +251,15 @@ procedure TSimbaImageBoxCanvas.DrawPolyFilled(Poly: TPointArray; Color: TColor);
end;
end;

procedure TSimbaImageBoxCanvas.DrawQuad(Quad: TQuad; Connect: Boolean; Color: TColor);
procedure TSimbaImageBoxCanvas.DrawQuad(Quad: TQuad; Color: TColor);
begin
DrawLine(Quad.Top, Quad.Right, Color);
DrawLine(Quad.Right, Quad.Bottom, Color);
DrawLine(Quad.Bottom, Quad.Left, Color);
DrawLine(Quad.Left, Quad.Top, Color);
end;

procedure TSimbaImageBoxCanvas.DrawQuadFilled(Quad: TQuad; Connect: Boolean; Color: TColor);
procedure TSimbaImageBoxCanvas.DrawQuadFilled(Quad: TQuad; Color: TColor);
begin
DrawPolyFilled([Quad.Top, Quad.Right, Quad.Bottom, Quad.Left], Color);
end;
Expand Down
2 changes: 1 addition & 1 deletion Source/imagebox/simba.imagebox_drawers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ implementation
Color.G := DrawInfo.Color.G;
Color.B := DrawInfo.Color.B;

_BuildPolygonFilled(Poly, TRect.Create(0, 0, DrawInfo.Width-1, DrawInfo.Height-1));
_BuildPolygonFilled(Poly, TRect.Create(0,0,DrawInfo.Width-1, DrawInfo.Height-1), DrawInfo.Offset);
end;

generic procedure DoDrawPoints<_T>(TPA: TPointArray; DrawInfo: TDrawInfo);
Expand Down
208 changes: 111 additions & 97 deletions Source/script/imports/simba.import_imagebox.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,83 +20,8 @@ implementation
type
PComponent = ^TComponent;
PCursor = ^TCursor;
PNotifyEvent = ^TNotifyEvent;
PMouseMoveEvent = ^TMouseMoveEvent;
PMouseEvent = ^TMouseEvent;
PStatusBar = ^TStatusBar;
PStatusPanel = ^TStatusPanel;
PBitmap = ^TBitmap;

//procedure _LapeSimbaImageBoxBitmap_DrawLineGap(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawLineGap(PPoint(Params^[1])^, PPoint(Params^[2])^, PInteger(Params^[3])^, PColor(Params^[4])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawLine(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawLine(PPoint(Params^[1])^, PPoint(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawCross(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawCross(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawCrossArray(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawCrossArray(PPointArray(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawCrossHair(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawCrosshair(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawBox(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawBox(PBox(Params^[1])^, PColor(Params^[2])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawBoxFilled(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawBoxFilled(PBox(Params^[1])^, PColor(Params^[2])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawPoly(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawPoly(PPointArray(Params^[1])^, PBoolean(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawPoint(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawPoint(PPoint(Params^[1])^, PColor(Params^[2])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawPoints(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawPoints(PPointArray(Params^[1])^, PColor(Params^[2])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawCircle(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawCircle(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawCircleFilled(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawCircleFilled(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawBoxTransparent(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawBoxTransparent(PBox(Params^[1])^, PColor(Params^[2])^, PSingle(Params^[3])^);
//end;
//
//procedure _LapeSimbaImageBoxBitmap_DrawHeatmap(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
//begin
// PSimbaImageBoxBitmap(Params^[0])^.DrawHeatmap(PSingleMatrix(Params^[1])^);
//end;

procedure _LapeSimbaImageBox_FindDTM(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PPointArray(Result)^ := PSimbaImageBox(Params^[0])^.FindDTM(PDTM(Params^[1])^);
Expand Down Expand Up @@ -292,35 +217,124 @@ procedure _LapeSimbaImageBox_OnImgKeyUp_Write(const Params: PParamArray); LAPE_W
PSimbaImageBox(Params^[0])^.OnImgKeyUp := TImageBoxKeyEvent(Params^[1]^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawLine(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawLine(PPoint(Params^[1])^, PPoint(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawLineGap(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawLineGap(PPoint(Params^[1])^, PPoint(Params^[2])^, PInteger(Params^[3])^, PColor(Params^[4])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawCross(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawCross(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawCrossArray(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawCrossArray(PPointArray(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawBox(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawBox(PBox(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawBoxFilled1(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawBoxFilled(PBox(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawBoxFilled2(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawBoxFilled(PBox(Params^[1])^, PColor(Params^[2])^, PSingle(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawCircle(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawCircle(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawCircleFilled(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawCircleFilled(PPoint(Params^[1])^, PInteger(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawPoly(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawPoly(PPointArray(Params^[1])^, PBoolean(Params^[2])^, PColor(Params^[3])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawPolyFilled(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawPolyFilled(PPointArray(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawQuad(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawQuad(PQuad(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawQuadFilled(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawQuadFilled(PQuad(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawPoint(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawPoint(PPoint(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawPoints(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawPoints(PPointArray(Params^[1])^, PColor(Params^[2])^);
end;

procedure _LapeSimbaImageBoxCanvas_DrawHeatmap(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImageBoxCanvas(Params^[0])^.DrawHeatmap(PSingleMatrix(Params^[1])^);
end;

procedure ImportSimbaImageBox(Compiler: TSimbaScript_Compiler);
begin
with Compiler do
begin
addClass('TSimbaImageBoxCanvas');

//addGlobalFunc('procedure TImageBoxImage.DrawLineGap(Start, Stop: TPoint; Gap: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawLineGap);
//addGlobalFunc('procedure TImageBoxImage.DrawLine(Start, Stop: TPoint; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawLine);
//addGlobalFunc('procedure TImageBoxImage.DrawCross(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawCross);
//addGlobalFunc('procedure TImageBoxImage.DrawCrossArray(Centers: TPointArray; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawCrossArray);
//addGlobalFunc('procedure TImageBoxImage.DrawCrossHair(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawCrossHair);
//addGlobalFunc('procedure TImageBoxImage.DrawBox(Box: TBox; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawBox);
//addGlobalFunc('procedure TImageBoxImage.DrawBoxFilled(Box: TBox; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawBoxFilled);
//addGlobalFunc('procedure TImageBoxImage.DrawPoly(Poly: TPointArray; Connect: Boolean; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawPoly);
//addGlobalFunc('procedure TImageBoxImage.DrawPoint(P: TPoint; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawPoint);
//addGlobalFunc('procedure TImageBoxImage.DrawPoints(TPA: TPointArray; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawPoints);
//addGlobalFunc('procedure TImageBoxImage.DrawCircle(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawCircle);
//addGlobalFunc('procedure TImageBoxImage.DrawCircleFilled(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxBitmap_DrawCircleFilled);
//addGlobalFunc('procedure TImageBoxImage.DrawBoxTransparent(Box: TBox; Color: TColor; Transparency: Single);', @_LapeSimbaImageBoxBitmap_DrawBoxTransparent);
//addGlobalFunc('procedure TImageBoxImage.DrawHeatmap(const Mat: TSingleMatrix);', @_LapeSimbaImageBoxBitmap_DrawHeatmap);
addClass('TImageBoxCanvas');

addGlobalFunc('procedure TImageBoxCanvas.DrawLine(Start, Stop: TPoint; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawLine);
addGlobalFunc('procedure TImageBoxCanvas.DrawLineGap(Start, Stop: TPoint; GapSize: Integer; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawLineGap);

addGlobalFunc('procedure TImageBoxCanvas.DrawCross(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawCross);
addGlobalFunc('procedure TImageBoxCanvas.DrawCrossArray(Centers: TPointArray; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawCrossArray);

addGlobalFunc('procedure TImageBoxCanvas.DrawBox(Box: TBox; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawBox);
addGlobalFunc('procedure TImageBoxCanvas.DrawBoxFilled(Box: TBox; Color: TColor); overload;', @_LapeSimbaImageBoxCanvas_DrawBoxFilled1);
addGlobalFunc('procedure TImageBoxCanvas.DrawBoxFilled(Box: TBox; Color: TColor; Transparency: Single); overload;', @_LapeSimbaImageBoxCanvas_DrawBoxFilled2);

addGlobalFunc('procedure TImageBoxCanvas.DrawCircle(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawCircle);
addGlobalFunc('procedure TImageBoxCanvas.DrawCircleFilled(Center: TPoint; Radius: Integer; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawCircleFilled);

addGlobalFunc('procedure TImageBoxCanvas.DrawPoly(Poly: TPointArray; Connect: Boolean; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawPoly);
addGlobalFunc('procedure TImageBoxCanvas.DrawPolyFilled(Poly: TPointArray; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawPolyFilled);

addGlobalFunc('procedure TImageBoxCanvas.DrawQuad(Quad: TQuad; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawQuad);
addGlobalFunc('procedure TImageBoxCanvas.DrawQuadFilled(Quad: TQuad; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawQuadFilled);

addGlobalFunc('procedure TImageBoxCanvas.DrawPoint(Point: TPoint; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawPoint);
addGlobalFunc('procedure TImageBoxCanvas.DrawPoints(TPA: TPointArray; Color: TColor);', @_LapeSimbaImageBoxCanvas_DrawPoints);

addGlobalFunc('procedure TImageBoxCanvas.DrawHeatmap(Mat: TSingleMatrix);', @_LapeSimbaImageBoxCanvas_DrawHeatmap);

addClass('TImageBox', 'TLazCustomControl');

addGlobalType('procedure(Sender: TImageBox; Canvas: TSimbaImageBoxCanvas; R: TLazRect) of object;', 'TImageBoxPaintEvent');
addGlobalType('procedure(Sender: TImageBox) of object;', 'TImageBoxEvent');
addGlobalType('procedure(Sender: TImageBox; X, Y: Integer) of object;', 'TImageBoxClickEvent');
addGlobalType('procedure(Sender: TImageBox; var Key: UInt16; Shift: TLazShiftState) of object;', 'TImageBoxKeyEvent');
addGlobalType('procedure(Sender: TImageBox; Button: TLazMouseButton; Shift: TLazShiftState; X, Y: Integer) of object;', 'TImageBoxMouseEvent');
addGlobalType('procedure(Sender: TImageBox; Shift: TLazShiftState; X, Y: Integer) of object;', 'TImageBoxMouseMoveEvent');
addGlobalType('procedure(Sender: TImageBox; Canvas: TImageBoxCanvas; R: TLazRect) of object', 'TImageBoxPaintEvent', FFI_DEFAULT_ABI);
addGlobalType('procedure(Sender: TImageBox) of object', 'TImageBoxEvent', FFI_DEFAULT_ABI);
addGlobalType('procedure(Sender: TImageBox; X, Y: Integer) of object', 'TImageBoxClickEvent', FFI_DEFAULT_ABI);
addGlobalType('procedure(Sender: TImageBox; var Key: UInt16; Shift: TLazShiftState) of object', 'TImageBoxKeyEvent', FFI_DEFAULT_ABI);
addGlobalType('procedure(Sender: TImageBox; Button: TLazMouseButton; Shift: TLazShiftState; X, Y: Integer) of object', 'TImageBoxMouseEvent', FFI_DEFAULT_ABI);
addGlobalType('procedure(Sender: TImageBox; Shift: TLazShiftState; X, Y: Integer) of object', 'TImageBoxMouseMoveEvent', FFI_DEFAULT_ABI);

addClassVar('TImageBox', 'OnImgPaint', 'TImageBoxPaintEvent', @_LapeSimbaImageBox_OnImgPaint_Read, @_LapeSimbaImageBox_OnImgPaint_Write);
addClassVar('TImageBox', 'OnImgMouseEnter', 'TImageBoxEvent', @_LapeSimbaImageBox_OnImgMouseEnter_Read, @_LapeSimbaImageBox_OnImgMouseEnter_Write);
Expand Down
Loading

0 comments on commit c694d12

Please sign in to comment.