Creating views in Top Level MDI
-
Hi, I have a Top Level MDI windows application. From the main frame users can choose a game. The game should open in a new frame window. This frame window should have a different view each time - according the game the user has selected. How do i intervene with the creation of the views of the frame windows? I have only one MainFrm class and one CView-derived class, which is enough. All i have to do is tell the view to draw a different backgournd each time (according to the selected game). Thanks a lot in advance guys. Snir_ya.
-
Hi, I have a Top Level MDI windows application. From the main frame users can choose a game. The game should open in a new frame window. This frame window should have a different view each time - according the game the user has selected. How do i intervene with the creation of the views of the frame windows? I have only one MainFrm class and one CView-derived class, which is enough. All i have to do is tell the view to draw a different backgournd each time (according to the selected game). Thanks a lot in advance guys. Snir_ya.
The selection can be saved in the doc class object, right?
- NS - [ODBaseBtn]
-
The selection can be saved in the doc class object, right?
- NS - [ODBaseBtn]
-
So in the view class you can use that. I mean, (but I am not sure, since I dont know your implementation), you can handle it in the OnDraw, or in your drawing code. Like...
void CTopLevelMDI_TestView::OnDraw(CDC* /*pDC*/) { CTopLevelMDI_TestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; if( pDoc->m_nGameType == 1 ) { // Drawing for Game 1 } else if( ... ) { // So on... } }
- NS - [ODBaseBtn]
-
So in the view class you can use that. I mean, (but I am not sure, since I dont know your implementation), you can handle it in the OnDraw, or in your drawing code. Like...
void CTopLevelMDI_TestView::OnDraw(CDC* /*pDC*/) { CTopLevelMDI_TestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; if( pDoc->m_nGameType == 1 ) { // Drawing for Game 1 } else if( ... ) { // So on... } }
- NS - [ODBaseBtn]