You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

571 lines
16 KiB
C++

// MainFrm.cpp : CMainFrame <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
#include "stdafx.h"
#include "LaiPuLaser.h"
#include "MainFrm.h"
#include "GlobalDrawMgr.h"
#include "LogMgr.h"
#include "PltReader.h"
#include "GlobalFunction.h"
#include "MarkObjPropertieMgr.h"
#include "ModuleDeviceMgr.h"
#include "ModuleDrawMgr.h"
#include "DlgAuthorityLogin.h"
#include "AuthorityMgr.h"
#include "MsgBox.h"
#include "TemplateMgr.h"
#include "WorkFileMgr.h"
#include "PropertieMgr.h"
#include "DlgAuthorityAccount.h"
#include "WorkTime.h"
#include "ProgramLaserTuiHuo.h"
#include "FileMgr.h"
#include "DlgDeviceMain.h"
#include "DlgChildEventLog.h"
#define DLG_FACTORY_MODE_FILE _T("\\Factory_mode_0.bat") //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD>ļ<EFBFBD>
#define PAR_TempVal "PAR_TempVal"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
#define PAR_TempErrMsg "PAR_TempErrMsg"//<2F><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD>Ϣ
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWndEx)
const int iMaxUserToolbars = 10;
const UINT uiFirstUserToolBarId = AFX_IDW_CONTROLBAR_FIRST + 40;
const UINT uiLastUserToolBarId = uiFirstUserToolBarId + iMaxUserToolbars - 1;
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWndEx)
ON_WM_CREATE()
ON_WM_COPYDATA()//<2F><>Ӧ<EFBFBD><D3A6><EFBFBD>̼<EFBFBD><CCBC><EFBFBD>Ϣ
// ȫ<>ְ<EFBFBD><D6B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ON_COMMAND(ID_HELP_FINDER, &CMDIFrameWndEx::OnHelpFinder)
ON_COMMAND(ID_HELP, &CMDIFrameWndEx::OnHelp)
ON_COMMAND(ID_DEFAULT_HELP, &CMDIFrameWndEx::OnHelpFinder)
ON_COMMAND(ID_WINDOW_MANAGER, &CMainFrame::OnWindowManager)
ON_COMMAND(ID_VIEW_CUSTOMIZE, &CMainFrame::OnViewCustomize)
ON_REGISTERED_MESSAGE(AFX_WM_CREATETOOLBAR, &CMainFrame::OnToolbarCreateNew)
ON_COMMAND_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnApplicationLook)
ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnUpdateApplicationLook)
ON_COMMAND(ID_VIEW_CAPTION_BAR, &CMainFrame::OnViewCaptionBar)
ON_UPDATE_COMMAND_UI(ID_VIEW_CAPTION_BAR, &CMainFrame::OnUpdateViewCaptionBar)
ON_COMMAND(ID_TOOLS_OPTIONS, &CMainFrame::OnOptions)
ON_WM_SETTINGCHANGE()
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // ״̬<D7B4><CCAC>ָʾ<D6B8><CABE>
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
// CMainFrame <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>
CMainFrame::CMainFrame()
{
theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_VS_2008);
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
BOOL bNameValid;
// <20><><EFBFBD>ڳ־<DAB3>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD>Ӿ<EFBFBD><D3BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
OnApplicationLook(theApp.m_nAppLook);
CMDITabInfo mdiTabParams;
#if 0//<2F><>Ҫѡ<D2AA>ʽ<EEBFA8>ĵ<EFBFBD>
mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ONENOTE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ...
mdiTabParams.m_bActiveTabCloseButton = TRUE; // <20><><EFBFBD><EFBFBD>Ϊ FALSE <20><EFBFBD>رհ<D8B1>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EEBFA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>
mdiTabParams.m_bTabIcons = FALSE; // <20><><EFBFBD><EFBFBD>Ϊ TRUE <20><><EFBFBD><EFBFBD> MDI ѡ<><EFBFBD><EEBFA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ͼ<EFBFBD><CDBC>
mdiTabParams.m_bAutoColor = TRUE; // <20><><EFBFBD><EFBFBD>Ϊ FALSE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MDI ѡ<><EFBFBD><EEBFA8><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ɫ
mdiTabParams.m_bDocumentMenu = TRUE; // <20><>ѡ<EFBFBD><EFBFBD><EEBFA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>˵<EFBFBD>
EnableMDITabbedGroups(TRUE, mdiTabParams);
#endif
if (!m_wndMenuBar.Create(this))
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>\n");
return -1; // δ<>ܴ<EFBFBD><DCB4><EFBFBD>
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);
// <20><>ֹ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
CMFCPopupMenu::SetForceMenuFocus(FALSE);
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME))
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return -1; // δ<>ܴ<EFBFBD><DCB4><EFBFBD>
}
CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
if (!m_wndStatusBar.Create(this))
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>\n");
return -1; // δ<>ܴ<EFBFBD><DCB4><EFBFBD>
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ˵<CDB2><CBB5><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#if 1
// <20><><EFBFBD><EFBFBD> Visual Studio 2005 <20><>ʽͣ<CABD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ
CDockingManager::SetDockingMode(DT_SMART);
// <20><><EFBFBD><EFBFBD> Visual Studio 2005 <20><>ʽͣ<CABD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>񽫴<EFBFBD><F1BDABB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A3AC><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3>:
EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT);
#endif
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
if (!CreateCaptionBar())
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return -1; // δ<>ܴ<EFBFBD><DCB4><EFBFBD>
}
// <20>Ѵ<EFBFBD><D1B4><EFBFBD> Outlook <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>
EnableDocking(CBRS_ALIGN_LEFT);
EnableAutoHidePanes(CBRS_ALIGN_RIGHT);
// <20><><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (!CreateDockingWindows())
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return -1;
}
EnableDocking(CBRS_ALIGN_ANY);
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndToolBar);
m_GraphEditPane.EnableDocking(CBRS_ALIGN_TOP);
DockPane(&m_GraphEditPane);
#if 0
m_DeviceMainPane.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_DeviceMainPane);
#endif
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>Ĵ<EFBFBD><C4B4>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>
EnableWindowsDialog(ID_WINDOW_MANAGER, ID_WINDOW_MANAGER, TRUE);
// <20><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD>ڲ˵<DAB2><CBB5>
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// <20><><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>(<28><>ס Alt <20>϶<EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
// <20><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD><EFBFBD>Ի<EFBFBD>(<28><><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>)
CList<UINT, UINT> lstBasicCommands;
lstBasicCommands.AddTail(ID_FILE_NEW);
lstBasicCommands.AddTail(ID_FILE_OPEN);
lstBasicCommands.AddTail(ID_FILE_SAVE);
lstBasicCommands.AddTail(ID_FILE_PRINT);
lstBasicCommands.AddTail(ID_APP_EXIT);
lstBasicCommands.AddTail(ID_EDIT_CUT);
lstBasicCommands.AddTail(ID_EDIT_PASTE);
lstBasicCommands.AddTail(ID_EDIT_UNDO);
lstBasicCommands.AddTail(ID_APP_ABOUT);
lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR);
lstBasicCommands.AddTail(ID_VIEW_TOOLBAR);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2003);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_VS_2005);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLUE);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_SILVER);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLACK);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_AQUA);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_WINDOWS_7);
CMFCToolBar::SetBasicCommands(lstBasicCommands);
// <20><><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD>Ϊ<EFBFBD><CEAA>ʾ<EFBFBD><CABE><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
//ModifyStyle(0, FWS_PREFIXTITLE);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWndEx::PreCreateWindow(cs) )
return FALSE;
// CREATESTRUCT cs <20><><EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
return TRUE;
}
#if 1//<2F><>ͣ<EFBFBD><CDA3><EFBFBD>ؼ<EFBFBD>
BOOL CMainFrame::CreateDockingWindows()
{
CFileMgr FileMgr;
CString FilePath;
FileMgr.GetFullFilePath(FilePath,DLG_FACTORY_MODE_FILE);//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><C2B7>
if(FileMgr.IsFileExist(FilePath))
{
gbFactoryMode = true;
}
{
m_GraphEditPane.SetDlg(&m_DlgGraphEdit);
if (!m_GraphEditPane.Create(_T("Drawing"), this, CRect(0, 0, 0, 0), TRUE, m_DlgGraphEdit.GetIDD(),
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
return FALSE;
}
m_GraphEditPane.EnableDocking(CBRS_ALIGN_ANY);
}
gDlgDeviceMain = new CDlgDeviceMain;
gDlgDeviceMain->Create(IDD_DEVICE_MAIN_DLG, this);
#if 0
{
m_DeviceMainPane.SetDlg(&m_DlgDeviceMain);
if (!m_DeviceMainPane.Create(_T("Laipu Laser"), this, CRect(0, 0, 3000, 2000), TRUE, m_DlgDeviceMain.GetIDD(),
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
return FALSE;
}
m_DeviceMainPane.EnableDocking(CBRS_ALIGN_ANY);
}
#endif
return TRUE;
}
#endif
BOOL CMainFrame::CreateCaptionBar()
{
#ifdef __CAPTION_BAR__
if (!m_wndCaptionBar.Create(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, this, ID_VIEW_CAPTION_BAR, -1, TRUE))
{
TRACE0("δ<EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return FALSE;
}
ResetCaptionBar();
#endif
return TRUE;
}
// CMainFrame <20><><EFBFBD><EFBFBD>
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWndEx::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWndEx::Dump(dc);
}
#endif //_DEBUG
// CMainFrame <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CMainFrame::OnWindowManager()
{
ShowWindowsDialog();
}
void CMainFrame::OnViewCustomize()
{
CMFCToolBarsCustomizeDialog* pDlgCust = new CMFCToolBarsCustomizeDialog(this, TRUE /* ɨ<><C9A8><EFBFBD>˵<EFBFBD>*/);
pDlgCust->EnableUserDefinedToolbars();
pDlgCust->Create();
}
LRESULT CMainFrame::OnToolbarCreateNew(WPARAM wp,LPARAM lp)
{
LRESULT lres = CMDIFrameWndEx::OnToolbarCreateNew(wp,lp);
if (lres == 0)
{
return 0;
}
CMFCToolBar* pUserToolbar = (CMFCToolBar*)lres;
ASSERT_VALID(pUserToolbar);
BOOL bNameValid;
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
return lres;
}
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;
case ID_VIEW_APPLOOK_VS_2008:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2008));
CDockingManager::SetDockingMode(DT_SMART);
break;
case ID_VIEW_APPLOOK_WINDOWS_7:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows7));
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);
}
void CMainFrame::OnViewCaptionBar()
{
#ifdef __CAPTION_BAR__
m_wndCaptionBar.ShowWindow(m_wndCaptionBar.IsVisible() ? SW_HIDE : SW_SHOW);
RecalcLayout(FALSE);
#endif
}
void CMainFrame::OnUpdateViewCaptionBar(CCmdUI* pCmdUI)
{
#ifdef __CAPTION_BAR__
pCmdUI->SetCheck(m_wndCaptionBar.IsVisible());
#endif
}
void CMainFrame::OnOptions()
{
}
BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
// <20><><EFBFBD>ཫִ<E0BDAB><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>
if (!CMDIFrameWndEx::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext))
{
return FALSE;
}
// Ϊ<><CEAA><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>尴ť
BOOL bNameValid;
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
for (int i = 0; i < iMaxUserToolbars; i ++)
{
CMFCToolBar* pUserToolbar = GetUserToolBarByIndex(i);
if (pUserToolbar != NULL)
{
pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
}
}
return TRUE;
}
void CMainFrame::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
CMDIFrameWndEx::OnSettingChange(uFlags, lpszSection);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>Ϣ
case WM_SYSCOMMAND:
{
if(wParam==SC_CLOSE)
{
CMsgBox MsgBox;
if(gProgramLaserTuiHuo->CloseAppCheck()==false)
return 0;
}
break;
}
}
return CMDIFrameWndEx::WindowProc(message, wParam, lParam);
}
#if 1
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CMainFrame::ShowMouseCoord(CPoint point)
{
Dbxy pt = gDraw->CPoint2Dbxy(point);
CString MouseX,MouseY;
MouseX.Format("%lf",pt.x);
MouseY.Format("%lf",pt.y);
CString str = "<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>λmm ):x = ["+MouseX+"]"+" y = ["+MouseY+"]";
str += " "+m_StatusBarExtStr;
m_wndStatusBar.SetPaneText(0,(LPCTSTR)str,TRUE);
}
//<2F><>ʾview <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>
void CMainFrame::ShowViewScale(double s)
{
CString Str;
Str.Format("%lf",s);
m_wndStatusBar.SetPaneText(0,(LPCTSTR)Str,TRUE);
}
void CMainFrame::SetCaptionCmdStr(CString str)
{
m_CaptionCmdStr = str+STR_INPUT_SYMBOL;
}
void CMainFrame::SetCaptionInputStr(CString str)
{
m_CaptionInputStr = str;
}
void CMainFrame::RefreashCaptionBar()
{
}
void CMainFrame::ResetCaptionBar()
{
m_CaptionCmdStr = "";
m_CaptionInputStr = "";
RefreashCaptionBar();
ResetStatusBarExtStr();
}
void CMainFrame::ResetStatusBarExtStr()
{
m_StatusBarExtStr = "";
}
void CMainFrame::SetStatusBarExtStr(CString str,CString val1,CString val2)
{
if(val1 != STR_NULL || val2 != STR_NULL)
{
str += " : ";
}
if(val1 != STR_NULL)
{
val1 = "<"+val1+">";
}
if(val2 != STR_NULL)
{
val2 = "<"+val2+">";
}
m_StatusBarExtStr = str+val1+val2;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD>󶨵<EFBFBD>obj <20><><EFBFBD><EFBFBD>
void CMainFrame::UnBindingDlg()
{
}
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CMainFrame::LockPane(bool bLock)
{
m_GraphEditPane.EnableGripper(!bLock);
m_DeviceMainPane.EnableGripper(!bLock);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CMainFrame::ShowWindowMax()
{
ShowWindow(SW_SHOWMAXIMIZED);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>
void CMainFrame::ShowWindowMin()
{
ShowWindow(SW_SHOWMINIMIZED);
}
//<2F>յ<EFBFBD><D5B5><EFBFBD><EFBFBD>̼<EFBFBD><CCBC><EFBFBD>Ϣ
BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
CString strRecievedText = (LPCSTR)(pCopyDataStruct->lpData);
if(gChildEventLog)
{
CDlgChildEventLog *pDlgChild = dynamic_cast<CDlgChildEventLog*>(gChildEventLog);
pDlgChild->InsertLogToList(strRecievedText,_LogListType_LaipuLaser);
}
return CMDIFrameWndEx::OnCopyData(pWnd, pCopyDataStruct);
}
#endif