Pārlūkot izejas kodu

1、禁用样式宏;2、侧边栏关闭后,使用ShowPane重新显示;3、判断CDockablePane隐藏或显示,使用IsVisible()函数。

Jeff 6 gadi atpakaļ
vecāks
revīzija
4f2c2a2529

+ 3 - 0
IDE/IDE/FileView.cpp

@@ -30,6 +30,7 @@ CFileView::CFileView()
 
 CFileView::~CFileView()
 {
+	OutputDebugString(_T("˛ŕąßŔ¸šŘąŐ\n"));
 }
 
 BEGIN_MESSAGE_MAP(CFileView, CDockablePane)
@@ -52,6 +53,8 @@ END_MESSAGE_MAP()
 
 int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
+	lpCreateStruct->style |= AFX_CBRS_REGULAR_TABS;
+	lpCreateStruct->style |= AFX_CBRS_RESIZE;
 	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
 		return -1;
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 451 - 385
IDE/IDE/IDE.rc


+ 32 - 4
IDE/IDE/MainFrm.cpp

@@ -78,8 +78,9 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 		return -1;      // 未能创建
 	}
 
-	CString strTitlePane1;
-	CString strTitlePane2;
+	// 窗口底部状态栏
+	CString strTitlePane1;// 窗格1;
+	CString strTitlePane2;// 窗格2;
 	bNameValid = strTitlePane1.LoadString(IDS_STATUS_PANE1);
 	ASSERT(bNameValid);
 	bNameValid = strTitlePane2.LoadString(IDS_STATUS_PANE2);
@@ -92,10 +93,10 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	// 启用 Visual Studio 2005 样式停靠窗口自动隐藏行为
 	EnableAutoHidePanes(CBRS_ALIGN_ANY);
 
+#if __OUTLOOKBAR__
 	// 导航窗格将创建在左侧,因此将暂时禁用左侧的停靠:
 	EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT);
 
-#if __OUTLOOKBAR__
 	// 创建并设置“Outlook”导航栏:
 	if (!CreateOutlookBar(m_wndNavigationBar, ID_VIEW_NAVIGATION, m_wndTree, m_wndCalendar, 250))
 	{
@@ -111,9 +112,11 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 		return -1;      // 未能创建
 	}
 
+#if __OUTLOOKBAR__
 	// 已创建 Outlook 栏,应允许在左侧停靠。
 	EnableDocking(CBRS_ALIGN_LEFT);
 	EnableAutoHidePanes(CBRS_ALIGN_RIGHT);
+#endif
 
 	// 加载菜单项图像(不在任何标准工具栏上):
 	CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
@@ -134,7 +137,15 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	DockPane(&m_wndOutput);
 	m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
 	DockPane(&m_wndProperties);
-
+	/* 
+	如果关闭了CDockablePane,使用ShowPane重显;
+	如下代码片段:
+	if ( m_wndFileView.GetSafeHwnd() )
+	{
+		m_wndFileView.ShowPane(TRUE, FALSE, TRUE);
+	}
+	参考:https://www.cnblogs.com/canger/p/4156531.html
+	*/
 
 	// 启用增强的窗口管理对话框
 	EnableWindowsDialog(ID_WINDOW_MANAGER, IDS_WINDOWS_MANAGER, TRUE);
@@ -290,6 +301,7 @@ void CMainFrame::InitializeRibbon()
 	pBtnWindows->SetMenu(IDR_WINDOWS_MENU, TRUE);
 	pPanelWindow->Add(pBtnWindows);
 
+#if __STYLE__
 	//////////////////////////////////////////////////////////////////////////
 	// 添加 "样式" 按钮;
 	// 将元素添加到选项卡右侧:
@@ -306,6 +318,7 @@ void CMainFrame::InitializeRibbon()
 	ASSERT(bNameValid);
 	pVisualStyleButton->SetDescription(strTemp);
 	m_wndRibbonBar.AddToTabs(pVisualStyleButton);
+#endif
 
 #if __QUICKACCESS_COMMAND__
 	// 添加快速访问工具栏命令:
@@ -570,11 +583,26 @@ void CMainFrame::OnUpdateApplicationLook(CCmdUI* pCmdUI)
 
 void CMainFrame::OnViewCaptionBar()
 {
+#if 0
 	m_wndCaptionBar.ShowWindow(m_wndCaptionBar.IsVisible() ? SW_HIDE : SW_SHOW);
 	RecalcLayout(FALSE);
+#else
+	if ( m_wndFileView.GetSafeHwnd() )
+	{
+		m_wndFileView.ShowPane(TRUE, FALSE, TRUE);
+	}
+	if ( m_wndClassView.GetSafeHwnd() )
+	{
+		m_wndClassView.ShowPane(TRUE,FALSE,TRUE);
+	}
+#endif
 }
 
 void CMainFrame::OnUpdateViewCaptionBar(CCmdUI* pCmdUI)
 {
+#if 0
 	pCmdUI->SetCheck(m_wndCaptionBar.IsVisible());
+#else
+	pCmdUI->SetCheck(m_wndFileView.IsVisible() || m_wndClassView.IsVisible());
+#endif
 }

BIN
IDE/IDE/res/Toolbar.bmp


BIN
IDE/IDE/res/Toolbar256.bmp


BIN
IDE/IDE/res/menuimages.bmp


+ 2 - 0
IDE/IDE/stdafx.h

@@ -54,6 +54,8 @@
 #define __RIBBON__ 1
 // 우醵련狂묏야으
 #define __QUICKACCESS_COMMAND__ 0
+// 湳駕객큐;
+#define __STYLE__ 0
 
 
 

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels