dynamic splitter and default size

Hello
I wanted to set (for dynamic splitter) default size for the first row:

issue=s.Create(this,2,1,CSize(100,100),pContext);
s.SetRowInfo(0,50,10);

As i understeand the first row should be 50 pixels height,
but it is always 0. (i can see only next pane, i have to move the 
splitter down to see the first one).
Why ?


Thanx

0
user681 (69)
1/12/2004 7:40:28 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
778 Views

Similar Articles

[PageSpeed] 33

user,

For dynamic splitters, this seems to be the designed behaviour, that is,
only one pane is displayed and the user splits the view.

Reading through the MFC source, however, you'll find the split member
SplitRow which indeed seems to be a better candidate for the split. This
function, however, depends on everything - the view, the document - already
being created. To postpone this call, but still have the splitter split
during startup, you might want to post a message from the frame to itself.

To do this, register a window message at the top of MainFrm.cpp, thus (lines
to add ended with <---):

////////////////////////////////////////////////////////////////////////////
/
// CMainFrame
const UINT RM_STARTUP_SPLIT = ::RegisterWindowMessage( "some long and unique
string goes here" ); <---

Add a handler for the message, in MainFrm.h:

 //}}AFX_MSG
 DECLARE_MESSAGE_MAP()
 afx_msg LRESULT OnStartupSplit( WPARAM, LPARAM ); <---

Add an entry into the message map so:

 //}}AFX_MSG_MAP
 ON_REGISTERED_MESSAGE( RM_STARTUP_SPLIT, OnStartupSplit ) <---

And the handler itself (all of it):

LRESULT CMainFrame::OnStartupSplit( WPARAM, LPARAM )
{
 m_wndSplitter.SplitRow( 50 );
 return 0;
}

Now, we want to get this function called after everything is finishen, which
we can do thus in CreateClient:

PostMessage( RM_STARTUP_SPLIT );

This will split the window into two rows, the first one being 50 pixels
high. Note that this value must be larger than the minimum size you declare
in Create for the splitter (or you can call SetRowInfo, which is -
however -redundant).

This will at least give you some base for experimentation!

Johan Rosengren
Abstrakt Mekanik AB

<user@domain.invalid> a �crit dans le message de
news:ed4iW9N2DHA.1704@tk2msftngp13.phx.gbl...
> Hello
> I wanted to set (for dynamic splitter) default size for the first row:
>
> issue=s.Create(this,2,1,CSize(100,100),pContext);
> s.SetRowInfo(0,50,10);
>
> As i understeand the first row should be 50 pixels height,
> but it is always 0. (i can see only next pane, i have to move the
> splitter down to see the first one).
> Why ?
>
>
> Thanx
>


0
1/13/2004 8:23:59 AM
Reply:

Similar Artilces: