浏览代码

#335 more consistent hints, restart timer, validated poly point count

circular17 3 年之前
父节点
当前提交
ba697c792a

+ 9 - 1
lazpaint/lazpaintmainform.pas

@@ -15,7 +15,8 @@ uses
 
 
   LazPaintType, UMainFormLayout, UTool, UImage, UImageAction, UZoom,
   LazPaintType, UMainFormLayout, UTool, UImage, UImageAction, UZoom,
   UImageObservation, UConfig, LCScaleDPI, UResourceStrings, UMenu, uscripting,
   UImageObservation, UConfig, LCScaleDPI, UResourceStrings, UMenu, uscripting,
-  ubrowseimages, UToolPolygon, UToolVectorial, LCVectorRectShapes,
+  ubrowseimages, UToolPolygon, UToolVectorial, UToolDeformationGrid, UToolSelect,
+  UToolBasic, UToolBrush, LCVectorRectShapes,
   LCVectorialFillControl, LCVectorialFill,
   LCVectorialFillControl, LCVectorialFill,
 
 
   udarktheme, UScriptType;
   udarktheme, UScriptType;
@@ -3668,6 +3669,13 @@ begin
   Config.SetDefaultRetrieveSelectionAnswer(0);
   Config.SetDefaultRetrieveSelectionAnswer(0);
   for m := low(TToolPopupMessage) to high(TToolPopupMessage) do
   for m := low(TToolPopupMessage) to high(TToolPopupMessage) do
     Config.SetToolPopupMessageShownCount(ord(m), 0);
     Config.SetToolPopupMessageShownCount(ord(m), 0);
+  UToolPolygon.TToolPolygon.ForgetHintShown;
+  UToolVectorial.TVectorialTool.ForgetHintShown;
+  UToolDeformationGrid.TToolTextureMapping.ForgetHintShown;
+  UToolDeformationGrid.TToolDeformationGrid.ForgetHintShown;
+  UToolSelect.TToolRotateSelection.ForgetHintShown;
+  UToolBasic.TToolPen.ForgetHintShown;
+  UToolBrush.TToolBrush.ForgetHintShown;
 end;
 end;
 
 
 procedure TFMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 procedure TFMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ar.po

@@ -3616,6 +3616,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr ""
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.bg.po

@@ -3600,6 +3600,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "ЧЗС"
 msgstr "ЧЗС"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Укажете източника с ДЕСЕН цък"
 msgstr "Укажете източника с ДЕСЕН цък"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.cs.po

@@ -3635,6 +3635,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Použijte PRAVÝ klik k určení zdroje"
 msgstr "Použijte PRAVÝ klik k určení zdroje"

+ 5 - 1
lazpaint/release/bin/i18n/lazpaint.de.po

@@ -3445,7 +3445,7 @@ msgstr "Neues Bild"
 
 
 #: uresourcestrings.rsnewmask
 #: uresourcestrings.rsnewmask
 msgid "New mask"
 msgid "New mask"
-msgstr "Neue Maske"                         "
+msgstr "Neue Maske\"                         "
 
 
 #: uresourcestrings.rsno
 #: uresourcestrings.rsno
 msgid "No"
 msgid "No"
@@ -3627,6 +3627,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "RECHTS-Klick um die Quelle zu wählen"
 msgstr "RECHTS-Klick um die Quelle zu wählen"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.es.po

@@ -3639,6 +3639,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr "Usa clic DERECHO para acabar la forma"
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Usa clic DERECHO para definir fuente"
 msgstr "Usa clic DERECHO para definir fuente"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.fi.po

@@ -3608,6 +3608,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr ""
 msgstr ""
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr ""
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.fr.po

@@ -3637,6 +3637,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Utiliser le clic DROIT pour définir la source"
 msgstr "Utiliser le clic DROIT pour définir la source"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.it.po

@@ -3624,6 +3624,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr ""
 msgstr ""
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr ""
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ja.po

@@ -3613,6 +3613,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr ""
 msgstr ""
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr ""
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.kab.po

@@ -3639,6 +3639,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Seqdec asiti ayfus iwakken ad tesbaduḍ aɣbalu"
 msgstr "Seqdec asiti ayfus iwakken ad tesbaduḍ aɣbalu"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.lv.po

@@ -3641,6 +3641,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Ar peles labo pogu norādi avotu"
 msgstr "Ar peles labo pogu norādi avotu"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.nl.po

@@ -3638,6 +3638,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Gebruik RECHTS klikken om de bron te definiëren"
 msgstr "Gebruik RECHTS klikken om de bron te definiëren"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pl.po

@@ -3633,6 +3633,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Użyj prawokliku, aby zdefiniować źródło"
 msgstr "Użyj prawokliku, aby zdefiniować źródło"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pot

@@ -3436,6 +3436,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr ""
 msgstr ""
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr ""
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pt_BR.po

@@ -3628,6 +3628,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Use o botão DIREITO para definir a origem"
 msgstr "Use o botão DIREITO para definir a origem"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ru.po

@@ -3598,6 +3598,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Правый клик для установки источника"
 msgstr "Правый клик для установки источника"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.sv.po

@@ -3619,6 +3619,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "Använd Högerklick för att välja källa"
 msgstr "Använd Högerklick för att välja källa"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.zh_CN.po

@@ -3634,6 +3634,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgid "RGB"
 msgstr "RGB"
 msgstr "RGB"
 
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgid "Use RIGHT click to define source"
 msgstr "单击右键来定义源"
 msgstr "单击右键来定义源"

+ 2 - 12
lazpaint/tools/utool.pas

@@ -165,7 +165,7 @@ type
   TToolClass = class of TGenericTool;
   TToolClass = class of TGenericTool;
 
 
   TToolPopupMessage= (tpmNone, tpmHoldKeyForSquare, tpmHoldKeySnapToPixel,
   TToolPopupMessage= (tpmNone, tpmHoldKeyForSquare, tpmHoldKeySnapToPixel,
-    tpmReturnValides, tpmBackspaceRemoveLastPoint, tpmHoldKeyRestrictRotation,
+    tpmReturnValides, tpmBackspaceRemoveLastPoint, tpmRightClickFinishShape, tpmHoldKeyRestrictRotation,
     tpmHoldKeysScaleMode, tpmCurveModeHint, tpmBlendOpBackground,
     tpmHoldKeysScaleMode, tpmCurveModeHint, tpmBlendOpBackground,
     tpmRightClickForSource, tpmNothingToBeDeformed);
     tpmRightClickForSource, tpmNothingToBeDeformed);
 
 
@@ -199,7 +199,6 @@ type
     FToolCurrentCursorPos: TPointF;
     FToolCurrentCursorPos: TPointF;
     FSleepingTool: TGenericTool;
     FSleepingTool: TGenericTool;
     FSleepingToolType: TPaintToolType;
     FSleepingToolType: TPaintToolType;
-    FReturnValidatesHintShown: boolean;
     FOnToolChangedHandler: TOnToolChangedHandler;
     FOnToolChangedHandler: TOnToolChangedHandler;
     FOnToolRenderChanged: TNotifyEvent;
     FOnToolRenderChanged: TNotifyEvent;
     FOnToolbarChanged: TNotifyEvent;
     FOnToolbarChanged: TNotifyEvent;
@@ -499,7 +498,6 @@ type
     function ToolUpdate: boolean;
     function ToolUpdate: boolean;
     function ToolUpdateNeeded: boolean;
     function ToolUpdateNeeded: boolean;
     procedure ToolPopup(AMessage: TToolPopupMessage; AKey: Word = 0; AAlways: boolean = false);
     procedure ToolPopup(AMessage: TToolPopupMessage; AKey: Word = 0; AAlways: boolean = false);
-    procedure HintReturnValidates;
 
 
     function IsSelectingTool: boolean;
     function IsSelectingTool: boolean;
     function DisplayFilledSelection: boolean;
     function DisplayFilledSelection: boolean;
@@ -759,6 +757,7 @@ begin
   tpmHoldKeySnapToPixel: result := ReplaceKey(rsHoldKeySnapToPixel, AKey);
   tpmHoldKeySnapToPixel: result := ReplaceKey(rsHoldKeySnapToPixel, AKey);
   tpmReturnValides: result := rsReturnValides;
   tpmReturnValides: result := rsReturnValides;
   tpmBackspaceRemoveLastPoint: result := rsBackspaceRemoveLastPoint;
   tpmBackspaceRemoveLastPoint: result := rsBackspaceRemoveLastPoint;
+  tpmRightClickFinishShape: result := rsRightClickFinishShape;
   tpmHoldKeyRestrictRotation: result := ReplaceKey(rsHoldKeyRestrictRotation, AKey);
   tpmHoldKeyRestrictRotation: result := ReplaceKey(rsHoldKeyRestrictRotation, AKey);
   tpmHoldKeysScaleMode: result := ReplaceKey(ReplaceKey(rsHoldKeysScaleMode, AKey, 2), VK_MENU);
   tpmHoldKeysScaleMode: result := ReplaceKey(ReplaceKey(rsHoldKeysScaleMode, AKey, 2), VK_MENU);
   tpmCurveModeHint: result := rsCurveModeHint;
   tpmCurveModeHint: result := rsCurveModeHint;
@@ -790,15 +789,6 @@ begin
     Result:= Manager.Image.SelectionLayerReadonly;
     Result:= Manager.Image.SelectionLayerReadonly;
 end;
 end;
 
 
-procedure TToolManager.HintReturnValidates;
-begin
-  if not FReturnValidatesHintShown then
-  begin
-    ToolPopup(tpmReturnValides);
-    FReturnValidatesHintShown:= true;
-  end;
-end;
-
 { TGenericTool }
 { TGenericTool }
 
 
 {$hints off}
 {$hints off}

+ 9 - 3
lazpaint/tools/utoolbasic.pas

@@ -46,7 +46,7 @@ type
 
 
   TToolPen = class(TGenericTool)
   TToolPen = class(TGenericTool)
   protected
   protected
-    class var HintShowed: boolean;
+    class var HintShown: boolean;
     penDrawing, penDrawingRight: boolean;
     penDrawing, penDrawingRight: boolean;
     shiftClicking, shiftClickingRight: boolean;
     shiftClicking, shiftClickingRight: boolean;
     penOrigin: TPointF;
     penOrigin: TPointF;
@@ -59,6 +59,7 @@ type
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolShiftClick(toolDest: TBGRABitmap; ptF: TPointF; rightBtn: boolean): TRect; virtual;
     function DoToolShiftClick(toolDest: TBGRABitmap; ptF: TPointF; rightBtn: boolean): TRect; virtual;
   public
   public
+    class procedure ForgetHintShown;
     function ToolUp: TRect; override;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
     function GetContextualToolbars: TContextualToolbars; override;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -369,10 +370,10 @@ end;
 
 
 function TToolPen.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect;
 function TToolPen.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect;
 begin
 begin
-  if (manager.PenWidth <= 3) and not HintShowed then
+  if (manager.PenWidth <= 3) and not HintShown then
   begin
   begin
     Manager.ToolPopup(tpmHoldKeySnapToPixel, VK_CONTROL);
     Manager.ToolPopup(tpmHoldKeySnapToPixel, VK_CONTROL);
-    HintShowed:= true;
+    HintShown:= true;
   end;
   end;
   if ssSnap in ShiftState then ptF := PointF(pt.X,pt.Y);
   if ssSnap in ShiftState then ptF := PointF(pt.X,pt.Y);
   result := EmptyRect;
   result := EmptyRect;
