Browse Source

登录窗口

Wang Jeff 3 năm trước cách đây
mục cha
commit
cba355991d

+ 16 - 0
AutoCompilation/AutoCompilation/AutoCompilation.vcproj

@@ -177,6 +177,10 @@
 				RelativePath=".\AutoCompilation.cpp"
 				>
 			</File>
+			<File
+				RelativePath=".\CLoginDlg.cpp"
+				>
+			</File>
 			<File
 				RelativePath=".\MainDlg.cpp"
 				>
@@ -214,6 +218,10 @@
 			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl;inc"
 			>
+			<File
+				RelativePath=".\CLoginDlg.h"
+				>
+			</File>
 			<File
 				RelativePath=".\MainDlg.h"
 				>
@@ -256,6 +264,10 @@
 				RelativePath=".\uires\values\color.xml"
 				>
 			</File>
+			<File
+				RelativePath=".\uires\xml\dlg_login.xml"
+				>
+			</File>
 			<File
 				RelativePath=".\uires\xml\dlg_main.xml"
 				>
@@ -268,6 +280,10 @@
 				RelativePath=".\uires\Translator\lang_cn.xml"
 				>
 			</File>
+			<File
+				RelativePath=".\uires\Translator\lang_jp.xml"
+				>
+			</File>
 			<File
 				RelativePath=".\uires\xml\menu_tray.xml"
 				>

+ 8 - 28
AutoCompilation/AutoCompilation/CLoginDlg.cpp

@@ -23,14 +23,16 @@ BOOL CLoginDlg::OnInitDialog(HWND hWnd, LPARAM lParam)
 	return 0;
 }
 
-void CLoginDlg::OnLanguageBtnCN()
+void CLoginDlg::OnLogin()
 {
-	OnLanguage(1);
+	SMessageBox(NULL, _T("登录按钮"), _T("haha"), MB_OK | MB_ICONEXCLAMATION);
+	EndDialog(IDOK);
 }
 
-void CLoginDlg::OnLanguageBtnJP()
+void CLoginDlg::OnLoginCancel()
 {
-	OnLanguage(0);
+	//SMessageBox(NULL, _T("这是按钮"), _T("haha"), MB_OK | MB_ICONEXCLAMATION);
+	PostQuitMessage(0);
 }
 
 void CLoginDlg::OnLanguage(int nID)
@@ -56,13 +58,8 @@ void CLoginDlg::OnLanguage(int nID)
 //TODO:消息映射
 void CLoginDlg::OnClose()
 {
-	//CSimpleWnd::DestroyWindow();
-	EndDialog(IDOK);
-}
-
-void CLoginDlg::OnMaximize()
-{
-	SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
+	PostQuitMessage(0);
+	//EndDialog(IDOK);
 }
 
 void CLoginDlg::OnRestore()
@@ -70,23 +67,6 @@ void CLoginDlg::OnRestore()
 	SendMessage(WM_SYSCOMMAND, SC_RESTORE);
 }
 
