Solved

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

Posted on 2007-11-14
10
558 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 and create keystrokes in Netbeans IDE 8.0 for Windows.

809 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