@@ -397,6 +398,11 @@ begin
   result := EmptyRect;
   result := EmptyRect;
 end;
 end;
 
 
+class procedure TToolPen.ForgetHintShown;
+begin
+  HintShown:= false;
+end;
+
 function TToolPen.ToolUp: TRect;
 function TToolPen.ToolUp: TRect;
 begin
 begin
   if penDrawing then
   if penDrawing then

+ 12 - 1
lazpaint/tools/utoolbrush.pas

@@ -54,6 +54,7 @@ type
 
 
   TToolClone = class(TToolGenericBrush)
   TToolClone = class(TToolGenericBrush)
   protected
   protected
+    class var RightClickHintShown: boolean;
     definingSource: boolean;
     definingSource: boolean;
     class var sourceLayerId: integer;
     class var sourceLayerId: integer;
     class var sourcePosition: TPoint;
     class var sourcePosition: TPoint;
@@ -67,6 +68,7 @@ type
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolShiftClick({%H-}toolDest: TBGRABitmap; {%H-}ptF: TPointF; {%H-}rightBtn: boolean): TRect; override;
     function DoToolShiftClick({%H-}toolDest: TBGRABitmap; {%H-}ptF: TPointF; {%H-}rightBtn: boolean): TRect; override;
   public
   public
+    class procedure ForgetHintShown;
     function SubPixelAccuracy: boolean; override;
     function SubPixelAccuracy: boolean; override;
     constructor Create(AManager: TToolManager); override;
     constructor Create(AManager: TToolManager); override;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -162,7 +164,11 @@ end;
 function TToolClone.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF
 function TToolClone.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF
   ): TRect;
   ): TRect;
 begin
 begin
-  Manager.ToolPopup(tpmRightClickForSource);
+  if not RightClickHintShown then
+  begin
+    Manager.ToolPopup(tpmRightClickForSource);
+    RightClickHintShown := true;
+  end;
   Result:=inherited DoToolMove(toolDest, pt, ptF);
   Result:=inherited DoToolMove(toolDest, pt, ptF);
 end;
 end;
 
 
@@ -172,6 +178,11 @@ begin
   Result:= EmptyRect;
   Result:= EmptyRect;
 end;
 end;
 
 
+class procedure TToolClone.ForgetHintShown;
+begin
+  RightClickHintShown:= false;
+end;
+
 function TToolClone.SubPixelAccuracy: boolean;
 function TToolClone.SubPixelAccuracy: boolean;
 begin
 begin
   Result:=false;
   Result:=false;

+ 30 - 6
lazpaint/tools/utooldeformationgrid.pas

@@ -20,6 +20,7 @@ type
     function ToolDeformationGridNeeded: boolean;
     function ToolDeformationGridNeeded: boolean;
     procedure ValidateDeformationGrid;
     procedure ValidateDeformationGrid;
   protected
   protected
+    class var ReturnHintShown: boolean;
     deformationGridNbX,deformationGridNbY,deformationGridX,deformationGridY: integer;
     deformationGridNbX,deformationGridNbY,deformationGridX,deformationGridY: integer;
     deformationGridMoving: boolean;
     deformationGridMoving: boolean;
     deformationOrigin: TPointF;
     deformationOrigin: TPointF;
@@ -35,6 +36,7 @@ type
     function GetIsSelectingTool: boolean; override;
     function GetIsSelectingTool: boolean; override;
     function DoToolUpdate({%H-}toolDest: TBGRABitmap): TRect; override;
     function DoToolUpdate({%H-}toolDest: TBGRABitmap): TRect; override;
   public
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
     function GetContextualToolbars: TContextualToolbars; override;
@@ -48,7 +50,7 @@ type
 
 
   TToolTextureMapping = class(TGenericTool)
   TToolTextureMapping = class(TGenericTool)
   private
   private