-void CLoginDlg::OnMinimize()
-{
-	SendMessage(WM_SYSCOMMAND, SC_MINIMIZE);
-}
-
-void CLoginDlg::OnHelp()
-{
-	//MessageBox(NULL, _T("222"), _T("111"), MB_ICONWARNING);
-	SMessageBox(NULL, _T("this is a message box"), _T("haha"), MB_OK | MB_ICONEXCLAMATION);
-}
-
-void CLoginDlg::OnMyBtn()
-{
-	//MessageBox(NULL, _T("222"), _T("111"), MB_ICONWARNING);
-	SMessageBox(NULL, _T("这是按钮"), _T("haha"), MB_OK | MB_ICONEXCLAMATION);
-}
-
 void CLoginDlg::OnSize(UINT nType, CSize size)
 {
 	SetMsgHandled(FALSE);

+ 4 - 11
AutoCompilation/AutoCompilation/CLoginDlg.h

@@ -7,10 +7,7 @@ public:
 	~CLoginDlg();
 
 	void OnClose();
-	void OnMaximize();
 	void OnRestore();
-	void OnMinimize();
-	void OnHelp();
 	void OnSize(UINT nType, CSize size);
 	//演示如何响应菜单事件
 	void OnCommand(UINT uNotifyCode, int nID, HWND wndCtl);
@@ -19,18 +16,14 @@ public:
 
 protected:
 	void OnLanguage(int nID);
-	void OnLanguageBtnCN();
-	void OnLanguageBtnJP();
-	void OnMyBtn();
+	void OnLogin();
+	void OnLoginCancel();
 	//soui消息
 	EVENT_MAP_BEGIN()
 		EVENT_NAME_COMMAND(L"btn_close", OnClose)
-		EVENT_NAME_COMMAND(L"btn_min", OnMinimize)
-		EVENT_NAME_COMMAND(L"btn_max", OnMaximize)
-		EVENT_NAME_COMMAND(L"my_btn", OnMyBtn)
 		EVENT_NAME_COMMAND(L"btn_restore", OnRestore)
-		EVENT_NAME_COMMAND(L"zh_cn", OnLanguageBtnCN)
-		EVENT_NAME_COMMAND(L"jp", OnLanguageBtnJP)
+		EVENT_NAME_COMMAND(L"btn_login", OnLogin)
+		EVENT_NAME_COMMAND(L"btn_cancel", OnLoginCancel)
 	EVENT_MAP_END()
 
 	//HostWnd真实窗口消息处理

BIN
AutoCompilation/AutoCompilation/res/resource.h


BIN
AutoCompilation/AutoCompilation/res/soui_res.rc2


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

@@ -1,21 +1,21 @@
-<SOUI name="mainWindow" title="@string/title" bigIcon="ICON_LOGO:32" smallIcon="ICON_LOGO:16" margin="5,5,5,5"  resizable="1" wndType="normal"
-toolWindow="0"
+<SOUI name="mainWindow" title="@string/title" bigIcon="ICON_LOGO:32" smallIcon="ICON_LOGO:16" margin="5,5,5,5"  resizable="0" wndType="normal"
+appWnd="1"
 translucent="1" 
 >
-  <root skin="_skin.sys.wnd.bkgnd" cache="1"  width="600" height="400" >
+  <root skin="_skin.sys.wnd.bkgnd" cache="1"  width="300" height="200" >
     <caption pos="0,0,-0,30" show="1" font="adding:0">
       <icon pos="10,8" src="ICON_LOGO:16"/>
       <text pos="29,9">@string/title</text>
       <imgbtn name="btn_close" skin="_skin.sys.btn.close"    pos="-45,0" tip="close" animate="1"/>
-      <imgbtn name="btn_max" skin="_skin.sys.btn.maximize"  pos="-83,0" animate="1" />
       <imgbtn name="btn_restore" skin="_skin.sys.btn.restore"  pos="-83,0" show="0" animate="1" />
-      <imgbtn name="btn_min" skin="_skin.sys.btn.minimize" pos="-121,0" animate="1" />
     </caption>
     <window pos="5,[2,-5,-5">
-      <text pos="|0,|0" offset="-0.5,-0.5">登录编译系统</text>
-      <button pos="|0,[" inset="4,4,4,4" name="zh_cn" offset="-1.1,0" text="lang_cn"/>
-      <button pos="|0,[" inset="4,4,4,4" name="jp" offset="-1.1,0" text="lang_jp"/>
-      <button pos="|0,[" inset="4,4,4,4" name="my_btn" offset="-1.1,0" text="my_btn"/>
+        <text pos="%30,%35" offset="-0.5,-0.5">账号</text>
+		<edit pos="[10,{-6,@120,@30" readOnly="0" cueText="请输入账号"></edit>
+        <text pos="%30,%50" offset="-0.5,-0.5">密码</text>
+		<edit pos="[10,{-6,@120,@30" readOnly="0" password="1">请输入密码</edit>
+		<button pos="%45,%60" inset="4,4,4,4" name="btn_login" offset="-1.1,0" text="登录"/>
+		<button pos="%75,%60" inset="4,4,4,4" name="btn_cancel" offset="-1.1,0" text="取消"/>
     </window>
   </root>
 </SOUI>