Jelajahi Sumber

rain quantity is more reactive

Lulu 2 tahun lalu
induk
melakukan
22dc7a405c

+ 28 - 27
lazpaint/dialog/filter/uformrain.lfm

@@ -20,20 +20,20 @@ object FRain: TFRain
   OnHide = FormHide
   OnShow = FormShow
   Position = poMainFormCenter
-  LCLVersion = '1.6.0.4'
+  LCLVersion = '2.2.4.0'
   object Label_Wind: TLabel
     Left = 8
-    Height = 20
+    Height = 15
     Top = 8
-    Width = 124
+    Width = 130
     Caption = 'Wind :'
     ParentColor = False
   end
   object PaintBox_Wind: TPaintBox
     Left = 8
     Height = 105
-    Top = 36
-    Width = 124
+    Top = 31
+    Width = 130
     OnMouseDown = PaintBox_WindMouseDown
     OnMouseMove = PaintBox_WindMouseMove
     OnMouseUp = PaintBox_WindMouseUp
@@ -41,29 +41,30 @@ object FRain: TFRain
   end
   object Label_Quantity: TLabel
     Left = 8
-    Height = 20
-    Top = 149
-    Width = 124
+    Height = 15
+    Top = 144
+    Width = 130
     Caption = 'Quantity:'
     ParentColor = False
   end
   object Panel2: TPanel
     Left = 8
     Height = 25
-    Top = 177
-    Width = 124
+    Top = 167
+    Width = 130
     BevelOuter = bvNone
     ClientHeight = 25
-    ClientWidth = 124
+    ClientWidth = 130
     TabOrder = 1
     object TrackBar_Quantity: TTrackBar
       Left = 0
       Height = 25
       Top = 0
-      Width = 124
+      Width = 130
       Frequency = 100
       Max = 100
-      PageSize = 200
+      OnChange = TrackBar_QuantityChange
+      PageSize = 10
       Position = 0
       ScalePos = trRight
       Align = alClient
@@ -72,35 +73,35 @@ object FRain: TFRain
   end
   object Panel1: TPanel
     Left = 8
-    Height = 30
-    Top = 210
-    Width = 124
+    Height = 25
+    Top = 200
+    Width = 130
     BevelOuter = bvNone
     ChildSizing.HorizontalSpacing = 8
     ChildSizing.Layout = cclLeftToRightThenTopToBottom
     ChildSizing.ControlsPerLine = 2
-    ClientHeight = 30
-    ClientWidth = 124
+    ClientHeight = 25
+    ClientWidth = 130
     TabOrder = 0
     object Button_OK: TButton
       Left = 0
-      Height = 30
+      Height = 25
       Top = 0
-      Width = 46
+      Width = 51
       AutoSize = True
-      Caption = 'OK'
+      Caption = 'rsOK'
       Default = True
       OnClick = Button_OKClick
       TabOrder = 0
     end
     object Button_Cancel: TButton
-      Left = 54
-      Height = 30
+      Left = 59
+      Height = 25
       Top = 0
-      Width = 70
+      Width = 71
       AutoSize = True
       Cancel = True
-      Caption = 'Cancel'
+      Caption = 'rsCancel'
       ModalResult = 2
       TabOrder = 1
     end
@@ -109,7 +110,7 @@ object FRain: TFRain
     Enabled = False
     Interval = 100
     OnTimer = Timer1Timer
-    left = 96
-    top = 40
+    Left = 96
+    Top = 40
   end
 end

+ 2 - 2
lazpaint/dialog/filter/uformrain.lrj

@@ -2,6 +2,6 @@
 {"hash":362494,"name":"tfrain.caption","sourcebytes":[82,97,105,110],"value":"Rain"},
 {"hash":98584122,"name":"tfrain.label_wind.caption","sourcebytes":[87,105,110,100,32,58],"value":"Wind :"},
 {"hash":140202874,"name":"tfrain.label_quantity.caption","sourcebytes":[81,117,97,110,116,105,116,121,58],"value":"Quantity:"},
-{"hash":1339,"name":"tfrain.button_ok.caption","sourcebytes":[79,75],"value":"OK"},
-{"hash":77089212,"name":"tfrain.button_cancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}
+{"hash":497723,"name":"tfrain.button_ok.caption","sourcebytes":[114,115,79,75],"value":"rsOK"},
+{"hash":127421996,"name":"tfrain.button_cancel.caption","sourcebytes":[114,115,67,97,110,99,101,108],"value":"rsCancel"}
 ]}

+ 11 - 1
lazpaint/dialog/filter/uformrain.pas

@@ -37,6 +37,7 @@ type
       {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
     procedure PaintBox_WindPaint(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
+    procedure TrackBar_QuantityChange(Sender: TObject);
   private
     { private declarations }
     wind: single;
@@ -64,7 +65,7 @@ function ShowRainDlg(AFilterConnector: TObject): TScriptResult;
 
 implementation
 
-uses LCScaleDPI, umac, LazPaintType;
+uses LCScaleDPI, umac, LazPaintType, UResourceStrings;
 
 function ShowRainDlg(AFilterConnector: TObject): TScriptResult;
 var
@@ -128,6 +129,9 @@ begin
   PreviewNeeded;
   Left := FilterConnector.LazPaintInstance.MainFormBounds.Left;
   Timer1.Enabled := true;
+
+  Button_OK.Caption := rsOK;
+  Button_Cancel.Caption := rsCancel;
 end;
 
 procedure TFRain.PaintBox_WindMouseDown(Sender: TObject; Button: TMouseButton;
@@ -189,6 +193,12 @@ begin
   Timer1.Enabled:= true;
 end;
 
+procedure TFRain.TrackBar_QuantityChange(Sender: TObject);
+begin
+  FreeAndNil(FRenderer);
+  PreviewNeeded;
+end;
+
 function TFRain.GetRainRenderer: TRainRenderer;
 begin
   if FRenderer = nil then