|
@@ -1,618 +0,0 @@
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-#include "stdafx.h"
|
|
|
-#include "OGCAssistTool.h"
|
|
|
-
|
|
|
-#include "MainFrm.h"
|
|
|
-
|
|
|
-#ifdef _DEBUG
|
|
|
-#define new DEBUG_NEW
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-IMPLEMENT_DYNCREATE(CMainFrame, CFrameWndEx)
|
|
|
-
|
|
|
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWndEx)
|
|
|
- ON_WM_CREATE()
|
|
|
- ON_COMMAND_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_OFF_2007_AQUA, &CMainFrame::OnApplicationLook)
|
|
|
- ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_OFF_2007_AQUA, &CMainFrame::OnUpdateApplicationLook)
|
|
|
-#ifndef DISABLE_CAPTIONBAR
|
|
|
- ON_COMMAND(ID_VIEW_CAPTION_BAR, &CMainFrame::OnViewCaptionBar)
|
|
|
- ON_UPDATE_COMMAND_UI(ID_VIEW_CAPTION_BAR, &CMainFrame::OnUpdateViewCaptionBar)
|
|
|
-#endif
|
|
|
- ON_COMMAND(ID_FILE_PRINT, &CMainFrame::OnFilePrint)
|
|
|
- ON_COMMAND(ID_FILE_PRINT_DIRECT, &CMainFrame::OnFilePrint)
|
|
|
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CMainFrame::OnFilePrintPreview)
|
|
|
- ON_UPDATE_COMMAND_UI(ID_FILE_PRINT_PREVIEW, &CMainFrame::OnUpdateFilePrintPreview)
|
|
|
-END_MESSAGE_MAP()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-CMainFrame::CMainFrame()
|
|
|
-{
|
|
|
-
|
|
|
- theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_OFF_2007_BLUE);
|
|
|
-}
|
|
|
-
|
|
|
-CMainFrame::~CMainFrame()
|
|
|
-{
|
|
|
-}
|
|
|
-
|
|
|
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|
|
-{
|
|
|
- if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
|
|
|
- return -1;
|
|
|
-
|
|
|
- BOOL bNameValid;
|
|
|
-
|
|
|
- OnApplicationLook(theApp.m_nAppLook);
|
|
|
-
|
|
|
- m_wndRibbonBar.Create(this);
|
|
|
- InitializeRibbon();
|
|
|
-
|
|
|
- if (!m_wndStatusBar.Create(this))
|
|
|
- {
|
|
|
- TRACE0("未能创建状态栏\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- CString strTitlePane1;
|
|
|
- CString strTitlePane2;
|
|
|
- bNameValid = strTitlePane1.LoadString(IDS_STATUS_PANE1);
|
|
|
- ASSERT(bNameValid);
|
|
|
- bNameValid = strTitlePane2.LoadString(IDS_STATUS_PANE2);
|
|
|
- ASSERT(bNameValid);
|
|
|
- m_wndStatusBar.AddElement(new CMFCRibbonStatusBarPane(ID_STATUSBAR_PANE1, strTitlePane1, TRUE), strTitlePane1);
|
|
|
- m_wndStatusBar.AddExtendedElement(new CMFCRibbonStatusBarPane(ID_STATUSBAR_PANE2, strTitlePane2, TRUE), strTitlePane2);
|
|
|
-
|
|
|
-
|
|
|
- CDockingManager::SetDockingMode(DT_SMART);
|
|
|
-
|
|
|
- EnableAutoHidePanes(CBRS_ALIGN_ANY);
|
|
|
-
|
|
|
-
|
|
|
- EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT);
|
|
|
-
|
|
|
-#ifndef DISABLE_OUTLOOKBAR
|
|
|
-
|
|
|
- if (!CreateOutlookBar(m_wndNavigationBar, ID_VIEW_NAVIGATION, m_wndTree, m_wndCalendar, 250))
|
|
|
- {
|
|
|
- TRACE0("未能创建导航窗格\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-#endif
|
|
|
-
|
|
|
-#ifndef DISABLE_CAPTIONBAR
|
|
|
-
|
|
|
- if (!CreateCaptionBar())
|
|
|
- {
|
|
|
- TRACE0("未能创建标题栏\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
- EnableDocking(CBRS_ALIGN_LEFT);
|
|
|
- EnableAutoHidePanes(CBRS_ALIGN_RIGHT);
|
|
|
-
|
|
|
-
|
|
|
- CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
|
|
|
-
|
|
|
-
|
|
|
- if (!CreateDockingWindows())
|
|
|
- {
|
|
|
- TRACE0("未能创建停靠窗口\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
|
|
|
- m_wndClassView.EnableDocking(CBRS_ALIGN_ANY);
|
|
|
- DockPane(&m_wndFileView);
|
|
|
- CDockablePane* pTabbedBar = NULL;
|
|
|
- m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
|
|
|
- m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
|
|
|
- DockPane(&m_wndOutput);
|
|
|
- m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
|
|
|
- DockPane(&m_wndProperties);
|
|
|
-
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
|
-{
|
|
|
- if( !CFrameWndEx::PreCreateWindow(cs) )
|
|
|
- return FALSE;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- cs.cx = 800;
|
|
|
- cs.cy = 600;
|
|
|
-
|
|
|
- cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
|
|
|
- | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE | WS_SYSMENU;
|
|
|
-
|
|
|
- return TRUE;
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::InitializeRibbon()
|
|
|
-{
|
|
|
- BOOL bNameValid;
|
|
|
-
|
|
|
- CString strTemp;
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_FILE);
|
|
|
- ASSERT(bNameValid);
|
|
|
-
|
|
|
-
|
|
|
- m_PanelImages.SetImageSize(CSize(16, 16));
|
|
|
- m_PanelImages.Load(IDB_BUTTONS);
|
|
|
-
|
|
|
-#pragma region 主按钮相关;
|
|
|
-
|
|
|
- m_MainButton.SetImage(IDB_MAIN);
|
|
|
- m_MainButton.SetText(_T("\nf"));
|
|
|
- m_MainButton.SetToolTipText(strTemp);
|
|
|
-
|
|
|
- m_wndRibbonBar.SetApplicationButton(&m_MainButton, CSize (45, 45));
|
|
|
- CMFCRibbonMainPanel* pMainPanel = m_wndRibbonBar.AddMainCategory(strTemp, IDB_FILESMALL, IDB_FILELARGE);
|
|
|
-
|
|
|
-#if 0
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_NEW);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->Add(new CMFCRibbonButton(ID_FILE_NEW, strTemp, 0, 0));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_OPEN);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->Add(new CMFCRibbonButton(ID_FILE_OPEN, strTemp, 1, 1));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_SAVE);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SAVE, strTemp, 2, 2));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_SAVEAS);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SAVE_AS, strTemp, 3, 3));
|
|
|
-#endif
|
|
|
-
|
|
|
-#if 0
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PRINT);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonButton* pBtnPrint = new CMFCRibbonButton(ID_FILE_PRINT, strTemp, 6, 6);
|
|
|
- pBtnPrint->SetKeys(_T("p"), _T("w"));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PRINT_LABEL);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pBtnPrint->AddSubItem(new CMFCRibbonLabel(strTemp));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PRINT_QUICK);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pBtnPrint->AddSubItem(new CMFCRibbonButton(ID_FILE_PRINT_DIRECT, strTemp, 7, 7, TRUE));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PRINT_PREVIEW);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pBtnPrint->AddSubItem(new CMFCRibbonButton(ID_FILE_PRINT_PREVIEW, strTemp, 8, 8, TRUE));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PRINT_SETUP);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pBtnPrint->AddSubItem(new CMFCRibbonButton(ID_FILE_PRINT_SETUP, strTemp, 11, 11, TRUE));
|
|
|
- pMainPanel->Add(pBtnPrint);
|
|
|
- pMainPanel->Add(new CMFCRibbonSeparator(TRUE));
|
|
|
-#endif
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_CLOSE);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->Add(new CMFCRibbonButton(ID_FILE_CLOSE, strTemp, 9, 9));
|
|
|
-
|
|
|
-#if 0
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_RECENT_DOCS);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->AddRecentFilesList(strTemp);
|
|
|
-#endif
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_EXIT);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pMainPanel->AddToBottom(new CMFCRibbonMainPanelButton(ID_APP_EXIT, strTemp, 15));
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-#pragma region 主页面板相关;
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_HOME);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonCategory* pCategoryHome = m_wndRibbonBar.AddCategory(strTemp, IDB_WRITESMALL, IDB_WRITELARGE);
|
|
|
-
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_CLIPBOARD);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonPanel* pPanelClipboard = pCategoryHome->AddPanel(strTemp, m_PanelImages.ExtractIcon(27));
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_PASTE);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonButton* pBtnPaste = new CMFCRibbonButton(ID_EDIT_PASTE, strTemp, 0, 0);
|
|
|
- pPanelClipboard->Add(pBtnPaste);
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_CUT);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_CUT, strTemp, 1));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_COPY);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_COPY, strTemp, 2));
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_SELECTALL);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_SELECT_ALL, strTemp, -1));
|
|
|
-
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_VIEW);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonPanel* pPanelView = pCategoryHome->AddPanel(strTemp, m_PanelImages.ExtractIcon (7));
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_STATUSBAR);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonButton* pBtnStatusBar = new CMFCRibbonCheckBox(ID_VIEW_STATUS_BAR, strTemp);
|
|
|
- pPanelView->Add(pBtnStatusBar);
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_CAPTIONBAR);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonButton* pBtnCaptionBar = new CMFCRibbonCheckBox(ID_VIEW_CAPTION_BAR, strTemp);
|
|
|
- pPanelView->Add(pBtnCaptionBar);
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-#pragma region 调试栏目相关;
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_HOME);
|
|
|
- ASSERT(bNameValid);
|
|
|
- strTemp = _T("调试(&D)");
|
|
|
- CMFCRibbonCategory* pCategoryDebug = m_wndRibbonBar.AddCategory(strTemp, IDB_WRITESMALL, IDB_WRITELARGE);
|
|
|
-
|
|
|
-
|
|
|
- strTemp = _T("工站参数");
|
|
|
- CMFCRibbonPanel* pPanelDebug = pCategoryDebug->AddPanel(strTemp, m_PanelImages.ExtractIcon(7));
|
|
|
-
|
|
|
- pPanelDebug->SetCenterColumnVert(TRUE);
|
|
|
-
|
|
|
- pPanelDebug->SetJustifyColumns(TRUE);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- CMFCRibbonButtonsGroup* pGroupDebug = new CMFCRibbonButtonsGroup();
|
|
|
- pPanelDebug->Add(pGroupDebug);
|
|
|
-
|
|
|
-
|
|
|
- strTemp = _T("线体");
|
|
|
- CMFCRibbonLabel* pCameraLable = new CMFCRibbonLabel(strTemp);
|
|
|
- pGroupDebug->AddButton(pCameraLable);
|
|
|
- pCameraLable->SetRect(CRect(0, 0, 150, 20));
|
|
|
-
|
|
|
- strTemp = _T("线体");
|
|
|
- CMFCRibbonEdit* pCameraEdit = new CMFCRibbonEdit(0, 100, strTemp);
|
|
|
- pGroupDebug->AddButton(pCameraEdit);
|
|
|
- pCameraEdit->SetRect(CRect(0, 0, 150, 20));
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-#pragma region 日志栏目相关;
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_HOME);
|
|
|
- ASSERT(bNameValid);
|
|
|
- strTemp = _T("日志(&L)");
|
|
|
- CMFCRibbonCategory* pCategoryDebugLog = m_wndRibbonBar.AddCategory(strTemp, IDB_WRITESMALL, IDB_WRITELARGE);
|
|
|
-
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-#pragma region 统计栏目相关;
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_HOME);
|
|
|
- ASSERT(bNameValid);
|
|
|
- strTemp = _T("统计(&S)");
|
|
|
- CMFCRibbonCategory* pCategoryStatistics = m_wndRibbonBar.AddCategory(strTemp, IDB_WRITESMALL, IDB_WRITELARGE);
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-#pragma region 设置栏目相关;
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_HOME);
|
|
|
- ASSERT(bNameValid);
|
|
|
- strTemp = _T("设置(&C)");
|
|
|
- CMFCRibbonCategory* pCategoryConfig = m_wndRibbonBar.AddCategory(strTemp, IDB_WRITESMALL, IDB_WRITELARGE);
|
|
|
-#pragma endregion
|
|
|
-
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_STYLE);
|
|
|
- ASSERT(bNameValid);
|
|
|
- CMFCRibbonButton* pVisualStyleButton = new CMFCRibbonButton(-1, strTemp, -1, -1);
|
|
|
-
|
|
|
- pVisualStyleButton->SetMenu(IDR_THEME_MENU, FALSE , TRUE );
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_STYLE_TIP);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pVisualStyleButton->SetToolTipText(strTemp);
|
|
|
- bNameValid = strTemp.LoadString(IDS_RIBBON_STYLE_DESC);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pVisualStyleButton->SetDescription(strTemp);
|
|
|
- m_wndRibbonBar.AddToTabs(pVisualStyleButton);
|
|
|
-
|
|
|
-#ifndef DISABLE_QUICKACCESS
|
|
|
-
|
|
|
- CList<UINT, UINT> lstQATCmds;
|
|
|
-
|
|
|
- lstQATCmds.AddTail(ID_FILE_NEW);
|
|
|
- lstQATCmds.AddTail(ID_FILE_OPEN);
|
|
|
- lstQATCmds.AddTail(ID_FILE_SAVE);
|
|
|
- lstQATCmds.AddTail(ID_FILE_PRINT_DIRECT);
|
|
|
-
|
|
|
- m_wndRibbonBar.SetQuickAccessCommands(lstQATCmds);
|
|
|
-#endif
|
|
|
-
|
|
|
- m_wndRibbonBar.AddToTabs(new CMFCRibbonButton(ID_APP_ABOUT, _T("\na"), m_PanelImages.ExtractIcon (0)));
|
|
|
-}
|
|
|
-
|
|
|
-BOOL CMainFrame::CreateDockingWindows()
|
|
|
-{
|
|
|
- BOOL bNameValid;
|
|
|
-
|
|
|
-
|
|
|
- CString strClassView;
|
|
|
- bNameValid = strClassView.LoadString(IDS_CLASS_VIEW);
|
|
|
- ASSERT(bNameValid);
|
|
|
- if (!m_wndClassView.Create(strClassView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_CLASSVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
|
|
|
- {
|
|
|
- TRACE0("未能创建“类视图”窗口\n");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- CString strFileView;
|
|
|
- bNameValid = strFileView.LoadString(IDS_FILE_VIEW);
|
|
|
- ASSERT(bNameValid);
|
|
|
- if (!m_wndFileView.Create(strFileView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT| CBRS_FLOAT_MULTI))
|
|
|
- {
|
|
|
- TRACE0("未能创建“文件视图”窗口\n");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- CString strOutputWnd;
|
|
|
- bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
|
|
|
- ASSERT(bNameValid);
|
|
|
- if (!m_wndOutput.Create(strOutputWnd, this, CRect(0, 0, 100, 100), TRUE, ID_VIEW_OUTPUTWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
|
|
|
- {
|
|
|
- TRACE0("未能创建输出窗口\n");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- CString strPropertiesWnd;
|
|
|
- bNameValid = strPropertiesWnd.LoadString(IDS_PROPERTIES_WND);
|
|
|
- ASSERT(bNameValid);
|
|
|
- if (!m_wndProperties.Create(strPropertiesWnd, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_PROPERTIESWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
|
|
|
- {
|
|
|
- TRACE0("未能创建“属性”窗口\n");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- SetDockingWindowIcons(theApp.m_bHiColorIcons);
|
|
|
- return TRUE;
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::SetDockingWindowIcons(BOOL bHiColorIcons)
|
|
|
-{
|
|
|
- HICON hFileViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_FILE_VIEW_HC : IDI_FILE_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
|
|
|
- m_wndFileView.SetIcon(hFileViewIcon, FALSE);
|
|
|
-
|
|
|
- HICON hClassViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_CLASS_VIEW_HC : IDI_CLASS_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
|
|
|
- m_wndClassView.SetIcon(hClassViewIcon, FALSE);
|
|
|
-
|
|
|
- HICON hOutputBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_OUTPUT_WND_HC : IDI_OUTPUT_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
|
|
|
- m_wndOutput.SetIcon(hOutputBarIcon, FALSE);
|
|
|
-
|
|
|
- HICON hPropertiesBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_PROPERTIES_WND_HC : IDI_PROPERTIES_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
|
|
|
- m_wndProperties.SetIcon(hPropertiesBarIcon, FALSE);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-#ifndef DISABLE_OUTLOOKBAR
|
|
|
-BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth)
|
|
|
-{
|
|
|
- CWindowDC dc(NULL);
|
|
|
-
|
|
|
- bar.SetMode2003();
|
|
|
-
|
|
|
- BOOL bNameValid;
|
|
|
- CString strTemp;
|
|
|
- bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
|
|
|
- ASSERT(bNameValid);
|
|
|
- if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
|
|
|
- {
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();
|
|
|
-
|
|
|
- if (pOutlookBar == NULL)
|
|
|
- {
|
|
|
- ASSERT(FALSE);
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- pOutlookBar->EnableInPlaceEdit(TRUE);
|
|
|
-
|
|
|
- static UINT uiPageID = 1;
|
|
|
-
|
|
|
- DWORD dwPaneStyle = AFX_DEFAULT_TOOLBAR_STYLE | CBRS_FLOAT_MULTI;
|
|
|
-
|
|
|
-
|
|
|
- DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;
|
|
|
-
|
|
|
- CRect rectDummy(0, 0, 0, 0);
|
|
|
- const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
|
|
|
-
|
|
|
- tree.Create(dwTreeStyle, rectDummy, &bar, 1200);
|
|
|
- bNameValid = strTemp.LoadString(IDS_FOLDERS);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pOutlookBar->AddControl(&tree, strTemp, 2, TRUE, dwStyle);
|
|
|
-
|
|
|
- calendar.Create(rectDummy, &bar, 1201);
|
|
|
- bNameValid = strTemp.LoadString(IDS_CALENDAR);
|
|
|
- ASSERT(bNameValid);
|
|
|
- pOutlookBar->AddControl(&calendar, strTemp, 3, TRUE, dwStyle);
|
|
|
-
|
|
|
- bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
|
|
|
-
|
|
|
- pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
|
|
|
- pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
|
|
|
- pOutlookBar->RecalcLayout();
|
|
|
-
|
|
|
- BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
|
|
|
- CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);
|
|
|
-
|
|
|
- bar.SetButtonsFont(&afxGlobalData.fontBold);
|
|
|
-
|
|
|
- return TRUE;
|
|
|
-}
|
|
|
-
|
|
|
-BOOL CMainFrame::CreateCaptionBar()
|
|
|
-{
|
|
|
- if (!m_wndCaptionBar.Create(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, this, ID_VIEW_CAPTION_BAR, -1, TRUE))
|
|
|
- {
|
|
|
- TRACE0("未能创建标题栏\n");
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- BOOL bNameValid;
|
|
|
-
|
|
|
- CString strTemp, strTemp2;
|
|
|
- bNameValid = strTemp.LoadString(IDS_CAPTION_BUTTON);
|
|
|
- ASSERT(bNameValid);
|
|
|
- m_wndCaptionBar.SetButton(strTemp, ID_TOOLS_OPTIONS, CMFCCaptionBar::ALIGN_LEFT, FALSE);
|
|
|
- bNameValid = strTemp.LoadString(IDS_CAPTION_BUTTON_TIP);
|
|
|
- ASSERT(bNameValid);
|
|
|
- m_wndCaptionBar.SetButtonToolTip(strTemp);
|
|
|
-
|
|
|
- bNameValid = strTemp.LoadString(IDS_CAPTION_TEXT);
|
|
|
- ASSERT(bNameValid);
|
|
|
- m_wndCaptionBar.SetText(strTemp, CMFCCaptionBar::ALIGN_LEFT);
|
|
|
-
|
|
|
- m_wndCaptionBar.SetBitmap(IDB_INFO, RGB(255, 255, 255), FALSE, CMFCCaptionBar::ALIGN_LEFT);
|
|
|
- bNameValid = strTemp.LoadString(IDS_CAPTION_IMAGE_TIP);
|
|
|
- ASSERT(bNameValid);
|
|
|
- bNameValid = strTemp2.LoadString(IDS_CAPTION_IMAGE_TEXT);
|
|
|
- ASSERT(bNameValid);
|
|
|
- m_wndCaptionBar.SetImageToolTip(strTemp, strTemp2);
|
|
|
-
|
|
|
- return TRUE;
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-#ifdef _DEBUG
|
|
|
-void CMainFrame::AssertValid() const
|
|
|
-{
|
|
|
- CFrameWndEx::AssertValid();
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::Dump(CDumpContext& dc) const
|
|
|
-{
|
|
|
- CFrameWndEx::Dump(dc);
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-void CMainFrame::OnApplicationLook(UINT id)
|
|
|
-{
|
|
|
- CWaitCursor wait;
|
|
|
-
|
|
|
- theApp.m_nAppLook = id;
|
|
|
-
|
|
|
- switch (theApp.m_nAppLook)
|
|
|
- {
|
|
|
- case ID_VIEW_APPLOOK_WIN_2000:
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManager));
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_OFF_XP:
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOfficeXP));
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_WIN_XP:
|
|
|
- CMFCVisualManagerWindows::m_b3DTabsXPTheme = TRUE;
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_OFF_2003:
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2003));
|
|
|
- CDockingManager::SetDockingMode(DT_SMART);
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_VS_2005:
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2005));
|
|
|
- CDockingManager::SetDockingMode(DT_SMART);
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- switch (theApp.m_nAppLook)
|
|
|
- {
|
|
|
- case ID_VIEW_APPLOOK_OFF_2007_BLUE:
|
|
|
- CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_LunaBlue);
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_OFF_2007_BLACK:
|
|
|
- CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_ObsidianBlack);
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_OFF_2007_SILVER:
|
|
|
- CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Silver);
|
|
|
- break;
|
|
|
-
|
|
|
- case ID_VIEW_APPLOOK_OFF_2007_AQUA:
|
|
|
- CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Aqua);
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007));
|
|
|
- CDockingManager::SetDockingMode(DT_SMART);
|
|
|
- }
|
|
|
-
|
|
|
- RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE);
|
|
|
-
|
|
|
- theApp.WriteInt(_T("ApplicationLook"), theApp.m_nAppLook);
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::OnUpdateApplicationLook(CCmdUI* pCmdUI)
|
|
|
-{
|
|
|
- pCmdUI->SetRadio(theApp.m_nAppLook == pCmdUI->m_nID);
|
|
|
-}
|
|
|
-
|
|
|
-#ifndef DISABLE_CAPTIONBAR
|
|
|
-void CMainFrame::OnViewCaptionBar()
|
|
|
-{
|
|
|
- m_wndCaptionBar.ShowWindow(m_wndCaptionBar.IsVisible() ? SW_HIDE : SW_SHOW);
|
|
|
- RecalcLayout(FALSE);
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::OnUpdateViewCaptionBar(CCmdUI* pCmdUI)
|
|
|
-{
|
|
|
- pCmdUI->SetCheck(m_wndCaptionBar.IsVisible());
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-void CMainFrame::OnFilePrint()
|
|
|
-{
|
|
|
- if (IsPrintPreview())
|
|
|
- {
|
|
|
- PostMessage(WM_COMMAND, AFX_ID_PREVIEW_PRINT);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::OnFilePrintPreview()
|
|
|
-{
|
|
|
- if (IsPrintPreview())
|
|
|
- {
|
|
|
- PostMessage(WM_COMMAND, AFX_ID_PREVIEW_CLOSE);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void CMainFrame::OnUpdateFilePrintPreview(CCmdUI* pCmdUI)
|
|
|
-{
|
|
|
- pCmdUI->SetCheck(IsPrintPreview());
|
|
|
-}
|