OSDN Git Service

Revert "連続表示にすると予期せぬ動作を起こすようになりました"
authorjiro <yamat0jp@yahoo.co.jp>
Wed, 11 Mar 2015 13:13:11 +0000 (22:13 +0900)
committerjiro <yamat0jp@yahoo.co.jp>
Wed, 11 Mar 2015 13:13:11 +0000 (22:13 +0900)
This reverts commit 3bd7ebeef6213d7b542d16327af8a99a569116a7.

Unit1.fmx
Unit1.pas

index 7271bd0..36fe960 100644 (file)
--- a/Unit1.fmx
+++ b/Unit1.fmx
@@ -44,6 +44,61 @@ object Form1: TForm1
     TabOrder = 6
     Text = #38283#12367
     OnClick = Button1Click
+  end
+  object Button2: TButton
+    Anchors = [akTop, akRight]
+    Position.X = 496.000000000000000000
+    Position.Y = 432.000000000000000000
+    TabOrder = 9
+    Text = #23455#34892
+    OnClick = Button2Click
+  end
+  object Timer1: TTimer
+    Left = 72
+    Top = 192
+  end
+  object MainMenu1: TMainMenu
+    Left = 152
+    Top = 136
+    object MenuItem1: TMenuItem
+      Text = 'File'
+      object MenuItem2: TMenuItem
+        Locked = True
+        Text = 'Open'
+        OnClick = Button1Click
+      end
+      object MenuItem4: TMenuItem
+        Locked = True
+        Text = '-'
+      end
+      object MenuItem5: TMenuItem
+        Locked = True
+        Text = 'Exit'
+        OnClick = MenuItem5Click
+      end
+    end
+    object MenuItem3: TMenuItem
+      Text = 'Operation'
+      object MenuItem6: TMenuItem
+        Locked = True
+        Text = 'Run'
+        OnClick = Button2Click
+      end
+    end
+    object MenuItem7: TMenuItem
+      Text = 'Setting'
+      object MenuItem8: TMenuItem
+        Locked = True
+        Text = 'Effects'
+        OnClick = MenuItem8Click
+      end
+    end
+  end
+  object OpenDialog1: TOpenDialog
+    Filter = #30011#20687#12501#12449#12452#12523'(*.jpg;*.jpeg;*.bmp;*png)|*.jpg;*.jpeg;*.bmp;*.png'
+    Options = [ofHideReadOnly, ofAllowMultiSelect, ofEnableSizing]
+    Left = 176
+    Top = 264
     object BandedSwirlTransitionEffect1: TBandedSwirlTransitionEffect
       Progress = 0.000000000000000000
       Strength = 1.000000000000000000
@@ -122,68 +177,6 @@ object Form1: TForm1
       RandomSeed = 0.300000011920929000
     end
   end
-  object Button2: TButton
-    Anchors = [akTop, akRight]
-    Position.X = 496.000000000000000000
-    Position.Y = 432.000000000000000000
-    TabOrder = 9
-    Text = #23455#34892
-    OnClick = Button2Click
-  end
-  object Timer1: TTimer
-    Left = 72
-    Top = 192
-  end
-  object MainMenu1: TMainMenu
-    Left = 152
-    Top = 136
-    object MenuItem1: TMenuItem
-      Text = 'File'
-      object MenuItem2: TMenuItem
-        Locked = True
-        Text = 'Open'
-        OnClick = Button1Click
-      end
-      object MenuItem4: TMenuItem
-        Locked = True
-        Text = '-'
-      end
-      object MenuItem5: TMenuItem
-        Locked = True
-        Text = 'Exit'
-        OnClick = MenuItem5Click
-      end
-    end
-    object MenuItem3: TMenuItem
-      Text = 'Operation'
-      object MenuItem6: TMenuItem
-        Locked = True
-        Text = 'Run'
-        OnClick = Button2Click
-      end
-    end
-    object MenuItem7: TMenuItem
-      Text = 'Setting'
-      object MenuItem8: TMenuItem
-        Locked = True
-        Text = 'Effects'
-        OnClick = MenuItem8Click
-      end
-    end
-    object MenuItem9: TMenuItem
-      Text = 'Help'
-      object MenuItem10: TMenuItem
-        Locked = True
-        Text = 'About'
-      end
-    end
-  end
-  object OpenDialog1: TOpenDialog
-    Filter = #30011#20687#12501#12449#12452#12523'(*.jpg;*.jpeg;*.bmp;*png)|*.jpg;*.jpeg;*.bmp;*.png'
-    Options = [ofHideReadOnly, ofAllowMultiSelect, ofEnableSizing]
-    Left = 176
-    Top = 264
-  end
   object FloatAnimation1: TFloatAnimation
     Duration = 5.000000000000000000
     Interpolation = Exponential
@@ -201,11 +194,4 @@ object Form1: TForm1
     Size.PlatformDefault = False
     TabOrder = 22
   end
-  object SpeedButton1: TSpeedButton
-    StaysPressed = True
-    Position.X = 672.000000000000000000
-    Position.Y = 432.000000000000000000
-    Text = #19968#26178#20572#27490
-    OnClick = SpeedButton1Click
-  end
 end
index c9f93ce..2fb3b94 100644 (file)
--- a/Unit1.pas
+++ b/Unit1.pas
@@ -51,9 +51,6 @@ type
     ComboBox1: TComboBox;
     MenuItem7: TMenuItem;
     MenuItem8: TMenuItem;
-    MenuItem9: TMenuItem;
-    MenuItem10: TMenuItem;
-    SpeedButton1: TSpeedButton;
     procedure Button1Click(Sender: TObject);
     procedure Button2Click(Sender: TObject);
     procedure ListView1Change(Sender: TObject);
@@ -61,7 +58,6 @@ type
     procedure FloatAnimation1Finish(Sender: TObject);
     procedure MenuItem5Click(Sender: TObject);
     procedure MenuItem8Click(Sender: TObject);
-    procedure SpeedButton1Click(Sender: TObject);
   private
     progress: Boolean;
     { private \90é\8c¾ }
@@ -88,14 +84,14 @@ begin
     ListView1.Items.Clear;
     for i := 0 to OpenDialog1.Files.Count - 1 do
     begin
-      s := ListView1.Items.Add;
-      s.Text := ExtractFileName(OpenDialog1.Files[i]);
+      s:=ListView1.Items.Add;
+      s.Text:=ExtractFileName(OpenDialog1.Files[i]);
       s.Detail := OpenDialog1.Files[i];
       s.Bitmap.LoadFromFile(OpenDialog1.Files[i]);
     end;
     if ListView1.ItemCount > 0 then
     begin
-      ListView1.ItemIndex := 0;
+      ListView1.ItemIndex:=0;
       Image1.Bitmap.Assign(ListView1.Items[0].Bitmap);
     end;
   end;
@@ -106,25 +102,17 @@ var
   s: TFmxObject;
   i: Integer;
 begin
-  if Sender = Button2 then
-    Randomize;
-  if (ListView1.ItemIndex > -1) and
-    (ListView1.ItemIndex < ListView1.ItemCount - 1) then
+  if (ListView1.ItemIndex > -1)and(ListView1.ItemIndex < ListView1.ItemCount-1) then
   begin
-    if FloatAnimation1.Running = true then
-    begin
-      progress := true;
-      FloatAnimation1.Stop;
-    end;
-    for i := 0 to Button1.ChildrenCount - 1 do
-      if Button1.Children[i].ClassName = ComboBox1.Items[ComboBox1.ItemIndex]
-      then
+    progress:=true;
+    FloatAnimation1.Stop;
+    for i := 0 to OpenDialog1.ChildrenCount - 1 do
+      if OpenDialog1.Children[i].ClassName = ComboBox1.Items[ComboBox1.ItemIndex] then
       begin
-        s := Button1.Children[i];
+        s := OpenDialog1.Children[i];
         s.Parent := Image1;
         FloatAnimation1.Parent := s;
-        SetObjectProp(s, 'target',
-          ListView1.Items[ListView1.ItemIndex + 1].Bitmap);
+        SetObjectProp(s, 'target', ListView1.Items[ListView1.ItemIndex+1].Bitmap);
         FloatAnimation1.Start;
         break;
       end;
@@ -133,34 +121,27 @@ end;
 
 procedure TForm1.FloatAnimation1Finish(Sender: TObject);
 begin
-  FloatAnimation1.Parent.Parent := Button1;
-  if (ListView1.ItemIndex < ListView1.ItemCount - 1) and (progress = false) then
-  begin
-    ComboBox1.ItemIndex := Random(ComboBox1.Items.Count);
-    ListView1.ItemIndex := ListView1.ItemIndex + 1;
-    Image1.Bitmap.Assign(ListView1.Items[ListView1.ItemIndex].Bitmap);
-    Button2Click(Sender);
-  end
-  else
-    progress := false;
+  FloatAnimation1.Parent.Parent := OpenDialog1;
+  if (ListView1.ItemIndex < ListView1.ItemCount-1)and(progress = false) then
+    ListView1.ItemIndex:=ListView1.ItemIndex+1
+    else
+    progress:=false;
+  Image1.Bitmap.Assign(ListView1.Items[ListView1.ItemIndex].Bitmap);
 end;
 
 procedure TForm1.FormCreate(Sender: TObject);
 var
   i: Integer;
 begin
-  for i := 0 to Button1.ChildrenCount - 1 do
-    ComboBox1.Items.Add(Button1.Children[i].ClassName);
+  for i := 0 to OpenDialog1.ChildrenCount - 1 do
+    ComboBox1.Items.Add(OpenDialog1.Children[i].ClassName);
   ComboBox1.ItemIndex := 0;
 end;
 
 procedure TForm1.ListView1Change(Sender: TObject);
 begin
-  if FloatAnimation1.Running = true then
-  begin
-    progress := true;
-    FloatAnimation1.Stop;
-  end;
+  progress:=true;
+  FloatAnimation1.Stop;
   Image1.Bitmap.Assign(ListView1.Items[ListView1.ItemIndex].Bitmap);
 end;
 
@@ -175,9 +156,4 @@ begin
     ComboBox1.Items.Assign(Form2.ListBox2.Items);
 end;
 
-procedure TForm1.SpeedButton1Click(Sender: TObject);
-begin
-  FloatAnimation1.Pause := SpeedButton1.IsPressed;
-end;
-
 end.