Jaime
September 2nd, 1999, 02:40 PM
Hi all....
I'm programming an SDI doc-view architecure program. The document is a splitterwindow with 2 views. The left one is a FormView control containing a Tree Control. The Right one is a Frame to display different views depending on the selected item of the tree control.
The views on the right are ListView controls since they are all reports. My problem is that I cannot make the report view to be shown. If I use FormView control instead, with the ListCtrl, I can show it, but with an ugly black border, so I want to use ListView. My method to switch views is:
void CRightPaneFrame::SwitchToView(UINT nView)
{
CView* pOldActiveView = GetActiveView();
CView* pNewActiveView = NULL;
switch( nView )
{
case VIEW_CONSUMO:
pNewActiveView = (CView*) m_pConsumoView; break;
case VIEW_ITEMS:
pNewActiveView = (CView*) m_pItemsView; break;
case VIEW_MEALS:
pNewActiveView = (CView*) m_pMealsView; break;
case VIEW_USERS:
pNewActiveView = (CView*) m_pUserListView; break;
case VIEW_DEVICES:
pNewActiveView = (CView*) m_pDevicesView; break;
}
if( pNewActiveView )
{
if( pOldActiveView == pNewActiveView )
return;
SetActiveView(pNewActiveView);
pNewActiveView->ShowWindow(SW_SHOW);
pNewActiveView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
if( pOldActiveView )
{
pOldActiveView->ShowWindow(SW_HIDE);
pOldActiveView->SetDlgCtrlID(m_nCurrentViewID);
}
m_nCurrentViewID = nView;
RecalcLayout();
}
}
Where actually only m_pDevicesView is a CListView class, the others are CFormView. When I switch to the CListView control, the border doesn't appear, but the headers aren'd displayed, that is, the ListView appears blank.
How can I do it?
Thanks
Jaime
I'm programming an SDI doc-view architecure program. The document is a splitterwindow with 2 views. The left one is a FormView control containing a Tree Control. The Right one is a Frame to display different views depending on the selected item of the tree control.
The views on the right are ListView controls since they are all reports. My problem is that I cannot make the report view to be shown. If I use FormView control instead, with the ListCtrl, I can show it, but with an ugly black border, so I want to use ListView. My method to switch views is:
void CRightPaneFrame::SwitchToView(UINT nView)
{
CView* pOldActiveView = GetActiveView();
CView* pNewActiveView = NULL;
switch( nView )
{
case VIEW_CONSUMO:
pNewActiveView = (CView*) m_pConsumoView; break;
case VIEW_ITEMS:
pNewActiveView = (CView*) m_pItemsView; break;
case VIEW_MEALS:
pNewActiveView = (CView*) m_pMealsView; break;
case VIEW_USERS:
pNewActiveView = (CView*) m_pUserListView; break;
case VIEW_DEVICES:
pNewActiveView = (CView*) m_pDevicesView; break;
}
if( pNewActiveView )
{
if( pOldActiveView == pNewActiveView )
return;
SetActiveView(pNewActiveView);
pNewActiveView->ShowWindow(SW_SHOW);
pNewActiveView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
if( pOldActiveView )
{
pOldActiveView->ShowWindow(SW_HIDE);
pOldActiveView->SetDlgCtrlID(m_nCurrentViewID);
}
m_nCurrentViewID = nView;
RecalcLayout();
}
}
Where actually only m_pDevicesView is a CListView class, the others are CFormView. When I switch to the CListView control, the border doesn't appear, but the headers aren'd displayed, that is, the ListView appears blank.
How can I do it?
Thanks
Jaime