瀏覽代碼

登录窗口完善

sat23 3 年之前
父節點
當前提交
8f5decd5d1

+ 13 - 2
AutoCompilation/AutoCompilation/CLoginDlg.cpp

@@ -35,7 +35,7 @@ void CLoginDlg::OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
 
 void CLoginDlg::OnLogin()
 {
-	SEdit* pAccount = FindChildByName2<SEdit>(_T("edit_accout"));
+	SEdit* pAccount = FindChildByName2<SEdit>(_T("edit_account"));
 	SEdit* pPssword = (SEdit*)FindChildByName(_T("edit_password"));
 	if (pAccount && pPssword)
 	{
@@ -44,6 +44,7 @@ void CLoginDlg::OnLogin()
 
 		if ( strAccount.Compare(_T("admin")) == 0 && strPassword.Compare(_T("123456")) == 0 )
 		{
+			AnimateHostWindow(200, AW_CENTER | AW_HIDE);
 			EndDialog(IDOK);
 		}
 		else
@@ -55,7 +56,17 @@ void CLoginDlg::OnLogin()
 
 void CLoginDlg::OnLoginCancel()
 {
-	PostQuitMessage(0);
+	AnimateHostWindow(200, AW_CENTER | AW_HIDE);
+	EndDialog(IDCANCEL);
+}
+
+void CLoginDlg::OnEditAccountClick()
+{
+	// ¹Ø±ÕÊäÈë·¨;
+	HWND hWnd = ::GetForegroundWindow();
+	HIMC hImc = ImmGetContext(hWnd);
+	if (ImmGetOpenStatus(hImc))
+		ImmSetOpenStatus(hImc, FALSE);
 }
 
 void CLoginDlg::OnLanguage(int nID)

+ 2 - 0
AutoCompilation/AutoCompilation/CLoginDlg.h

@@ -18,12 +18,14 @@ protected:
 	void OnLanguage(int nID);
 	void OnLogin();
 	void OnLoginCancel();
+	void OnEditAccountClick();
 	//souiÏûÏ¢
 	EVENT_MAP_BEGIN()
 		EVENT_NAME_COMMAND(L"btn_close", OnClose)
 		EVENT_NAME_COMMAND(L"btn_restore", OnRestore)
 		EVENT_NAME_COMMAND(L"btn_login", OnLogin)
 		EVENT_NAME_COMMAND(L"btn_cancel", OnLoginCancel)
+		EVENT_NAME_COMMAND(L"edit_account", OnEditAccountClick)
 	EVENT_MAP_END()
 
 	//HostWndÕæÊµ´°¿ÚÏûÏ¢´¦Àí

二進制
AutoCompilation/AutoCompilation/MainDlg.cpp


二進制
AutoCompilation/AutoCompilation/res/resource.h


二進制
AutoCompilation/AutoCompilation/stdafx.h


+ 2 - 2
AutoCompilation/AutoCompilation/uires/xml/dlg_login.xml

@@ -8,9 +8,9 @@
     </caption>
     <window pos="5,[2,-5,-5">
       <text pos="%30,%30" offset="-0.5,-0.5">账号</text>
-      <edit pos="[10,{-6,@120,@30" name="edit_accout" readOnly="0" cueText="请输入账号"></edit>
+      <edit pos="[10,{-6,@120,@30" name="edit_account" readOnly="0" notifyChange="1" cueText="请输入账号">admin</edit>
       <text pos="%30,%45" offset="-0.5,-0.5">密码</text>
-      <edit pos="[10,{-6,@120,@30" readOnly="0" name="edit_password" password="1">请输入密码</edit>
+      <edit pos="[10,{-6,@120,@30" readOnly="0" margin="0" name="edit_password" password="1" cueText="请输入密码">123456</edit>
       <button pos="%50,%60,@80,@30" name="btn_login" offset="-1.1,0" text="登录"/>
       <button pos="%85,%60,@80,@30" name="btn_cancel" offset="-1.1,0" text="取消"/>
     </window>