Link to home
Start Free TrialLog in
Avatar of developmentguru
developmentguruFlag for United States of America

asked on

How do you smoothly pop open a left side section on a form?

 I am developing a wizard for a program I am working on.  I just got to the point of incorporating a tree view on the left side of the wizard so the user can more easily move around the wizard (there will be instances when the wizard has over 100 panels).  I want the tree view to be hidden at first and come up only when the user clicks on a splitter (code responding to a button press would work too, don't concentrate on using a splitter).  The arrangement of the form is the tree view on the left with a splitter left aligned to it, a panel on the right that contains a top panel (the parent for the wizard panels) and a bottom panel for the usual wizard navigation buttons.

  The issue I am working on is this... when the form needs to display or hide the tree on the left I will need to resize and move the form so the panel appears to pop up on the left of the form (everything else stays in place).  I already have this working.  The issue I need to resolve is how to keep the controls in the non-tree view portion of the form from flickering while the tree view is hidden and shown (thus changing the left side and width of the form by 161.  I have tried the LockWindowUpdate.  I have tried the DisableAlign and EnableAlign at the form level.  I even tried to temporarily stop window message processing by hooking the MessageProc.

  What I am looking for is a simple example.  If you can get the example to work with:
1) a tree view left aligned and a parent panel client aligned
2) some buttons in the right bottom panel (bottom aligned within the parent panel)
3) some controls in the right top panel (client aligned within the right side parent panel)
and show me the code that can pop it open or closed on the left side, smoothly, the points are yours.
Avatar of developmentguru
developmentguru
Flag of United States of America image

ASKER

P.S.  I have also tried using DoubleBuffered on the form.
In most cases the wizards have some picture on the left and some clever words... If you have something like this drawn as background of the main form you can easily have the tree popup over this backgrounded area.
Thats not the case for me.  I have seen applications do the kind of behavior I am looking for, I just need to figure out how.
Ok, to spur you all on (and see if I can find a better solution, I can tell you that I have found a good looking solution.  I want to see if I can award someone else the points for meeting or beating my solution.  So you now know it is possible, how would you do it?
Avatar of CodedK
Hi developmentguru.
Did u use TMS components ? :P
I am using Developer Express components, but they do not do all of the work for you.  I used a TcxSplitter as my splitter and a TcxTreeView for the tree view.  I used TPanels to containt the other controls.  My solution will work with basic Delphi controls though.
I had the same problem DevelopmentGuru.
I bet you've allready read all the PAQs here, i saw that you've tried many of the solutions too.
I dont know what to say since i had the same problems too.

Maybe you mad the controls invisible then visible, maybe u used a timer or Application.ProcessMessages or a Custom OnDraw event. Its a combination of try and see whta will work for you maybe.
ASKER CERTIFIED SOLUTION
Avatar of developmentguru
developmentguru
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator