[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

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.
0
developmentguru
Asked:
developmentguru
1 Solution
 
developmentguruAuthor Commented:
P.S.  I have also tried using DoubleBuffered on the form.
0
 
Ivanov_GCommented:
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
 
developmentguruAuthor Commented:
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!

 
developmentguruAuthor Commented:
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
 
CodedKCommented:
Hi developmentguru.
Did u use TMS components ? :P
0
 
developmentguruAuthor Commented:
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
 
CodedKCommented:
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
 
developmentguruAuthor Commented:
 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
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now