浏览代码

优化UI - 优化编辑框

chenrongqian 2 年之前
父节点
当前提交
2e3be1c482

+ 8 - 7
PDFReaderPro_Installer/Bin/XMLFile.xml

@@ -17,12 +17,12 @@
 				<Button name="Btninstall" font="0" text="install" width="300" height="64" textcolor="0xFFFFFFFF" bkcolor="0xff273C62" hotbkcolor="0xff31538D" pushedbkcolor="0xff1B2944" />
 				<Container />
 			</HorizontalLayout>
-			<HorizontalLayout padding="0,20,0,0" width="760" visible="true">
+			<HorizontalLayout padding="0,30,0,0" width="760" visible="true">
 				<Container />
 				<Text name="TxtByClickInstall" font="0" autocalcwidth="true" floatalign="center" text="By clicking “Install”,you agree to the" textcolor="0xFF000000" />
-				<Button name="BtnTermsService" padding="0,-16,0,0" text="Terms of Service." font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
+				<Button name="BtnTermsService" padding="0,-25,0,0" text="Terms of Service." font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
 				<Text name="TxtAnd" text=" and " font="0" autocalcwidth="true" textcolor="0xFF000000" />
-				<Button name="BtnPrivacyPolicy" padding="0,-16,0,0" text=" Privacy Policy" font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
+				<Button name="BtnPrivacyPolicy" padding="0,-25,0,0" text=" Privacy Policy" font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
 				<Text name="TextShowContentLink" visible="false" padding="0,16,0,0" autocalcwidth="true" floatalign="center" font="0" text="By clicking “Install”,you agree to the {a https://www.baidu.com} Privacy Policy{/a} and {a https://www.csdn.net} Terms of Service{/a}" textcolor="0xFF000000" showhtml="true" />
 				<Container />
 			</HorizontalLayout>
@@ -36,11 +36,11 @@
 				</HorizontalLayout>
 				<Container />
 			</HorizontalLayout>
-			<HorizontalLayout visible="true" padding="40,20,0,15" width="680" bkcolor="0xFFEAECF2" height="1" />
-			<HorizontalLayout padding="40,0,0,0" width="760" autocalcheight="true">
+			<HorizontalLayout visible="true" padding="40,0,0,0" width="680" bkcolor="0xFFEAECF2" height="1" />
+			<HorizontalLayout padding="40,10,0,0" width="760" autocalcheight="true">
 				<Label name="InstallationfolderTitle" font="0" height="30" autocalcwidth="true" padding="0,0,8,0" text="Installation folder" textcolor="0xFF000000" />
-				<Edit name="EdFilepath" readonly="true" font="0" textpadding="4,0,0,0" height="32" bordercolor="0xFFDFDFDF" bordersize="1,1,0,1" />
-				<HorizontalLayout visible="true" width="32" height="32" bordercolor="0xFFDFDFDF" bordersize="0,1,1,1">
+				<Edit name="EdFilepath" readonly="true" font="0" textpadding="4,0,4,0" height="32" bordercolor="0xFFDFDFDF" bordersize="1,1,1,1" />
+				<HorizontalLayout visible="false" width="32" height="32" bordercolor="0xFFDFDFDF" bordersize="0,1,1,1">
 					<Button name="BtnIconSelectFolder" padding="10,8,0,0" width="16" height="16" bkimage="arrow.png" hotforeimage="file='arrow.png' source='0,0,30,20'" maxheight="16" />
 				</HorizontalLayout>
 				<Button name="BtnTextSelectFolder" visible="true" font="0" text="Select a Folder" padding="14,0,20,0" maxwidth="140" width="140" height="32" hotbkcolor="0xFFC0C0C0" textcolor="0xFF000000" bkcolor="0xFFE1E1E1" pushedbkcolor="0xFF969696" bordercolor="0x29000000" bordersize="1" />
@@ -78,6 +78,7 @@
 					<Container />
 					<Button name="Btnminsize" height="32" width="32" visible="true" hotbkcolor="0x39F0F0F0" pushedbkcolor="0x69E1E1E1" normalimage="minimize.png" hotimage="minimize.png" pushedimage="minimize.png" />
 					<Button name="BtnClose" height="32" width="32" hotbkcolor="0xFFFF0000" pushedbkcolor="0xFFFF5757" normalimage="close.png" hotimage="close.png" pushedimage="close.png" />
