Solved

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

Posted on 2007-11-14
10
542 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
Comment Utility
P.S.  I have also tried using DoubleBuffered on the form.
0
 
LVL 12

Expert Comment

by:Ivanov_G
Comment Utility
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
Comment Utility
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
 
LVL 21

Author Comment

by:developmentguru
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 16

Expert Comment

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

Author Comment

by:developmentguru
Comment Utility
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
Comment Utility
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
Comment Utility
 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
Comment Utility
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi 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 new code templates in NetBeans IDE 8.0 for Windows.

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now