Solved

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

Posted on 2007-11-14
10
561 Views
Last Modified: 2013-11-23
 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.
0
Comment
Question by:developmentguru
10 Comments
 
LVL 21

Author Comment

by:developmentguru
ID: 20281390
P.S.  I have also tried using DoubleBuffered on the form.
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 20283297
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.
0
 
LVL 21

Author Comment

by:developmentguru
ID: 20283760
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Author Comment

by:developmentguru
ID: 20283892
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?
0
 
LVL 16

Expert Comment

by:CodedK
ID: 20284101
Hi developmentguru.
Did u use TMS components ? :P
0
 
LVL 21

Author Comment

by:developmentguru
ID: 20288794
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.
0
 
LVL 16

Expert Comment

by:CodedK
ID: 20288817
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.
0
 
LVL 21

Accepted Solution

by:
developmentguru earned 0 total points
ID: 20298024
 I made the TreeView Align left, the splitter align left, and changed the panel than contained the right side of the form to align Right.  This was key to getting it to work.  The rest was just doing the following code attached to events on the splitter.  The code could just as easily be placed in separate procedures and called from a button click.
---------------------------------------------------------------------------
procedure TfWizard.spTreeViewBeforeClose(Sender: TObject;
  var AllowClose: Boolean);
begin
  LockWindowUpdate(Handle);
  tvWizardPanels.Visible := false;
  SetBounds(Left + 161, Top, 710, Height);
  LockWindowUpdate(0);
end;

procedure TfWizard.spTreeViewBeforeOpen(Sender: TObject; var NewSize: Integer;
  var AllowOpen: Boolean);
begin
  LockWindowUpdate(Handle);
  SetBounds(Left - 161, Top, 871, Height);
  tvWizardPanels.Visible := true;
  LockWindowUpdate(0);
end;
---------------------------------------------------------------------------

  Note that before I made the right side of the form align right the LockWindowUpdate and SetBounds did not help.  I will leave the question open for a while longer as I am still hoping to get some more options.
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20518821
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

726 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