Solved

TPaneSplitter

Posted on 1997-06-12
8
268 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:djfr
Comment Utility
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
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 3

Expert Comment

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

Author Comment

by:djfr
Comment Utility
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
Comment Utility
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
Comment Utility
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

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!

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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

9 Experts available now in Live!

Get 1:1 Help Now