-    class var FHintShowed: boolean;
+    class var ScaleHintShown, ReturnHintShown: boolean;
     FCurrentBounds: TRect;
     FCurrentBounds: TRect;
     FLastTexture: TBGRABitmap;
     FLastTexture: TBGRABitmap;
     FTextureAfterAlpha: TBGRABitmap;
     FTextureAfterAlpha: TBGRABitmap;
@@ -89,6 +91,7 @@ type
     function GetStatusText: string; override;
     function GetStatusText: string; override;
     function GetAllowedBackFillTypes: TVectorialFillTypes; override;
     function GetAllowedBackFillTypes: TVectorialFillTypes; override;
   public
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
     function GetContextualToolbars: TContextualToolbars; override;
@@ -526,12 +529,11 @@ begin
   end;
   end;
 
 
   result := EmptyRect;
   result := EmptyRect;
-  if not FHintShowed then
+  if not ScaleHintShown then
   begin
   begin
     Manager.ToolPopup(tpmHoldKeysScaleMode, VK_SHIFT);
     Manager.ToolPopup(tpmHoldKeysScaleMode, VK_SHIFT);
-    FHintShowed:= true;
+    ScaleHintShown:= true;
   end;
   end;
-  Manager.HintReturnValidates;
   if quadMoving then
   if quadMoving then
   begin
   begin
     if quadMovingIndex = -1 then
     if quadMovingIndex = -1 then
@@ -724,6 +726,12 @@ begin
   Result:= [vftTexture];
   Result:= [vftTexture];
 end;
 end;
 
 
+class procedure TToolTextureMapping.ForgetHintShown;
+begin
+  ScaleHintShown:= false;
+  ReturnHintShown:= false;
+end;
+
 constructor TToolTextureMapping.Create(AManager: TToolManager);
 constructor TToolTextureMapping.Create(AManager: TToolManager);
 begin
 begin
   inherited Create(AManager);
   inherited Create(AManager);
@@ -783,6 +791,11 @@ begin
     DrawQuad;
     DrawQuad;
     FCanReadaptTexture:= false;
     FCanReadaptTexture:= false;
     result := FCurrentBounds;
     result := FCurrentBounds;
+    if not ReturnHintShown then
+    begin
+      Manager.ToolPopup(tpmreturnValides);
+      ReturnHintShown:= true;
+    end;
     exit;
     exit;
   end;
   end;
   if quadMoving then
   if quadMoving then
@@ -1034,7 +1047,6 @@ var xb,yb,NbX,NbY: integer;
 
 
 begin
 begin
   result := EmptyRect;
   result := EmptyRect;
-  Manager.HintReturnValidates;
 
 
   if not deformationGridMoving then
   if not deformationGridMoving then
   begin
   begin
@@ -1192,6 +1204,11 @@ begin
     result := EmptyRect;
     result := EmptyRect;
 end;
 end;
 
 
+class procedure TToolDeformationGrid.ForgetHintShown;
+begin
+  ReturnHintShown := false;
+end;
+
 constructor TToolDeformationGrid.Create(AManager: TToolManager);
 constructor TToolDeformationGrid.Create(AManager: TToolManager);
 begin
 begin
   inherited Create(AManager);
   inherited Create(AManager);
@@ -1278,7 +1295,14 @@ end;
 function TToolDeformationGrid.ToolUp: TRect;
 function TToolDeformationGrid.ToolUp: TRect;
 begin
 begin
   if deformationGridMoving then
   if deformationGridMoving then
-    result := OnlyRenderChange
+  begin
+    result := OnlyRenderChange;
+    if not ReturnHintShown then
+    begin
+      Manager.ToolPopup(tpmreturnValides);
+      ReturnHintShown := true;
+    end;
+  end
   else
   else
     Result:=EmptyRect;
     Result:=EmptyRect;
   deformationGridMoving := false;
   deformationGridMoving := false;

+ 21 - 0
lazpaint/tools/utoolpolygon.pas