+					<Container name="containerCloseNone" visible="false" height="32" width="32" />
 				</HorizontalLayout>
 			</HorizontalLayout>
 		</HorizontalLayout>

+ 31 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp

@@ -85,7 +85,6 @@ void CFrameWnd::InitControls()
 	InitHomeControls();
 	InitInstallingControls();
 	InitInstalledControls();
-
 }
 
 void CFrameWnd::InitWindow()
@@ -95,7 +94,7 @@ void CFrameWnd::InitWindow()
 	this->CenterWindow();
 	InitControls();
 	//AdaptationDPI();
-
+	SelectLayout(LayoutType::Home);
 }
 
 
@@ -329,6 +328,8 @@ AppCore::ClearAllTempFolder();
 	//	wss << m_pm.GetDPIObj()->GetDPI();
 	//	wss >> optionNamea;
 	//	break;
+	case WM_KEYDOWN:
+		//lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
 	default:
 		break;
 	}
@@ -341,6 +342,28 @@ AppCore::ClearAllTempFolder();
 
 }
 
+LRESULT CFrameWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	switch (wParam)
+	{
+	case _T('A'):
+	{
+		if (GetKeyState(VK_CONTROL) < 0)
+		{
+			if (m_InstallationPage->EdFilepath->IsFocused())
+			{
+			//	m_InstallationPage->EdFilepath->SetReadOnly(false);
+
+			}
+		}
+	}
+
+
+	break;
+	}
+	return 0;
+}
+
 void CFrameWnd::SelectLayout(LayoutType LayoutType)
 {
 	this->m_State.m_LayoutType = LayoutType;
@@ -351,12 +374,18 @@ void CFrameWnd::SelectLayout(LayoutType LayoutType)
 	{
 	case LayoutType::Home:
 		m_InstallationPage->LayoutHome->SetVisible(true);
+		m_InstallationPage->BtnClose->SetVisible(true);
+		m_InstallationPage->containerCloseNone->SetVisible(false);
 		break;
 	case LayoutType::Installing:
 		m_InstallingPage->LayoutInstalling->SetVisible(true);
+		m_InstallationPage->BtnClose->SetVisible(false);
+		m_InstallationPage->containerCloseNone->SetVisible(true);
 		break;
 	case LayoutType::Installed:
 		m_InstalledPage->LayoutInstalled->SetVisible(true);
+		m_InstallationPage->BtnClose->SetVisible(true);
+		m_InstallationPage->containerCloseNone->SetVisible(false);
 		KillTimer(m_hWnd, TIMER_INSTALL_ID);
 		KillTimer(m_hWnd, TIMER_BANNER_ID);
 		break;

+ 1 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h

@@ -97,6 +97,7 @@ private:
 	 LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
+	 LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 #pragma endregion
 
 

+ 3 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp

@@ -35,6 +35,9 @@ void InstallationPage::InitControls()
 	CheckInstallSetting = static_cast<CCheckBoxUI*>(m_pm->FindControl(UI_CheckInstallSetting));
 	EdFilepath = static_cast<CEditUI*>(m_pm->FindControl(UI_EdFilepath));
 	Lbicon = static_cast<CButtonUI*>(m_pm->FindControl(UI_Lbicon));
+
+	BtnClose = static_cast<CButtonUI*>(m_pm->FindControl(UI_BtnClose));
+	containerCloseNone = static_cast<CContainerUI*>(m_pm->FindControl(UI_containerCloseNone));
 }
 
 void InstallationPage::InitLanguage()

+ 5 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h

@@ -23,8 +23,8 @@
 #define UI_CheckInstallSetting L"CheckInstallSetting"//自定义按钮
 #define UI_EdFilepath L"EdFilepath"//安装路径编辑框
 #define UI_Lbicon L"Lbicon"//自定义按钮icon▲
-
-
+#define UI_BtnClose L"BtnClose"//关闭按钮
+#define UI_containerCloseNone L"containerCloseNone"//关闭按钮右侧留空
 //安装主页界面
 #pragma region 文件说明
 
@@ -64,6 +64,9 @@ public:
 	CLabelUI* InstallationfolderTitle;
 	CButtonUI* BtnOpenApp;
 	CButtonUI* Lbicon;
+
+	CButtonUI* BtnClose;
+	CContainerUI* containerCloseNone;
 public:
 	void InitControls();
 	void InitLanguage();