Link to home
Start Free TrialLog in
Avatar of djfr
djfr

asked on

TPaneSplitter

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!
ASKER CERTIFIED SOLUTION
Avatar of gaohong
gaohong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of djfr
djfr

ASKER

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?
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
 
 
Avatar of djfr

ASKER

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?
That's more than 40 points, could you up adjust the points ?
Avatar of djfr

ASKER

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.
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

Avatar of djfr

ASKER

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?