Ver código fonte

静默安装

chenrongqian 2 anos atrás
commit
6b91519e3f
100 arquivos alterados com 24601 adições e 0 exclusões
  1. 9 0
      .gitignore
  2. 8 0
      .gitignore.bak
  3. BIN
      PDFReaderPro_Installer/Bin/DuiLib.dll
  4. BIN
      PDFReaderPro_Installer/Bin/DuiLib_d.dll
  5. BIN
      PDFReaderPro_Installer/Bin/Logo.png
  6. BIN
      PDFReaderPro_Installer/Bin/NoNetwork.png
  7. BIN
      PDFReaderPro_Installer/Bin/PDFReaderPro_Insrtaller.exe
  8. BIN
      PDFReaderPro_Installer/Bin/PDFReaderPro_Insrtaller.pdb
  9. 85 0
      PDFReaderPro_Installer/Bin/XMLFile.xml
  10. BIN
      PDFReaderPro_Installer/Bin/arrow.png
  11. BIN
      PDFReaderPro_Installer/Bin/close.png
  12. BIN
      PDFReaderPro_Installer/Bin/minimize.png
  13. 22 0
      PDFReaderPro_Installer/Bin/msg.xml
  14. 4 0
      PDFReaderPro_Installer/Bin/project.dui
  15. BIN
      PDFReaderPro_Installer/Bin/question.png
  16. BIN
      PDFReaderPro_Installer/Lib/DuiLib.exp
  17. BIN
      PDFReaderPro_Installer/Lib/DuiLib.lib
  18. BIN
      PDFReaderPro_Installer/Lib/DuiLib_d.exp
  19. BIN
      PDFReaderPro_Installer/Lib/DuiLib_d.lib
  20. 100 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller.sln
  21. 175 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp
  22. 124 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h
  23. 697 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp
  24. 53 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h
  25. 57 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp
  26. 16 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.h
  27. 1 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CClasses.cpp
  28. 104 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CClasses.h
  29. 134 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp
  30. 22 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.h
  31. 19 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp
  32. 64 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h
  33. 362 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp
  34. 162 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h
  35. 203 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp
  36. 89 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.h
  37. 112 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMsgWnd.cpp
  38. 61 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMsgWnd.h
  39. 110 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp
  40. 16 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.h
  41. 39 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineStr.h
  42. 1252 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIActiveX.cpp
  43. 81 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIActiveX.h
  44. 182 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIAnimation.cpp
  45. 86 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIAnimation.h
  46. 745 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIButton.cpp
  47. 119 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIButton.h
  48. 405 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIColorPalette.cpp
  49. 65 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIColorPalette.h
  50. 1341 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UICombo.cpp
  51. 165 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UICombo.h
  52. 110 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIComboBox.cpp
  53. 29 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIComboBox.h
  54. 324 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIDateTime.cpp
  55. 45 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIDateTime.h
  56. 719 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIEdit.cpp
  57. 92 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIEdit.h
  58. 133 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFadeButton.cpp
  59. 45 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFadeButton.h
  60. 270 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFlash.cpp
  61. 65 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFlash.h
  62. 232 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnim.cpp
  63. 56 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnim.h
  64. 193 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnimEx.cpp
  65. 39 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnimEx.h
  66. 160 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGroupBox.cpp
  67. 40 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGroupBox.h
  68. 523 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIHotKey.cpp
  69. 87 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIHotKey.h
  70. 308 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddress.cpp
  71. 43 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddress.h
  72. BIN
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddressEx.cpp
  73. 44 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddressEx.h
  74. 335 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILabel.cpp
  75. 60 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILabel.h
  76. 3180 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIList.cpp
  77. 524 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIList.h
  78. 1582 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIListEx.cpp
  79. 310 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIListEx.h
  80. 238 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILoading.cpp
  81. 60 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILoading.h
  82. 1200 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIMenu.cpp
  83. 394 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIMenu.h
  84. 468 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIOption.cpp
  85. 106 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIOption.h
  86. 175 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIProgress.cpp
  87. 47 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIProgress.h
  88. 2804 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRichEdit.cpp
  89. 197 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRichEdit.h
  90. 101 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRing.cpp
  91. 36 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRing.h
  92. 153 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRollText.cpp
  93. 50 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRollText.h
  94. 1020 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIScrollBar.cpp
  95. 151 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIScrollBar.h
  96. 307 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UISlider.cpp
  97. 52 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UISlider.h
  98. 169 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIText.cpp
  99. 36 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIText.h
  100. 0 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UITreeView.cpp

+ 9 - 0
.gitignore

@@ -0,0 +1,9 @@
+PDFReaderPro_Installer/.vs/
+PDFReaderPro_Installer/Debug/
+PDFReaderPro_Installer/Release/
+PDFReaderPro_Installer/Temp/
+PDFReaderPro_Installer/x64/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Debug/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Release/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/x64/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/x86/

+ 8 - 0
.gitignore.bak

@@ -0,0 +1,8 @@
+PDFReaderPro_Installer/.vs/
+PDFReaderPro_Installer/Debug/
+PDFReaderPro_Installer/Release/
+PDFReaderPro_Installer/Temp/
+PDFReaderPro_Installer/x64/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Debug/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Release/
+PDFReaderPro_Installer/PDFReaderPro_Insrtaller/x64/

BIN
PDFReaderPro_Installer/Bin/DuiLib.dll


BIN
PDFReaderPro_Installer/Bin/DuiLib_d.dll


BIN
PDFReaderPro_Installer/Bin/Logo.png


BIN
PDFReaderPro_Installer/Bin/NoNetwork.png


BIN
PDFReaderPro_Installer/Bin/PDFReaderPro_Insrtaller.exe


BIN
PDFReaderPro_Installer/Bin/PDFReaderPro_Insrtaller.pdb


+ 85 - 0
PDFReaderPro_Installer/Bin/XMLFile.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--mininfo="600,400" -->
+<Window size="760,540" roundcorner="6" caption="0,0,0,32" showshadow="true" shadowcorner="1,1,1,1" shadowsize="3">
+	<Font id="0" name="FontBtn" sname="Segoe UI" size="16" />
+	<Font id="3" name="FontBtn" sname="Segoe UI" size="16" underline="true" />
+	<Font id="2" name="FontLable" sname="Segoe UI" size="9" />
+	<Font id="1" name="title" sname="Segoe UI" size="30" />
+	<VerticalLayout>
+		<!--主页 -->
+		<VerticalLayout name="LayoutHome" visible="true" width="760" height="600" float="true" bkcolor="0xFFFFFFFF">
+			<VerticalLayout inset="0,0,0,0" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
+				<Control padding="350,120,0,0" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
+				<Label font="1" padding="290,20,0,0" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
+			</VerticalLayout>
+			<HorizontalLayout height="64" padding="0,32,0,0" width="760">
+				<Container />
+				<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">
+				<Container />
+				<Text name="TxtByClickInstall" font="0" autocalcwidth="true" floatalign="center" font="0" 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" />
+				<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" />
+				<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>
+			<HorizontalLayout padding="0,20,0,0" width="760" visible="true">
+				<Container />
+				<HorizontalLayout autocalcwidth="true" floatalign="center">
+					<Container />
+					<CheckBox name="CheckInstallSetting" selected="true" autocalcwidth="true" height="30" font="0" text="Installation settings" textcolor="0xFF333333" hotbkcolor="0x01000000" />
+					<Button name="Lbicon" text="▲" font="2" autocalcwidth="true" valign="top" padding="4,6,0,0" />
+					<Container />
+				</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">
+				<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">
+					<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" />
+			</HorizontalLayout>
+		</VerticalLayout>
+		<!--安装中 -->
+		<VerticalLayout name="LayoutInstalling" visible="false" width="760" height="540" float="true" bkcolor="0xFFFFFFFF">
+			<Control name="ConNoNetWork" visible="false" width="760" height="432" minwidth="760" minheight="432" bkimage="NoNetwork.png" />
+			<TabLayout name="tab_switch" minwidth="760" minheight="432" width="760" height="432" bkcolor="0xFF2C3F62" />
+			<Progress name="InstallingProgress" padding="40,32,0,0" width="670" height="12" forecolor="0xFF477EDE" bkcolor="0xFFE2E3E6" />
+			<HorizontalLayout padding="40,16,0,0">
+				<Label name="installNotWork" visible="true" font="0" height="30" text="网络错误,请检查网络并重试" textcolor="0xFF000000" />
+				<Label name="installingValue" font="0" height="30" align="right" padding="0,0,50,0" text="0%" textcolor="0xFF000000" />
+			</HorizontalLayout>
+		</VerticalLayout>
+		<!--完成 -->
+		<VerticalLayout name="LayoutInstalled" visible="false" width="760" height="540" float="true" bkcolor="0xFFFFFFFF">
+			<VerticalLayout inset="0,0,0,0" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
+				<Control padding="350,120,0,0" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
+				<Label font="1" padding="290,20,0,0" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
+			</VerticalLayout>
+			<HorizontalLayout width="760" height="64" padding="0,32,0,0">
+				<Container />
+				<Button name="BtnOpenApp" font="0" text="Open app" width="300" height="64" textcolor="0xFFFFFFFF" bkcolor="0xff273C62" hotbkcolor="0xff31538D" pushedbkcolor="0xff1B2944" />
+				<Container />
+			</HorizontalLayout>
+			<Label name="LbInstalledPath" font="0" height="40" width="760" padding="0,32,0,0" align="center" text="Offline installer is saved in: C:\Users\Public\Documents\Wonder" textcolor="0xFF000000" />
+		</VerticalLayout>
+		<!--标题栏 -->
+		<HorizontalLayout height="32" width="760">
+			<Container />
+			<HorizontalLayout autocalcwidth="true">
+				<Container />
+				<HorizontalLayout autocalcwidth="true">
+					<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" />
+				</HorizontalLayout>
+			</HorizontalLayout>
+		</HorizontalLayout>
+	</VerticalLayout>
+</Window>

BIN
PDFReaderPro_Installer/Bin/arrow.png


BIN
PDFReaderPro_Installer/Bin/close.png


BIN
PDFReaderPro_Installer/Bin/minimize.png


+ 22 - 0
PDFReaderPro_Installer/Bin/msg.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Window caption="0,0,0,40" size="534,206" roundcorner="6" caption="0,0,0,32" showshadow="true" shadowcorner="1,1,1,1" shadowsize="3">
+	<Font id="0" name="微软雅黑" size="12" default="true" />
+	<Font id="1" name="微软雅黑" size="14" />
+	<VerticalLayout bkcolor="#FFFFFFFF">
+		<HorizontalLayout name="appbar" height="32" inset="6,-1" bkcolor="#FF273C62">
+			<Label name="MessageTitle" padding="12,0,0,0" text="提示" textcolor="#FFFFFFFF" font="1" />
+			<Button name="closebtn" hotbkcolor="0xFFFF0000" pushedbkcolor="0xFFFF5757" normalimage="close.png" hotimage="close.png" pushedimage="close.png" pushedbkcolor="0xFFFF0000" height="32" width="32" hotbkcolor="0xFFFF5757" />
+		</HorizontalLayout>
+		<HorizontalLayout inset="20,10,20,10">
+			<Control bkimage="question.png" width="32" height="32" padding="28,48,16,0" />
+			<Label name="MessageText" text="hello" textcolor="#FF000000" padding="0,35,0,0" font="1" />
+		</HorizontalLayout>
+		<HorizontalLayout height="60" inset="10,10,10,10">
+			<Control />
+			<Button name="confirm_btn" width="112" height="32" text="OK" bordersize="2" hotbkcolor="#FFE1EAFA" pushedbkcolor="#FFC7D8F5" bkcolor="#FFFFFFFF" hotbordercolor="#FFE1EAFA" pushedbordercolor="#FFC7D8F5" bordercolor="0xFFECECEC" />
+			<Control width="20" />
+			<Button name="cancel_btn" width="112" height="32" text="Cancle" textcolor="0xFFFFFF" bkcolor="#FF273C62" hotbkcolor="#FF31538D" pushedbkcolor="#FF1B2944" />
+			<Control width="30" />
+		</HorizontalLayout>
+	</VerticalLayout>
+</Window>

+ 4 - 0
PDFReaderPro_Installer/Bin/project.dui

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Project>
+	<ProjectPath>C:\CompanyCode\windowsStudy\PDFReaderPro_Insrtaller\Bin\</ProjectPath>
+</Project>

BIN
PDFReaderPro_Installer/Bin/question.png


BIN
PDFReaderPro_Installer/Lib/DuiLib.exp


BIN
PDFReaderPro_Installer/Lib/DuiLib.lib


BIN
PDFReaderPro_Installer/Lib/DuiLib_d.exp


BIN
PDFReaderPro_Installer/Lib/DuiLib_d.lib


+ 100 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller.sln

@@ -0,0 +1,100 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32328.378
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PDFReaderPro_Insrtaller", "PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller.vcxproj", "{600E9D31-79D2-4343-A853-77036957EF73}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DuiLib", "PDFReaderPro_Insrtaller\DuiLib\DuiLib.vcxproj", "{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		DebugA|x64 = DebugA|x64
+		DebugA|x86 = DebugA|x86
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+		ReleaseA|x64 = ReleaseA|x64
+		ReleaseA|x86 = ReleaseA|x86
+		SDebug|x64 = SDebug|x64
+		SDebug|x86 = SDebug|x86
+		SDebugA|x64 = SDebugA|x64
+		SDebugA|x86 = SDebugA|x86
+		SRelease|x64 = SRelease|x64
+		SRelease|x86 = SRelease|x86
+		SReleaseA|x64 = SReleaseA|x64
+		SReleaseA|x86 = SReleaseA|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{600E9D31-79D2-4343-A853-77036957EF73}.Debug|x64.ActiveCfg = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.Debug|x64.Build.0 = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.Debug|x86.ActiveCfg = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.Debug|x86.Build.0 = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.DebugA|x64.ActiveCfg = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.DebugA|x64.Build.0 = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.DebugA|x86.ActiveCfg = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.DebugA|x86.Build.0 = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.Release|x64.ActiveCfg = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.Release|x64.Build.0 = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.Release|x86.ActiveCfg = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.Release|x86.Build.0 = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.ReleaseA|x64.ActiveCfg = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.ReleaseA|x64.Build.0 = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.ReleaseA|x86.ActiveCfg = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.ReleaseA|x86.Build.0 = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebug|x64.ActiveCfg = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebug|x64.Build.0 = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebug|x86.ActiveCfg = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebug|x86.Build.0 = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebugA|x64.ActiveCfg = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebugA|x64.Build.0 = Debug|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebugA|x86.ActiveCfg = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SDebugA|x86.Build.0 = Debug|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SRelease|x64.ActiveCfg = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SRelease|x64.Build.0 = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SRelease|x86.ActiveCfg = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SRelease|x86.Build.0 = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SReleaseA|x64.ActiveCfg = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SReleaseA|x64.Build.0 = Release|x64
+		{600E9D31-79D2-4343-A853-77036957EF73}.SReleaseA|x86.ActiveCfg = Release|Win32
+		{600E9D31-79D2-4343-A853-77036957EF73}.SReleaseA|x86.Build.0 = Release|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x64.ActiveCfg = Debug|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x64.Build.0 = Debug|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x86.ActiveCfg = Debug|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.DebugA|x64.ActiveCfg = DebugA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.DebugA|x64.Build.0 = DebugA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.DebugA|x86.ActiveCfg = DebugA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.DebugA|x86.Build.0 = DebugA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|x64.ActiveCfg = Release|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|x64.Build.0 = Release|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|x86.ActiveCfg = Release|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|x86.Build.0 = Release|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.ReleaseA|x64.ActiveCfg = ReleaseA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.ReleaseA|x64.Build.0 = ReleaseA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.ReleaseA|x86.ActiveCfg = ReleaseA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.ReleaseA|x86.Build.0 = ReleaseA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebug|x64.ActiveCfg = SDebug|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebug|x64.Build.0 = SDebug|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebug|x86.ActiveCfg = SDebug|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebug|x86.Build.0 = SDebug|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebugA|x64.ActiveCfg = SDebugA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebugA|x64.Build.0 = SDebugA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebugA|x86.ActiveCfg = SDebugA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SDebugA|x86.Build.0 = SDebugA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SRelease|x64.ActiveCfg = SRelease|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SRelease|x64.Build.0 = SRelease|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SRelease|x86.ActiveCfg = SRelease|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SRelease|x86.Build.0 = SRelease|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SReleaseA|x64.ActiveCfg = SReleaseA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SReleaseA|x64.Build.0 = SReleaseA|x64
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SReleaseA|x86.ActiveCfg = SReleaseA|Win32
+		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.SReleaseA|x86.Build.0 = SReleaseA|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {E3F3F59B-660E-4139-ADD1-988A27AA370B}
+	EndGlobalSection
+EndGlobal

+ 175 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp

@@ -0,0 +1,175 @@
+
+#include "stdafx.h"
+#include "AppCore.h"
+
+#pragma region 静态成员变量
+
+//更换为其他产品静默安装时,以“必改项”为必须要更改的内容
+const wstring AppCore::URI_AppXml = L"https://www.pdfreaderpro.com/downloads/pdfreaderprocast_win_en_Us.xml";//必改项
+const wstring AppCore::URI_InstallPackge = L"https://pdfreaderpro.oss-cn-shanghai.aliyuncs.com/downloads/PDFReaderPro.exe";//必改项
+
+const wstring AppCore::smName_InstallPackage = L"PDFReaderPro.exe";//必改项,可自定义名称,建议跟安装包名一致
+const wstring AppCore::smName_Application = L"PDFReaderProWin.exe";//必改项,具体看安装包打包时命名的可执行程序
+
+//const wstring AppCore::smPath_DefaultInstall = L"C:\\Program Files\\PDF Technologies, Inc";//必改项,具体看安装包打包时设置的默认路径\\PDF Reader Pro
+wstring AppCore::smPath_Install = L"C:\\Program Files\\PDF Technologies, Inc";
+
+//缓存路径+"\\InstallerInfoTemp\\",存的是:Banner json文件,Banner图片,config.ini文件;
+//思路:先获取或创建.../Temp,若创建失败,则获取文档文件夹(避免在特殊的情况下发生);若获取文档文件夹失败,则获取安装的路径;
+wstring AppCore::smPath_Temp = L"C:/Program Files(x86)/Temp";
+#define TempFolderName L"InstallTemp"; //在缓存路径Temp文件夹里创建一个缓存文件夹,方便退出程序后,删除所有缓存文件
+//可不改
+int AppCore::ShowBannerCount = 5;
+const wstring AppCore::URI_BannerJson = L"https://content.filmagepro.com/api/pictures/list";
+const wstring AppCore::smName_BannerJson = L"Banner.json";
+
+const wstring AppCore::FileName_ProgressName = L"PDF Reader Pro";
+#pragma endregion
+
+
+#pragma region 文件路径
+
+wstring AppCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar)
+{
+	while (true)
+	{
+		size_t pos = saveFilePath.find(oldchar);
+		if (pos != wstring::npos)
+		{
+			WCHAR pBuf[1] = { L'\0' };
+			saveFilePath.replace(pos, oldchar.length(), pBuf, 0);
+			saveFilePath.insert(pos, newchar);
+		}
+		else
+		{
+
+			break;
+		}
+
+	}
+	return saveFilePath;
+}
+
+wstring AppCore::GetOrCreateFolderPath(wstring saveFilePath)
+{
+	wstring newSaveFolder = AppCore::GetNewSaveFolder(saveFilePath, L"\\", L"/");
+	BOOL isCreate = FALSE;
+	if (!PathIsDirectoryW(newSaveFolder.c_str()))
+		isCreate = CreateDirectory((newSaveFolder.c_str()), NULL);
+
+	return newSaveFolder;
+}
+
+wstring AppCore::SetSHGetFolderPath(_In_ int csidl)
+{
+	TCHAR szPath[MAX_PATH];
+	if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, szPath)))
+	{
+		wstring temp(szPath);
+		return temp;
+	}
+	return L"";
+}
+
+wstring AppCore::GetAppTempPath()
+{
+	 if (smPath_Temp == L"")
+	 {
+		 smPath_Temp = smPath_Install;
+	 }
+	 return smPath_Temp;
+}
+
+void AppCore::InitAppTempPath()
+ {
+	 wchar_t strTmpDir[MAX_PATH] = { 0 };
+	 GetTempPathW(MAX_PATH, strTmpDir);
+
+	 wstring temp = strTmpDir;
+	 if (temp.empty() == false && temp != L"")
+	 {
+		 temp = temp + TempFolderName;//Temp缓存文件
+	 }
+	 else
+	 {
+		 temp = SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + TempFolderName;//文档
+	 }
+
+	 BOOL isCreate = True;
+	 if (!PathIsDirectoryW(temp.c_str()))
+		 isCreate = CreateDirectory((temp.c_str()), NULL);
+
+	 if (isCreate == FALSE)
+		 temp = L"";
+
+	 temp = temp+L"\\";
+	 smPath_Temp = AppCore::ReplaceSubStr(temp, L"\\", L"/");
+
+
+	 isCreate = True;
+
+	 if (!PathIsDirectoryW(smPath_Install.c_str()))
+		 isCreate = CreateDirectory((smPath_Install.c_str()), NULL);
+
+	 if (isCreate)
+	 {
+		 smPath_Install = smPath_Install + L"\\" + FileName_ProgressName;
+		 if (!PathIsDirectoryW(smPath_Install.c_str()))
+			 isCreate = CreateDirectory((smPath_Install.c_str()), NULL);
+	 }
+ }
+
+void AppCore::ClearAllTempFolder()
+{
+	    RemoveDirectory(AppCore::smPath_Temp.c_str());
+		wstring installPathFile = AppCore::smPath_Install + L"\\" + AppCore::smName_InstallPackage;
+		DeleteFile(installPathFile.c_str());
+}
+
+#pragma endregion
+
+
+
+#pragma region 字符串编码处理
+
+wstring AppCore::GetMultiByteToWideChar(char* multiByte)
+{
+	//Todo:	char* ch = (LPSTR)(LPCTSTR)multiByte;//当multiByte为std::string类型时
+	char* ch = multiByte;
+	int len = MultiByteToWideChar(CP_ACP, 0, ch, -1, NULL, 0);
+	wchar_t* wch = new wchar_t[len];
+	MultiByteToWideChar(CP_ACP, 0, ch, -1, wch, len);
+	return wch;
+}
+
+char* AppCore::GetWideCharToMultiByte(wchar_t* wideChar)
+{
+	char* multiByte;
+	int iwstrLen = WideCharToMultiByte(CP_ACP, 0, wideChar, -1, 0, 0, 0, 0);
+	multiByte = new char[iwstrLen + 1];
+	memset(multiByte, 0, sizeof(char) * (iwstrLen + 1));
+	WideCharToMultiByte(CP_ACP, 0, wideChar, -1, multiByte, iwstrLen, 0, 0);
+
+	return multiByte;
+}
+
+std::wstring AppCore::ReplaceSubStr(wstring sourceSrc, const wstring& oldSubStr, const wstring& newSubStr)
+{
+	wstring strRet = sourceSrc;
+	size_t pos = 0;
+	int l_count = 0;
+	int count = -1;
+	if (-1 == count) // replace all
+		count = strRet.size();
+	while ((pos = strRet.find(oldSubStr, pos)) != wstring::npos)
+	{
+		strRet.replace(pos, oldSubStr.size(), newSubStr);
+		if (++l_count >= count) break;
+		pos += newSubStr.size();
+	}
+	return strRet;
+}
+
+#pragma endregion
+
+

+ 124 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h

@@ -0,0 +1,124 @@
+#pragma once
+#include<string>
+using namespace std;
+#include "stdafx.h"
+#include "duilib.h"
+#include <Shlwapi.h>
+#pragma region 使用说明
+
+//文件的作用:
+//    1.网页链接:获取安装包信息的链接,安装包资源的链接;获取Banner json链接等
+//     作用:获取在线资源到本地;
+//     命名规范:Url_xxx;
+// 
+//    2.文件名称:安装包包名称,安装后的程序名称;创建Banner json文件名称等
+//     作用:根据名称,用于对对应名称的资源进行操作处理;
+//     命名规范:smName_xxx;
+// 
+//    3.默认路径:默认安装程序的路径;存放Banner轮播图片的路径;
+//     作用:作为文件缓存路径;退出下载器后,用于删除缓存文件;
+//     命名规范:smPath_xxx;
+// 
+//    4.函数:创建文件夹,字符串编码格式转换等
+//     作用:可通用任何范围
+//     命名规范:Get_xxx,Set_xxx;
+// 
+//    5.备注:由于通用其他产品的下载器,以下字符串变量会以"(对应产品)"来备注说明为:该项目改为用于其他产品的下载器时,必须要替换为对应产品的字符串内容
+
+#pragma endregion
+
+/// <summary>
+/// 方便修改和使用,重要的处理的字符串变量和公共函数;
+/// </summary>
+static class AppCore
+{
+public:
+	static wstring smPath_Temp;
+	static wstring smPath_Install;
+
+public:
+	static void ClearAllTempFolder();
+#pragma region 安装信息
+
+	/// <summary>
+	/// 安装包信息的XML文件(对应产品)
+	/// </summary>
+	static const wstring URI_AppXml;
+	/// <summary>
+	/// 安装包资源链接(对应产品)
+	/// </summary>
+	static const wstring URI_InstallPackge;
+	/// <summary>
+	/// 安装包名称(建议对应产品)
+	/// </summary>
+	static const wstring smName_InstallPackage;
+	/// <summary>
+	/// 安装后的程序:安装后的可运行程序名称,该名称由安装包决定的(对应产品)
+	/// </summary>
+	static const wstring smName_Application;
+	/*/// <summary>
+	/// 默认安装路径(建议对应产品)
+	/// </summary>
+	static const wstring smPath_DefaultInstall;*/
+
+#pragma endregion
+
+#pragma region Banner信息
+
+	static int ShowBannerCount;
+	/// <summary>
+	/// Banner图片资源json链接
+	/// </summary>
+	static const wstring URI_BannerJson;
+	/// <summary>
+	/// 创建Banner json文件的名称(带文件后缀名)
+	/// </summary>
+	static const wstring smName_BannerJson;
+
+#pragma endregion
+
+	/// <summary>
+	/// 后台任务管理器的进程名称
+	/// </summary>
+	static const wstring FileName_ProgressName;
+
+public:
+	static wstring GetNewSaveFolder(std::wstring saveFilePath, std::wstring oldchar, std::wstring newchar);
+	static wstring GetOrCreateFolderPath(std::wstring saveFilePath);
+	/// <summary>
+	/// 获取系统路径
+	/// </summary>
+	/// <param name="csidl">系统指定的路径名称,例如user\\kdan\\文档</param>
+	/// <returns>系统路径</returns>
+	static wstring  SetSHGetFolderPath(_In_ int csidl);
+
+	/// <summary>
+	/// 获取缓存路径,并在缓存路径下创建一个文件夹
+	/// </summary>
+	/// <returns>如果获取不到缓存路径,就更换为文档路径;若两个路径都获取不到,就返回空字符串</returns>
+	static wstring  GetAppTempPath();
+
+	static void InitAppTempPath();
+
+#pragma region 字符串处理
+
+	/// <summary>
+	/// 多字节字符转换为宽字符
+	/// </summary>
+	static wstring GetMultiByteToWideChar(char* multiByte);
+
+	/// <summary>
+	/// 宽字符转换为多字节字符
+	/// </summary>
+	/// <param name="wideChar"></param>
+	/// <returns></returns>
+	static char* GetWideCharToMultiByte(wchar_t* wideChar);
+
+	static wstring ReplaceSubStr(wstring sourceSrc, const wstring& oldSubStr, const wstring& newSubStr);
+
+#pragma endregion
+
+	
+};
+
+

+ 697 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp

@@ -0,0 +1,697 @@
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "CAccessRegedit.h"
+#include <fstream>
+#include <urlmon.h>
+#pragma comment(lib, "urlmon.lib")
+
+VertionResultType CAccessRegedit::AccessKey()
+{
+	DWORD dwType1 = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ | REG_DWORD_LITTLE_ENDIAN | REG_DWORD_BIG_ENDIAN | REG_LINK | REG_RESOURCE_LIST | REG_FULL_RESOURCE_DESCRIPTOR | REG_RESOURCE_REQUIREMENTS_LIST | REG_QWORD_LITTLE_ENDIAN;
+
+	long lRet;
+	HKEY hKey1;
+	TCHAR tchData1[64];
+	DWORD dwSize;
+
+	HKEY hkResult;
+	HKEY hkRKey;
+	LPCTSTR lpSubKey;
+	lpSubKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products";
+
+	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey1);
+	VertionResultType state = VertionResultType::None;
+
+	if (lRet == ERROR_SUCCESS)
+	{
+		DWORD index = 0;
+		TCHAR szKeyName[255] = { 0 };
+		DWORD dwKeyLen = 255;
+		std::wstring strBuffer;
+		std::wstring strMidReg;
+		TCHAR szBuffer1[255] = { 0 };
+		DWORD dwNameLen1 = 255;
+		TCHAR szKeyName22[255] = { 0 };
+		DWORD retCode;
+
+		while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey1, index, szKeyName, &dwKeyLen, 0, NULL, NULL, NULL))
+		{
+			index++;
+			std::wstring temp(szKeyName);
+			strBuffer = temp;
+
+			if (!strBuffer.empty())
+			{
+				state = AccessSubKey(strBuffer);
+				dwKeyLen = 255;
+				memset(szKeyName, 0, 255);
+				if (state != VertionResultType::None)
+					return state;
+
+				continue;
+			}
+			dwKeyLen = 255;
+			memset(szKeyName, 0, 255);
+		}
+	}
+
+	return state;
+}
+
+VertionResultType CAccessRegedit::AccessSubKey(std::wstring AppKey)
+{
+	DWORD dwType1 = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ | REG_DWORD_LITTLE_ENDIAN | REG_DWORD_BIG_ENDIAN | REG_LINK | REG_RESOURCE_LIST | REG_FULL_RESOURCE_DESCRIPTOR | REG_RESOURCE_REQUIREMENTS_LIST | REG_QWORD_LITTLE_ENDIAN;
+
+	long lRet;
+	HKEY hKey1;
+	TCHAR tchData1[64];
+	DWORD dwSize;
+
+	HKEY hkResult;
+	HKEY hkRKey;
+	LPCTSTR lpSubKey;
+	
+	AppKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products\\" + AppKey;
+	lpSubKey = AppKey.c_str();
+	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey1);
+	VertionResultType state = VertionResultType::None;
+
+	if (lRet == ERROR_SUCCESS)
+	{
+		DWORD index = 0;
+		TCHAR szKeyName[255] = { 0 };
+		DWORD dwKeyLen = 255;
+		std::wstring strBuffer;
+		std::wstring strMidReg;
+		TCHAR szBuffer1[255] = { 0 };
+		DWORD dwNameLen1 = 255;
+		TCHAR szKeyName22[255] = { 0 };
+		DWORD retCode;
+		while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey1, index, szKeyName, &dwKeyLen, 0, NULL, NULL, NULL))
+		{
+
+			index++;
+			std::wstring temp(szKeyName);
+			strBuffer = temp;
+
+			if (!strBuffer.empty())
+			{
+				std::wstring temp2(L"\\" + strBuffer);
+				strMidReg = lpSubKey + temp2;
+			
+				if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, strMidReg.c_str(), 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hkRKey) == ERROR_SUCCESS)
+				{
+					std::wstring str;
+
+					RegQueryValueEx(hkRKey, L"DisplayName", 0, &dwType1, (LPBYTE)szBuffer1, &dwNameLen1);
+
+					std::wstring temp3(szBuffer1);
+					str = temp3;
+
+					if (str == AppName)
+					{
+						RegQueryValueEx(hkRKey, L"DisplayVersion", 0, &dwType1, (LPBYTE)szBuffer1, &dwNameLen1);
+
+						std::wstring temp4(szBuffer1);
+						str = temp4;
+
+						if (str.find(VersionFromXML) != -1)
+						{
+							dwNameLen1 = 255;
+							memset(szBuffer1, 0, 255);
+
+							state = VertionResultType::Same;
+						}
+						else
+						{
+							int n = str.compare(VersionFromXML);
+							if (n < 0)
+							{
+								state = VertionResultType::Low;
+							}
+							else
+							{
+								state = VertionResultType::Hight;
+							}
+
+						}
+						VersionFromDevice = str;
+						dwNameLen1 = 255;
+						memset(szBuffer1, 0, 255);
+						return state;
+					}
+
+					dwNameLen1 = 255;
+					memset(szBuffer1, 0, 255);
+
+				}
+				dwKeyLen = 255;
+				memset(szKeyName, 0, 255);
+			}
+		}
+	}
+	VersionFromDevice = L"";
+	return state;
+}
+#include <Shlwapi.h>
+#pragma comment(lib,"shlwapi.lib")
+#include <atlconv.h>
+
+BOOL CAccessRegedit::FileExistsStatus(const CHAR* path)
+{
+	DWORD dwAttribute = GetFileAttributes((LPWSTR)path);
+	if (dwAttribute == 0XFFFFFFFF) {
+		return false;
+	}
+	else {
+		return true;
+	}
+}
+#include <WinInet.h> 
+
+#pragma comment(lib,"wininet.lib") 
+
+#define MAXBLOCKSIZE 1024
+
+
+#include <shlobj.h>
+#include <atlstr.h>
+#include <json/reader.h>
+
+std::wstring CAccessRegedit::GetInstallPageXML()
+{
+
+	IStream* stream;
+	HRESULT ret = URLOpenBlockingStreamW( 
+		nullptr, 
+		AppCore::URI_AppXml.c_str(),
+		&stream,
+		0,
+		nullptr
+	);
+
+
+
+
+	if (ret != S_OK)
+		return L"";
+
+	char buffer[1024] = { 0 };
+	DWORD readBytes = 0; 
+
+	std::wstring xmlcontent=L"";
+
+	do
+	{
+		stream->Read(
+			buffer, 
+			1024,
+			&readBytes
+		);
+
+		std::wstring wch = AppCore::GetMultiByteToWideChar(buffer);
+		xmlcontent = xmlcontent + wch;
+	} while (readBytes > 0);
+
+	int first = xmlcontent.find(L"sparkle:version=\"");
+
+	std::wstring newStr = xmlcontent.substr(first +17, 7);
+	stream->Release();
+
+
+	return newStr;
+}
+
+
+std::wstring CAccessRegedit::GetVersionFromXML()
+{
+	VersionFromXML = GetInstallPageXML();
+	return VersionFromXML;
+}
+
+
+
+#include <Windows.h>
+#include "CDownLoadFile.h"
+
+std::vector<std::string> CAccessRegedit::ReadJsonFromFile(const char* file)
+{
+	Json::Reader reader;
+	Json::Value root;
+
+	std::ifstream is;
+	is.open(file, std::ios::binary);
+	std::vector<std::string> imagelink;
+
+	if (reader.parse(is, root))
+	{
+		
+			Json::Value val_image = root["data"]["Static"][0]["picture_data"];
+			int image_size = val_image.size();
+			for (int j = 0; j < image_size; ++j)
+			{
+				std::string type = val_image[j]["pic_url"].asString();
+				imagelink.push_back(type);
+			}
+	}
+	is.close();
+
+	return imagelink;
+}
+
+std::vector<std::string> CAccessRegedit::GetBannerlinkFromJson(std::wstring st)
+{
+
+	DownloadProgress progress;
+	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
+
+	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + AppCore::smName_BannerJson;
+	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
+
+	//宽字符转多字节字符
+	char* pStr;
+	int iwstrLen = WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, 0, 0, 0, 0);
+	pStr = new char[iwstrLen + 1];
+	memset(pStr, 0, sizeof(char) * (iwstrLen + 1));
+	WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, pStr, iwstrLen, 0, 0);
+
+	return ReadJsonFromFile(pStr);
+
+}
+
+
+void CAccessRegedit::GetImage(std::wstring url, std::wstring saveFolder,int i)
+{
+
+	HRESULT Hfile = URLDownloadToFile(NULL, url.c_str(), saveFolder.c_str(), 0, NULL);
+
+}
+
+std::wstring CAccessRegedit::m_replace(std::wstring strSrc,const std::wstring& oldStr, const std::wstring& newStr)
+{
+	
+	std::wstring strRet = strSrc;
+	size_t pos = 0;
+	int l_count = 0;
+	int count = -1;
+	if (-1 == count) // replace all RegisterFileRelation std::wstring g_appIco = L"";
+		count = strRet.size();
+	while ((pos = strRet.find(oldStr, pos)) != std::wstring::npos)
+	{
+		strRet.replace(pos, oldStr.size(), newStr);
+		if (++l_count >= count) break;
+		pos += newStr.size();
+	}
+	return strRet;
+}
+
+bool CAccessRegedit::RegisterAppAutoRun(std::wstring strExt, std::wstring strAppName, std::wstring strAppKey, std::wstring strDefaultIcon,std::wstring strDescribe)
+{
+	LSTATUS status = ERROR_SUCCESS;
+	try
+	{
+		HKEY hKey;
+		status &= RegCreateKey(HKEY_CLASSES_ROOT, strExt.c_str(), &hKey);
+		status &= RegSetValue(hKey, L"", REG_SZ, strAppKey.c_str(), strAppKey.length());
+		status &= RegCloseKey(hKey);
+
+		status &= RegCreateKey(HKEY_CLASSES_ROOT, strAppKey.c_str(), &hKey);
+		status &= RegSetValue(hKey, L"", REG_SZ, strDescribe.c_str(), strDescribe.length());
+		status &= RegCloseKey(hKey);
+
+		std::wstring strAppIconKey = strAppKey + L"\\DefaultIcon";
+		status &= RegCreateKey(HKEY_CLASSES_ROOT, strAppIconKey.c_str(), &hKey);
+		status &= RegSetValue(hKey, L"", REG_SZ, strDefaultIcon.c_str(), strDefaultIcon.length());
+		status &= RegCloseKey(hKey);
+
+		std::wstring strAppShellKey = strAppKey + L"\\Shell";
+		status &= RegCreateKey(HKEY_CLASSES_ROOT, strAppShellKey.c_str(), &hKey);
+		status &= RegSetValue(hKey, L"", REG_SZ, L"Open", sizeof(L"Open"));
+		status &= RegCloseKey(hKey);
+
+		strAppShellKey = strAppKey + L"\\Open\\Command";
+		status &= RegCreateKey(HKEY_CLASSES_ROOT, strAppShellKey.c_str(), &hKey);
+		strAppName += L" \"%1\"";
+		status &= RegSetValue(hKey, L"", REG_SZ, strAppName.c_str(), strAppName.length());
+		status &= RegCloseKey(hKey);
+	}
+	catch(int e)
+	{
+		return true;
+	}
+	return true;
+}
+
+void CAccessRegedit::AutoRun()
+{
+
+
+	std::wstring strAppPath = L"\"C:\\Users\\kdan\\PDFReaderPro\\PDFReaderProWin.exe\"";
+	
+	bool isSuccess = RegisterAppAutoRun(L".pdf", strAppPath, L"PDFReaderProWin.PDF", L"", L"PDFReaderProWin");
+//	WriteReg();
+	//RegisterDefaultPDFOpen();
+
+}
+
+#include<profinfo.h>
+VertionResultType CAccessRegedit::RegisterDefaultPDFOpen()
+{
+	DWORD dwType1 = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ | REG_DWORD_LITTLE_ENDIAN | REG_DWORD_BIG_ENDIAN | REG_LINK | REG_RESOURCE_LIST | REG_FULL_RESOURCE_DESCRIPTOR | REG_RESOURCE_REQUIREMENTS_LIST | REG_QWORD_LITTLE_ENDIAN;
+	LPCTSTR lpSubKey;
+	long lRet;
+	HKEY hKey;
+	TCHAR tchData1[64];
+	DWORD dwSize;
+
+	HKEY hkResult;
+	HKEY hkRKey;
+
+	lpSubKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice";
+	std::wstring strAppPath = L"PDFReaderProWin.PDF";
+	
+
+
+
+	lRet = RegOpenKeyEx(HKEY_CURRENT_USER, lpSubKey, 0, KEY_READ/*KEY_ALL_ACCESS *//*| KEY_SET_VALUE| KEY_READ*//* | KEY_WOW64_32KEY | KEY_WOW64_64KEY*/, &hKey);
+	LPCWSTR dda222 = L"UserChoice";;
+	LPCWSTR strAppPath223 = L"PDFReaderProWin.PDF";;
+	lRet = RegSetKeyValue(
+		HKEY_CURRENT_USER, //主键
+		lpSubKey, //子键的路径
+		L"ProgId", //值的名称
+		REG_SZ, //值的类型
+		strAppPath223, //值的数据所在的缓冲区
+		sizeof(L"PDFReaderProWin.PDF")
+	);
+
+
+	//lRet = RegOpenKeyEx(HKEY_CURRENT_USER, lpSubKey, 0, KEY_WRITE | KEY_WOW64_32KEY| KEY_WOW64_64KEY , &hKey);
+	VertionResultType state = VertionResultType::None;
+
+	if (lRet == ERROR_SUCCESS)
+	{
+		DWORD index = 0;
+		TCHAR szKeyName[255] = { 0 };
+		DWORD dwKeyLen = 255;
+		std::wstring strBuffer;
+		std::wstring strMidReg;
+		TCHAR szBuffer1[255] = { 0 };
+		DWORD dwNameLen1 = 255;
+		TCHAR szKeyName22[255] = { 0 };
+		DWORD retCode;
+		bool isHaveUserChoice = false;
+		while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, index, szKeyName, &dwKeyLen, 0, NULL, NULL, NULL))
+		{
+
+			index++;
+			std::wstring temp(szKeyName);
+			strBuffer = temp;
+
+			if (!strBuffer.empty())
+			{
+				std::wstring temp2(L"\\" + strBuffer);
+				strMidReg = lpSubKey + temp2;
+				LPCWSTR dda = L"UserChoice";;
+				LPCWSTR strAppPath22 = L"PDFReaderProWin.PDF";;
+				if (temp2 == L"\\UserChoice")
+				{
+					
+					isHaveUserChoice = true;
+					lRet = RegSetKeyValue(
+						hKey, //主键
+						dda, //子键的路径
+						L"ProgId", //值的名称
+						REG_SZ, //值的类型
+						strAppPath22, //值的数据所在的缓冲区
+						sizeof(strAppPath22)
+					);
+
+					if (lRet != ERROR_SUCCESS)
+					{
+						int i = 0;
+					}
+					//RegSetKeyValue();
+				}
+
+
+				/*if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, strMidReg.c_str(), 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hkRKey) == ERROR_SUCCESS)
+				{
+					std::wstring str;
+
+					RegQueryValueEx(hkRKey, L"DisplayName", 0, &dwType1, (LPBYTE)szBuffer1, &dwNameLen1);
+
+					std::wstring temp3(szBuffer1);
+					str = temp3;
+
+					if (str == AppName)
+					{
+						RegQueryValueEx(hkRKey, L"DisplayVersion", 0, &dwType1, (LPBYTE)szBuffer1, &dwNameLen1);
+
+						std::wstring temp4(szBuffer1);
+						str = temp4;
+
+						if (str.find(VersionFromXML) != -1)
+						{
+							dwNameLen1 = 255;
+							memset(szBuffer1, 0, 255);
+
+							state = VertionResultType::Same;
+						}
+						else
+						{
+							int n = str.compare(VersionFromXML);
+							if (n < 0)
+							{
+								state = VertionResultType::Low;
+							}
+							else
+							{
+								state = VertionResultType::Hight;
+							}
+
+						}
+						VersionFromDevice = str;
+						dwNameLen1 = 255;
+						memset(szBuffer1, 0, 255);
+						return state;
+					}
+
+					dwNameLen1 = 255;
+					memset(szBuffer1, 0, 255);
+
+				}*/
+				dwKeyLen = 255;
+				memset(szKeyName, 0, 255);
+			}
+		}
+	}
+	VersionFromDevice = L"";
+	return state;
+}
+
+#include<tlhelp32.h>
+#include<sddl.h>
+//这个函数的的代码不美观哈
+BOOL CAccessRegedit::GetTokenByName(HANDLE& hToken, LPTSTR lpName)
+{
+	if (!lpName)
+		return FALSE;
+
+	HANDLE         hProcessSnap = NULL;
+	BOOL           bRet = FALSE;
+	PROCESSENTRY32 pe32 = { 0 };
+
+	hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+	if (hProcessSnap == INVALID_HANDLE_VALUE)
+		return (FALSE);
+
+	pe32.dwSize = sizeof(PROCESSENTRY32);
+
+	if (Process32First(hProcessSnap, &pe32))
+	{
+		do
+		{
+			if (!_tcscmp(_tcsupr(pe32.szExeFile), _tcsupr(lpName)))
+			{
+				HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pe32.th32ProcessID);
+				bRet = OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken);
+				CloseHandle(hProcess);
+				CloseHandle(hProcessSnap);
+				return (bRet);
+			}
+		} while (Process32Next(hProcessSnap, &pe32));
+		bRet = FALSE;
+	}
+	else
+	{
+		bRet = FALSE;
+	}
+
+	CloseHandle(hProcessSnap);
+	return (bRet);
+}
+//
+//获取用户sid
+//
+bool CAccessRegedit::GetAccountSid(LPTSTR AccountName, PSID* Sid)
+{
+	PSID pSID = NULL;
+	DWORD cbSid = 0;
+	LPTSTR DomainName = NULL;
+	DWORD cbDomainName = 0;
+	SID_NAME_USE SIDNameUse;
+	BOOL  bDone = FALSE;
+	do
+	{
+		if (LookupAccountName(NULL,
+			AccountName,
+			pSID,
+			&cbSid,
+			DomainName,
+			&cbDomainName,
+			&SIDNameUse))
+		{
+			bDone = TRUE;
+			break;
+		}
+		pSID = (PSID)malloc(cbSid);
+		DomainName = (LPTSTR)malloc(cbDomainName * sizeof(TCHAR));
+		if (!pSID || !DomainName)
+		{
+			printf("malloc error\n");
+			break;
+		}
+		if (!LookupAccountName(NULL,
+			AccountName,
+			pSID,
+			&cbSid,
+			DomainName,
+			&cbDomainName,
+			&SIDNameUse))
+		{
+			printf("LookupAccountName error code:%d\n", GetLastError());
+			break;
+		}
+		bDone = TRUE;
+
+	} while (FALSE);
+	if (DomainName)
+	{
+		free(DomainName);
+		DomainName = NULL;
+	}
+
+	if (!bDone && pSID)
+	{
+		free(pSID);
+		pSID = NULL;
+	}
+	if (bDone)
+	{
+		*Sid = pSID;
+	}
+	return bDone;
+}
+
+//修改注册表
+void CAccessRegedit::WriteReg()
+{
+	PSID pSid = NULL;
+	HANDLE hToken = NULL;
+	do
+	{
+		std::wstring ddsd = L"EXPLORER.EXE";
+
+		wchar_t* ptr = _wcsdup(ddsd.c_str());
+		LPTSTR d = ptr;
+		if (!GetTokenByName(hToken, d))
+		{
+			printf("GetTokenByName error\n");
+			break;
+		}
+
+		// 模拟登录用户的安全上下文
+		if (FALSE == ImpersonateLoggedOnUser(hToken))
+		{
+			printf("ImpersonateLoggedOnUser error\n");
+			break;
+		}
+
+		// 获取用户名
+		TCHAR szUsername[MAX_PATH];
+		DWORD dwUsernameLen = MAX_PATH;
+		if (FALSE == GetUserName(szUsername, &dwUsernameLen))
+			break;
+
+		// 到这里已经模拟完了,别忘记返回原来的安全上下文
+		if (FALSE == RevertToSelf())
+			break;
+
+		// 获取sid
+		
+		LPWSTR sid;
+		BOOL ret = GetAccountSid(szUsername, &pSid); //获取得到的是一个结构体
+		if (!ret)
+		{
+			printf("GetAccountSid fail\n");
+			break;
+		}
+		ret = ConvertSidToStringSid(pSid, &sid); //从结构体中得到sid串
+		if (!ret)
+		{
+			printf("ConvertSidToStringSid fail code %d\n", GetLastError());
+			break;
+		}
+
+		DWORD dwType1 = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ | REG_DWORD_LITTLE_ENDIAN | REG_DWORD_BIG_ENDIAN | REG_LINK | REG_RESOURCE_LIST | REG_FULL_RESOURCE_DESCRIPTOR | REG_RESOURCE_REQUIREMENTS_LIST | REG_QWORD_LITTLE_ENDIAN;
+		LPCTSTR lpSubKey;
+		long lRet;
+		HKEY hKey;
+		TCHAR tchData1[64];
+		DWORD dwSize;
+
+		HKEY hkResult;
+		HKEY hkRKey;
+
+
+
+	//	lpSubKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice";
+	//	std::wstring strAppPath = L"PDFReaderProWin.PDF";
+
+
+
+
+	////	lRet = RegOpenKeyEx(HKEY_CURRENT_USER, lpSubKey, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY/*| KEY_SET_VALUE| KEY_READ*//* | KEY_WOW64_32KEY | KEY_WOW64_64KEY*/, &hKey);
+	//	LPCWSTR dda222 = L"UserChoice";;
+	//	LPCWSTR strAppPath223 = L"PDFReaderProWin.PDF";;
+	//	lRet = RegSetKeyValue(
+	//		HKEY_CURRENT_USER, //主键
+	//		lpSubKey, //子键的路径
+	//		L"ProgId", //值的名称
+	//		REG_SZ, //值的类型
+	//		strAppPath223, //值的数据所在的缓冲区
+	//		sizeof(L"PDFReaderProWin.PDF")
+	//	);
+
+
+
+		RegisterDefaultPDFOpen();
+		/*
+		  这里就可以操作CURRENT_USER中的注册表项了
+		  将用户的SID与要操作的注册表项拼接在一起就可以操作了
+		*/
+
+	} while (false);
+	if (hToken)
+	{
+		CloseHandle(hToken);
+		hToken = NULL;
+	}
+
+	if (pSid)
+	{
+		free(pSid);
+		pSid = NULL;
+	}
+}

+ 53 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h

@@ -0,0 +1,53 @@
+#pragma once
+#include<string>
+#include<windows.h>
+#include "AppCore.h"
+#include "CClasses.h"
+#include<vector>
+typedef struct _URL_INFO
+{
+	WCHAR szScheme[512];
+	WCHAR szHostName[512];
+	WCHAR szUserName[512];
+	WCHAR szPassword[512];
+	WCHAR szUrlPath[512];
+	WCHAR szExtraInfo[512];
+}URL_INFO, * PURL_INFO;
+
+
+class CAccessRegedit
+{
+
+public:
+
+	bool RegisterAppAutoRun(std::wstring strExt, std::wstring strAppName, std::wstring strAppKey, std::wstring strDefaultIcon, std::wstring strDescribe);
+	void AutoRun();
+	VertionResultType RegisterDefaultPDFOpen();
+	
+	std::wstring VersionFromXML;
+	std::wstring VersionFromDevice;
+	/// <summary>
+	/// 访问注册表
+	/// </summary>
+	/// <param name="AppKey">注册表的产品标识</param>
+	/// <returns></returns>
+	VertionResultType AccessKey();
+	std::wstring GetVersionFromXML();
+
+	std::vector<std::string> GetBannerlinkFromJson(std::wstring st);
+	std::vector<std::string> ReadJsonFromFile(const char* file);
+
+	BOOL FileExistsStatus(const CHAR* path);
+
+	void GetImage(std::wstring url, std::wstring saveFolder, int i);
+	std::wstring m_replace(std::wstring strSrc,const std::wstring& oldStr, const std::wstring& newStr);
+private:
+	VertionResultType AccessSubKey(std::wstring AppKey);
+	std::wstring GetInstallPageXML();
+private:
+	const std::wstring AppName = L"PDF Reader Pro";
+
+	void WriteReg();
+	bool GetAccountSid(LPTSTR AccountName, PSID* Sid);
+	BOOL GetTokenByName(HANDLE& hToken, LPTSTR lpName);
+};

+ 57 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp

@@ -0,0 +1,57 @@
+#include "CAdsBanner.h"
+
+CAdsBanner::CAdsBanner()
+{
+
+}
+
+std::vector<std::string> CAdsBanner::GetBannerlinkFromJson(std::wstring st)
+{
+	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + AppCore::smName_BannerJson;
+	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0,NULL);
+
+	//¿í×Ö·ûת¶à×Ö½Ú×Ö·û
+	char* pStr;
+	int iwstrLen = WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, 0, 0, 0, 0);
+	pStr = new char[iwstrLen + 1];
+	memset(pStr, 0, sizeof(char) * (iwstrLen + 1));
+	WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, pStr, iwstrLen, 0, 0);
+
+	return ReadJsonFromFile(pStr);
+}
+
+std::vector<std::string> CAdsBanner::ReadJsonFromFile(const char* file)
+{
+	Json::Reader reader;
+	Json::Value root;
+
+	std::ifstream is;
+	is.open(file, std::ios::binary);
+	BannerCollection.clear();
+	if (reader.parse(is, root))
+	{
+
+		Json::Value val_image = root["data"]["Static"][0]["picture_data"];
+		int image_size = val_image.size();
+		for (int j = 0; j < image_size; ++j)
+		{
+			std::string pic_url = val_image[j]["pic_url"].asString();
+			BannerCollection.push_back(pic_url);
+		}
+	}
+	is.close();
+
+	return BannerCollection;
+}
+
+void CAdsBanner::GetBannerJson(std::wstring st)
+{
+
+}
+
+void CAdsBanner::GetImage(std::wstring url, std::wstring saveFolder, int i)
+{
+
+	HRESULT Hfile = URLDownloadToFile(NULL, url.c_str(), saveFolder.c_str(), 0, NULL);
+
+}

+ 16 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.h

@@ -0,0 +1,16 @@
+//#pragma once
+#include "AppCore.h"
+#include <shlobj.h>
+#include <atlstr.h>
+#include <json/reader.h>
+#include <fstream>
+class CAdsBanner
+{
+public:
+	vector<std::string> BannerCollection;
+	CAdsBanner();
+	std::vector<std::string> GetBannerlinkFromJson(std::wstring st);
+	std::vector<std::string> ReadJsonFromFile(const char* file);
+	void GetBannerJson(std::wstring st);
+	void GetImage(std::wstring url, std::wstring saveFolder, int i);
+};

+ 1 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CClasses.cpp

@@ -0,0 +1 @@
+#include "CClasses.h"

+ 104 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CClasses.h

@@ -0,0 +1,104 @@
+#pragma once
+/// <summary>
+/// 显示界面类型
+/// </summary>
+enum class LayoutType
+{
+	/// <summary>
+	/// 主页界面
+	/// </summary>
+	Home,
+	/// <summary>
+	/// 安装中界面
+	/// </summary>
+	Installing,
+	/// <summary>
+	/// 安装完成界面
+	/// </summary>
+	Installed
+};
+
+/// <summary>
+/// 设备与安装包的版本号比较
+/// </summary>
+enum class VertionResultType
+{
+	/// <summary>
+	/// 设备还没有安装产品
+	/// </summary>
+	None,
+	/// <summary>
+	/// 与安装包的版本号相同
+	/// </summary>
+	Same,
+	/// <summary>
+	/// 低于安装包的版本号
+	/// </summary>
+	Low,
+	/// <summary>
+	/// 高于安装包的版本号
+	/// </summary>
+	Hight
+};
+
+/// <summary>
+/// 安装状态
+/// </summary>
+enum class InstallStateType
+{
+	/// <summary>
+	/// 待安装
+	/// </summary>
+	None,
+	/// <summary>
+	/// 安装失败
+	/// </summary>
+	Failed,
+	/// <summary>
+	/// 没有网络
+	/// </summary>
+	NoNetWork,
+	/// <summary>
+	/// 安装成功
+	/// </summary>
+	Success
+};
+
+/// <summary>
+/// 安装中状态
+/// </summary>
+enum class SilenceInstallingType
+{
+	/// <summary>
+	/// 未安装
+	/// </summary>
+	None,
+	/// <summary>
+	/// 下载中
+	/// </summary>
+	DownLoading,
+	/// <summary>
+	/// 下载中断网
+	/// </summary>
+	DownLoadNoNetWork,
+	/// <summary>
+	/// 下载失败
+	/// </summary>
+	DownLoadFailed,
+	/// <summary>
+	/// 下载完成
+	/// </summary>
+	DownLoadSuccess,
+	/// <summary>
+	/// 安装中
+	/// </summary>
+	Installing,
+	/// <summary>
+	/// 安装失败
+	/// </summary>
+	InstallFailed,
+	/// <summary>
+	/// 已安装
+	/// </summary>
+	Installed
+};

+ 134 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp

@@ -0,0 +1,134 @@
+#include "CCmd.h"
+#include <time.h>
+
+CCmd::CCmd()
+{
+	
+}
+
+BOOL CCmd::Installcmd()
+{
+	std::wstring cmd=L"";
+
+	if (AppCore::smPath_Install.find(L" ") != -1)
+	{
+		cmd = L"/k cd \"" + AppCore::smPath_Install + L"\"" + L" & start/wait " + AppCore::smName_InstallPackage + L" APPDIR=\"" + AppCore::smPath_Install + L"\" /qb /qn /norestart";
+	}
+	else
+	{
+		cmd = L"/k start/wait " + AppCore::smPath_Install + L"\\" + AppCore::smName_InstallPackage + L" APPDIR=" + AppCore::smPath_Install + L" /qb /qn /norestart";
+	}
+
+	//wstring s = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + L"静默安装日志";
+	//wchar_t* ptr = _wcsdup(s.c_str());
+	//std::string ss = AppCore::GetWideCharToMultiByte(ptr);
+	//
+	//time_t     now = time(0);
+	//struct tm  tstruct;
+	//char       buf[80];
+	//tstruct = *std::localtime(&now);
+	//strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct);
+
+
+	//DWORD pidIni = WritePrivateProfileStringA("静默指令日志", buf, "cmd:", ss.c_str());
+
+	TCHAR* tc = (TCHAR*)(&cmd[0]);
+	return Executecmd(tc);
+}
+
+BOOL CCmd::OpenAppcmd()
+{
+	std::wstring cmd = L"";
+
+	if (AppCore::smPath_Install.find(L" ") != -1)
+	{
+		cmd = L"/k cd \"" + AppCore::smPath_Install + L"\"" + L" & start/wait " + AppCore::smName_Application;
+	}
+	else
+	{
+		cmd = L"/k  start/wait " + AppCore::smPath_Install + L"\\" + AppCore::smName_Application;
+	}
+
+
+	TCHAR* tc = (TCHAR*)(&cmd[0]);
+   return Executecmd(tc);
+}
+
+
+BOOL CCmd::Executecmd(TCHAR pszCmdLine[])
+{
+		char Buffer[4096];
+		STARTUPINFO sInfo;//新进程的主窗口特性
+		PROCESS_INFORMATION pInfo;
+		SECURITY_ATTRIBUTES sa;
+		HANDLE hRead, hWrite;
+		DWORD bytesRead;    //读取代码的长度
+		sa.nLength = sizeof(SECURITY_ATTRIBUTES); //结构体的大小,可用SIZEOF取得
+		sa.lpSecurityDescriptor = NULL;//安全描述符
+		sa.bInheritHandle = TRUE;; //安全描述的对象能否被新创建ÆÆ的进程继承
+
+		if (!CreatePipe(&hRead, &hWrite, &sa, 0)) //创建匿名管道
+		{
+			return GetLastError();//返回最近的一个错误,0表示正常
+		}
+
+		GetStartupInfo(&sInfo);
+		sInfo.cb = sizeof(sInfo);
+		sInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
+		sInfo.wShowWindow = SW_HIDE;
+		sInfo.hStdError = hWrite;   //将管道的写端交给子进程
+		sInfo.hStdOutput = hWrite;
+		memset(&pInfo, 0, sizeof(pInfo));
+		
+		if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe"/*L"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\\powershell.exe"*/, pszCmdLine , NULL, NULL, TRUE, 0, NULL, NULL, &sInfo, &pInfo)) //创建子进程
+		{
+			CloseHandle(hWrite);
+			CloseHandle(hRead);
+			return GetLastError();
+		}
+
+
+		for (int i = 0;; ++i)
+		{
+			if (!ReadFile(hRead, Buffer, sizeof(Buffer) - 1, &bytesRead, NULL)) //读取内容
+			{
+				break;
+				Buffer[bytesRead] = 0;
+			}
+			else
+			{
+				WaitForSingleObject(pInfo.hProcess, /*INFINITE*/1000);//当等待仍在挂起状态时,句柄被关闭,那么函数行为是未定义的。该句柄必须具有 SYNCHRONIZE 访问权限;
+				CloseHandle(hRead);
+			//	system("pause");
+				return TRUE;
+			}
+
+
+		}
+
+		return TRUE;
+
+		WaitForSingleObject(pInfo.hProcess, INFINITE);//当等待仍在挂起状态时,句柄被关闭,那么函数行为是未定义的。该句柄必须具有 SYNCHRONIZE 访问权限;
+		CloseHandle(hRead);
+		//system("pause");
+		return TRUE;
+
+}
+
+//其他执行cmd的方式
+//	//system("cmd.exe /k start/wait C:\\Users\\kdan\\Desktop\\Demo\\PDFReaderPro.exe /qb /qn /norestart");
+//	SHELLEXECUTEINFO ShExecInfo = { 0 };
+//	ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+//	ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
+//	ShExecInfo.hwnd = NULL;
+//	ShExecInfo.lpVerb = NULL;
+//	ShExecInfo.lpFile = L"cmd.exe";//调用的程序名
+//	ShExecInfo.lpParameters = L"/k start/wait C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro\\PDFReaderPro.exe APPDIR=C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro APPDATADIR=C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro /qn";///qb调用程序的命令行参数
+//	ShExecInfo.lpDirectory = NULL;
+//	ShExecInfo.nShow = SW_HIDE;//窗口状态为隐藏
+//	ShExecInfo.hInstApp = NULL;
+//	ShellExecuteEx(&ShExecInfo); //启动新的程序
+//	WaitForSingleObject(ShExecInfo.hProcess, INFINITE);////等到该进程结束
+////C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
+//	/*Start - Process - FilePath C : \Users\kdan\Desktop\Demo\PDFReaderPro.exe / qn*/
+//	return true;

+ 22 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.h

@@ -0,0 +1,22 @@
+#pragma once
+#include<string>
+#include "AppCore.h"
+#include <tchar.h>
+#include <windows.h>
+#include "CCmd.h"
+
+
+
+class CCmd
+{
+public:
+	STARTUPINFO si;
+	PROCESS_INFORMATION pi;
+	 CCmd();
+	//¾²Ä¬°²×°Ö¸Áî
+	 BOOL Installcmd();
+	//´ò¿ªAppÖ¸Áî
+	 BOOL OpenAppcmd();
+	 BOOL Executecmd(TCHAR pszCmdLine[]);
+};
+

+ 19 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp

@@ -0,0 +1,19 @@
+#include "CDownLoadFile.h"
+#include <WinInet.h>
+
+double DownloadProgress::Currentpercentage = 0;
+bool CDownLoadFile::GetInstallPackage(std::wstring SaveFolder)
+{
+	DownloadProgress progress;
+	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
+
+	SaveFolder = AppCore::GetOrCreateFolderPath(SaveFolder) + L"/" + AppCore::smName_InstallPackage;
+	DeleteUrlCacheEntry(AppCore::URI_InstallPackge.c_str());
+	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_InstallPackge.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
+	
+	if (DownloadProgress::Currentpercentage > 99.0)
+	{
+		return true;
+	}
+	return false;
+}

+ 64 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h

@@ -0,0 +1,64 @@
+#pragma once
+#include "AppCore.h"
+#include <winerror.h>
+#include<BASETYPS.H>
+#include <urlmon.h>
+#pragma comment(lib, "urlmon.lib")
+
+
+class DownloadProgress : public IBindStatusCallback
+{
+
+public:
+    static double Currentpercentage;
+    HRESULT __stdcall QueryInterface(const IID&, void**) {
+        return E_NOINTERFACE;
+    }
+    ULONG STDMETHODCALLTYPE AddRef(void) {
+        return 1;
+    }
+    ULONG STDMETHODCALLTYPE Release(void) {
+        return 1;
+    }
+    HRESULT STDMETHODCALLTYPE OnStartBinding(DWORD dwReserved, IBinding* pib) {
+        return E_NOTIMPL;
+    }
+    virtual HRESULT STDMETHODCALLTYPE GetPriority(LONG* pnPriority) {
+        return E_NOTIMPL;
+    }
+    virtual HRESULT STDMETHODCALLTYPE OnLowResource(DWORD reserved) {
+        return S_OK;
+    }
+    virtual HRESULT STDMETHODCALLTYPE OnStopBinding(HRESULT hresult, LPCWSTR szError) {
+        return E_NOTIMPL;
+    }
+    virtual HRESULT STDMETHODCALLTYPE GetBindInfo(DWORD* grfBINDF, BINDINFO* pbindinfo) {
+        return E_NOTIMPL;
+    }
+    virtual HRESULT STDMETHODCALLTYPE OnDataAvailable(DWORD grfBSCF, DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) {
+        return E_NOTIMPL;
+    }
+    virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable(REFIID riid, IUnknown* punk) {
+        return E_NOTIMPL;
+    }
+
+    virtual HRESULT __stdcall OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
+    {
+        if (ulProgressMax != 0)
+        {
+            double* percentage = new double(ulProgress * 1.0 / ulProgressMax * 100);
+            DownloadProgress::Currentpercentage = *percentage;
+            //½«percentage ·¢Ë͸øÏÔʾ
+            delete percentage;
+        }
+        return S_OK;
+    }
+};
+
+
+class CDownLoadFile
+{
+public:
+    bool GetInstallPackage(std::wstring SaveFolder);
+};
+

+ 362 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp

@@ -0,0 +1,362 @@
+#include "stdafx.h"
+#include <sstream>
+#include "CFrameWnd.h"
+#include<vector>
+#include <Utils/stb_image.h>
+#define UIMSG_SET_DPI WM_USER + 200
+#pragma region 初始化
+
+DUI_BEGIN_MESSAGE_MAP(CMainPage, CNotifyPump)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_CLICK, OnClick)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_SELECTCHANGED, OnSelectChanged)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_ITEMCLICK, OnItemClick)
+DUI_END_MESSAGE_MAP()
+
+CMainPage::CMainPage()
+{
+	m_pPaintManager = NULL;
+}
+
+void CMainPage::SetPaintMagager(CPaintManagerUI* pPaintMgr)
+{
+	m_pPaintManager = pPaintMgr;
+}
+
+void CMainPage::OnClick(TNotifyUI& msg)
+{
+
+}
+
+void CMainPage::OnSelectChanged(TNotifyUI& msg)
+{
+
+}
+
+void CMainPage::OnItemClick(TNotifyUI& msg)
+{
+
+}
+
+
+/// ///////////////////////////////////////
+
+SilenceInstallingType CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::None;
+
+CFrameWnd::CFrameWnd(LPCTSTR pszXMLPath)
+	: m_strXMLPath(pszXMLPath)
+{
+
+}
+
+CFrameWnd::CFrameWnd()
+{
+	m_MainPage.SetPaintMagager(&m_pm);
+	AddVirtualWnd(_T("MainWnd"), &m_MainPage);
+	banner = new CAdsBanner();
+	m_threadData.pFrame = this;
+}
+
+CFrameWnd::~CFrameWnd(void)
+{
+	RemoveVirtualWnd(_T("MainWnd"));
+}
+
+LPCTSTR CFrameWnd::GetWindowClassName() const
+{
+	return _T("MainWnd");
+}
+
+
+//DuiLib::CDuiString CFrameWnd::GetSkinFile()
+//{
+//	return XML_MainFile;
+//}
+
+CDuiString CFrameWnd::GetSkinFolder()
+{
+	return _T("");
+}
+
+void CFrameWnd::InitControls()
+{
+	m_InstallationPage = new InstallationPage(&m_pm);
+	m_InstallingPage = new InstallingPage(&m_pm);
+	m_InstalledPage = new InstalledPage(&m_pm);
+	InitHomeControls();
+	InitInstallingControls();
+	InitInstalledControls();
+
+}
+
+void CFrameWnd::InitWindow()
+{
+	SetIcon(IDI_ICON1);
+	//SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME);
+	this->CenterWindow();
+	InitControls();
+	//AdaptationDPI();
+
+}
+
+
+void CFrameWnd::AdaptationDPI()
+{
+	HWND hd = FindWindow(L"Progman", L"Program Manager");
+
+	int dpiValue = GetDpiForWindow(hd);//当前DPI
+
+	double currentZoom = dpiValue / 96.0;//当前显示比例
+	double tempDPI = currentZoom;
+
+	int dpiOffer = (int)(96 - (currentZoom - 1) * 96.0);//DPI偏移量
+
+	if (dpiValue == 96)
+	{
+		dpi = 1;
+		CurrentDPI = 96;
+	}
+	else
+	{
+		dpi = dpiOffer / 96.0;//比例偏移量
+		CurrentDPI = 96 - dpiOffer;
+		dpi = 1 - dpi;
+
+	}
+
+	m_pm.SetDPI(CurrentDPI);
+}
+
+void CFrameWnd::setDPI(int DPI)
+{
+	m_pm.SetDPI(DPI);
+}
+//使用OnCreate就会不触发GetSkinFile事件
+//LRESULT CFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+//{
+//
+//	return 1;
+//}
+
+
+LRESULT CFrameWnd::OnDPIChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	m_pm.SetDPI(LOWORD(wParam));
+	m_pm.ResetDPIAssets();
+	int g_dpi = HIWORD(wParam);
+
+	RECT* const prcNewWindow = (RECT*)lParam;
+	SetWindowPos(m_hWnd,
+		NULL,
+		prcNewWindow->left,
+		prcNewWindow->top,
+		prcNewWindow->right - prcNewWindow->left,
+		prcNewWindow->bottom - prcNewWindow->top,
+		SWP_NOZORDER | SWP_NOACTIVATE);
+	if (m_pm.GetRoot() != NULL) m_pm.GetRoot()->NeedUpdate();
+
+	bHandled = false;
+
+	wstring optionName;
+	wstringstream wss;
+	wss << L"DPI";
+	wss << m_pm.GetDPIObj()->GetDPI();
+	wss >> optionName;
+	COptionUI* option = static_cast<COptionUI*>(m_pm.FindControl(optionName.c_str()));
+	option->Selected(true);
+
+	return 0;
+}
+
+#pragma endregion
+
+
+
+
+#pragma region 事件逻辑处理
+
+
+LRESULT CFrameWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	if (wParam == TIMER_BANNER_ID)
+	{
+		SetTimerBannerSwitch();
+	}
+
+	if (wParam == TIMER_INSTALL_ID)
+	{
+		SetTimerInstalling();
+	}
+
+	if (wParam == TIMER_WAITDOWNLOAD_ID)
+	{
+		SetTimerBanner();
+	}
+
+	if (wParam == TIMER_SILENTINSTALL_ID)
+	{
+		SetTimerSilen();
+	}
+
+	bHandled = false;
+	return 0;
+}
+
+#pragma endregion
+
+
+
+void CFrameWnd::Notify(TNotifyUI& msg)
+{
+
+	if (msg.sType == _T("click"))
+	{
+	
+		if (msg.pSender->GetName() == _T("BtnClose"))
+		{
+		
+			if (MSGID_OK == CMsgWnd::MessageBox(
+				m_hWnd, _T("提示"), CLanguage::GetText(TextType::MSG_IsExitApp).c_str(),
+				CLanguage::GetText(TextType::MSG_BtnOK).c_str(),
+				CLanguage::GetText(TextType::MSG_BtnCancel).c_str()
+				))
+			{
+
+				::DestroyWindow(m_hWnd);
+			}
+		}
+
+		if (msg.pSender->GetName() == _T("Btnminsize"))
+		{
+			//CAccessRegedit d;
+			//d.AutoRun();
+			SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
+			//return ;
+		}
+	}
+
+
+
+	switch (m_State.m_LayoutType)
+	{
+	case LayoutType::Home:
+		NotifyHome(msg);
+		break;
+	case LayoutType::Installing:
+		NotifyInstalling(msg);
+		break;
+	case LayoutType::Installed:
+		NotifyInstalled(msg);
+		break;
+	default:
+		break;
+	}
+
+	return WindowImplBase::Notify(msg);
+}
+
+
+
+
+
+
+std::wstring CFrameWnd::m_replace(std::wstring strSrc, const std::wstring& oldStr, const std::wstring& newStr)
+{
+	std::wstring strRet = strSrc;
+	size_t pos = 0;
+	int l_count = 0;
+	int count = -1;
+	if (-1 == count) // replace all
+		count = strRet.size();
+	while ((pos = strRet.find(oldStr, pos)) != std::wstring::npos)
+	{
+		strRet.replace(pos, oldStr.size(), newStr);
+		if (++l_count >= count) break;
+		pos += newStr.size();
+	}
+	return strRet;
+}
+
+
+LRESULT CFrameWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LRESULT lRes = 0;
+	BOOL bHandled1 = TRUE;
+	wstring optionNamea;
+	wstringstream wss;
+	
+	switch (uMsg)
+	{
+	case WM_CREATE:
+		break;
+		//return 0;
+
+	case WM_DESTROY:
+::PostQuitMessage(0);
+AppCore::ClearAllTempFolder();
+		break;
+	case WM_NCCALCSIZE:
+		return 0;
+
+	/*case WM_NCHITTEST:
+		break;*/
+	case WM_DPICHANGED:
+		lRes = OnDPIChanged(uMsg, wParam, lParam, bHandled); 
+		break;
+	//case WM_LBUTTONDOWN:
+	//
+	//	break;
+
+	//case WM_MOUSEMOVE:
+	//	break;
+
+	//case WM_LBUTTONUP:
+	//	break;
+
+	//case WM_NCLBUTTONDBLCLK:
+	//	break;
+		//return 0;
+    case WM_TIMER:  
+		lRes = OnTimer(uMsg, wParam, lParam, bHandled);
+		break;
+
+	case UIMSG_SET_DPI:
+		wss << L"DPI";
+		wss << m_pm.GetDPIObj()->GetDPI();
+		wss >> optionNamea;
+		break;
+	default:
+		break;
+	}
+
+	return lRes;
+
+	//以下代码的实现,会导致编辑框失去焦点之后而无法再次获取焦点
+	/*if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes)) return lRes;
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);*/
+
+}
+
+void CFrameWnd::SelectLayout(LayoutType LayoutType)
+{
+	this->m_State.m_LayoutType = LayoutType;
+	m_InstallationPage->LayoutHome->SetVisible(false);
+	m_InstallingPage->LayoutInstalling->SetVisible(false);
+	m_InstalledPage->LayoutInstalled->SetVisible(false);
+	switch (LayoutType)
+	{
+	case LayoutType::Home:
+		m_InstallationPage->LayoutHome->SetVisible(true);
+		break;
+	case LayoutType::Installing:
+		m_InstallingPage->LayoutInstalling->SetVisible(true);
+		break;
+	case LayoutType::Installed:
+		m_InstalledPage->LayoutInstalled->SetVisible(true);
+		KillTimer(m_hWnd, TIMER_INSTALL_ID);
+		KillTimer(m_hWnd, TIMER_BANNER_ID);
+		break;
+	default:
+		break;
+	}
+	
+}

+ 162 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h

@@ -0,0 +1,162 @@
+#pragma once
+//核心
+#include "CAccessRegedit.h"
+#include "CDownLoadFile.h"
+#include "CCmd.h"
+//字符与通用
+#include "CLanguage.h"
+#include "CClasses.h"
+#include "DefineStr.h"
+//系统与资源
+#include <WinInet.h>//网络
+#include <thread>
+#include "resource.h"
+//UI
+#include "CMsgWnd.h"
+#include "CAdsBanner.h"
+#include "InstallPage.h"
+#include "InstallingPage.h"
+#include "InstalledPage.h"
+
+typedef struct ThreadData
+{
+public:
+	struct CFrameWnd* pFrame;
+}ThreadData;
+
+typedef struct CurrentState
+{
+public:
+	enum class LayoutType m_LayoutType = LayoutType::Home;
+	enum class VertionResultType m_VertionResultType = VertionResultType::None;
+	enum class InstallStateType m_InstallStateType = InstallStateType::None;
+
+
+}CurrentState;
+
+
+class CMainPage : public CNotifyPump
+{
+public:
+	CMainPage();
+
+public:
+	void SetPaintMagager(CPaintManagerUI* pPaintMgr);
+
+	DUI_DECLARE_MESSAGE_MAP()
+    virtual void OnClick(TNotifyUI& msg);
+	virtual void OnSelectChanged(TNotifyUI& msg);
+	virtual void OnItemClick(TNotifyUI& msg);
+
+private:
+	CPaintManagerUI* m_pPaintManager;
+};
+
+ class CFrameWnd : public WindowImplBase
+{
+
+#pragma region 全局
+
+private:
+	CDuiString	m_strXMLPath;
+	ThreadData m_threadData;
+	CurrentState m_State;
+	static SilenceInstallingType m_SilenceInstallingType;
+	int CurrentDPI = 96;
+	double dpi = 1;
+	RECT start_rect_;
+	
+
+	CMainPage m_MainPage;
+
+	//enum class LayoutType m_LayoutType = LayoutType::Home;
+	//enum class VertionResultType m_VertionResultType = VertionResultType::None;
+	//enum class InstallStateType m_InstallStateType = InstallStateType::None;
+public:
+	//初始化
+	 explicit CFrameWnd(LPCTSTR pszXMLPath);
+	 CFrameWnd();
+	 ~CFrameWnd(void);
+	 virtual LPCTSTR GetWindowClassName() const;
+	 virtual CDuiString GetSkinFile() { return  XML_MainFile; }
+	 virtual CDuiString GetSkinFolder();
+	 void InitControls();
+	 void InitWindow();
+private:
+	 void WindowSize();
+	 //逻辑
+	 void setDPI(int DPI);
+	 void AdaptationDPI();
+	 void SelectLayout(LayoutType LayoutType);
+	 
+	 std::wstring m_replace(std::wstring strSrc, const std::wstring& oldStr, const std::wstring& newStr);
+	 //消息事件
+	 void Notify(TNotifyUI& msg);
+	// LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	 LRESULT OnDPIChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	 LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+#pragma endregion
+
+
+#pragma region Banner事件和变量
+private:
+	CAdsBanner* banner;
+	int currentImageNum = 0;
+public:
+	void GetBanner();
+	void CreateBannerUI(CDuiString ImagePath, int i);
+	void SetTimerBanner();
+	void SetBannerOnTimer();
+	void SetTimerBannerSwitch();
+	static void Thread_LoadedBanner( ThreadData threadData);
+#pragma endregion
+
+#pragma region 安装主页
+public:
+	bool m_isCanInstall = false;//有没有满足条件安装
+private:
+	InstallationPage* m_InstallationPage;
+	bool ischeckCustom = false;
+	//初始化
+	void InitHomeControls();
+	//逻辑
+	bool GetVersionState();
+	void SetSelectedFolder();
+	void GoToLink(std::wstring linkStr);
+	void Install_Click();
+	static void Thread_GetVerstion(ThreadData threadData);
+	//消息事件
+	void NotifyHome(TNotifyUI& msg);
+	LRESULT HomeMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	
+#pragma endregion
+
+
+#pragma region 安装中
+private:
+	InstallingPage* m_InstallingPage;
+	void InitInstallingControls();
+	void SetTimerInstalling();
+	void SetTimerSilen();
+	static void Thread_Installing(ThreadData threadData);
+	//消息事件
+	void NotifyInstalling(TNotifyUI& msg);
+	LRESULT InstallingMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	
+#pragma endregion
+
+#pragma region 安装完成
+private:
+	InstalledPage* m_InstalledPage;
+	void InitInstalledControls();
+	void OpenApp_Click();
+	static void Thread_OpenApp(ThreadData threadData);
+	//消息事件
+	void NotifyInstalled(TNotifyUI& msg);
+	LRESULT InstalledMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+#pragma endregion
+
+
+};

+ 203 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp

@@ -0,0 +1,203 @@
+
+#include "stdafx.h"
+
+
+#pragma region 添加文案
+std::wstring CLanguage::GetContent(TextType textType)
+{
+    std::wstring content = L"";
+
+    switch (textType)
+    {
+    case TextType::Btn_Install:
+        content = LoadLanguage(L"Install", L"开始安装", L"開始安裝");
+        break;
+
+    case TextType::Btn_CutomInstall:
+        content = LoadLanguage(L"Installation settings", L"自定义安装", L"自定義安裝");
+        break;
+
+    case TextType::Link_Install:
+        content = LoadLanguage
+        (
+            L"Clicking \"Install\" means you agree to the {a https://www.pdfreaderpro.com/terms_of_service}Terms of Service{/a} and the {a https://www.pdfreaderpro.com/privacy-policy}Privacy Policy{/a}.",
+            L"点击“开始安装”代表你同意{a https://www.pdfreaderpro.com/terms_of_service}服务条款{/a}和{a https://www.pdfreaderpro.com/privacy-policy}隐私权政策{/a}",
+            L"點擊「開始安裝」代表你同意{a https://www.pdfreaderpro.com/terms_of_service}服務條款{/a}和{a https://www.pdfreaderpro.com/privacy-policy}隱私權政策{/a}"
+        );
+        break;
+    case TextType::Txt_ByClickInstall:
+        content = LoadLanguage
+        (
+            L"Clicking \"Install\" means you agree to the ",
+            L"点击“开始安装”代表你同意",
+            L"點擊「開始安裝」代表你同意"
+        );
+        break;
+
+    case TextType::Btn_TermsService:
+        content = LoadLanguage
+        (
+            L"Terms of Service ",
+            L"服务条款",
+            L"服務條款"
+        );
+        break;
+  
+    case TextType::Txt_And:
+        content = LoadLanguage
+        (
+            L"and the ",
+            L"和",
+            L"和"
+        );
+        break;
+
+    case TextType::Btn_PrivacyPolicy:
+        content = LoadLanguage
+        (
+            L"Privacy Policy",
+            L"隐私权政策",
+            L"隱私權政策"
+        );
+        break;
+
+    case TextType::Text_InstallPath:
+        content = LoadLanguage(L"Installation folder", L"安装路径", L"安裝路徑");
+        break;
+
+    case TextType::Btn_FilePath:
+        content = LoadLanguage(L"Select Folder", L"选择文件夹", L"選擇文件夾");
+        break;
+
+    case TextType::Text_Installing:
+        content = LoadLanguage(L"Installing, please wait...", L"安装中,请稍等...", L"安裝中,請稍等...");
+        break;
+
+    case TextType::Text_NoNetwork:
+        content = LoadLanguage
+        (
+            L"Network error, please check your internet and try again later.",
+            L"网络错误,请检查网络并重试。",
+            L"網絡錯誤,請檢查網絡並重試。"
+        );
+        break;
+
+    case TextType::Btn_OpenApp:
+        content = LoadLanguage(L"Start Now", L"立即启动", L"立即啟動");
+        break;
+
+    case TextType::Btn_GoToFilesPath:
+        content = LoadLanguage(L"Offline installer is saved in:", L"安装文件储存路径:", L"安裝文件儲存路徑:");
+        break;
+
+    case TextType::MSG_IsExitApp:
+        content = LoadLanguage(L"Are you sure to cancel the process? If you exit now, the program won't be installed.",
+            L"请确认是否退出程序安装。退出后,安装进程将停止。", 
+            L"請確認是否退出程序安裝。退出後,安裝進程將停止。");
+        break;
+
+    case TextType::MSG_LatestVersion:
+        content = LoadLanguage(
+            L"Latest version already installed, you don't need to install again.", 
+            L"您已安装最新版本,无需再次安装。", 
+            L"您已安裝最新版本,無需再次安裝。");
+        break;
+
+    case TextType::MSG_UpgradeVersion:
+        content = LoadLanguage(
+            L"Your current version is low. Would you like to update PDF Reader Pro to the latest version?", 
+            L"当前版本较低,是否升级至最新版本?", 
+            L"當前版本較低,是否升級至最新版本?");
+        break;
+
+    case TextType::MSG_OverHighVersion:
+        content = LoadLanguage(
+            L"The existing version in your system is higher than the version you are installing now. Please uninstall the existing version first.",
+            L"您正在安装的程序版本号低于系统已有版本。请先卸载已有版本。",
+            L"您正在安裝的程序版本號低於系統已有版本。請先卸載已有版本。");
+        break;
+
+    case TextType::MSG_BtnCancel:
+        content = LoadLanguage(L"Cancel", L"取消", L"取消");
+        break;
+    case TextType::MSG_BtnOK:
+        content = LoadLanguage(L"Ok", L"确定", L"確定");
+        break;
+            
+    default:
+        break;
+    }
+
+    return content;
+}
+
+#pragma endregion
+
+#pragma region 多语言逻辑
+LanguageType CLanguage::CurrentLanguage = LanguageType::NONE;
+LanguageType CLanguage::LastLanguage = LanguageType::NONE;
+
+std::wstring CLanguage::GetText(TextType textType)
+{
+    CurrentLanguage = GetLocalLanguage();
+
+    return GetContent(textType);
+
+}
+
+std::wstring CLanguage::LoadLanguage(std::wstring EnStr, std::wstring zhsStr, std::wstring zhStr)
+{
+    std::wstring content = L"";
+
+    switch (CLanguage::CurrentLanguage)
+    {
+    case LanguageType::EN_US:
+        content = EnStr;
+        break;
+    case LanguageType::ZH_CN:
+        content = zhsStr;
+        break;
+    case LanguageType::ZH_TW:
+        content = zhStr;
+        break;
+    default:
+        content = EnStr;
+        break;
+    }
+
+    return  content;
+}
+
+LanguageType CLanguage::GetLocalLanguage(bool isGetText) 
+{
+
+    LanguageType language = LanguageType::EN_US;
+    //加载文案时,不必要重新获取当前系统的语言种类
+    if (isGetText)
+    {
+        if (CurrentLanguage != LanguageType::NONE && CurrentLanguage == LastLanguage)
+            return CurrentLanguage;
+    }
+
+    LastLanguage = CurrentLanguage;
+
+    LCID lcid = GetSystemDefaultLCID();
+    if (lcid == 0x409)
+    {
+        language = LanguageType::EN_US;
+
+    }
+    else if (lcid == 0x404)
+    {
+        language = LanguageType::ZH_TW;
+
+    }
+    else if (lcid == 0x804)
+    {
+        language = LanguageType::ZH_CN;
+    }
+
+    return language;
+}
+
+#pragma endregion

+ 89 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.h

@@ -0,0 +1,89 @@
+#pragma once
+#include<string>
+#include<Windows.h>
+
+#pragma region 文件说明
+
+///备注时间:2022/11/26
+/// 目前可采用两种方式对多语的逻辑进行处理:
+/// 
+/// 方案1.加载多语言文件xml(未采用):
+/// 实现的思路:比如创建三个xml,内容分别是<Text id="okId" value ="OK"/>, <Text id="okId" value = "确认"/>,<Text okId="ok" value="確認"/>;
+/// 在xml界面文件里,可以使用如<Button Text="okId"/>即可动态加载对应的文案;
+/// 核心代码:(具体实现,可参考Duilib的Demo:duidemo)
+/// CResourceManager::GetInstance()->SetLanguage(_T("en"));
+/// CResourceManager::GetInstance()->LoadLanguage(_T("lan_en.xml"));
+/// CResourceManager::GetInstance()->ReloadText();
+/// InvalidateRect(m_hWnd, NULL, TRUE);
+/// m_pm.NeedUpdate();
+/// 
+/// 方案2.创建多语类来处理文案(当前项目已采用):
+/// 理由:
+/// 1)考虑到下载安装器本身要求exe小,且需要的多语文案比较少,如果再添加多语文件资源,就会增加程序的大小。虽然多语文件不大,但应当尽量减少引用;
+/// 2)如果将来要实现频繁切换语言类型的逻辑,使用文件资源,就会增加潜在问题的风险;
+/// 3)多语xml文件需要跟界面文件同步id和文案,这会增加改动内容的复杂度;如果多个多语xml文件分别来写对应的文案,就会容易疏漏或填错内容;
+/// 建议采用方案1的情况:程序需要显示文案内容太多,比如内置用户协议内容;
+
+#pragma endregion
+
+///如果有文案名称需要调整或有新文案时,此处必须要调整下对应的内容,以及函数GetContent(TextType textType)里的内容;
+#pragma region 添加编辑文案
+
+enum class TextType
+{
+	//主页
+	Btn_Install,
+	Btn_CutomInstall,
+	Link_Install,
+	Txt_ByClickInstall,
+	Btn_PrivacyPolicy,
+	Txt_And,
+	Btn_TermsService,
+	Text_InstallPath,
+	Btn_FilePath,
+	//安装中
+	Text_Installing,
+	Text_NoNetwork,
+	//安装完成
+	Btn_OpenApp,
+	Btn_GoToFilesPath,
+	//提示弹窗
+	MSG_IsExitApp,
+	MSG_LatestVersion,
+	MSG_UpgradeVersion,
+	MSG_OverHighVersion,
+	MSG_BtnCancel,
+	MSG_BtnOK
+};
+
+#pragma endregion
+
+
+
+
+enum class LanguageType
+{
+	EN_US,//英语
+	ZH_CN,//简中
+	ZH_TW,//繁中
+	Other,//其他语言
+	NONE //未进行获取系统语言时,程序初始化前默认值
+};
+
+static class CLanguage
+{
+private:
+	static LanguageType CurrentLanguage;
+	static LanguageType LastLanguage;//上次选择的语言,或程序初始化时
+
+public:
+	/// <summary>
+	/// //获取当前系统显示的语言种类
+	/// </summary>
+	static LanguageType GetLocalLanguage(bool isGetText = true);
+	static std::wstring GetText(TextType textType);//获取文案
+private:
+	static std::wstring GetContent(TextType textType);
+	static std::wstring LoadLanguage(std::wstring EnStr, std::wstring zhsStr, std::wstring zhStr);
+};
+

+ 112 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMsgWnd.cpp

@@ -0,0 +1,112 @@
+#include "CMsgWnd.h"
+DUI_BEGIN_MESSAGE_MAP(CMsgWnd, WindowImplBase)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_CLICK, OnClick)
+DUI_END_MESSAGE_MAP()
+
+CMsgWnd::CMsgWnd(void)
+{
+}
+
+CMsgWnd::~CMsgWnd(void)
+{
+}
+
+void CMsgWnd::SetTitle(LPCTSTR lpstrTitle)
+{
+	if (lstrlen(lpstrTitle) <= 0) return;
+
+	CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("MessageTitle")));
+	if (pControl) pControl->SetText(lpstrTitle);
+}
+
+void CMsgWnd::SetMsg(LPCTSTR lpstrMsg)
+{
+	if (lstrlen(lpstrMsg) <= 0) return;
+
+	CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("MessageText")));
+	if (pControl) pControl->SetText(lpstrMsg);
+}
+
+void CMsgWnd::SetConfirmBtn(LPCTSTR lpstrConfirmBtn)
+{
+	if (lstrlen(lpstrConfirmBtn) <= 0) return;
+
+	CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("confirm_btn")));
+	if (pControl) pControl->SetText(lpstrConfirmBtn);
+}
+
+void CMsgWnd::SetCancelBtn(LPCTSTR lpstrCancelBtn)
+{
+	if (lstrlen(lpstrCancelBtn) <= 0) return;
+
+	CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("cancel_btn")));
+	if (pControl) pControl->SetText(lpstrCancelBtn);
+}
+
+void CMsgWnd::OnFinalMessage(HWND hWnd)
+{
+	__super::OnFinalMessage(hWnd);
+	delete this;
+}
+
+DuiLib::CDuiString CMsgWnd::GetSkinFile()
+{
+	return _T("msg.xml");
+}
+
+LPCTSTR CMsgWnd::GetWindowClassName(void) const
+{
+	return _T("MsgWnd");
+}
+
+void CMsgWnd::OnClick(TNotifyUI& msg)
+{
+	CDuiString sName = msg.pSender->GetName();
+	sName.MakeLower();
+
+	if (msg.pSender == m_pCloseBtn) {
+		Close(MSGID_CANCEL);
+		return;
+	}
+	else if (msg.pSender == m_pMinBtn) {
+		SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return;
+	}
+	else if (msg.pSender == m_pMaxBtn) {
+		SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return;
+	}
+	else if (msg.pSender == m_pRestoreBtn) {
+		SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return;
+	}
+	else if (msg.pSender == m_pMenuBtn) {
+	}
+	else if (sName.CompareNoCase(_T("confirm_btn")) == 0)
+	{
+		Close(MSGID_OK);
+	}
+	else if (sName.CompareNoCase(_T("cancel_btn")) == 0)
+	{
+		Close(MSGID_CANCEL);
+	}
+}
+
+LRESULT CMsgWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	bHandled = FALSE;
+	return 0;
+}
+
+void CMsgWnd::Notify(TNotifyUI& msg)
+{
+	return WindowImplBase::Notify(msg);
+}
+
+LRESULT CMsgWnd::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	bHandled = FALSE;
+	return 0L;
+}
+
+void CMsgWnd::InitWindow()
+{
+	m_pCloseBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("closebtn")));
+}

+ 61 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMsgWnd.h

@@ -0,0 +1,61 @@
+#pragma once
+#define MSGID_OK		1
+#define MSGID_CANCEL	0
+#include "duilib.h"
+class CMsgWnd : public WindowImplBase
+{
+public:
+	static int MessageBox(HWND hParent, LPCTSTR lpstrTitle, LPCTSTR lpstrMsg, LPCTSTR lpstrConfirmBtn, LPCTSTR lpstrCancelBtn)
+	{
+		CMsgWnd* pWnd = new CMsgWnd();
+		pWnd->Create(hParent, _T("msgwnd"), WS_POPUP | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW);
+		pWnd->CenterWindow();
+		pWnd->SetTitle(lpstrTitle);
+		pWnd->SetMsg(lpstrMsg);
+		pWnd->SetConfirmBtn(lpstrConfirmBtn);
+		pWnd->SetCancelBtn(lpstrCancelBtn);
+		return pWnd->ShowModal();
+	}
+
+	static void ShowMessageBox(HWND hParent, LPCTSTR lpstrTitle, LPCTSTR lpstrMsg, LPCTSTR lpstrConfirmBtn, LPCTSTR lpstrCancelBtn)
+	{
+		CMsgWnd* pWnd = new CMsgWnd();
+		pWnd->Create(hParent, _T("msgwnd"), UI_WNDSTYLE_FRAME, 0);
+		pWnd->CenterWindow();
+		pWnd->SetTitle(lpstrTitle);
+		pWnd->SetMsg(lpstrMsg);
+		pWnd->SetConfirmBtn(lpstrConfirmBtn);
+		pWnd->SetCancelBtn(lpstrCancelBtn);
+		pWnd->ShowWindow(true);
+	}
+
+public:
+	CMsgWnd(void);
+	~CMsgWnd(void);
+
+	void SetMsg(LPCTSTR lpstrMsg);
+	void SetTitle(LPCTSTR lpstrTitle);
+	void SetConfirmBtn(LPCTSTR lpstrConfirmBtn);
+	void SetCancelBtn(LPCTSTR lpstrCancelBtn);
+
+public:
+	virtual void OnFinalMessage(HWND);
+	virtual CDuiString GetSkinFile();
+	virtual LPCTSTR GetWindowClassName(void) const;
+	virtual void Notify(TNotifyUI& msg);
+	virtual void InitWindow();
+
+	DUI_DECLARE_MESSAGE_MAP()
+		virtual void OnClick(TNotifyUI& msg);
+
+	virtual LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+private:
+	CButtonUI* m_pCloseBtn;
+	CButtonUI* m_pMaxBtn;
+	CButtonUI* m_pRestoreBtn;
+	CButtonUI* m_pMinBtn;
+	CButtonUI* m_pMenuBtn;
+};
+

+ 110 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp

@@ -0,0 +1,110 @@
+#include "CSystemInfo.h"
+#include <string>
+#include "stdafx.h"
+
+#define APPCONFIG L"config.ini"
+#define THREADPROCESS "ThreadProcess"
+#define PID "pid"
+#define THREADID "TheardId"
+
+CSystemInfo::CSystemInfo()
+{
+
+}
+
+
+bool CSystemInfo::IsHanvedCurrentWindow()
+{
+	//std::wstring ss1 = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) +L"\\config.ini";
+	std::wstring ss1 = AppCore::smPath_Temp + APPCONFIG;
+	wchar_t* ptr = _wcsdup(ss1.c_str());
+	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
+	HANDLE h = ::CreateMutex(NULL, TRUE, AppCore::FileName_ProgressName.c_str());
+
+	if (h != NULL)
+	{
+		if (GetLastError() == ERROR_ALREADY_EXISTS)
+		{
+			
+			DWORD pidIni = ReadIntFromini(THREADPROCESS, PID, 0, ss.c_str());
+		    DWORD TheardIdIni = ReadIntFromini(THREADPROCESS, THREADID, 0, ss.c_str());
+
+			HWND hWnd = ::GetTopWindow(0);
+			while (hWnd)
+			{
+				DWORD pid = 0;
+				DWORD dwTheardId = ::GetWindowThreadProcessId(hWnd, &pid);
+
+				if (dwTheardId != 0)
+				{
+					if (pid == pidIni && TheardIdIni == dwTheardId)
+					{
+						bool isWindowVisible = IsWindowVisible(hWnd);
+
+						if (isWindowVisible == true)
+						{
+							ShowWindow(hWnd, SW_SHOWNOACTIVATE);
+							break;
+						}
+					}
+
+				}
+
+				hWnd = ::GetNextWindow(hWnd, GW_HWNDNEXT);
+
+			}
+
+
+			CloseHandle(h);
+			h = NULL;
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
+ bool CSystemInfo::isWriteAppProcessInfoToIni(HWND hwnd)
+{
+	std::wstring ss1 = AppCore::smPath_Temp + APPCONFIG;
+	wchar_t* ptr = _wcsdup(ss1.c_str());
+	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
+	DWORD pid = 0;
+	DWORD dwTheardId = ::GetWindowThreadProcessId(hwnd, &pid);
+	BOOL readpid = CSystemInfo::WriteIntToini(THREADPROCESS, PID, pid, ss.c_str());
+	BOOL readTheardId = CSystemInfo::WriteIntToini(THREADPROCESS, THREADID, dwTheardId, ss.c_str());
+
+	return (readpid > 0 && readTheardId > 0);
+}
+
+DWORD CSystemInfo::WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
+{
+	char _Buf[64];
+	_CSTD sprintf_s(_Buf, sizeof(_Buf), "%u", nDefault);
+	return WritePrivateProfileStringA(lpAppNam, lpKeyName, _Buf, lpFileName);
+}
+
+DWORD CSystemInfo::ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
+{
+	return  GetPrivateProfileIntA(lpAppNam, lpKeyName, nDefault, lpFileName);
+}
+
+
+//DWORD GetProcessIDByName()
+//{
+//	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+//	if (INVALID_HANDLE_VALUE == hSnapshot) {
+//		return NULL;
+//	}
+//	PROCESSENTRY32 pe = { sizeof(pe) };
+//	for (BOOL ret = Process32First(hSnapshot, &pe); ret; ret = Process32Next(hSnapshot, &pe)) {
+//		if (pe.szExeFile == L"PDFReaderPro_Installer") {
+//			CloseHandle(hSnapshot);
+//			return pe.th32ProcessID;
+//		}
+//		//printf("%-6d %s\n", pe.th32ProcessID, pe.szExeFile);
+//	}
+//	CloseHandle(hSnapshot);
+//	return 0;
+//}

+ 16 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.h

@@ -0,0 +1,16 @@
+#pragma once
+#include "windows.h"
+
+class CSystemInfo
+{
+public:
+	CSystemInfo();
+	static bool IsHanvedCurrentWindow();
+
+	static bool isWriteAppProcessInfoToIni(HWND hwnd);
+
+	static DWORD WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);
+	static DWORD ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);
+
+};
+

+ 39 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineStr.h

@@ -0,0 +1,39 @@
+#pragma once
+
+//主界面资源
+#define XML_ZIP _T("XMLFile.zip")
+#define XML_MainFile _T("XMLFile.xml")
+
+//收缩展开的整个窗口大小(点击自定义安装时发生)
+#define XML_WndWidth  760
+#define XML_WndHeight  540
+#define XML_WndExpendWidth  760
+#define XML_WndExpenHeight  600
+
+
+#pragma region 定时器(ID和时间)
+
+//Banner
+#define TIMER_BANNER_TIMES (3000)//Banner轮播定时器的时间
+#define TIMER_BANNER_ID (1)//Banner轮播定时器ID
+
+//安装进度
+#define TIMER_INSTALL_TIMES (500)//安装进度定时器的时间
+#define TIMER_INSTALL_ID (2)//安装进度定时器ID
+
+//安装中断网等待联网
+#define TIMER_WAITDOWNLOAD_TIMES (500)//断网时等待联网的定时器的时间
+#define TIMER_WAITDOWNLOAD_ID (3)//断网时等待联网的定时器ID
+
+//静默安装进度补充
+#define TIMER_SILENTINSTALL_TIMES (1000)//静默安装定时器的时间
+#define TIMER_SILENTINSTALL_ID (4)//静默安装定时器ID
+
+#pragma endregion
+
+#pragma region 超链接
+
+#define TermsOfService L"https://www.pdfreaderpro.com/terms_of_service"
+#define PrivacyPolicy  L"https://www.pdfreaderpro.com/privacy-policy"
+
+#pragma endregion

Diferenças do arquivo suprimidas por serem muito extensas
+ 1252 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIActiveX.cpp


+ 81 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIActiveX.h

@@ -0,0 +1,81 @@
+#ifndef __UIACTIVEX_H__
+#define __UIACTIVEX_H__
+
+#pragma once
+
+struct IOleObject;
+
+
+namespace DuiLib {
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class CActiveXCtrl;
+
+	template< class T >
+	class CSafeRelease
+	{
+	public:
+		CSafeRelease(T* p) : m_p(p) { };
+		~CSafeRelease() { if( m_p != NULL ) m_p->Release(); };
+		T* Detach() { T* t = m_p; m_p = NULL; return t; };
+		T* m_p;
+	};
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CActiveXUI : public CControlUI, public IMessageFilterUI
+	{
+		DECLARE_DUICONTROL(CActiveXUI)
+
+		friend class CActiveXCtrl;
+	public:
+		CActiveXUI();
+		virtual ~CActiveXUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		HWND GetHostWindow() const;
+
+		virtual bool IsDelayCreate() const;
+		virtual void SetDelayCreate(bool bDelayCreate = true);
+		virtual bool IsMFC() const;
+		virtual void SetMFC(bool bMFC = false);
+
+		bool CreateControl(const CLSID clsid);
+		bool CreateControl(LPCTSTR pstrCLSID);
+		HRESULT GetControl(const IID iid, LPVOID* ppRet);
+		CLSID GetClisd() const;
+		CDuiString GetModuleName() const;
+		void SetModuleName(LPCTSTR pstrText);
+
+		void SetVisible(bool bVisible = true);
+		void SetInternVisible(bool bVisible = true);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void Move(SIZE szOffset, bool bNeedInvalidate = true);
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
+
+	protected:
+		virtual void ReleaseControl();
+		virtual bool DoCreateControl();
+
+	protected:
+		CLSID m_clsid;
+		CDuiString m_sModuleName;
+		bool m_bCreated;
+		bool m_bDelayCreate;
+		bool m_bMFC;
+		IOleObject* m_pUnk;
+		CActiveXCtrl* m_pControl;
+		HWND m_hwndHost;
+	};
+
+} // namespace DuiLib
+
+#endif // __UIACTIVEX_H__

+ 182 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIAnimation.cpp

@@ -0,0 +1,182 @@
+#include "StdAfx.h"
+#include "UIAnimation.h"
+#include <vector>
+#include <algorithm>
+
+namespace DuiLib {
+	struct CUIAnimation::Imp
+	{
+		std::vector<CAnimationData*> m_arAnimations;
+	};
+
+	CUIAnimation::CUIAnimation():m_pImp(new CUIAnimation::Imp())
+	{
+		m_pControl = NULL;
+	}
+
+	CUIAnimation:: ~CUIAnimation()
+	{
+		if(m_pImp)
+		{
+			delete m_pImp;
+			m_pImp = NULL;
+		}
+	}
+
+	void CUIAnimation::Attach(CControlUI* pOwner)
+	{
+		m_pControl = pOwner;
+	}
+
+	BOOL CUIAnimation::StartAnimation(int nElapse, int nTotalFrame, int nAnimationID /*= 0*/, BOOL bLoop/* = FALSE*/)
+	{
+		CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+		if( NULL != pData 
+			|| nElapse <= 0
+			|| nTotalFrame <= 0
+			|| NULL == m_pControl )
+		{
+			ASSERT(FALSE);
+			return FALSE;
+		}
+
+		CAnimationData* pAnimation = new CAnimationData(nElapse, nTotalFrame, nAnimationID, bLoop);
+		if( NULL == pAnimation ) return FALSE;
+		
+		if(m_pControl->GetManager()->SetTimer( m_pControl, nAnimationID, nElapse ))
+		{
+			m_pImp->m_arAnimations.push_back(pAnimation);
+			return TRUE;
+		}
+		return FALSE;
+	}
+
+	void CUIAnimation::StopAnimation(int nAnimationID /*= 0*/)
+	{
+		if(m_pControl == NULL) return;
+
+		if(nAnimationID  != 0)
+		{
+			CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+			if( NULL != pData )
+			{
+				m_pControl->GetManager()->KillTimer( m_pControl, nAnimationID );
+				m_pImp->m_arAnimations.erase(std::remove(m_pImp->m_arAnimations.begin(), m_pImp->m_arAnimations.end(), pData), m_pImp->m_arAnimations.end());
+				if(pData != NULL){
+					delete pData;
+					pData = NULL;
+				}
+				return;
+			}
+		}
+		else
+		{
+			int nCount = m_pImp->m_arAnimations.size();
+			for(int i=0; i<nCount; ++i)
+			{
+				CAnimationData* pData = m_pImp->m_arAnimations[i];
+				if(pData) {
+					m_pControl->GetManager()->KillTimer(m_pControl, pData->m_nAnimationID);
+					if(pData != NULL){
+						delete pData;
+						pData = NULL;
+					}
+				}
+			}
+			m_pImp->m_arAnimations.clear();
+		}
+	}
+
+	BOOL CUIAnimation::IsAnimationRunning(int nAnimationID)
+	{
+		CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+		return NULL != pData;
+	}
+
+	int CUIAnimation::GetCurrentFrame(int nAnimationID/* = 0*/)
+	{
+		CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+		if( NULL == pData )
+		{
+			ASSERT(FALSE);
+			return -1;
+		}
+		return pData->m_nCurFrame;
+	}
+
+	BOOL CUIAnimation::SetCurrentFrame(int nFrame, int nAnimationID/* = 0*/)
+	{
+		CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+		if( NULL == pData)
+		{
+			ASSERT(FALSE);
+			return FALSE;
+		}
+
+		if(nFrame >= 0 && nFrame <= pData->m_nTotalFrame)
+		{
+			pData->m_nCurFrame = nFrame;
+			return TRUE;
+		}
+		else
+		{
+			ASSERT(FALSE);
+		}
+		return FALSE;
+	}
+
+	void CUIAnimation::OnAnimationElapse(int nAnimationID)
+	{
+		if(m_pControl == NULL) return;
+
+		CAnimationData* pData = GetAnimationDataByID(nAnimationID);
+		if( NULL == pData ) return;
+
+		int nCurFrame = pData->m_nCurFrame;
+		if(nCurFrame == 0)
+		{
+			OnAnimationStart(nAnimationID, pData->m_bFirstLoop);
+			pData->m_bFirstLoop = FALSE;
+		}
+
+		OnAnimationStep(pData->m_nTotalFrame, nCurFrame, nAnimationID);
+
+		if(nCurFrame >= pData->m_nTotalFrame)
+		{
+			OnAnimationStop(nAnimationID);
+			if(pData->m_bLoop)
+			{
+				pData->m_nCurFrame = 0;
+			}
+			else
+			{
+				m_pControl->GetManager()->KillTimer( m_pControl, nAnimationID );
+				m_pImp->m_arAnimations.erase(std::remove(m_pImp->m_arAnimations.begin(), m_pImp->m_arAnimations.end(), pData), m_pImp->m_arAnimations.end());
+				delete pData;
+				pData = NULL;
+			}
+		}
+
+		if( NULL != pData )
+		{
+			++(pData->m_nCurFrame);
+		}
+	}
+
+	CAnimationData* CUIAnimation::GetAnimationDataByID(int nAnimationID)
+	{
+		CAnimationData* pRet = NULL;
+		int nCount = m_pImp->m_arAnimations.size();
+		for(int i=0; i<nCount; ++i)
+		{
+			if(m_pImp->m_arAnimations[i]->m_nAnimationID == nAnimationID)
+			{
+				pRet = m_pImp->m_arAnimations[i];
+				break;
+			}
+		}
+
+		return pRet;
+	}
+
+} // namespace DuiLib

+ 86 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIAnimation.h

@@ -0,0 +1,86 @@
+#ifndef __UIANIMATION_H__
+#define __UIANIMATION_H__
+
+#include "UIButton.h"
+#pragma once
+
+namespace DuiLib {
+
+	class UILIB_API IUIAnimation
+	{
+	public:
+		virtual ~IUIAnimation() { NULL; }
+
+		virtual BOOL StartAnimation(int nElapse, int nTotalFrame, int nAnimationID = 0, BOOL bLoop = FALSE) = 0;
+		virtual void StopAnimation(int nAnimationID = 0) = 0;
+		virtual BOOL IsAnimationRunning(int nAnimationID) = 0;
+		virtual int GetCurrentFrame(int nAnimationID = 0) = 0;
+		virtual BOOL SetCurrentFrame(int nFrame, int nAnimationID = 0) = 0;
+
+		virtual void OnAnimationStep(int nTotalFrame, int nCurFrame, int nAnimationID) = 0;
+		virtual void OnAnimationStart(int nAnimationID, BOOL bFirstLoop) = 0;
+		virtual void OnAnimationStop(int nAnimationID) = 0;
+
+		virtual void OnAnimationElapse(int nAnimationID) = 0;
+	};
+
+	class UILIB_API CAnimationData
+	{
+	public:
+		CAnimationData(int nElipse, int nFrame, int nID, BOOL bLoop)
+		{
+			m_bFirstLoop = TRUE;
+			m_nCurFrame = 0;
+			m_nElapse = nElipse;
+			m_nTotalFrame = nFrame;
+			m_bLoop = bLoop;
+			m_nAnimationID = nID;
+		}
+
+	//protected:
+	public:
+		friend class CDUIAnimation;
+
+		int m_nAnimationID;
+		int m_nElapse;
+
+		int m_nTotalFrame;
+		int m_nCurFrame;
+
+		BOOL m_bLoop;
+		BOOL m_bFirstLoop;
+	};
+
+	class UILIB_API CUIAnimation: public IUIAnimation
+	{
+		struct Imp;
+	public:
+		CUIAnimation();
+		~CUIAnimation();
+
+	public:
+		void Attach(CControlUI* pOwner);
+
+		virtual BOOL StartAnimation(int nElapse, int nTotalFrame, int nAnimationID = 0, BOOL bLoop = FALSE);
+		virtual void StopAnimation(int nAnimationID = 0);
+		virtual BOOL IsAnimationRunning(int nAnimationID);
+		virtual int GetCurrentFrame(int nAnimationID = 0);
+		virtual BOOL SetCurrentFrame(int nFrame, int nAnimationID = 0);
+
+		virtual void OnAnimationStart(int nAnimationID, BOOL bFirstLoop) {};
+		virtual void OnAnimationStep(int nTotalFrame, int nCurFrame, int nAnimationID) {};
+		virtual void OnAnimationStop(int nAnimationID) {};
+
+		virtual void OnAnimationElapse(int nAnimationID);
+
+	protected:
+		CAnimationData* GetAnimationDataByID(int nAnimationID);
+
+	protected:
+		CControlUI* m_pControl;
+		Imp * m_pImp;
+	};
+
+} // namespace DuiLib
+
+#endif // __UIANIMATION_H__

+ 745 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIButton.cpp

@@ -0,0 +1,745 @@
+#include "StdAfx.h"
+#include "UIButton.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CButtonUI)
+
+	CButtonUI::CButtonUI()
+		: m_uButtonState(0)
+		, m_iHotFont(-1)
+		, m_iPushedFont(-1)
+		, m_iFocusedFont(-1)
+		, m_dwHotTextColor(0)
+		, m_dwPushedTextColor(0)
+		, m_dwFocusedTextColor(0)
+		, m_dwHotBkColor(0)
+		, m_dwPushedBkColor(0)
+		, m_dwDisabledBkColor(0)
+		, m_dwHotBorderColor(0)
+		, m_dwPushedBorderColor(0)
+		, m_dwDisabledBorderColor(0)
+		, m_iBindTabIndex(-1)
+		, m_nStateCount(0)
+	{
+		m_uTextStyle = DT_SINGLELINE | DT_VCENTER | DT_CENTER;
+	}
+
+	LPCTSTR CButtonUI::GetClass() const
+	{
+		return _T("ButtonUI");
+	}
+
+	LPVOID CButtonUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_BUTTON) == 0 ) return static_cast<CButtonUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	UINT CButtonUI::GetControlFlags() const
+	{
+		return (IsKeyboardEnabled() ? UIFLAG_TABSTOP : 0) | (IsEnabled() ? UIFLAG_SETCURSOR : 0);
+	}
+
+	void CButtonUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_SETFOCUS ) 
+		{
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_KILLFOCUS ) 
+		{
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_KEYDOWN )
+		{
+			if (IsKeyboardEnabled()) {
+				if( event.chKey == VK_SPACE || event.chKey == VK_RETURN ) {
+					Activate();
+					return;
+				}
+			}
+		}		
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK)
+		{
+			if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) {
+				m_uButtonState |= UISTATE_PUSHED | UISTATE_CAPTURED;
+				Invalidate();
+				if(IsRichEvent()) m_pManager->SendNotify(this, DUI_MSGTYPE_BUTTONDOWN);
+			}
+			return;
+		}	
+		if( event.Type == UIEVENT_MOUSEMOVE )
+		{
+            if ((m_uButtonState & UISTATE_CAPTURED) != 0)
+            {
+                if (::PtInRect(&m_rcItem, event.ptMouse))
+                    m_uButtonState |= UISTATE_PUSHED;
+                else m_uButtonState &= ~UISTATE_PUSHED;
+                Invalidate();
+            }
+
+			return;
+		}
+		if( event.Type == UIEVENT_BUTTONUP)
+		{
+			if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
+				m_uButtonState &= ~(UISTATE_PUSHED | UISTATE_CAPTURED);
+				Invalidate();
+				if( ::PtInRect(&m_rcItem, event.ptMouse) ) Activate();				
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			if( IsContextMenuUsed() ) {
+				m_pManager->SendNotify(this, DUI_MSGTYPE_MENU, event.wParam, event.lParam);
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEENTER )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState |= UISTATE_HOT;
+				Invalidate();
+
+				if(IsRichEvent()) m_pManager->SendNotify(this, DUI_MSGTYPE_MOUSEENTER);
+			}
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState &= ~UISTATE_HOT;
+				Invalidate();
+
+				if(IsRichEvent()) m_pManager->SendNotify(this, DUI_MSGTYPE_MOUSELEAVE);
+			}
+		}
+		CLabelUI::DoEvent(event);
+	}
+
+	bool CButtonUI::Activate()
+	{
+		if( !CControlUI::Activate() ) return false;
+		if( m_pManager != NULL )
+		{
+			m_pManager->SendNotify(this, DUI_MSGTYPE_CLICK);
+			BindTriggerTabSel();
+		}
+		return true;
+	}
+
+	void CButtonUI::SetEnabled(bool bEnable)
+	{
+		CControlUI::SetEnabled(bEnable);
+		if (!IsEnabled()) {
+			m_uButtonState |= UISTATE_DISABLED;
+		}
+		else {
+			m_uButtonState &= ~UISTATE_DISABLED;
+		}
+	}
+
+	
+	void CButtonUI::SetHotFont(int index)
+	{
+		m_iHotFont = index;
+		Invalidate();
+	}
+
+	int CButtonUI::GetHotFont() const
+	{
+		return m_iHotFont;
+	}
+
+	void CButtonUI::SetPushedFont(int index)
+	{
+		m_iPushedFont = index;
+		Invalidate();
+	}
+
+	int CButtonUI::GetPushedFont() const
+	{
+		return m_iPushedFont;
+	}
+
+	void CButtonUI::SetFocusedFont(int index)
+	{
+		m_iFocusedFont = index;
+		Invalidate();
+	}
+
+	int CButtonUI::GetFocusedFont() const
+	{
+		return m_iFocusedFont;
+	}
+
+	void CButtonUI::SetHotBkColor( DWORD dwColor )
+	{
+		m_dwHotBkColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetHotBkColor() const
+	{
+		return m_dwHotBkColor;
+	}
+	
+	void CButtonUI::SetPushedBkColor( DWORD dwColor )
+	{
+		m_dwPushedBkColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetPushedBkColor() const
+	{
+		return m_dwPushedBkColor;
+	}
+		
+	void CButtonUI::SetDisabledBkColor( DWORD dwColor )
+	{
+		m_dwDisabledBkColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetDisabledBkColor() const
+	{
+		return m_dwDisabledBkColor;
+	}
+	
+	void CButtonUI::SetHotTextColor(DWORD dwColor)
+	{
+		m_dwHotTextColor = dwColor;
+	}
+
+	DWORD CButtonUI::GetHotTextColor() const
+	{
+		return m_dwHotTextColor;
+	}
+
+	void CButtonUI::SetPushedTextColor(DWORD dwColor)
+	{
+		m_dwPushedTextColor = dwColor;
+	}
+
+	DWORD CButtonUI::GetPushedTextColor() const
+	{
+		return m_dwPushedTextColor;
+	}
+
+	void CButtonUI::SetFocusedTextColor(DWORD dwColor)
+	{
+		m_dwFocusedTextColor = dwColor;
+	}
+
+	DWORD CButtonUI::GetFocusedTextColor() const
+	{
+		return m_dwFocusedTextColor;
+	}
+
+	void CButtonUI::SetHotBorderColor(DWORD dwColor)
+	{
+		if (m_dwHotBorderColor == dwColor) return;
+
+		m_dwHotBorderColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetHotBorderColor() const
+	{
+		return m_dwHotBorderColor;
+	}
+
+	void CButtonUI::SetPushedBorderColor(DWORD dwColor)
+	{
+		if (m_dwPushedBorderColor == dwColor) return;
+
+		m_dwPushedBorderColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetPushedBorderColor() const
+	{
+		return m_dwPushedBorderColor;
+	}
+
+	void CButtonUI::SetDisabledBorderColor(DWORD dwColor)
+	{
+		if (m_dwDisabledBorderColor == dwColor) return;
+
+		m_dwDisabledBorderColor = dwColor;
+		Invalidate();
+	}
+
+	DWORD CButtonUI::GetDisabledBorderColor() const
+	{
+		return m_dwDisabledBorderColor;
+	}
+
+	LPCTSTR CButtonUI::GetNormalImage()
+	{
+		return m_sNormalImage;
+	}
+
+	void CButtonUI::SetNormalImage(LPCTSTR pStrImage)
+	{
+		m_sNormalImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CButtonUI::GetHotImage()
+	{
+		return m_sHotImage;
+	}
+
+	void CButtonUI::SetHotImage(LPCTSTR pStrImage)
+	{
+		m_sHotImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CButtonUI::GetPushedImage()
+	{
+		return m_sPushedImage;
+	}
+
+	void CButtonUI::SetPushedImage(LPCTSTR pStrImage)
+	{
+		m_sPushedImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CButtonUI::GetFocusedImage()
+	{
+		return m_sFocusedImage;
+	}
+
+	void CButtonUI::SetFocusedImage(LPCTSTR pStrImage)
+	{
+		m_sFocusedImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CButtonUI::GetDisabledImage()
+	{
+		return m_sDisabledImage;
+	}
+
+	void CButtonUI::SetDisabledImage(LPCTSTR pStrImage)
+	{
+		m_sDisabledImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CButtonUI::GetHotForeImage()
+	{
+		return m_sHotForeImage;
+	}
+
+	void CButtonUI::SetHotForeImage( LPCTSTR pStrImage )
+	{
+		m_sHotForeImage = pStrImage;
+		Invalidate();
+	}
+
+    LPCTSTR CButtonUI::GetPushedForeImage()
+    {
+        return m_sPushedForeImage;
+    }
+
+    void CButtonUI::SetPushedForeImage(LPCTSTR pStrImage)
+    {
+        m_sPushedForeImage = pStrImage;
+        Invalidate();
+    }
+
+	void CButtonUI::SetStateCount(int nCount)
+	{
+		m_nStateCount = nCount;
+		Invalidate();
+	}
+
+	int CButtonUI::GetStateCount() const
+	{
+		return m_nStateCount;
+	}
+
+	LPCTSTR CButtonUI::GetStateImage()
+	{
+		return m_sStateImage;
+	}
+
+	void CButtonUI::SetStateImage( LPCTSTR pStrImage )
+	{
+		m_sNormalImage.Empty();
+		m_sStateImage = pStrImage;
+		Invalidate();
+	}
+
+	void CButtonUI::BindTabIndex(int _BindTabIndex )
+	{
+		if( _BindTabIndex >= 0)
+			m_iBindTabIndex	= _BindTabIndex;
+	}
+
+	void CButtonUI::BindTabLayoutName( LPCTSTR _TabLayoutName )
+	{
+		if(_TabLayoutName)
+			m_sBindTabLayoutName = _TabLayoutName;
+	}
+
+	void CButtonUI::BindTriggerTabSel( int _SetSelectIndex /*= -1*/ )
+	{
+		LPCTSTR pstrName = GetBindTabLayoutName();
+		if(pstrName == NULL || (GetBindTabLayoutIndex() < 0 && _SetSelectIndex < 0))
+			return;
+
+		CTabLayoutUI* pTabLayout = static_cast<CTabLayoutUI*>(GetManager()->FindControl(pstrName));
+		if(!pTabLayout) return;
+		pTabLayout->SelectItem(_SetSelectIndex >=0?_SetSelectIndex:GetBindTabLayoutIndex());
+	}
+
+	void CButtonUI::RemoveBindTabIndex()
+	{
+		m_iBindTabIndex	= -1;
+		m_sBindTabLayoutName.Empty();
+	}
+
+	int CButtonUI::GetBindTabLayoutIndex()
+	{
+		return m_iBindTabIndex;
+	}
+
+	LPCTSTR CButtonUI::GetBindTabLayoutName()
+	{
+		return m_sBindTabLayoutName;
+	}
+
+	void CButtonUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue);
+        else if (_tcsicmp(pstrName, _T("hotforeimage")) == 0) SetHotForeImage(pstrValue);
+        else if (_tcsicmp(pstrName, _T("pushedforeimage")) == 0) SetPushedForeImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("stateimage")) == 0 ) SetStateImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("statecount")) == 0 ) SetStateCount(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("bindtabindex")) == 0 ) BindTabIndex(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("bindtablayoutname")) == 0 ) BindTabLayoutName(pstrValue);
+		else if( _tcsicmp(pstrName, _T("hotbkcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetHotBkColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("pushedbkcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetPushedBkColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("disabledbkcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetDisabledBkColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("hottextcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetHotTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("pushedtextcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetPushedTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("focusedtextcolor")) == 0 )
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetFocusedTextColor(clrColor);
+		}
+		else if (_tcscmp(pstrName, _T("hotbordercolor")) == 0)
+		{
+			if (*pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetHotBorderColor(clrColor);
+		}
+		else if (_tcscmp(pstrName, _T("pushedbordercolor")) == 0)
+		{
+			if (*pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetPushedBorderColor(clrColor);
+		}
+		else if (_tcscmp(pstrName, _T("disabledbordercolor")) == 0)
+		{
+			if (*pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetDisabledBorderColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("hotfont")) == 0 ) SetHotFont(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("pushedfont")) == 0 ) SetPushedFont(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("focuedfont")) == 0 ) SetFocusedFont(_ttoi(pstrValue));
+		
+		else CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CButtonUI::PaintText(HDC hDC)
+	{
+		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+		else m_uButtonState &= ~ UISTATE_FOCUSED;
+		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+		else m_uButtonState &= ~ UISTATE_DISABLED;
+
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+		
+		CDuiString sText = GetText();
+		if( sText.IsEmpty() ) return;
+
+		RECT m_rcTextPadding = CButtonUI::m_rcTextPadding;
+		GetManager()->GetDPIObj()->Scale(&m_rcTextPadding);
+		int nLinks = 0;
+		RECT rc = m_rcItem;
+		rc.left += m_rcTextPadding.left;
+		rc.right -= m_rcTextPadding.right;
+		rc.top += m_rcTextPadding.top;
+		rc.bottom -= m_rcTextPadding.bottom;
+
+		DWORD clrColor = IsEnabled()?m_dwTextColor:m_dwDisabledTextColor;
+		
+		if( ((m_uButtonState & UISTATE_PUSHED) != 0) && (GetPushedTextColor() != 0) )
+			clrColor = GetPushedTextColor();
+		else if( ((m_uButtonState & UISTATE_HOT) != 0) && (GetHotTextColor() != 0) )
+			clrColor = GetHotTextColor();
+		else if( ((m_uButtonState & UISTATE_FOCUSED) != 0) && (GetFocusedTextColor() != 0) )
+			clrColor = GetFocusedTextColor();
+
+		int iFont = GetFont();
+		if( ((m_uButtonState & UISTATE_PUSHED) != 0) && (GetPushedFont() != -1) )
+			iFont = GetPushedFont();
+		else if( ((m_uButtonState & UISTATE_HOT) != 0) && (GetHotFont() != -1) )
+			iFont = GetHotFont();
+		else if( ((m_uButtonState & UISTATE_FOCUSED) != 0) && (GetFocusedFont() != -1) )
+			iFont = GetFocusedFont();
+
+		if( m_bShowHtml )
+			CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, clrColor, \
+			NULL, NULL, nLinks, iFont, m_uTextStyle);
+		else
+			CRenderEngine::DrawText(hDC, m_pManager, rc, sText, clrColor, \
+			iFont, m_uTextStyle);
+	}
+
+	void CButtonUI::PaintBkColor(HDC hDC)
+	{
+		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
+			if(m_dwDisabledBkColor != 0) {
+				CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwDisabledBkColor));
+				return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
+			if(m_dwPushedBkColor != 0) {
+				CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwPushedBkColor));
+				return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if(m_dwHotBkColor != 0) {
+				CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwHotBkColor));
+				return;
+			}
+		}
+
+		return CControlUI::PaintBkColor(hDC);
+	}
+
+	void CButtonUI::PaintStatusImage(HDC hDC)
+	{
+		if(!m_sStateImage.IsEmpty() && m_nStateCount > 0)
+		{
+			TDrawInfo info;
+			info.Parse(m_sStateImage, _T(""), m_pManager);
+			const TImageInfo* pImage = m_pManager->GetImageEx(info.sImageName, info.sResType, info.dwMask, info.bHSL, info.bGdiplus);
+			if(m_sNormalImage.IsEmpty() && pImage != NULL)
+			{
+				SIZE szImage = {pImage->nX, pImage->nY};
+				SIZE szStatus = {pImage->nX / m_nStateCount, pImage->nY};
+				if( szImage.cx > 0 && szImage.cy > 0 )
+				{
+					RECT rcSrc = {0, 0, szImage.cx, szImage.cy};
+					if(m_nStateCount > 0) {
+						int iLeft = rcSrc.left + 0 * szStatus.cx;
+						int iRight = iLeft + szStatus.cx;
+						int iTop = rcSrc.top;
+						int iBottom = iTop + szStatus.cy;
+						m_sNormalImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom);
+					}
+					if(m_nStateCount > 1) {
+						int iLeft = rcSrc.left + 1 * szStatus.cx;
+						int iRight = iLeft + szStatus.cx;
+						int iTop = rcSrc.top;
+						int iBottom = iTop + szStatus.cy;
+						m_sHotImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom);
+						m_sPushedImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom);
+					}
+					if(m_nStateCount > 2) {
+						int iLeft = rcSrc.left + 2 * szStatus.cx;
+						int iRight = iLeft + szStatus.cx;
+						int iTop = rcSrc.top;
+						int iBottom = iTop + szStatus.cy;
+						m_sPushedImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom);
+					}
+					if(m_nStateCount > 3) {
+						int iLeft = rcSrc.left + 3 * szStatus.cx;
+						int iRight = iLeft + szStatus.cx;
+						int iTop = rcSrc.top;
+						int iBottom = iTop + szStatus.cy;
+						m_sDisabledImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom);
+					}
+				}
+			}
+		}
+
+		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+		else m_uButtonState &= ~ UISTATE_FOCUSED;
+		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+		else m_uButtonState &= ~ UISTATE_DISABLED;
+		if(!::IsWindowEnabled(m_pManager->GetPaintWindow())) {
+			m_uButtonState &= UISTATE_DISABLED;
+		}
+		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
+			if( !m_sDisabledImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
+			if( !m_sPushedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if( !m_sHotImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
+			if( !m_sFocusedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) {}
+				else return;
+			}
+		}
+
+		if( !m_sNormalImage.IsEmpty() ) {
+			if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) {}
+		}
+	}
+
+	void CButtonUI::PaintBorder(HDC hDC)
+	{
+		if ((m_uButtonState & UISTATE_DISABLED) != 0) {
+			if (m_dwDisabledBorderColor != 0) {
+				DrawBorder(hDC, m_rcItem, GetAdjustColor(m_dwDisabledBorderColor), m_nBorderSize, m_rcBorderSize, m_cxyBorderRound, m_nBorderStyle);
+				return;
+			}
+		}
+		else if ((m_uButtonState & UISTATE_PUSHED) != 0) {
+			if (m_dwPushedBorderColor != 0) {
+				DrawBorder(hDC, m_rcItem, GetAdjustColor(m_dwPushedBorderColor), m_nBorderSize, m_rcBorderSize, m_cxyBorderRound, m_nBorderStyle);
+				return;
+			}
+		}
+		else if ((m_uButtonState & UISTATE_HOT) != 0) {
+			if (m_dwHotBorderColor != 0) {
+				DrawBorder(hDC, m_rcItem, GetAdjustColor(m_dwHotBorderColor), m_nBorderSize, m_rcBorderSize, m_cxyBorderRound, m_nBorderStyle);
+				return;
+			}
+		}
+		return CControlUI::PaintBorder(hDC);
+	}
+
+	void CButtonUI::PaintForeImage(HDC hDC)
+	{
+		if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
+			if( !m_sPushedForeImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sPushedForeImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if( !m_sHotForeImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sHotForeImage) ) {}
+				else return;
+			}
+		}
+		if(!m_sForeImage.IsEmpty() ) {
+			if( !DrawImage(hDC, (LPCTSTR)m_sForeImage) ) {}
+		}
+	}
+
+	void CButtonUI::DrawBorder(HDC hDC, const RECT& rcItem, const DWORD& dwBorderColor, const int& nBorderSize, const RECT& rcBorderSize, const SIZE& cxyBorderRound, const int& nBorderStyle)
+	{
+		if (dwBorderColor != 0) {
+			//ť­Ô˛˝Çąßżň
+			if (nBorderSize > 0 && (cxyBorderRound.cx > 0 || cxyBorderRound.cy > 0)) {
+					CRenderEngine::DrawRoundRect(hDC, rcItem, nBorderSize, cxyBorderRound.cx, cxyBorderRound.cy, GetAdjustColor(dwBorderColor), nBorderStyle);
+			}
+			else {
+				if (rcBorderSize.left > 0 || rcBorderSize.top > 0 || rcBorderSize.right > 0 || rcBorderSize.bottom > 0) {
+					RECT rcBorder;
+
+					if (rcBorderSize.left > 0) {
+						rcBorder = rcItem;
+						rcBorder.right = rcBorder.left;
+						CRenderEngine::DrawLine(hDC, rcBorder, rcBorderSize.left, GetAdjustColor(dwBorderColor), nBorderStyle);
+					}
+					if (rcBorderSize.top > 0) {
+						rcBorder = rcItem;
+						rcBorder.bottom = rcBorder.top;
+						CRenderEngine::DrawLine(hDC, rcBorder, rcBorderSize.top, GetAdjustColor(dwBorderColor), nBorderStyle);
+					}
+					if (rcBorderSize.right > 0) {
+						rcBorder = rcItem;
+						rcBorder.right -= 1;
+						rcBorder.left = rcBorder.right;
+						CRenderEngine::DrawLine(hDC, rcBorder, rcBorderSize.right, GetAdjustColor(dwBorderColor), nBorderStyle);
+					}
+					if (rcBorderSize.bottom > 0) {
+						rcBorder = rcItem;
+						rcBorder.bottom -= 1;
+						rcBorder.top = rcBorder.bottom;
+						CRenderEngine::DrawLine(hDC, rcBorder, rcBorderSize.bottom, GetAdjustColor(dwBorderColor), nBorderStyle);
+					}
+				}
+				else if (nBorderSize > 0) {
+					CRenderEngine::DrawRect(hDC, rcItem, nBorderSize, GetAdjustColor(dwBorderColor), nBorderStyle);
+				}
+			}
+		}
+	}
+
+}

+ 119 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIButton.h

@@ -0,0 +1,119 @@
+#ifndef __UIBUTTON_H__
+#define __UIBUTTON_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CButtonUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CButtonUI)
+
+	public:
+		CButtonUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		bool Activate();
+		void SetEnabled(bool bEnable = true);
+		void DoEvent(TEventUI& event);
+
+		virtual LPCTSTR GetNormalImage();
+		virtual void SetNormalImage(LPCTSTR pStrImage);
+		virtual LPCTSTR GetHotImage();
+		virtual void SetHotImage(LPCTSTR pStrImage);
+		virtual LPCTSTR GetPushedImage();
+		virtual void SetPushedImage(LPCTSTR pStrImage);
+		virtual LPCTSTR GetFocusedImage();
+		virtual void SetFocusedImage(LPCTSTR pStrImage);
+		virtual LPCTSTR GetDisabledImage();
+		virtual void SetDisabledImage(LPCTSTR pStrImage);
+		virtual LPCTSTR GetHotForeImage();
+		virtual void SetHotForeImage(LPCTSTR pStrImage);
+        virtual LPCTSTR GetPushedForeImage();
+        virtual void SetPushedForeImage(LPCTSTR pStrImage);
+		void SetStateCount(int nCount);
+		int GetStateCount() const;
+		virtual LPCTSTR GetStateImage();
+		virtual void SetStateImage(LPCTSTR pStrImage);
+
+		void BindTabIndex(int _BindTabIndex);
+		void BindTabLayoutName(LPCTSTR _TabLayoutName);
+		void BindTriggerTabSel(int _SetSelectIndex = -1);
+		void RemoveBindTabIndex();
+		int	 GetBindTabLayoutIndex();
+		LPCTSTR GetBindTabLayoutName();
+
+		void SetHotFont(int index);
+		int GetHotFont() const;
+		void SetPushedFont(int index);
+		int GetPushedFont() const;
+		void SetFocusedFont(int index);
+		int GetFocusedFont() const;
+
+		void SetHotBkColor(DWORD dwColor);
+		DWORD GetHotBkColor() const;
+		void SetPushedBkColor(DWORD dwColor);
+		DWORD GetPushedBkColor() const;
+		void SetDisabledBkColor(DWORD dwColor);
+		DWORD GetDisabledBkColor() const;
+		void SetHotTextColor(DWORD dwColor);
+		DWORD GetHotTextColor() const;
+		void SetPushedTextColor(DWORD dwColor);
+		DWORD GetPushedTextColor() const;
+		void SetFocusedTextColor(DWORD dwColor);
+		DWORD GetFocusedTextColor() const;
+
+		void SetHotBorderColor(DWORD dwColor);
+		DWORD GetHotBorderColor() const;
+		void SetPushedBorderColor(DWORD dwColor);
+		DWORD GetPushedBorderColor() const;
+		void SetDisabledBorderColor(DWORD dwColor);
+		DWORD GetDisabledBorderColor() const;
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintText(HDC hDC);
+
+		void PaintBkColor(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+		void PaintBorder(HDC hDC);
+		void PaintForeImage(HDC hDC);
+
+		void DrawBorder(HDC hDC, const RECT& rcItem, const DWORD& dwBorderColor, const int& nBorderSize, const RECT& rcBorderSize, const SIZE& cxyBorderRound, const int& nBorderStyle);
+	protected:
+		UINT m_uButtonState;
+
+		int		m_iHotFont;
+		int		m_iPushedFont;
+		int		m_iFocusedFont;
+
+		DWORD m_dwHotBkColor;
+		DWORD m_dwPushedBkColor;
+		DWORD m_dwDisabledBkColor;
+		DWORD m_dwHotTextColor;
+		DWORD m_dwPushedTextColor;
+		DWORD m_dwFocusedTextColor;
+		DWORD m_dwHotBorderColor;
+		DWORD m_dwPushedBorderColor;
+		DWORD m_dwDisabledBorderColor;
+
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sHotForeImage;
+		CDuiString m_sPushedImage;
+		CDuiString m_sPushedForeImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sDisabledImage;
+		int m_nStateCount;
+		CDuiString m_sStateImage;
+
+		int			m_iBindTabIndex;
+		CDuiString	m_sBindTabLayoutName;
+	};
+
+}	// namespace DuiLib
+
+#endif // __UIBUTTON_H__

+ 405 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIColorPalette.cpp

@@ -0,0 +1,405 @@
+#include "StdAfx.h"
+#include <math.h>
+
+namespace DuiLib {
+#define HSLMAX   255	/* H,L, and S vary over 0-HSLMAX */
+#define RGBMAX   255    /* R,G, and B vary over 0-RGBMAX */
+#define HSLUNDEFINED (HSLMAX*2/3)
+
+	/*
+	* Convert hue value to RGB
+	*/
+	static float HueToRGB(float v1, float v2, float vH)
+	{
+		if (vH < 0.0f) vH += 1.0f;
+		if (vH > 1.0f) vH -= 1.0f;
+		if ((6.0f * vH) < 1.0f) return (v1 + (v2 - v1) * 6.0f * vH);
+		if ((2.0f * vH) < 1.0f) return (v2);
+		if ((3.0f * vH) < 2.0f) return (v1 + (v2 - v1) * ((2.0f / 3.0f) - vH) * 6.0f);
+		return (v1);
+	}
+
+	/*
+	* Convert color RGB to HSL
+	* pHue HSL hue value			[0 - 1]
+	* pSat HSL saturation value		[0 - 1]
+	* pLue HSL luminance value		[0 - 1]
+	*/
+
+	static void RGBToHSL(DWORD clr, float *pHue, float *pSat, float *pLue)
+	{
+		float R = (float)(GetRValue(clr) / 255.0f);  //RGB from 0 to 255
+		float G = (float)(GetGValue(clr) / 255.0f);
+		float B = (float)(GetBValue(clr) / 255.0f);
+
+		float H = 0, S = 0, L = 0;
+
+		float fMin = min(R, min(G, B));		//Min. value of RGB
+		float fMax = max(R, max(G, B));		//Max. value of RGB
+		float fDelta = fMax - fMin;				//Delta RGB value
+
+		L = (fMax + fMin) / 2.0f;
+
+		if (fDelta == 0)                     //This is a gray, no chroma...
+		{
+			H = 0.0f;                          //HSL results from 0 to 1
+			S = 0.0f;
+		}
+		else                                   //Chromatic data...
+		{
+			float del_R, del_G, del_B;
+
+			if (L < 0.5) S = fDelta / (fMax + fMin);
+			else           S = fDelta / (2.0f - fMax - fMin);
+
+			del_R = (((fMax - R) / 6.0f) + (fDelta / 2.0f)) / fDelta;
+			del_G = (((fMax - G) / 6.0f) + (fDelta / 2.0f)) / fDelta;
+			del_B = (((fMax - B) / 6.0f) + (fDelta / 2.0f)) / fDelta;
+
+			if (R == fMax) H = del_B - del_G;
+			else if (G == fMax) H = (1.0f / 3.0f) + del_R - del_B;
+			else if (B == fMax) H = (2.0f / 3.0f) + del_G - del_R;
+
+			if (H < 0.0f) H += 1.0f;
+			if (H > 1.0f)  H -= 1.0f;
+		}
+
+		*pHue = H;
+		*pSat = S;
+		*pLue = L;
+	}
+
+	/*
+	* Convert color HSL to RGB
+	* H HSL hue value				[0 - 1]
+	* S HSL saturation value		[0 - 1]
+	* L HSL luminance value			[0 - 1]
+	*/
+	static DWORD HSLToRGB(float H, float S, float L)
+	{
+		BYTE R, G, B;
+		float var_1, var_2;
+
+		if (S == 0)                       //HSL from 0 to 1
+		{
+			R = G = B = (BYTE)(L * 255.0f);   //RGB results from 0 to 255
+		}
+		else
+		{
+			if (L < 0.5) var_2 = L * (1.0f + S);
+			else           var_2 = (L + S) - (S * L);
+
+			var_1 = 2.0f * L - var_2;
+
+			R = (BYTE)(255.0f * HueToRGB(var_1, var_2, H + (1.0f / 3.0f)));
+			G = (BYTE)(255.0f * HueToRGB(var_1, var_2, H));
+			B = (BYTE)(255.0f * HueToRGB(var_1, var_2, H - (1.0f / 3.0f)));
+		}
+
+		return RGB(R, G, B);
+	}
+
+	/*
+	* _HSLToRGB color HSL value to RGB
+	* clr  RGB color value
+	* nHue HSL hue value			[0 - 360]
+	* nSat HSL saturation value		[0 - 200]
+	* nLue HSL luminance value		[0 - 200]
+	*/
+#define _HSLToRGB(h,s,l) (0xFF << 24 | HSLToRGB((float)h / 360.0f,(float)s / 200.0f,l / 200.0f))
+
+	///////////////////////////////////////////////////////////////////////
+	//
+	//
+	IMPLEMENT_DUICONTROL(CColorPaletteUI)
+
+	CColorPaletteUI::CColorPaletteUI()
+		: m_uButtonState(0)
+		, m_bIsInBar(false)
+		, m_bIsInPallet(false)
+		, m_nCurH(180)
+		, m_nCurS(200)
+		, m_nCurB(100)
+		, m_nPalletHeight(200)
+		, m_nBarHeight(10)
+		, m_pBits(NULL)
+	{
+		memset(&m_bmInfo, 0, sizeof(m_bmInfo));
+	
+		m_hMemBitmap=NULL;
+	}
+
+	CColorPaletteUI::~CColorPaletteUI()
+	{
+		if (m_pBits) free(m_pBits);
+
+		if (m_hMemBitmap) {
+			::DeleteObject(m_hMemBitmap);
+		}
+
+	}
+
+	DWORD CColorPaletteUI::GetSelectColor()
+	{
+		DWORD dwColor = _HSLToRGB(m_nCurH, m_nCurS, m_nCurB);
+		return 0xFF << 24 | GetRValue(dwColor) << 16 | GetGValue(dwColor) << 8 | GetBValue(dwColor);
+	}
+
+	void CColorPaletteUI::SetSelectColor(DWORD dwColor) 
+	{
+		float H = 0, S = 0, B = 0;
+		COLORREF dwBkClr = RGB(GetBValue(dwColor),GetGValue(dwColor),GetRValue(dwColor));
+		RGBToHSL(dwBkClr, &H, &S, &B);
+		m_nCurH = (int)(H*360);
+		m_nCurS = (int)(S*200);
+		m_nCurB = (int)(B*200);
+		UpdatePalletData();
+		NeedUpdate();
+	}
+
+	LPCTSTR CColorPaletteUI::GetClass() const
+	{
+		return _T("ColorPaletteUI");
+	}
+
+	LPVOID CColorPaletteUI::GetInterface(LPCTSTR pstrName)
+	{
+		if (_tcscmp(pstrName, DUI_CTR_COLORPALETTE) == 0) return static_cast<CColorPaletteUI*>(this);
+		return CControlUI::GetInterface(pstrName);
+	}
+
+	void CColorPaletteUI::SetPalletHeight(int nHeight)
+	{
+		m_nPalletHeight = nHeight;
+	}
+	int	 CColorPaletteUI::GetPalletHeight() const
+	{
+		return m_nPalletHeight;
+	}
+	void CColorPaletteUI::SetBarHeight(int nHeight)
+	{
+		if (nHeight>150) {
+			nHeight = 150; //限制最大高度,由于当前设计,nheight超出190,程序会因越界访问崩溃
+		}
+		m_nBarHeight = nHeight;
+	}
+	int  CColorPaletteUI::GetBarHeight() const
+	{
+		return m_nBarHeight;
+	}
+
+	void CColorPaletteUI::SetThumbImage(LPCTSTR pszImage)
+	{
+		if (m_strThumbImage != pszImage)
+		{
+			m_strThumbImage = pszImage;
+			NeedUpdate();
+		}
+	}
+
+	LPCTSTR CColorPaletteUI::GetThumbImage() const
+	{
+		return m_strThumbImage.GetData();
+	}
+
+	void CColorPaletteUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if (_tcscmp(pstrName, _T("palletheight")) == 0) SetPalletHeight(_ttoi(pstrValue));
+		else if (_tcscmp(pstrName, _T("barheight")) == 0) SetBarHeight(_ttoi(pstrValue));
+		else if (_tcscmp(pstrName, _T("thumbimage")) == 0) SetThumbImage(pstrValue);
+		else CControlUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CColorPaletteUI::DoInit()
+	{
+		m_MemDc = CreateCompatibleDC(GetManager()->GetPaintDC());
+		m_hMemBitmap = CreateCompatibleBitmap(GetManager()->GetPaintDC(), 400, 360);
+		SelectObject(m_MemDc, m_hMemBitmap);
+
+		::GetObject(m_hMemBitmap, sizeof(m_bmInfo), &m_bmInfo);
+		DWORD dwSize = m_bmInfo.bmHeight * m_bmInfo.bmWidthBytes;
+		m_pBits = (BYTE *)malloc(dwSize);
+		::GetBitmapBits(m_hMemBitmap, dwSize, m_pBits);
+	}
+
+	void CColorPaletteUI::SetPos(RECT rc, bool bNeedInvalidate)
+	{
+		CControlUI::SetPos(rc, bNeedInvalidate);
+
+		m_ptLastPalletMouse.x = m_nCurH * (m_rcItem.right - m_rcItem.left) / 360 + m_rcItem.left;
+		m_ptLastPalletMouse.y = (200 - m_nCurB) * m_nPalletHeight / 200 + m_rcItem.top;
+
+		UpdatePalletData();
+		UpdateBarData();
+	}
+
+	void CColorPaletteUI::DoEvent(TEventUI& event)
+	{
+		CControlUI::DoEvent(event);
+
+		if (event.Type == UIEVENT_BUTTONDOWN)
+		{
+			if (event.ptMouse.x >= m_rcItem.left && event.ptMouse.y >= m_rcItem.top &&
+				event.ptMouse.x < m_rcItem.right && event.ptMouse.y < m_rcItem.top + m_nPalletHeight)
+			{
+				int x = (event.ptMouse.x - m_rcItem.left) * 360 / (m_rcItem.right - m_rcItem.left);
+				int y = (event.ptMouse.y - m_rcItem.top) * 200 / m_nPalletHeight;
+				x = min(max(x, 0), 360);
+				y = min(max(y, 0), 200);
+
+				m_ptLastPalletMouse = event.ptMouse;
+				if (m_ptLastPalletMouse.x < m_rcItem.left) m_ptLastPalletMouse.x = m_rcItem.left;
+				if (m_ptLastPalletMouse.x > m_rcItem.right) m_ptLastPalletMouse.x = m_rcItem.right;
+				if (m_ptLastPalletMouse.y < m_rcItem.top) m_ptLastPalletMouse.y = m_rcItem.top;
+				if (m_ptLastPalletMouse.y > m_rcItem.top + m_nPalletHeight) m_ptLastPalletMouse.y = m_rcItem.top + m_nPalletHeight;
+
+				m_nCurH = x;
+				m_nCurB = 200 - y;
+
+				m_uButtonState |= UISTATE_PUSHED;
+				m_bIsInPallet = true;
+				m_bIsInBar = false;
+
+				UpdateBarData();
+			}
+
+			if (event.ptMouse.x >= m_rcItem.left && event.ptMouse.y >= m_rcItem.bottom - m_nBarHeight &&
+				event.ptMouse.x < m_rcItem.right && event.ptMouse.y < m_rcItem.bottom)
+			{
+				m_nCurS = (event.ptMouse.x - m_rcItem.left) * 200 / (m_rcItem.right - m_rcItem.left);
+				m_uButtonState |= UISTATE_PUSHED;
+				m_bIsInBar = true;
+				m_bIsInPallet = false;
+				UpdatePalletData();
+			}
+
+			Invalidate();
+			return;
+		}
+		if (event.Type == UIEVENT_BUTTONUP)
+		{
+			DWORD color=0;
+			if ((m_uButtonState | UISTATE_PUSHED) && (IsEnabled()))
+			{
+				color = GetSelectColor();
+				m_pManager->SendNotify(this, DUI_MSGTYPE_COLORCHANGED, color, 0);
+			}
+
+			m_uButtonState &= ~UISTATE_PUSHED;
+			m_bIsInPallet = false;
+			m_bIsInBar = false;
+
+			Invalidate();
+			return;
+		}
+		if (event.Type == UIEVENT_MOUSEMOVE)
+		{
+			if (!(m_uButtonState &UISTATE_PUSHED))
+			{
+				m_bIsInBar = false;
+				m_bIsInPallet = false;
+			}
+			if (m_bIsInPallet == true)
+			{
+				POINT pt = event.ptMouse;
+				pt.x -= m_rcItem.left;
+				pt.y -= m_rcItem.top;
+
+				if (pt.x >= 0 && pt.y >= 0 && pt.x <= m_rcItem.right && pt.y <= m_rcItem.top + m_nPalletHeight)
+				{
+					int x = pt.x * 360 / (m_rcItem.right - m_rcItem.left);
+					int y = pt.y * 200 / m_nPalletHeight;
+					x = min(max(x, 0), 360);
+					y = min(max(y, 0), 200);
+
+					m_ptLastPalletMouse = event.ptMouse;
+					if (m_ptLastPalletMouse.x < m_rcItem.left) m_ptLastPalletMouse.x = m_rcItem.left;
+					if (m_ptLastPalletMouse.x > m_rcItem.right) m_ptLastPalletMouse.x = m_rcItem.right;
+					if (m_ptLastPalletMouse.y < m_rcItem.top) m_ptLastPalletMouse.y = m_rcItem.top;
+					if (m_ptLastPalletMouse.y >= m_rcItem.top + m_nPalletHeight) m_ptLastPalletMouse.y = m_rcItem.top + m_nPalletHeight;
+
+					m_nCurH = x;
+					m_nCurB = 200 - y;
+
+					UpdateBarData();
+				}
+			}
+			else if (m_bIsInBar == true)
+			{
+				m_nCurS = (event.ptMouse.x - m_rcItem.left) * 200 / (m_rcItem.right - m_rcItem.left);
+				m_nCurS = min(max(m_nCurS, 0), 200);
+				UpdatePalletData();
+			}
+
+			Invalidate();
+			return;
+		}
+
+	}
+
+	void CColorPaletteUI::PaintBkColor(HDC hDC)
+	{
+		PaintPallet(hDC);
+	}
+	
+	void CColorPaletteUI::PaintPallet(HDC hDC)
+	{
+		int nSaveDC = ::SaveDC(hDC);
+
+		::SetStretchBltMode(hDC, HALFTONE);
+		//拉伸模式将内存图画到控件上
+		StretchBlt(hDC, m_rcItem.left, m_rcItem.top, m_rcItem.right - m_rcItem.left, m_nPalletHeight, m_MemDc, 0, 1, 360, 200, SRCCOPY);
+		StretchBlt(hDC, m_rcItem.left, m_rcItem.bottom - m_nBarHeight, m_rcItem.right - m_rcItem.left, m_nBarHeight, m_MemDc, 0, 210, 200, m_nBarHeight, SRCCOPY);
+
+		RECT rcCurSorPaint = { m_ptLastPalletMouse.x - 4, m_ptLastPalletMouse.y - 4, m_ptLastPalletMouse.x + 4, m_ptLastPalletMouse.y + 4 };
+		CRenderEngine::DrawImageString(hDC, m_pManager, rcCurSorPaint, m_rcPaint, m_strThumbImage);
+
+		rcCurSorPaint.left = m_rcItem.left + m_nCurS * (m_rcItem.right - m_rcItem.left) / 200 - 4;
+		rcCurSorPaint.right = m_rcItem.left + m_nCurS * (m_rcItem.right - m_rcItem.left) / 200 + 4;
+		rcCurSorPaint.top = m_rcItem.bottom - m_nBarHeight / 2 - 4;
+		rcCurSorPaint.bottom = m_rcItem.bottom - m_nBarHeight / 2 + 4;
+		CRenderEngine::DrawImageString(hDC, m_pManager, rcCurSorPaint, m_rcPaint, m_strThumbImage);
+		::RestoreDC(hDC, nSaveDC);
+	}
+
+	void CColorPaletteUI::UpdatePalletData()
+	{
+		int x, y;
+		BYTE *pPiexl;
+		DWORD dwColor;
+		for (y = 0; y < 200; ++y) {
+			for (x = 0; x < 360; ++x) {
+				pPiexl = LPBYTE(m_pBits) + ((200 - y)*m_bmInfo.bmWidthBytes) + ((x*m_bmInfo.bmBitsPixel) / 8);
+				dwColor = _HSLToRGB(x, m_nCurS, y);
+				if(dwColor == 0xFF000000) dwColor = 0xFF000001;
+				pPiexl[0] = GetBValue(dwColor);
+				pPiexl[1] = GetGValue(dwColor);
+				pPiexl[2] = GetRValue(dwColor);
+			}
+		}
+
+		SetBitmapBits(m_hMemBitmap, m_bmInfo.bmWidthBytes * m_bmInfo.bmHeight, m_pBits);
+	}
+
+
+	void CColorPaletteUI::UpdateBarData()
+	{
+		int x, y;
+		BYTE *pPiexl;
+		DWORD dwColor;
+		//这里画出Bar
+		for (y = 0; y < m_nBarHeight; ++y) {
+			for (x = 0; x < 200; ++x) {
+				pPiexl = LPBYTE(m_pBits) + ((210 + y)*m_bmInfo.bmWidthBytes) + ((x*m_bmInfo.bmBitsPixel) / 8);
+				dwColor = _HSLToRGB(m_nCurH, x, m_nCurB);
+				if(dwColor == 0xFF000000) dwColor = 0xFF000001;
+				pPiexl[0] = GetBValue(dwColor);
+				pPiexl[1] = GetGValue(dwColor);
+				pPiexl[2] = GetRValue(dwColor);
+			}
+		}
+
+		SetBitmapBits(m_hMemBitmap, m_bmInfo.bmWidthBytes * m_bmInfo.bmHeight, m_pBits);
+	}
+
+}

+ 65 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIColorPalette.h

@@ -0,0 +1,65 @@
+#ifndef UI_PALLET_H
+#define UI_PALLET_H
+#pragma once
+
+namespace DuiLib {
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+	class UILIB_API CColorPaletteUI : public CControlUI
+	{
+		DECLARE_DUICONTROL(CColorPaletteUI)
+	public:
+		CColorPaletteUI();
+		virtual ~CColorPaletteUI();
+
+		//获取最终被选择的颜色,可以直接用于设置duilib背景色
+		DWORD GetSelectColor();
+		void SetSelectColor(DWORD dwColor);
+
+		virtual LPCTSTR GetClass() const;
+		virtual LPVOID GetInterface(LPCTSTR pstrName);
+		virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		//设置/获取 Pallet(调色板主界面)的高度
+		void SetPalletHeight(int nHeight);
+		int	GetPalletHeight() const;
+
+		//设置/获取 下方Bar(亮度选择栏)的高度
+		void SetBarHeight(int nHeight);
+		int GetBarHeight() const;
+		//设置/获取 选择图标的路径
+		void SetThumbImage(LPCTSTR pszImage);
+		LPCTSTR GetThumbImage() const;
+
+		virtual void SetPos(RECT rc, bool bNeedInvalidate = true);
+		virtual void DoInit();
+		virtual void DoEvent(TEventUI& event);
+		virtual void PaintBkColor(HDC hDC);
+		virtual void PaintPallet(HDC hDC);
+
+	protected:
+		//更新数据
+		void UpdatePalletData();
+		void UpdateBarData();
+
+	private:
+		HDC			m_MemDc;
+		HBITMAP		m_hMemBitmap;
+		BITMAP		m_bmInfo;
+		BYTE		*m_pBits;
+		UINT		m_uButtonState;
+		bool		m_bIsInBar;
+		bool		m_bIsInPallet;
+		int			m_nCurH;
+		int			m_nCurS;
+		int			m_nCurB;
+
+		int			m_nPalletHeight;
+		int			m_nBarHeight;
+		CDuiPoint		m_ptLastPalletMouse;
+		CDuiPoint		m_ptLastBarMouse;
+		CDuiString  m_strThumbImage;
+	};
+}
+
+#endif // UI_PALLET_H

Diferenças do arquivo suprimidas por serem muito extensas
+ 1341 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UICombo.cpp


+ 165 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UICombo.h

@@ -0,0 +1,165 @@
+#ifndef __UICOMBO_H__
+#define __UICOMBO_H__
+
+#pragma once
+
+namespace DuiLib {
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class CComboWnd;
+
+	class UILIB_API CComboUI : public CContainerUI, public IListOwnerUI
+	{
+		DECLARE_DUICONTROL(CComboUI)
+		friend class CComboWnd;
+	public:
+		CComboUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		void DoInit();
+		UINT GetControlFlags() const;
+
+		CDuiString GetText() const;
+		void SetEnabled(bool bEnable = true);
+
+		void SetTextStyle(UINT uStyle);
+		UINT GetTextStyle() const;
+		void SetTextColor(DWORD dwTextColor);
+		DWORD GetTextColor() const;
+		void SetDisabledTextColor(DWORD dwTextColor);
+		DWORD GetDisabledTextColor() const;
+		void SetFont(int index);
+		int GetFont() const;
+		RECT GetTextPadding() const;
+		void SetTextPadding(RECT rc);
+		bool IsShowHtml();
+		void SetShowHtml(bool bShowHtml = true);
+		bool IsShowShadow();
+		void SetShowShadow(bool bShow = true);
+
+		CDuiString GetDropBoxAttributeList();
+		void SetDropBoxAttributeList(LPCTSTR pstrList);
+		SIZE GetDropBoxSize() const;
+		void SetDropBoxSize(SIZE szDropBox);
+		RECT GetDropBoxInset() const;
+		void SetDropBoxInset(RECT szDropBox);
+
+		UINT GetListType();
+		TListInfoUI* GetListInfo();
+		int GetCurSel() const;  
+		bool SelectItem(int iIndex, bool bTakeFocus = false);
+		bool SelectMultiItem(int iIndex, bool bTakeFocus = false);
+		bool UnSelectItem(int iIndex, bool bOthers = false);
+		bool SetItemIndex(CControlUI* pControl, int iIndex);
+
+		bool Add(CControlUI* pControl);
+		bool AddAt(CControlUI* pControl, int iIndex);
+		bool Remove(CControlUI* pControl);
+		bool RemoveAt(int iIndex);
+		void RemoveAll();
+
+		bool Activate();
+
+		LPCTSTR GetNormalImage() const;
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage() const;
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetPushedImage() const;
+		void SetPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage() const;
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetDisabledImage() const;
+		void SetDisabledImage(LPCTSTR pStrImage);
+
+		bool GetScrollSelect();
+		void SetScrollSelect(bool bScrollSelect);
+
+		void SetItemFont(int index);
+		void SetItemTextStyle(UINT uStyle);
+		RECT GetItemTextPadding() const;
+		void SetItemTextPadding(RECT rc);
+		DWORD GetItemTextColor() const;
+		void SetItemTextColor(DWORD dwTextColor);
+		DWORD GetItemBkColor() const;
+		void SetItemBkColor(DWORD dwBkColor);
+		LPCTSTR GetItemBkImage() const;
+		void SetItemBkImage(LPCTSTR pStrImage);
+		bool IsAlternateBk() const;
+		void SetAlternateBk(bool bAlternateBk);
+		DWORD GetSelectedItemTextColor() const;
+		void SetSelectedItemTextColor(DWORD dwTextColor);
+		DWORD GetSelectedItemBkColor() const;
+		void SetSelectedItemBkColor(DWORD dwBkColor);
+		LPCTSTR GetSelectedItemImage() const;
+		void SetSelectedItemImage(LPCTSTR pStrImage);
+		DWORD GetHotItemTextColor() const;
+		void SetHotItemTextColor(DWORD dwTextColor);
+		DWORD GetHotItemBkColor() const;
+		void SetHotItemBkColor(DWORD dwBkColor);
+		LPCTSTR GetHotItemImage() const;
+		void SetHotItemImage(LPCTSTR pStrImage);
+		DWORD GetDisabledItemTextColor() const;
+		void SetDisabledItemTextColor(DWORD dwTextColor);
+		DWORD GetDisabledItemBkColor() const;
+		void SetDisabledItemBkColor(DWORD dwBkColor);
+		LPCTSTR GetDisabledItemImage() const;
+		void SetDisabledItemImage(LPCTSTR pStrImage);
+		DWORD GetItemLineColor() const;
+		void SetItemLineColor(DWORD dwLineColor);
+		bool IsItemShowHtml();
+		void SetItemShowHtml(bool bShowHtml = true);
+
+		SIZE EstimateSize(SIZE szAvailable);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void Move(SIZE szOffset, bool bNeedInvalidate = true);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+		void PaintText(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+
+	public:
+		void SortItems();
+		BOOL SortItems(PULVCompareFunc pfnCompare, UINT_PTR dwData);
+
+	protected:
+		static int __cdecl ItemComareFunc(void* pvlocale, const void* item1, const void* item2);
+		int __cdecl ItemComareFunc(const void* item1, const void* item2);
+
+	protected:
+		PULVCompareFunc m_pCompareFunc;
+		UINT_PTR m_compareData;
+
+	protected:
+		CComboWnd* m_pWindow;
+
+		int m_iCurSel;
+		DWORD	m_dwTextColor;
+		DWORD	m_dwDisabledTextColor;
+		int		m_iFont;
+		UINT	m_uTextStyle;
+		RECT	m_rcTextPadding;
+		bool	m_bShowHtml;
+		bool	m_bShowShadow;
+		CDuiString m_sDropBoxAttributes;
+		SIZE m_szDropBox;
+		RECT m_rcDropBox;
+		UINT m_uButtonState;
+
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sPushedImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sDisabledImage;
+
+		bool m_bScrollSelect;
+		TListInfoUI m_ListInfo;
+	};
+
+} // namespace DuiLib
+
+#endif // __UICOMBO_H__

+ 110 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIComboBox.cpp

@@ -0,0 +1,110 @@
+#include "StdAfx.h"
+#include "UIComboBox.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CComboBoxUI)
+
+	CComboBoxUI::CComboBoxUI()
+	{
+		m_nArrowWidth = 0;
+	}
+
+	LPCTSTR CComboBoxUI::GetClass() const
+	{
+		return _T("ComboBoxUI");
+	}
+
+	void CComboBoxUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if (_tcsicmp(pstrName, _T("arrowimage")) == 0)
+			m_sArrowImage = pstrValue;
+		else
+			CComboUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CComboBoxUI::PaintStatusImage(HDC hDC)
+	{
+		if (m_sArrowImage.IsEmpty())
+			CComboUI::PaintStatusImage(hDC);
+		else
+		{
+			// get index
+			if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+			else m_uButtonState &= ~ UISTATE_FOCUSED;
+			if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+			else m_uButtonState &= ~ UISTATE_DISABLED;
+
+			int nIndex = 0;
+			if ((m_uButtonState & UISTATE_DISABLED) != 0)
+				nIndex = 4;
+			else if ((m_uButtonState & UISTATE_PUSHED) != 0)
+				nIndex = 2;
+			else if ((m_uButtonState & UISTATE_HOT) != 0)
+				nIndex = 1;
+			else if ((m_uButtonState & UISTATE_FOCUSED) != 0)
+				nIndex = 3;
+
+			// make modify string
+			CDuiString sModify = m_sArrowImage;
+
+			int nPos1 = sModify.Find(_T("source"));
+			int nPos2 = sModify.Find(_T("'"), nPos1 + 7);
+			if (nPos2 == -1) return; //first
+			int nPos3 = sModify.Find(_T("'"), nPos2 + 1);
+			if (nPos3 == -1) return; //second
+
+			CDuiRect rcBmpPart;
+			LPTSTR lpszValue = NULL;
+			rcBmpPart.left = _tcstol(sModify.GetData() + nPos2 + 1, &lpszValue, 10);  ASSERT(lpszValue);    
+			rcBmpPart.top = _tcstol(lpszValue + 1, &lpszValue, 10);    ASSERT(lpszValue);    
+			rcBmpPart.right = _tcstol(lpszValue + 1, &lpszValue, 10);  ASSERT(lpszValue);    
+			rcBmpPart.bottom = _tcstol(lpszValue + 1, &lpszValue, 10); ASSERT(lpszValue); 
+
+			m_nArrowWidth = rcBmpPart.GetWidth() / 5;
+			rcBmpPart.left += nIndex * m_nArrowWidth;
+			rcBmpPart.right = rcBmpPart.left + m_nArrowWidth;
+
+			CDuiRect rcDest(0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top);
+			rcDest.Deflate(GetBorderSize(), GetBorderSize());
+			rcDest.left = rcDest.right - m_nArrowWidth;
+
+			CDuiString sSource = sModify.Mid(nPos1, nPos3 + 1 - nPos1);
+			CDuiString sReplace;
+			sReplace.SmallFormat(_T("source='%d,%d,%d,%d' dest='%d,%d,%d,%d'"),
+				rcBmpPart.left, rcBmpPart.top, rcBmpPart.right, rcBmpPart.bottom,
+				rcDest.left, rcDest.top, rcDest.right, rcDest.bottom);
+
+			sModify.Replace(sSource, sReplace);
+
+			// draw image
+			if (!DrawImage(hDC, m_sArrowImage, sModify))
+				{}
+		}
+	}
+
+	void CComboBoxUI::PaintText(HDC hDC)
+	{
+		RECT rcText = m_rcItem;
+		rcText.left += m_rcTextPadding.left;
+		rcText.right -= m_rcTextPadding.right;
+		rcText.top += m_rcTextPadding.top;
+		rcText.bottom -= m_rcTextPadding.bottom;
+
+		rcText.right -= m_nArrowWidth; // add this line than CComboUI::PaintText(HDC hDC)
+
+		if( m_iCurSel >= 0 ) {
+			CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);
+			IListItemUI* pElement = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
+			if( pElement != NULL ) {
+				pElement->DrawItemText(hDC, rcText);
+			}
+			else {
+				RECT rcOldPos = pControl->GetPos();
+				pControl->SetPos(rcText);
+				pControl->DoPaint(hDC, rcText, NULL);
+				pControl->SetPos(rcOldPos);
+			}
+		}
+	}
+}

+ 29 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIComboBox.h

@@ -0,0 +1,29 @@
+#ifndef __UICOMBOBOX_H__
+#define __UICOMBOBOX_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	/// 扩展下拉列表框
+	/// 增加arrowimage属性,一张图片平均分成5份,Normal/Hot/Pushed/Focused/Disabled(必须有source属性)
+	/// <Default name="ComboBox" value="arrowimage=&quot;file='sys_combo_btn.png' source='0,0,16,16'&quot; "/>
+	class UILIB_API CComboBoxUI : public CComboUI
+	{
+		DECLARE_DUICONTROL(CComboBoxUI)
+	public:
+		CComboBoxUI();
+		LPCTSTR GetClass() const;
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintText(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+
+	protected:
+		CDuiString m_sArrowImage;
+		int        m_nArrowWidth;
+	};
+}
+
+#endif // __UICOMBOBOX_H__

+ 324 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIDateTime.cpp

@@ -0,0 +1,324 @@
+#include "StdAfx.h"
+#include "UIDateTime.h"
+
+namespace DuiLib
+{
+	//CDateTimeUI::m_nDTUpdateFlag
+#define DT_NONE   0
+#define DT_UPDATE 1
+#define DT_DELETE 2
+#define DT_KEEP   3
+
+	class CDateTimeWnd : public CWindowWnd
+	{
+	public:
+		CDateTimeWnd();
+
+		void Init(CDateTimeUI* pOwner);
+		RECT CalPos();
+
+		LPCTSTR GetWindowClassName() const;
+		LPCTSTR GetSuperClassName() const;
+		void OnFinalMessage(HWND hWnd);
+
+		LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+	protected:
+		CDateTimeUI* m_pOwner;
+		HBRUSH m_hBkBrush;
+		bool m_bInit;
+		bool m_bDropOpen;
+		SYSTEMTIME m_oldSysTime;
+	};
+
+	CDateTimeWnd::CDateTimeWnd() : m_pOwner(NULL), m_hBkBrush(NULL), m_bInit(false), m_bDropOpen(false)
+	{
+	}
+
+	void CDateTimeWnd::Init(CDateTimeUI* pOwner)
+	{
+		m_pOwner = pOwner;
+		m_pOwner->m_nDTUpdateFlag = DT_NONE;
+
+		if (m_hWnd == NULL)
+		{
+			RECT rcPos = CalPos();
+			UINT uStyle = WS_CHILD;
+			Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
+			SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
+		}
+		// 使用系统当前时间
+		if (m_pOwner->GetText().IsEmpty()) {
+			::GetLocalTime(&m_pOwner->m_sysTime);
+		}
+		// 显示格式
+		CDuiString sTimeFormat = m_pOwner->GetTimeFormat();
+		::SendMessage(m_hWnd, DTM_SETFORMAT, 0, LPARAM(sTimeFormat.GetData()));
+		memcpy(&m_oldSysTime, &m_pOwner->m_sysTime, sizeof(SYSTEMTIME));
+		::SendMessage(m_hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&m_pOwner->m_sysTime);
+		::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
+		::SetFocus(m_hWnd);
+
+		m_bInit = true;    
+	}
+
+	RECT CDateTimeWnd::CalPos()
+	{
+		CDuiRect rcPos = m_pOwner->GetPos();
+		//CDuiRect rcPadding = m_pOwner->GetTextPadding();
+		//rcPos.left += rcPadding.left;
+		//rcPos.top += rcPadding.top;
+		//rcPos.right -= rcPadding.right;
+		//rcPos.bottom -= rcPadding.bottom;
+
+		CControlUI* pParent = m_pOwner;
+		RECT rcParent;
+		while( pParent = pParent->GetParent() ) {
+			if( !pParent->IsVisible() ) {
+				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
+				break;
+			}
+			rcParent = pParent->GetClientPos();
+			if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
+				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
+				break;
+			}
+		}
+
+		return rcPos;
+	}
+
+	LPCTSTR CDateTimeWnd::GetWindowClassName() const
+	{
+		return _T("DateTimeWnd");
+	}
+
+	LPCTSTR CDateTimeWnd::GetSuperClassName() const
+	{
+		return DATETIMEPICK_CLASS;
+	}
+
+	void CDateTimeWnd::OnFinalMessage(HWND hWnd)
+	{
+		if( m_hBkBrush != NULL ) ::DeleteObject(m_hBkBrush);
+		//m_pOwner->GetManager()->RemoveNativeWindow(hWnd);
+		m_pOwner->m_pWindow = NULL;
+		delete this;
+	}
+
+	LRESULT CDateTimeWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		LRESULT lRes = 0;
+		BOOL bHandled = TRUE;
+		if (uMsg == WM_KEYDOWN && wParam == VK_ESCAPE) {
+			memcpy(&m_pOwner->m_sysTime, &m_oldSysTime, sizeof(SYSTEMTIME));
+			m_pOwner->m_nDTUpdateFlag = DT_UPDATE;
+			m_pOwner->UpdateText();
+			PostMessage(WM_CLOSE);
+			return lRes;
+		}
+		else if(uMsg == OCM_NOTIFY) {
+			NMHDR* pHeader=(NMHDR*)lParam;
+			if(pHeader != NULL && pHeader->hwndFrom == m_hWnd) {
+				if(pHeader->code == DTN_DATETIMECHANGE) {
+					LPNMDATETIMECHANGE lpChage=(LPNMDATETIMECHANGE)lParam;
+					::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&m_pOwner->m_sysTime);
+					m_pOwner->m_nDTUpdateFlag = DT_UPDATE;
+					m_pOwner->UpdateText();
+				}
+				else if(pHeader->code == DTN_DROPDOWN) {
+					m_bDropOpen = true;
+				}
+				else if(pHeader->code == DTN_CLOSEUP) {
+					::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&m_pOwner->m_sysTime);
+					m_pOwner->m_nDTUpdateFlag = DT_UPDATE;
+					m_pOwner->UpdateText();
+					PostMessage(WM_CLOSE);
+					m_bDropOpen = false;
+				}
+			}
+			bHandled = FALSE;
+		}
+		else if(uMsg == WM_KILLFOCUS)
+		{
+			if(!m_bDropOpen) {
+				PostMessage(WM_CLOSE);
+			}
+			bHandled = FALSE;
+		}
+		else bHandled = FALSE;
+		if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+		return lRes;
+	}
+	//////////////////////////////////////////////////////////////////////////
+	//
+	IMPLEMENT_DUICONTROL(CDateTimeUI)
+
+	CDateTimeUI::CDateTimeUI()
+	{
+		::GetLocalTime(&m_sysTime);
+		m_bReadOnly = false;
+		m_sTimeFormat = _T("yyyy-MM-dd HH:mm:ss");
+		m_pWindow = NULL;
+
+		m_nDTUpdateFlag=DT_UPDATE;
+		UpdateText();
+		m_nDTUpdateFlag = DT_NONE;
+	}
+
+	LPCTSTR CDateTimeUI::GetClass() const
+	{
+		return _T("DateTimeUI");
+	}
+
+	LPVOID CDateTimeUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcscmp(pstrName, DUI_CTR_DATETIME) == 0 ) return static_cast<CDateTimeUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	SYSTEMTIME& CDateTimeUI::GetTime()
+	{
+		return m_sysTime;
+	}
+
+	void CDateTimeUI::SetTime(SYSTEMTIME* pst)
+	{
+		m_sysTime = *pst;
+		Invalidate();
+		m_nDTUpdateFlag = DT_UPDATE;
+		UpdateText();
+		m_nDTUpdateFlag = DT_NONE;
+	}
+
+	void CDateTimeUI::SetReadOny(bool bReadOnly)
+	{
+		m_bReadOnly = bReadOnly;
+		Invalidate();
+	}
+
+	bool CDateTimeUI::IsReadOnly() const
+	{
+		return m_bReadOnly;
+	}
+
+	void CDateTimeUI::SetTimeFormat(LPCTSTR pstrFormat)
+	{
+		m_sTimeFormat = pstrFormat;
+		Invalidate();
+
+		m_nDTUpdateFlag = DT_UPDATE;
+		UpdateText();
+		m_nDTUpdateFlag = DT_NONE;
+	}
+
+	CDuiString CDateTimeUI::GetTimeFormat() const
+	{
+		return m_sTimeFormat;
+	}
+
+	void CDateTimeUI::UpdateText()
+	{
+		if (m_nDTUpdateFlag == DT_DELETE) {
+			SetText(_T(""));
+		}
+		else if (m_nDTUpdateFlag == DT_UPDATE) {
+			CDuiString sText;
+			if(m_sTimeFormat.CompareNoCase(_T("yyyy-MM-dd")) == 0) {
+				sText.SmallFormat(_T("%4d-%02d-%02d"), m_sysTime.wYear, m_sysTime.wMonth, m_sysTime.wDay);
+			}
+			else if(m_sTimeFormat.CompareNoCase(_T("HH:mm:ss")) == 0) {
+				sText.SmallFormat(_T("%02d:%02d:%02d"),  m_sysTime.wHour, m_sysTime.wMinute, m_sysTime.wSecond);
+			}
+			else {
+				sText.SmallFormat(_T("%4d-%02d-%02d %02d:%02d:%02d"), m_sysTime.wYear, m_sysTime.wMonth, m_sysTime.wDay, m_sysTime.wHour, m_sysTime.wMinute, m_sysTime.wSecond);
+			}
+			SetText(sText);
+		}
+	}
+
+	void CDateTimeUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_WINDOWSIZE )
+		{
+			if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
+		}
+		if( event.Type == UIEVENT_SCROLLWHEEL )
+		{
+			if( m_pWindow != NULL ) return;
+		}
+		if( event.Type == UIEVENT_SETFOCUS && IsEnabled() ) 
+		{
+			if( m_pWindow ) return;
+			m_pWindow = new CDateTimeWnd();
+			ASSERT(m_pWindow);
+			m_pWindow->Init(this);
+			m_pWindow->ShowWindow();
+		}
+		if( event.Type == UIEVENT_KILLFOCUS && IsEnabled() ) 
+		{
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK || event.Type == UIEVENT_RBUTTONDOWN) 
+		{
+			if( IsEnabled() ) {
+				GetManager()->ReleaseCapture();
+				if( IsFocused() && m_pWindow == NULL )
+				{
+					m_pWindow = new CDateTimeWnd();
+					ASSERT(m_pWindow);
+				}
+				if( m_pWindow != NULL )
+				{
+					m_pWindow->Init(this);
+					m_pWindow->ShowWindow();
+				}
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEMOVE ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_BUTTONUP ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEENTER )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			return;
+		}
+
+		CLabelUI::DoEvent(event);
+	}
+
+	void CDateTimeUI::SetPos(RECT rc, bool bNeedInvalidate)
+	{
+		CControlUI::SetPos(rc, bNeedInvalidate);
+		if( m_pWindow != NULL ) {
+			RECT rcPos = m_pWindow->CalPos();
+			::SetWindowPos(m_pWindow->GetHWND(), NULL, rcPos.left, rcPos.top, rcPos.right - rcPos.left, 
+				rcPos.bottom - rcPos.top, SWP_NOZORDER | SWP_NOACTIVATE);        
+		}
+	}
+
+	void CDateTimeUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if(lstrcmpi(pstrName, _T("timeformat")) == 0) SetTimeFormat(pstrValue);
+		else if(lstrcmpi(pstrName, _T("readonly")) == 0) SetReadOny(lstrcmpi(pstrValue, _T("true")) == 0);
+		else return CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+}

+ 45 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIDateTime.h

@@ -0,0 +1,45 @@
+#ifndef __UIDATETIME_H__
+#define __UIDATETIME_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class CDateTimeWnd;
+
+	/// ʱ¼äÑ¡Ôñ¿Ø¼þ
+	class UILIB_API CDateTimeUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CDateTimeUI)
+		friend class CDateTimeWnd;
+
+	public:
+		CDateTimeUI();
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		SYSTEMTIME& GetTime();
+		void SetTime(SYSTEMTIME* pst);
+
+		void SetReadOny(bool bReadOnly);
+		bool IsReadOnly() const;
+
+		void SetTimeFormat(LPCTSTR pstrFormat = _T("yyyy-MM-dd HH:mm:ss"));
+		CDuiString GetTimeFormat() const;
+
+		void UpdateText();
+
+		void DoEvent(TEventUI& event);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+	protected:
+		SYSTEMTIME m_sysTime;
+		int m_nDTUpdateFlag;
+		bool m_bReadOnly;
+		CDuiString m_sTimeFormat;
+		CDateTimeWnd* m_pWindow;
+	};
+}
+#endif // __UIDATETIME_H__

+ 719 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIEdit.cpp

@@ -0,0 +1,719 @@
+#include "StdAfx.h"
+#include "UIEdit.h"
+
+namespace DuiLib
+{
+	class CEditWnd : public CWindowWnd
+	{
+	public:
+		CEditWnd();
+
+		void Init(CEditUI* pOwner);
+		RECT CalPos();
+
+		LPCTSTR GetWindowClassName() const;
+		LPCTSTR GetSuperClassName() const;
+		void OnFinalMessage(HWND hWnd);
+
+		LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+		LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+		LRESULT OnEditChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	protected:
+		enum { 
+			DEFAULT_TIMERID = 20,
+		};
+
+		CEditUI* m_pOwner;
+		HBRUSH m_hBkBrush;
+		bool m_bInit;
+		bool m_bDrawCaret;
+	};
+
+
+	CEditWnd::CEditWnd() : m_pOwner(NULL), m_hBkBrush(NULL), m_bInit(false), m_bDrawCaret(false)
+	{
+	}
+
+	void CEditWnd::Init(CEditUI* pOwner)
+	{
+		m_pOwner = pOwner;
+		RECT rcPos = CalPos();
+		UINT uStyle = 0;
+		if(m_pOwner->GetManager()->IsLayered()) {
+			uStyle = WS_POPUP | ES_AUTOHSCROLL | WS_VISIBLE;
+			RECT rcWnd={0};
+			::GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWnd);
+			rcPos.left += rcWnd.left;
+			rcPos.right += rcWnd.left;
+			rcPos.top += rcWnd.top - 1;
+			rcPos.bottom += rcWnd.top - 1;
+		}
+		else {
+			uStyle = WS_CHILD | ES_AUTOHSCROLL;
+		}
+		UINT uTextStyle = m_pOwner->GetTextStyle();
+		if(uTextStyle & DT_LEFT) uStyle |= ES_LEFT;
+		else if(uTextStyle & DT_CENTER) uStyle |= ES_CENTER;
+		else if(uTextStyle & DT_RIGHT) uStyle |= ES_RIGHT;
+		if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
+		Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
+		HFONT hFont=NULL;
+		int iFontIndex=m_pOwner->GetFont();
+		if (iFontIndex!=-1)
+			hFont = m_pOwner->GetManager()->GetFont(iFontIndex);
+		if (hFont == NULL)
+			hFont = m_pOwner->GetManager()->GetDefaultFontInfo()->hFont;
+
+		SetWindowFont(m_hWnd, hFont, TRUE);
+		Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
+		if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
+		Edit_SetText(m_hWnd, m_pOwner->GetText());
+		Edit_SetModify(m_hWnd, FALSE);
+		SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
+		Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
+		Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
+
+		//Styls
+		LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
+		styleValue |= pOwner->GetWindowStyls();
+		::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
+		//Styls
+		::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
+		::SetFocus(m_hWnd);
+		if (m_pOwner->IsAutoSelAll()) {
+			int nSize = GetWindowTextLength(m_hWnd);
+			if( nSize == 0 ) nSize = 1;
+			Edit_SetSel(m_hWnd, 0, nSize);
+		}
+		else {
+			int nSize = GetWindowTextLength(m_hWnd);
+			Edit_SetSel(m_hWnd, nSize, nSize);
+		}
+
+		m_bInit = true;
+	}
+
+	RECT CEditWnd::CalPos()
+	{
+		CDuiRect rcPos = m_pOwner->GetPos();
+		RECT rcInset = m_pOwner->GetTextPadding();
+		rcPos.left += rcInset.left;
+		rcPos.top += rcInset.top;
+		rcPos.right -= rcInset.right;
+		rcPos.bottom -= rcInset.bottom;
+		LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
+		if( lEditHeight < rcPos.GetHeight() ) {
+			rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
+			rcPos.bottom = rcPos.top + lEditHeight;
+		}
+
+		CControlUI* pParent = m_pOwner;
+		RECT rcParent;
+		while( pParent = pParent->GetParent() ) {
+			if( !pParent->IsVisible() ) {
+				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
+				break;
+			}
+			rcParent = pParent->GetClientPos();
+			if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
+				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
+				break;
+			}
+		}
+
+		return rcPos;
+	}
+
+	LPCTSTR CEditWnd::GetWindowClassName() const
+	{
+		return _T("EditWnd");
+	}
+
+	LPCTSTR CEditWnd::GetSuperClassName() const
+	{
+		return WC_EDIT;
+	}
+
+	void CEditWnd::OnFinalMessage(HWND hWnd)
+	{
+		m_pOwner->Invalidate();
+		// Clear reference and die
+		if( m_hBkBrush != NULL ) ::DeleteObject(m_hBkBrush);
+		if (m_pOwner->GetManager()->IsLayered()) {
+			m_pOwner->GetManager()->RemoveNativeWindow(hWnd);
+		}
+		m_pOwner->m_pWindow = NULL;
+		delete this;
+	}
+
+	LRESULT CEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		LRESULT lRes = 0;
+		BOOL bHandled = TRUE;
+		if( uMsg == WM_CREATE ) {
+			bHandled = FALSE;
+		}
+		else if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
+		else if( uMsg == OCM_COMMAND ) {
+			if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
+			else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
+				RECT rcClient;
+				::GetClientRect(m_hWnd, &rcClient);
+				::InvalidateRect(m_hWnd, &rcClient, FALSE);
+			}
+		}
+		else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ){
+			m_pOwner->GetManager()->SendNotify(m_pOwner, DUI_MSGTYPE_RETURN);
+		}
+		else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_TAB ){
+			if (m_pOwner->GetManager()->IsLayered()) {
+				m_pOwner->GetManager()->SetNextTabControl();
+			}
+		}
+		else if( uMsg == OCM__BASE + WM_CTLCOLOREDIT  || uMsg == OCM__BASE + WM_CTLCOLORSTATIC ) {
+			::SetBkMode((HDC)wParam, TRANSPARENT);
+			DWORD dwTextColor = m_pOwner->GetTextColor();
+			::SetTextColor((HDC)wParam, RGB(GetBValue(dwTextColor),GetGValue(dwTextColor),GetRValue(dwTextColor)));
+			DWORD clrColor = m_pOwner->GetNativeEditBkColor();
+			if (clrColor < 0xFF000000) {
+				if (m_hBkBrush != NULL) ::DeleteObject(m_hBkBrush);
+				RECT rcWnd = m_pOwner->GetManager()->GetNativeWindowRect(m_hWnd);
+				HBITMAP hBmpEditBk = CRenderEngine::GenerateBitmap(m_pOwner->GetManager(), rcWnd, m_pOwner, clrColor);
+				m_hBkBrush = ::CreatePatternBrush(hBmpEditBk);
+				::DeleteObject(hBmpEditBk);
+			}
+			else {
+				if (m_hBkBrush == NULL) {
+					m_hBkBrush = ::CreateSolidBrush(RGB(GetBValue(clrColor), GetGValue(clrColor), GetRValue(clrColor)));
+				}
+			}
+			return (LRESULT)m_hBkBrush;
+		}
+		else if( uMsg == WM_PAINT) {
+			bHandled = FALSE;
+		}
+		else if( uMsg == WM_PRINT ) {
+			bHandled = FALSE;
+		}
+		else if( uMsg == WM_TIMER ) {
+			if (wParam == CARET_TIMERID) {
+				m_bDrawCaret = !m_bDrawCaret;
+				RECT rcClient;
+				::GetClientRect(m_hWnd, &rcClient);
+				::InvalidateRect(m_hWnd, &rcClient, FALSE);
+				return 0;
+			}
+			bHandled = FALSE;
+		}
+		else bHandled = FALSE;
+
+		if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+		return lRes;
+	}
+
+	LRESULT CEditWnd::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		LRESULT lRes = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
+		PostMessage(WM_CLOSE);
+		return lRes;
+	}
+
+	LRESULT CEditWnd::OnEditChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
+	{
+		if( !m_bInit ) return 0;
+		if( m_pOwner == NULL ) return 0;
+		// Copy text back
+		int cchLen = ::GetWindowTextLength(m_hWnd) + 1;
+		LPTSTR pstr = static_cast<LPTSTR>(_alloca(cchLen * sizeof(TCHAR)));
+		ASSERT(pstr);
+		if( pstr == NULL ) return 0;
+		::GetWindowText(m_hWnd, pstr, cchLen);
+		m_pOwner->m_sText = pstr;
+		m_pOwner->GetManager()->SendNotify(m_pOwner, DUI_MSGTYPE_TEXTCHANGED);
+		if( m_pOwner->GetManager()->IsLayered() ) m_pOwner->Invalidate();
+		return 0;
+	}
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+	//
+	IMPLEMENT_DUICONTROL(CEditUI)
+
+		CEditUI::CEditUI() : m_pWindow(NULL), m_uMaxChar(255), m_bReadOnly(false), 
+		m_bPasswordMode(false), m_cPasswordChar(_T('*')), m_bAutoSelAll(false), m_uButtonState(0), 
+		m_dwEditbkColor(0xFFFFFFFF), m_dwEditTextColor(0x00000000), m_iWindowStyls(0),m_dwTipValueColor(0xFFBAC0C5)
+	{
+		SetTextPadding(CDuiRect(4, 3, 4, 3));
+		SetBkColor(0xFFFFFFFF);
+	}
+
+	LPCTSTR CEditUI::GetClass() const
+	{
+		return _T("EditUI");
+	}
+
+	LPVOID CEditUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_EDIT) == 0 ) return static_cast<CEditUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	UINT CEditUI::GetControlFlags() const
+	{
+		if( !IsEnabled() ) return CControlUI::GetControlFlags();
+
+		return UIFLAG_SETCURSOR | UIFLAG_TABSTOP;
+	}
+
+	void CEditUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_SETCURSOR && IsEnabled() )
+		{
+			::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM)));
+			return;
+		}
+		if( event.Type == UIEVENT_WINDOWSIZE )
+		{
+			if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
+		}
+		if( event.Type == UIEVENT_SCROLLWHEEL )
+		{
+			if( m_pWindow != NULL ) return;
+		}
+		if( event.Type == UIEVENT_SETFOCUS && IsEnabled() ) 
+		{
+			if( m_pWindow ) return;
+			m_pWindow = new CEditWnd();
+			ASSERT(m_pWindow);
+			m_pWindow->Init(this);
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_KILLFOCUS && IsEnabled() ) 
+		{
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK || event.Type == UIEVENT_RBUTTONDOWN) 
+		{
+			if( IsEnabled() ) {
+				GetManager()->ReleaseCapture();
+				if( IsFocused() && m_pWindow == NULL )
+				{
+					m_pWindow = new CEditWnd();
+					ASSERT(m_pWindow);
+					m_pWindow->Init(this);
+
+					if( PtInRect(&m_rcItem, event.ptMouse) )
+					{
+						int nSize = GetWindowTextLength(*m_pWindow);
+						if( nSize == 0 ) nSize = 1;
+						Edit_SetSel(*m_pWindow, 0, nSize);
+					}
+				}
+				else if( m_pWindow != NULL )
+				{
+					if (!m_bAutoSelAll) {
+						RECT rcTextPadding = GetTextPadding();
+						POINT pt = event.ptMouse;
+						pt.x -= m_rcItem.left + rcTextPadding.left;
+						pt.y -= m_rcItem.top + rcTextPadding.top;
+						Edit_SetSel(*m_pWindow, 0, 0);
+						::SendMessage(*m_pWindow, WM_LBUTTONDOWN, event.wParam, MAKELPARAM(pt.x, pt.y));
+					}
+				}
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEMOVE ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_BUTTONUP ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEENTER )
+		{
+			if( ::PtInRect(&m_rcItem, event.ptMouse ) ) {
+				if( IsEnabled() ) {
+					if( (m_uButtonState & UISTATE_HOT) == 0  ) {
+						m_uButtonState |= UISTATE_HOT;
+						Invalidate();
+					}
+				}
+			}
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState &= ~UISTATE_HOT;
+				Invalidate();
+			}
+			return;
+		}
+		CLabelUI::DoEvent(event);
+	}
+
+	void CEditUI::SetEnabled(bool bEnable)
+	{
+		CControlUI::SetEnabled(bEnable);
+		if( !IsEnabled() ) {
+			m_uButtonState = 0;
+		}
+	}
+
+	void CEditUI::SetText(LPCTSTR pstrText)
+	{
+		m_sText = pstrText;
+		if( m_pWindow != NULL ) Edit_SetText(*m_pWindow, m_sText);
+		Invalidate();
+	}
+
+	void CEditUI::SetMaxChar(UINT uMax)
+	{
+		m_uMaxChar = uMax;
+		if( m_pWindow != NULL ) Edit_LimitText(*m_pWindow, m_uMaxChar);
+	}
+
+	UINT CEditUI::GetMaxChar()
+	{
+		return m_uMaxChar;
+	}
+
+	void CEditUI::SetReadOnly(bool bReadOnly)
+	{
+		if( m_bReadOnly == bReadOnly ) return;
+
+		m_bReadOnly = bReadOnly;
+		if( m_pWindow != NULL ) Edit_SetReadOnly(*m_pWindow, m_bReadOnly);
+		Invalidate();
+	}
+
+	bool CEditUI::IsReadOnly() const
+	{
+		return m_bReadOnly;
+	}
+
+	void CEditUI::SetNumberOnly(bool bNumberOnly)
+	{
+		if( bNumberOnly )
+		{
+			m_iWindowStyls |= ES_NUMBER;
+		}
+		else
+		{
+			m_iWindowStyls &= ~ES_NUMBER;
+		}
+	}
+
+	bool CEditUI::IsNumberOnly() const
+	{
+		return (m_iWindowStyls & ES_NUMBER) ? true:false;
+	}
+
+	int CEditUI::GetWindowStyls() const 
+	{
+		return m_iWindowStyls;
+	}
+
+	void CEditUI::SetPasswordMode(bool bPasswordMode)
+	{
+		if( m_bPasswordMode == bPasswordMode ) return;
+		m_bPasswordMode = bPasswordMode;
+		Invalidate();
+		if( m_pWindow != NULL ) {
+			LONG styleValue = ::GetWindowLong(*m_pWindow, GWL_STYLE);
+			bPasswordMode ? styleValue |= ES_PASSWORD : styleValue &= ~ES_PASSWORD;
+			::SetWindowLong(*m_pWindow, GWL_STYLE, styleValue);
+		}
+	}
+
+	bool CEditUI::IsPasswordMode() const
+	{
+		return m_bPasswordMode;
+	}
+
+	void CEditUI::SetPasswordChar(TCHAR cPasswordChar)
+	{
+		if( m_cPasswordChar == cPasswordChar ) return;
+		m_cPasswordChar = cPasswordChar;
+		if( m_pWindow != NULL ) Edit_SetPasswordChar(*m_pWindow, m_cPasswordChar);
+		Invalidate();
+	}
+
+	TCHAR CEditUI::GetPasswordChar() const
+	{
+		return m_cPasswordChar;
+	}
+
+	LPCTSTR CEditUI::GetNormalImage()
+	{
+		return m_sNormalImage;
+	}
+
+	void CEditUI::SetNormalImage(LPCTSTR pStrImage)
+	{
+		m_sNormalImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CEditUI::GetHotImage()
+	{
+		return m_sHotImage;
+	}
+
+	void CEditUI::SetHotImage(LPCTSTR pStrImage)
+	{
+		m_sHotImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CEditUI::GetFocusedImage()
+	{
+		return m_sFocusedImage;
+	}
+
+	void CEditUI::SetFocusedImage(LPCTSTR pStrImage)
+	{
+		m_sFocusedImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CEditUI::GetDisabledImage()
+	{
+		return m_sDisabledImage;
+	}
+
+	void CEditUI::SetDisabledImage(LPCTSTR pStrImage)
+	{
+		m_sDisabledImage = pStrImage;
+		Invalidate();
+	}
+
+	void CEditUI::SetNativeEditBkColor(DWORD dwBkColor)
+	{
+		m_dwEditbkColor = dwBkColor;
+	}
+
+	DWORD CEditUI::GetNativeEditBkColor() const
+	{
+		return m_dwEditbkColor;
+	}
+
+	void CEditUI::SetNativeEditTextColor( LPCTSTR pStrColor )
+	{
+		if( *pStrColor == _T('#')) pStrColor = ::CharNext(pStrColor);
+		LPTSTR pstr = NULL;
+		DWORD clrColor = _tcstoul(pStrColor, &pstr, 16);
+
+		m_dwEditTextColor = clrColor;
+	}
+
+	DWORD CEditUI::GetNativeEditTextColor() const
+	{
+		return m_dwEditTextColor;
+	}
+
+	bool CEditUI::IsAutoSelAll()
+	{
+		return m_bAutoSelAll;
+	}
+
+	void CEditUI::SetAutoSelAll(bool bAutoSelAll)
+	{
+		m_bAutoSelAll = bAutoSelAll;
+	}
+
+	void CEditUI::SetSel(long nStartChar, long nEndChar)
+	{
+		if( m_pWindow != NULL ) Edit_SetSel(*m_pWindow, nStartChar,nEndChar);
+	}
+
+	void CEditUI::SetSelAll()
+	{
+		SetSel(0,-1);
+	}
+
+	void CEditUI::SetReplaceSel(LPCTSTR lpszReplace)
+	{
+		if( m_pWindow != NULL ) Edit_ReplaceSel(*m_pWindow, lpszReplace);
+	}
+
+	void CEditUI::SetTipValue( LPCTSTR pStrTipValue )
+	{
+		m_sTipValue	= pStrTipValue;
+	}
+
+	LPCTSTR CEditUI::GetTipValue()
+	{
+		if (!IsResourceText()) return m_sTipValue;
+		return CResourceManager::GetInstance()->GetText(m_sTipValue);
+	}
+
+	void CEditUI::SetTipValueColor( LPCTSTR pStrColor )
+	{
+		if( *pStrColor == _T('#')) pStrColor = ::CharNext(pStrColor);
+		LPTSTR pstr = NULL;
+		DWORD clrColor = _tcstoul(pStrColor, &pstr, 16);
+
+		m_dwTipValueColor = clrColor;
+	}
+
+	DWORD CEditUI::GetTipValueColor()
+	{
+		return m_dwTipValueColor;
+	}
+
+	HWND CEditUI::GetHWND()
+	{
+		if(m_pWindow != NULL) {
+			return m_pWindow->GetHWND();
+		}
+		return NULL;
+	}
+
+	void CEditUI::SetPos(RECT rc, bool bNeedInvalidate)
+	{
+		CControlUI::SetPos(rc, bNeedInvalidate);
+		if( m_pWindow != NULL ) {
+			RECT rcPos = m_pWindow->CalPos();
+			::SetWindowPos(m_pWindow->GetHWND(), NULL, rcPos.left, rcPos.top, rcPos.right - rcPos.left, 
+				rcPos.bottom - rcPos.top, SWP_NOZORDER | SWP_NOACTIVATE);        
+		}
+	}
+
+	void CEditUI::Move(SIZE szOffset, bool bNeedInvalidate)
+	{
+		CControlUI::Move(szOffset, bNeedInvalidate);
+		if( m_pWindow != NULL ) {
+			RECT rcPos = m_pWindow->CalPos();
+			::SetWindowPos(m_pWindow->GetHWND(), NULL, rcPos.left, rcPos.top, rcPos.right - rcPos.left, 
+				rcPos.bottom - rcPos.top, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);        
+		}
+	}
+
+	void CEditUI::SetVisible(bool bVisible)
+	{
+		CControlUI::SetVisible(bVisible);
+		if( !IsVisible() && m_pWindow != NULL ) m_pManager->SetFocus(NULL);
+	}
+
+	void CEditUI::SetInternVisible(bool bVisible)
+	{
+		if( !IsVisible() && m_pWindow != NULL ) m_pManager->SetFocus(NULL);
+	}
+
+	SIZE CEditUI::EstimateSize(SIZE szAvailable)
+	{
+		if( m_cxyFixed.cy == 0 ) return CDuiSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 6);
+		return CControlUI::EstimateSize(szAvailable);
+	}
+
+	void CEditUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("readonly")) == 0 ) SetReadOnly(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcsicmp(pstrName, _T("numberonly")) == 0 ) SetNumberOnly(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcscmp(pstrName, _T("autoselall")) == 0 ) SetAutoSelAll(_tcscmp(pstrValue, _T("true")) == 0);	
+		else if( _tcsicmp(pstrName, _T("password")) == 0 ) SetPasswordMode(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcsicmp(pstrName, _T("passwordchar")) == 0 ) SetPasswordChar(*pstrValue);
+		else if( _tcsicmp(pstrName, _T("maxchar")) == 0 ) SetMaxChar(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("tipvalue")) == 0 ) SetTipValue(pstrValue);
+		else if( _tcsicmp(pstrName, _T("tipvaluecolor")) == 0 ) SetTipValueColor(pstrValue);
+		else if( _tcsicmp(pstrName, _T("nativetextcolor")) == 0 ) SetNativeEditTextColor(pstrValue);
+		else if( _tcsicmp(pstrName, _T("nativebkcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetNativeEditBkColor(clrColor);
+		}
+		else CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CEditUI::PaintStatusImage(HDC hDC)
+	{
+		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+		else m_uButtonState &= ~ UISTATE_FOCUSED;
+		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+		else m_uButtonState &= ~ UISTATE_DISABLED;
+
+		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
+			if( !m_sDisabledImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
+			if( !m_sFocusedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if( !m_sHotImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) {}
+				else return;
+			}
+		}
+
+		if( !m_sNormalImage.IsEmpty() ) {
+			if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) {}
+			else return;
+		}
+	}
+
+	void CEditUI::PaintText(HDC hDC)
+	{
+		DWORD mCurTextColor = m_dwTextColor;
+
+		if( m_dwTextColor == 0 ) mCurTextColor = m_dwTextColor = m_pManager->GetDefaultFontColor();		
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+
+		CDuiString sDrawText = GetText();
+		CDuiString sTipValue = GetTipValue();
+		if(sDrawText == sTipValue || sDrawText == _T("")) {
+			mCurTextColor = m_dwTipValueColor;
+			sDrawText = sTipValue;
+		}
+		else {
+			CDuiString sTemp = sDrawText;
+			if( m_bPasswordMode ) {
+				sDrawText.Empty();
+				LPCTSTR pStr = sTemp.GetData();
+				while( *pStr != _T('\0') ) {
+					sDrawText += m_cPasswordChar;
+					pStr = ::CharNext(pStr);
+				}
+			}
+		}
+
+		RECT rcTextPadding = GetTextPadding();
+		RECT rc = m_rcItem;
+		rc.left += rcTextPadding.left;
+		rc.right -= rcTextPadding.right;
+		rc.top += rcTextPadding.top;
+		rc.bottom -= rcTextPadding.bottom;
+		if( IsEnabled() ) {
+			CRenderEngine::DrawText(hDC, m_pManager, rc, sDrawText, mCurTextColor, \
+				m_iFont, DT_SINGLELINE | m_uTextStyle);
+		}
+		else {
+			CRenderEngine::DrawText(hDC, m_pManager, rc, sDrawText, m_dwDisabledTextColor, \
+				m_iFont, DT_SINGLELINE | m_uTextStyle);
+		}
+	}
+}

+ 92 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIEdit.h

@@ -0,0 +1,92 @@
+#ifndef __UIEDIT_H__
+#define __UIEDIT_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class CEditWnd;
+
+	class UILIB_API CEditUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CEditUI)
+		friend class CEditWnd;
+	public:
+		CEditUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		void SetEnabled(bool bEnable = true);
+		void SetText(LPCTSTR pstrText);
+		void SetMaxChar(UINT uMax);
+		UINT GetMaxChar();
+		void SetReadOnly(bool bReadOnly);
+		bool IsReadOnly() const;
+		void SetPasswordMode(bool bPasswordMode);
+		bool IsPasswordMode() const;
+		void SetPasswordChar(TCHAR cPasswordChar);
+		TCHAR GetPasswordChar() const;
+		void SetNumberOnly(bool bNumberOnly);
+		bool IsNumberOnly() const;
+		int GetWindowStyls() const;
+
+		LPCTSTR GetNormalImage();
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage();
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage();
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetDisabledImage();
+		void SetDisabledImage(LPCTSTR pStrImage);
+		void SetNativeEditBkColor(DWORD dwBkColor);
+		DWORD GetNativeEditBkColor() const;
+		void SetNativeEditTextColor( LPCTSTR pStrColor );
+		DWORD GetNativeEditTextColor() const;
+
+		bool IsAutoSelAll();
+		void SetAutoSelAll(bool bAutoSelAll);
+		void SetSel(long nStartChar, long nEndChar);
+		void SetSelAll();
+		void SetReplaceSel(LPCTSTR lpszReplace);
+
+		void SetTipValue(LPCTSTR pStrTipValue);
+		LPCTSTR GetTipValue();
+		void SetTipValueColor(LPCTSTR pStrColor);
+		DWORD GetTipValueColor();
+
+		HWND GetHWND();
+
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void Move(SIZE szOffset, bool bNeedInvalidate = true);
+		void SetVisible(bool bVisible = true);
+		void SetInternVisible(bool bVisible = true);
+		SIZE EstimateSize(SIZE szAvailable);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintStatusImage(HDC hDC);
+		void PaintText(HDC hDC);
+
+	protected:
+		CEditWnd* m_pWindow;
+
+		UINT m_uMaxChar;
+		bool m_bReadOnly;
+		bool m_bPasswordMode;
+		bool m_bAutoSelAll;
+		TCHAR m_cPasswordChar;
+		UINT m_uButtonState;
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sDisabledImage;
+		CDuiString m_sTipValue;
+		DWORD m_dwTipValueColor;
+		DWORD m_dwEditbkColor;
+		DWORD m_dwEditTextColor;
+		int m_iWindowStyls;
+	};
+}
+#endif // __UIEDIT_H__

+ 133 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFadeButton.cpp

@@ -0,0 +1,133 @@
+#include "StdAfx.h"
+#include "UIFadeButton.h"
+
+namespace DuiLib {
+	IMPLEMENT_DUICONTROL(CFadeButtonUI)
+
+	CFadeButtonUI::CFadeButtonUI(): m_bMouseHove( FALSE ), m_bMouseLeave( FALSE )
+	{
+		Attach(this);
+	}
+
+	CFadeButtonUI::~CFadeButtonUI()
+	{
+		StopAnimation();
+	}
+
+	LPCTSTR CFadeButtonUI::GetClass() const
+	{
+		return _T("FadeButtonUI");
+	}
+
+	LPVOID CFadeButtonUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcscmp(pstrName, _T("FadeButton")) == 0 ) 
+			return static_cast<CFadeButtonUI*>(this);
+		return CButtonUI::GetInterface(pstrName);
+	}
+
+	void CFadeButtonUI::SetNormalImage(LPCTSTR pStrImage)
+	{
+		m_sNormalImage = pStrImage;
+		m_sLastImage = m_sNormalImage;
+	}
+
+	void CFadeButtonUI::DoEvent(TEventUI& event)
+	{
+		if( event.Type == UIEVENT_TIMER ) {
+			OnTimer(  event.wParam );
+		}
+		else if(IsEnabled()) {
+			if( event.Type == UIEVENT_MOUSEENTER && !IsAnimationRunning( FADE_IN_ID ) )
+			{
+				m_bFadeAlpha = 0;
+				m_bMouseHove = TRUE;
+				StopAnimation(FADE_OUT_ID);
+				StartAnimation(FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_IN_ID);
+				Invalidate();
+				return;
+			}
+			else if( event.Type == UIEVENT_MOUSELEAVE && !IsAnimationRunning( FADE_OUT_ID ) )
+			{
+				m_bFadeAlpha = 0;
+				m_bMouseLeave = TRUE;
+				StopAnimation(FADE_IN_ID);
+				StartAnimation(FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_OUT_ID);
+				Invalidate();
+				return;
+			}
+		}
+		CButtonUI::DoEvent( event );
+	}
+
+	void CFadeButtonUI::OnTimer( int nTimerID )
+	{
+		OnAnimationElapse( nTimerID );
+	}
+
+	void CFadeButtonUI::PaintStatusImage(HDC hDC)
+	{
+		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+		else m_uButtonState &= ~ UISTATE_FOCUSED;
+		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+		else m_uButtonState &= ~ UISTATE_DISABLED;
+
+		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
+			if( !m_sDisabledImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
+			if( !m_sPushedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
+			if( !m_sFocusedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) {}
+				else return;
+			}
+		}
+		if( !m_sNormalImage.IsEmpty() ) {
+			if( m_bMouseHove ) {
+				m_bMouseHove = FALSE;
+				m_sLastImage = m_sHotImage;
+			}
+
+			if( m_bMouseLeave ) {
+				m_bMouseLeave = FALSE;
+				m_sLastImage = m_sNormalImage;
+			}
+
+			if( IsAnimationRunning(FADE_IN_ID) || IsAnimationRunning(FADE_OUT_ID)) {
+				m_sOldImage = m_sNormalImage;
+				m_sNewImage = m_sHotImage;
+				if( IsAnimationRunning(FADE_OUT_ID) ) {
+					m_sOldImage = m_sHotImage;
+					m_sNewImage = m_sNormalImage;
+				}
+				CDuiString sFadeOut, sFadeIn;
+				sFadeOut.Format(_T("fade='%d'"), 255 - m_bFadeAlpha);
+				sFadeIn.Format(_T("fade='%d'"), m_bFadeAlpha);
+				if( !DrawImage(hDC, (LPCTSTR)m_sOldImage, sFadeOut) ) {}
+				if( !DrawImage(hDC, (LPCTSTR)m_sNewImage, sFadeIn) ) {}
+				return;
+			}
+			else {
+				if(m_sLastImage.IsEmpty()) m_sLastImage = m_sNormalImage;
+				if( !DrawImage(hDC, (LPCTSTR)m_sLastImage) ) {}
+				return;
+			}
+		}
+	}
+
+	void CFadeButtonUI::OnAnimationStep(INT nTotalFrame, INT nCurFrame, INT nAnimationID)
+	{
+		m_bFadeAlpha = (BYTE)((nCurFrame / (double)nTotalFrame) * 255);
+		m_bFadeAlpha = m_bFadeAlpha == 0 ? 10 : m_bFadeAlpha;
+		Invalidate();
+	}
+
+} // namespace DuiLib

+ 45 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFadeButton.h

@@ -0,0 +1,45 @@
+#ifndef __UIFADEBUTTON_H__
+#define __UIFADEBUTTON_H__
+
+#include "UIAnimation.h"
+#pragma once
+
+namespace DuiLib {
+
+	class UILIB_API CFadeButtonUI : public CButtonUI, public CUIAnimation
+	{
+		DECLARE_DUICONTROL(CFadeButtonUI)
+	public:
+		CFadeButtonUI();
+		virtual ~CFadeButtonUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		void SetNormalImage(LPCTSTR pStrImage);
+
+		void DoEvent(TEventUI& event);
+		void OnTimer( int nTimerID );
+		void PaintStatusImage(HDC hDC);
+
+		virtual void OnAnimationStart(INT nAnimationID, BOOL bFirstLoop) {}
+		virtual void OnAnimationStep(INT nTotalFrame, INT nCurFrame, INT nAnimationID);
+		virtual void OnAnimationStop(INT nAnimationID) {}
+		
+	protected:
+		CDuiString m_sOldImage;
+		CDuiString m_sNewImage;
+		CDuiString m_sLastImage;
+		BYTE       m_bFadeAlpha;
+		BOOL       m_bMouseHove;
+		BOOL       m_bMouseLeave;
+		enum{
+			FADE_IN_ID			= 8,
+			FADE_OUT_ID			= 9,
+			FADE_ELLAPSE		= 10,
+			FADE_FRAME_COUNT	= 30,
+		};
+	};
+
+} // namespace DuiLib
+
+#endif // __UIFADEBUTTON_H__

+ 270 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFlash.cpp

@@ -0,0 +1,270 @@
+#include "StdAfx.h"
+#include "UIFlash.h"
+#include <atlcomcli.h>
+
+#define DISPID_FLASHEVENT_FLASHCALL	 ( 0x00C5 )
+#define DISPID_FLASHEVENT_FSCOMMAND	 ( 0x0096 )
+#define DISPID_FLASHEVENT_ONPROGRESS	( 0x07A6 )
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CFlashUI)
+
+	CFlashUI::CFlashUI(void)
+		: m_dwRef(0)
+		, m_dwCookie(0)
+		, m_pFlash(NULL)
+		, m_pFlashEventHandler(NULL)
+	{
+		CDuiString strFlashCLSID=_T("{D27CDB6E-AE6D-11CF-96B8-444553540000}");
+		OLECHAR szCLSID[100] = { 0 };
+#ifndef _UNICODE
+		::MultiByteToWideChar(::GetACP(), 0, strFlashCLSID, -1, szCLSID, lengthof(szCLSID) - 1);
+#else
+		_tcsncpy(szCLSID, strFlashCLSID, lengthof(szCLSID) - 1);
+#endif
+		::CLSIDFromString(szCLSID, &m_clsid);
+	}
+
+	CFlashUI::~CFlashUI(void)
+	{
+		if (m_pFlashEventHandler)
+		{
+			m_pFlashEventHandler->Release();
+			m_pFlashEventHandler=NULL;
+		}
+		ReleaseControl();
+	}
+
+	LPCTSTR CFlashUI::GetClass() const
+	{
+		return _T("FlashUI");
+	}
+
+	LPVOID CFlashUI::GetInterface( LPCTSTR pstrName )
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_FLASH) == 0 ) return static_cast<CFlashUI*>(this);
+		return CActiveXUI::GetInterface(pstrName);
+	}
+
+	HRESULT STDMETHODCALLTYPE CFlashUI::GetTypeInfoCount( __RPC__out UINT *pctinfo )
+	{
+		return E_NOTIMPL;
+	}
+
+	HRESULT STDMETHODCALLTYPE CFlashUI::GetTypeInfo( UINT iTInfo, LCID lcid, __RPC__deref_out_opt ITypeInfo **ppTInfo )
+	{
+		return E_NOTIMPL;
+	}
+
+	HRESULT STDMETHODCALLTYPE CFlashUI::GetIDsOfNames( __RPC__in REFIID riid, __RPC__in_ecount_full(cNames ) LPOLESTR *rgszNames, UINT cNames, LCID lcid, __RPC__out_ecount_full(cNames) DISPID *rgDispId )
+	{
+		return E_NOTIMPL;
+	}
+
+	HRESULT STDMETHODCALLTYPE CFlashUI::Invoke( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr )
+	{
+
+		return S_OK;
+		switch(dispIdMember)
+		{
+		case DISPID_FLASHEVENT_FLASHCALL:
+			{
+				if (pDispParams->cArgs != 1 || pDispParams->rgvarg[0].vt != VT_BSTR) 
+					return E_INVALIDARG;
+				return this->FlashCall(pDispParams->rgvarg[0].bstrVal);
+			}
+		case DISPID_FLASHEVENT_FSCOMMAND:
+			{
+				if( pDispParams && pDispParams->cArgs == 2 )
+				{
+					if( pDispParams->rgvarg[0].vt == VT_BSTR &&
+						pDispParams->rgvarg[1].vt == VT_BSTR )
+					{
+						return FSCommand(pDispParams->rgvarg[1].bstrVal, pDispParams->rgvarg[0].bstrVal);
+					}
+					else
+					{
+						return DISP_E_TYPEMISMATCH;
+					}
+				}
+				else
+				{
+					return DISP_E_BADPARAMCOUNT;
+				}
+			}
+		case DISPID_FLASHEVENT_ONPROGRESS:
+			{
+				return OnProgress(*pDispParams->rgvarg[0].plVal);
+			}
+		case DISPID_READYSTATECHANGE:
+			{
+				return this->OnReadyStateChange(pDispParams->rgvarg[0].lVal);
+			}
+		}
+
+		return S_OK;
+	}
+
+	HRESULT STDMETHODCALLTYPE CFlashUI::QueryInterface( REFIID riid, void **ppvObject )
+	{
+		*ppvObject = NULL;
+
+		if( riid == IID_IUnknown)
+			*ppvObject = static_cast</*IOleWindow**/LPUNKNOWN>(this);
+		else if( riid == IID_IDispatch)
+			*ppvObject = static_cast<IDispatch*>(this);
+		else if( riid ==  __uuidof(_IShockwaveFlashEvents))
+			*ppvObject = static_cast<_IShockwaveFlashEvents*>(this);
+
+		if( *ppvObject != NULL )
+			AddRef();
+		return *ppvObject == NULL ? E_NOINTERFACE : S_OK;
+	}
+
+	ULONG STDMETHODCALLTYPE CFlashUI::AddRef( void )
+	{
+		::InterlockedIncrement(&m_dwRef); 
+		return m_dwRef;
+	}
+
+	ULONG STDMETHODCALLTYPE CFlashUI::Release( void )
+	{
+		::InterlockedDecrement(&m_dwRef);
+		return m_dwRef;
+	}
+
+	HRESULT CFlashUI::OnReadyStateChange (long newState)
+	{
+		if (m_pFlashEventHandler)
+		{
+			return m_pFlashEventHandler->OnReadyStateChange(newState);
+		}
+		return S_OK;
+	}
+
+	HRESULT CFlashUI::OnProgress(long percentDone )
+	{
+		if (m_pFlashEventHandler)
+		{
+			return m_pFlashEventHandler->OnProgress(percentDone);
+		}
+		return S_OK;
+	}
+
+	HRESULT CFlashUI::FSCommand (_bstr_t command, _bstr_t args)
+	{
+		if (m_pFlashEventHandler)
+		{
+			return m_pFlashEventHandler->FSCommand(command,args);
+		}
+		return S_OK;
+	}
+
+	HRESULT CFlashUI::FlashCall( _bstr_t request )
+	{
+		if (m_pFlashEventHandler)
+		{
+			return m_pFlashEventHandler->FlashCall(request);
+		}
+		return S_OK;
+	}
+
+	void CFlashUI::ReleaseControl()
+	{
+		//GetManager()->RemoveTranslateAccelerator(this);
+		RegisterEventHandler(FALSE);
+		if (m_pFlash)
+		{
+			m_pFlash->Release();
+			m_pFlash=NULL;
+		}
+	}
+
+	bool CFlashUI::DoCreateControl()
+	{
+		if (!CActiveXUI::DoCreateControl())
+			return false;
+		//GetManager()->AddTranslateAccelerator(this);
+		GetControl(__uuidof(IShockwaveFlash),(LPVOID*)&m_pFlash);
+		RegisterEventHandler(TRUE);
+		return true;
+	}
+
+	void CFlashUI::SetFlashEventHandler( CFlashEventHandler* pHandler )
+	{
+		if (m_pFlashEventHandler!=NULL)
+		{
+			m_pFlashEventHandler->Release();
+		}
+		if (pHandler==NULL)
+		{
+			m_pFlashEventHandler=pHandler;
+			return;
+		}
+		m_pFlashEventHandler=pHandler;
+		m_pFlashEventHandler->AddRef();
+	}
+
+	LRESULT CFlashUI::TranslateAccelerator( MSG *pMsg )
+	{
+		if(pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST)
+			return S_FALSE;
+
+		if( m_pFlash == NULL )
+			return E_NOTIMPL;
+
+		// 当前Web窗口不是焦点,不处理加速键
+		BOOL bIsChild = FALSE;
+		HWND hTempWnd = NULL;
+		HWND hWndFocus = ::GetFocus();
+
+		hTempWnd = hWndFocus;
+		while(hTempWnd != NULL)
+		{
+			if(hTempWnd == m_hwndHost)
+			{
+				bIsChild = TRUE;
+				break;
+			}
+			hTempWnd = ::GetParent(hTempWnd);
+		}
+		if(!bIsChild)
+			return S_FALSE;
+
+		CComPtr<IOleInPlaceActiveObject> pObj;
+		if (FAILED(m_pFlash->QueryInterface(IID_IOleInPlaceActiveObject, (LPVOID *)&pObj)))
+			return S_FALSE;
+
+		HRESULT hResult = pObj->TranslateAccelerator(pMsg);
+		return hResult;
+	}
+
+	HRESULT CFlashUI::RegisterEventHandler( BOOL inAdvise )
+	{
+		if (m_pFlash==NULL)
+			return S_FALSE;
+
+		HRESULT hr=S_FALSE;
+		CComPtr<IConnectionPointContainer>  pCPC;
+		CComPtr<IConnectionPoint> pCP;
+		
+		hr=m_pFlash->QueryInterface(IID_IConnectionPointContainer,(void **)&pCPC);
+		if (FAILED(hr))
+			return hr;
+		hr=pCPC->FindConnectionPoint(__uuidof(_IShockwaveFlashEvents),&pCP);
+		if (FAILED(hr))
+			return hr;
+
+		if (inAdvise)
+		{
+			hr = pCP->Advise((IDispatch*)this, &m_dwCookie);
+		}
+		else
+		{
+			hr = pCP->Unadvise(m_dwCookie);
+		}
+		return hr; 
+	}
+
+};

+ 65 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIFlash.h

@@ -0,0 +1,65 @@
+#ifndef __UIFLASH_H__
+#define __UIFLASH_H__
+#pragma once
+
+// \Utils\Flash11.tlb 为Flash11接口文件,部分方法在低版本不存在,使用需注意
+// #import "PROGID:ShockwaveFlash.ShockwaveFlash"  \
+//      raw_interfaces_only,       /* Don't add raw_ to method names */ \
+//  	named_guids,           /* Named guids and declspecs */    \
+//  	rename("IDispatchEx","IMyDispatchEx")	/* fix conflicting with IDispatchEx ant dispex.h */  
+// using namespace ShockwaveFlashObjects;
+#include "Utils/FlashEventHandler.h"
+#include "Utils/flash11.tlh"
+
+class CActiveXCtrl;
+
+namespace DuiLib
+{
+	class UILIB_API CFlashUI
+		: public CActiveXUI
+	//	, public IOleInPlaceSiteWindowless // 透明模式绘图,需要实现这个接口
+		, public _IShockwaveFlashEvents
+		, public ITranslateAccelerator
+	{
+		DECLARE_DUICONTROL(CFlashUI)
+	public:
+		CFlashUI(void);
+		~CFlashUI(void);
+
+		void SetFlashEventHandler(CFlashEventHandler* pHandler);
+		virtual bool DoCreateControl();
+		IShockwaveFlash* m_pFlash;
+
+	private:
+		virtual LPCTSTR GetClass() const;
+		virtual LPVOID GetInterface( LPCTSTR pstrName );
+
+		virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( __RPC__out UINT *pctinfo );
+		virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( UINT iTInfo, LCID lcid, __RPC__deref_out_opt ITypeInfo **ppTInfo );
+		virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( __RPC__in REFIID riid, __RPC__in_ecount_full(cNames ) LPOLESTR *rgszNames, UINT cNames, LCID lcid, __RPC__out_ecount_full(cNames) DISPID *rgDispId);
+		virtual HRESULT STDMETHODCALLTYPE Invoke( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr );
+
+		virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject );
+		virtual ULONG STDMETHODCALLTYPE AddRef( void );
+		virtual ULONG STDMETHODCALLTYPE Release( void );
+
+		HRESULT OnReadyStateChange (long newState);
+		HRESULT OnProgress(long percentDone );
+		HRESULT FSCommand (_bstr_t command, _bstr_t args);
+		HRESULT FlashCall (_bstr_t request );
+
+		virtual void ReleaseControl();
+		HRESULT RegisterEventHandler(BOOL inAdvise);
+
+		// ITranslateAccelerator
+		// Duilib消息分发给WebBrowser
+		virtual LRESULT TranslateAccelerator( MSG *pMsg );
+
+	private:
+		LONG m_dwRef;
+		DWORD m_dwCookie;
+		CFlashEventHandler* m_pFlashEventHandler;
+	};
+}
+
+#endif // __UIFLASH_H__

+ 232 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnim.cpp

@@ -0,0 +1,232 @@
+#include "StdAfx.h"
+#include "UIGifAnim.h"
+
+///////////////////////////////////////////////////////////////////////////////////////
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CGifAnimUI)
+
+	CGifAnimUI::CGifAnimUI(void)
+	{
+		m_pGifImage			=	NULL;
+		m_pPropertyItem		=	NULL;
+		m_nFrameCount		=	0;	
+		m_nFramePosition	=	0;	
+		m_bIsAutoPlay		=	true;
+		m_bIsAutoSize		=	false;
+		m_bIsPlaying		=	false;
+
+	}
+
+
+	CGifAnimUI::~CGifAnimUI(void)
+	{
+		DeleteGif();
+		m_pManager->KillTimer( this, EVENT_TIEM_ID );
+
+	}
+
+	LPCTSTR CGifAnimUI::GetClass() const
+	{
+		return _T("GifAnimUI");
+	}
+
+	LPVOID CGifAnimUI::GetInterface( LPCTSTR pstrName )
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_GIFANIM) == 0 ) return static_cast<CGifAnimUI*>(this);
+		return CControlUI::GetInterface(pstrName);
+	}
+
+	void CGifAnimUI::DoInit()
+	{
+		InitGifImage();
+	}
+
+	bool CGifAnimUI::DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl)
+	{
+		if( !::IntersectRect( &m_rcPaint, &rcPaint, &m_rcItem ) ) return true;
+		if ( NULL == m_pGifImage )
+		{		
+			InitGifImage();
+		}
+		DrawFrame( hDC );
+		return true;
+	}
+
+	void CGifAnimUI::DoEvent( TEventUI& event )
+	{
+		if( event.Type == UIEVENT_TIMER )
+			OnTimer( (UINT_PTR)event.wParam );
+	}
+
+	void CGifAnimUI::SetVisible(bool bVisible /* = true */)
+	{
+		CControlUI::SetVisible(bVisible);
+		if (bVisible)
+			PlayGif();
+		else
+			StopGif();
+	}
+
+	void CGifAnimUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("bkimage")) == 0 ) SetBkImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("autoplay")) == 0 ) {
+			SetAutoPlay(_tcsicmp(pstrValue, _T("true")) == 0);
+		}
+		else if( _tcsicmp(pstrName, _T("autosize")) == 0 ) {
+			SetAutoSize(_tcsicmp(pstrValue, _T("true")) == 0);
+		}
+		else
+			CControlUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CGifAnimUI::SetBkImage(LPCTSTR pStrImage)
+	{
+		if( m_sBkImage == pStrImage || NULL == pStrImage) return;
+
+		m_sBkImage = pStrImage;
+
+		StopGif();
+		DeleteGif();
+
+		Invalidate();
+
+	}
+
+	LPCTSTR CGifAnimUI::GetBkImage()
+	{
+		return m_sBkImage.GetData();
+	}
+
+	void CGifAnimUI::SetAutoPlay(bool bIsAuto)
+	{
+		m_bIsAutoPlay = bIsAuto;
+	}
+
+	bool CGifAnimUI::IsAutoPlay() const
+	{
+		return m_bIsAutoPlay;
+	}
+
+	void CGifAnimUI::SetAutoSize(bool bIsAuto)
+	{
+		m_bIsAutoSize = bIsAuto;
+	}
+
+	bool CGifAnimUI::IsAutoSize() const
+	{
+		return m_bIsAutoSize;
+	}
+
+	void CGifAnimUI::PlayGif()
+	{
+		if (m_bIsPlaying || m_pGifImage == NULL || m_nFrameCount <= 1)
+		{
+			return;
+		}
+
+		long lPause = ((long*) m_pPropertyItem->value)[m_nFramePosition] * 10;
+		if ( lPause == 0 ) lPause = 100;
+		m_pManager->SetTimer( this, EVENT_TIEM_ID, lPause );
+
+		m_bIsPlaying = true;
+	}
+
+	void CGifAnimUI::PauseGif()
+	{
+		if (!m_bIsPlaying || m_pGifImage == NULL)
+		{
+			return;
+		}
+
+		m_pManager->KillTimer(this, EVENT_TIEM_ID);
+		this->Invalidate();
+		m_bIsPlaying = false;
+	}
+
+	void CGifAnimUI::StopGif()
+	{
+		if (!m_bIsPlaying)
+		{
+			return;
+		}
+
+		m_pManager->KillTimer(this, EVENT_TIEM_ID);
+		m_nFramePosition = 0;
+		this->Invalidate();
+		m_bIsPlaying = false;
+	}
+
+	void CGifAnimUI::InitGifImage()
+	{
+		TImageInfo* pImageInfo = CRenderEngine::GdiplusLoadImage(GetBkImage());
+		if(pImageInfo == NULL) return;
+
+		m_pGifImage = pImageInfo->pImage;
+		if ( NULL == m_pGifImage ) return;
+		UINT nCount	= 0;
+		nCount	=	m_pGifImage->GetFrameDimensionsCount();
+		GUID* pDimensionIDs	=	new GUID[ nCount ];
+		m_pGifImage->GetFrameDimensionsList( pDimensionIDs, nCount );
+		m_nFrameCount	=	m_pGifImage->GetFrameCount( &pDimensionIDs[0] );
+		if (m_nFrameCount > 1)
+		{
+			int nSize = m_pGifImage->GetPropertyItemSize(PropertyTagFrameDelay);
+			m_pPropertyItem = (Gdiplus::PropertyItem*) malloc(nSize);
+			m_pGifImage->GetPropertyItem(PropertyTagFrameDelay, nSize, m_pPropertyItem);
+		}
+		delete[]  pDimensionIDs;
+		pDimensionIDs = NULL;
+
+		if (m_bIsAutoSize)
+		{
+			SetFixedWidth(m_pGifImage->GetWidth());
+			SetFixedHeight(m_pGifImage->GetHeight());
+		}
+		if (m_bIsAutoPlay)
+		{
+			PlayGif();
+		}
+	}
+
+	void CGifAnimUI::DeleteGif()
+	{
+		if ( m_pGifImage != NULL )
+		{
+			delete m_pGifImage;
+			m_pGifImage = NULL;
+		}
+
+		if ( m_pPropertyItem != NULL )
+		{
+			free( m_pPropertyItem );
+			m_pPropertyItem = NULL;
+		}
+		m_nFrameCount		=	0;	
+		m_nFramePosition	=	0;	
+	}
+
+	void CGifAnimUI::OnTimer( UINT_PTR idEvent )
+	{
+		if ( idEvent != EVENT_TIEM_ID )
+			return;
+		m_pManager->KillTimer( this, EVENT_TIEM_ID );
+		this->Invalidate();
+
+		m_nFramePosition = (++m_nFramePosition) % m_nFrameCount;
+
+		long lPause = ((long*) m_pPropertyItem->value)[m_nFramePosition] * 10;
+		if ( lPause == 0 ) lPause = 100;
+		m_pManager->SetTimer( this, EVENT_TIEM_ID, lPause );
+	}
+
+	void CGifAnimUI::DrawFrame( HDC hDC )
+	{
+		if ( NULL == hDC || NULL == m_pGifImage ) return;
+		GUID pageGuid = Gdiplus::FrameDimensionTime;
+		Gdiplus::Graphics graphics( hDC );
+		graphics.DrawImage( m_pGifImage, m_rcItem.left, m_rcItem.top, m_rcItem.right-m_rcItem.left, m_rcItem.bottom-m_rcItem.top );
+		m_pGifImage->SelectActiveFrame( &pageGuid, m_nFramePosition );
+	}
+}

+ 56 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnim.h

@@ -0,0 +1,56 @@
+#ifndef GifAnimUI_h__
+#define GifAnimUI_h__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CGifAnimUI : public CControlUI
+	{
+		enum
+		{ 
+			EVENT_TIEM_ID = 100,
+		};
+		DECLARE_DUICONTROL(CGifAnimUI)
+	public:
+		CGifAnimUI(void);
+		~CGifAnimUI(void);
+
+		LPCTSTR	GetClass() const;
+		LPVOID	GetInterface(LPCTSTR pstrName);
+		void	DoInit();
+		bool	DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+		void	DoEvent(TEventUI& event);
+		void	SetVisible(bool bVisible = true );
+		void	SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		void	SetBkImage(LPCTSTR pStrImage);
+		LPCTSTR GetBkImage();
+
+		void	SetAutoPlay(bool bIsAuto = true );
+		bool	IsAutoPlay() const;
+		void	SetAutoSize(bool bIsAuto = true );
+		bool	IsAutoSize() const;
+		void	PlayGif();
+		void	PauseGif();
+		void	StopGif();
+
+	private:
+		void	InitGifImage();
+		void	DeleteGif();
+		void    OnTimer( UINT_PTR idEvent );
+		void	DrawFrame( HDC hDC );		// 绘制GIF每帧
+
+	private:
+		Gdiplus::Image	*m_pGifImage;
+		UINT			m_nFrameCount;				// gif图片总帧数
+		UINT			m_nFramePosition;			// 当前放到第几帧
+		Gdiplus::PropertyItem*	m_pPropertyItem;	// 帧与帧之间间隔时间
+
+		CDuiString		m_sBkImage;
+		bool			m_bIsAutoPlay;				// 是否自动播放gif
+		bool			m_bIsAutoSize;				// 是否自动根据图片设置大小
+		bool			m_bIsPlaying;
+	};
+}
+
+#endif // GifAnimUI_h__

+ 193 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnimEx.cpp

@@ -0,0 +1,193 @@
+#include "StdAfx.h"
+#ifdef USE_XIMAGE_EFFECT
+#include "UIGifAnimEx.h"
+#include "../../3rd/CxImage/ximage.h"
+//
+namespace DuiLib
+{
+	#define GIFANIMUIEX_EVENT_TIEM_ID	100
+	IMPLEMENT_DUICONTROL(CGifAnimExUI)
+	struct CGifAnimExUI::Imp
+	{
+		bool				m_bRealStop			;//外部停止了
+		bool				m_bLoadImg			;//是否加载过图片
+		bool				m_bTimer			;//是否启动定时器
+		bool				m_bAutoStart		;//是否自动开始
+		int					m_nDelay			;//循环毫秒数
+		UINT				m_nFrameCount		;//gif图片总帧数
+		UINT				m_nFramePosition	;//当前放到第几帧
+		CxImage*			m_pGifImage			;//gif对象
+		CPaintManagerUI*&	m_pManager			;
+		CGifAnimExUI*			m_pOwer				;//拥有者
+		Imp(CPaintManagerUI* & pManager):m_pManager(pManager),
+			m_bLoadImg(false),m_bTimer(false),
+			m_nDelay(100),m_pGifImage(NULL),m_nFrameCount(0U),
+			m_nFramePosition(0U),
+			m_pOwer(NULL),m_bRealStop(false),m_bAutoStart(true)
+		{
+		}
+		void SetOwer(CGifAnimExUI *pOwer)
+		{
+			m_pOwer = pOwer;
+		}
+		~Imp()
+		{
+			if ( m_pGifImage != NULL )
+			{
+				delete m_pGifImage;
+				m_pGifImage = NULL;
+			}
+		}
+		inline void CheckLoadImage()
+			{
+			if(!m_bLoadImg)
+				LoadGifImage();
+		}
+		inline bool IsLoadImage(){return m_bLoadImg;}
+		virtual void LoadGifImage()
+		{
+			CDuiString sImag = m_pOwer->GetBkImage();
+			m_bLoadImg = true;
+			m_pGifImage	=	CRenderEngine::LoadGifImageX(STRINGorID(sImag),0, 0);
+			if ( NULL == m_pGifImage ) return;
+			m_nFrameCount	=	m_pGifImage->GetNumFrames();
+			m_nFramePosition = 0;
+			m_nDelay = m_pGifImage->GetFrameDelay();
+			if (m_nDelay <= 0 ) 
+				m_nDelay = 100;
+			if(!m_bAutoStart)
+				m_bRealStop = true;
+			if(m_bAutoStart && m_pOwer->IsVisible())
+				StartAnim();
+		}
+		void SetAutoStart(bool bAuto)
+		{
+			m_bAutoStart = bAuto;
+		}
+		void StartAnim()
+		{
+			if(!m_bTimer)
+			{
+				if(!IsLoadImage())
+				{
+					LoadGifImage();
+					m_pOwer->Invalidate();
+				}
+				if(m_pGifImage)
+				m_pManager->SetTimer( m_pOwer, GIFANIMUIEX_EVENT_TIEM_ID, m_nDelay );
+				m_bTimer = true;
+			}
+		}
+		void StopAnim(bool bGoFirstFrame)//bGoFirstFrame 是否跑到第一帧
+		{
+			if(m_bTimer)
+			{
+				if(bGoFirstFrame)
+				{
+					m_nFramePosition = 0U;
+					m_pOwer->Invalidate();
+				}
+				m_pManager->KillTimer( m_pOwer, GIFANIMUIEX_EVENT_TIEM_ID );
+				m_bTimer = false;
+			}
+		}
+		void EventOnTimer(const WPARAM idEvent )
+		{
+			if ( idEvent != GIFANIMUIEX_EVENT_TIEM_ID )
+				return;
+			++m_nFramePosition;
+			if(m_nFramePosition >= m_nFrameCount)
+				m_nFramePosition = 0;
+			if(!m_pOwer->IsVisible())return;
+			m_pOwer->Invalidate();
+		}
+		void DrawFrame( HDC hDC,const RECT& rcPaint,const RECT &rcItem)
+		{
+			if ( NULL == hDC || NULL == m_pGifImage ) return;
+			if(m_pGifImage)
+			{
+				if (CxImage* pImage = m_pGifImage->GetFrame(m_nFramePosition))
+					pImage->Draw2(hDC,rcItem);
+			}
+		}
+		void EventSetVisible(bool bVisible)
+		{
+			if(bVisible)
+			{
+				if(!m_bRealStop)
+					StartAnim();
+			}
+			else
+				StopAnim(true);
+		}
+	};
+	CGifAnimExUI::CGifAnimExUI(void):m_pImp(new CGifAnimExUI::Imp(m_pManager))
+	{
+		this;
+		m_pImp->SetOwer(this);
+	}
+	CGifAnimExUI::~CGifAnimExUI(void)
+	{
+		m_pImp->StopAnim(false);
+		delete m_pImp;
+		m_pImp = nullptr;
+	}
+	LPCTSTR CGifAnimExUI::GetClass() const
+	{
+		return _T("GifAnimUI");
+	}
+	LPVOID CGifAnimExUI::GetInterface( LPCTSTR pstrName )
+	{
+			if( _tcscmp(pstrName, _T("GifAnim")) == 0 ) 
+				return static_cast<CGifAnimExUI*>(this);
+			return CLabelUI::GetInterface(pstrName);
+	}
+	void CGifAnimExUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcscmp(pstrName, _T("auto")) == 0 ) 
+			m_pImp->SetAutoStart(_tcscmp(pstrValue, _T("true")) == 0);
+		else
+			__super::SetAttribute(pstrName, pstrValue);
+	}
+	void CGifAnimExUI::Init()
+	{
+		__super::Init();
+		m_pImp->CheckLoadImage();
+	}
+	void CGifAnimExUI::SetVisible(bool bVisible /*= true*/)
+	{
+		__super::SetVisible(bVisible);
+		m_pImp->EventSetVisible(bVisible);
+	}
+	void CGifAnimExUI::SetInternVisible(bool bVisible/* = true*/)
+	{
+		__super::SetInternVisible(bVisible);
+		m_pImp->EventSetVisible(bVisible);
+	}
+
+	bool CGifAnimExUI::DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl)
+	{
+		if( !::IntersectRect( &m_rcPaint, &rcPaint, &m_rcItem ) ) return true;
+		m_pImp->DrawFrame( hDC,rcPaint,m_rcItem);
+
+		return true;
+	}
+	void CGifAnimExUI::DoEvent( TEventUI& event )
+	{
+		this;
+		WPARAM nID = event.wParam;
+		if( event.Type == UIEVENT_TIMER )
+			m_pImp->EventOnTimer(nID);
+	}
+	void CGifAnimExUI::StartAnim()
+	{
+		m_pImp->m_bRealStop = false;
+		m_pImp->StartAnim();
+	}
+	void CGifAnimExUI::StopAnim()
+	{
+		m_pImp->m_bRealStop = true;
+		m_pImp->StopAnim(true);
+	}
+}
+#endif//USE_XIMAGE_EFFECT

+ 39 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGifAnimEx.h

@@ -0,0 +1,39 @@
+#ifndef GifAnimUIEX_h__
+#define GifAnimUIEX_h__
+#pragma once
+/* write by wangji 2016.03.16
+** 解决多个gif控件在gdi+环境下占用CPU过高的问题,本类采用ximage替代
+** 注意:使用的时候在预编译头文件中包含UIlib.h前先定义宏USE_XIMAGE_EFFECT
+** #define USE_XIMAGE_EFFECT
+** #include "UIlib.h"
+*/
+#ifdef USE_XIMAGE_EFFECT
+namespace DuiLib
+{
+	class CLabelUI;
+
+	class UILIB_API CGifAnimExUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CGifAnimExUI)
+	public:
+		CGifAnimExUI(void);
+		~CGifAnimExUI(void);
+	public:
+		virtual LPCTSTR	GetClass() const;
+		virtual LPVOID	GetInterface(LPCTSTR pstrName);
+		virtual void Init();
+		virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		virtual void SetVisible(bool bVisible = true);
+		virtual void SetInternVisible(bool bVisible = true);
+		virtual bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+		virtual void DoEvent(TEventUI& event);
+	public:
+		void StartAnim();
+		void StopAnim();
+	protected:
+		struct Imp;
+		Imp* m_pImp;
+	};
+}
+#endif //USE_XIMAGE_EFFECT
+#endif // GifAnimUIEx_h__

+ 160 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGroupBox.cpp

@@ -0,0 +1,160 @@
+#include "StdAfx.h"
+#include "UIGroupBox.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CGroupBoxUI)
+
+	//////////////////////////////////////////////////////////////////////////
+	//
+	CGroupBoxUI::CGroupBoxUI(): m_uTextStyle(DT_SINGLELINE | DT_VCENTER | DT_CENTER), m_dwTextColor(0), 
+		m_dwDisabledTextColor(0), m_iFont(-1)
+	{
+		SetInset(CDuiRect(20, 25, 20, 20));
+	}
+
+	CGroupBoxUI::~CGroupBoxUI()
+	{
+	}
+
+	LPCTSTR CGroupBoxUI::GetClass() const
+	{
+		return _T("GroupBoxUI");
+	}
+
+	LPVOID CGroupBoxUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, _T("GroupBox")) == 0 ) return static_cast<CGroupBoxUI*>(this);
+		return CVerticalLayoutUI::GetInterface(pstrName);
+	}
+	void CGroupBoxUI::SetTextColor(DWORD dwTextColor)
+	{
+		m_dwTextColor = dwTextColor;
+		Invalidate();
+	}
+
+	DWORD CGroupBoxUI::GetTextColor() const
+	{
+		return m_dwTextColor;
+	}
+	void CGroupBoxUI::SetDisabledTextColor(DWORD dwTextColor)
+	{
+		m_dwDisabledTextColor = dwTextColor;
+		Invalidate();
+	}
+
+	DWORD CGroupBoxUI::GetDisabledTextColor() const
+	{
+		return m_dwDisabledTextColor;
+	}
+	void CGroupBoxUI::SetFont(int index)
+	{
+		m_iFont = index;
+		Invalidate();
+	}
+
+	int CGroupBoxUI::GetFont() const
+	{
+		return m_iFont;
+	}
+	void CGroupBoxUI::PaintText(HDC hDC)
+	{
+		CDuiString sText = GetText();
+		if( sText.IsEmpty() ) {
+			return;
+		}
+
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+		if( sText.IsEmpty() ) return;
+
+		CDuiRect rcText = m_rcItem;
+		rcText.Deflate(5,5);
+		SIZE szAvailable = { rcText.right - rcText.left, rcText.bottom - rcText.top };
+		SIZE sz = CalcrectSize(szAvailable);
+
+		//计算文字区域
+		rcText.left = rcText.left + 15;
+		rcText.top = rcText.top - 5;
+		rcText.right = rcText.left + sz.cx;
+		rcText.bottom = rcText.top + sz.cy;
+
+		DWORD dwTextColor = m_dwTextColor;
+		if(!IsEnabled()) dwTextColor = m_dwDisabledTextColor;
+		CRenderEngine::DrawText(hDC, m_pManager, rcText, sText, dwTextColor, m_iFont, m_uTextStyle, GetAdjustColor(m_dwBackColor));
+	}
+	void CGroupBoxUI::PaintBorder(HDC hDC)
+	{
+		int nBorderSize;
+		SIZE cxyBorderRound;
+		RECT rcBorderSize;
+		if (m_pManager) {
+			nBorderSize = GetManager()->GetDPIObj()->Scale(m_nBorderSize);
+			cxyBorderRound = GetManager()->GetDPIObj()->Scale(m_cxyBorderRound);
+			rcBorderSize = GetManager()->GetDPIObj()->Scale(m_rcBorderSize);
+		}
+		else {
+			nBorderSize = m_nBorderSize;
+			cxyBorderRound = m_cxyBorderRound;
+			rcBorderSize = m_rcBorderSize;
+		}
+
+		if( nBorderSize > 0 )
+		{
+			CDuiRect rcItem = m_rcItem;
+			rcItem.Deflate(5, 5);
+			
+			if( cxyBorderRound.cx > 0 || cxyBorderRound.cy > 0 )//画圆角边框
+			{
+				if (IsFocused() && m_dwFocusBorderColor != 0)
+					CRenderEngine::DrawRoundRect(hDC, rcItem, nBorderSize, cxyBorderRound.cx, cxyBorderRound.cy, GetAdjustColor(m_dwFocusBorderColor));
+				else
+					CRenderEngine::DrawRoundRect(hDC, rcItem, nBorderSize, cxyBorderRound.cx, cxyBorderRound.cy, GetAdjustColor(m_dwBorderColor));
+			}
+			else
+			{
+				if (IsFocused() && m_dwFocusBorderColor != 0)
+					CRenderEngine::DrawRect(hDC, rcItem, nBorderSize, GetAdjustColor(m_dwFocusBorderColor));
+				else
+					CRenderEngine::DrawRect(hDC, rcItem, nBorderSize, GetAdjustColor(m_dwBorderColor));
+			}
+		}
+
+		PaintText(hDC);
+	}
+
+	SIZE CGroupBoxUI::CalcrectSize(SIZE szAvailable)
+	{
+		SIZE cxyFixed = GetFixedXY();
+		RECT rcText = { 0, 0, MAX(szAvailable.cx, cxyFixed.cx), 20 };
+		
+		CDuiString sText = GetText();
+
+		CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, m_dwTextColor, m_iFont, DT_CALCRECT | m_uTextStyle);
+		SIZE cXY = {rcText.right - rcText.left, rcText.bottom - rcText.top};
+		return cXY;
+	}
+	void CGroupBoxUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("textcolor")) == 0 ) 
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("disabledtextcolor")) == 0 ) 
+		{
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetDisabledTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("font")) == 0 ) 
+		{
+			SetFont(_ttoi(pstrValue));
+		}
+
+		CVerticalLayoutUI::SetAttribute(pstrName, pstrValue);
+	}
+}

+ 40 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIGroupBox.h

@@ -0,0 +1,40 @@
+#ifndef __UIGROUPBOX_H__
+#define __UIGROUPBOX_H__
+
+#pragma once
+
+namespace DuiLib
+{
+
+	class UILIB_API CGroupBoxUI : public CVerticalLayoutUI
+	{
+		DECLARE_DUICONTROL(CGroupBoxUI)
+	public:
+		CGroupBoxUI();
+		~CGroupBoxUI();
+		 LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		void SetTextColor(DWORD dwTextColor);
+		DWORD GetTextColor() const;
+		void SetDisabledTextColor(DWORD dwTextColor);
+		DWORD GetDisabledTextColor() const;
+		void SetFont(int index);
+		int GetFont() const;
+
+	protected:	
+		//Paint
+		virtual void PaintText(HDC hDC);
+		virtual void PaintBorder(HDC hDC);
+		virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+	private:
+		SIZE CalcrectSize(SIZE szAvailable);
+
+	protected:
+		DWORD m_dwTextColor;
+		DWORD m_dwDisabledTextColor;
+		int m_iFont;
+		UINT m_uTextStyle;
+	};
+}
+#endif // __UIGROUPBOX_H__

+ 523 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIHotKey.cpp

@@ -0,0 +1,523 @@
+#include "stdafx.h"
+#include "UIHotKey.h"
+namespace DuiLib{
+	CHotKeyWnd::CHotKeyWnd(void) : m_pOwner(NULL), m_hBkBrush(NULL), m_bInit(false)
+	{
+	}
+	void CHotKeyWnd::Init(CHotKeyUI * pOwner)
+	{
+		m_pOwner = pOwner;
+		do  {
+			if (NULL == m_pOwner) {
+				break;
+			}
+			RECT rcPos = CalPos();
+			UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
+			HWND hWnd = Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
+			if (!IsWindow(hWnd)) {
+				break;
+			}
+			SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
+			SetHotKey(m_pOwner->m_wVirtualKeyCode, m_pOwner->m_wModifiers);
+			m_pOwner->m_sText = GetHotKeyName();
+			::EnableWindow(m_hWnd, m_pOwner->IsEnabled() == true);
+			::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
+			::SetFocus(m_hWnd);
+			m_bInit = true;   
+		} while (0); 
+	}
+
+
+	RECT CHotKeyWnd::CalPos()
+	{
+		CDuiRect rcPos = m_pOwner->GetPos();
+		RECT rcInset = m_pOwner->GetTextPadding();
+		rcPos.left += rcInset.left;
+		rcPos.top += rcInset.top;
+		rcPos.right -= rcInset.right;
+		rcPos.bottom -= rcInset.bottom;
+		LONG lHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
+		if( lHeight < rcPos.GetHeight() ) {
+			rcPos.top += (rcPos.GetHeight() - lHeight) / 2;
+			rcPos.bottom = rcPos.top + lHeight;
+		}
+		return rcPos;
+	}
+
+
+	LPCTSTR CHotKeyWnd::GetWindowClassName() const
+	{
+		return _T("HotKeyClass");
+	}
+
+	void CHotKeyWnd::OnFinalMessage(HWND /*hWnd*/)
+	{
+		// Clear reference and die
+		if( m_hBkBrush != NULL ) ::DeleteObject(m_hBkBrush);
+		m_pOwner->m_pWindow = NULL;
+		delete this;
+	}
+
+	LRESULT CHotKeyWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		LRESULT lRes = 0;
+		BOOL bHandled = TRUE;
+		if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
+		else if( uMsg == OCM_COMMAND ) {
+			if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
+			else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
+				RECT rcClient;
+				::GetClientRect(m_hWnd, &rcClient);
+				::InvalidateRect(m_hWnd, &rcClient, FALSE);
+			}
+		}
+		else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ) {
+			m_pOwner->GetManager()->SendNotify(m_pOwner, _T("return"));
+		}
+		else if ( (uMsg == WM_NCACTIVATE) || (uMsg == WM_NCACTIVATE) || (uMsg == WM_NCCALCSIZE) )
+		{
+			return 0;
+		}
+		else if (uMsg == WM_PAINT)
+		{
+			PAINTSTRUCT ps = { 0 };
+			HDC hDC = ::BeginPaint(m_hWnd, &ps);
+			DWORD dwTextColor = m_pOwner->GetTextColor();
+			DWORD dwBkColor = m_pOwner->GetNativeBkColor();
+			CDuiString strText = GetHotKeyName();
+			::RECT rect;
+			::GetClientRect(m_hWnd, &rect);
+			::SetBkMode(hDC, TRANSPARENT);
+			::SetTextColor(hDC, RGB(GetBValue(dwTextColor), GetGValue(dwTextColor), GetRValue(dwTextColor)));
+			HBRUSH hBrush =  CreateSolidBrush( RGB(GetBValue(dwBkColor), GetGValue(dwBkColor), GetRValue(dwBkColor)) );
+			::FillRect(hDC, &rect, hBrush);
+			::DeleteObject(hBrush);
+			HFONT hOldFont = (HFONT)SelectObject(hDC, GetWindowFont(m_hWnd));
+			::SIZE size = { 0 };
+			::GetTextExtentPoint32(hDC, strText.GetData(), strText.GetLength(), &size) ;
+			::DrawText(hDC, strText.GetData(), -1, &rect, DT_LEFT|DT_SINGLELINE|DT_END_ELLIPSIS|DT_NOPREFIX);
+			::SelectObject(hDC, hOldFont);
+			::SetCaretPos(size.cx, 0);
+			::EndPaint(m_hWnd, &ps);
+			bHandled = TRUE;
+		}
+		else bHandled = FALSE;
+		if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+		return lRes;
+	}
+
+
+	LPCTSTR CHotKeyWnd::GetSuperClassName() const
+	{
+		return HOTKEY_CLASS;
+	}
+
+
+	LRESULT CHotKeyWnd::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		LRESULT lRes = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
+		::SendMessage(m_hWnd, WM_CLOSE, 0, 0);
+		return lRes;
+	}
+
+
+	LRESULT CHotKeyWnd::OnEditChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if( !m_bInit ) return 0;
+		if( m_pOwner == NULL ) return 0;
+		GetHotKey(m_pOwner->m_wVirtualKeyCode, m_pOwner->m_wModifiers);
+		if (m_pOwner->m_wVirtualKeyCode == 0) {
+			m_pOwner->m_sText = _T("ÎÞ");
+			m_pOwner->m_wModifiers = 0;
+		}
+		else {
+			m_pOwner->m_sText = GetHotKeyName();
+		}
+		m_pOwner->GetManager()->SendNotify(m_pOwner, _T("textchanged"));
+		return 0;
+	}
+
+
+	void CHotKeyWnd::SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
+	{
+		ASSERT(::IsWindow(m_hWnd));  
+		::SendMessage(m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L);
+	}
+
+	DWORD CHotKeyWnd::GetHotKey() const
+	{
+		ASSERT(::IsWindow(m_hWnd));
+		return (::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L));
+	}
+
+	void CHotKeyWnd::GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const
+	{
+		DWORD dw = GetHotKey();
+		wVirtualKeyCode = LOBYTE(LOWORD(dw));
+		wModifiers = HIBYTE(LOWORD(dw));
+	}
+
+	void CHotKeyWnd::SetRules(WORD wInvalidComb, WORD wModifiers)
+	{ 
+		ASSERT(::IsWindow(m_hWnd));  
+		::SendMessage(m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0)); 
+	}
+
+
+	CDuiString CHotKeyWnd::GetKeyName(UINT vk, BOOL fExtended)
+	{
+		UINT nScanCode = ::MapVirtualKeyEx( vk, 0, ::GetKeyboardLayout( 0 ) );
+		switch( vk )
+		{
+			// Keys which are "extended" (except for Return which is Numeric Enter as extended)
+		case VK_INSERT:
+		case VK_DELETE:
+		case VK_HOME:
+		case VK_END:
+		case VK_NEXT: // Page down
+		case VK_PRIOR: // Page up
+		case VK_LEFT:
+		case VK_RIGHT:
+		case VK_UP:
+		case VK_DOWN:
+			nScanCode |= 0x100; // Add extended bit
+		}
+		if (fExtended)
+			nScanCode |= 0x01000000L;
+
+		TCHAR szStr[ MAX_PATH ] = {0};
+		::GetKeyNameText( nScanCode << 16, szStr, MAX_PATH );
+
+		return CDuiString(szStr);
+	}
+
+
+	CDuiString CHotKeyWnd::GetHotKeyName()
+	{
+		ASSERT(::IsWindow(m_hWnd));
+
+		CDuiString strKeyName;
+		WORD wCode = 0;
+		WORD wModifiers = 0;
+		const TCHAR szPlus[] = _T(" + ");
+
+		GetHotKey(wCode, wModifiers);
+		if (wCode != 0 || wModifiers != 0)
+		{
+			if (wModifiers & HOTKEYF_CONTROL)
+			{
+				strKeyName += GetKeyName(VK_CONTROL, FALSE);
+				strKeyName += szPlus;
+			}
+
+
+			if (wModifiers & HOTKEYF_SHIFT)
+			{
+				strKeyName += GetKeyName(VK_SHIFT, FALSE);
+				strKeyName += szPlus;
+			}
+
+
+			if (wModifiers & HOTKEYF_ALT)
+			{
+				strKeyName += GetKeyName(VK_MENU, FALSE);
+				strKeyName += szPlus;
+			}
+
+
+			strKeyName += GetKeyName(wCode, wModifiers & HOTKEYF_EXT);
+		}
+
+		return strKeyName;
+	}
+
+
+	//////////////////////////////////////////////////////////////////////////
+	IMPLEMENT_DUICONTROL(CHotKeyUI)
+
+	CHotKeyUI::CHotKeyUI() : m_pWindow(NULL), m_wVirtualKeyCode(0), m_wModifiers(0), m_uButtonState(0), m_dwHotKeybkColor(0xFFFFFFFF)
+	{
+		SetTextPadding(CDuiRect(4, 3, 4, 3));
+		SetBkColor(0xFFFFFFFF);
+	}
+
+	LPCTSTR CHotKeyUI::GetClass() const
+	{
+		return _T("HotKeyUI");
+	}
+
+	LPVOID CHotKeyUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcscmp(pstrName, _T("HotKey")) == 0 ) return static_cast<CHotKeyUI *>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	UINT CHotKeyUI::GetControlFlags() const
+	{
+		if( !IsEnabled() ) return CControlUI::GetControlFlags();
+
+		return UIFLAG_SETCURSOR | UIFLAG_TABSTOP;
+	}
+
+	void CHotKeyUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_SETCURSOR && IsEnabled() )
+		{
+			::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM)));
+			return;
+		}
+		if( event.Type == UIEVENT_WINDOWSIZE )
+		{
+			if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
+		}
+		if( event.Type == UIEVENT_SCROLLWHEEL )
+		{
+			if( m_pWindow != NULL ) return;
+		}
+		if( event.Type == UIEVENT_SETFOCUS && IsEnabled() ) 
+		{
+			if( m_pWindow ) return;
+			m_pWindow = new CHotKeyWnd();
+			ASSERT(m_pWindow);
+			m_pWindow->Init(this);
+			Invalidate();
+		}
+
+		if( event.Type == UIEVENT_KILLFOCUS && IsEnabled() ) 
+		{
+			Invalidate();
+		}
+
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK || event.Type == UIEVENT_RBUTTONDOWN) 
+		{
+			if( IsEnabled() ) {
+				GetManager()->ReleaseCapture();
+				if( IsFocused() && m_pWindow == NULL ) {
+					m_pWindow = new CHotKeyWnd();
+					ASSERT(m_pWindow);
+					m_pWindow->Init(this);
+				}
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEMOVE ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_BUTTONUP ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEENTER )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState |= UISTATE_HOT;
+				Invalidate();
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState &= ~UISTATE_HOT;
+				Invalidate();
+			}
+			return;
+		}
+		CLabelUI::DoEvent(event);
+	}
+
+	void CHotKeyUI::SetEnabled(bool bEnable)
+	{
+		CControlUI::SetEnabled(bEnable);
+		if( !IsEnabled() ) {
+			m_uButtonState = 0;
+		}
+	}
+
+	void CHotKeyUI::SetText(LPCTSTR pstrText)
+	{
+		m_sText = pstrText;
+		if( m_pWindow != NULL ) Edit_SetText(*m_pWindow, m_sText);
+		Invalidate();
+	}
+
+	LPCTSTR CHotKeyUI::GetNormalImage()
+	{
+		return m_sNormalImage;
+	}
+
+	void CHotKeyUI::SetNormalImage(LPCTSTR pStrImage)
+	{
+		m_sNormalImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CHotKeyUI::GetHotImage()
+	{
+		return m_sHotImage;
+	}
+
+	void CHotKeyUI::SetHotImage(LPCTSTR pStrImage)
+	{
+		m_sHotImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CHotKeyUI::GetFocusedImage()
+	{
+		return m_sFocusedImage;
+	}
+
+	void CHotKeyUI::SetFocusedImage(LPCTSTR pStrImage)
+	{
+		m_sFocusedImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CHotKeyUI::GetDisabledImage()
+	{
+		return m_sDisabledImage;
+	}
+
+	void CHotKeyUI::SetDisabledImage(LPCTSTR pStrImage)
+	{
+		m_sDisabledImage = pStrImage;
+		Invalidate();
+	}
+
+	void CHotKeyUI::SetNativeBkColor(DWORD dwBkColor)
+	{
+		m_dwHotKeybkColor = dwBkColor;
+	}
+
+	DWORD CHotKeyUI::GetNativeBkColor() const
+	{
+		return m_dwHotKeybkColor;
+	}
+
+	void CHotKeyUI::SetPos(RECT rc)
+	{
+		CControlUI::SetPos(rc);
+		if( m_pWindow != NULL ) {
+			RECT rcPos = m_pWindow->CalPos();
+			::SetWindowPos(m_pWindow->GetHWND(), NULL, rcPos.left, rcPos.top, rcPos.right - rcPos.left, 
+				rcPos.bottom - rcPos.top, SWP_NOZORDER | SWP_NOACTIVATE);        
+		}
+	}
+
+	void CHotKeyUI::SetVisible(bool bVisible)
+	{
+		CControlUI::SetVisible(bVisible);
+		if( !IsVisible() && m_pWindow != NULL ) m_pManager->SetFocus(NULL);
+	}
+
+	void CHotKeyUI::SetInternVisible(bool bVisible)
+	{
+		if( !IsVisible() && m_pWindow != NULL ) m_pManager->SetFocus(NULL);
+	}
+
+	SIZE CHotKeyUI::EstimateSize(SIZE szAvailable)
+	{
+		if( m_cxyFixed.cy == 0 ) return CDuiSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 6);
+		return CControlUI::EstimateSize(szAvailable);
+	}
+
+	void CHotKeyUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue);
+		else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue);
+		else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue);
+		else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue);
+		else if( _tcscmp(pstrName, _T("nativebkcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetNativeBkColor(clrColor);
+		}
+		else CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CHotKeyUI::PaintStatusImage(HDC hDC)
+	{
+		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
+		else m_uButtonState &= ~ UISTATE_FOCUSED;
+		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
+		else m_uButtonState &= ~ UISTATE_DISABLED;
+
+		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
+			if( !m_sDisabledImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
+			if( !m_sFocusedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if( !m_sHotImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) {}
+				else return;
+			}
+		}
+
+		if( !m_sNormalImage.IsEmpty() ) {
+			if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) {}
+			else return;
+		}
+	}
+
+	void CHotKeyUI::PaintText(HDC hDC)
+	{
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+		if( m_sText.IsEmpty() ) return;
+		CDuiString sText = m_sText;
+		RECT rc = m_rcItem;
+		rc.left += m_rcTextPadding.left;
+		rc.right -= m_rcTextPadding.right;
+		rc.top += m_rcTextPadding.top;
+		rc.bottom -= m_rcTextPadding.bottom;
+		DWORD dwTextColor = m_dwTextColor;
+		if(!IsEnabled())dwTextColor = m_dwDisabledTextColor;
+
+		CRenderEngine::DrawText(hDC, m_pManager, rc, sText, dwTextColor, m_iFont, DT_SINGLELINE | m_uTextStyle);
+	}
+
+	DWORD CHotKeyUI::GetHotKey() const
+	{
+		return (MAKEWORD(m_wVirtualKeyCode, m_wModifiers));
+	}
+
+	void CHotKeyUI::GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const
+	{
+		wVirtualKeyCode = m_wVirtualKeyCode;
+		wModifiers = m_wModifiers;
+	}
+
+	void CHotKeyUI::SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
+	{
+		m_wVirtualKeyCode = wVirtualKeyCode;
+		m_wModifiers = wModifiers;
+
+		if( m_pWindow ) return;
+		m_pWindow = new CHotKeyWnd();
+		ASSERT(m_pWindow);
+		m_pWindow->Init(this);
+		Invalidate();
+	}
+
+}// Duilib

+ 87 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIHotKey.h

@@ -0,0 +1,87 @@
+#ifndef __UIHOTKEY_H__
+#define __UIHOTKEY_H__
+#pragma once
+
+namespace DuiLib{
+	class CHotKeyUI;
+
+	class UILIB_API CHotKeyWnd : public CWindowWnd
+	{
+	public:
+		CHotKeyWnd(void);
+
+	public:
+		void Init(CHotKeyUI * pOwner);
+		RECT CalPos();
+		LPCTSTR GetWindowClassName() const;
+		void OnFinalMessage(HWND hWnd);
+		LPCTSTR GetSuperClassName() const;
+		LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+		LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+		LRESULT OnEditChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	public:
+		void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers);
+		void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const;
+		DWORD GetHotKey(void) const;
+		CDuiString GetHotKeyName();
+		void SetRules(WORD wInvalidComb, WORD wModifiers);
+		CDuiString GetKeyName(UINT vk, BOOL fExtended);
+	protected:
+		CHotKeyUI * m_pOwner;
+		HBRUSH m_hBkBrush;
+		bool m_bInit;
+	};
+
+	class UILIB_API CHotKeyUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CHotKeyUI)
+		friend CHotKeyWnd;
+	public:
+		CHotKeyUI();
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+		void SetEnabled(bool bEnable = true);
+		void SetText(LPCTSTR pstrText);
+		LPCTSTR GetNormalImage();
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage();
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage();
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetDisabledImage();
+		void SetDisabledImage(LPCTSTR pStrImage);
+		void SetNativeBkColor(DWORD dwBkColor);
+		DWORD GetNativeBkColor() const;
+
+		void SetPos(RECT rc);
+		void SetVisible(bool bVisible = true);
+		void SetInternVisible(bool bVisible = true);
+		SIZE EstimateSize(SIZE szAvailable);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintStatusImage(HDC hDC);
+		void PaintText(HDC hDC);
+	public:
+		void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const;
+		DWORD GetHotKey(void) const;
+		void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers);
+
+	protected:
+		CHotKeyWnd * m_pWindow;
+		UINT m_uButtonState;
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sDisabledImage;
+		DWORD m_dwHotKeybkColor;
+
+	protected:
+		WORD m_wVirtualKeyCode;
+		WORD m_wModifiers;
+	};
+}
+
+
+#endif

+ 308 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddress.cpp

@@ -0,0 +1,308 @@
+#include "StdAfx.h"
+#pragma comment( lib, "ws2_32.lib" )
+
+DWORD GetLocalIpAddress()   
+{   
+	WORD wVersionRequested = MAKEWORD(2, 2);   
+	WSADATA wsaData;   
+	if (WSAStartup(wVersionRequested, &wsaData) != 0)   
+		return 0;   
+	char local[255] = {0};   
+	gethostname(local, sizeof(local));   
+	hostent* ph = gethostbyname(local);   
+	if (ph == NULL)   
+		return 0;   
+	in_addr addr;   
+	memcpy(&addr, ph->h_addr_list[0], sizeof(in_addr));   
+	DWORD dwIP = MAKEIPADDRESS(addr.S_un.S_un_b.s_b1, addr.S_un.S_un_b.s_b2, addr.S_un.S_un_b.s_b3, addr.S_un.S_un_b.s_b4);
+	return dwIP;
+}
+
+namespace DuiLib
+{
+	//CDateTimeUI::m_nDTUpdateFlag
+#define IP_NONE   0
+#define IP_UPDATE 1
+#define IP_DELETE 2
+#define IP_KEEP   3
+
+	class CIPAddressWnd : public CWindowWnd
+	{
+	public:
+		CIPAddressWnd();
+
+		void Init(CIPAddressUI* pOwner);
+		RECT CalPos();
+
+		LPCTSTR GetWindowClassName() const;
+		LPCTSTR GetSuperClassName() const;
+		void OnFinalMessage(HWND hWnd);
+
+		LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+		LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	protected:
+		CIPAddressUI* m_pOwner;
+		HBRUSH m_hBkBrush;
+		bool m_bInit;
+	};
+
+	CIPAddressWnd::CIPAddressWnd() : m_pOwner(NULL), m_hBkBrush(NULL), m_bInit(false)
+	{
+	}
+
+	void CIPAddressWnd::Init(CIPAddressUI* pOwner)
+	{
+		m_pOwner = pOwner;
+		m_pOwner->m_nIPUpdateFlag = IP_NONE;
+
+		if (m_hWnd == NULL)
+		{
+			INITCOMMONCONTROLSEX   CommCtrl;
+			CommCtrl.dwSize=sizeof(CommCtrl);
+			CommCtrl.dwICC=ICC_INTERNET_CLASSES;//Ö¸¶¨Class
+			if(InitCommonControlsEx(&CommCtrl))
+			{
+				RECT rcPos = CalPos();
+				UINT uStyle = WS_CHILD | WS_TABSTOP | WS_GROUP;
+				Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
+			}
+			SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
+		}
+
+		if (m_pOwner->GetText().IsEmpty())
+			m_pOwner->m_dwIP = GetLocalIpAddress();
+		::SendMessage(m_hWnd, IPM_SETADDRESS, 0, m_pOwner->m_dwIP);
+		::ShowWindow(m_hWnd, SW_SHOW);
+		::SetFocus(m_hWnd);
+
+		m_bInit = true;    
+	}
+
+	RECT CIPAddressWnd::CalPos()
+	{
+		CDuiRect rcPos = m_pOwner->GetPos();
+		return rcPos;
+	}
+
+	LPCTSTR CIPAddressWnd::GetWindowClassName() const
+	{
+		return _T("IPAddressWnd");
+	}
+
+	LPCTSTR CIPAddressWnd::GetSuperClassName() const
+	{
+		return WC_IPADDRESS;
+	}
+
+	void CIPAddressWnd::OnFinalMessage(HWND /*hWnd*/)
+	{
+		// Clear reference and die
+		if( m_hBkBrush != NULL ) ::DeleteObject(m_hBkBrush);
+		m_pOwner->m_pWindow = NULL;
+		delete this;
+	}
+
+	LRESULT CIPAddressWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		LRESULT lRes = 0;
+		BOOL bHandled = TRUE;
+		if( uMsg == WM_KILLFOCUS )
+		{
+			bHandled = TRUE;
+			return 0;
+			lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
+		}
+		else if (uMsg == WM_KEYUP && (wParam == VK_DELETE || wParam == VK_BACK))
+		{
+			LRESULT lRes = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
+			m_pOwner->m_nIPUpdateFlag = IP_DELETE;
+			m_pOwner->UpdateText();
+			PostMessage(WM_CLOSE);
+			return lRes;
+		}
+		else if (uMsg == WM_KEYUP && wParam == VK_ESCAPE)
+		{
+			LRESULT lRes = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
+			m_pOwner->m_nIPUpdateFlag = IP_KEEP;
+			PostMessage(WM_CLOSE);
+			return lRes;
+		}
+		else if( uMsg == OCM_COMMAND ) {
+			if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_KILLFOCUS )
+			{
+				lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
+			}
+		}
+		else bHandled = FALSE;
+		if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+		return lRes;
+	}
+
+	LRESULT CIPAddressWnd::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		HWND hWndFocus = GetFocus();
+		while (hWndFocus)
+		{
+			if (GetFocus() == m_hWnd)
+			{
+				bHandled = TRUE;
+				return 0;
+			}
+			hWndFocus = GetParent(hWndFocus);
+		}
+
+		LRESULT lRes = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
+		if (m_pOwner->m_nIPUpdateFlag == IP_NONE)
+		{
+			::SendMessage(m_hWnd, IPM_GETADDRESS, 0, (LPARAM)&m_pOwner->m_dwIP);
+			m_pOwner->m_nIPUpdateFlag = IP_UPDATE;
+			m_pOwner->UpdateText();
+		}
+		::ShowWindow(m_hWnd, SW_HIDE);
+		return lRes;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	//
+	IMPLEMENT_DUICONTROL(CIPAddressUI)
+
+		CIPAddressUI::CIPAddressUI()
+	{
+		m_dwIP = GetLocalIpAddress();
+		m_bReadOnly = false;
+		m_pWindow = NULL;
+		m_nIPUpdateFlag=IP_UPDATE;
+		UpdateText();
+		m_nIPUpdateFlag = IP_NONE;
+	}
+
+	LPCTSTR CIPAddressUI::GetClass() const
+	{
+		return _T("DateTimeUI");
+	}
+
+	LPVOID CIPAddressUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcscmp(pstrName, DUI_CTR_IPADDRESS) == 0 ) return static_cast<CIPAddressUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	DWORD CIPAddressUI::GetIP()
+	{
+		return m_dwIP;
+	}
+
+	void CIPAddressUI::SetIP(DWORD dwIP)
+	{
+		m_dwIP = dwIP;
+		UpdateText();
+	}
+
+	void CIPAddressUI::SetReadOnly(bool bReadOnly)
+	{
+		m_bReadOnly = bReadOnly;
+		Invalidate();
+	}
+
+	bool CIPAddressUI::IsReadOnly() const
+	{
+		return m_bReadOnly;
+	}
+
+	void CIPAddressUI::UpdateText()
+	{
+		if (m_nIPUpdateFlag == IP_DELETE)
+			SetText(_T(""));
+		else if (m_nIPUpdateFlag == IP_UPDATE)
+		{
+			TCHAR szIP[MAX_PATH] = {0};
+			in_addr addr;
+			addr.S_un.S_addr = m_dwIP;
+			_stprintf(szIP, _T("%d.%d.%d.%d"), addr.S_un.S_un_b.s_b4, addr.S_un.S_un_b.s_b3, addr.S_un.S_un_b.s_b2, addr.S_un.S_un_b.s_b1);
+			SetText(szIP);
+		}
+	}
+
+	void CIPAddressUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_SETCURSOR && IsEnabled() )
+		{
+			::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM)));
+			return;
+		}
+		if( event.Type == UIEVENT_WINDOWSIZE )
+		{
+			if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
+		}
+		if( event.Type == UIEVENT_SCROLLWHEEL )
+		{
+			if( m_pWindow != NULL ) return;
+		}
+		if( event.Type == UIEVENT_SETFOCUS && IsEnabled() ) 
+		{
+			if( m_pWindow ) 
+			{
+				return;
+			}
+			m_pWindow = new CIPAddressWnd();
+			ASSERT(m_pWindow);
+			m_pWindow->Init(this);
+			m_pWindow->ShowWindow();
+		}
+		if( event.Type == UIEVENT_KILLFOCUS && IsEnabled() ) 
+		{
+			Invalidate();
+		}
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK || event.Type == UIEVENT_RBUTTONDOWN) 
+		{
+			if( IsEnabled() ) {
+				GetManager()->ReleaseCapture();
+				if( IsFocused() && m_pWindow == NULL )
+				{
+					m_pWindow = new CIPAddressWnd();
+					ASSERT(m_pWindow);
+				}
+				if( m_pWindow != NULL )
+				{
+					m_pWindow->Init(this);
+					m_pWindow->ShowWindow();
+				}
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEMOVE ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_BUTTONUP ) 
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSEENTER )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			return;
+		}
+
+		CLabelUI::DoEvent(event);
+	}
+
+	void CIPAddressUI::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue )
+	{
+		CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+}

+ 43 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddress.h

@@ -0,0 +1,43 @@
+#ifndef __UIIPADDRESS_H__
+#define __UIIPADDRESS_H__
+
+#pragma once
+
+//给该控件添加一个属性dtstyle
+
+namespace DuiLib
+{
+	class CIPAddressWnd;
+
+	/// 时间选择控件
+	class UILIB_API CIPAddressUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CIPAddressUI)
+
+		friend class CIPAddressWnd;
+	public:
+		CIPAddressUI();
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		DWORD GetIP();
+		void SetIP(DWORD dwIP);
+
+		void SetReadOnly(bool bReadOnly);
+		bool IsReadOnly() const;
+
+		void UpdateText();
+
+		void DoEvent(TEventUI& event);
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+	protected:
+		DWORD	m_dwIP;
+		bool       m_bReadOnly;
+		int		m_nIPUpdateFlag;
+
+		CIPAddressWnd* m_pWindow;
+	};
+}
+#endif // __UIIPADDRESS_H__

BIN
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddressEx.cpp


+ 44 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIIPAddressEx.h

@@ -0,0 +1,44 @@
+#ifndef __UIIPADDRESSEX_H__
+#define __UIIPADDRESSEX_H__
+
+#pragma once
+
+//给该控件添加一个属性dtstyle
+
+namespace DuiLib
+{
+	
+    /// IP输入控件
+    class UILIB_API CIPAddressExUI : public CEditUI
+    {
+		DECLARE_DUICONTROL(CIPAddressExUI)
+    public:
+        CIPAddressExUI();
+        LPCTSTR GetClass() const;
+        LPVOID GetInterface(LPCTSTR pstrName);
+        UINT GetControlFlags() const;
+        void DoEvent(TEventUI& event);
+        void PaintText(HDC hDC);
+
+        void SetIP(LPCTSTR lpIP);
+        CDuiString GetIP();
+
+    private:
+        void CharToInt();
+        void GetNumInput(TCHAR chKey);
+        void UpdateText();
+        void IncNum();
+        void DecNum();
+
+    protected:
+        int m_nFirst;
+        int m_nSecond;
+        int m_nThird;
+        int m_nFourth;
+        int m_nActiveSection;
+
+        TCHAR m_chNum;
+        CDuiString m_strNum;
+    };
+}
+#endif // __UIIPADDRESSEX_H__

+ 335 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILabel.cpp

@@ -0,0 +1,335 @@
+#include "StdAfx.h"
+#include "UILabel.h"
+
+#include <atlconv.h>
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CLabelUI)
+
+		CLabelUI::CLabelUI() : m_uTextStyle(DT_VCENTER | DT_SINGLELINE), m_dwTextColor(0), 
+		m_dwDisabledTextColor(0),
+		m_iFont(-1),
+		m_bShowHtml(false),
+		m_bAutoCalcWidth(false),
+		m_bAutoCalcHeight(false),
+		m_bNeedEstimateSize(false)
+	{
+		m_cxyFixedLast.cx = m_cxyFixedLast.cy = 0;
+		m_szAvailableLast.cx = m_szAvailableLast.cy = 0;
+		::ZeroMemory(&m_rcTextPadding, sizeof(m_rcTextPadding));
+	}
+
+	CLabelUI::~CLabelUI()
+	{
+	}
+
+	LPCTSTR CLabelUI::GetClass() const
+	{
+		return _T("LabelUI");
+	}
+
+	LPVOID CLabelUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, _T("Label")) == 0 ) return static_cast<CLabelUI*>(this);
+		return CControlUI::GetInterface(pstrName);
+	}
+
+	UINT CLabelUI::GetControlFlags() const
+	{
+		return IsEnabled() ? UIFLAG_SETCURSOR : 0;
+	}
+	void CLabelUI::SetTextStyle(UINT uStyle)
+	{
+		m_uTextStyle = uStyle;
+		Invalidate();
+	}
+
+	UINT CLabelUI::GetTextStyle() const
+	{
+		return m_uTextStyle;
+	}
+
+	void CLabelUI::SetTextColor(DWORD dwTextColor)
+	{
+		m_dwTextColor = dwTextColor;
+		Invalidate();
+	}
+
+	DWORD CLabelUI::GetTextColor() const
+	{
+		return m_dwTextColor;
+	}
+
+	void CLabelUI::SetDisabledTextColor(DWORD dwTextColor)
+	{
+		m_dwDisabledTextColor = dwTextColor;
+		Invalidate();
+	}
+
+	DWORD CLabelUI::GetDisabledTextColor() const
+	{
+		return m_dwDisabledTextColor;
+	}
+
+	void CLabelUI::SetFont(int index)
+	{
+		m_iFont = index;
+		m_bNeedEstimateSize = true;
+		Invalidate();
+	}
+
+	int CLabelUI::GetFont() const
+	{
+		return m_iFont;
+	}
+
+	RECT CLabelUI::GetTextPadding() const
+	{
+		RECT rcTextPadding = m_rcTextPadding;
+		if(m_pManager != NULL) m_pManager->GetDPIObj()->Scale(&rcTextPadding);
+		return rcTextPadding;
+	}
+
+	void CLabelUI::SetTextPadding(RECT rc)
+	{
+		m_rcTextPadding = rc;
+		m_bNeedEstimateSize = true;
+		Invalidate();
+	}
+
+	bool CLabelUI::IsShowHtml()
+	{
+		return m_bShowHtml;
+	}
+
+	void CLabelUI::SetShowHtml(bool bShowHtml)
+	{
+		if( m_bShowHtml == bShowHtml ) return;
+
+		m_bShowHtml = bShowHtml;
+		m_bNeedEstimateSize = true;
+		Invalidate();
+	}
+
+	SIZE CLabelUI::EstimateSize(SIZE szAvailable)
+	{
+		RECT rcTextPadding = GetTextPadding();
+		if (m_cxyFixed.cx > 0 && m_cxyFixed.cy > 0) {
+			return GetFixedSize();
+		}
+
+		if ((szAvailable.cx != m_szAvailableLast.cx || szAvailable.cy != m_szAvailableLast.cy)) {
+			m_bNeedEstimateSize = true;
+		}
+
+		if (m_bNeedEstimateSize) {
+			CDuiString sText = GetText();
+			m_bNeedEstimateSize = false;
+			m_szAvailableLast = szAvailable;
+			m_cxyFixedLast = GetFixedSize();
+			// 自动计算宽度
+			if ((m_uTextStyle & DT_SINGLELINE) != 0) {
+				// 高度
+				if (m_cxyFixedLast.cy == 0) {
+					m_cxyFixedLast.cy = m_pManager->GetFontInfo(m_iFont)->tm.tmHeight + 8;
+					m_cxyFixedLast.cy += rcTextPadding.top + rcTextPadding.bottom;
+				}
+				// 宽度
+				if (m_cxyFixedLast.cx == 0) {
+					if(m_bAutoCalcWidth) {
+						RECT rcText = { 0, 0, 9999, m_cxyFixedLast.cy };
+						if( m_bShowHtml ) {
+							int nLinks = 0;
+							CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, 0, NULL, NULL, nLinks, m_iFont, DT_CALCRECT | m_uTextStyle & ~DT_RIGHT & ~DT_CENTER);
+						}
+						else {
+							CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, 0, m_iFont, DT_CALCRECT | m_uTextStyle & ~DT_RIGHT & ~DT_CENTER);
+						}
+						m_cxyFixedLast.cx = rcText.right - rcText.left + GetManager()->GetDPIObj()->Scale(m_rcTextPadding.left + m_rcTextPadding.right);
+					}
+				}
+			}
+			// 自动计算高度
+			else if(m_cxyFixedLast.cy == 0) {
+				if(m_bAutoCalcHeight) {
+					RECT rcText = { 0, 0, m_cxyFixedLast.cx, 9999 };
+					rcText.left += rcTextPadding.left;
+					rcText.right -= rcTextPadding.right;
+					if( m_bShowHtml ) {
+						int nLinks = 0;
+						CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, 0, NULL, NULL, nLinks, m_iFont, DT_CALCRECT | m_uTextStyle & ~DT_RIGHT & ~DT_CENTER);
+					}
+					else {
+						CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, 0, m_iFont, DT_CALCRECT | m_uTextStyle & ~DT_RIGHT & ~DT_CENTER);
+					}
+					m_cxyFixedLast.cy = rcText.bottom - rcText.top + rcTextPadding.top + rcTextPadding.bottom;
+				}
+			}
+
+		}
+		return m_cxyFixedLast;
+	}
+
+	void CLabelUI::DoEvent(TEventUI& event)
+	{
+		if( event.Type == UIEVENT_SETFOCUS ) 
+		{
+			m_bFocused = true;
+			return;
+		}
+		if( event.Type == UIEVENT_KILLFOCUS ) 
+		{
+			m_bFocused = false;
+			return;
+		}
+		CControlUI::DoEvent(event);
+	}
+
+	void CLabelUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("align")) == 0 ) {
+			if( _tcsstr(pstrValue, _T("left")) != NULL ) {
+				m_uTextStyle &= ~(DT_CENTER | DT_RIGHT);
+				m_uTextStyle |= DT_LEFT;
+			}
+			if( _tcsstr(pstrValue, _T("center")) != NULL ) {
+				m_uTextStyle &= ~(DT_LEFT | DT_RIGHT );
+				m_uTextStyle |= DT_CENTER;
+			}
+			if( _tcsstr(pstrValue, _T("right")) != NULL ) {
+				m_uTextStyle &= ~(DT_LEFT | DT_CENTER);
+				m_uTextStyle |= DT_RIGHT;
+			}
+		}
+		else if( _tcsicmp(pstrName, _T("valign")) == 0 ) {
+			if( _tcsstr(pstrValue, _T("top")) != NULL ) {
+				m_uTextStyle &= ~(DT_BOTTOM | DT_VCENTER | DT_WORDBREAK);
+				m_uTextStyle |= (DT_TOP | DT_SINGLELINE);
+			}
+			if( _tcsstr(pstrValue, _T("vcenter")) != NULL ) {
+				m_uTextStyle &= ~(DT_TOP | DT_BOTTOM | DT_WORDBREAK);            
+				m_uTextStyle |= (DT_VCENTER | DT_SINGLELINE);
+			}
+			if( _tcsstr(pstrValue, _T("bottom")) != NULL ) {
+				m_uTextStyle &= ~(DT_TOP | DT_VCENTER | DT_WORDBREAK);
+				m_uTextStyle |= (DT_BOTTOM | DT_SINGLELINE);
+			}
+		}
+		else if( _tcsicmp(pstrName, _T("endellipsis")) == 0 ) {
+			if( _tcsicmp(pstrValue, _T("true")) == 0 ) m_uTextStyle |= DT_END_ELLIPSIS;
+			else m_uTextStyle &= ~DT_END_ELLIPSIS;
+		}   
+		else if( _tcsicmp(pstrName, _T("wordbreak")) == 0 ) {
+			if( _tcsicmp(pstrValue, _T("true")) == 0 ) {
+				m_uTextStyle &= ~DT_SINGLELINE;
+				m_uTextStyle |= DT_WORDBREAK | DT_EDITCONTROL;
+			}
+			else {
+				m_uTextStyle &= ~DT_WORDBREAK & ~DT_EDITCONTROL;
+				m_uTextStyle |= DT_SINGLELINE;
+			}
+		}
+		else if( _tcsicmp(pstrName, _T("noprefix")) == 0 ) {
+			if( _tcsicmp(pstrValue, _T("true")) == 0)
+			{
+				m_uTextStyle |= DT_NOPREFIX;
+			}
+			else
+			{
+				m_uTextStyle = m_uTextStyle & ~DT_NOPREFIX;
+			}
+		}
+		else if( _tcsicmp(pstrName, _T("font")) == 0 ) SetFont(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("textcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("disabledtextcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetDisabledTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("textpadding")) == 0 ) {
+			RECT rcTextPadding = { 0 };
+			LPTSTR pstr = NULL;
+			rcTextPadding.left = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
+			rcTextPadding.top = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr);    
+			rcTextPadding.right = _tcstol(pstr + 1, &pstr, 10);  ASSERT(pstr);    
+			rcTextPadding.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);    
+			SetTextPadding(rcTextPadding);
+		}
+		else if( _tcsicmp(pstrName, _T("showhtml")) == 0 ) SetShowHtml(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcsicmp(pstrName, _T("autocalcwidth")) == 0 ) {
+			SetAutoCalcWidth(_tcsicmp(pstrValue, _T("true")) == 0);
+		}
+		else if( _tcsicmp(pstrName, _T("autocalcheight")) == 0 ) {
+			SetAutoCalcHeight(_tcsicmp(pstrValue, _T("true")) == 0);
+		}
+		else CControlUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CLabelUI::PaintText(HDC hDC)
+	{
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+
+		RECT rc = m_rcItem;
+		RECT m_rcTextPadding = CLabelUI::m_rcTextPadding;
+		GetManager()->GetDPIObj()->Scale(&m_rcTextPadding);
+		rc.left += m_rcTextPadding.left;
+		rc.right -= m_rcTextPadding.right;
+		rc.top += m_rcTextPadding.top;
+		rc.bottom -= m_rcTextPadding.bottom;
+
+		CDuiString sText = GetText();
+		if( sText.IsEmpty() ) return;
+		int nLinks = 0;
+		if( IsEnabled() ) {
+			if( m_bShowHtml )
+				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwTextColor, \
+				NULL, NULL, nLinks, m_iFont, m_uTextStyle);
+			else
+				CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
+				m_iFont, m_uTextStyle);
+		}
+		else {
+			if( m_bShowHtml )
+				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
+				NULL, NULL, nLinks, m_iFont, m_uTextStyle);
+			else
+				CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
+				m_iFont, m_uTextStyle);
+		}
+	}
+
+	bool CLabelUI::GetAutoCalcWidth() const
+	{
+		return m_bAutoCalcWidth;
+	}
+
+	void CLabelUI::SetAutoCalcWidth(bool bAutoCalcWidth)
+	{
+		m_bAutoCalcWidth = bAutoCalcWidth;
+	}
+
+	bool CLabelUI::GetAutoCalcHeight() const
+	{
+		return m_bAutoCalcHeight;
+	}
+
+	void CLabelUI::SetAutoCalcHeight(bool bAutoCalcHeight)
+	{
+		m_bAutoCalcHeight = bAutoCalcHeight;
+	}
+
+	void CLabelUI::SetText( LPCTSTR pstrText )
+	{
+		CControlUI::SetText(pstrText);
+		if(GetAutoCalcWidth() || GetAutoCalcHeight()) {
+			NeedParentUpdate();
+		}
+	}
+}

+ 60 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILabel.h

@@ -0,0 +1,60 @@
+#ifndef __UILABEL_H__
+#define __UILABEL_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CLabelUI : public CControlUI
+	{
+		DECLARE_DUICONTROL(CLabelUI)
+	public:
+		CLabelUI();
+		~CLabelUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		void SetTextStyle(UINT uStyle);
+		UINT GetTextStyle() const;
+		void SetTextColor(DWORD dwTextColor);
+		DWORD GetTextColor() const;
+		void SetDisabledTextColor(DWORD dwTextColor);
+		DWORD GetDisabledTextColor() const;
+		void SetFont(int index);
+		int GetFont() const;
+		RECT GetTextPadding() const;
+		void SetTextPadding(RECT rc);
+		bool IsShowHtml();
+		void SetShowHtml(bool bShowHtml = true);
+
+		SIZE EstimateSize(SIZE szAvailable);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintText(HDC hDC);
+
+		virtual bool GetAutoCalcWidth() const;
+		virtual void SetAutoCalcWidth(bool bAutoCalcWidth);
+		virtual bool GetAutoCalcHeight() const;
+		virtual void SetAutoCalcHeight(bool bAutoCalcHeight);
+		virtual void SetText(LPCTSTR pstrText);
+		
+	protected:
+		DWORD	m_dwTextColor;
+		DWORD	m_dwDisabledTextColor;
+		int		m_iFont;
+		UINT	m_uTextStyle;
+		RECT	m_rcTextPadding;
+		bool	m_bShowHtml;
+		bool	m_bAutoCalcWidth;
+		bool	m_bAutoCalcHeight;
+
+		SIZE    m_szAvailableLast;
+		SIZE    m_cxyFixedLast;
+		bool    m_bNeedEstimateSize;
+	};
+}
+
+#endif // __UILABEL_H__

Diferenças do arquivo suprimidas por serem muito extensas
+ 3180 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIList.cpp


+ 524 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIList.h

@@ -0,0 +1,524 @@
+#ifndef __UILIST_H__
+#define __UILIST_H__
+
+namespace DuiLib {
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	typedef int (CALLBACK *PULVCompareFunc)(UINT_PTR, UINT_PTR, UINT_PTR);
+
+	class CListHeaderUI;
+
+#define UILIST_MAX_COLUMNS 32
+
+	typedef struct tagTListInfoUI
+	{
+		int nColumns;
+		RECT rcColumn[UILIST_MAX_COLUMNS];
+		int nFont;
+		UINT uTextStyle;
+		RECT rcTextPadding;
+		DWORD dwTextColor;
+		DWORD dwBkColor;
+		CDuiString sBkImage;
+		bool bAlternateBk;
+		DWORD dwSelectedTextColor;
+		DWORD dwSelectedBkColor;
+		CDuiString sSelectedImage;
+		DWORD dwHotTextColor;
+		DWORD dwHotBkColor;
+		CDuiString sHotImage;
+		DWORD dwDisabledTextColor;
+		DWORD dwDisabledBkColor;
+		CDuiString sDisabledImage;
+		CDuiString sForeImage;
+		CDuiString sHotForeImage;
+		CDuiString sSelectedForeImage;
+
+		DWORD dwLineColor;
+		bool bShowRowLine;
+		bool bShowColumnLine;
+		bool bShowHtml;
+		bool bMultiExpandable;
+		bool bRSelected;
+	} TListInfoUI;
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class IListCallbackUI
+	{
+	public:
+		virtual LPCTSTR GetItemText(CControlUI* pList, int iItem, int iSubItem) = 0;
+		virtual DWORD GetItemTextColor(CControlUI* pList, int iItem, int iSubItem, int iState) = 0;// iState:0-正常、1-激活、2-选择、3-禁用
+	};
+
+	class IListOwnerUI
+	{
+	public:
+		virtual UINT GetListType() = 0;
+		virtual TListInfoUI* GetListInfo() = 0;
+		virtual int GetCurSel() const = 0;
+		virtual bool SelectItem(int iIndex, bool bTakeFocus = false) = 0;
+		virtual bool SelectMultiItem(int iIndex, bool bTakeFocus = false) = 0;
+		virtual bool UnSelectItem(int iIndex, bool bOthers = false) = 0;
+		virtual void DoEvent(TEventUI& event) = 0;
+	};
+
+	class IListUI : public IListOwnerUI
+	{
+	public:
+		virtual CListHeaderUI* GetHeader() const = 0;
+		virtual CContainerUI* GetList() const = 0;
+		virtual IListCallbackUI* GetTextCallback() const = 0;
+		virtual void SetTextCallback(IListCallbackUI* pCallback) = 0;
+		virtual bool ExpandItem(int iIndex, bool bExpand = true) = 0;
+		virtual int GetExpandedItem() const = 0;
+
+		virtual void SetMultiSelect(bool bMultiSel) = 0;
+		virtual bool IsMultiSelect() const = 0;
+		virtual void SelectAllItems() = 0;
+		virtual void UnSelectAllItems() = 0;
+		virtual int GetSelectItemCount() const = 0;
+		virtual int GetNextSelItem(int nItem) const = 0;
+	};
+
+	class IListItemUI
+	{
+	public:
+		virtual int GetIndex() const = 0;
+		virtual void SetIndex(int iIndex) = 0;
+		virtual IListOwnerUI* GetOwner() = 0;
+		virtual void SetOwner(CControlUI* pOwner) = 0;
+		virtual bool IsSelected() const = 0;
+		virtual bool Select(bool bSelect = true) = 0;
+		virtual bool SelectMulti(bool bSelect = true) = 0;
+		virtual bool IsExpanded() const = 0;
+		virtual bool Expand(bool bExpand = true) = 0;
+		virtual void DrawItemText(HDC hDC, const RECT& rcItem) = 0;
+	};
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class CListBodyUI;
+	class CListHeaderUI;
+	class CEditUI;
+	class CComboBoxUI;
+	class UILIB_API CListUI : public CVerticalLayoutUI, public IListUI
+	{
+		DECLARE_DUICONTROL(CListUI)
+
+	public:
+		CListUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		bool GetScrollSelect();
+		void SetScrollSelect(bool bScrollSelect);
+		int GetCurSel() const;
+		int GetCurSelActivate() const;
+		bool SelectItem(int iIndex, bool bTakeFocus = false);
+		bool SelectItemActivate(int iIndex);    // 双击选中
+
+		bool SelectMultiItem(int iIndex, bool bTakeFocus = false);
+		void SetMultiSelect(bool bMultiSel);
+		bool IsMultiSelect() const;
+		bool UnSelectItem(int iIndex, bool bOthers = false);
+		void SelectAllItems();
+		void UnSelectAllItems();
+		int GetSelectItemCount() const;
+		int GetNextSelItem(int nItem) const;
+
+		CListHeaderUI* GetHeader() const;  
+		CContainerUI* GetList() const;
+		UINT GetListType();
+		TListInfoUI* GetListInfo();
+
+		CControlUI* GetItemAt(int iIndex) const;
+		int GetItemIndex(CControlUI* pControl) const;
+		bool SetItemIndex(CControlUI* pControl, int iIndex);
+		int GetCount() const;
+		bool Add(CControlUI* pControl);
+		bool AddAt(CControlUI* pControl, int iIndex);
+		bool Remove(CControlUI* pControl);
+		bool RemoveAt(int iIndex);
+		void RemoveAll();
+
+		void EnsureVisible(int iIndex);
+		void Scroll(int dx, int dy);
+
+		bool IsDelayedDestroy() const;
+		void SetDelayedDestroy(bool bDelayed);
+		int GetChildPadding() const;
+		void SetChildPadding(int iPadding);
+
+		void SetItemFont(int index);
+		void SetItemTextStyle(UINT uStyle);
+		void SetItemTextPadding(RECT rc);
+		void SetItemTextColor(DWORD dwTextColor);
+		void SetItemBkColor(DWORD dwBkColor);
+		void SetItemBkImage(LPCTSTR pStrImage);
+		void SetAlternateBk(bool bAlternateBk);
+		void SetSelectedItemTextColor(DWORD dwTextColor);
+		void SetSelectedItemBkColor(DWORD dwBkColor);
+		void SetSelectedItemImage(LPCTSTR pStrImage); 
+		void SetHotItemTextColor(DWORD dwTextColor);
+		void SetHotItemBkColor(DWORD dwBkColor);
+		void SetHotItemImage(LPCTSTR pStrImage);
+		void SetDisabledItemTextColor(DWORD dwTextColor);
+		void SetDisabledItemBkColor(DWORD dwBkColor);
+		void SetDisabledItemImage(LPCTSTR pStrImage);
+		void SetItemLineColor(DWORD dwLineColor);
+		void SetItemShowRowLine(bool bShowLine = false);
+		void SetItemShowColumnLine(bool bShowLine = false);
+		bool IsItemShowHtml();
+		void SetItemShowHtml(bool bShowHtml = true);
+		bool IsItemRSelected();
+		void SetItemRSelected(bool bSelected = true);
+		RECT GetItemTextPadding() const;
+		DWORD GetItemTextColor() const;
+		DWORD GetItemBkColor() const;
+		LPCTSTR GetItemBkImage() const;
+		bool IsAlternateBk() const;
+		DWORD GetSelectedItemTextColor() const;
+		DWORD GetSelectedItemBkColor() const;
+		LPCTSTR GetSelectedItemImage() const;
+		DWORD GetHotItemTextColor() const;
+		DWORD GetHotItemBkColor() const;
+		LPCTSTR GetHotItemImage() const;
+		DWORD GetDisabledItemTextColor() const;
+		DWORD GetDisabledItemBkColor() const;
+		LPCTSTR GetDisabledItemImage() const;
+		DWORD GetItemLineColor() const;
+
+		void SetMultiExpanding(bool bMultiExpandable); 
+		int GetExpandedItem() const;
+		bool ExpandItem(int iIndex, bool bExpand = true);
+
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void Move(SIZE szOffset, bool bNeedInvalidate = true);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		IListCallbackUI* GetTextCallback() const;
+		void SetTextCallback(IListCallbackUI* pCallback);
+
+		SIZE GetScrollPos() const;
+		SIZE GetScrollRange() const;
+		void SetScrollPos(SIZE szPos, bool bMsg = true);
+		void LineUp();
+		void LineDown();
+		void PageUp();
+		void PageDown();
+		void HomeUp();
+		void EndDown();
+		void LineLeft();
+		void LineRight();
+		void PageLeft();
+		void PageRight();
+		void HomeLeft();
+		void EndRight();
+		void EnableScrollBar(bool bEnableVertical = true, bool bEnableHorizontal = false);
+		virtual CScrollBarUI* GetVerticalScrollBar() const;
+		virtual CScrollBarUI* GetHorizontalScrollBar() const;
+		BOOL SortItems(PULVCompareFunc pfnCompare, UINT_PTR dwData);
+
+		virtual BOOL CheckColumEditable(int nColum) { return FALSE; };
+		virtual CRichEditUI* GetEditUI() { return NULL; };
+		virtual BOOL CheckColumComboBoxable(int nColum) { return FALSE; };
+		virtual CComboBoxUI* GetComboBoxUI() { return NULL; };
+
+	protected:
+		int GetMinSelItemIndex();
+		int GetMaxSelItemIndex();
+
+	protected:
+		bool m_bScrollSelect;
+		bool m_bMultiSel;
+		int m_iCurSel;
+		int m_iFirstSel;
+		CStdPtrArray m_aSelItems;
+		int m_iCurSelActivate;  // 双击的列
+		int m_iExpandedItem;
+		IListCallbackUI* m_pCallback;
+		CListBodyUI* m_pList;
+		CListHeaderUI* m_pHeader;
+		TListInfoUI m_ListInfo;
+	};
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListBodyUI : public CVerticalLayoutUI
+	{
+	public:
+		CListBodyUI(CListUI* pOwner);
+
+
+		int GetScrollStepSize() const;
+		void SetScrollPos(SIZE szPos, bool bMsg = true);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void DoEvent(TEventUI& event);
+		BOOL SortItems(PULVCompareFunc pfnCompare, UINT_PTR dwData);
+	protected:
+		static int __cdecl ItemComareFunc(void *pvlocale, const void *item1, const void *item2);
+		int __cdecl ItemComareFunc(const void *item1, const void *item2);
+	protected:
+		CListUI* m_pOwner;
+		PULVCompareFunc m_pCompareFunc;
+		UINT_PTR m_compareData;
+	};
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListHeaderUI : public CHorizontalLayoutUI
+	{
+		DECLARE_DUICONTROL(CListHeaderUI)
+	public:
+		CListHeaderUI();
+		virtual ~CListHeaderUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		SIZE EstimateSize(SIZE szAvailable);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void SetScaleHeader(bool bIsScale);
+		bool IsScaleHeader() const;
+
+		void DoInit();
+		void DoPostPaint(HDC hDC, const RECT& rcPaint);
+	private:
+		bool m_bIsScaleHeader;
+	};
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListHeaderItemUI : public CHorizontalLayoutUI
+	{
+		DECLARE_DUICONTROL(CListHeaderItemUI)
+
+	public:
+		CListHeaderItemUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		void SetEnabled(bool bEnable = true);
+
+		bool IsDragable() const;
+		void SetDragable(bool bDragable);
+		DWORD GetSepWidth() const;
+		void SetSepWidth(int iWidth);
+		DWORD GetTextStyle() const;
+		void SetTextStyle(UINT uStyle);
+		DWORD GetTextColor() const;
+		void SetTextColor(DWORD dwTextColor);
+		void SetTextPadding(RECT rc);
+		RECT GetTextPadding() const;
+		void SetFont(int index);
+		bool IsShowHtml();
+		void SetShowHtml(bool bShowHtml = true);
+		LPCTSTR GetNormalImage() const;
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage() const;
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetPushedImage() const;
+		void SetPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage() const;
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetSepImage() const;
+		void SetSepImage(LPCTSTR pStrImage);
+		void SetScale(int nScale);
+		int GetScale() const;
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		RECT GetThumbRect() const;
+
+		void PaintText(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+
+	protected:
+		POINT ptLastMouse;
+		bool m_bDragable;
+		UINT m_uButtonState;
+		int m_iSepWidth;
+		DWORD m_dwTextColor;
+		int m_iFont;
+		UINT m_uTextStyle;
+		bool m_bShowHtml;
+		RECT m_rcTextPadding;
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sPushedImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sSepImage;
+		CDuiString m_sSepImageModify;
+		int m_nScale;
+	};
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListElementUI : public CControlUI, public IListItemUI
+	{
+	public:
+		CListElementUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		void SetEnabled(bool bEnable = true);
+
+		int GetIndex() const;
+		void SetIndex(int iIndex);
+
+		IListOwnerUI* GetOwner();
+		void SetOwner(CControlUI* pOwner);
+		void SetVisible(bool bVisible = true);
+
+		bool IsSelected() const;
+		bool Select(bool bSelect = true);
+		bool SelectMulti(bool bSelect = true);
+		bool IsExpanded() const;
+		bool Expand(bool bExpand = true);
+
+		void Invalidate(); // 直接CControl::Invalidate会导致滚动条刷新,重写减少刷新区域
+		bool Activate();
+
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void DrawItemBk(HDC hDC, const RECT& rcItem);
+
+	protected:
+		int m_iIndex;
+		bool m_bSelected;
+		UINT m_uButtonState;
+		IListOwnerUI* m_pOwner;
+	};
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListLabelElementUI : public CListElementUI
+	{
+		DECLARE_DUICONTROL(CListLabelElementUI)
+	public:
+		CListLabelElementUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+
+		void DrawItemText(HDC hDC, const RECT& rcItem);
+	};
+
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListTextElementUI : public CListLabelElementUI
+	{
+		DECLARE_DUICONTROL(CListTextElementUI)
+	public:
+		CListTextElementUI();
+		~CListTextElementUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		LPCTSTR GetText(int iIndex) const;
+		void SetText(int iIndex, LPCTSTR pstrText);
+
+		DWORD GetTextColor(int iIndex) const;
+		void SetTextColor(int iIndex, DWORD dwTextColor);
+
+		void SetOwner(CControlUI* pOwner);
+		CDuiString* GetLinkContent(int iIndex);
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+
+		void DrawItemText(HDC hDC, const RECT& rcItem);
+
+	protected:
+		enum { MAX_LINK = 8 };
+		int m_nLinks;
+		RECT m_rcLinks[MAX_LINK];
+		CDuiString m_sLinks[MAX_LINK];
+		int m_nHoverLink;
+		IListUI* m_pOwner;
+		CStdPtrArray m_aTexts;
+		CStdPtrArray m_aTextColors;
+	};
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListContainerElementUI : public CHorizontalLayoutUI, public IListItemUI
+	{
+		DECLARE_DUICONTROL(CListContainerElementUI)
+	public:
+		CListContainerElementUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		int GetIndex() const;
+		void SetIndex(int iIndex);
+
+		IListOwnerUI* GetOwner();
+		void SetOwner(CControlUI* pOwner);
+		void SetVisible(bool bVisible = true);
+		void SetEnabled(bool bEnable = true);
+
+		bool IsSelected() const;
+		bool Select(bool bSelect = true);
+		bool SelectMulti(bool bSelect = true);
+		bool IsExpanded() const;
+		bool Expand(bool bExpand = true);
+
+		void Invalidate(); // 直接CControl::Invalidate会导致滚动条刷新,重写减少刷新区域
+		bool Activate();
+
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+
+		virtual void DrawItemText(HDC hDC, const RECT& rcItem);    
+		virtual void DrawItemBk(HDC hDC, const RECT& rcItem);
+
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+
+	protected:
+		int m_iIndex;
+		bool m_bSelected;
+		UINT m_uButtonState;
+		IListOwnerUI* m_pOwner;
+	};
+
+} // namespace DuiLib
+
+#endif // __UILIST_H__

Diferenças do arquivo suprimidas por serem muito extensas
+ 1582 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIListEx.cpp


+ 310 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIListEx.h

@@ -0,0 +1,310 @@
+#ifndef __UILISTEX_H__
+#define __UILISTEX_H__
+
+#pragma once
+
+#include "Layout/UIVerticalLayout.h"
+#include "Layout/UIHorizontalLayout.h"
+
+namespace DuiLib {
+
+	class IListComboCallbackUI
+	{
+	public:
+		virtual void GetItemComboTextArray(CControlUI* pCtrl, int iItem, int iSubItem) = 0;
+	};
+
+	class CEditUI;
+	class CComboBoxUI;
+
+	class UILIB_API CListExUI : public CListUI, public INotifyUI
+	{
+		DECLARE_DUICONTROL(CListExUI)
+
+	public:
+		CListExUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+	public: 
+		virtual void DoEvent(TEventUI& event);
+
+	public:
+		void InitListCtrl();
+
+	protected:
+		CRichEditUI*		m_pEditUI;
+		CComboBoxUI*	m_pComboBoxUI;
+
+	public:
+		virtual BOOL CheckColumEditable(int nColum);
+		virtual CRichEditUI* GetEditUI();
+
+		virtual BOOL CheckColumComboBoxable(int nColum);
+		virtual CComboBoxUI* GetComboBoxUI();
+
+		virtual BOOL CheckColumCheckBoxable(int nColum);
+
+	public:
+		virtual void Notify(TNotifyUI& msg);
+		BOOL	m_bAddMessageFilter;
+		int		m_nRow,m_nColum;
+		void	SetEditRowAndColum(int nRow,int nColum) { m_nRow = nRow; m_nColum = nColum; };
+
+	public:
+		IListComboCallbackUI* m_pXCallback;
+		virtual IListComboCallbackUI* GetTextArrayCallback() const;
+		virtual void SetTextArrayCallback(IListComboCallbackUI* pCallback);
+
+	public:
+		void OnListItemClicked(int nIndex, int nColum, RECT* lpRCColum, LPCTSTR lpstrText);
+		void OnListItemChecked(int nIndex, int nColum, BOOL bChecked);
+
+	public:
+		void SetColumItemColor(int nIndex, int nColum, DWORD iBKColor);
+		BOOL GetColumItemColor(int nIndex, int nColum, DWORD& iBKColor);
+
+	private:
+		void HideEditAndComboCtrl();
+	};
+
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+	class UILIB_API CListContainerHeaderItemUI : public CHorizontalLayoutUI
+	{
+		DECLARE_DUICONTROL(CListContainerHeaderItemUI)
+
+	public:
+		CListContainerHeaderItemUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		void SetEnabled(BOOL bEnable = TRUE);
+
+		BOOL IsDragable() const;
+		void SetDragable(BOOL bDragable);
+		DWORD GetSepWidth() const;
+		void SetSepWidth(int iWidth);
+		DWORD GetTextStyle() const;
+		void SetTextStyle(UINT uStyle);
+		DWORD GetTextColor() const;
+		void SetTextColor(DWORD dwTextColor);
+		void SetTextPadding(RECT rc);
+		RECT GetTextPadding() const;
+		void SetFont(int index);
+		BOOL IsShowHtml();
+		void SetShowHtml(BOOL bShowHtml = TRUE);
+		LPCTSTR GetNormalImage() const;
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage() const;
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetPushedImage() const;
+		void SetPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage() const;
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetSepImage() const;
+		void SetSepImage(LPCTSTR pStrImage);
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		RECT GetThumbRect() const;
+
+		void PaintText(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+
+	protected:
+		POINT ptLastMouse;
+		BOOL m_bDragable;
+		UINT m_uButtonState;
+		int m_iSepWidth;
+		DWORD m_dwTextColor;
+		int m_iFont;
+		UINT m_uTextStyle;
+		BOOL m_bShowHtml;
+		RECT m_rcTextPadding;
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sPushedImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sSepImage;
+		CDuiString m_sSepImageModify;
+
+		//支持编辑
+		BOOL m_bEditable;
+
+		//支持组合框
+		BOOL m_bComboable;
+
+		//支持复选框
+		BOOL m_bCheckBoxable;
+
+	public:
+		BOOL GetColumeEditable();
+		void SetColumeEditable(BOOL bEnable);
+
+		BOOL GetColumeComboable();
+		void SetColumeComboable(BOOL bEnable);
+
+		BOOL GetColumeCheckable();
+		void SetColumeCheckable(BOOL bEnable);
+
+	public:
+		void SetCheck(BOOL bCheck);
+		BOOL GetCheck();
+
+	private:
+		UINT	m_uCheckBoxState;
+		BOOL	m_bChecked;
+
+		CDuiString m_sCheckBoxNormalImage;
+		CDuiString m_sCheckBoxHotImage;
+		CDuiString m_sCheckBoxPushedImage;
+		CDuiString m_sCheckBoxFocusedImage;
+		CDuiString m_sCheckBoxDisabledImage;
+
+		CDuiString m_sCheckBoxSelectedImage;
+		CDuiString m_sCheckBoxForeImage;
+
+		SIZE m_cxyCheckBox;
+
+	public:
+		BOOL DrawCheckBoxImage(HDC hDC, LPCTSTR pStrImage, LPCTSTR pStrModify = NULL);
+		LPCTSTR GetCheckBoxNormalImage();
+		void SetCheckBoxNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxHotImage();
+		void SetCheckBoxHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxPushedImage();
+		void SetCheckBoxPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxFocusedImage();
+		void SetCheckBoxFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxDisabledImage();
+		void SetCheckBoxDisabledImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetCheckBoxSelectedImage();
+		void SetCheckBoxSelectedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxForeImage();
+		void SetCheckBoxForeImage(LPCTSTR pStrImage);
+
+		void GetCheckBoxRect(RECT &rc);	
+
+		int GetCheckBoxWidth() const;       // 实际大小位置使用GetPos获取,这里得到的是预设的参考值
+		void SetCheckBoxWidth(int cx);      // 预设的参考值
+		int GetCheckBoxHeight() const;      // 实际大小位置使用GetPos获取,这里得到的是预设的参考值
+		void SetCheckBoxHeight(int cy);     // 预设的参考值
+
+
+	public:
+		CContainerUI* m_pOwner;
+		void SetOwner(CContainerUI* pOwner);
+		CContainerUI* GetOwner();
+	};
+	 
+	/////////////////////////////////////////////////////////////////////////////////////
+	//
+
+	class UILIB_API CListTextExtElementUI : public CListLabelElementUI
+	{
+		DECLARE_DUICONTROL(CListTextExtElementUI)
+
+	public:
+		CListTextExtElementUI();
+		~CListTextExtElementUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		LPCTSTR GetText(int iIndex) const;
+		void SetText(int iIndex, LPCTSTR pstrText);
+
+		void SetOwner(CControlUI* pOwner);
+		CDuiString* GetLinkContent(int iIndex);
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+
+		void DrawItemText(HDC hDC, const RECT& rcItem);
+
+	protected:
+		enum { MAX_LINK = 8 };
+		int m_nLinks;
+		RECT m_rcLinks[MAX_LINK];
+		CDuiString m_sLinks[MAX_LINK];
+		int m_nHoverLink;
+		CListUI* m_pOwner;
+		CStdPtrArray m_aTexts;
+
+	private:
+		UINT	m_uCheckBoxState;
+		BOOL	m_bChecked;
+
+		CDuiString m_sCheckBoxNormalImage;
+		CDuiString m_sCheckBoxHotImage;
+		CDuiString m_sCheckBoxPushedImage;
+		CDuiString m_sCheckBoxFocusedImage;
+		CDuiString m_sCheckBoxDisabledImage;
+
+		CDuiString m_sCheckBoxSelectedImage;
+		CDuiString m_sCheckBoxForeImage;
+
+		SIZE m_cxyCheckBox;
+
+	public:
+		virtual bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+		virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		virtual void PaintStatusImage(HDC hDC);
+		BOOL DrawCheckBoxImage(HDC hDC, LPCTSTR pStrImage, LPCTSTR pStrModify, RECT& rcCheckBox);
+		LPCTSTR GetCheckBoxNormalImage();
+		void SetCheckBoxNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxHotImage();
+		void SetCheckBoxHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxPushedImage();
+		void SetCheckBoxPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxFocusedImage();
+		void SetCheckBoxFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxDisabledImage();
+		void SetCheckBoxDisabledImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetCheckBoxSelectedImage();
+		void SetCheckBoxSelectedImage(LPCTSTR pStrImage);
+		LPCTSTR GetCheckBoxForeImage();
+		void SetCheckBoxForeImage(LPCTSTR pStrImage);
+
+		void GetCheckBoxRect(int nIndex, RECT &rc);	
+		void GetColumRect(int nColum, RECT &rc);
+
+		int GetCheckBoxWidth() const;       // 实际大小位置使用GetPos获取,这里得到的是预设的参考值
+		void SetCheckBoxWidth(int cx);      // 预设的参考值
+		int GetCheckBoxHeight() const;      // 实际大小位置使用GetPos获取,这里得到的是预设的参考值
+		void SetCheckBoxHeight(int cy);     // 预设的参考值
+
+		void SetCheck(BOOL bCheck);
+		BOOL GetCheck() const;
+
+	public:
+		int HitTestColum(POINT ptMouse);
+		BOOL CheckColumEditable(int nColum);
+
+	private:
+		typedef struct tagColumColorNode
+		{
+			BOOL  bEnable;
+			DWORD iTextColor;
+			DWORD iBKColor;
+		}COLUMCOLORNODE;
+
+		COLUMCOLORNODE ColumCorlorArray[UILIST_MAX_COLUMNS];
+
+	public:
+		void SetColumItemColor(int nColum, DWORD iBKColor);
+		BOOL GetColumItemColor(int nColum, DWORD& iBKColor);
+
+	};
+} // namespace DuiLib
+
+#endif // __UILISTEX_H__

+ 238 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILoading.cpp

@@ -0,0 +1,238 @@
+#include "stdafx.h"
+#include "UILoading.h"
+#include <Gdiplus.h>
+
+using namespace DuiLib;
+using namespace Gdiplus;
+
+namespace
+{
+
+void DrawLine(Graphics* _objGraphics, PointF _objPointOne, PointF _objPointTwo, Color _objColor, int _intLineThickness)
+{
+    SolidBrush brush(_objColor);
+    Pen objPen(&brush, (Gdiplus::REAL)_intLineThickness);
+    {
+        objPen.SetStartCap(LineCap::LineCapRound);
+        objPen.SetEndCap(LineCap::LineCapRound);
+        _objGraphics->DrawLine(&objPen, _objPointOne, _objPointTwo);
+    }
+}
+
+PointF GetCoordinate(PointF _objCircleCenter, int _intRadius, double _dblAngle)
+{
+    double dblAngle = 3.14 * _dblAngle / 180;
+    PointF pf(_objCircleCenter.X + _intRadius * (float)cos(dblAngle), _objCircleCenter.Y + _intRadius * (float)sin(dblAngle));
+    return pf;
+}
+
+Color Darken(Color _objColor, int _intPercent)
+{
+    int intRed = _objColor.GetR();
+    int intGreen = _objColor.GetG();
+    int intBlue = _objColor.GetB();
+    Color color(_intPercent, min(intRed, 255), min(intGreen, 255), min(intBlue, 255));
+    return color;
+}
+
+double* GetSpokesAngles(int _intNumberSpoke)
+{
+    double* Angles = new double[_intNumberSpoke];
+    double dblAngle = (double)360 / _intNumberSpoke;
+    for (int shtCounter = 0; shtCounter < _intNumberSpoke; shtCounter++)
+    {
+        Angles[shtCounter] = (shtCounter == 0 ? dblAngle : Angles[shtCounter - 1] + dblAngle);
+    }
+    return Angles;
+}
+}
+
+IMPLEMENT_DUICONTROL(CLoadingUI)
+
+CLoadingUI::CLoadingUI()
+	: m_bStop(true)
+	, m_nTime(100)
+	, m_nNumber(0)
+	, m_Angles(nullptr)
+	, m_Colors(nullptr)
+	, m_NumberOfSpoke(10)
+	, m_SpokeThickness(4)
+	, m_OuterCircleRadius( 10)
+	, m_InnerCircleRadius (8)
+{
+
+}
+
+CLoadingUI::~CLoadingUI()
+{
+	Stop();
+
+    if(m_Angles) delete m_Angles;
+    if(m_Colors) delete m_Colors;
+}
+
+LPCTSTR CLoadingUI::GetClass() const
+{
+	return DUI_CTR_LOADINGCIRCLE;
+}
+
+LPVOID CLoadingUI::GetInterface(LPCTSTR pstrName)
+{
+	if (_tcscmp(pstrName, DUI_CTR_LOADINGCIRCLE) == 0) return static_cast<CLoadingUI*>(this);
+	return CControlUI::GetInterface(pstrName);
+}
+
+void CLoadingUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+{
+	if (_tcsicmp(pstrName, _T("style") ) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_nNumber = _tcstol(pstrValue, &pstr, 10);
+	}
+	else if (_tcsicmp(pstrName, _T("time") ) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_nTime = _tcstol(pstrValue, &pstr, 10);
+	}
+	else if (_tcsicmp(pstrName, _T("spoke") ) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_NumberOfSpoke = _tcstol(pstrValue, &pstr, 0);
+	}
+	else if (_tcsicmp(pstrName, _T("thickness")) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_SpokeThickness = _tcstol(pstrValue, &pstr, 0);
+	}
+	else if (_tcsicmp(pstrName, _T("outradius")) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_OuterCircleRadius = _tcstol(pstrValue, &pstr, 0);
+	}
+	else if (_tcsicmp(pstrName, _T("innerradius")) == 0)
+	{
+		LPTSTR pstr = NULL;
+		m_InnerCircleRadius = _tcstol(pstrValue, &pstr, 0);
+	}
+	else if (_tcsicmp(pstrName, _T("color")) == 0)
+	{
+		while (*pstrValue > _T('\0') && *pstrValue <= _T(' ')) pstrValue = ::CharNext(pstrValue);
+		if (*pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+		LPTSTR pstr = NULL;
+		DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+		m_Color.SetValue(clrColor);
+	}
+	else
+	{
+		__super::SetAttribute(pstrName, pstrValue);
+	}
+}
+
+void CLoadingUI::PaintBkImage(HDC hDC)
+{
+	m_CenterPoint.X = (Gdiplus::REAL)this->GetWidth() / 2;
+	m_CenterPoint.Y = (Gdiplus::REAL)this->GetHeight() / 2;
+	if (m_NumberOfSpoke > 0)
+	{
+		Image* img = new Bitmap(this->GetWidth(), this->GetHeight());
+		Graphics g(img);
+		g.SetSmoothingMode(SmoothingMode::SmoothingModeHighQuality);
+
+		int intPosition = m_ProgressValue;
+		for (int intCounter = 0; intCounter < m_NumberOfSpoke; intCounter++)
+		{
+			intPosition = intPosition % m_NumberOfSpoke;
+			DrawLine(&g,
+				GetCoordinate(m_CenterPoint, m_InnerCircleRadius, m_Angles[intPosition]),
+				GetCoordinate(m_CenterPoint, m_OuterCircleRadius, m_Angles[intPosition]),
+				m_Colors[intCounter], m_SpokeThickness);
+			intPosition++;
+		}
+		// 获得窗口的Graphics对象
+		Graphics gh(hDC);
+		// 将描画好的CacheImage画到窗口上
+		gh.DrawImage(img, m_rcItem.left, m_rcItem.top);
+		delete img;
+	}
+}
+
+Color* CLoadingUI::GenerateColorsPallet(Color _objColor, bool _blnShadeColor, int _intNbSpoke)
+{
+	Color* objColors = new Color[m_NumberOfSpoke];
+	byte bytIncrement = (byte)(255 / m_NumberOfSpoke);
+	byte PERCENTAGE_OF_DARKEN = 0;
+	for (int intCursor = 0; intCursor < m_NumberOfSpoke; intCursor++)
+	{
+		if (_blnShadeColor)
+		{
+			if (intCursor == 0 || intCursor < m_NumberOfSpoke - _intNbSpoke)
+			{
+				objColors[intCursor] = _objColor;
+			}
+			else
+			{
+				PERCENTAGE_OF_DARKEN += bytIncrement;
+				if (PERCENTAGE_OF_DARKEN > 255)
+				{
+					PERCENTAGE_OF_DARKEN = 255;
+				}
+				objColors[intCursor] = Darken(_objColor, PERCENTAGE_OF_DARKEN);
+			}
+		}
+		else
+		{
+			objColors[intCursor] = _objColor;
+		}
+	}
+	return objColors;
+}
+
+void CLoadingUI::Start()
+{
+	if (m_nTime > 0 && m_pManager && m_bStop == true)
+	{
+		m_pManager->SetTimer(this, kTimerLoadingId, m_nTime);
+	}
+	m_bStop = false;
+}
+
+void CLoadingUI::Stop()
+{
+	m_bStop = true;
+	if (m_pManager)
+	{
+		m_pManager->KillTimer(this, kTimerLoadingId);
+	}
+}
+
+void CLoadingUI::Init()
+{
+	CControlUI::Init();
+	m_Angles = GetSpokesAngles(m_NumberOfSpoke);
+	m_Colors = GenerateColorsPallet(m_Color, true, m_NumberOfSpoke);
+	Start();
+}
+
+void DuiLib::CLoadingUI::DoEvent(TEventUI& event)
+{
+    if (event.Type == UIEVENT_TIMER && event.wParam == kTimerLoadingId)
+    {
+        m_ProgressValue = ++m_ProgressValue % m_NumberOfSpoke;
+        Invalidate();
+    }
+    else
+    {
+        CControlUI::DoEvent(event);
+    }
+}
+
+CControlUI* CreateLoadingControl(LPCTSTR pstrType)
+{
+	if (_tcsicmp(pstrType, DUI_CTR_LOADINGCIRCLE) == 0)
+	{
+		return new CLoadingUI();
+	}
+
+	return NULL;
+}
+

+ 60 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UILoading.h

@@ -0,0 +1,60 @@
+#ifndef __UILoadingCircle_H
+#define __UILoadingCircle_H
+
+namespace DuiLib
+{
+
+enum StylePresets
+{
+	Custom,
+	MacOSX,
+	Firefox,
+	IE7
+};
+
+class UILIB_API CLoadingUI : public CControlUI
+{
+    DECLARE_DUICONTROL(CControlUI)
+
+	enum TIMEID
+	{
+		kTimerLoadingId = 100,
+	};
+public:
+	CLoadingUI();
+	virtual ~CLoadingUI();
+
+	LPCTSTR GetClass() const;
+	LPVOID GetInterface(LPCTSTR pstrName);
+
+	virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+	void Start();
+	void Stop();
+protected:
+    virtual void PaintBkImage(HDC hDC);
+    virtual void DoEvent(TEventUI& event);
+	virtual void Init();
+	Gdiplus::Color* GenerateColorsPallet(Gdiplus::Color _objColor, bool _blnShadeColor, int _intNbSpoke);
+
+protected:
+	int                 m_nNumber;
+	int                 m_nTime;
+	bool				m_bStop;
+
+	int m_NumberOfSpoke;//辐条数量
+	int m_SpokeThickness;//辐条粗细
+	int m_ProgressValue;//------------------------
+	int m_OuterCircleRadius;//外圈
+	int m_InnerCircleRadius;//内圈
+	Gdiplus::PointF m_CenterPoint;//二维平面的点
+	Gdiplus::Color m_Color;
+	Gdiplus::Color* m_Colors;
+	double* m_Angles;
+};
+
+CControlUI* CreateLoadingControl(LPCTSTR pstrType);
+
+}
+
+
+#endif //__UILoadingCircle_H

Diferenças do arquivo suprimidas por serem muito extensas
+ 1200 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIMenu.cpp


+ 394 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIMenu.h

@@ -0,0 +1,394 @@
+#ifndef __UIMENU_H__
+#define __UIMENU_H__
+
+#pragma once
+
+#include "../Utils/observer_impl_base.h"
+
+namespace DuiLib {
+
+struct ContextMenuParam
+{
+	// 1: remove all
+	// 2: remove the sub menu
+	WPARAM wParam;
+	HWND hWnd;
+};
+
+struct MenuItemInfo
+{
+	TCHAR szName[256];
+	bool bChecked;
+};
+struct MenuCmd
+{
+	TCHAR szName[256];
+	TCHAR szUserData[1024];
+	TCHAR szText[1024];
+	BOOL bChecked;
+};
+
+enum MenuAlignment
+{
+	eMenuAlignment_Left = 1 << 1,
+	eMenuAlignment_Top = 1 << 2,
+	eMenuAlignment_Right = 1 << 3,
+	eMenuAlignment_Bottom = 1 << 4,
+};
+
+
+enum MenuItemDefaultInfo
+{
+	ITEM_DEFAULT_HEIGHT = 30,		//每一个item的默认高度(只在竖状排列时自定义)
+	ITEM_DEFAULT_WIDTH = 150,		//窗口的默认宽度
+
+	ITEM_DEFAULT_ICON_WIDTH = 26,	//默认图标所占宽度
+	ITEM_DEFAULT_ICON_SIZE = 16,	//默认图标的大小
+
+	ITEM_DEFAULT_EXPLAND_ICON_WIDTH = 20,	//默认下级菜单扩展图标所占宽度
+	ITEM_DEFAULT_EXPLAND_ICON_SIZE = 9,		//默认下级菜单扩展图标的大小
+
+	DEFAULT_LINE_LEFT_INSET = ITEM_DEFAULT_ICON_WIDTH + 3,	//默认分隔线的左边距
+	DEFAULT_LINE_RIGHT_INSET = 7,	//默认分隔线的右边距
+	DEFAULT_LINE_HEIGHT = 6,		//默认分隔线所占高度
+	DEFAULT_LINE_COLOR = 0xFFBCBFC4	//默认分隔线颜色
+
+};
+
+///////////////////////////////////////////////
+class MenuMenuReceiverImplBase;
+class MenuMenuObserverImplBase
+{
+public:
+	virtual void AddReceiver(MenuMenuReceiverImplBase* receiver) = 0;
+	virtual void RemoveReceiver(MenuMenuReceiverImplBase* receiver) = 0;
+	virtual BOOL RBroadcast(ContextMenuParam param) = 0;
+};
+/////////////////////////////////////////////////
+class MenuMenuReceiverImplBase
+{
+public:
+	virtual void AddObserver(MenuMenuObserverImplBase* observer) = 0;
+	virtual void RemoveObserver() = 0;
+	virtual BOOL Receive(ContextMenuParam param) = 0;
+};
+/////////////////////////////////////////////////
+
+class MenuReceiverImpl;
+class UILIB_API MenuObserverImpl : public MenuMenuObserverImplBase
+{
+	friend class Iterator;
+public:
+	MenuObserverImpl():
+	m_pMainWndPaintManager(NULL),
+	m_pMenuCheckInfo(NULL)
+	{
+		pReceivers_ = new ReceiversVector;
+	}
+
+	~MenuObserverImpl()
+	{
+		if (pReceivers_ != NULL)
+		{
+			delete pReceivers_;
+			pReceivers_ = NULL;
+		}
+		
+	}
+
+	virtual void AddReceiver(MenuMenuReceiverImplBase* receiver)
+	{
+		if (receiver == NULL)
+			return;
+
+		pReceivers_->push_back(receiver);
+		receiver->AddObserver(this);
+	}
+
+	virtual void RemoveReceiver(MenuMenuReceiverImplBase* receiver)
+	{
+		if (receiver == NULL)
+			return;
+
+		ReceiversVector::iterator it = pReceivers_->begin();
+		for (; it != pReceivers_->end(); ++it)
+		{
+			if (*it == receiver)
+			{
+				pReceivers_->erase(it);
+				break;
+			}
+		}
+	}
+
+	virtual BOOL RBroadcast(ContextMenuParam param)
+	{
+		ReceiversVector::reverse_iterator it = pReceivers_->rbegin();
+		for (; it != pReceivers_->rend(); ++it)
+		{
+			(*it)->Receive(param);
+		}
+
+		return BOOL();
+	}
+
+
+	class Iterator
+	{
+		MenuObserverImpl & _tbl;
+		DWORD index;
+		MenuMenuReceiverImplBase* ptr;
+	public:
+		Iterator( MenuObserverImpl & table )
+			: _tbl( table ), index(0), ptr(NULL)
+		{}
+
+		Iterator( const Iterator & v )
+			: _tbl( v._tbl ), index(v.index), ptr(v.ptr)
+		{}
+
+		MenuMenuReceiverImplBase* next()
+		{
+			if ( index >= _tbl.pReceivers_->size() )
+				return NULL;
+
+			for ( ; index < _tbl.pReceivers_->size(); )
+			{
+				ptr = (*(_tbl.pReceivers_))[ index++ ];
+				if ( ptr )
+					return ptr;
+			}
+			return NULL;
+		}
+	};
+
+	virtual void SetManger(CPaintManagerUI* pManager)
+	{
+		if (pManager != NULL)
+			m_pMainWndPaintManager = pManager;
+	}
+
+	virtual CPaintManagerUI* GetManager() const
+	{
+		return m_pMainWndPaintManager;
+	}
+
+	virtual void SetMenuCheckInfo(CStdStringPtrMap* pInfo)
+	{
+		if (pInfo != NULL)
+			m_pMenuCheckInfo = pInfo;
+		else
+			m_pMenuCheckInfo = NULL;
+	}
+
+	virtual CStdStringPtrMap* GetMenuCheckInfo() const
+	{
+		return m_pMenuCheckInfo;
+	}
+
+protected:
+	typedef std::vector<MenuMenuReceiverImplBase*> ReceiversVector;
+	ReceiversVector *pReceivers_;
+	CPaintManagerUI* m_pMainWndPaintManager;
+	CStdStringPtrMap* m_pMenuCheckInfo;
+};
+
+////////////////////////////////////////////////////
+class UILIB_API MenuReceiverImpl : public MenuMenuReceiverImplBase
+{
+public:
+	MenuReceiverImpl()
+	{
+		pObservers_ = new ObserversVector;
+	}
+
+	~MenuReceiverImpl()
+	{
+		if (pObservers_ != NULL)
+		{
+			delete pObservers_;
+			pObservers_ = NULL;
+		}
+	}
+
+	virtual void AddObserver(MenuMenuObserverImplBase* observer)
+	{
+		pObservers_->push_back(observer);
+	}
+
+	virtual void RemoveObserver()
+	{
+		if (!pObservers_) return;
+
+		ObserversVector::iterator it = pObservers_->begin();
+		for (; it != pObservers_->end(); ++it)
+		{
+			(*it)->RemoveReceiver(this);
+		}
+	}
+
+	virtual BOOL Receive(ContextMenuParam param)
+	{
+		return BOOL();
+	}
+
+protected:
+	typedef std::vector<MenuMenuObserverImplBase*> ObserversVector;
+	ObserversVector* pObservers_;
+};
+
+/////////////////////////////////////////////////////////////////////////////////////
+//
+
+class CListUI;
+class CMenuWnd;
+class UILIB_API CMenuUI : public CListUI
+{
+	DECLARE_DUICONTROL(CMenuUI)
+public:
+	CMenuUI();
+	virtual ~CMenuUI();
+	CMenuWnd*	m_pWindow;
+    LPCTSTR GetClass() const;
+    LPVOID GetInterface(LPCTSTR pstrName);
+	UINT GetListType();
+
+	virtual void DoEvent(TEventUI& event);
+
+    virtual bool Add(CControlUI* pControl);
+    virtual bool AddAt(CControlUI* pControl, int iIndex);
+
+    virtual int GetItemIndex(CControlUI* pControl) const;
+    virtual bool SetItemIndex(CControlUI* pControl, int iIndex);
+    virtual bool Remove(CControlUI* pControl);
+
+	SIZE EstimateSize(SIZE szAvailable);
+
+	void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) ;
+};
+
+/////////////////////////////////////////////////////////////////////////////////////
+//
+
+class CMenuElementUI;
+class UILIB_API CMenuWnd : public CWindowWnd, public MenuReceiverImpl, public INotifyUI, public IDialogBuilderCallback
+{
+public:
+	static MenuObserverImpl& GetGlobalContextMenuObserver()
+	{
+		static MenuObserverImpl s_context_menu_observer;
+		return s_context_menu_observer;
+	}
+	static CMenuWnd* CreateMenu(CMenuElementUI* pOwner, STRINGorID xml, POINT point,
+		CPaintManagerUI* pMainPaintManager, CStdStringPtrMap* pMenuCheckInfo = NULL,
+		DWORD dwAlignment = eMenuAlignment_Left | eMenuAlignment_Top);
+	static void DestroyMenu();
+	static MenuItemInfo* SetMenuItemInfo(LPCTSTR pstrName, bool bChecked);
+
+public:
+	CMenuWnd();
+	~CMenuWnd();
+	void Close(UINT nRet = IDOK);
+	bool isClosing;
+	/*
+	 *	@pOwner 一级菜单不要指定这个参数,这是菜单内部使用的
+	 *	@xml	菜单的布局文件
+	 *	@point	菜单的左上角坐标
+	 *	@pMainPaintManager	菜单的父窗体管理器指针
+	 *	@pMenuCheckInfo	保存菜单的单选和复选信息结构指针
+	 *	@dwAlignment		菜单的出现位置,默认出现在鼠标的右下侧。
+	 */
+
+    void Init(CMenuElementUI* pOwner, STRINGorID xml, POINT point,
+		CPaintManagerUI* pMainPaintManager, CStdStringPtrMap* pMenuCheckInfo = NULL,
+		DWORD dwAlignment = eMenuAlignment_Left | eMenuAlignment_Top);
+    LPCTSTR GetWindowClassName() const;
+    void OnFinalMessage(HWND hWnd);
+	void Notify(TNotifyUI& msg);
+	CControlUI* CreateControl(LPCTSTR pstrClassName);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+    LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	BOOL Receive(ContextMenuParam param);
+
+	// 获取根菜单控件,用于动态添加子菜单
+	CMenuUI* GetMenuUI();
+
+	// 重新调整菜单的大小
+	void ResizeMenu();
+
+	// 重新调整子菜单的大小
+	void ResizeSubMenu();
+	void setDPI(int DPI);
+
+public:
+
+	POINT			m_BasedPoint;
+	STRINGorID		m_xml;
+    CPaintManagerUI m_pm;
+    CMenuElementUI* m_pOwner;
+    CMenuUI*	m_pLayout;
+	DWORD		m_dwAlignment;	//菜单对齐方式
+};
+
+class CListContainerElementUI;
+class UILIB_API CMenuElementUI : public CListContainerElementUI
+{
+	DECLARE_DUICONTROL(CMenuElementUI)
+	friend CMenuWnd;
+public:
+    CMenuElementUI();
+	~CMenuElementUI();
+
+    LPCTSTR GetClass() const;
+    LPVOID GetInterface(LPCTSTR pstrName);
+    bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+	void DrawItemText(HDC hDC, const RECT& rcItem);
+	SIZE EstimateSize(SIZE szAvailable);
+
+	void DoEvent(TEventUI& event);
+
+	CMenuWnd* GetMenuWnd();
+	void CreateMenuWnd();
+	
+	void SetLineType();
+	void SetLineColor(DWORD color);
+	DWORD GetLineColor() const;
+	void SetLinePadding(RECT rcInset);
+	RECT GetLinePadding() const;
+	void SetIcon(LPCTSTR strIcon);
+	void SetIconSize(LONG cx, LONG cy);
+	SIZE GetIconSize();
+	void DrawItemIcon(HDC hDC, const RECT& rcItem);
+	void SetChecked(bool bCheck = true);
+	bool GetChecked() const;
+	void SetCheckItem(bool bCheckItem = false);
+	bool GetCheckItem() const;
+
+	void SetShowExplandIcon(bool bShow);
+	void DrawItemExpland(HDC hDC, const RECT& rcItem);
+
+	void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+	MenuItemInfo* GetItemInfo(LPCTSTR pstrName);
+	MenuItemInfo* SetItemInfo(LPCTSTR pstrName, bool bChecked);
+protected:
+	CMenuWnd*	m_pWindow;
+
+	bool		m_bDrawLine;	//画分隔线
+	DWORD		m_dwLineColor;  //分隔线颜色
+	RECT		m_rcLinePadding;	//分割线的左右边距
+
+	SIZE		m_szIconSize; 	//画图标
+	CDuiString	m_strIcon;
+	bool		m_bCheckItem;
+
+	bool		m_bShowExplandIcon;
+};
+
+} // namespace DuiLib
+
+#endif // __UIMENU_H__

+ 468 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIOption.cpp

@@ -0,0 +1,468 @@
+#include "StdAfx.h"
+#include "UIOption.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(COptionUI)
+	COptionUI::COptionUI() : m_bSelected(false) ,m_iSelectedFont(-1), m_dwSelectedTextColor(0), m_dwSelectedBkColor(0), m_nSelectedStateCount(0)
+	{
+	}
+
+	COptionUI::~COptionUI()
+	{
+		if( !m_sGroupName.IsEmpty() && m_pManager ) m_pManager->RemoveOptionGroup(m_sGroupName, this);
+	}
+
+	LPCTSTR COptionUI::GetClass() const
+	{
+		return _T("OptionUI");
+	}
+
+	LPVOID COptionUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_OPTION) == 0 ) return static_cast<COptionUI*>(this);
+		return CButtonUI::GetInterface(pstrName);
+	}
+
+	void COptionUI::SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit)
+	{
+		CControlUI::SetManager(pManager, pParent, bInit);
+		if( bInit && !m_sGroupName.IsEmpty() ) {
+			if (m_pManager) m_pManager->AddOptionGroup(m_sGroupName, this);
+		}
+	}
+
+	LPCTSTR COptionUI::GetGroup() const
+	{
+		return m_sGroupName;
+	}
+
+	void COptionUI::SetGroup(LPCTSTR pStrGroupName)
+	{
+		if( pStrGroupName == NULL ) {
+			if( m_sGroupName.IsEmpty() ) return;
+			m_sGroupName.Empty();
+		}
+		else {
+			if( m_sGroupName == pStrGroupName ) return;
+			if (!m_sGroupName.IsEmpty() && m_pManager) m_pManager->RemoveOptionGroup(m_sGroupName, this);
+			m_sGroupName = pStrGroupName;
+		}
+
+		if( !m_sGroupName.IsEmpty() ) {
+			if (m_pManager) m_pManager->AddOptionGroup(m_sGroupName, this);
+		}
+		else {
+			if (m_pManager) m_pManager->RemoveOptionGroup(m_sGroupName, this);
+		}
+
+		Selected(m_bSelected);
+	}
+
+	LPCTSTR COptionUI::GetGroupType() const
+	{
+		return m_sGroupType;
+	}
+
+	void COptionUI::SetGroupType(LPCTSTR pStrGroupType)
+	{
+		if( pStrGroupType == NULL ) {
+			if( m_sGroupType.IsEmpty() ) return;
+			m_sGroupType.Empty();
+		}
+		else {
+			m_sGroupType = pStrGroupType;
+		}
+	}
+
+	bool COptionUI::IsSelected() const
+	{
+		return m_bSelected;
+	}
+
+	void COptionUI::Selected(bool bSelected, bool bMsg/* = true*/)
+	{
+		if(m_bSelected == bSelected) return;
+
+		m_bSelected = bSelected;
+		if( m_bSelected ) m_uButtonState |= UISTATE_SELECTED;
+		else m_uButtonState &= ~UISTATE_SELECTED;
+
+		if( m_pManager != NULL ) {
+			if( !m_sGroupName.IsEmpty() ) {
+				if( m_bSelected ) {
+					CStdPtrArray* aOptionGroup = m_pManager->GetOptionGroup(m_sGroupName);
+					for( int i = 0; i < aOptionGroup->GetSize(); i++ ) {
+						COptionUI* pControl = static_cast<COptionUI*>(aOptionGroup->GetAt(i));
+						if( pControl != this && (m_sGroupType.IsEmpty() || m_sGroupType.CompareNoCase(pControl->GetGroupType()) != 0)) {
+							pControl->Selected(false, bMsg);
+						}
+					}
+					if(bMsg) {
+						m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
+					}
+				}
+				else {
+					if(bMsg) {
+						m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
+					}
+				}
+			}
+			else {
+				if(bMsg) {
+					m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
+				}
+			}
+		}
+
+		Invalidate();
+	}
+
+	bool COptionUI::Activate()
+	{
+		if( !CButtonUI::Activate() ) return false;
+		if( !m_sGroupName.IsEmpty() ) {
+			Selected(true);
+		}
+		else Selected(!m_bSelected);
+		
+		Invalidate();
+		return true;
+	}
+
+	LPCTSTR COptionUI::GetSelectedImage()
+	{
+		return m_sSelectedImage;
+	}
+
+	void COptionUI::SetSelectedImage(LPCTSTR pStrImage)
+	{
+		m_sSelectedImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR COptionUI::GetSelectedHotImage()
+	{
+		return m_sSelectedHotImage;
+	}
+
+	void COptionUI::SetSelectedHotImage( LPCTSTR pStrImage )
+	{
+		m_sSelectedHotImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR COptionUI::GetSelectedPushedImage()
+	{
+		return m_sSelectedPushedImage;
+	}
+
+	void COptionUI::SetSelectedPushedImage(LPCTSTR pStrImage)
+	{
+		m_sSelectedPushedImage = pStrImage;
+		Invalidate();
+	}
+
+	void COptionUI::SetSelectedTextColor(DWORD dwTextColor)
+	{
+		m_dwSelectedTextColor = dwTextColor;
+	}
+
+	DWORD COptionUI::GetSelectedTextColor()
+	{
+		if (m_dwSelectedTextColor == 0) m_dwSelectedTextColor = m_pManager->GetDefaultFontColor();
+		return m_dwSelectedTextColor;
+	}
+
+	void COptionUI::SetSelectedBkColor( DWORD dwBkColor )
+	{
+		m_dwSelectedBkColor = dwBkColor;
+	}
+
+	DWORD COptionUI::GetSelectBkColor()
+	{
+		return m_dwSelectedBkColor;
+	}
+
+	LPCTSTR COptionUI::GetSelectedForedImage()
+	{
+		return m_sSelectedForeImage;
+	}
+
+	void COptionUI::SetSelectedForedImage(LPCTSTR pStrImage)
+	{
+		m_sSelectedForeImage = pStrImage;
+		Invalidate();
+	}
+
+	void COptionUI::SetSelectedStateCount(int nCount)
+	{
+		m_nSelectedStateCount = nCount;
+		Invalidate();
+	}
+
+	int COptionUI::GetSelectedStateCount() const
+	{
+		return m_nSelectedStateCount;
+	}
+
+	LPCTSTR COptionUI::GetSelectedStateImage()
+	{
+		return m_sSelectedStateImage;
+	}
+
+	void COptionUI::SetSelectedStateImage( LPCTSTR pStrImage )
+	{
+		m_sSelectedStateImage = pStrImage;
+		Invalidate();
+	}
+	void COptionUI::SetSelectedFont(int index)
+	{
+		m_iSelectedFont = index;
+		Invalidate();
+	}
+
+	int COptionUI::GetSelectedFont() const
+	{
+		return m_iSelectedFont;
+	}
+	void COptionUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("group")) == 0 ) SetGroup(pstrValue);
+		else if( _tcsicmp(pstrName, _T("grouptype")) == 0 ) SetGroupType(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selected")) == 0 ) Selected(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcsicmp(pstrName, _T("selectedimage")) == 0 ) SetSelectedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selectedhotimage")) == 0 ) SetSelectedHotImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selectedpushedimage")) == 0 ) SetSelectedPushedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selectedforeimage")) == 0 ) SetSelectedForedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selectedstateimage")) == 0 ) SetSelectedStateImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("selectedstatecount")) == 0 ) SetSelectedStateCount(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("selectedbkcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetSelectedBkColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("selectedtextcolor")) == 0 ) {
+			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+			LPTSTR pstr = NULL;
+			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+			SetSelectedTextColor(clrColor);
+		}
+		else if( _tcsicmp(pstrName, _T("selectedfont")) == 0 ) SetSelectedFont(_ttoi(pstrValue));
+		else CButtonUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void COptionUI::PaintBkColor(HDC hDC)
+	{
+		if(IsSelected()) {
+			if(m_dwSelectedBkColor != 0) {
+				CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwSelectedBkColor));
+			}
+		}
+		else {
+			return CButtonUI::PaintBkColor(hDC);
+		}
+	}
+
+	void COptionUI::PaintStatusImage(HDC hDC)
+	{
+		if(IsSelected()) {
+			if(!m_sSelectedStateImage.IsEmpty() && m_nSelectedStateCount > 0)
+			{
+				TDrawInfo info;
+				info.Parse(m_sSelectedStateImage, _T(""), m_pManager);
+				const TImageInfo* pImage = m_pManager->GetImageEx(info.sImageName, info.sResType, info.dwMask, info.bHSL, info.bGdiplus);
+				if(m_sSelectedImage.IsEmpty() && pImage != NULL)
+				{
+					SIZE szImage = {pImage->nX, pImage->nY};
+					SIZE szStatus = {pImage->nX / m_nSelectedStateCount, pImage->nY};
+					if( szImage.cx > 0 && szImage.cy > 0 )
+					{
+						RECT rcSrc = {0, 0, szImage.cx, szImage.cy};
+						if(m_nSelectedStateCount > 0) {
+							int iLeft = rcSrc.left + 0 * szStatus.cx;
+							int iRight = iLeft + szStatus.cx;
+							int iTop = rcSrc.top;
+							int iBottom = iTop + szStatus.cy;
+							m_sSelectedImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d' corner='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom, info.rcCorner.left, info.rcCorner.top, info.rcCorner.right, info.rcCorner.bottom);
+						}
+						if(m_nSelectedStateCount > 1) {
+							int iLeft = rcSrc.left + 1 * szStatus.cx;
+							int iRight = iLeft + szStatus.cx;
+							int iTop = rcSrc.top;
+							int iBottom = iTop + szStatus.cy;
+							m_sSelectedHotImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d' corner='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom, info.rcCorner.left, info.rcCorner.top, info.rcCorner.right, info.rcCorner.bottom);
+							m_sSelectedPushedImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d' corner='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom, info.rcCorner.left, info.rcCorner.top, info.rcCorner.right, info.rcCorner.bottom);
+						}
+						if(m_nSelectedStateCount > 2) {
+							int iLeft = rcSrc.left + 2 * szStatus.cx;
+							int iRight = iLeft + szStatus.cx;
+							int iTop = rcSrc.top;
+							int iBottom = iTop + szStatus.cy;
+							m_sSelectedPushedImage.Format(_T("res='%s' restype='%s' dest='%d,%d,%d,%d' source='%d,%d,%d,%d' corner='%d,%d,%d,%d'"), info.sImageName.GetData(), info.sResType.GetData(), info.rcDest.left, info.rcDest.top, info.rcDest.right, info.rcDest.bottom, iLeft, iTop, iRight, iBottom, info.rcCorner.left, info.rcCorner.top, info.rcCorner.right, info.rcCorner.bottom);
+						}
+					}
+				}
+			}
+
+			if( (m_uButtonState & UISTATE_PUSHED) != 0 && !m_sSelectedPushedImage.IsEmpty()) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sSelectedPushedImage) ) {}
+				else return;
+			}
+			else if( (m_uButtonState & UISTATE_HOT) != 0 && !m_sSelectedHotImage.IsEmpty()) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sSelectedHotImage) ) {}
+				else return;
+			}
+
+			if( !m_sSelectedImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sSelectedImage) ) {}
+			}
+		}
+		else {
+			CButtonUI::PaintStatusImage(hDC);
+		}
+	}
+
+	void COptionUI::PaintForeImage(HDC hDC)
+	{
+		if(IsSelected()) {
+			if( !m_sSelectedForeImage.IsEmpty() ) {
+				if( !DrawImage(hDC, (LPCTSTR)m_sSelectedForeImage) ) {}
+				else return;
+			}
+		}
+
+		return CButtonUI::PaintForeImage(hDC);
+	}
+
+	void COptionUI::PaintText(HDC hDC)
+	{
+		if( (m_uButtonState & UISTATE_SELECTED) != 0 )
+		{
+			DWORD oldTextColor = m_dwTextColor;
+			if( m_dwSelectedTextColor != 0 ) m_dwTextColor = m_dwSelectedTextColor;
+
+			if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+			if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+
+			int iFont = GetFont();
+			if(GetSelectedFont() != -1) {
+				iFont = GetSelectedFont();
+			}
+			CDuiString sText = GetText();
+			if( sText.IsEmpty() ) return;
+			int nLinks = 0;
+			RECT rc = m_rcItem;
+			RECT rcTextPadding = GetTextPadding();
+			rc.left += rcTextPadding.left;
+			rc.right -= rcTextPadding.right;
+			rc.top += rcTextPadding.top;
+			rc.bottom -= rcTextPadding.bottom;
+			
+			if( m_bShowHtml )
+				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \
+				NULL, NULL, nLinks, iFont, m_uTextStyle);
+			else
+				CRenderEngine::DrawText(hDC, m_pManager, rc, sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \
+				iFont, m_uTextStyle);
+
+			m_dwTextColor = oldTextColor;
+		}
+		else
+			CButtonUI::PaintText(hDC);
+	}
+
+	//////////////////////////////////////////////////////////////////////////////////////////////////
+	//
+	IMPLEMENT_DUICONTROL(CCheckBoxUI)
+
+	CCheckBoxUI::CCheckBoxUI() : m_bAutoCheck(false)
+	{
+
+	}
+
+	LPCTSTR CCheckBoxUI::GetClass() const
+	{
+		return _T("CheckBoxUI");
+	}
+	LPVOID CCheckBoxUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_CHECKBOX) == 0 ) return static_cast<CCheckBoxUI*>(this);
+		return COptionUI::GetInterface(pstrName);
+	}
+
+	void CCheckBoxUI::SetCheck(bool bCheck)
+	{
+		Selected(bCheck);
+	}
+
+	bool  CCheckBoxUI::GetCheck() const
+	{
+		return IsSelected();
+	}
+
+	void CCheckBoxUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("EnableAutoCheck")) == 0 ) SetAutoCheck(_tcsicmp(pstrValue, _T("true")) == 0);
+		
+		COptionUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CCheckBoxUI::SetAutoCheck(bool bEnable)
+	{
+		m_bAutoCheck = bEnable;
+	}
+
+	void CCheckBoxUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else COptionUI::DoEvent(event);
+			return;
+		}
+
+		if( m_bAutoCheck && (event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK)) {
+			if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) {
+				SetCheck(!GetCheck()); 
+				m_pManager->SendNotify(this, DUI_MSGTYPE_CHECKCLICK, 0, 0);
+				Invalidate();
+			}
+			return;
+		}
+		COptionUI::DoEvent(event);
+	}
+
+	void CCheckBoxUI::Selected(bool bSelected, bool bMsg/* = true*/)
+	{
+		if( m_bSelected == bSelected ) return;
+
+		m_bSelected = bSelected;
+		if( m_bSelected ) m_uButtonState |= UISTATE_SELECTED;
+		else m_uButtonState &= ~UISTATE_SELECTED;
+
+		if( m_pManager != NULL ) {
+			if( !m_sGroupName.IsEmpty() ) {
+				if( m_bSelected ) {
+					CStdPtrArray* aOptionGroup = m_pManager->GetOptionGroup(m_sGroupName);
+					for( int i = 0; i < aOptionGroup->GetSize(); i++ ) {
+						COptionUI* pControl = static_cast<COptionUI*>(aOptionGroup->GetAt(i));
+						if( pControl != this ) {
+							pControl->Selected(false, bMsg);
+						}
+					}
+					if(bMsg) {
+						m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED, m_bSelected, 0);
+					}
+				}
+			}
+			else {
+				if(bMsg) {
+					m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED, m_bSelected, 0);
+				}
+			}
+		}
+
+		Invalidate();
+	}
+}

+ 106 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIOption.h

@@ -0,0 +1,106 @@
+#ifndef __UIOPTION_H__
+#define __UIOPTION_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API COptionUI : public CButtonUI
+	{
+		DECLARE_DUICONTROL(COptionUI)
+	public:
+		COptionUI();
+		virtual ~COptionUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		void SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit = true);
+
+		bool Activate();
+
+		LPCTSTR GetSelectedImage();
+		void SetSelectedImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetSelectedHotImage();
+		void SetSelectedHotImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetSelectedPushedImage();
+		void SetSelectedPushedImage(LPCTSTR pStrImage);
+
+		void SetSelectedTextColor(DWORD dwTextColor);
+		DWORD GetSelectedTextColor();
+
+		void SetSelectedBkColor(DWORD dwBkColor);
+		DWORD GetSelectBkColor();
+
+		LPCTSTR GetSelectedForedImage();
+		void SetSelectedForedImage(LPCTSTR pStrImage);
+
+		void SetSelectedStateCount(int nCount);
+		int GetSelectedStateCount() const;
+		virtual LPCTSTR GetSelectedStateImage();
+		virtual void SetSelectedStateImage(LPCTSTR pStrImage);
+
+		void SetSelectedFont(int index);
+		int GetSelectedFont() const;
+
+		LPCTSTR GetGroup() const;
+		void SetGroup(LPCTSTR pStrGroupName = NULL);
+		LPCTSTR GetGroupType() const;
+		void SetGroupType(LPCTSTR pStrGroupType = NULL);
+
+		bool IsSelected() const;
+		virtual void Selected(bool bSelected, bool bMsg = true);
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		void PaintBkColor(HDC hDC);
+		void PaintStatusImage(HDC hDC);
+		void PaintForeImage(HDC hDC);
+		void PaintText(HDC hDC);
+
+	protected:
+		bool			m_bSelected;
+		CDuiString		m_sGroupName;
+		CDuiString		m_sGroupType;
+
+		int				m_iSelectedFont;
+
+		DWORD			m_dwSelectedBkColor;
+		DWORD			m_dwSelectedTextColor;
+
+		CDuiString		m_sSelectedImage;
+		CDuiString		m_sSelectedHotImage;
+		CDuiString		m_sSelectedPushedImage;
+		CDuiString		m_sSelectedForeImage;
+
+		int m_nSelectedStateCount;
+		CDuiString m_sSelectedStateImage;
+	};
+
+	class UILIB_API CCheckBoxUI : public COptionUI
+	{
+		DECLARE_DUICONTROL(CCheckBoxUI)
+	public:
+		CCheckBoxUI();
+
+	public:
+		virtual LPCTSTR GetClass() const;
+		virtual LPVOID GetInterface(LPCTSTR pstrName);
+
+		void SetCheck(bool bCheck);
+		bool GetCheck() const;
+
+	public:
+		virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		void SetAutoCheck(bool bEnable);
+		virtual void DoEvent(TEventUI& event);
+		virtual void Selected(bool bSelected, bool bMsg = true);
+
+	protected:
+		bool m_bAutoCheck; 
+	};
+} // namespace DuiLib
+
+#endif // __UIOPTION_H__

+ 175 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIProgress.cpp

@@ -0,0 +1,175 @@
+#include "StdAfx.h"
+#include "UIProgress.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CProgressUI)
+
+	CProgressUI::CProgressUI() : m_bShowText(false), m_bHorizontal(true), m_nMin(0), m_nMax(100), m_nValue(0), m_bStretchForeImage(true)
+	{
+		m_uTextStyle = DT_SINGLELINE | DT_CENTER;
+		SetFixedHeight(12);
+	}
+
+	LPCTSTR CProgressUI::GetClass() const
+	{
+		return _T("ProgressUI");
+	}
+
+	LPVOID CProgressUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_PROGRESS) == 0 ) return static_cast<CProgressUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+	
+	bool CProgressUI::IsShowText()
+	{
+		return m_bShowText;
+	}
+
+	void CProgressUI::SetShowText(bool bShowText)
+	{
+		if( m_bShowText == bShowText ) return;
+		m_bShowText = bShowText;
+		if(!m_bShowText) SetText(_T(""));
+	}
+
+	bool CProgressUI::IsHorizontal()
+	{
+		return m_bHorizontal;
+	}
+
+	void CProgressUI::SetHorizontal(bool bHorizontal)
+	{
+		if( m_bHorizontal == bHorizontal ) return;
+
+		m_bHorizontal = bHorizontal;
+		Invalidate();
+	}
+
+	int CProgressUI::GetMinValue() const
+	{
+		return m_nMin;
+	}
+
+	void CProgressUI::SetMinValue(int nMin)
+	{
+		m_nMin = nMin;
+		Invalidate();
+	}
+
+	int CProgressUI::GetMaxValue() const
+	{
+		return m_nMax;
+	}
+
+	void CProgressUI::SetMaxValue(int nMax)
+	{
+		m_nMax = nMax;
+		Invalidate();
+	}
+
+	int CProgressUI::GetValue() const
+	{
+		return m_nValue;
+	}
+
+	void CProgressUI::SetValue(int nValue)
+	{
+		if(nValue == m_nValue || nValue<m_nMin || nValue > m_nMax) {
+			return;
+		}
+		m_nValue = nValue;
+		Invalidate();
+		UpdateText();
+	}
+
+	void CProgressUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("hor")) == 0 ) SetHorizontal(_tcsicmp(pstrValue, _T("true")) == 0);
+		else if( _tcsicmp(pstrName, _T("min")) == 0 ) SetMinValue(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("max")) == 0 ) SetMaxValue(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("value")) == 0 ) SetValue(_ttoi(pstrValue));
+		else if( _tcsicmp(pstrName, _T("isstretchfore"))==0) SetStretchForeImage(_tcsicmp(pstrValue, _T("true")) == 0? true : false);
+		else if( _tcsicmp(pstrName, _T("showtext"))==0) SetShowText(_tcsicmp(pstrValue, _T("true")) == 0? true : false);
+		else CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CProgressUI::PaintForeColor(HDC hDC)
+	{
+		if(m_dwForeColor == 0) return;
+
+		if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1;
+		if( m_nValue > m_nMax ) m_nValue = m_nMax;
+		if( m_nValue < m_nMin ) m_nValue = m_nMin;
+
+		RECT rc = m_rcItem;
+		if( m_bHorizontal ) {
+			rc.right = m_rcItem.left + (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) / (m_nMax - m_nMin);
+		}
+		else {
+			rc.bottom = m_rcItem.top + (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) / (m_nMax - m_nMin);
+		
+		}
+		
+		CRenderEngine::DrawColor(hDC, rc, GetAdjustColor(m_dwForeColor));
+	}
+
+	void CProgressUI::PaintForeImage(HDC hDC)
+	{
+		if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1;
+		if( m_nValue > m_nMax ) m_nValue = m_nMax;
+		if( m_nValue < m_nMin ) m_nValue = m_nMin;
+
+		RECT rc = {0};
+		if( m_bHorizontal ) {
+			rc.right = (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) * 1.0f / (m_nMax - m_nMin);
+			rc.bottom = m_rcItem.bottom - m_rcItem.top;
+		}
+		else {
+			rc.top = (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) * 1.0f / (m_nMax - m_nMin);
+			rc.right = m_rcItem.right - m_rcItem.left;
+			rc.bottom = m_rcItem.bottom - m_rcItem.top;
+		}
+
+		if( !m_sForeImage.IsEmpty() ) {
+			m_sForeImageModify.Empty();
+			int sw = MulDiv(rc.right - rc.left, 100, GetManager()->GetDPIObj()->GetScale());
+			int sh = MulDiv(rc.bottom - rc.top, 100, GetManager()->GetDPIObj()->GetScale());
+			rc.left = MulDiv(rc.left, 100, GetManager()->GetDPIObj()->GetScale());
+			rc.top = MulDiv(rc.top, 100, GetManager()->GetDPIObj()->GetScale());
+			rc.right = rc.left + sw;
+			rc.bottom = rc.top + sh;
+			if (m_bStretchForeImage) {
+				m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom);
+			}
+			else {
+				m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d' source='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom, rc.left, rc.top, rc.right, rc.bottom);
+			}
+
+			if( !DrawImage(hDC, (LPCTSTR)m_sForeImage, (LPCTSTR)m_sForeImageModify) ) {}
+			else return;
+		}
+	}
+
+	bool CProgressUI::IsStretchForeImage()
+	{
+		return m_bStretchForeImage;
+	}
+
+	void CProgressUI::SetStretchForeImage( bool bStretchForeImage /*= true*/ )
+	{
+		if (m_bStretchForeImage==bStretchForeImage)		return;
+		m_bStretchForeImage=bStretchForeImage;
+		Invalidate();
+	}
+
+	void CProgressUI::UpdateText()
+	{
+		if(m_bShowText) {
+			CDuiString sText;
+			sText.Format(_T("%.0f%%"), (m_nValue - m_nMin) * 100.0f / (m_nMax - m_nMin));
+			SetText(sText);
+		}
+	}
+}

+ 47 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIProgress.h

@@ -0,0 +1,47 @@
+#ifndef __UIPROGRESS_H__
+#define __UIPROGRESS_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CProgressUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CProgressUI)
+	public:
+		CProgressUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		bool IsShowText();
+		void SetShowText(bool bShowText = true);
+		bool IsHorizontal();
+		void SetHorizontal(bool bHorizontal = true);
+		bool IsStretchForeImage();
+		void SetStretchForeImage(bool bStretchForeImage = true);
+		int GetMinValue() const;
+		void SetMinValue(int nMin);
+		int GetMaxValue() const;
+		void SetMaxValue(int nMax);
+		int GetValue() const;
+		void SetValue(int nValue);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		void PaintForeColor(HDC hDC);
+		void PaintForeImage(HDC hDC);
+		virtual void UpdateText();
+
+	protected:
+		bool m_bShowText;
+		bool m_bHorizontal;
+		bool m_bStretchForeImage;
+		int m_nMax;
+		int m_nMin;
+		int m_nValue;
+
+		CDuiString m_sForeImageModify;
+	};
+
+} // namespace DuiLib
+
+#endif // __UIPROGRESS_H__

Diferenças do arquivo suprimidas por serem muito extensas
+ 2804 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRichEdit.cpp


+ 197 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRichEdit.h

@@ -0,0 +1,197 @@
+#ifndef __UIRICHEDIT_H__
+#define __UIRICHEDIT_H__
+
+#pragma once
+
+namespace DuiLib {
+
+	class CTxtWinHost;
+
+	class UILIB_API CRichEditUI : public CContainerUI, public IMessageFilterUI
+	{
+		DECLARE_DUICONTROL(CRichEditUI)
+	public:
+		CRichEditUI();
+		~CRichEditUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		UINT GetControlFlags() const;
+
+		void SetEnabled(bool bEnabled);
+		bool IsMultiLine();
+		void SetMultiLine(bool bMultiLine);
+		bool IsWantTab();
+		void SetWantTab(bool bWantTab = true);
+		bool IsWantReturn();
+		void SetWantReturn(bool bWantReturn = true);
+		bool IsWantCtrlReturn();
+		void SetWantCtrlReturn(bool bWantCtrlReturn = true);
+		bool IsTransparent();
+		void SetTransparent(bool bTransparent = true);
+		bool IsRich();
+		void SetRich(bool bRich = true);
+		bool IsReadOnly();
+		void SetReadOnly(bool bReadOnly = true);
+		bool IsWordWrap();
+		void SetWordWrap(bool bWordWrap = true);
+		int GetFont();
+		void SetFont(int index);
+		void SetFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic);
+		LONG GetWinStyle();
+		void SetWinStyle(LONG lStyle);
+		DWORD GetTextColor();
+		void SetTextColor(DWORD dwTextColor);
+		int GetLimitText();
+		void SetLimitText(int iChars);
+		long GetTextLength(DWORD dwFlags = GTL_DEFAULT) const;
+		CDuiString GetText() const;
+		void SetText(LPCTSTR pstrText);
+		bool IsModify() const;
+		void SetModify(bool bModified = true) const;
+		void GetSel(CHARRANGE &cr) const;
+		void GetSel(long& nStartChar, long& nEndChar) const;
+		int SetSel(CHARRANGE &cr);
+		int SetSel(long nStartChar, long nEndChar);
+		void ReplaceSel(LPCTSTR lpszNewText, bool bCanUndo);
+		void ReplaceSelW(LPCWSTR lpszNewText, bool bCanUndo = false);
+		CDuiString GetSelText() const;
+		int SetSelAll();
+		int SetSelNone();
+		WORD GetSelectionType() const;
+		bool GetZoom(int& nNum, int& nDen) const;
+		bool SetZoom(int nNum, int nDen);
+		bool SetZoomOff();
+		bool GetAutoURLDetect() const;
+		bool SetAutoURLDetect(bool bAutoDetect = true);
+		DWORD GetEventMask() const;
+		DWORD SetEventMask(DWORD dwEventMask);
+		CDuiString GetTextRange(long nStartChar, long nEndChar) const;
+		void HideSelection(bool bHide = true, bool bChangeStyle = false);
+		void ScrollCaret();
+		int InsertText(long nInsertAfterChar, LPCTSTR lpstrText, bool bCanUndo = false);
+		int AppendText(LPCTSTR lpstrText, bool bCanUndo = false);
+		DWORD GetDefaultCharFormat(CHARFORMAT2 &cf) const;
+		bool SetDefaultCharFormat(CHARFORMAT2 &cf);
+		DWORD GetSelectionCharFormat(CHARFORMAT2 &cf) const;
+		bool SetSelectionCharFormat(CHARFORMAT2 &cf);
+		bool SetWordCharFormat(CHARFORMAT2 &cf);
+		DWORD GetParaFormat(PARAFORMAT2 &pf) const;
+		bool SetParaFormat(PARAFORMAT2 &pf);
+		bool CanUndo();
+		bool CanRedo();
+		bool CanPaste();
+		bool Redo();
+		bool Undo();
+		void Clear();
+		void Copy();
+		void Cut();
+		void Paste();
+		int GetLineCount() const;
+		CDuiString GetLine(int nIndex, int nMaxLength) const;
+		int LineIndex(int nLine = -1) const;
+		int LineLength(int nLine = -1) const;
+		bool LineScroll(int nLines, int nChars = 0);
+		CDuiPoint GetCharPos(long lChar) const;
+		long LineFromChar(long nIndex) const;
+		CDuiPoint PosFromChar(UINT nChar) const;
+		int CharFromPos(CDuiPoint pt) const;
+		void EmptyUndoBuffer();
+		UINT SetUndoLimit(UINT nLimit);
+		long StreamIn(int nFormat, EDITSTREAM &es);
+		long StreamOut(int nFormat, EDITSTREAM &es);
+		void SetAccumulateDBCMode(bool bDBCMode);
+		bool IsAccumulateDBCMode();
+
+		RECT GetTextPadding() const;
+		void SetTextPadding(RECT rc);
+		LPCTSTR GetNormalImage();
+		void SetNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetHotImage();
+		void SetHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetFocusedImage();
+		void SetFocusedImage(LPCTSTR pStrImage);
+		LPCTSTR GetDisabledImage();
+		void SetDisabledImage(LPCTSTR pStrImage);
+		void PaintStatusImage(HDC hDC);
+
+		void SetTipValue(LPCTSTR pStrTipValue);
+		LPCTSTR GetTipValue();
+		void SetTipValueColor(LPCTSTR pStrColor);
+		DWORD GetTipValueColor();
+		void SetTipValueAlign(UINT uAlign);
+		UINT GetTipValueAlign();
+
+		void DoInit();
+		bool SetDropAcceptFile(bool bAccept);
+		// 注意:TxSendMessage和SendMessage是有区别的,TxSendMessage没有multibyte和unicode自动转换的功能,
+		// 而richedit2.0内部是以unicode实现的,在multibyte程序中,必须自己处理unicode到multibyte的转换
+		virtual HRESULT TxSendMessage(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *plresult) const; 
+		IDropTarget* GetTxDropTarget();
+		virtual bool OnTxViewChanged();
+		virtual void OnTxNotify(DWORD iNotify, void *pv);
+
+		CDuiSize GetNaturalSize(LONG width, LONG height);
+		void SetScrollPos(SIZE szPos, bool bMsg = true);
+		void LineUp();
+		void LineDown();
+		void PageUp();
+		void PageDown();
+		void HomeUp();
+		void EndDown();
+		void LineLeft();
+		void LineRight();
+		void PageLeft();
+		void PageRight();
+		void HomeLeft();
+		void EndRight();
+
+		SIZE EstimateSize(SIZE szAvailable);
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void Move(SIZE szOffset, bool bNeedInvalidate = true);
+		void DoEvent(TEventUI& event);
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
+
+	protected:
+		enum { 
+			DEFAULT_TIMERID = 20,
+		};
+
+		CTxtWinHost* m_pTwh;
+		bool m_bVScrollBarFixing;
+		bool m_bWantTab;
+		bool m_bWantReturn;
+		bool m_bWantCtrlReturn;
+		bool m_bTransparent;
+		bool m_bRich;
+		bool m_bReadOnly;
+		bool m_bWordWrap;
+		DWORD m_dwTextColor;
+		int m_iFont;
+		int m_iLimitText;
+		LONG m_lTwhStyle;
+		bool m_bDrawCaret;
+		bool m_bInited;
+
+		bool  m_fAccumulateDBC ; // TRUE - need to cumulate ytes from 2 WM_CHAR msgs
+		// we are in this mode when we receive VK_PROCESSKEY
+		UINT m_chLeadByte; // use when we are in _fAccumulateDBC mode
+
+		RECT m_rcTextPadding;
+		UINT m_uButtonState;
+		CDuiString m_sNormalImage;
+		CDuiString m_sHotImage;
+		CDuiString m_sFocusedImage;
+		CDuiString m_sDisabledImage;
+		CDuiString m_sTipValue;
+		DWORD m_dwTipValueColor;
+		UINT m_uTipValueAlign;
+	};
+
+} // namespace DuiLib
+
+#endif // __UIRICHEDIT_H__

+ 101 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRing.cpp

@@ -0,0 +1,101 @@
+#include "StdAfx.h"
+#include "UIRing.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CRingUI)
+
+	CRingUI::CRingUI() : m_fCurAngle(0.0f), m_pBkimage(NULL)
+	{
+	}
+
+	CRingUI::~CRingUI()
+	{
+		if(m_pManager) m_pManager->KillTimer(this, RING_TIMERID);
+
+		DeleteImage();
+	}
+
+	LPCTSTR CRingUI::GetClass() const
+	{
+		return _T("RingUI");
+	}
+
+	LPVOID CRingUI::GetInterface( LPCTSTR pstrName )
+	{
+		if( _tcscmp(pstrName, _T("Ring")) == 0 ) return static_cast<CRingUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	void CRingUI::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue )
+	{
+		if( _tcscmp(pstrName, _T("bkimage")) == 0 ) SetBkImage(pstrValue);
+		else CLabelUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CRingUI::SetBkImage( LPCTSTR pStrImage )
+	{
+		if (m_sBkImage == pStrImage) return;
+		m_sBkImage = pStrImage;
+		DeleteImage();
+		Invalidate();
+	}
+
+	void CRingUI::PaintBkImage( HDC hDC )
+	{
+		if(m_pBkimage == NULL) {
+			InitImage();
+		}
+
+		if(m_pBkimage != NULL) {
+			RECT rcItem = m_rcItem;
+			int iWidth = rcItem.right - rcItem.left;
+			int iHeight = rcItem.bottom - rcItem.top;
+			Gdiplus::PointF centerPos(rcItem.left + iWidth/2, rcItem.top + iHeight/2);
+			
+			// 解决偶数时抖动问题
+			if ((iWidth % 2) == 0) centerPos.X -= 0.5;
+			if ((iHeight % 2) == 0) centerPos.Y -= 0.5;
+
+			Gdiplus::Graphics graphics(hDC);
+			graphics.TranslateTransform(centerPos.X,centerPos.Y);
+			graphics.RotateTransform(m_fCurAngle);
+			graphics.TranslateTransform(-centerPos.X, -centerPos.Y);//»¹Ô­Ô´µã
+			graphics.DrawImage(m_pBkimage,rcItem.left,rcItem.top,iWidth,iHeight);
+		}
+	}
+
+	void CRingUI::DoEvent( TEventUI& event )
+	{
+		if( event.Type == UIEVENT_TIMER && event.wParam == RING_TIMERID ) {
+			if(m_fCurAngle > 359) {
+				m_fCurAngle = 0;
+			}
+			m_fCurAngle += 36.0;
+			//Invalidate();
+			NeedParentUpdate();
+		}
+		else {
+			CLabelUI::DoEvent(event);
+		}
+	}
+
+	void CRingUI::InitImage()
+	{
+		TImageInfo* pImageInfo = CRenderEngine::GdiplusLoadImage(GetBkImage());
+		if(pImageInfo == NULL) return;
+
+		m_pBkimage = pImageInfo->pImage;
+		if ( NULL == m_pBkimage ) return;
+		if(m_pManager) m_pManager->SetTimer(this, RING_TIMERID, 100);
+	}
+
+	void CRingUI::DeleteImage()
+	{
+		if ( m_pBkimage != NULL )
+		{
+			delete m_pBkimage;
+			m_pBkimage = NULL;
+		}
+	}
+}

+ 36 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRing.h

@@ -0,0 +1,36 @@
+#ifndef __UIROTATE_H__
+#define __UIROTATE_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class CRingUI : public CLabelUI
+	{
+		enum
+		{ 
+			RING_TIMERID = 100,
+		};
+		DECLARE_DUICONTROL(CRingUI)
+	public:
+		CRingUI();
+		~CRingUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		void SetBkImage(LPCTSTR pStrImage);	
+		virtual void DoEvent(TEventUI& event);
+		virtual void PaintBkImage(HDC hDC);	
+
+	private:
+		void InitImage();
+		void DeleteImage();
+
+	public:
+		float m_fCurAngle;
+		Gdiplus::Image* m_pBkimage;
+	};
+}
+
+#endif // __UIROTATE_H__

+ 153 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRollText.cpp

@@ -0,0 +1,153 @@
+#include "stdafx.h"
+#include "UIRollText.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CRollTextUI)
+
+	CRollTextUI::CRollTextUI(void)
+	{
+		m_nScrollPos = 0;
+		m_nText_W_H = 0;
+		m_nStep = 5;
+		m_bUseRoll = FALSE;
+		m_nRollDirection = ROLLTEXT_LEFT;
+	}
+
+	CRollTextUI::~CRollTextUI(void)
+	{
+		m_pManager->KillTimer(this, ROLLTEXT_ROLL_END);
+		m_pManager->KillTimer(this, ROLLTEXT_TIMERID);
+	}
+
+	LPCTSTR CRollTextUI::GetClass() const
+	{
+		return _T("RollTextUI");
+	}
+
+	LPVOID CRollTextUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, _T("RollText")) == 0 ) return static_cast<CRollTextUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	void CRollTextUI::BeginRoll(int nDirect, LONG lTimeSpan, LONG lMaxTimeLimited)
+	{
+		m_nRollDirection = nDirect;
+		if (m_bUseRoll)
+		{
+			EndRoll();
+		}
+		m_nText_W_H = 0;
+	
+		m_pManager->KillTimer(this, ROLLTEXT_TIMERID);
+		m_pManager->SetTimer(this, ROLLTEXT_TIMERID, lTimeSpan);
+	
+		m_pManager->KillTimer(this, ROLLTEXT_ROLL_END);
+		m_pManager->SetTimer(this, ROLLTEXT_ROLL_END, lMaxTimeLimited*1000);
+
+		m_bUseRoll = TRUE;
+	}
+
+	void CRollTextUI::EndRoll()
+	{
+		if (!m_bUseRoll) return;
+
+		m_pManager->KillTimer(this, ROLLTEXT_ROLL_END);
+		m_pManager->KillTimer(this, ROLLTEXT_TIMERID);
+		
+		m_bUseRoll = FALSE;
+	}
+
+	void CRollTextUI::SetPos(RECT rc)
+	{
+		CLabelUI::SetPos(rc);
+		m_nText_W_H = 0;			//布局变化重新计算
+	}
+
+	void CRollTextUI::SetText( LPCTSTR pstrText )
+	{
+		CLabelUI::SetText(pstrText);
+		m_nText_W_H = 0;			//文本变化重新计算
+	}
+
+	void CRollTextUI::DoEvent(TEventUI& event)
+	{
+		if (event.Type == UIEVENT_TIMER && event.wParam == ROLLTEXT_ROLL_END)
+		{
+			m_pManager->KillTimer(this, ROLLTEXT_ROLL_END);
+			m_pManager->SendNotify(this, DUI_MSGTYPE_TEXTROLLEND);
+		}
+		else if( event.Type == UIEVENT_TIMER && event.wParam == ROLLTEXT_TIMERID ) 
+		{
+			Invalidate();
+			return;
+		}
+		CLabelUI::DoEvent(event);
+	}
+
+	void CRollTextUI::PaintText(HDC hDC)
+	{
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+		DWORD dwTextColor = IsEnabled() ? m_dwTextColor : m_dwDisabledTextColor;
+		CDuiString sText = GetText();
+		if( sText.IsEmpty() ) return;
+
+		RECT rcTextPadding = GetTextPadding();
+		CDuiRect  rcClient;
+		rcClient = m_rcItem;
+		rcClient.left += rcTextPadding.left;
+		rcClient.right -= rcTextPadding.right;
+		rcClient.top += rcTextPadding.top;
+		rcClient.bottom -= rcTextPadding.bottom;
+
+		if(m_nText_W_H > 0)
+		{
+			int nScrollRange = 0;
+
+			if (m_nRollDirection == ROLLTEXT_LEFT || m_nRollDirection == ROLLTEXT_RIGHT) {	//左面移动
+				nScrollRange = m_nText_W_H + rcClient.GetWidth();
+
+				rcClient.Offset((m_nRollDirection == ROLLTEXT_LEFT?rcClient.GetWidth():-rcClient.GetWidth()), 0);
+				rcClient.Offset((m_nRollDirection == ROLLTEXT_LEFT?-m_nScrollPos:m_nScrollPos), 0);
+				rcClient.right += (m_nText_W_H - rcClient.GetWidth());
+			}
+			else {																		//上下移动
+				nScrollRange = m_nText_W_H + rcClient.GetHeight();
+				rcClient.Offset(0, (m_nRollDirection == ROLLTEXT_UP?rcClient.GetHeight():-rcClient.GetHeight()));
+				rcClient.Offset(0, (m_nRollDirection == ROLLTEXT_UP?-m_nScrollPos:m_nScrollPos));
+				rcClient.bottom += (m_nText_W_H - rcClient.GetHeight());
+			}
+
+			m_nScrollPos += m_nStep;
+			if (m_nScrollPos > nScrollRange) {
+				m_nScrollPos = 0;
+			}
+		}
+
+		RECT rc = rcClient;
+		UINT uTextStyle = DT_WORDBREAK | DT_EDITCONTROL;
+		if(m_nText_W_H == 0) {
+			uTextStyle |= DT_CALCRECT;				//第一次计算文本宽度或高度
+			if (m_nRollDirection == ROLLTEXT_LEFT || m_nRollDirection == ROLLTEXT_RIGHT) {	//左面移动
+				rc.right += 10000;
+			}
+			else {																		//上下移动
+				rc.bottom += 10000;
+			}
+		}
+
+		if( m_bShowHtml ) {
+			int nLinks = 0;
+			CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, dwTextColor, NULL, NULL, nLinks, m_iFont, uTextStyle);
+		}
+		else {
+			CRenderEngine::DrawText(hDC, m_pManager, rc, sText, dwTextColor, m_iFont, uTextStyle);
+		}
+
+		if(m_nText_W_H == 0) {
+			m_nText_W_H = (m_nRollDirection == ROLLTEXT_LEFT || m_nRollDirection == ROLLTEXT_RIGHT)?(rc.right - rc.left):(rc.bottom - rc.top);		//计算文本宽度或高度
+		}
+	}
+}

+ 50 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIRollText.h

@@ -0,0 +1,50 @@
+#ifndef __UITEXTSCROLLH__
+#define __UITEXTSCROLLH__
+
+#pragma once
+
+namespace DuiLib
+{
+	#define ROLLTEXT_LEFT		0
+	#define ROLLTEXT_RIGHT		1
+	#define ROLLTEXT_UP 		2
+	#define ROLLTEXT_DOWN		3
+
+	#define ROLLTEXT_TIMERID			20
+	#define ROLLTEXT_TIMERID_SPAN		50U
+
+	#define ROLLTEXT_ROLL_END			21
+	#define ROLLTEXT_ROLL_END_SPAN		1000*6U
+
+	class UILIB_API CRollTextUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CRollTextUI)
+	public:
+		CRollTextUI(void);
+		~CRollTextUI(void);
+
+	public:
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+	public:	
+		virtual void PaintText(HDC hDC);
+		virtual void DoEvent(TEventUI& event);
+		virtual void SetPos(RECT rc);
+		virtual void SetText(LPCTSTR pstrText);
+
+	public:
+		void BeginRoll(int nDirect = ROLLTEXT_RIGHT, LONG lTimeSpan = ROLLTEXT_TIMERID_SPAN, LONG lMaxTimeLimited = 60);
+		void EndRoll();
+		
+	private:    
+		int m_nStep;
+		int m_nScrollPos;
+		BOOL m_bUseRoll;
+		int m_nRollDirection;   
+		int m_nText_W_H;
+	};
+
+}	// namespace DuiLib
+
+#endif // __UITEXTSCROLLH__

Diferenças do arquivo suprimidas por serem muito extensas
+ 1020 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIScrollBar.cpp


+ 151 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIScrollBar.h

@@ -0,0 +1,151 @@
+#ifndef __UISCROLLBAR_H__
+#define __UISCROLLBAR_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CScrollBarUI : public CControlUI
+	{
+		DECLARE_DUICONTROL(CScrollBarUI)
+	public:
+		CScrollBarUI();
+
+		LPCTSTR GetClass() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		CContainerUI* GetOwner() const;
+		void SetOwner(CContainerUI* pOwner);
+
+		void SetVisible(bool bVisible = true);
+		void SetEnabled(bool bEnable = true);
+		void SetFocus();
+
+		bool IsHorizontal();
+		void SetHorizontal(bool bHorizontal = true);
+		int GetScrollRange() const;
+		void SetScrollRange(int nRange);
+		int GetScrollPos() const;
+		void SetScrollPos(int nPos);
+		int GetLineSize() const;
+		void SetLineSize(int nSize);
+
+		bool GetShowButton1();
+		void SetShowButton1(bool bShow);
+		LPCTSTR GetButton1NormalImage();
+		void SetButton1NormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton1HotImage();
+		void SetButton1HotImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton1PushedImage();
+		void SetButton1PushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton1DisabledImage();
+		void SetButton1DisabledImage(LPCTSTR pStrImage);
+
+		bool GetShowButton2();
+		void SetShowButton2(bool bShow);
+		LPCTSTR GetButton2NormalImage();
+		void SetButton2NormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton2HotImage();
+		void SetButton2HotImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton2PushedImage();
+		void SetButton2PushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetButton2DisabledImage();
+		void SetButton2DisabledImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetThumbNormalImage();
+		void SetThumbNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetThumbHotImage();
+		void SetThumbHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetThumbPushedImage();
+		void SetThumbPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetThumbDisabledImage();
+		void SetThumbDisabledImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetRailNormalImage();
+		void SetRailNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetRailHotImage();
+		void SetRailHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetRailPushedImage();
+		void SetRailPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetRailDisabledImage();
+		void SetRailDisabledImage(LPCTSTR pStrImage);
+
+		LPCTSTR GetBkNormalImage();
+		void SetBkNormalImage(LPCTSTR pStrImage);
+		LPCTSTR GetBkHotImage();
+		void SetBkHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetBkPushedImage();
+		void SetBkPushedImage(LPCTSTR pStrImage);
+		LPCTSTR GetBkDisabledImage();
+		void SetBkDisabledImage(LPCTSTR pStrImage);
+
+		bool GetShow();
+		void SetShow(bool bShow);
+
+		void SetPos(RECT rc, bool bNeedInvalidate = true);
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+
+		bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
+
+		void PaintBk(HDC hDC);
+		void PaintButton1(HDC hDC);
+		void PaintButton2(HDC hDC);
+		void PaintThumb(HDC hDC);
+		void PaintRail(HDC hDC);
+
+	protected:
+		enum
+		{ 
+			DEFAULT_SCROLLBAR_SIZE = 16,
+			DEFAULT_TIMERID = 10,
+		};
+		bool m_bShow;
+		bool m_bHorizontal;
+		__int64 m_nRange;
+		__int64 m_nScrollPos;
+		int m_nLineSize;
+		CContainerUI* m_pOwner;
+		POINT m_ptLastMouse;
+		int m_nLastScrollPos;
+		int m_nLastScrollOffset;
+		int m_nScrollRepeatDelay;
+
+		CDuiString m_sBkNormalImage;
+		CDuiString m_sBkHotImage;
+		CDuiString m_sBkPushedImage;
+		CDuiString m_sBkDisabledImage;
+
+		bool m_bShowButton1;
+		RECT m_rcButton1;
+		UINT m_uButton1State;
+		CDuiString m_sButton1NormalImage;
+		CDuiString m_sButton1HotImage;
+		CDuiString m_sButton1PushedImage;
+		CDuiString m_sButton1DisabledImage;
+
+		bool m_bShowButton2;
+		RECT m_rcButton2;
+		UINT m_uButton2State;
+		CDuiString m_sButton2NormalImage;
+		CDuiString m_sButton2HotImage;
+		CDuiString m_sButton2PushedImage;
+		CDuiString m_sButton2DisabledImage;
+
+		RECT m_rcThumb;
+		UINT m_uThumbState;
+		CDuiString m_sThumbNormalImage;
+		CDuiString m_sThumbHotImage;
+		CDuiString m_sThumbPushedImage;
+		CDuiString m_sThumbDisabledImage;
+
+		CDuiString m_sRailNormalImage;
+		CDuiString m_sRailHotImage;
+		CDuiString m_sRailPushedImage;
+		CDuiString m_sRailDisabledImage;
+
+		CDuiString m_sImageModify;
+	};
+}
+
+#endif // __UISCROLLBAR_H__

+ 307 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UISlider.cpp

@@ -0,0 +1,307 @@
+#include "StdAfx.h"
+#include "UISlider.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CSliderUI)
+		CSliderUI::CSliderUI() : m_uButtonState(0), m_nStep(1),m_bSendMove(false)
+	{
+		m_uTextStyle = DT_SINGLELINE | DT_CENTER;
+		m_szThumb.cx = m_szThumb.cy = 10;
+	}
+
+	LPCTSTR CSliderUI::GetClass() const
+	{
+		return _T("SliderUI");
+	}
+
+	UINT CSliderUI::GetControlFlags() const
+	{
+		if( IsEnabled() ) return UIFLAG_SETCURSOR;
+		else return 0;
+	}
+
+	LPVOID CSliderUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_SLIDER) == 0 ) return static_cast<CSliderUI*>(this);
+		return CProgressUI::GetInterface(pstrName);
+	}
+
+	void CSliderUI::SetEnabled(bool bEnable)
+	{
+		CControlUI::SetEnabled(bEnable);
+		if( !IsEnabled() ) {
+			m_uButtonState = 0;
+		}
+	}
+
+	int CSliderUI::GetChangeStep()
+	{
+		return m_nStep;
+	}
+
+	void CSliderUI::SetChangeStep(int step)
+	{
+		m_nStep = step;
+	}
+
+	void CSliderUI::SetThumbSize(SIZE szXY)
+	{
+		m_szThumb = szXY;
+	}
+
+	RECT CSliderUI::GetThumbRect() const
+	{
+		RECT rcThumb = {0};
+		SIZE m_szThumb = CSliderUI::m_szThumb;
+		if (GetManager() != NULL) {
+			GetManager()->GetDPIObj()->Scale(&m_szThumb);
+		}
+		if( m_bHorizontal ) {
+			int left = m_rcItem.left + (m_rcItem.right - m_rcItem.left - m_szThumb.cx) * (m_nValue - m_nMin) / (m_nMax - m_nMin);
+			int top = (m_rcItem.bottom + m_rcItem.top - m_szThumb.cy) / 2;
+			rcThumb = CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy); 
+		}
+		else {
+			int left = (m_rcItem.right + m_rcItem.left - m_szThumb.cx) / 2;
+			int top = m_rcItem.bottom - m_szThumb.cy - (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy) * (m_nValue - m_nMin) / (m_nMax - m_nMin);
+			rcThumb = CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy); 
+		}
+		if(m_pManager != NULL) {
+			//m_pManager->GetDPIObj()->Scale(&rcThumb);
+		}
+		return rcThumb;
+	}
+
+	LPCTSTR CSliderUI::GetThumbImage() const
+	{
+		return m_sThumbImage;
+	}
+
+	void CSliderUI::SetThumbImage(LPCTSTR pStrImage)
+	{
+		m_sThumbImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CSliderUI::GetThumbHotImage() const
+	{
+		return m_sThumbHotImage;
+	}
+
+	void CSliderUI::SetThumbHotImage(LPCTSTR pStrImage)
+	{
+		m_sThumbHotImage = pStrImage;
+		Invalidate();
+	}
+
+	LPCTSTR CSliderUI::GetThumbPushedImage() const
+	{
+		return m_sThumbPushedImage;
+	}
+
+	void CSliderUI::SetThumbPushedImage(LPCTSTR pStrImage)
+	{
+		m_sThumbPushedImage = pStrImage;
+		Invalidate();
+	}
+
+	void CSliderUI::SetValue(int nValue)
+	{
+		if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) return;
+		CProgressUI::SetValue(nValue);
+	}
+
+	void CSliderUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CProgressUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK ) {
+			if( IsEnabled() ) {
+				m_uButtonState |= UISTATE_CAPTURED;
+
+				int nValue;
+				if( m_bHorizontal ) {
+					if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) nValue = m_nMax;
+					else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) nValue = m_nMin;
+					else nValue = m_nMin + 1.0f * (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx);
+				}
+				else {
+					if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) nValue = m_nMin;
+					else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2  ) nValue = m_nMax;
+					else nValue = m_nMin + 1.0f * (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy);
+				}
+				if(m_nValue != nValue && nValue >= m_nMin && nValue <= m_nMax) {
+					m_nValue = nValue;
+					Invalidate();
+				}
+				UpdateText();
+			}
+			return;
+		}
+
+		if( event.Type == UIEVENT_BUTTONUP || event.Type == UIEVENT_RBUTTONUP) {
+			if( IsEnabled() ) {
+				int nValue = 0;
+				if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
+					m_uButtonState &= ~UISTATE_CAPTURED;
+				}
+				if( m_bHorizontal ) {
+					if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) nValue = m_nMax;
+					else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) nValue = m_nMin;
+					else nValue = m_nMin + (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx);
+				}
+				else {
+					if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) nValue = m_nMin;
+					else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2  ) nValue = m_nMax;
+					else nValue = m_nMin + (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy);
+				}
+				if(nValue >= m_nMin && nValue <= m_nMax) {
+					m_nValue =nValue;
+					m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED);
+					Invalidate();
+				}
+				UpdateText();
+				return;
+			}
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		if( event.Type == UIEVENT_SCROLLWHEEL ) 
+		{
+			if( IsEnabled() ) {
+				switch( LOWORD(event.wParam) ) {
+				case SB_LINEUP:
+					SetValue(GetValue() + GetChangeStep());
+					m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED);
+					return;
+				case SB_LINEDOWN:
+					SetValue(GetValue() - GetChangeStep());
+					m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED);
+					return;
+				}
+			}
+		}
+		if( event.Type == UIEVENT_MOUSEMOVE ) {
+			if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
+				if( m_bHorizontal ) {
+					if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) m_nValue = m_nMax;
+					else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) m_nValue = m_nMin;
+					else m_nValue = m_nMin + 1.0f * (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx);
+				}
+				else {
+					if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) m_nValue = m_nMin;
+					else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2  ) m_nValue = m_nMax;
+					else m_nValue = m_nMin + 1.0f * (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy);
+				}
+				if (m_bSendMove) {
+					UpdateText();
+					m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED_MOVE);
+				}
+				Invalidate();
+			}
+
+			POINT pt = event.ptMouse;
+			RECT rcThumb = GetThumbRect();
+			if( IsEnabled() && ::PtInRect(&rcThumb, event.ptMouse) ) {
+				m_uButtonState |= UISTATE_HOT;
+				Invalidate();
+			}
+			else {
+				m_uButtonState &= ~UISTATE_HOT;
+				Invalidate();
+			}
+			return;
+		}
+		if( event.Type == UIEVENT_SETCURSOR )
+		{
+			RECT rcThumb = GetThumbRect();
+			if( IsEnabled()) {
+				::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)));
+				return;
+			}
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE )
+		{
+			if( IsEnabled() ) {
+				m_uButtonState &= ~UISTATE_HOT;
+				Invalidate();
+			}
+			return;
+		}
+		CControlUI::DoEvent(event);
+	}
+
+	void CSliderUI::SetCanSendMove(bool bCanSend)
+	{
+		m_bSendMove = bCanSend;
+	}
+	bool CSliderUI::GetCanSendMove() const
+	{
+		return m_bSendMove;
+	}
+
+	void CSliderUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
+	{
+		if( _tcsicmp(pstrName, _T("thumbimage")) == 0 ) SetThumbImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("thumbhotimage")) == 0 ) SetThumbHotImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("thumbpushedimage")) == 0 ) SetThumbPushedImage(pstrValue);
+		else if( _tcsicmp(pstrName, _T("thumbsize")) == 0 ) {
+			SIZE szXY = {0};
+			LPTSTR pstr = NULL;
+			szXY.cx = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
+			szXY.cy = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr); 
+			SetThumbSize(szXY);
+		}
+		else if( _tcsicmp(pstrName, _T("step")) == 0 ) {
+			SetChangeStep(_ttoi(pstrValue));
+		}
+		else if( _tcsicmp(pstrName, _T("sendmove")) == 0 ) {
+			SetCanSendMove(_tcsicmp(pstrValue, _T("true")) == 0);
+		}
+		else CProgressUI::SetAttribute(pstrName, pstrValue);
+	}
+
+	void CSliderUI::PaintForeImage(HDC hDC)
+	{
+		CProgressUI::PaintForeImage(hDC);
+
+		RECT rcThumb = GetThumbRect();
+		rcThumb.left -= m_rcItem.left;
+		rcThumb.top -= m_rcItem.top;
+		rcThumb.right -= m_rcItem.left;
+		rcThumb.bottom -= m_rcItem.top;
+
+		GetManager()->GetDPIObj()->ScaleBack(&rcThumb);
+
+		if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
+			if( !m_sThumbPushedImage.IsEmpty() ) {
+				m_sImageModify.Empty();
+				m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
+				if( !DrawImage(hDC, (LPCTSTR)m_sThumbPushedImage, (LPCTSTR)m_sImageModify) ) {}
+				else return;
+			}
+		}
+		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
+			if( !m_sThumbHotImage.IsEmpty() ) {
+				m_sImageModify.Empty();
+				m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
+				if( !DrawImage(hDC, (LPCTSTR)m_sThumbHotImage, (LPCTSTR)m_sImageModify) ) {}
+				else return;
+			}
+		}
+
+		if( !m_sThumbImage.IsEmpty() ) {
+			m_sImageModify.Empty();
+			m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
+			if( !DrawImage(hDC, (LPCTSTR)m_sThumbImage, (LPCTSTR)m_sImageModify) ) {}
+			else return;
+		}
+	}
+}

+ 52 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UISlider.h

@@ -0,0 +1,52 @@
+#ifndef __UISLIDER_H__
+#define __UISLIDER_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CSliderUI : public CProgressUI
+	{
+		DECLARE_DUICONTROL(CSliderUI)
+	public:
+		CSliderUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		void SetEnabled(bool bEnable = true);
+
+		int GetChangeStep();
+		void SetChangeStep(int step);
+		void SetThumbSize(SIZE szXY);
+		RECT GetThumbRect() const;
+		LPCTSTR GetThumbImage() const;
+		void SetThumbImage(LPCTSTR pStrImage);
+		LPCTSTR GetThumbHotImage() const;
+		void SetThumbHotImage(LPCTSTR pStrImage);
+		LPCTSTR GetThumbPushedImage() const;
+		void SetThumbPushedImage(LPCTSTR pStrImage);
+
+		void DoEvent(TEventUI& event);
+		void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
+		void PaintForeImage(HDC hDC);
+
+		void SetValue(int nValue);
+		void SetCanSendMove(bool bCanSend);
+		bool GetCanSendMove() const;
+	protected:
+		SIZE m_szThumb;
+		UINT m_uButtonState;
+		int m_nStep;
+
+		CDuiString m_sThumbImage;
+		CDuiString m_sThumbHotImage;
+		CDuiString m_sThumbPushedImage;
+
+		CDuiString m_sImageModify;
+		bool	   m_bSendMove;
+	};
+}
+
+#endif // __UISLIDER_H__

+ 169 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIText.cpp

@@ -0,0 +1,169 @@
+#include "StdAfx.h"
+#include "UIText.h"
+
+namespace DuiLib
+{
+	IMPLEMENT_DUICONTROL(CTextUI)
+
+	CTextUI::CTextUI() : m_nLinks(0), m_nHoverLink(-1)
+	{
+		m_uTextStyle = DT_WORDBREAK;
+		m_rcTextPadding.left = 2;
+		m_rcTextPadding.right = 2;
+		::ZeroMemory(m_rcLinks, sizeof(m_rcLinks));
+	}
+
+	CTextUI::~CTextUI()
+	{
+	}
+
+	LPCTSTR CTextUI::GetClass() const
+	{
+		return _T("TextUI");
+	}
+
+	LPVOID CTextUI::GetInterface(LPCTSTR pstrName)
+	{
+		if( _tcsicmp(pstrName, DUI_CTR_TEXT) == 0 ) return static_cast<CTextUI*>(this);
+		return CLabelUI::GetInterface(pstrName);
+	}
+
+	UINT CTextUI::GetControlFlags() const
+	{
+		if( IsEnabled() && m_nLinks > 0 ) return UIFLAG_SETCURSOR;
+		else return 0;
+	}
+
+	CDuiString* CTextUI::GetLinkContent(int iIndex)
+	{
+		if( iIndex >= 0 && iIndex < m_nLinks ) return &m_sLinks[iIndex];
+		return NULL;
+	}
+
+	void CTextUI::DoEvent(TEventUI& event)
+	{
+		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
+			if( m_pParent != NULL ) m_pParent->DoEvent(event);
+			else CLabelUI::DoEvent(event);
+			return;
+		}
+
+		if( event.Type == UIEVENT_SETCURSOR ) {
+			for( int i = 0; i < m_nLinks; i++ ) {
+				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
+					::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)));
+					return;
+				}
+			}
+		}
+		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK && IsEnabled() ) {
+			for( int i = 0; i < m_nLinks; i++ ) {
+				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
+					Invalidate();
+					return;
+				}
+			}
+		}
+		if( event.Type == UIEVENT_BUTTONUP && IsEnabled() ) {
+			for( int i = 0; i < m_nLinks; i++ ) {
+				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
+					m_pManager->SendNotify(this, DUI_MSGTYPE_LINK, i);
+					return;
+				}
+			}
+		}
+		if( event.Type == UIEVENT_CONTEXTMENU )
+		{
+			return;
+		}
+		// When you move over a link
+		if( m_nLinks > 0 && event.Type == UIEVENT_MOUSEMOVE && IsEnabled() ) {
+			int nHoverLink = -1;
+			for( int i = 0; i < m_nLinks; i++ ) {
+				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
+					nHoverLink = i;
+					break;
+				}
+			}
+
+			if(m_nHoverLink != nHoverLink) {
+				m_nHoverLink = nHoverLink;
+				Invalidate();
+				return;
+			}      
+		}
+		if( event.Type == UIEVENT_MOUSELEAVE ) {
+			if( m_nLinks > 0 && IsEnabled() ) {
+				if(m_nHoverLink != -1) {
+					m_nHoverLink = -1;
+					Invalidate();
+					return;
+				}
+			}
+		}
+
+		CLabelUI::DoEvent(event);
+	}
+
+	SIZE CTextUI::EstimateSize(SIZE szAvailable)
+	{
+		CDuiString sText = GetText();
+		RECT m_rcTextPadding = GetTextPadding();
+
+		RECT rcText = { 0, 0, m_bAutoCalcWidth ? 9999 : GetManager()->GetDPIObj()->Scale(m_cxyFixed.cx), 9999 };
+		rcText.left += m_rcTextPadding.left;
+		rcText.right -= m_rcTextPadding.right;
+
+		if( m_bShowHtml ) {   
+			int nLinks = 0;
+			CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, m_dwTextColor, NULL, NULL, nLinks, m_iFont, DT_CALCRECT | m_uTextStyle);
+		}
+		else {
+			CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, sText, m_dwTextColor, m_iFont, DT_CALCRECT | m_uTextStyle);
+		}
+		SIZE cXY = {rcText.right - rcText.left + m_rcTextPadding.left + m_rcTextPadding.right,
+			rcText.bottom - rcText.top + m_rcTextPadding.top + m_rcTextPadding.bottom};
+		
+		if (m_bAutoCalcWidth)
+		{
+			m_cxyFixed.cx = MulDiv(cXY.cx, 100.0, GetManager()->GetDPIObj()->GetScale());
+		}
+
+		return CControlUI::EstimateSize(szAvailable);
+	}
+
+	void CTextUI::PaintText(HDC hDC)
+	{
+		CDuiString sText = GetText();
+		if( sText.IsEmpty() ) {
+			m_nLinks = 0;
+			return;
+		}
+
+		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
+		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
+
+		m_nLinks = lengthof(m_rcLinks);
+		RECT rc = m_rcItem;
+		rc.left += m_rcTextPadding.left;
+		rc.right -= m_rcTextPadding.right;
+		rc.top += m_rcTextPadding.top;
+		rc.bottom -= m_rcTextPadding.bottom;
+		if( IsEnabled() ) {
+			if( m_bShowHtml )
+				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwTextColor, \
+				m_rcLinks, m_sLinks, m_nLinks, m_iFont, m_uTextStyle);
+			else
+				CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
+				m_iFont, m_uTextStyle);
+		}
+		else {
+			if( m_bShowHtml )
+				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
+				m_rcLinks, m_sLinks, m_nLinks, m_iFont, m_uTextStyle);
+			else
+				CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
+				m_iFont, m_uTextStyle);
+		}
+	}
+}

+ 36 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UIText.h

@@ -0,0 +1,36 @@
+#ifndef __UITEXT_H__
+#define __UITEXT_H__
+
+#pragma once
+
+namespace DuiLib
+{
+	class UILIB_API CTextUI : public CLabelUI
+	{
+		DECLARE_DUICONTROL(CTextUI)
+	public:
+		CTextUI();
+		~CTextUI();
+
+		LPCTSTR GetClass() const;
+		UINT GetControlFlags() const;
+		LPVOID GetInterface(LPCTSTR pstrName);
+
+		CDuiString* GetLinkContent(int iIndex);
+
+		void DoEvent(TEventUI& event);
+		SIZE EstimateSize(SIZE szAvailable);
+
+		void PaintText(HDC hDC);
+
+	protected:
+		enum { MAX_LINK = 8 };
+		int m_nLinks;
+		RECT m_rcLinks[MAX_LINK];
+		CDuiString m_sLinks[MAX_LINK];
+		int m_nHoverLink;
+	};
+
+} // namespace DuiLib
+
+#endif //__UITEXT_H__

+ 0 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DuiLib/Control/UITreeView.cpp


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff