|
@@ -49,24 +49,24 @@ int CTitleBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
CRect rectDummy;
|
|
CRect rectDummy;
|
|
rectDummy.SetRectEmpty();
|
|
rectDummy.SetRectEmpty();
|
|
|
|
|
|
- // 创建视图:
|
|
|
|
- const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
|
|
|
|
|
|
+ //// 创建视图:
|
|
|
|
+ //const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
|
|
|
|
|
|
- if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
|
|
|
|
- {
|
|
|
|
- TRACE0("未能创建文件视图\n");
|
|
|
|
- return -1; // 未能创建
|
|
|
|
- }
|
|
|
|
|
|
+ //if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
|
|
|
|
+ //{
|
|
|
|
+ // TRACE0("未能创建文件视图\n");
|
|
|
|
+ // return -1; // 未能创建
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
|
|
// 加载视图图像:
|
|
// 加载视图图像:
|
|
- m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
|
|
|
|
- m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);
|
|
|
|
|
|
+ //m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
|
|
|
|
+ //m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);
|
|
#if 0
|
|
#if 0
|
|
m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
|
|
m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
|
|
m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* 已锁定*/);
|
|
m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* 已锁定*/);
|
|
#endif
|
|
#endif
|
|
- OnChangeVisualStyle();
|
|
|
|
|
|
+ //OnChangeVisualStyle();
|
|
#if 0
|
|
#if 0
|
|
m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
|
|
m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
|
|
|
|
|
|
@@ -78,7 +78,7 @@ int CTitleBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
|
|
m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
|
|
#endif
|
|
#endif
|
|
// 填入一些静态树视图数据(此处只需填入虚拟代码,而不是复杂的数据)
|
|
// 填入一些静态树视图数据(此处只需填入虚拟代码,而不是复杂的数据)
|
|
- FillFileView();
|
|
|
|
|
|
+ //FillFileView();
|
|
AdjustLayout();
|
|
AdjustLayout();
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -168,7 +168,7 @@ void CTitleBar::AdjustLayout()
|
|
#if 0
|
|
#if 0
|
|
m_wndToolBar.SetWindowPos(nullptr, rectClient.left, rectClient.top, rectClient.Width(), cyTlb, SWP_NOACTIVATE | SWP_NOZORDER);
|
|
m_wndToolBar.SetWindowPos(nullptr, rectClient.left, rectClient.top, rectClient.Width(), cyTlb, SWP_NOACTIVATE | SWP_NOZORDER);
|
|
#endif
|
|
#endif
|
|
- m_wndFileView.SetWindowPos(nullptr, rectClient.left + 1, rectClient.top + cyTlb + 1, rectClient.Width() - 2, rectClient.Height() - cyTlb - 2, SWP_NOACTIVATE | SWP_NOZORDER);
|
|
|
|
|
|
+ //m_wndFileView.SetWindowPos(nullptr, rectClient.left + 1, rectClient.top + cyTlb + 1, rectClient.Width() - 2, rectClient.Height() - cyTlb - 2, SWP_NOACTIVATE | SWP_NOZORDER);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -211,20 +211,29 @@ void CTitleBar::OnEditClear()
|
|
void CTitleBar::OnPaint()
|
|
void CTitleBar::OnPaint()
|
|
{
|
|
{
|
|
CPaintDC dc(this); // 用于绘制的设备上下文
|
|
CPaintDC dc(this); // 用于绘制的设备上下文
|
|
-
|
|
|
|
|
|
+#if 0
|
|
CRect rectTree;
|
|
CRect rectTree;
|
|
m_wndFileView.GetWindowRect(rectTree);
|
|
m_wndFileView.GetWindowRect(rectTree);
|
|
ScreenToClient(rectTree);
|
|
ScreenToClient(rectTree);
|
|
|
|
|
|
rectTree.InflateRect(1, 1);
|
|
rectTree.InflateRect(1, 1);
|
|
dc.Draw3dRect(rectTree, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW));
|
|
dc.Draw3dRect(rectTree, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW));
|
|
|
|
+#else
|
|
|
|
+ // 如果CDockablePane无控件,改变大小时背景会刷新失败;
|
|
|
|
+ // 所以要重载onpaint;
|
|
|
|
+ CRect rc;
|
|
|
|
+ GetClientRect(rc);
|
|
|
|
+ CBrush brush;
|
|
|
|
+ brush.CreateSolidBrush(0xFFEFD5);
|
|
|
|
+ dc.FillRect(&rc, &brush);
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
void CTitleBar::OnSetFocus(CWnd* pOldWnd)
|
|
void CTitleBar::OnSetFocus(CWnd* pOldWnd)
|
|
{
|
|
{
|
|
CDockablePane::OnSetFocus(pOldWnd);
|
|
CDockablePane::OnSetFocus(pOldWnd);
|
|
|
|
|
|
- m_wndFileView.SetFocus();
|
|
|
|
|
|
+ //m_wndFileView.SetFocus();
|
|
}
|
|
}
|
|
|
|
|
|
void CTitleBar::OnChangeVisualStyle()
|
|
void CTitleBar::OnChangeVisualStyle()
|