// 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 "DlgPlatformCtrl.h"
# include "DlgTest.h"
# include "ModuleDeviceMgr.h"
# include "ModuleDrawMgr.h"
# include "DlgAuthorityMgr.h"
# include "AuthorityMgr.h"
# include "DlgObjComponent.h"
# include "DlgMarkArea.h"
# include "MsgBox.h"
# include "TemplateMgr.h"
# include "WorkFileMgr.h"
# include "PropertieMgr.h"
# include "DlgUserMgr.h"
# include "ProgramCutMgr.h"
# 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 ( )
// ȫ<> ְ<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 ( )
ON_COMMAND ( ID_EXPORT_DEVICE_PAR , & CMainFrame : : OnExportDevicePar )
ON_COMMAND ( ID_USER_MGR , & CMainFrame : : OnUserMgr )
ON_COMMAND ( ID_OPEN_FILE , & CMainFrame : : OnOpenFile )
ON_COMMAND ( ID_SAVE_FILE_AS , & CMainFrame : : OnSaveFileAs )
ON_COMMAND ( ID_SAVE_FILE_AS2 , & CMainFrame : : OnSaveFileAs2 )
ON_COMMAND ( ID_SAVE_FILE , & CMainFrame : : OnSaveFile )
ON_COMMAND ( ID_DEVICE_PAR , & CMainFrame : : OnDevicePar )
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 ) ;
# ifdef __DLG_PANE_CMD__
m_OutputCmd . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_OutputCmd ) ;
# endif
m_OutputLog . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_OutputLog ) ;
m_PaneDevicePar . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneDevicePar ) ;
m_PaneDrawPar . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneDrawPar ) ;
# ifdef __DLG_PANE_STD_MARK_CTRL__
m_StdMarkCtrlPane . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_StdMarkCtrlPane ) ;
# endif
# ifdef __DLG_PANE_SIMULATE_TRACE__
m_SimulatetracePane . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_SimulatetracePane ) ;
# endif
# ifdef __DLG_PANE_WORK_TIME__
m_WorkTimePane . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_WorkTimePane ) ;
# endif
# ifdef __DLG_PANE_MARK_PAR__
m_MarkParPane . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_MarkParPane ) ;
# endif
# ifdef __DLG_PANE_VAR_STRING__
m_PaneValString . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneValString ) ;
# endif
# ifdef __DLG_PANE_PLATFORM__
m_PanePlatformCtrl . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PanePlatformCtrl ) ;
# endif
# ifdef __DLG_PANE_TEST__
m_PaneTest . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneTest ) ;
# endif
# ifdef __DLG_PANE_OBJ_LIST__
m_ObjListPane . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_ObjListPane ) ;
# endif
# ifdef __LPS_IS3000__
m_PaneHawkvisCamera . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneHawkvisCamera ) ;
//m_PaneCutDeviceCtrl.EnableDocking(CBRS_ALIGN_ANY);
//DockPane(&m_PaneCutDeviceCtrl);
m_PaneSW_XL_Flow . EnableDocking ( CBRS_ALIGN_ANY ) ;
DockPane ( & m_PaneSW_XL_Flow ) ;
# 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> )
// TODO: <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> <D4BC> Ļ<EFBFBD> <C4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EEA3AC> <C8B7> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <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 ) ;
lstBasicCommands . AddTail ( ID_EXPORT_DEVICE_PAR ) ;
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);
#if 0 //<2F> <> <EFBFBD> ó<EFBFBD> <C3B3> <EFBFBD> Ĭ<EFBFBD> ϵĹرհ <D8B1> ť
CMenu * pMenu = GetSystemMenu ( false ) ;
UINT nID = pMenu - > GetMenuItemID ( pMenu - > GetMenuItemCount ( ) - 1 ) ;
pMenu - > EnableMenuItem ( nID , MF_DISABLED ) ;
# endif
return 0 ;
}
BOOL CMainFrame : : PreCreateWindow ( CREATESTRUCT & cs )
{
if ( ! CMDIFrameWndEx : : PreCreateWindow ( cs ) )
return FALSE ;
// TODO: <20> ڴ˴ <DAB4> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD>
// 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 ( )
{
# ifdef __DLG_PANE_CMD__
//<2F> <> <EFBFBD> <EFBFBD> <EEB4B0> ---------------------------------------------------------------
if ( ! m_OutputCmd . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> cmd" ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , ID_OUTPUT_CMD , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \n " ) ;
return FALSE ; // δ<> ܴ<EFBFBD> <DCB4> <EFBFBD>
}
# endif
//<2F> <> ־<EFBFBD> <D6BE> <EFBFBD> <EFBFBD> ---------------------------------------------------------------
if ( ! m_OutputLog . Create ( _T ( " <EFBFBD> <EFBFBD> ־" ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , ID_OUTPUT_LOG , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ־<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \n " ) ;
return FALSE ; // δ<> ܴ<EFBFBD> <DCB4> <EFBFBD>
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> -------------------------------------------------------
if ( ! m_PaneDrawPar . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 200 , 200 ) , TRUE , ID_PANE_DRAW_PROP , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \n " ) ;
return FALSE ; // δ<> ܴ<EFBFBD> <DCB4> <EFBFBD>
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 豸<EFBFBD> <E8B1B8> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> -------------------------------------------------------
if ( ! m_PaneDevicePar . Create ( _T ( " <EFBFBD> 豸<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 200 , 200 ) , TRUE , ID_PANE_DEVICE_PROP , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \n " ) ;
return FALSE ; // δ<> ܴ<EFBFBD> <DCB4> <EFBFBD>
}
# ifdef __DLG_PANE_STD_MARK_CTRL__
//<2F> <> <EFBFBD> <D7BC> <EFBFBD> ̿<EFBFBD> <CCBF> <EFBFBD> -----------------------------------------------------
m_StdMarkCtrlPane . SetDlg ( & m_DlgStdMarkCtr ) ;
if ( ! m_StdMarkCtrlPane . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ̿<EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 0 , 0 ) , TRUE , m_DlgStdMarkCtr . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̿<EFBFBD> <EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_StdMarkCtrlPane . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_SIMULATE_TRACE__
//<2F> <> <EFBFBD> ݹ켣ģ<ECBCA3> <C4A3> -----------------------------------------------------
m_SimulatetracePane . SetDlg ( & m_DlgSimulatetrace ) ;
if ( ! m_SimulatetracePane . Create ( _T ( " <EFBFBD> 켣ģ<EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 0 , 0 ) , TRUE , m_DlgSimulatetrace . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 켣ģ<EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_SimulatetracePane . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_WORK_TIME__
//<2F> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> -----------------------------------------------------
m_WorkTimePane . SetDlg ( & m_DlgWorkTime ) ;
if ( ! m_WorkTimePane . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 0 , 0 ) , TRUE , m_DlgWorkTime . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_WorkTimePane . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_MARK_PAR__
//<2F> <> <EFBFBD> ̲<EFBFBD> <CCB2> <EFBFBD> -----------------------------------------------------
m_MarkParPane . SetDlg ( & m_CDlgMarkPar ) ;
if ( ! m_MarkParPane . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 0 , 0 ) , TRUE , m_CDlgMarkPar . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_MarkParPane . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_VAR_STRING__
//<2F> ɱ<EFBFBD> <C9B1> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> <EFBFBD> -----------------------------------------------------
m_PaneValString . SetDlg ( & m_DlgVariableString ) ;
if ( ! m_PaneValString . Create ( _T ( " <EFBFBD> ַ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgVariableString . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɱ<EFBFBD> <EFBFBD> ַ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_PaneValString . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_PLATFORM__
//ƽ ̨<C6BD> <CCA8> <EFBFBD> <EFBFBD> -----------------------------------------------------
m_PanePlatformCtrl . SetDlg ( & m_DlgPlatformCtrl ) ;
if ( ! m_PanePlatformCtrl . Create ( _T ( " ƽ ̨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgPlatformCtrl . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> ƽ ̨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_PanePlatformCtrl . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __LPS_IS3000__
m_PaneHawkvisCamera . SetDlg ( & m_DlgHawkvisCamera ) ;
if ( ! m_PaneHawkvisCamera . Create ( _T ( " CCD <20> <> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgHawkvisCamera . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> Info/n " ) ;
return FALSE ;
}
m_PaneHawkvisCamera . EnableDocking ( CBRS_ALIGN_ANY ) ;
/* m_PaneCutDeviceCtrl.SetDlg(&m_DlgCutDeviceCtrl);
if ( ! m_PaneCutDeviceCtrl . Create ( _T ( " <EFBFBD> 豸<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgCutDeviceCtrl . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> Ctrl Btn/n " ) ;
return FALSE ;
}
m_PaneCutDeviceCtrl . EnableDocking ( CBRS_ALIGN_ANY ) ; */
m_PaneSW_XL_Flow . SetDlg ( & m_DlgSW_XL_Flow ) ;
if ( ! m_PaneSW_XL_Flow . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ̿<EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgSW_XL_Flow . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> Ctrl Btn/n " ) ;
return FALSE ;
}
m_PaneSW_XL_Flow . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_TEST__
//<2F> <> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> -----------------------------------------------------
m_PaneTest . SetDlg ( & m_DlgTest ) ;
if ( ! m_PaneTest . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> " ) , this , CRect ( 0 , 0 , 100 , 100 ) , TRUE , m_DlgTest . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> /n " ) ;
return FALSE ;
}
m_PaneTest . EnableDocking ( CBRS_ALIGN_ANY ) ;
# endif
# ifdef __DLG_PANE_OBJ_LIST__
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> -----------------------------------------------------
m_ObjListPane . SetDlg ( & m_DlgObjList ) ;
if ( ! m_ObjListPane . Create ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> " ) , this , CRect ( 0 , 0 , 0 , 0 ) , TRUE , m_DlgObjList . GetIDD ( ) ,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI ) )
{
TRACE0 ( " δ<EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> /n " ) ;
return FALSE ;
}
m_ObjListPane . 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 ) ;
}
# 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 ( )
{
# ifdef __CAPTION_BAR__
CString Wstr = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : " + m_CaptionCmdStr + m_CaptionInputStr ;
m_wndCaptionBar . SetText ( Wstr , CMFCCaptionBar : : ALIGN_LEFT ) ;
# endif
}
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 ( )
{
# ifdef __DLG_PANE_VAR_STRING__
m_DlgVariableString . UnBindingObj ( ) ;
# endif
}
# endif
# if 1 //<2F> ˵<EFBFBD> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD>
void CMainFrame : : OnOpenFile ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _USER , true ) = = false )
return ;
CWorkFileMgr WorkFileMgr ;
WorkFileMgr . OnOpenFile ( ) ;
GetCurViewPtr ( ) - > RefreshView ( ) ;
gDrawPropertieMgr . SaveAllPropertie ( ) ;
gDevicePropertieMgr . SaveAllPropertie ( ) ;
}
//<2F> <> <EFBFBD> 浱ǰ<E6B5B1> <EFBFBD> <F2BFAAB5> ĵ<EFBFBD>
void CMainFrame : : OnSaveFile ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
CWorkFileMgr WorkFileMgr ;
WorkFileMgr . OnSaveFile ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> Ϊ
void CMainFrame : : OnSaveFileAs ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
CWorkFileMgr WorkFileMgr ;
WorkFileMgr . OnSaveFileAs ( ) ;
}
void CMainFrame : : OnSaveFileAs2 ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
gProgramCutMgr - > SaveMarkFile2 ( ) ;
}
# endif
# if 1
//<2F> <> <EFBFBD> <EFBFBD> ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD>
void CMainFrame : : OnExportDevicePar ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
TCHAR szFilters [ ] = ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ļ<EFBFBD> (*.txt)|*.txt" ) ;
CFileDialog dlg ( FALSE , ( " txt " ) , ( " DeviceParFile " ) , OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT , szFilters ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
ofstream File ;
File . open ( dlg . GetPathName ( ) ) ;
gModuleDeviceMgr . ExportDevicePar ( & File ) ;
gModuleDrawMgr . ExportDevicePar ( & File ) ;
File . close ( ) ;
}
}
//<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
void CMainFrame : : OnUserMgr ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
CDlgUserMgr dlg ;
dlg . DoModal ( ) ;
}
# endif
# if 1
//<2F> <> ʼ <EFBFBD> <CABC> ʱ
void CMainFrame : : StartRecordTime ( )
{
# ifdef __DLG_PANE_WORK_TIME__
m_DlgWorkTime . StartRecordTime ( ) ;
# endif
}
void CMainFrame : : StopRecordTime ( )
{
# ifdef __DLG_PANE_WORK_TIME__
m_DlgWorkTime . StopRecordTime ( ) ;
# endif
}
# endif
# if 1
void CMainFrame : : OnDevicePar ( )
{
if ( gAuthorityMgr - > CheckAuthority ( _ADMIN , true ) = = false )
return ;
}
# endif