Solved

TPaneSplitter

Posted on 1997-06-12
8
272 Views
Last Modified: 2012-05-07
I have a window that has 2 panes initially.  I want to be able to hide/show one of the panes depending on application specific settings.My problem is that when I call RemovePane() the object is deleted.  It also gets deleted when you call ::ShowWindow(Pane->HWindow,SW_HIDE).  It also get deleted when you use MoveSplitter() to move the splitter to the left edge of the window, so as to totally obscure the pane I want to hide.  How can I do this -- am I doing something wrong?Help -- Please!
0
Comment
Question by:djfr
  • 4
  • 4
8 Comments
 
LVL 3

Accepted Solution

by:
gaohong earned 40 total points
ID: 1163900
Hi:

Make sure You use TShouldDelete::NoDelete in your call to
RemovePane().

If you really just want to hide one pane, then use
Pane1()->ShowWindow(SW_HIDE);

Hope this helpful
gaohong xie

0
 

Author Comment

by:djfr
ID: 1163901
I tried using MyPane->ShowWindow(SW_HIDE).  It did hide the window I wanted hidden.  It did not allow the other pane to occupy the space used by the now hidden window nor did the splitter budge.  As far as using Pane1()->ShowWindow(SW_XXXX), Pane()1 is a member of the TSplitter class.  How do I get access to the splitter?
0
 
LVL 3

Expert Comment

by:gaohong
ID: 1163902
Your pane's parent should be the splitter.
To allow other pane to occupy the space left, try MoveWindow()
with arguments (sizes) by calling GetSplitterWidth() or by
calling hidened window's size Attr.W, Attr.H, if still not take
that space, or something clipped off, then it means panes are
clipped to each other.   In this case, do following:

 say your to be hiden window is hidewin, the other one is  otherwin:

 Get size of hidewin from Attr.W/H, w/h
 MoveWindow hidewin to size 0,0,0,0

 Move other window otherwin to its Attr.W + w, Attr.H + h

 good luck
 
 
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:djfr
ID: 1163903
Moving the other pane over the hidden one works. However, when the window is resized the splitter pops back out to where it was and the pane goes back to its previous size (when split).  Any guesses as to how to stop this from occurring?
0
 
LVL 3

Expert Comment

by:gaohong
ID: 1163904
That's more than 40 points, could you up adjust the points ?
0
 

Author Comment

by:djfr
ID: 1163905
40 points is all I had and I'm totally stuck.  If you could find it in your heart to aid in following this to a conclusion, I would be most greatful.
0
 
LVL 3

Expert Comment

by:gaohong
ID: 1163906
Sure, why not, but could you grade now ?

After you adjust your pane sizes, then build a TLayoutMetrics object for each pane as you desired, then call SetChildLayoutMetrics().

good luck
gaohong xie

0
 

Author Comment

by:djfr
ID: 1163907
I am able to set the proper left and top edge constrants using:metrics.X.Set(lmLeft, lmRightOf, EditWindowPane->Parent, lmLeft);
metrics.Y.Set(lmTop, lmBelow, EditWindowPane->Parent, lmTop);But, I am having a bit of trouble getting the width and height constraints right.  When my window resizes the top and left edges are OK.  But the bottom and right edges are frozen in place.  It also appears as though the edit control I have in the remaining visible pane has stopped receiving EV_WM_SIZE notfications.  Any suggestions on how to proceed?

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 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

9 Experts available now in Live!

Get 1:1 Help Now