mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
More editor progress
This commit is contained in:
@@ -176,8 +176,8 @@ Boolean HouseFilter (Dialog *dial, EventRecord *event, short *item)
|
||||
default:
|
||||
mouseIs = event->where;
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
if ((PtInRect(mouseIs, &houseEditText1)) ||
|
||||
(PtInRect(mouseIs, &houseEditText2)))
|
||||
if ((houseEditText1.Contains(mouseIs)) ||
|
||||
(houseEditText2.Contains(mouseIs)))
|
||||
{
|
||||
if (houseCursorIs != kBeamCursor)
|
||||
{
|
||||
|
||||
@@ -421,7 +421,7 @@ Boolean MarqueeHasHandles (short *direction, short *dist)
|
||||
|
||||
Boolean PtInMarqueeHandle (Point where)
|
||||
{
|
||||
return (PtInRect(where, &theMarquee.handle));
|
||||
return theMarquee.handle.Contains(where);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawGliderMarquee
|
||||
|
||||
@@ -53,16 +53,16 @@ short FindObjectSelected (Point where)
|
||||
|
||||
found = kNoObjectSelected;
|
||||
|
||||
if (PtInRect(where, &initialGliderRect))
|
||||
if (initialGliderRect.Contains(where))
|
||||
return (kInitialGliderSelected);
|
||||
else if (PtInRect(where, &leftStartGliderDest))
|
||||
else if (leftStartGliderDest.Contains(where))
|
||||
return (kLeftGliderSelected);
|
||||
else if (PtInRect(where, &rightStartGliderDest))
|
||||
else if (rightStartGliderDest.Contains(where))
|
||||
return (kRightGliderSelected);
|
||||
|
||||
for (i = kMaxRoomObs - 1; i >= 0; i--)
|
||||
{
|
||||
if (PtInRect(where, &roomObjectRects[i]))
|
||||
if (roomObjectRects[i].Contains(where))
|
||||
{
|
||||
found = i;
|
||||
break;
|
||||
|
||||
@@ -149,7 +149,7 @@ void DragMiniTile (DrawSurface *surface, Point mouseIs, short *newTileOver)
|
||||
QOffsetRect(&dragRect, mouseIs.h - mouseWas.h, 0);
|
||||
surface->InvertFrameRect(dragRect, pattern);
|
||||
|
||||
if (PtInRect(mouseIs, &tileDest)) // is cursor in the drop rect
|
||||
if (tileDest.Contains(mouseIs)) // is cursor in the drop rect
|
||||
{
|
||||
*newTileOver = (mouseIs.h - tileDest.left) / kMiniTileWide;
|
||||
if (*newTileOver != wasTileOver)
|
||||
@@ -259,7 +259,7 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
|
||||
{
|
||||
short newTileOver;
|
||||
|
||||
if (PtInRect(mouseIs, &tileSrc))
|
||||
if (tileSrc.Contains(mouseIs))
|
||||
{
|
||||
if (cursorIs != kHandCursor)
|
||||
{
|
||||
@@ -323,7 +323,7 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
|
||||
tileOver = -1;
|
||||
}
|
||||
|
||||
if (PtInRect(mouseIs, &editTETextBox))
|
||||
if (editTETextBox.Contains(mouseIs))
|
||||
{
|
||||
if (cursorIs != kBeamCursor)
|
||||
{
|
||||
@@ -384,7 +384,7 @@ Boolean RoomFilter (Dialog *dial, EventRecord *event, short *item)
|
||||
case mouseDown:
|
||||
mouseIs = event->where;
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
if (PtInRect(mouseIs, &tileSrc))
|
||||
if (tileSrc.Contains(mouseIs))
|
||||
{
|
||||
if (StillDown())
|
||||
{
|
||||
@@ -694,22 +694,22 @@ Boolean OriginalArtFilter (Dialog *dial, EventRecord *event, short *item)
|
||||
case mouseDown:
|
||||
mouseIs = event->where;
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
if (PtInRect(mouseIs, &leftBound))
|
||||
if (leftBound.Contains(mouseIs))
|
||||
{
|
||||
*item = 7;
|
||||
return(true);
|
||||
}
|
||||
else if (PtInRect(mouseIs, &topBound))
|
||||
else if (topBound.Contains(mouseIs))
|
||||
{
|
||||
*item = 8;
|
||||
return(true);
|
||||
}
|
||||
else if (PtInRect(mouseIs, &rightBound))
|
||||
else if (rightBound.Contains(mouseIs))
|
||||
{
|
||||
*item = 9;
|
||||
return(true);
|
||||
}
|
||||
else if (PtInRect(mouseIs, &bottomBound))
|
||||
else if (bottomBound.Contains(mouseIs))
|
||||
{
|
||||
*item = 10;
|
||||
return(true);
|
||||
|
||||
@@ -192,7 +192,7 @@ void DrawToolTiles (DrawSurface *surface)
|
||||
void EraseSelectedTool (void)
|
||||
{
|
||||
#ifndef COMPILEDEMO
|
||||
DrawSurface *surface = mainWindow->GetDrawSurface();
|
||||
DrawSurface *surface = toolsWindow->GetDrawSurface();
|
||||
Rect theRect;
|
||||
short toolIcon;
|
||||
|
||||
@@ -269,7 +269,6 @@ void UpdateToolsWindow (void)
|
||||
return;
|
||||
|
||||
DrawSurface *surface = toolsWindow->GetDrawSurface();
|
||||
DrawControls(toolsWindow);
|
||||
|
||||
DkGrayForeColor(surface);
|
||||
surface->DrawLine(Point::Create(4, 25), Point::Create(112, 25));
|
||||
@@ -353,6 +352,8 @@ void OpenToolsWindow (void)
|
||||
}
|
||||
|
||||
UpdateToolsCheckmark(true);
|
||||
|
||||
UpdateToolsWindow();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -460,7 +461,7 @@ void SwitchToolModes (short newMode)
|
||||
void HandleToolsClick (Point wherePt)
|
||||
{
|
||||
#ifndef COMPILEDEMO
|
||||
ControlHandle theControl;
|
||||
PortabilityLayer::Widget *theControl;
|
||||
short i, part, newMode, toolIcon;
|
||||
|
||||
if (toolsWindow == nil)
|
||||
@@ -472,10 +473,10 @@ void HandleToolsClick (Point wherePt)
|
||||
part = FindControl(wherePt, toolsWindow, &theControl);
|
||||
if ((theControl != nil) && (part != 0))
|
||||
{
|
||||
part = TrackControl(theControl, wherePt, (ControlActionUPP)-1L);
|
||||
part = TrackControl(theControl, wherePt, nullptr);
|
||||
if (part != 0)
|
||||
{
|
||||
newMode = GetControlValue(theControl);
|
||||
newMode = theControl->GetState();
|
||||
if (newMode != toolMode)
|
||||
{
|
||||
EraseSelectedTool();
|
||||
@@ -486,7 +487,7 @@ void HandleToolsClick (Point wherePt)
|
||||
else
|
||||
{
|
||||
for (i = 0; i < kTotalTools; i++)
|
||||
if ((PtInRect(wherePt, &toolRects[i])) && (i <= lastTool))
|
||||
if ((toolRects[i].Contains(wherePt)) && (i <= lastTool))
|
||||
{
|
||||
EraseSelectedTool();
|
||||
toolIcon = i;
|
||||
|
||||
Reference in New Issue
Block a user