|
@@ -124,15 +124,13 @@ var
|
|
begin
|
|
begin
|
|
SetDrMd(rp, JAM1);
|
|
SetDrMd(rp, JAM1);
|
|
SetAPen(rp, 0);
|
|
SetAPen(rp, 0);
|
|
- RectFill(rp, BorderLeft, BorderTop,
|
|
|
|
- BorderRight, BorderBottom);
|
|
|
|
|
|
+ RectFill(rp, BorderLeft, BorderTop, BorderRight, BorderBottom);
|
|
SetDrMd(rp, COMPLEMENT);
|
|
SetDrMd(rp, COMPLEMENT);
|
|
SetAPen(rp, 3);
|
|
SetAPen(rp, 3);
|
|
end;
|
|
end;
|
|
|
|
|
|
begin
|
|
begin
|
|
- dummy := ModifyIDCMP(w, IDCMP_CLOSEWINDOW or IDCMP_MOUSEBUTTONS or
|
|
|
|
-IDCMP_MOUSEMOVE);
|
|
|
|
|
|
+ dummy := ModifyIDCMP(w, IDCMP_CLOSEWINDOW or IDCMP_MOUSEBUTTONS or IDCMP_MOUSEMOVE);
|
|
SetDrMd(rp, COMPLEMENT);
|
|
SetDrMd(rp, COMPLEMENT);
|
|
PointCount := 0;
|
|
PointCount := 0;
|
|
Leave := False;
|
|
Leave := False;
|
|
@@ -149,25 +147,25 @@ IDCMP_MOUSEMOVE);
|
|
case StoreMsg.IClass of
|
|
case StoreMsg.IClass of
|
|
IDCMP_MOUSEMOVE : if PointCount > 0 then begin
|
|
IDCMP_MOUSEMOVE : if PointCount > 0 then begin
|
|
if not OutOfBounds then
|
|
if not OutOfBounds then
|
|
- DrawLine;
|
|
|
|
|
|
+ DrawLine;
|
|
LastX := StoreMsg.MouseX;
|
|
LastX := StoreMsg.MouseX;
|
|
LastY := StoreMsg.MouseY;
|
|
LastY := StoreMsg.MouseY;
|
|
if (LastX > BorderLeft) and
|
|
if (LastX > BorderLeft) and
|
|
- (LastX < BorderRight) and
|
|
|
|
- (LastY > BorderTop) and
|
|
|
|
- (LastY < BorderBottom) then begin
|
|
|
|
- DrawLine;
|
|
|
|
- OutOfBounds := False;
|
|
|
|
|
|
+ (LastX < BorderRight) and
|
|
|
|
+ (LastY > BorderTop) and
|
|
|
|
+ (LastY < BorderBottom) then begin
|
|
|
|
+ DrawLine;
|
|
|
|
+ OutOfBounds := False;
|
|
end else
|
|
end else
|
|
- OutOfBounds := True;
|
|
|
|
|
|
+ OutOfBounds := True;
|
|
end;
|
|
end;
|
|
IDCMP_MOUSEBUTTONS : if StoreMsg.Code = SELECTUP then begin
|
|
IDCMP_MOUSEBUTTONS : if StoreMsg.Code = SELECTUP then begin
|
|
if PointCount > 0 then
|
|
if PointCount > 0 then
|
|
- Leave := CheckForExit
|
|
|
|
|
|
+ Leave := CheckForExit
|
|
else
|
|
else
|
|
ClearIt;
|
|
ClearIt;
|
|
if (not Leave) and (not OutOfBounds) then
|
|
if (not Leave) and (not OutOfBounds) then
|
|
- AddPoint;
|
|
|
|
|
|
+ AddPoint;
|
|
end;
|
|
end;
|
|
IDCMP_CLOSEWINDOW : CleanUpAndDie;
|
|
IDCMP_CLOSEWINDOW : CleanUpAndDie;
|
|
end;
|
|
end;
|
|
@@ -222,7 +220,7 @@ end;
|
|
begin
|
|
begin
|
|
|
|
|
|
s := OpenScreenTags(nil,[
|
|
s := OpenScreenTags(nil,[
|
|
- AsTag(SA_Pens), AsTag(@pens),
|
|
|
|
|
|
+ AsTag(SA_Pens), AsTag(@pens),
|
|
AsTag(SA_Depth), 2,
|
|
AsTag(SA_Depth), 2,
|
|
AsTag(SA_DisplayID), HIRES_KEY,
|
|
AsTag(SA_DisplayID), HIRES_KEY,
|
|
AsTag(SA_Title), AsTag('Simple Bezier Curves'),
|
|
AsTag(SA_Title), AsTag('Simple Bezier Curves'),
|
|
@@ -230,23 +228,23 @@ begin
|
|
|
|
|
|
if s = NIL then CleanUpAndDie;
|
|
if s = NIL then CleanUpAndDie;
|
|
|
|
|
|
- w := OpenWindowTags(nil,[
|
|
|
|
|
|
+ w := OpenWindowTags(nil,[
|
|
WA_IDCMP, IDCMP_CLOSEWINDOW,
|
|
WA_IDCMP, IDCMP_CLOSEWINDOW,
|
|
WA_Left, 0,
|
|
WA_Left, 0,
|
|
WA_Top, s^.BarHeight +1,
|
|
WA_Top, s^.BarHeight +1,
|
|
WA_Width, s^.Width,
|
|
WA_Width, s^.Width,
|
|
WA_Height, s^.Height - (s^.BarHeight + 1),
|
|
WA_Height, s^.Height - (s^.BarHeight + 1),
|
|
- WA_DepthGadget, ltrue,
|
|
|
|
- WA_DragBar, ltrue,
|
|
|
|
- WA_CloseGadget, ltrue,
|
|
|
|
- WA_ReportMouse, ltrue,
|
|
|
|
- WA_SmartRefresh, ltrue,
|
|
|
|
- WA_Activate, ltrue,
|
|
|
|
|
|
+ WA_DepthGadget, AsTag(True),
|
|
|
|
+ WA_DragBar, AsTag(True),
|
|
|
|
+ WA_CloseGadget, AsTag(True),
|
|
|
|
+ WA_ReportMouse, AsTag(True),
|
|
|
|
+ WA_SmartRefresh, AsTag(True),
|
|
|
|
+ WA_Activate, AsTag(True),
|
|
WA_Title, AsTag('Close the Window to Quit'),
|
|
WA_Title, AsTag('Close the Window to Quit'),
|
|
WA_CustomScreen, AsTag(s),
|
|
WA_CustomScreen, AsTag(s),
|
|
TAG_END]);
|
|
TAG_END]);
|
|
|
|
|
|
- IF w=NIL THEN CleanUpAndDie;
|
|
|
|
|
|
+ IF w = NIL THEN CleanUpAndDie;
|
|
|
|
|
|
rp := w^.RPort;
|
|
rp := w^.RPort;
|
|
GfxMove(rp, 252, 30);
|
|
GfxMove(rp, 252, 30);
|