Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Animation - slide in from bottom
Mon, Jul 2 2018 5:06 AMPermanent Link

thomh

Based on this old thread started by Trinione

https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&msg=8614&start=1&keywords=animation&searchbody=True&forum=EWB_Announce&forum=EWB_General&forum=EWB_Components&forum=EWB_Server&forum=EWB_Demos&forum=EWB_Binaries&forum=EWB_Discussion&forum=EWB2_Preview&forum=EWB_Beta#8614

I have code to slide in from the left, right and slide down from top.

But I cannot manage to get slide up from bottom to work.

This works for slide in from top:

procedure SlideInTop(AControl: TControl; AStyle: TAnimationStyle; ADuration: Integer);
var
  TempPosition: TLayoutPosition;
begin
  with AControl do
  begin
     BeginUpdate;
     try
        Visible := False;
        TempPosition := Layout.Position; // Save the current layout position
        DefineLayout; // Peg the defined dimensions of the control based upon the current layout
        Layout.Position := lpNone;
        Animations.Top.Style := asNone;
        Animations.Visible.Style := asNone;
        Animations.Left.Style := asNone;
        Top := -Parent.ClientHeight;
     finally
        EndUpdate; // Render
     end;

     BeginUpdate;
     try
        Visible := True;
        Animations.Top.Style := AStyle;
        Animations.Top.Duration := ADuration;
        Layout.Position := TempPosition; // Set the layout to the saved layout
     finally
        EndUpdate; // Render (with animation)
     end;
  end;
end;

I tried setting Top := 0 but that did not work.

Can somebody point me in the right direction?

Thanks.

// Thom
Mon, Jul 2 2018 5:45 AMPermanent Link

Matthew Jones

thomh wrote:

> Can somebody point me in the right direction?

Ho ho. But have you tried setting Top to +Parent.ClientHeight (instead of negative)? The key being that you want it to end up at zero, and the negative one starts it above, so you need to start it below.

--

Matthew Jones
Tue, Jul 3 2018 1:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thom,

Just FYI, there's a TControl method that does the sliding work for you:

https://www.elevatesoft.com/manual?action=viewmethod&id=ewb2&comp=TControl&method=SlideTo

Tim Young
Elevate Software
www.elevatesoft.com
Image