Skip to content

31 XE3 quick videos in 31 days - Oct25 - Adding Actions and Gestures to the FireFlow application

This video shows you how to quickly add actions and gestures to the RAD Studio XE3 FireMonkey 2 FireFlow sample application (an adaption of the Cover Flow 3D animated UI found in iTunes, Mac Finder and other applications).  Four actions (First, Last, Left and Right) are created and connected to four standard gestures (Left, Right, ChevronLeft, ChevronRight).  The actions change the TrackBar value which triggers the already defined TrackBar OnChange Event Handler to animate the UI. The FireFlow sample application first appeared in RAD Studio XE2 using FireMonkey 1.  The video shows how to add the actions and gestures to the Delphi FireFlow version.  Below you will find the actions code to add to the FireFlow Delphi XE3 and C++Builder XE3 versions.

The Delphi code for the four actions is included below:

procedure TFrmMain.FirstActionExecute(Sender: TObject);
begin
  TrackBar1.Value := 0;
end;

procedure TFrmMain.LastActionExecute(Sender: TObject);
begin
  TrackBar1.Value := CoverFlow.ChildrenCount-1;
end;

procedure TFrmMain.LeftActionExecute(Sender: TObject);
begin
  if TrackBar1.Value > 0 then
    TrackBar1.Value := TrackBar1.Value - 1;
end;

procedure TFrmMain.RightActionExecute(Sender: TObject);
begin
  if TrackBar1.Value < CoverFlow.ChildrenCount-1 then
    TrackBar1.Value := TrackBar1.Value + 1;
end;

The existing Delphi TrackBar OnChange event handler is:

procedure TFrmMain.TrackBar1Change(Sender: TObject);
begin
  SetCoverIndex(Round(TrackBar1.Value));
end;

The C++Builder code for the four actions is included below:

void __fastcall TFrmMain::FirstActionExecute(TObject *Sender)
{
  TrackBar1->Value = 0;
}

void __fastcall TFrmMain::LastActionExecute(TObject *Sender)
{
  TrackBar1->Value = Coverflow->ChildrenCount-1;
}
void __fastcall TFrmMain::LeftActionExecute(TObject *Sender)
{
  if (TrackBar1->Value > 0) {
	TrackBar1->Value--;
  }
}

void __fastcall TFrmMain::RightActionExecute(TObject *Sender)
{
  if (TrackBar1->Value < Coverflow->ChildrenCount-1) {
	TrackBar1->Value++;
  }
}

The existing C++Builder TrackBar OnChange event handler is:

void __fastcall TFrmMain::TrackBar1Change(TObject *Sender)
{
  SetCoverIndex(int(TrackBar1->Value));
}

You can find additional information about the new FireMonkey 2 Actions and Gestures support in the following DocWiki articles:

October 25 - Adding Actions and Gestures to the FireMonkey FireFlow application

Download: http://cc.embarcadero.com/item/29096

Watch on YouTube: http://www.youtube.com/watch?v=0GmFgQsrYAA

Duration: 4 minutes and 40 seconds

Size: 36.4mb

Format: MP4

Download the original and modified FireFlow Delphi and C++ projects: http://cc.embarcadero.com/item/29097

For additional product information go to http://www.embarcadero.com/products/rad-studio

{ 2 } Trackbacks

  1. Polished concrete overlay floor | September 27, 2014 at 6:52 am | Permalink

    Polished concrete overlay floor…

    Sip from the Firehose : 31 XE3 quick videos in 31 days - Oct25 - Adding Actions and Gestures to the FireFlow application…

  2. Thin brick pavers pool deck | October 16, 2014 at 10:46 pm | Permalink

    Thin brick pavers pool deck…

    Sip from the Firehose : 31 XE3 quick videos in 31 days - Oct25 - Adding Actions and Gestures to the FireFlow application…

Bad Behavior has blocked 4 access attempts in the last 7 days.

Close