cpj196
asked on
MFC splitter Windows
Hi,
When a splitter window is created, MFC seems to only like it when you specify a view for EVERY column and row, else you get an assertion. I want to be able to have a single static splitter window with 2 columns in the top row and one column in the bottom row (this is for an IRC client), but at the moment i can only have it so that there are 2 columns in both the top and bottom rows.
Anyone know How I get around this? (100)
Thanks a lot...
Chris
When a splitter window is created, MFC seems to only like it when you specify a view for EVERY column and row, else you get an assertion. I want to be able to have a single static splitter window with 2 columns in the top row and one column in the bottom row (this is for an IRC client), but at the moment i can only have it so that there are 2 columns in both the top and bottom rows.
Anyone know How I get around this? (100)
Thanks a lot...
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
cpj,
To move the horizontal splitter up and down use
int posy = 30; // x position
m_wndSplitter.SetRowInfo(0 ,posy,posy );
To move the vertical splitter left and right use
int posx = 180; // y position
m_topwndSplitter.SetColumn Info(0,pos x,posx);
Use these funtions after the splitter were created
To move the horizontal splitter up and down use
int posy = 30; // x position
m_wndSplitter.SetRowInfo(0
To move the vertical splitter left and right use
int posx = 180; // y position
m_topwndSplitter.SetColumn
Use these funtions after the splitter were created
ASKER
This was very helpful, and i now have 3 panes as required. Although, i am still having probelms with the initial sizing when the window is created. I have a size structure that contains the window size by getting the client rect area. Ideally, when the application loads, i want the bottom pane (for typing into) to be about 30 pixels high, the top left pane (for receiving IRC messages) to be y - 30 pixels high and x - 100 pixels wide, and the top right pane (for displaying usernames of users on current channel) to be y-30 pixels high and 100 pixels wide.
The code i am using is not working, creating all the panes but then making the bottom one (typing into pane) take up the entire window!
I am using the following code...
BOOL CMainFrame::OnCreateClient
CCreateContext* pContext)
{
if (m_wndSplitter.CreateStati
{
CRect rect;
GetClientRect(&rect);
CSize size = rect.Size();
if (m_topwndSplitter.CreateSt
{
if (m_topwndSplitter.CreateVi
{
if (m_topwndSplitter.CreateVi
{
if (m_wndSplitter.CreateView(
{
SetActiveView((CView*)m_wn
return TRUE;
}
}
}
}
}
return FALSE;
}
Wot am i doing wrong! ?
Please help! :-)
Thanks again for the previous response,
Chris J