From bbc0013e545404f5440447a8b1e9d87bcf0d3ffd Mon Sep 17 00:00:00 2001 From: jiro Date: Wed, 11 Mar 2015 20:08:40 +0900 Subject: [PATCH] =?utf8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE=E4=BF=AE?= =?utf8?q?=E5=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Unit1.fmx | 11 +++++++++-- Unit1.pas | 22 +++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Unit1.fmx b/Unit1.fmx index fa04665..36fe960 100644 --- a/Unit1.fmx +++ b/Unit1.fmx @@ -13,6 +13,7 @@ object Form1: TForm1 MultiResBitmap = < item end> + Anchors = [akTop, akRight] Position.X = 280.000000000000000000 Position.Y = 40.000000000000000000 Size.Width = 481.000000000000000000 @@ -25,9 +26,10 @@ object Form1: TForm1 ItemEditAppearanceClassName = 'TImageListItemRightButtonDeleteAppearance' HeaderAppearanceClassName = 'TListHeaderObjects' FooterAppearanceClassName = 'TListHeaderObjects' - Position.X = 24.000000000000000000 + Align = Scale + Position.X = 28.000000000000000000 Position.Y = 40.000000000000000000 - Size.Width = 209.000000000000000000 + Size.Width = 200.000000000000000000 Size.Height = 345.000000000000000000 Size.PlatformDefault = False TabOrder = 5 @@ -36,11 +38,15 @@ object Form1: TForm1 object Button1: TButton Position.X = 88.000000000000000000 Position.Y = 432.000000000000000000 + Size.Width = 80.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False TabOrder = 6 Text = #38283#12367 OnClick = Button1Click end object Button2: TButton + Anchors = [akTop, akRight] Position.X = 496.000000000000000000 Position.Y = 432.000000000000000000 TabOrder = 9 @@ -180,6 +186,7 @@ object Form1: TForm1 StopValue = 100.000000000000000000 end object ComboBox1: TComboBox + Anchors = [akTop, akRight] Position.X = 464.000000000000000000 Position.Y = 480.000000000000000000 Size.Width = 148.000000000000000000 diff --git a/Unit1.pas b/Unit1.pas index ba1158e..2fb3b94 100644 --- a/Unit1.pas +++ b/Unit1.pas @@ -59,6 +59,7 @@ type procedure MenuItem5Click(Sender: TObject); procedure MenuItem8Click(Sender: TObject); private + progress: Boolean; { private éŒ¾ } public { public éŒ¾ } @@ -89,7 +90,10 @@ begin s.Bitmap.LoadFromFile(OpenDialog1.Files[i]); end; if ListView1.ItemCount > 0 then + begin ListView1.ItemIndex:=0; + Image1.Bitmap.Assign(ListView1.Items[0].Bitmap); + end; end; end; @@ -100,21 +104,28 @@ var begin if (ListView1.ItemIndex > -1)and(ListView1.ItemIndex < ListView1.ItemCount-1) then begin + progress:=true; FloatAnimation1.Stop; for i := 0 to OpenDialog1.ChildrenCount - 1 do if OpenDialog1.Children[i].ClassName = ComboBox1.Items[ComboBox1.ItemIndex] then + begin s := OpenDialog1.Children[i]; - s.Parent := Image1; - FloatAnimation1.Parent := s; - SetObjectProp(s, 'target', ListView1.Items[ListView1.ItemIndex+1].Bitmap); - FloatAnimation1.Start; + s.Parent := Image1; + FloatAnimation1.Parent := s; + SetObjectProp(s, 'target', ListView1.Items[ListView1.ItemIndex+1].Bitmap); + FloatAnimation1.Start; + break; + end; end; end; procedure TForm1.FloatAnimation1Finish(Sender: TObject); begin FloatAnimation1.Parent.Parent := OpenDialog1; - ListView1.ItemIndex:=ListView1.ItemIndex+1; + 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; @@ -129,6 +140,7 @@ end; procedure TForm1.ListView1Change(Sender: TObject); begin + progress:=true; FloatAnimation1.Stop; Image1.Bitmap.Assign(ListView1.Items[ListView1.ItemIndex].Bitmap); end; -- 2.11.0