Solved

TPaneSplitter

Posted on 1997-06-12
8
273 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

838 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