@@ -32,6 +32,8 @@ type
 
 
   TToolPolygon = class(TVectorialTool)
   TToolPolygon = class(TVectorialTool)
   protected
   protected
+    class var RightClickHintShown: boolean;
+    class var RemovePointHintShown: boolean;
     initiallyClosed : boolean;
     initiallyClosed : boolean;
     function ShapeClass: TVectorShapeAny; override;
     function ShapeClass: TVectorShapeAny; override;
     function CreateShape: TVectorShape; override;
     function CreateShape: TVectorShape; override;
@@ -44,6 +46,7 @@ type
     function DoToolKeyDown(var key: Word): TRect; override;
     function DoToolKeyDown(var key: Word): TRect; override;
     function RoundCoordinate(constref ptF: TPointF): TPointF; override;
     function RoundCoordinate(constref ptF: TPointF): TPointF; override;
   public
   public
+    class procedure ForgetHintShown;
     function ToolUp: TRect; override;
     function ToolUp: TRect; override;
     function ToolKeyPress(var key: TUTF8Char): TRect; override;
     function ToolKeyPress(var key: TUTF8Char): TRect; override;
   end;
   end;
@@ -285,6 +288,11 @@ function TToolPolygon.CreateShape: TVectorShape;
 begin
 begin
   result := inherited CreateShape;
   result := inherited CreateShape;
   initiallyClosed := ShouldCloseShape;
   initiallyClosed := ShouldCloseShape;
+  if not RightClickHintShown then
+  begin
+    Manager.ToolPopup(tpmRightClickFinishShape);
+    RightClickHintShown := true;
+  end;
 end;
 end;
 
 
 function TToolPolygon.ShouldCloseShape: boolean;
 function TToolPolygon.ShouldCloseShape: boolean;
@@ -336,7 +344,14 @@ function TToolPolygon.ToolUp: TRect;
 begin
 begin
   Result:=inherited ToolUp;
   Result:=inherited ToolUp;
   if Assigned(FShape) then
   if Assigned(FShape) then
+  begin
     UpdateManagerCloseShape((FShape as TCustomPolypointShape).Closed);
     UpdateManagerCloseShape((FShape as TCustomPolypointShape).Closed);
+    if not RemovePointHintShown and ((FShape as TCustomPolypointShape).ValidatedPointCount >= 3) then
+    begin
+      Manager.ToolPopup(tpmBackspaceRemoveLastPoint);
+      RemovePointHintShown := true;
+    end;
+  end;
 end;
 end;
 
 
 function TToolPolygon.ToolKeyPress(var key: TUTF8Char): TRect;
 function TToolPolygon.ToolKeyPress(var key: TUTF8Char): TRect;
@@ -376,6 +391,12 @@ begin
     result := ptF;
     result := ptF;
 end;
 end;
 
 
+class procedure TToolPolygon.ForgetHintShown;
+begin
+  RemovePointHintShown := false;
+  RemovePointHintShown := false;
+end;
+
 initialization
 initialization
 
 
   RegisterTool(ptRect,TToolRectangle);
   RegisterTool(ptRect,TToolRectangle);

+ 9 - 3
lazpaint/tools/utoolselect.pas

@@ -118,7 +118,7 @@ type
 
 
   TToolRotateSelection = class(TTransformSelectionTool)
   TToolRotateSelection = class(TTransformSelectionTool)
   protected
   protected
-    class var HintShowed: boolean;
+    class var HintShown: boolean;
     FHandRotating, FHandTranslating: boolean;
     FHandRotating, FHandTranslating: boolean;
     FHandOrigin: TPointF;
     FHandOrigin: TPointF;
     FSnapMode: boolean;
     FSnapMode: boolean;
@@ -135,6 +135,7 @@ type
     function GetStatusText: string; override;
     function GetStatusText: string; override;
     procedure UpdateTransform;
     procedure UpdateTransform;
   public
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function ToolUp: TRect; override;
     function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override;
     function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override;
