Delphi 7 - Panel visible with animation

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
danz67Asked:
Who is Participating?
 
Geert GConnect With a Mentor Oracle dbaCommented:
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
 
Geert GOracle dbaCommented:
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
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
What kind of animation do you mean? A Tanimation on the Panel or what else?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
danz67Author Commented:
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
 
Geert GOracle dbaCommented:
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
 
danz67Author Commented:
ok, I need an animation like that of iphone, push side
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
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
 
danz67Author Commented:
Sorry,
a sliding panel is fine, but to use with TPanel
0
 
Geert GOracle dbaCommented:
that's easy, just use a splitter next to the panel
some splitters provide animation
http://sourceforge.net/projects/tcycomponents/?_test=b
0
 
danz67Author Commented:
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
 
Geert GOracle dbaCommented:
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
 
danz67Author Commented:
Very good,
I need use the animation by pressing button

you explain how?
0
 
Geert GOracle dbaCommented:
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
 
danz67Author Commented:
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
 
danz67Author Commented:
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
 
Geert GOracle dbaCommented:
that's all the help i can give

i'm not an animation artist
0
 
danz67Author Commented:
ok, no problem, thanks for all
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.