#pragma once #include "stdafx.h" #include "MBUserOfflineDbMgr.h" /************************************************************************/ /* µÇ¼´°¿Ú */ /************************************************************************/ class AFX_EXT_CLASS CMBLoginWnd : public SHostWnd,public SDpiHandler { public: CMBLoginWnd(void); ~CMBLoginWnd(void); private: BOOL m_bLayoutInited; static int m_nRetCode; private: CMBCfgInfo *m_pMBCfgInfo; CMBOrgListMgr *m_pMBOrgListMgr; CMBOrgWebCMgr *m_pMBOrgWebCMgr; CMBUserLogin *m_pMBUserLogin; CMBNetDiskWebCMgr *m_pMBNetDiskCMgr; CMBMoboxWebCMgr *m_pMBMoboxWebCMgr; CMBUserNetDiskInfo*m_pMBUserNetDiskInfo; CMBFileSvrMgr *m_pFileSvrMgr; CMBExtWebCMgr *m_pMBExtWebCMgr; // À©Õ¹Web·þÎñ CSTKExtClientMgr *m_pMBExtCMgr; // À©Õ¹·þÎñ CMBDataWebCMgr *m_pDataWebCMgr; // data ·þÎñ //CMBSysAppMgr *m_pSysAppMgr; CMBBaseAppMgr *m_pAppMgr; SEdit *m_pEdPort; SEdit *m_pEdPwd; SComboView *m_pCbvServerName; SComboView *m_pCbvLogin; SCheckBox *m_pCkAutoLogin; SCheckBox *m_pCkSavePwd; SCheckBox *m_pCkOffline; // wah ÀëÏߵǼ SStatic *m_pTextTip; SStatic *m_pTextError; BOOL m_bShellLogin; int m_nStartLoginTime; CString m_strServer; int m_nPort; CString m_strLoginName; CString m_strPassword; public: CMBUserOfflineDbMgr *m_pUserOfflineDbMgr; public: void OnClose() { AnimateHostWindow(200, AW_CENTER | AW_HIDE); DestroyWindow(); } void OnMaximize() { SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE); } void OnRestore() { SendMessage(WM_SYSCOMMAND, SC_RESTORE); } void OnMinimize() { SendMessage(WM_SYSCOMMAND, SC_MINIMIZE); } int OnCreate(LPCREATESTRUCT lpCreateStruct); BOOL OnInitDialog(HWND wndFocus, LPARAM lInitParam); void OnBtnSetting(); void OnBtnSettingOK(); void OnBtnSettingCancel(); BOOL OnTurn3D(EventArgs *pEvt); BOOL OnAccountChanged(EventArgs *pEvt); BOOL OnServerChanged(EventArgs *pEvt); void OnBtnLogin(); void OnBtnErrorCancel(); void OnTimer(UINT_PTR nIDEvent); int GetReturnCode() { return m_nRetCode; } LRESULT OnOrgWebResponse(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); LRESULT OnOrgWebError(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); LRESULT OnNetDiskResponse(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); LRESULT OnNetDiskError(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); //LRESULT OnMoboxResponse(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); //LRESULT OnMoboxError(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL & bHandled); protected: EVENT_MAP_BEGIN() EVENT_NAME_COMMAND(L"btn_close", OnClose) EVENT_NAME_COMMAND(L"btn_min", OnMinimize) EVENT_NAME_COMMAND(L"btn_setting", OnBtnSetting) EVENT_NAME_COMMAND(L"btn_setting_ok", OnBtnSettingOK) EVENT_NAME_COMMAND(L"btn_setting_cancel", OnBtnSettingCancel) EVENT_NAME_COMMAND(L"btn_login", OnBtnLogin) EVENT_NAME_COMMAND(L"btn_error_cancel", OnBtnErrorCancel) EVENT_NAME_HANDLER(L"turn3d", EventTurn3d::EventID, OnTurn3D); EVENT_NAME_HANDLER(L"cbx_account", EventCBSelChange::EventID, OnAccountChanged) EVENT_NAME_HANDLER(L"cbx_server", EventCBSelChange::EventID, OnServerChanged) EVENT_MAP_END() BEGIN_MSG_MAP_EX(CMBLoginWnd) MESSAGE_HANDLER(WM_ORGWEB_RESPONSE,OnOrgWebResponse) MESSAGE_HANDLER(WM_ORGWEB_ERROR,OnOrgWebError) MESSAGE_HANDLER(WM_NETDISK_RESPONSE,OnNetDiskResponse) MESSAGE_HANDLER(WM_NETDISK_ERROR,OnNetDiskError) /* MESSAGE_HANDLER(WM_MOBOX_RESPONSE,OnMoboxResponse) MESSAGE_HANDLER(WM_MOBOX_ERROR,OnMoboxError)*/ //MSG_WM_TIMER2(OnTimer); // ¼ì²â¿ì½Ý¼ü MSG_WM_KEYDOWN(OnKeyDown) MSG_WM_TIMER_EX(OnTimer) MSG_WM_CREATE(OnCreate) MSG_WM_INITDIALOG(OnInitDialog) MSG_WM_CLOSE(OnClose) CHAIN_MSG_MAP(SHostWnd) REFLECT_NOTIFICATIONS_EX() CHAIN_MSG_MAP(SDpiHandler) END_MSG_MAP() private: void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); public: void SetSvrMgr( CMBServerMgr *pSvrMgr ); void SetCurLoginInfo(CString strServer,int nPort,CString strLoginName,CString strPassword, int nStartLoginTime); private: void Init(); bool SaveCfgInfo(CString strServerID,CString &strErrInfo); void AutoScale(); // ×ÔÊÊÓ¦¸ßƵ BOOL AppIsRun(); protected: bool CopyDb( CString strSrcDb,CString strTargetDb,CString &strErrInfo ); //¿½±´dbÎļþ private: bool IsAllowEnterLogin(); // ÊÇ·ñÔÊÐíEnter·½Ê½µÇ¼ protected: void InternetLogin(); // ÁªÍøµÇ¼ void OfflineLogin(); // ÀëÏߵǼ };