@@ -421,10 +422,10 @@ function TToolRotateSelection.DoToolMove(toolDest: TBGRABitmap; pt: TPoint;
 var angleDiff: single;
 var angleDiff: single;
   finalCenter, newOfs: TPointF;
   finalCenter, newOfs: TPointF;
 begin
 begin
-  if not HintShowed then
+  if not HintShown then
   begin
   begin
     Manager.ToolPopup(tpmHoldKeyRestrictRotation, VK_CONTROL);
     Manager.ToolPopup(tpmHoldKeyRestrictRotation, VK_CONTROL);
-    HintShowed:= true;
+    HintShown:= true;
   end;
   end;
   if FHandRotating and ((FHandOrigin.X <> ptF.X) or (FHandOrigin.Y <> ptF.Y)) then
   if FHandRotating and ((FHandOrigin.X <> ptF.X) or (FHandOrigin.Y <> ptF.Y)) then
   begin
   begin
@@ -480,6 +481,11 @@ begin
                                    FOriginalTransform;
                                    FOriginalTransform;
 end;
 end;
 
 
+class procedure TToolRotateSelection.ForgetHintShown;
+begin
+  HintShown:= false;
+end;
+
 constructor TToolRotateSelection.Create(AManager: TToolManager);
 constructor TToolRotateSelection.Create(AManager: TToolManager);
 begin
 begin
   inherited Create(AManager);
   inherited Create(AManager);

+ 11 - 1
lazpaint/tools/utoolvectorial.pas

@@ -28,6 +28,7 @@ type
     function GetIsHandDrawing: boolean;
     function GetIsHandDrawing: boolean;
     function GetIsIdle: boolean;
     function GetIsIdle: boolean;
   protected
   protected
+    class var SquareHintShown: boolean;
     FLayerWasEmpty: boolean;
     FLayerWasEmpty: boolean;
     FShape: TVectorShape;
     FShape: TVectorShape;
     FTemporaryStorage: TBGRACustomOriginalStorage;
     FTemporaryStorage: TBGRACustomOriginalStorage;
@@ -90,6 +91,7 @@ type
     function GetGridMatrix: TAffineMatrix; virtual;
     function GetGridMatrix: TAffineMatrix; virtual;
     property Editor: TBGRAOriginalEditor read GetEditor;
     property Editor: TBGRAOriginalEditor read GetEditor;
   public
   public
+    class procedure ForgetHintShown;
     function ValidateShape: TRect;
     function ValidateShape: TRect;
     function CancelShape: TRect;
     function CancelShape: TRect;
     constructor Create(AManager: TToolManager); override;
     constructor Create(AManager: TToolManager); override;
@@ -1823,6 +1825,11 @@ begin
   end;
   end;
 end;
 end;
 
 
+class procedure TVectorialTool.ForgetHintShown;
+begin
+  SquareHintShown:= false;
+end;
+
 function TVectorialTool.ValidateShape: TRect;
 function TVectorialTool.ValidateShape: TRect;
 var
 var
   layerId: LongInt;
   layerId: LongInt;
@@ -2136,8 +2143,11 @@ begin
       FShape.OnEditingChange:=@ShapeEditingChange;
       FShape.OnEditingChange:=@ShapeEditingChange;
       FShape.OnRemoveQuery:= @ShapeRemoveQuery;
       FShape.OnRemoveQuery:= @ShapeRemoveQuery;
       result := RectUnion(result, UpdateShape(toolDest));
       result := RectUnion(result, UpdateShape(toolDest));
-      if FShape is TCustomRectShape then
+      if not SquareHintShown and (FShape is TCustomRectShape) then
+      begin
+        SquareHintShown := true;
         Manager.ToolPopup(tpmHoldKeyForSquare, VK_SHIFT);
         Manager.ToolPopup(tpmHoldKeyForSquare, VK_SHIFT);
+      end;
     end;
     end;
   end;
   end;
 end;
 end;

+ 1 - 0
lazpaint/uloading.pas

@@ -127,6 +127,7 @@ begin
     Timer1.Enabled:= false
     Timer1.Enabled:= false
   else
   else
     begin
     begin
+      Timer1.Enabled := false;
       Timer1.Interval := AMillisecond;
       Timer1.Interval := AMillisecond;
       Timer1.Enabled := true;
       Timer1.Enabled := true;
     end;
     end;

+ 1 - 0
lazpaint/uresourcestrings.pas

@@ -87,6 +87,7 @@ resourcestring
   rsHoldKeySnapToPixel = 'Hold %1 to snap to pixels';
   rsHoldKeySnapToPixel = 'Hold %1 to snap to pixels';
   rsReturnValides = 'Press ENTER to validate';
   rsReturnValides = 'Press ENTER to validate';
   rsBackspaceRemoveLastPoint = 'Press BACKSPACE to remove last point';
   rsBackspaceRemoveLastPoint = 'Press BACKSPACE to remove last point';
+  rsRightClickFinishShape = 'Use RIGHT click to finish shape';
   rsHoldKeyRestrictRotation = 'Hold %1 to restrict rotation angle';
   rsHoldKeyRestrictRotation = 'Hold %1 to restrict rotation angle';
   rsHoldKeysScaleMode = 'Hold %1 or %2 to scale';
   rsHoldKeysScaleMode = 'Hold %1 or %2 to scale';
   rsCurveModeHint = 'Press S or X to set the curve mode of the last point';
   rsCurveModeHint = 'Press S or X to set the curve mode of the last point';

+ 10 - 0
lazpaintcontrols/lcvectorpolyshapes.pas

@@ -67,6 +67,7 @@ type
     function GetLineCap: TPenEndCap;
     function GetLineCap: TPenEndCap;
     function GetPoint(AIndex: integer): TPointF;
     function GetPoint(AIndex: integer): TPointF;
     function GetPointCount: integer;
     function GetPointCount: integer;
+    function GetValidatedPointCount: integer;
     procedure SetArrowEndKind(AValue: TArrowKind);
     procedure SetArrowEndKind(AValue: TArrowKind);
     procedure SetArrowSize(AValue: TPointF);
     procedure SetArrowSize(AValue: TPointF);
     procedure SetArrowStartKind(AValue: TArrowKind);
     procedure SetArrowStartKind(AValue: TArrowKind);
@@ -128,6 +129,7 @@ type
     class function DefaultArrowSize: TPointF;
     class function DefaultArrowSize: TPointF;
     property Points[AIndex:integer]: TPointF read GetPoint write SetPoint;
     property Points[AIndex:integer]: TPointF read GetPoint write SetPoint;
     property PointCount: integer read GetPointCount;
     property PointCount: integer read GetPointCount;
+    property ValidatedPointCount: integer read GetValidatedPointCount;
     property Closed: boolean read GetClosed write SetClosed;
     property Closed: boolean read GetClosed write SetClosed;
     property HoverPoint: integer read GetHoverPoint write SetHoverPoint;
     property HoverPoint: integer read GetHoverPoint write SetHoverPoint;
     property HoverCenter: boolean read FHoverCenter write SetHoverCenter;
     property HoverCenter: boolean read FHoverCenter write SetHoverCenter;
@@ -476,6 +478,14 @@ begin
   result:= length(FPoints);
   result:= length(FPoints);
 end;
 end;
 
 
+function TCustomPolypointShape.GetValidatedPointCount: integer;
+begin
+  if (PointCount > 1) and FAddingPoint then
+    result := PointCount - 1
+  else
+    result := PointCount;
+end;
+
 procedure TCustomPolypointShape.SetArrowEndKind(AValue: TArrowKind);
 procedure TCustomPolypointShape.SetArrowEndKind(AValue: TArrowKind);
 begin
 begin
   if FArrowEndKind=AValue then Exit;
   if FArrowEndKind=AValue then Exit;