?
Solved

Delphi 7 - Panel visible with animation

Posted on 2012-04-02
17
Medium Priority
?
3,705 Views
Last Modified: 2013-02-24
hello,
I have a form with 2 panels, panel1 and panel2

defalut:

panel1.visible = true - align = client
panel2.visible = false = align = right

when I press a button panel2 becomes visible = true.
I would like to panel2 visible with animation.

Regards
0
Comment
Question by:danz67
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
  • 2
17 Comments
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37794909
what exactly do you mean with animation ?

here is a sample from about.com
http://delphi.about.com/od/delphi-tips-2011/qt/hide-slide-fade-away-controls-delphi-form.htm
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 37794918
What kind of animation do you mean? A Tanimation on the Panel or what else?
0
 

Author Comment

by:danz67
ID: 37794928
what exactly do you mean with animation ?

here is a sample from about.com
http://delphi.about.com/od/delphi-tips-2011/qt/hide-slide-fade-away-controls-delphi-form.htm
I already know this example and it is fine for what I do I

What kind of animation do you mean? A Tanimation on the Panel or what else?
yes, animation panel
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37794932
please explain in more detail, what exactly do you want ?

a animation can include all sorts
> a slideshow, line drawing, panel growing/shrinking, etc
0
 

Author Comment

by:danz67
ID: 37794944
ok, I need an animation like that of iphone, push side
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 37794965
Wow Geert, can you understand what does he need? 'Cause today I feel a little stupid, as right now I still don't understand what he want.
Push side? A sliding panel?
0
 

Author Comment

by:danz67
ID: 37794982
Sorry,
a sliding panel is fine, but to use with TPanel
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37794983
that's easy, just use a splitter next to the panel
some splitters provide animation
http://sourceforge.net/projects/tcycomponents/?_test=b
0
 

Author Comment

by:danz67
ID: 37795032
that's easy, just use a splitter next to the panel
some splitters provide animation
http://sourceforge.net/projects/tcycomponents/?_test=b

Ok , i have installed all component.

the component that I use is cySplitter?
you explain how?
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37795036
i used the devexpress splitter and a panel:

add a splitter (align left, with hot zone xp, autosnap)
and a panel (set control of splitter to this panel)

then add these events to splitter

procedure TForm1.cxSplitter1AfterOpen(Sender: TObject);
var sp: TcxSplitter;
begin
  sp := Sender as TcxSplitter;
  AnimateWindow(TPanel(sp.Control).Handle, 500, AW_HOR_POSITIVE or AW_SLIDE or  AW_ACTIVATE);
end;

procedure TForm1.cxSplitter1BeforeClose(Sender: TObject;
  var AllowClose: Boolean);
var sp: TcxSplitter;
begin
  sp := Sender as TcxSplitter;
  AnimateWindow(TPanel(sp.Control).Handle, 500, AW_HOR_NEGATIVE or  AW_HIDE);
  AllowClose := True;
end;

Open in new window

0
 

Author Comment

by:danz67
ID: 37795284
Very good,
I need use the animation by pressing button

you explain how?
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37795314
what button ?

when you set the hotzone to style xp, you can click in the middle of the splitter (you may have to widen it to see the hotzone)
this hotzone is clickable
0
 

Author Comment

by:danz67
ID: 37795332
I have understood this and saw and that's fine, but I need to make the panel visible after animation just click a button and not spliier hotzone
0
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 375 total points
ID: 37795403
use this in button to make visible

panel1.Visible := True;
AnimateWindow(Panel1.Handle, 500, AW_HOR_POSITIVE or AW_SLIDE or  AW_ACTIVATE);


use this in a button to hide
AnimateWindow(Panel1.Handle, 500, AW_HOR_NEGATIVE or  AW_HIDE);
Panel1.Visible := False;
0
 

Author Comment

by:danz67
ID: 37795420
panel1.Visible := True;
AnimateWindow(Panel1.Handle, 500, AW_HOR_POSITIVE or AW_SLIDE or  AW_ACTIVATE);

in this way does not happen to any animation
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 37795465
that's all the help i can give

i'm not an animation artist
0
 

Author Comment

by:danz67
ID: 37795470
ok, no problem, thanks for all
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question