MDI without Doc/view
-
HI i want to use different captions for each MDI child window i create. i am creating it using CreateNewChild function. also how to assign some values for each child i create so that i can iterate over them or identify them using that value. Thanx'n'advance
-
HI i want to use different captions for each MDI child window i create. i am creating it using CreateNewChild function. also how to assign some values for each child i create so that i can iterate over them or identify them using that value. Thanx'n'advance
I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)
-
I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)
-
I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)
-
ya i too have those class n function available.. plz help me in detail... NOTE: I am creating child window using CreateNewChild.. how can i make use of cs.lpCreateParams.
This is more or less what I made.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;// Set the configuration for the different Views extern CFPSDoc\* m\_pDoc;
;
if ((m_pDoc) && (m_pDoc->m_szNewFrameName != ""))
{ cs.style = WS_SYSMENU | WS_CAPTION | WS_OVERLAPPED; //This is the main View (CScrollView)
;
//All following type of views are from CFormView derived
if (m_pDoc->m_szNewFrameName == "ViewType1")
{ int nMax = 0;
if (m_pDoc->m_cmlMyList1.GetCount () >= m_pDoc->m_cmlMyList2.GetCount ())
nMax = m_pDoc->m_cmlMyList1.GetCount ();
else
nMax = m_pDoc->m_cmlMyList2.GetCount ();cs.cx = 500; cs.cy = (40 + (25 \* nMax)); //Variable Frame height according to number of elements m\_pDoc->m\_szNewFrameName = "This is the Type of view 1 in project \\"" + m\_pDoc->GetTitle () + "\\""; } else if (m\_pDoc->m\_szNewFrameName == "ViewType2") { cs.cx = 528; cs.cy = 322; m\_pDoc->m\_szNewFrameName = "Second type of View in project \\"" + m\_pDoc->GetTitle () + "\\""; cs.style = cs.style | WS\_MINIMIZEBOX; } else if (m\_pDoc->m\_szNewFrameName == "ViewType2\_Not\_Visible") { cs.cx = 1; cs.cy = 1; m\_pDoc->m\_szNewFrameName = ""; cs.style = cs.style | WS\_MINIMIZE; //this is to have access to some functions coded in the view of second type, but without having the view itself. } else if (m\_pDoc->m\_pObj1 || m\_pDoc->m\_pObj2) //if one particular element is selected { cs.cx = 415; cs.cy = 260; cs.style = cs.style | WS\_MINIMIZEBOX; } else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 0)) //if the other type of element is from one subtype { cs.cx = 517; cs.cy = 421; cs.style = cs.style | WS\_MINIMIZEBOX; } else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 2)) //if the other subtype { cs.cx = 610; cs.cy = 435; cs.style = cs.style | WS\_MINIMIZEBOX; }
;
cs.lpszName = m_pDoc->m_szNewFrameName; //Assigning the correspondent title to the frame
}
return TRUE;
}This is what I use to configure the different type of views that may be opened. Up to 50 different views in 6 different configurations. Was that what you were asking for? If not... sorry. I didn't understand what you told me the ";" are used just to avoid the cancellation of empty lines
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution...
-
This is more or less what I made.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;// Set the configuration for the different Views extern CFPSDoc\* m\_pDoc;
;
if ((m_pDoc) && (m_pDoc->m_szNewFrameName != ""))
{ cs.style = WS_SYSMENU | WS_CAPTION | WS_OVERLAPPED; //This is the main View (CScrollView)
;
//All following type of views are from CFormView derived
if (m_pDoc->m_szNewFrameName == "ViewType1")
{ int nMax = 0;
if (m_pDoc->m_cmlMyList1.GetCount () >= m_pDoc->m_cmlMyList2.GetCount ())
nMax = m_pDoc->m_cmlMyList1.GetCount ();
else
nMax = m_pDoc->m_cmlMyList2.GetCount ();cs.cx = 500; cs.cy = (40 + (25 \* nMax)); //Variable Frame height according to number of elements m\_pDoc->m\_szNewFrameName = "This is the Type of view 1 in project \\"" + m\_pDoc->GetTitle () + "\\""; } else if (m\_pDoc->m\_szNewFrameName == "ViewType2") { cs.cx = 528; cs.cy = 322; m\_pDoc->m\_szNewFrameName = "Second type of View in project \\"" + m\_pDoc->GetTitle () + "\\""; cs.style = cs.style | WS\_MINIMIZEBOX; } else if (m\_pDoc->m\_szNewFrameName == "ViewType2\_Not\_Visible") { cs.cx = 1; cs.cy = 1; m\_pDoc->m\_szNewFrameName = ""; cs.style = cs.style | WS\_MINIMIZE; //this is to have access to some functions coded in the view of second type, but without having the view itself. } else if (m\_pDoc->m\_pObj1 || m\_pDoc->m\_pObj2) //if one particular element is selected { cs.cx = 415; cs.cy = 260; cs.style = cs.style | WS\_MINIMIZEBOX; } else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 0)) //if the other type of element is from one subtype { cs.cx = 517; cs.cy = 421; cs.style = cs.style | WS\_MINIMIZEBOX; } else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 2)) //if the other subtype { cs.cx = 610; cs.cy = 435; cs.style = cs.style | WS\_MINIMIZEBOX; }
;
cs.lpszName = m_pDoc->m_szNewFrameName; //Assigning the correspondent title to the frame
}
return TRUE;
}This is what I use to configure the different type of views that may be opened. Up to 50 different views in 6 different configurations. Was that what you were asking for? If not... sorry. I didn't understand what you told me the ";" are used just to avoid the cancellation of empty lines
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution...
-
You are wellcome :)
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson