Solved

TPaneSplitter

Posted on 1997-06-12
8
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
is twain_32.dll cmpatible with windows 10 ? 10 235
c++ getting the first 10 characters of a char* string 11 105
thread-safe code in c++ 2 122
Beginner to Unreal Engine 4 5 105
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

749 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