commit eb601195fe2fb13ac957eb3456f7522d4452afd3 Author: JianjunLiu Date: Wed Apr 20 14:33:56 2022 +0800 编辑器 上传 diff --git a/ACE.dll b/ACE.dll new file mode 100644 index 0000000..264e4be Binary files /dev/null and b/ACE.dll differ diff --git a/API-MS-Win-Core-Heap-Obsolete-L1-1-0.dll b/API-MS-Win-Core-Heap-Obsolete-L1-1-0.dll new file mode 100644 index 0000000..dffa703 Binary files /dev/null and b/API-MS-Win-Core-Heap-Obsolete-L1-1-0.dll differ diff --git a/API-MS-Win-Core-Kernel32-Private-L1-1-0.dll b/API-MS-Win-Core-Kernel32-Private-L1-1-0.dll new file mode 100644 index 0000000..b2774bb Binary files /dev/null and b/API-MS-Win-Core-Kernel32-Private-L1-1-0.dll differ diff --git a/API-MS-Win-Core-Kernel32-Private-L1-1-1.dll b/API-MS-Win-Core-Kernel32-Private-L1-1-1.dll new file mode 100644 index 0000000..3bc8aa8 Binary files /dev/null and b/API-MS-Win-Core-Kernel32-Private-L1-1-1.dll differ diff --git a/API-MS-Win-EventLog-Legacy-L1-1-0.dll b/API-MS-Win-EventLog-Legacy-L1-1-0.dll new file mode 100644 index 0000000..1ef3ce4 Binary files /dev/null and b/API-MS-Win-EventLog-Legacy-L1-1-0.dll differ diff --git a/API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll b/API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll new file mode 100644 index 0000000..0267f38 Binary files /dev/null and b/API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll differ diff --git a/API-MS-Win-Eventing-Controller-L1-1-0.dll b/API-MS-Win-Eventing-Controller-L1-1-0.dll new file mode 100644 index 0000000..14e9d4a Binary files /dev/null and b/API-MS-Win-Eventing-Controller-L1-1-0.dll differ diff --git a/API-MS-Win-Eventing-Legacy-L1-1-0.dll b/API-MS-Win-Eventing-Legacy-L1-1-0.dll new file mode 100644 index 0000000..68a59b7 Binary files /dev/null and b/API-MS-Win-Eventing-Legacy-L1-1-0.dll differ diff --git a/API-MS-Win-Eventing-Provider-L1-1-0.dll b/API-MS-Win-Eventing-Provider-L1-1-0.dll new file mode 100644 index 0000000..e470925 Binary files /dev/null and b/API-MS-Win-Eventing-Provider-L1-1-0.dll differ diff --git a/API-MS-Win-Security-Lsalookup-L2-1-0.dll b/API-MS-Win-Security-Lsalookup-L2-1-0.dll new file mode 100644 index 0000000..719d9f7 Binary files /dev/null and b/API-MS-Win-Security-Lsalookup-L2-1-0.dll differ diff --git a/API-MS-Win-Security-Lsalookup-L2-1-1.dll b/API-MS-Win-Security-Lsalookup-L2-1-1.dll new file mode 100644 index 0000000..b2147d1 Binary files /dev/null and b/API-MS-Win-Security-Lsalookup-L2-1-1.dll differ diff --git a/API-MS-Win-core-file-l2-1-0.dll b/API-MS-Win-core-file-l2-1-0.dll new file mode 100644 index 0000000..c90326b Binary files /dev/null and b/API-MS-Win-core-file-l2-1-0.dll differ diff --git a/API-MS-Win-core-file-l2-1-1.dll b/API-MS-Win-core-file-l2-1-1.dll new file mode 100644 index 0000000..dd1c5e2 Binary files /dev/null and b/API-MS-Win-core-file-l2-1-1.dll differ diff --git a/API-MS-Win-core-localization-obsolete-l1-2-0.dll b/API-MS-Win-core-localization-obsolete-l1-2-0.dll new file mode 100644 index 0000000..5d82520 Binary files /dev/null and b/API-MS-Win-core-localization-obsolete-l1-2-0.dll differ diff --git a/API-MS-Win-core-string-l2-1-0.dll b/API-MS-Win-core-string-l2-1-0.dll new file mode 100644 index 0000000..cd497db Binary files /dev/null and b/API-MS-Win-core-string-l2-1-0.dll differ diff --git a/API-MS-Win-core-string-obsolete-l1-1-0.dll b/API-MS-Win-core-string-obsolete-l1-1-0.dll new file mode 100644 index 0000000..03dbf9a Binary files /dev/null and b/API-MS-Win-core-string-obsolete-l1-1-0.dll differ diff --git a/API-MS-Win-core-xstate-l2-1-0.dll b/API-MS-Win-core-xstate-l2-1-0.dll new file mode 100644 index 0000000..ec98200 Binary files /dev/null and b/API-MS-Win-core-xstate-l2-1-0.dll differ diff --git a/API-MS-Win-devices-config-L1-1-0.dll b/API-MS-Win-devices-config-L1-1-0.dll new file mode 100644 index 0000000..7bfa538 Binary files /dev/null and b/API-MS-Win-devices-config-L1-1-0.dll differ diff --git a/API-MS-Win-devices-config-L1-1-1.dll b/API-MS-Win-devices-config-L1-1-1.dll new file mode 100644 index 0000000..9af07d6 Binary files /dev/null and b/API-MS-Win-devices-config-L1-1-1.dll differ diff --git a/API-MS-Win-security-lsapolicy-l1-1-0.dll b/API-MS-Win-security-lsapolicy-l1-1-0.dll new file mode 100644 index 0000000..d493016 Binary files /dev/null and b/API-MS-Win-security-lsapolicy-l1-1-0.dll differ diff --git a/API-MS-Win-security-provider-L1-1-0.dll b/API-MS-Win-security-provider-L1-1-0.dll new file mode 100644 index 0000000..0c0d146 Binary files /dev/null and b/API-MS-Win-security-provider-L1-1-0.dll differ diff --git a/BasicDLL.dll b/BasicDLL.dll new file mode 100644 index 0000000..8ef71fc Binary files /dev/null and b/BasicDLL.dll differ diff --git a/CSAPI64.dll b/CSAPI64.dll new file mode 100644 index 0000000..3d70067 Binary files /dev/null and b/CSAPI64.dll differ diff --git a/CommKrnl.dll b/CommKrnl.dll new file mode 100644 index 0000000..0ded604 Binary files /dev/null and b/CommKrnl.dll differ diff --git a/CommonDlgUtils.dll b/CommonDlgUtils.dll new file mode 100644 index 0000000..4321217 Binary files /dev/null and b/CommonDlgUtils.dll differ diff --git a/CommonUse.dll b/CommonUse.dll new file mode 100644 index 0000000..efa2469 Binary files /dev/null and b/CommonUse.dll differ diff --git a/ConnectMan.exe b/ConnectMan.exe new file mode 100644 index 0000000..1d598e9 Binary files /dev/null and b/ConnectMan.exe differ diff --git a/DocProc.dll b/DocProc.dll new file mode 100644 index 0000000..75dd6e6 Binary files /dev/null and b/DocProc.dll differ diff --git a/Func2Ext.exe b/Func2Ext.exe new file mode 100644 index 0000000..230374b Binary files /dev/null and b/Func2Ext.exe differ diff --git a/FuncDLL.dll b/FuncDLL.dll new file mode 100644 index 0000000..70e7037 Binary files /dev/null and b/FuncDLL.dll differ diff --git a/GraphDll.dll b/GraphDll.dll new file mode 100644 index 0000000..8132dee Binary files /dev/null and b/GraphDll.dll differ diff --git a/Help/LANGUAGEGUIDE.CHM b/Help/LANGUAGEGUIDE.CHM new file mode 100644 index 0000000..ae0d109 Binary files /dev/null and b/Help/LANGUAGEGUIDE.CHM differ diff --git a/Help/LANGUAGEGUIDE.HLP b/Help/LANGUAGEGUIDE.HLP new file mode 100644 index 0000000..7018b3b Binary files /dev/null and b/Help/LANGUAGEGUIDE.HLP differ diff --git a/Help/LanguageGuide.chw b/Help/LanguageGuide.chw new file mode 100644 index 0000000..c5154f8 Binary files /dev/null and b/Help/LanguageGuide.chw differ diff --git a/Help/LanguageGuide.cnt b/Help/LanguageGuide.cnt new file mode 100644 index 0000000..445ce73 --- /dev/null +++ b/Help/LanguageGuide.cnt @@ -0,0 +1,1607 @@ +:Base LanguageGuide.hlp +1 TSLԻ +2 TSLԻ=TH_1 +2 Ը +3 Ը=TH_2 +3 TSL=TH_3 +3 TSLԵص=TH_4 +2 ֪ʶ +3 ֪ʶ=TH_5 +3 TSLĻ=TH_6 +3 TSLķ +4 TSLķ=TH_7 +4 (ؼ) +5 (ؼ)=TH_8 +5 PROGRAM=TH_9 +5 FUNCTION=TH_10 +5 BEGIN=TH_11 +5 END=TH_12 +5 PARAMCOUNT=TH_680 +5 PARAMS=TH_681 +5 SYSPARAMS=TH_915 +5 SYSTEM=TH_776 +5 IF=TH_13 +5 THEN=TH_14 +5 ELSE=TH_15 +5 WITH=TH_683 +5 FOR=TH_16 +5 TO=TH_17 +5 DOWNTO=TH_18 +5 DO=TH_19 +5 STEP=TH_916 +5 WHILE=TH_20 +5 REPEAT=TH_917 +5 UNTIL=TH_918 +5 BREAK=TH_21 +5 CONTINUE=TH_22 +5 RETURN=TH_23 +5 DEBUGRETURN=TH_24 +5 EXIT=TH_25 +5 ARRAY=TH_26 +5 NIL=TH_27 +5 TRUE=TH_28 +5 FALSE=TH_29 +5 AND=TH_30 +5 OR=TH_31 +5 NOT=TH_32 +5 IN=TH_33 +5 LIKE=TH_919 +5 MOD=TH_777 +5 DIV=TH_778 +5 RAISE=TH_34 +5 TRY=TH_35 +5 EXCEPT=TH_36 +5 FINALLY=TH_37 +5 SQL﷨ֱ֧=TH_920 +3 ʶ=TH_38 +4 עͷ=TH_39 +3 TSL +4 TSL=TH_40 +4 Integer=TH_41 +4 Real=TH_42 +4 Boolean=TH_43 +4 TDateTime=TH_44 +4 String=TH_45 +4 Binary=TH_921 +4 ArrayTableArray=TH_46 +4 TMatrix=TH_456 +4 Matrix=TH_922 +4 NIL=TH_47 +4 TGraph=TH_48 +4 TGraphGroup=TH_49 +4 TExpression=TH_50 +4 ComObj=TH_923 +4 TSLObj=TH_925 +2 =TH_51 +3 ͱʽ +4 ͱʽ=TH_52 +4 ȼ +5 ȼ=TH_53 +5 +6 =TH_54 +6 =TH_55 +6 ߼=TH_56 +6 ϵ=TH_57 +6 ʽ=TH_58 +6 Withֵ=TH_684 +6 ʷ=TH_926 +4 ȼ=TH_59 +4 ʽ +5 ʽ=TH_60 +5 ʽ=TH_61 +5 ʽ=TH_62 +2 ̿ +3 ̿=TH_63 +3 +4 =TH_64 +4 IF=TH_65 +3 ѭ +4 ѭ=TH_66 +4 WHILE=TH_67 +4 REPEAT=TH_927 +4 FOR=TH_68 +4 BREAK=TH_69 +4 CONTINUE=TH_70 +3 ƣԼ +4 ƣԼ=TH_71 +4 RAISE=TH_72 +4 DEBUGRETURN=TH_73 +4 쳣=TH_685 +2 ķغ˳=TH_74 +2 SQL﷨֧ +3 SQL﷨֧=TH_928 +3 SELECTѯ +4 SELECTѯ=TH_929 +4 VSelect=TH_930 +4 MSelect=TH_931 +4 SSelect=TH_932 +4 SelectӾ=TH_933 +4 FromӾ=TH_934 +4 WHEREӾ=TH_935 +4 GROUP BY Ӿ=TH_936 +4 ORDER BYӾ=TH_937 +4 ֶαʽ=TH_938 +4 Уͺ +5 Уͺ=TH_939 +5 ThisRow=TH_940 +5 ThisRowIndex=TH_941 +5 ChecksumOf=TH_942 +4 ۼ +5 ۼ=TH_943 +5 COUNTOF=TH_944 +5 REFOF=TH_945 +5 COUNTIFOF=TH_946 +5 AVGOF=TH_947 +5 HARMEANOF=TH_948 +5 GEOMEANOF=TH_949 +5 SUMOF=TH_950 +5 MINOF=TH_951 +5 MAXOF=TH_952 +5 MODEOF=TH_953 +5 MEDIANOF=TH_954 +5 STDEVOF=TH_955 +5 STDEVPOF=TH_956 +5 VAROF=TH_957 +5 VARPOF=TH_958 +5 AvedevOF=TH_959 +5 DEVSQOF=TH_960 +5 NORMOF=TH_961 +5 SKEWOF=TH_962 +5 KURTOSISOF=TH_963 +5 CHECKSUM_AGGOF=TH_964 +5 AGGOF +6 AGGOF=TH_965 +6 ۼչĶ淶=TH_966 +3 INSERT=TH_967 +3 UPDATE=TH_968 +3 DELETE=TH_969 +1 黷=TH_686 +2 ͺ +3 ͺ=TH_75 +3 =TH_779 +3 Ӻ=TH_77 +3 ʽʵʲ +4 ʽʵʲ=TH_78 +4 ֵ=TH_79 +4 =TH_80 +4 Լ˳=TH_81 +2 һЩע=TH_84 +1 ڷ.NETȫ +2 ڷ.NETȫ=TH_85 +2 ֤ȯغ +3 ֤ȯغ=TH_86 +3 ʱغ +4 ʱغ=TH_87 +4 sp_time=TH_88 +4 tradeDays=TH_89 +4 FirstDay=TH_90 +4 LastDay=TH_970 +3 ж +4 ж=TH_91 +4 IsStock=TH_92 +4 IsTradeDay=TH_93 +4 TestStock=TH_94 +4 IsValidCode=TH_971 +4 ValidFullCode=TH_972 +3 +4 =TH_95 +4 Rd=TH_96 +3 ̺(ڵտ) +4 ̺(ڵտ)=TH_97 +4 Open=TH_98 +4 Close=TH_99 +4 High=TH_100 +4 Low=TH_101 +4 Vol=TH_102 +4 Amount=TH_103 +4 Sys_PrevClose=TH_780 +4 TradeCount=TH_973 +4 SseSyl1=TH_974 +4 SseSyl2=TH_975 +4 Buy1=TH_976 +4 BuyVol1=TH_977 +4 Buy2=TH_978 +4 BuyVol2=TH_979 +4 Buy3=TH_980 +4 BuyVol3=TH_981 +4 Buy4=TH_982 +4 BuyVol4=TH_983 +4 Buy5=TH_984 +4 BuyVol5=TH_985 +4 Sale1=TH_986 +4 SaleVol1=TH_987 +4 Sale2=TH_988 +4 SaleVol2=TH_989 +4 Sale3=TH_990 +4 SaleVol3=TH_991 +4 Sale4=TH_992 +4 SaleVol4=TH_993 +4 Sale5=TH_994 +4 SaleVol5=TH_995 +4 VolRate=TH_996 +4 SectionOpen=TH_997 +4 SectionHigh=TH_998 +4 SectionLow=TH_999 +4 SectionVol=TH_1000 +4 SectionAmount=TH_1001 +4 SectionPrevClose=TH_1002 +4 SectionTradeCount=TH_1003 +4 SectionTradeWay=TH_1004 +4 InitialtiveBuyAmount=TH_1005 +4 InitialtiveBuyVol=TH_1006 +4 InitialtiveSaleAmount=TH_1007 +4 InitialtiveSaleVol=TH_1008 +4 SubmitBuyVol=TH_1009 +4 SubmitSaleVol=TH_1010 +4 SubmitBSR=TH_1011 +4 SectionInitialtiveBuyAmount=TH_1012 +4 SectionInitialtiveBuyVol=TH_1013 +4 SectionInitialtiveSaleAmount=TH_1014 +4 SectionInitialtiveSaleVol=TH_1015 +4 SectionSubmitBuyVol=TH_1016 +4 SectionSubmitSaleVol=TH_1017 +4 SectionSubmitBSR=TH_1018 +4 OpenInterest=TH_1596 +4 Settlement=TH_1597 +4 Prev_Settlement=TH_1598 +4 SectionOpenInterest=TH_1599 +4 Advance=TH_104 +4 Decline=TH_105 +4 Flat=TH_781 +4 HHV=TH_106 +4 LLV=TH_107 +4 MA=TH_108 +4 EMA=TH_109 +4 IsUp=TH_110 +4 IsDown=TH_111 +4 IsEqual=TH_112 +4 Cross=TH_113 +4 Count=TH_114 +4 SMA=TH_115 +4 SumN=TH_116 +3 ɽϸݺ +4 ɽϸݺ=TH_774 +4 toverData=TH_775 +4 toverDataEx=TH_1019 +4 TD=TH_1020 +4 TDByIndex=TH_1021 +4 TDCount=TH_1022 +4 TDCountEx=TH_1023 +4 TDInfo=TH_1024 +4 TDInfoByIndex=TH_1025 +4 TDSum=TH_1026 +3 ϸֶαʶ +4 ϸֶαʶ=TH_1027 +4 tdf_time=TH_1028 +4 tdf_price=TH_1029 +4 tdf_amount=TH_1030 +4 tdf_vol=TH_1031 +4 tdf_lb=TH_1032 +4 tdf_buy1=TH_1033 +4 tdf_buy2=TH_1034 +4 tdf_buy3=TH_1035 +4 tdf_buy4=TH_1036 +4 tdf_buy5=TH_1037 +4 tdf_sale1=TH_1038 +4 tdf_sale2=TH_1039 +4 tdf_sale3=TH_1040 +4 tdf_sale4=TH_1041 +4 tdf_sale5=TH_1042 +4 tdf_buy1count=TH_1043 +4 tdf_buy2count=TH_1044 +4 tdf_buy3count=TH_1045 +4 tdf_buy4count=TH_1046 +4 tdf_buy5count=TH_1047 +4 tdf_sale1count=TH_1048 +4 tdf_sale2count=TH_1049 +4 tdf_sale3count=TH_1050 +4 tdf_sale4count=TH_1051 +4 tdf_sale5count=TH_1052 +4 tdf_tradecount=TH_1053 +4 tdf_syl1=TH_1054 +4 tdf_syl2=TH_1055 +3 ѯѯ +4 ѯѯ=TH_119 +4 Query=TH_120 +4 Foreach=TH_121 +3 гͰ麯 +4 гͰ麯=TH_122 +4 GetBK=TH_123 +4 GetUserBKList=TH_124 +4 GetBKList=TH_125 +4 GetUserBKList2=TH_1056 +4 GetBKList2=TH_1057 +3 ûͺغ +4 ûͺغ=TH_126 +4 User=TH_127 +4 UserName=TH_128 +4 FunctionType=TH_129 +4 FunctionName=TH_130 +4 FunctionVer=TH_131 +4 UserConfig=TH_782 +4 Call=TH_682 +4 SetUID=TH_1600 +4 SUDO=TH_1601 +3 ȡк +4 ȡк=TH_132 +4 NDay=TH_133 +4 NDay2=TH_134 +4 NDay3=TH_135 +3 ͳƺ +4 ͳƺ=TH_136 +4 SP_STD=TH_137 +4 SP_STDP=TH_138 +4 SP_VAR=TH_139 +4 SP_VARP=TH_140 +4 SP_AVEDDEV=TH_141 +4 SP_DEVSQ=TH_142 +3 ָ +4 ָ=TH_143 +4 Ref=TH_144 +4 SpecDate=TH_145 +4 Spec=TH_146 +3 ϵͳúͻȡ +4 ϵͳúͻȡ=TH_687 +4 GetSysParam=TH_148 +4 SetSysParam=TH_149 +3 ϵͳƺ +4 ϵͳƺ=TH_150 +4 pn_Stock=TH_151 +4 pn_Date=TH_152 +4 pn_Rate=TH_153 +4 pn_RateDay=TH_678 +4 pn_nDay=TH_154 +4 pn_Cycle=TH_155 +4 pn_Precision=TH_156 +3 Ȩͺ +4 Ȩͺ=TH_1058 +4 rt_none=TH_1059 +4 rt_scale=TH_1060 +4 rt_complex=TH_1061 +3 Ȩ׼պ +4 Ȩ׼պ=TH_1062 +4 rd_lastday=TH_1063 +4 rd_firstday=TH_1064 +3 ں +4 ں=TH_157 +4 Cy_day=TH_158 +4 Cy_month=TH_159 +4 Cy_week=TH_160 +4 Cy_Quarter=TH_783 +4 Cy_HalfYear=TH_784 +4 Cy_Year=TH_785 +4 Cy_1m=TH_161 +4 Cy_2m=TH_786 +4 Cy_3m=TH_787 +4 Cy_5m=TH_162 +4 Cy_10m=TH_788 +4 Cy_15m=TH_163 +4 Cy_30m=TH_164 +4 Cy_60m=TH_165 +4 Cy_120m=TH_789 +4 Cy_Detail=TH_1065 +3 +4 =TH_166 +4 Report=TH_167 +4 ReportOfDiy=TH_1602 +4 ReportExists=TH_790 +4 ReportHist=TH_168 +4 ReportHistExists=TH_791 +4 Base=TH_169 +4 BaseExists=TH_792 +4 InfoArray=TH_170 +4 InfoArrayExt=TH_793 +4 InfoArrayExists=TH_794 +4 bName=TH_171 +4 idtType=TH_688 +4 idfType=TH_689 +4 BasicIDExists=TH_795 +2 ͼκ +3 ͼκ=TH_172 +3 ͼ +4 ͼ=TH_173 +4 Graph=TH_174 +4 GraphGroup=TH_175 +4 DecodeGraphGroup=TH_176 +4 EncodeGraphGroup=TH_177 +4 DecodeGraph=TH_178 +4 EncodeGraph=TH_179 +3 ͼͺ +4 ͼͺ=TH_180 +4 gtLine=TH_181 +4 gtKLine=TH_182 +4 gtTower=TH_183 +4 gtAmerican=TH_184 +4 gtBar=TH_185 +4 gtSingleBar=TH_186 +4 gtCircle=TH_187 +3 ͼֶκ +4 ͼֶκ=TH_188 +4 gfValue=TH_189 +4 gfClose=TH_190 +4 gfOpen=TH_191 +4 gfHigh=TH_192 +4 gfLow=TH_193 +4 gfTowerLow=TH_194 +4 gfTowerHigh=TH_195 +4 gfTowerMid=TH_196 +4 gfVol=TH_197 +4 gfAmount=TH_198 +4 gfTime=TH_199 +4 gfColor=TH_200 +4 gfFill=TH_201 +4 gfFlag=TH_202 +4 gfRateFlag=TH_203 +4 gfZero=TH_204 +4 gfMaxValue=TH_205 +4 gfMinValue=TH_206 +4 gfLTP=TH_207 +4 gfTitleCaption=TH_1066 +4 gfLeftTitleCaption=TH_1067 +4 gfCoordinate=TH_1068 +3 ͼαʾ +4 ͼαʾ=TH_208 +4 fgNone=TH_209 +4 fgUp=TH_210 +4 fgDown=TH_211 +4 fgLeft=TH_212 +4 fgRight=TH_213 +4 fgLeftUp=TH_214 +4 fgLeftDown=TH_215 +4 fgRightUp=TH_216 +4 fgRightDown=TH_217 +3 ͼú +4 ͼú=TH_218 +4 flSolid=TH_219 +4 flClear=TH_220 +4 flHorizontal=TH_221 +4 flVertical=TH_222 +4 flFDiagonal=TH_223 +4 flBDiagonal=TH_224 +4 flCross=TH_225 +4 flDiagCross=TH_226 +3 ɫ +4 ɫ=TH_227 +4 clBlack=TH_228 +4 clMaroon=TH_229 +4 clGreen=TH_230 +4 clOlive=TH_231 +4 clNavy=TH_232 +4 clPurple=TH_233 +4 clTeal=TH_234 +4 clGray=TH_235 +4 clSilver=TH_236 +4 clRed=TH_237 +4 clLime=TH_238 +4 clYellow=TH_239 +4 clBlue=TH_240 +4 clFuchsia=TH_241 +4 clAqua=TH_242 +4 clLtGray=TH_243 +4 clDkGray=TH_244 +4 clWhite=TH_245 +4 clMoneyGreen=TH_246 +4 clSkyBlue=TH_247 +4 clCream=TH_248 +4 clMedGray=TH_249 +3 ɫ任 +4 ɫ任=TH_1069 +4 GetCValue=TH_1070 +4 GetMValue=TH_1071 +4 GetYValue=TH_1072 +4 GetKValue=TH_1073 +4 CMYK=TH_1074 +4 RGB=TH_1075 +4 PaletteRGB=TH_1076 +4 PaletteIndex=TH_1077 +4 GetRValue=TH_1078 +4 GetGValue=TH_1079 +4 GetBValue=TH_1080 +2 ϵͳغ +3 ϵͳغ=TH_250 +3 ͺ +4 ͺ=TH_251 +4 DataType=TH_252 +4 ifInt=TH_253 +4 ifReal=TH_254 +4 ifNumber=TH_255 +4 ifString=TH_256 +4 ifArray=TH_257 +4 ifNil=TH_258 +4 ifExp=TH_259 +4 ifGraph=TH_260 +4 ifGraphGroup=TH_261 +4 ifBinary=TH_1081 +4 ifMatrix=TH_1362 +4 ifObj=TH_1083 +4 GetOleObject=TH_1084 +4 CreateComObject=TH_1085 +4 CreateObject=TH_1086 +4 CreateMatrix=TH_1087 +4 GetMatrixFields=TH_1088 +4 CreateBinary=TH_1089 +3 ƺ +4 ƺ=TH_262 +4 dupValue=TH_263 +3 +4 =TH_264 +4 randomize=TH_265 +4 random=TH_266 +4 RandomFrom=TH_267 +3 ѡ +4 ѡ=TH_268 +4 IfThen=TH_269 +3 ת +4 ת=TH_288 +4 Integer=TH_289 +4 Real=TH_290 +4 String=TH_1090 +4 Binary=TH_1091 +4 SetPrecision=TH_291 +4 ToSTM=TH_1092 +4 ToSTN=TH_1093 +4 ToXML=TH_1094 +4 STM=TH_1095 +4 STN=TH_1096 +4 XML=TH_1097 +3 ά +4 ά=TH_292 +4 SaveTable=TH_293 +4 LoadTable=TH_294 +4 TestTable=TH_797 +3 ʽغ +4 ʽغ=TH_295 +4 Eval=TH_296 +2 麯 +3 麯=TH_1098 +3 ±Լغ +4 ±Լغ=TH_1099 +4 GetStrIndexNum=TH_280 +4 GetStrIndexs=TH_281 +4 GetIntIndexs=TH_282 +4 GetAllIndexs=TH_796 +4 DeleteIndex=TH_283 +4 DeleteField=TH_284 +4 Length=TH_278 +3 +4 =TH_285 +4 SortTableByField=TH_286 +4 SortArray=TH_287 +2 ѧ +3 ѧ=TH_378 +3 ѧ +4 ѧ=TH_1100 +4 Pi=TH_299 +4 Sin=TH_300 +4 Cos=TH_301 +4 ArcTan=TH_302 +4 Odd=TH_303 +4 Abs=TH_304 +4 Exp=TH_305 +4 Ln=TH_306 +4 Sqr=TH_307 +4 Sqrt=TH_308 +4 Int=TH_309 +4 Frac=TH_310 +4 Round=TH_311 +4 Trunc=TH_312 +3 λ㺯 +4 λ㺯=TH_1101 +4 _And=TH_799 +4 _Or=TH_800 +4 _Not=TH_801 +4 _Xor=TH_802 +4 _Shl=TH_803 +4 _Shr=TH_804 +4 _Rol=TH_805 +4 _Ror=TH_806 +3 Ǻ +4 Ǻ=TH_379 +4 ArcCos=TH_380 +4 ArcSin=TH_381 +4 ArcTan2=TH_382 +4 SinCos=TH_383 +4 Tan=TH_384 +4 CoTan=TH_385 +4 Secant=TH_386 +4 Cosecant=TH_387 +4 Hypot=TH_388 +4 RadToDeg=TH_389 +4 RadToGrad=TH_390 +4 RadToCycle=TH_391 +4 DegToRad=TH_392 +4 DegToGrad=TH_393 +4 DegToCycle=TH_394 +4 GradToRad=TH_395 +4 GradToDeg=TH_396 +4 GradToCycle=TH_397 +4 CycleToRad=TH_398 +4 CycleToDeg=TH_399 +4 CycleToGrad=TH_400 +4 Cot=TH_401 +4 Sec=TH_402 +4 Csc=TH_403 +4 ArcCot=TH_404 +4 ArcSec=TH_405 +4 ArcCsc=TH_406 +3 ˫ߺ +4 ˫ߺ=TH_407 +4 Cosh=TH_408 +4 Sinh=TH_409 +4 Tanh=TH_410 +4 CotH=TH_411 +4 SecH=TH_412 +4 CscH=TH_413 +4 ArcCosh=TH_414 +4 ArcSinh=TH_415 +4 ArcTanh=TH_416 +4 ArcCotH=TH_417 +4 ArcSecH=TH_418 +4 ArcCscH=TH_419 +3 +4 =TH_420 +4 LnXP1=TH_421 +4 Log10=TH_422 +4 Log2=TH_423 +4 LogN=TH_424 +3 ָ +4 ָ=TH_425 +4 IntPower=TH_426 +4 Power=TH_427 +3 +4 =TH_428 +4 Frexp=TH_429 +4 Ldexp=TH_430 +4 Ceil=TH_431 +4 Floor=TH_432 +4 Poly=TH_433 +3 ͳƺ +4 ͳƺ=TH_434 +4 Mean=TH_435 +4 Sum=TH_436 +4 SumInt=TH_437 +4 SumOfSquares=TH_438 +4 SumsAndSquares=TH_439 +4 MinValue=TH_440 +4 MinIntValue=TH_441 +4 Min=TH_442 +4 MaxValue=TH_443 +4 MaxIntValue=TH_444 +4 Max=TH_445 +4 StdDev=TH_446 +4 MeanAndStdDev=TH_447 +4 PopnStdDev=TH_448 +4 Variance=TH_449 +4 PopnVariance=TH_450 +4 TotalVariance=TH_451 +4 Norm=TH_452 +4 MomentSkewKurtosis=TH_453 +4 RandG=TH_454 +3 ͨú +4 ͨú=TH_463 +4 IsNan=TH_464 +4 IsInfinite=TH_465 +4 Sign=TH_466 +4 CompareValue=TH_467 +4 SameValue=TH_468 +4 IsZero=TH_469 +4 RandomRange=TH_470 +4 InRange=TH_471 +4 EnsureRange=TH_472 +4 DivMod=TH_473 +4 RoundTo=TH_474 +4 SimpleRoundTo=TH_475 +3 +4 =TH_476 +4 RealDecliningBalance=TH_477 +4 FutureValue=TH_478 +4 InterestPayment=TH_479 +4 InterestRate=TH_480 +4 InternalRateOfReturn=TH_481 +4 NumberOfPeriods=TH_482 +4 NetPresentValue=TH_483 +4 Payment=TH_484 +4 PeriodPayment=TH_485 +4 PresentValue=TH_486 +4 SLNDepreciation=TH_487 +4 SYDDepreciation=TH_488 +2 ֵ㺯 +3 ֵ㺯=TH_690 +3 Դ +4 Դ=TH_691 +4 se_Gauss=TH_692 +4 se_Gauss_Jordan =TH_907 +4 se_Ldl=TH_694 +4 se_Cholesky=TH_695 +4 se_Gauss_Seidel=TH_696 +3 ֵ +4 ֵ=TH_807 +4 ip_Lagrangian_A=TH_698 +4 ip_Lagrangian_B=TH_699 +4 ip_Parabola_A=TH_700 +4 ip_Parabola_B=TH_701 +4 ip_Hermite_A=TH_702 +4 ip_Hermite_B=TH_703 +4 ip_Aitken_A=TH_704 +4 ip_Aitken_B=TH_705 +4 ip_Spline_A=TH_706 +4 ip_Spline_B=TH_707 +4 ip_Spline_C=TH_708 +4 ip_SLQ=TH_709 +4 ip_SLG =TH_908 +3 ֵ +4 ֵ=TH_711 +4 ig_Trapezoid_1=TH_712 +4 ig_Simpson_1=TH_713 +4 ig_ Romberg=TH_714 +4 ig_Gauss=TH_715 +4 ig_Chebyshev=TH_716 +4 ig_Simpson_2=TH_717 +3 ⺯ +4 ⺯=TH_718 +4 sf_Gamma=TH_719 +4 sf_Beta=TH_720 +4 sf_IncompleteGamma=TH_721 +4 sf_Error=TH_722 +4 sf_IntegerBessel_1=TH_723 +4 sf_IntegerBessel_2=TH_724 +4 sf_RealBessel_1=TH_725 +4 sf_RealBessel_2=TH_726 +4 sf_IncompleteBeta=TH_727 +4 sf_Normal=TH_728 +4 sf_t=TH_729 +4 sf_X2=TH_730 +4 sf_F=TH_731 +4 sf_SinX=TH_732 +4 sf_CosX=TH_733 +4 sf_eX=TH_734 +4 sf_EllipseX_1=TH_735 +4 sf_EllipseX_2=TH_736 +3 +4 =TH_737 +4 mt_Multiplication=TH_738 +4 mt_Addition=TH_739 +4 mt_Subtraction=TH_740 +4 mt_Transposition=TH_741 +4 mt_iv_Gauss_Jordan=TH_742 +4 mt_iv_Ldl=TH_743 +4 mt_va_Gauss_Jordan=TH_744 +4 mt_va_ Cholesky=TH_745 +2 /ʱ亯 +3 /ʱ亯=TH_489 +3 ISO8601=TH_679 +3 ʱ亯 +4 ʱ亯=TH_1102 +4 EncodeDate=TH_349 +4 EncodeTime=TH_350 +4 TryEncodeDate=TH_351 +4 TryEncodeTime=TH_352 +4 DecodeDate=TH_353 +4 DecodeDateFully=TH_354 +4 DecodeTime=TH_355 +4 DayOfWeek=TH_356 +4 Date=TH_357 +4 Time=TH_358 +4 Now=TH_359 +4 CurrentYear=TH_360 +4 IncMonth=TH_361 +4 IncAMonth=TH_362 +4 IsLeapYear=TH_363 +4 DateToStr=TH_364 +4 TimeToStr=TH_365 +4 DateTimeToStr=TH_366 +4 StrToDate=TH_367 +4 StrToDateDef=TH_368 +4 TryStrToDate=TH_369 +4 StrToTime=TH_370 +4 StrToTimeDef=TH_371 +4 TryStrToTime=TH_372 +4 StrToDateTime=TH_373 +4 StrToDateTimeDef=TH_374 +4 TryStrToDateTime=TH_375 +4 FormatDateTime=TH_376 +4 DateTimeToString=TH_377 +4 DateTimeToInternetStr=TH_1103 +4 GMTToLocalDateTime=TH_1104 +3 ת +4 ת=TH_490 +4 DateOf=TH_491 +4 TimeOf=TH_492 +3 ͨں +4 ͨں=TH_493 +4 IsInLeapYear=TH_494 +4 IsPM=TH_495 +4 IsValidDate=TH_496 +4 IsValidTime=TH_497 +4 IsValidDateTime=TH_498 +4 IsValidDateDay=TH_499 +4 IsValidDateWeek=TH_500 +4 IsValidDateMonthWeek=TH_501 +4 WeeksInYear=TH_502 +4 WeeksInAYear=TH_503 +4 DaysInYear=TH_504 +4 DaysInAYear=TH_505 +4 DaysInMonth=TH_506 +4 DaysInAMonth=TH_507 +4 Today=TH_508 +4 Yesterday=TH_509 +4 Tomorrow=TH_510 +4 IsToday=TH_511 +4 IsSameDay=TH_512 +3 ֽ⺯ +4 ֽ⺯=TH_513 +4 YearOf=TH_514 +4 MonthOf=TH_515 +4 DayOf=TH_516 +4 HourOf=TH_517 +4 MinuteOf=TH_518 +4 SecondOf=TH_519 +4 MilliSecondOf=TH_520 +3 ʼ +4 ʼ=TH_521 +4 StartOfTheYear=TH_522 +4 EndOfTheYear=TH_523 +4 StartOfAYear=TH_524 +4 EndOfAYear=TH_525 +4 StartOfTheMonth=TH_526 +4 EndOfTheMonth=TH_527 +4 StartOfAMonth=TH_528 +4 EndOfAMonth=TH_529 +4 StartOfTheWeek=TH_530 +4 EndOfTheWeek=TH_531 +4 StartOfAWeek=TH_532 +4 EndOfAWeek=TH_533 +4 StartOfTheDay=TH_534 +4 EndOfTheDay=TH_535 +4 StartOfADay=TH_536 +4 EndOfADay=TH_537 +3 ϵ +4 ϵ=TH_538 +4 MonthOfTheYear=TH_539 +4 WeekOfTheYear=TH_540 +4 DayOfTheYear=TH_541 +4 HourOfTheYear=TH_542 +4 MinuteOfTheYear=TH_543 +4 SecondOfTheYear=TH_544 +4 MilliSecondOfTheYear=TH_545 +4 WeekOfTheMonth=TH_546 +4 DayOfTheMonth=TH_547 +4 HourOfTheMonth=TH_548 +4 MinuteOfTheMonth=TH_549 +4 SecondOfTheMonth=TH_550 +4 MilliSecondOfTheMonth=TH_551 +4 DayOfTheWeek=TH_552 +4 HourOfTheWeek=TH_553 +4 MinuteOfTheWeek=TH_554 +4 SecondOfTheWeek=TH_555 +4 MilliSecondOfTheWeek=TH_556 +4 HourOfTheDay=TH_557 +4 MinuteOfTheDay=TH_558 +4 SecondOfTheDay=TH_559 +4 MilliSecondOfTheDay=TH_560 +4 MinuteOfTheHour=TH_561 +4 SecondOfTheHour=TH_562 +4 MilliSecondOfTheHour=TH_563 +4 SecondOfTheMinute=TH_564 +4 MilliSecondofTheMinute=TH_565 +4 MilliSecondOfTheSecond=TH_566 +3 Χж +4 Χж=TH_567 +4 WithinPastYears=TH_568 +4 WithinPastMonths=TH_569 +4 WithinPastWeeks=TH_570 +4 WithinPastDays=TH_571 +4 WithinPastHours=TH_572 +4 WithinPastMinutes=TH_573 +4 WithinPastSeconds=TH_574 +4 WithinPastMilliSeconds=TH_575 +3 Χú +4 Χú=TH_576 +4 YearsBetween=TH_577 +4 MonthsBetween=TH_578 +4 WeeksBetween=TH_579 +4 DaysBetween=TH_580 +4 HoursBetween=TH_581 +4 MinutesBetween=TH_582 +4 SecondsBetween=TH_583 +4 MilliSecondsBetween=TH_584 +3 Χɺ +4 Χɺ=TH_585 +4 YearSpan=TH_586 +4 MonthSpan=TH_587 +4 WeekSpan=TH_588 +4 DaySpan=TH_589 +4 HourSpan=TH_590 +4 MinuteSpan=TH_591 +4 SecondSpan=TH_592 +4 MilliSecondSpan=TH_593 +3 ʱƺ +4 ʱƺ=TH_594 +4 IncYear=TH_595 +4 IncWeek=TH_596 +4 IncDay=TH_597 +4 IncHour=TH_598 +4 IncMinute=TH_599 +4 IncSecond=TH_600 +4 IncMilliSecond=TH_601 +3 ϡֽں +4 ϡֽں=TH_602 +4 EncodeDateTime=TH_603 +4 DecodeDateTime=TH_604 +4 EncodeDateWeek=TH_605 +4 DecodeDateWeek=TH_606 +4 DecodeDateDay=TH_607 +4 EncodeDateMonthWeek=TH_608 +4 DecodeDateMonthWeek=TH_609 +4 TryEncodeDateTime=TH_610 +4 TryEncodeDateWeek=TH_611 +4 TryEncodeDateDay=TH_612 +4 TryEncodeDateMonthWeek=TH_613 +3 麯 +4 麯=TH_614 +4 RecodeYear=TH_615 +4 RecodeMonth=TH_616 +4 RecodeDay=TH_617 +4 RecodeHour=TH_618 +4 RecodeMinute=TH_619 +4 RecodeSecond=TH_620 +4 RecodeMilliSecond=TH_621 +4 RecodeDate=TH_622 +4 RecodeTime=TH_623 +4 RecodeDateTime=TH_624 +4 TryRecodeDateTime=TH_625 +4 CompareDateTime=TH_626 +4 SameDateTime=TH_627 +4 CompareDate=TH_628 +4 SameDate=TH_629 +4 CompareTime=TH_630 +4 SameTime=TH_631 +4 NthDayOfWeek=TH_632 +4 DecodeDayOfWeekInMonth=TH_633 +4 EncodeDayOfWeekInMonth=TH_634 +4 TryEncodeDayOfWeekInMonth=TH_635 +3 ڸʽת +4 ڸʽת=TH_636 +4 DateTimeToJulianDate=TH_637 +4 JulianDateToDateTime=TH_638 +4 TryJulianDateToDateTime=TH_639 +4 DateTimeToModifiedJulianDate=TH_640 +4 ModifiedJulianDateToDateTime=TH_641 +4 TryModifiedJulianDateToDateTime=TH_642 +4 DateTimeToUnix=TH_643 +4 UnixToDateTime=TH_644 +4 FileDateToDateTime=TH_1105 +4 DateTimeToFileDate=TH_1106 +2 ַ +3 ַ=TH_645 +3 ַ +4 ַ=TH_1107 +4 Str2Array=TH_271 +4 Array2Str=TH_272 +4 Chr=TH_273 +4 Ord=TH_274 +4 StrCmp=TH_275 +4 Concat=TH_276 +4 Format=TH_277 +4 Pos=TH_314 +4 Copy=TH_315 +4 SetLength=TH_316 +4 GetChar=TH_1108 +4 SetChar=TH_1109 +4 Str=TH_317 +4 Val=TH_318 +4 CompareStr=TH_319 +4 UpperCase=TH_320 +4 LowerCase=TH_321 +4 AppendStr=TH_322 +4 CompareText=TH_323 +4 SameText=TH_324 +4 Trim=TH_325 +4 TrimLeft=TH_326 +4 TrimRight=TH_327 +4 IsValidIdent=TH_328 +4 IntToStr=TH_329 +4 IntToHex=TH_330 +4 StrToInt=TH_331 +4 StrToIntDef=TH_332 +4 TryStrToInt=TH_333 +4 StrToBool=TH_334 +4 StrToBoolDef=TH_335 +4 TryStrToBool=TH_336 +4 BoolToStr=TH_337 +4 FloatToStr=TH_338 +4 CurrToStr=TH_339 +4 FormatFloat=TH_340 +4 FormatCurr=TH_341 +4 StrToFloat=TH_342 +4 StrToFloatDef=TH_343 +4 TryStrToFloat=TH_344 +4 StrToCurr=TH_345 +4 StrToCurrDef=TH_346 +4 TryStrToCurr=TH_347 +3 ж +4 ж=TH_646 +4 AnsiContainsText=TH_647 +4 AnsiStartsText=TH_648 +4 AnsiEndsText=TH_649 +4 AnsiMatchText=TH_650 +4 AnsiContainsStr=TH_651 +4 AnsiStartsStr=TH_652 +4 AnsiEndsStr=TH_653 +4 AnsiMatchStr=TH_654 +3 滻Լ +4 滻Լ=TH_1110 +4 StuffString=TH_656 +4 AnsiReplaceText=TH_657 +4 AnsiReplaceStr=TH_658 +4 ReplaceText=TH_1111 +4 ReplaceStr=TH_1112 +4 WrapText=TH_1113 +4 AdjustLineBreaks=TH_1114 +3 ַغ +4 ַغ=TH_659 +4 AnsiIndexText=TH_660 +4 AnsiIndexStr=TH_661 +3 ظ +4 ظ=TH_662 +4 DupeString=TH_663 +3 ֺֽ֧ +4 ֺֽ֧=TH_1377 +4 LengthW=TH_1378 +4 LeftStr=TH_665 +4 RightStr=TH_666 +4 MidStr=TH_667 +3 غ +4 غ=TH_668 +4 SoundEx=TH_669 +4 SoundexInt=TH_670 +4 DecodeSoundexInt=TH_671 +4 SoundexWord=TH_672 +4 DecodeSoundexWord=TH_673 +4 SoundexSimilar=TH_674 +4 SoundexCompare=TH_675 +4 SoundexProc=TH_676 +4 AnsiResemblesText=TH_677 +3 ʽ +4 ʽ=TH_808 +4 ParseRegExpr=TH_809 +4 GetLikeFlag=TH_1115 +4 SetLikeFlag=TH_1116 +4 ʽ +5 ʽ=TH_1117 +5 ʲôʽ=TH_1118 +5 ʽ=TH_1119 +5 ʽеԪַ=TH_1120 +3 ֺ֧ +4 ֺ֧=TH_1121 +4 AnsiPos=TH_1122 +4 ByteType=TH_1123 +4 ByteToCharLen=TH_1124 +4 CharToByteLen=TH_1125 +4 ByteToCharIndex=TH_1126 +4 CharToByteIndex=TH_1127 +4 CharLength=TH_1128 +4 NextCharIndex=TH_1129 +4 AnsiQuotedStr=TH_1130 +4 AnsiDequotedStr=TH_1131 +4 AnsiToUTF8=TH_1132 +4 UTF8ToAnsi=TH_1133 +4 UnicodeESC=TH_1134 +4 unUnicodeESC=TH_1135 +3 ļԼĿ¼ش +4 ļԼĿ¼ش=TH_1136 +4 ChangeFileExt=TH_1137 +4 ExtractFilePath=TH_1138 +4 ExtractFileDir=TH_1139 +4 ExtractFileDrive=TH_1140 +4 ExtractFileName=TH_1141 +4 ExtractFileExt=TH_1142 +4 ExtractRelativePath=TH_1143 +4 IsPathDelimiter=TH_1144 +4 IsDelimiter=TH_1145 +4 IncludeTrailingPathDelimiter=TH_1146 +4 IncludeTrailingBackslash=TH_1147 +4 ExcludeTrailingPathDelimiter=TH_1148 +4 ExcludeTrailingBackslash=TH_1149 +4 LastDelimiter=TH_1150 +4 AnsiCompareFileName=TH_1151 +4 SameFileName=TH_1152 +4 AnsiLowerCaseFileName=TH_1153 +4 AnsiUpperCaseFileName=TH_1154 +2 Դʺ +3 Դʺ=TH_1155 +3 ݿʺ +4 ݿʺ=TH_747 +4 ExecSQL=TH_748 +3 ļʺ +4 ļʺ=TH_749 +4 Ŀ¼=TH_750 +4 ExportFile=TH_763 +4 ImportFile=TH_764 +4 ReadFile=TH_765 +4 WriteFile=TH_766 +4 FileExists=TH_767 +4 FileSize=TH_768 +4 FileDelete=TH_769 +4 FileRename=TH_770 +4 FileList=TH_771 +4 FileCopy=TH_1156 +4 CreateDir=TH_1363 +4 RemoveDir=TH_1364 +4 뵼ͺ +5 뵼ͺ=TH_751 +5 ftCSV=TH_752 +5 ftXLS=TH_753 +5 ftXls2=TH_1157 +5 ftStream=TH_754 +5 ftString=TH_755 +5 ftXML=TH_810 +4 ļдͺ +5 ļдͺ=TH_756 +5 rwByte=TH_757 +5 rwInt=TH_758 +5 rwReal=TH_759 +5 rwStr=TH_760 +5 rwObj=TH_761 +5 rwRaw=TH_762 +5 rwBinary=TH_1158 +3 Լغ +4 Լغ=TH_813 +4 GetHttp=TH_814 +4 PostHttp=TH_1159 +4 InternetRequest=TH_1160 +4 ParseHtml=TH_815 +4 GetURL=TH_816 +4 SysSendMail=TH_1161 +3 INIļ +4 INIļ=TH_1162 +4 IniReadBool=TH_1163 +4 IniReadDate=TH_1164 +4 IniReadDateTime=TH_1165 +4 IniReadFloat=TH_1166 +4 IniReadInteger=TH_1167 +4 IniReadTime=TH_1168 +4 IniReadString=TH_1169 +4 IniReadBinaryStream=TH_1170 +4 IniReadSection=TH_1171 +4 IniReadSections=TH_1172 +4 IniReadSectionValues=TH_1173 +4 IniSectionExists=TH_1174 +4 IniValueExists=TH_1175 +4 IniWriteBool=TH_1176 +4 IniWriteDate=TH_1177 +4 IniWriteDateTime=TH_1178 +4 IniWriteFloat=TH_1179 +4 IniWriteInteger=TH_1180 +4 IniWriteTime=TH_1181 +4 IniWriteString=TH_1182 +4 IniWriteBinaryStream=TH_1183 +4 IniDeleteKey=TH_1184 +4 IniEraseSection=TH_1185 +3 غ +4 غ=TH_1186 +4 Sleep=TH_773 +4 SysExec=TH_1187 +4 SysParamcount=TH_1188 +4 SysParamStr=TH_1189 +4 SysCmdLine=TH_1190 +4 SysExecName=TH_1191 +4 PluginPath=TH_1192 +4 SysProcessID=TH_1365 +4 SysThreadID=TH_1366 +4 SysThreadID=TH_1367 +4 SysCreateMutex=TH_1368 +4 SysReleaseMutex=TH_1369 +4 SysWaitForSingleObject=TH_1370 +4 SysWaitForMultipleObjects=TH_1371 +4 SysCloseHandle=TH_1372 +4 SysGetLastError=TH_1373 +4 SysErrorMessage=TH_1374 +2 Wordģ庯(WordTSL) +3 Wordģ庯(WordTSL)=TH_817 +3 ͻݷʺ +4 ͻݷʺ=TH_1193 +4 LoadClientData=TH_1194 +3 Wordģƺ +4 Wordģƺ=TH_818 +4 WordGetCurrentDocument=TH_1195 +4 WordGetCurrentRange=TH_1196 +4 WordGetLastRange=TH_1197 +4 WordGetLastTable=TH_1198 +4 WordGetLastShape=TH_1199 +4 WordWrite=TH_819 +4 WordBr=TH_820 +4 WordWriteTable=TH_821 +4 WordWriteChart=TH_822 +4 WordWriteSampleChart=TH_1200 +4 WordWriteGraph=TH_1201 +4 WordWritePicFromFile=TH_1202 +4 WordSetFont=TH_1203 +4 WordGetFont=TH_1204 +4 WordPaste=TH_1205 +4 WordAddOleObjectFromFile=TH_1206 +4 WordLastTableSplit=TH_1207 +4 WordLastTableMerge=TH_1208 +4 Wordȡ=TH_1209 +4 WordSetRangeProp=TH_1210 +4 WordGetRangeProp=TH_1211 +4 WordSetLastTableProp=TH_1212 +4 WordGetLastTableProp=TH_1213 +4 WordSetLastTableCellProp=TH_1214 +4 WordGetLastTableCellProp=TH_1215 +2 Word=TH_1216 +3 ExcelWordTSLغ +4 ExcelWordTSLغ=TH_1217 +4 WordCopyFromExcel=TH_1218 +4 WordCopyPicFromExcel=TH_1219 +4 WordChartCopyPicFromExcel=TH_1220 +3 Word/Excel CHARTͼຯ +4 Word/Excel CHARTͼຯ=TH_825 +4 xlColumnClustered=TH_826 +4 xlColumnStacked=TH_827 +4 xlColumnStacked100=TH_828 +4 xl3DColumnClustered=TH_829 +4 xl3DColumnStacked=TH_830 +4 xl3DColumnStacked100=TH_831 +4 xlBarClustered=TH_832 +4 xlBarStacked=TH_833 +4 xlBarStacked100=TH_834 +4 xl3DBarClustered=TH_835 +4 xl3DBarStacked=TH_836 +4 xl3DBarStacked100=TH_837 +4 xlLineStacked=TH_838 +4 xlLineStacked100=TH_839 +4 xlLineMarkers=TH_840 +4 xlLineMarkersStacked=TH_841 +4 xlLineMarkersStacked100=TH_842 +4 xlPieOfPie=TH_843 +4 xlPieExploded=TH_844 +4 xl3DPieExploded=TH_845 +4 xlBarOfPie=TH_846 +4 xlXYScatterSmooth=TH_847 +4 xlXYScatterSmoothNoMarkers=TH_848 +4 xlXYScatterLines=TH_849 +4 xlXYScatterLinesNoMarkers=TH_850 +4 xlAreaStacked=TH_851 +4 xlAreaStacked100=TH_852 +4 xl3DAreaStacked=TH_853 +4 xl3DAreaStacked100=TH_854 +4 xlDoughnutExploded=TH_855 +4 xlRadarMarkers=TH_856 +4 xlRadarFilled=TH_857 +4 xlSurface=TH_858 +4 xlSurfaceWireframe=TH_859 +4 xlSurfaceTopView=TH_860 +4 xlSurfaceTopViewWireframe=TH_861 +4 xlBubble=TH_862 +4 xlBubble3DEffect=TH_863 +4 xlStockHLC=TH_864 +4 xlStockOHLC=TH_865 +4 xlStockVHLC=TH_866 +4 xlStockVOHLC=TH_867 +4 xlCylinderColClustered=TH_868 +4 xlCylinderColStacked=TH_869 +4 xlCylinderColStacked100=TH_870 +4 xlCylinderBarClustered=TH_871 +4 xlCylinderBarStacked=TH_872 +4 xlCylinderBarStacked100=TH_873 +4 xlCylinderCol=TH_874 +4 xlConeColClustered=TH_875 +4 xlConeColStacked=TH_876 +4 xlConeColStacked100=TH_877 +4 xlConeBarClustered=TH_878 +4 xlConeBarStacked=TH_879 +4 xlConeBarStacked100=TH_880 +4 xlConeCol=TH_881 +4 xlPyramidColClustered=TH_882 +4 xlPyramidColStacked=TH_883 +4 xlPyramidColStacked100=TH_884 +4 xlPyramidBarClustered=TH_885 +4 xlPyramidBarStacked=TH_886 +4 xlPyramidBarStacked100=TH_887 +4 xlPyramidCol=TH_888 +4 xl3DColumn=TH_889 +4 xlLine=TH_890 +4 xl3DLine=TH_891 +4 xl3DPie=TH_892 +4 xlPie=TH_893 +4 xlXYScatter=TH_894 +4 xl3DArea=TH_895 +4 xlArea=TH_896 +4 xlDoughnut=TH_897 +4 xlRadar=TH_898 +2 Excel +3 Excel=TH_1221 +3 Excelƺ +4 Excelƺ=TH_1222 +4 ExcelCopy=TH_1223 +4 ExcelCopyPic=TH_1224 +4 ExcelChartCopyPic=TH_1225 +3 Excelƺ +4 Excelƺ=TH_1226 +4 ExcelGetApplication=TH_1227 +4 ExcelGetDataRange=TH_1228 +4 ExcelGetCell=TH_1229 +4 ExcelSetCell=TH_1230 +4 ExcelGetSheetCount=TH_1231 +4 ExcelGetChartSheetCount=TH_1232 +4 ExcelGetSheetNameByIndex=TH_1233 +4 ExcelGetChartSheetNameByIndex=TH_1234 +4 ExcelSaveAs=TH_1235 +4 ExcelSaveAs2=TH_1236 +4 ExcelSave=TH_1237 +4 ExcelOpen=TH_1238 +4 ExcelClose=TH_1239 +4 ExcelQuit=TH_1240 +4 ExcelDeleteSheet=TH_1241 +4 ExcelDeleteChartSheet=TH_1242 +4 ExcelNewSheet=TH_1243 +4 ExcelNewChartSheet=TH_1244 +4 ExcelRenameChartSheet=TH_1245 +4 ExcelRenameSheet=TH_1246 +4 ExcelRangeSetProp=TH_1247 +4 ExcelSetRangeProp=TH_1248 +4 ExcelGetRangeProp=TH_1249 +4 ExcelMerge=TH_1250 +4 ExcelUnMerge=TH_1251 +4 ExcelCopySheet=TH_1252 +4 ExcelCopyChartSheet=TH_1253 +4 ExcelSetActiveSheet=TH_1254 +4 ExcelSetActiveChart=TH_1255 +4 ExcelSetChartSheetDataSource=TH_1256 +3 Excelس +4 Excelس=TH_1257 +4 xlColumns=TH_1258 +4 xlRows=TH_1259 +2 ֵ֧Excelб=TH_1260 +2 Officeغ +3 Officeغ=TH_1261 +3 ģִк +4 ģִк=TH_1262 +4 WordTemplate=TH_1263 +4 ExcelTemplate=TH_1264 +3 ʼ +4 ʼ=TH_1265 +4 CoInitialize=TH_1266 +4 CoUnInitialize=TH_1267 +3 ϵͳ +4 ϵͳ=TH_1268 +4 SetSysParams=TH_1269 +4 GetSysParams=TH_1270 +2 ֵ֧Officeб=TH_1271 +2 GUI +3 GUI=TH_1272 +3 GUIܺ +4 GUIܺ=TH_1273 +4 InputQuery=TH_1274 +4 PromptForFileName=TH_1275 +4 MessageBox=TH_1276 +4 InputDialog=TH_1277 +4 BuildOptionComboValue=TH_1278 +4 ShowValue=TH_1279 +3 ϢԻͿ +4 ϢԻͿ=TH_1280 +4 mb_AbortRetryIgnore=TH_1281 +4 mb_Ok=TH_1282 +4 mb_OkCancel=TH_1283 +4 mb_RetryCancel=TH_1284 +4 mb_YesNo=TH_1285 +4 mb_YesNoCancel=TH_1286 +3 ϢԻͼ +4 ϢԻͼ=TH_1287 +4 mb_IconExclamation=TH_1288 +4 mb_IconWarning=TH_1289 +4 mb_IconInfomation=TH_1290 +4 mb_IconAsterisk=TH_1291 +4 mb_IconQuestion=TH_1292 +4 mb_IconStop=TH_1293 +4 mb_IconError=TH_1294 +4 mb_IconHand=TH_1295 +3 ϢԻĬϰť +4 ϢԻĬϰť=TH_1296 +4 mb_DefButton1=TH_1297 +4 mb_DefButton2=TH_1298 +4 mb_DefButton3=TH_1299 +4 mb_DefButton4=TH_1300 +3 ϢԻģʽ +4 ϢԻģʽ=TH_1301 +4 mb_AppModal=TH_1302 +4 mb_SystemModal=TH_1303 +4 mb_TaskModal=TH_1304 +3 ϢԻ +4 ϢԻ=TH_1305 +4 mb_Default_Desktop_Only=TH_1306 +4 mb_Help=TH_1307 +4 mb_Right=TH_1308 +4 mb_RtlReading=TH_1309 +4 mb_SetForeGround=TH_1310 +4 mb_SetTopMost=TH_1311 +4 mb_Service_Notification=TH_1312 +4 mb_Service_Notification_NT3X=TH_1313 +3 ϢԻķ +4 ϢԻķ=TH_1314 +4 idAbort=TH_1315 +4 idCancel=TH_1316 +4 idIgnore=TH_1317 +4 idNo=TH_1318 +4 idOk=TH_1319 +4 idRetry=TH_1320 +4 idYes=TH_1321 +2 CGI/̨غ +3 CGI/̨غ=TH_1379 +3 CGI/̨ +4 CGI/̨=TH_1380 +4 Write=TH_1324 +4 Writeln=TH_1325 +4 Read=TH_1381 +4 ReadLn=TH_1382 +3 CGIԼغ +4 CGIԼغ=TH_1326 +4 HttpGetContent=TH_1327 +4 HttpGetQueryString=TH_1328 +4 HttpGetRequestMethod=TH_1329 +4 HttpGetQueryValues=TH_1330 +4 HttpGetQueryValueByName=TH_1331 +4 HttpGetScriptName=TH_1332 +4 HttpGetPathInfo=TH_1333 +4 HttpGetPathTranslated=TH_1334 +4 HttpGetRemoteHost=TH_1335 +4 HttpGetRemoteAddr=TH_1336 +4 HttpGetAuthType=TH_1337 +4 HttpGetRemoteUser=TH_1338 +4 HttpGetRemoteIdent=TH_1339 +4 HttpGetHttpAccept=TH_1340 +4 HttpGetHttpUserAgent=TH_1341 +4 HttpGetServerName=TH_1342 +4 HttpGetServerPort=TH_1343 +4 HttpGetServerProtocol=TH_1344 +4 HttpGetServerSoftware=TH_1345 +4 HttpGetGatewayInterface=TH_1346 +4 HttpGetCookie=TH_1347 +4 HttpGetEnvVar=TH_1348 +4 HttpSetHeadString=TH_1349 +2 +3 =TH_1350 +3 DefaultConnectAndLoginServer=TH_1351 +3 SendExecuteAndWait=TH_1352 +3 CheckConnected=TH_1353 +3 CheckLogined=TH_1354 +3 DisconnectServer=TH_1355 +1 TSLöʹôȫ +2 TSLöʹôȫ=TH_1383 +2 SMTP +3 SMTP=TH_1511 +3 SMTPĴ=TH_1386 +3 SMTPķ +4 SMTPķ=TH_1387 +4 SendCmd=TH_1388 +4 Connect=TH_1389 +4 Disconnect=TH_1390 +4 DisconnectNotifyPeer=TH_1391 +4 Send=TH_1392 +4 Authenticate=TH_1393 +4 QuickSend=TH_1394 +4 Expand=TH_1395 +4 Verify=TH_1396 +3 SMTP +4 SMTP=TH_1397 +4 AuthType=TH_1398 +4 Host=TH_1399 +4 Port=TH_1400 +4 Username=TH_1401 +4 Password=TH_1402 +4 UseTLS=TH_1403 +4 LastCmdResult=TH_1404 +4 LastCmdResultCode=TH_1405 +4 DidAuthenticate=TH_1406 +2 Pop3 +3 Pop3=TH_1512 +3 Pop3Ĵ=TH_1408 +3 Pop3ķ +4 Pop3ķ=TH_1409 +4 SendCmd=TH_1410 +4 Connect=TH_1411 +4 Disconnect=TH_1412 +4 DisconnectNotifyPeer=TH_1413 +4 CheckMessages=TH_1414 +4 KeepAlive=TH_1415 +4 Reset=TH_1416 +4 Delete=TH_1417 +4 Top=TH_1418 +4 RetrieveMsgSize=TH_1419 +4 RetrieveMailBoxSize=TH_1420 +4 Retrieve=TH_1421 +4 RetrieveHeader=TH_1422 +4 RetrieveRaw=TH_1423 +4 UIDL=TH_1424 +4 CAPA=TH_1425 +3 Pop3 +4 Pop3=TH_1426 +4 AuthType=TH_1427 +4 Host=TH_1428 +4 Port=TH_1429 +4 Username=TH_1430 +4 Password=TH_1431 +4 UseTLS=TH_1432 +4 LastCmdResult=TH_1433 +4 LastCmdResultCode=TH_1434 +4 Capabilities=TH_1435 +4 HasCAPA=TH_1436 +4 HasAPOP=TH_1437 +4 AutoLogin=TH_1438 +2 MailMsg +3 MailMsg=TH_1513 +3 MailMsgĴ=TH_1440 +3 MailMsgķ +4 MailMsgķ=TH_1441 +4 SendCmd=TH_1442 +4 SaveToFile=TH_1443 +4 LoadFromFile=TH_1444 +4 MessagePart=TH_1445 +4 AddAttachment=TH_1446 +3 MailMsg +4 MailMsg=TH_1538 +4 Flags=TH_1448 +4 IsEncoded=TH_1540 +4 MsgID=TH_1541 +4 Headers=TH_1542 +4 UID=TH_1452 +4 IsMsgSinglePartMime=TH_1453 +4 AttachmentEncoding=TH_1454 +4 Body=TH_1455 +4 BccList=TH_1456 +4 CCList=TH_1457 +4 CharSet=TH_1543 +4 ContentType=TH_1539 +4 ContentTransferEncoding=TH_1460 +4 ContentDisposition=TH_1461 +4 Date=TH_1590 +4 Encoding=TH_1463 +4 ExtraHeaders=TH_1544 +4 FromList=TH_1465 +4 From=TH_1466 +4 NewsGroups=TH_1467 +4 NoEncode=TH_1468 +4 NoDecode=TH_1469 +4 Organization=TH_1470 +4 Priority=TH_1471 +4 ReceiptRecipient=TH_1472 +4 Recipients=TH_1473 +4 References=TH_1474 +4 InReplyTo=TH_1475 +4 ReplyTo=TH_1476 +4 Subject=TH_1477 +4 Sender=TH_1478 +4 UseNowForDate=TH_1479 +4 LastGeneratedHeaders=TH_1480 +4 ConvertPreamble=TH_1481 +4 ExceptionOnBlockedAttachments=TH_1482 +4 AttachmentTempDirectory=TH_1483 +4 MessagePartsCount=TH_1484 +4 AsString=TH_1545 +4 AsBinary=TH_1546 +2 MessagePart +3 MessagePart=TH_1524 +3 MessagePartĴ=TH_1488 +3 MessagePartķ +4 MessagePartķ=TH_1489 +4 SaveToFile=TH_1490 +4 LoadFromFile=TH_1491 +3 MessagePart +4 MessagePart=TH_1579 +4 ContentType=TH_1580 +4 IsEncoded=TH_1581 +4 MsgID=TH_1582 +4 Headers=TH_1583 +4 CharSet=TH_1584 +4 ExtraHeaders=TH_1585 +4 ContentTransfer=TH_1499 +4 ContentID=TH_1500 +4 ContentDescription=TH_1501 +4 ContentLocation=TH_1502 +4 ParentPart=TH_1503 +4 PartType=TH_1504 +4 FileName=TH_1505 +4 Body=TH_1591 +4 AsString=TH_1586 +4 AsBinary=TH_1587 diff --git a/Help/designerUserGuid.CHM b/Help/designerUserGuid.CHM new file mode 100644 index 0000000..606632b Binary files /dev/null and b/Help/designerUserGuid.CHM differ diff --git a/Help/tslvclhelp.CHM b/Help/tslvclhelp.CHM new file mode 100644 index 0000000..63ada0c Binary files /dev/null and b/Help/tslvclhelp.CHM differ diff --git a/IIS_TSL.dll b/IIS_TSL.dll new file mode 100644 index 0000000..fab4af8 Binary files /dev/null and b/IIS_TSL.dll differ diff --git a/InitDLL.dll b/InitDLL.dll new file mode 100644 index 0000000..cf9f17b Binary files /dev/null and b/InitDLL.dll differ diff --git a/LU.exe b/LU.exe new file mode 100644 index 0000000..0607ea3 Binary files /dev/null and b/LU.exe differ diff --git a/LiveUpd.dll b/LiveUpd.dll new file mode 100644 index 0000000..c90599d Binary files /dev/null and b/LiveUpd.dll differ diff --git a/LoginMgr.dll b/LoginMgr.dll new file mode 100644 index 0000000..985b117 Binary files /dev/null and b/LoginMgr.dll differ diff --git a/MathKrnl.dll b/MathKrnl.dll new file mode 100644 index 0000000..0cda5b9 Binary files /dev/null and b/MathKrnl.dll differ diff --git a/Mod_TSL1.dll b/Mod_TSL1.dll new file mode 100644 index 0000000..9ca2b7b Binary files /dev/null and b/Mod_TSL1.dll differ diff --git a/Mod_TSL2.dll b/Mod_TSL2.dll new file mode 100644 index 0000000..019ef2a Binary files /dev/null and b/Mod_TSL2.dll differ diff --git a/Mod_TSL24.dll b/Mod_TSL24.dll new file mode 100644 index 0000000..f3ebf2c Binary files /dev/null and b/Mod_TSL24.dll differ diff --git a/Mod_TSL24New.dll b/Mod_TSL24New.dll new file mode 100644 index 0000000..e810f4e Binary files /dev/null and b/Mod_TSL24New.dll differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c587eb --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# tslediter + +tsl语言本地编辑器,支持本地,远程调试 \ No newline at end of file diff --git a/ResMan.dll b/ResMan.dll new file mode 100644 index 0000000..caf5016 Binary files /dev/null and b/ResMan.dll differ diff --git a/SysBugCheck.exe b/SysBugCheck.exe new file mode 100644 index 0000000..8338185 Binary files /dev/null and b/SysBugCheck.exe differ diff --git a/TSBLPAPI.DLL b/TSBLPAPI.DLL new file mode 100644 index 0000000..f45d89f Binary files /dev/null and b/TSBLPAPI.DLL differ diff --git a/TSCrypt.dll b/TSCrypt.dll new file mode 100644 index 0000000..5854578 Binary files /dev/null and b/TSCrypt.dll differ diff --git a/TSExpert.exe b/TSExpert.exe new file mode 100644 index 0000000..a875a14 Binary files /dev/null and b/TSExpert.exe differ diff --git a/TSIcons.dll b/TSIcons.dll new file mode 100644 index 0000000..676cc72 Binary files /dev/null and b/TSIcons.dll differ diff --git a/TSIniMgr.dll b/TSIniMgr.dll new file mode 100644 index 0000000..3253dcb Binary files /dev/null and b/TSIniMgr.dll differ diff --git a/TSL.exe b/TSL.exe new file mode 100644 index 0000000..1a5a544 Binary files /dev/null and b/TSL.exe differ diff --git a/TSLCgi.exe b/TSLCgi.exe new file mode 100644 index 0000000..1e800d4 Binary files /dev/null and b/TSLCgi.exe differ diff --git a/TSLDebugModule.dll b/TSLDebugModule.dll new file mode 100644 index 0000000..c703b11 Binary files /dev/null and b/TSLDebugModule.dll differ diff --git a/TSLEventMsg.dll b/TSLEventMsg.dll new file mode 100644 index 0000000..535cf9a Binary files /dev/null and b/TSLEventMsg.dll differ diff --git a/TSLInterp.dll b/TSLInterp.dll new file mode 100644 index 0000000..6cd0557 Binary files /dev/null and b/TSLInterp.dll differ diff --git a/TSLLdLibAp1.dll b/TSLLdLibAp1.dll new file mode 100644 index 0000000..6b99edb Binary files /dev/null and b/TSLLdLibAp1.dll differ diff --git a/TSLLdLibAp2.dll b/TSLLdLibAp2.dll new file mode 100644 index 0000000..252cc74 Binary files /dev/null and b/TSLLdLibAp2.dll differ diff --git a/TSLLdLibAp24.dll b/TSLLdLibAp24.dll new file mode 100644 index 0000000..0ff93d5 Binary files /dev/null and b/TSLLdLibAp24.dll differ diff --git a/TSLLdLibIIS.dll b/TSLLdLibIIS.dll new file mode 100644 index 0000000..7c7b3a8 Binary files /dev/null and b/TSLLdLibIIS.dll differ diff --git a/TSLMemMan.dll b/TSLMemMan.dll new file mode 100644 index 0000000..4d8198a Binary files /dev/null and b/TSLMemMan.dll differ diff --git a/TSLPlugin.dll b/TSLPlugin.dll new file mode 100644 index 0000000..797fb1f Binary files /dev/null and b/TSLPlugin.dll differ diff --git a/TSLib.dll b/TSLib.dll new file mode 100644 index 0000000..86147ad Binary files /dev/null and b/TSLib.dll differ diff --git a/TSLogin.dll b/TSLogin.dll new file mode 100644 index 0000000..e2c6afc Binary files /dev/null and b/TSLogin.dll differ diff --git a/TSNetAPI.dll b/TSNetAPI.dll new file mode 100644 index 0000000..a7f4650 Binary files /dev/null and b/TSNetAPI.dll differ diff --git a/TSOle.dll b/TSOle.dll new file mode 100644 index 0000000..2d37e73 Binary files /dev/null and b/TSOle.dll differ diff --git a/TSPlatFormWhatsNew.txt b/TSPlatFormWhatsNew.txt new file mode 100644 index 0000000..bfca0f5 --- /dev/null +++ b/TSPlatFormWhatsNew.txt @@ -0,0 +1,1423 @@ +־--------2022-02-10 + NextGen汾֧ + TSLWin.exe û + TSL_DebugServer=Enable //Է + TSL_DebugListen=ַ //IPĬ127.0.0.1 + TSL_DebugPort=20020 //ö˿ڣĬֵ20020 + TSL_DebugThreads=1 //õ߳Ĭ1 + TSL_DebugNeedLogin=Enable //Ҫ½ĬҪ 0Ҫ½ + ⣬м²: + -DEBUGSERVER //DebugServer + -NODEBUGSERVER //ǿƽDebugServer + -WAITATTACH //DebugServerȴattach,Ĭ20 + -DEBUGPORT 20020 //ö˿ + -DEBUGLISTEN 127.0.0.1 //IP + -DEBUGTHREADS 1 //߳ + -DEBUGLOGIN 0 //ǷҪ¼ + + + ֺ֧ + function dbgcreatechannel():Integer; //һԵͨIDƽ̨ԣʹô˺Ϊ첽õSendExecuteԵõͨID + function dbgsetcallback(Id:Integer;CallBack:String); //ƽ̨ԣSendExecute첽ָ + function dbgunsetcallback(Id:Integer); + function dbggetcallback(Id:Integer): + ĵ + dbg...(Id:Integer); + dbgpause жϢ + dbgreset ֹͣ + dbgrun + dbggetallvalue õǰķűֵ + dbgstep + dbgstepout + dbgstepover + dbgsteptiny ΢ + dbgattachwait ȴattach + dbglist бattach + dbgdetach ֹͣattach + IJĵ + dbg...(Id:Integer;User,Func:String;Line:Integer); + dbggoto ת + dbgsetbreak öϵ + dbgunsetbreak ȥϵ + + dbgeval(id:Integer;str:string);// + dbggetvalue(id:Integer;Name:string;issysparam:Boolean); //ñֵ + dbgsetvalue(id:Integer;Name:string;issysparam:Boolean;Value:Any); //ñֵ + dbgattach(id:Integer;taskid:String); //attachָбattachlist + dbglogin(username,password:string); //Է½ȷ + +־--------2022-01-20 + InitRun.TSLб⣨Legacy⣬NextGen汾⣩ + +־--------2022-01-13 + ֧InitRun.TSLгʼԼ߳AutoMon.TSLмء + ȫֻĹܡȫֻ˵ + +־--------2021-12-27 + ȫֻơ + +־--------2021-12-10 + ȫֻ潫SetGlobalCache쳣Ϊ١ĺôʧܲTRYԸѺã + +־--------2021-12-07 + ȫֻ֧֡ + tslkrnl.dll ,tslinterp.dll ,exec64.exe,plugin\tslcplugin.dll + + setglobalcache(Name,Value) + ҪFileMgr.iniΪûHighLevelȨ޻ϵͳȨޣHighLevelֵλ2 + listglobalcache():array + гȫϢҪȨsetglobalcacheһ + [HighLevel Rights] + User1=2 + Name : + Value: ֵ + getglobalcache(Name,Var Value[,Dup:Boolean=false]):Boolean; + Name: + Value: صĻû߸ƵݣĿǰarraymatrixʹģʽ + Dup: һ²ҪDupΪֱʹãΪֵ + checkglobalcacheexpired(Cache):Boolean; + Cache: + ֵѾʧЧ򷵻棬򷵻ؼ + + ifcache(Value) + ValueǷһ + getglobalcacheinfo(Cache):array + CacheϢ + +־--------2021-11-23 + ֧tostm(Data,1)תΪ¸ʽļ + ȫļܻظĿԡʹ÷ȫӰ켶ߣ + +־--------2021-11-22 + ⡣ + +־--------2021-11-18 + ޶ҹtradedaysڷǽʱ⡣ + +־--------2021-11-9 + ޶ڴ⡣ + +־--------2021-11-7 + ޶ڴ⡣ + +־--------2021-11-5 + ޶һڴ⡣ + +־--------2021-11-4 + queryϵͳַ֧顣 + +־--------2021-10-15 + COMʱڵڴй¶⡣(TSLUTILS.DLL) + +־--------2021-9-27 + ַת⡣ + +־--------2021-9-24 + ڣϾ۵tradedays⡣ + forinı64λ¿ܷЧΣã޶Ϊfor in޸±ꡣ + +־--------2021-9-13 + ڣϾ۵tradedays⡣ + +־--------2021-9-2 + ߵʱ㿪δʱ˵Ŀ̼۵⡣ + ֧[a,b]:=array(1,2)һʱ򣬿֧һȡķݵͬıʾʹøñʽֵֵΪһִֵݣΪЧʲء + +־--------2021-8-31 + ڲ + formatȶԸ5⡣ + +־--------2021-8-27 + ͬһʱĴ߼ڻͬ + +־--------2021-7-27 + ʵʱ汾֧256-2̡߳ԭΪ64-2̣߳ + +־--------2021-7-26 + ʵʱߵ¼ִегһʱܲڴдԽ⣨²ķ⣩ + +־--------2021-7-22 + ʧijЩ¿ܻڴй¶⡣ + +־--------2021-7-17 + CalcCTRLWordwarningϢûмʱͻ˵⡣ + ֹͬλͬ͵ظϢͻˡ + +־--------2021-7-16 + CalcCTRLWordãnilԼ0⡣ + ޶¿ܳݲһµ⡣ + ԣģʽһöȽУʱ޷дתɾģʽ + +־--------2021-7-9 + ð·ĺgetbkgroup,getuserbkgroup,getsysbkgroup + ޶ڲͻʱCHUQUANµʱкʵݲһµ⡣ + +־--------2021-6-1 + Ƶʱ޽Ϊ0⡣ + +־--------2021-4-6 + Format1Kȵʱֱܻضϵ⡣tslkrnl.dll + +־--------2021-3-9 + rankofַdzӽĸᵼNILԣҲ⣬ֵ㼸ܵӰ죬ҪȫͬRANKܵӰ졣(ԣ + ڷϸ񻺴棬¼ٶֵͬ⡣ + +־--------2021-3-2 + ݲֿʱд(ԣ + +־--------2021-1-26 + sortarray,sorttablebyfieldַ±⡣ + +־--------2020-11-20 + ߵʱظ⡣ + +־--------2020-10-29 + ޶һʹô󴮵µı⣨Ӱʹãݴʱշ + +־--------2020-10-26 + ޶ַһDZڵı⣬ص覴LINUXƽ̨ڵ񲢷·ֵġ2018-12-31İ汾DZ⣬ڷǴ⼸ᷢWINDOWS汾ȼͣ + +־--------2020-10-25 + ޶3⡣ + ݰϿ + +־--------2020-10-12 + ޶°汾IncMonthȺ·ݵ12»ᵼʧܡ + °汾֧strtoint("0x10")ģʽ + +־--------2020-10-09 + 鲢޶õC++ķ̰߳ȫ + +־--------2020-09-30 + ԰Ϊʽ汾 + +־--------2020-09-29 +====================================================== + ޶9-27IJ԰汾ϸõǰBUG + +־--------2020-09-28 +====================================================== + openssl 1.1.1gֹ֧㷨 + ļlibcrypto-1_1-x64.dll libcrypto-1_1.dll + sysdbfreadļµı + Ƶʱгʱڷʵ⡣ + ޶Avedevڿݳ⡣ + +־--------2020-09-27 +====================================================== + ݲֿʱн,ģƵNDAYͻȡԻЧ + ޶JSONԳģ2Gַµı⡣ + sysdbfread,sysdbfwrite + +־--------2020-09-23 +====================================================== + ޶Apacheģ⡣ + +־--------2020-09-22 +====================================================== + ԰汾汾ʹlegacy_ͷ_ֹƳͻ + : ʱнŻ + +־--------2020-09-18 + ԰汾concatԳĴ⡣ + strtoint,strtointdef,strtofloat,strtofloatdef⡣ + +־--------2020-09-16 + ViewPointԵ⡣ + ȡʱշ⡣ + : gethttpܻᵼڴ⡣ + +־--------2020-09-11 + ԰汾͵DeleteFieldں˴BUG + ԰汾DateTimeToStrһĿʼֹڵDateToStr + +־--------2020-09-06 + ƺ쳣¼ + Դڴжջ¼ + +־--------2020-09-04 + ޶ΪȫֺʹбɾɵIJԤ⡣ + function ExportJsonStringUTF8(a:array):string;TSLתΪJSONַַתΪUTF8롣 +־--------2020-09-03 + £޶ѹʧܵ⡣ + ޶ansireplacestrһºBUG +־--------2020-08-20 +====================================================== + £ֵдcplugin + gamma + gammaln + erf + erfc + erfinv + erfcinv + sf_gamma + sf_gammaln + sf_beta + sf_incompletegamma + sf_gammainv + sf_error + sf_integerbessel_1 + sf_integerbessel_2 + sf_realbessel_1 + sf_realbessel_2 + sf_incompletebeta + sf_betainv + sf_normal + sf_normal2 + sf_normalinv + sf_normalinv2 + sf_f + sf_finv + sf_t + sf_tinv + sf_x2 + sf_x2inv + sf_sinx + sf_ex + sf_exinv + sf_cosx + sf_ellipsex_1 + sf_ellipsex_2 + + na_errormsg + //Է + se_gauss + se_gauss_jordan + se_ldl + se_cholesky + se_gauss_seidel + + //ֵ + ip_lagrangian_a + ip_lagrangian_b + ip_parabola_a + ip_parabola_b + ip_hermite_a + ip_hermite_b + ip_aitken_a + ip_aitken_b + ip_spline_a + ip_spline_b + ip_spline_c + ip_slq + ip_slg + + // + mt_multiplication + mt_addition + mt_subtraction + mt_transposition + mt_iv_gauss_jordan + mt_iv_ldl + mt_va_cholesky + mt_va_gauss_jordan + mt_decompose_qr + + mt_decompose_qr2 + mt_decompose_lu + mt_decompose_svd + mt_decompose_eig + mt_decompose_chol + mt_decompose_ldl + // + ig_trapezoid_1 + ig_trapezoid_2 + ig_simpson_1 + ig_romberg + ig_gauss + ig_chebyshev + ig_simpson_2 +־--------2020-08-4 +====================================================== + ޶str(-11.11,s)ѭ⡣ + ޶strtocurr("-10.0")ฺת⡣ + +־--------2020-07-31 +====================================================== + ޶ܵµĿڴ⡣ + ޸ģݲֿ⺯ַͨں˺ʵ֡ + £ºдҪ + ַ=============strext.dllѾдcplugin + ansiresemblestext + ansicontainstext + ansistartstext + ansiendstext + ansireplacetext + ansimatchtext + ansiindextext + ansicontainsstr + ansistartsstr + ansiendsstr + + ansireplacestr + ansimatchstr + ansiindexstr + dupestring + reversestring + stuffstring + leftbstr + rightbstr + midbstr + leftstr + rightstr + midstr + soundex + soundexint + decodesoundexint + soundexword + decodesoundexword + soundexsimilar + soundexcompare + soundexproc + replacetext + replacestr + unicodetomultibyte + multibytetounicode + lcmapstring + makelcid + multibytetounicodew + unicodeesc + unicodeesc2 + ununicodeesc + ununicodeescw + ununicodeesc2 + ununicodeesc2w + ͼδ=============graphext.dllѾдcplugin + clblack + clmaroon + clgreen + clolive + clnavy + clpurple + clteal + clgray + clsilver + clred + cllime + clyellow + clblue + clfuchsia + claqua + clltgray + cldkgray + clwhite + clmoneygreen + clskyblue + clcream + clmedgray + flsolid + flclear + flhorizontal + flvertical + flfdiagonal + flbdiagonal + + flcross + fldiagcross + gtline + gtkline + gttower + gtamerican + gtbar + gtsinglebar + gtcircle + fgnone + fgleft + fgup + fgright + fgdown + fgleftup + fgrightup + fgrightdown + fgleftdown + gfcolor + gfvalue + gfclose + gfopen + gfhigh + gflow + gfzero + gfvol + gfamount + gfflag + gfrateflag + gfmaxvalue + gfminvalue + gftitlecaption + gflefttitlecaption + gfcoordinate + gftowerlow + gftowerhigh + gftowermid + gftime + gfltp + gffill + + encodegraph + decodegraph + decodegraphgroup + encodegraphgroup + + getcvalue + getmvalue + getyvalue + getkvalue + getrvalue + getgvalue + getbvalue + paletteindex + rgb + cmyk + palettergb + + ڴ=============dateext.dllѾдcplugin + tryencodedateweek + today + yesterday + tomorrow + gmttolocaldatetime + datetimetointernetstr + datetimegmttohttpstr + datetimegmttocookiestr + datetimetointernetstrw + datetimegmttohttpstrw + datetimegmttocookiestrw + dateof + timeof + isinleapyear + ispm + isvaliddate + isvalidtime + isvaliddatetime + isvaliddateday + isvaliddateweek + isvaliddatemonthweek + weeksinyear + weeksinayear + daysinyear + daysinayear + daysinmonth + daysinamonth + istoday + issameday + yearof + monthof + weekof + dayof + hourof + minuteof + secondof + millisecondof + startoftheyear + endoftheyear + startofayear + endofayear + startofthemonth + endofthemonth + startofamonth + endofamonth + startoftheweek + endoftheweek + startofaweek + endofaweek + startoftheday + endoftheday + startofaday + endofaday + monthoftheyear + weekoftheyear + dayoftheyear + houroftheyear + minuteoftheyear + secondoftheyear + millisecondoftheyear + weekofthemonth + dayofthemonth + hourofthemonth + minuteofthemonth + secondofthemonth + millisecondofthemonth + dayoftheweek + houroftheweek + minuteoftheweek + secondoftheweek + millisecondoftheweek + houroftheday + minuteoftheday + secondoftheday + millisecondoftheday + minuteofthehour + secondofthehour + millisecondofthehour + secondoftheminute + millisecondoftheminute + millisecondofthesecond + withinpastyears + withinpastmonths + withinpastweeks + withinpastdays + withinpasthours + withinpastminutes + withinpastseconds + withinpastmilliseconds + yearsbetween + monthsbetween + weeksbetween + daysbetween + hoursbetween + minutesbetween + secondsbetween + millisecondsbetween + yearspan + monthspan + weekspan + dayspan + hourspan + minutespan + secondspan + millisecondspan + incyear + incweek + incday + inchour + incminute + incsecond + incmillisecond + encodedatetime + decodedatetime + encodedateweek + decodedateweek + encodedateday + decodedateday + encodedatemonthweek + decodedatemonthweek + tryencodedatetime + tryencodedateday + tryencodedatemonthweek + recodeyear + recodemonth + recodeday + recodehour + recodeminute + recodesecond + recodemillisecond + recodedate + recodetime + recodedatetime + tryrecodedatetime + comparedatetime + samedatetime + comparedate + samedate + comparetime + sametime + nthdayofweek + decodedayofweekinmonth + encodedayofweekinmonth + tryencodedayofweekinmonth + datetimetojuliandate + juliandatetodatetime + tryjuliandatetodatetime + datetimetomodifiedjuliandate + modifiedjuliandatetodatetime + trymodifiedjuliandatetodatetime + datetimetounix + unixtodatetime + ú=============sysext2.dllѾдcplugin + pos + copy + str + val + comparestr + uppercase + lowercase + comparetext + sametext + trim + trimleft + trimright + isvalidident + inttostr + inttohex + strtoint + strtointdef + trystrtoint + strtobool + strtobooldef + trystrtobool + booltostr + floattostr + currtostr + formatfloat + formatcurr + strtofloat + strtofloatdef + trystrtofloat + strtocurr + strtocurrdef + trystrtocurr + encodedate + encodetime + tryencodedate + tryencodetime + decodedate + decodedatefully + decodetime + dayofweek + incmonth + isleapyear + datetostr + timetostr + datetimetostr + strtodate + strtodatedef + trystrtodate + strtotime + strtotimedef + trystrtotime + strtodatetime + strtodatetimedef + trystrtodatetime + formatdatetime + quotedstr + ansiquotedstr + ansidequotedstr + adjustlinebreaks + changefileext + extractfilepath + extractfiledir + extractfiledrive + extractfilename + extractfileext + extractrelativepath + filedatetodatetime + datetimetofiledate + bytetype + bytetocharlen + chartobytelen + bytetocharindex + chartobyteindex + charlength + nextcharindex + ispathdelimiter + isdelimiter + includetrailingpathdelimiter + includetrailingbackslash + excludetrailingpathdelimiter + excludetrailingbackslash + lastdelimiter + ansicomparefilename + samefilename + ansilowercasefilename + ansiuppercasefilename + wraptext + ansipos + ansitoutf8 + utf8toansi + inttostrw + inttohexw + booltostr2 + booltostrw + booltostrw2 + utf8tounicode + unicodetoutf8 + floattostrw + currtostrw + datetostrw + timetostrw + datetimetostrw + strw + + date + time + now + currentyear + incamonth + appendstr + datetimetostring + format + ansiformat + + ֽںMBCSԭʼַڷBANSI汾(ԭʼstrext.dll汾) + containstext + startstext + endstext + containsstr + startsstr + endsstr + stuffbstring + reversebstring + + +־--------2020-07-16 +====================================================== + ޶԰汾Minof,MaxOfBUG + ޶ƽ̨ݷ޶ + ޶Apacheģ޶ + ºС + +־--------2020-07-6 +====================================================== + ޶Import Excelļʱ򣬽޳ոʽݡ + txlssheetCalcDimensionsEx¼FirstCol,LastCol,FirstRow,LastRow +====================================================== +־--------2020-07-3 +====================================================== + ޶ǰ޶շĩtradedays⡣ + ޶Ϊ֧Ĺ޶ +====================================================== + +־--------2020-06-23 +====================================================== + SetLength⡣ + ޶PostHttpȶhttps֧⡣ + ޶⡣ + ޶صTSLµ⡣ +====================================================== +־--------2020-06-7 +====================================================== + ĩҹTRADEDAYS⡣ + sortarray,sorttablebyfield,str2arrayʮextsys.dllĺֲcplugin.dll,ܵõ + ǣ浽ĺ£ + datatype, ifint,ifint64,ifreal,ifnumber,ifstring,ifwstring,ifarray,ifnil,ifexp,ifgraph,ifgraphgroup,ifbinary,ifobj,ifmatrix, + dupvalue, str2array,array2str,strcmp,length,lengthw,setlength,creatematrix,getmatrixfields,createbinary,getstrindexnum, + getstrindexs,getintindexs,getallindexs,sorttablebyfield,sortarray,matrixtoarray, + pn_stock,pn_date,pn_rate,pn_rateday,pn_nday,pn_cycle,pn_precision,pn_niltrans,pn_i64trans,pn_languageid,pn_bk,pn_sector,pn_endt,pn_begt,pn_timeindex, + cy_day,cy_month,cy_week,cy_1m,cy_5m,cy_15m,cy_30m,cy_60m,cy_quarter,cy_halfyear,cy_year,cy_2m,cy_3m,cy_10m,cy_120m,cy_20m,cy_40m, + cy_1s,cy_2s,cy_3s,cy_4s,cy_5s,cy_6s,cy_10s,cy_12s,cy_15s,cy_20s,cy_30s,cy_halfs,cy_detail,cy_freecycle,cy_trailingdays,cy_trailingseconds, + rt_none,rt_scale,rt_complex,rd_lastday,rd_firstday,deleteindex,deletefield,tostn,tostm,stn,stm,setspeedcalcmode,getspeedcalcmode,setlikeflag,getlikeflag, + convertdatatobuf,convertbuftodata,getformatlocalcode,setformatlocalcode,setprofiler,getprofilerinfo,pn_viewpoint,pn_reportmode,pn_emptymode,pn_freecycle, + pn_keeprawdata,pn_standardarray,pn_textresult,pn_resultfilename,pn_uid,cy_f30m,cy_f60m,pn_cyclefilter,cf_default,cf_nonighttrading,cf_callauctiontoseries,cf_suspendtoseries + ifstringȺ֧ifstring(a,1)ڵĽббΪͬṹ顣 +====================================================== + +־--------2020-05-22 +====================================================== + 517յIJ԰汾-tabledefʧЧ⡣ +====================================================== + +־--------2020-05-20 +====================================================== + иЧʡ +====================================================== +־--------2020-05-19 +====================================================== + viewpointʱ޷ʵݵ⡣ + tsdb_permission.iniȨ޴ùʱ򣬻dzstock_permission.iniֱȨޡ + FindFunction֧unitabcd.aaaķʽҺ +====================================================== + +־--------2020-05-17 +====================================================== + Event /timeout:timeoutseconds /maxlen:maxresultreturn ֧ijʱʱԼؽС + 磺event /dump daydata /id:*all /timeout:600 /maxlen:100000000 + ǰĬϳʱ趨Ϊ300룬󷵻شС趨Ϊ100M + +====================================================== +־--------2020-05-15 +====================================================== + ޶TSLںTSLDESTROY¿ܻ⡣ + a.c()ĵԼevalü뵽öջУʹÿԳstackframeԡ + createobject("DDD",....)ĵģʽŻʹnew һ£Ҫû޸Ĵ롣 + Ż + ޶һЩEvent.exe/ip:ſִе⣬޶Ϊɱȱʡ127.0.0.1 + reloadmarketΪEVENTԽ޸ڴƷֵг塣 + eventdumpߵidΪ*allʱΪDUMPڴƷֵг塣 + +====================================================== + + +־--------2020-05-07 +====================================================== + ں˵ЧʣʱŻ󶨺ָ롣 + ƷȨ޼ԻЧ +====================================================== +־--------2020-05-06 + ں˺APACHEģƥ + ORAINSERT BLOB⡣ + +־--------2020-04-30 + ںܡ + ޶гıƷֵ⡣ + MEMDBɵЧʡ + ã޹ƱݷʵȨSELECTƹȨ޵⡣ + +־--------2020-04-17 + ڴԪ߾޴еú߳ԱԼԿܻ⡣ + +־--------2020-04-14 + MEMDBֶֶ֧ڴ濪ٽӽ50%100% + ڲ쳣ļأ˶Եʱϵͳļ¼ + +־--------2020-04-13 + ޶һCALLڴŻϢʱ⡣ + +־--------2020-04-10 + ޶312汾ʼиʱе롣 + +־--------2020-04-9 + ޶ʹImportfilexlsļᵼڴй¶ + +־--------2020-03-31 + ʹtxlsreadwriteExcelдᶪʧ⣬Ĭɫʹǰһµ⡣ + "µдCHARTϢXLSX XMLļΪδ"б뵼µľ档 + +־--------2020-03-30 + ޶ߡߵһͣƹɴϵ⡣ + +־--------2020-03-27 + ޶311շ汾ʼĬΪ8bit⣬ָMBCS + ޶С¼ļźᵼ·ʷ쳣⡣ + +־--------2020-03-20 + ´֧֡ + +־--------2020-03-19 + ͻִ֧TSINTERP.DLLִ֧ɡ + +־--------2020-03-12 + ޶ָͼɺwg_drawgraphĬΪı⡣ + ޶gethttphttpú֧ѡȥWININET֧֣һΪѡΪʱúģʽӣ + 0ʾʹ΢Ŀ⣨һɿԷգԸߣ1ʹTCPֱģʽ: + gethttp(1,"https://www.baidu.com",6000,Value,Code); + ޶32λTCPֱGETHTTPҳѹᵼ³⡣ + ޶ApacheģURLֱĵ⡣ + +־--------2020-3-11 + ===============˰汾Ϊ԰汾+++++++++++++++++++Ҫȴʽ汾++++++++++++++++ + ޶event.exe -sysinikeynameʱ޷ + +־--------2020-3-6 + ===============˰汾Ϊ԰汾+++++++++++++++++++Ҫȴʽ汾++++++++++++++++ + ޶һĴύTSL뵼µִб⡣ + ޶ϵͳߵĺͷڲһµ⡣ + ޶.SS,.SZȴг⡣ + ַ֧WININETģʽHTTP֧֡ + ͬLINUX԰档 + +־--------2019-12-3 + ===============˰汾Ϊ԰汾+++++++++++++++++++Ҫȴʽ汾++++++++++++++++ + ҹ̷µIJ + ޶֮ǰֵݷʲ + +־--------2019-11-27 + 25Ű汾MDݺ⡣ + +־--------2019-11-26 + 趨VIEWPOINTʱ⡣ + ApacheģTWebRequestַ⡣ + +־--------2019-11-25 + ߵʱ⡣ + 趨VIEWPOINTʱΪ0⡣ + ǿJDBCЧʣJDBC Linuxԭ֧֣ȴLinuxķ͸£ + +־--------2019-09-26 + tsl newͷʱûڴʱһʮֽڵ,64λΪ24ֽڣ趨ڴ޶ʱ˲ĸֵܻڴ泬޵Ĵ + +־--------2019-09-10 + չݵĴӳ⡣ + +־--------2019-09-06 + WINDOWSµAPIΪʹTSSVC,TSSVC64ڷʱעͽijЩʱ򣩻ᵼ޷INIļı䶯Ҳ޷ص̵˳ + +־--------2019-08-23 + GetMsgDigestļ޷ʱԻ⡣ + UACǷ򿪵жϹɽĿ¼PUBKRNL.INIΪĿ¼PUBKRNL.INITSLKRNL.DLL·PUBKRNL.INI + +־--------2019-08-19 + ҹ̲ҵĩBUG + +־--------2019-08-18 + 16Ű汾BUG + +־--------2019-08-16 + ֧market.ini¼ַʽһַloadconfigһַʽevent. + -reloadid2market //reload id2market + -reinitmarket //reload market.ini + -reinitmarketrestartexec//reload market.ini and restart all exec server + -restartexec //restart all exec server + -reloadtradedays //reload tradeday.ini + +־--------2019-08-09 + ƽ̨ڵ֧֡ + +־--------2019-08-02 + ArrayDMLдNilʹõһҲΪյ⡣ + +־--------2019-08-01 + binaryexecsql ARRAYDML⡣ + +־--------2019-07-31 + any,allже⡣ + binaryexecsql ARRAYDML⡣ + ASCIIΪ1-31TOSTNתΪ\x01 \x1f + +־--------2019-07-30 + òôSQL̵ʱBLOBͻַת⡣ + +־--------2019-07-19 + ֧UTF8ַʽU""UTF8ַǣµķתҲ֧֣U%% %% + .PYļڿͻ˱༭ԶUTF8ʽǺĿǰPYTHONĬϱΪUTF8ʽ + PyError()PyRunʧܵݡdo pythonԶԶPYTHONĶջ + +־--------2019-07-03 + 2012 R2ϰ汾쳣ƵTSL.EXEȵµͨѶһʷ˳ԣͷʡ + +־--------2019-07-02 + MATLAB 2018B 2019A֧֡ + +־--------2019-06-28 + DeleteIndex,DeleteFieldļԸߣַ±߷Ǻϲģʽ±ɾЧʵõʵ + +־--------2019-06-27 + DeleteIndex¾̬µ⡣ + do﷨in*ֲջdo python in * rdoext python in * + +־--------2019-06-25 + Rִֶ֧С + ::﷨ûнβĴʾ + +־--------2019-06-20 + һָĩµķ߹ϡ + 3.5 PYTHONֿ֧PYTHON37⡣ + +־--------2019-06-18 + tsl -libpath⡣ + execsql֧preparedstatementģʽҲǵһΪʱ֮ǰΪڿƷֶͣΪսҲԵõϢ + λΪ1ʱ0x80000000,֮еSQLΪpreparedstatementҲǿθøַԽݿı뿪 + ֧rdoext﷨﷨do﷨ȫһ£ڽԵĵڿͻ + +־--------2019-06-8 + תַ%%֧֡ + : + %%[ʶ]<س|س|tab|ո>ַԭʼ%%[ʶ] + %% \r\nABC%%ַ\r\nABC + %%JJC %%JJJ%%JJCַ%%JJJJJCDZʶ + %% + abcd%%ַabcd + %%__ + printf("%%smc")%%__ַprintf("%%smc"),__Ϊʶ + Ϣclassinfoclassinfo(1)õһ͡ + ⲿԵĵãinʾֻ룬outʾֻͳvarʾͳ + ʹñĬϽͬ뵹ⲿУTSLıСд޹أĶСдĿԴСдأnameؼ + a:=3; + c:=2; + do python in a name "A",out b,var c + %% + c=A*c + b:=c*c + %%; + cΪ6,bΪ36 + ڲͬԶԣеԴڷֵе޷ֵġأPYTHONûзֵrзֵ + ִֻд룬ȶʡԡ + ijЩԣܻõģͨby﷨롣 + do extlanguage [paramlist] [by config] + ĿǰextlanguageѾ֧python,r,matlabܸԻᱻչ֧֣ײûҲͨӿڹ淶չ֧ԡ + µ%%תַ﷨ڵԻ㡣 + + +־--------2019-06-2 + £ETL̬ + CTP + tssvcֽ֧Ϣ¼ + +־--------2019-05-31 + £ͻInternetIP,InternetPort,LoginTimeϢ + +־--------2019-05-30 + getnoneԻnoneͰintֵ + ifnone(v,i)жǷnoneλi + ±setʱnone͵ֵΪsetļҲǴ0,1,2,3....һsetĹִ̳setأֵΪ-1none,ݿʵ֡ + APITSL_GetClientInfoTSLsysclientinfoʱͻ˵ϢTSLĵ÷ʽΪsysclientinfo([0/1/2],[Name]) + PythonĶTSLֱTSLһø÷ʱ֧[] + ַConnect.iniֶ֧IPãֶ֧IP + [Service] + MyIPs=192.168.103.9;192.168.102.9;192.168.101.9 + ִпԲַͨ¼ԴIPͨIPѯȼӷַЩ޷ӣ᳢ԴIP + ڶͬʱMǧʱ򣬿ܴڶΣijЩڷȴһӵٵΡʱѯ;߱˴ڵļֵ + +־--------2019-05-28 + ޶İ汾3736Pythonӵ3.5Ŀ⡣ + teradatamongodbapiֱ֧֡ + Эֽ֧֣֧Ϣƽ̨,CTPزϢ + Python󴫵ݵ֧֡ + +־--------2019-05-25 + ޶һTSL.EXE汾ִд⡣ + ˶.py/.m/.r֧֡ + SetSysParam,GetSysParamȺṩ˿ͻͷͬʵ߼R/PYTHONڷṩֱӵTSL֧֡ + ޶ֹnew ͬʱ⡣ + +־--------2019-05-06 + ʱ޷⡣ + ijЩʱ߼Ķ⡣ + TSL.EXE -libpath + case of⡣ + tssvcNUMANODE趨磺NUMANODE001=0Խ̰󶨵ضCPUڵ + +־--------2019-04-29 + ݺչµȲ¼⡣ + ֧֣tsl.confSystemLibpath趨ӵ··֧{$P}滻Ϊǰ·ʹҪTSL.EXE.tslдӦõĺ⡣ + tsl.conf + [system] + libpath={$P}funcext\ + ʹ.tslڵ·µfuncextΪȵfuncext· + +־--------2019-04-28 + ݣ20191¿ʼ޶˿Էʵ˽еproperty⣬еϳԡ + TSL.INI֧֣һ趨ѡΪ1κοӵpropertyɱʣpublicprotected,privateĬΥDzġ + [Compatible] + PrivatePropertyAccess=1 + +־--------2019-04-27 + ¼ʱͬһչߺͱ׼߻õµ⡣ڻ飬չ߲׼߻߱׼߲չߵݡ + +־--------2019-04-25 + MEMDB64.EXEԻСļģʽ֧֡ȥMYSQL֮ļС٣Чʿ١ + £ִӳ䡣43,42,40,81->89ͷӳ䵽NE75,77ͷӳ䵽SHӳ䵽SZ + SysBugCheck /o ݲ߼ӿе⡣ + +־--------2019-04-24 + MagicSetArrayMagicGetArrayṩ֧֣ + MagicSetArray(A,1,2,3,4,99)ͬڶAA[1][2][3][4]:=99 + MagicSetArrayһдΪ + MagicSetArray(A,array(1,2,3,4),99)ҲͬģҲ˵ڶһ飬Ϊڵݾ±ꡣ + MagicGetArray(A,1,2,3,4)ͬڶA[1][2][3][4]Ļò + MagicGetArrayһдΪ + MagicGetArray(A,array(1,2,3,4))ҲͬģҲ˵ڶһ飬Ϊڵݾ±ꡣ + ޶MDIJһMDһڵMDݣݽΪnil֮ǰΪDzȷģܻ᷵زض֡ + ޶AnsiPosλǽֵһַ20188µ2019-04-18İ汾УAnsiPosĺPosͬȱ壬޶ԭĺ塣 + ޶WriteToLogĻ⡣ + ޶chuquan޷ʵ⡣ + +־--------2019-04-18 + TS_ModuleInfoĺ֧TS_ModuleInfo()УԼTSLInterp.dllʱԼСϢ + ϵͳȨϢTS_ModuleInfo(1)ģļʱ䡣 + importjsonstringĺзбܵ޷⡣ + ޶: ViewPointһ⡣ + +־--------2019-04-17 + Debugreturn޷ݡ + +־--------2019-04-16 + չƷָƵʱпܻر⣬¶ܳ⡣ + Ϣܻᱻ⡣ + гݵطֹֿš + гݵ룬ͻ¶дš + ִкͷַʱ޷¼11000Ժ + +־--------2019-04-12 + ݲ޷ʵ⡣ + Reindexܴڵں˴⡣ + ִ֧еķ֧ύ㡣 + ǴִзLowSvrPythonSvrTaskĿ¼config.iniм + [AppGroup] + LowSvr=HaHa;127.0.0.1:D:\tinysoft\bin642\Exec64.exe + PythonSvr=127.0.0.1:D:\tinysoft\bin642\Exec64.exe;127.0.0.1:D:\tinysoft\bin64\Exec64.exe + ʹLowSvrPythonSvr趨ύķִȺ顣(ڿͻָ#withָֻAPIָ) + + +־--------2019-04-11 + ־ + ݲ޷ʵ⡣ + #with"@AppServerId@"±ָҪķǷȺҲÿִ̨е֣ip:·ģʽҲExec64.exe.name趨֡ + ֳ20ַʱǰʮַЧ + ʹApiָҲʹ趨ִָ + ͻڷѡнгִҲ˽ض20ַ + +־--------2019-04-09 + ҹ̵⡣ + ⡣ + ûҪ־⡣ + +־--------2019-04-04 + ҹTradeDaysܶһ⡣ + ֵ֧ıļExec64.exe.name֣ڷַгĽֲ֣ܳ19ַ + tsappservernameõ֡ûãĬip:·ԭtsappserverʱֲ䡣 + +־--------2019-04-02 + ҹ̷TradeDaysܶһ⡣ + +־--------2019-04-01 + ֧COMoutͲзշ0BUG + ִڸļԵյݵ޶ + +־--------2019-03-27 + ֧COMoutͲзء + SysBugCheck.EXEWindows 2012Ժİ汾Էܻá + 2012Ҫأ SysBugCheck /g /po,ԼַҲԼ̷ֵ + 2012й¶Щй¶覴ð汾ģֲϣSysBugCheck /g /dɾй¶ݡ + +Usage: + [/g] switch to global mode,default is local mode ȫԭģʽ + [/po] print string atom only ӡַԭ,ѡ2012²Űȫ + [/c nnnnn] try Allocate nnnnn times ԷĴĬ + [/p] print string atom ӡַԭ + [/d] try delete leaked string atom(maybe no safe!) ɾ覴ð汾ԼEDGEй¶ַԭӣڲϵͳ½ + [/o file1.txt] output to file1.txt ļ + [/?] help + process exit code: if use /po return the count of string atoms, ̷ش룬/poģʽ򷵻еַԭأ10000ںΣգһӦڼʮǧ + else if allocate atom success return 0 򵱳Էɹ򷵻0 + else return the max count of allocated 򷵻سԳɹĴ + + +־--------2019-03-25 + ޶TSL.EXEʱ޷˳⡣ + +־--------2019-03-18 + ޶importjsonstringexportjsonstring֧naninf,ӦĸתΪNaN,Infinity,-Infinityע⣺json淶֧naninf,ֻΪʹϵıݣתֺpythonļ,޷пȷתjson + sysbugcheckֲ֧/g /c /o,/gʾȫԭӣ/c 512ʾԷ512Σ/o C:\out\1.txtʾļ + ȷ̷ֵΪ0̷ֵΪĸ + +־--------2019-02-25 + Viewpoint⡣ + ӹرBASICܿء + ع鴦ԭ򣬶ȼ + +־--------2019-02-18 + SelectʱDataNextPrevһǷбڵIJ + viewpointܡ + ֧BinarytslexecsqlIJС + Integer,Int64͵תԻõַΪΨһֵ + +־--------2019-01-30 + Selectҹҹ̴޷ȡݵ⡣ + Selectҹܴ̿ȡݳdatekeyĽ⡣ + matlab 2018bֿ֧⡣ + ViewPointõĩķǽʱεµ⡣ + +־--------2019-01-29 + ޶ߺߵ13:00ֵĹ⡣ + ޶PropertyPrivateõ⡣ + ޶InheritdPrivateõ⡣ + +־--------2019-01-11 + ޶SQL﷨TSL֧ûofTSqlSetDataKeyʵֵʱ򣩣ͬʱ֧лof + +־--------2019-01-08 + ޶SQL﷨TSLֵ֧һС⡣Update Set Thisrow=֮󲻻öPost + +־--------2019-01-03 + ޶XLSXZIPʱ򣬿ܻᵼѭ޷⡣ + ޶XLSXĶдChartͼ֧֡ + ޶һּ÷ĺͲصBUG(ʹòӦõ) + +־--------2018-12-21 + ֧ύȼڶеŶӴȼߵĻСTSL.exe˺setrunpriority,getrunpriority,r/pythonغͻ˲˵ȼѡ + ޶ڲܱblockBUG + manager2r.exemanager64.exe + +־--------2018-12-17 + ݵķϵͳѡpn_EmptyMode()趨¼ڵʱreportbaseȱʡΪ + ϵͳȡֵΪ֣ + 0ȱʡֵΪ0 + 1ΪNil + 2ֶε趨,Ϊ0.0 + 3Ϊ̸ַ + 4ΪN/Aַ + 5ΪNAN + 6趨,ΪNAN + +־--------2018-12-14 + TSJDBCȱһࡣ + +־--------2018-12-11 + ݿNUMERICͳ㾫ȵֻᵼ³⡣ + ַconfig.iniã趨ûпִԴʱĵȴ + ޵ȴԽΪ0߸ + [Service] + MAX_WAIT_TIMEOUT=0 + + +־--------2018-12-7 + СԼĺ޷ͬصͻ˵⡣ + +־--------2018-12-6 + 32λ¸64λΪ$ĵһᵼ´ + ݿУִSQLʱ򣬻Զر⡣ + +־--------2018-12-5 + Inheritedؼֵ⡣ + +־--------2018-12-4 + £֧inheritedؼ֣ڵøķ + ǿ߿ͻ˷ƽ̨ListִЧʡ + +־--------2018-11-26 + ViewPointĩߺߴBUG + ǿtssvcpathѡ֧·ִеCMD֧4096ֽڣ֧JAVA·ܳӦá + ǿjdbc֧־ + tslogin.dllµace.dll + endexecuteûз͹⡣ + +־--------2018-11-23 + £֧෽ֱʹá + ViewPointĩĴBUG + ϸڼϾʱεĴ⡣ + £SelectOpt(16384)ѡڷؽеRefOfԼƶۼOrder by ֮ʹýΪУԭʼ򣩡 + £Ϣֻ֧ü¼ĸʱ䡣 + +־--------2018-11-20 + £refofԼۼorder byڵ(ҲGroup by)SelectOpt(16384)ʹ÷беľۼrefofĽΪ׼ + +־--------2018-11-15 + ֶ֧a.b+=10IJ + ֧setter getterΪԱʱ෽ֱʹá + Adoģʽ޷⡣ + +־--------2018-11-6 + £Ϳͻ˶̬ͬ + +־--------2018-10-22 + һʽ׼۸ǿ̼ʱķ߲⡣ + +־--------2018-10-17 + sql֧֣ͨԡ + sqlԶ֧֣ͨԡ + +־--------2018-10-16 + ں˵һ⡣ + objectstateԻö״̬ + TStringList[]ء + +־--------2018-10-15 + SelectѯķTSQLGetCurrentDate,TSQLInsertӦΪ޲ + +־--------2018-10-14 + ڶзصʱúͻȡֶ֧༶༶ʱм䷵ֵӦǶ + isnoneڼõʱõֵΪnoneͣΪм伶á + ²a[i][j][k]:=100ʱa[i]÷صһֵٶ[j]ãһ,Ȼ[k]в100 + Ҫöһʵ[i][j][k]none͵ʱ±겢ҷselfֵnoneʱһԴò + TSL.EXE 64λջΪ64M + +־--------2018-10-11 + µı汾롣 + cov,commaexprԤѡ + (a:=1,b:=2,a+b)C++űʽ + +־--------2018-9-28 + ޶sp_slopeandInterceptδʵֵ⡣ + +־--------2018-9-21 + ޶ڴ治շı + +־--------2018-9-20 + ޶sp_skurtosissp_skewnessļ㡣 + £˫֧һһάͶάһм㡣һƱһBENCHMARKϵȡ + +־--------2018-9-19 + exportfile ftxls2xlsļ⡣ + £integer/int64ֱ֧ʽתΪ֡ + ˫кCov,Correl,Rsq,Slope,Intercept,Steyx + ʱкsp_large,sp_small, sp_percentile,sp_percentrank,sp_quartile,sp_rank,sp_trimmean,sp_frequency,sp_geomean,sp_harmean,sp_median,sp_mode, + sp_product,sp_totalvariance,sp_norm,sp_skewness,sp_kurtosis,sp_skewness2,sp_kurtosis2 + ˫ʱкsp_cov,sp_correl,sp_slope,sp_intercept,sp_rsq,sp_steyx + ˫SQLۼcovof,correlof,slopeof,interceptof,rsqof,steyxof + +־--------2018-9-10 + ¼֧64λID + +־--------2018-9-6 + ִеϵͳг֧64λID + +־--------2018-9-5 + ϵͳг֧64λID + +־--------2018-8-31 + FindClassҶ޷ҵ⡣ + +־--------2018-8-29 + nilȥֵʱܻõԤڵֵ + ݵʱ¼ܴڶ̰߳ȫ⡣ + +־--------2018-8-28 + ִв¼ݿİ汾¼CRC + سANY⣬֧FindClassȷصĶȡ + ӣSQLIn + +־--------2018-8-27 + 824հ汾downloadover緢ͬδɾͽ⡣ + 64λ룬Ƶmin.ind3Ϊmin.ind4ָƵݷ쳣⡣ڲʹ64λIDͻɾmin.ind3 + +־--------2018-8-26 + JDBC޷ж̹߳⡣TSJDBC.ZIP + +־--------2018-8-24 + ִظݵ⡣ + MDݸºͻȡʱͻܻᵼCRASH⡣ + Ķclassinfoгʼ±⡣ + ĸϢɷֱַӴݸִС¼ͷַͬʱִУִнֻǶִһЧʺ͹Ӱ죬Աϼʱĺ״̬£ + +־--------2018-8-23 + ߺspecлƱʱܻᵼӰߵĵݷʵ֮ǰлĹƱ + chuquanļ16ֽڵ֧64ֽڣȻݽȥɴ⡣ + +־--------2018-8-22 + ͻ½շ¼⡣ + ޶InternetrequestԼgethttpʹHTTPSʱ޷֤URL + +־--------2018-8-16 + pubkrnl.dllʹõsorttablebyfieldȺɵBUGԼͻ⡣BUGBETAԿʼʹڣҪ + +־--------2018-8-15 + TSLUtils.dll Import Export DBF͵ļʧܵ⡣ + º͵ͷݱ + +־--------2018-8-14 + TSL.EXE˳óһᵼTSL.EXEƽ̨ʧܵ⡣ + ע⣺TSL64extkrnl.dll֧ŵ¼ȻÿͻMACַϢ + һ֪⣬Ȼ˶µ֧֣ODBC DRIVER 17 FOR SQL SERVERڿܵTSL.EXE޷˳SQLServerSQL SERVER NATIVE CLIENT 11.0 + Unicode֧֣ExecSQLΪWideStringʱĬʹWideStringSQLSelect֧SelectOpt8192ѡʹ÷ַΪUnicode + Com,OleĶһWideString֮÷صַʹWideString + Unicode֧֣ײַػ֧Unicode,ĿǰݲֿϵͳȲ֧֧֡Unicodeģʽһ෽ַҲΪַģһͣ󲿷ַַ෽WβķWideString + Unicodeʵ壺 + һļʣļ޷תΪMultiByteַֻUnicodeļſԷʡ + ʼ֮ģһЩַΪUTF8ͣ޷תMultiByteҪUnicode֧֡ + ݿֶΣһUnicode룬Ҳ޷뵽MultiByteʽҪUnicode֧֡ + ǶDLLⲿã֧UnicodeԸõؽӳ䡣 + ƽ̨֧ĬȨƷINIĺڰ֧֣ʹʽ + [STOCK] + BLACKLIST=^S(Z|H).*\.IW$ + WHITELIST= + + +־--------2018-8-9 + ָ֧ļ + TSLȶκƽ̨, ҪͬTSL64TSLĿ¼µĿ⡣ + ƽ̨ĴݸʱܵϢ⡣ + BETA԰ʽԼײ㺯һ󲨵UNICODE֧֡ + + +־--------2018-7-18 + ޶tslutils.dllReadExcelSheetsĶһմ⡣ + +־--------2018-7-16 + µWINDOWSƽ̨µWINDOWS 2008 R2ODBCݿʼԳ⡣ǿ˺WINDOWSļԡ + +־--------2018-7-12 + ʱݴڶʧ⡣ + __line__ؼֻкš + parseregexpr֧滻ģʽ + Operator֧[],[][0]getter,[1]setter + ֧++,--أûأû++,--,+=,-= + + º + datetimetointernetstrw + datetimegmttohttpstrw + datetimegmttocookiestrw + concat,getchar,setchar֧wstring + +־--------2018-6-19 + string,widestring,binary֧widestring֧ͣ顣WideChrOrdΪ֧WideStringWideChr,Chr,Ord֧顣 + +־--------2018-6-14 + ʵʱ֧64ֽڡ + ͬһͻһαδصʱCTRL+S溯ְ汾ȷʾ + +־--------2018-6-8 + ʵʱ֧64ֽڣص⡣ + ַos,oePSENDS,PSEND(M)ݣԲ鿴ЩͨѶжٸٸֽδԶ˽ա + +־--------2018-6-6 + ƷIDƵijΪ64ֽڡ diff --git a/TSSVRAPI.DLL b/TSSVRAPI.DLL new file mode 100644 index 0000000..6fbdacf Binary files /dev/null and b/TSSVRAPI.DLL differ diff --git a/TSTransaction.dll b/TSTransaction.dll new file mode 100644 index 0000000..04d7139 Binary files /dev/null and b/TSTransaction.dll differ diff --git a/TSWinAdmin64.exe b/TSWinAdmin64.exe new file mode 100644 index 0000000..fc29726 Binary files /dev/null and b/TSWinAdmin64.exe differ diff --git a/TT_GateWayLib.dll b/TT_GateWayLib.dll new file mode 100644 index 0000000..71f438a Binary files /dev/null and b/TT_GateWayLib.dll differ diff --git a/TestDll.dll b/TestDll.dll new file mode 100644 index 0000000..b8feb54 Binary files /dev/null and b/TestDll.dll differ diff --git a/TinyODBC.dll b/TinyODBC.dll new file mode 100644 index 0000000..6e34e11 Binary files /dev/null and b/TinyODBC.dll differ diff --git a/TinyRTDServer.dll b/TinyRTDServer.dll new file mode 100644 index 0000000..c639be6 Binary files /dev/null and b/TinyRTDServer.dll differ diff --git a/UnRAR64.dll b/UnRAR64.dll new file mode 100644 index 0000000..a7cf728 Binary files /dev/null and b/UnRAR64.dll differ diff --git a/UserData.dll b/UserData.dll new file mode 100644 index 0000000..2f5af0b Binary files /dev/null and b/UserData.dll differ diff --git a/WebGraph.dll b/WebGraph.dll new file mode 100644 index 0000000..9786584 Binary files /dev/null and b/WebGraph.dll differ diff --git a/WinDataCollect.dll b/WinDataCollect.dll new file mode 100644 index 0000000..ecfdaac Binary files /dev/null and b/WinDataCollect.dll differ diff --git a/api-ms-win-base-util-l1-1-0.dll b/api-ms-win-base-util-l1-1-0.dll new file mode 100644 index 0000000..65337fc Binary files /dev/null and b/api-ms-win-base-util-l1-1-0.dll differ diff --git a/api-ms-win-core-com-l1-1-0.dll b/api-ms-win-core-com-l1-1-0.dll new file mode 100644 index 0000000..bc90f67 Binary files /dev/null and b/api-ms-win-core-com-l1-1-0.dll differ diff --git a/api-ms-win-core-comm-l1-1-0.dll b/api-ms-win-core-comm-l1-1-0.dll new file mode 100644 index 0000000..f7df48e Binary files /dev/null and b/api-ms-win-core-comm-l1-1-0.dll differ diff --git a/api-ms-win-core-console-l1-1-0.dll b/api-ms-win-core-console-l1-1-0.dll new file mode 100644 index 0000000..6313f63 Binary files /dev/null and b/api-ms-win-core-console-l1-1-0.dll differ diff --git a/api-ms-win-core-datetime-l1-1-0.dll b/api-ms-win-core-datetime-l1-1-0.dll new file mode 100644 index 0000000..b995a42 Binary files /dev/null and b/api-ms-win-core-datetime-l1-1-0.dll differ diff --git a/api-ms-win-core-datetime-l1-1-1.dll b/api-ms-win-core-datetime-l1-1-1.dll new file mode 100644 index 0000000..3bae052 Binary files /dev/null and b/api-ms-win-core-datetime-l1-1-1.dll differ diff --git a/api-ms-win-core-debug-l1-1-0.dll b/api-ms-win-core-debug-l1-1-0.dll new file mode 100644 index 0000000..8a6b2d9 Binary files /dev/null and b/api-ms-win-core-debug-l1-1-0.dll differ diff --git a/api-ms-win-core-debug-l1-1-1.dll b/api-ms-win-core-debug-l1-1-1.dll new file mode 100644 index 0000000..c67ae9a Binary files /dev/null and b/api-ms-win-core-debug-l1-1-1.dll differ diff --git a/api-ms-win-core-delayload-l1-1-0.dll b/api-ms-win-core-delayload-l1-1-0.dll new file mode 100644 index 0000000..56672c3 Binary files /dev/null and b/api-ms-win-core-delayload-l1-1-0.dll differ diff --git a/api-ms-win-core-errorhandling-l1-1-0.dll b/api-ms-win-core-errorhandling-l1-1-0.dll new file mode 100644 index 0000000..9d57529 Binary files /dev/null and b/api-ms-win-core-errorhandling-l1-1-0.dll differ diff --git a/api-ms-win-core-errorhandling-l1-1-1.dll b/api-ms-win-core-errorhandling-l1-1-1.dll new file mode 100644 index 0000000..072a5a7 Binary files /dev/null and b/api-ms-win-core-errorhandling-l1-1-1.dll differ diff --git a/api-ms-win-core-fibers-l1-1-0.dll b/api-ms-win-core-fibers-l1-1-0.dll new file mode 100644 index 0000000..c04d7d5 Binary files /dev/null and b/api-ms-win-core-fibers-l1-1-0.dll differ diff --git a/api-ms-win-core-fibers-l1-1-1.dll b/api-ms-win-core-fibers-l1-1-1.dll new file mode 100644 index 0000000..51c673c Binary files /dev/null and b/api-ms-win-core-fibers-l1-1-1.dll differ diff --git a/api-ms-win-core-file-l1-1-0.dll b/api-ms-win-core-file-l1-1-0.dll new file mode 100644 index 0000000..97ec5e1 Binary files /dev/null and b/api-ms-win-core-file-l1-1-0.dll differ diff --git a/api-ms-win-core-file-l1-2-0.dll b/api-ms-win-core-file-l1-2-0.dll new file mode 100644 index 0000000..e7ef451 Binary files /dev/null and b/api-ms-win-core-file-l1-2-0.dll differ diff --git a/api-ms-win-core-file-l1-2-1.dll b/api-ms-win-core-file-l1-2-1.dll new file mode 100644 index 0000000..82b0ea1 Binary files /dev/null and b/api-ms-win-core-file-l1-2-1.dll differ diff --git a/api-ms-win-core-handle-l1-1-0.dll b/api-ms-win-core-handle-l1-1-0.dll new file mode 100644 index 0000000..c00587b Binary files /dev/null and b/api-ms-win-core-handle-l1-1-0.dll differ diff --git a/api-ms-win-core-heap-l1-1-0.dll b/api-ms-win-core-heap-l1-1-0.dll new file mode 100644 index 0000000..7050366 Binary files /dev/null and b/api-ms-win-core-heap-l1-1-0.dll differ diff --git a/api-ms-win-core-interlocked-l1-1-0.dll b/api-ms-win-core-interlocked-l1-1-0.dll new file mode 100644 index 0000000..a946fbb Binary files /dev/null and b/api-ms-win-core-interlocked-l1-1-0.dll differ diff --git a/api-ms-win-core-io-l1-1-0.dll b/api-ms-win-core-io-l1-1-0.dll new file mode 100644 index 0000000..ac8090e Binary files /dev/null and b/api-ms-win-core-io-l1-1-0.dll differ diff --git a/api-ms-win-core-io-l1-1-1.dll b/api-ms-win-core-io-l1-1-1.dll new file mode 100644 index 0000000..c811377 Binary files /dev/null and b/api-ms-win-core-io-l1-1-1.dll differ diff --git a/api-ms-win-core-kernel32-legacy-l1-1-0.dll b/api-ms-win-core-kernel32-legacy-l1-1-0.dll new file mode 100644 index 0000000..1984958 Binary files /dev/null and b/api-ms-win-core-kernel32-legacy-l1-1-0.dll differ diff --git a/api-ms-win-core-kernel32-legacy-l1-1-1.dll b/api-ms-win-core-kernel32-legacy-l1-1-1.dll new file mode 100644 index 0000000..9d9715a Binary files /dev/null and b/api-ms-win-core-kernel32-legacy-l1-1-1.dll differ diff --git a/api-ms-win-core-libraryloader-l1-1-0.dll b/api-ms-win-core-libraryloader-l1-1-0.dll new file mode 100644 index 0000000..4c21a2a Binary files /dev/null and b/api-ms-win-core-libraryloader-l1-1-0.dll differ diff --git a/api-ms-win-core-libraryloader-l1-1-1.dll b/api-ms-win-core-libraryloader-l1-1-1.dll new file mode 100644 index 0000000..08bb186 Binary files /dev/null and b/api-ms-win-core-libraryloader-l1-1-1.dll differ diff --git a/api-ms-win-core-localization-l1-2-0.dll b/api-ms-win-core-localization-l1-2-0.dll new file mode 100644 index 0000000..2858eb1 Binary files /dev/null and b/api-ms-win-core-localization-l1-2-0.dll differ diff --git a/api-ms-win-core-localization-l1-2-1.dll b/api-ms-win-core-localization-l1-2-1.dll new file mode 100644 index 0000000..c625722 Binary files /dev/null and b/api-ms-win-core-localization-l1-2-1.dll differ diff --git a/api-ms-win-core-memory-l1-1-0.dll b/api-ms-win-core-memory-l1-1-0.dll new file mode 100644 index 0000000..e4fbba1 Binary files /dev/null and b/api-ms-win-core-memory-l1-1-0.dll differ diff --git a/api-ms-win-core-memory-l1-1-1.dll b/api-ms-win-core-memory-l1-1-1.dll new file mode 100644 index 0000000..b74c958 Binary files /dev/null and b/api-ms-win-core-memory-l1-1-1.dll differ diff --git a/api-ms-win-core-memory-l1-1-2.dll b/api-ms-win-core-memory-l1-1-2.dll new file mode 100644 index 0000000..e2e2dde Binary files /dev/null and b/api-ms-win-core-memory-l1-1-2.dll differ diff --git a/api-ms-win-core-namedpipe-l1-1-0.dll b/api-ms-win-core-namedpipe-l1-1-0.dll new file mode 100644 index 0000000..f919f7e Binary files /dev/null and b/api-ms-win-core-namedpipe-l1-1-0.dll differ diff --git a/api-ms-win-core-privateprofile-l1-1-0.dll b/api-ms-win-core-privateprofile-l1-1-0.dll new file mode 100644 index 0000000..2115778 Binary files /dev/null and b/api-ms-win-core-privateprofile-l1-1-0.dll differ diff --git a/api-ms-win-core-privateprofile-l1-1-1.dll b/api-ms-win-core-privateprofile-l1-1-1.dll new file mode 100644 index 0000000..bcc4b78 Binary files /dev/null and b/api-ms-win-core-privateprofile-l1-1-1.dll differ diff --git a/api-ms-win-core-processenvironment-l1-1-0.dll b/api-ms-win-core-processenvironment-l1-1-0.dll new file mode 100644 index 0000000..c4acd48 Binary files /dev/null and b/api-ms-win-core-processenvironment-l1-1-0.dll differ diff --git a/api-ms-win-core-processenvironment-l1-2-0.dll b/api-ms-win-core-processenvironment-l1-2-0.dll new file mode 100644 index 0000000..4f7e6ba Binary files /dev/null and b/api-ms-win-core-processenvironment-l1-2-0.dll differ diff --git a/api-ms-win-core-processthreads-l1-1-0.dll b/api-ms-win-core-processthreads-l1-1-0.dll new file mode 100644 index 0000000..f3739c7 Binary files /dev/null and b/api-ms-win-core-processthreads-l1-1-0.dll differ diff --git a/api-ms-win-core-processthreads-l1-1-1.dll b/api-ms-win-core-processthreads-l1-1-1.dll new file mode 100644 index 0000000..9705327 Binary files /dev/null and b/api-ms-win-core-processthreads-l1-1-1.dll differ diff --git a/api-ms-win-core-processthreads-l1-1-2.dll b/api-ms-win-core-processthreads-l1-1-2.dll new file mode 100644 index 0000000..7383649 Binary files /dev/null and b/api-ms-win-core-processthreads-l1-1-2.dll differ diff --git a/api-ms-win-core-processtopology-obsolete-l1-1-0.dll b/api-ms-win-core-processtopology-obsolete-l1-1-0.dll new file mode 100644 index 0000000..8a5d34b Binary files /dev/null and b/api-ms-win-core-processtopology-obsolete-l1-1-0.dll differ diff --git a/api-ms-win-core-profile-l1-1-0.dll b/api-ms-win-core-profile-l1-1-0.dll new file mode 100644 index 0000000..f4407e2 Binary files /dev/null and b/api-ms-win-core-profile-l1-1-0.dll differ diff --git a/api-ms-win-core-realtime-l1-1-0.dll b/api-ms-win-core-realtime-l1-1-0.dll new file mode 100644 index 0000000..23d46ba Binary files /dev/null and b/api-ms-win-core-realtime-l1-1-0.dll differ diff --git a/api-ms-win-core-registry-l1-1-0.dll b/api-ms-win-core-registry-l1-1-0.dll new file mode 100644 index 0000000..de484ff Binary files /dev/null and b/api-ms-win-core-registry-l1-1-0.dll differ diff --git a/api-ms-win-core-registry-l2-1-0.dll b/api-ms-win-core-registry-l2-1-0.dll new file mode 100644 index 0000000..a540d0f Binary files /dev/null and b/api-ms-win-core-registry-l2-1-0.dll differ diff --git a/api-ms-win-core-rtlsupport-l1-1-0.dll b/api-ms-win-core-rtlsupport-l1-1-0.dll new file mode 100644 index 0000000..1bf68ae Binary files /dev/null and b/api-ms-win-core-rtlsupport-l1-1-0.dll differ diff --git a/api-ms-win-core-shlwapi-legacy-l1-1-0.dll b/api-ms-win-core-shlwapi-legacy-l1-1-0.dll new file mode 100644 index 0000000..2a1b6ab Binary files /dev/null and b/api-ms-win-core-shlwapi-legacy-l1-1-0.dll differ diff --git a/api-ms-win-core-shlwapi-obsolete-l1-1-0.dll b/api-ms-win-core-shlwapi-obsolete-l1-1-0.dll new file mode 100644 index 0000000..7987f27 Binary files /dev/null and b/api-ms-win-core-shlwapi-obsolete-l1-1-0.dll differ diff --git a/api-ms-win-core-shutdown-l1-1-0.dll b/api-ms-win-core-shutdown-l1-1-0.dll new file mode 100644 index 0000000..49659fc Binary files /dev/null and b/api-ms-win-core-shutdown-l1-1-0.dll differ diff --git a/api-ms-win-core-string-l1-1-0.dll b/api-ms-win-core-string-l1-1-0.dll new file mode 100644 index 0000000..7813590 Binary files /dev/null and b/api-ms-win-core-string-l1-1-0.dll differ diff --git a/api-ms-win-core-stringansi-l1-1-0.dll b/api-ms-win-core-stringansi-l1-1-0.dll new file mode 100644 index 0000000..59e985b Binary files /dev/null and b/api-ms-win-core-stringansi-l1-1-0.dll differ diff --git a/api-ms-win-core-stringloader-l1-1-1.dll b/api-ms-win-core-stringloader-l1-1-1.dll new file mode 100644 index 0000000..21d2926 Binary files /dev/null and b/api-ms-win-core-stringloader-l1-1-1.dll differ diff --git a/api-ms-win-core-synch-l1-1-0.dll b/api-ms-win-core-synch-l1-1-0.dll new file mode 100644 index 0000000..4451c9d Binary files /dev/null and b/api-ms-win-core-synch-l1-1-0.dll differ diff --git a/api-ms-win-core-synch-l1-2-0.dll b/api-ms-win-core-synch-l1-2-0.dll new file mode 100644 index 0000000..299ed37 Binary files /dev/null and b/api-ms-win-core-synch-l1-2-0.dll differ diff --git a/api-ms-win-core-sysinfo-l1-1-0.dll b/api-ms-win-core-sysinfo-l1-1-0.dll new file mode 100644 index 0000000..23dba77 Binary files /dev/null and b/api-ms-win-core-sysinfo-l1-1-0.dll differ diff --git a/api-ms-win-core-sysinfo-l1-2-0.dll b/api-ms-win-core-sysinfo-l1-2-0.dll new file mode 100644 index 0000000..8f6a24a Binary files /dev/null and b/api-ms-win-core-sysinfo-l1-2-0.dll differ diff --git a/api-ms-win-core-sysinfo-l1-2-1.dll b/api-ms-win-core-sysinfo-l1-2-1.dll new file mode 100644 index 0000000..236055b Binary files /dev/null and b/api-ms-win-core-sysinfo-l1-2-1.dll differ diff --git a/api-ms-win-core-threadpool-l1-2-0.dll b/api-ms-win-core-threadpool-l1-2-0.dll new file mode 100644 index 0000000..c355c21 Binary files /dev/null and b/api-ms-win-core-threadpool-l1-2-0.dll differ diff --git a/api-ms-win-core-threadpool-legacy-l1-1-0.dll b/api-ms-win-core-threadpool-legacy-l1-1-0.dll new file mode 100644 index 0000000..6d77b92 Binary files /dev/null and b/api-ms-win-core-threadpool-legacy-l1-1-0.dll differ diff --git a/api-ms-win-core-threadpool-private-l1-1-0.dll b/api-ms-win-core-threadpool-private-l1-1-0.dll new file mode 100644 index 0000000..0d4a6d4 Binary files /dev/null and b/api-ms-win-core-threadpool-private-l1-1-0.dll differ diff --git a/api-ms-win-core-timezone-l1-1-0.dll b/api-ms-win-core-timezone-l1-1-0.dll new file mode 100644 index 0000000..424b66f Binary files /dev/null and b/api-ms-win-core-timezone-l1-1-0.dll differ diff --git a/api-ms-win-core-url-l1-1-0.dll b/api-ms-win-core-url-l1-1-0.dll new file mode 100644 index 0000000..5647a89 Binary files /dev/null and b/api-ms-win-core-url-l1-1-0.dll differ diff --git a/api-ms-win-core-util-l1-1-0.dll b/api-ms-win-core-util-l1-1-0.dll new file mode 100644 index 0000000..582efcc Binary files /dev/null and b/api-ms-win-core-util-l1-1-0.dll differ diff --git a/api-ms-win-core-version-l1-1-0.dll b/api-ms-win-core-version-l1-1-0.dll new file mode 100644 index 0000000..4aa727a Binary files /dev/null and b/api-ms-win-core-version-l1-1-0.dll differ diff --git a/api-ms-win-core-wow64-l1-1-0.dll b/api-ms-win-core-wow64-l1-1-0.dll new file mode 100644 index 0000000..9e422b4 Binary files /dev/null and b/api-ms-win-core-wow64-l1-1-0.dll differ diff --git a/api-ms-win-core-xstate-l1-1-0.dll b/api-ms-win-core-xstate-l1-1-0.dll new file mode 100644 index 0000000..f17e29f Binary files /dev/null and b/api-ms-win-core-xstate-l1-1-0.dll differ diff --git a/api-ms-win-crt-conio-l1-1-0.dll b/api-ms-win-crt-conio-l1-1-0.dll new file mode 100644 index 0000000..45c9c53 Binary files /dev/null and b/api-ms-win-crt-conio-l1-1-0.dll differ diff --git a/api-ms-win-crt-convert-l1-1-0.dll b/api-ms-win-crt-convert-l1-1-0.dll new file mode 100644 index 0000000..7689964 Binary files /dev/null and b/api-ms-win-crt-convert-l1-1-0.dll differ diff --git a/api-ms-win-crt-environment-l1-1-0.dll b/api-ms-win-crt-environment-l1-1-0.dll new file mode 100644 index 0000000..140e964 Binary files /dev/null and b/api-ms-win-crt-environment-l1-1-0.dll differ diff --git a/api-ms-win-crt-filesystem-l1-1-0.dll b/api-ms-win-crt-filesystem-l1-1-0.dll new file mode 100644 index 0000000..92a83f3 Binary files /dev/null and b/api-ms-win-crt-filesystem-l1-1-0.dll differ diff --git a/api-ms-win-crt-heap-l1-1-0.dll b/api-ms-win-crt-heap-l1-1-0.dll new file mode 100644 index 0000000..5c04463 Binary files /dev/null and b/api-ms-win-crt-heap-l1-1-0.dll differ diff --git a/api-ms-win-crt-locale-l1-1-0.dll b/api-ms-win-crt-locale-l1-1-0.dll new file mode 100644 index 0000000..361af88 Binary files /dev/null and b/api-ms-win-crt-locale-l1-1-0.dll differ diff --git a/api-ms-win-crt-math-l1-1-0.dll b/api-ms-win-crt-math-l1-1-0.dll new file mode 100644 index 0000000..d00bd9d Binary files /dev/null and b/api-ms-win-crt-math-l1-1-0.dll differ diff --git a/api-ms-win-crt-multibyte-l1-1-0.dll b/api-ms-win-crt-multibyte-l1-1-0.dll new file mode 100644 index 0000000..09532ce Binary files /dev/null and b/api-ms-win-crt-multibyte-l1-1-0.dll differ diff --git a/api-ms-win-crt-private-l1-1-0.dll b/api-ms-win-crt-private-l1-1-0.dll new file mode 100644 index 0000000..e354be0 Binary files /dev/null and b/api-ms-win-crt-private-l1-1-0.dll differ diff --git a/api-ms-win-crt-process-l1-1-0.dll b/api-ms-win-crt-process-l1-1-0.dll new file mode 100644 index 0000000..db9af51 Binary files /dev/null and b/api-ms-win-crt-process-l1-1-0.dll differ diff --git a/api-ms-win-crt-runtime-l1-1-0.dll b/api-ms-win-crt-runtime-l1-1-0.dll new file mode 100644 index 0000000..9602abf Binary files /dev/null and b/api-ms-win-crt-runtime-l1-1-0.dll differ diff --git a/api-ms-win-crt-stdio-l1-1-0.dll b/api-ms-win-crt-stdio-l1-1-0.dll new file mode 100644 index 0000000..e2d9eff Binary files /dev/null and b/api-ms-win-crt-stdio-l1-1-0.dll differ diff --git a/api-ms-win-crt-string-l1-1-0.dll b/api-ms-win-crt-string-l1-1-0.dll new file mode 100644 index 0000000..6b8bb8c Binary files /dev/null and b/api-ms-win-crt-string-l1-1-0.dll differ diff --git a/api-ms-win-crt-time-l1-1-0.dll b/api-ms-win-crt-time-l1-1-0.dll new file mode 100644 index 0000000..e5e57b4 Binary files /dev/null and b/api-ms-win-crt-time-l1-1-0.dll differ diff --git a/api-ms-win-crt-utility-l1-1-0.dll b/api-ms-win-crt-utility-l1-1-0.dll new file mode 100644 index 0000000..d8bfc17 Binary files /dev/null and b/api-ms-win-crt-utility-l1-1-0.dll differ diff --git a/api-ms-win-eventing-consumer-l1-1-0.dll b/api-ms-win-eventing-consumer-l1-1-0.dll new file mode 100644 index 0000000..848f267 Binary files /dev/null and b/api-ms-win-eventing-consumer-l1-1-0.dll differ diff --git a/api-ms-win-security-base-l1-1-0.dll b/api-ms-win-security-base-l1-1-0.dll new file mode 100644 index 0000000..19db41f Binary files /dev/null and b/api-ms-win-security-base-l1-1-0.dll differ diff --git a/api-ms-win-security-cryptoapi-l1-1-0.dll b/api-ms-win-security-cryptoapi-l1-1-0.dll new file mode 100644 index 0000000..d8c1cef Binary files /dev/null and b/api-ms-win-security-cryptoapi-l1-1-0.dll differ diff --git a/api-ms-win-security-sddl-l1-1-0.dll b/api-ms-win-security-sddl-l1-1-0.dll new file mode 100644 index 0000000..2836cbe Binary files /dev/null and b/api-ms-win-security-sddl-l1-1-0.dll differ diff --git a/api-ms-win-service-core-l1-1-0.dll b/api-ms-win-service-core-l1-1-0.dll new file mode 100644 index 0000000..b575478 Binary files /dev/null and b/api-ms-win-service-core-l1-1-0.dll differ diff --git a/api-ms-win-service-core-l1-1-1.dll b/api-ms-win-service-core-l1-1-1.dll new file mode 100644 index 0000000..aa6b5de Binary files /dev/null and b/api-ms-win-service-core-l1-1-1.dll differ diff --git a/api-ms-win-service-management-l1-1-0.dll b/api-ms-win-service-management-l1-1-0.dll new file mode 100644 index 0000000..91a82e4 Binary files /dev/null and b/api-ms-win-service-management-l1-1-0.dll differ diff --git a/api-ms-win-service-management-l2-1-0.dll b/api-ms-win-service-management-l2-1-0.dll new file mode 100644 index 0000000..3d47731 Binary files /dev/null and b/api-ms-win-service-management-l2-1-0.dll differ diff --git a/api-ms-win-service-private-l1-1-0.dll b/api-ms-win-service-private-l1-1-0.dll new file mode 100644 index 0000000..d1131b6 Binary files /dev/null and b/api-ms-win-service-private-l1-1-0.dll differ diff --git a/api-ms-win-service-private-l1-1-1.dll b/api-ms-win-service-private-l1-1-1.dll new file mode 100644 index 0000000..bc6c6bf Binary files /dev/null and b/api-ms-win-service-private-l1-1-1.dll differ diff --git a/api-ms-win-service-winsvc-l1-1-0.dll b/api-ms-win-service-winsvc-l1-1-0.dll new file mode 100644 index 0000000..bb6298d Binary files /dev/null and b/api-ms-win-service-winsvc-l1-1-0.dll differ diff --git a/d3dcompiler_43.dll b/d3dcompiler_43.dll new file mode 100644 index 0000000..ab96161 Binary files /dev/null and b/d3dcompiler_43.dll differ diff --git a/d3dcompiler_47.dll b/d3dcompiler_47.dll new file mode 100644 index 0000000..efd0813 Binary files /dev/null and b/d3dcompiler_47.dll differ diff --git a/designer/examples/ListBox/e_listbox.tpj b/designer/examples/ListBox/e_listbox.tpj new file mode 100644 index 0000000..c4f2e88 --- /dev/null +++ b/designer/examples/ListBox/e_listbox.tpj @@ -0,0 +1,18 @@ +array( + "name":"e_listbox", + "version":"1.2.0", + "dir":( + ), + "files":( + "e_listboxmain":( + "name":"e_listboxmain", + "type":"form" + ), + "e_listbox":( + "name":"e_listbox", + "type":"tsl" + ) + ), + "mainform":"e_listboxmain", + "time":"2021-02-03 11:10:32" +) \ No newline at end of file diff --git a/designer/examples/ListBox/e_listbox.tsl b/designer/examples/ListBox/e_listbox.tsl new file mode 100644 index 0000000..e23df44 --- /dev/null +++ b/designer/examples/ListBox/e_listbox.tsl @@ -0,0 +1,6 @@ +//E_ListBox +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_ListBoxmain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/ListBox/e_listboxmain.tsf b/designer/examples/ListBox/e_listboxmain.tsf new file mode 100644 index 0000000..a454ca7 --- /dev/null +++ b/designer/examples/ListBox/e_listboxmain.tsf @@ -0,0 +1,94 @@ +type E_ListBoxmain=class(tdcreateform) + uses tslvcl; + listbox1:tlistbox; + btn1:tbtn; + btn2:tbtn; + btn3:tbtn; + btn4:tbtn; + btn5:tbtn; + btn6:tbtn; + function Create(AOwner);override; // + begin + inherited; + end + function btn6_clk(o;e);virtual; //ѡǰѡĺһ + begin + if listbox1.Multisel=0 then + begin + idx := listbox1.getCurrentSelection(); + nidx := (idx+1+listbox1.ItemCount) mod listbox1.ItemCount; + listbox1.setCurrentSelection(nidx); + end + end + function btn5_clk(o;e);virtual; //ѡǰ + begin + listbox1.insertItem(datetimetostr(now()),listbox1.getCurrentSelection()); + end + + function btn4_clk(o;e);virtual; // + begin + listbox1.appendItem(datetimetostr(now())); + end + function btn3_clk(o;e);virtual; //ѡѡ + begin + if o.caption="ѡ/(ѡ)" then + begin + listbox1.Multisel := 1; + o.caption :="(ѡ)/ѡ"; + end else + begin + listbox1.Multisel := 0; + o.caption :="ѡ/(ѡ)" + end + end + + function btn2_clk(o;e);virtual; //ɾѡ + begin + listbox1.DeleteSelectedItems(); + end + function btn1_clk(o;e);virtual; //ʼ + begin + InitListData(); + end + function InitListData(); + begin + listbox1.Items := array( + "", + "", + "ƺɽ", + "", + "ر", + "", + "", + "ɽ", + "", + "ɽ" + ); + end + function e_listboxmain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end +end diff --git a/designer/examples/ListBox/resource.tfm/e_listboxmain.tfm b/designer/examples/ListBox/resource.tfm/e_listboxmain.tfm new file mode 100644 index 0000000..ffdfc73 --- /dev/null +++ b/designer/examples/ListBox/resource.tfm/e_listboxmain.tfm @@ -0,0 +1,53 @@ +object e_listboxmain1:e_listboxmain + caption="ListBox " + height=585 + left=374 + onclose=e_listboxmain1_close + top=189 + width=559 + object listbox1:tlistbox + caption="listbox1" + height=526 + left=6 + top=12 + width=400 + end + object btn1:tbtn + caption="óʼֵ" + height=31 + left=416 + onclick=btn1_clk + top=34 + width=94 + end + object btn2:tbtn + caption="ɾѡ" + left=419 + onclick=btn2_clk + top=83 + end + object btn3:tbtn + caption="ѡ/(ѡ)" + left=419 + onclick=btn3_clk + top=134 + end + object btn4:tbtn + caption="׷һ" + left=419 + onclick=btn4_clk + top=187 + end + object btn5:tbtn + caption="" + left=419 + onclick=btn5_clk + top=238 + end + object btn6:tbtn + caption="ѡһ" + left=420 + onclick=btn6_clk + top=289 + end +end \ No newline at end of file diff --git a/designer/examples/ListView/e_listview.tpj b/designer/examples/ListView/e_listview.tpj new file mode 100644 index 0000000..a725ca9 --- /dev/null +++ b/designer/examples/ListView/e_listview.tpj @@ -0,0 +1,18 @@ +array( + "name":"e_listview", + "version":"1.2.0", + "dir":( + ), + "files":( + "e_listviewmain":( + "name":"e_listviewmain", + "type":"form" + ), + "e_listview":( + "name":"e_listview", + "type":"tsl" + ) + ), + "mainform":"e_listviewmain", + "time":"2021-02-09 16:30:48" +) \ No newline at end of file diff --git a/designer/examples/ListView/e_listview.tsl b/designer/examples/ListView/e_listview.tsl new file mode 100644 index 0000000..65a7834 --- /dev/null +++ b/designer/examples/ListView/e_listview.tsl @@ -0,0 +1,6 @@ +//E_Listview +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_Listviewmain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/ListView/e_listviewmain.tsf b/designer/examples/ListView/e_listviewmain.tsf new file mode 100644 index 0000000..9ac2a4d --- /dev/null +++ b/designer/examples/ListView/e_listviewmain.tsf @@ -0,0 +1,105 @@ +type E_Listviewmain=class(tdcreateform) + uses tslvcl; + + listview1:tlistview; + btn1:tbtn; + btn2:tbtn; + btn3:tbtn; + btn4:tbtn; + btn5:tbtn; + btn6:tbtn; + btn7:tbtn; + btn8:tbtn; + function Create(AOwner);override; // + begin + inherited; + end + + + + + function btn8_clk(o;e);virtual; + begin + Messageboxa(tostn(listview1.SelectedValue),"ѡ",0,self); + + end + + function btn7_clk(o;e);virtual; + begin + Messageboxa(tostn(listview1.ListValues),"",0,self); + + end + + function btn6_clk(o;e);virtual; // + begin + listview1.InsertItem(array(0,datetimetostr(now())),listview1.SelectedId); + ModifyIndex(); + end + + function btn4_clk(o;e);virtual; // + begin + listview1.DeleteAllColumns(); + end + + function btn3_clk(o;e);virtual; //ɾ + begin + listview1.DeleteAllItems(); + end + function btn2_clk(o;e);virtual; //ɾѡ + begin + listview1.deleteselect(); + ModifyIndex(); + end + + function btn1_clk(o;e);virtual; //׷һ + begin + listview1.appendItem(array(listview1.ItemCount+1,datetimetostr(now()))); + end + function btn5_clk(o;e);virtual; //ʼ + begin + listview1.Columns := array(("text":"id"),("text":"value","width":260)); + listview1.DeleteAllItems(); + d := array((1,""), + (2,"ɽ"), + (3,""), + (4,""), + (5,"޺"), + (6,"") + ); + listview1.Appenditems(d); + + end + function e_listviewmain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end + function ModifyIndex(); // + begin + for i := 0 to listview1.ItemCount-1 do + begin + listview1.SetSubItemByIndex(i,0,i+1); + end + end +end diff --git a/designer/examples/ListView/resource.tfm/e_listviewmain.tfm b/designer/examples/ListView/resource.tfm/e_listviewmain.tfm new file mode 100644 index 0000000..5d8d214 --- /dev/null +++ b/designer/examples/ListView/resource.tfm/e_listviewmain.tfm @@ -0,0 +1,89 @@ +object e_listviewmain1:e_listviewmain + caption="Listview" + height=608 + left=434 + minmaxbox=false + onclose=e_listviewmain1_close + top=248 + width=728 + wssizebox=false + object listview1:tlistview + columns= [< + width=80 + text="id" + > + < + width=280 + text="value" + > + ] + height=532 + left=17 + top=17 + width=384 + end + object btn1:tbtn + caption="׷" + height=31 + left=432 + onclick=btn1_clk + top=168 + width=233 + end + object btn2:tbtn + caption="ɾѡ" + height=31 + left=431 + onclick=btn2_clk + top=221 + width=233 + end + object btn3:tbtn + caption="" + height=31 + left=432 + onclick=btn3_clk + top=275 + width=232 + end + object btn4:tbtn + caption="ݺ" + height=31 + left=431 + onclick=btn4_clk + top=330 + width=233 + end + object btn5:tbtn + caption="ʼ" + height=31 + left=431 + onclick=btn5_clk + top=73 + width=229 + end + object btn6:tbtn + caption="ѡλò" + height=31 + left=432 + onclick=btn6_clk + top=125 + width=226 + end + object btn7:tbtn + caption="" + height=31 + left=429 + onclick=btn7_clk + top=381 + width=235 + end + object btn8:tbtn + caption="ѡ" + height=31 + left=431 + onclick=btn8_clk + top=428 + width=232 + end +end \ No newline at end of file diff --git a/designer/examples/TreeView/e_treeview.tpj b/designer/examples/TreeView/e_treeview.tpj new file mode 100644 index 0000000..f65a933 --- /dev/null +++ b/designer/examples/TreeView/e_treeview.tpj @@ -0,0 +1,18 @@ +array( + "name":"e_treeview", + "version":"1.2.0", + "dir":( + ), + "files":( + "e_treeviewmain":( + "name":"e_treeviewmain", + "type":"form" + ), + "e_treeview":( + "name":"e_treeview", + "type":"tsl" + ) + ), + "mainform":"e_treeviewmain", + "time":"2021-02-18 10:01:20" +) \ No newline at end of file diff --git a/designer/examples/TreeView/e_treeview.tsl b/designer/examples/TreeView/e_treeview.tsl new file mode 100644 index 0000000..282ff1a --- /dev/null +++ b/designer/examples/TreeView/e_treeview.tsl @@ -0,0 +1,6 @@ +//E_TreeView +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_TreeViewmain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/TreeView/e_treeviewmain.tsf b/designer/examples/TreeView/e_treeviewmain.tsf new file mode 100644 index 0000000..0f74537 --- /dev/null +++ b/designer/examples/TreeView/e_treeviewmain.tsf @@ -0,0 +1,119 @@ +type E_TreeViewmain=class(tdcreateform) + uses tslvcl; + treeview1:ttreeview; + btn1:tbtn; + btn2:tbtn; + btn3:tbtn; + btn4:tbtn; + btn5:tbtn; + btn6:tbtn; + btn7:tbtn; + btn8:tbtn; + function Create(AOwner);override; // + begin + inherited; + end + function btn8_clk(o;e);virtual; + begin + treeview1.HasLine := not treeview1.HasLine; + end + + function e_treeviewmain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + end + function btn7_clk(o;e);virtual; + begin + Messageboxa(tostn(treeview1.RootNode.toarray()),"",0,self); + end + function btn6_clk(o;e);virtual; //޸ı + begin + nd := treeview1.CurrentNode; + if not nd then return; + r := nd.caption; + wd := new TInPutQuerys(self); + wd.parent := self; + d := array(("Name":"b","value":r,"caption":":")); + wd.SetData(d); + if wd.ShowDlg(r1,"") then + begin + nd.caption := r1["b"]; + treeview1.InvalidateItem(nd); + end + end + + function btn4_clk(o;e);virtual;//checkbox + begin + treeview1.checkbox := not treeview1.checkbox; + treeview1.InvalidateRect(nil,false); + end + function btn5_clk(o;e);virtual; //ɾѡ + begin + nd := treeview1.CurrentNode; + if nd then + begin + nd.Recycling(); + end + end + function btn3_clk(o;e);virtual;//ӽڵ + begin + nd := treeview1.CurrentNode; + if nd then + begin + nnd := treeview1.CreateTreeNode(); + nnd.caption := datetimetostr(now()); + nnd.parent := nd; + treeview1.SetSel(nnd); + end + end + function btn2_clk(o;e);virtual; //ʼ + begin + rnd := treeview1.RootNode; + ndsz := treeview1.CreateTreeNode(); + ndsz.caption := ""; + ndsz.parent := rnd; + ndgz := treeview1.CreateTreeNode(); + ndgz.caption := ""; + ndgz.parent := rnd; + + for i,v in array("","޺","","","") do + begin + nd := treeview1.CreateTreeNode(); + nd.caption := v; + nd.parent := ndsz; + end + for i,v in array("","","") do + begin + nd := treeview1.CreateTreeNode(); + nd.caption := v; + nd.parent := ndgz; + end + + end + function btn1_clk(o;e);virtual; // + begin + treeview1.RootNode.RecyclingChildren(); + end + + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end +end diff --git a/designer/examples/TreeView/resource.tfm/e_treeviewmain.tfm b/designer/examples/TreeView/resource.tfm/e_treeviewmain.tfm new file mode 100644 index 0000000..75375ab --- /dev/null +++ b/designer/examples/TreeView/resource.tfm/e_treeviewmain.tfm @@ -0,0 +1,81 @@ +object e_treeviewmain1:e_treeviewmain + caption="ؼ" + height=520.0 + left=483 + minmaxbox=false + onclose=e_treeviewmain1_close + top=258 + width=632 + wssizebox=false + object treeview1:ttreeview + caption="treeview1" + height=420 + left=15 + top=26 + width=371 + end + object btn1:tbtn + caption="" + height=31 + left=418 + onclick=btn1_clk + top=412 + width=153 + end + object btn2:tbtn + caption="ʼ" + height=31 + left=418 + onclick=btn2_clk + top=38 + width=155 + end + object btn3:tbtn + caption="ӽڵ" + height=31 + left=420 + onclick=btn3_clk + top=91 + width=152 + end + object btn4:tbtn + caption="checkbox" + height=31 + left=418 + onclick=btn4_clk + top=204 + width=152 + end + object btn5:tbtn + caption="ɾѡڵ" + height=31 + left=420 + onclick=btn5_clk + top=148 + width=150 + end + object btn6:tbtn + caption="޸ѡнڵı" + height=31 + left=420 + onclick=btn6_clk + top=308 + width=151 + end + object btn7:tbtn + caption="" + height=31 + left=419 + onclick=btn7_clk + top=360 + width=151 + end + object btn8:tbtn + caption="hasline" + height=31 + left=419 + onclick=btn8_clk + top=259 + width=150 + end +end \ No newline at end of file diff --git a/designer/examples/action/atsl.tsl b/designer/examples/action/atsl.tsl new file mode 100644 index 0000000..4fb5cbc --- /dev/null +++ b/designer/examples/action/atsl.tsl @@ -0,0 +1 @@ +//tsl script :atsl diff --git a/designer/examples/action/e_action.tpj b/designer/examples/action/e_action.tpj new file mode 100644 index 0000000..0755993 --- /dev/null +++ b/designer/examples/action/e_action.tpj @@ -0,0 +1,27 @@ +array( + "name":"e_action", + "version":"1.1.2", + "dir":( + ), + "files":( + "e_actionmain":( + "name":"e_actionmain", + "type":"form", + "dir":"" + ), + "e_action":( + "name":"e_action", + "type":"tsl", + "dir":"" + ), + "atsl":( + "name":"atsl", + "type":"tsl", + "dir":"" + ) + ), + "mainform":"e_actionmain", + "entryscript":"e_action", + "time":"2022-04-08 14:37:00", + "commandline":"\"$(TSL_EXE)\" \"$(FULL_CURRENT_PATH)\" -libpath \"$(SEARCH_PATH)\\;\"" +) \ No newline at end of file diff --git a/designer/examples/action/e_action.tsl b/designer/examples/action/e_action.tsl new file mode 100644 index 0000000..7e0b2ca --- /dev/null +++ b/designer/examples/action/e_action.tsl @@ -0,0 +1,6 @@ +//E_Action +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_Actionmain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/action/e_actionmain.tsf b/designer/examples/action/e_actionmain.tsf new file mode 100644 index 0000000..4fe2330 --- /dev/null +++ b/designer/examples/action/e_actionmain.tsf @@ -0,0 +1,53 @@ +type E_Actionmain=class(tdcreateform) + uses tslvcl; + btn1:tbtn; + actionlist1:tactionlist; + action1:taction; + btn2:tbtn; + btn3:tbtn; + btn4:tbtn; + btn5:tbtn; + popupmenu1:tpopupmenu; + menu1:tmenu; + btn6:tbtn; + function Create(AOwner);override; // + begin + inherited; + end + function btn5_clk(o;e);virtual; //޸caption + begin + action1.caption := datetimetostr(now()); + end + function btn6_clk(o;e);virtual; //޸enabled״̬ + begin + action1.Enabled := not action1.Enabled; + end + function e_actionmain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end +end + + diff --git a/designer/examples/action/resource.tfm/e_actionmain.tfm b/designer/examples/action/resource.tfm/e_actionmain.tfm new file mode 100644 index 0000000..316727e --- /dev/null +++ b/designer/examples/action/resource.tfm/e_actionmain.tfm @@ -0,0 +1,76 @@ +object e_actionmain1:e_actionmain + caption="action " + height=520.0 + left=451 + onclose=e_actionmain1_close + popupmenu=popupmenu1 + top=256 + width=510 + object btn1:tbtn + action=action1 + caption="btn1" + height=31 + left=25 + onclick=btn1_clk + top=67 + width=163 + end + object actionlist1:tactionlist + left=225 + top=189 + object action1:taction + caption="actionĿؼ" + enabled=true + end + end + object btn2:tbtn + action=action1 + caption="btn2" + height=31 + left=25 + onclick=btn2_clk + top=126 + width=163 + end + object btn3:tbtn + action=action1 + caption="btn3" + height=31 + left=25 + top=182 + width=162 + end + object btn4:tbtn + action=action1 + caption="btn4" + height=31 + left=27 + top=241 + width=161 + end + object btn5:tbtn + caption="޸actioncaption" + height=31 + left=280 + onclick=btn5_clk + top=98 + width=140 + end + object popupmenu1:tpopupmenu + left=162 + top=329 + caption="popupmenu1" + object menu1:tmenu + action=action1 + caption="menu1" + end + end + object btn6:tbtn + caption="޸action enabed" + height=31 + left=281 + onclick=btn6_clk + top=248 + width=143 + end +end \ No newline at end of file diff --git a/designer/examples/menu/e_menu.tpj b/designer/examples/menu/e_menu.tpj new file mode 100644 index 0000000..2a43778 --- /dev/null +++ b/designer/examples/menu/e_menu.tpj @@ -0,0 +1,18 @@ +array( + "name":"e_menu", + "version":"1.2.0", + "dir":( + ), + "files":( + "e_menumain":( + "name":"e_menumain", + "type":"form" + ), + "e_menu":( + "name":"e_menu", + "type":"tsl" + ) + ), + "mainform":"e_menumain", + "time":"2021-02-18 11:07:09" +) \ No newline at end of file diff --git a/designer/examples/menu/e_menu.tsl b/designer/examples/menu/e_menu.tsl new file mode 100644 index 0000000..8ed2486 --- /dev/null +++ b/designer/examples/menu/e_menu.tsl @@ -0,0 +1,6 @@ +//E_Menu +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_Menumain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/menu/e_menumain.tsf b/designer/examples/menu/e_menumain.tsf new file mode 100644 index 0000000..69cbab9 --- /dev/null +++ b/designer/examples/menu/e_menumain.tsf @@ -0,0 +1,45 @@ +type E_Menumain=class(tdcreateform) + uses tslvcl; + mainmenu1:tmainmenu; + menu1:tmenu; + menu2:tmenu; + menu3:tmenu; + menu4:tmenu; + menu5:tmenu; + popupmenu1:tpopupmenu; + menu6:tmenu; + menu7:tmenu; + function Create(AOwner);override; // + begin + inherited; + end + function Menuclick(o,e);//˵ + begin + messageboxa(format("˵:%s ",o.caption),"˵:",0,self); + end + function e_menumain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end +end diff --git a/designer/examples/menu/resource.tfm/e_menumain.tfm b/designer/examples/menu/resource.tfm/e_menumain.tfm new file mode 100644 index 0000000..33dfc4a --- /dev/null +++ b/designer/examples/menu/resource.tfm/e_menumain.tfm @@ -0,0 +1,101 @@ +object e_menumain1:e_menumain + caption="˵" + height=392 + left=488 + mainmenu=mainmenu1 + onclose=e_menumain1_close + popupmenu=popupmenu1 + top=220 + width=375 + object mainmenu1:tmainmenu + left=58 + top=73 + height=30 + width=30 + object menu1:tmenu + caption="menu1" + object menu3:tmenu + caption="˵3" + onclick=menuclick + end + object menu4:tmenu + caption="menu4" + object menu5:tmenu + caption="menu5" + onclick=menuclick + end + end + end + object menu2:tmenu + caption="menu2" + onclick=menuclick + end + end + object popupmenu1:tpopupmenu + left=172 + top=98 + height=30 + width=30 + caption="popupmenu1" + object menu6:tmenu + bitmap={ 0502000000060400000074797065000203000000696D670006040000006461746 + 100020103000089504E470D0A1A0A0000000D4948445200000020000000200806 + 000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 + BFC6105000000097048597300000EC300000EC301C76FA8640000029649444154 + 5847ED964B68135114865D894BC1951BE946A42B752356505C54042D882E846A5 + BA13B6B151491D295B4882B2D08E293D6422D55918AF5416AC5A22008BAD085D4 + 5A6D9A986812E3249989B1769263FEDB7BAF379957122DA5900F0EC99C398F7FE + 69E99B9CB689159FA02326F5FD3B7CE760AECAF67BFC6D8437EA634FE49803E3A + 4293B5AB6862CDF2020B1F3BC423BCF114103BDF455AFF2532E331EEF9CBCCBEE + DACE174FD061687C64284F1CCC7A3DC2910F0BDA79B12B76EF0A379444158A071 + 27690357C94CFC60E770DBD17C76F23D3B065F5AF7B2D868F729EE71470A885FB + F201B850E37CAA210E56FA893E784059A765162A897B27A8AC509D098D5686FE6 + 1E77A480ACA153B0A54136800895F4AB17143DDB49D33B36CA1866352B2898BFE + AE4DD01CAFD4C33C1F063494AC13203C6D347ECD6A65F8E738F15E3F918454E9F + A0CFDB6A0BC47C58B792426D0728393C48B95F191EED8EE7107A618CFBE86B471 + B4D6DAA2910F371FD6A0A1F6FA5D4C81D22738E475B910252F786D8731CE93AC9 + 3DE5A3E7DF01688AE6AA18888348FDC903A25C8E47CF2305A80973A120F75A316 + 311FECF1DDD779FC2475BD8B2A8B5B16CEA7C48017883C52F9FCBDFD251EEB1F2 + 3BE867457035E5907A3C4CA12307D9C0223F71BB9F9F71980134FAB465ADE551C + 260A20086B45250437D746D05884630153701D1331DB6F3632635CABC7BC38FAC + FC3701221E312AFEDD9B995F7D5BAA2CB80027BFA02AA02AA02A606909C8EA49B + 9FF2B061B98E24D0CA848C0ECD4844CC477A152C4C70BE6F43AB6150066F66C65 + 89F12B3DDC533EC81502C446B6184701DACD6B32195F46AC7B39861C91EFF6F97 + 61400B0D6A248A5A6F55DE4D5EC711500B08ED840408C9D61176C67C829657E3C + 052C348B2C80E80FBF5E212863E9B00A0000000049454E44AE42608200 } + caption="menu6" + onclick=menuclick + end + object menu7:tmenu + bitmap={ 0502000000060400000074797065000203000000696D670006040000006461746 + 100024503000089504E470D0A1A0A0000000D4948445200000020000000200806 + 000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 + BFC6105000000097048597300000EC300000EC301C76FA864000002DA49444154 + 5847C597BD6A54411886BD066BADD45E11BC01116C6C142F402C2CAC44112C949 + 47A031606B7515288918022A8202EF107D42A0988C4D5603624EBAE68B2C6282A + 9FFB8CE73D993D993973768DF8C040767EDF39F3CDFB4DB6D87F66200193CDAF7 + 6A6FEC1F6DF7C6FBBAFCDD9B6D1866DEF95BDD7E7ECE0AD79BBF0B46D77DF7DB1 + C5D59FD9883449012BDF7FD995A94F6ED1AD97672B9791671DEBACA585940AB8F + 8BC637B7A3BF527DE596BD8A189A69D7BDCB61BAF576C7CB66B23BD9D1FB9BD60 + BB6A6FFBFAEE1B9BB3B157CBD96C61A2022EBDF8D837D9F9276D9BEE7CCB5AE3C + CF4FA9CAEB7FAC69E7CD8CA5A37121470F4CE423E78C7D586D5E757B396EAD466 + 965D7C681EE60CB141006A35E8C483A5AC76780EF78E46F371A445FA04705EEAC + CC014A71EB55C49C14662227201442C4143273E5D8A63F716F349F93B0547495F + 829A9B2572015C1B4DC8F995E12FAE9212411CA92FD75A380118871A89E032428 + BABA4447093E887A7082700F7D2245CA318FEE2136FBAC1BFCB44708DD50F5705 + 27000BA5122389515C1CF41BAA8AC0C8E883A58313808F53899B85082D0EAA135 + 544E0A2B4EB189C00920995586A11DF17FCC541F53EBE88900362E1B491CCC009 + 9063E1EB451045E7E2E2A0858A48446843E40FDAC8A4E004F02326A08C9880322 + 4405EE304B0432A438ACB1846808E8063072740B93E1684318611A02024F0C109 + 9041945DC310C308D0353C3BE95DC3974B6BF964654654645001BE1129DE9C003 + 830FEC70B5256EC33A8007D694AB3FBC3D5E50248106A4C2523A1FE55F0931189 + 4FE40248917AFF5549C7308800A56352BEFF58CD05008F054D5AE54142445352F + 80F92A2D7F40980E3F7D77D7FB39F64A3539FB3DA75360800DD55CA663D4A635F + 2A280050ABC194BF7996F35563440500E7A577A2CA20FF9810D4A197B04FA9002 + 062FDF7629582A770ADFDC7678CA4008171B05B2C141F279970C664529219F984 + 63C25507A1B2807F83D96FD95753C0FE2C3C9B0000000049454E44AE42608200 } + caption="menu7" + onclick=menuclick + end + end +end \ No newline at end of file diff --git a/designer/examples/toolbar/e_toolbar.tpj b/designer/examples/toolbar/e_toolbar.tpj new file mode 100644 index 0000000..322743c --- /dev/null +++ b/designer/examples/toolbar/e_toolbar.tpj @@ -0,0 +1,18 @@ +array( + "name":"e_toolbar", + "version":"1.2.0", + "dir":( + ), + "files":( + "e_toolbarmain":( + "name":"e_toolbarmain", + "type":"form" + ), + "e_toolbar":( + "name":"e_toolbar", + "type":"tsl" + ) + ), + "mainform":"e_toolbarmain", + "time":"2021-02-18 10:41:29" +) \ No newline at end of file diff --git a/designer/examples/toolbar/e_toolbar.tsl b/designer/examples/toolbar/e_toolbar.tsl new file mode 100644 index 0000000..9d1465f --- /dev/null +++ b/designer/examples/toolbar/e_toolbar.tsl @@ -0,0 +1,6 @@ +//E_Toolbar +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(E_Toolbarmain),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ diff --git a/designer/examples/toolbar/e_toolbarmain.tsf b/designer/examples/toolbar/e_toolbarmain.tsf new file mode 100644 index 0000000..57f917f --- /dev/null +++ b/designer/examples/toolbar/e_toolbarmain.tsf @@ -0,0 +1,43 @@ +type E_Toolbarmain=class(tdcreateform) + uses tslvcl; + toolbar1:ttoolbar; + controlimagelist1:tcontrolimagelist; + toolbutton1:ttoolbutton; + toolbutton2:ttoolbutton; + toolbutton3:ttoolbutton; + toolbutton4:ttoolbutton; + toolbutton5:ttoolbutton; + function Create(AOwner);override; // + begin + inherited; + end + function ToolbarItemClick(o,e);//item + begin + Messageboxa(format("ť:%s ",o.caption),"",0,self); + end + function e_toolbarmain1_close(o;e);virtual; + begin + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + invoke(self,v["name"],nil); + end + end +end diff --git a/designer/examples/toolbar/resource.tfm/e_toolbarmain.tfm b/designer/examples/toolbar/resource.tfm/e_toolbarmain.tfm new file mode 100644 index 0000000..34ad42d --- /dev/null +++ b/designer/examples/toolbar/resource.tfm/e_toolbarmain.tfm @@ -0,0 +1,168 @@ +object e_toolbarmain1:e_toolbarmain + caption="" + height=520.0 + left=429 + onclose=e_toolbarmain1_close + top=236 + width=664 + object toolbar1:ttoolbar + caption="toolbar1" + height=29 + imagelist=controlimagelist1 + width=648 + object toolbutton1:ttoolbutton + caption="ť1" + imageid=0 + onclick=toolbaritemclick + end + object toolbutton2:ttoolbutton + caption="ť2" + imageid=1 + onclick=toolbaritemclick + end + object toolbutton3:ttoolbutton + caption="ť3" + imageid=2 + onclick=toolbaritemclick + end + object toolbutton4:ttoolbutton + caption="toolbutton4" + imageid=4 + onclick=toolbaritemclick + end + object toolbutton5:ttoolbutton + caption="toolbutton5" + imageid=3 + onclick=toolbaritemclick + end + end + object controlimagelist1:tcontrolimagelist + left=84 + top=114 + images={ 0502000000060400000074797065000204000000626D707300060500000069746 + 56D73000505000000000000000005020000000604000000747970650002030000 + 00696D670006040000006461746100029F02000089504E470D0A1A0A0000000D4 + 948445200000020000000200806000000737A7AF4000000017352474200AECE1C + E90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC + 301C76FA86400000234494441545847ED96CDCB69511487EF5F6BC25061A048C9 + 409181C840182829C554664AEFC04C0C0C64A0440626C8E0DC9E75D73E6DC7E1E + 55EEE3BF1D41A9CB5D6DEFB77F6C7DAFB97F3C37C047C045C08C866B34E201078 + DA686768341ABE39582C1693B8CD4B056CB75BDFB8D77ABD9EE4C34B9760381CC + A00D56A553D97CC663389472211F5BC588099C16EB7AB9E4BCEE7B3C483C1A07A + 3C0268C83A91F4B7964C269DC3E1A03D5EB2DFEF25271C0EABC712C0BA783B7BD + 6CAE5B233994CB4C76BD6EBB5E4C5E371F55802581782ACD3BB582C1632463A9D + 568F2520140A49F0743AA9E7F54CA753192397CBA9C712108D4625B8DBEDD4F31 + 85F5F5FCE6834D2AFFB8CC76319A3542AA9C712904AA524B85C2ED5F318DFED7C + 1B734C6BB59A7A2C01F97C5E82F736911FABD5CA4924120F89E8F7FB92D76AB5D + 46309A8542A12644A6FC1F16293FA99116157392FE6A4D9425D01CD66538283C1 + 403DD79829FCCE10E4077F4E9C9930B802FCD479A1D613B78D7658A15090F6C56 + 251B3AF61EDC9E1470CAE00FE9C2033F12CF57A5DDAB28F8EC7A37AAF61F793C7 + 6930B802587B82EC8567E8743AD22E93C948A9BD07E79F5CEA81C115C0EE377FF + 128F3F95CDA50FF379B8D7A6F4305249F8A68700570FE09520F9E816378EBF2F1 + C21DC018DC0906570015902015F15D700B3286BD54AE00EE0082DC09EF8277006 + 3F02E30B802E09D37227DD2B7FD1A820B019C6B92DE69ED765B47FBC3850040C4 + BFBE8AFC8C3E79B078B912F0BFF908F861018EF31BE3A64DABEA5772560000000 + 049454E44AE426082000001000000050200000006040000007479706500020300 + 0000696D67000604000000646174610002D303000089504E470D0A1A0A0000000 + D49484452000000300000003008060000005702F987000000017352474200AECE + 1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000 + EC301C76FA86400000368494441546843ED98DB4B14511CC7FB837AEB35287A08 + 0A8A1E844088EA2108C948222822BAA0629682742122C9D0BC84B5A246E135EFB + AAEAB99AD46522A5B5E482C5371E7F66DCECE6FDCD9F1CCECCD7194F6035FD839 + F33D737EDFD939672E7BB0CB4907709B74002EBF2781BA1380AF981A9CC39900A + 3CF80B2BD9A825DD4E80CD60116C781F76781E6F3407B0ED07915E8BD050CE403 + 83F701FF03400E91D904EBA70718794C8D26E687D4639400DE42A03F0FE8BE017 + 45C01DAB281A6735ADBCA2C99ADB10E507B3852044FC38FC8C8C118C0CEC74E8E + F198668D9591D11AEB00BC031AB530A2F9E687B5B3CCC48A653207304BE75369F + 431CD327A2D482E407D069954DE66F23D769A6ED6FA2E06F8FB753916C0B8BAD4 + 1CE47BEC345E499D553CC7F81E26C702B009AE136BAEF0642CCC5BC0F7303912C + 0739C0CC4DF2030EB4D4C46D8366F1C266702A87FF95632DDC21F87C99100E5FB + B4FB81F9AC26A3892AE0F511FE384C8ECD81ED523A80DB4A07705BE900B1F4EA9 + 0F640C65B22EDE4BDCB3F9E598E07E8CB257312189F58ADE47880EEEB644E1061 + 75870460626F506CA04414EF2338F3C6E03F9FC44E2B1D201EB117733650228A6 + 70233316F0C520BD0758DCC49102B04BB57C4416A01D87B41B2D8050854904943 + 595A53975E99B6A249FD12B25B46F5CF2D66597D0FAADA0FCCB453012A7FD6211 + 67E4028A31CA153D5106BE8538E819D33891B4F024B5F69700DB1C2AF156F90DC + 33457B35764600F6E992DD9D09A92100B1A43BFC5B2CEE8C0A209CA98132F92BB + C8FE17E005F110DA8A228109F0E6C142B95F9A02CAC40C8AE8B0A2116755207B7 + 034C54D3606AED3F9721DC6E8E2A9489FD1BF2F08F4DED3AEE04A83E0004B54B8 + 4C10A14B23C9B8AD425F74D43F28C6D6C4BE57EEAE95680858F34885AFCBB2F51 + C572755ABDEE3FCF417CD803E9C510F5D4D8FE006F8ED200EA65E30B42BCD9145 + E1EB9851B245CAA8732B3443D236C7F00C34B9058EA8570B911CAE22AC47B1DDC + C299C4DC56286B02F58AC6850077680035405EAB56A05A3C96D7C361CCC54B4FF + AC9CDC73A40DB457E01A9AA258B0600421722CBA3F4D20F796C0EA1CCCA485BED + 2839ADB10EC0E0BD906F8508BD505D72D77708EA9C608F0D72C73772D9631FC06 + 1E4DE2948CF072116B443C8698090590531BF0D72609E1CB17135C056900EE036 + BB3C00F00FB4FD2774447C293D0000000049454E44AE426082000002000000050 + 2000000060400000074797065000203000000696D670006040000006461746100 + 02DB02000089504E470D0A1A0A0000000D4948445200000020000000200806000 + 000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0BFC + 6105000000097048597300000EC300000EC301C76FA8640000027049444154584 + 7D596CB6A2A411086CF0BBA72A3A851541414043722EE44111782BAF182260441 + B7826F6188E015DCB81111172AC4B55087BFE89E8CE3CCD8E6C484F341914A55F + 7F43F5D3DD5FEA15FE6FF13301C0EA95AAD92C7E32197CB45D1689452A914F5FB + 7DDA6EB762943ACA0276BB1D65B35972381CB6562814E870388859B7511230994 + C281C0EF3028944823A9D0EAD562B91253A1E8FD4EBF5C8EFF7F398582C46F3F9 + 5C64EDB92960B3D9F076E3C1E572993E3E3E44E61A942097CB69BBB15C2E45C69 + A9B02506F3CAC56AB89C86DBADD2ECF29954A22628DAD80E974CA0F72BBDDBC13 + AAA024B21CEFEFEF226A8EAD80F57A4DF1789CDFE85E702620A05EAFF3FFFBFD9 + E4EA713FB7A940EE13D542A150A8542D46AB558402693E15D808F9731F2ED02DA + ED362F260DE583C137DB495301AFAFAF6C5F452FC2E974F25F7C41665C09188D4 + 6DA64F85F65301868CF49A7D3743E9F45E6922B01B27630F8FFC2DBDB1B6F3BBA + A8155702D0DBA500F88FE642C0783CE6859F9E9ED8E023F6482E04BCBCBCF0A2C + D66930D3E62F780CF0EF3A4A121E5F37991BDE64280BC707091C0E023760FFAC5 + 8D66862660369BF1A060302822C43E62C8A9625C0CDD54DE0DC56251443FD1043 + C3F3F6B938D869C2A728E1E79A7F87C3E11F94413100804B4C946434E153947CF + 4D018BC582074422110EEA410C398C51C12800259017936509E489470B3522DB2 + AC6A820059899D9D7C002BC5E2F0F306BBDB235638C0AFA05AD4C0F0BC0AFDA46 + A3C1013392C9247FDF2A982D02ACBE06ED107E17560280D961FC5101D805E4D01 + D253F26006F2F4BA03F8C0F1360677ABE5D80F1329286BADBB6E2DFE2970510FD + 05E1AD4F7F1B5448FE0000000049454E44AE42608200000300000005020000000 + 60400000074797065000203000000696D67000604000000646174610002F80200 + 0089504E470D0A1A0A0000000D4948445200000020000000200806000000737A7 + AF4000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 00097048597300000EC300000EC301C76FA8640000028D494441545847C5973D6 + 814411480B7B25050045B259D8595A0A5550AB5B00A626163255A5A5B28B676E9 + 2C14091A8B84E01F88281844A208FE8128722268E7DE9D5E363197E4923CF79B9 + BB7EEE6CE9DD9BDD3FD608ED937F3E6BD9B7DF3DE6C209EB456D665E2735BC69E + B464FFDDA6EC996AC8D61BA169F4919D989D9799AFCB12AD6E582D374E073EB43 + A72F679243B26EB125CFF6EDA968950764FD5E5C0BDA669F491E9F8CEC9D0E8A0 + EB22D781F3AF1765FBCDAEE1C38F7ECA85370B3217AEDAD15E5E353A72F9FD2F3 + 912CF45075DD6C8E3AF0E1C9F6D9945F6CE34E46AAD6DA5FEA0832E6B1C7AF0C3 + 4A7BE9EBC0C87457F14CBC8DF5F6BA9516075DFD23BB6E85569AA5C70126A2C07 + 60F8B934FE7CD9AFCB1CD641C60AB9888C2B0E10FB1363B9226718060E9376198 + F04AB1910E4CE300C7858825680679E72E581B1BD8D2236A1CE0CCE259D1683FF + 73232AD08D8C0163621206B91388EC667B7282C442B0A3985C446760D489D2C32 + FE71C90EFB53D6818B6FBBF1466A0FC8DF3CD4A2353BEC4F5907C8A6E85157028 + AC8B6B8A094A1AC0340EDC0764025EB97207C18C4010A18B603CAE9C1FB4D2B2E + C6200E5045B16D1CE0218F53CF22B34BD76AD940EDE70073988B4E1E89036C03D + B9187462DEDD2BB5416DBE400632A73D592E415100804848B2B9F9692C54FCFD9 + 24629F01993E33D74512847A0CB94CB8B8F36DD9242DE61F7BDCBD74A4FB8C31C + 745E6186A22E226E3C38B7A47F6DD8E3DB7C6B52163CC07AD8C2611692AE61AE5 + CB978535197DF86707E823F325938A119429468B9D0DF3DE69F47DE92946FC545 + E8EA1D20B8952E9954CA9F452AA3011854AAEE58A2A123445AF6A800EBAAC51F8 + C3442158885816F9EF9F660AC785335BC9C7699A7FF3792EF21B1F1CB3C87955C + 3470000000049454E44AE42608200000400000005020000000604000000747970 + 65000203000000696D670006040000006461746100028E02000089504E470D0A1 + A0A0000000D4948445200000020000000200806000000737A7AF4000000017352 + 474200AECE1CE90000000467414D410000B18F0BFC61050000000970485973000 + 00EC300000EC301C76FA86400000223494441545847ED972DAB024114860D824D + 2C7693C560103409FA038C62B008828A3FC0EA57B268320882980D822206838A4 + 530F80BC42236ABC570EE3D7BE7EC9DFD9A9D5D96850BF78117768ECE99675777 + 56032049201080CD66C34662B2D92C9CCF673612232DF07ABD20994CB2D10FEFF + 71B2E970B7C3E1F56F9A1DFEFB3237BA4059056AB05F3F91CDAED36643219E5AA + 6082C120A4D369A8D7EB50AD56E1F97CB219F6480BDCEF77A8542AEAA25689442 + 2301C0ED92C7BA404F6FBBDE962A2148B45365B8CADC0E974825028A4344DA552 + 301E8F0D8BF1E16565246C054AA592DA1005ECAE06BE1E0E87D5F16432619DCC1 + 10ADC6E37F5ECDD06A5450805F01B6FD6D4691E8F07EB684428D068344C1B3A8D + 6853D208D0AD869F2372381C6C733C1EA582E0FE81E1D108C46231D57A3A9D42A + 7D3D19C89DBE009E11D41E372B9CC56E404F4DFEE5C2E07BD5E4F53731BB33B87 + F04560B7DB196A84A5403E9FF74C60BBDD1A6A842F02EBF5DA50237C11582E978 + 61A2114E876BB9A9ADB2C160B438DF04560B55A196A842F02FADE184228E0E546 + A4AF11BF47DFE0938BDE8093BC14A8D56AEA188F098DC0F57A85D168A44C4070D + FE61BB90DF6C3E7CC6C365382C78446408F9702560805F08A98357492783CCEBA + 99231440D01E9F0B187D73AAEB5FA3DA6030605DACB115E0E117C11028C9D7717 + 159FE05FE960036365B04FF0BF202FADF7D221C09E0CE98482494E81769369B10 + 8D46A15028B08A0C005F1ECEF59244AA69250000000049454E44AE42608200 } + end +end \ No newline at end of file diff --git a/designer/gettslediterstart.tsf b/designer/gettslediterstart.tsf new file mode 100644 index 0000000..e9a474f --- /dev/null +++ b/designer/gettslediterstart.tsf @@ -0,0 +1,228 @@ +//tsl༭ +uses tslvcl; +deletefuncacheini(); +//mtic ; +ops := ""; +GLobal G_OpenHostory; +G_OpenHostory := true; //Ĭϴʷ +hasinstance := true; // +for i:= 0 to sysparamcount() do +begin + if (i200) and ((FCurrentRect[2]-FCurrentRect[0])>200) then + BoundsRect := FCurrentRect; + end + + //_wapi.SetForegroundWindow(seLF.Handle); + end + inherited; + end + function CreateParams(p);override; + begin + inherited; + p.WinClassName := "tslediter_a_a_1"; + end + private + FCurrentRect; +end +function InStallToMenu(); //ע +begin + k1 := new TRegKey(class(TRegKey).HKEY_CLASSES_ROOT); + tek := k1.openKeyA("*\\shell\\tslediter"); + if not ifobj(tek) then + begin + return echo "Please run with administrator rights!!"; + end + tek.SetValueStringA(nil,"TSLر༭"); + tek.SetValueStringA("Icon",SysExecName()); + tc := tek.openKeyA("command"); + if not ifobj(tc) then + begin + echo "Please run with administrator rights!!"; + end else + begin + tc.SetValueStringA(nil,SysExecName()+ ' "%1"'); + bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter\\command"); + if bkcl then bkcl.SetValueStringA(nil,SysExecName()); + bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter"); + bkcl.SetValueStringA(nil,"TSL Editer"); + if bkcl then bkcl.SetValueStringA("Icon",SysExecName()); + echo "register tslediter ok ~~"; + end +end +function UnInStallToMenu(); //ж +begin + k1 := new TRegKey(class(TRegKey).HKEY_CLASSES_ROOT); + tc := k1.openKeyA("*\\shell"); + if not ifobj(tc) then + begin + echo "Please run with administrator rights!!"; + return; + end else + begin + if 0=tc.DeleteKeyA("tslediter\\command") then + begin + if 0=tc.DeleteKeyA("tslediter") then + begin + bkcl := k1.openKeyA("Directory\\Background\\shell"); + if ifobj(bkcl) then + begin + if 0=bkcl.DeleteKeyA("tslediter\\command") then + begin + if 0=bkcl.DeleteKeyA("tslediter") then + begin + end + end + end + echo "unregister tslediter ok~~"; + return ; + end + end + + echo "tslediter not installed~~"; + return ; + end +end +function deletefuncacheini(); +begin + plg := pluginpath(); + {$ifdef linux} + sp :="/"; + {$else} + sp := "\\"; + {$endif} + for i:= length(plg)-1 downto 1 do + begin + if plg[i]=sp then + begin + fn := plg[1:i]+"FunCache.ini"; + r := filedelete("",fn); + return r; + end + end +end +{$ifdef linux} +function PostMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer)begin end ; +function FindWindowA(lpClassName:string;lpWindowName:string)begin end ; +function GetCurrentDirectoryA(nBufferLength:integer; var lpBuffer:string)begin end ; +function TS_GetUserProfileHome()begin end ; +{$else} +function PostMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):integer;stdcall;external "User32.dll" name "PostMessageA"; +function FindWindowA(lpClassName:string;lpWindowName:string):pointer;stdcall;external "User32.dll" name "FindWindowA"; +function GetCurrentDirectoryA(nBufferLength:integer; var lpBuffer:string):integer;stdcall;external "Kernel32.dll" name "GetCurrentDirectoryA"; +function TS_GetUserProfileHome():string;cdecl;external "TSSVRAPI.dll" name "TS_GetUserProfileHome"; +{$endif} diff --git a/designer/gettslvcldesignerstart.tsf b/designer/gettslvcldesignerstart.tsf new file mode 100644 index 0000000..664461b --- /dev/null +++ b/designer/gettslvcldesignerstart.tsf @@ -0,0 +1,71 @@ +{ + tsl +} +uses tslvcl,tslvclDesigner; +deletefuncacheini(); +h := FindWindowA("tsluidesigner_a_a_1",nil); //Ψһ +if h then +begin + return PostMessageA(h,0x400,303,10); +end +app := InitializeApplication(); +app.createform(class(TVclDesignerStart),Desginer); +Desginer.Show(); +r := app.run(); +return r; +type TVclDesignerStart = class(TVclDesigner) //ʵΨһĴ + function create(AOwner); + begin + inherited; + end + function WMUSER(o,e):WM_USER;override; + begin + if e.wparam = 303 and e.lparam=10 then + begin + Show(SW_SHOWMINIMIZED); + PostMessageA(self.handle,WM_USER,303,12); + end + else if e.wparam = 303 and e.lparam=12 then + begin + Show(SW_SHOWNORMAL); + _wapi.bringWindowToTop(self.Handle); + end + inherited; + end + function CreateParams(p);override; + begin + inherited; + p.WinClassName := "tsluidesigner_a_a_1"; + end +end +function deletefuncacheini(); +begin + plg := pluginpath(); + {$ifdef linux} + sp :="/"; + {$else} + sp := "\\"; + {$endif} + for i:= length(plg)-1 downto 1 do + begin + if plg[i]=sp then + begin + fn := plg[1:i]+"FunCache.ini"; + r := filedelete("",fn); + return r; + end + end +end +{$ifdef linux} +function PostMessageA(); +begin +end +function FindWindowA(); +begin + +end +{$else} +function PostMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):integer;stdcall;external "User32.dll" name "PostMessageA"; //api +function FindWindowA(lpClassName:string;lpWindowName:string):pointer;stdcall;external "User32.dll" name "FindWindowA";//api +{$endif} + diff --git a/designer/tediterform.tsf b/designer/tediterform.tsf new file mode 100644 index 0000000..5ca068e --- /dev/null +++ b/designer/tediterform.tsf @@ -0,0 +1,1468 @@ +type TEditerForm = class(TVCform) //༭ + uses tslvcl,UTslSynMemo,UtslCodeEditor; + function WMACTIVATE(o,e):WM_ACTIVATE;override; // + begin + inherited; + if e.wparam then + begin + return _send_(WM_USER,50,60,1); + end + //inherited; + end + function WMUSER(o,e):WM_USER;override; + begin + if e.wparam=50 and e.lparam=60 then + begin + it := FEdter.GetCurrentItem(); + if it and it.FEditer then + begin + it.FEditer.SetFocus(); + end + return ; + end + inherited; + end + function editerinfo(); + begin + return "tslԱر༭\r\n汾:1.1.2\r\n:2022-03-22"; + end + function Create(AOwner);override; + begin + inherited ; + GLobal G_OpenHostory; + //////////////////Ŀ¼///////////////////// + {$ifdef linux} + basepath := ".vcl/tsl/"; + {$else} + basepath := TS_GetUserProfileHome(); + {$endif} + sp := ioFileseparator(); + FCache := basepath+"editer"+sp+"cmpCaches"; + FPathDirPath := basepath+"editer"+sp+"paths.tsm"; + Fexefilepath := basepath+"editer"+sp+"tslfile.tsm"; + FOpendpaths := basepath+"editer"+sp+"openedpaths.tsm"; + FTabWidthpath := basepath+"editer"+sp+"tabwidpath.tsm"; + FexefileCmds := basepath+"editer"+sp+"cmds.tsm"; + FHistoryPath := basepath+"editer"+sp+"HistoryPath.tsm"; + FCodeblockPath := basepath+"editer"+sp+"BlockManager.tsm"; + FFindhistroypath := basepath+"editer"+sp+"findhistory.tsm"; + FFormatpath := basepath+"editer"+sp+"tslformat.tsm"; + Fremotepath := basepath+"editer"+sp; + CreateDirWithFileName(basepath+"editer"+sp+"1.txt"); + CreateDirWithFileName(basepath+"editer"+sp+"cmpCaches"+sp+"1.txt"); + //TBlockManager + //echo "\r\n",FCache; + //////////////////////////////////////// + rc:=_wapi.GetScreenRect(); + SetBoundsRect(RC); + caption := "tsl༭"; + m := new TMainMenu(self); + ////////////////////////////////////////////// + FmTool := new TMenu(self); + FmTool.Caption := ""; + fmglobsearch := new TMenu(self); + fmglobsearch.caption := "־.."; + fmglobsearch.OnClick := function(o,e) + begin + FEDter.SwitchLogWnd(); + end + /////////////////////////////////////////////////////// + FEnCodeMenu := new TMenu(self); + FEnCodeMenu.Caption := ""; + FCodeMenus := array(); + for i,v in array("ANSI","UTF8","UTF8 BOM","UCS2-big","UCS2-little","----","תΪANSI","תΪUTF8","תΪUTF8 BOM","תΪUCS2-big","תΪUCS2-little") do + begin + it := new TMenu(self); + it.Caption := v; + FCodeMenus[i] := it; + if v="----" then it.TSeparator := true; + else + if v in array("UCS2-big","UCS2-little","UTF8 BOM") then + begin + it.Enabled := false; + end else + begin + it.OnClick := thisfunction(ClickEnCodeMenu); + end + it.Parent := FEnCodeMenu; + end + /////////////////////////////////////////////////////////////// + Fmopen := new TMenu(self); + Fmopen.caption := ""; + + Fmnew:= new TMenu(self); + Fmnew.caption := "½"; + Fmnew.OnClick := function(o,e) + begin + return FEdter.CreateAfile(); + end + FOpenOther := new TMenu(self); + FOpenOther.Caption := "ڴ"; + FOpenOther.OnClick := thisfunction(OpenInOtherWnd) ; + FOpenHistoryMenu := new TMenu(self); + FOpenHistoryMenu.caption := "ʷ"; + FOpenHistoryMenu.OnClick := function(o,e)begin + FEdter.ShowHistoryWnd(); + end + + //////////////////////////////////////////////////////////////////// + FTslLangMenu := new tmenu(self); + FTslLangMenu.Caption := ""; + + FTslFormatMenu := new tmenu(self); + FTslFormatMenu.Caption := "tslʽ"; + FTslFormatMenu.OnClick := function(o,e)begin + FFormatInfoWnd.show(); + end + FCodeBlockMenu := new TMenu(self); + FCodeBlockMenu.caption := "tsl"; + FCodeBlockMenu.OnClick := function(o,e)begin + fBlockManager.ShowModal(); + + end + + FMenuSet := new TMenu(self); + FMenuSet.caption := ""; + fmtslexepath := new TMenu(self); + if 1=importfile(ftstream(),"",Fexefilepath,tslexefile) then + begin + end else + begin + sexe := SysExecName(); + if ifstring(sexe) and sexe then + begin + for i:= length(sexe) downto 3 do + begin + if sexe[i]=sp then + begin + if sp="/" then sexe := sexe[1:i]+"TSL"; + else + sexe := sexe[1:i]+"tsl.exe"; + break; + end + end + tslexefile := sexe; + end + end + fBlockManager := new TBlockManager(self); + fBlockManager.WsDlgModalFrame := true; + fBlockManager.caption := ""; + fBlockManager.minmaxbox := false; + fBlockManager.Visible := false; + fBlockManager.Parent := self; + fBlockManager.SaveClick := function(o,e)begin + d := fBlockManager.GetData(); + Exportfile(ftstream(),"",FCodeblockPath,d); + fBlockManager.EndModal(); + class(TTSLCompletion).FCodeBlocks := d; + end + + if 1= importfile(ftstream(),"",FCodeblockPath,d) and d and ifarray(d) then + begin + fBlockManager.SetData(d); + class(TTSLCompletion).FCodeBlocks := d; + end else + begin + try + d := GetTslCompletionCodeBlocks(); + fBlockManager.SetData(d); + class(TTSLCompletion).FCodeBlocks := d; + except + + end + end + ///////////////////////////////////////// + //////////////////////////////////////////////// + fmtslexepath.caption :="tslִ"; + fmfile := new TMenu(self); + fmfile.caption := "ļ"; + fmfile.parent := m; + FMenuSet.parent := m; + Fmopen.parent := fmfile; + Fmnew.parent := fmfile; + FOpenOther.Parent := fmfile; + FOpenHistoryMenu.Parent := fmfile; + FTslLangMenu.Parent := FMenuSet; + FCodeBlockMenu.Parent := FTslLangMenu; + FTslFormatMenu.Parent := FTslLangMenu; + tbwidth := 4; + if importfile(ftstream(),"",FTabWidthpath,d)=1 and ( d>0 ) then + begin + tbwidth := d; + end + FMTabContain :=new TMenu(self); + FMTabs := array(); + FMTabContain.Caption := "tab:"; + for i:= 0 to 6 do + begin + tm := new TMenu(self); + if i=0 then tm.Caption := "\\t"; + else + tm.Caption := inttostr(i)+"ո"; + if tbwidth=i then tm.Checked := true; + tm.Onclick := thisfunction(TabWidthClick); + FMTabs[i] := tm; + tm.Parent := FMTabContain; + end + FMTabContain.parent := FMenuSet; + mainmenu := m; + FmTool.parent := m; + FEnCodeMenu.parent := m; + + fmglobsearch.parent := FmTool; + FSearchDir := new TSearchDir(self); + FSearchDir.onsaveclick := function(o,e)begin + return o.EndModal(1); + end + FSearchDir.parent := self; + fmtslexepath.parent := FTslLangMenu; + fmtslexepath.OnClick := function(o,e)begin + //FEdter.FExecuteEditer.ShowModal(); + FEdter.ShowExeEditer(); + end + Fmopen.onclick := function(o,e) + begin + return FEdter.OpenAfile(); + end; + FCloseMenu := new tmenu(self); + FCloseMenu.Caption:="رʱС"; + //FCloseMenu.Checked := true; + FCloseMenu.parent := FMenuSet; + FCloseMenu.OnClick := function(o,e) + begin + FCloseMenu.Checked := not(FCloseMenu.Checked); + end + FEdter := New TEditer(self); + FEdter.Visible := false; + + //԰ť + FSynMenu := New TMenu(self); + FSynMenu.Caption := ""; + FSynMenus := array(); + for i,v in FEdter.GetSynTypeNames() do + begin + it := new TMenu(self); + it.Caption := v; + FSynMenus[i] := it; + it.OnClick := thisfunction(ClickSynMenu); + it.Parent := FSynMenu; + end + FSynMenu.Parent := m; + + FRunMenu := new TMenu(self); + FRunMenu.caption := ""; + for i,v in array("","tslĿ¼","ִ(F9)","","Զ̵","Զ̵(waitattach)") do + begin + it := new TMenu(self); + it.caption := v; + it.OnClick := thisfunction(clickRun); + it.Parent := FRunMenu; + end + FRunMenu.Parent := m; + + FEdter.Parent := self; + ////////////////////////////////////////////////// + FHelpMenu := new TMenu(self); + FHelpMenu.Caption := ""; + FHelpMenus := array(); + for i,v in array("tsl԰","") do + begin + vi := new TMenu(self); + vi.Caption := v; + vi.OnClick := thisfunction(HelpClick); + vi.Parent := FHelpMenu; + end + FHelpMenu.parent := m; + ///////////////////////////////// + FEdter.TslCacheDir := FCache; + FEdter.TabWidth :=tbwidth; + FEdter.OnPageItemSelChanged := thisfunction(PageItemSelChanged); + FEdter.OnPageEditerChanged := thisfunction(PageEditerChanged); + FEdter.TslExe := tslexefile; + FEdter.align := alClient; + FEdter.FHistoryDir:= Fremotepath; + if importfile(ftstream(),"",FPathDirPath,dirs)=1 then + begin + FEdter.TslSearchDir := formatsearchdir(dirs); + end else + begin + fn := SysExecName(); + fio := ioFileseparator(); + for i:= length(fn) downto 1 do + begin + if fn[i]=fio then + begin + dirs := array( + fn[1:i]+"funcext" + ); + break; + end + end + FEdter.TslSearchDir := dirs; + end + if ifarray(dirs) and dirs then FDirs := dirs; + if G_OpenHostory then + begin + if 1= importfile(ftstream(),"",FOpendpaths,opinfo) then + begin + if ifarray(opinfo) then + begin + for i,v in opinfo["pages"] do + begin + it := FEdter.OpenAndGoLineByName(v["filename"],v["r"]); + if it then + begin + ls := it.FEditer.Lines; + for j,vj in v["f2"] do + begin + if vj and ls[j]then ls[j].FMarked := true; + end + if v["isnewfile"] then it.fisnewfile := true; + end + end + if ifarray(opinfo["currentpage"]) then + begin + it := FEdter.OpenAndGotoFileByName( opinfo["currentpage"][0],opinfo["currentpage"][1]); + //if it then it.FEditer.SetFocus(); + end + end + end + if 1= importfile(ftstream(),"",FHistoryPath,hist) then + begin + FEdter.SetHistoryFiles(hist); + end + if 1 = importfile(ftstream(),"",FFindhistroypath,fds) then + begin + FEdter.SetFindHistroy(fds); + end + end + if 1=Importfile(ftstream(),"",FexefileCmds,cmds) then + begin + //echo "getok\r\n"; + FEdter.FExecuteEditer.SetData(cmds); + end else + begin + FEdter.FExecuteEditer.SetData(array( + //"items":(("caption":"tsl","exe":format('"%s" "%s" -libpath "%s"',tslexefile,"$(FULL_CURRENT_PATH)","$(CURRENT_DIRECTORY)"+sp+";"))), + "items":(("caption":"tsl","exe":format('"%s" "%s" -libpath "%s"',"$(TSL_EXE)","$(FULL_CURRENT_PATH)","$(SEARCH_PATH)"))), + "itemindex":0 + )); + end + + onclose := thisfunction(closemain); + FFileopen := new TOpenFileADlg(self); + FFileopen.Filter := array("ִļ":"*.exe"); + FFileopen.parent := self; + formIcon := GetIcon(); + FEdter.Visible := true; + + FFormatInfoWnd := NEW tformatinfownd(self); + FFormatInfoWnd.Visible := false; + FFormatInfoWnd.WsDlgModalFrame := true; + FFormatInfoWnd.Parent := self; + FFormatInfoWnd.onclose := function(o,e)begin + e.skip := true; + o.Visible := false; + //o.EndModal(); + + end + FFormatInfoWnd.OnOkClicked := function(o,e)begin + //o.EndModal(); + //o.show(); + o.Visible := false; + d := o.GetData(); + FEdter.SetCodeFormatInfo(d); + Exportfile(ftstream(),"",FFormatpath,d); + end + if 1=Importfile(ftstream(),"",FFormatpath,FMTDATA) then + begin + //echo "getok\r\n"; + if ifarray(FMTDATA) then FEdter.SetCodeFormatInfo(FMTDATA); + FFormatInfoWnd.setdata(FMTDATA); + end + + end + function HelpClick(o,e); + begin + case o.Caption of + "tsl԰": + begin + return FEdter.ShowTslLangChm(); + end + "": + begin + return messageboxa(editerinfo(),"˵",0,self.Handle); + end + + end + end + function PageItemSelChanged(o,it) + begin + if it then + begin + if it.fisnewfile then self.Caption := (it.FEditer.ChangedFlag?"*":"")+ " new "; + else + self.Caption := (it.FEditer.ChangedFlag?"*":"")+ it.OrigScriptPath; + end else + caption := "-tsl༭"; + ModifyEnCodeMenu(it); + ModifySynMenu(it); + end + function PageEditerChanged(it,flg) + begin + cit := FEdter.GetCurrentItem(); + if it=cit then + begin + if it.fisnewfile then self.Caption := (flg?"*":"")+ " new "//o.Caption;//it.ScriptPath+" -tsl༭"; + else + self.Caption := (flg?"*":"")+ it.OrigScriptPath;//o.Caption;//it.ScriptPath+" -tsl༭"; + ModifyEnCodeMenu(it); + end + else caption := "-tsl ༭"; + end + function OpenInOtherWnd(o,e) + begin + it := FEdter.GetCurrentItem(); + if not it then return ; + nph := it.OrigScriptPath; + it.FEditer.ReadOnly := True; + it := nil; + _wapi.WinExec(format('"%s" -f "%s" -h 0 -i 1',SysExecName(),nph),true); + end + Function SearDirMenuClick(o,e); + begin + FSearchDir.SetData(FDirs); + if FSearchDir.ShowModal() then + begin + ndirs :=FSearchDir.GetData(); + if ndirs <> FDirs then + begin + FDirs := ndirs; + dd := array(); + FEdter.TslSearchDir := formatsearchdir(FDirs); + Exportfile(ftstream(),"",FPathDirPath,ndirs); + end + end + end + function TabWidthClick(o,e); + begin + if o.Checked then return ; + for i,v in FMTabs do + begin + if v=o then + begin + v.Checked := true; + FEdter.TabWidth := i; + exportfile(ftstream(),"",FTabWidthpath,i); + end + else v.Checked := false; + end + + end + function CloseAllPageItems(); + begin + Cit := FEdter.GetCurrentItem(); + its := FEdter.GetAllPageItems(); + for i:= 0 to its.Length()-1 do + begin + it := its[i]; + if it.FEditer.ChangedFlag then + begin + r := MessageBoxA("δļ,Ƿ񱣴!","ʾ",3,self) ; + if r = IDYES then + begin + FEdter.SaveAllPageItems(); + break; + end else + if r = IDCANCEL then + begin + return ; + end + else + begin + + end + break; + end + end + FEdter.CloseAllPageItems(Cit); + end + function closemain(o,e); + begin + if FCloseMenu.CHecked then + begin + e.skip := true; + show(SW_SHOWMINNOACTIVE); + return ; + end + fd := MessageBoxA('Ƿرձ༭','ر',MB_YESNO,o); + if fd<>IDYES then return e.skip := true; + its := FEdter.GetAllPageItems(); + for i:= 0 to its.Length()-1 do + begin + it := its[i]; + if it.FEditer.ChangedFlag then + begin + r := MessageBoxA("δļ,Ƿ񱣴!","ʾ",3,self) ; + if r = IDYES then + begin + FEdter.SaveAllPageItems(); + break; + end else + if r = IDCANCEL then + begin + e.skip := true; + return ; + end + else + begin + + end + break; + end + end + + d := FEdter.FExecuteEditer.GetData(); + if d and ifarray(d) then + begin + exportfile(ftstream(),"",FexefileCmds,d); + end + d := FEdter.GetHistoryFiles(); + if ifarray(d) and d then + begin + Exportfile(ftstream(),"",FHistoryPath,d); + end + d := FEdter.GetFindHistory(); + if ifarray(d) and d then + begin + Exportfile(ftstream(),"",FFindhistroypath,d); + end + global g_dotsavehistory; + if g_dotsavehistory then return ; + d := FEdter.GetAllPagesInfo(); + if not ifarray(d) then d := array(); + exportfile(ftstream(),"",FOpendpaths,d); + FEdter.CloseAllPageItems(); + end + function clickRun(o,e); + begin + case o.caption of + "": + begin + FEdter.ShowExeEditer(); + end + "ִ(F9)" : + begin + FEdter.ExecutePageItem(FEdter.GetCurrentItem()); + end + "": + begin + FEdter.DebugPageItem(FEdter.GetCurrentItem()); + end + "Զ̵": + begin + FEdter.Debugremote(0); + end + "Զ̵(waitattach)": + begin + FEdter.Debugremote(1); + end + "tslĿ¼": + begin + SearDirMenuClick(o,e); + end + end + end + function ClickSynMenu(o,e); + begin + it := FEdter.GetCurrentItem(); + if not it then return ; + if o.Checked then return ; + FEdter.SetPageItemSyn(it,o.caption); + ModifySynMenu(it); + end + function ClickEnCodeMenu(o,e); + begin + it := FEdter.GetCurrentItem(); + if not it then return ; + if o.Checked then return ; + case o.Caption of + "ANSI": + begin + it.CurrentcodeIsAnsi(); + end + "UTF8": + begin + it.CurrentCodeIsUtf8(); + end + "תΪUCS2-big": + begin + it.ToUnicode_big(); + end + "תΪUCS2-little": + begin + it.ToUniocode_little(); + end + "תΪANSI": + begin + it.ToANSI(); + end + "תΪUTF8": + begin + it.ToUtF8(); + end + "תΪUTF8 BOM": + begin + it.ToUtF8BOM(); + end + end; + ModifyEnCodeMenu(it); + end + function OpenAndGotoFileByName(f,line); + begin + if f and ifstring(f) then + FEdter.OpenAndGotoFileByName(f,line); + end + function ModifyEnCodeMenu(it); + begin + if not it then return ; + bm := it.EnCode; + for i,v in FCodeMenus do + begin + if i>5 then break; + if v.Caption = bm then + begin + v.Checked := true; + end else + v.Checked := false; + end + end + function ModifySynMenu(it); + begin + if not it then return ; + bm := it.FSynType; + for i,v in FSynMenus do + begin + if v.Caption = bm then + begin + v.Checked := true; + end else + v.Checked := false; + end + end + private + function formatsearchdir(d); + begin + for i,v in d do + begin + if not ifarray(v) then return d; + if v["s"] then return v["d"]; + end + return array(); + end + protected + type TSerlogerSimpleWnd=class(tdcreateform) + uses tslvcl; + label1:tlabel; + furl:tedit; + label2:tlabel; + fport:tedit; + label3:tlabel; + fusr:tedit; + label4:tlabel; + fpwd:tpassword; + + flogout:tbtn; + flogin:tbtn; + cancel_clk; + save_clk; + function Create(AOwner);override; // + begin + inherited; + Loader.LoadFromTfmScript(self,getinfo()); + flogout.OnClick := function(o,e)begin + calldatafunction(cancel_clk,self,e); + end + flogin.OnClick := function(o,e)begin + calldatafunction(save_clk,self,e); + end + end + function setdata(d); + begin + if not ifarray(d) then return ; + furl.text := d["addr"]; + fport.text := d["port"]; + fusr.text := d["usr"]; + fpwd.text := d["pwd"]; + end + function getdata(); + begin + r := array(); + r["addr"] := furl.text; + r["port"] := fport.text; + r["usr"] := fusr.text; + r["pwd"] := fpwd.text; + return r; + end + function tserlogersimplewnd1_close(o;e);virtual; + begin + Visible := false; + e.skip := true; + + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + if v["static"]then continue; + invoke(self,v["name"],nil); + end + end + private + function getinfo(); + begin + return %% + object tserlogersimplewnd1:tserlogersimplewnd + caption="ԶϢ" + color=0xFFFFFF + height=211 + minmaxbox=false + onclose=tserlogersimplewnd1_close + width=422 + wsdlgmodalframe=true + wssizebox=true + object label1:tlabel + left=4 + top=3 + width=80 + height=25 + caption="ַ" + end + object furl:tedit + height=25 + left=88 + tabstop=true + top=3 + width=204 + end + object label2:tlabel + left=296 + top=3 + width=34 + height=25 + caption="˿" + end + object fport:tedit + height=25 + left=333 + tabstop=true + top=3 + width=62 + end + object label3:tlabel + left=2 + top=38 + width=80 + height=25 + caption=" û" + end + object fusr:tedit + height=25 + left=88 + tabstop=true + top=38 + width=244 + end + object label4:tlabel + left=2 + top=72 + width=80 + height=25 + caption=" " + end + object fpwd:tpassword + height=25 + left=88 + tabstop=true + top=72 + width=245 + end + object flogout:tbtn + anchors=[akright akbottom] + caption="ȡ" + height=23 + left=149 + tabstop=true + top=130 + width=74 + end + object flogin:tbtn + anchors=[akright akbottom] + caption="" + height=23 + left=259 + tabstop=true + top=130 + width=74 + end +end + %%; + end + end + + type TFormatInfoWnd=class(tvcform) + uses tslvcl; + label1:tlabel; + label2:tlabel; + label3:tlabel; + label4:tlabel; + label5:tlabel; + faligncmt:tcombobox; + fcharct:tcombobox; + farraytype:tcombobox; + fsyncheck:tcheckbtn; + fselectcheck:tcheckbtn; + btn1:tbtn; + function Create(AOwner);override;// + begin + inherited; + Loader.LoadFromTfmScript(self,GetWndInfo()); + //WSSizebox := true; + end + function DoOKClick(o;e);virtual; + begin + calldatafunction(FOnOkClick,self,e); + end + function tformatinfownd1_close(o;e);virtual; + begin + e.skip := true; + o.Visible := false; + end + function DoControlAlign();override;//ӿؼ + begin + end + function Recycling();override;//ձ + begin + inherited; + ci := self.classinfo(); + //ԱֵΪnilѭ + for i,v in ci["members"]do + begin + invoke(self,v["name"],nil); + end + end + function GetData(); + begin + r := array(); + r["cmt"]:= faligncmt.Checked; + r["arraytype"]:= array("ͨ":1,"Ĭ":0,"":3)[farraytype.getCurrentItemText()]; + r["syn"]:= fsyncheck.checked; + r["sel"]:= fselectcheck.checked; + return r; + end + function SetData(d); + begin + //"50" "80" "100" "130" + // "50" "100" "130" "150" "200" "250" "300" + //"Ĭ" "ͨ" "" + if ifarray(d) then + begin + faligncmt.Checked := (d["cmt"]=1); + farraytype.ItemIndex := (array(0:0,1:1,3:2))[d["arraytype"]]; + fsyncheck.Checked := d["syn"]; + fselectcheck.Checked := d["sel"]; + end + end + property OnOkClicked read FOnOkClick write FOnOkClick; + private + FOnOkClick; + function GetWndInfo(); + begin + return %% object tformatinfownd1:tformatinfownd + caption="tslʽ" + height=240 + left=497 + minmaxbox=false + onclose=tformatinfownd1_close + top=295 + width=280 + wssizebox=false + object label1:tlabel + left=16 + top=19 + width=92 + height=25 + caption="עͶ" + end + object label3:tlabel + left=16 + top=67 + width=80 + height=25 + caption="arrayʽ" + end + object label4:tlabel + left=13 + top=112 + width=80 + height=21 + caption="﷨" + end + object label5:tlabel + left=13 + top=138 + width=114 + height=25 + caption="ʽѡ" + end + object faligncmt:tcheckbtn + height=22 + left=113 + top=19 + width=22 + caption ="" + end + object farraytype:tcombobox + height=23 + itemindex=1 + items=["Ĭ" "ͨ" "" ] + left=103 + top=67 + width=143 + end + object fsyncheck:tcheckbtn + caption="" + checked=true + height=22 + left=124 + top=109 + width=22 + end + object fselectcheck:tcheckbtn + caption="" + height=20 + left=135 + top=141 + width=21 + end + object btn1:tbtn + caption="ȷ" + height=31 + left=154 + onclick=dookclick + top=166 + width=82 + end + end%%; + end + end + type TBlockEditer = class(TPanel) + uses TSLVCL,UtslCodeEditor; + function Create(AOwner);override; + begin + inherited; + caption := "༭..."; + FLabels := array(); + for i,v in array("ǰ׺","","ֵ","ֵ") do + begin + li := new TLabel(self); + li.caption := v; + FLabels[i] := li; + li.parent := self; + end + FEditers := array(); + for i:= 0 to 1 do + begin + FEditers[i] := new TEdit(self); + FEditers[i].parent := self; + end + FChecked := new tcheckbtn(self); + FChecked.parent := self; + FBtn := new tbtn(self); + FBtn.caption := "ȷ"; + FBtn.parent := self; + FCoder := new TFTSLScriptMemo(self); + FCoder.Completion := new unit(UTslSynMemo).TTSLCompletion(self); + FCoder.HighLighter := new unit(UTslSynMemo).TTslSynHighLighter(self); + FBtn.onclick := function(o,e)begin + + calldatafunction(FBtnClick,self,e); + end + FCoder.parent := self; + end + function Recycling();override; + begin + inherited; + FChecked := nil; + FEditers:= nil; + FLabels := nil; + FBtn := nil; + FCoder := nil; + FBtnClick := nil; + end + function DoControlAlign();override; + begin + if FLabels and FEditers and FBtn and FCoder and FChecked then + begin + r := ClientRect; + lr := array(5,10,45,35); + FChecked.SetBoundsRect(array(52,10,72,30)); + for i,v in FLabels do + begin + v.SetBoundsRect(lr); + lr[1]+=25; + lr[3]+=25; + end + w := r[2]-r[0]; + lr := array(52,10+25,w-48,35+25); + for i,v in FEditers do + begin + v.SetBoundsRect(lr); + lr[1]+=25; + lr[3]+=25; + end + lr[3] := r[3]-35; + + FCoder.SetBoundsRect(lr); + lr := array(lr[2]-100,lr[3]+5,lr[2],r[3]-5); + FBtn.SetBoundsRect(lr); + end + end + function GetData(); + begin + return array(FChecked.checked,FEditers[0].text,FEditers[1].text,FCoder.text); + end + function SetData(d); + begin + if ifarray(d) then + begin + FCoder.ClearAll(); + FCoder.PrepareCompletion(); + FChecked.checked := d[0]; + FEditers[0].text := d[1]; + FEditers[1].text := d[2]; + FCoder.text := d[3]; + + end + end + property BtnClick read FBtnClick write FBtnClick; + + private + FBtnClick; + FChecked; + FEditers; + FLabels; + FBtn; + FCoder; +end +type TBlockManager=class(TVCForm) + uses TSLVCL; + function Create(AOwner);override; + begin + inherited; + Fbtns := array(); + for i,v in array("","","ɾ")do + begin + bi := new tbtn(self); + bi.caption := v; + bi.onclick := thisfunction(btnlick); + Fbtns[i] := bi; + bi.parent := self; + end + FList := new TListView(self); + FList.Columns := array(("text":"ǰ׺","width":40),("text":"","width":130),("text":"ֵ","width":200),("text":"չ","width":430)); + FList.ColumnAsBool(0); + { + r := array(); + r[0] := array("caption":"try..except","value":"try","valueext":"\r\nexcept\r\nend;"); + r[1] := array("caption":"ѭ","value":"for","valueext":"for i= to do\r\nbegin\r\nend","prefix":true); + r[2] := array("caption":"","value":"vclform","valueext":"type =class(tvcform)\r\n function create(AOwner);\r\n begin\r\n inherited;\r\n end\r\nend","prefix":true); + r[3] := array("caption":"","value":"vclscript","valueext":"uses tslvcl;\r\napp := Initalizeapplication();\r\napp.createform(class(),fm);\r\nfm.show();\r\napp.run();","prefix":true); + SetData(r); + } + FList.parent := self; + FEditer := new TBlockEditer(self); + FEditer.SetBoundsRect(array(left+30,top+30,left+width-20,top+height-20)); + FEditer.Visible := false; + FEditer.WsPopUp := true; + FEditer.WSsysMenu := true; + FEditer.parent := self; + FEditer.OnClose := function(o,e)begin + o.EndModal(); + end + FEditer.BtnClick := function(o,e)begin + if FEditer.caption = "Ӵ..." then + begin + FList.appendItem(FEditer.GetData()); + end else + begin + FList.SetItem(FList.SelectedId, FEditer.GetData()); + end + FEditer.EndModal(); + end + FList.OnDblClick :=function(o,e)begin + FEditer.caption := "޸Ĵ..."; + FEditer.SetData(FList.SelectedValue); + FEditer.showmodal(); + end + + end + + function DoControlAlign();override; + begin + if FList and FBtns then + begin + R := ClientRect; + R1 := R; + R1[3]-=30; + FList.SetBoundsRect(R1); + rc := R; + RC[1] := R[3]-28; + RC[3] := R[3]-2; + for i,v in Fbtns do + begin + rc1 := RC; + rc1[0] := R[2]-(I+1)*130; + rc1[2] := RC1[0]+95; + V.SetBoundsRect(rc1); + end + end + + end + function btnlick(o,e); + begin + case o.caption of + "ɾ": FList.deleteselect(); + "": + begin + FEditer.caption := "Ӵ..."; + FEditer.SetData(array(0,"","","")); + FEditer.showmodal(); + end + "": + begin + //echo tostn(FList.ListValues); + calldatafunction(FSaveClick,self,e); + end + + end + end + function GetData(); + begin + d := FList.ListValues; + r := array(); + ri := 0; + for i,v in d do + begin + if v[1] and v[2] and v[3] then r[ri++] := array("prefix":v[0],"caption":v[1],"value":v[2],"valueext":v[3]); + end + r union2= array(); + + return r; + end + function SetData(d); + begin + FList.DeleteAllItems(); + r := array(); + idx := 0; + for i ,vv in d do + begin + if not ifarray(vv) then continue; + cp := vv["caption"]; + if not(cp and ifstring(cp)) then continue; + v := vv["value"]; + if not(v and ifstring(v)) then continue; + ve := vv["valueext"]; + if not(ve and ifstring(ve)) then continue; + r[idx++] := array(vv["prefix"],cp,v,ve); + + end + FList.appendItems(r); + end + property SaveClick read FSaveClick write FSaveClick; + function Recycling();override; + begin + inherited; + FSaveClick := FEditer := Fbtns := FList := nil; + end + private + FSaveClick; + FEditer; + Fbtns ; + FList; +end +type tsearchdir = class(TCustomControl) + uses tslvcl; + function Create(AOwner);override; + begin + inherited; + caption := "Ŀ¼:Ϊ,ҲΪ-libpathĿ¼...."; + WsDlgModalFrame := true; + //WSSizebox := true; + visible := false; + wsPopUp := true; + WsSysMenu := true; + Fidx := -1; + FFolder := new TFolderChooseADlg(self); + FFolder.parent := self; + rc:=_wapi.GetScreenRect(); + l:=(rc[2]-rc[0])/2-400; + t:=(rc[3]-rc[1])/2-300; + SetBoundsRect(array(l,t,545+l,310+t)); + FLists := array(); + FBtns := array(); + for i,v in array(array(2,28,120,230),array(148,2,500,230)) do + begin + ls := new TListBox(self); + ls.SetBoundsRect(v); + ls.parent := self; + ls.Border := true; + FLists[i] := ls; + end + btrecs := array( + array(124,3,144,25), + array(124,206,144,230), + array(502,3,528,25), + array(502,206,528,230), + array(400,240,500,265) + ); + btcolor := array(0x00c800,0x0000c8,0x00c800,0x0000c8,0); + btcolor := array(); + for i,v in array("+","-","+","-","ȷ") do + begin + bt := new tbtn(self); + bt.caption := v; + bt.SetBoundsRect(btrecs[i]); + bt.parent := self; + bt.onclick := thisfunction(btnclick); + ci := btcolor[i]; + if ci>0 then + bt.Color := ci; + FBtns[i] := bt; + end + ///////////////////////////////// + FEdit := new tedit(self); + FEdit.SetBoundsRect(array(2,2,120,26)); + FEdit.parent := self; + FEdit.onkeyup := thisfunction(editkeyup); + FEdit.placeholder := "or"; + clean(); + onclose := function(o,e)begin + e.skip := true; + o.endmodal(0); + end ; + end + function editkeyup(o,e); + begin + if e.CharCode = 13 then + begin + s := FEdit.text; + if not s then return ; + its := FLists[0].items; + for i,v in its do + begin + if s = v then + begin + FLists[0].setCurrentSelection(i); + return ; + end + end + + end + end + function btnclick(o,e); // + begin + for i,v in FBtns do + begin + if v<>o then continue; + list0 := FLists[0]; + list1 := FLists[1]; + case i of + 0: // + begin + S := FEdit.text; + if not s then return ; + + its := list0.items; + if not(s in its) then + begin + List0.appenditem(s); + Farraya.push(array()); + end + FEdit.text := ""; + end + 1: + begin + Farraya.splice(Fidx,1); + Fidx := -1; + FLists[1].items := array(); + FLists[0].DeleteSelectedItems(); + end + 2: //ɾ + begin + if Fidx<0 then return ; + if FFolder.OpenDlg() then + begin + s := FFolder.Folder; + its := list1.items; + if not(s in its) then + begin + its union= array(s); + Farraya.splice(Fidx,1,its); + list1.appenditem(s); + end + end + end + 3: + begin + if Fidx<0 then return ; + FLists[1].DeleteSelectedItems(); + its := FLists[1].items; + Farraya.splice(Fidx,1,its); + end + 4: + begin + calldatafunction(FOnsaveclick,self(true)); + //echo tostn(GetData()); + end + + + end ; + end + end + function listselchanged(o,e); + begin + if o = FLists[0] then + begin + Fidx := o.getCurrentSelection; + its := Farraya[Fidx]; + FLists[1].items := its; + end + + end + function GetData(); // + begin + r := array(); + its := FLists[0].items; + for i,v in its do + begin + r[i,"n"] := v; + r[i,"d"] := Farraya[i]; + if i=Fidx then r[i,"s"] := 1; + end + return r; + end + function SetData(d); // + begin + clean(); + list0 := FLists[0]; + formatdata(d); + for i,v in d do + begin + if ifarray(v) then + begin + list0.appenditem(v["n"]); + Farraya.push(v["d"]); + if v["s"] then list0.setCurrentSelection(i); + end + end + end + function clean();// + begin + Fidx := -1; + FEdit.text := ""; + Farraya := new TMyArrayB(); + for i,v in FLists do + begin + v.onSelectionChange := nil; + v.items := array(); + v.onSelectionChange := thisfunction(listselchanged); + end + end + function Recycling();override; + begin + inherited; + FOnsaveclick := nil; + Farraya := nil; + FFolder := nil; + FLists := nil; + FBtns := nil; + end + property onsaveclick read FOnsaveclick write FOnsaveclick; + private + function formatdata(d); + begin + r := array(); + for i,v in d do + begin + if not ifstring(v) then + begin + return ; + end + end + r := array(( + "n":"default", + "d":d, + "s":1 + )) ; + d := r; + end + FOnsaveclick; + Fidx; + FFolder; + Farraya; + FEdit; + FLists; + FBtns; +end + private +function GetIcon(); +begin + r := "0502000000060400000074797065000203000000696D670006040000006461746 +10002EA01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017F49444154 +484BCD944B4B02611885FB412DDBB4ED37740369D1C6F69110B5A89FD0A6562DA +4B21BB8C8F2921214840B4992C0109112BA58511048C55C4FF3CEF78DCE37CD94 +CE2478E0C070E6F53CCEFBE90CA0C7EA23C0ED31101D049AF73CE84C22E0709C9 +558BE5CE5370C95D658D628F0C0D0E9AC389F5FE637DA1201F661F2E70B2BC94C +3353665D9F2F02F59C384FB943DE80648865DBC3626ED92ADB1AFA99D9E40DB0D +6432BF132894A7D01F64718E42FD39C2F801FF727C06D2D969DB35D03E827FA9B +A8D03EEFEB09E8435E769B75A80FCE80DE416EFF01B2F329CE22BCA8ADFF03D0A +11B52A217D05215F39A147C45F4AAB84901AF1FD0725548A39BA6B57CDDAC0C06 +488C016FD7D0AF1A90E78E208776A0A52B26400EC7CD4AFF806CD8D8C71754631 +DD244ACF5CD95F934D4833294BD9259E91F505C815E7A845E7E823C136F01A4A9 +5DE8C5075E1804504B403BA94159C840BF7B87341983B29485FEDCE4654C22A04 +BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000 +0049454E44AE42608200"; + ico := new TIcon(); + ico.ReadVcon(HexFormatStrToTsl(r)); + return ico; +end + private + FLoger; + FFormatInfoWnd; + fBlockManager; + FCodeMenus; + FCloseMenu; + FSynMenus; + FCPB; + FMTabs; + FOpendpaths; + FTabWidthpath; + FFileopen; + FexefileCmds; + FCodeblockPath; + FHistoryPath; + FFindhistroypath; + FFormatpath; + Fremotepath; + FEdter; + FSearchDir; + FCache; + FPathDirPath; + FDirs; + Fexefilepath; +end diff --git a/designer/tslediter.exe.cmd b/designer/tslediter.exe.cmd new file mode 100644 index 0000000..5180bdc --- /dev/null +++ b/designer/tslediter.exe.cmd @@ -0,0 +1 @@ +"%~dp0..\tsl.exe" "%~dp0tslediter.tsl" -libpath "%~dp0;" \ No newline at end of file diff --git a/designer/tslediter.tsl b/designer/tslediter.tsl new file mode 100644 index 0000000..af87333 --- /dev/null +++ b/designer/tslediter.tsl @@ -0,0 +1,3 @@ +//tsl༭--ljj +//20201019 +return GetTslEditerStart(); diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf new file mode 100644 index 0000000..3dd5708 --- /dev/null +++ b/designer/tslvcldesigner.tsf @@ -0,0 +1,10782 @@ +unit tslvclDesigner; +{** +@explan(˵) %% +**} +interface +uses tslvcl,cstructurelib,UVCPropertyTypesPersistence,utslmemo,UDesignerProject; +function initlib(); + +//*******ƿؼ********************** +//**********ƿؼ************ +type TComponentMenu= class(tmenu) +{** + @explan(˵) ƿؼ˵ %% +**} + private + FComponent; + public + function Create(AOwner);override; + begin + inherited; + end + function Recycling();override; + begin + FComponent := nil; + inherited; + end + property Component read FComponent write FComponent; + {** + @param(Component)(TDComponent) ƿؼ %% + **} +end +type TDComponent = class() +{** + @explan(˵) ƿؼ +**} + private + feventnametable; + FMenuDel; + FTreeNode; + FCwnd; + FMenus; + FBitmap; + FImgs; + class function DeleteItemsByIndexs(r,dxs); + begin + {** + @explan(˵) ɾ±, %% + @param(r)(array) ɾ±,ַ±,η%%; + **} + if not ifarray(r) then exit; + rdx := array(); + for i,v in dxs do rdx[v] := nil; + return reindex(r,rdx); + end + function SetImgs(id); + begin + FImgs := id; + end + function GetImgs(); + begin + return FImgs; + end + function SetName(v); + begin + SetComponentName(v); + end + function GetName(v); + begin + obj := GetTrueComponent(); + if obj then return obj.Name; + end + function SetCwnd(v) + begin + if ifnil(FCwnd) and (v is class(TWincontrol)) then FCwnd := v; + end + function SetTreeNode(v); + begin + if FTreeNode<>v then + begin + if FTreeNode is class(TComponentTreeNode) then + begin + FTreeNode.Component := nil; + end + FTreeNode := V; + if FTreeNode is class(TComponentTreeNode) then + begin + FTreeNode.Component := self(true); + end + end + end + + public + function libs();virtual; + begin + {** + @explan(˵)unit ; + **} + return array("tslvcl"); + end + function InToolBar();virtual; + begin + {** + @explan(˵) ťǷ + **} + return true; + end + class function ClassName();virtual; + begin + {** + @explan(˵) ؼ úoverride%% + **} + return "tcomponent"; + end + function ComponentClass();virtual; + begin + {** + @explan(˵) ؼ %% + **} + return WndClass(); + end + + class function HitTip();virtual; + begin + {** + @explan(˵)ʾ úoverride%% + **} + + return "tcomponent"; + end + function classification();virtual; + begin + {** + @explan(˵) %% + **} + return ""; + end + function DoControlAlign();virtual; + begin + {** + @explan(˵) ؼ %% + **} + if FCwnd is class(TWincontrol) then FCwnd.DoControlAlign(); + end + function IsContainer();virtual; + begin + {** + @explan(˵) Ƿؼ %% + **} + return true; + end + function bitmap();virtual; + begin + {** + @explan(˵) ͼϢӿ %% + **} + if not FBitmap then + begin + FBitmap := new tbitmap(); + d := HexFormatStrToTsl( bitmapinfo()); + FBitmap.Readvcon(d); + end + return FBitmap; + end + function bitmapinfo();override; + begin + {** + @expand(˵) ͼbitmapϢ %% + **} + return GetDefaultIconInfo(); + end + + function ClassObject();virtual; + begin + {** + @ignore() %% + @explan(˵) Ĺ캯 úoverride %% + **} + return self(true).classinfo(1); + end + function WndClass();virtual; + begin + {** + @explan(˵) ʾĴ,úoverride %% + **} + return class(TWincontrol); + end + + function CheckParentWnd(Pwnd);virtual; + begin + {** + @explan(˵) жϸǷЧ %% + **} + return Pwnd is class(Twincontrol); + end + function CheckParent(dcomp,Pwnd);virtual; + begin + {** + @explan(˵) жϸڵ %% + @param(pwnd)(window) ֵ, %% + **} + if not (dcomp is class(TDComponent)) then return 0; + IF not dcomp.CheckChild(self(true)) then return 0; + if not dcomp.IsContainer() then return 0; + Pwnd := dcomp.Cwnd; + if not(CheckParentWnd(Pwnd) ) then return false; + return true; + end + function CheckChild(dcmp);virtual; + begin + {** + @explan(˵) жӵӿؼǷϷ %% + **} + return true; + end + function NodeOk(tnode,owner,tree,Pwnd);virtual; + begin + {** + @explan(˵) ڵж,ڴ˺жϽڵownerǷϷ + дúжǷ񹹽´ + %% + @param(tnode)(TComponentTreeNode) ڵ %% + @param(owner)(tcomponent) %% + @param(tree)(TComponentTree) ֵ,tnode ȡ %% + @param(Pwnd)(TWincontrol) ֵ,tnode ȡ %% + @return(bool) жϽڵǷɹ %% + **} + if not( owner is class(TComponent)) then return 0; + if not( tnode is class(TComponentTreeNode)) then return 0; + tree := tnode.owner ; + if not(tree is class(TTreeView)) then return 0; + dcomp := tnode.Component; + if not CheckParent(dcomp,Pwnd) then return 0; + return true; + end + function CreateMenu(); + begin + {** + @explan(˵) ؼ˵ %% + **} + if FMenus then return FMenus; + createmenubyarray(menus(),FMenus); + return FMenus; + end + function DeleteMenu(mu,n); + begin + {** + @explan(˵) captionɾ˵ %% + **} + if ifarray(mu) and mu then exit; + if mu["type"] <> "menu" then + begin + if mu["caption"]<>n then + begin + r := mu; + end + end else + for i,v in mu do + begin + r := array(); + rt := call(thisfunction,v,n); + if rt then r[length(r)] := rt; + end + return r; + + end + function deleteclick(o,e);virtual; //ؼɾ + begin + cp:=o.Component; + if not cp then exit; + nd := cp.TreeNode; + If not nd then exit; + ndp := nd.parent; + if ndp then + begin + dm := gettswin32api().MessageBoxA(nd.owner.handle,"ɾ:"+nd.Caption,"ɾ",0x1 .| 0x30); + if dm<>1 then exit; + wd := nd.Component.Cwnd; + ds := nd.owner.Designer; + //ds.setcomponentfocus(wd,false); + ndp.deletenode(nd); + ns := array(); + wds := array(); + GetDeleteNames(nd,ns,wds); //ɾ + for i,nsv in ns do + ds.DeleFiledFromEdit(nsv,""); + ds.EditerCodeChanged(); + + nd.Recycling(); + if wd then + begin + wd.Recycling(); + end + o.Component := nil; + ndp.Owner.SetSel(ndp); + end + end + function GetDeleteNames(nd,ns,wds); + begin + ns[length(ns)] := nd.Component.GetName(); + wds[length(wds)] := nd.Component; + for i:= 0 to nd.ItemCount-1 do + begin + GetDeleteNames(nd.GetNodeByIndex(i),ns,wds); + end + + end + function MoveComponentUp(o,e);virtual; //ؼ + begin + cp:=o.Component; + if not cp then exit; + nd := cp.TreeNode; + If not nd then exit; + if nd.moveup() then + begin + wd := nd.Component.Cwnd; + if (wd is class(TWincontrol)) or (wd is class(tmenu)) then + begin + wd.zorder := wd.zorder -1; + end + nd.owner.SetSel(nd); + end + return ; + ndp := nd.parent; + if ndp then + begin + idx := ndp.indexof(nd); + if idx>0 then + begin + bf := ndp.GetNodeByPosition(idx-1); + ndp.deletenode(nd); + ndp.insertnode(nd,bf); + wd := nd.Component.Cwnd; + if wd is class(TWincontrol) then wd.zorder := wd.zorder -1; + end + end + end + function MoveComponentDown(o,e);virtual; //ؼ + begin + cp:=o.Component; + if not cp then exit; + nd := cp.TreeNode; + If not nd then exit; + if nd.movedown() then + begin + wd := nd.Component.Cwnd; + if (wd is class(TWincontrol)) or (wd is class(tmenu)) then wd.zorder := wd.zorder+1; + nd.owner.SetSel(nd); + end + return ; + ndp := nd.parent; + if ndp then + begin + idx := ndp.indexof(nd); + if ndp.ItemCount>1 and idx<(ndp.ItemCount-1) then + begin + if idx< ndp.ItemCount-2 then + begin + bf := ndp.GetNodeByPosition(idx+2); + end + else + begin + bf := nil; + end + ndp.deletenode(nd); + ndp.insertnode(nd,bf); + wd := nd.Component.Cwnd; + if wd is class(TWincontrol) then wd.zorder := wd.zorder+1; + end + end + end + function createmenubyarray(ms,pm); //˵ + begin + if not(ifarray(ms) and ms) then exit; + if ms["type"]="menu" then + begin + if not pm then pm := new TPopUpmenu(FCwnd); + if ifstring(ms["caption"]) then + begin + mu := new TComponentMenu(FCwnd); + mu.caption := ms["caption"]; + mu.onclick := ms["onclick"]; + if ms["id"] = "delete" then + begin + FMenuDel := mu; + end + mu.Component := self(true); + mu.parent := pm; + call(thisfunction,ms["items"],mu); + end + end + else for i,v in ms do + begin + call(thisfunction,v,pm); + end + end + + function menus();virtual; //˵ + begin + return array( + ("type":"menu","caption":"ɾ","id":"delete","onclick":thisfunction(deleteclick)), + ("type":"menu","caption":"","onclick":thisfunction(MoveComponentUp)), + ("type":"menu","caption":"","onclick":thisfunction(MoveComponentDown)) + ); + end + function CreateNode(tnode,owner,tree,Pwnd);virtual; + begin + {** + @explan(˵) ڵ %% + @return(TComponentTreeNode|false) ڵ %% + **} + if not NodeOk(tnode,owner,tree,Pwnd) then return false; + return tnode.insertnode(array("type":"treenode"),tnode.TVI_LAST); + end + function SetViewParent(wnd,pwnd);virtual; + begin + {** + @explan(˵)ؼĸ%% + **} + wnd.parent := Pwnd; + end + function ComponentCreater(tnode,owner);virtual; + begin + {** + @explan(˵) ½ڵ㴰 %% + @param(tnode)(TComponentTreeNode) ڵ %% + @param(owner)(TWincontrol) %% + @return(TDComponent|0)ɹضʧ0%% + **} + tn := CreateNode(tnode,owner,tree,Pwnd); + if not tn then return 0; + if Imgs >=0 then + begin + tn.ImgId := Imgs; + tn.SelImgId := Imgs; + end + o := createobject({ClassObject()}self(true).classinfo(1),owner); + if not o then return 0; + o.TreeNode := tn; + SetViewParent(o.Cwnd,Pwnd); + o.Cwnd._tag := tn; + //tree.SetSel(tn); + return o; + end + function create(AOwner);virtual; + begin + {** + @explan(˵) ؼĹ캯 %% + **} + feventnametable := array(); + if not(AOwner is class(TComponent)) then exit; + c := WndClass(); + if c is class(TComponent) then + begin + FCwnd := createobject(c,AOwner); + FCwnd.SetDesigning(true); + end + else raise "ʹ!"; + + end + function GetChangedPropertiesn(n); + begin + if FCwnd then return FCwnd.GetChangedPropertiesn(n); + return nil; + end + function GetChangedPublish();virtual; + begin + {** + @explan(˵)øı%% + **} + if FCwnd then return FCwnd.GetChangedPublish(); + return array(); + end + function GetPublishProperties();virtual; + begin + {** + @explan(˵)е%% + **} + if FCwnd then return FCwnd.GetPublishProperties(); + return array(); + end + function GetPublishEvents();virtual; + begin + {** + @explan(˵)øı¼ص%% + **} + if FCwnd then return FCwnd.GetPublishEvents(); + end + function DefaultAlign();virtual; + begin + return false; + end + function destroy();virtual; + begin + FTreeNode := nil; + FCwnd := nil; + end + function SetComponentProperties(n,v); + begin + {** + @explan(˵)޸%% + **} + if FCwnd then + begin + if n="name" then + begin + return SetComponentName(v); + end else + return FCwnd.SetPublish(n,v); + end + end + function GetTrueComponent();virtual; + begin + {** + @explan(˵) ʵĿؼ%% + **} + if FCwnd is class(TDVirutalWindow) then return FCwnd.BindComp; + return FCwnd; + end + function SetComponentName(v); + begin + {** + @explan(˵) ޸Ŀؼname %% + **} + obj := GetTrueComponent(); + if obj and ifstring(v) then + begin + odn := obj.name; + v := lowercase(v); + if v=odn then return false; + if v in TemporaryNotName then return false; + cn := ClassName(); + obj.name := v; + if v=(obj.name) then + begin + if TreeNode then TreeNode.caption := v+":"+cn; + if ifstring(odn) and v then + begin + ds := FTreeNode.owner.Designer; + ds.DeleFiledFromEdit(odn,(v+":"+cn)); + ds.EditerCodeChanged(); + end + return true; + end + end + end + function SelectedNode();virtual; + begin + {** + @explan(˵) ÿؼڵ㱻ѡʱIJ %% + **} + if (FCwnd is class(TWincontrol)) and FCwnd.HandleAllocated() then + begin + FCwnd._wapi.BringWindowToTop(FCwnd.Handle); + end + end + static TemporaryNotName; + function CreateName();virtual; + begin + {** + @explan(˵)ؼһ%% + **} + obj := GetTrueComponent(); + if obj then + begin + cn := ClassName(); + cn1 := cn[1]; + if cn1="t" and length(cn)>1 then + begin + cn := cn[2:]; + end + i := 1; + oname := obj.name; + if ifstring(cn) and cn and not(oname) then + begin + while oname<>nn do + begin + nn := cn+inttostr(i++); + if nn in TemporaryNotName then continue; + obj.name := nn; + SetComponentProperties("caption",nn); + oname := nn;//obj.name; + end + end + if TreeNode then TreeNode.caption := oname+":"+cn; + end + return nn; + end + function SetDefalutEvent(ev); + begin + if ifarray(ev) then + hs := createtslfunction(ev); + if not hs then + begin + FDefaultEvent := nil; + return ; + end + r := format("type ca = class\r\n%s \r\nend",hs); + if CheckTslCode(r,err) then + begin + feventnametable[ev["event"]] := ev; + FDefaultEvent := ev["event"]; + end + end + private + FDefaultEvent; + function GetDefalutEvent(); + begin + return feventnametable[FDefaultEvent]; + end + public + function geteventfunctionbyname(n); + begin + r := feventnametable[n] ; + if r and ifarray(r) then + begin + return r; + end else + begin + r := array(); + r["name"] := n; + r["event"] := n; + r["param"] := array("o","e"); + r["body"] := +format(" + {** + @explan(˵) %sϢص %% + @param(e)(tuievent) Ϣ %% + @param(o)(tcomponent) %% + **}",n); + end + return r; + end + property TreeNode read FTreeNode write SetTreeNode; + property Cwnd read FCwnd write SetCwnd; + property Name read GetName write SetName; + property Imgs read GetImgs write SetImgs; + property DefaultEvent read GetDefalutEvent write SetDefalutEvent; + {** + @param(TreeNode)(TComponentTreeNode) %% + @param(Cwnd)(TWincontrol) %% + @param(Name)(string) %% + @param(TemporaryNotName)(array of string) Ƿı %% + @param(Imgs)(integer) ͼ,Ҫʹ %% + **} +end + +type TDRootComponent = class(TDComponent) + {** + @explan(˵) ֻΪӽڵ,˵,ļѡ,ʱ %% + **} + function Create(AOwner);override; + begin + inherited; + end + function CheckParentWnd(Pwnd);override; + begin + return (Pwnd is class(tvcform)) or (Pwnd is class(tpanelform)); + end +end +//**********red**DControl***************************** + +type TDedit= class(TDComponent) + class function HitTip();override; + begin + return "ıؼ"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002D201000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000016749444154 +484BED93B18AC2401445D30BDAA51214044997C6D680A2A435D8DB59FA0D0BFE4 +26C52588B9FB06065C02A453A0B9580A50A12B5D03477796F278B59571CC16CE5 +8107F74E60CE304314A4CC5BF090FF117C0C3F539984E0D53C2598CD6668B7DBA +225511485E7777E4A309D4E619AA6687F136F1C735710451156AB1576BB9D5849 +0A96CB25C230E47C8D9460B15840D775B45A2D94CB650C06035E2741B55A85655 +93C854201B66DF3B71829C17EBFC7F178E44CB252A9C49904994C06411070DF6C +36505515DBED963B2125A0EB711C079D4E874F9CCBE5789D048661708EA9D56A7 +05D57344941AFD743B7DBC57C3EC7E1704808EAF53AE7984AA502DFF7459314D0 +29279309E7F1789C1064B359ACD76BEE9EE7A1582CE272B97027A404A3D108F97 +C1ECD6613FD7E9F1F93A0FFA0D168F0E3D3D5699A96B81E424A40D0A9CEE7B368 +B79C4E2791BEA18DE3CDAFF35DC1ABB811A4313F8234790B1E92B200F80266B31 +3963A1FCCDB0000000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tedit"; + end + + function ClassObject();override; + begin + return class(TDedit); + end + function WndClass();override; + begin + return Class(tedit); + end + function Create(AOwner);override; + begin + inherited; + end + function IsContainer();override; + begin + return false; + end +end + +type TDmemo= class(TDComponent) + class function HitTip();override; + begin + return "ı"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100027103000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000030649444154 +5847ED96DD4F52711CC6A1EEB21B2FEA3FD07FC0D98DAD1BB76EF2A23B6FEAA2B +A68D3CD2D6D6D66EAD6EB48D010255158CA459B93B9C4347039D37005A8883A82 +5E6C1C5FC68B5BE69029439FCEF7B08327E4E086076BCECFF6BBE0EC1CCEE73CC +FF7F04386FF8C132162777717ABDFBF61F9AB0FF1789CFBCC73E4427473C6FB05 +F6B379982E2F87C73583ADADADA498A850A3C12AFDD25B50ABE9852D3F1FE8EE4 +654A5C2DB9212B8ED9F108D46B1B3B39359484AE8E983C1203A3B7530299AF05B +A100535A0A7761219ACF9FC3DA5A984BEA488448666565199393362C2EFEC0C88 +8152F6EDE80A3A000E6BC33E8AAAB83DFEF472412C9BD10C9F8FD2E188D8F303E +FE81139A9E9E82C1A047CDA58B50D754C36EB7836198DC0BF1320B0B173036F60 +C66730FBB06303838C80A1AA1D777C166FB08AFD78B70388BCA8A8A8A0E5C3C09 +9959B8DDC570B95AD819512210B80C8DA606F50D0DE8E979C5C9783C1E6EB6723 +AD4BCCCDC5C31666654EC0D9BD8A365181A3A85D1D1D3B856796F9F0CBDF684E4 +42C29A9C4E257BC3E7ECD1320C0FCB593919B4DA0ADCAA6DDE2743D7119254C6F +3B78C8A9D8B443266B39C1D6419DADB2BB8642A1FEBD3CA10922524AC89662614 +4A2443325353245399ACE96E4B6F5A19421221A10CCD4C20B0571325A3D5EEC95 +032752FCD696588AC2BE3A12F6518773219A14C6A327C4D0D5DEFD2CA10874E68 +7B7B1B86D6EB7863AA4FD63430202E43C9D09E26C6A184E82927462D887826F0B +EAF1DB1D815F4F7CBD98196A1ADAD2AAD0C5D93E9BBB3AE8C564747074C8656C4 +995944662D303DBD0D8743CEFEF8256484E70A674632A154363737F1E46123829 +FCDF8D9A740F79DAB68D33CE036D174C9F0E44CC86AB540A954E27E7515FA5E1B +B9CDD3E974C0E7F3B1F314127DB52513125640D066180A053981F9F9796E935C5 +A62A056AB93E751ADA9E42CA1582C868D8D0DEECF55381CC2FAFA2FAE463A4E1B +A5183913CA16C9848495A52E9D4E97F11C21C73721A9904C28B506B19AD21D177 +27C13928A13A183C85A28974B0C51A17FC5895066803FCD8B95CBA6C573F60000 +000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tmemo"; + end + + function ClassObject();override; + begin + return class(TDmemo); + end + function WndClass();override; + begin + return Class(tmemo); + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onchange", + "name":"change", + "param":array("o","e"), + "virtual":true, + "body": +" + {** + @explan(˵) ııص %% + @param(e)(tuievent) Ϣ %% + @param(o)(tmemo) ı %% + **} +" + ); + end + function IsContainer();override; + begin + return false; + end +end +type TDpassword= class(TDComponent) + class function HitTip();override; + begin + return ""; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002F300000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000008849444154 +5847ED91010A80300845BD795DA48374BA859065C36644A163FFC18789321E4A2 +51910F2809007843CF20A4DCB1A1AE12214C5D8424474C4AA99B00D69094DBF42 +44F3FEBABE6B9ECF41C89B7B29C49FB622583D9D1A9C8CF945883F6D45B07A3A3 +538193396D0D7A4106209895533611BBAA31FA1C808E7219300210F087940A84D +291BB496CCEA5B2547890000000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tpassword"; + end + + function ClassObject();override; + begin + return class(TDpassword); + end + function WndClass();override; + begin + return Class(tpassword); + end + function Create(AOwner);override; + begin + inherited; + end + function IsContainer();override; + begin + return false; + end +end +(** +type TDtrackbar= class(TDComponent) + class function HitTip();override; + begin + return ""; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100026701000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000FC49444154 +5847EDCE310AC2401085E1345676E2592CBC876061A3A59E40B0C8416CAC3C400 +A1B0B0BCBA0206A2A53580882A0A0A006C9E8CAAE923871125835C2FCF020EC66 +E133206531888A41540CA2224146694A4E67E9055996850E038487BD4B3A55006 +4DBF6CB304078D8BB2463103506516310B54810360C101EF62EE9540F5054D9CA +1C45A8897B9D91A0EE708742D43A83ADFC534F2448546FAF504CE376AEBB5820E +FE243B1E5063085E6024E9E2FFFD0572C9068B9F1205F73EE985CD501777D9637 +7A8B0D12F52707C89467D01BEFE589FE12814423F728BF3E130A324D537E3DFBC +69988412AEC4CF41FA05FC6202A065131E87D0057498A8BEBDBFB6A1400000000 +49454E44AE42608200"; + end; + class function ClassName();override; + begin + return "ttrackbar"; + end + + function ClassObject();override; + begin + return class(TDtrackbar); + end + function WndClass();override; + begin + return Class(ttrackbar); + end + function Create(AOwner);override; + begin + inherited; + end + function IsContainer();override; + begin + return false; + end +end +**) +type TDcomboBox= class(TDComponent) + class function HitTip();override; + begin + return "ѡ"; + end + class function ImageId();override; + begin + return 6; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023501000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000CA49444154 +5847ED92C109C42010452D45F094A385A4A65461135660375EEC220797C92ABBD +90C314AD4ECE0838F8387CF6318E61FC6104AB1139AE7B969300E427772D6D755 +C839B7BD409CB3859665294E04FAD675F5D33479A5D41698E1AF9B1060ADF59CF +32D3003D94277F0DD07225106E82EF4CB65A196C1A8BAA13386508A2221C6D82D +D15A87C60F343654131A42D83D5C8D3126B4E0D0D8504D680861B791132965683 +A42634335A12184DD45698410A1F50D8D0DD5E47F855A066327F40486508A2174 +8EF72FB778FABEB46AB5F60000000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tcombobox"; + end + function ClassObject();override; + begin + return class(TDcomboBox); + end + function WndClass();override; + begin + return Class(tcomboBox); + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onselchanged", + "name":"sel", + "virtual":true, + "param":array("o","e"), + "body": +" + {** + @explan(˵) itemѡıص %% + @param(e)(tuievent) Ϣ %% + @param(o)(tcomboBox)comboboxؼ %% + **} + MessageBoxA('ѡid:'+tostn(o.itemIndex),'ʾ',0,o); +" + ); + end + function IsContainer();override; + begin + return false; + end +end +type TDColorComboBox= class(TDComponent) + class function HitTip();override; + begin + return "ɫѡ"; + end + class function ImageId();override; + begin + return 6; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023001000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000C549444154 +5847EDD1DF09C32010C77147F13513640AD7C81A9DC2453A45B7F0C52D7CB039F +1A0A1FEC9859C49E03EF02392807C6955BC1909EAD904196386AEE42FE84CADFB +E841EFD7F165789FF73E3D019EE941CBFAE9E832B82F8410A7698AD6DA3438C3B +BCB8280732E6AADD3E00CE841A5BF62EFB2DFFB200463003DE804ADFB76078D5C +09EB2FD4F2FC20B5F00C49506D881CC44D827AE8416AFDC4B14C82AACBE841CC2 +4A8871C347F66962109AA0D9183B84950CF738346AE6413740712D416E317FE0C +479C51B569C20000000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tcolorcombobox"; + end + function ClassObject();override; + begin + return class(TDColorComboBox); + end + function WndClass();override; + begin + return Class(tcolorcombobox); + end + function Create(AOwner);override; + begin + inherited; + end +end +type TDradiobtn = class(TDComponent) + + class function HitTip();override; + begin + return "ѡ"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002AD02000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000024249444154 +5847ED96C96EE2401086E7F5B23C14121C13D63B08DE055022E0C076040408894 +54A2EEC4835FE9CB2C621B6BB1D26520EFEA492ACEAEAF2EFEEEA6AFF915F4622 +C84422C84422C8C44D8296CBA574BB5D69341AAEF1BC5AAD74F47BC416743E9FA +55EAF4BA15090542A15688C2190D8B8C412349D4E259BCDBA2FADD56AD26EB765 +B3D9C8E974726DBD5EBB3EC688C9E572329BCD74B61DD682FAFDBEA4D36929954 +A32994CD41B0E31C5625132998C0C0603F59AB112C4CA20A652A9C87EBF57AF19 +62CBE5B22BCA76A58C82A803B689958923C663B7DBB92B95CFE7E572B9A8371CA +3200A987A188FC7EAF94CB3298EE00FE33908B68F1C14BA09A3204E0C457ACDDB +9BC8DD9D93C0C9E0B7FB7B91F7770DF251AD56DD95321129883EC397753A1DF5F +C23488C670F0F1AE4A3D56AB9B94C7DCA991E0E8D8E241C6D3F6C4D9010BFBDBC +68B0424B2057AFD7534F30CED470BCFA391E8FEAF9E0E9E9AB806B7B7ED660851 +CE432D59133351C267F571045EEE77038DC2EE8D76D19054812AE836B384D4142 +B0C7470DF2E11535C2A270A647C3510D3AF61C6D4E5390981F3BF6E015F668345 +2CF67D81AEAC5B947E5F5559D57788DB119D6397D18057175706BD3FAB7DBAD7A +EDF9EF57072C160BF782E4A2E405B610EB5DAEF3F95CBDD15809027E2148CCD78 +6DD6B7E88219639C3E150BD66AC0501BF102C3DF5409172723835F4298C677C8C +1143ACEDCA78C41204D401CD8DAFE7A541C618056C5333D7C416E48715A179F27 +28C67539F317193A09F2011642211642211148DC85F768426F04BC530CE000000 +0049454E44AE42608200"; + end; + class function ImageId();override; + begin + return 6; + end + + class function ClassName();override; + begin + return "tradiobtn"; + end + function ClassObject();override; + begin + return class(TDradiobtn); + end + function WndClass();override; + begin + return Class(tradiobtn); + end + function Create(AOwner);override; + begin + inherited; + end +end +type TDipaddr= class(TDComponent) +{** + @explan(˵)ipƿؼ%% +**} + class function HitTip();override; + begin + return "ipַؼ"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002B402000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000024949444154 +5847B5963D8B14411086E7771819980882B870F88170222A2826228A81707881C +1B1818966C7456AA226FA238C4C04115610111185FB211E9C7A6A20D33353774F +431DDD3DDD3D33BBB3EFF232B3555D55EFCCF4471532005FEA6FB2593D966BE69 +69C3697E4989958728F0D1F6386A053C00FD99167D54B395F5E9523E5F15E642C +31C476212B8024A7CC6AB4481F124B8E1C92026E98BBD1A4F3905C2944059C28C +F45132D4272C6D012C0848A251883E40EE109B85F3D88068E496AB83814C06489 +052C83EEC4B402582EA9D97ED3AC2599F34FCA0BAD5C4A6AE912B502724F9F5A4 +614C9F9C16EF353BE37DB72BDBA93CC6B059C292FB70628870A785EBFB2B6D7CD +1BF9DC7CB5B63DF923EBD5D4CB4B4D507CA83F798E90FA4A5DA80D7F28208C7F5 +BBFB776AEA18FDAC5A36AABE508190A707D5D0234F66FF3AFE5A376C121123A42 +2E228009A7D0B7A6A476D167E35944C056FDD4DAFF1FFC8E96273D1FB50B8E53D +718E33C0256CC456FD379D7CCBC3848EDD105C4F04B7ECB5973C58B8356C0D89F +20C4ACF9286BD58617A3B49F60CC49A87BC093FA854CAB8772DBDCF3C686B4939 +0362AE674D95700F7AEAF8BD42EE8E1624E97CB12406DBB15E7FA3D92868D26FF +11A57EC51001D404A31E464304685CE771CC409E38A42B406D7D05B48E633044F +DA2D4A7078702C0989D708A6187EC0900CBE88895B1CEB82500F4D91D87929C31 +440580313BE4B01376911400D85A53ABA30F8975275C0C590180E542925CDF189 +2B1C4E852CBA153800B7A38DA280E11BE29C729E41E1B3EC6F487C83E6F6E81BB +6E01F9710000000049454E44AE42608200"; + end; + class function ClassName();override; + begin + return "tipaddr"; + end + function ClassObject();override; + begin + return class(TDipaddr); + end + function WndClass();override; + begin + return Class(tipaddr); + end + function Create(AOwner);override; + begin + inherited; + end + +end +type TDmessagebox = class(TDRootComponent) + class function HitTip();override; + begin + return "ʾ"; + end + function bitmapinfo();override; + begin + return GetMessageBoxBitmapInfo(); + end; + + function classification();override; + begin + return "Ի"; + end + class function ClassName();override; + begin + return "tmessageboxadlg"; + end + function ComponentClass();virtual; + begin + {** + @explan(˵) ؼ %% + **} + return class(tmessageboxadlg); + end + function ClassObject();override; + begin + return class(TDmessagebox); + end + function WndClass();override; + begin + return Class(TDMessageboxWindow); + end + function Create(AOwner);override; + begin + inherited; + end +end +type TDMessageboxWindow = class(TDVirutalWindow) +{** + @explan(˵) ɫѡؼ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TMessageboxADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetMessageBoxBitmapInfo(); + end; +end + +//***********zh**DControl*********************** +type TDListBox=class(TDComponent) +private + FLBItemEdit; +public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return "б"; + end + class function ClassName();override;begin + return "tlistbox"; + end + function setItems(o,e);begin + if ifnil(FLBItemEdit) then + FLBItemEdit:= new TItemEditer(); + // {α} + // FLBItemEdit.setdata(FlistBox.getdata()); + // FLBItemEdit.onOK:=void(){FlistBox.setData(FLBItemEdit.getdata());} + end + function menus();override;begin + r := inherited; + r[length(r)] := array("type":"menu","caption":"݋б","onclick":thisfunction(setItems)); + return r; + end + function ClassObject();override;begin + return class(TDListBox); + end + function WndClass();override;begin + return Class(tlistbox); + end + function Create(AOwner);override;begin + inherited; + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100025401000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000E949444154 +5847ED96410EC2201045390ADB1E86E371122FE0A69C807D37BD451798C192D8F +643156841C24B5E6C884E5E9C6860A6327AD0199B2021C4AD220E413909CD2B1E +344D93D55134884238E756171515C418FB49A5D4FAC937346F5916330C8391525 +AE999CEA2825271F3E679B6AF847B2E1A84880A426B41FA86D37948C4E5DFD0F8 +7C40DB0842EB09897E6528868C0A4AA5FD20B496BD5AEBF5DD47B207A5D27E105 +A11D2373C7B502AED07A1F584FC8B3FC69088CB837C4405A1B5207DC3DD795517 +B42AAFB0D92EF9A97CCEA3101743140FDAF375D09D22364135D083CEE841618C7 +90143F9BE01B37879820000000049454E44AE42608200"; + end +end +type TDColorBox=class(TDComponent) + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return "ɫб"; + end + class function ImageId();override;begin + return 5; + end + class function ClassName();override;begin + return "tcolorbox"; + end + function ClassObject();override;begin + return class(TDColorBox); + end + function WndClass();override;begin + return Class(tcolorBox); + end + function Create(AOwner);override;begin + inherited; + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100025B01000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000F049444154 +5847ED96B10D833010451985969A822958838D3C49164813295BD0B00585C3593 +AC9266793B33E06059EF48485A5F32B5CB8B227E30EDA2208EAFBBEA8125F4148 +52F30E0F1AC7D1C9E8838665CB37039E4721755D3B390A16D4B6EDA60CCD9BE7D +9364D638D314E5AD3BFC38288699ADC97E0352C4843EC50421F0480E6A594D83D +E8F57C88AA83AA2134872241D22566D75C3348033408C19F0755CB966F064582A +4CBBC96B96690066C10805306A594880675EF2E3087D8A1042C48BAC4BE3E3C0F +F2404305C19EB0B1200D3C0FF3C807E0CFA3108E210E0F5AF37350492582A0337 +0076D7107A5B1F6034F9699CCB1141CEB0000000049454E44AE42608200"; + end +end +type TDCalendar=class(TDComponent) +private + +public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return ""; + end + class function ImageId();override;begin + return 5; + end + class function ClassName();override;begin + return "tmonthcalendar"; + end + function ClassObject();override;begin + return class(TDCalendar); + end + function WndClass();override;begin + return Class(tmonthcalendar); + end + function Create(AOwner);override;begin + inherited; + end + function GetPublishEvents();override;begin + r:=inherited; + if r then + reindex(r,array("ondrawitem":nil,"onpaint":nil)); + return r; + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100029901000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000012E49444154 +484BED94B1AA82501CC6DD7C010D71745268953B2AEE3E40F80A2E977A1371095 +C0D8256C1390209DC5C05373721084104BF8BA77335A2AB51D725FAC187E77F3E +F0770E884CC23098321FC168DE40F0F51D612ADA77BFB160B55A41D775489284F +D7E4F772F6CB75BB27F9DC3E140DB9E41C172B9C466B301C77108C390EE5EF03C +0F8661204DD32E6559D2B66750F08B288A7705A669D2E96F5E12F03C0F5996A16 +91AD6EB359AA6A16DCFD382388E110401922481EFFB98CD66701C87B63D4F0B6E +715D17AAAAD2A9E7DF04EDC7A0280A9D7A0605A7D3094551401004EC763BB2AEE +B9A745114A1AA2AB2CEF39C9CDEB66D325F332898CFE760DA7FC9558EC723E92C +CB02CBB2E476ED73B1589003DD322818E37C3E23CBB2EE26F77849F0081FC1289 +D60BA44F8013782F60023EBD3020000000049454E44AE42608200"; + end +end +type TDProgressBar=class(TDComponent) + public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return ""; + end + class function ImageId();override;begin + return 5; + end + class function ClassName();override;begin + return "tprogressbar"; + end + function ClassObject();override;begin + return class(TDProgressBar); + end + function WndClass();override;begin + return Class(tprogressbar); + end + function Create(AOwner);override;begin + inherited; + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100024C02000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001E149444154 +5847ED95476E633110447DAB39978FA395749C11A09C73CE3967A907D540CBF46 +75BF46EB46003B57109CDA72A52FEA0371B0FE41A0FE41A0FE41A0FE41A0FE41A +068A4422140A85FEABC0F004C21FB6DB2D9D4EA7A78EC7231D0E07DAEFF7ACDD6 +EC79FD96C36B45EAF9F5AAD56B45C2E69B158D07C3EA7D96CC69A4EA734994C68 +3C1ED36834A2E1704883C180D5EFF7A9D7EB51B7DB65351A0D66F806743E9FE9F +178D0FD7E67DD6E37BA5EAF74B95CD8D34005D20435014D48133008D96AB56C20 +1C04883F9F7F2D0984E60984E601E23749359B4D1B08DF1869688B250DCD93343 +4CF841010B3AE4EA7C3AAD7EB3610224725DA62A944F3A412CD0B429820ED769B +AB423AD56AD50642EC48425B0CEF552DA844F38269088480E032239D52A964032 +17A24A12D96CBA9795289E64925661A0201D56A354EA75028D840381017545B2C +AF44F3A412CD13081344202A950AAB5C2E532E97B381702052D216CB2BD13CA94 +4F38210020208D4542C16399D4C26630321FA5797F3552DA844F3CC3404C204C9 +E7F39C4E3299B48110FD4F3F5CAE57E2AA24082120D96C96D3492412361096BB5 +E832BFA9F0E84D2E934A552294E0300F1789C158BC5281A8D7E077A877FAEE170 +F80BE89DC603B9C603B9C603B9C603B9C603BD1EA27F2BABB3A7A95F430C00000 +00049454E44AE42608200"; + end +end +type TDCheckBtn=class(TDComponent) + public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return "ѡ"; + end + class function ImageId();override;begin + return 5; + end + class function ClassName();override;begin + return "tcheckbtn"; + end + function ClassObject();override;begin + return class(TDCheckBtn); + end + function WndClass();override;begin + return Class(tcheckbtn); + end + function Create(AOwner);override;begin + inherited; + DefaultEvent := array( + "event":"onclick", + "name":"clk", + "param":array("o","e"), + "virtual":true, + "body": +" + {** + @explan(˵) ص %% + @param(e)(tuievent) Ϣ %% + @param(o)(tcheckbtn)ѡť %% + **} + MessageBoxA(((o.checked)?'ѡ':'ûѡ'),'ʾ',0,o); +" + ); + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023A02000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001CF49444154 +5847EDD64B4EC2501406602638C10487C484810B70EC0274430E7527121640888 +AACC0A9C1F22ECF02A52D85D296D70A7E295822A5F6564E8D0EFA2767D873BFDC +474E23F8670941AC84205642102B9EA09BFB775CDDBE055A564FAF7882AC06ABD +50ACBE5128BC502F3F91CB3D90CA669C2300CE8BA8EE9740A4DD330994C301E8F +A1AA2A46A3111445812CCB902409C3E110A2286230186C7A7A85090A12D3EFF7E +9A02031BD5E8F0E3A162308D2014610043AE818CCEBAB846452472A25EF61BADD +2E1D740C26913010899888460D3C3C58BBB5C5743A1D3AC80DA3AA6C8C5D27272 +6D269718369B7DB74901393CF6BB8BC34C0712A1363553C6EE0E9A9BFC1B45A2D +3AC889393DDD2E747161A050507E8469369B74908D7979D1108BED2F68A13219C +5157376A6AFBFE9ED611A8D061D645FE07C7EB2DB1D56B9ED8C85E1799E0EFAFA +9A72399589F2C2D4EB753AC8F99A9E9F47EBA33B3C223F985AAD4607399FB6350 +E1E1FE503941F4CB55AA5839C187B1C64B3D20EE51753A954E820378C3D0E3219 +11E7E7BA6F4CB95CA683BEC3D8E380E7BBBE31A552890EF2C2D8E3C02FA6582CD +2414162388EA38382C49041BFF1937F7D57F8ECEE1E4FD05F2404B11282580941 +DE013E00FF2B90FB3AF2B1880000000049454E44AE42608200"; + end +end +type TDDateTimePicker=class(TDComponent) +private +public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return "ʱѡ"; + end + class function ClassName();override;begin + return "tdatetimepicker"; + end + function ClassObject();override;begin + return class(TDDateTimePicker); + end + function WndClass();override;begin + return Class(tdatetimepicker); + end + function Create(AOwner);override;begin + inherited; + end + function bitmapinfo();override;begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020E01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000A349444154 +484BD58FD10D83300C44D9285B650D6FD14DFACD10198221F2E1F62C8C5C29941 +80C88279D8C2C398F1BF864AE13E49CC362F91178D19B5AAB046C0A88C6AE00DC +945238A524C177B8001091046C0A3CB46EFE0AA26239D4A04597E0F59EDC51BA0 +57B260869C0C3F76CCEB29B0969208F9BB94B20478D3F5DDB2BAE06F28899BA5F +9B20A4412B8AAB81770257034F942EC111EE1544C5B208CEE2E902E60FE420D1B +CC541E3100000000049454E44AE42608200"; + end +end +type TDTimePicker=class(TDComponent) + public + function isContainer();override;begin + return 0; + end + class function HitTip();override;begin + return "ʱѡ"; + end + class function ClassName();override;begin + return "ttimepicker"; + end + function ClassObject();override;begin + return class(TDTimePicker); + end + function WndClass();override;begin + return Class(ttimepicker); + end + function Create(AOwner);override;begin + inherited; + end + function bitmapinfo();override;begin + r := "0502000000060400000074797065000203000000696D670006040000006461746 +100024C02000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001E149444154 +484BDD95CB2F434114C6FD0D96D65D5AD8B0B42376B622362291486C88C442626 +3819060A189854A4988054917E2FD4A4BC43BA242545BFAD097BEB455F5F8DC73 +EF54AFA90CF558F04B4E7266EECD7C933373E6CBC32FF3CF04F2B5E72818B240A +3B3A2506F43F1F8254A27AF503EE540A5C189AA19376AE7AFD1B0EC41F39A176D +1B7E746C05D0BB7B83C1C310868FC398388DB2D514DE086874172C7B1FADB4088 +508A14089B463114667420E1142818A6907CBBE8E50A05AAAF177110A34AE7859 +96C11CB887FE24024B28C56614561D71985C776C944128D0BEE9679942F7CE0D6 +6AC31F8138FD2F9D8114C3EC9F3D6700A9367D1DC05FAF6822CCBA64CBAAACB57 +7139AF5FF460E932FE3A56231418954A617225E45073FFF48C9A59E57C5A8D3E1 +82CB7D049777EC41C91E788818310666D31B1007DA49FE8673554AA397B1C4D52 +735133A6A368CC267F23D21BA34DAAC912E0E9D90DA26B3BC0461968E1F4E26AF +8320B05FAF783F2AE8EFC49B8630F4829672C438BBF27CC5F14A140DD82072DEB +3E746E2BBB557731958C8287BFEA1F962857F866FD7101FEB9C949E0338F1DFF6 +0E624F099E79A7FF2B304C834C83CC844C84CC854C85CC864C86CC874C87CC884 +C88CC894C89CC8A4C8ACA83FD4BC11F80DFEBA00F002CD0C9338BD4F383600000 +00049454E44AE42608200"; + return r; + end + +end + + +//******************************* +type TDForm = class(TDComponent) +{** + @explan(˵) %% +**} + private + static FClassName; + static FParser; + function savecurrentform(o,e); + begin + cp:=o.Component; + if not cp then exit; + nd := cp.TreeNode; + if nd then d := nd.owner.Designer; + if d then + begin + d.saveCurrentForm(); + //d.openclassfile(); + end + end + function OpenClass(o,e); + begin + cp:=o.Component; + if not cp then exit; + nd := cp.TreeNode; + if nd then d := nd.owner.Designer; + if d then + begin + d.openclassfile(); + end + end + public + function menus();override; + begin + r := array(); + //r[0] := array("type":"menu","caption":"洰"); + r[0] := array("type":"menu","caption":"tsfļ","onclick":thisfunction(OpenClass)); + r[1] := array("type":"menu","caption":"浱ǰ","onclick":thisfunction(savecurrentform)); + //r[2] := array("type":"menu","caption":"򿪹Ŀ¼","onclick":thisfunction(openProjectDir)); + return r; + end + function InToolBar();override; + begin + return false; + end + function ComponentCreater(tnode,owner);virtual; + begin + r := inherited; + return r; + end + function classification();override; + begin + return "ǵӿؼ"; + end + class function HitTip();override; + begin + return "\r\nڹfile\r\nfile managerй"; + end + class function ClassName(v);override; + begin + if ifstring(v) and v then + begin + FClassName := v; + end + if not FClassName then return "tdcreateform"; + return FClassName; + end + function bitmapinfo();override; + begin + return "0507000000060400000074797065000203000000626D700006050000007769647 +468000010000000060C000000626D776964746862797465730000400000000608 +000000626D706C616E6573000001000000060B000000626D62697473706978656 +C0000200000000606000000686569676874000010000000060500000062797465 +73000200040000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000CEA47CFFCFA47CFFD0A57DFFD0A57CFFD0A57CFFD0A47 +BFFCFA47BFFCFA37BFFCDA27AFFCCA179FFCAA078FFC89E77FFC69D76FFC49B75 +FFC29A74FF00000000CFA47CFFD0A57CFFD1A57CFFD1A57CFFD1A57CFFD1A47BF +FD0A47BFFCFA37AFFCEA279FFCCA178FFCB9F77FFC89E76FFC69C75FFC49B74FF +C29973FF00000000D0A57CFFD1A57CFFD1A57CFFD1A57CFFD1A57BFFD1A47AFFD +0A379FFCFA379FFCEA278FFCDA077FFCA9F76FFC89D75FFC69B73FFC49A72FFC2 +9972FF00000000D0A57CFFFCFCFCFFFDFDFDFFFEFEFEFFFEFEFEFFFEFEFEFFFDF +DFDFFFCFCFCFFFBFBFBFFF9F9F9FFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFC198 +70FF00000000CFA47CFFFCFCFCFFFDFDFDFFFDFDFDFFFEFEFEFFFEFEFEFFFDFDF +DFFFCFCFCFFFBFBFBFFF9F9F9FFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFC1976F +FF00000000CFA47BFFFBFBFBFFFCFCFCFFFDFDFDFFFDFDFDFFFDFDFDFFFCFCFCF +FFBFBFBFFFAFAFAFFF8F8F8FFF6F6F6FFF3F3F3FFF0F0F0FFEDEDEDFFC0966EFF +00000000CEA37AFFFAFAFAFFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFFF +AFAFAFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFEFEFEFFFEDEDEDFFC0956CFF00 +000000CCA179FFF8F8F8FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FFF8F +8F8FFF7F7F7FFF5F5F5FFF3F3F3FFF1F1F1FFEFEFEFFFEDEDEDFFBF946CFF0000 +0000CAA078FFF5F5F5FFF6F6F6FFF7F7F7FFF7F7F7FFF7F7F7FFF6F6F6FFF6F6F +6FFF5F5F5FFF3F3F3FFF1F1F1FFF0F0F0FFEEEEEEFFECECECFFBE936BFF000000 +00C89E77FFF3F3F3FFF3F3F3FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF3F3F3F +FF3F3F3FFF1F1F1FFF0F0F0FFEEEEEEFFEDEDEDFFEBEBEBFFBE936AFF00000000 +C69D76FFF0F0F0FFF1F1F1FFF1F1F1FFF1F1F1FFF1F1F1FFF0F0F0FFF0F0F0FFF +0F0F0FFEFEFEFFFEDEDEDFFECECECFFEBEBEBFFEAEAEAFFBD936AFF00000000C4 +9B75FFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFFEDE +DEDFFECECECFFEBEBEBFFEAEAEAFFEAEAEAFFE9E9E9FFBD936BFF00000000C29A +74FFC29973FFC29972FFC19870FFC1976FFFC1966EFFC0956DFFC0956CFFC0946 +BFFBF946BFFBE936AFFBE936AFFBD926AFFBD936BFFBD936BFF00000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000"; + end + function ClassObject();override; + begin + return class(TDForm); + end + function WndClass();override; + begin + return class(tvcform); + //return class(TDCreateForm); + end + function create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onclose", + "name":"close", + "virtual":true, + "param":array("o","e"), + "body": + " + {** + @explan(˵) ڹرջص %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ǰ %% + **} + if MessageBoxA('Ƿرյǰ','ر',MB_YESNO,o)<>IDYES then e.skip := true; +"); + end +end +type TDPanelForm = class(TDForm) +{** + @explan(˵) %% +**} + function ClassObject();override; + begin + return class(TDPanelForm); + end + function WndClass();override; + begin + return class(TpanelForm); + //return class(TDCreatePanel); + end + function create(AOwner);override; + begin + inherited; + end +end + + +//**************TPanel************************** +type TDPanel = class(TDComponent) + class function HitTip();override; + begin + return "ؼ"; + end + + class function ClassName();override; + begin + return "tpanel"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002CA00000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000005F49444154 +5847EDD7B109C0300C05D1ECBF812AADA94EC1453A91AB4C1CB80F571ABDD6571 +F36413441B41194991D115B5B37A68DA0F5A0AAB6B66E4C13F42488124409A204 +5182284194204A1025881244FD1B74DC47F1CB09A2097A5FF70DF185865E9BB41 +DE30000000049454E44AE42608200"; + end + function ClassObject();override; + begin + return class(TDPanel); + end + function WndClass();override; + begin + return Class(tpanel); + end + function ComponentCreater(node,pt);override; + begin + r := inherited; + return r; + if r then + begin + r.Cwnd.Color := rgb(240,240,240); + end + return r; + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := "no"; + end + + +end +//**************groupbox************************** +type TDGroupBox = class(TDComponent) +{** + @explan(˵) groupboxؼ +**} + class function HitTip();override; + begin + return ""; + end + class function ClassName();override; + begin + return "tgroupbox"; + end + + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020B01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000A049444154 +484BCD91510A83301044BD92782B2F90DF9CA11F3D8FED358A7894C8424736B0A +43B89A11978B0129D67922975CE7F04EB732FC2E41284F0B8B04A35FA5D0B9D4C +8058A59A52A4E7BDBDBE4F86E0383ED548F138821863F6B107B740CAE5AC2199E +7E527940012CC5E28410DE3EC80BD035A0009662F94A0867176C0DE81400920C1 +EC8512D4E012C8620B45C15D980289FE9356904CD0239D05299D037BBA604E978 +76D0000000049454E44AE42608200"; + end + function ClassObject();override; + begin + return class(TDGroupBox); + end + function WndClass();override; + begin + return Class(tgroupbox); + end + function Create(AOwner);override; + begin + inherited; + end + +end +//*****************Check GroupBox************************ +type TDBtn = class(TDComponent) + class function HitTip();override; + begin + return "ť"; + end + function IsContainer();override; + begin + return false; + end + class function ClassName();override; + begin + return "tbtn"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002A101000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000013649444154 +484BED95416A83401486BD5537D90A929D8A0B1123928D889B627B93D21E21076 +87B80B408AD8A95E042415C4430907887BFBC81144D44A1D14221031F8CCFF7E6 +1B477C7298785C0583637AC1C3F316B3BB4FDCDC7E8C0AADF9F8B2054793F7B84 +45DD7A3F2F6556276EF83235B57C218D0DABF12A469DA193F655090651996CB25 +0CC380A669088280C5154539CBED6250208A22C23064F33CCFC1F33CF6FBFD8F6 +0B3D9A0288A564D935E4155559065B915B32C0B51143181E779505515BBDDAE95 +D3A45750962524496AC54840BB160401F3F99C6DA279FF945E01418BC471CCE67 +444747D381CD813388E83D56A7556D36450902409168B054CD384AEEBEC7828EE +BA2E7B17B66DC3F7FDB3BA2383824BF91B01B50AFAACBB122E617D6C15D490A66 +A764FAFE5F587333CFEBB00F8061B912011B78C94420000000049454E44AE4260 +8200"; + end; + function ClassObject();override; + begin + return class(TDBtn); + end + function WndClass();override; + begin + return Class(tbtn); + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onclick", + "name":"clk", + "virtual":true, + "param":array("o","e"), + "body": +" + {** + @explan(˵) ص %% + @param(e)(tuievent) Ϣ %% + @param(o)(tbtn)ť %% + **} + MessageBoxA(o.caption+':','ʾ',0,o); +" + ); + end + +end +//*****************TPairSplitter******************************* +type TDPairSplitterSide = class(TDComponent) + class function HitTip();override; + begin + return "PairSplitterSide\r\nsplitterؼҼ"; + end + class function ClassName();override; + begin + return "tpairsplitterside"; + end + function classification();override; + begin + return "ǵӿؼ" ; + end + function menus();override; + begin + r := inherited; + return select * from r where ["caption"]="ɾ" end ; + end + function InToolBar();override; + begin + return false; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002E601000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017B49444154 +384FA592DB4EC24010867D5E51349C29F8128AA82082808F81882184A0507C0CC +E6728C7DFFDDB6E5D9B182FD8E4BBE874E6DBD9DD39C191CB14C48B2D818EAB97 +36E236B122D1112BE8D0F24D449F3F11C935107EAA2394A92198AE22907A9702D +D2EFC728815491B9A1044F32D4484209CFD404808828F350484C0FF2005EE6281 +2604D1425BA0232204E15C13A16C03C14C1DFE740DBE54153E55B0DBEDB0DFEF7 +1381C1CF8CDF876BBC57ABDC672B9C46C36C36432C17038C4E57DE5E70852A04A +FE135CDCD9025E169354895ABCD96C60188623188FC7180C06F026DF2C8156689 +9494C76C338775FAD56582C16984EA7188D46A6E0ECD616F089B80313DD302E8B +65FB8E2051B6047C5F26B045264BF84DD462B6CFF3F7FB7D786E5E2D018783096 +43E9FFF42C6D562EEDEEBF5702A059C2CFE64920A6312D936776671B7DB158292 +25E058D2FC17EE42D2E974C4116C01679A63C9C9E270F07DBDC90ACEC52DF3A63 +D0952365B36B92E99C58EE09875A400F80678339550E1D72CF30000000049454E +44AE42608200"; + end + function ClassObject();override; + begin + return class(TDPairSplitterSide); + end + function WndClass();override; + begin + return Class(TPairSplitterSide); + end + function CheckParentWnd(Pwnd);override; + begin + {** + @explan(˵) ڵж %% + **} + r := Pwnd is class(TPairSplitter); + if (not r) and (Pwnd is class(TWincontrol) ) then Pwnd._wapi.MessageBoxA(Pwnd.Handle,"Ҫ TPairSplitter Ϊ","ʧ",0); + return r; + end + + function Create(AOwner);override; + begin + inherited; + end +end +type TDPairSplitter = class(TDComponent) + class function HitTip();override; + begin + return "ɶԷ"; + end + class function ClassName();override; + begin + return "tpairsplitter"; + end + function AddsplitterSide(o,e);override; + begin + cp := o.Component; + r := (GetDCompObject("tpairsplitterside")).ComponentCreater(cp.TreeNode,cp.Cwnd); + if not r then exit; + r.CreateName(); + tr := r.TreeNode.owner.Designer; + tr.BindCwndMessage(r.Cwnd); + tr.VariableSelecter.additem(r); + end + function menus();override; + begin + r := inherited; + r[length(r)] := array("type":"menu","caption":"splitterside","onclick":thisfunction(AddsplitterSide)); + return r; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023301000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000C849444154 +484B63F84F63304C2C983973264E0C02870E1CC4C020804D3D0CC3005E1FC0148 +20CBC7FFF361C97974F028B231B840B0C2E0B40060F0D1F3C7BFB1D4C136B014C +3D368061C18B77DFFF07371C07B3D12DC01544FEB5C7FE3F79FD0DCC46072816C +00CB7C8D907E613EB03907A5C96C02D40369C5C8CCD12B8059913CE61D5442A06 +99830CE8E70310A0691CC0004D53110CD0341F2003622DC00748B2005710E1038 +3CB07645B0052880B8300C80290A1C81804B0A9876118C0EB036A001A5BF0FF3F +008B200E0EE56C49BF0000000049454E44AE42608200"; + end + function ClassObject();override; + begin + return class(TDPairSplitter); + end + function WndClass();override; + begin + return Class(TPairSplitter); + end + function CheckChild(dcmp);override; + begin + return dcmp is Class(TDPairSplitterSide); + end + function Create(AOwner);override; + begin + inherited; + end + function ComponentCreater(tnode,owner);override; + begin + {** + @explan(˵) ½ڵ㴰 %% + @param(tnode)(TComponentTreeNode) ڵ %% + @param(owner)(TWincontrol) %% + @return(TDComponent|0)ɹضʧ0%% + **} + o := inherited; + //if o then o.Cwnd.color := rgb(200,200,200); + return o; + end + +end +type TDTabSheet = class(TDComponent) + function CheckParent(p,pwnd);override; + begin + if not (p is class(TDPage)) then return 0; + return inherited; + end + class function HitTip();override; + begin + return "pagesheet\r\npageؼҼ"; + end + class function ClassName();override; + begin + return "ttabsheet"; + end + function classification();override; + begin + return "ǵӿؼ"; + end + function SelectedNode();override; + begin + if Cwnd is class(ttabsheet) then + begin + pc := Cwnd.Parent; + if pc is class(TPageControl) then + begin + pc.cursel := Cwnd; + end + end + inherited; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002AE01000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000014349444154 +384FAD92C94AC4501045FBAFFC1657BA722B7E862E04FDAA86A61511119C5A5D6 +44E77E639B9D67DCD4B7A08226AE040A0EA5C2A55991C9C4DF11754002693D1E2 +4FF8A709469EB66DD1340DEABA465996288A02799E234D53244982388EC7030EC +FE77B1C5FDEE2E6C9EDE5288A1086E17E40D7754A68E5BDE9805AA884FBCF1827 +D777983DDABDBC5AADB603F4C80C28242113522111E206982D221CC9244110287 +9B95C0E015AAEAA4A0544229C5E5CF5F835E009AC51F47D1F9EE70D015C14652E +8B4D6C7605A7022CC1140C8135CAAEEBC2719C2180B2DE329BD8BC3901792FD60 +15AB62C6B08A09C6599DA329B3E4A6021C29BF02ABCE4C0B3C09A6DDB4A364D73 +08D0326FCB2636EF4EF090AD03281A86A1E803F48FC113B189CD63B0A6E5AD00C +ABC2D4FC4A6EF180DD03F863E915E14BF7773E45DFA80DF33C517615C294C8193 +B0280000000049454E44AE42608200"; + end + function menus();override; + begin + r := inherited; + return select * from r where ["caption"]="ɾ" end ; + end + function InToolBar();override; + begin + return false; + end + function ClassObject();override; + begin + return class(TDTabSheet); + end + function WndClass();override; + begin + return Class(TTabSheet); + end + function Create(AOwner);override; + begin + inherited; + end +end +type TDPage = class(TDComponent) + class function HitTip();override; + begin + return "ҳؼ"; + end + class function ClassName();override; + begin + return "tpagecontrol"; + end + function addtabsheet(o,e); + begin + cp := o.Component; + r := (GetDCompObject("ttabsheet")).ComponentCreater(cp.TreeNode,cp.Cwnd); + if not r then exit; + r.CreateName(); + cp.TreeNode.expand(); + tr := r.TreeNode.owner.Designer; + tr.BindCwndMessage(r.Cwnd); + tr.VariableSelecter.additem(r); + end + function menus();override; + begin + r := inherited; + r[length(r)] := array("type":"menu","caption":"tabsheet","onclick":thisfunction(addtabsheet)); + return r; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023001000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000C549444154 +5847ED97C10A84201400F76BA36E7EB5274F9A969AB9BC43B1CBEAB30EED53706 +02E29398181BE6265F4A0123DA8C419C4188BC330A0C29CA7398360C112E338FE +441E4ED3947C0EDEF9905B413087739E14C6841049AFBCFBA0EEA07DDF51FF1E1 +44240AD2E08DBB8D818F633809F9BFE2B68DB361261ED83BA83BCF72466839C73 +24B61364AD25311BB4AE2B89ED042DCB426236C81843623B415A6B12DB099AE79 +9C46C90528AC47682A49424B61174E5A2F894C9236C2DF4A0123D0827C637259C +FCE218FD50E80000000049454E44AE42608200"; + end + function CheckChild(cd);override; + begin + return cd is class(TDTabSheet); + end + function ClassObject();override; + begin + return class(TDPage); + end + function WndClass();override; + begin + return Class(TPageControl); + end + function Create(AOwner);override; + begin + inherited; + end +end +//************TImageList*********************** +type TDVirutalWindow = class(TCustomControl) +{** + @explan(˵) ǿӿؼĴ %% +**} + private + FBitmap; + FBindComponent; + FWindowFileds; + function SetBindComponent(v); + begin + if v is class(TComponent) then + begin + FBindComponent := v; + end + end + protected + function deletefiled(r); + begin + {** + @explan(˵)ɾģⴰе %% + **} + rdx := array(); + for i,v in FWindowFileds do rdx[v] := nil; + reindex(r,rdx); + return r; + end + function getnotnil(ra); + begin + r := array(); + for i,v in FWindowFileds do + begin + if v="name" then continue; + rav := ra[v]; + if not ifnil(ra[v]) then r[v] := rav; + end + return r; + end + public + function Create(AOwner);override; + begin + inherited; + width := 30; + height := 30; + FWindowFileds := array("left","top","height","width"); + end + function paint();override; + begin + //canvas.draw("polyline",array((0,0),(20,0),(20,20),(0,20))); + canvas.StretchDraw(array(0,0,30,30),GetBitmap()); + end + function GetBitmap(); + begin + if not FBitmap then + begin + FBitmap := new tbitmap(); + FBitmap.Readvcon(HexFormatStrToTsl(bitmapinfo())); + end + return FBitmap; + end + function bitmapinfo();override; + begin + return nil; + end + function GetPublishProperties();override; + begin + r := inherited; + r := r[FWindowFileds]; + if not FBindComponent then return r; + r2 := FBindComponent.GetPublishProperties(); + if r2 then + begin + deletefiled(r2); + return r union r2; + end + return r; + end + function GetPublishEvents();override; + begin + if FBindComponent then + begin + r := FBindComponent.GetPublishEvents(); + return r; + end + if not r then return array(1:nil); + return r; + end + function GetChangedPublish();override; + begin + r := getnotnil(inherited); + if not FBindComponent then exit; + r2 :=FBindComponent.GetChangedPublish(); + if r2 then + begin + deletefiled(r2); + r union= r2; + end + return r; + end + function SetPublish(n,v);override; + begin + if n in FWindowFileds then + begin + return inherited; + end + if FBindComponent then + begin + return FBindComponent.SetPublish(n,v); + end + end + function DesigningSizer();override; + begin + return false; + end + function Recycling();override; + begin + inherited; + if FBindComponent is class(TComponent) then + begin + FBindComponent.Recycling(); + FBindComponent := nil; + end + end + property BindComp read FBindComponent write SetBindComponent; + property WindowFileds read FWindowFileds write FWindowFileds; + {** + @param(BindComp)(tcomponent) 󶨵Ŀؼ %% + @param(WindowFileds)(array of string) ؼ %% + **} + +end +type TDFileWindow = class(TDVirutalWindow) +{** + @explan(˵) ļѡ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TOpenFileADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetOpenFileBitmapInfo(); + end +end +type TDFileSaveWindow = class(TDVirutalWindow) +{** + @explan(˵) ļѡ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TSavefileADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetSaveFileBitmapInfo(); + end +end +type TDInputQuerysWindow = class(TDVirutalWindow) +{** + @explan(˵) ļѡ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TInPutQuerys(self);; + end + function GetPublishEvents();override; + begin + return array(); + //return array(1:nil); + end + function bitmapinfo();override; + begin + return GetInputquerysBitmapInfo(); + end +end + +type TDColorChooseWindow = class(TDVirutalWindow) +{** + @explan(˵) ɫѡؼ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TColorChooseADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetColorChooseBitmapInfo(); + end +end +type TDFontChooseWindow = class(TDVirutalWindow) +{** + @explan(˵) ɫѡؼ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TFontChooseADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetFontChooseBitmapInfo(); + end +end +type TDFolderChooseWindow = class(TDVirutalWindow) +{** + @explan(˵) ɫѡؼ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TFolderChooseADlg(self);; + end + function GetPublishEvents();override; + begin + return array(1:nil); + end + function bitmapinfo();override; + begin + return GetFolderChooseBitmapInfo(); + end +end + +type TImageListWindow = class(TDVirutalWindow) +{** + @explan(˵) imagelist %% +**} + public + function Create(AOwner);override; + begin + inherited; + WindowFileds := array("left","top","height","width"); + BindComp := new TControlImageList(self);; + end + function bitmapinfo();override; + begin + return GetImageListBitmapInfo(); + end + +end +type TDImageList = class(TDRootComponent) +{** + @explan(˵)imagelist ƿؼ %% +**} + class function HitTip();override; + begin + return "ͼб"; + end + class function ImageId();override; + begin + return 12; + end + function bitmapinfo();override; + begin + return GetImageListBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TControlImageList); + end + class function ClassName();override; + begin + return "tcontrolimagelist"; + end + function menus();override; + begin + r := inherited; + //r[length(r)] := array("type":"menu","caption":"༭","onclick":nil); + return r; + end + function ClassObject();override; + begin + return class(TDImageList); + end + function WndClass();override; + begin + return Class(TImageListWindow); + end + function Create(AOwner);override; + begin + inherited; + end + function GetPublishProperties();override; + begin + r := inherited; + return r[ array("name","top","left","images","imgwidth","imgheight")]; + end + +end +//******************label******************* +type TGraphicLabelWindow = class(TDVirutalWindow) +{** + @explan(˵) label ؼ %% +**} + + function paint();override; + begin + canvas.Font := font; + al := BindComp.TextAlign; + BindComp.CanvasDrawAlignText(self.canvas,self.ClientRect,self.caption,al); + end + function SetPublish(n,v);override; + begin + r := inherited; + if n="bkbitmap" then bkbitmap := v; + if (n="textalign" or n="caption" or n="font" or n="bkbitmap") then InvalidateRect(nil,true); + return r; + end + function Create(AOwner);override; + begin + inherited; + BindComp := new tlabel(self); + width := BindComp.width; + height := BindComp.Height; + WindowFileds := array("left","top","width","height","color","font","caption","visible","align","anchors"); + end + + function DesigningSizer();override; + begin + return true; + end +end + +type TDLabel = class(TDComponent) +{** + @explan(˵) labelؼ %% +**} + class function HitTip();override; + begin + return "̬ı"; + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(tlabel); + end + class function ClassName();override; + begin + return "tlabel"; + end + function ClassObject();override; + begin + return class(TDLabel); + end + function WndClass();override; + begin + return Class(TGraphicLabelWindow); + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100026B03000089504E470D0A1A0A0000000D4948445200000024000000240806 +000000E1009898000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000030049444154 +5847ED95F94F134114C7FDAFD488B73F6922C6C478FF6A4C20A0164C4004B1A08 +9261A148207225034C1185083E281504A6D2986C3022D7297231469A172B4F4E2 +39EF31EB76D9BA1B43C4FEB09F64D37933B333DF7DF37DD32D90606882D4D004A +9A109524313A48626480D55419E9F4198F6067824A7A8761074A5DF78B4711405 +45A2AB7028DB0CDB529B6072D6CF7BA5E45739E0ECCD761E6D1C454126FB2CEC4 +86B26518FDF8EF05E299B2A28F3A11D528ABAA0F0991392732C105D5DE523229B +26C8BB10A4ECD45BA7A173601EB6A63481CDE9E5A32282A050380A559F5C905ED +C0DE925DD50D33C01E188FC03267EF8C977A9F7BA686EF1AB21580945F9A88220 +035B7CD705232CFAC38089399A67859CF25E3E2A82824E15DA28939798B9CBDE8 +DC29527BDE4BB6CF61B4B2BB3C04EB6E6C9021B0929793D4CED59DF0A9FA120E8 +84DE06B94FFB7804F0A87E0492D28C30BF18E23D6BA020CCDE7A8F5537BAA8BF8 +36517996319DFAB6B818C0776CAA600DA20CA8A4720AE20FBB08F16B3F6894784 +A9C6AF7E619CE03D6BA0A0DD175B201411374170D3A4742394378C52FCFCF338B +D3F332F66231E7105A189D13F2F5B26A1CE3CF5FB399865863337A406168E2C1E +78CC85D54E6A5F3738E070CE176A2B2113E40F46609FCE047BD8571FC834491E4 +C3966CEE95AE0B34553C703DFB955F39DDA79157D907CD5426D256482B0AA70D3 +81C945DE23820647A3DFE69B202808378EF50132E65EA6756A5BA72846B36F4F6 +D66060E52FC276482CEDFED84E3FA361EC9C10ADA9F618200CB242298BAF2C318 +C508FA47C7CC8B99F62DAD15C19427409EBACCEEB6D832C7228935B94410FE3DA +0F12A62165F8FD5E12501EFBFBA294641C7F2DBE034F3D6B93B1D50C03C83317A +B0B17386E60834B4BBA9FF48AE05AE553A20ABAC876C105BB91241FDE30B50F5D +1A598563C1A2CE9D61E0FC566F68BC7BC1408D3DDA53738A1F4CD308C4E2FD3F8 +7A5C33CB7485E0BCFB7543D0DE3F47F79C80ECC8FE37124178147FF3FC0B123B4 +3898026480D4D901A9A2035124C10C02FFABD674D6A547CAC0000000049454E44 +AE42608200"; + end + function Create(AOwner);override; + begin + inherited; + end +end +//****************timmer**************************** +type TTimerWindow = class(TDVirutalWindow) +{** + @explan(˵)timmer %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new Ttimer(self); + end + function bitmapinfo();override; + begin + return GetTimerBitmapInfo(); + end +end +type TDTimer = class(TDRootComponent) +{** + @explan(˵) timmer ؼ %% +**} + class function HitTip();override; + begin + return "ʱ"; + end + + function bitmapinfo();override; + begin + return GetTimerBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TTimer); + end + class function ClassName();override; + begin + return "ttimer"; + end + function menus();override; + begin + r := inherited; + //r[length(r)] := array("type":"menu","caption":"༭","onclick":nil); + return r; + end + + + function ClassObject();override; + begin + return class(TDTimer); + end + function WndClass();override; + begin + return Class(TTimerWindow); + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"ontimer", + "name":"time", + "virtual":true, + "param":array("o","e"), + "body": +" + {** + @explan(˵) ʱ %% + @param(e)(tuievent) Ϣ %% + @param(o)(ttimer) ʱ %% + **} +" + ); + end + +end +//**************FMainMenu******************************** +type TMainMenuWindow = class(TDVirutalWindow) +{** + @explan(˵) ˵ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TMainmenu(self); + end + function bitmapinfo();override; + begin + return GetMainMenuBitmapInfo(); + end + + +end + +type TTrayWindow = class(TDVirutalWindow) +{** + @explan(˵) imagelist %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TTray(self);; + end + function bitmapinfo();override; + begin + return GetTrayBitmapInfo(); + end + +end +//**********actionlistwindow********************** +type TActionListWindow = class(TDVirutalWindow) +{** + @explan(˵) actionlist %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TActionList(self); + end + function bitmapinfo();override; + begin + return GetActionListBitmapInfo(); + end +end +//***********opendlg***************** +type TDOpenFileADlg = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "ļѡ"; + end + function classification();override; + begin + return "Ի"; + end + function bitmapinfo();override; + begin + return GetOpenFileBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TOpenFileADlg); + end + class function ClassName();override; + begin + return "topenfileadlg"; + end + function ClassObject();override; + begin + return class(TDOpenFileADlg); + end + function WndClass();override; + begin + return Class(TDFileWindow); // + end + function Create(AOwner);override; + begin + inherited; + end + +end +//***********savefile*************************** +type TDSaveFileADlg = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "ļѡ"; + end + function bitmapinfo();override; + begin + return GetSaveFileBitmapInfo(); + end + function classification();override; + begin + return "Ի"; + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TSavefileADlg); + end + class function ClassName();override; + begin + return "tsavefileadlg"; + end + function ClassObject();override; + begin + return class(TDSaveFileADlg); + end + function GetPublishProperties();override; + begin + r := inherited; + if r then + reindex(r,array("multiselected":nil)); + return r; + end + function WndClass();override; + begin + return Class(TDFileSaveWindow); // + end + function Create(AOwner);override; + begin + inherited; + end + +end +//************querys************************************** +type TDInputQuerys = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "Ի"; + end + function bitmapinfo();override; + begin + return GetInputquerysBitmapInfo(); + end + function classification();override; + begin + return "Ի"; + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TInPutQuerys); + end + class function ClassName();override; + begin + return "tinputquerys"; + end + function ClassObject();override; + begin + return class(TDInputQuerys); + end + function WndClass();override; + begin + return Class(TDInputQuerysWindow); // + end + function Create(AOwner);override; + begin + inherited; + end + +end + +//***********colorchoose******************************* +type TDColorChoose = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "ɫѡ"; + end + function bitmapinfo();override; + begin + return GetColorChooseBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function classification();override; + begin + return "Ի"; + end + function ComponentClass();override; + begin + return class(TColorChooseADlg); + end + class function ClassName();override; + begin + return "tcolorchooseadlg"; + end + function ClassObject();override; + begin + return class(TDColorChoose); + end + function WndClass();override; + begin + return Class(TDColorChooseWindow); // + end + function Create(AOwner);override; + begin + inherited; + end +end +//*************font choose ********************************** +type TDFontChoose = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "ѡ"; + end + function classification();override; + begin + return "Ի"; + end + function bitmapinfo();override; + begin + return GetFontChooseBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TFontChooseADlg); + end + class function ClassName();override; + begin + return "tfontchooseadlg"; + end + function ClassObject();override; + begin + return class(TDFontChoose); + end + function WndClass();override; + begin + return Class(TDFontChooseWindow); // + end + function Create(AOwner);override; + begin + inherited; + end +end +//**************folder********************* +type TDFolderChoose = class(TDRootComponent) +{** + @explan(˵) ļ򿪿ؼ %% +**} + class function HitTip();override; + begin + return "Ŀ¼ѡ"; + end + function classification();override; + begin + return "Ի"; + end + function bitmapinfo();override; + begin + return GetFolderChooseBitmapInfo(); + end + function IsContainer();override; + begin + return false; + end + function ComponentClass();override; + begin + return class(TFolderChooseADlg); + end + class function ClassName();override; + begin + return "tfolderchooseadlg"; + end + function ClassObject();override; + begin + return class(TDFolderChoose); + end + function WndClass();override; + begin + return Class(TDFolderChooseWindow); // + end + function Create(AOwner);override; + begin + inherited; + end +end + +//****************toolbar*********************************** +type TDToolButton = class(TDComponent) +{** + @explan(˵) toolbar ťƿؼ %% +**} + class function HitTip();override; + begin + return "toolbutton"; + end + function classification();override; + begin + return "ǵӿؼ" ; + end + class function ClassName();override; + begin + return "ttoolbutton"; + end + function IsContainer();override; + begin + return false; + end + function InToolBar();override; + begin + return false; + end + function CheckParent(p,pwnd);override; + begin + if not(p is class(TDToolBar)) then return false; + pwnd := p.Cwnd; + return true; + end + function ClassObject();override; + begin + return class(TDToolButton); + end + + function WndClass();override; + begin + return Class(TToolButton); + end + function Create(AOwner);override; + begin + inherited; + end + function ComponentCreater(node,owner);override; + begin + r := inherited; + node.owner.expand(node); + return r; + end +end + +type TDToolBar = class(TDComponent) +{** + @explan(˵) toolbar ؼ %% +**} + private + function createabutton(o,n); + begin + cp := o.Component; + if not cp then exit; + if n=0 then + r := (GetDCompObject("ttoolbutton")).ComponentCreater(cp.TreeNode,cp.Cwnd); + if n=2 then + r := (GetDCompObject("ttoolsepbutton")).ComponentCreater(cp.TreeNode,cp.Cwnd); + if not r then exit; + r.CreateName(); + tr := r.TreeNode.owner.Designer; + tr.VariableSelecter.additem(r); + end + public + class function HitTip();override; + begin + return ""; + end + function DefaultAlign();override; + begin + return true; + end + class function ClassName();override; + begin + return "ttoolbar"; + end + function addtoolbutton(o,e); + begin + createabutton(o,0); + end + function addtoolbutton2(o,e); + begin + createabutton(o,2); + end + function menus();override; + begin + r := inherited; + r[length(r)] := array("type":"menu","caption":"ӹť","onclick":thisfunction(addtoolbutton)); + //r[length(r)] := array("type":"menu","caption":"ӹť","onclick":thisfunction(addtoolbutton2)); + return r; + end + function CheckChild(CD);override; + begin + return cd is class(TDToolButton); + end + function ClassObject();override; + begin + return class(TDToolBar); + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002BE01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000015349444154 +484BED953D4AC5501085C77DD8887BD0C645B8010B05155C811BB0114454B4119 +5B78654EE41105110440B9BFCE7BD972016BEC0E8B9E184686E7E40D288031F37 +8799CC979022A203D71F10388EA343225996695F7003CAD66B42D234D5BE5060E +B3521D3E95417B6776B6C1C5F6A14278A3EA180F9E960B946751EC86432310B59 +B89EE5B96E9D8D74EDF05C832852CC000A98B150DF1F4A90D923321E8F6B02D4C +72CD7CDD391AE1F5D28660005CC46905E97F02DAA340A509020B70AA2AB562449 +929AE027980114301B81BBA72F272BDF9EBA8AC4716C9634157A980114306381B +EEE14E7DBAD1589BE3E62970033800266B3F879B538BD7D2B128661A700338002 +66B3F871A914D9F8BDE06EBE38EF17AD4810049D02CC000A98CDE29BB9F2B421B +EEF9B256D600650C08CC55D88E779DA170A6CBD26C4755DED0B05B65E13C3FF0F +CC230D58FF828E52FD0481EEF4FA779294570000000049454E44AE42608200"; + end + function WndClass();override; + begin + return Class(TToolBar); + end + function Create(AOwner);override; + begin + inherited; + end + function ComponentCreater(tnode,owner);override; + begin + r := inherited; + //r.Cwnd.align := r.Cwnd.alnone; + return r; + end + +end +type TDStatusBar = class(TDComponent) +{** + @explan(˵) statusbarؼ %% +**} + class function HitTip();override; + begin + return "״̬"; + end + class function ClassName();override; + begin + return "tstatusbar"; + end + function ComponentCreater(tnode,owner);virtual; + begin + r := inherited; + //owner.DoControlAlign(); + return r; + end + function menus();override; + begin + r := inherited; + //r[length(r)] := array("type":"menu","caption":"ӹť","onclick":thisfunction(addtoolbutton)); + return r; + end + function ClassObject();override; + begin + return class(TDStatusBar); + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100025001000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000E549444154 +484BDD8E5106846014856757B3AED941DB6847F39088881E22A2878888F4D4B88 +77324535373FD0F33978FF3517DDD96C0F72781FBE3190C04E67906711C9BCABD +28304D136080EE4581711C0103742F0A0CC30018A07B51A0EF7BC000DD8B025DD +70106E85E1468DB163040BFCAF65D059AA6010CD0AF621745915C81BAAE0103F4 +6FB000B70255550106E867583FBFDE860265590206E867B0B3BFDE6E4381A2280 +003F4B3D847DF6D05F23C070CD0F7583FB3B70D05B22C030CD0F7B0B33F3DDA86 +02699A0206E847D8873E6D059224010CD0BD286023140884BC5F0F2CCB0BD5861 +2A5BA8CBF2E0000000049454E44AE42608200"; + end + function WndClass();override; + begin + return Class(TStatusBar); + end + function IsContainer();override; + begin + return false; + end + function Create(AOwner);override; + begin + inherited; + end + +end +type TDTray = class(TDRootComponent) +{** + @explan(˵) statusbarؼ %% +**} + class function HitTip();override; + begin + return ""; + end + class function ClassName();override; + begin + return "ttray"; + end + + function menus();override; + begin + r := inherited; + //r[length(r)] := array("type":"menu","caption":"ӹť","onclick":thisfunction(addtoolbutton)); + return r; + end + function ClassObject();override; + begin + return class(TDTray); + end + function CheckParentWnd(Pwnd);override; + begin + return (Pwnd is class(TVCForm)) ; + end + function bitmapinfo();override; + begin + return GetTrayBitmapInfo(); + end + function ComponentClass();override; + begin + return class(TTray); + end + function WndClass();override; + begin + return Class(TTrayWindow); + end + function Create(AOwner);override; + begin + inherited; + end + +end + +//*************˵*********************** +type TDMenuBase = class(TDRootComponent) +{** + @explan(˵) ˵ؼ %% +**} + function CheckChild(cd);override; + begin + return cd is class(TDMenu); + end + function addmenu(o,e); + begin + {** + @explan(˵)Ӳ˵ + **} + cp := o.Component; + r := (GetDCompObject("tmenu")).ComponentCreater(cp.TreeNode,cp.Cwnd); + r.CreateName(); + tr := r.TreeNode.owner.Designer; + tr.BindCwndMessage(r.Cwnd); + tr.VariableSelecter.additem(r); + end + function menus();override; + begin + r := inherited; + r[length(r)] := array("type":"menu","caption":"Ӳ˵","onclick":thisfunction(addmenu)); + return r; + end + function Create(AOwner);override; + begin + inherited; + + end +end +type TDMainMenu = class(TDMenuBase) +{** + @explan(˵) ˵ؼ %% +**} + class function HitTip();override; + begin + return "˵"; + end + function ComponentClass();override; + begin + return class(tmainmenu); + end + class function ClassName();override; + begin + return "tmainmenu"; + end + + function bitmapinfo();override; + begin + return GetMainMenuBitmapInfo(); + end + function CheckParentWnd(Pwnd);override; + begin + return (Pwnd is class(TVCForm)) ; + end + function ClassObject();override; + begin + return class(TDMainMenu); + end + function WndClass();override; + begin + return Class(TMainMenuWindow); + end + function Create(AOwner);override; + begin + inherited; + end + +end + +type TDMenu = class(TDMenuBase) +{** + @explan(˵) ͨ˵ؼ %% +**} + class function HitTip();override; + begin + return "menu\r\nͨҼ"; + end + function classification();override; + begin + return "ǵӿؼ" ; + end + class function ClassName();override; + begin + return "tmenu"; + end + + function InToolBar();override; + begin + return false; + end + function WndClass();override; + begin + return class(tmenu); + end + function ClassObject();override; + begin + return class(TDMenu); + end + function Create(AOwner);override; + begin + inherited; + + end + function CheckParent(p,pwnd);override; + begin + r := (p is class(TDMenu)) or + (p is class(TDMainMenu)) or + (p is class(TDPopUpMenu)); + Pwnd := p.GetTrueComponent; + return r; + end + private + function ifmainmenunode(pwnd); + begin + if pwnd is class(tmainmenu) then return true; + if pwnd is class(tmenu) then + begin + return ifmainmenunode(pwnd.parent); + end + return false; + end + public + function SetViewParent(wnd,pwnd);override; + begin + if ifmainmenunode(pwnd) then wnd.parent := pwnd; + end + function ComponentCreater(node,owner);override; + begin + r := inherited; + node.owner.expand(node); + return r; + end + +end +type TDAction = class(TDComponent) +{** + @explan(˵) actionؼ %% +**} + class function HitTip();override; + begin + return "taction\r\nͨҼ"; + end + function IsContainer();override; + begin + return false; + end + function classification();override; + begin + return "ǵӿؼ" ; + end + function InToolBar();override; + begin + return false; + end + function CheckParent(dcomp,Pwnd);override; + begin + if dcomp is class(TDActionList) then return TRUE; + Pwnd := dcomp.Cwnd; + return false; + end + + class function ClassName();override; + begin + return "taction"; + end + function ClassObject();override; + begin + return class(TDAction); + end + function WndClass();override; + begin + return Class(taction); + end + function ComponentCreater(node,owner);override; + begin + r := inherited; + node.owner.expand(node); + return r; + end + function create(AOwner);override; + begin + inherited; + end +end +type TDActionList = class(TDRootComponent) +{** + @expand(˵)actionlist ؼ %% +**} + class function HitTip();override; + begin + return "actionlist"; + end + function CheckChild(cd);override; + begin + return cd is class(TDAction); + end + function bitmapinfo();override; + begin + return GetActionListBitmapInfo(); + end + + + function addaction(o,e); + begin + cp := o.Component; + r := (GetDCompObject("taction")).ComponentCreater(cp.TreeNode,cp.Cwnd); + r.CreateName(); + tr := r.TreeNode.owner.Designer; + tr.VariableSelecter.additem(r); + end + + function menus();override; + begin + + r := inherited; + r[length(r)] := array("type":"menu","caption":"add action","onclick":thisfunction(addaction)); + return r; + end + function ComponentClass();override; + begin + return class(tactionlist); + end + class function ClassName();override; + begin + return "tactionlist"; + end + function ClassObject();override; + begin + return class(TDActionList); + end + function WndClass();override; + begin + return Class(TActionListWindow); + end + function Create(AOwner);override; + begin + inherited; + end + + + +end +//**************FMainMenu******************************** +type TPopUpMenuWindow = class(TDVirutalWindow) +{** + @explan(˵) ˵ⴰ %% +**} + public + function Create(AOwner);override; + begin + inherited; + BindComp := new TPopUpmenu(self); + end + function bitmapinfo();override; + begin + return GetPopUpMenuBitmapInfo(); + end +end +type TSocketServerWindow = class(TDVirutalWindow) + function Create(AOwner);override; + begin + inherited; + BindComp := new TSocketServer(self); + end + function bitmapinfo();override; + begin + return GetServerBitmapInfo(); + end +end +type TSocketClientWindow = class(TDVirutalWindow) + function Create(AOwner);override; + begin + inherited; + BindComp := new TSocketClient(self); + end + function bitmapinfo();override; + begin + return GetClientBitmapInfo(); + end +end +type TClipBordWindow = class(TDVirutalWindow) + function Create(AOwner);override; + begin + inherited; + BindComp := new TClipBoard(self); + end + function bitmapinfo();override; + begin + return GetClipboardBitmapInfo(); + end +end +//********************* +type TQuotationWindow = class(TDVirutalWindow) + function Create(AOwner);override; + begin + inherited; + BindComp := new TQuotations(self); + end + function bitmapinfo();override; + begin + return GetQuotationBitmapInfo(); + end +end +type TLoginWindow = class(TDVirutalWindow) + function Create(AOwner);override; + begin + inherited; + BindComp := new tlogincontrol(self); + end + function bitmapinfo();override; + begin + return GetLoginBitmapInfo(); + end +end + +type TDPopUpMenu = class(TDMenuBase) +{** + @explan(˵) ˵ؼ %% +**} + class function HitTip();override; + begin + return "Ҽ˵"; + end + function libs();override; + begin + return array(); + end + function ComponentClass();override; + begin + return class(tpopupmenu); + end + class function ClassName();override; + begin + return "tpopupmenu"; + end + + function bitmapinfo();override; + begin + return GetPopUpMenuBitmapInfo(); + end + + function ClassObject();override; + begin + return class(TDPopUpMenu); + end + function WndClass();override; + begin + return Class(TPopUpMenuWindow); + end + function Create(AOwner);override; + begin + inherited; + end + +end + +//*****************clipboard******************** +type TDClipBoard = class(TDRootComponent) + class function HitTip();override; + begin + return "а"; + end + function libs();override; + begin + return array(); + end + function classification();override; + begin + return ""; + end + function ComponentClass();override; + begin + return class(TClipBoard); + end + class function ClassName();override; + begin + return "tclipboard"; + end + + function bitmapinfo();override; + begin + return GetClipboardBitmapInfo(); + end + function WndClass();override; + begin + return Class(TClipBordWindow); + end + function Create(AOwner);override; + begin + inherited; + end + + +end +//*********************************** +type TDQuotations = class(TDRootComponent) + class function HitTip();override; + begin + return "鶩"; + end + function libs();override; + begin + return array(); + end + function ComponentClass();override; + begin + return class(TQuotations); + end + function classification();override; + begin + return ""; + end + class function ClassName();override; + begin + return "tquotations"; + end + + function bitmapinfo();override; + begin + return GetQuotationBitmapInfo(); + end + function WndClass();override; + begin + return Class(TQuotationWindow); + end + function Create(AOwner);override; + begin + inherited; + end + + +end +//**************************** +type TDtlogincontrol = class(TDRootComponent) + class function HitTip();override; + begin + return "½"; + end + function classification();override; + begin + return ""; + end + function libs();override; + begin + return array(); + end + function ComponentClass();override; + begin + return class(tlogincontrol); + end + class function ClassName();override; + begin + return "tlogincontrol"; + end + + function bitmapinfo();override; + begin + return GetLoginBitmapInfo(); + end + function WndClass();override; + begin + return Class(TLoginWindow); + end + function Create(AOwner);override; + begin + inherited; + end + + +end + +//*************Server************************* +type TDSocketServer = class(TDRootComponent) +{** + @explan(˵) ˵ؼ %% +**} + class function HitTip();override; + begin + return "socket"; + end + function libs();override; + begin + return array(); + end + function classification();override; + begin + return ""; + end + function ComponentClass();override; + begin + return class(TSocketServer); + end + class function ClassName();override; + begin + return "tsocketserver"; + end + + function bitmapinfo();override; + begin + return GetServerBitmapInfo(); + end + + function WndClass();override; + begin + return Class(TSocketServerWindow); + end + function Create(AOwner);override; + begin + inherited; + end + +end + +//*************client********************** + +type TDSocketClient = class(TDRootComponent) +{** + @explan(˵) ˵ؼ %% +**} + class function HitTip();override; + begin + return "socketͻ"; + end + function classification();override; + begin + return ""; + end + function libs();override; + begin + return array(); + end + function ComponentClass();override; + begin + return class(TSocketClient); + end + class function ClassName();override; + begin + return "tsocketclient"; + end + + function bitmapinfo();override; + begin + return GetClientBitmapInfo(); + end + + function WndClass();override; + begin + return Class(TSocketClientWindow); + end + function Create(AOwner);override; + begin + inherited; + end + +end + +//*************TTreeView*************************** +type TDTreeView = class (TDComponent) +{** + @explan(˵) ƿؼ %% +**} + class function HitTip();override; + begin + return "ؼ"; + end + class function ClassName();override; + begin + return "ttreeview"; + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100027101000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000010649444154 +484BB595CB0D83400C05530725A44ADAE0C43DF55009FFCF61A387F422AFB3364 +B084823451C668C7DC823DCFCEC81BAAE4355557F05CE4F002FB66D8B58D73562 +599688799E23A6698A80F32B109AE7CE55F9388EE940F37A44FC2ACF0E4058144 +516529E0C701D65595E9A3C2B40296F72563E0C831F207A65B972332057027400 +C2D4FE819427035ACE75E04BCE4C0EFABEF703943340296F7224770352CE80751 +34B6E06B41C53CB2FD00148F52DCC404ACE95E077CE5A48D7757EC09A3857EE06 +28B7027A2544CACD80940308718333939B81945C0620E54D8EE46DDBFA01CA192 +07A6596DC0D4839906BD10108F52DDC8027CF598B240ADCFEA77FDF13C21B71B1 +C6D53F7109130000000049454E44AE42608200"; + end + function IsContainer();override; + begin + return false; + end + function ClassObject();override; + begin + return class(TDTreeView); + end + function WndClass();override; + begin + return Class(ttreeview); + end + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onselchanged", + "name":"sel", + "virtual":true, + "param":array("o","e"), + "body": +" + {** + @explan(˵) itemѡıص %% + @param(e)(tuieventtree) Ϣ %% + @param(o)(ttreeview)ؼ %% + **} + if e.itemold and e.itemnew then + begin + MessageBoxA(e.itemold.caption+' л '+e.itemnew.caption,'ʾ',0,o); + end +" + + ); + end + + + +end +//**************TSPinEdit***************************** +type TDSpinEdit = class(TDComponent) +{** + @explan(˵) spinedit ؼ %% +**} + class function HitTip();override; + begin + return "SpinEdit"; + end + function IsContainer();override; + begin + return false; + end + class function ClassName();override; + begin + return "tspinedit"; + end + function ClassObject();override; + begin + return class(TDSPinEdit); + end + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100026901000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000FE49444154 +484B63F84F63306A0141401F0BEAE7EE240B83C0FCF9F3FFCF9C39132B06C9C12 +D2015C0F4800C828113274E80310C80E4A866C1FEFDFBFF7371718131880D0244 +5BB074EDEEFF21A9F5607CE5C67DB018BA05929292FF191818C018C40601A22D2 +86D9EFEFFDCE55B501E04A05B800D106D415A690F182F5EB3EBFFDFBFFFC06230 +3D5489E4874F5E80830614446BB61C048B11D203034459F0EBD76F30DDD8BBE0F +FECA55BC06CAAFA20B77AE2FFC0E4DAFFF1F9EDFF3F7FF9061683E90119840B80 +E488B2001B40B7405A5A1A9E8A406C10A0AA0514E5036C00DD0210387EFC3818C +3008A05E46010202A926909462D200886BA05FFFF03002A9E4731011BC45B0000 +000049454E44AE42608200"; + end + function WndClass();override; + begin + return Class(TSpinEdit); + end + + function Create(AOwner);override; + begin + inherited; + end + +end + +//************tlistview****************************** +type TDListView = class(TDComponent) +{** + @explan(˵) TTSLDataGrid ؼ %% +**} + class function HitTip();override; + begin + return "бͼؼ"; + end + function IsContainer();override; + begin + return false; + end + class function ClassName();override; + begin + return "tlistview"; + end + + function bitmapinfo();override; + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002ED01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000018249444154 +484BB5D52D4CC3401407F0E770381C0E8947A3499A60700B06B3E006212080646 +A1364624B204D9A34080C0EB1A48E90903A1C0E070AB97EAD1FE2D1077B973B76 +57D1B54DFEE689DFFFF5724D015B7E7E0B5CD745DBB61B0D99A28006455128C9F +35C4996654AD23455329FCF9590A92DD8BA4871B337C38DE36F057F0340BFCC73 +1919061F10BC328F20F02449CC058CAF1F7D2A9B33EEFD2F58E0E0FC15106E2C2 +090F1B5CE87C0298C3F490504320E2310B8B6808F8323E314796BC6E5C8B8B1C0 +B2ACA510AE9B13AA9B131EC7B1F90D56DD9C70630181B317C0AF29E07B79B632F +C7AD0C7E9DE193EEC76157C78EFE0F5DD184F6F0602D716F0C68CFBAE5AC0F8ED +4E47D99CF16EFF52E05114990B18F726EA6D617CB0BD2F700AE387E72702AF2C9 +0B7665C8E8C53786B193716E86E05A1BA39E1BAB9B1A0A9CD2961189A0BC077CB +CF7F527EA1C3DA7875C10207E7AA366E2C20907118F56AE3DA023E0ECE2A78100 +4FA02DDADA8831B0B9AD8BCB2A0297CA9A0F59F7E7B0FE20F1D79BA1B7D429BC4 +0000000049454E44AE42608200"; + end + function WndClass();override; + begin + return Class(TListView); + end + + function Create(AOwner);override; + begin + inherited; + DefaultEvent := array( + "event":"onselchanged", + "name":"sel", + "param":array("o"), + "virtual":true, + "body": +" + {** + @explan(˵) ѡıص %% + @param(o)(tlistview) tlistview %% + **} + MessageBoxA('ǰѡ:'+tostn(o.selectedid),'ʾ',0,o); +" + ); + end + + +end + + +//**********Ա༭*************** +(*type TGCellRender = class(TSLUIBASE) + {** + @ignore() %% + @explan(˵) gridcellȾ %% + **} + private + FActivate; + public + class function EditType();virtual; + begin + {** + @explan(˵) %% + @return(string) ַ %% + **} + return nil; + end + function CreateEditer(AOwner);virtual; + begin + return createobject(self(true).classinfo(1),AOwner); + end + function Create(AOwner);override; + begin + {** + @explan(˵) ༭ %% + **} + class(TSLuibase).create(); + end + function CellClick(grid,e,d);virtual; + begin + {** + @explan(˵) ӵ %% + **} + FActivate := true; + end + function CellDraw(grid,e,d);virtual; + begin + {** + @explan(˵) Ƹ %% + **} + end + function CellLeave(grid);virtual; + begin + {** + @explan(˵) 뿪༭ %% + **} + FActivate := false; + end; + property Activated read FActivate; + end *) + type TGCellRender = class(TSLUIBASE) +{** + @explan(˵) gridcellȾ %% +**} + private + FActivate; + public + function CreateEditer(AOwner);virtual; + begin + return createobject(self(true).classinfo(1),AOwner); + end + function Create(AOwner);override; + begin + {** + @explan(˵) ༭ %% + **} + class(TSLuibase).create(); + end + function CelldbClick(grid,e,d);virtual; + begin + end + function CellClick(grid,e,d);virtual; + begin + {** + @explan(˵) ӵ %% + **} + FActivate := true; + end + function CellDraw(grid,e,d);virtual; + begin + {** + @explan(˵) Ƹ %% + **} + end + function CellLeave(grid);virtual; + begin + {** + @explan(˵) 뿪༭ %% + **} + FActivate := false; + end; + property Activated read FActivate; +end +type TTSLDataGrid=class(TDrawGrid) + {** + @ignore() %% + @explan(˵)TSLͶչʾ %% + **} + private + type TGCellBoolRender=class(TGCellRender) + class Function EditType();override; + begin + return "bool"; + end + function CellClick(o,e,d);override; + begin + if not ifarray(d)then return; + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + indexs := 1; + o.getdata(i,j,cp,indexs); + dv := d["value"]; + o.setvalue(indexs union array("value"),not dv); + rec := o.GetSubItemRect(i,j); + o.InvalidateRect(rec,true); + end + function CellDraw(o,e,d);override; + begin + dc := e.canvas; + DrawBoolButton(dc,e.SubItemRect,d["value"]); + end + function DrawBoolButton(dc,srca,v); + begin + FRbuttonWidth := 20; + src := srca; + src[0]:= src[2]-FRbuttonWidth-10; + src[2]-= 10; + src[1]+= 3; + src[3]-= 3; + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,v?DFCS_CHECKED:DFCS_BUTTONCHECK); + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_BUTTON,v?DFCS_CHECKED:DFCS_BUTTONCHECK); + end + end + FCols; + Fdata; + FObjectData; + FMRWD; + FGridControl; + FRows; + FShowTwo; + FCControls; + FColumnWidth; + FRowHeader; + static FGCellRender; + FCanEditStr; + FEditStr; + FControlIndex; + FStringAlign; + FNumberAlign; + FDefAlign; + function SetStringAlign(v); + begin + if v <> FStringAlign then + begin + FStringAlign := v; + InvalidateRect(nil,true); + end + end + function SetNumberAlign(v); + begin + if v <> FNumberAlign then + begin + FNumberAlign := v; + InvalidateRect(nil,true); + end + end + function SetdefAlign(v); + begin + if v <> FDefAlign then + begin + FDefAlign := v; + InvalidateRect(nil,true); + end + end + function GetTSLData(); + begin + if FObjectData then return FObjectData; + return FData; + end + function CreateFedit(); + begin + if not FEditStr then + begin + FEditStr := new tedit(self); + FEditStr.onkeypress := thisfunction(EditKeyPress); + FEditStr.onkillfocus := thisfunction(EditKillFocus); + FEditStr.visible := false; + FEditStr.parent := self; + end + return FEditStr; + end + function StrToNumber(s); + begin + if pos(".",s)then + begin + return StrToFloatDef(s,0); + end else + begin + return StrToIntDef(s,0); + end + end + public + function GetCellRender(n); + begin + if not ifarray(FGCellRender)then + begin + FGCellRender := array(); + end + return FGCellRender[n]; + end + private + function SetRowHeader(v); + begin + nv := v?true:false; + if FRowHeader <> nv then + begin + FRowHeader := nv; + FD := FData; + SetData(array()); + SetData(FD); + end + end + function SetTwoD(v); + begin + if parent is class(TTSLDataGrid)then exit; + nv := v?true:false; + if nv <> FShowTwo then + begin + FD := FData; + SetData(array()); + FShowTwo := nv; + SetData(FD); + end + end + function setdatap(); + begin + if not Fdata then exit; + FCols := nil; + FRows := mrows(Fdata,1); + FCL := mcols(Fdata,1); + allFCL := true; + for i,v in FData do + begin + if not ifarray(v)then + begin + allFCL := false; + break; + end + end + fcs := array(); + wd := 80; + ftwidth := font.width; + for i,v in FRows do + begin + if ifstring(v)then + begin + wd := max(wd,length(v) * ftwidth+3); + if wd>200 then break; + end + end + if RowHeader then + begin + fcs[0]:= array("text":" ","width":min(200,wd)); + end + if FCL and allFCL and FShowTwo then + begin + FCols := FCl; + for i,v in FCols do + begin + fcs[length(fcs)]:= array("text":ifstring(v)?v:inttostr(v),"width":FMRWD); + end + end else + begin + fcs[length(fcs)]:= array("text":" ","width":ColumnWidth>20?ColumnWidth:100); + end + Columns := fcs; + ItemCount := length(FRows); + end + function objecttoarray(d); + begin + if dep<0 then return 0; + if not ifobj(d)then return 0; + try + di := d.classinfo(); + except + return 0; + end; + da := array(); + inhs := array(); + for i,v in di["inherited"] do + begin + inhs[v]:= findclass(v,d); + end + if inhs then da["inherited"]:= inhs; + k := 0; + for i,v in di["members"] do + begin + if(v["access"]in array(0,1,4))then + begin + vn := v["name"]; + da[vn]:= invoke(d,vn); + end + end + for i,v in di["properties"] do + begin + if v["access"]in array(0,1,4)then + begin + vn := v["name"]; + if not(v["read"])then continue; + da[vn]:= invoke(d,vn); + end + end + return da; + end + function SetData(data,f); + begin + if Fdata=data then return; + DeleteAllColumns(); + if ifobj(data)then + begin + FObjectData := data; + r := objecttoarray(data); + return SetData(r,1); + end + if not ifarray(data)then return; + if f then FObjectData := nil; + FData := data; + setdatap(); + end + function itemishow(r,r2); + begin + return r[2]r2[2]; + end + function getitemcontrol(d,p,i,j,tp,cp,idexs); + begin + idx := format("%d*%d",i,j); + o := FCControls[idx]; + if tp="grid" then + begin + if not o then + begin + o := new TTSlDataGrid(self); + o.ControlIndexs(idexs); + o.height := 500; + o.width := 500; + o.Twodimensional := Twodimensional; + O.CanEditStr := CanEditStr; + o.Visible := false; + o.wspopup := true; + o.WsSysMenu := true; + o.WsSizeBox := true; + o.parent := self; + o.onclose := thisfunction(ShowDataClose); + FCControls[idx]:= o; + end + o.Twodimensional := Twodimensional; + if o.wspopup then p := ClientToScreen(p[0],p[1]); + o.left := p[0]; + o.top := p[1]; + o.caption := cp; + o.TSLdata := d; + o.show(); + end + end + public + function create(AOwner);override; + begin + inherited; + FCControls := array(); + FRowHeader := true; + FixedColumns := 1; + caption := ""; + FMRWD := 100; + FShowTwo := false; + //OndblClick := thisfunction(GridCellDblClick); + OnClick := thisfunction(CellClick); + RegisterRender(new TGCellBoolRender()); + FNumberAlign := AL9_CENTERRIGHT; + FStringAlign := AL9_CENTERLEFT; + FDefAlign := AL9_CENTER; + end + + function InitializeWnd();override; + begin + inherited; + end + procedure Notification(AComponent:TComponent;Operation:TOperation);override; + begin + if Operation=opRemove then + begin + for i,v in FCControls do + begin + if v=AComponent then + begin + reindex(FCControls,array(i:nil)); + break; + end + end + end + inherited; + end + function getdata(i,j,cp,indexs); + begin + {** + @explan(˵) ȡ + **} + if not FRows then return nil; + if j=0 and FRowHeader then return FRows[i]; + r := FRows[i]; + if FCols and FShowTwo then + begin + if FRowHeader then c := FCols[j-1]; + else c := FCols[j]; + d := FData[r][c]; + if cp then cp := "["+tostn(r)+"]"; + if cp then cp += "["+tostn(c)+"]"; + if indexs then indexs := array(r,c); + end else + begin + d := FData[FRows[i]]; + if cp then cp := "["+tostn(r)+"]"; + if indexs then indexs := array(r); + end + return d; + end + function DoDrawSubItem(o,e);override; + begin + inherited; + if e.skip then exit; + dc := e.canvas; + i := e.itemid; + j := e.subitemid; + d := getdata(i,j); + src := e.SubItemRect; + if j=0 and FRowHeader then + begin + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,DFCS_BUTTONPUSH); + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_BUTTON,DFCS_BUTTONPUSH); + end + ds := ""; + dc.font.color := 0; + if ifarray(d)then + begin + if d["type"]="object" then + begin + rd := GetCellRender(d["class"]); + if rd is class(TGCellRender)then + begin + rd.CellDraw(o,e,d); + end + end else + begin + ds := format("",length(d)); + //dc.drawtext(ds,src); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FDefAlign); + end + end else + if ifstring(d)then + begin + ds := d; + //dc.drawtext(ds,src); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FStringAlign); + end else + if ifobj(d)then + begin + //dc.drawtext("",src); + class(TLabel).CanvasDrawAlignText(dc,src,"",FDefAlign); + end else + begin + ds := tostn(d); + if d<0 then dc.font.color := rgb(200,0,0); + if ifnumber(d)and j>0 then + begin + //dc.drawtext(ds,src,DT_RIGHT); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FNumberAlign); + end else + begin + //dc.drawtext(ds,src); + if not ifnil(d)then class(TLabel).CanvasDrawAlignText(dc,src,ds,FStringAlign); + end + end + end + function DoDrawItem(o,e);override; + begin + dc := e.canvas; + rc := e.rcitem; + {if SelectedRow = e.id then + if ifnumber(SelectRowColor) then dc.brush.color := SelectRowColor; + else + dc.brush.color := rgb(150,150,150); + else } + if color then dc.brush.color := color; // + else dc.brush.color := rgb(255,255,255); + dc.fillrect(rc); + inherited; + end + function CellClick(o,e);virtual; + begin + i := e.iitem; + j := e.isubitem; + cellid := array(i,j); + if not(i >= 0 and j >= 0)then + begin + exit; + end + d := getdata(i,j); + if ifarray(d)and d["type"]="object" then + begin + rd := GetCellRender(d["class"]); + if rd is class(TGCellRender)then + begin + return rd.CellClick(o,e,d); + end + end else + if ifnumber(d)or ifstring(d)or ifnil(d)then + begin + CreateFedit(); + if not CanEditStr then exit; + onShowEdit(e); + end + end + function GridCellDblClick(o,e);virtual; + begin + cp := 1; + cl := e.isubitem; + if cl<1 and FRowHeader then exit; + indexs := 1; + d := getdata(e.iitem,cl,cp,indexs); + + p := e.ptaction; + if ifarray(d)then + begin + if d["type"]="object" then + begin + rd := GetCellRender(d["class"]); + + if r then return r.CelldbClick(o,e,d); + end + getitemcontrol(d,p,e.iitem,cl,"grid",cp,indexs); + end else + if ifobj(d)then + begin + return getitemcontrol(d,p,e.iitem,cl,"grid",cp,indexs); + end + end + function ShowDataClose(o,e); + begin + o.show(false); + o.TSLdata := array(); + e.skip := true; + o.Recycling(); + end + function Recycling();override; + begin + FCols := nil; + Fdata := nil; + inherited; + end + function SetValue(index,val);virtual; + begin + if ifobj(FObjectData)then + begin + p := index[0]; + if ifstring(p)then + begin + try + invoke(FObjectData,p,1,val); + except + end + end + end + if not ifarray(FData)then exit; + r := magicsetarray(FData,index,val); + if FControlIndex then + begin + if parent is class(TTSLDataGrid)then + begin + parent.SetValue(FControlIndex,FData); + end + end + return r; + idx := "FData"; + for i,v in index do + begin + if ifnumber(v)then idx += format("[%d]",v); + else if ifstring(v)then + begin + idx += format('["%s"]',v); + end + end + if length(idx)>5 then + begin + vals := idx+":="+tostn(val)+";"; //FData["c"]["value"]:=0; + try + eval(&vals); + except + //echo "===errr"; + end; + end + end + function ControlIndexs(dx); + begin + {** + @ignore() %% + **} + if dx then FControlIndex := dx; + return FControlIndex; + end + function RegisterRender(it); + begin + if it is class(TGCellRender)then + begin + if not ifarray(FGCellRender)then FGCellRender := array(); + FGCellRender[it.EditType()]:= it; + end else + if ifarray(it)then + begin + for i,v in it do call(thisfunction,v); + end + end + function EditKeyPress(o,e); + begin + k := e.wparam; + if k=VK_ESCAPE or k=13 then + begin + info := o._tag; + if ifarray(info)then + begin + v := o.text; + v2 := info[2]; + if ifnumber(v2)then + begin + vi := StrToNumber(v); + if v2 <> vi then + begin + SetValue(info[3],vi); + end + end else + begin + if v2 <> v then + begin + SetValue(info[3],v2); + end + end + end + o.visible := false; + end + end + function EditKillFocus(o,e); + begin + o.visible := false; + end + function onShowEdit(e); + begin + {** + @explan(˵) ʾ༭ %% + **} + i := e.iitem; + j := e.isubitem; + rc := GetSubItemRect(i,j); + FEditStr.SetBoundsRect(rc); + indexs := 1; + v := getdata(i,j,nil,indexs); + FEditStr._tag := array(i,j,v,indexs); + vs := ""; + if ifstring(v)then vs := v; + else if ifnumber(v)then v := tostn(v); + FEditStr.text := v; + FEditStr.show(); + xy := e.ptaction; + pt := makelong(xy[0]-rc[0],xy[1]-rc[1]); + FEditStr._send_(WM_LBUTTONDOWN,0,pt,0); + end + property Twodimensional:bool read FShowTwo write SetTwoD; + property TSLdata:variable read GetTSLData write SetData; + property ColumnWidth:integer read FColumnWidth write FColumnWidth; + property RowHeader:bool read FRowHeader write SetRowHeader; + property CanEditStr:bool read FCanEditStr write FCanEditStr; + property StringAlign:AlignStyle9 read FStringAlign write SetStringAlign; + property NumberAlign:AlignStyle9 read FNumberAlign write SetNumberAlign; + property DefAlign:AlignStyle9 read FDefAlign write SetdefAlign; + {** + @param(Twodimensional)(BOOL) Ƿάǿƶάչʾ %% + @param(TSLdata)(array) tsl %% + **} +end + + +type TGridPropertyRender = class(TGCellRender) + function CreateEditer(AOwner);override; + begin + return CreateObject(self(true).Classinfo(1),AOwner); + end + function Create(AOwner); + begin + inherited; + Owner := AOwner; + end + Owner ; +end +type TGridCellEditWithButton = class(TGridPropertyRender) +{** + @explan(˵) аťĸ% +**} + private + FRbuttonWidth; + FCurorList; + FUpRect; + FDownRect; + protected + function ptinrect(pt,rec); + begin + return (pt[0]>rec[0] and pt[0]<=rec[2]) and (pt[1]>rec[1] and pt[1]<=rec[3]); + end + function splitrect(r,rs);virtual; + begin + rs := array(); + src := r; + wd := FRbuttonWidth?FRbuttonWidth:20; + src[0] := src[2]-wd; + src[1]+=3; + src[3]-=3; + rs[0] := src; + src := r; + src[2]-=wd; + rs[1] := src; + end + public + function GetPopRectByHeight(h); + begin + {** + @explan(˵)ݸӻõ %% + **} + if not(h>10) then h:= 100; + dn := GetPopRect(); + if dn[3]-dn[1]=h then + begin + dn[1]:= dn[3]-h; + end else + begin + dn := dna; + end + end + return dn; + end + function GetPopRect(f); + begin + {** + @explan(˵) õ%% + @param(f)(bool) tureϷ,false · %% + **} + if f then return FUpRect; + return FDownRect; + end + function DrawButton(dc,src,d); + begin + {** + @explan(˵) ưť%% + **} + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_SCROLL,DFCS_SCROLLDOWN); + end + Function Create(AOwner);override; + begin + inherited; + //echo "\r\nwitchbtn:"; + ButtonWidth := 20; + end + function CellDraw(grid,e,d);override; + begin + rec := e.SubItemRect; + dc := e.canvas; + splitrect(rec,rs); + DrawButton(dc,rs[0],d); + CellDrawLabel(dc,rs[1],d); + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ʊǩ %% + **} + if ifarray(d) then + begin + //dc.drawtext(self(true).EditType(),rect); + end + end + function CellClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + inherited; + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + splitrect(rec,rs); + btr := rs[0]; + lr := rs[1]; + x1y1 := grid.ClientToScreen(rec[0],rec[1]); + x2y2 := grid.ClientToScreen(rec[2],rec[3]); + src := _wapi.GetScreenRect(); + FUpRect := array(x1y1[0],src[1],x2y2[0],x1y1[1]); + FDownRect := array(x1y1[0],x2y2[1],x2y2[0],src[3]); + if ptinrect(pt,btr) then + begin + ButtonClick(grid,e,d); + end else if ptinrect(pt,lr) then + begin + LabelClick(grid,e,d); + end + end + + function CelldbClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + inherited; + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + splitrect(rec,rs); + btr := rs[0]; + lr := rs[1]; + x1y1 := grid.ClientToScreen(rec[0],rec[1]); + x2y2 := grid.ClientToScreen(rec[2],rec[3]); + src := _wapi.GetScreenRect(); + FUpRect := array(x1y1[0],src[1],x2y2[0],x1y1[1]); + FDownRect := array(x1y1[0],x2y2[1],x2y2[0],src[3]); + if ptinrect(pt,lr) then + begin + //LabelClick(grid,e,d); + end + end + function ButtonClick(grid,e,d);virtual; + begin + {** + @explan(˵) ť %% + **} + end + function LabelClick(grid,e,d);virtual; + begin + {** + @explan(˵)ǩ %% + **} + end + function CellLeave(grid);override; + begin + {** + @explan(˵) 뿪༭ %% + **} + inherited; + end; + property ButtonWidth read FRbuttonWidth write FRbuttonWidth; + {** + @param(ButtonWidth)(integer) ť %% + **} +end +///////////////////////////////////////////////////////////////////////// + +type TGridCellNaturalEdit = class(TGridPropertyRender,TPropertyNatural) + FRow; + FCol; + FGrid; + FEdit; + public + function create(AOwner);override; + begin + inherited; + FGrid := AOwner; + end + function numbertotext(num);virtual; + begin + if ifnumber(num) then return inttostr(num); + return ""; + end + function textonumber(txt);virtual; + begin + return strtointdef(txt,0); + end + function Ched(o,e); + begin + v := textonumber(o.TEXT); + FGrid.CellChanged(FRow,FCol,"value",v); + //o.parent.CallChanged(o.parent,nil); + end + function EditKeyPress(o,e);virtual; + begin + if 13 = e.wparam then + begin + try + ched(o); + o.visible := false; + except + end ; + end else + begin + if not(e.wparam >= ord("0") and e.wparam<= ord("9") or e.wparam = VK_BACK) then + e.skip := true; + end + end + function CellClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + i := e.iitem; + j := e.isubitem; + Frow := i; + FCol := j; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + if d["class"]=EditType() and (FGrid is class(TDrawGrid)) then + begin + if not(FEdit is class(TWincontrol)) then + begin + FEdit := new TPopEditCtrl(FGrid);//CreateExtendEdit(FGrid); + FEdit.visible := false; + FEdit.OnKeyPress := thisfunction(EditKeyPress); + FEdit.parent := FGrid; + FEdit.OnChanged := thisfunction(Ched); + end + FEdit.SetBoundsRect(FGrid.clienttoscreen(rec[0],rec[1]) union FGrid.clienttoscreen(rec[2],rec[3])); + FEdit.text := numbertotext(d["value"]); + FEdit.parent := grid; + FEdit.SetFocus(); + FEdit.visible := true; + end + end + function CellDraw(grid,e,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if FGrid is class(TDrawGrid) then + e.canvas.drawtext(numbertotext(d["value"]),e.subItemRect,DT_CENTER); + end + function CellLeave(grid);virtual; + begin + {** + @explan(˵) 뿪༭ %% + **} + if not(FEdit is class(TEdit)) then exit; + FEdit.text := ""; + FEdit.visible := false; + inherited; + end; + +end +type TGridCellIntegerEdit = class(TGridCellNaturalEdit) +{** + @explan(˵) ༭ %% +**} + function CreateEditer(AOwner);override; + begin + return new TGridCellIntegerEdit(AOwner); + end + function EditType();override; + begin + return "integer"; + end + function FormatEdit(d,modify);override; + begin + {** + @explan(˵)ؼתΪ޸ı %% + **} + r := inherited; + r["class"] := EditType(); + if not ifnil(d) then + begin + r["value"] := d; + end + return r; + end + + public + function Create(AOwner);override; + begin + inherited; + end + function EditKeyPress(o,e);override; + begin + if e.wparam = ord("-") then + begin + end else inherited; + end +end +type TGridCellStringEdit = class(TGridCellNaturalEdit) +{** + @explan(˵) ༭ %% +**} + function CreateEditer(AOwner);override; + begin + return new TGridCellStringEdit(AOwner); + end + function EditType();override; + begin + return "string"; + end + function FormatEdit(d,modify);override; + begin + {** + @explan(˵)ؼתΪ޸ı %% + **} + r := inherited; + r["class"] := EditType(); + if not ifnil(d) then + begin + r["value"] := d?:""; + end + return r; + end + + public + function Create(AOwner);override; + begin + inherited; + end + function textonumber(txt);override; + begin + return txt; + end + function numbertotext(num);override; + begin + return num; + end + function EditKeyPress(o,e);override; + begin + if e.wparam <>13 then + begin + end else inherited; + end +end + +type TPopEditCtrl = class(TCustomControl) + private + FEdit; + FOnChanged; + FOnKeyPress; + function GetText(); + begin + return FEdit.Text; + end + function SetText(v); + begin + FEdit.Text := v; + end + public + function dosetfocus();override; + begin + FEdit.SetFocus; + end + function WMACTIVATE(o,e):WM_ACTIVATE;override; + begin + if e.wparam = 0 then + begin + CallChanged(o,e); + end + end + function CallChanged(o,e); + begin + o.visible := false; + CallDataFunction(FOnChanged,o,e); + //O.text := ""; + end + function create(AOwner);override; + begin + inherited; + WsPopUp := true; + WsDlgModalFrame := false; + FEdit := new tedit(self); + width := FEdit.Width+2; + height := FEdit.Height +2; + FEdit.align := alClient; + FEdit.parent := self; + FEdit.OnKeyPress := function(o,e)begin + CallDataFunction(FOnKeyPress,self,e); + end + end + function ReCycling();override; + begin + FOnChanged := nil; + FOnKeyPress := nil; + inherited; + end + property Text read GetText write SetText; //ı + property OnKeyPress read FOnKeyPress write FOnKeyPress; // + property OnChanged read FOnChanged write FOnChanged; //ı +end +type TGridCellColorEdit = class(TGridCellEditWithButton,TPropertyColor) + {** + @explan(˵) color edit + **} + private + Fcpok ; + FColorChoose; + public + function create(AOwner);override; + begin + inherited; + FRbuttonWidth := 20; + end + function ButtonClick(grid,e,d);override; + begin + Fcpok := true; + if not(FColorChoose) then + begin + FColorChoose := new TColorChooseADlg(grid); + FColorChoose.Parent := grid; + end + FColorChoose.Result := d["value"]; + if FColorChoose.OpenDlg() and Fcpok then + begin + grid.CellChanged(e.iitem,e.isubitem,"value",FColorChoose.Result); + end + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + dc.brush.color := d["value"]; + dc.fillrect(rect); + end + function CellLeave();override; + begin + Fcpok := false; + inherited; + end +end +type TGridCellDirectoryEdit = class(TGridCellEditWithButton,TPropertyDirectory) + {** + @explan(˵) color edit + **} + private + Fcpok ; + FColorChoose; + + public + + function create(AOwner);override; + begin + inherited; + end + function ButtonClick(grid,e,d);override; + begin + Fcpok := true; + if not(FColorChoose) then + begin + FColorChoose := new TFolderChooseADlg(grid); + FColorChoose.Parent := grid; + end + if FColorChoose.OpenDlg() and Fcpok then + begin + grid.CellChanged(e.iitem,e.isubitem,"value",FColorChoose.Folder); + end + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if ifarray(d) then + begin + dc.drawtext(d["value"],rect); + end + end + function CellLeave();override; + begin + Fcpok := false; + inherited; + end +end +type TGridCellFileNameEdit = class(TGridCellEditWithButton,TPropertyFileName) + {** + @explan(˵) color edit + **} + private + Fcpok ; + FColorChoose; + public + function create(AOwner);override; + begin + inherited; + end + function ButtonClick(grid,e,d);override; + begin + Fcpok := true; + if not(FColorChoose) then + begin + FColorChoose := new TOpenFileADlg(grid); + FColorChoose.Parent := grid; + end + if FColorChoose.OpenDlg() and Fcpok then + begin + grid.CellChanged(e.iitem,e.isubitem,"value",FColorChoose.FileName); + end + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if ifarray(d) then + begin + dc.drawtext(d["value"],rect); + end + end + function CellLeave();override; + begin + Fcpok := false; + inherited; + end +end + +type TGridCellFontEdit = class(TGridCellEditWithButton,TPropertyFont) + {** + @explan(˵) font edit + **} + private + Fcpok ; + FColorChoose; + fparser; + public + function create(AOwner);override; + begin + inherited; + end + function ButtonClick(grid,e,d);override; + begin + Fcpok := true; + if not(FColorChoose) then + begin + FColorChoose := new TFontChooseADlg(grid); + FColorChoose.Parent := grid; + end + FColorChoose.fontinfo := d["value"]; + if FColorChoose.OpenDlg() and Fcpok then + begin + i := e.iitem; + j := e.isubitem; + grid.CellChanged(i,j,"value",FColorChoose.fontinfo); + end + end + function CellDrawLabel(dc,rect,d);override; + begin + dc.SaveDC(); + + dc.font := d["value"]; + dc.drawtext("tfont",rect); + dc.RestoreDC(); + end + function CellLeave();override; + begin + Fcpok := false; + inherited; + end +end +type TGridCellhotkeyEdit = class(TGridPropertyRender,TPropertyHotkey) +{** + @explan(˵) Ȼ༭ +**} + FRow; + FCol; + FGrid; + FEdit; + + function hotchange(o,e); + begin + if e.wparam = 13 then + begin + e.skip := true; + FGrid.CellChanged(FRow,FCol,"value",FEdit.hotkey); + end + end + + public + function create(AOwner);override; + begin + inherited; + FGrid := AOwner; + end + function CellClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + i := e.iitem; + j := e.isubitem; + Frow := i; + FCol := j; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + if d["class"]=EditType() and (FGrid is class(TDrawGrid)) then + begin + if not(FEdit is class(TEdit)) then + begin + FEdit := new thotkey(FGrid); + FEdit.visible := false; + FEdit.parent := FGrid; + FEdit.onkeydown := thisfunction(hotchange); + end + + FEdit.SetBoundsRect(rec); + FEdit.hotkey := d["value"]; + FEdit.parent := grid; + FEdit.SetFocus(); + FEdit.visible := true; + end + end + function CellDraw(grid,e,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if FGrid is class(TDrawGrid) then + if ifarray(d) then + e.canvas.drawtext(class(thotkey).hotkeytostr(d["value"]),e.subItemRect,DT_CENTER); + end + function CellLeave(grid);override; + begin + {** + @explan(˵) 뿪༭ %% + **} + if not(FEdit is class(thotkey)) then exit; + FEdit.visible := false; + inherited; + FGrid.CellChanged(FRow,FCol,"value",FEdit.hotkey); + end; + +end +type TGridCellBoolEdit = class(TGridPropertyRender,TPropertyBool) +{** + @explan(˵) boolcell༭ +**} + private + FRbuttonWidth; + function DrawButton(dc,srca,v); + begin + src := srca; + src[0] := src[2]-FRbuttonWidth; + src[1]+=3; + src[3]-=3; + _wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,v?DFCS_CHECKED:DFCS_BUTTONCHECK); + end + public + function create(AOwner);override; + begin + inherited; + FRbuttonWidth := 20; + end + function CellClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + if not( grid is class(TDrawGrid)) then exit; + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + + rec := grid.getSubItemRect(i,j); + if pt[0]<(rec[2]-FRbuttonWidth) then exit; + if d["class"]="bool" then + begin + grid.CellChanged(i,j,"value",not(d["value"])); + end + end + function CellDraw(grid,e,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + src := e.SubItemRect; + dv := d["value"]; + dc := e.canvas; + if src[2]-src[0]>50 then + begin + src1 := src; + src1[2]-=FRbuttonWidth; + dc.drawtext(dv?"TRUE":"FALSE",src1,DT_CENTER); + end + DrawButton(dc,src,dv); + end + + +end + + +type TGridCellEditList = class(TGridCellEditWithButton) + protected + Fi; + fj; + FGrid; + private + FDataList; + function GetDataList();virtual; + begin + return FDataList; + end + function SetDataList(v);virtual; + begin + FDataList:=v; + end + public + function create(AOwner);override; + begin + inherited; + end + function GetItemValue(v);virtual; + begin + return v; + end + function CellDrawLabel(dc,rect,d);override; + begin + v := d["value"]; + dc.DrawText(v,rect,DT_LEFT); + end + function nameFilter();virtual; + begin + return nil; + end + function ButtonClick(grid,e,d);override; + begin + {** + @explan(˵) ť %% + **} + + FGrid := grid; + i := e.iitem; + FI := I; + j := e.isubitem; + FJ := J; + dlist := DataList; + if dlist then + begin + try + dlist.filter := nameFilter(); + except + end ; + dn := GetPopRectByHeight(250); + dlist.width := dn[2]-dn[0]; + dlist.height := 250; + dlist.left := dn[0]; + dlist.top := dn[1]; + dlist.OnClickSelected := thisfunction(OnvSelected); + dlist.SetSelectedByValue(d["value"]); + //dlist.visible := true; + dlist.show(); + + end + end + function OnvSelected(o); + begin + sv:=GetItemValue(o.SelectedValue); + Fgrid.CellChanged(fi,fj,"value",sv); + o.visible := false; + end + property DataList read GetDataList write SetDataList; +end +type TGridCellEventHandleEdit = class(TGridCellEditList,TPropertyTypeEvent) + public + function create(owner);override; + begin + inherited; + end + function CelldbClick(grid,e,d);virtual; + begin + FGrid := grid; + i := e.iitem; + FI := I; + j := e.isubitem; + FJ := J; + //˫ӻص + end + +end + +type TGridCellSysCursorEidt=class(TOneSelectCell,TPropertyTypeSysCursor) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyTypeSysCursor).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end //Ա༭ + + + +type TGridCellVariableEdit = class(TGridCellEditList,TPropertyVarible) + public + + + function create(owner);override; + begin + inherited; + end + function nameFilter();virtual; + begin + return nil; + end + function GetItemValue(v);override; + begin + try + if v then return v.name; + except + end ; + return v; + end +end + +type TGridCellVariableTactionEdit = class(TGridCellVariableEdit) + + function nameFilter();override; + begin + return EditType(); + end + function IfComponent();virtual; + begin + {** + @explan(˵) ǷΪؼ%% + **} + return true; + end + Function EditType();override; + begin + return "taction"; + end + function CellDrawLabel(dc,rect,d);override; + begin + v := d["value"]; + if v is class(tcomponent) then + begin + dc.DrawText(v.name,rect,DT_LEFT); + end else inherited; + end + function create(owner);override; + begin + inherited; + end +end +type TGridCellVariableTrayEdit = class(TGridCellVariableTactionEdit) + + Function EditType();override; + begin + return "ttray"; + end + function create(owner);override; + begin + inherited; + end +end +type TGridCellVariabletpopupmenuEdit = class(TGridCellVariableTactionEdit) + + Function EditType();override; + begin + return "tpopupmenu"; + end + function create(owner);override; + begin + inherited; + end +end +type TGridCellVariabletmainmenuEdit = class(TGridCellVariableTactionEdit) + + Function EditType();override; + begin + return "tmainmenu"; + end + function create(owner);override; + begin + inherited; + end + function FormatTMF(d);override; + begin + if d is class(tcomponent) then + begin + r := d.name; + if r then return r; + end + return false; + end + function GetItemValue(V);override; + begin + if v is class(TDComponent) then r := v.GetTrueComponent(); + return r; + end +end +type TGridCellVariabletimagelistEdit = class(TGridCellVariableTactionEdit) + Function EditType();override; + begin + return "tcontrolimagelist"; + end + function CellDrawLabel(dc,rect,d);override; + begin + v := d["value"]; + if v is class(tcomponent) then + begin + dc.DrawText(v.name,rect,DT_LEFT); + end + end + + function FormatTMF(d);override; + begin + if d is class(tcomponent) then + begin + r := d.name; + if r then return r; + end + return false; + end + function GetItemValue(V);override; + begin + if v is class(TDComponent) then r := v.GetTrueComponent(); + return r; + end + function create(owner);override; + begin + inherited; + end +end +type TBtnCellDrawVTtype = class(TGridCellEditWithButton) + function Create(AOwner);override; + begin + inherited; + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ʊǩ %% + **} + if ifarray(d) then + begin + dc.drawtext(self(true).EditType(),rect); + end + end +end +type TGridCellImagesEdit = class(TBtnCellDrawVTtype,TPropertyImagesData) + private + FGrid; + FEdit; + FImageEditer; + function GetImagesEdit(); + begin + if not FImageEditer then + begin + FImageEditer := new TIconsEditer(FGrid); + FImageEditer.parent := FGrid; + end + FImageEditer.clean(); + return FImageEditer; + end + public + function CellDrawLabel(dc,rect,d);override; + begin + if not(d and ifarray(d)) then exit; + dv := d["value"]; + if ifarray(dv) and dv["type"]="bmps" then + begin + its := dv["items"]; + if ifarray(its) then + dc.DrawText("imgs:"+inttostr(length(its)),rect); + end + end + function create(AOwner);override; + begin + inherited; + FRbuttonWidth := 20; + FGrid := AOwner; + end + function ButtonClick(grid,e,d);override; + begin + GetImagesEdit(); + if FImageEditer then + begin + FImageEditer.seticons(d["value"]["items"]); + FImageEditer.showmodal(); + if self.Activated then + begin + dd := FImageEditer.GetIcons(); + //echo tostn(dd); + grid.CellChanged(e.iitem,e.isubitem,"value",array("type":"bmps","items":dd)); + end + end + end +end +type TGridCellBitmapEdit = class(TBtnCellDrawVTtype,TPropertyBitmap) + private + FGrid; + FEdit; + FImageEditer; + function GetImagesEdit(); + begin + if not FImageEditer then + begin + FImageEditer := new TOpenFileADlg(FGrid); + FImageEditer.parent := FGrid; + end + return FImageEditer; + end + public + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if ifarray(d) and (d["value"] is class(tbitmap) )then inherited; + end + + function create(AOwner);override; + begin + inherited; + FRbuttonWidth := 20; + FGrid := AOwner; + end + function ButtonClick(grid,e,d);override; + begin + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + GetImagesEdit(); + if FImageEditer.opendlg() then + begin + inherited; + bmp := new tbitmap(); + bmp.id := FImageEditer.FileName; + if bmp.HandleAllocated() then + grid.CellChanged(i,j,"value",bmp); + else grid.CellChanged(i,j,"value",nil); + end + else grid.CellChanged(i,j,"value",nil); + end + +end +type TGridCellIconEdit = class(TBtnCellDrawVTtype,TPropertyIcon) + private + FGrid; + FEdit; + FImageEditer; + function GetImagesEdit(); + begin + if not FImageEditer then + begin + FImageEditer := new TOpenFileADlg(FGrid); + FImageEditer.parent := FGrid; + end + return FImageEditer; + end + public + + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + if ifarray(d) and (d["value"] is class(ticon)) then inherited; + end + function create(AOwner);override; + begin + inherited; + FRbuttonWidth := 20; + FGrid := AOwner; + end + function ButtonClick(grid,e,d);override; + begin + i := e.iitem; + j := e.isubitem; + pt := e.ptaction; + rec := grid.getSubItemRect(i,j); + GetImagesEdit(); + if FImageEditer.opendlg() then + begin + inherited; + ic := new Ticon(); + ic.id := FImageEditer.FileName; + if ic.HandleAllocated() then + grid.CellChanged(i,j,"value",ic); + else grid.CellChanged(i,j,"value",nil); + end + else grid.CellChanged(i,j,"value",nil); + end +end +type TGridCellStatusItemsEdit = class(TBtnCellDrawVTtype,TPropertyStatusItems) + private + FGrid; + FStatus; + function GetWnd(); + begin + if (not FStatus) and (FGrid is class(TWincontrol)) then + begin + FStatus := new TListStatusEdit(FGrid); + FStatus.parent := FGrid; + end + return FStatus; + end + public + + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) and ifarray(d["value"]) then + begin + dc.DrawText("item:"+inttostr(length(d["value"])),rect); + end + end + + function create(owner);override; + begin + inherited; + FGrid := owner; + end + function OnApplay(o,e);virtual; + begin + o.EndModalCode := true; + o.EndModal(); + end + function ButtonClick(grid,e,d);override; + begin + if GetWnd() then + begin + inherited; + FStatus.OnApplay := thisfunction(OnApplay); + FStatus.setitems(d["value"]); + FStatus.EndModalCode := false; + if FStatus.showmodal() then + begin + grid.CellChanged(e.iitem,e.isubitem,"value",FStatus.ListControl.ListValues); + end + end + end + +end +type TGridCellFileFilterEdit = class(TGridCellEditWithButton,TPropertyFileFilter) + private + FGrid; + FStatus; + function GetWnd(); + begin + if (not FStatus) and (FGrid is class(TWincontrol)) then + begin + FStatus := new TListStatusEdit2(FGrid); + FStatus.SetLable(0,"ʾ"); + FStatus.SetLable(1,""); + FStatus.SetColoumn(1,"ı"); + FStatus.SetColoumn(2,"ɸѡ"); + FStatus.parent := FGrid; + FStatus.FCheckNumber := false; + end + return FStatus; + end + public + function create(owner);override; + begin + inherited; + FGrid := owner; + end + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) and ifarray(d["value"]) then + begin + dc.DrawText("item:"+inttostr(length(d["value"])),rect); + end + end + function OnApplay(o,e);virtual; + begin + o.EndModalCode := true; + o.EndModal(); + end + function ButtonClick(grid,e,d);override; + begin + if GetWnd() then + begin + inherited; + FStatus.OnApplay := thisfunction(OnApplay); + dv := array(); + dvi := 0; + for i,v in d["value"] do + begin + dv[dvi]["width"] := i; + dv[dvi++]["text"] := v; + end + FStatus.setitems(dv); + FStatus.EndModalCode := false; + if FStatus.showmodal() then + begin + vs := FStatus.ListControl.ListValues; + dv := array(); + for i,v in vs do + begin + dv[v["width"]] := v["text"]; + end + grid.CellChanged(e.iitem,e.isubitem,"value",dv); + end + end + end +end +type TGridCellLazyIntegerEdit = class(TGridCellIntegerEdit) + function CreateEditer(AOwner);override; + begin + return new TGridCellLazyIntegerEdit(AOwner); + end + function EditType();override; + begin + return "lazyinteger"; + end + function LazyProperty();override; + begin + return true; + end + function create(AOwner);override; + begin + inherited; + end +end +//*****************ѡlist******************************************* +type UniCheckList = class(TTreeView) //ѡ + private + Fdata; + FOnSelChanged; + public + function Create(AOwner);override; + begin + inherited; + hasline := false; + Fdata := array(); + OnActivate := function(o,e) + begin + if e.lowparam = WA_INACTIVE then + begin + Visible := false; + end + end ; + end + function DoOnSelChang(v); + begin + Calldatafunction(FOnSelChanged,self(true),v); + end + function MouseUp(o,e);override; + begin + it := CurrentNode; + nit := GetItemIndexByYpos(e.ypos); + if nit >=0 then + begin + inherited; + if CurrentNode<>nit then + begin + DoOnSelChang(CurrentNode._tag); + end + end + else + begin + DoOnSelChang(nil); + end + end + function hasFocus();override; + begin + return true; + end + function SetList(lst); + begin + clean(); // + rnd := RootNode; + Fdata := array(); + for i,v in lst do + begin + nd := CreateTreeNode(self); + nd.Caption := v[0]; + nd._tag := v[1]; + nd.Parent := rnd; + Fdata[v[1]] := nd; + end + end + function SetSelValue(v); + begin + for i,vi in FData do + begin + if vi._tag = v then return SetSel(vi); + end + end + property OnSelChanged read FOnSelChanged write FOnSelChanged; +end +type MultiCheckListPanel = class(TCustomControl) //ѡ + private + Flist; + fbtn; + FIDokClick; + protected + type MultiCheckList = class(TTreeView) + private + Fdata; + public + function Create(AOwner);override; + begin + inherited; + Fdata := array(); + end + function MouseUp(o,e);override; + begin + inherited; + end + function hasFocus();override; + begin + return false; + end + function SetList(lst); + begin + clean(); // + rnd := RootNode; + Fdata := array(); + for i,v in lst do + begin + nd := CreateTreeNode(self); + nd.Caption := v[0]; + nd._tag := v[1]; + nd.Parent := rnd; + Fdata[v[1]] := nd; + end + + end + function SetSelValue(v); + begin + for i,vi in FData do + begin + if vi._tag in v then vi.Checked := true; + //if vi._tag = v then return SetSel(vi); + end + end + function GetSelValue(); + begin + r := array(); + for i,vi in FData do + begin + if vi.Checked then r[rl++] := vi._tag; + end + return r; + end + end + + PUBLIC + function Create(AOwner);override; + begin + inherited; + height := 200; + //WsDlgModalFrame := true; + Flist := new MultiCheckList(self); + flist.CheckBox := true; + flist.border := false; + //flist.WsDlgModalFrame := true; + Flist.parent := self; + fbtn := new TBtn(self); + fbtn.height := 25; + fbtn.width := 40; + fbtn.caption := "ȷ"; + fbtn.Parent := self; + fbtn.Onclick := function(o,e)begin + Calldatafunction(FIDokClick,self(true),e); + end + end + function DoControlAlign();override; + begin + if not(FList and fbtn) then return; + rc := ClientRect; + rc[3]-=30; + FList.SetBoundsRect(rc); + fbtn.top := rc[3]+2; + fbtn.left := rc[2]-fbtn.width-3; + end + function SetList(lst); + begin + FList.SetList(lst); + end + function SetSelValue(v); + begin + FList.SetSelValue(v); + end + function GetSelValue(); + begin + return FList.GetSelValue(); + end + property IdOKClick read FIDokClick write FIDokClick; +end + +//*************zh**property******************************* +type tGridCellAlignPos3BoxEdit=class(TOneSelectCell ,TPropertyAlign3) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyAlign3).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type tGridCellDayOfWeekBoxEdit=class(TOneSelectCell,TPropertyDayOfWeek) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyDayOfWeek).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type TGridCellPairIntEdit=class(TGridPropertyRender,TPropertyPairInt) +private + FGrid; + FeditWindow; + Fi; + Fj; + type PairWindow=class(tpanel) + private + ts1; + ts2; + edit1; + edit2; + btn; + ari; + FonOK; + function is_valid_int(str);begin + arr:=array('0','1','2','3','4','5','6','7','8','9'); + if r:=length(str) then begin + if r=1 then + return not (r='-'); + if str[1] in arr or str[1]='-' then begin + for i:=2 to r do + if not(str[i] in arr) then + return 0; + return 1; + end + end + return 0; + end + public + function initializewnd();override;begin + inherited; + ts1.caption:="ޣ"; + ts2.caption:="ޣ"; + ts1.left:=8; + ts1.top:=8; + ts2.left:=8; + ts2.top:=40; + edit1.top:=8; + edit1.left:=50; + edit2.top:=40; + edit2.left:=50; + btn.top:=68; + btn.left:=30; + btn.caption:="ȷ"; + ts1.parent:=self; + ts2.parent:=self; + edit1.parent:=self; + edit2.parent:=self; + btn.parent:=self; + end + function create(aowner);override;begin + inherited; + height:=132; + width:=152; + caption:=""; + wscaption := true; + wssysmenu := true; + wspopup := true; + visible := false; + ari:=array(0,0); + ts1:=new tstext(self); + ts2:=new tstext(self); + edit1:=new tedit(self); + edit2:=new tedit(self); + btn:=new tbtn(self); + btn.onclick:=function(o,e)begin + if(is_valid_int(edit1.text) and is_valid_int(edit2.text)) then begin + i:=strtoint(edit1.text); + j:=strtoint(edit2.text); + if i<=j then begin + ari:=array(i,j); + calldatafunction(FonOK,o,e); + visible:=0; + setarr(array("","")); + return; + end + end + _wapi.MessageBoxA(self.handle,"ǷΧ","",0); + end + end + function WMCLOSE(o,e):WM_CLOSE;override; + begin + o.visible := false; + e.skip := true; + inherited; + end + function getarr();begin + return ari; + end + function setarr(ari);begin + edit1.text:=ari[0]; + edit2.text:=ari[1]; + end + property onOK read FonOK write FonOK; + end + type Tstext = class(TGraphicControl) + FCaption ; + function create(owner); + begin + inherited; + FCaption := "tstext"; + height:=16; + width:=50; + end + procedure Paint(); override; + begin + rect := clientrect; + Canvas.font.height := 16; + // Canvas.font.SetValues(array("height":-18,"width":0,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,"charset":134,"outprecision":3,"clipprecision":2,"quality":1,"pitchandfamily":2,"facename":"","color":0)); + Canvas.drawtext(FCaption,rect); + end + function SetCaption(v);override; + begin + inherited; + if not(ifstring(v) and (FCaption<>v)) then exit; + FCaption := v; + end + property caption read FCaption write SetCaption; + end +public + + function create(AOwner);override;begin + inherited; + FGrid := AOwner; + FeditWindow:=nil; + end + function CellClick(grid,e,d);override;begin + Fi := e.iitem; + Fj := e.isubitem; + if ifnil(FeditWindow) then begin + FeditWindow:=new PairWindow(FGrid); + FeditWindow.onOK:=function(o,e)begin + Fgrid.CellChanged(Fi,Fj,"value",FeditWindow.getarr()); + end + end + if ifnil(FeditWindow.parent) then begin + FeditWindow.parent :=FGrid; + end + rec := grid.getSubItemRect(Fi,Fj); + r:=grid.ClientToScreen(rec[0],rec[3]); + FeditWindow.left:=r[0]; + FeditWindow.top:=r[1]; + FeditWindow.show(); + end + function CellDraw(grid,e,d);override;begin + {** + @explan(˵) Ƹ %% + **} + if FGrid is class(TDrawGrid) then begin + str:=inttostr(d["value"][0])+":"+inttostr(d["value"][1]); + e.canvas.drawtext(str,e.subItemRect,DT_CENTER); + end + end + function CellLeave(grid);override;begin + {** + @explan(˵) 뿪༭ %% + **} + _wapi.PostMessageA(FeditWindow.handle,WM_CLOSE,0,0); + end +end +type TGridCellPairSpliterTypeEdit=class(TOneSelectCell,TPropertySpliterType) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertySpliterType).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type TGridCellTreeViewDataEdit=class(TGridCellEditWithButton,TPropertyTreeViewData) +private + FeditWindow; + Fgrid; + fi; + fj; + FnodeNum; + type tPopupEditorWindow=class(tpanel) + private + FtreeViewBox; + FnewItemBtn; + FnewSubItemBtn; + FmoveUpBtn; + FmoveDownBtn; + FdeleteBtn; + FclearBtn; + Fstatictxt0; + Fstatictxt1; + Fstatictxt2; + Fedit0; + Fedit1; + Fedit2; + Fokbtn; + Fcancelbtn; + mok; + editingNode; + function setwindow(window,l,t,w,h);begin + if l then window.left:=l; + if t then window.top:=t; + if h then window.height:=h; + if w then window.width:=w; + window.parent:=self; + end + type TreeViewEditorClass=class(TTreeView) + private + currentSelection; + counter; + fSelectionChanged; + function createNode(aname,img,selimg);begin + n:=new TTreeNode(self); + n.caption:=aname; + n.imgid:=img; + n.selimgid:=selimg; + return n; + end + type nameCounter=class + private + countNumber; + countUp; + public + function create();begin + countNumber:=0; + countUp:=0; + end + function getName();begin + if countUp<>1000000 then begin + ++countNumber; + return "Ŀ"+inttostr(countUp++); + end + return "Ŀ"; + end + function deleteName(n);begin + if "Ŀ"+inttostr(countUp-1)=n then + --countUp; + --countNumber; + end + function reset(n);begin + countNumber:=n?:0; + countUp:=n?:0; + end + end + function getlastnode(node);begin + t:=node.itemcount; + if t then + return getlastnode(node.indexof(t-1)); + return node; + end + function setCurrentSelection(n,b);begin + if b then + currentSelection:=n; + else + setsel(n); + end + function getCurrentSelection();begin + if ifnil(currentSelection) then + currentSelection:=rootItem; + return currentSelection; + end + public + function initializewnd();override;begin + inherited; + getCurrentSelection(); + end + function create(aOwner);override;begin + inherited; + // counter:=new nameCounter(); + self.OnSelChanged:=function(o,e)begin + if e.itemnew is class(tTreeNode) then begin + setCurrentSelection(e.itemnew,1); + calldatafunction(fSelectionChanged,getCurrentSelection()); + end + end + end + function addNewItem();begin + // + // if not currentSelection then currentSelection := RootItem; + if getCurrentSelection()=RootItem then + return addNewSubItem(); + // d:=createNode(counter.getName(),-1,-1); + d:=createNode("item",-1,-1); + // p:=currentSelection.parent; + getCurrentSelection().insertsibling(d); + setCurrentSelection(d); + end + function addNewSubItem();begin + // + // d:=createNode(counter.getName(),-1,-1); + d:=createNode("item",-1,-1); + getCurrentSelection().insertNode(d); + setCurrentSelection(d); + end + function move(b);begin + //0ƣ1ơ + if getCurrentSelection()=RootItem then + return; + t:=getCurrentSelection(); + if b then + getCurrentSelection().moveUp(); + else + getCurrentSelection().moveDown(); + setCurrentSelection(t); + end + function deleteThis();begin + if getCurrentSelection()=RootItem then + return; + // t:=currentSelection.getsibling(-1)?:currentSelection.parent; + getCurrentSelection().recycling(); + if RootItem.ItemCount<1 then setCurrentSelection(nil,1); + // setCurrentSelection(t); + end + function clear();begin + clean(); + // counter.reset(); + setCurrentSelection(nil,1); + end + function setTreeviewFigureData(arr,n);begin + lazyitems:=arr; + // counter.reset(n); + setCurrentSelection(nil,1); + end + property selectionChanged read fSelectionChanged write fSelectionChanged; + property selectedNode read currentSelection; + end + function flushInfo(n);begin + if n then begin + Fedit0.text:=n.caption; + Fedit1.text:=tostn(n.imgid); + Fedit2.text:=tostn(n.selimgid); + return; + end + Fedit0.text:=""; + Fedit1.text:=""; + Fedit2.text:=""; + end + function charProc(o,e)begin + ac:=e.wparam; + if ac=VK_RETURN then + return 1; + if not((ac>=48 and ac<58) or ac=VK_BACK or (not length(o.text) and ac=45)) then + e.skip:=1; + return 0; + end + function saveEditingNode(o,e);begin + editingNode:=FtreeViewBox.selectedNode; + end + public + function create(aOwner);override;begin + inherited; + caption:="TreeViewEditor"; + left:=300; + top:=300; + FtreeViewBox:=new TreeViewEditorClass(self); + FtreeViewBox.selectionChanged:=function(n)begin + flushInfo(n); + end + FnewItemBtn:=new tbtn(self); + FnewItemBtn.onclick:=function(o,e)begin + FtreeViewBox.addNewItem(); + end + FnewSubItemBtn:=new tbtn(self); + FnewSubItemBtn.onclick:=function(o,e)begin + FtreeViewBox.addNewSubItem(); + end + FmoveUpBtn:=new tbtn(self); + FmoveUpBtn.onclick:=function(o,e)begin + FtreeViewBox.move(1); + end + FmoveDownBtn:=new tbtn(self); + FmoveDownBtn.onclick:=function(o,e)begin + FtreeViewBox.move(); + end + FdeleteBtn:=new tbtn(self); + FdeleteBtn.onclick:=function(o,e)begin + FtreeViewBox.deleteThis(); + end + FclearBtn:=new tbtn(self); + FclearBtn.onclick:=function(o,e)begin + FtreeViewBox.clear(); + flushInfo(nil); + end + Fedit0:=new tedit(self); + Fedit0.onSetFocus:=thisfunction(saveEditingNode); + // Fedit0.onKillFocus:=function(o,e)begin + // if editingNode then + // editingNode.caption:=o.text; + // end + FEdit0.onkeypress:=function(o,e)begin + if e.wparam=VK_RETURN then + if editingNode then + editingNode.caption:=o.text; + end + Fedit1:=new tedit(self); + Fedit1.onSetFocus:=thisfunction(saveEditingNode); + // Fedit1.onKillFocus:=function(o,e)begin + // if editingNode then + // editingNode.ImgId:=strtoint(o.text); + // end + FEdit1.onkeypress:=function(o,e)begin + if call("charProc",o,e) then + editingNode.ImgId:=strtoint(o.text); + end + // Fedit1.onkeypress:= thisfunction(charProc); + Fedit2:=new tedit(self); + Fedit2.onSetFocus:=thisfunction(saveEditingNode); + // Fedit2.onKillFocus:=function(o,e)begin + // echo "[KillFocus]\n"; + // if editingNode then + // editingNode.SelImgId:=strtoint(o.text); + // end + Fedit2.onkeypress:=function(o,e)begin + if call("charProc",o,e) then + editingNode.SelImgId:=strtoint(o.text); + end + // Fedit2.onkeypress:=thisfunction(charProc); + Fokbtn:=new tbtn(self); + Fokbtn.onclick:=function(o,e)begin + calldatafunction(mok,o,e); + _send_(WM_CLOSE,0,0); + end + Fcancelbtn:=new tbtn(self); + Fcancelbtn.onclick:=function(o,e)begin + _send_(WM_CLOSE,0,0); + end + Fstatictxt0:=new TLabel(self); + Fstatictxt1:=new TLabel(self); + Fstatictxt2:=new TLabel(self); + height:=358;//ߴ硣 + width:=570; + wscaption := true; + wssysmenu := true; + wspopup := true; + visible := false; + end + function initializewnd();override;begin + inherited; + setwindow(FtreeViewBox,24,24,216,280); + setwindow(FnewItemBtn,270,24,112); + FnewItemBtn.caption:="½"; + setwindow(FnewSubItemBtn,270,73,112); + FnewSubItemBtn.caption:="½"; + setwindow(FmoveUpBtn,270,122,112); + FmoveUpBtn.caption:="ѡ"; + setwindow(FmoveDownBtn,270,171,112); + FmoveDownBtn.caption:="ѡ"; + setwindow(FdeleteBtn,270,220,112); + FdeleteBtn.caption:="ɾѡ"; + setwindow(FclearBtn,270,270,112); + FclearBtn.caption:="ɾ"; + Fstatictxt0.caption:="name:"; + setwindow(Fstatictxt0,400,24,128,20); + setwindow(Fedit0,400,47,128); + Fstatictxt1.caption:="imageid:"; + setwindow(Fstatictxt1,400,78,128,20); + setwindow(Fedit1,400,101,128); + Fstatictxt2.caption:="selimageid:"; + setwindow(Fstatictxt2,400,132,128,20); + setwindow(Fedit2,400,155,128); + Fokbtn.caption:="ȷ"; + setwindow(Fokbtn,400,269,65); + Fcancelbtn.caption:="ȡ"; + setwindow(Fcancelbtn,475,269,65); + end + function WMCLOSE(o,e):WM_CLOSE;override;begin + o.visible:=false; + e.skip:=1; + + inherited; + end + function getlazyitems();begin + n:=FtreeViewBox.lazyitems; + // echo ">>Origin Lazyitems:",tostn(n); + if ifnil(n) then return array("type":"treenodes"); + return n; + end + function updateEditorData(arr,n);begin + if ifnil(arr) then + arr:=array("type":"treenodes"); + //echo ">>UPDATENUM:",n,"\n"; + FtreeViewBox.setTreeviewFigureData(arr,n); + flushInfo(nil); + end + property ok read mok write mok; + end + function getnodenum(arr);begin + r:=mrows(arr); + for i:=0 to r-1 do + if arr[i]["nodes"] then + r+=getnodenum(arr[i]["nodes"]["items"]); + return r; + end +public + function create(AOwner);override;begin + inherited; + Fgrid:=aOwner; + FeditWindow:=nil; + end + function CellClick(grid,e,d);override;begin + Fi := e.iitem; + Fj := e.isubitem; + inherited; + end + function CellLeave(grid);override;begin + if FeditWindow then + _wapi.PostMessageA(FeditWindow.handle,WM_CLOSE,0,0); + end + function ButtonClick(grid,e,d);override;begin + if ifnil(FeditWindow) then begin + FeditWindow:=new tPopupEditorWindow(FGrid); + FeditWindow.ok:=function(o,e)begin + t := FeditWindow.getlazyitems(); + Fgrid.CellChanged(Fi,Fj,"value",t); + end + end + if ifnil(FeditWindow.parent) then begin + FeditWindow.parent :=FGrid; + end + rec := grid.getSubItemRect(Fi,Fj); + FeditWindow.updateEditorData(d["value"],ifnil(FnodeNum)?0:FnodeNum); + FeditWindow.show(); + end + function CellDrawLabel(dc,rect,d);override;begin + // FnodeNum:=getnodenum(d["value"]["items"]); + // str:="itemstats:"+(ifnil(d["value"])?"0":inttostr(FnodeNum)); + str:="itemstrings"; + dc.drawtext(str,rect,DT_LEFT); + end +end + +type tGridCellAlignPosBoxEdit = class(TOneSelectCell,TPropertyAlign9) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyAlign9).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +//////////////////////ѡlist////////////////////////////// +type TMultiSelList = class(TCustomControl) + function Create(AOwner); + begin + inherited; + FList := new TListBox(self); + FList.Multisel := 2; + //FList.Appenditems(array("a","b","c")); + FList.setCurrentSelection(array(0,1)); + FList.parent := self; + FOkBtn := new TBTN(self); + FBtnWidth := 80; + FOkBtn.width := FBtnWidth; + FOkBtn.caption := "ȷ"; + FOkBtn.parent := self; + FCanceBtn := new TBTN(self); + FCanceBtn.width := FBtnWidth; + FCanceBtn.caption := "ȡ"; + FCanceBtn.parent := self; + FCanceBtn.onclick := thisfunction(CancelClick); + FOkBtn.onclick := thisfunction(okClick); + end + function GetSelectdata(); + begin + idx := FList.getSelectedIndexes(); + r := array(); + for i,v in idx do + begin + r[i] := Fdata[v,1]; + end + return r; + end + function SetSelectData(d); + begin + idxs := array(); + for i,v in d do + begin + for j,vj in Fdata do + begin + if v=vj[1] then + begin + idxs[i] := j; + break; + end + end + end + FList.setCurrentSelection(idxs); + end + function SetListData(d); + begin + if ifarray(d) then + begin + FList.SetData(d[:,0]); + Fdata := d; + end + end + function Recycling();override; + begin + fOnokclick := 0; + FOnCancelclick := 0; + Fdata := 0; + FBtnWidth:=0; + FList:=0; + FOkBtn:=0; + FCanceBtn:=0; + end + function DoControlAlign();override; + begin + if FList and FOkBtn AND FCanceBtn then + begin + r := ClientRect; + h := FOkBtn.height; + c := r; + c[3]-=h+4; + FList.SetBoundsRect(c); + bt := r[3]-h-1; + FOkBtn.Top := bt; + FOkBtn.Left := r[2]-FBtnWidth-5; + FCanceBtn.top := bt; + FCanceBtn.Left := r[2]-FBtnWidth-FBtnWidth-10; + end + end + function CancelClick(o,e); + begin + calldatafunction(FOnCancelclick,self(true),e); + end + function okClick(o,e); + begin + calldatafunction(fOnokclick,self(true),e); + end + property OnCancelclick read FOnCancelclick write FOnCancelclick; + property Onokclick read FOnokclick write fOnokclick; + private + fOnokclick; + FOnCancelclick; + Fdata; + FBtnWidth; + FList; + FOkBtn; + FCanceBtn; +end +type TMultiSelectCell = class(TGridCellEditWithButton) + FListSel; + private + FPanel; + FI; + FJ; + FCellv; + function GetSelPanel();virtual; + begin + if not FPanel then + begin + FPanel := new TMultiSelList(Owner); + FPanel.OnCancelclick := function(o,e)begin + o.visible := false; + end + FPanel.wspopup := true; + FPanel.SetListData(SelPalRange()); + FPanel.Onokclick := thisfunction(SelChanged); + end + end + function SelPalRange();virtual; + public + function SelChanged(o,e); + begin + if fi>=0 and fj>=0 and ifarray(FCellv) then + begin + o.visible := false; + v := o.GetSelectdata(); + Owner.CellChanged(FI,FJ,"value",V); + end + end + function create(AOwner);override; + begin + inherited; + end + function ButtonClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + inherited; + fi := e.iitem; + fj := e.isubitem; + FCellv := array(); + GetSelPanel(); + rec := GetPopRectByHeight(160); + rec[3] := rec[1]+160; + FPanel.SetBoundsRect(rec); + FPanel.SetSelectData(FListSel); + FPanel.Show(); + end + function CellLeave(grid);override; + begin + {** + @explan(˵) 뿪༭ %% + **} + if FPanel then + FPanel.visible := false; + end; +end +//************red**propery********************************** +type TOneSelectCell = class(TGridCellEditWithButton) + private + FPanel; + FI; + FJ; + FCellv; + function GetSelPanel();virtual; + begin + if not FPanel then + begin + FPanel := new UniCheckList(Owner); + FPanel.wspopup := true; + FPanel.SetList(SelPalRange()); + FPanel.OnSelChanged := thisfunction(SelChanged); + end + end + function SelPalRange();virtual; + public + function SelChanged(o,v); + begin + if fi>=0 and fj>=0 and ifarray(FCellv) then + begin + o.visible := false; + Owner.CellChanged(FI,FJ,"value",v); + end + end + function create(AOwner);override; + begin + inherited; + end + function ButtonClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + inherited; + fi := e.iitem; + fj := e.isubitem; + FCellv := array(); + GetSelPanel(); + rec := GetPopRectByHeight(160); + rec[3] := rec[1]+160; + FPanel.SetBoundsRect(rec); + FPanel.Show(); + end +end +type TGridCellAnchorsEdit = class(TMultiSelectCell,TPropertyAnchors) + {** + @explan(˵)align%% + **} + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + FListSel := d["value"]; + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyAnchors).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type TGridCellAlignEdit = class(TOneSelectCell,TPropertyAlign) + {** + @explan(˵)align%% + **} + + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyAlign).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type TGridCellTabAlignEdit = class(TOneSelectCell,TPropertyTabAlign) + {** + @explan(˵)align%% + **} + + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyTabAlign).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type TtextEditor = class(tpanel) +{** + @explan(˵)memo༭%% + **} + protected + btn1; + btn2; + function SetItemStr(v);virtual; + begin + memo.text := v; + end + function GetItemStr();virtual; + begin + memo.text; + end + public + itemData; + memo; + function DoControlAlign(); + begin + if btn1 and btn2 and memo then + begin + rc := ClientRect; + rc2 := rc; + rc2[3]-=38; + memo.SetBoundsRect(rc2); + btop := rc[3]-34; + rt := rc[2]-5; + btn2.top := btop; + btn1.Top := btop; + btn2.Left := rc2[0]+(rt-btn2.width); + btn1.Left := rc2[0]+(rt-btn2.width*2-20); + end + end + function create(AOwner);override; + begin + inherited; + height := 400; + width := 400; + left := 500; + top := 200; + wspopup := true; + wscaption := true; + wssysmenu := true; + caption := "text Editor Dialog"; + memo := new tmemo(self); + memo.OnKeyPress := thisfunction(MemoKeyPress); + memo.parent :=self; + btn1 := new tbtn(self); + btn1.parent := self; + btn2 := new tbtn(self); + btn2.parent := self; + btn1.caption := "ȡ"; + btn2.caption := "ȷ"; + btn1.onclick := thisfunction(cancelEdit); + btn2.onclick := thisfunction(comfirmEdit); + itemData:= ""; + end + function MemoKeyPress(o,e);virtual; + begin + + end + function textonumber(v);virtual; + begin + return v; + end + function comfirmEdit(o,e);virtual; + begin + itemData := memo.text; + EndModalCode := 1; + return EndModal(); + end + function WMClose(o,e):WM_CLOSE;override; + begin + memo.text := " "; + e.skip := true; + EndModalCode := 0; + o.EndModal(); + end + function cancelEdit(o,e);virtual; + begin + //memoϵͬʱ¼õmemo + //رeditor + memo.text := " "; + EndModalCode := 0; + return EndModal(); + end + property ItemStr read GetItemStr write SetItemStr; +end + +type TGridCellTextEdit = class(TGridCellEditWithButton,TPropertyText) +{** + @explan(˵)༭ַı%% + **} + private + isShow; + FRbuttonWidth; + screenbottom; + protected + Fowner; + Fpanel; + rowNum; + colNum; + Fgrid; + public + function create(AOwner);override; + begin + inherited; + Fowner := AOwner; + Fpanel := nil; + FRbuttonWidth := 20; + screenArr := _wapi.getscreenrect(); + screenbottom := screenArr[3]; + isShow := true; + end + function createEditObj();virtual; + begin + Fpanel := new TtextEditor(Fowner); + end + function ButtonClick(grid,e,d);override; + begin + {** + @explan(˵) ӵ %% + **} + inherited; + rowNum := e.iitem; + colNum := e.isubitem; + Fgrid := grid; + pt := e.ptaction; + rec := grid.getSubItemRect(rowNum,colNum); + if pt[0]>=(rec[2]-FRbuttonWidth) then + begin + if ifnil(Fpanel) then begin + createEditObj(); + Fpanel.parent := Fowner; + Fpanel.OnActivate := function(o,e) + begin + if e.lowparam = WA_INACTIVE then + begin + CellLeave(Fgrid); + end + end; + end + clickToText(d); + if Fpanel.showmodal()=1 then + begin + textChange1(Fpanel.itemData); + end + end + end + function clickToText(d);virtual; + begin + if d["value"] <> " " then + begin + Fpanel.ItemStr := d["value"]; + end + end + function CellName();virtual; + begin + return "text"; + end + function textChange1(data);virtual; + begin + Fgrid.CellChanged(rowNum,colNum,"value",data); + end + function CellDrawLabel(dc,rect,d);override; + begin + {** + @explan(˵) Ƹ %% + **} + dc.drawtext(cellName(),rect); + end +end + +type TGridCellStringsEdit = class(TGridCellTextEdit) + {** + @explan(˵)༭ַ%% + **} + protected + function createEditObj();override; + begin + Fpanel := new TstringsEditor(Fowner); + end + function clickToText(d);override; + begin + if length(d["value"]) = 0 then Fpanel.ItemStr := ""; + else Fpanel.ItemStr := Array2Str(d["value"],"\r\n"); + end + function CellName();Override; + begin + return ""; + end + public + function EditType();override; + begin + return "strings"; + end + function Create(AOwner); + begin + inherited; + end +end +type TstringsEditor = class(TtextEditor) + {** + @explan(˵)memo༭%% + **} + protected + function textonumber(v);override; + begin + return v; + end + function comfirmEdit(o,e);override; + begin + itemData := array(); + linecount := memo.getlinecount(); + if linecount > 0 then begin + for i:= 1 to linecount do + begin + str := memo.getline(i); + itemData[i-1] := textonumber(str); + end + end + EndModalCode := 1; + return EndModal(); + end + public + function create(AOwner);override; + begin + inherited; + caption := "Strings Editor Dialog"; + end +end +type TGridCellIntegersEdit = class(TGridCellStringsEdit) + {** + @explan(˵)༭%% + **} + protected + function createEditObj();override; + begin + Fpanel := new TIntegersEditor(Fowner); + end + function CellName();override; + begin + return "integers"; + end + public + function Create(AOwner);override; + begin + inherited; + end + function EditType();override; + begin + return "integers"; + end +end +type TIntegersEditor = class(TstringsEditor) + {** + @explan(˵)memo༭%% + **} + protected + function textonumber(txt);override; + begin + return strtointdef(txt,0); + end + function MemoKeyPress(o,e);override; + begin + if e.wparam = ord("-") then + begin + end else begin + if not(e.wparam >= ord("0") and e.wparam<= ord("9") or e.wparam = VK_BACK or e.wparam = 13) then + e.skip := true; + end + end + public + function create(AOwner);override; + begin + inherited; + caption := "Integers Editor Dialog"; + end +end +type TGridCellEsAlignEdit = class(TOneSelectCell,TPropertyEsAlign) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyEsAlign).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end + + +type TGridCellColorBoxEdit = class(TOneSelectCell,TPropertyColorList) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertyColorList).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type tGridCellMbbtnstyleEdit=class(TOneSelectCell,TPropertymbbtnstyle) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertymbbtnstyle).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end +type tGridCellMbiconstyleEdit=class(TOneSelectCell,TPropertymbicostyle) + function CellDrawLabel(dc,rect,d);override; + begin + if ifarray(d) then + begin + dc.drawtext(FormatTMF(d["value"]),rect); + end + end + function create(AOwner);override; + begin + inherited; + class(TPropertymbicostyle).Create(); + end + private + function SelPalRange();virtual; + begin + return SelRange; + end +end //Ա༭ + +type TPropGrid = class(TTSLDataGrid) +{** + @explan(˵)Ա༭ %% +**} + protected + FDesigner; + private + FCellEditers; + FCurrentEditer; + FCurrentIndex; + FEventEditer; + FVariabeEditer; + + static FCellRenders; + function GetCellEditer(n); + begin + r := FCellEditers[n]; + if not r then + begin + t := GetRegCellRender(n) ;//GetPropertyType(n); + if not ifobj(t) then exit; + r := t.CreateEditer(self(true)); + FCellEditers[n] := r; + end + if r is class(TGridCellVariableEdit) then + begin + r.DataList := FVariabeEditer; + //r.FVariabeEditer := FVariabeEditer; + end else + if r is class(TGridCellEventHandleEdit) then + begin + r.DataList := FEventEditer; + FEventEditer.ColumnHeader := true; + FEventEditer.OnColumnClick := thisfunction(clickediter); + //r.FEventEdit := FEventEditer; + end + return r; + return FCellEditers[n]; + end + function clickediter(o,e); + begin + if FComponent then + FDesigner.AddAndOPenEvent(FComponent.TreeNode);//DBLClickComponent(); + end + function currentLeave(); + begin + if FCurrentEditer is class({TGridCellEdit}TGridPropertyRender) then + begin + FCurrentEditer.CellLeave(self(true)); + FCurrentIndex := nil; + FCurrentEditer := nil; + end + end + protected + FComponent; + function SetComponent(v);virtual; + begin + FComponent := v; + currentLeave(); + end + public + class function RegCellRender(t); + begin + if not ifarray(FCellRenders) then FCellRenders := array(); + FCellRenders[t.EditType()] := t; + end + class function GetRegCellRender(n); + begin + if not(FCellRenders and ifstring(n)) then return ; + return FCellRenders[n]; + end + private + FInsetvalue; + public + function CellChanged(i,j,index,d);virtual; + begin + indexs := 1; + if FInsetvalue then exit; + FInsetvalue := true; + try + od := getdata(i,j,cp,indexs); + if not ifarray(od) then exit; + if od[index]<>d then + begin + SetValue(indexs union array(index),d); + rec := GetSubItemRect(i,j); + InvalidateRect(rec,true); + end + currentLeave(); + except + + end; + FInsetvalue := false; + end + function SetValue(indexs,d); virtual;//޸Ķ + begin + {** + @explan(˵) ޸ĸӵ,Ѿؼ%% + **} + if not (FComponent is class(TDComponent)) then exit; + n := indexs[0]; + {rfocus := false; + if n in array("left","top","width","height") then + begin + ccwnd := FComponent.Cwnd; + if ccwnd is class(TWincontrol) then + begin + if Designer then + begin + Designer.setcomponentfocus(ccwnd,false); + rfocus := true; + end + end + end + //inherited; + if (n="visible" and not(d)) or (n="wspopup" and d) or (n="align") then + begin + if Designer then + begin + Designer.setcomponentfocus(FComponent.Cwnd,false); + end + end } + if FComponent.SetComponentProperties(n,d) then + begin + //echo "\r\ntrue"; + inherited; + end + + {if (n="visible" and d) or (n="wspopup" and not(d)) then + begin + if Designer then + begin + Designer.setcomponentfocus(FComponent.Cwnd,true); + end + end } + end + function SetGridValue(index,d,o); + begin + if (FComponent is class(TDComponent)) and FComponent.Cwnd = o then + begin + dt := TSLData; + if ifarray(dt) then + begin + for i,v in mrows(dt,1) do + begin + if v=index then + begin + CellChanged(i,1,"value",d); + return 1; + end + end + end + end + return o.SetPublish(index,d); + end + function WMMove(o,e):WM_MOVE;override; + begin + inherited; + currentLeave(); + end + function CellClick(o,e);virtual; + begin + + i := e.iitem; + j := e.isubitem; + cellid := array(i,j); + if not( i>=0 and j>=0) then + begin + return currentLeave(); + end + index := 1; + d := getdata(i,j,cp,index); + if ifarray(d) and d["type"]="object" then + begin + editer := GetCellEditer(d["class"]); + if (cellid<>FCurrentIndex ) then + begin + currentLeave(); + end + if ifobj( editer) then + begin + FCurrentEditer := editer; + FCurrentIndex := cellid; + editer.CellClick(o,e,d); + end + end else + begin + if (cellid<>FCurrentIndex) then + begin + currentLeave(); + FCurrentIndex := cellid; + end + end + end + function create(AOwner);override; + begin + inherited; + ColumnHeader := false; + color := rgb(255,255,255); + onclick := thisfunction(CellClick); + ColumnWidth := 150; + FCellEditers := array(); + //OndblClick := nil; + FDesigner := AOwner; + end + function Recycling();override; + begin + FDesigner := nil; + inherited; + end + function CNMEASUREITEM(O,E):CN_MEASUREITEM;override; + begin + e.height := 26; + end + function DoDrawSubItem(o,e);override; + begin + j := e.subitemid; + dc := e.canvas; + dc.font := font; + if j=0 then return inherited; + i := e.itemid; + d := getdata(i,j); + if ifstring(d) or ifnumber(d) then + begin + return inherited; + end else + if ifnil(d) then return ; + + src :=e.SubItemRect; + if not(ifarray(d) and (d["type"] = "object" )) then exit; + edit := GetCellEditer(d["class"]); + if not(edit)then return inherited; + edit.CellDraw(o,e,d); + + end + property EventEditer write FEventEditer; + property VariabeEditer write FVariabeEditer; + property Component read FComponent write SetComponent; + property Designer read FDesigner; + {** + @param(Component)(TDComponent) ؼƶ %% + @param(Designer)(TVclDesigner) %% + **} +end; + +type TPropEditGrid = class(TPropGrid) +{** + @explan(˵) Ա༭ %% +**} + protected + function SetComponent(v);override; + begin + if v=FComponent then exit; + if v is class(TDComponent) then + begin + TSLData := v.GetPublishProperties(); + end else + begin + TSLData := array(NIL); + end + inherited; + end + public + function Create(AOwner); + begin + inherited; + end + +end +type TEventEditGrid = class(TPropGrid) +{** + @explan(˵) ¼༭ %% +**} + protected + function SetComponent(v);override; + begin + if v=FComponent then exit; + if v is class(TDComponent) then + begin + TSLData := v.GetPublishEvents(); + //echo tostn(TSLData); + end else + begin + TSLData := array(NIL); + end + inherited; + end + + public + function Create(AOwner); + begin + inherited; + OndblClick := thisfunction(GridCellDblClick); + end + function GridCellDblClick(o,e);override; + begin + i := e.iitem; + j := e.isubitem; + cellid := array(i,j); + if not(i >= 0 and j >= 0)then + begin + exit; + end + d := getdata(i,j); + if ifarray(d)and d["type"]="object" then + begin + rd := GetRegCellRender(d["class"]); + if rd is class(TGCellRender)then //˫ + begin + if FComponent then + begin + FDesigner.addandopeneventbyname(FComponent.TreeNode,getdata(i,0));//DBLClickComponent(); + end + end + end + end + +end +//ؼڵ +type TComponentTreeNode = class(TTreeNode) +{** + @explan(˵)ڵ %% +**} + private + FComponent; + public + function create(AOwner);override; + begin + inherited; + end + function Recycling();override; + begin + FComponent := nil; + inherited; + end + property Component read FComponent write FComponent; +end +type TComponentTree = class(TTreeView) +{** + @explan(˵)ؼ %% +**} + private + FEventGrid; + FProGrid; + FDesigner; + FLoading; + public + function hasFocus();override; + begin + return true; + end + function SetSel(item);override; + begin + if not FLoading then inherited; + end + function CreateTreeNode();override; + begin + return new TComponentTreeNode(self(true)); + end + function Recycling();override; + begin + FDesigner := nil; + inherited; + end + function create(AOwner);override; + begin + inherited; + FDesigner := AOwner; + end + function GetRootNode();override; + begin + r := inherited; + if not(r.Component) then + begin + c := new TDComponent(); + c.Cwnd := owner; + r.Component := c; + end + return r; + end + //ContextMenu(o,e) + + property EventGrid read FEventGrid write FEventGrid; + property ProGrid read FProGrid write FProGrid; + property Designer read FDesigner ; + property Loading read FLoading write FLoading; + {** + @param(Designer)(TVclDesigner) %% + **} +end +type TDesigImageList = class(TControlImageList) +{** + @explan(˵) imagelist %% +**} + private + FIconMaps; + public + function Create(AOwner);override; + begin + inherited; + Width := 24; + Height := 24; + FIconMaps := array(); + end + function RegisterDitem(item);virtual; + begin + {** + @explan(˵) עͼ %% + @param(item)(TDComponent) %% + **} + if item is Class(TDComponent) then + begin + n := item.ClassName; + id := FIconMaps[n]; + bmp := item.bitmap(); + if (bmp is class(tbitmap)) and bmp.HandleAllocated() then + begin + if id>=0 then + begin + Replaceimge(id,bmp) ; + end else + begin + addbmp(bmp); + FIconMaps[n] := ImageCount-1; + end + end + end + end + function GetImageId(v); + begin + if ifstring(v) then + begin + n := v; + end + if v is class(TDComponent) then + begin + n := V.ClassName; + end + r := FIconMaps[n]; + return r?r:0; + if r then return r; + //return FIconMaps["tvcform"]; + end + +end + +type TListEidter = class(TPanel) +{** + @explan(˵) list༭ %% +**} + private + FListControl; + FBadd; + FBdelete; + FBup; + FBdown; + FBAplay; + FOnApplay; + FListWidth; + public + function WMCLOSE(o,e):WM_CLOSE;override; + begin + e.skip := true; + inherited; + end + function ListCheck(v);virtual; + begin + {** + @explan(˵) list %% + @param(v)(TWincontrol) %% + **} + return v is class(TGridList); + end + function SetListControl(v); + begin + if ifnil(v) then + begin + if FListControl then + begin + FListControl.Recycling(); + FListControl:= nil; + end + end + if ifnil(FListControl) and (ListCheck(v)) + and v.parent = self then + begin + FListControl := v; + DoControlAlign(); + end + + end + function SetListWidth(v); + begin + if v>100 and v<> FListWidth then + begin + FListWidth := v; + DoControlAlign(); + end + end + function Buttons();virtual; + begin + {** + @explan(˵) Ҳ ť %% + **} + return array(FBadd,FBdelete,FBup,FBdown,FBAplay); + end + function DoControlAlign();override; + begin + if not HandleAllocated() then exit; + sz := clientrect; + if FListControl and FListControl.parent = self then + begin + sz[2] := FListWidth; + FListControl.SetBoundsRect(sz); + BTS := Buttons(); + y := 30; + x := FListWidth+10; + for i,v in BTS do + begin + if v and (v is class(tcontrol)) and (v.parent=self) and v.visible then + begin + v.left := x; + v.top := y; + y+=v.height+10; + end + + end + end + end + function create(AOwner);override; + begin + inherited; + caption := "Imagelist Editer"; + minmaxbox := false; + left := 400; + height := 600; + width := 350; + FListWidth:=250; + WsCaption := true; + WsPopUp := true; + WsSysmenu := true; + wsSizeBox := false; + FBadd := new tbtn(self); + FBup := new tbtn(self); + FBdown := new tbtn(self); + FBAplay := new tbtn(self); + FBdelete := new tbtn(self); + FBadd.caption := ""; + FBup.caption := ""; + FBdown.caption := ""; + FBAplay.caption := "Ӧ"; + FBdelete.caption := "ɾ"; + + FBAplay.onclick := thisfunction(applay); + FBadd.parent := self; + FBup.parent := self; + FBdown.parent := self; + FBAplay.parent := self; + FBadd.onclick := thisfunction(addclick); + FBdelete.onclick := thisfunction(delselect); + FBup.onclick := thisfunction(moveup); + FBdown.onclick := thisfunction(movedown); + for i,v in Buttons() do + begin + if (v is class(tcontrol)) and v.visible then + v.parent := self; + end + end + function moveup(o,e);virtual; + begin + if FListControl then + FListControl.moveup(); + end + function movedown(o,e);virtual; + begin + if FListControl then + FListControl.movedown(); + end + function delselect(o,e);virtual; + begin + if FListControl then + FListControl.deleteselect(); + end + function addclick(o,e);virtual; + begin + + end + function applay(o,e);virtual; + begin + calldatafunction(OnApplay,self(true)); + end + property ListWidth read FListWidth write SetListWidth; + property OnApplay read FOnApplay write FOnApplay; + property ListControl read FListControl write SetListControl; + {** + @param(OnApplay)(function[TListEidter]) Ӧðťص %% + **} +end + +type TvclFormManager = class(TListEidter) +{** + @explan(˵) ڹ %% +**} + private + FOnAddForm; + FOnOpenFrom; + FOnRemoveForm; + FOnSetMainForm; + FSaveEdition; + FOpenEditon; + FAddPanelForm; + FRenameEdition; + FOnSaveWindowEditon; + FOnOpenWindowEditon; + FOnRenameForm; + FOnAddPanelForm; + type TFormList = class(TGridList) + FMainForm; + function SetItem(idx,v); + begin + cs := self.SelectedValue; + if FMainForm = cs then + begin + s := true; + end + inherited; + if s then SetMainForm(v); + end + function SetMainForm(v); + begin + if FMainForm=v then exit; + draw1 := finditemid(FMainForm); + FMainForm := v; + draw2 := finditemid(v); + if draw1>=0 then + begin + GridDrawItem(draw1); + end + if draw2>=0 then + begin + GridDrawItem(draw2); + end + end + function clean();override; + begin + inherited; + FMainForm := nil; + end + function create(AOwner);override; + begin + inherited; + Columns := array(("text":"id","width":40),("text":"","width":150),("text":"main","width":50)); + //FMainForm := "tform2"; + end + function DoDrawSubItem(o,e);override; + begin + j := e.subitemid; + i := e.itemid; + if j in array(1,2) then + begin + dc := e.canvas; + src := e.subItemRect; + fn := List[i]; + if j=2 then + begin + if fn = FMainForm then fn := "**"; + else fn := ""; + end + dc.DrawText(fn,src,DT_VCENTER .| DT_SINGLELINE); + end + else inherited; + end + property MainForm read FMainForm write SetMainForm; + end + public + function clean(); + begin + ListControl.clean(); + end + function create(AOwner);override; + begin + inherited; + caption := "ڹ"; + left := 300; + top := 300; + ed := new TFormList(self); + + FOpenEditon := new TBtn(self); + FRenameEdition := new TBtn(self); + FOpenEditon.parent := self; + FAddPanelForm := new TBtn(self); + FAddPanelForm.caption := "崰"; + FAddPanelForm.parent := self; + FAddPanelForm.onclick := thisfunction(addpanelform); + FRenameEdition.parent := self; + btns := Buttons(); + btns[0].caption := "Ӵ"; + btns[0].OnClick := thisfunction(addform); + btns[1].caption := "Ƴ"; + btns[1].OnClick := thisfunction(removeform); + btns[2].caption := ""; + btns[2].OnClick := thisfunction(openform); + btns[3].Caption := "Ϊ"; + btns[3].width := btns[3].width+10; + btns[3].OnClick := thisfunction(setMainForm); + btns[4].Caption := "洰ڰ汾"; + btns[4].width := btns[4].width+10; + btns[4].OnClick := thisfunction(SaveWindowEdition); + btns[5].Caption := "ԭ汾"; + btns[5].OnClick := thisfunction(openWindowEdition); + btns[6].caption := ""; + btns[6].OnClick := thisfunction(RenameForm); + //btns[5].visible := false; + //btns[4].visible := false; + ed.parent := self; + ListControl := ed; + OnClose := function(o,e) + begin + o.visible := false; + e.skip := true; + end + width := 400; + end + function SaveWindowEdition(o,e); + begin + calldatafunction(OnSaveWindowEditon,self(true)); + end + function OpenWindowEdition(o,e); + begin + calldatafunction(OnOpenWindowEditon,self(true)); + end + function RenameForm(o,e); + begin + calldatafunction(FOnRenameForm,self(true)); + end + function addpanelform(o,e); + begin + calldatafunction(OnAddPanelForm,self(true)); + end + function addform(o,e); + begin + calldatafunction(OnAddForm,self(true)); + end + function removeform(o,e); + begin + calldatafunction(OnRemoveForm,self(true)); + end + function openform(o,e); + begin + calldatafunction(OnOpenFrom,self(true)); + end + function setMainForm(o,e); + begin + calldatafunction(OnSetMainForm,self(true)); + end + function Buttons();override; + begin + r := inherited; + r[length(r)] := FOpenEditon; + r[length(r)] := FRenameEdition; + r[length(r)] := FAddPanelForm; + for i,v in r do if v then v.width := 120; + return r; + end + property OnRenameForm read FOnRenameForm write FOnRenameForm; + property OnSaveWindowEditon read FOnSaveWindowEditon write FOnSaveWindowEditon; + property OnOpenWindowEditon read FOnOpenWindowEditon write FOnOpenWindowEditon; + property OnAddPanelForm read FOnAddPanelForm write FOnAddPanelForm; + property OnAddForm read FOnAddForm write FOnAddForm; + property OnRemoveForm read FOnRemoveForm write FOnRemoveForm; + property OnOpenFrom read FOnOpenFrom write FOnOpenFrom; + property OnSetMainForm read FOnSetMainForm write FOnSetMainForm; + +end +type TStrFileer = class() +{** + @explan(˵)ıļд %% +**} + private + FPath; + FData; + FLastError; + function SetPath(v); + begin + if v<>FPath then + begin + FPath := v; + FData := ""; + if not FileExists("",v) then exit; + size:=filesize("",FPath); //ȡļС + if readFile(rwraw(),"",FPath,0,size,FData) then + begin + end + else + begin + FLastError := FData; + FData := ""; + end + end + end + public + function create(); + begin + FOpenOk := false; + end + function clean(); + begin + FPath := nil; + end + function ReWrite(p,d,ch); + begin + {** + @explan(˵) ļд %% + **} + if not ifstring(p) then exit; + if not ifstring(d) then exit; + if not FileExists("",p) then + begin + return writefile(rwraw(),"",p,0,length(d),d); + end + SetPath(p); + if FData<>d then + begin + if FData=d then exit; + if ch and ifstring(ch) then + begin + r := writefile(rwraw(),"",ch,0,length(FData),FData); + end + if length(FData)>length(d) then + begin + FileDelete("",p); + end + return writefile(rwraw(),"",p,0,length(d),d); + end + return true; + end + property Path read FPath write SetPath; + property LastError read FLastError; + property Data read FData; + {** + @param(path)(string) ļ· %% + @param(FData)(string) ļ %% + **} +end +type TToolbars = class(TPageControl) + private + FToolbars; + FLabels ; + fimg; + function SetImageList(im); + begin + fimg := im; + end + public + function Create(AOwner);override; + begin + inherited; + align := alClient; + FToolbars := array(); + end + Procedure Notification(AComponent,Operation);virtual; + begin + if Operation=opRemove then + begin + if AComponent=fimg then + begin + fimg := nil; + end else + begin + for i,v in FToolbars do + begin + if v=AComponent then + begin + idx := i; + end + end + if idx then + begin + reindex(FToolbars,array(idx:nil)); + end + end + end + inherited; + end + function CrossCursor(f); + begin + for i,v in FToolbars do + begin + if f then + v.Cursor := OCR_CROSS; + else v.Cursor := OCR_NORMAL; + end + end + function addbtn(btn,t); + begin + if not(t and ifstring(t)) then + begin + t := ""; + end + tb := FToolbars[t]; + if not tb then + begin + st := new TTabSheet(self); + st.caption := t; + + tb := new ttoolbar(self); + tb.align := alClient; + if t<>"ǵӿؼ" then + begin + st.parent := self; + tb.parent := st; + end + tb.imagelist := fimg; + FToolbars[t] := tb; + end + btn.parent := tb; + end + property ImageList write SetImageList; + +end + +//********************************************** +type TVclDesigner = class(tvcform) +{** + @explan(˵) ؼ %% +**} + private + + FChmHelper; + tmpcanvas; //canvas + FImageList; //ͼ + FViewBitmap; + FCTrans; + FVariableSelecter; + FFunctionSelecter; + Ftvclform; + //**********˵*************** + FMenu0; + FParser; + //******************************** + FToolBars; + FTree; + FCurrentTreeNode; + FObjInspector; + FPropGrid; + FEventGrid; + + FTempCanvas; + static FClassItems; + //************************************ + FCurrentNode; + FCurrentClikPos; + FComponentCreater; + FRounMenu; + FStopMenu; + FProjectsManager; + FProjectManager; + //*************************** + function WrapProjectTo(); + begin + FProjectManager.WrapTo(); + end + function OpenProjectFromtpj(); //ѡ + begin + SetWndPostWithMouse(FProjectsManager); + FProjectsManager.Show(); + return ; + end + function ShowProjectView(o,e); //ļ + begin + FProjectManager.visible := not FProjectManager.visible; + if o then + begin + FProjectManager._tag := o; + o.Checked := FProjectManager.visible; + end + //FProjectManager.show(); + end + + function addtoolbuttons();//ӹ + begin + {** + @explan(˵)ӹ %% + **} + for i,v in FClassItems do + begin + FImageList.RegisterDitem(v); + //if not v.InToolBar() then continue; + tb := new TToolButton(self); + tb.caption := v.HitTip; + tb.Enabled := v.InToolBar(); + ig := FImageList.GetImageId(V.ClassName); + tb.imageid := ig; + v.Imgs := ig; + tb._tag := v; + tb.onclick := thisfunction(OnToolButtonCick); + FToolBars.addbtn(tb,v.classification); + end + end + + function calcheight(twidth); //߶ȼ + begin + //extheight := CaptionHeight()+MenuBarHeight(); + clc := array(); + if FClassItems and ifarray(FClassItems) then + begin + for i,v in FClassItems do + begin + cli := v.classification; + if not(cli and ifstring(cli)) then cli := ""; + if ifnil(clc[cli]) then clc[cli] := 0; + clc[cli]+=1; + end + mx := 0; + for i,v in clc do mx := max(mx,v); + height := (integer(mx*32/twidth)+1)*32+60+30; + end else + height := 90+32; + end + + function TreeNode2tfmsub(lib,node,itemnames);//tmfļַ + begin + if not(node) then + begin + it := FTree.RootItem; + node := (it.items)[0]; + end + if not ifarray(itemnames) then itemnames := array(); + if not ifarray(lib) then lib := array(); + if not node then exit; + tc := node.Component; + wlibs := tc.libs(); + tlibs := array(); + for i,v in wlibs do if v and ifstring(v) then tlibs[length(tlibs)] := lowercase(v); + tclib := lowercase(tc.libs()); + lib union2= tlibs; + r := ""; + tab := " "; + if tc is class(TDComponent) then + begin + tcname := tc.name; + tcclassname := tc.ClassName; + if not(tcclassname and tcname and ifstring(tcname) and ifstring(tcclassname)) then raise "!"; + r+= "object "+ tc.name +":"+tc.ClassName+"\r\n"; + itemnames[length(itemnames)] := array(tc.name,tc.ClassName); + cr := tc.GetChangedPublish(); + for i,v in cr do + begin + if not(v and ifstring(i) and ifstring(v) ) then continue; //ϸж + r+=tab; + r+= i + "=" + v +"\r\n"; + end + for i := 0 to node.ItemCount-1 do + begin + r += tablelines( call(thisfunction,lib,(node.items)[i],itemnames),tab); + end + r += "end"; + end + return r; + //GetChangedPublish + end + + function DeletComponent(comp); //ɾؼ + begin + if comp is class(TDComponent) then + begin + DeleteNode(comp.TreeNode); + end + end + function DeleteNode(node); //ɾڵ + begin + if node Is class(TComponentTreeNode) then + begin + comp := node.Component; + tree := Node.owner; + node.Recycling(); + if tree is class(TComponentTree) then + begin + tree.deleteitem(node); + node.Recycling(); + end + if comp is class(TDComponent) then + begin + wd := comp.Cwnd; + if wd is class(TComponent) then wd.Recycling(); + end + end + end + + function createmainmenubyarray(ms,pm,oer); + begin + if not(ifarray(ms) and ms) then exit; + if ms["type"]="menu" then + begin + if not pm then pm := new TMainmenu(oer); + if ifstring(ms["caption"]) then + begin + mu := new tmenu(oer); + mu.caption := ms["caption"]; + o := ms["onclick"]; + mu.onclick := ms["onclick"]; + mu.parent := pm; + if ms["checked"] =1 then + begin + mu.Checked := true; + end + field := ms["filed"]; + if ms["checked"]=true then + begin + mu.Checked := true; + end else + begin + bp := ms["bitmap"]; + if bp and ifstring(bp) then + begin + bpp := new tbitmap(); + bpp.Readvcon(HexFormatStrToTsl( bp)); + mu.bitmap := bpp; + end + + end + if ms["enabled"]=0 then + begin + mu.Enabled := false; + end + if ifstring(field) then + begin + try + invoke(oer,lowercase(field),1,mu); + except + end ; + end + call(thisfunction,ms["items"],mu,oer); + end + end + else for i,v in ms do + begin + call(thisfunction,v,pm,oer); + end + end + public + function OpenFileFromTpjFile(); //ļ򿪹 + begin + FProjectFileOpener.caption := ""; + if FProjectFileOpener.OpenDlg() then + begin + f := FProjectFileOpener.FileName; + FProjectsManager.OpenFileFromTpjFile(f); + for i := length(f) downto 3 do + begin + if f[i]="\\" then + begin + FProjectFileOpener.initialDir := f[1:(i-1)]; + break; + end + end + end + end + function OpenExaple(); + begin + FProjectFileOpener.caption := "򿪷...."; + f := 0;// tslfilename(); + fio := ioFileseparator(); + if f then + begin + for i := length(f) downto 3 do + begin + if f[i]=fio then + begin + ef := f[1:i]+"examples"; + if filelist("",ef) then + begin + FProjectFileOpener.initialDir := ef; + end + else + begin + FProjectFileOpener.initialDir := f[1:(i-1)]; + end + break; + end + end + end else + begin + f := sysexecname(); + for i := length(f) downto 3 do + begin + if f[i]=fio then + begin + ef := f[1:i]+"designer"+fio+"examples"; + if filelist("",ef) then + begin + FProjectFileOpener.initialDir := ef; + end + else + begin + FProjectFileOpener.initialDir := f[1:(i-1)]; + end + break; + end + end + end + if FProjectFileOpener.OpenDlg() then + begin + //echo ,"\r\n"; + FProjectsManager.OpenFileFromTpjFile(FProjectFileOpener.FileName); + end + end + function CreateTpjFomFile();//½ + begin + FProjectFileOpener.caption := "½"; + if FProjectFileOpener.OpenDlg() then + begin + f := FProjectFileOpener.FileName; + if parseregexpr(".tpj$",f,"",pp1,pp2,pp3)<>1 then f+=".tpj"; + FProjectsManager.CreateTpjFomFile(f); + end + end + function db(o,e): WM_NCLBUTTONDBLCLK;virtual;//󻯴 + begin + e.skip := true; + end + function openclassfile(); //򿪱༭ + begin + FProjectManager.ShowCurrentFormCode();//ShowEditor(); + end + + Function EnabledDesigner(f); + begin + {** + @explan(˵) designerǷ %% + @param(f)(bool) + **} + FObjInspector.Visible := F; + self.Enabled := f; + rt := FTree.RootItem; + if rt and rt.ItemCount>0 then + it := (rt.items)[0]; + if it then itt := it.Component; + if itt then itt.Cwnd.Enabled := f; + end + function TreeNode2tfm(lib,itemnames); //תļ + begin + {** + @explan(˵) ṹתΪļʽ %% + **} + r := TreeNode2tfmsub(lib,nil,itemnames); + if itemnames then itemnames := itemnames[1:]; + return r; + end + + function saveCurrentForm(); //浱ǰ༭ + begin + FProjectManager.saveCurrentEdit(); + end + function mainmenus();virtual; + begin + {** + @explan(˵) ˵ + **} + return array( + ("type":"menu","caption":"ļ","onclick",nil,"items":( + ("type":"menu","caption":"","onclick":thisfunction(saveCurrentForm), + "bitmap":GetSaveFileBitmapInfo()), + ("type":"menu","caption":"༭","onclick":thisfunction(openclassfile), + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +10002EA01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017F49444154 +484BCD944B4B02611885FB412DDBB4ED37740369D1C6F69110B5A89FD0A6562DA +4B21BB8C8F2921214840B4992C0109112BA58511048C55C4FF3CEF78DCE37CD94 +CE2478E0C070E6F53CCEFBE90CA0C7EA23C0ED31101D049AF73CE84C22E0709C9 +558BE5CE5370C95D658D628F0C0D0E9AC389F5FE637DA1201F661F2E70B2BC94C +3353665D9F2F02F59C384FB943DE80648865DBC3626ED92ADB1AFA99D9E40DB0D +6432BF132894A7D01F64718E42FD39C2F801FF727C06D2D969DB35D03E827FA9B +A8D03EEFEB09E8435E769B75A80FCE80DE416EFF01B2F329CE22BCA8ADFF03D0A +11B52A217D05215F39A147C45F4AAB84901AF1FD0725548A39BA6B57CDDAC0C06 +488C016FD7D0AF1A90E78E208776A0A52B26400EC7CD4AFF806CD8D8C71754631 +DD244ACF5CD95F934D4833294BD9259E91F505C815E7A845E7E823C136F01A4A9 +5DE8C5075E1804504B403BA94159C840BF7B87341983B29485FEDCE4654C22A04 +BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000 +0049454E44AE42608200") + )), + ("type":"menu","caption":"ͼ","items":( + ("type":"menu","caption":"ļ","checked":1,"bitmap":GetWindowMgrBmp(),"onclick":thisfunction(ShowProjectView)), + ("type":"menu","caption":"","checked":true,"onclick":thisfunction(Mobjinspect), + "bitmap":GetDefaultIconInfo()) + )), + ("type":"menu","caption":"","items":( + ("type":"menu","caption":"򿪹","onclick":thisfunction(OpenFileFromTpjFile), + "bitmap":GetOpenFileBitmapInfo()), + ("type":"menu","caption":"½","onclick":thisfunction(CreateTpjFomFile), + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +10002BC02000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000025149444154 +384F7D924D48146118C7273C885D5D0A89920D84ECE2A5082F76D93DA478A8DDD +9D99DFD5EAB252AC465D94317B340BD545B4B1D0A619548292F8298618730F2D0 +0795645E2A2F82C57E7F7FCCACFFE679DDA161C97DE0CFBC87F9FFDEF7F93F0F8 +77DCAE373D7E582DBEB84CBA3C8ED80D36D87C325C2E1146177DAD014502E9751 +A95498E85C2A9590CFE791CD66914EA7213AACCD002E66AC56AB4C2AA4582C229 +7CB31804D149A00BC2E66942489A97394635201994C06828D6F00ECEE028B8B40 +28C4FADE0F406D10C062353700A251C0EF0704818546CF568D8DA216788B49035 +0A8CC6C3603BDBD0AC0C17AFE9F994400B3E58206B0B5C56E465F1FA0D7B371D1 +732979926A54FB4FA55230F1E735005946666000525717A4B63665D676D66BA15 +060520164A6DB93C9E43F40A12C63E5F31FBC8A3CC3B713DDD86C6D65CB42F3D6 +4A6B4E24127B804F3F33B8FA78039E075F619958833D308325D1A76C99C89E490 +6129D49648EC7E388C5620A40C960786A13F67BEB308C7EC0A9C02A7A2E3F87F1 +DA13B6A6B46956655968DE16C1AC846662C19191C4421C8A7C81F1E647745F7F8 +BA3BE6574F051740E4E22316F407AFA3876C22D58BFC561798443F4520B7EFF58 +6391A9C58993AB38137C8363BE97382CCCA1BDFF3E0E19C7F06BFA2CB61FEA98F +97590C3CC450E61F10012DB1B75EB5E7181C80A4EFB6771849F82AE3F8C76C318 +C41B4FF17D218477B73BB044370F29669BF20DF6EC6DABA6B8AA2463E4EE024EF +277A01F1CC7958979C8B59AF25F0DEFE702981DD6E191F7205E8C9F835C2DD76D +6A017F012E1003A76A3E2C680000000049454E44AE42608200"), + ("type":"menu","caption":"ʷ","onclick":thisfunction(OpenProjectFromtpj), + "bitmap":GetHostroyBimp()) + , + ("type":"menu","caption":"","onclick":thisfunction(WrapProjectTo), + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +100022D04000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000003C249444154 +484B9D95FF4FD34718C7F987F6C3DC9438E7343A750BC100A211182628884E98E +CBB084215A16C859608A5A3A603265FC6280C1601A15A22158DB4AE0B66E88420 +6E12A4D81629A57C31BC77F7F45A7AA538B25772F97C9EE79E7BDEF7B97BEE3E5 +1F80F56565E63DEEB85CB3D0BC7CC4B385D2ECC793C585A5A12116F664381E5E5 +65B8675F61DA3183B73E3E8743D95AA971BFD3E586CFE71323221351C0E399C79 +0FD313E385A045D432F0E1C2FC38FF766826DCBC17C4CBD70E072553B1415AD18 +7BFA1CABABAB62B4CC3A01AF770119B957A1D475925DACEDC0BB71059240F4210 +592CF56A1ED86154FFF7160FFB152347658283E1C496060E811624EA830CE0685 +C2972854606BBC0263CFA645AF9F6C453DCE14D6E2D1D8A4F0F8218129C72CEBA +C434DF32D7286B3E3489124B02B45297A645E7916B025360FDA0693F03081E6DF +EEE248D6152C2EAD08978CC33987E8C44B92C0FB4925D89EA88075785C44C9D41 +A6F23FE940683B6BF1055A0312233CF20BA6476262BF10E5BFFF025E2F6CEA462 +7AA67C5E2DA2D7E8EAB763172B9081A1C7FE25B258FD15C367CBD135DE4474422 +12AEB7B915ED820250FB43C9D0916DB131CFF564F42FA9FCD34F62B6523D25991 +787DFE7312DCE4B9390F761C568859698517B08F4C20ABD428254F3DFF136E581 +E8A08B083B8C8F6E92276275D6693EA115E3F41819B771E62EF2725F49E94538D +BDA9A598989C21BBA3CF86B3AA4E4A1E97FD037EE9B1929FC337765B7C0195F37 +5B31DB1E965B8C3D63E0009D4349BB127A5981C01BAFAFFA0AFF9B4B09EEC7243 +0F4E29DBA16FB94D362739478BB84C355D27A1F073A1BADA45EF513C095FF38D8 +861338ACD50E39E7D14EADA3EF25DD0B492F8EF7F4E901D89D6EEFB14435FD069 +B2E1C354259C6E0F7586D3697A40C10967AED03357D5227AD633F9C2C5F6F2627 +0D2C13DF0787D54721B956C4BB715EFB1815CA0CE3820BC3227CF1BA8FE27A7DD +C21322108027E0778FC5364AF6FCC2227235BFE2CBEA5B48FCBA8E363AABB40D0 +9A72BA89FD3CE8A602BDBE8A3AC38C28928C093A45D6AC5C9826BD89756864AD3 +04F90E7E56434FDEF20C168A8DCDAC407C8E9E7CE7CADB449635361488D43ECAA +C94ECEF3B46A0EE1A0DDAC535DD22CB1AEB04F4C641E4EBCD52A240DB93561ED1 +CF9BDA68A3C985B34E80C32B21BFEA3ABE6B1B9692F0BB29D4E64DD9741F9A867 +EDAAB48441408D03738820C45130C771D942CF4562D6A1A8242D78DF1BFE57F47 +386F14085071CD8C6FB47D789BFD2A4B8CC3F842D54E076F336C4A80F37CCA899 +8D35530F63E109ECDB16981FF07F02FE5F4C30FC035A3F30000000049454E44AE +42608200" + ) + ) + ), + ("type":"menu","caption":"","items":( + ("type":"menu","caption":"","onclick":thisfunction(editcommandline)), + ("type":"menu","caption":"","onclick":thisfunction(RunProject),"filed":"FRounMenu", + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 + 10002DF01000089504E470D0A1A0A0000000D4948445200000010000000100806 + 0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 + BFC6105000000097048597300000EC300000EC301C76FA8640000017449444154 + 384F85906B6F0151108657575489AD124B5C1AAC452D65DB529754DA34FD692D4 + 5DD4ADDBA71EBFF7CBB3889E8504F321FCECC9B674E86C31F5EB4289E3599BD8E + 43044F33098F5309652DC83AFF43058B10CAF3008A531F4ADF3ED63D0C1194970 + 194165E14666EDC6B22B263179BEC87081E967E1496227273276E353BD4910075 + 6067530A11147F3CC82D1CC8CC045C6B1628A333A4FA16243B3696D8850A166ED + CCCED484FAD502626C4873CE23D23AEDA66249B5696DA420485B9A80B04A43433 + 62231E72DF80708743E48347B47E0AA526B0E40622C8CF5C50A7B6F576796040A + 4CD41AA7308E925D78C88572D2CB98108569757270212035DD033406A70085639 + 842BBAA872C2525B88203B16911E0A50FA66481D5DB0DAFEA6D72B89AEA13F18B + A91F93A87D2B520DAE411AA6D048720935CDF03F5F302899615B1860991779E4D + F64304F9AE176ADB895453BF437DF760FB208242C78FBBA6884CDDC13AFF4304A + 5D625720D2F7B1D03F80599273DB222D313980000000049454E44AE42608200" + ), + ("type":"menu","caption":"ֹͣ","onclick":thisfunction(StopProject),"enabled":false,"filed":"FStopMenu", + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 + 100029301000089504E470D0A1A0A0000000D4948445200000010000000100806 + 0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 + BFC6105000000097048597300000EC300000EC301C76FA8640000012849444154 + 384FCD92496B025110847353DC453DB880A888A888EBFFFF2781104446CC6602C + 9E430F9D2E57B8679971CE2C11434BE81AEEAEA6A6FB810FF4C20D96C60B582E5 + 12E673984EF91A8F8947235EAD0EF6DE4E26BEDB217420F27AED6AB13809301C9 + 2F4FBBCF77A3C0D06ECEC3B8D504093CFE4D90C6C2A46A4D522B67AE97488BA5D + DFEC100AC8F6996C76B1C9B4DB50AFF359AB71B4DF7DB3E99B1D4201595669B2C + 8369146038A45E2528963A54264226904020A4C3B9F6C6BB22727B91C1F56CFF9 + 3C9189A41108286D05A69D65FB879CC9F066F560EF9D39492310D0A994B602D3C + EB2ADC9223F66B344F6BE2F977DB74320A03BEB544A5B816967D9D66491B78502 + 77D5AAEF760804F427D19D752AA5ADC0B4B36C6BB2C8B7BF85F8175C5B00BE01F + F2C4775DEA0B57A0000000049454E44AE42608200"), + ("type":"menu","caption":"","onclick":thisfunction(debugproject)), + + )), + ("type":"menu","caption":"","items":( + ("type":"menu","caption":"ͼƬ","checked":0,"onclick":thisfunction(ViewBitmap)) + )), + ("type":"menu","caption":"","items":( + ("type":"menu","caption":"ʹֲ","onclick":thisfunction(OpenHelp), + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +10002E002000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000027549444154 +384FA590494F53611885FD6FC6C48D2B57BA21828808C4401C222444A26200A31 +8A802020151204A903009AD76A02D63A194D2C26DCAD401E8A54C2DBD94C9C7AF +A5704358194F727237E73CF73DDF15FE539700FB877F58D93C666C318E495230C +CC5304B31BCEB7162F193544AD505801C39C6EC51F0860E585857F004A3497BD7 +62B803317A2737F187E3A9F4A9CE01A1DD2374B35196E47DA617B76833F929EB9 +CA7B4638E7ADD0223EE0DA4D5282DA6004BA158AA9502C40E4ED039775908290C +CF872911A53A9D57FC4DC1178ED1391AA0A86D06EDD42A2EDFAE002EB1B377A80 +212E7CDFAF798F46E53DCEEE269D3B4D87B247C9CF21125ED0E8ABED831BB6486 +66130EA980AE7119496C6D14E4C74D760A1A27F16F88CD13010CCE35140130388 +3E4D45878DFEB6666798B8A0EA70A68D0AD88C78A50DCEA20BFC1466EDD88085B +E9B7F9D88AC659DF5268FE2D71BF7A88FC4F56DCBE1DF26B475440558F072910A +1F0AB839C5A2B0F3E5AC8FE6021A21CB22247C9D30C91F94ECF5DE13C8D11977F +9BAC4A930AD0F4483857B6D1F449E4D68C90AD31935565E25EA521E98C0A1D19E +583A4970F50DA3681CD2BF35040CF01BFECAB0CDA0258DD72F2B4B36278771F79 +4721ADEC67D219657DE8A67CB48A396D7A49052482CF1AC6189B97D14EFAC9A93 +692FE464B75973DE944F9CEEB6EBE193D181D016EBDE86735BCA702129A906451 +D26371AD619809F2AA758CACB7036496F7F3BCD98AD6B68C7EDACFF5273F308AE +F99CE01090D8B725A999616DD1CE39E108EE570D2A3F3EBD4F739B951D885DEEE +4BA54F75019050509CF659EBE6F6CB7EAE3DEAE06AC1776E16770BC00C7E39924 +AA9BA04F837C15F4F46800A8EF8DEDF0000000049454E44AE42608200"), + ("type":"menu","caption":"ؼ","onclick":thisfunction(OpenHelp), + "bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +10002E402000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000027949444154 +384F8D924B4C135118852B2AA046431150E303E26B455CB1D3953B162ED818A2C +6850B88441275A126269A687443A54AA251AC411E1B345414E461176881A260C4 +5035D3875230410A0DB543FAB074EEF1DCCE34445CE849BEB4F77F9CB9FFCC6FC +25F1224423E00F35660F23CB064E7394012467E592B0C647216983E0D58D60167 +5601D52CB9B21A682A02B40EE6A3E9CA8C5618C8275F036E6703554C5D261789F +C2F8D9C5B997792A42C4E8BD18C52641C88950056861F93251227D2489AB4F126 +A82461D99016A319C5492B3113193670911A226FE2E348D84766882E596548CE7 +6876C22324CA6C9257295788D18B6113FD1C81F06BFC80B52488CE25BA49E848D +33E40865244874C928E6BCEFA0B49D42C05E81D87C118496A5A7AE938F996613B +4640E7E2A65987C5E8BB81A92ADBA81D2701089BA2CA4BA4A21C673F93AF824C1 +7947990E1A061ACFE1B5D05EAF47AAB314BEE1A7B25537F8565F8AA82D1B9A733 +FC4977C0875339B697496E90B6C9CC9E197CB830815424CE4437B6586BFFFA66E +90585CC00F6B09D4E65C88919D10937C07D11DC01B2E4E0D9BCFADE136EEE6AD4 +8743B84AF00626023A6BAAB748339FF382296022CDCCB81E63043B87983792E4C +B418F844A300F722BE87E75D10B35B38A2195ACF06843ACA918C2DC2E4733D43C +A9A87196B31949643F0741E86C7510ECFD01178472BE0797F94BF95F0BA8EC13B +701CDEDE13F0D94FC2D35E85AF637D30298E46F8EAF62218FC9EBED2FFC8ED1E4 +66B432D42D30A4C0B539FE1AE3B00555D5ECF7F696CCC019BA59A23A8FA57F03B +EE62B0FD069C5DF731D8F50043DD8D187AF910C33D36B824BD8F30D2D794E66D7 +F3369C1C0130BE291107E03B1BD47754EBE98780000000049454E44AE42608200 +"), +("type":"menu","caption":"..","onclick":thisfunction(OpenExaple),"bitmap":"0502000000060400000074797065000203000000696D670006040000006461746 +10002AA01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000013F49444154 +484BBD940B4FC2301485F9FF7F49638C898F058C8293E81ECA18E1351C0C64899 +179DDA9AEA9A3CDB8C03CC949BAFBFAB6765BE3E4E699EAF4FF01E2647D546B01 +C79216E08591B43F98FDB9DEC75B80BA2C01AD6EF8EBFE81FE99B305A8FD0C760 +1CC97A97095F606D8FE48B84A6CC0E72613775ED4628D98493B03DED30FBAEEF4 +6471D9C8A1A62CD6139820A6E1100B00BD290D851133890D08270BD950183193D +880EECB98DC7E4459F6258C356226B101BABD36ED3FC40670C506C4494A4E30A5 +CBFB5761AC1133A912808F681825F4E08DE8E2D697C56523871AD4AA1F9E11108 +EE7D4768674D6746541E1BBA781C8C35897F3E8412FF25AC0A9E5C8207CDE72E9 +31FFEF4CE3156D34BF05C490430D6AD55E759604C057ED5EBEBF11CD16FC03470 +F7A31439DD9B0EC80BCFCBD56CFE0506116665A7640DF50A54EEE2F8BDA750000 +000049454E44AE42608200") + +), + + ) + ); + end + public + function DeleFiledFromEdit(n,nn); + begin + if FTree.Loading then return ; + FProjectManager.DeleteAFiled(n,nn); + end + function AddFiledFromEdit(n); + begin + if FTree.Loading then return ; + FProjectManager.AddAFiled(n); + end + function EditerCodeChanged(); //ı + begin + if FTree.Loading then return ; + classinfo := FProjectManager.GetFormClassInfo(); + if classinfo and ifarray(classinfo) then + begin + class(TDComponent).TemporaryNotName := classinfo["members"]; + SetFunctionList(classinfo["funcs"]); + end + end + function LoadProject(n); + begin + FProjectManager.SetProjectInfo(n); + end + private + + function OpenHelp(o,e); + begin + if not FChmHelper then + begin + FChmHelper := new unit(UtslCodeEditor).TTslChmHelp(); + end + case o.caption of + "ʹֲ": + begin + FChmHelper.ChmName := "help\\designerUserGuid.CHM"; + // p := "C:\\Program Files\\Tinysoft\\Analyse.NETplug\\help\\designerUserGuid.pdf" ;//pluginpath()+"..\\help\\designerUserGuid.pdf"; + //_wapi.WinExec(format('cmd.exe /C call "start %s"',p),0); //http://bzjj.sinaapp.com/tslvclhelp/index.html + //_wapi.WinExec(format('start "%s"',p),0); + //_wapi.WinExec('cmd.exe /C start http://bzjj.sinaapp.com/tslvclhelp/index.html',0); + //_wapi.WinExec('cmd.exe /C "start http://bzjj.sinaapp.com/tvcldesignerhelp/tvcldesigner.pdf"',0); + + end + "ÿؼ": + begin + FChmHelper.ChmName := "help\\vclNormalControls.CHM"; + end + "ؼ": + begin + FChmHelper.ChmName := "help\\tslvclhelp.chm"; + + end + + end + FChmHelper.ShowTslLangChm(); + //_wapi.WinExec('cmd.exe /C start http://bzjj.sinaapp.com/tslvclhelp/index.html',0); + end + function ComponentMove(o,e); //ƶ + begin + {** + @explan(˵) ƶ ؼ %% + **} + //setcomponentfocus(o,false); + FPropGrid.SetGridValue("left",O.left,O) ; + FPropGrid.SetGridValue("top",o.top,O); + + end + function ComponentSize(o,e);//Сı + begin + {** + @explan(˵) ؼС %% + **} + FPropGrid.SetGridValue("width",o.width,O); + FPropGrid.SetGridValue("height",o.height,O); + //setcomponentfocus(o,false); + end + function DesignerClose(o,e) //ر + begin + {** + @explan(˵) %% + **} + if _wapi.MessageBoxA(self.Handle,"˳Ӧ","ʾ", MB_YESNO.| MB_ICONWARNING) = IDNO then + begin + e.skip := true; + end + else + begin //̴ + FProjectManager.StopProject(); + FProjectManager.CloseCurrentEdit(); + end + end + function CompClose(o,e); //ؿؼ + begin + {** + @explan(˵) ؼر %% + **} + e.skip := true; + end + function OnDesignerActivate(o,e); + begin + {** + @explan(˵) %% + **} + return ; + if e.wparam = WA_CLICKACTIVE then + begin + end + end + + public + class function GetClassItem(n); + begin + return FClassItems[n]; + end + class function RegestorClassItems(its); + begin + {** + @explan(˵) ע %% + @param(its)(array of TDComponent) %% + **} + if not ifarray(FClassItems) then FClassItems := array(); + for i,v in its do + begin + if (v is class(TDComponent) ) then + begin + n := v.ClassName(); + if n and ifstring(n) then n := lowercase(n); + FClassItems[n]:= createobject(v); + //RegisterComponentType(n,FClassItems[n].ComponentClass()); + end + end + + end + //**************************************** + function CreateComponent(); // + begin + {** + @explan(˵) %% + @return (TDComponent) + **} + if FComponentCreater and FCurrentNode and FCurrentClikPos then + begin + par := FCurrentNode.Component.Cwnd; + r := FComponentCreater.ComponentCreater(FCurrentNode,FCurrentNode.Component.Cwnd); + if not r then exit; + r.CreateName(); + FVariableSelecter.additem(r); + BindCwndMessage(r.Cwnd); + if ifarray(FCurrentClikPos) and (r.Cwnd is class(TControl)) then + begin + if r.Cwnd.Align<>alnone then + begin + //par.DoControlAlign(); + end else + begin + x := FCurrentClikPos[0]; + y := FCurrentClikPos[1]; + if r.Cwnd is class(TControl) then + begin + if ifnumber(x) then r.Cwnd.left := x; + if ifnumber(y) then r.Cwnd.top := y; + end + end + end + FTree.SetSel(r.TreeNode); + end + FCurrentClikPos := nil; + FComponentCreater := nil; + FCurrentNode := nil; + FTree.PopupMenu := nil; + //echo "\r\n ӿؼ"; + return r; + end + function RectToPoints(rc); + begin + {** + @explan(˵) + **} + r := array(); + r := array((rc[0],rc[1]),(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),(rc[0],rc[1])); + return r; + end + function setcomponentfocus(cwnd,fk); + begin + {** + @explan(˵) ƿؼý %% + **} + if not(cwnd is class(TWincontrol)) then exit ; + if not cwnd.HandleAllocated() then exit; + //if cwnd is class(tvcform) then exit; + //if cwnd.WsPopUp then exit; + return cwnd.DesigningSelect(fk); + end + function setcomponentfocus_bk(cwnd,fk); + begin + + if not(cwnd is class(TWincontrol)) then exit ; + if not cwnd.HandleAllocated() then exit; + if cwnd.WsPopUp then exit; + cp := cwnd.parent ; + if not(cp is class(TWincontrol)) then exit; + rec := array(cwnd.left-1,cwnd.top-1,cwnd.left+cwnd.width+1,cwnd.top+cwnd.height+1); + if not fk then + begin + if cwnd is class(TTabSheet) then + begin + tmpcanvas.pen.color := rgb(255,255,255); + goto abcef; + //return o.DoControlAlign(); + end + t := 25; + rec := array(rec[0]-t,rec[1]-t,rec[2]+t,rec[3]+t); + return cp.InvalidateRect(rec,true); + end + tmpcanvas.pen.color := rgb(200,0,0); + label abcef; + tmpcanvas.pen.width := 2; + //tmpcanvas.pen.Style := 1; + pcp := _wapi.GetDC(cp.handle); + if not pcp then exit; + tmpcanvas.Handle := pcp; + vw := RectToPoints(rec); + tmpcanvas.draw("polyline",vw); + tmpcanvas.Handle := 0; + _wapi.ReleaseDC(cp.Handle,pcp); + end + function TreeNodeSelected(n); + begin + {** + @explan(˵) ڵ㱻ѡ %% + @param(n)(TComponentTreeNode) ѡڵ %% + **} + if FCurrentNode=n then exit; + FCurrentNode := n; + if not ifobj(n) then exit; + t := n.Component; + if not t then exit; + mu := t.CreateMenu(); + FTree.PopupMenu := mu; + FPropGrid.Component := t; + FEventGrid.Component := t; + wd := t.cwnd ; + setcomponentfocus(wd,true); + return t.SelectedNode(); + end + private + function RClickComponent(o,e); + begin + {** + @explan(˵)Ҽ˵ %% + **} + nd := o._tag; + if FCurrentNode<>nd then + begin + FTree.SetSel(nd); + TreeNodeSelected(nd); + end + cp := nd.Component; + if cp then + begin + mu := cp.CreateMenu(); + if mu then + begin + //ֱӽ˵ֵؼ,gtkڽ㵼µ˵ + cwnd := cp.Cwnd; + cwnd.PopupMenu := mu; + xy := o.ClientToScreen(e.lolparamsigned,e.hilparamsigned); + //_send_(WM_CONTEXTMENU,self.handle,makeposition(xy[0],xy[1]),1); + _send_(WM_CONTEXTMENU,cwnd.handle,makeposition(xy[0],xy[1]),1); + return ; + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + _wapi.TrackPopupMenu(mu.Handle,uf,xy[0],xy[1],0,self.Handle,nil); + end + end + end + //FClickTime; + public + function addandopeneventbyname(nd,n); + begin + if nd then + begin + cp := nd.Component; + if cp then + begin + pe := cp.GetPublishEvents(); + if ifstring(n) and n then + begin + de := cp.geteventfunctionbyname(n); + end else + de := cp.DefaultEvent; + if ifarray(de) and de then + begin + dei := de["event"]; + dvs := pe[dei]; + if ifarray(dvs) then + begin + dv := dvs["value"]; + if not dv then + begin + td := de; + td["name"] := cp.Name+"_"+td["name"]; + if FProjectManager.AddAFunction(td) then + begin + FEventGrid.SetGridValue(dei,td["name"],cp.Cwnd); + FProjectManager.GoToAFunction(td["name"]); + return ; + end + end else + begin + FProjectManager.GoToAFunction(dv); + return ; + end + end + end + end + end + FProjectManager.ShowEditor(); + end + function AddAndOPenEvent(nd); + begin + {** + @explan(˵)ͨڵ򿪺༭ %% + **} + addandopeneventbyname(nd,n); + end + function DBLClickComponent(o,e);//˫ + begin + {** + @explan(˵) ˫ %% + **} + if o then AddAndOPenEvent(o._tag); + if e then e.skip := true; + end + private + function ClickComponent(o,e); //ѡ + begin + {** + @explan(˵) %% + **} + nd := o._tag; + if FCurrentNode<> nd then + begin + wd := o;//nd.Component.Cwnd; + //if wd is class(TWincontrol) then _wapi.BringWindowToTop(wd.Handle); + FTree.SetSel(nd); + TreeNodeSelected(nd); + end; + setcomponentfocus(o,true); + if FComponentCreater and FCurrentNode then + begin + //SetSysParam("cpos_screan",array(e.lolparam,e.hilparam)); + if FComponentCreater is class(TDRootComponent) then + begin + FCurrentNode := (FTree.RootItem.items)[0]; + if not FCurrentNode then exit; + O1 := FCurrentNode.Component.Cwnd; + if not o1 then exit; + end else o1 := o; + xy := array(0,0); + _wapi.GetCursorPos(xy); + FCurrentClikPos := o.ScreenToClient(xy[0],xy[1]); + //FCurrentClikPos := array(e.lolparam,e.hilparam);//o1.screentoclient(e.lolparam,e.hilparam); + r := CreateComponent(); + end + return ; + end + function ClickTreeNode(o,e);//ѡ + begin + {** + @explan(˵) ͨѡڵ %% + **} + od := e.itemold; + if od then + begin + cp := od.Component; + if cp then + begin + setcomponentfocus(cp.Cwnd,false); + end + end + TreeNodeSelected(e.item); + end + + + function SpectorClose(o,e);//objectspector ر + begin + {** + @explan(˵) Ŀ¼ر %% + **} + e.skip := true; + o.visible := false; + if o._Tag is class(tmenu) then o._tag.Checked := false; + end + + function OnToolButtonCick(o,e); // + begin + {** + @explan(˵) ѡ񹤾߰ť %% + **} + cct := o._tag; + //if FComponentCreater=cct then exit; + FComponentCreater := cct; + return ; + fm := (FTree.RootItem.items)[0]; + if not fm then exit; + O1 := fm.Component.Cwnd; + o1.show(); + + end + + function CloseShowForm(); //ڹر + begin + {** + @explan(˵)رյǰ̴%% + **} + FProjectManager.CloseCurrentEdit(); + end + public + function BindCwndMessage(wnd); + begin + {** + @explan(˵) Ϊؼ¼ %% + **} + if wnd is class(tmenu) then wnd.OnDesignClick := thisfunction(ClickComponent); + if wnd is class(TWincontrol) then + begin + wnd.OnDesignClick := thisfunction(ClickComponent); + wnd.OnDesigndblClick := thisfunction(DBLClickComponent); + wnd.OnDesignrClick := thisfunction(RClickComponent); + wnd.onmove := thisfunction(ComponentMove); + wnd.onsize := thisfunction(ComponentSize); + //wnd.Onclose := thisfunction(CompClose); //ֻǺ + wnd.Onclose := function(o,e)begin + e.skip := true; + CloseShowForm(); //洰Ϣ + end ; + wnd.bindmessage(wnd.WM_NCLBUTTONDOWN,thisfunction(ClickComponent)); + //WM_NCLBUTTONUP wnd. + if (wnd is class(TVCForm)) then + begin + {wnd.Onclose := function(o,e)begin + e.skip := true; + CloseShowForm(); + end ;} + wnd.OnMinimize := thisfunction(CompClose); + end + end + end + function UnLoadTreeNode(); + begin + {** + @explan(˵) жtreeĽڵ%% + **} + node := FTree.RootItem; + if node.ItemCount>0 then + begin + DeleteNode((Node.items)[0]); + end + FVariableSelecter.clean(); + FEventGrid.Component := array(); + FPropGrid.Component := array(); + end + private + FLoadInheritedName; + public + function LoadTreeNode(Ptfm,inh); + begin + {** + @explan(˵) treeڵ %% + **} + FLoadInheritedName := inh; + UnLoadTreeNode(); + FTree.Loading := true; + try + prs := array(); + obarray := array(); + loadtfmtotree(Ptfm,Ptfm.gettree,FTree.RootItem,FTree,prs,obarray); + for i,v in prs do + begin + va := obarray[v[2]]; + if va then + begin + v[0].SetComponentProperties(v[1],va.GetTrueComponent()); + end + end + except + end ; + FTree.Loading := nil; + end + function loadtfmtotree(p,d,node,owner,prs,obarray); + begin + {** + @explan(˵) tfmļ %% + **} + if not ifarray(d) then exit; + if not d["type"]=p.TT_COMP then exit; + dcls := d["class"]; + it := GetClassItem(dcls); + if not it then + begin + if ("tdcreateform" in FLoadInheritedName) then + begin + it := NEW TDForm(); + end + else if "tdcreatepanel" in FLoadInheritedName then + it := new TDPanelForm(); + else return ; + it.ClassName(d["class"]); + it.Imgs := FImageList.GetImageId("tvcform"); + FLoadInheritedName := array(); + end + comp := it.ComponentCreater(node,owner); + comp.name := d["name"]; + obarray[d["name"]] := comp; + FVariableSelecter.additem(comp); + BindCwndMessage(comp.Cwnd); + pubs := comp.GetPublishProperties() union comp.GetPublishEvents(); + dprop := d["property"]; + ddp := array(); + for i,v in dprop do + begin + ddp[v["name"]] :=v; + end + if comp.DefaultAlign() then + begin + if ifarray(ddp["align"]) and (ddp["align"]["value"]="alnone") then + begin + comp.Cwnd.align := alnone; + end + end + lazy := array(); + for i,v in pubs do + begin + n := i; + ddpv := ddp[n]; + if not ifarray(ddpv) then continue; + cls := v["class"]; + et := GetPropertyType(cls); + if not et then continue; + setddpv := et.TmfToNode(p.SampleValue(ddpv)); + if et.IfComponent() then + begin + prs[length(prs)]:= array(comp,n,setddpv); + continue; + end + if et.LazyProperty() then + begin + lazy[length(lazy)] := array(n,setddpv); + continue; + end + comp.SetComponentProperties(n,setddpv); + end + for i,v in d["object"] do + begin + call(thisfunction,p,v,comp.TreeNode,comp.Cwnd,prs,obarray); + end + for i,v in lazy do + begin + comp.SetComponentProperties(v[0],v[1]); + end + //comp.DoControlAlign(); + end + function SetFunctionList(v); + begin + {** + @explan(˵) õǰʹõĺ %% + **} + FFunctionSelecter.clean(); + for i,vi in v do + begin + if vi in array("create","destroy","recycling","loadfromtfm") then continue; + FFunctionSelecter.additem(vi); + end + end + + function create(AOwner); + begin + inherited; + tmpcanvas := new tcanvas(AOwner); + top := 10; + left := 10; + rect := _wapi.GetScreenRect(); + twidth := (rect[2]-50); + width := twidth; + calcheight(twidth); + caption := "TVCL"; + FProjectsManager := new TProjectManagerForm(self); + ico := new tbitmap(); + ico.Readvcon(HexFormatStrToTsl( GetHostroyBimp())); + FProjectsManager.FormICon := ico.ToIcon(); + + FProjectsManager.parent := self; + FProjectManager := new TProjectView(self); + ico := new tbitmap(); + ico.Readvcon(HexFormatStrToTsl(GetWindowMgrBmp())); + FProjectManager.FormICon := ico.ToIcon(); + FProjectManager.parent := self; + //FTempCanvas := new + //*********************************************** + FObjInspector := initobjinspector(); + FObjInspector.height := rect[3]-top-height-20; + tparent := new TPairSplitterSide(self); + tparent.border := false; + pparent := new TPairSplitterSide(self); + //********************************** + FTree := new TComponentTree(self); + FTree.onselchanged := thisfunction(ClickTreeNode); + FTree.align := alClient; + //*************޸********************** + pedits := new TPageControl(self); + pedits.align := alclient; + FProp := new TTabSheet(self); + FProp.caption := "propertys"; + FEvent := new TTabSheet(self); + FEvent.caption := "events"; + FPropGrid := new TPropEditGrid(self); + FPropGrid.border := false; + FPropGrid.Component := self; + FEventGrid := new TEventEditGrid(self); + FVariableSelecter := new TListVariableFilter(self); + FVariableSelecter.visible := false; + FVariableSelecter.parent := FPropGrid; + FFunctionSelecter := new TListStr(self); + FFunctionSelecter.visible := false; + FFunctionSelecter.parent := FEventGrid; + FEventGrid.EventEditer := FFunctionSelecter; + FPropGrid.VariabeEditer := FVariableSelecter; + //**************ڹϵ********************* + FObjInspector.parent := self; + tparent.parent := FObjInspector; + pparent.parent := FObjInspector; + FTree.parent := tparent; + pedits.parent := pparent ; + FProp.parent := pedits; + FEvent.parent := pedits; + + FPropGrid.align := alclient; + FEventGrid.align := alclient; + FPropGrid.parent := FProp; + FEventGrid.parent := FEvent; + + Mobjinspect(); + + onactivate := thisfunction(OnDesignerActivate); + FImageList := new TDesigImageList(self); + FTree.Imagelist := FImageList; + //******************toolbar *************** + FToolBars := new ttoolbars(self); + FToolBars.parent := self; + FToolBars.Imagelist := FImageList; + addtoolbuttons(); + //************˵****************************** + createmainmenubyarray(mainmenus(),FMenu0,self); + Mainmenu := FMenu0; + self.onclose := thisfunction(DesignerClose); + ic := new Ticon(); + ic.Readvcon(HexFormatStrToTsl(GetTsIconBitmapInfo())); + self.FormICon := ic; + + //ļ򴰿 + + FProjectFileOpener := new TOpenFileADlg(self); + FProjectFileOpener.filter := array("tvcl":"*.tpj"); + FProjectFileOpener.parent := self; + + end + property VariableSelecter read FVariableSelecter; + private + function ViewBitmap(o,e); + begin + if not FViewBitmap then + begin + FViewBitmap := new TViewBitmap(self); + FViewBitmap.minmaxbox := FALSE; + FViewBitmap.visible := 0; + FViewBitmap.visible := false; + FViewBitmap.onclose := thisfunction(SpectorClose); + FViewBitmap.parent := self; + FViewBitmap._Tag := o; + //FViewBitmap.show(0); + end + FViewBitmap.visible := not FViewBitmap.visible; + if o then o.Checked := FViewBitmap.visible; + end + function StopProject(o,e); + begin + //FRounMenu.Enabled := true; + //FStopMenu.Enabled := false; + FProjectManager.StopProject(); + end + function RunProject(o,e); // + begin + FRounMenu.Enabled := false; + FStopMenu.Enabled := true; + FProjectManager.RunProject(); + FRounMenu.Enabled := true; + FStopMenu.Enabled := false; + end + function editcommandline(); + begin + FProjectManager.ShowExeEditer(); + end + function debugproject(o,e); + begin + FProjectManager.debugproject(); + end + function Mobjinspect(o,e); //лչʾ + begin + {** + @explan(˵) ޸ %% + **} + FObjInspector.Visible := not FObjInspector.Visible; + if FObjInspector.Visible then + begin + FObjInspector.left := width+ Left-FObjInspector.width; + FObjInspector.top := top+height+20; + end + if o then + begin + FObjInspector._tag := o; + o.Checked := FObjInspector.Visible + end + end + function initobjinspector(); + begin + project := new TPairSplitter(self); + project.visible := false; + project.caption := "object inspector"; + project.Onclose := thisfunction(spectorclose); + project.WsPopUp := true; + project.Visible := false; + project.Width := 300;// + project.height := 800; + project.WsCaption := true; + project.WsSysmenu := true; + project.WSSizebox := true; + project.SplitterType := pstVertical; + project.position := 250; + return project; + end + function GetWindowMgrBmp(); + begin + + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002DA01000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000016F49444154 +384FA593EB4EC2401484F7790595702FC59710451451047C0C140C218410EA637 +0BFDF2119CF54DA748DBFA0C964DBCDCC7732BBA9C2998F4A96DA48962C24DFBF +65A52C98450B89621BC65B0BF17C13B19706A2B93A22D91AC24F5FC7E8EF23000 +B370C1F650A242100A3D0465C00B1D726A202883CD7255C43E8F11F8016161902 +880B20966F212A8070AE8150B68EA00082993F005300FBFD1E87C3C115BF77BB1 +D369B0D96CB25E6F33926930986C321020F55AD8E32A52BCD1483DEF07ABDB601 +B3D9CC055CA72B5A1D9528B46CF376BB75E50D73FA743AC56834C26030C0E57D4 +5ABA30C39651A57AB951DE2CA6F27CCE9E3F1D806F4FB7DF8EF3EB53A8A5744A3 +A3C562E10639D909737AAFD783CF03601DC503E106CD14DF1D39619A39DD06A43 +EB43A8AA7C90DAF18A0686290EA76BBE8743AF0DD966D8F5347F12A789A415120 +53C5B5F4BA4A57E1173A0D9C485D1C575FAAACD5D1FE8553EA688053EA688053E +A9CF93B033F9EA579B5AA7EC4E00000000049454E44AE42608200"; + end + FProjectFileOpener; +end + +type TGridList = class(TListView) +{** + @explan(˵) tlistview ģ list %% +**} + function clean(); + begin + DeleteAllItems(); + end + function CheckItem(v);override; + begin + {** + @explan(˵) Ŀ %% + **} + return List.indexof(v)<0; + end + function additem(v);virtual; + begin + appenditem(v); + end + function additems(v);virtual; + begin + appenditems(v); + end + function create(AOwner);override; + begin + inherited; + end + function DoDrawSubItem(o,e);override; + begin + dc := e.canvas; + if not dc.Handle then exit; + j := e.subitemid; + if j = 0 then + begin + i := e.itemid; + src := e.subItemRect; + _wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,DFCS_BUTTONPUSH); + dc.DrawText(inttostr(i),src,DT_VCENTER .| DT_SINGLELINE); + end + end +end +type TBitmapGrid = class(TGridList) +{** + @explan(˵) imagelist༭ %% +**} + public + function CheckItem(v);override; + begin + return (v is class(tbitmap)) and inherited; + end + function create(AOwner);override; + begin + inherited; + cls := array(( + "text":"id", + "width":30 + ), + ( + "text":"bmp", + "width":60 + ), + ( + "text":"size", + "width":100 + )); + Columns := cls; + end + function CNMEASUREITEM(O,E):CN_MEASUREITEM;override; + begin + e.height := 40; + end + function DoDrawSubItem(o,e);override; + begin + dc := e.canvas; + if not dc.Handle then exit; + i := e.itemid; + j := e.subitemid; + src := e.subItemRect; + it := List[i]; + if not it then exit; + if j = 0 then + begin + return inherited; + end else + if j = 1 and it.HandleAllocated() then + begin + src[2] := src[0]+40; + dc.StretchDraw(src,it); + end else + if j = 2 then + begin + if it.HandleAllocated() then + begin + dc.DrawText(format("%d*%d",it.bmwidth, it.bmheight),src,DT_VCENTER .| DT_SINGLELINE); + end + end + end +end + + +type TListVariableFilter = class(TListVariable) + private + FVlist; + FFilter; + FFirst; + type ttypefilter = class + FStyle; + function filter(o); + begin + if o is class(TDComponent) then + begin + if not FStyle then return true; + return o.ClassName() =FStyle ; + end + end + end + function SetFilter(v); + begin + FFilter.FStyle:=v; + dofilter(); + return ; + if FFilter.FStyle <> v then + begin + FFilter.FStyle := v; + dofilter(); + end else + if FFirst then + begin + FFirst := false; + dofilter(); + end + end + public + function clean(); + begin + class(TListVariable).clean(); + FVlist.clean(); + FFirst := true; + end + function deletebyvalue(v);override; + begin + idx := FVlist.indexof(v); + if idx>=0 then + begin + FVlist.deli(idx); + inherited; + end + end + function cleandestroy();//ٲڵĿؼ + begin + id := 0; + while id0) and ifstring(v["text"]); + else r := true; + return r; + end + function MouseUp(o,e);override; + begin + inherited; + y := GetRowIndexByPos(e.ypos); + if y<0 then + begin + UnSelected(); + CallDataFunction(self.SelectedChanged,self,e); + end + end + function DoDrawSubItem(o,e);override; + begin + {** + @explan(˵) %% + **} + dc := e.canvas; + if not dc.Handle then exit; + j := e.subitemid; + if j = 0 then + begin + return inherited; + end + else + begin + i := e.itemid; + src := e.subItemRect; + di := list[i]; + if j=1 then + begin + wd := di["width"]; + if ifstring(wd) then + begin + di := wd; + end else di := tostn(wd); + end + else di := di["text"]; + dc.DrawText(di,src,DT_VCENTER .| DT_SINGLELINE); + end + end +end +type TListStatusEdit = class(TListEidter) +{** + @explan(˵) ༭ %% +**} + private + FEDITS; + e1; + e3; + ed; + e2; + e4; + public + FCheckNumber; + function clean(); + begin + if ListControl then + ListControl.clean(); + end + function setitems(v); + begin + if not ListControl then exit; + ListControl.clean(); + ListControl.additems(v); + end + function Buttons();override; + begin + if FEDITS then + return FEDITS union inherited; + return inherited; + end + function addclick(o,e);virtual; + begin + if not ListControl then exit; + v1 := FEDITS[1].text; + FCurrentIndx := -1; + if FCheckNumber then + begin + ListControl.FCheckNumber := true; + v1 := StrToIntDef( v1,0) ; + + if not(v1>0) then + begin + return _wapi.MessageBoxA(self.Handle,"ȴ!","",0); + end + end else ListControl.FCheckNumber := false; + v2 := FEDITS[3].text ; + FEDITS[1].text := ""; + FEDITS[3].text := ""; + ListControl.additem(array("width":v1,"text":v2)); + end + function Create(AOwner);override; + begin + inherited; + caption := "statusbar ༭"; + top := 300; + height := 400; + width := 430; + FCheckNumber := true; + ed := new TListStatusbarItem(self); + e1 := new TGraphicControl(self); + e1.caption := ":"; + e2 := new TEdit(self); + e2.Width := 150; + e3 := new TGraphicControl(self); + e3.caption := "ı:"; + e4 := new Tedit(self); + e4.Width := 150; + FEDITS := array(e1,e2,e3,e4); + for i,v in FEDITS do v.parent := self; + ed.parent := self; + ListControl := ed; + ListControl.SelectedChanged := thisfunction(onlistchanged); + e2.OnChange := thisfunction(EditChanged); + e4.OnChange := thisfunction(EditChanged); + end + function EditChanged(o,e); + begin + if not(FCurrentIndx>=0) then return ; + if o=e4 then + begin + ListControl.SetsubItem(FCurrentIndx,"text", formatText1(O.text)); + + end else + if o= e2 then + begin + ListControl.SetsubItem(FCurrentIndx,"width",formatText2(o.text)); + end + end + function formatText1(txt);virtual; + begin + return txt; + end + function formatText2(txt);virtual; + begin + return strtointdef(txt,100); + end + function onEditClick(o,e);virtual; + begin + if not ListControl then exit; + end + function onlistchanged(o,e); + begin + v := o.SelectedValue; + if ifarray(v) and v then + begin + FCurrentIndx := -1; + e2.text := ifstring(v["width"])?v["width"]:tostn(v["width"]); + e4.text :=v["text"]; + FCurrentIndx := o.SelectedId; + end else + begin + FCurrentIndx := -1; + end + end + function SetColoumn(i,v); + begin + ed.SetColumnText(i,v); + end + function SetLable(id,v); + begin + if id =0 then + begin + e1.caption := v; + end else e3.caption := v; + end + FCurrentIndx; +end +type TListStatusEdit2 = class(TListStatusEdit) + function Create(AOwner); + begin + inherited; + end + function formatText2(txt);override; + begin + return txt; + end + +end +type TIconsEditer = class(TListEidter) + private + FFileopen; + FIcons; + FImage; + public + function clean(); + begin + if not ListControl then exit; + ListControl.clean(); + end + function Create(AOwner);override; + begin + inherited; + top := 400; + left := 300; + height := 400; + ListWidth := 230; + FFileopen := new TOpenFileADlg(self); + FFileopen.wndowner := self; + FFileopen.filter := array("all":"*.bmp;*.ico;*.png;*.jpg;*.jpeg","bmp":"*.bmp","ico":"*.ico","png":"*.png");; + list := New TBitmapGrid(self); + List.parent := self; + List.border := true; + ListControl := list; + FImage := new timage(); + end + function addclick(o,e);override; + begin + if not ListControl then exit; + if FFileopen.ChooseDlg() then + begin + fn := FFileopen.FileName; + r := FImage.LoadFromFile(fn); + if r=0 then + begin + ico := new tbitmap(); + ico.handle := FImage.ToHBitmap; + ListControl.additem(ico); + end else _wapi.MessageBoxA(self.Handle,"ļʧ","ʹ",0); + end + end + function seticons(icons); + begin + //if FIcons=icons then exit; + FIcons := icons; + ListControl.clean(); + for i,v in icons do + begin + ListControl.additem(v); + end + end + function GetIcons(); + begin + r := ListControl.ListValues; + return r; + end + function showmodal();override; + begin + inherited; + return 1; + end + function applay(o,e);override; + begin + WMCLOSE(self,e); + end + function WMCLOSE(o,e):WM_CLOSE;override; + begin + e.skip := true; + o.visible := false; + o.EndModal(); + end + +end + +implementation +function includestate(u,s); +begin +{** + @explan(˵) ״̬չ %% +**} + if not ifarray(u) then u := array(); + if ifarray(s) then u union2= s; + else u union2= array( s); + return u; +end +function CreateExtendEdit(AOwner); +begin + r := new tedit(AOwner); + return r; +end +function GetFolderChooseBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002F601000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000018B49444154 +484BB595CB4AC3401486FB56051114EB9BF8046E5DF800A2088D0FE02BB871D59 +D1BC1B5206D166E6CD2DC9B26E92DEDB167E00CA733939A4833F0431639DF7732 +B774A0E5210497371FD0BD7E3F6A902905A617FE1B313A1DF97C7CC10EDEAA806 +74F4063BBDD8A6C361B28CB12D6EB35AC562B582E97B0582C44E6F33914450179 +9E439665309BCD44D23485E9740A49921C1698E02450E124E0F0388ECD02139C7 +7CFE1BC7B156E1470B8FDD483E14357C6B67A90873F02AE4E0D8793208A225D80 +701220148A4F196F700BEEE0BE12CEBB4778188666014D8D10A46F32A5FB0A76F +F7CEFABD48CAC0B09370AF8BC630104CF8D82352408824017F0451D3E9EEC7557 +2BBB1A82FBBE5F2DC01D83057C0DEA046B08EE799E2EE0DB5108E29746F953407 +02970EE1A056B083E994CAA05789884E0FBAA51B086E0AEEBEA027E5285E0EBB4 +51B006E1950282636CEBF09E3765D43F9370C771AA05754F2A2D289F77828FC76 +35D6082AB971887F31DC3E195020E572F3182ABDD7338EF5E13B4FED36F6F00FC +0241F784DD5ED660EB0000000049454E44AE42608200"; +end +function GetColorChooseBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002AB01000089504E470D0A1A0A0000000D4948445200000019000000190806 +000000C4E98563000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000014049444154 +484BBDD6CB4DC4301006607745015440177BE5C88D7AB8D2042BF6480B9BF7FBF +D1E3296068D8D13041B63EB972225F127C7F124E2E2015C4BBBF942EE9FDEE1EE +F1EDD0E0980A62BAE8AF914D08796C0F5901EB08CF3784DAB22C32F33CC3344D3 +08E230CC3007DDF43D775326DDB42D33450D7355455056559CA144501799E4396 +653F232680101D208403699A6E23088867A1849E31254DD568A725B089D00C8E4 +092243123081C812010C7F13682EB702B82C026420B2D3ED61B59E07452030F4A +F4D30844516446E84DBA1541200C43BB080241109811DA0F5611DA6CEBD04A87F +3590DBC2A79B98012047CDFB78B20E0799E19A192C101EC872254933880FDB708 +02AEEBEE23BCB252D1E3858F7634BDAAB4D03403041CC731232640AFAC1C20440 +77691BD6F0301FA2C38C0676144FEE547C266246237009F3C80A931F3C228EA00 +00000049454E44AE42608200"; +end +function GetFontChooseBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023C02000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001D149444154 +484BB595C96A02411086C5E7F0E83BE4ACE4A4375F40F0A65EF49A474A8E21470 +D219018859CDC6E12C16546C7D9D471AF743794943DDD1282D3F0C380EDF71555 +A51383888F10DC3FB4E0AEDAB86938F32C505DF86FC489C5CECFB7173078A4029 +A0B019ED3E924723C1EE17038C07EBF87DD6E07DBED16369B8D481004B05EAF61 +B55AC172B904DFF7453CCF03D775C1719CEB02151C05321C05146EDBB65AA0820 +7EC8B76BF0F8B5E0FAC6E17E69D0ECCDA6D1193C5679FCB70A54086A3C01B8DE0 +BB5A854736B8976412DE733991B76C169EE27130991CE128582C16610187EBFAE +ECFE742D02A972FFA5E4BA7C161405A3D875B96A516E8864A05B4E7D670A8842B +05D786EACD6642D02C95941B837014CC59412101C269F5B831AE690AC1732201F +5544AE4239F3FC369F51C3E63056905329C0A3E0B05D19651A3013FF57AA83508 +37D9FD904086D37D770C4308BE8A45D11655DF39FCAA00E1B47ADC1859A01A2A8 +51BECBE5620C3F940A94037540A9F4EA761810A8E8261AD2604AF990C988381B6 +EF1CAE15205CAEDE607F07AD4AE59C268BC560329C563F994CF4020AC75DD70D9 +5C3E5D670F8783C0E0B5470D58F09E1AABE73B85640E1B4FABF0E95561F1244FE +D28FEE00FC02B599AB32671AF3C00000000049454E44AE42608200"; +end +function GetInputquerysBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020B04000089504E470D0A1A0A0000000D4948445200000030000000300806 +0000005702F987000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000003A049444154 +6843ED995B4F134118867B8DFE0F2FBC3046A31726466FFC05C61310349E1212B +D43241A124550910818D468B840543C444D4C8C070820118D62A0A022B605DA05 +0A2DD0A5F4243D90D7F9B64C335D5AE5B0D9B208C9936FE69D6F76E661D92B4C3 +001464611E8E8E84561E10D4340774D1230D2E539A28489875D030143C0EF3B4F +A0E5DBB4AE4C767CC778E583456769059E7FF2E8C6D4CB56449A3E23925F8E91E +2DB8BCAF87D9B9B5B93056A1BDDBAE129A8468C5D2ABA350FC373672F34130588 +8440C50BA7AE48C5B7E02CAB5D749656E05CBD6408D20A188DD52760949FD52F6 +0B7DB5624FCC26B029962D102269329E90199664D80671CDAACCE8885F4F13955 +0E9F2B9752F5F29C589680887A9DE6F44031E3B958D5B97AAECE399A08281B58C +E1133AA7FEBE395936E2EEE553F9358968098F1F152FBFE3557674B1210E10F51 +67E29C67E9FAA872D43D621F877AC47E62C1022B8D35814CB32690693413700C5 +870F9CE136417DC406ED14DE414D5FC954367AA19557355A40AD9ECDC9CB335C8 +3B7F0B6D1FBFC0294929CF243413385D568FC2BBEF51FEC28C8B8FCD2879DABD7 +49E9851CAEA85475D3871A901365B7FCA3309CD04F6143C42DFE82CE4DFC04400 +980CCEC7ED8BC3D7C7FDF37B085A77B3355F04C8AF6EC1DBB6CE9467129A09EC3 +8F5008E893066636104C351FC8EC4E69845281C273B274F419C530DCE4484FE18 +CBA208B08C9E75B4A211EF3E74A53C93D04C605BFE7D0CBA66109999C5B42F0A7 +F20A6E09D0E2B952ECB331A07827101AA84CF1F532AADFBFC51B62F2E9057FE0E +8D1F7478035B4ED6A37F6C06A1600C1E3982296F54617C22A4409715C71E393CA +F12B447664CB23109E45E6102ED3ABC81CDC7EFC1EA0C419603708EF930C6FE88 +89A11159812E298E5DEC03A0CAC7C4A82BBE8718767A1581ECB2B74C408737B0E +9D83DFC1A0EC1EDF262D0E18134242BD806DC0A7451716C774C62FF81DCC498C3 +F7F50F4E2802074B99801EDFC0C62375E895821896C6D1671983D5E652B058461 +3F0DFB8C5CAE60C1A4B43DEA48CA07DBD3F4714817D256FD0D46E4E7926A199C0 +86C375F8391482B54F4267D720BABBED4998CD2CEBB1A3A7C7111FF32CB1E648E +AEFF86A453010C6DE12FA88757803DB8FDFC6D9DA5E5C7FECC5B587322A1A88A9 +2522B3677850F3CC8FDDA71BD0F9C39AF24C423381D72DEDD87EB412593B4B90B +5AB74D9AC63ACDF7D0957EB5EA53C8FA39940A6F87F04F8C24A65F50A188DD523 +C0FFE3CD03A3911030A6442BFE00B24E924CE37F2F940000000049454E44AE426 +08200"; +end +function GetTsIconBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100021E02000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001B349444154 +5847ED97DB4B024114C6FD0BFB1B7AE8257AED217C28E802DD91422308B388B47 +A903093EE0891614AB145BD88A61851A64268D18D93DFD0C8AE8DEEAC924BB01F +7CECEE396738BF1DCE2CAC8D2A9A751F5147E75C5B8D9E90CD8CE6DCE86D1325D +A690BC002F8DF004E4F982E6FEE686426548D45CF6FE9389AD0D43572D300ABFE +33F621413368CCB9CBE2B842B2104D0174F5AEB0269178923DB702D1F40E4089D +423F5D87DEC5904113CB8D2AC11D93080673D422FAFEFAC1994CE16EA42C8581A +C0B514A6EC7D913548A673D43F1120EFCF1CB402A10B30EC0891529974285F28D +1D4FCBE26CF87510431381DD4D48AAC0B902F96E9E3F38BDCBE13611EAE078123 +5A5B5B6B5D00085B2DCAA9CD213098381D50ED6E896C18C01FBAA09DF035D9473 +7357503935BAC964B061A3604C0870E5ADE38D5D4A5324F542ABFB1FBEE3EAF26 +D7C88600F870418B6B916A8D63E190C57052784CD6D200BC39EE391037063559D +901754CD65200BC79604FF995C74E40E32EF98F8FDA5200504C4957DF5E6D1CD1 +B89211AE95B134403D3DE49E69C8B12D5C2B635D80BFB6056001980F60FACF29C +EB21910E84944F40D9996C7E196BAE5D60000000049454E44AE42608200"; +end +function GetOpenFileBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002FE01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000019349444154 +484BB5954B4EC33010867BAB4A8004528FC209107B0E8040482D9BEEB802AAC4A +A3B365C000941166C68D2A479346D1E4DD20E1D8B318EED240D2223FDABDADF37 +766CB7B72FE8383D38BE7C81FEC5FF06995CA01BF0D7B0FA617623D8F33A15882 +909A876BB1DCB76BB85A22820CF73C8B20C369B0DA469CA922409C4710C5114C1 +7ABD86D56AC51286212C974B0882A05EA083934086934084FBBEAF17E8E062F70 +81F8FC7B541B85620C3E5ADA1CE11525524F03C4F15201C63DC0FE0FDB6CF638C +0610B95F8A603299948285BF21DC755DBD00BB4728C4AF3CF6F40AACE90DDFF7A +615205C2BA0AD6182F099A7B09EC0189EF11535AD00E18BC54215D09E3381F350 +99A61520DC719C1AC1DD11EFF6D0E0772301C26DDB560574627082F80D0E099BD +324A0E3C806FB8FAD220A103E9FCF1B04E675AB8802845B96A50AE832B1C19FE7 +AD8273105E2BA08BC4046F27AD8273686B106E9A66B5C018FD9EF943F3313C2DC +167B3992AA09B2ABE8EF20B49CF009E753AEF72E79582BAB79DE0A240868BDD2B +82CEFFF4BB4B0FBE011F9D6134A0D7ECFF0000000049454E44AE42608200"; +end +function GetTrayBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002D401000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000016949444154 +484BED933D4BC3501486FB83FC01BAB83A7510E9225D0A0E4504ED20BA77A9A83 +838A483830D181C5C623A085182592B4832086A5CD42182D83616ABFDE0D5739A +2B972692A55DA40F5C2EE7BDE13C9C9B248531331124321124F20F04F92D13538 +B876359334B1A52778F6F98CD1FE3E1B9113A470749F88A8ECE6EB0B6677128E3 +BA2E72B95C580D68369BA8D56AB02C8BF72008C293018661F0227E05F5F74F1E4 +7869A67B359A4D369AEDBED362A950A0A8502CAE532344D83A2285C534EE744AC +E0FEA98EB9D5130E755DE7A6994C862542609A26376DB55A701C8727A09D6ACAE +99C8815ACEC5CE0407739A48769098480A0EB28168B28954A50559577AAE9DA04 +11816E7B58D83C45A7DBE7F0AF09049EE7C1F77DD8B6CD3BD53211C1FC868EEBD +B170E6486DF814CB55AE5094423998860FAE7E5BE363E381826EE2B4A2222D8D5 +AEB0BC7D8EAF4E8FC351C2826EAF8FF5FD4B2E46BDF84F0E656363224800F8065 +E0D34316036A3840000000049454E44AE42608200"; +end +function GetImageListBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100026001000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000F549444154 +484BD58F310AC2301486BB4BEFE101D40BB87988BAF5060E1EC0414767A91E40E +9A082B3D845D04170165C159776504462FE426C62EA5BF2163FF848783CF8122F +0C43C1E93779800B32A05EC0A5C20870410670725A1AE0820CD47B6E0232D01AB +A09C8407BEC2620039DA96994CCC5F956178F67253FA3CDC2DAD1056460B02A9C +EDE672E259C6FBD8D8D305646092145ED39A9CD8814BDA30F6740119581E0A9F2 +F5F4EEC00E6FA9E2E2003DB5361762FFF41766F187BBA800CF87DDF494006AAA3 +AA93E01350AA2168C64D27411EC86F92EF40B00E9C04564009BAC7AE93C008285 +480839F014EAD0037FF1E10E20DEF9AF049B9ED69F90000000049454E44AE4260 +8200"; +end +function GetTimerBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020903000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000029E49444154 +484BC594D96AA24110857D9E79C9C99D51AF024188883E8106340A2E37C625370 +ADE08921830242EE08EB8E0420D5F619B36696784619803C5DF7F2F75AA4E55B7 +47FE312E22B8BBBB936AB52A8D464392C9A4DCDCDC1C56FE8CFF4FB0DD6EE5E5E +545AEAEAE8ED66AB574FE129C25188D46128BC5E4FAFA5AC2E1B08E53A994DCDF +DF4B241211AFD72BF1785CC6E3F1E1841B4E8272B92C3E9F4F32998C7C7C7CC86 +03090E170A8A4D3E954E6F3B97E0B8582040201DD7F0EDF08D0F8F6F65665E876 +BBD2E974D418FFF8294A34994C9464BD5EEB38140AE939174E088824180CCAFBF +BBB46FEF6F626ED765B8DB1C7E3915EAFA72464B0582C64B3D9A8D108954AE5E0 +E9134702B4F4FBFDF2FAFAAACE714A1644FDFCFCAC630858EBF7FB3A6FB2D8EFF +7329BCDF43C32DA381250C46C36AB52102D0E9BCDA6B626C61802D6D84316385D +2E97B2DBEDD4C7E3E3A316DE8612D072740BD1A137D113218EEBF5BA1A6308586 +30F854726F69996858CEE42320325205A5A91438600592E21C0A97D27A2D1A8CA +6CA004DC522422EDBF9108241209F567A004C56251D2E9B416889431536432B18 +B6C9B29B23903F2F9BCFA333866C00D256522A3155D6DCA9CAB4D6D9041AD563B +FC5935E0FA1311170707B42252A037C69839D6EC8B66CB039C35A048549FA8386 +8BA036714D3F554AC562B3D67A401D4836EB48BAE0480FEE56D212A52C70945C4 +21C69839D6D8633B31E03C52DB381290360F17371A5D71424444C817638E3564B +12307E6267F7D5D8F0480B7883705275C7F1C1129E6726AC07ECE3D3D3D1D663E +7142007815D94C445FE122601FFB1F1E1E0E33A7F8460078154997B705695C609 +E75F6B92237701200B4A4F07417AD477FE77239FDF2CF3C05A576BFC3590203F4 +A7AFB93CA55249BFFCBBBAE83B447E01A5FB392686E583230000000049454E44A +E42608200"; +end +function GetSaveFileBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100021702000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001AC49444154 +484BB5954B4E024114455994891B70C63A5C8013062E4017E0CC814E9C191DB80 +09D9A4048909020100C10A0F9FFFF9FABAFE2EDBCFE6A3A50C94D57D255E77477 +55BD8EE1C8CD08CE2E9338BD783F6884690BFC06448D69B198DD3FBCE0077E548 +18E43C0B6DFEF4D76BB1DB6DB2D369B0DD6EB3556AB1596CBA5C962B1C07C3EC7 +6C36C3743AC5643231198FC7188D46180E87E1023F38056E38051A3E180CFC058 +49F9C3FD849A55248A7D3C86432C866B3C8E572B8BA7BC5F5FD1B8AC522E28967 +7C7E590EB8AF403FB916109ACFE7512814502A95EC7BD56AD55CE3892703A7A0D +FEF7B0502F713105A2E9751A95450ABD5EC7BAD56CBEE6B78AFD7F317F0BB7392 +84D07ABD0ECBB2D06EB71D50F635DC57A0179593248476BB5D03916F7DF398349 +185E538815320633D02C2DD82FF46C33B9D4EB040B62327DDBE7CFC198ED57079 +638F8070D9EB9CF49FC6B1020F15E8931A5540B8ECAE40819CD428020D978DE11 +1E83210454078A0807087E0B7F486C52D1078B3D90C1648118B22D0F046A3E115 +E80AC9EAE8AE907AAFBB1795F04041586D27DC7D98345C3FBD4770F49FFEF11AF +00DCA98480ED0E0E3350000000049454E44AE42608200"; +end +function GetMainMenuBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100021E01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000B349444154 +484BD591310AC4201000FDA0D8D859E547FE48EC03127D809D8F48B3870B064F3 +DD45C725C06A688849DAC21703318608C01A5F432A594383C7204D675ED1A42E8 +EABD876559C018530708211F4D81F2BC3C534A8110029C7375A067FEA52DB5D63 +87CDB361C1EC140EB1ECFC839076B2D0E4E1C815166DE8DBC05F2BB4C967C1518 +E1F20DA239CFDAA0C5B336686D713AB0EFFB90A70333CEF0BB0DF0E1CE7F30CAF +F06669CA1BEE48B797A00E00533D0A5754BB70F010000000049454E44AE426082 +00"; +end +function GetActionListBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002D200000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000006749444154 +5847ED92510A002108053BA8D7F18A5EC768E185D8A750C2BE818190A0811CFE1 +8063080010C380254750BE2AC6AE6081091CF78799D31AF9AE917709B7E0166B6 +05715635C325ECF705B7E91780BFFAEF12AEC72088B3AA192E210318C080C701E +E13DA99A6670A4C99A90000000049454E44AE42608200"; +end +function GetPopUpMenuBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002F401000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000018949444154 +484BDD944FCB015114C6E74B8D448842A6B1F401E43358284B7B4B2B595958B05 +3B250B2D3A0AC486489324929911EDD33476E8C3FEF782DDEF757A7EE79EEDC9E +79EE9946C197F98706F178FC47F50A5B8377F9C8405194BBBAE5EF251025F3950 +4A7D309954A85D6BF9A40465555D46AB5EF2410B85C2EC4623184C361561EF376 +023985DBEDC6743A45281442BD5E67D51E5B83C3E1F0B43C1E0FF6FB3DE6F3392 +569341A7CFA1E5B83572512EC763B7A7E3299D055359B4DEA6F719420100860BB +DDF209603C1E231289A0DD6EB372C5D10C82C120369B0D7716A3D1884C3A9D0E2 +B160F0D9E21AE64BD5E7377653018C0E7F3A1DBEDB2E2D0201A8D62B55A716751 +AD56A1691A52A9145AAD16AB0F0C5E95DFEFC762B140AFD743BFDFA773A552099 +94C86D6327706EF7031126F9C4C2649334D9366230F5FE0C8209FCFC3300CFA2F +E9BA4E5F91209BCDA25C2ED3FA8223039962B1885C2E87D96C86743A8D4422C13 +B161F1B88AFC9EBF5D2E00B850296CB25EF587C6C20180E87381E8FDCC90067A0 +D1EA483E13801D0000000049454E44AE42608200"; +end +function GetMessageBoxBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023F02000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001D449444154 +484BB5954D4B024118C7FD0675280882A0BA77ED0B04D90788A053DF203A44509 +720F3E02D48D0F410E5A9A0023B061D1414B2022F7AC98378F2FDDD5D77D77F3B +23B38C3BA344EC0EFC60F719FDFF1E9E19D1039717156C9D7E60F328ED2824D31 +2C83EF05FE8F278AC67E70566B8AB029E09015BA3D188621806745D87A669180E +875055158AA250068301FAFD3E7ABD1EBADD2E3A9D0EA5DD6EA3D56AA1D96CCE1 +61866B0118D423383593813D8C399800F6F341A7201EBDC88C5E81CF5FBBB89EE +C3E1F054F870A9C01A8BD91D569781930D606509AAF945BE73FB68F8CE99A05EA +F8B02DA39C1EF03BCEBC0CF2EB0BD06EDF2828613649DF32493491A5EABD5E402 +BD5C0616E78137EF58F0BE032CCC412995A49DDBE7CEC2A50272638C5088CEDEC +E3018A4E1B2AE197CF7D56A5514B0EBC81F2A7F63A6CD9D1D2A1F5EA954A60BEC +E17F3D543EBC6C8E5A10D8C3F9EEEDE1B2B993F099824C26E32882209BCD3A8A2 +0C8E7F3C8E572787AB8C1F363843E93DA9E2F85E3EB84C5BE3F25ADF37B044150 +2814F0FD95C655E090F2F539AE9D851288C7E316E45D56E7F70882A064FE988AC +5225E5F6E29E499D40E02699C471216E45D56E7F70882809CBC93080276AF9D62 +42E0FA9FBE7B0BF805EA9D74EABD7884450000000049454E44AE42608200"; +end +function GetClientBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100024803000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000002DD49444154 +5847E5974D48625114C7FD2C050D5A0D6582BB206D5704BA2FB086D9369B16D14 +A0884419C4D9B8A362DFA90C036B3ACE508439160B3B195820E2444398892227E +64A5D5301FF59FCE9DB9F5F469D4F4D2C5083FDEC377DFB9BF7BDF79EFDC2BBBF +DA116B95C0E8BC502ABD58ACECE4EA452298C8C8CC06432E1E2E202575757FFCC +B7EFBFA01AF3DD219B9B9BC3432C2C2CA0582CBE9CC0F9F9391EC3F0F0F0CB08F +4F5F58133383888A1A1A1BA747575C16C364B2FA0D7EBC1D9DEDE463C1E6F4822 +91C0E5E565DDC08F452470747404CED9D919C2E13056575725C7E3F12093C9880 +5767676C0C9E7F3585C5C646F415B5B9B64A8542A16331289880584AF5F281462 +021A8D067B7B7BD8DFDF9784E5E56516FF4902E974BAEE337C2A94339B9B9B8D0 +57A7A7AC0A106520B100F0A944A2510272727A8542ACD17585B5B03E7F8F8B8F9 +02949D9C97C801E24181959515705A3203A7A7A720280FE833DB7401FE06188D4 +6D6A0E9027481D3921C502814E0B444C0EFF783C36B41530584E596AA61D305DA +DBDB4150A7548AFFBF246CB9C0ECEC2C38C9649209A8D56ACCCFCF63696949122 +627271B0B704BAADB04090867454A1A0A50C7548EE9787878C816A742B6B6B6AA +CE0D068328B8DD6EAF6A578F42A1D058C0ED76231A8DB2733E2BFC1AD5886C36C +BAEEFEEEEA2BBBB5B2440FB06120806836C10545FE85E1E8F1F494039FA512CE0 +F57AD1DBDB8B582C76D798A0458ACBE562A3D66AB56C8159DB3941E55CA954B2F +CE9E8E8407F7F3F028140552C8204D4AF7D508EFD9190E5723936C2838303F63D +A01B690442736A4323DBD8D8600BCC99991926353D3D0D87C301A7D3C96690127 +77D7D1D3E9F8F2D46CBE5B248E0C7CF6BBC7AFBE96E166434EA8989094C4D4D41 +A7D3B1D10C0C0C546D42E8584BA3FF85083BE65CDFDCC0F6EEF3FD0C08A75188C +D66639BD27A419EC3CDADC0FB0F5FA01AFD9B03F4DC6A3BA7E7393E3ECE36A5F5 +823C0712887C2D42FB86047CF80D6DF21A10823FEDBD0000000049454E44AE426 +08200"; +end +function GetClipboardBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020802000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000019D49444154 +5847ED97BDAE82401085EF3B51FB083C02ADBDF1052809893D3DB1B1A4A72194D +426141616143674985861CEC4F1EEAE2BFBE35ADCE49EE42430333B7E597659FC +991D753C1EE7AEEB249F4EA747D65D4E00C330CC511469ED0BE10C10C7F1CB8F2 +3869C8F9C1F4168BD004CD3243DDFEBF54AF1CBE522C575E659C018317EBBDD28 +AE930470381C5EA6B82C4BCAE9A65E356A208C11E3ABD56AAEAA8A72AA2480ED7 +64B03D6EBF5D36DDB520ED762539DD334A55A8C117B20C770AA24002EC6B48512 +7A31A04EFF005F07C08EC0A2B45A842680F3F94C395FEBB6A33500E73EB16E3B5 +A01F47D4F71E43F317AA8DBD10A00F70CE02BEE018BFABB005C6B729665541F1C +20499267C3256F361BAA0F0E80930F7193C771A47A5C070570557000ECE7A2288 +CE6D3343800373399C70407C0EAC6BDC94DD3507D7000570507A8EB5AFBCC61E4 +54390188CD201D00377B67555600EAC724BCDFEFB5004B6B80DF7EA2AC0050B4D +BEDA466D8463A00575901BC9308806B5F7B03E04B061F13DCE013F3D9C0B20280 +F0E6B3F973B2E43CCF1FDD7E650DF01DCDF31D7DD4021C9110D40A00000000494 +54E44AE42608200"; +end +function GetServerBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100022402000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001B949444154 +5847E596DF2B436118C7FD916EB840AE2853DBA424AD2C62C50DA1B9212D4949B +9A024CACAC5507EDCB8922DE7D8D62CC6C4D2C3F7FD9173CE76F2EE6CEF99F2A9 +A7534FE73CEFE7BCEFA9F36DA316F3F7057266856EAEDF3C55FAF65D4C71C7556 +07DB940A3FDF7D4D77ED75005BB33B418CB53D6A888C9766A0A0CF566D8C381CE +3445C326CD46B29E6A7AE481C23D7C16442E5265B1C20F55028978813D3037916 +3DBDF0CE233793613524E6C0297A76576231E68049C3D16C37720D95A2BB2D9A9 +E48BE8706C02477B2576D3E1EEB3E878437E3B0B5339D1E152E8E1DBB26213D8D +9E09656732FACCEF363C45B5B41CF790C5A04DCA84B4047290BE82C25015C7594 +B200B64B07BE09C839B85AF14D00336A2DE69B40CB77C00D65015C7594B280CE5 +23E021D5597800E7C13907F43E7AFD7370119E99CC1E65781E37D1E48920725D1 +F106022816B2BE8891F960B39D19C1267075C62319C264B391B9F0FCE45574383 +6010073DCB8B9F248A5A74FD16D0C79B4CEED075502606C80673AC4F2F1A0C11E +F45293C32685BEE33866219E2BC572C976A248D19041C12E3EC04B053AD214193 +46829E61EF15D05FCE2BF0B107D0115A294818AC7913B0000000049454E44AE42 +608200"; +end +function GetQuotationBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100023B02000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001D049444154 +5847ED97394B03511485FD0D76D636967682A56025F692CAD6522C1414042B2DE +C44105404C115D1464923445C10255868E112251A09D9D4108C216872CD992579 +73677C6FB24814F2C1859777CF3D3903F3669226624C9E25A879F6EE570ADE1C5 +B00A7C15A16E76F07A81532CF4680FF1DA073ED512B1532CF8A0388CF0BA7F32D +22F36C04701D20F399A7F193380D1DC4B4EADA7C2AEAB036F7C78EE394CAE68C2 +99D9F3C81EB00FDDEB0A5272BCF6ED898D2117B1CD701860F63969EAC067D5163 +4A47EC71CABA07D66F52B47895D4AAAF7095A60E6B737FF53A65A84BC83C2BBE0 +9A7CE5F8ABABA9C82BA0798BF4C167558CB9079561C00CC5CBC6AA542E6595500 +B7C83C1B01AA0A10497F69A542E65976805C5E3F82BD3BCF451DD6388AE83921F +32C2B802F94A69EED904523167AD070440DC755808FC29B70E2D4FE87A57D39A8 +15DF87163326628FA30CE00DBE53F796F5AA5BE60234ED2F9D7FACB1276A30835 +920EE73A401468FE296CF28CF5E98FCD18CA12E813DF4B89E7B70A401C46A5B7A +503E720134D03A79A038AE020CEC4728F09635146AA0C58C9317471AA06325481 +BB7F6F7BB5B300B0FD193630B8033DEBA704F23855F40898CFA21A3021EF0C297 +DB5FDB44DF6B0BDB1A1CD1EFD70000000049454E44AE42608200"; +end +function GetLoginBitmapInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100020803000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000029D49444154 +5847C5963D6B15411486FD1DFE004150886015514965974604D122428CA0A0060 +B3F8BA0285824A098221288123544441182A2588AA820162204AC2408C61051F0 +A3D89D99E37D8E334BEE8733736F72F10903CB99F3BEFBEEEECCDCAC93FFCCAA0 +27C740B3A5643DB01C6ECB80C9647A5A7DC21EB8B8D3AB8A6366AAEF9AE7CB203 +3C772FA5B7D8A537DC5C6C93DDE5809C311774704D8D397AE8CD252BC03DFBB07 +ADA13E69CAF36C35CE843934332C0922C57A6B7EC5D5FFD37F4847EB42992018E +99536A366D677D250DBD68D0A6880678E49EAAD1FE72C857F24183168F18D1009 +7EC989A4CD9DBBE920F1AB478C48806D8531E509317F6B5AFE483062D1E31A201 +36145BD5E487FBE92BF9A0418B478C6880BEB25F4D3A39EDD0A0C5234634C0493 +3A2268FDD335FC9070D5A3C62440384EDD4C911CB918D36B57DA301DEBBF96A1D +B4B310C302448B478C68001837936AB6A5DCE92B69E84583364532000C99E36AD +8536C9757EE8DAF36C31C3DF4A2C9212B00CCBA076ACC183087E5B43D2F57CC84 +0EAEA985797A73C90EB02C5F65B4B6B03615BDD58D1A074F3F61A7E49B7CF7AA3 +4C9005F6ABF69ACE8F05D19FCFEEF2B0FCADE725007D7D4C23CBDEC1CB429A201 +E6EC93EAC67D45BF4CDA6959709FFC6C339FDDA2DCB077B43704E9781BDEB773D +5135DB5D7E597FCF63369E84513F4B173A465000441FCD6BDF3D5F6E10D061F1E +A8154D01C2E9C7582B821F811AA90BC0A209DFBC5573A7F016F1C4BB7161D6050 +8AF9EEFB7D68435C18E5A491580BD4B4256703B0B2E173CF1E61E9C29812A4058 +F56CA36EC136E61E37ED8CAFAC0830608EE8247BB95B7086700F0EAD800628A46 +C9AE816E1C42C6B7FA00116DD92160F99612D76936173B6EE4D6B8079F7418B23 +E6B216BBC9453BAAF7FAFB8F8AC81F0139E1CCDA06E76D0000000049454E44AE4 +2608200 + "; +end +function registerproperties(ps); +begin + //dser := class(TVclDesigner); + for i,v in ps do + begin + it := createobject( v,0); + //RegComponentPropertyType(it); + class(TPropGrid).RegCellRender(it); + //dser.REGEditType(v); + end +end +//*************red**register************************ +function redregister(); +begin + classes := array( + class(TDipaddr), + class(TDmessagebox), + class(TDEdit), +// class(TDtrackbar), + class(TDcomboBox), + class(TDradiobtn), + class(TDmemo), + class(TDpassword), + class(TDColorComboBox), + ); + class(TVclDesigner).RegestorClassItems(classes); + ps := array( + class(TGridCellEsAlignEdit), + class(TGridCellTextEdit), + class(TGridCellAlignEdit), + class(TGridCellAnchorsEdit), + class(TGridCellTabAlignEdit), + class(TGridCellStringsEdit), + class(TGridCellIntegersEdit), + class(TGridCellColorBoxEdit), + class(tGridCellMbbtnstyleEdit), + class(tGridCellMbiconstyleEdit) + ); + registerproperties(ps); +end +function zhregister();begin + classes := array( + class(TDListBox), + class(TDColorBox), + class(TDCalendar), + class(TDProgressBar), + class(TDCheckBtn), + class(TDDateTimePicker), + class(TDTimePicker), + ); + o := class(TVclDesigner); + o.RegestorClassItems(classes); + ps := array( + class(tGridCellDayOfWeekBoxEdit), + class(TGridCellPairIntEdit), + class(TGridCellPairSpliterTypeEdit), + class(tGridCellAlignPosBoxEdit), + class(TGridCellTreeViewDataEdit) + ); + registerproperties(ps); +end + +function tablelines(str,n); +begin + lines := str2array(str,"\r\n"); + r := ""; + for i,v in lines do + begin + if not v then continue; + r+=n; + r+= v; + r+="\r\n"; + end + return r; +end + +function compileTsl(tsl); +begin + rts := ""; + havekg := 0; + for i := 1 to length(tsl) do + begin + vi := tsl[i]; + if vi in array(" ","\t","\n","\r") then + begin + if havekg then + begin + + end else + begin + havekg := true; + rts+=vi; + end + end else + begin + rts+=vi; + havekg := false; + end + end + return rts; +end +function GetDCompObject(n); +begin + return class(TVclDesigner).GetClassItem(n); +end +function staticInit(); +begin + its := array(class(TDGroupBox){,class(TDCheckGroupBox),class(TDRadioGroupBox)}, + class(TDForm),class(TDPanelForm), + class(TDPanel),class(TDTimer),class(TDSpinEdit), + class(TDPairSplitter),class(TDPairSplitterSide), + class(TDPage),class(TDTabSheet), + {class(TDHotKey),} + class(TDImageList),class(TDMainMenu),class(TDPopUpMenu), + class(TDMenu),class(TDBtn){,class(TDPopMenuBtn)},class(TDTreeView), + class(TDOpenFileADlg),class(TDSaveFileADlg),class(TDInputQuerys), + class(TDColorChoose),class(TDFontChoose),class(TDFolderChoose), + class(TDToolBar),class(TDListView){,class(TDTSLDataGrid)},class(TDToolButton),{class(TDtoolsepbutton),}class(TDStatusBar), + class(TDTray), + class(TDActionList),class(TDAction),class(TDLabel), + //class(TDSocketServer),class(TDSocketClient), + class(TDClipBoard),class(TDQuotations),class(TDtlogincontrol) + ); + o := class(TVclDesigner); + o.RegestorClassItems(its); + ps := array( + class(TGridCellBoolEdit), + class(TGridCellColorEdit), + class(TGridCellDirectoryEdit), + class(TGridCellFileNameEdit), + class(TGridCellNaturalEdit), + class(TGridCellIntegerEdit), + class(TGridCellLazyIntegerEdit), + class(TGridCellStringEdit), + class(TGridCellEventHandleEdit), + class(TGridCellVariableEdit), + class(TGridCellVariableTactionEdit), + class(TGridCellVariableTrayEdit), + class(TGridCellVariabletimagelistEdit), + class(TGridCellVariabletmainmenuEdit), + class(TGridCellVariabletpopupmenuEdit), + class(TGridCellImagesEdit), + class(TGridCellBitmapEdit), + class(TGridCellIconEdit), + class(TGridCellFontEdit), + class(TGridCellhotkeyEdit), + class(TGridCellSysCursorEidt), + class(TGridCellStatusItemsEdit), + class(TGridCellFileFilterEdit) + ); + registerproperties(ps); + redregister(); + zhregister(); +end + +type TViewBitmap = class(TvcForm) +{** + @explan(˵) ͼƬϢɼ%% +**} + private + FFileopen; + FBmp; + FText; + FOldSize; + Fimage; + FMU; + FMopen; + FMhelp; + FMCopy; + FClipBoard; + FLB; + public + function paint();override; + begin + if FBmp and FBmp.Handle then + begin + if FBmp.bmwidth<200 and FBmp.bmheight<300 then + FBmp.draw(self.canvas,650,100); + else + FBmp.StretchDraw(self.canvas,array(650,100,650+200,100+300)); + end + end + function GetBimpOpenBmp(); + begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002AE04000089504E470D0A1A0A0000000D4948445200000040000000400806 +000000AA6971DE000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000044349444154 +785EED97794F135B1887FD307E00FFF25B98F811AE1A1313638C8991B82626AE1 +4D9B4A514011716254A29B4A58085D28D0285B66C054190CB2D704590AD2082BE +F64CCF603BF356A733530BD3F9254F1A867366DEDFD3E9148E408E4715405F733 +6AA00FABA9FB5A54D45C30D2AA0B7694491A802D2151076CF1C48469A1C3052DF +0C43CF1B60B8A611865F5960B42D80AE2548127090F2FDCB02AC159C84E58B475 +1A2D612BAF2571425206ABC8B166759C93B067B0B9374753C8A1140DE7DAC3497 +68E31DBA231EC508D80958D1C25C56F34FD01DF12846C057570D5A98CBCAF5E37 +4473C8A11403EDB58612E9BF557E98E7814238064A3FA025A3A916F61275D1D8F +A204ECCE0CA2A559B8EF3E89A20490EC45C661BDEC1F5EF96D7B055D911CC5096 +043BE16C91D419E0D3FB637E8517E142B40685401AA0055802AE0D008D8D9DB81 +C8C622835C3934026656E7E0ED442B1882750CC14F63F437D2722804CCAE45F68 +B27E25F18A22BC4E7C00B20B73B569E85DC195272A0057C8A7E464B73598C2ED1 +1DE94776014B5BCB609A6C67066B9CB031B76974779BFE3639FA400BE4751AA02 +AD40A8ED9203D1ACFDCFA3CAF682A1AC6CDB0F92D4A77A617590544D617A166D4 +C81BB036768C2B82943E65CE4FE2BEB70E7AE7C3108A3DE0B8E7F8139EFFFCF4C +CE9453601D3ABFF4265E8353A1C4BFD980926963F802160E69567B9E9D4A37B85 +E098F5C33D4FEDFEB92EDBF5B163213A211ED90498A7ECE85018773D1570AEB53 +0A9F8596B01DC761BD0F542D1F8AA92CEC95219B4D229F99145C0FF021F568994 +0DD6407E6CE01BDD6590D7A5055DEC676C5DBA9073611274032666566E6411D03 +71F4487C9069ADE6A5400A1E9BD87993731B20868089BD161B2C5A577A5A80082 +71C2CDCCCC46B280A5AD1574886C72CFFB142D4F38632980A995086D238300E6A +98E0C916DCED9921FB28914F7BDA16D6410E09EEB4707C836A91E862C9D1F034C +1FC902DE8C5BD101B2CDEF3E06846B8E4AD8DAFD2A4DC0987B1ABD3841D7FF024 +ABD5550D86D80626705687B9F4379A0165D9B09B4032FD1E289B44C7AA50918F2 +4CF22E5CE67F098F3ACBE181ED098F87ED5A28EA8ECBE0EECB04173B4AD0E22C5 +762FF878CBAA6C50B18F486932E48DE71AC38C613DFB3A4BD99E096B31C2D9E48 +5FE7A87801FDDEE1FD8B153A0C68D1DF916909857DCFD0D289D86D7EF1027C3D2 +1E6428F7BAAD18242201F19EEE07272C6A2418BB3989A5DD204E807627FD3B7EB +D07242287157A283CBC5F9B622B4388BD1D42D5E80B767088A5D4FD16242D174E +832FAED70D9AE85D3E64729796B728A175067F781C62EFCC1978A22570394FA2C +19E181C30B579B6753526DEA172FA0A3EB23DCB7E9D152E970DB624387FB1B900 +EA205B4754DA185D2E58EF5153ADCDF409200A37D006EB60CCAC2F5963174C04C +234900D98C9DF430A10A5005A8025401AA002902948068014A431520548092E18 +62720D7A20AA0AF399B1C1700F01309B59D2D832D152F0000000049454E44AE42 +608200"; + end + function Create(AOwner);override; + begin + inherited; + ico := new tbitmap(); + ico.Readvcon(HexFormatStrToTsl( GetBimpOpenBmp())); + FormICon := ico.ToIcon(); + caption := "ͼƬϢȡ,֧bmp,ico,png,jpg,jpegʽ"; + FFileopen := new TOpenFileADlg(self); + FClipBoard := new TClipBoard(self); + FMU := new TMainmenu(self); + FMopen := new TMenu(self); + FMopen.caption := "ͼƬ"; + FMhelp := new TMenu(self); + FMCopy := new TMenu(self); + FMhelp.caption := ""; + FMCopy.caption := "Ϣճ"; + FMopen.parent := FMU; + FMCopy.parent := FMu; + FMhelp.parent := FMu; + FMhelp.OnClick := thisfunction(OnHelp); + FMCopy.OnClick := thisfunction(OnCopy); + FMopen.onclick := thisfunction(OpenBmp); + FFileopen.wndowner := self; + FFileopen.filter := array("all":"*.bmp;*.ico;*.png;*.jpg;*.jpeg","bmp":"*.bmp","ico":"*.ico","png":"*.png"); + FBmp := new TBitmap(); + FText := new TSynMemoNorm(self); + FText.border := true; + FText.readonly := true; + FText.parent := self; + + FText.top := 15; + FText.width := 600; + FText.Height := 430; + lb := new TLabel(self); + FLB := lb; + lb.caption := "ͼƬ:"; + lb.left := 650; + lb.top := 20; + lb.width := 200; + lb.parent := self; + Fimage := new timage(); + FOldSize := array(0,0); + Mainmenu := FMU; + end + function OnHelp(o,e); + begin + _wapi.MessageBoxA(self.Handle,"ͼƬϢתΪ16ַ\r\nHexFormatStrToTsl ԽϢתΪtsl\r\nȻbtmapͨReadvconõbitmap","",0); + end + function Oncopy(o,e); + begin + r := FText.text; + if r then + begin + FClipBoard.text := r; + _wapi.MessageBoxA(self.Handle,"ճɹ!","ʾ",0); + end else _wapi.MessageBoxA(self.Handle,"Ϊ!","ʾ",0); + end + function OpenBmp(o,e);virtual; + begin + IF FFileopen.ChooseDlg() then + begin + r := 3; + r := Fimage.LoadFromFile(FFileopen.FileName); + if r<>0 then + begin + _wapi.MessageBoxA(0,"ʧ","",0); + return ; + end + FBmp.Handle := Fimage.ToHBitmap(); + size := array(FBmp.bmwidth,FBmp.bmheight); + Flb.caption := format("ͼƬ:%d*%d",size[0],size[1]); + rsize := array(min(300,max(size[0],FOldSize[0])),min(300,max(size[1],FOldSize[1]))); + FText.text := TSLToHexFormatStr(FBmp.TOvcon); + Invalidaterect(array(650,100,650+rsize[0],100+rsize[1])); + FOldSize := size; + end + end +end +function GetHostroyBimp(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +100021901000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000AE49444154 +384FB591B10A83301884FBFE90277010CCE412870412F00D9C5DB2677472C816A +EFC2196BF1A6AB5F4839FBB1B7204EE01C6388EC57DCFFF0B628C98E719D33465 +A5CC392DA087DE7BA494B252E61C0AF6A794C2BAAEAFA3CC792BD8B0D616070CC +300E71C4208592973AA055AEBE2806559D0751D8410592973AA05FB6F7EA25AD0 +F77D71E7540BA494C55D9C71A36DDBE22ECEB8618C41D334F96ECDC8B93523E7D +68C57F8B1007802C798CF8E2876C2280000000049454E44AE42608200"; +end +function GetDefaultIconInfo(); +begin + return "0502000000060400000074797065000203000000696D670006040000006461746 +10002F802000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000028D49444154 +484BED936F4813611CC785DEF5AE971115F45230712B36A6DBDCD6A84D4D72B69 +486EFCA188D70A1D339655638DC422D6C36470441043333882010234248BBD38D +52DA91FFF722E8DED93004F1DBF35C3BB9C50D37B057F5852FF7F0BBDFEFFBB97 +BEEB922FC65FD238034C7617D680889DA5AC1744D6BF9282760736909A9911124 +EAEA10B75AB1EA74626360009BE130526E37123535885757633514C2462201ECE +C6426B3250BF8DAD58569950A8C5E8FEFDDDD402C266B7A8FF6D05E3A23275940 +2A1A45923CE102797246ABC5ACD18875970B69BA35C4743D67328125F716341A2 +4954A61464E3901298703F0FB05F3CDCD9827301AC85454605EAD065F5A0A1417 +0B4E9595E50F98FB96C4E38E2B5900D1F48D6898185C10E0FCB3161CE93F87A38 +316F4B7D6EF3FE0C0ADD338D8ABC1A1A01EBD3E3B3E9A2AB1E6B88C343931B900 +E99212AC284E916DD362EDC9D34C52B67601457E2502CB0134BC75E244D882939 +E72B4365560D2ACC3944187C5C6467C329BB1A85060454942355A7C309DC57357 +1FDAEF4CC2D8C1C2359CC46B86C78F9FDB99541980D41446EBB66B6308D8BC98D +21A30A3ABC444E77D8CBFE41063C969CDF8D1FB2D34849250B54C4373732693BA +07809AD6E990FDEE328C9DB3C2707DDF67F48CF24228BD5E0A7E4139A91BBC719 +CE95916FA4565015CAC2727C0FF8A7C06E2F6D12D0166F0B2024C0CBDF0600B17 +23102C0BF0BF8BE0F860150E0F98611A6BDA85FD09909AD6C550A96501A2E87FD +036710FC706AD026CDF01525198E3850F7A0FDD770E57A33C7CE3DBB200DBF036 +AA823C2CB73918DA994CC21E00516972ECDEB03C6E44380263600FFD86518018A +A6B6370FD2127F4D17E517901A492C2D4EE19D950A90A0614AAFF803D04FC02CB +EAA6F9D1CC6EB10000000049454E44AE42608200"; +end +function createtslfunction(f); +begin + n := f["name"]; + p := f["param"]; + b := f["body"]; + ps := ""; + if ifarray(p) then + begin + len := length(p); + for i:= 0 to len-1 do + begin + v := p[i]; + if ifstring(v) then ps+=v; + if iFLinea.width then FLinea.width := rc[2]; + end + end + function CreateTpjFomFile(f); + begin + if AddAproject(F)then + begin + OpenFileFromTpjFile(F); + end + end + private + function AddAproject(F); //һ + begin + if not ifstring(f)then return "Ϸ"; + if FileExists("",f)then return "Ѿ"; + p := GetPathFromFullName(f,n,t); + fio := ioFileseparator(); + if length(FileList("",p+fio+"*.*"))>2 then + begin + if IDOK <> Messageboxa("ļзǿ,ȷ\r\nȡ˳","ļзǿ",1)then return false; + end + if not(LegalVariableName(n))then return "Ϸ"; // Ϸ + if findfunction(n)or findclass(n)then return "еĺ"; + cprojpath := p+fio; + fn := f; + CreateDirWithFileName(cprojpath+"resource.tfm"+fio+"abc.tfm"); //Ϣļ + info := array(); + info["name"]:= n; + info["version"]:= "1.2.0"; + info["dir"]:= array(); + mfn := n+"main"; + info["files"]:= array( + mfn:("name":mfn,"type":"form"), + n:("name":n,"type":"tsl") + ); + info["mainform"]:= mfn; + info["time"]:= datetimetostr(now()); + r := FormatTslData(info); + if 1 <> ReWriteString(cprojpath+n+".tpj",r)then + begin + return "޷Ȩ"; + end + //ReWriteString(cprojpath+n+".cmd",format(%% tsl.exe %s.tsl -libpath .\ %%,n)); + r := format(%% //%s +uses tslvcl; // +app := InitializeApplication(); //ý +app.CreateForm(class(%s),fm); // +fm.show(); //ʾ +app.run(); //ʼϢѭ +%%,n,n+"main"); + ReWriteString(cprojpath+n+".tsl",r); + ReWriteString(cprojpath+n+"main.tsf",CreateAForm(n+"main")); + ReWriteString(cprojpath+"resource.tfm"+fio+format("%smain.tfm",n),CreateAtfm(n+"main",n+"main")); + //д뻺 + FProjectCoder.AddProject(n,f); + //ӵlist + FList.AppendItem(array("caption":n,"value":f)); + return 1; + end + function GetAllProjects(); //ù + begin + ls := FProjectCoder.ListProjects(); + return ls; + end + FLinea; + FList; + FDelBtn; + FOpenBtn; + FOnOpenProject; + FDesigner; + FProjectCoder; + +end +type TProjectView = class(TVCForm) //ļ + private + FTreePopUpMenu; + type TMyToolBar=class(TToolBar) + function Create(AOwner);override; + begin + inherited; + end + function WMCOMMAND(o,e):WM_COMMAND;override; + begin + class(TWinControl).WMCOMMAND(o,e); + end + function ContextMenu(o,e);override; + begin + //inherited; + e.skip := true; + end + function DoClick(o,e); + begin + xy := array(0,height+1); + xy := clienttoscreen(xy[0],xy[1]); + if PopupMenu is class(TPopUpmenu)then + begin + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + _wapi.TrackPopupMenu(PopupMenu.Handle,uf,xy[0],xy[1],0,self.Handle,nil); + end + end + end + //**************Ŀ¼ɸѡ*********************************** + FFilter; + FFilterList; + FFilterNodes; + function ShowFilterList(d); + begin + if not FFilterList.visible then + begin + xy := FFilter.clienttoscreen(FFilter.left,FFilter.height); + rec := xy; + rec[2] := xy[0]+FFilter.width; + rec[3] := xy[1]+200; + FFilterList.SetBoundsRect(rec); + FFilterList.Show(SW_SHOWNOACTIVATE); + end + FFilterList.SetData(d); + end + public + function FilterKillFocus(o,e); + begin + if FFilterList.visible then FFilterList.visible := false; + end + function FilterChanged(o,e); + begin + s := o.text; + if s then + begin + s := lowercase(s); + FFilterNodes := array(); + FTree.GetNodesByName(FFilterNodes,s); + if FFilterNodes then + begin + ndsn := array(); + for i,v in FFilterNodes do + begin + ndsn[i] := v.Fname ; + end + return ShowFilterList(ndsn); + end + end + FFilterList.visible := false; + end + function FilterKeyDown(o,e); + begin + cc := e.CharCode; + if cc=13 then + begin + if FFilterList.visible then + begin + FFilterList.visible := false; + o.text := ""; + idx := FFilterList.getCurrentSelection(); + if idx >= 0 then + begin + FTree.SetSel(FFilterNodes[idx]); + end + end + end else + if cc =VK_DOWN then + begin + if FFilterList.visible then + begin + idx := FFilterList.getCurrentSelection(); + ct := length(FFilterNodes); + nidx := (idx+1) mod ct ; + FFilterList.SetCurrentSelection(nidx); + FFilterList.InsureIdxInClient(nidx); + end + end else + if cc=VK_UP then + begin + e.skip := true; + if FFilterList.visible then + begin + idx := FFilterList.getCurrentSelection(); + ct := length(FFilterNodes); + nidx := (idx-1+ct) mod ct ; + FFilterList.SetCurrentSelection(nidx); + FFilterList.InsureIdxInClient(nidx); + end + end + end + function FilterKeyPress(o,e); + begin + cc := e.CharCode; + if cc=95 or (cc>=65 and cc<(65+32)) or (cc>96 and cc<(96+32)) or (cc=8) then + begin + + end + else e.skip := true; + end + //**************Ŀ¼ɸѡ*********************************** + //////////////////캯////////////////////////////// + function Create(AOwner);override; + begin + inherited; + minmaxbox := false; + FDesigner := AOwner; + //visible := false; + onclose := thisfunction(CloseHidden); + WsPopup := true; + WsSysMenu := true; + WsSizeBox := true; + caption := "ļ"; + rc := _wapi.GetScreenRect(); + left := 20; + top := 150; + width := 300; //350 + height := max(400,rc[3]-200); + FInput := new TNameInput(self); + FInput.visible := false; + FInput.parent := self; + FTslEditer := new TTslEditer(AOwner); + FTslEditer.FExecuteEditer.cannotadd := true; + FTslEditer.FExecuteEditer.onsaveclk := function(o,e) + begin + SaveProjInfo(); + end + FTslEditer.ReadOnlyDirs := array(GetVCLdir()); + fio := ioFileseparator(); + {$ifdef linux} + bpath := ".vcl/tsl/"; + {$else} + bpath := TS_GetUserProfileHome(); + {$endif} + FTslEditer.TslCacheDir := bpath+"designer"+fio+"cmpCaches"; + FCodeblockPath := bpath+"editer"+fio+"BlockManager.tsm"; + if 1=importfile(ftstream(),"",FCodeblockPath,blockd)and blockd and ifarray(blockd)then + begin + class(TTSLCompletion).FCodeBlocks := blockd; + end + if importfile(ftstream(),"",bpath+"editer"+fio+"tabwidpath.tsm",wdtd)=1 and(wdtd>0)then + begin + FTslEditer.TabWidth := wdtd; + end + if 1=Importfile(ftstream(),"",bpath+"editer"+fio+"tslformat.tsm",FMTDATA)and ifarray(FMTDATA)then + begin + FTslEditer.SetCodeFormatInfo(FMTDATA); + end + FTslEditer.OnFormCodeSave := function(o,e) + begin + if FOpendFormTSFfilename then FDesigner.EditerCodeChanged(); + end + //FTslEditer.Parent := AOwner; + FTmfParser := new TTmfParser(); + FTslParser := new tslparser(); + FTreeTool := new TMyToolBar(self); + FTreeTool.parent := self; + imgs := New TControlImageList(self); + EditToolBmps := array(); + for i,v in GetToolBtns() do + begin + bmp := new TBitmap(); + bmp.ReadVCon(HexFormatStrToTsl(v)); + imgs.AddBmp(bmp); + EditToolBmps[i]:= bmp; + btn := new TToolButton(self); + btn.caption := i; + btn.ImageId := imgs.ImageCount-1; + btn.parent := FTreeTool; + btn.Onclick := thisfunction(ToolClick); + end + FTreeTool.ImageList := imgs; + //**************Ŀ¼ɸѡ*********************************** + FFilter := new TEdit(self); + FFilterList := new TListBox(self); + FFilterList.color := 0xdcF8ff; + FFilterList.visible := false; + FFilterList.WsPopUp := TRUE; + FFilterList.parent := FFilter; + FFilter.Align := alTop; + FFilter.parent := self; + FFilter.OnKeyPress := thisfunction(FilterKeyPress); + FFilter.onkeydown := thisfunction(FilterKeydown); + FFilter.OnChange := thisfunction(FilterChanged); + FFilter.onSetFocus := thisfunction(FilterChanged); + FFilter.onKillFocus := thisfunction(FilterKillFocus); + //************************************************************ + FTree := new TFileTree(self); + FTree.Align := alClient; + FTree.Parent := self; + //˵ + fpm := new TPopUpMenu(self); + FTreePopUpMenu := fpm; + bmps := array(); + for i,v in GetTreeIcons() do + begin + bi := new TBitmap(); + bi.ReadVCon(HexFormatStrToTsl(v)); + bmps[i]:= bi; + end + FAddMenu := new TPopUpMenu(self); + FTreeTool.PopUpMenu := FAddMenu; + FAddMenu.bitmap := EditToolBmps[""]; + FAddMenu.Caption := ""; + FSetMainMenu := new TMenu(self); + FSetMainMenu.caption := "Ϊ"; + FSetMainMenu.bitmap := bmps[""]; + FSetMainMenu.OnClick := thisfunction(SetAsMainWind); + FSetEntryMenu := new TMenu(self); + FSetEntryMenu.Caption := "Ϊڽű"; + FSetEntryMenu.bitmap := bmps[""]; + FSetEntryMenu.OnClick := thisfunction(SetAsMainWind); + FDelMenu := new TPopUpMenu(self); + FDelMenu.bitmap := EditToolBmps["ɾ"]; + FDelMenu.Caption := "ɾ"; + FDelMenu.Onclick := thisfunction(DeletCTNode); + FAddMenu.parent := fpm; + FDelMenu.Parent := fpm; + FAddMenuForm := new TMenu(self); + FAddMenuForm.Caption := "Ӵ"; + FAddMenuForm.bitmap := bmps["form"]; + FAddMenuForm.parent := FAddMenu; + FAddMenuPanel := new TMenu(self); + FAddMenuPanel.Caption := ""; + FAddMenuPanel.bitmap := bmps["panel"]; + FAddMenuPanel.parent := FAddMenu; + FAddMenuTsf := new TMenu(self); + FAddMenuTsf.Caption := "Ӻ"; + FAddMenuTsf.bitmap := bmps["tsf"]; + FAddMenuTsf.parent := FAddMenu; + FAddMenuTsl := new TMenu(self); + FAddMenuTsl.Caption := "ӽű"; + FAddMenuTsl.bitmap := bmps["tsl"]; + FAddMenuTsl.parent := FAddMenu; + FAddMenuDir := new TMenu(self); + FAddMenuDir.Caption := "Ŀ¼"; + FAddMenuDir.bitmap := bmps["dir"]; + FAddMenuDir.parent := FAddMenu; + FMoveMenu := new TMenu(self); + FMoveMenu.caption := "ƶ:"; + FMoveMenu.bitmap := bmps["ƶ"]; + FRenameMenu := new TMenu(self); + FRenameMenu.caption := ""; + FRenameMenu.bitmap := bmps[""]; + FRenameMenu.OnClick := thisfunction(DoRename); + FAddMenuForm.OnClick := thisfunction(Add_form); + FAddMenuPanel.OnClick := thisfunction(Add_panel); + FAddMenuTsf.OnClick := thisfunction(Add_tsf); + FAddMenuTsl.OnClick := thisfunction(add_tsl); + FAddMenuDir.OnClick := thisfunction(Add_dir); + FOpenMenu := new TMenu(self); + FOpenMenu.Caption := ""; + FOpenMenu.bitmap := EditToolBmps[""]; + FOpenMenu.OnClick := thisfunction(OpenTreeNode); + FOpenMenu.parent := fpm; + FTree.OnSelChanged := thisfunction(TreeNodeChanged); + FTree.OnDblClick := function(o,e) + begin + //echo "dbclick\r\n"; + OpenTreeNode(); + end + FWrapFolder := new TFolderChooseADlg(self); + FWrapFolder.Caption := "̵Ŀ¼"; + return; + end + + function OpenTreeNode(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + cn := FTree.CurrentNode; + fio := ioFileseparator(); + if cn.FType="dir" then + begin + n := cn.FPath; + CreateDirWithFileName(FCProjectPath+n+fio+"1.txt"); + _wapi.WinExec('cmd.exe /C start "" "'+FCProjectPath+n,1); + end else + begin + OpenFileByName(cn.FName); + end + end + function TreeNodeChanged(o,e); //ڵл + begin + if not FTree.PopUpMenu then return; + it := e.itemnew; + if it then + begin + if it.FType="dir" then + begin + FDelMenu.Enabled := true; + FAddMenu.Enabled := true; + end else + begin + FDelMenu.Enabled := true; + FAddMenu.Enabled := false; + end + if((it.FType="form")and(it.FName <> FMainForm)and(it.FPath()=""))then + begin + FSetMainMenu.parent := FTreePopUpMenu; + end else + begin + FSetMainMenu.parent := nil; + //FAddMenu.visible := false; + end + if(it.FType="tsl")and(it.FName <> FExecEntry)and(it.FPath()="")then + begin + FSetEntryMenu.parent := FTreePopUpMenu; + end else + FSetEntryMenu.parent := nil; + if((it.FType="form")and(it.FName <> FMainForm))or(it.FType="tsl")and(it.FName <> FExecEntry)or(it.FType="tsf")or(it.FType="panel") {or((it.FType = "dir") and it.parent<>FTree.RootNode)}then + begin + FRenameMenu.parent := FTreePopUpMenu; + if CreateMoveDirMenus()then FMoveMenu.parent := FTreePopUpMenu; + else FMoveMenu.parent := nil; + end else + begin + FRenameMenu.parent := nil; + FMoveMenu.parent := nil; + end + end + end + function Add_dir(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + AddDirToCurrentNode(FInput.GetEditV()); + end + end + function DoRename(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + RenameCurrentDir(FInput.GetEditV()); + end + end + function Add_form(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + AddFormToCurrentDir(FInput.GetEditV(1)); + end + end + function Add_panel(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + AddPanelToCurrentDir(FInput.GetEditV(1)); + end + end + function Add_tsf(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + AddTsfToCurrentDir(FInput.GetEditV(1),"tsf"); + end + end + function add_tsl(); + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + if FInput.ShowModal()then + begin + AddTsfToCurrentDir(FInput.GetEditV(1),"tsl"); + end + end + function ToolClick(o,e); // + begin + if not FCProjectPath then return Messageboxa("û","ʾ",0,self); + case o.Caption of + "": + begin + nd := FTree.CurrentNode; + if not(nd)or(nd.FType <> "dir")then return Messageboxa("ѡĿ¼ڵȻ","ʾ",0,self); + FTreeTool.DoClick(FTreeTool,e); + end + "ɾ": + begin + DeletCTNode(); + end + "": + begin + OpenTreeNode(); + end + "": + begin + nd := FTree.CurrentNode; + if nd then + begin + pnd := nd.parent; + idx := pnd.indexof(nd); + nd.MoveUp(); + if idx <> pnd.indexof(nd)then + begin + SaveProjInfo(); + end + end + end + "": + begin + nd := FTree.CurrentNode; + if nd then + begin + pnd := nd.parent; + idx := pnd.indexof(nd); + nd.movedown(); + if idx <> pnd.indexof(nd)then + begin + SaveProjInfo(); + end + end + end else + begin + o.Enabled := false; + end + end + end + function GetFormClassInfo(); //ñ༭ıϢ + begin + return FTslEditer.GetClassInfo(); + end + function ShowEditor(); //ʾ༭ + begin + FTslEditer.Show(SW_SHOWNOACTIVATE); // + _wapi.bringWindowToTop(FTslEditer.Handle); + end + function ShowCurrentFormCode(); + begin + if FOpendFormTSFfilename then FTslEditer.OpenAndGotoFileByName(FOpendFormTSFfilename); + ShowEditor(); + end + function AddAFiled(n); //ӳԱ + begin + if ifstring(n)and FCurrentOpend and(FCurrentOpend["type"]in array("form","panel"))then + begin + FTslEditer.Addfiled(FOpendFormTSFfilename,n); + end + end + function DeleteAFiled(n,nn); //ɾԱ + begin + if ifstring(n)and FCurrentOpend and(FCurrentOpend["type"]in array("form","panel"))then + begin + FTslEditer.Delfiled(FOpendFormTSFfilename,n,nn); + end + end + function AddAFunction(ff); //Ӻ + begin + if ifarray(ff)and ifstring(ff["name"])and FCurrentOpend and(FCurrentOpend["type"] in array("form","panel"))then + begin + s := createtslfunction(ff); + r := FTslEditer.AddFunction(FOpendFormTSFfilename,ff["name"],s); + ShowEditor(); + return r; + end + end + function GoToAFunction(n); + begin + r := FTslEditer.GoToFunction(FOpendFormTSFfilename,n); + ShowEditor(); + return r; + end + function OpenFileByName(n); //ļ + begin + fio := ioFileseparator(); + nopend := FTree.NameInTree(lowercase(n),nil,true); + if nopend then nopend := nopend.FFileInfo; + if not nopend then return 0; + if nopend=FCurrentOpend then + begin + if FCurrentOpend["type"]in array("tsf","tsl","form","panel")then + begin + dir := FCurrentOpend["dir"]; + if dir then dir += fio; + else dir := ""; + FTslEditer.OpenAndGotoFileByName(FCProjectPath+dir+FCurrentOpend["name"]+"."+((FCurrentOpend["type"]in array("tsf","tsl"))?(FCurrentOpend["type"]):("tsf"))); + ShowEditor(); //FTslEditer.Show(); + end + return 0; + end + CloseCurrentEdit(); + FCurrentOpend := nopend; + case FCurrentOpend["type"]of + "tsl","tsf": + begin + dir := FCurrentOpend["dir"]; + if dir then dir += fio; + else dir := ""; + it := FTslEditer.OpenAndGotoFileByName(FCProjectPath+dir+FCurrentOpend["name"]+"."+FCurrentOpend["type"]); + if not it then return FCurrentOpend := nil; + FOpendScriptFileName := FCProjectPath+dir+FCurrentOpend["name"]+"."+FCurrentOpend["type"]; + ShowEditor(); //FTslEditer.Show(); + end + "form","panel": + begin + //class + dir := FCurrentOpend["dir"]; + if dir then dir += fio; + else dir := ""; + it := FTslEditer.OpenAndGotoFileByName(FCProjectPath+dir+FCurrentOpend["name"]+".tsf"); + if not it then + begin + FCurrentOpend := nil; + return messageboxa("ļ","",0,self); + end + classinfo := FTslEditer.GetClassInfo(); + if not(ifarray(classinfo)and classinfo)then + begin + FCurrentOpend := nil; + return messageboxa("Ǵ,߸ļѾ","",0,self); + end + inh := classinfo["inherited"]; + if not(ifarray(inh)and(inh intersect array("tdcreateform","tdcreatepanel")))then + begin + FCurrentOpend := nil; + return messageboxa("Ǵ,߸ļѾ","",0,self); + end + //򿪽 + FOpendFormTSFfilename := FCProjectPath+dir+FCurrentOpend["name"]+".tsf"; + FOpendScriptFileName := FOpendFormTSFfilename; + FDesigner.caption := "TVCL "+FprojName+"->"+FCurrentOpend["name"]; + FCurrentTfmName := FCProjectPath+"resource.tfm"+fio+FCurrentOpend["name"]+".tfm"; + FTmfParser.ScriptPath := FCurrentTfmName; + FTfmComponets := array(); + FTmfParser.GetAllSubObjects(nil,FTfmComponets); + FDesigner.LoadTreeNode(FTmfParser,inh); + FDesigner.EditerCodeChanged(); + //FTslEditer.Show(); + end else + begin + messageboxa("Ŀǰִ֧򿪸ļʽ","ʾ",0,self); + FCurrentOpend := nil; + return; + end + end + end + function OpenMainForm(); // + begin + OpenFileByName(FMainForm); + end + function SetProjectInfo(F); //Ϣ %% + begin + if FOpenProjectFile=F then + begin + if FOpenProjectFile then OpenMainForm(); + return false; // + end + fio := ioFileseparator(); + CloseCurrentEdit(); //浱ǰϢ + FTslEditer.SaveAndClose(); + FTree.ClearTree(); + p := GetPathFromFullName(F,n,t); + FMainForm := nil; + FprojName := ""; + FExecEntry := ""; + FTree.RootDir := ""; + FCProjectPath := ""; + FOpenProjectFile := F; + d := ImportProjectInfo(); + if not ifarray(d)then d := array(); + if d["mainform"]then + begin + FMainForm := d["mainform"]; + FTree.SetFileToNodes(d["files"]); + FTree.InitDirs(d["dir"]); + FTree.RootDir := n; + FCProjectPath := p+fio; + FprojName := n; + FDesigner.caption := "TVCL "+FprojName; + FTree.ProjectNode.Expand(); + FTree.PopUpMenu := FTreePopUpMenu; + end else + begin + FTree.PopUpMenu := nil; + FOpenProjectFile := ""; + messageboxa("򿪹ļ:"+f,"ʾ",0,self); + return; + end + FTslEditer.TslSearchDir := array(p,Getfuncextdir()); + FExecEntry := FprojName; + if d["entryscript"]then + begin + FExecEntry := d["entryscript"]; + end + FTslEditer.setExecuteEditerSetcmdline(d["commandline"]); + OpenMainForm(); //2 + //ѡнڵ 20210413 + mnode := FTree.NameInTree(lowercase(FMainForm),nil,true); + if FTree.CurrentNode <> mnode then + begin + FTree.SetSel(mnode); + end + end + + function SetAsMainWind(o,e); + begin + if o.caption = "Ϊ" then + begin + cn := FTree.CurrentNode; + fn := cn.FName ; + FMainForm := fn; + SaveProjInfo(); + o.parent := nil; + end else + if o.caption = "Ϊڽű" then + begin + cn := FTree.CurrentNode; + fn := cn.FName ; + FExecEntry := fn; + SaveProjInfo(); + o.parent := nil; + end + end + function DeletCTNode(); + begin + cn := FTree.CurrentNode; + if cn.FType="dir" then DeleteCurrentDir(); + else DeleteCurrentFile(); + end + function DeleteCurrentDir(); //ɾǰĿ¼; + begin + cn := FTree.CurrentNode; + if not cn then return; + if cn=FTree.ProjectNode then return Messageboxa("Ŀ¼ɾ","ʾ",0,self); + if IDOK=Messageboxa("ӹƳļ:"+cn.Caption,"ʾ",1,self)then + begin + if FCurrentOpend and FTree.FileNameInCurrentNode(FCurrentOpend["name"])then + begin + CloseCurrentEdit(); + end + if IDOK=Messageboxa("Ƿɾļм:"+cn.Caption,"ʾ",1,self)then + begin + dp := cn.FPath; + DeleteAllFiles(FCProjectPath+dp); + end + FTree.DeleteCurrentNode(); + SaveProjInfo(); + end + end + function DeleteCurrentFile(); //ɾǰļ + begin + nd := FTree.CurrentNode; + if nd then d := nd.FFileInfo; + if not ifarray(d)then return; + fio := ioFileseparator(); + if lowercase(d["name"]+".tsf")=lowercase(FMainForm+".tsf")then return Messageboxa("ڲɾ","ʾ",0,self); + if lowercase(d["name"]+".tsl")=lowercase(FExecEntry+".tsl")then return Messageboxa("ִļɾ","ʾ",0,self); + if IDOK=Messageboxa("ӹƳ:"+d["name"],"ʾ",1,self)then + begin + if FCurrentOpend and FCurrentOpend["name"]=d["name"]then CloseCurrentEdit(); + ml := d["dir"]; + if ifstring(ml)and ml then ml := ml+fio; + else ml := ""; + ft := "tsl"; + if d["type"]in array("panel","form","tsf")then ft := "tsf"; + FTslEditer.CloseScriptByFileName(FCProjectPath+ml+d["name"]+"."+ft); + if IDOK=Messageboxa("Ƿɾļ","ʾ",1,self)then //Ƴļ + begin + case d["type"]of + "form","panel": + begin + FileDelete("",FCProjectPath+ml+d["name"]+".tsf"); + FileDelete("",FCProjectPath+"resource.tfm"+fio+d["name"]+".tfm"); + end + "tsl": + begin + FileDelete("",FCProjectPath+ml+d["name"]+".tsl"); + end + "tsf": + begin + //echo FCProjectPath+ml+d["name"]+"."+d["type"]+"\r\n"; + FileDelete("",FCProjectPath+ml+d["name"]+"."+d["type"]); + end + end; + end + //FTree.DeleteNode(nd); + nd.Recycling(); + SaveProjInfo(); + end + end + function AddDirToCurrentNode(n); //ļ + begin + if not LegalFolderName(n)then return MessageboxA("ֲϷ,","ʾ",0,self); + cn := FTree.CurrentNode; + if not cn then return; + fio := ioFileseparator(); + if cn.parent=FTree.RootNode then + begin + FTree.AddDir(n); + end else + begin + FTree.AddDir(cn.FPath+fio+n); + end + if cn then FTree.InvalidateItem(cn); + SaveProjInfo(); + end + function AddFormToCurrentDir(n); //Ӵ + begin + if not(LegalVariableName(n))then return MessageboxA("ֲϷ,","ʾ",0,self); + if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("ظļ","ʾ",0,self); + ph := FTree.CurrentNode.FPath; + fio := ioFileseparator(); + fn := array("name":n,"type":"form","dir":ph); + cprojpath := FCProjectPath; + if ph then ph += fio; + else ph := ""; + ph := cprojpath+ph+n+".tsf"; + if not(FileExists("",ph))then + begin + r := CreateAForm(n); + ReWriteString(ph,r); + r := CreateAtfm(n,n); + ReWriteString((FCProjectPath+"resource.tfm"+fio+n+".tfm"),r); + end else //Ѿ + begin + FTslParser.ScriptPath := ph; + cc := FTslParser.GetClassAbstract(); + if ifarray(cc)then + begin + inh := cc["inherited"]; + if ifarray(inh)and lowercase(n)=cc["name"]then + begin + if("tdcreateform"=inh[0])and FileExists("",(FCProjectPath+"resource.tfm"+fio+n+".tfm"))then + begin + fn["type"]:= "form"; + end else + if("tdcreatepanel"=inh[0])and FileExists("",(FCProjectPath+"resource.tfm"+fio+n+".tfm"))then + begin + fn["type"]:= "panel"; + end else + begin + fn["type"]:= "tsf"; + end + end else + begin + fn["type"]:= "tsf"; + end + end + end + FTree.SetFileToNode(fn); + SaveProjInfo(); + end + function AddPanelToCurrentDir(n); // + begin + if not LegalVariableName(n)then return MessageboxA("ֲϷ,","ʾ",0,self); + if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("ظļ","ʾ",0,self); + ph := FTree.CurrentNode.FPath; + fio := ioFileseparator(); + fn := array("name":n,"type":"panel","dir":ph); + cprojpath := FCProjectPath; + if ph then ph += fio; + else ph := ""; + ph := cprojpath+ph+n+".tsf"; + if not FileExists("",ph)then + begin + r := CreateAPanel(n); + ReWriteString(ph,r); + r := CreateAtfm(n,n); + ReWriteString((FCProjectPath+"resource.tfm"+fio+n+".tfm"),r); + end else + begin + FTslParser.ScriptPath := ph; + cc := FTslParser.GetClassAbstract(); + if ifarray(cc)then + begin + inh := cc["inherited"]; + if ifarray(inh)and lowercase(n)=cc["name"]then + begin + if("tdcreateform"=inh[0])and FileExists("",(FCProjectPath+"resource.tfm"+fio+n+".tfm"))then + begin + fn["type"]:= "form"; + end else + if("tdcreatepanel"=inh[0])and FileExists("",(FCProjectPath+"resource.tfm"+fio+n+".tfm"))then + begin + fn["type"]:= "panel"; + end else + begin + fn["type"]:= "tsf"; + end + end else + begin + fn["type"]:= "tsf"; + end + end + end + FTree.SetFileToNode(fn); + SaveProjInfo(); + end + function RenameCurrentDir(n); //޸Ŀ¼ + begin + if not LegalVariableName(n)then return MessageboxA("ֲϷ,","ʾ",0,self); + if FTree.NameInTree(lowercase(n),nil,false)then return MessageboxA("ظļ","ʾ",0,self); + CloseCurrentEdit(); + cn := FTree.CurrentNode; + if cn.FType="dir" then return; + fio := ioFileseparator(); + ph := FTree.CurrentNode.FPath; + if ph then ph += fio; + else ph := ""; + fullsouce := 0; + case cn.FType of + "tsf","panel","form": + begin + fllname := FCProjectPath+ph+cn.caption+".tsf"; + fllnname := FCProjectPath+ph+n+".tsf"; + if cn.FType in array("panel","form")then + begin + fullsouce := FCProjectPath+"resource.tfm"+fio+cn.caption+".tfm"; + fullnsouce := FCProjectPath+"resource.tfm"+fio+n+".tfm"; + end + end else + begin + fllname := FCProjectPath+ph+cn.caption+".tsl"; + fllnname := FCProjectPath+ph+n+".tsl"; + end + end + FTslEditer.CloseScriptByFileName(fllname); + if cn.FType in array("tsf","panel","form")then + begin + size := filesize("",fllname); //ȡļС + if 1=readFile(rwraw(),"",fllname,0,size,data)then + begin + s := ParserReplace(data,cn.caption,n); + if s then + begin + if 1 <> ReWriteString(fllname,s)then + begin + return MessageboxA("","ʾ",0,self); + end + end + end + if(cn.FType in array("panel","form"))and fullsouce then + begin + size := filesize("",fullsouce); //ȡļС + if 1=readFile(rwraw(),"",fullsouce,0,size,data)then + begin + s := ParserReplace(data,cn.caption,n); + if s then + begin + if 1 <> ReWriteString(fullsouce,s)then + begin + //return MessageboxA("","ʾ",0); + end + end + end + end + end + if 1=filerename("",fllname,fllnname)then + begin + if fullsouce then + begin + filerename("",fullsouce,fullnsouce); + end + cnifno := cn.FFileInfo; + cnifno["name"]:= lowercase(n); + cn.FFileInfo := cnifno; + cn.caption := n; + SaveProjInfo(); + end else + return MessageboxA("","ʾ",0,self); + end + function AddTsfToCurrentDir(n,t); //ļ + begin + if not LegalVariableName(n)then return MessageboxA("ֲϷ,","ʾ",0,self); + if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("ظļ","ʾ",0,self); + fn := array("name":n,"type":t,"dir":FTree.CurrentNode.FPath); + ph := FTree.CurrentNode.FPath; + fio := ioFileseparator(); + if ph then ph += fio; + else ph := ""; + FTree.SetFileToNode(fn); + cprojpath := FCProjectPath; + ph := cprojpath+ph+n+"."+t; + if not FileExists("",ph)then + begin + if t="tsf" then r := CreateATsf(n); + else r := CreateATsl(n); + ReWriteString(ph,r); + end + SaveProjInfo(); + end + function ShowExeEditer(); + begin + if not FMainForm then + begin + messageboxa("δ","ʾ",0,self); + exit; + end + FTslEditer.ShowExeEditer(); + end + function RunProject(); //й + begin + if not FMainForm then + begin + messageboxa("δ","ʾ",0,self); + exit; + end + saveCurrentEdit(); + scriptname := FCProjectPath+FExecEntry+".tsl"; + //FTslEditer.PopUpAuxiliary(); + if not FTslEditer.visible then FTslEditer.Show(SW_SHOWNOACTIVATE); + it := FTslEditer.OpenScriptByFileName(scriptname); + if it then FTslEditer.ExecutepageItem(it,FScriptHandle); + FScriptHandle := 0; + return; + end + + function debugproject(); + begin + if not FMainForm then + begin + messageboxa("δ","ʾ",0,self); + exit; + end + saveCurrentEdit(); + scriptname := FCProjectPath+FExecEntry+".tsl"; + //FTslEditer.PopUpAuxiliary(); + if not FTslEditer.visible then FTslEditer.Show(SW_SHOWNOACTIVATE); + it := FTslEditer.OpenScriptByFileName(scriptname); + if it then FTslEditer.DebugPageItem(it); + return; + end + + function WrapTo(); + begin + if not FMainForm then + begin + messageboxa("δ","ʾ",0,self); + exit; + end + {$ifdef linux} + messageboxa("linuxϵͳִ֧","ʾ",0,self); + exit; + {$endif} + fio := ioFileseparator(); + if FWrapFolder.opendlg() then + begin + ds := FileList("",FWrapFolder.Folder+fio+"*") ; + if ifarray(ds) then ct := length(ds); + else ct := 0; + if ct>2 then + begin + if IDCANCEL = Messageboxa("ļвΪ,ȷḲļ!\r\nȡ˳,","ʾ",1,self) then + begin + return ; + end + end + CopyUsedTslDllToNewDir(FWrapFolder.Folder+fio+"tsl");//tsl + CopyDirToDir(pluginpath()+".."+fio+"funcext",FWrapFolder.Folder+"\\tsl\\funcext"); //funcext + CopyDirToDir(FCProjectPath[1:length(FCProjectPath)-1],FWrapFolder.Folder+"\\"+FprojName); + s := '"%~dp0\\tsl\\tsl.exe" "%~dp0'+FprojName+"\\"+FExecEntry+".tsl"+'" '+'-libpath "%~dp0'+FprojName+'\\"'; + exename := SysExecName(); + if 1= parseregexpr("\\\\tsl.exe$",exename,"",m1,m2,m3) then + begin + + end else + begin + for i := length(exename) downto 2 do + begin + if exename[i]="\\" then + begin + exename := exename[1:i]+"tsl.exe"; + break; + end + end + filecopy("",exename,"",FWrapFolder.Folder+"\\tsl\\tsl.exe",false); + end + ReWriteString(FWrapFolder.Folder+"\\start.cmd",s); + _wapi.WinExec('cmd.exe /C start "" "'+FWrapFolder.Folder,1); + //echo "copyfolder:",filecopy("",pluginpath()+"..\\funcext","",FWrapFolder.Folder+"\\tsl\\funcext",false); + //Ŀ¼ + //echo FWrapFolder.Folder,"\r\n"; + end + end + function CopyDirToDir(d1,d2); + begin + fio := ioFileseparator(); + for i,v in FileList("",d1+fio+"*") do + begin + vn := v["FileName"]; + if vn="." or vn=".." then continue; + if pos("D",v["Attr"]) then //Ŀ¼ + begin + CopyDirToDir(d1+fio+vn,d2+fio+vn); + end else + begin + fn := d2+fio+vn; + CreateDirWithFileName(fn); + filecopy("",d1+fio+vn,"",fn,0) + end + end + end + function StopProject(); //ֹͣ + begin + r := 1; + if FScriptHandle then + begin + SysTerminate(r,FScriptHandle); + end + FScriptHandle := 0; + end + function OpenEditer(); //򿪱༭ + begin + //FTslEditer.Show(); + ShowEditor(); + end + function saveCurrentEdit(); //ڱ༭ + begin + if FCurrentOpend then + begin + case FCurrentOpend["type"]of + "form","panel": + begin + //tfm + if FCurrentTfmName then + begin + tfm := FDesigner.TreeNode2tfm(lib,items); + ReWriteString(FCurrentTfmName,tfm); + end + end + end; + FTslEditer.SaveFileByName(FOpendScriptFileName); + end + end + function CloseCurrentEdit(); //رյǰı༭ + begin + if FCurrentOpend then + begin + saveCurrentEdit(); + //FTslEditer.CloseEditor(); + FDesigner.caption := "TVCL "+FprojName; + FDesigner.UnLoadTreeNode(); + class(TDComponent).TemporaryNotName := array(); + FCurrentOpend := nil; + FOpendFormTSFfilename := nil; + FOpendScriptFileName := nil; + end + end + private + FMoveMnus; + FMoveMenu; + + function MoveCurrentFileto(o,e); + begin + nd := FTree.CurrentNode; + if nd then + d := nd.FFileInfo; + cp := nd.caption; + fio := ioFileseparator(); + if not ifarray(d) then return ; + if lowercase(d["name"]+".tsf") = lowercase( FMainForm+".tsf") then return Messageboxa("ڲƶ","ʾ",0,self); + if lowercase(d["name"]+".tsl") = lowercase( FExecEntry+".tsl") then return Messageboxa("ڲƶ","ʾ",0,self); + ndr := (o.caption="<Ŀ¼>")?"":(o.caption+fio); + if IDOK=Messageboxa("ƶļ:"+d["name"]+" Ŀ¼ "+ (ndr?ndr:"Ŀ¼"),"ʾ",1,self) then + begin + if FCurrentOpend and FCurrentOpend["name"] = d["name"] then CloseCurrentEdit(); + ml := d["dir"]; + if ifstring(ml) and ml then ml := ml+fio; + else ml := ""; + ft := "tsl"; + case d["type"] of + "panel","form","tsf": + begin + ft := "tsf"; + end + end ; + if FCProjectPath+ml+d["name"]+"."+ft=FCProjectPath+ndr+d["name"]+"."+ft then return ; + FTslEditer.CloseScriptByFileName(FCProjectPath+ml+d["name"]+"."+ft); //رձ༭ļ + CreateDirWithFileName(FCProjectPath+ndr+fio+d["name"]+"."+ft); + if 1=filerename("",FCProjectPath+ml+d["name"]+"."+ft,FCProjectPath+ndr+d["name"]+"."+ft) then + begin + nd.Recycling(); + SaveProjInfo(); + //ƶɹ + FTree.SetSel(o._tag); + case d["type"] of + "form": + begin + AddFormToCurrentDir(cp); + end + "panel": + begin + AddPanelToCurrentDir(cp); + end + "tsf": + begin + AddTsfToCurrentDir(cp,"tsf"); + end + "tsl": + begin + AddTsfToCurrentDir(cp,"tsl"); + end + end; + SaveProjInfo(); + end + + //FTree.DeleteNode(nd); + + end + end + function GetDirNodes(nd,r); + begin + if not ifarray(r) then r := array(); + if not nd then return ; + for i := 0 to nd.ItemCount-1 do + begin + tnd := nd.GetNodeByIndex(i); + if tnd.FType="dir" then + begin + r[length(r)] := array(tnd.FPath(),tnd); + GetDirNodes(tnd,r); + end + end + end + function CreateMoveDirMenus(); + begin + ds := array(); + rnd := FTree.RootNode.GetNodeByIndex(0); + GetDirNodes(rnd,ds); + if not ifarray(FMoveMnus) then FMoveMnus := array(); + + if ds then + begin + ds[length(ds)] := array("<Ŀ¼>",rnd); + lends := length(ds); + lengthMenus := length(FMoveMnus); + for i:= length(FMoveMnus) to lends-1 do + begin + FMoveMnus[i] := new Tmenu(self); + end + for i,v in FMoveMnus do + begin + if i FTSLstr then + begin + FTSLstr := v; + FTokens := nil; + end + end + public + function create(); + begin + inherited; + end + function tokens(); + begin + if FTokens then return FTokens; + if not ifstring(FTSLstr)then return array(); + str := binary(FTSLstr); + pos :=-1; + len := length(str); + FTokens := array(); + nk := 0; + vs := ""; + hh := 0; + while true do + begin + pos++; + if pos >= len then break; + v := str[pos]; + if v="%" then + begin + kk := 1; + v1 := str[pos+kk]; + if v1="%" then + begin + pls := "%%"; + while true do + begin + kk++; + if pos+kk >= len then break; + if str[pos+kk]in array(" ","\t","\r","\n")then + begin + if str[pos+kk]="\n" then hh++; + break; + end else + pls += str[pos+kk]; + end + pos += kk; + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv2(str,pls,len,pos,hh); + //vs := findstringv(str,pls,len,pos,nil,hh); //str,f,len,pos,zy,hh + setdata(FTokens,nk,vs,"ַ",pos,hh); + vf := 0; + continue; + end + end + if v='"' then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv(str,'"',len,pos,1,hh); + setdata(FTokens,nk,vs,"ַ",pos,hh); + vf := 0; + end else + if v="'" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv(str,"'",len,pos,1,hh); + setdata(FTokens,nk,vs,"ַ",pos,hh); + vf := 0; + end else + if v='{' then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv(str,'}',len,pos,nil,hh); + lvs := length(vs); + flvs := true; + if lvs>5 then + begin + if vs[1:2]="**" and(vs[3]in array(" ","\t","\r","\n"))and vs[lvs-1:lvs]="**" and(vs[lvs-2]in array(" ","\t","\r","\n"))then + begin + flvs := false; + vv := trim(vs[3:lvs-2]); + if vs[3]="\n" then hh++; + setdata(FTokens,nk,vv,"˵",pos,hh); + if vs[lvs-2]="\n" then hh++; + vs := ""; + end + end + if flvs then setdata(FTokens,nk,vs,"˵0",pos,hh); + vf := 0; + end else + if v="#" then + begin + pos++; + vi := str[pos]; + if vi="!" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv(str,'\n',len,pos,nil,hh); + setdata(FTokens,nk,vs,"˵2",pos,hh); + vf := 0; + end else + begin + pos--; + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + setdata(FTokens,nk,v,"ָ",pos,hh); + vf := 0; + end + end else + if v="/" then + begin + pos++; + vi := str[pos]; + if vi="/" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + vs := findstringv(str,'\n',len,pos,nil,hh); + setdata(FTokens,nk,vs,"˵2",pos,hh); + vf := 0; + end else + begin + vs += v; + pos--; + end + end else + if v='(' then + begin + pos++; + vi := str[pos]; + if vi="*" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + pos++; + while pos <= len do + begin + vi := str[pos]; + if vi="\n" then hh++; + if pos3 then + begin + if vs[1]="*" and(vs[2]in array(" ","\t","\r","\n"))and vs[lvs]="*" and(vs[lvs-1]in array(" ","\t","\r","\n"))then + begin + flvs := false; + vv := trim(vs[2:lvs-1]); + if vs[2]="\n" then hh++; + setdata(FTokens,nk,vv,"˵",pos,hh); + if vs[lvs-1]="\n" then hh++; + vs := ""; + end + end + if flvs then setdata(FTokens,nk,vs,"˵1",pos,hh); + //********************************************************* + vf := 0; + end else + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos-1,hh); + setdata(FTokens,nk,v,"ǰ",pos,hh); + pos--; + continue; + end + end else + if v=")" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + setdata(FTokens,nk,v,"",pos,hh); + end else + if v="\t" then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + if vf then continue; + vf := 1; + setdata(FTokens,nk,v,"ո",pos,hh); + end else + if v=" " then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + if vf then continue; + vf := 1; + setdata(FTokens,nk,v,"ո",pos,hh); + end else + if v='\n' then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + hh++; + if vf then continue; + vf := 1; + setdata(FTokens,nk,v,"",pos,hh); + end else + if v='\r' then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + if vf then continue; + vf := 1; + setdata(FTokens,nk,v,"س",pos,hh); + end else + if v in array(",",";",".","]","[",":","=","!")then + begin + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + setdata(FTokens,nk,v,"ָ",pos,hh); + end else + begin + vs += v; + end + end + if length(vs)then setdata(FTokens,nk,vs,"",pos,hh); + return FTokens; + end + property tslstr read FTSLstr write SetTSLstr; +end +type tslparser = class(tslparserbase) +{** + @explan(˵) tsl %% +**} + private + FTokener; + FTokens; + FCurrentPos; + FTokenLen; + FScriptPath; + function SetScriptPath(v); + begin + size := filesize("",v); //ȡļС + readFile(rwraw(),"",v,0,size,data); + SetScript(data); + end + function SetScript(v); + begin + if FTokener.tslstr <> v then + begin + FTokener.tslstr := v; + FTokens := FTokener.tokens(); + if FTokens then FTokenLen := length(FTokens)-1; + FTokenLen :=-1; + end + end + function tkopok(); + begin + return FCurrentPos>0 and FCurrentPos= 0 then FCurrentPos -= n; + else FCurrentPos--; + end + function btoken(tk,tp,pos,n); + begin + bpos(n); + r := ctoken(tk,tp,pos); + return r; + end + function GetScript(); + begin + return FTokener.tslstr; + end + public + function create(); + begin + inherited; + FTokener := new tsltoken(); + end + //type beg end name + function GetClassAbstract(); + begin + {** + @explan(˵) class ĻϢ %% + @return(array) "name","inherited","uses" Ϣ %% + **} + if not Tokens then array(); + FCurrentPos := 0; + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then return array(); + if tk="type" and tp <> TT_STR then + begin + r := array(); + ctoken(tk,tp,pos); + if tp=TT_IDE then + begin + r["name"]:= tk; + ctoken(tk,tp,pos); + if tk <> "=" then return 0; + ctoken(tk,tp,pos); + if tk <> "class" then return 0; + ctoken(tk,tp,pos); + inh := array(); + if tk="(" then + begin + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then break; + if tk=")" then break; + if tk="," then continue; + else inh[length(inh)]:= tk; + end + r["inherited"]:= inh; + end + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then break; + if tk="uses" and tp <> TT_STR then + begin + ru := array(); + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then break; + if tk="," then continue; + if tk=";" then break; + ru[length(ru)]:= tk; + end + r["uses"]:= ru; + break; + end + end + return r; + end + end else + return array(); + end + end + function GetClassInfo(fi); + begin + {** + @explan(˵) classϸϢ %% + @param(fi)(bool) ǷclassԱλϢ %% + **} + r := array(); + if not Tokens then return r; + FCurrentPos := 0; + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then exit; + if tk="type" and tp <> TT_STR then break; + end + if tk="type" and tp <> TT_STR then + begin + r["beg"]:= pos; + tr := parserclass(fi); + if ifarray(tr)then r union=tr; + r["end"]:= CurrentPos; + return r; + end + return r; + end + function parserclass(fi); + begin + {** + @explan(˵) classϸ %% + @param(fi)(bool) ǷúϢ %% + **} + ctoken(tk,tp,pos); + r := array(); + if tp=TT_IDE then + begin + r["name"]:= tk; + ctoken(tk,tp,pos); + if tk <> "=" then raise ""; + ctoken(tk,tp,pos); + if tk <> "class" then raise ""; + ctoken(tk,tp,pos); + if tk="(" then + begin + pa := array(); + while true do + begin + ctoken(tk,tp,pos); + if tk=")" then break; + if tk <> "," then pa[length(pa)]:= tk; + end + r["inherited"]:= pa; + end else + begin + bpos(); + end + props := array(); + funcs := array(); + funcsinfo := array(); + filed := array(); + priv := "public"; + while true do + begin + ctoken(tk,tp,pos,row); + if ifnil(tk)then break; + if tk in array("private","public","protected")then + begin + priv := tk; + continue; + end + if tk="uses" and tp=TT_IDE then + begin + usb := pos; + pu := array(); + while true do + begin + ctoken(tk,tp,pos); + if tp=TT_IDE then + begin + pu[length(pu)]:= tk; + end else + if tk=";" then break; + end + r["uses"]:= array("row":row,"beg":usb,"end":pos,"info":pu); + end else + if tk="static" and tp=TT_IDE then + begin + if not r["filed"]then r["filed"]:= array(); + sf := parserfiled(); + for i := 0 to length(sf)-1 do + begin + sf[i]["static"]:= true; + sf[i]["staticpos"]:= pos; + sf[i]["priv"]:= priv; + end + filed union=sf; + end else + if tk="function" or tk="procedure" then + begin + bpos(); + bfpos := CurrentPos; + lenf := length(funcsinfo); + tfn := parserfunction(); + if priv="public" then funcs[length(funcs)]:= tfn; + if fi then + begin + funcsinfo[lenf]["name"]:= tfn; + funcsinfo[lenf]["startpos"]:= getTokenPos(bfpos); + funcsinfo[lenf]["endpos"]:= getTokenPos(self.CurrentPos)-1; + funcsinfo[lenf]["row"]:= row; + end + end else + if tk="property" then + begin + props[length(props)]:= parserproperty(); + end else + if tk="class" and tp=TT_IDE then + begin + if priv="public" then funcs[length(funcs)]:= parserfunction(); + end else + if tk=";" then continue; + else if tk="end" and tp=TT_IDE then break; + else if tk="type" then + begin + cr := array(); + cr["type"]:= "class"; + cr["beg"]:= pos; + cr["info"]:= parserclass(fi); + cr["end"]:= CurrentPos; + end else + if tk="type" then break; + else + begin + bpos(); + filed union=parserfiled(priv); + end + end + end + r["prop"]:= props; + r["funcs"]:= funcs; + r["filed"]:= filed; + r["funcsinfo"]:= funcsinfo; + prn := array(); + if filed then prn := filed[:,"name"]; + r["members"]:=(prn union2 funcs)union2 props; + return r; + end + function parsertype(); + begin + ctoken(tk,tp,pos); + tarray := ""; + if tk="array" then + begin + tarray := "array "; + ctoken(tk,tp,pos); + if tk=";" then + begin + return tarray; + end else + if tk="of" then + begin + tarray += "of "; + ctoken(tk,tp,pos); + end + end + return tarray+tk; + end + function parserfiled(priv); + begin + rcount := 0; + r := array(); + while true do + begin + ctoken(tk,tp,pos); + if tk=";" then + begin + if rcount then + begin + r[rcount]["last"]:= true; + end + r[rcount]["end"]:= pos; + return r; + end else + if tk="," then + begin + if rcount>0 then + begin + r[rcount]["nextcomma"]:= pos; + end else + r[rcount]["first"]:= true; + rcount++; + r[rcount]["precomma"]:= pos; + end else + if tk=":" then + begin + tpv := parsertype(); + for i := 0 to length(r)-1 do + begin + r[i]["type"]:= tpv; + end + continue; + ctoken(tk,tp,pos); + tarray := ""; + if tk="array" then + begin + tarray := "array "; + ctoken(tk,tp,pos); + if tk=";" then + begin + for i := 0 to length(r) do + begin + r[i]["type"]:= "array"; + end + return r; + end else + if tk="of" then + begin + tarray += "of "; + ctoken(tk,tp,pos); + end + end + end else + begin + r[rcount]["name"]:= tk; + r[rcount]["beg"]:= pos; + r[rcount]["id"]:= rcount; + r[rcount]["priv"]:= priv; + end + end + return r; + end + function parserproperty(); + begin + r := ""; + while true do + begin + ctoken(tk,tp,pos); + if not r then r := tk; + if tk=";" then return r; + end + return r; + end + function parserfunction(); + begin + ctoken(tk,tp,pos); + ctoken(tk,tp,pos); + fn := ""; + if tk <> "(" then fn := tk; + while true do + begin + if tk="begin" then + begin + //return parserstatement(); + parserstatement(); + break; + end else + if tk="(" then + begin + while true do + begin + ctoken(tk,tp,pos); + if tk=")" and tp <> TT_STR then + begin + break; + end + end + parserfunctionplus(); + break; + end else + if tk=":" then + begin + bpos(); + parserfunctionplus(); + break; + end else + if tk="." then + begin + ctoken(tk,tp,pos); + fn := tk; + end else + if tk=";" then + begin + parserfunctionplus(); + break; + end + ctoken(tk,tp,pos); + end + return fn; + end + function parserfunctionplus(); + begin + ctoken(tk,tp,pos); + if ifnil(tk)then return; + if tk=";" then + begin + parserfunctionplus(); + end else + if tk=":" then + begin + parsertype(); + parserfunctionplus(); + end else + if tk="begin" then + begin + return parserstatement(); + end else + if tk="name" then + begin + ctoken(tk,tp,pos); + end else + if tk in array("virtual","cdecl","stdcall","external","override","overload")then + begin + ctoken(tk,tp,pos); + parserfunctionplus(); + end else + begin + bpos(); + end + end + + function parserstatement(); + begin + while true do + begin + ctoken(tk,tp,pos); + if ifnil(tk)then return; + if tk="end" and tp <> TT_STR then + begin + n := 0; + while true do + begin + n++; + ctoken(tk,tp,pos); + if ifnil(tk)then return; + if tk <> ";" then + begin + bpos(n); + return; + end + end + return array(pos+3); + end else + if tp <> TT_STR and(tk in array("begin","select","sselect", + "mselct","vselect","try","case","update"))then + begin + parserstatement(); + end + end + end + property Script read GetScript write SetScript; + property ScriptPath read FScriptPath write SetScriptPath; + property Tokens read FTokens; + property CurrentPos read FCurrentPos write FCurrentPos; +end +//************************************ + +implementation +//*************б**************************************** +type TDesignerProjectsRecoder = class() //¼ + function Create(); + begin + {$ifdef linux} + bpath := ".vcl/tsl/"; + {$else} + bpath := TS_GetUserProfileHome(); + {$endif} + ph := bpath+"designer"+ioFileseparator()+"ProjectsInfo.ini"; + CreateDirWithFileName(ph); + FIni := new TIniFileExta("",ph); + end + function DeleteProject(n); //ɾ + begin + if ifstring(n)and n then return FIni.EraseSection(n); + end + function ListProjects(); //г + begin + r := FIni.ReadSections(); + rr := array(); + for i,v in r do + begin + rr[i,"name"]:= lowercase(v); + rr[i,"file"]:= FIni.ReadKey(v,"file"); + end + return rr; + end + function AddProject(n,f); //ӹ + begin + return FIni.WriteKey(n,"file",f); //Сд + end + private + FIni; + +end +//**********tsl parser token**************************** +type tslparserbase= class +{** + @explan(˵) tslԽ %% +**} + static TT_IDE; //ʾ + static TT_STR; //ַ + static TT_SYM; //ָ + static TT_OK; + function create(); + begin + if not TT_OK then + begin + TT_IDE := "ʾ"; + TT_STR := "ַ"; + TT_SYM := "ָ"; + TT_OK := true; + end + end + function setdata(ret,nk,vs,tp,idx,hh) // + begin + {** + @explan(˵) + **} + if tp="ո" or tp="س" or tp="" then return; + if tp in array("˵0","˵1","˵2","˵")then + begin + vs := ""; + return; + end + if tp="" then // + begin + vs := lowercase(trim(vs)); + end + //if vs in array("of","array") then tp := "ؼ"; + ret[nk,0]:= vs; + ret[nk,1]:= tp; + if ifnumber(idx)and tp="" then ret[nk,2]:= idx-length(vs); + else if ifnumber(idx)and tp <> "ַ" then ret[nk,2]:= idx; + case tp of + "":ret[nk,1]:= TT_IDE; + "ַ":ret[nk,1]:= TT_STR; + else ret[nk,1]:= TT_SYM; + end; + vs := ""; + ret[nk,3]:= hh; + nk++; + end; + function findstringv2(str,fg,len,pos,hh); + begin + fgl := length(fg); + pfg := 0; + vs := ""; + while pos fg[i2]then break; + pfg := i2; + if pos=len then break; + end + if pfg=fgl then + begin + pos += fgl; + break; + end + vs += vi; + pos++; + end + return vs; + end + function findstringv(str,f,len,pos,zy,hh); + begin + {** + @explan(˵)fβַ + **} + pos++; + vs := ""; + if not(hh >= 0)then hh := 0; + while pos "dir" and ind.FName=n then return ind; + end else + if ind.FName=n then return ind; + if ind.FType="dir" then + begin + r := NameInTree(n,ind,iffile); + if r then return r; + end + end + end + function Create(AOwner);override; + begin + inherited; + ImageList := CreateaImageList(self,FImageIdName); + hasline := true; + FPNode := CreateTreeNode(); + FPNode.Caption := "ǰ"; + FPNode.FType := "dir"; + FPNode.parent := RootNode; + SetSel(FPNode); + end + function GetNodesByName(nds,n); + begin + Rnd := RootNode; + GetLeafNodeByName(Rnd,nds,n); + end + + function GetLeafNodeByName(nd,nds,n); + begin + if not ifarray(nds) then nds := array(); + for i:= 0 to nd.ItemCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + if cnd.FType="dir" then + begin + GetLeafNodeByName(cnd,nds,n); + end else + begin + if pos(n, cnd.FName) then + begin + nds[length(nds)] := cnd; + end + end + end + end + function NodeSelChanged(o,e); //л + begin + it := e.ItemNew; + if it then + begin + if it.FType <> "dir" then + begin + FAddMenu.Enabled := false; + end else + begin + if not it.FName then + begin + FAddMenu.Enabled := false; + FDelMenu.Enabled := false; + end else + begin + FAddMenu.Enabled := true; + FDelMenu.Enabled := true; + end + end + end + end + function InitDirs(ds); //ʼĿ¼ + begin + for i,v in ds do + begin + AddDir(v); + end + FPNode.Expand(); + end + function ClearTree(); + begin + FPNode.RecyclingChildren(); + end + function DeleteCurrentNode(); //ɾڵ + begin + C := CurrentNode; + if not c then return false; + if FPNode=c then return false; + pc := c.parent; + DeleteNode(c); + if pc.ItemCount<1 then setsel(pc); + else setsel(pc.GetNodeByIndex(0)); + c.Recycling(); + end + function GetNodePath(nd); //Ŀ¼ڵpath + begin + if not nd then return ""; + if nd=FPNode then return ""; + p := nd.Parent; + r := ""; + fio := ioFileseparator(); + while p and p <> FPNode do + begin + r := p.Caption+(r?(fio+r):""); + p := p.Parent; + end + return r; + end + function AddDir(s); //Ŀ¼ + begin + if not(ifstring(s)and s)then return false; + fio := ioFileseparator(); + if fio <> "\\" then + begin + s := replacetext(s,"\\",fio); + end else + if fio <> "/" then + begin + s := replacetext(s,"/",fio); + end + rs := str2array(s,fio); + vi := ""; + ci := nil; + pc := FPNode; + for i,v in rs do + begin + if not v then + begin + return ci; + end + ci := AddDirToNode(v,pc); + pc := ci; + continue; + end + return ci; + end + function AddDirToCurrentNode(n); //Ŀ¼ + begin + cn := CurrentNode; + AddDirToNode(n,cn); + end + function AddDirToNode(n,nd); //ڽڵĿ¼ + begin + if not ifstring(n)then return nil; + if not nd then return nil; + if nd.FType <> "dir" then return nil; + lv := lowercase(n); + ci := DirInNode(lv,nd); + if ci then return ci; + ci := CreateTreeNode(); + ci.FType := "dir"; + ci.caption := n; + ci.FName := lv; + ci.parent := nd; + return ci; + end + function GetImageIdByname(n); //ͼ + begin + return FImageIdName[n]; + end + property RootDir read FRootDir write SetRootDir; //Ŀ¼ + property FileCanSel read FFileCanSel write SetFileCanSel; //ļǷѡ + property ProjectNode read FPNode; + private + FImageIdName; + FFileCanSel; + function GetNodeLeafs(nd,fs); //Ҷӽڵ + begin + if nd.ItemCount<1 then + begin + fs[length(fs)]:= nd; + return; + end + for i := 0 to nd.ItemCount-1 do + begin + GetNodeLeafs(nd.GetNodeByIndex(i),fs); + end + end + function SetFileCanSel(v); + begin + FFileCanSel := v; + end + function DirInNode(d,nd); //ļǷڽڵ + begin + for i := 0 to nd.ItemCount-1 do + begin + ci := nd.GetNodeByIndex(i); + if(ci.FName=d)then + begin + return ci; + end; + end + end + function SetRootDir(c); + begin + FPNode.Caption := c; + FRootDir := c; + end + function CreateaImageList(AOwner,imgns); + begin + imgs := New TControlImageList(AOwner); + imgns := array(); + bmp := new TBitmap(); + for i,v in GetIcons() do + begin + bmp.ReadVCon(HexFormatStrToTsl(v)); + imgs.AddBmp(bmp); + imgns[i]:= k; + k++; + end + return imgs; + end + function GetIcons(); + begin + return GetTreeIcons(); + end + FRootDir; + FPNode; +end +function GetTreeIcons(); //õͼ +begin + r := array(); +r["dir"]:="0502000000060400000074797065000203000000696D670006040000006461746 +10002C301000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000015849444154 +484BDD94318A8340144025571052A7509BF429839590CE464825DA0662E301CC0 +1C42282E00162E1016C0541888585827D7A4B0FF037F377D4C8EEC2B23369F6C1 +C7FF3F3A6F661C468037F30F04AAAA8220085F62BBDD42D775F4B5BFF31CEBFB4 +55C2E172E921F0504CFF316ABFA4DC4714CBFFEE4D9E3F71B4EA7134EEA9585A0 +2CCBC56C58C3300CF29C05B66D431004B462878A66812CCB70BFDF69C5469665A +069DA2CA8AA0AD6EB35E63C389FCFE0FBFE2C20C5F178C49C07922441DBB6B340 +D77508C31073561E8F076C361BCC2781288A50D735E6AC5CAF57B02C0B731490F +D5714051B3C381C0E70BBDD304701B9164CD3C4060FC8987DDF8FB900FBFD1EA2 +28C2062B455100B9404750B05AADA0691ADA62C3755DDC911114EC763B5AB2438 +E679EE7B4A202C77168C9C6300CD3F11C4141922468658D344DA7E33922902345 +7E0AAF20A257E69BEE4DBC5900F00106E8BE867C71B1300000000049454E44AE4 +2608200"; +r["form"]:="0502000000060400000074797065000203000000696D670006040000006461746 +100023E01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000D349444154 +484B63F84F6300B6A0E1C1EFFF0E177EFE6738F09D2A186456FDFD5F080BB44F2 +30C5739F9034531084B1EC314C3A60E1983CC845B00139CFFFC0F581004606209 +377EFD9FF9EC0F18E353870D83E591155DF9F20F2C08023017D6DFFF0DB700E61 +36CEAB0611040B10064D8D39FFFC02E8489F95CFEF9BFEBD16FB04FF0A9C38631 +2CA03646B1400DE8556A62AC16C0C29A523C6A01413C6A01413C6A01413C4C2D0 +095F5D8149383E54FA05900AB8F411220DB29C1B04A096426DC0250058D5C2F53 +8A4166A154FAB403FFFF03001D726C72BDB4F7150000000049454E44AE4260820 +0"; +r["panel"]:="0502000000060400000074797065000203000000696D670006040000006461746 +10002ED00000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000008249444154 +484BE5953D0EC0200885BD32377171E06C2E8EDE82E6D9D0C1D80E2DA4D6BEE41 +97F90CF306010672D02A8B50A330B119938C628A5941D80C928C8C27878000D8B +9C73235A08B9901355094AB396E6FD0920A5745C5063EF4A1A3707E08EE6008C4 +AD3FBAC547AFE2EE0891602B8373BF7760DA2EB87D346477D1D20B201A116DBAE +8765266A0000000049454E44AE42608200"; +r["tsf"]:="0502000000060400000074797065000203000000696D670006040000006461746 +100021F03000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000002B449444154 +484BCD95DF4B935118C7FB4BFA23A2B05F8684174A10642534B42E826810DED44 +51078D355110ADD84FDD0D9A6369D5BE9DCD4A63257CE5767BA0D37744B673653 +866D4BCD4CEDDB79CECEBBF6EE7D5D5E24F48107CE737E3CDF739EE79CF73D840 +3E6FF10F8B1BD8B0F4B6918FD716ED4A6BEFD5050A0379AC0A5F6299C691A43B5 +3580DAA108B328AEDA8238DD28A1C23C85E185A498ADCD9E020FDFCFE3D40B098 +373ABA2470D8DD19CC7D282E851A32970B8DECD779CCFC862929D4642151B9B4B +7E17BDE073698D162A01DAF95DD7ACF0945C64E9AA1B9947BD3786DB7D33A2370 +3ADB9D13D2DBC3F280428E7258671E129F1C5D338C9D2B1F17387FB749A7CCA4C +3ED8C2CBC2CBA010A8304F6268FEABF09498024BAA5DE7E35D4CE1323B652E598 +1AD9D5D5EB07CF4F6102A3BFC0A9B5DDD10A36A4EB018144B262B1058F9065DA7 +7661C9A88872BB10572C7E0457D6849723D016FC827B0311E1290925D650CCEEF +DBAC87F2128462B4BA7CCBE049AD9EBBD69CFDC109A43A7A87186B9E5A78BC629 +964C56808EA5EBF40B4FC92D47084FC63FF136A5AAF4E538BC9F53FC45534D72A +13453BA6514452E6E1C139E92A2E7A31863D7942001C3649CB7E94DE40BD045D1 +2C3241DF1D89ED8CB8D33F83E4E636C289751C6702BBBF7877B6D8842CB0BE954 +66A3381BE689C5FF55C1402AD818F38DBEC413431097DF7104A9A0651D9EE82CE +E28237D68D89C5B75CA0CDFF0ED28203353D76941A9CB04F37703BDAD08F9E488 +18746545B47A1EB78C317E8BB3A5165790D83AF291BA4D2DC853A8F91B71F794C +6C8E85B7694DEDA072F7844A80A05D96191DD9A07FB372632F5FA385A60071DF3 +D81230D0378E06ED10C4A4663C79EBAD9DCB058A5664F01C21989E15CCB088A9E +0DE37CEB00AE59BB70DDE6C085576E56780FCA4D12FF4016A2A080CC81FD32FF0 +5072C00FC0687994836D53FED040000000049454E44AE42608200"; +r["tsl"]:="0502000000060400000074797065000203000000696D670006040000006461746 +10002D002000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000026549444154 +484BA596316BF26010C7FD0A4A45E820EAE0AAE22055870E2E4E7E00371571717 +311119DDB8A5014717110071144544429942E56A1ED262E4E2ED6ADA2A0EBBDDE +E51293D4B7BEE9FB8323FC2F77CFFF497289EA40C5D3D313148B45C8E57267239 +FCFFF351E1F1FE1E3E3835712501884C361D0E974FF1D6EB71BAAD52AAD2919BC +BDBDD149DCE57C3EA723EAC964C21597D96C36D0EFF7C1E3F150EF6030381994C +B654AE2E22206830152A914AB7FE7F3F313AEAFAFC1EFF79F0C1E1E1EC860BFDF +73066827C16090953662B1189948068D46830C96CB2567002C160BDCDEDEFE3A7 +03DC9E0F9F99912EFEFEFA45F5F5FCF36FD14D8FF2D47AB1DC17B8F05C3E19033 +DAC0F1C4FEC3E1C01901C9E0EBEB8B0AEAF53A67B4810F16FB67B319670424030 +40B0A85022BED188D46E8743AAC041406269309D2E9342B819797978B21E27038 +E0FEFE9E9580C2C0E974D278C9C1ABFA29E40638D28944829580C2000B42A1102 +BED44A351080402AC0414069148047C3E1F2BED64B359B05AADAC041406994C06 +EC763B2B01F55CAB437E8B2A950ADD36390A552A9540AFD7B312907FAA31D49F6 +8B941B7DB25031C59118541BBDDA6027C277E037E05B07F3C1E73E66820EE44DC +21162C160B3EAD8DD56A45FDF297F5A8BF8F9E96DF0035D88F1B15D15D5D5D413 +29924319D4EA9A0D7EB91D60A6E0CFB47A311678E0638962E978BC47ABDA6D7BD +56AB91D60A4E95CD6683ED76CB99A381F8158DC7E334115EAF17EEEEEEF8F4657 +6BB1D3D547CC9709D66B3C96704688A7061B3D94C05780578D41A373737D06AB5 +685139D298E265E1BD93CFB83CC42953C7B9BF2A2700FE001125FC161DCF24BC0 +000000049454E44AE42608200"; +r[""]:="0502000000060400000074797065000203000000696D670006040000006461746 +10002E001000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017549444154 +5847ED953D4BC3401CC6FD087E23BF84832E8E4E2E82AB88089D05DF8A6341501 +7A122221DAC083AB858284507FB42A4A64A9334689BB6B48FF74F0E43936BE9A5 +8716CC0F1E4A42F2E4D7CBE56E067F4C2C100B4CAF80F5D943BEEC2809750D432 +87092B530BFA5294DF2C2E0ED838404C8986E78D2DAFCCCE4501775DE159AFC8C +8F506023F50E38ECE2834DE0F612689780C22CD03843DED6B1F478ECFECA409D3 +4B241860B10473BC043D61328CEFD08AC3F5FA1D4AC7BD78C09759EDE34F8918F +5060ED5047AED8521AEA1C4BE03AF785C58478225156F6DE4646740F6521F18AF +DF3F0441CFD0A1422F50A0604FA7D3607D81711253DFFFB8F26D0E90095CA6471 +1CB72A9A80698A4B6552F7BE96A910905F07628158C0B6C5A532B1BC874613200 +CB67CEA6CE78B12FEEF092981E5ED2A3F520775A6EFD988060809681F5DAC2675 +ECA60D574645A88B36A4728DADAC01420244CDEC2295B1DC615311EA7AA9B2BD4 +18050E0378905FEBB00F00DEE6C35FA45FA2AE60000000049454E44AE42608200"; +r[""]:="0502000000060400000074797065000203000000696D670006040000006461746 +10002A502000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000023A49444154 +484BCD95DF2F5C4114C7FB5F493DB42F4DF5A912124985344D9AF0E041080F4D9 +AB42A7812CFA40D1AE26715618BAD5DBB6115CBB2586DB17E44AD6A6DFD2E2AC7 +9CE38CDED93B7BF74622F149E661CF3933DFB967BE337B076E98DB23103D3986F +05E14FCDB1B707876CAD1C42414E80887E0A9FB03247DAC56C6B3A10EA8087861 +746B9D2BF5C41508EE6C290B17F83E4179C003D5A1097831E6842783AD5739148 +A8756C01B598587BD753419170D45B739A332125983F48126AA7BE478CF511593 +C0C6E11E15E3A496A5598E5A5332E9A6FA32B199584C0295332354DCB038C3117 +B147FE9A779AE1F618E5C6212C0A2BCE11EFE05E41A8CB52ECF71440F7EF9839E +5A48132D33BACC2450B3E087656147C9EEE95FC81A6C2391D77E97A545DF4C0E5 +11D6E4AA23DE4580EC4A285A37D3439C3D9A22C60A43D3C4F350DDFA7396210A8 +FD3A05F7BADE52416A5FA376600EC7DDCE1AED97AC1FEC52FEE5F8678E5C53205 +9081C690436C53960FE9568A5C4568B70B7D22599E23C02BF3639A3E258FB4635 +D82A8949006FAAF190F10DCA76B5D344BCB156878C9712EBA67F47381223202D9 +9E3ED8293F37F4ACCB82B1DB3E269B9DFFD0E1E8B565ADAB494AD5615F471C41E +F2DD6A5A0A72E41293C0CAFE1F48E9ADA7626C971D7033589FEBEDE6C87FB4873 +C2C1E312962F5D861AF9F7B3AA90E6FB00EAD0032B7F35379AEF37D0E7153DDF4 +5545C25119CEE6AB9CD5F9C41590C4FBC34167954D7914C7E848282041BBA27DD +15556568DC5B6C075B96101800B47754813D0D042980000000049454E44AE4260 +8200"; +r[""] := "0502000000060400000074797065000203000000696D670006040000006461746 +100024402000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001D949444154 +484BB595498BC2401085FDFF7812F4E041DC10455C10978B2737545C5011F1268 +2B8207A52F054C3AB54679249F7C499CC7C50245DD55D2F5DA9A443F4CFBC25F0 +7ABD68B3D9D06432A1ED764BF7FB5D22FEF80A74BB5D8A4422140E875D562A956 +8B95CCA2C33DF0AB45A2D4ED66C3669BFDF8B97F8BED16870AC5AAD8A578F5160 +3A9D7282D56A251E2F2817E6ACD76BF178D10A3C1E0F5ED8EFF7C563067330F77 +2B988C78D7107B55A4DEECC3C9F4FEA743A2C301E8FE97ABDD262B190A885EF4B +368164C964922D9D4E53A552B1C74E5C02B7DB8D0A85C28FDA10C991149D168BC +5E8783C4AC4C22530180CDEAEBD139413EB76BB9D783E7109E47239DE41269311 +CFFB98766D0B9CCF677E8AF97CCED7C3E1209160D802A3D18813A333704577F88 +179CAB06B5D696D816C364BC56291EFCBE5B2A71B74203192C2208071BD5E97A8 +050BA0E51044FD95617C3A9D78920925A0C0BA783C2E230B16180E875A01FCE8B +E4327108D466564C102A954CA53927C3E4F894442467A9480B344ED765BA21621 +559E5EAF272E8BD96CC67EC44D20AE339C1B8A107EBDF8CCF1153B41626CD94FC +059228031FC6A9DDD45BF412700E05787D19F0BA81DA80F35B080CE70022A0209 +E044C3133BEDEB3F2990803F441F7C8E61D93F70A8A40000000049454E44AE426 +08200"; +r["ƶ"] := "0502000000060400000074797065000203000000696D670006040000006461746 +10002F501000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000018A49444154 +484BB555ABAEC24010DD8FA842F109381469834054E010583CDFD0FE018A20491 +A140996104C1D82903A9AA0488346010235F79EC9B49742E963B99CE4B0E93067 +0ECB6C67157D1989C17EBFA7F1784C8EE324745D37A1EFFB92590D6C00B1522A9 +78661D0E170605115A8DBED46B55A8D9ACD264DA753367BA6E7796C32180C4456 +1E2A080216CF66330965A3D3E970DE66B391483928FC4208B1E6E172B9705EBBD +D4EF5E9B957A3D188D6EBB5A82A180093C98473CB10C6402503007979C449ACD7 +EBDCD7EBF55ADDA00C70585073BBDD7EC7E0B1A696C16EB7A3E17048F7FB5D226 +97C6CB05C2E5963DB369DCF6789A681269F4E27FDBF08C711BA56AB45511449F4 +15990670C6731171EEA16D341A1486A1A8898EC7235996C56BA601B6875815C6E +71E4061D334DF1B00782E62BC835EAF27AA5768F7A0A8F8474DC660CC2BFE5853 +CB60B55AF17BF00E2983785C2F160BF9FA73601EA1268F8AF8C2E9F7FB349FCF2 +5451F78CBBBDDEEDFB04330DED27F3219D7FCF98BAC4B5F872F178EAC5F02D10F +9BD147CD71D3BCE20000000049454E44AE42608200"; + return r; +end +type TProgValueList=class(TKeyValueList) //б + function Create(AOwner);override; + begin + inherited; + end + function getItemText(i);override; + begin + r := ""; + it := GetItem(i); + if ifarray(it)then r := " "+it["caption"]+" ("+it["value"]+")"; + return r; + end +end + +type TKeyValueList = class(TListBox) //kvalue list + function Create(AOwner);override; + begin + inherited; + end + function CheckListItem(v);override; + begin + return ifarray(v)and ifstring(v["caption"]); + end + function MouseMove(o,e);override; + begin + inherited; + idx := GetIdxByYpos(e.ypos); + if FCurrentIndex<>idx then + begin + FCurrentIndex := idx; + InValidateRect(nil,false); + end + end + function PaintIdx(idx,rc_,cvs);virtual; + begin + {** + @explan(˵) %% + @param(item)(TCustomListItem) %% + @param(rc)(array) %% + @param(cvs)(tcanvas) %% + **} + inherited; + if idx = FCurrentIndex then + begin + rc := rc_; + rc[2:3]-=1; + cvs.pen.Color := rgb(30, 144, 255); + cvs.draw("Polyline",array(rc[0:1],(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),rc[0:1])); + end + end + + function getItemText(i);override; + begin + r := FitemData[i]; + if ifarray(r) then r := r["caption"]; + if ifstring(r) then return " "+r; + return ""; + end + private + FCurrentIndex; +end +type TNameInput=class(TCustomControl) //ļ + function Create(AOwner);override; + begin + inherited; + WsPopup := true; + WsSysMenu := true; + caption := ""; + WsDlgModalFrame := true; + rc := _wapi.GetScreenRect(); + left :=(rc[2]-rc[0])/2-280; + top :=(rc[3]-rc[1])/2-230; + width := 220; + height := 150; + FEidt := new TEdit(self); + FLabel := new TLabel(self); + FLabel.Caption := ":"; + FBtn := new TBtn(self); + FLabel.SetBoundsRect(array(5,5,200,28)); + FEidt.SetBoundsRect(array(5,35,210,60)); + FBtn.SetBoundsRect(array(100,70,210,100)); + FLabel.parent := self; + FEidt.parent := self; + FBtn.Parent := self; + FBtn.Caption := "ȷ"; + Onclose := thisfunction(CloseEndModalForm); + FBtn.onClick := function(o,e) + begin + Endmodal(1); + end + FEidt.OnKeyUp := function(o,e) + begin + if ssCtrl in e.shiftstate then + begin + if e.CharCode=Ord("A")then + begin + sellAllText(); + e.skip := true; + end + end + end + FEidt.OnKeyPress := function(o,e) + begin + if e.wparam=13 then + begin + e.skip := true; + FBtn.Click(); + end + end + end + function sellAllText(); + begin + FEidt.SetSel(0,length(FEidt.text)); + end + function SetLabelCaption(c); + begin + FLabel.Caption := c; + end + function ShowModal();override; + begin + FEidt.SetFocus(); + SetWndPostWithMouse(self); + return inherited; + end + function SetBtnCaption(c); + begin + FBtn.Caption := c; + end + function GetEditV(f); + begin + r := FEidt.text; + if f then return lowercase(r); + return r; + end + private + FEidt; + FLabel; + FSelect; + FBtn; + FOnBtnClk; +end + +type TProjectAddDlg=class(TCustomControl) //ļ + function Create(AOwner);override; + begin + inherited; + WsPopup := true; + WsSysMenu := true; + caption := ""; + rc := _wapi.GetScreenRect(); + left :=(rc[2]-rc[0])/2-280; + top :=(rc[3]-rc[1])/2-230; + width := 320; + height := 150; + FEidt := new TEdit(self); + FLabel := new TLabel(self); + FLabel.Caption := ":"; + FSelect := new TCombobox(); + FSelect.AppendItems(array("dir","tsf","form","panel","tsl")); + FSelect.ItemIndex := 2; + FBtn := new TBtn(self); + FLabel.SetBoundsRect(array(5,5,200,28)); + FEidt.SetBoundsRect(array(5,35,200,60)); + FSelect.SetBoundsRect(array(215,35,296,60)); + FBtn.SetBoundsRect(array(150,70,250,100)); + FLabel.parent := self; + FEidt.parent := self; + FSelect.parent := self; + FBtn.Parent := self; + FBtn.Caption := "ȷ"; + Onclose := thisfunction(CloseEndModalForm); + FBtn.onClick := function(o,e) + begin + Endmodal(1); + end + end + function SetLabelCaption(c); + begin + FLabel.Caption := c; + end + function SetBtnCaption(c); + begin + FBtn.Caption := c; + end + function GetSelectv(); //ѡеֵ + begin + return FSelect.getCurrentItemText(); + end + function GetEditV(); + begin + return FEidt.text; + end + //property OnBtnClk read FOnBtnClk write FOnBtnClk; + private + FEidt; + FLabel; + FSelect; + FBtn; + FOnBtnClk; +end +function ReWriteString(fn,d); +begin + if not ifstring(d)then return 0; + als := ""; + if FileExists(als,fn)then + begin + FileDelete(als,fn); + end else + begin + CreateDirWithFileName(fn); + end + spos := 0; + len := length(d); + return writefile(rwraw(),als,fn,spos,len,d); +end + +function CreateAForm(n); +begin +r := format(%% type %s=class(tdcreateform) + uses tslvcl; + function Create(AOwner);override; // + begin + inherited; + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + if v["static"] then continue; + invoke(self,v["name"],nil); + end + end +end +%%,n); + return r; +end +function CreateAPanel(n); +begin +r := format(%% type %s=class(tdcreatepanel) + uses tslvcl; + function Create(AOwner);override;// + begin + inherited; + end + function DoControlAlign();override;//ӿؼ + begin + //ڴСıʱ,úᱻ, + //ͨ clientrect ȡͻС,ӿؼλԼС + //ԼӿؼĶ,Ϳȥ inherited + inherited; + end + function Recycling();override; + begin + inherited; + ci := self.classinfo(); + for i,v in ci["members"] do + begin + if v["static"] then continue; + invoke(self,v["name"],nil); + end + end +end +%%,n); + return r; +end +function CreateAtfm(n,t); //tfm +begin +r := format(%% +object %s1:%s + caption=%s +end +%%,n,t,t); + return r; +end +function CreateATsf(n); //һtsf +begin + r := format(%% function %s(); +begin + echo ""; +end%%,n); + return r; +end +function CreateATsl(n); //һtsf +begin +r := format( +%% //tsl script :%s +%%,n); +return r; +end + +function CloseEndModalForm(o,e); //رģʽ +begin + e.skip := true; + o.Endmodal(0); +end +function CloseHidden(o,e); //ش +begin + e.skip := true; + o.visible := false; + if o._tag is class(tmenu) then o._tag.checked := false; +end +function LegalVariableName(n); //ж +begin + return ifstring(n) and n and (1=ParseRegExpr("^[A-Za-z_]\\w{2,}$",n,v,vp,vl)) and not(lowercase(n) in static TSL_ReservedKeys2()); +end +function LegalFolderName(n); //Ŀ¼ж +begin + return ifstring(n) and n and (1=ParseRegExpr("^[A-Za-z_]\\w{2,}$",n,v,vp,vl)) and (lowercase(n)<>"con"); +end +function createtslfunction(f);//캯 +begin + n := f["name"]; + p := f["param"]; + b := f["body"]; + ps := ""; + if ifarray(p)then + begin + len := length(p); + for i := 0 to len-1 do + begin + v := p[i]; + if ifstring(v)then ps += v; + if i Bmp then + begin + FBitmapA := Bmp; + if FOwner then FOwner.ItemBitmapAChenged(self); + end + end + function SetBitmapB(Bmp); + begin + if FBitmapB <> Bmp then + begin + FBitmapB := Bmp; + if FOwner then FOwner.ItemBitmapBChenged(self); + end + end + FBitmapB; + FBitmapA; + FCaption; + FOwner; + end + type TPage=class(TCustomControl) //ǩ + function Create(AOwner) + begin + Inherited; + FCloseBtn := false; + FPageItems := new TMyarrayB(); + FMultiLine := 1; + FLineHeight := 16; //font.Height+6; + FLines := 0; + FItemIndex :=-1; + FWill_Drag := true; + font := array("height":16,"width":8,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0, + "charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0); + end + function GetPageRect(); //ñǩ + begin + GetClientRect(); + return FPageRect; + end + function PosInCurrentItemSection(xy); // + begin + if not FCurrentITem then return 0; + rc := FCurrentItem.Rect; + if not rc then return 0; + rc1 := rc; + rc1[2]:= rc1[0]+20; + if PointInrect(xy,rc1)then return 1; + rc1 := rc; + rc1[0]:= rc[2]-20; + if PointInrect(xy,rc1)then return 3; + if PointInRect(xy,rc)then return 2; + end + function DoControlAlign();override; + begin + CalcPageItemRect(); + end + function CreateApageItem();virtual; + begin + return new TPageItem(self); + end + function itemcaptionchenged(it); + begin + if GetItemIndex(it)>= 0 then + begin + DoControlAlign(); + InValidateRect(nil,false); + end + end + function ItemBitmapAChenged(it); + begin + if GetItemIndex(it)>= 0 then InValidateRect(it.Rect,false); + end + function ItemBitmapBChenged(it); + begin + if GetItemIndex(it)>= 0 then InValidateRect(it.Rect,false); + end + function FontChanged();override; + begin + FLineHeight := font.Height+6; + DoControlAlign(); + end + function IncPaintLock(); + begin + BeginUpdate(); + end + function DecPaintLock(); + begin + EndUpdate(); + end + function DoEndUpDate();override; + begin + DoControlAlign(); + inherited; + end + function GetClientRect();override; + begin + r := inherited; + FPageRect := R; + r[1]+= FLineHeight * FLines; //FLabelsheight; + FPageRect[3]:= r[1]; + return r; + end + function Paint();override; + begin + dc := Canvas; + ps := PAINTSTRUCT().rcPaint; + //dc.Pen.Color := rgb(180,180,100); + dc.Pen.Color := rgb(250,250,250); + dc.Pen.Width := 1; + dc.font := font; + for i := 0 to FPageItems.Length()-1 do + begin + it := FPageitems[i]; + rc := it.Rect; + if not rc then continue; + if Intersectrect(it.Rect,ps)then + begin + if FItemIndex=i then + begin + //dc.Brush.Color := rgb(244,205,205); + dc.Brush.Color := 0xFa901E; + end else + begin + dc.Brush.Color := rgb(238,238,228) //rgb(244,244,244); + end + dc.draw("roundrect",array(rc[0:1],rc[2:3],array(5,5))); + if it.BitmapB then + begin + rc1 := rc; + rc1[0]:= rc[2]-20; + rc1[2]-= 2; + rc1[1]+= 4; + rc1[3]-= 4; + dc.Stretchdraw(rc1,it.BitmapB); + end + if it.BitmapA then + begin + rc1 := rc; + rc1[2]:= rc1[0]+20; + rc1[0]+= 2; + rc1[2]-= 2; + rc1[1]+= 2; + rc1[3]-= 2; + dc.Stretchdraw(rc1,it.BitmapA); + end + rc[0]+= 20; + dc.DrawText(it.caption,rc,DT_nOPREFIX .| DT_LEFT .| DT_SINGLELINE .| DT_VCENTER); + end + end + if FCloseBtn and((FPageItems.Length()>0))then + begin + Closebmp(); + rc := ClientRect; + FBmpClose.Draw(dc,rc[2]-25,3,SRCAND); + //rc := ClientRect; + //rc := array(rc[2]-25,1,rc[2]-1,19); + //dc.Stretchdraw(rc,FBmpClose); + end + end + function SetSel(it); + begin + idx := GetItemIndex(it); + if idx >= 0 and idx <> FItemIndex then + begin + ItemIndex := idx; + end + end + function CloseAllItem(it); + begin + FItemINdex :=-1; + FCurrentITem := nil; + saveit := nil; + for i,v in FPageItems.Data do + begin + if v=it then + begin + saveit := it; + continue; + end + end + FPageItems.Splice(0,FPageItems.Length()); + if saveit then + begin + FItemINdex := 0; + FCurrentITem := it; + FPageItems.push(it); + end + //InValidateRect(nil,false); + DoControlAlign(); + InValidateRect(nil,false); + end + function DeleteItemByIndex(idx);virtual; + begin + if idx >= 0 and idx= 0 and FItemIndex <> idx then + begin + if FItemIndex=0 then + begin + e._Tag := FPageitems[idx]; + callDatafunction(fOnbmpbclick,o,e); + idx := GetItemIndex(FCurrentItem); + ItemIndex := idx; + return ; + end + end + if e.shiftdouble() then //½ + begin + idx := GetItemIndexByPos(e.pos); + if idx=-1 then + begin + callDatafunction(OnDblClick,o,e); + end + return ; + end + if e.button=mbLeft then + begin + cidx := posinitembmpb(e.pos); + if cidx>=0 then + begin + e._Tag := FPageitems[cidx]; + callDatafunction(fOnbmpbclick,o,e); + idx := GetItemIndex(FCurrentItem); + ItemIndex := idx; + return ; + end + end + idx := GetItemIndexByPos(e.pos); + itemindex := idx; + FCloseBtnClicked := false; + if e.button=mbLeft and idx >= 0 then + begin + nxy := clienttowindow(e.xpos,e.ypos); + if FCanDraged and FWill_Drag then + begin + IncPaintLock(); + FWill_Drag := false; + FIs_Draging := true; + CreateImageList(); + _wapi.ImageList_BeginDrag(FDRageimglist,0,12,12); + FNot_DragLive := true; + //_wapi.ImageList_DragEnter(self.Handle,nxy[0],nxy[1]); + crect := GetPageRect(); + ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3])); + _wapi.clipcursor(ps); + end + end else + begin + rc := ClientRect; + rc := array(rc[2]-25,1,rc[2]-1,19); + if PointInRect(e.pos,rc)then + begin + FCloseBtnClicked := true; + end + end + FCanDraged := true; + return inherited; + //if 3=PosInCurrentItemSection(e.pos) then FCurrentITem.Caption := datetimetostr(now()); + end + FCanDraged; //ʾ޸ĺʾdrage + function PostInCloseRect(ps); + begin + rc := ClientRect; + rc := array(rc[2]-25,1,rc[2]-1,19); + return PointInRect(ps,rc); + end + function GetItemIndexByPos(xy); + begin + for i := 0 to FPageItems.Length()-1 do + begin + if PointInrect(xy,FPageItems[I].Rect)then return i; + end + return -1; + end + function posinitembmpb(xy); + begin + for i := 0 to FPageItems.Length()-1 do + begin + it := FPageItems[I]; + if not it.BitmapB then continue ; + ri := it.Rect; + ri[0] := ri[2]-18; + ri[1]+=2; + ri[3]-=2; + ri[2]-=2; + if PointInrect(xy,ri)then return i; + end + return -1; + end + Function GetItemIndex(it); + begin + for i := 0 to FPageItems.length()-1 do + begin + if it=FPageitems[i]then + begin + return i; + end + end + return -1; + end + function Recycling();override; + begin + FPageItems.Splice(0,FPageItems.Length()); + FOnSelChanged := nil; + FOnSelchanging := nil; + FCurrentItem := nil; + FItemIndex :=-1; + FOnCloseClick := nil; + fOnbmpbclick := nil; + inherited; + end + property CurrentItem read FCurrentItem; + property OnSelChanged read FOnSelChanged write FOnSelChanged; + property OnSelChanging read FOnSelChanging write FOnSelChanging; + property OnCloseClick read FOnCloseClick write FOnCloseClick; + property Onbmpbclick read FOnbmpbclick write fOnbmpbclick; + property MultiLine read FMultiLine write SetMultiLine; + property CloseBtn read FCloseBtn write SetCloseBtn; + property Lines read FLines; + property PageItems read FPageItems; + property ItemIndex read FItemIndex write SetItemIndex; + protected + function CallSelChanged();virtual; + begin + if not OnSelChanged then return false; + e := new tuieventbase(); + callDatafunction(OnSelChanged,self(true),e); + end + function CallSelChanging();virtual; + begin + if not FOnSelchanging then return false; + e := new tuieventbase(); + CallDatafunction(FOnSelchanging,self(true),e); + return e.skip; + end + function CalcPageItemRect(); + begin + li := 0; + cw := Font.Width; + r := class(TCustomControl).ClientRect; + x := 0; + xct := 0; + for i := 0 to FPageitems.Length()-1 do + begin + it := FPageitems[i]; + itwidth := length(it.Caption) * cw+40; + if xct>0 and(r[2]-(FCloseBtn?20:0)) FCloseBtn then + begin + FCloseBtn := nv; + DoControlAlign(); + end + end + function SetItemIndex(idx); + begin + if idx >= 0 and idx FItemIndex then + begin + if CallSelChanging()then return; + FItemIndex := idx; + FCurrentItem := FPageItems[idx]; + InValidateRect(nil,false); + CallSelChanged(); + end + end + FMultiLine; + FLineHeight; + FLines; + FOnSelChanged; + FOnCloseClick; + FOnSelchanging; + function SetMultiLine(); + begin + end + end + type TEditerAuxiliary=class(TPage) // + function Create(AOwner); + begin + inherited; + Caption := "message:"; + Ftimer := new TTimer(self); + Ftimer.Interval := 200; + Ftimer.Ontimer := thisfunction(BdownTimeOut); + Ftimer.Enabled := false; + //FEchoItem := CreateApageItem(); + //FFileFindeItem := CreateApageItem(); + OnSelChanged := thisfunction(OnSelChangedCall); + CloseBtn := true; + end + function WMNCLBUTTONDOWN(o,e):WM_NCLBUTTONDOWN;override; + begin + FIgnoreSize := true; + Ftimer.Enabled := true; + end + function BdownTimeOut(o,e); + begin + if(_wapi.GetAsyncKeyState(VK_LBUTTON).& 0xFF00)>0 then + begin + end else + begin + FIgnoreSize := false; + o.Enabled := false; + p := Parent; + if p then p.DoControlAlign(); + end + end + {function MouseDown(o,e);override; + begin + if CloseBtn then + begin + rc := ClientRect; + rc := rc := array(rc[2]-25,1,rc[2]-1,19); + if PointInRect(e.pos,rc) then + begin + callDatafunction(FOnCloseClick,o,e); + end + end + inherited; + end } + //property OnCloseClick read FOnCloseClick write FOnCloseClick; + function DoControlAlign();override; + begin + if FIgnoreSize then + begin + end + inherited; + rc := ClientRect; + //linux + {$ifdef linux} + rc[0]+= 2; + rc[2]-= 2; + rc[3]-= 2; + {$endif} + if CurrentItem then wnd := CurrentItem.Tag; + if wnd then wnd.SetBoundsRect(Rc); + end + function ShowPopUp(); + begin + if not WSpOPUp then + begin + WSpOPUp := true; + Parent.DoControlAlign(); + end + if not Visible then Visible := true; + end + function MouseDown(o,e);override; + begin + if e.shiftdouble()and e.button()=mbLeft then + begin + WSpOPUp := not WSpOPUp; + Parent.DoControlAlign(); + if not WSpOPUp then + begin + _wapi.SetWindowPos(self.Handle,0,0,0,0,0,SWP_NOMOVE .| SWP_NOSIZE .| SWP_NOREDRAW .| SWP_NOSENDCHANGING); + end + end else + if GetItemIndexByPos(e.pos)>= 0 then + begin + inherited; + end else + if PostInCloseRect(e.pos)then + begin + //echo "------------\r\n"; + inherited; + end else + begin + if WSpOPUp then _send_(WM_SYSCOMMAND,0xF012,0); + end + end + function Recycling();override; + begin + Ftimer := nil; + FEchoWnd := nil; + FFileFindWnd := nil; + FOnCloseClick := nil; + inherited; + //FOnCloseClick := nil; + end + function ShowByTag(tg); //ʾ + begin + its := Pageitems; + for i := 0 to its.Length()-1 do + begin + if its[i].tag=tg then + begin + ItemIndex := i; + //visible := true; + return; + end + end + end + function OnSelChangedCall(o,e); + begin + if not CurrentItem then Caption := "--"; + rc := ClientRect; + its := PageItems; + for i := 0 to its.Length()-1 do + begin + it := its[i]; + if CurrentItem=it then + begin + it.tag.SetboundsRect(rc); + it.tag.Visible := true; + caption := it.Tag.Caption; + end else + it.tag.Visible := false; + end + end + function AddWnd(wnd); + begin + if wnd is class(TWincontrol)then + begin + its := PageItems; + for i := 0 to its.Length()-1 do + begin + it := its[i]; + if it.tag=wnd then return; + end + IncPaintLock(); + it := CreateApAgeItem(); + it.Caption := wnd.Caption; + it.tag := wnd; + wnd.visible := 0; + wnd.Parent := self; + PageItems.Push(it); + if PageItems.Length()=1 then + begin + itemIndex := 0; + end + DecPaintLock(); + end + end + FEchoWnd; + FFileFindWnd; + FOnCloseClick; + private + Ftimer; + FIgnoreSize; + end + type TExecuteEditer=class(TCustomControl) //ִб༭ + Protected + Type TExecuteMemoComp=class(TSynCompletion) + function Create(AOwner); + begin + inherited; + IgnoreCase := false; + end + function PrepareCompletion(c);override; // + begin + //ͨSetCompData + if Not Memo then return; + d := array(); + for i,v in array("FULL_CURRENT_PATH","CURRENT_DIRECTORY","SEARCH_PATH","TSL_EXE") do + begin + d[i,"caption"]:= v; + d[i,"value"]:= v; + d[i,"lvalue"]:= lowercase(v); + cl := length(v); + d[i,"clen"]:= cl; + d[i,"vlen"]:= cl; + end + SetCompData(d); + end + end + type TListBoxb=class(TListBOx) + function Create(AOwner); + begin + inherited; + end + function CheckListItem(it);override; + begin + return ifobj(it); + end + function GetItemText(i);override; + begin + it := GetItem(i); + if it then return it.FCaption; + return ""; + end + function InsureItemVisible(idx); //ƶǰĸ + begin + rc := GetIdxRect(idx); + c := ClientRect; + if rc[1]c[3]then + begin + SetYpos(1+GetYPos()+(rc[3]-c[3]+1)/GetYScrollDelta()); + end + end + function GetItemIndex();virtual; + begin + return inherited; + end + function SetItemIndex(idx);virtual; + begin + inherited; + FListBox.InsureItemVisible(idx); + end + end + type TComboBoxb=class(TCombobox) + function Create(AOwner); + begin + INherited; + end + function CreateAlist();override; + begin + return new TListBoxb(self); + end + end + type TCobItem=class + function Create(d); + begin + FCaption := ""; + FExe := ""; + if not ifarray(d)then return; + FCaption := d["caption"]; + FExe := d["exe"]; + end + FCaption; + FExe; + end + public + function showexeediter(); + begin + FMemo.ExecuteCommand(FMemo.ecGotoXY,array(1,1)); + FMemO.SetFocus(); + show(); + end + function Create(AOwner); + begin + inherited; + WSsYSMenu := true; + WsDlgModalFrame := true; + WsSizeBox := true; + WSpOPUp := true; + FItems := new TMyArrayB(); + caption := "༭ Execute....."; + SetBoundsRect(array(50,50,930,201)); + FMemo := new TSynMemoNorm(self); + FMemo.OnKeyPress := function(o,e) + begin + if 13=e.charcode then + begin + e.skip := true; + doSaveCurrentName(); + end + end + {FMemo.OnKeyDown := function(o,e) + begin + case e.charcode of + VK_DOWN: + begin + e.skip := true; + FChooser.ItemIndex += 1; + end + VK_UP: + begin + e.skip := true; + FChooser.ItemIndex -= 1; + end + end; + end} + + FMemo.Border := true; + FMemo.parent := self; + FChooser := new TComboBoxb(self); //new TEditList(self); + FChooser.ReadOnly := false; + FChooser.parent := self; + FOkBtn := new TBtn(self); + FCancelBtn := new TBtn(self); + FEgnorBtn := new TBtn(self); + cp := new TExecuteMemoComp(self); + FMemo.Completion := cp; + cp.PrepareCompletion(); + OnClose := function(o,e) + begin + e.skip := true; + o.visible := false; + end + FOkBtn.Caption := "/"; + FCancelBtn.Caption := "ɾǰ"; + FEgnorBtn.caption := "ȡ"; + FOkBtn.parent := self; + FCancelBtn.parent := self; + FEgnorBtn.parent := self; + FMemo.parent := self; + FChooser.OnSelChanged := thisfunction(OnChooserChanged); + FCancelBtn.OnClick := thisfunction(DeleteCurrent); + FOkBtn.OnClick := thisfunction(doSaveCurrentName); + FEGnorBtn.OnClick := thisfunction(OnIgnore); + end + function Recycling();override; + begin + inherited; + FMemo := nil; + FChooser := nil; + FCancelBtn := nil; + FOkBtn := nil; + FEgnorBtn := nil; + Fonsaveclk := nil; + end + function DeleteCurrent(); + begin + if length(FChooser.Items)<2 then return ; + FChooser.DeleteItem(FChooser.ItemIndex); + end + function DoControlAlign();override; + begin + if FMemo and FChooser and FCancelBtn and FOkBtn and FEgnorBtn then + begin + r := clientRect; + r1 := r; + r1[3]-= 30; + FMemo.SetBoundsRect(r1); + tp := r1[3]+2; + wd := 200; + x := 50; + FChooser.SetBoundsRect(array(x,tp,x+200,tp+26)); + x += 200; + FCancelBtn.SetBoundsRect(array(x+20,tp,x+20+100,tp+26)); + x += 120; + FOkBtn.SetBoundsRect(array(x+20,tp,x+100,tp+26)); + x += 120; + FEgnorBtn.SetBoundsRect(array(x+20,tp,x+100,tp+26)); + x += 120; + end + end + function OnIgnore(); + begin + idx := FChooser.ItemIndex; + if idx >= 0 then + begin + it := FChooser.GetItem(idx); + FChooser.Editer.Text := it.FCaption; + FMemo.Text := it.FExe; + end + Visible := false; + end + function GetCurrentExuteparams(f); + begin + return ParserCommandLine(GetCurrentExuteString(f)); + end + function getcurrentcommandline(); + begin + idx := FChooser.ItemIndex; + if not(idx >= 0)then return ""; + s := FChooser.GetItem(idx).fexe; + if not ifstring(s)then return ""; + return s; + end + function GetCurrentExuteString(f); //õǰִַ + begin + if not ifstring(f)then return ""; + if not fileexists("",f)then return ""; + idx := FChooser.ItemIndex; + if not(idx >= 0)then return ""; + s := FChooser.GetItem(idx).fexe; + if not ifstring(s)then return ""; + s := replacetext(s,"$(FULL_CURRENT_PATH)",f); + dir := ""; + sp := ioFileseparator(); + for i := length(f)downto 1 do + begin + if f[i]=sp then + begin + dir := f[1:i-1]; + break; + end + end + s := replacetext(s,"$(CURRENT_DIRECTORY)",dir); + s := replacetext(s,"$(SEARCH_PATH)",owner.getlibpathstr()); + s := replacetext(s,"$(TSL_EXE)",gettslexe()); + return s; + end + function doSaveCurrentName(); + begin + Visible := false; + s := FChooser.Editer.Text; + its := FChooser.Items; + len := Length(its); + for i,v in its do + begin + if v.FCaption=s then + begin + v.FExe := FMemo.Text; + return callDatafunction( Fonsaveclk,self,self); + end + end + if cannotadd then return ; + FChooser.InsertItem(new TCobItem(array("caption":s,"exe":FMemo.Text)),0); + FChooser.ItemIndex := 0; + callDatafunction( Fonsaveclk,self,self); + end + function OnChooserChanged(o,e); + begin + idx := o.ItemIndex; + if idx >= 0 then + begin + it := O.GetItem(idx); + FMemo.Text := it.fexe; + end else + FMemo.Text := ""; + FMemo.ClearUndo(); + end + function GetData(); // + begin + r := array(); + its := FChooser.Items; + if not(its)then return r; + r["itemindex"]:= FChooser.ItemIndex; + for i,v in its do + begin + r["items"][i]:= array("caption":v.FCaption,"exe":v.FExe); + end + return r; + end + function SetData(d); // + begin + if ifarray(d)then + begin + SetItems(d["items"]); + FChooser.ItemIndex := d["itemindex"]; + end + end + property Items read FItems Write SetItems; + property onsaveclk read Fonsaveclk write Fonsaveclk; + property cannotadd read FCannotadd write FCannotadd; + private + FCannotadd; + Fonsaveclk; + FMemo; + FChooser; + FCancelBtn; + FOkBtn; + FItems; + FEgnorBtn; + private + function GetItemIndex(); + begin + return FChooser.Items; + end + function SetItems(its); //Ϣ + begin + vs := array(); + for i,v in its do + begin + if ifarray(v)and ifstring(v["caption"])and ifstring(v["exe"])then + begin + vi := new TCobItem(v); + vs[length(vs)]:= vi; + end + end + FChooser.Items := vs; + end + end + type TEditList=class(TComboBox) + function Create(AOwner);override; + begin + inherited; + width := 280; + maxListItemShow := 30; + FMaxCoder := 20; + ReadONly := false; + Editer.OnKeyDown := function(o,e) + begin + case e.charcode of + VK_UP: + begin + ItemIndex -= 1; + e.skip := true; + end + VK_DOWN: + begin + ItemIndex += 1; + e.skip := true; + end + 13: + begin + Calldatafunction(OnEnterUp,self(true),e); + e.skip := true; + end + VK_ESCAPE: + begin + oer := o.owner.owner; + if oer then oer.Visible := false; + end + ord("A"): + begin + if ssCtrl in e.Shiftstate()then + begin + e.skip := true; + o.SetSel(0,length(o.text)); + end + end + end; + end + end + function Recycling();override; + begin + inherited; + FOnEnterUp := nil; + end + function Pushitem(s); + begin + if not ifstring(s)and s then return; + if s in Items then return 0; + insertItem(s,0); + if getItemCount()>FMaxCoder then + begin + deleteItem(FMaxCoder); + end + end + property OnEnterUp read FOnEnterUp write FOnEnterUp; + property MaxCoder read FMaxCoder write FMaxCoder; + private + FMaxCoder; + FOnEnterUp; + end + type TFindWnd=class(TPage) + type TFindBtn=class(TBtn) + function Create(AOwner); + begin + inherited; + left := 425; + width := 160; + height := 25; + end + end + type TFindCheck=class(TCheckBtn) + function Create(AOwner); + begin + inherited; + left := 25; + width := 160; + height := 25; + end + end + function CreateWndInfo(btn,sec); // + begin + r := GetInfo(); + if sec then r["section"]:= sec; + r["btn"]:= btn; + end + function Create(AOwner);override; + begin + inherited; + OnClose := function(o,e) + begin + Parent.EndFind(); + o.visible := false; + e.Skip := true; + end + WsDlgModalFrame := true; + Visible := false; + WsPopUp := true; + WsCaption := true; + WSsYSMenu := true; + //WsSizeBox := true; + caption := ""; + SetBoundsRect(array(300,300,920,680)); + IncPaintLock(); + for i,v in array("","滻","ļ") do + begin + it := CreateApageItem(); + it.Caption := v; + PageItems.Push(it); + end + DecPaintLock(); + lg := 30; + FEdit_Target := new TEditList(self); + FEdit_repace := new TEditList(self); + FEdit_Type := new TEditList(self); + FEdit_dir := new TEditList(self); + FDirChooser := new TFolderChooseADlg(self); + FEdit_dir_btn := new TBtn(self); + flabels := array(); + for i,v in array("Ŀ:"," 滻Ϊ:","ļ:"," Ŀ¼:") do + begin + lb := new TLabel(self); + lb.TextAlign := AL9_CENTERRIGHT; + lb.caption := v; + lb.Top :=(i+1) * lg; + lb.Height := 25; + lb.Left := 20; + lb.Width := 120; + lb.Parent := self; + //lb.border := true; + flabels[i]:= lb; + end + FEdit_Target.left := 140; + FEdit_Target.top := lg; + FEdit_target.parent := self; + FEdit_target.Editer.OnKeyPress := thisfunction(EditerEnter); + FEdit_repace.left := 140; + FEdit_repace.top := lg+lg; + FEdit_repace.parent := self; + FEdit_type.left := 140; + FEdit_type.top := lg+lg+lg; + FEdit_type.Editer.Text := "*.tsf;*.tsl;"; + FEdit_type.parent := self; + FEdit_dir.left := 140; + FEdit_dir.Width := FEdit_dir.Width-20; + FEdit_dir_btn.Caption := ".."; + FEdit_dir_btn.top := lg+lg+lg+lg; + FEdit_dir_btn.Width := 18; + FEdit_dir_btn.left := 140+FEdit_dir.Width+2; + FEdit_dir_btn.height := 24; + FEdit_dir.top := lg+lg+lg+lg; + FEdit_dir.parent := self; + FEdit_dir_btn.OnClick := function(o,e) + begin + if FDirChooser.OpenDlg()then + begin + FEdit_dir.Editer.text := FDirChooser.Folder; + end + end + FBtn_Find := new TFindBtn(self); + FBtn_replace := new TFindBtn(self); + FBtn_Count := new TFindBtn(self); // + FBtn_replaceall := new TFindBtn(self); + FBtn_Find.caption := ""; + FBtn_replace.caption := "滻"; + FBtn_Count.caption := "ȫ"; + FBtn_replaceall.caption := "ȫ滻"; + FBtn_Find.top := lg; + FBtn_Find.parent := self; + FBtn_replace.top := lg+lg; + FBtn_replace.parent := self; + FBtn_replaceall.top := lg+lg+lg; + FBtn_replaceall.parent := self; + FBtn_Find.OnClick := thisfunction(FindBtnClick); + FBtn_replace.OnClick := thisfunction(FindBtnClick); + FBtn_Count.OnClick := thisfunction(FindBtnClick); + FBtn_replaceall.OnClick := thisfunction(FindBtnClick); + FBtn_Count.top := lg+lg+lg+lg; + FBtn_Count.parent := self; + FDirChooser.parent := self; + FCheck_revers := new TFindCheck(self); + FCheck_wrap := new TFindCheck(self); + FCheck_case := new TFindCheck(self); + FCheck_cycle := new TFindCheck(self); + FCheck_reg := new TFindCheck(self); + FCheck_subdir := new TFindCheck(self); + FCheck_gt := new TFindCheck(self); + FCheck_subdir.checked := true; + FCheck_subdir.Left := 425; + FCheck_subdir.top := lg+lg+lg+lg; + FCheck_subdir.Caption := "Ŀ¼"; + FCheck_revers.caption := ""; + FCheck_revers.top := lg * 5; + FCheck_revers.parent := self; + FCheck_wrap.caption := "ȫƥ"; + FCheck_wrap.top := lg * 6; + FCheck_wrap.parent := self; + FEdit_dir_btn.parent := self; + FCheck_case.caption := "ԴСд"; + FCheck_case.Checked := true; + FCheck_case.top := lg * 7; + FCheck_case.parent := self; + FCheck_cycle.caption := "ѭ"; + FCheck_cycle.Checked := true; + FCheck_cycle.top := lg * 8; + FCheck_cycle.parent := self; + FCheck_reg.caption := "ƥ"; + FCheck_reg.Enabled := false; + FCheck_reg.top := lg * 9; + FCheck_reg.parent := self; + FCheck_gt.caption := "\\tתtab"; + FCheck_gt.Checked := false; + FCheck_gt.top := lg * 9; + FCheck_gt.Left := FCheck_reg.width+FCheck_reg.Left+10; + FCheck_gt.parent := self; + FCheck_subdir.parent := self; + FCheck_reg.OnClick := function(o,e) + begin + FCheck_revers.Enabled := not(o.Checked); + FCheck_wrap.Enabled := not(o.Checked); + FCheck_case.Enabled := not(o.Checked); + end + FStatus := new TStatusBar(self); + //FStatus.Align := alNone; + FStatus.Items := array(("text":"","width":700)); + FStatus.Parent := self; + OnSelChanged := thisfunction(DoSelChanged); + ItemIndex := 0; + //SetStatusText(""); + end + function FindBtnClick(o,e); + begin + r := GetInfo(); + r["btn"]:= o.Caption; + Owner.DoFind(r,self); + end + function EditErEnter(o,e); + begin + if e.CharCode=13 then + begin + e.skip := true; + r := GetInfo(); + r["btn"]:= ""; + OWner.DoFind(r,self); + end + end + function GetInfo(); + begin + r := array(); + r["section"]:= CurrentITem.Caption; + s := FEdit_target.Editer.Text; + if FCheck_gt.Checked then + begin + s := Replacestr(s,"\\t","\t"); + end + r["target"]:= s; + s := FEdit_repace.Editer.Text; + if FCheck_gt.Checked then + begin + s := Replacestr(s,"\\t","\t"); + end + r["replace"]:= s; + r["filetype"]:= FEdit_type.Editer.Text; + r["dir"]:= FEdit_dir.Editer.Text; + r["c_revers"]:= FCheck_revers.Checked; + r["c_cycle"]:= FCheck_cycle.Checked; + r["c_wrap"]:= FCheck_wrap.Checked; + r["c_case"]:= FCheck_case.Checked; + r["c_reg"]:= FCheck_reg.Checked; + r["c_dir"]:= FCheck_subdir.Checked; + return r; + end + function SetStatusText(s); + begin + if ifstring(s)then FStatus.SetItemText(s,0); + end + function OpenFind(); + begin + ItemIndex := 0; + end + function OpenReplace(); + begin + ItemIndex := 1; + end + function Show(f);override; + begin + it := Owner.GetCurrentEditer(); + if it then + begin + s1 := it.SelText; + if s1 and length(s1)<20 and not(pos("\n",s1))then + begin + s := s1; + end else + s := it.CaretWords(); + if s then SetFindText(s); + FEdit_target.Editer.SetFocus(); + end + inherited; + end + Function SetFindText(s); //òҵַ + begin + FEdit_target.Editer.Text := s; + FEdit_target.Editer.SetSel(0,length(s)); + end + function SaveCurrentEditer(); //һ + begin + for i,v in array(FEdit_target,FEdit_dir,FEdit_type,FEdit_repace) do + begin + v.PushItem(v.Editer.Text); + end + //if e then e.PushItem(e.Editer.Text); + end + function DoSelChanged(o,e); + begin + if CurrentItem then Caption := CurrentItem.Caption; + case Caption of + "": + begin + for i := 1 to 3 do flabels[i].Visible := false; + FEdit_dir.visible := false; + FEdit_dir_btn.visible := false; + FEdit_type.visible := false; + FEdit_repace.visible := false; + FBtn_replace.visible := false; + FBtn_count.Visible := true; + FBtn_Replaceall.Visible := false; + FCheck_subdir.visible := false; + FCheck_Revers.visible := true; + FCheck_cycle.Visible := true; + end + "滻": + begin + flabels[1].Visible := true; + for i := 2 to 3 do flabels[i].Visible := false; + FEdit_dir.visible := false; + FEdit_dir_btn.visible := false; + FEdit_type.visible := false; + FEdit_repace.visible := true; + FBtn_replace.visible := true; + FBtn_count.Visible := false; + FBtn_Replaceall.Visible := true; + FCheck_subdir.visible := false; + FCheck_Revers.visible := false; + FCheck_cycle.Visible := true; + end + "ļ": + begin + for i := 1 to 3 do flabels[i].Visible := true; + FEdit_dir.visible := true; + FEdit_dir_btn.Visible := true; + FEdit_type.visible := true; + FEdit_repace.visible := true; + FBtn_replace.visible := false; + FBtn_count.Visible := false; + FBtn_Replaceall.Visible := true; + FCheck_subdir.visible := true; + FCheck_Revers.visible := false; + FCheck_cycle.Visible := false; + end + end + end + function DoControlAlign();override; + begin + inherited; + if not FStatus then return; + rc := ClientRect; + rc[1]:= rc[3]-30; + FStatus.SetBoundsRect(rc); + end + function recycling();override; + begin + inherited; + FStatus := nil; + end + function GetHistory(); + begin + r := array(); + r["finds"]:= FEdit_Target.Items; + r["repalces"]:= FEdit_repace.Items; + r["dirs"]:= FEdit_dir.items; + r["findfiletyps"] := FEdit_Type.items; + return r; + end + function SetHistory(d); + begin + if not ifarray(d)then return; + fds := d["finds"]; + if ifarray(fds)then + begin + FEdit_Target.Items := fds; + end + rps := d["repalces"]; + if ifarray(rps)then + begin + FEdit_repace.Items := rps; + end + dirs := d["dirs"]; + if ifarray(dirs)then + begin + FEdit_dir.items := dirs; + end + dirs := d["findfiletyps"]; + if ifarray(dirs)then + begin + FEdit_Type.items := dirs; + end + end + private + FStatus; + FDirChooser; + // + FEdit_Target; + FEdit_repace; + FEdit_type; + FEdit_dir; + FEdit_dir_btn; + FBtn_Find; + FBtn_replace; + FBtn_Replaceall; + FBtn_Count; // + flabels; + FCheck_revers; + FCheck_wrap; + FCheck_case; + FCheck_cycle; + FCheck_reg; + FCheck_subdir; + FCheck_gt; + end + type TListPages=class(TListBox) + function Create(AOwner);override; + begin + inherited; + Visible := false; + WsPopUp := true; + end + function PaintIdx(idx,rc_,cvs);override; + begin + {** + @explan(˵) %% + @param(item)(TCustomListItem) %% + @param(rc)(array) %% + @param(cvs)(tcanvas) %% + **} + inherited; + if idx=getCurrentSelection()then + begin + rc := rc_; + rc[2:3]-= 1; + cvs.pen.Color := rgb(30,144,255); + cvs.draw("Polyline",array(rc[0:1],(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),rc[0:1])); + end + end + function MouseUp(o,e);override; + begin + inherited; + visible := false; + end + function SetData(d);override; + begin + if not ifarray(d)then return; + height := ItemHeight * (1+min(15,length(d))); + x := 10; + for i,v in d do + begin + x := max(x,length(v)); + end + width := font.Width * (x+3); + inherited; + end + function InsureItemVisible(idx); //ƶǰĸ + begin + rc := GetIdxRect(idx); + c := ClientRect; + if rc[1]c[3]then + begin + SetYpos(1+GetYPos()+(rc[3]-c[3]+1)/GetYScrollDelta()); + end + end + function GetSelFileName; + begin + r := GetItem(getCurrentSelection()); + if pos("*",r)then + begin + return r[2:]; + end + return r; + end + function IncIndex(f); + begin + if ifnil(f)then f :=-1; + idx := getCurrentSelection(); + ct := ItemCount; + nidx := idx-f; + if idx=ct-1 then nidx := 0; + else if idx=-1 then nidx := 1; + SetCurrentSelection(nidx); + InsureItemVisible(nidx); + end + end + type tagCOMPOSITIONFORM=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("dwstyle","int",4), + ("ptcurrentpos","intptr",0), + ("rcarea","int[4]",array(0,0,0,0))),nil,nil,1); + return SSTRUCT; + end + public + function create() + begin + inherited create(getstruct(),ptr); + FPonter := new TCPoint(); + _setvalue_("ptcurrentpos",FPonter._getptr_()); + end + property dwstyle index "dwstyle" read _getvalue_ write _setvalue_; + property ptcurrentpos read FPonter; + property rcarea index "rcarea" read _getvalue_ write _setvalue_; + private + FPonter; + end + type TFTSLScriptMemo=class(TSYNmemoNorm) + function Create(AOwner);override; + begin + inherited; + WsDlgModalFrame := true; + FChangedFlag := false; + FChangedLock := false; + Lineinterval := 3; + FCOMPOSITIONFORM := new tagCOMPOSITIONFORM(nil); + font := array("height":18,"width":9,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0, + "charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0); + //134 + //font := array("facename":"Courier New"); + end + function DoCaretPosChanged();override; + begin + if HandleAllocated()then calldatafunction(FOnCaretChanged,self(true),new tuieventbase(0,0,0,0)); + //echo tostn(self.CaretXY); + end + function WMIMESTARTCOMPOSITION(o,e):WM_IME_STARTCOMPOSITION;virtual; + begin + ime := ImmGetContext(self.Handle); + FCOMPOSITIONFORM.ptcurrentpos.cx := 200; + FCOMPOSITIONFORM.ptcurrentpos.cy := 200; + ImmSetCompositionWindow(ime,FCOMPOSITIONFORM._getptr_()); + ImmReleaseContext(self.Handle,ime); + end + {$ifdef linux} + function ImmReleaseContext(); + begin + end; + function ImmGetContext(); + begin + end; + function ImmSetCompositionWindow(); + begin + end; + function ImmSetStatusWindowPos(); + begin + end; + {$else} + function ImmReleaseContext(h:pointer;ime:pointer):integer;stdcall;external "Imm32.dll" name "ImmReleaseContext"; + function ImmGetContext(h:pointer):pointer;stdcall;external "Imm32.dll" name "ImmGetContext"; + function ImmSetCompositionWindow(h:pointer;s:pointer):integer;stdcall;external "Imm32.dll" name "ImmSetCompositionWindow"; + function ImmSetStatusWindowPos(h:pointer;s:pointer):integer;stdcall;external "Imm32.dll" name "ImmSetStatusWindowPos"; + {$endif} + function InvalidateLines(FirstLine,LastLine:integer);override; + begin + //return inherited; + if not HandleAllocated()then return; + if HighLighter is class(TTslSynHighLighter)then + begin + fy :=(FirstLine-TopLine) * TextHeight; + r := ClientRect; + if fyr[3]then return; + r[0]:= GutterWidth; + r[1]:= max(0,fy); + InvalidateRect(r,false); + end else + return inherited; + end + function MouseUp(o,e);override; + begin + inherited; + end + function InsertChars(s);override; + begin + if(s="\r\n")then + begin + y := CaretY; + x := CaretX; + sl := Lines.GetStringByIndex(y-1); + if ifstring(sl)and sl then + begin + ins := ""; + for i := 1 to x-1 do + begin + si := sl[i]; + if si="\t" or si=" " then + begin + ins += si; + end else + break; + end + if ins then + begin + return inherited InsertChars(s+ins); + end + end + end + return inherited; + end + function KeyUp(o,e);override; + begin + e.Result := 1; + if Calldatafunction(FQuckKeys,self,e)then return; + inherited; + end + function ContextMenu(o,e);override; + begin + inherited; + e.skip := true; + end + function SwitchMarkLine(L); //˴ϵ + begin + if not(L >= 0)then + begin + L := self.CaretY-1; + end + it := Lines[L]; + if it then + begin + it.FMarked := not(it.FMarked); + r := ClientRect; + r[2]:= GutterWidth()-1; + InValidateRect(r,false); + if _Tag then _Tag.markline(L,it.FMarked); + end + end + function KeyDown(o,e);override; + begin + e.Result := 0; + qc := Calldatafunction(FQuckKeys,self,e); + if qc then return; + if e.CharCode=VK_F5 then + begin + L := self.CaretY-1; + SwitchMarkLine(L); + return; + end + if e.CharCode=VK_F2 and(ssCtrl in e.shiftState())then + begin + L := self.CaretY-1; + SwitchMarkLine(L); + return; + end + if not(ssCtrl in e.shiftstate())and not(ssShift in e.shiftstate())then + begin + if e.CharCode=VK_F2 then + begin + y := CaretY-1; + len := Lines.length(); + for i := y+1 to len+y-1 do + begin + idx :=(i+len)mod len; + it := Lines[idx]; + if it and it.FMarked then + begin + return ExecuteCommand(ecGotoXY,array(idx+1,1)); + end + end + return; + end + end + inherited; + end + function WMSYSKEYUP(o,e):WM_SYSKEYUP;override; + begin + e.Result := 1; + if CallDatafunction(FQuckKeys,self,e)then return; + inherited; + end + Function WMSYSKEYDOWN(o,e):WM_SYSKEYDOWN;override; + begin + e.Result := 0; + if CallDatafunction(FQuckKeys,self,e)then return; + inherited; + end + function WMSETFOCUS(o,e):WM_SETFOCUS;override; + begin + inherited; + CallDataFunction(FOnTextSetFocus,self(true),e); + end + function DoTextChanged(p);override; + begin + n := Lines.Length(); + ccnt := GutterCharCnt; + nccnt := max(integer(n~10)+3,4); + if ccnt <> nccnt then + begin + GutterCharCnt := nccnt; + end + inherited; + SetChangeFlag(true); + end + function Recycling();override; + begin + FQuckKeys := nil; + FOnTextChanged := nil; + FOnTextSetFocus := nil; + FPageItem := nil; + FOnCaretChanged := nil; + inherited; + end + published + property OnCaretChanged read FOnCaretChanged write FOnCaretChanged; + property PageItem read FPageItem write FPageItem; + property OnTextChanged read FOnTextChanged write FOnTextChanged; //ıı + property QuckKeys read FQuckKeys write FQuckKeys; //ݼ + property ChangedFlag read FChangedFlag write SetChangeFlag; + property ChangedLock read FChangedLock write FChangedLock; + property OnTextSetFocus read FOnTextSetFocus write FOnTextSetFocus; + private + function SetChangeFlag(v); + begin + nv := v?true:false; + if nv <> FChangedFlag then + begin + FChangedFlag := nv; + if FChangedLock then return; + calldatafunction(OnTextChanged,self(true),nv); + end + end + FPageItem; + FChangedLock; + FChangedFlag; + FOnTextChanged; + FOnTextSetFocus; + FQuckKeys; + FCOMPOSITIONFORM; + FOnCaretChanged; + end + type TPageEditerItem=class(TPageItem) + FPageOrderId; //еʹ + FEditer; //༭ + FSynType; + FInitCompletion; + FDebuger; + fisnewfile; + function create(AOwner);override; + begin + inherited; + FSynType := ""; + FEnCode := "ANSI"; + FGetInfoText := ""; + FLastVersion := ""; + FEditer := new TFTSLScriptMemo(AOwner); + FEditer.Visible := false; + FEditer._Tag := self; + end + function Recycling();override; + begin + FDebuger := nil; + inherited; + FEditer.Recycling(); + FEditer := nil; + end + function markline(l,f); //DZ + begin + if FDebuger then + begin + if f then + begin + FDebuger.addbreak(self,l); + end else + begin + FDebuger.removebreak(self,l); + end + end + end + function ScriptPathIs(v); + begin + return filenameIsTheSame(v,FScriptPath); + end + published + property ScriptPath read FScriptPath write SetScriptPath; //ļ + property OrigScriptPath read FOrgScriptPath; + property TslSynText read FTslSynText write FTslSynText; + property LastText read FLastVersion; //µİ汾 + property EnCode read FEnCode; + RepreComple; + FISstm; + ///////////////////////////////////////////////////////// + public + function Addfiled(fld); //ӳԱ + begin + if not FTslParser then return 0; + if not(fld and ifstring(fld))then return; + nfld := lowercase(fld); + nt := str2array(nfld,":"); + nfld := nt[0]; + nfldt := nt[1]; + d := GetClassInfo(); + if not(d and ifarray(d))then return 0; + for i,v in d["filed"] do + begin + if v["name"]=nfld then return 1; + end + crec := GetCreateFunctionRec(d); + if crec then + begin + p := crec[0]; + if ifarray(p)then + begin + FEditer.ExecuteCommand(FEditer.ecGotoXY,p); + FEditer.ExecuteCommand(FEditer.ecString,fld+";\r\n "); + end + end + end + function GetCreateFunctionRec(d); //ò뺯Ϊλ + begin + fi := d["funcsinfo"]; + for i,v in fi do + begin + if v["name"]="create" then + begin + return GetInfoRowCol(v); + end + end + return 0; + end + function Delfiled(fld,nn); //ɾԱ + begin + if not FTslParser then return 0; + if not(fld and ifstring(fld))then return; + if not ifstring(nn)then nn := ""; + nfld := lowercase(fld); + d := GetClassInfo(); + if not(d and ifarray(d))then return 0; + for i,v in d["filed"] do + begin + if v["name"]=nfld then + begin + frec := GetInfoRowCol2(v); + if ifarray(frec[0])and ifarray(frec[1])then + begin + FEditer.ExecuteCommand(FEditer.ecGotoXY,frec[0]); + FEditer.ExecuteCommand(FEditer.ecSelGotoXY,frec[1]); + FEditer.SelText := nn?(nn+";"):""; + end + end + end + end + function GoToFunction(fn); + begin + if not(ifstring(fn))then return false; + nfld := lowercase(fn); + d := GetClassInfo(); + if not ifarray(d)then return 0; + for i,v in d["funcsinfo"] do + begin + if v["name"]=nfld then + begin + crec := GetInfoRowCol(v); + if ifarray(crec)and ifarray(crec[0])then + begin + FEditer.ExecuteCommand(FEditer.ecGotoXY,crec[0]); + end + return true; + end + end + end + function AddFunction(fn,finfo); //Ӻ + begin + if not FTslParser then return 0; + if not(ifstring(fn)and fn and ifstring(finfo))then return 0; + nfld := lowercase(fn); + d := GetClassInfo(); + if not ifarray(d)then return 0; + for i,v in d["funcsinfo"] do + begin + if v["name"]=nfld then + begin + crec := GetInfoRowCol(v); + if ifarray(crec)and ifarray(crec[0])then + begin + FEditer.ExecuteCommand(FEditer.ecGotoXY,crec[0]); + end + return true; + end + end + crec := GetCreateFunctionRec(d); + if crec then + begin + p := crec[1]; + if ifarray(p)then + begin + FEditer.ExecuteCommand(FEditer.ecGotoXY,p); + FEditer.ExecuteCommand(FEditer.ecString,"\r\n"+finfo+"\r\n "); + end + end + return true; + end + function GetLastLoadTime(); //ʱ + begin + return FLastFileTime; + end + function ReGetLastLoadTime(); //»ʱ + begin + fi := FileList("",FScriptPath); + FLastFileTime := fi[0,"Time"]; + return FLastFileTime; + end + function PrePareSave(); //׼ + begin + if not FEditer.ChangedFlag then + begin + if RepreComple then itemPareCompletion(); + return false; + end + if FEditer.ReadOnly then + begin + if RepreComple then itemPareCompletion(); + return false; + end + t := FEditer.Text; + if FLastVersion=t then + begin + FEditer.ChangedFlag := false; + if RepreComple then itemPareCompletion(); + return false; + end + FLastVersion := t; + itemPareCompletion(); + //FEditer.PrePareCompletion(t); //׼Զ + FEditer.ChangedFlag := false; + return true; + end + function itemPareCompletion(); + begin + t := caption; + cp := FEditer.Completion; + if cp then cp.PrePareCompletion(t); + RepreComple := false; + end + function IsTextUTF8(str) + begin + {utf8 + ֽ: 0xxxxxxx + ֽ 110xxxxx 10xxxxxx + ֽ 1110xxxx 10xxxxxx 10xxxxxx + ֽ 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + ֽ 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + ֽ 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + } + // 0 Ϊansi ,1 Ϊutf8 -1 ȷʲô + nBytes := 0; //UFT81-6ֽڱ,ASCIIһֽ + DY := 0; + chr := ""; + bAllAscii := TRUE; //ȫASCII, ˵UTF-8 + for i := 1 to length(str) do + begin + chr := ord(str[i]); + if((chr .& 0x80)<> 0)then + begin // жǷASCII,,˵пUTF-8,ASCII7λ,һֽڴ,λΪ0,o0xxxxxxx + bAllAscii := FALSE; + end + if(nBytes=0)then //ASCII,ӦǶֽڷ,ֽ + begin + if(chr >= 0x80)then + begin + if(chr >= 0xFC and chr <= 0xFD)then nBytes := 6; + else if(chr >= 0xF8)then nBytes := 5; + else if(chr >= 0xF0)then nBytes := 4; + else if(chr >= 0xE0)then nBytes := 3; + else if(chr >= 0xC0)then nBytes := 2; + else return 0; + DY := MAX(nBytes,DY); + nBytes--; + end + end else //ֽڷķֽ,ӦΪ 10xxxxxx + begin + if((chr .& 0xC0)<> 0x80)then return-1; + nBytes--; + end + end; + if(nBytes>0)then //Υ + return-1; + if(bAllAscii)then //ȫASCII, ˵UTF-8 + return 0; + //return 1; + return DY>2; + end + function ToUnicode_big(); + begin + if FEnCode="UCS2-big" then return; + FEnCode := "UCS2-big"; + FEditer.ChangedFlag := true; + FLastVersion := ""; + end + function ToUniocode_little(); + begin + if FEnCode="UCS2-little" then return; + FEnCode := "UCS2-little"; + FEditer.ChangedFlag := true; + FLastVersion := ""; + end + function ToUTF8(); + begin + if FEnCode="UTF8" then return; + FEnCode := "UTF8"; + FEditer.ChangedFlag := true; + FLastVersion := ""; + return; + end + function ToUTF8BOM(); + begin + if FEnCode="UTF8 BOM" then return; + FEditer.ChangedFlag := true; + FEnCode := "UTF8 BOM"; + FLastversion := ""; + end + function ToANSI(); + begin + if FEnCode="ANSI" then return; + FEditer.ChangedFlag := true; + FEnCode := "ANSI"; + FLastversion := ""; + end + function CurrentCodeIsUtf8(); + begin + if FEnCode="ANSI" then + begin + s := FEditer.Text; + try + s := UTF8toansi(s); + FEditer.Text := s; + FEnCode := "UTF8"; + except + end + end + end + function CurrentCodeIsAnsi(); + begin + if FEnCode="UTF8" then + begin + FEnCode := "ANSI"; + end + end + function SetLoadScript(s); //ļ + begin + if not ifstring(s)then return; + strcode := 0; + FEnCode := "ANSI"; + if(length(s)>= 2)and ord(s[1])=0xFE and ord(s[2])=0xFF then //ucs2-big + begin + strcode := 2; + FEnCode := "UCS2-big"; //Ҫת + if length(s)=2 then s := ""; + else + begin + s1 := ""; + setlength(s1,length(s)-2); + for i := 3 to length(s)-1 step 2 do + begin + s1[i-2]:= s[i+1]; + s1[i-1]:= s[i]; + end + s := unicodetomultibyte(s1,936); + end + end else + if(length(s)>= 2)and ord(s[1])=0xFF and ord(s[2])=0xFE then //ucs2-little + begin + strcode := 4; + FEnCode := "UCS2-little"; + if length(s)=2 then s := ""; + else + begin + s := unicodetomultibyte(s[3:],936); + end + end else + if(length(s)>= 3)and ord(s[1])=0xEF and ord(s[2])=0xBB and ord(s[3])=0xBF then + begin + FEnCode := "UTF8 BOM"; + if length(s)=3 then s := ""; + else s := utf8toansi(s[4:]); + strcode := 1; + end + if(0=strcode)then + begin + if IsTextUTF8(s)=1 then + begin + FEnCode := "UTF8"; + strcode := 1; + s := utf8toansi(s); + end + end + FLastVersion := s; + FEditer.Text := s; + FEditer.ExecuteCommand(FEditer.ecGotoXY,array(1,1)); + FEditer.ClearUndo(); + FEditer.ChangedFlag := false; + if not FTslSynText then return; + if not(s)then return; + r := tsl_tokenizeex_2_(s,1); + cs := r["class"]; + if ifarray(cs)and cs[0]then + begin + lcs1 := lowercase(cs[0]); + if lcs1 in array("tdcreateform","tdcreatepanel")then + begin + try + if not FTslParser then FTslParser := new unit(UDesignerProject).tslparser(); #! end + except + end; + return; // + end + end + FTslParser := nil; + end + function GetClassInfo(); //Ϣ + begin + if not FTslParser then return array(); + txt := FEditer.Text; + if txt <> FGetInfoText then + begin + FGetInfoText := txt; + FTslParser.Script := txt; + FGetInfoChace := FTslParser.GetClassInfo(1); + end + return FGetInfoChace; + end + private + FEnCode; + FLastFileTime; + FTslSynText; + function GetInfoRowCol(v); // + begin + rs := PosToRowCol(FGetInfoText,array(v["startpos"]-1,v["endpos"])); + return rs; + end + function GetInfoRowCol2(v); //нβ + begin + rs := PosToRowCol(FGetInfoText,array(v["beg"]-1,v["end"])); + return rs; + end + function PosToRowCol(s,ps); //λû + begin + r := array(); + idx := 0; + pi := ps[idx]; + ri := ci := 1; + for i := 1 to length(s) do + begin + vi := s[i]; + if vi="\n" then + begin + ri++; + ci := 1; + end else + ci++; + if i=pi then + begin + r[idx]:= array(ri,ci); + idx++; + pi := ps[idx]; + end + end + return r; + end + FTslParser; // + FGetInfoChace; //class Ϣ + FGetInfoText; //ı + FLastVersion; //ű + FScriptPath; //· + FOrgScriptPath; //ԭʼ· + function SetScriptPath(v); + begin + sp := ioFileseparator(); + if ifstring(v)then + begin + for i := length(v)downto 1 do + begin + if v[i]=sp then + begin + Caption := v[i+1:]; + break; + end + if v[i]="." then + begin + if lowercase(v[i:])in array(".tsl",".tsf")then FTslSynText := true; + end + end + FScriptPath := v; + FOrgScriptPath := v; + FEditer.Caption := v; + end + end + end + type TPageEditer=class(TPage) //ҳ༭ + function Create(AOwner);override; + begin + inherited; + end + function MouseUp(o,e);override; + begin + inherited; + if e.button()=mbRight then + begin + return CallDatafunction(FPageItemOnRClick,self,e); + end + end + function CallSelChanged();override; + begin + it := Currentitem; + if it then + begin + it.FEditer.SetBoundsRect(self.ClientRect); + it.FEditer.Visible := true; + it.FEditer.SetFocus(); + end + inherited; + end + function CallSelChanging();override; + begin + inherited; + it := CurrentItem; + if it and it.FEditer then it.FEditer.Visible := false; + end + function Recycling();override; + begin + inherited; + FCliper := nil; + FMenu := nil; + FPageItemOnRClick := nil; + end + function DoControlAlign();override; + begin + inherited; + it := CurrentItem; + if it then + begin + it.FEditer.SetBoundsRect(self.ClientRect); + end + end + property PageItemOnRClick read FPageItemOnRClick write FPageItemOnRClick; + private + FPageItemOnRClick; + end + type TTslChmHelp=class + function SearchWord(s); + begin + if not s then return; + pm := format('%s::/%s.htm',FTSLinterpPath+FChmName,s); //>mainwin + HtmlHelpA(GetDesktopWindow(),pm,0,nil); + return; + end + function ShowTslLangChm(); + begin + return HtmlHelpA(GetDesktopWindow(),FTSLinterpPath+FChmName,0,nil); + end + function Create(); + begin + FChmName := "help\\LANGUAGEGUIDE.CHM"; + FTSLinterpPath := ""; + n := pluginpath(); + for i := length(n)-1 downto 3 do + begin + if n[i]="\\" then + begin + FTSLinterpPath := n[1:i]; + break; + end + end + end + property ChmName read FChmName write FChmName; + private + FTSLinterpPath; + FHanle; + FChmName; + end + type TEditerEchoWnd=class(TSynMemoNorm) // + function Create(AOwner);override; + begin + inherited; + FDoLockTime := 0; + FIsLocked := false; + height := 250; + ReadOnly := true; + WsSizeBox := true; + WsSysMenu := true; + OnClose := function(o,e) + begin + o.visible := false; + e.skip := true; + end + m := new TPopUpMenu(self); + m1 := new TMenu(self); + m1.Caption := ""; + m1.parent := m; + {m2 := new TMenu(self); + m2.Caption := "ѡַ"; + m2.Checked := false; + m2.OnClick := function(o,e)begin + o.Checked := not(o.Checked); + self.HighLighter := (o.Checked) ?F_Highlighter :false; + end + m2.Parent := m;} + PopUpMenu := m; + m1.OnClick := function(o,e) + begin + ClearAll(); + AppendString("ctrl+z ֹͣ;ctrl+c ѡ\r\n"); + end; + FProcess := new TCreateProcessA(); + FProcess.BufSize := 1024 * 5; + FProcess.OnEcho := thisfunction(TEchoToString); + AppendString("ctrl+z ֹͣ;ctrl+c ѡ\r\n"); + F_Highlighter := new TSynHighLighter(self); + //Highlighter := new TSynHighLighter(self); + end + function TEchoToString(o,s); + begin + //t := now(); + {if (t-FDoLockTime)>(0.3E-5) then + begin + FDoLockTime := t; + if FIsLocked then + begin + FIsLocked := false; + DecPaintLock(); + end else + begin + FIsLocked := true; + IncPaintLock(); + end + end } + AppendString(s); + //Visible := true; + return true; + end + function Exec(exe,cmd,h); + begin + //AppendString(format('"%s" %s\r\n',exe,cmd)); + self.HighLighter := nil; + AppendString(format('%s %s\r\n',exe,cmd)); + //EndExe(); + r := FProcess.CreateProcessWaitRead(exe,cmd,h); + AppendString(format("\r\nִн:endcode:%d\r\n",r)); + {if FIsLocked then + begin + FIsLocked := false; + DecPaintLock(); + end } + self.HighLighter := F_Highlighter; + h := 0; + return r; + end + function Exeing(); + begin + return FProcess.LastExeHandle; + end + function EndExe(); + begin + if FProcess.LastExeHandle then + begin + r := 1; + SysTerminate(r,FProcess.LastExeHandle); + end + end + function KeyDown(o,e);override; + begin + if ssCtrl in e.shiftstate then + begin + case e.charcode of + ord("Z"): + begin + EndExe(); + return; + end + ord("C"): + begin + ExecuteCommand(ecCopy); + return; + end + end + end + inherited; + end + function AppendString(s); + begin + if not(ifstring(s)and s)then return; + ct := Lines.Length(); + if ct>0 then + begin + ExecuteCommand(ecGoToXY,array(ct,1)); + ExecuteCommand(ecLineEnd); + ExecuteCommand(ecString,s); + end + end + FExeHandle; + FProcess; + FIsLocked; + FDoLockTime; + F_Highlighter; + end + type TTslDebug=class(TCustomControl) + private //Ա + FRuningfile; //ִнűļ + FRuningItem; //ִеpageitem + FCurrentgotoitem; //ǰеpageitem + FDebughandle; //Եľ + FDebugExe; //Թܵexe + FConnectchannel; //Ե ͨ + FDebugaddr; //ַ + FDebugport; //ԵĶ˿ + FDebugUsr; //û + FDebugPwd; // + FDebugtsfs; //ǰ̶Ӧtsfļ + FBtns; + FAttchedid; + FDebugtype; + fdbgselwnd; + FRemoteWait; //Զ̵Եȴ + FValewnd; + FCmdHistory; + FCmdHistoryid; + FCmdHistorycount; + //////////////////// + Fdbgssybs; + Fdbgsybs; + Fdbgstack; + fdefaultdbger; //༭ĵ + type tdbgwnd=class(TPanel) + uses tslvcl; + function Create(AOwner); + begin + inherited; + WsDlgModalFrame := false; + p1 := new TPairSplitter(self); + p1.Position := 310; + p2 := new TPairSplitter(self); + p2.Position := 310; + sd1 := new TPairSplitterSide(self); + sd2 := new TPairSplitterSide(self); + sd3 := new TPairSplitterSide(self); + sd3 := new TPairSplitterSide(self); + sd4 := new TPairSplitterSide(self); + p1.Align := alClient; + sd1.WsDlgModalFrame := false; + sd2.WsDlgModalFrame := false; + sd3.WsDlgModalFrame := false; + sd4.WsDlgModalFrame := false; + p1.WsDlgModalFrame := false; + p2.WsDlgModalFrame := false; + p1.parent := self; + sd1.parent := p1; + sd1.Border := false; + sd2.parent := p1; + p2.Align := alClient; + p2.parent := sd2; + sd3.parent := p2; + sd4.parent := p2; + sd4.Border := false; + fside1 := sd1; + fside2 := sd3; + fside3 := sd4; + end + function addwnds(stk,vlist,cmd,cmdshow); + begin + stk.Align := alClient; + stk.parent := fside1; + vlist.Align := alClient; + vlist.parent := fside2; + cmd.Align := alBottom; + cmd.parent := fside3; + cmdshow.Align := alClient; + cmdshow.parent := fside3; + end + function Recycling();override; + begin + inherited; + fside1 := nil; + fside2 := nil; + fside3 := nil; + end + fside1; + fside2; + fside3; + end + function cmdkeyup(o,e); + begin + case e.charcode of + VK_UP: + begin + //return ; + if FCmdHistoryid <= 0 then return o.text := ""; + FCmdHistoryid--; + txt := FCmdHistory[FCmdHistoryid]; + if ifstring(txt)and txt then o.text := txt; + end + VK_DOWN: + begin + if FCmdHistoryid >= Length(FCmdHistory)then return o.text := ""; + FCmdHistoryid++; + txt := FCmdHistory[FCmdHistoryid]; + if ifstring(txt)and txt then o.text := txt; + end + 13: + begin + //return ExecuteCommand("docmd"); + txt := trim(o.Text); + if txt then + begin + if length(FCmdHistory)>FCmdHistorycount then + begin + for i := 0 to FCmdHistorycount-1 do + begin + FCmdHistory[i]:= FCmdHistory[i+1]; + end + end + FCmdHistory[length(FCmdHistory)]:= txt; + FCmdHistoryid := length(FCmdHistory); + ExecuteCommand("docmd"); + end + e.skip := true; + end + end + end + function getvalewnd(cp); + begin + if not FValewnd then + begin + FValewnd := new TTSLDataGrid(self); + FValewnd.Visible := false; + FValewnd.Caption := "Value"; + FValewnd.left := owner.left+100; + FValewnd.Width := 600; + FValewnd.Height := 500; + FValewnd.WSpOPUp := true; + FValewnd.WSsYSMenu := true; + FValewnd.WsSizeBox := true; + FValewnd.Parent := self; + FValewnd.OnClose := function(o,e) + begin + o.Visible := false; + o.TSLdata := array(); + end + end + if ifstring(cp)then FValewnd.Caption := cp; + return FValewnd; + end + function deletefuncacheini(); + begin + plg := pluginpath(); + {$ifdef linux} + sp := "/"; + {$else} + sp := "\\"; + {$endif} + for i := length(plg)-1 downto 1 do + begin + if plg[i]=sp then + begin + fn := plg[1:i]+"FunCache.ini"; + r := filedelete("",fn); + return r; + end + end + end + public + function addbtns(btns); //Ӳ˵ + begin + FBtns := btns; + for i,v in Fbtns do + begin + v.onClick := thisfunction(Dbgtooldo); + if v.Caption="/ɾϵF5" then continue; + v.Visible := false; + end + end + function DbgNextLine(); //һ + begin + ExecuteCommand("dbgstepover"); + end + function serwnd_cclk(o,e); //ȡ + begin + FRemoteWait := false; + cancelremotedbg(o,e,"ȡ"); + return; + end + function serwnd_oclk(o,e); //ԶӰť + begin + d := fdbgselwnd.GetData(); + addr := d["addr"]; + port := d["port"]; + if not(addr and port)then return MessageboxA("Զ̷Ϣȫ","ʾ",0,self.Handle); + port := StrToIntDef(port,443); + usr := d["usr"]; + pwd := d["pwd"]; + //ж + if checkconnected()then + begin + disconnectserver(); + end + if FDebugtype="remotewait" then //Զ̵ȴ + begin + FDebugaddr := addr; + FDebugport := port; + FDebugUsr := usr; + FDebugPwd := pwd; + FRemoteWait := true; + fdbgselwnd.Visible := false; + return _send_(WM_USER,0,0,1); + end + if 0 <> connectserver(addr,port)then return MessageboxA("Զ̷ʧ","ʾ",0,self.Handle); + if(usr and pwd)and 0 <> dbglogin(usr,pwd)then + begin + return MessageboxA("½ûʧ","ʾ",0,self.Handle); + end + ExecuteCommand("dbgcreatechannel"); //channel + if FConnectchannel then + begin + dbglist(FConnectchannel); + end + end + function dbg_clk(o,e); + begin + file := o.getstartfilename(d); + item := nil; + if file=0 then //ڽű + begin + if 1 <> MessageboxA("ûҵضӦtsl\r\nǷ","ʾ",1,self.Handle)then + begin + return serwnd_cclk(); + end + end else + begin + item := owner.OpenAndGotoFileByName(file,1); + end + o.Visible := false; + FRuningItem := item; + FCurrentgotoitem := item; + parsercurrentitem(item); + FAttchedid := d; + dbgattach(FConnectchannel,d["id"]); + //echo tostn(d); + end + function Debugremote(flg); + begin + {$ifdef linux} + return MessageboxA("linuxĿǰֵ֧","ʾ",0,self.Handle); + {$endif} + if FRemoteWait then + begin + if flg then + begin + if 1=MessageboxA("Զ̵Եȴ...\r\nȷֹͣȴ..","ʾ",1,self.Handle)then + begin + FRemoteWait := false; + disconnectserver(); + end + return; + end else + begin + return MessageboxA("Զ̵Եȴ...","ʾ",0,self.Handle); + end + end else + begin + //if flg then return ; + if FConnectchannel then + begin + return MessageboxA("ڵ...","ʾ",0,self.Handle); + end + end + if not fdbgselwnd then + begin + fdbgselwnd := new tdbgselwnd(self); + fdbgselwnd.Parent := self; + fdbgselwnd.FHistoryDir := owner.FHistoryDir; + fdbgselwnd.loaddata(); + fdbgselwnd.OnClose := thisfunction(serwnd_cclk); + fdbgselwnd.save_clk := thisfunction(serwnd_oclk); + fdbgselwnd.cancel_clk := thisfunction(serwnd_cclk); + fdbgselwnd.dbg_clk := thisfunction(dbg_clk); + end + fdbgselwnd.setlist(); + if flg then + begin + FDebugtype := "remotewait"; + fdbgselwnd.setattachwait(true); + end else + begin + FDebugtype := "remote"; + fdbgselwnd.setattachwait(false); + end + fdbgselwnd.show(); + return; + end + function Debuglocal(item); //Խű + begin + {$ifdef linux} + return MessageboxA("linuxĿǰֵ֧","ʾ",0,self.Handle); + {$endif} + if not item then return 0; + if FConnectchannel then return MessageboxA("ڵ","ʾ",0,self.Handle); + if FRemoteWait then return MessageboxA("Զ̵Եȴ...","ʾ",0,self.Handle); + FDebugtype := "local"; + if checkconnected()then disconnectserver(); //Ͽ + FAttchedid := 0; + FDebugport := randomfrom(1 -> 600)+20000; + FDebugaddr := '127.0.0.1'; + FRuningItem := item; + FCurrentgotoitem := item; + dirs := owner.getlibpathstr(); + parsercurrentitem(item); + fio := ioFileseparator(); + FDebugUsr := 0; + FDebugPwd := 0; + deletefuncacheini(); + getdebuger(pms); + exestr := format('"%s" "%s" -DEBUGSERVER -DEBUGLOGIN 0 -WAITATTACH -DEBUGPORT %d -libpath "%s" ',FDebugExe,FRuningfile,FDebugport,dirs); + exestr += pms; + FDebughandle := sysexec(FDebugExe,exestr,nil,0,rcode,0); + if FDebughandle then + begin + ExecuteCommand("dbgcreatechannel"); + ExecuteCommand("showeval","Գ:"+FDebugExe); + if FConnectchannel then + begin + dbgattachwait(FConnectchannel); + end + end + end + function wmuser(o,e):WM_USER;virtual; + begin + if FRemoteWait and not(checkconnected())then + begin + if(0 <> connectserver(FDebugaddr,FDebugport))then + begin + FRemoteWait := false; + messageboxa("ӷʧ","",0,self); + return; + //sleep(100); + //_send_(WM_USER,0,0,1); + end else + begin + FRemoteWait := false; + FConnectchannel := dbgcreatechannel(); + setgdbcallback(); + if(FDebugUsr and FDebugPwd)and(0 <>(lgg := dbglogin(FDebugUsr,FDebugPwd)))then + begin + messageboxa("½ʧ\r\nû","½ʧ",0,self); + return disconnectserver(); + end + dbgattachwait(FConnectchannel); + FBtns["ֹ"].Visible := true; + end + end + end + function Create(AOwner); + begin + inherited; + FCmdHistory := array(); + FCmdHistoryid := 0; + FCmdHistorycount := 10; + FDebugExe := ""; + Caption := "tsl debug ..."; + {fimgelist := new tcontrolimagelist(self); + fimgelist.Width := 24; + fimgelist.height := 24; + fimgelist.DrawBimpFirst := true; + FToolbar := new TToolBar(self); + FToolbar.Visible := false; + idx := 0; + for i,v in dbugicos() do // + begin + bmp := new TBitmap(); + bmp.ReadVcon(HexformatStrToTsl( v)); + fimgelist.addbmp(bmp); + iti := new TToolButton(self); + iti.OnClick := thisfunction(Dbgtooldo); + iti.Caption := i; + iti.imageid := idx; + iti.Parent := FToolbar; + idx++; + end + + FToolbar.ImageList := fimgelist; + FToolbar.Parent := self; + } + dbwnd := new tdbgwnd(self); + dbwnd.Align := alClient; + dbwnd.Parent := self; + FStackList := new TListView(self); // new TListBox(self); //new tmemo(self);// + FStackList.ItemHeight := 23; + FStackList.Columns := array(("text":"line","width":40), + ("text":"function","width":250) //,("text":"type","width":70) + ); + //FStackList.ReadOnly := true; + //FStackList.Width := 300; + FStackList.Border := true; + //FStackList.Align := alLeft; + //FStackList.Parent := self; + FVaraiblesList := new TGroupGridA(self); + FVaraiblesList.Border := false; + FVaraiblesList.ItemHeight := 23; + FVaraiblesList.Columns := array(("text":"name","width":95), + ("text":"value","width":135), + ("text":"type","width":50) + ); + FCommandtext := new TEdit(self); + //FCommandtext.Border := true; + FCommandtext.placeholder := ""; + FCommandtext.Height := 23; + //FCommandtext.Align := alBottom; + //FCommandtext.Parent := self; + FCommandtext.onkeyup := thisfunction(cmdkeyup); + FShowText := new tmemo(self); + FShowText.ReadOnly := true; + FShowText.Border := true; + //FShowText.Align := alClient; + //FShowText.Parent := self; + pmenu := new TPopUpMenu(self); + cmu := new TMenu(self); + cmu.OnClick := function(o,e) + begin + FShowText.Text := ""; + end; + cmu.Caption := ""; + cmu.Parent := pmenu; + FShowText.PopUpMenu := pmenu; + dbwnd.addwnds(FStackList,FVaraiblesList,FCommandtext,FShowText); + ExecuteCommand("clearall"); + getdefaultdbger(); + end + function addbreak(item,idx,n); //Ӷϵ + begin + if not FConnectchannel then return; + parseriteminfo(item,idx,n,usr); + if n then + begin + //echo "\r\n====add:",usr,"====",n,"===",idx; + dbgsetbreak(FConnectchannel,usr,n,idx+1); + end + end + function removebreak(item,idx); //Ƴϵ + begin + if not FConnectchannel then return; + parseriteminfo(item,idx,n,usr); + if n then + begin + //echo "\r\n====remove:",usr,"====",n,"===",idx; + dbgunsetbreak(FConnectchannel,usr,n,idx+1); + end + end + function Dbgtooldo(o,e) + begin + cp := o.Caption; + case cp of + "": + begin + //echo ""; + it := Owner.GetCurrentItem(); //Owner.GetAllPageItems(); + Debuglocal(it); + end + "/ɾϵF5": + begin + it := Owner.GetCurrentItem(); + if it then + begin + it.FEditer.SwitchMarkLine(); + end + end + "ͣ": + begin + ExecuteCommand("dbgpause"); + end + "": + begin + ExecuteCommand("dbgstep") + end + "": + begin + //dbgstep(); + end + "һ(F8)": + begin + ExecuteCommand("dbgstepover"); + end + "": + begin + ExecuteCommand("dbgstepout"); + end + "": + begin + toolbtnState(""); + if FCurrentgotoitem and FCurrentgotoitem.FEditer then FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil); + ExecuteCommand("dbgrun"); + end + "ֹ": + begin + ExecuteCommand("dbgreset"); + end + "": + begin + end + "ˢ·ű": + begin + ExecuteCommand("dbggetallvalue"); + end + "ˢµǰ": + begin + ExecuteCommand("dbggetcurrentnode"); + end + "ı": + begin + FShowText.Text := ""; + end + end; + end + function dbgeventcall(d); //ص + begin + global g_tsldbgcallback_handle; + if not ifarray(d)then return; + if d["channel"]<> FConnectchannel then return; + recvtype := d["recvtype"]; + if recvtype=0 then + begin + FRemoteWait := 0; + ExecuteCommand("showeval","Խ"); + if FConnectchannel then dbgdeletechannel(FConnectchannel); + FConnectchannel := 0; + g_tsldbgcallback_handle := nil; + if FCurrentgotoitem and FCurrentgotoitem.FEditer then FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil); + FDebughandle := 0; + toolbtnState("ֹͣ"); + return; + end + //echo "\r\nrectype",format("0x%x",recvtype); + if 0x0401=recvtype then + begin + owner.echoAppendString(d["errmsg"]); + return; + end + if recvtype <> 0x402 then + begin + return; + end + case magicgetarray(d,array("result","CmdType"))of + "attachlist": + begin + r := magicgetarray(d,array("result","CmdData")); + r :: + begin + if mcol="createtm" then + begin + mcell := datetimetostr(mcell); + end + end + return fdbgselwnd.setlist(r); + //return echo tostn(r); + end + "attachwaitok","attachok": // ,Ĭ + begin + debuginitok(); + FVaraiblesList.SetNodeData(array()); + FStackList.DeleteAllItems(); + //dbgeval(FConnectchannel,getobjtransfunc()); + return; + end + "DebugInfo": //Ϣ + begin + if "dbgdetach"=remotewaitinit(d)then return; + toolbtnState("ͣ"); + stk := magicgetarray(d,array("result","CmdData","CallStack")); // + sybs := magicgetarray(d,array("result","CmdData","SymbolInfo")); // + ssybs := magicgetarray(d,array("result","CmdData","EnvInfo")); //ϵͳ + {if (ssybs = Fdbgssybs) and (sybs = Fdbgsybs) and (stk=Fdbgstack) then //ֵû + begin + return ; + end } + if(ssybs <> Fdbgssybs)or(sybs <> Fdbgsybs)then + begin + FVaraiblesList.SetNodeData(array()); + ddd := formatsysvlist(ssybs,nil); + FVaraiblesList.SetNodeData(ddd,true); + Fdbgssybs := ssybs; + ddd := formatvlist(sybs); + FVaraiblesList.SetNodeData(ddd,true); + Fdbgsybs := sybs; + end + if stk <> Fdbgstack then + begin + FStackList.DeleteAllItems(); + FStackList.appendItems(stk[:,array("LINE","NAME","USER")]); + //FStackList.text := array2str(stks,"\r\n"); + Fdbgstack := stk; + end + if ifarray(stk)then + begin + FVaraiblesList.celldbclk := thisfunction(vdbclk); + FVaraiblesList.celledit := thisfunction(vdoedit); + FVaraiblesList.Showarray := thisfunction(vdoshowarray); + FStackList.OnDblClick := thisfunction(stkdbclk); + it := opengoto(stk[0]); + //if not it then return; + if it and it <> FCurrentgotoitem then + begin + if FCurrentgotoitem and FCurrentgotoitem.FEditer then + begin + FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil); + end + FCurrentgotoitem := it; + end + if FCurrentgotoitem then + begin + FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",stk[0,"LINE"]-1); + end + end + return; + end + "detached": + begin + if FConnectchannel then + begin + dbgdeletechannel(FConnectchannel); + FConnectchannel := 0; + g_tsldbgcallback_handle := nil; + FAttchedid := 0; + end + FRemoteWait := 0; + if FCurrentgotoitem and FCurrentgotoitem.FEditer then FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil); + ExecuteCommand("showeval","Խ"); + toolbtnState("ֹͣ"); + return; + end + "DebugSysParamValue": + begin + CmdTypeAux := magicgetarray(d,array("result","CmdTypeAux")); + ev := magicgetarray(d,array("result","CmdData")); + cp := magicgetarray(d,array("result","CmdParam")); + len :=-1; + if ifnumber(CmdTypeAux)and(CmdTypeAux .& 0x80000000)then + begin + len := _shr((int(CmdTypeAux).& 0xFFF0),4); + end + //echo "\r\n***",len," ",cp," ",tostn(ev); + if(cp="#DebugEval")or(cp="#Error")then + begin + return showevaldata(nil,ev); + end + if ifarray(ev)then + begin + ddd := formatsysvlist(array(cp:ev),len); + FVaraiblesList.SetNodeData(ddd,true); + for i,v in ev do + begin + if ifstring(i)then + begin + ncp := tostn(i); + ncp := replacetext(ncp,".","\\o"); + ncp := cp+".["+ncp+"]"; + end else + begin + ncp := cp+".["+tostn(i)+"]"; + end + magicsetarray(d,array("result","CmdParam"),ncp); + magicsetarray(d,array("result","CmdData"),v); + dbgeventcall(d); + end + return; + end else + begin + ddd := formatsysvlist(array(cp:ev),len); + FVaraiblesList.SetNodeData(ddd,true); + end + end + "DebugValue": + begin + cp := magicgetarray(d,array("result","CmdParam")); + ev := magicgetarray(d,array("result","CmdData")); + if(cp="#DebugEval")or(cp="#Error")then + begin + return showevaldata(nil,ev); + end + if ifarray(ev)then + begin + //showevaldata(cp,ev); + ddd := formatvlist(array(cp:ev)); + FVaraiblesList.SetNodeData(ddd,true); + for i,v in ev do + begin + if ifstring(i)then + begin + ncp := tostn(i); + ncp := replacetext(ncp,".","\\o"); + ncp := cp+".["+ncp+"]"; + end else + begin + ncp := cp+".["+tostn(i)+"]"; + end + magicsetarray(d,array("result","CmdParam"),ncp); + magicsetarray(d,array("result","CmdData"),v); + dbgeventcall(d); + end + return; + end else + begin + ddd := formatvlist(array(cp:ev)); + FVaraiblesList.SetNodeData(ddd,true); + end + end + "noattachederror": + begin + return disconnectserver(); + FRemoteWait := 0; + ExecuteCommand("showeval","noattachederror"); + d["recvtype"]:= 0; //˳ + dbgeventcall(d); + return; + end else + begin + //echo tostn(d); + end + end + return; + end + function showevaldata(cp_,ev); + begin + cp := cp_; + if cp then + begin + if parseregexpr("\\(\\w+\\)\\.",cp,"r", function(a) + begin + return ""; + end + ,s)=1 then + begin + cp := s; + end + end + if ev and ifarray(ev)then + begin + fwnd := getvalewnd(cp); + fwnd.TSLdata := ev; + fwnd.Show(); + end else + begin + if cp then FShowText.Text += ">>"+cp+"\r\n"; + ExecuteCommand("showeval",ev); + end + end + function ExecuteCommand(cmd,p); + begin + case cmd of + "dbgstate": + begin + if ifnil(p)then return FdebugState; + end + "execommand": + begin + case p of + "#127": + begin + FShowText.Text := ""; + end + end; + end + "docmd": + begin + s := FCommandtext.Text; + if not s then return; + FCommandtext.Text := ""; + if s="#cls" then return ExecuteCommand("execommand",s); + FShowText.Text += ">>"+s+"\r\n"; + ExecuteCommand("dbgeval",s); + end + "clearall": // + begin + //FStackList.items := array(); + //FStackList.text := ""; + FStackList.DeleteAllItems(); + FVaraiblesList.SetNodeData(array()); + if p then + begin + FShowText.Text := ""; + FCommandtext.Text := ""; + end + end + "showeval": + begin + FShowText.Text += "ans="+tostn(p)+"\r\n"; + FShowText.ExecuteCommand(FShowText.ecGotoXY,array(100000,1)); + end + "dbgcreatechannel": + begin + if not FConnectchannel then + begin + idx := 0; + if not checkconnected()then + begin + while(FDebugtype="local")and(0 <> connectserver(FDebugaddr,FDebugport)) do + begin + sleep(100); + idx++; + if idx>20 then + begin + return ExecuteCommand("debugconnecterr"); + end; + end + end + FConnectchannel := dbgcreatechannel(); + setgdbcallback(); + end + end + "dbggetallvalue": + begin + if FConnectchannel then + begin + dbggetallvalue(FConnectchannel); + end + end + "dbggetcurrentnode": + begin + FVaraiblesList.getcurrentnodedata(); + end + "dbgreset": //ֹͣ + begin + if FConnectchannel then + begin + if FDebughandle then + begin + return SysTerminate(-1,FDebughandle); + end + if FAttchedid then + begin + //echo "\r\nֹ"; + return dbgdetach(FConnectchannel); + end else + begin + if FDebugtype="remotewait" then //Զ,Ͽ + begin + return disconnectserver(); + end + return dbgdetach(FConnectchannel); + //return dbgreset(FConnectchannel); + end + end + end + "dbgrun": // + begin + if FConnectchannel then dbgrun(FConnectchannel); + end + "dbgstep": + begin + if FConnectchannel then dbgstep(FConnectchannel); + end + "dbgpause": //ͣ + begin + if FConnectchannel then dbgpause(FConnectchannel); + end + "dbgstepover": //һ + begin + if FConnectchannel then dbgstepover(FConnectchannel); + end + "dbgstepout": // + begin + if FConnectchannel then dbgstepout(FConnectchannel); + end + "dbgeval": //ִ + begin + if FConnectchannel and p and ifstring(p)then + begin + getvalewnd("ans"); + dbgeval(FConnectchannel,p); + end + end + end + end + function Recycling();override; + begin + global g_tsldbgcallback_handle; + stopdebug(); + inherited; + FStackList := nil; + FVaraiblesList := nil; + FToolbar := nil; + FCommandtext := nil; + FShowText := nil; + fimgelist := nil; + FBtns := nil; + g_tsldbgcallback_handle := nil; + fdbgselwnd := nil; + end + private + function getdefaultdbger(); + begin + fdefaultdbger := gettslexe(); + end + function getdebuger(pms); //õԳ + begin + p := static pluginpath(); + FDebugExe := inireadstring("",p+"localediter.ini","debug","debuger",""); + pms := " "; + //if FDebugExe="1" then //Ĭϻȡ + // begin + ps := owner.getexecuteparams(FRuningfile); + if ps then + begin + psi := ps[0]; + if fileexists("",psi)then + begin + cmdexe := psi; + end else + begin + if FDebugExe="1" then + ExecuteCommand("showeval","ǰִָг򲻴!!"); + end + psi := ps[1]; + if psi and fileexists("",psi)then + begin + end else + begin + pms += " "+tostn(psi); + end + idx := 2; + while idx"); + end else + if fileexists("",FDebugExe)then + begin + ExecuteCommand("showeval","<ļĵ>"); + end else + begin + FDebugExe := fdefaultdbger; + ExecuteCommand("showeval","<ñ༭Դĵb:>"); + end + end + function remotedbugok(); + begin + if FAttchedid then + begin + ExecuteCommand("showeval","Զű:"+FAttchedid["info"]); + end + end + function remotewaitinit(d); + begin + if FDebugtype <> "remotewait" then return; + if FAttchedid then return; + FAttchedid := magicgetarray(d,array("result","CmdData","StartInfo")); + file := fdbgselwnd.getstartfilename(FAttchedid); + item := nil; + if file=0 then //ڽű + begin + if 1 <> MessageboxA("ûҵضӦtsl\r\nǷ","ʾ",1,self.Handle)then + begin + dbgdetach(FConnectchannel); + return "dbgdetach"; + //return serwnd_cclk(); + end + end else + begin + item := owner.OpenAndGotoFileByName(file,1); + end + FRuningItem := item; + FCurrentgotoitem := item; + parsercurrentitem(item); + setbrks(); //öϵ + remotedbugok(); + end + function debuginitok(); + begin + if FDebugtype <> "remotewait" then setbrks(); //öϵ + //showbtns(); //ʾť + ExecuteCommand("showeval","ʼ"); + //toolbtnState("ͣ"); + remotedbugok(); + return; + end + function opengoto(v); + begin + cn := v["NAME"]; + cnn := ""; + for ii := 1 to length(cn) do + begin + if cn[ii]in array(".",":")then + begin + cn := cnn; + break; + end + cnn += cn[ii]; + end + f := FDebugtsfs[lowercase(cn)]; + if not f then + begin + return ExecuteCommand("showeval","Ҳ:"+cn); + end + it := owner.OpenAndGotoFileByName(f,v["LINE"]); + return it; + end + function cancelremotedbg(o,e,s); + begin + fdbgselwnd.Visible := false; + if e then e.skip := true; + if FConnectchannel then dbgdeletechannel(FConnectchannel); + FConnectchannel := 0; + ExecuteCommand("showeval",ifstring(s)?s:"ȡԶ̵..."); + end + function stkdbclk(o,e); + begin + //echo "\r\n",o.SelectedId; + id := o.SelectedId; + if id >= 0 then + begin + d := o.GetItem(id); + if d then + begin + return opengoto(d); + end + end + end + function vdoshowarray(d); + begin + //echo tostn(d); + try + gp := d[3]; + if(gp[length(gp)]="+")and parseregexpr("\\+$",gp,"r", function(a) + begin + return ""; + end + ,sgp)=1 then + begin + gp := "sysparams:"+sgp; + end + showevaldata(gp,d[1]["value"]); + except + end; + end + function vdoedit(d,s); + begin + if not FConnectchannel then return; + gp := d[1][3]; + try + v := eval(&s); + except + v := nil; + end + if(gp[length(gp)]="+")and parseregexpr("\\+$",gp,"r", function(a) + begin + return ""; + end + ,sgp)=1 then + begin + dbgsetvalue(FConnectchannel,sgp,d[1][5],v); + sleep(20); + dbggetvalue(FConnectchannel,sgp,d[1][5]); + end else + begin + //echo "\r\nset: ",gp," ",v; + dbgsetvalue(FConnectchannel,gp,0,v); + sleep(20); + dbggetvalue(FConnectchannel,gp,0); + end + end + function vdbclk(o,e); + begin + if not FConnectchannel then return; + if(e[0]=1)and(e[1][2]="*")then + begin + gp := e[1][3]; + if gp="sysparams+" then return; + if(gp[length(gp)]="+")and parseregexpr("\\+$",gp,"r", function(a) + begin + return ""; + end + ,sgp)=1 then + begin + dbggetvalue(FConnectchannel,sgp,e[1][5]); + end else + begin + dbggetvalue(FConnectchannel,gp,0); + end + end + end + function parsercurrentitem(item); //غ + begin + FDebugtsfs := class(TTSLCompletion).getdirtsfs(); + if item then + begin + FRuningfile := item.OrigScriptPath; // %% E:\TSUIGROUP\script\tgdb.tsl%%; + FDebugtsfs["__main__"]:= FRuningfile; + ls := item.FEditer.lines; + d := tsl_tokenizeex_2_(item.FEditer.Text,0xffff); + for i,v in d["blcks"] do + begin + s := ls.GetStringByIndex(v["mbeg"]-1); + ctls := 0; + case v["mtype"]of // + 11: + begin + ctls := "function\\s+(\\w+)\\("; + end + 3: + begin + ctls := "type\\s+(\\w+)\\s*=\\s*class" // + end + end; + if s and ctls and(parseregexpr(ctls,s,"si",m,mp,ml)=1)then + begin + n := lowercase(m[0,1]); + FDebugtsfs[n]:= FRuningfile; + end + end + end + end + function toolbtnState(flg); + begin + case flg of + "","ͣ": + begin + showbtns(); + FBtns["ͣ"].Visible := false; + FBtns["ˢ·ű"].Visible := true; + FBtns["ˢµǰ"].Visible := true; + end + "": + begin + // + FBtns[""].Visible := false; + FBtns[""].Visible := false; + FBtns[""].Visible := false; + FBtns["һ(F8)"].Visible := false; + //FBtns[""].Visible := false; + FBtns["ֹ"].Visible := false; + FBtns["ͣ"].Visible := true; + FBtns["ˢ·ű"].Visible := false; + FBtns["ˢµǰ"].Visible := false; + end + "ֹͣ": + begin + hiddenbtns(); + end + end + end + function showbtns(); //ʾ + begin + for i,v in FBtns do + begin + V.Visible := true; + end + //FToolbar.Visible := true; + end + function hiddenbtns(); // + begin + for i,v in FBtns do + begin + if v.Caption="/ɾϵF5" then continue; + v.Visible := false; + end + //FToolbar.Visible := false; + end + function stopdebug(); // + begin + if FDebughandle then + begin + SysTerminate(-1,FDebughandle); + FDebughandle := 0; + end + end + function parseriteminfo(item,idx,n,usr); + begin + if item=FRuningItem then + begin + usr := "local"; + n := "__main__"; + end else + begin + usr := "system"; + end + if not n then + begin + n := getscriptname(item.OrigScriptPath); + end + end + function getscriptname(nn); + begin + fio := ioFileseparator(); + n := ""; + for i := Length(nn)-1 downto 1 do + begin + if fio=nn[i]then + begin + n := nn[i+1:]; + idx := pos(".",n); + if idx then + begin + n := lowercase(n[1:idx-1]); + end + break; + end + end + return n; + end + function setbrks(); //Ӷϵ + begin + its := owner.GetAllPageItems().data; + for i,v in FDebugtsfs do + begin + delii :=-1; + for ii,vv in its do + begin + ifok := vv.ScriptPathIs(v); + if ifok then + begin + delii := ii; + lines := vv.FEditer.Lines; + for idx := 0 to Lines.Length()-1 do + begin + if Lines[idx].FMarked then addbreak(vv,idx,i); + end + break; + end + end + if delii <> 0 then + begin + reindex(its,array(delii:nil)); + end + end + if FRuningItem then + begin + lines := FRuningItem.FEditer.Lines; + for idx := 0 to Lines.Length()-1 do + begin + if Lines[idx].FMarked then addbreak(FRuningItem,idx,"__main__"); + end + end + end + function setgdbcallback(); //ûص + begin + global g_tsldbgcallback_handle; + g_tsldbgcallback_handle := thisfunction(dbgeventcall); + dbgsetcallback(FConnectchannel,"return unit(UtslCodeEditor).tdbgcallback();"); + end + function formatvlist(d); + begin + r := array(); + ncs := array(); + { + ddd := array(); + for i,v in dd do + begin + ddd[i]["id"] := v["n"]; + ddd[i]["data"] := array(v["c"],v["v"],v["t"],v["n"]); + ddd[i]["pid"] := v["p"]; + + end + } + idx := 0; + for i,v in d do + begin + ri := parservname(i,v); + for j,vj in ri do + begin + id := vj["n"]; + if ncs[id]then continue; + ncs[id]:= true; + r[idx]["id"]:= id; + vjt := vj["t"]; + vjv := vj["v"]; + if vjt="*" then + begin + vval := array("value":vjv,"font":("color":0xff0000)); + end else + if ifarray(vjv)then + begin + vval := array("value":vjv,"font":("color":0)); + end else + if ifstring(vjt)and(vjt <> "nil")then + begin + vval := array("value":tostn(vjv),"font":("color":0)); + end else + begin + vval := array("value":"","font":("color":0)); + end + r[idx]["data"]:= array(vj["c"],vval,vj["t"],vj["n"],id); + r[idx]["pid"]:= vj["p"]; + r[idx]["nnp"]:= vj["nnp"]; + idx++; + end + end + return r; + end + function formatsysvlist(d,len); + begin + r := array(); + ncs := array(); + idx := 0; + for i,v in d do + begin + ri := parsersysname(i,v,len); + for j,vj in ri do + begin + id := vj["n"]; + if ncs[id]then continue; + ncs[id]:= true; + r[idx]["id"]:= id; + vjt := vj["t"]; + vjv := vj["v"]; + if vjt="*" then + begin + vval := array("value":vjv,"font":("color":0xff0000)); + end else + if ifarray(vjv)then + begin + vval := array("value":vjv,"font":("color":0)); + end else + if ifstring(vjt)and(vjt <> "nil")then + begin + vval := array("value":tostn(vjv),"font":("color":0)); + end else + begin + vval := array("value":"","font":("color":0)); + end + r[idx]["data"]:= array(vj["c"],vval,vjt,vj["n"],id,vj["len"]); + r[idx]["pid"]:= vj["p"]; + r[idx]["nnp"]:= vj["nnp"]; + idx++; + end + end + return r; + end + function gettypename(ev); + begin + case datatype(ev)of + 0:t := "int"; //͵ + 20:t := "int64"; + 24:t := "lstr"; + 1:t := "double"; + 2:t := "str"; + 5:t := "array"; + else t := "nil"; + end; + return t; + end + function parsersysname(ostring,ev,nlen); + begin + len := length("*TSL_UNComplete*"); + ucp := false; + if pos("*TSL_UNComplete*",ostring)=1 then + begin + ucp := true; + if Length(ostring)=len then //մ + begin + nstr := ""; + return array(); + end else + nstr := ostring[len+1:]; + end else + nstr := ostring; + r := array(); + if ucp then t := "*"; + else t := gettypename(ev); + nid := ""; + r[0]:= array("n":"sysparams+", + "c":array("font":("color":0x0000ff,"italic":1),"value":"sysparams") + ); + if nlen >= 0 then + begin + nnl := 0x80000000+_shl(nlen,4)+1; + cn := ""; + if nlen=0 then + begin + r[1]:= array("n":"+", + "c":tostn(""), + "len":nnl, + "p":"sysparams+" + ); + end else + begin + cn := nstr[1:nlen]; + r[1]:= array("n":cn+"+", + "c":cn, + "len":nnl, + "p":"sysparams+" + ); + if nlen"; + o := o_; + obk := o; + try + stk := array(); + idx :=0; + while idx<(ct>0?ct:3) do + begin + mus[length(mus)] := o; + d := o.classinfo(); + stk[idx,0] := o; + stk[idx,1] := d; + inh := d["inherited"]; + if not inh then break; + o := findclass(inh[0],o); + idx++; + end + for idx := length(stk)-1 downto 0 do + begin + o:=stk[idx,0]; + for i,v in stk[idx,1,"properties"] do + begin + n := v["name"]; + if v["read"] and (v["access"] in array(0,1)) then + begin + r[n] := 0; + + end else + begin + reindex(r,array(n:nil)); + end + end + for i,v in stk[idx,1,"members"] do + begin + n := v["name"]; + if v["access"] in array(0,1) then + begin + r[n] := 0; + + end else + begin + reindex(r,array(n:nil)); + end + end + + end + rs := mrows(r,1) ; + for i := length(rs)-1 downto 0 do + begin + v := rs[i]; + nv := invoke(obk,v); + if datatype(nv)=7 then r[v] := ""; + else if ifarray(nv) then r[v] := _show_dbg_obj(nv,ct,mus); + else if ifobj(nv) then r[v] := _show_dbg_obj(nv,ct,mus); + else r[v] := _show_dbg_obj(nv,ct,mus); + end + except + return r; + end; + return r; +end + %%; + end + FStackList; + FVaraiblesList; + FToolbar; + FCommandtext; + FShowText; + fimgelist; + end + type TFindListWnd=class(TListBox) //ҵĵط + function Create(AOwner); + begin + inherited; + end + function CheckListItem(s);override; + begin + return ifarray(s); + end + function GetItemText(i);override; + begin + it := GetItem(i); + if it then r := it["caption"]; + if not ifstring(r)then return ""; + return r; + end + Published + private + end + type TGoToLineWnd=class(TVCForm) //ת + function Create(AOwner);override; + begin + inherited; + wssizebox := false; + minmaxbox := false; + WsDlgModalFrame := true; + width := 300; + height := 80; + caption := "ת.."; + FLabel := new TLabel(self); + FLabel.SetBoundsRect(array(3,10,70,35)); + FEdit := new TEdit(self); + FEdit.SetBoundsRect(array(75,10,200,35)); + FBtn := new TBtn(self); + FBtn.SetBoundsRect(array(210,10,280,35)); + FLabel.Caption := "Ŀλ:"; + FBtn.Caption := "λ"; + FLabel.parent := self; + FEdit.parent := self; + FEdit.OnKeyPress := function(o,e) + begin + if e.CharCode=13 then + begin + e.skip := true; + GotoTextInteger(); + end + end + OnClose := function(o,e) + begin + o.visible := false; + e.skip := true; + end + FBtn.parent := self; + FBtn.OnClick := function(o,e) + begin + GotoTextInteger(); + end + end + function DoControlAlign();override; + begin + end + function ShowGoto(); + begin + show(); + FEdit.SetFocus(); + FEdit.Text := ""; + end + private + function GotoTextInteger(); + begin + id := FEdit.Text; + id := StrToIntDef(id,0); + if id>0 then + begin + it := Owner.GetCurrentItem(); + Visible := false; + Owner.OpenAndGotoFileByName(it.ScriptPath,id); + //it.SetFocus(); + //return ; + it := Owner.GetCurrentEditer(); + if not it then return; + //it.ExecuteCommand(it.ecGotoXY,array(id,1)); + //Visible := false; + it.SetFocus(); + end + end + FEdit; + FBtn; + end + type TTslCodeMap=class(TTreeView) //tslͼ + function Create(AOwner); + begin + inherited; + caption := ":֧[////enter]"; + width := 400; + height := 800; + WsPopUp := true; + WsSysMenu := true; + WsSizeBox := true; + OnClose := function(o,e) + begin + o.visible := false; + e.skip := true; + if not FTreeEditer then return; + FTreeEditer.SetFocus(); + end + OnActivate := function(o,e) + begin + if not e.wparam then CodeMapLive(o,e); + {o.Visible := false; + if not FTreeEditer then return; + FTreeEditer.SetFocus();} + end + onKeyPress := thisfunction(CodeMapLive); + //OnDblClick := thisfunction(SynNodeSelected); + OnSelChanged := thisfunction(SynNodeSelected); + end + function CodeMapLive(o,e); + begin + o.Visible := false; + if not FTreeEditer then return; + FTreeEditer.SetFocus(); + end + function SynNodeSelected(o,e); + begin + //˫ + if not FTreeEditer then return; + nd := CurrentNode; + line := nd._tag; + if line>0 then + begin + FTreeEditer.ExecuteCommand(FTreeEditer.ecGoToXY,array(line,1)); + end + end + function hasFocus();override; + begin + return true; + end + function ShowMap(); + begin + FTreeEditer := nil; + it := Owner.GetCurrentItem(); + if not it then return; + //caption := "codemap:"+it.ScriptPath; + FTreeEditer := it.FEditer; + s := FTreeEditer.Text; + if FString <> s then + begin + FString := s; + LoadString(s,FTreeEditer.CaretY); + end else + GoToTheNode(FTreeEditer.CaretY); + end + function Recycling();override; + begin + inherited; + FTempNodes := nil; //ڵ + FEditer := nil; + FString := nil; + FTreeEditer := nil; + end + private + function LoadString(s,line); + begin + { + #define Block_TypeClass 1 + #define Block_Function 2 + #define Block_Statements 4 + #define Block_If 8 + #define Block_Else 16 + #define Block_SubCase 32 + #define Block_Goto_Label 64 + #define Block_Empty_Begin_End 128 + #define Block_Try 256 + #define Block_NeedSql 512 + #define Block_UnitStruct 1024 + } + if s then r := tsl_tokenizeex_2_(s,1+2+4+8+16+32+256+1024); + else r := array(); + RootNode.RecyclingChildren(); + FTempNodes := array(); + ScriptDelBlocks(r["blcks"],str2array(s,"\r\n"),self.RootNode,0); + GoToTheNode(line); + end + function GoToTheNode(line); + begin + nd := FTempNodes[0]; + for i,v in FTempNodes do + begin + if v._tag <= line then + begin + nd := v; + end else + if v._tag >= Line then + begin + SetSel(nd); + break; + end + end + Show(); + if _wapi.GetFocus()<> Handle then + begin + SetFocus(); + end + end + function ScriptDelBlocks(blcks,strs,Node,ct); + begin + if not blcks then return; + for i,v in blcks do + begin + if v["mtype"]<> 1 then + begin + cnd := CreateTreeNode(); + cnd.Caption := trim(strs[v["mbeg"]-1]); + cnd._tag := v["mbeg"]; + FTempNodes[length(FTempNodes)]:= cnd; + cnd.parent := node; + end + if not cnd then cnd := node; + ScriptDelBlocks(v["msub"],strs,cnd,ct+1); + end + end + FTempNodes; //ڵ + FString; //ַ + FTreeEditer; //༭ + end + type TEditer=class(TCustomcontrol) //,״̬,, + function Create(AOwner);override; + begin + inherited; + FOpenHistory := new TMyarrayb(); + FFistShows := array(); + FSynHCS := New TMyArrayA(); + //첿 + FLastDispathTime := now(); + FTslexe := gettslexe() ;//SysExecName(); + FTabChar := " "; + FTabWidth := 4; + FCurrentItemCode := array(); + FGoBackA := new TMyarrayB(); + FGoBackB := new TMyarrayB(); + FToolbar := new TToolBar(self); // + FStatus := new TStatusBar(self); //״̬ + FInfoShowWnd := new TEditerAuxiliary(self); + FPageEditer := new TPageEditer(self); + //FPageEditer.CloseBtn := true; + FPageEditer.Onbmpbclick := function(o,e) + begin + it := e._Tag; + if not it then return ; + if JudgeItemState(it)then return; + if it.FEditer.ChangedFlag then + begin + mr := MessageboxA(format("Ƿ񱣴:%s",it.OrigScriptPath),"ʾ",3,self); + if mr=IDYES then + begin + SavePageItem(it); + end else + if mr=IDCANCEL then + begin + return; + end + end + DeletePageItem(it); + o.CallSelChanged(); + end + FPageEditer.OnCloseClick := function(o,e) + begin + it := GetCurrentItem(); + if not it then return ; + if JudgeItemState(it)then return; + if it.FEditer.ChangedFlag then + begin + mr := MessageboxA(format("Ƿ񱣴:%s",it.OrigScriptPath),"ʾ",3,self); + if mr=IDYES then + begin + SavePageItem(it); + end else + if mr=IDCANCEL then + begin + return; + end + end + DeletePageItem(it); + end; + FFindWnd := new TFindWnd(self); // + FGotoLineWnd := new TGoToLineWnd(self); //ͬ + FListPages := new TListPages(self); //tab תҳ + FEchoWnd := new TEditerEchoWnd(self); + FEchoWnd.font := array("height":16,"width":8,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0, + "charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0); + FTslDebug := new TTslDebug(self); + FFindListWnd := new TFindListWnd(self); + FCodeMap := new TTslCodeMap(self); + FFileopen := new TOpenFileADlg(self); + FFileSave := new TSavefileADlg(self); + FFileopen.WndOwner := self; + FFileSave.WndOwner := self; + //ʼ + ////////////////////////////////////// + FEchoWnd.Border := true; + FEchoWnd.WsSysMenu := false; + FEchoWnd.WsSizeBox := false; + FEchoWnd.Caption := "echo..."; + FFindListWnd.Caption := "find...."; + FFindListWnd.OnDblClick := thisfunction(FindListChoosed); + FGotoLineWnd.Visible := false; + ///////////////////////// + FCodeMap.visible := false; + FFindWnd.Visible := false; + FFileSave.Filter := array("any":"*.*","tslļ":"*.tsl;*.tsf"); + FFileSave.Caption := "Ϊ"; + FFileopen.Filter := array("any":"*.*","tslļ":"*.tsl;*.tsf"); + FPageEditer.OnSelChanged := thisfunction(PageItemSelChanged); + //////// + FListPages.Visible := false; + //////////////////////////// + FPageMenu := new TPopUpMenu(self); + for i,v in array("ر","رǩ","ļ","ļȫ","¼","Ŀ¼","Ϊ") do + begin + mi := new TMenu(self); + mi.Caption := v; + mi.Parent := FPageMenu; + mi.OnClick := thisfunction(PageMenuClick); + end + FExecuteEditer := new TExecuteEditer(self); + FExecuteEditer.visible := false; + //////////// + FPageEditer.PageItemOnRClick := thisfunction(PageItemOnRClick); + FImages := new TControlImageList(self); + FImages.Width := 22; + FImages.Height := 22; + bmp := new TBitmap(); + imgs := GetEditIcons(); + id := 0; + FToolbtns := array(); + dbgbtns := array(); + for i,v in imgs do + begin + bmp.Readvcon(HexFormatStrToTsl(v)); + FImages.addbmp(bmp); + bt := new TToolButton(self); + FToolbtns[i]:= bt; + bt.OnClick := thisfunction(ToolClick); + bt.Caption := i; + bt.imageid := id; + id++; + BT.parent := FToolbar; + if i in array("/ɾϵF5","ͣ","","","","","һ(F8)","ֹ","ˢ·ű","ˢµǰ")then + begin + dbgbtns[i]:= bt; + end + end + FImages.DrawBimpFirst := true; + FTslDebug.addbtns(dbgbtns); + FToolbar.ImageList := FImages; + FInfoShowWnd.Visible := false; + //FInfoShowWnd.WsSysMenu := true; + FInfoShowWnd.WSsizebox := true; + FInfoShowWnd.height := 200; + //FInfoShowWnd.OnSize := thisfunction(DoControlAlign); + FInfoShowWnd.OnCloseClick := function(o,e) + begin + o.visible := false; + e.skip := true; + DoControlAlign(); + end + ///////////////////// + FStatus.Items := array(("text":"","width":0.85),("text":"","width":0.16)); + ///////////////////////////////////////// + //FInfoShowWnd.Caption := "Ϣ:"; + ////ڵ//////////////////////////////////////////////////// + FToolBar.Parent := self; + FStatus.Parent := self; + FInfoShowWnd.Parent := self; + FPageEditer.Parent := self; + FCodeMap.parent := self; + FGotoLineWnd.Parent := self; + FFindWnd.parent := self; + FFileopen.parent := self; + FFileSave.parent := self; + FListPages.parent := self; + FExecuteEditer.parent := self; + //FEchoWnd + FInfoShowWnd.AddWnd(FEchoWnd); + FInfoShowWnd.AddWnd(FFindListWnd); + FInfoShowWnd.AddWnd(FTslDebug); + FTempPageItem := new TPageEditerItem(FPageEditer); + ///////////// + FSynClasses["txt"]:= array(class(TSynHighLighter),class(TSynCompletion),";txt;"); + FSynClasses["tsl"]:= array(class(TTslSynHighLighter),class(TTslCompletion),";tsl;tsf;pas;stm;"); + FSynClasses["json"]:= array(class(TJsonSynHighLighter),class(TSynCompletion),";json;"); + FSynClasses["ini"]:= array(class(TINISynHigLighter),class(TSynCompletion),";ini;"); + FSynClasses["bat"]:= array(class(TBatSynHigLighter),class(TSynCompletion),";bat;cmd;"); + FSynClasses["None"]:= array(nil,nil,""); + //FSynClasses["tsf"] := FSynClasses["tsl"]; + FTslChmHelp := new TTslChmHelp(); + FCodeFormatInfo := array("wordct":80,"charct":200,"syn":true,"sel":false,"arraytype":0); + FPageEditer.OnDblClick := function(o,e) + begin + CreateAFile(); + end + end + function PopUpAuxiliary(); + begin + FInfoShowWnd.ShowPopUp(); + end + function ClearPageItemMark(it); + begin + if not it then it := GetCurrentItem(); + if not it then return; + ed := it.FEditer; + ls := ed.Lines; + canval := false; + for i := 0 to ls.length()-1 do + begin + li := ls[i]; + if li.FMarked then + begin + li.FMarked := false; + canval := true; + end + end + if canval then ed.InValidateRect(nil,false); + end + function GetAllPageItems(); + begin + return FPageEditer.PageItems; + end + function SaveFileByName(n); + begin + for i,v in FPageEditer.PageItems.Data do + begin + if v.ScriptPathIs(n)then + begin + return SavePageItem(v); + end + end + end + function GetAllPagesInfo(); + begin + r := array(); + its := FPageEditer.PageItems; + for i := 0 to its.Length()-1 do + begin + it := its[i]; + r["pages"][i]["filename"]:= it.OrigScriptPath; + edt := it.FEditer; + r["pages"][i]["r"]:= edt.TopLine; //edt.CaretY; + ls := edt.Lines; + f2s := array(); + for j := 0 to ls.Length()-1 do + begin + if ls[j].FMarked then f2s[j]:= true; + end + r["pages"][i]["f2"]:= f2s; + r["pages"][i]["isnewfile"]:= it.fisnewfile; + end + it := GetCurrentItem(); + if it then + begin + r["currentpage"]:= array(it.OrigScriptPath,it.FEditer.TopLine); + end + //FPageEditer.DoControlAlign(); + return r; + end + function CloseScriptByFileName(n); + begin + for i,v in FPageEditer.PageItems.Data do + begin + if v.ScriptPathIs(n)then + begin + return DeletePageItem(v); + end + end + end + function CloseAllPageItems(it); + begin + its := FPageEditer.PageItems; + tits := its.Data; + FPageEditer.CloseAllItem(it); + for i,v in tits do + begin + if v=it then + begin + cit := it; + continue; + end + v.Recycling(); + end + if cit then cit.FEditer.ReCreateCaret(); + end + function SaveAllPageItems(); // + begin + its := FPageEditer.PageItems; + for i,v in its.Data do + begin + JudgeItemState(v); + end + its := FPageEditer.PageItems; + for i := 0 to its.Length()-1 do + begin + SavePageItem(its[i]); + end + end + function WMUSER(o,e):WM_USER;override; + begin + inherited; + if e.wparam=101 and e.lparam=102 then + begin + self.Enabled := true; + end + end + function EndFind(); + begin + FIsFinding := false; + _send_(WM_USER,101,102,1); + end + function DoFind(d,o); + begin + if FIsFinding then return; + o.SetStatusText("....."); + o.SaveCurrentEditer(); + self.Enabled := false; + FIsFinding := true; + if not(d["c_reg"])then + begin + if(d["section"]="")and(d["btn"]="ȫ")then + begin + FFindListWnd.Clean(); + ShowFindWnd(); + FindAllInCurrent(d,o,nil,ct); + o.SetStatusText(format("ҵ %d",ct)); + return EndFind(); + end else + if(d["section"]in array("","滻"))and(d["btn"]="")then + begin + FindInCurrent(d,o); + return EndFind(); + end else + if(d["section"]in array("滻"))and(d["btn"]="滻")then + begin + if d["replace"]<> d["target"]then FindInCurrent(d,o,nil,1); + return EndFind(); + end else + if(d["section"]in array("滻"))and(d["btn"]="ȫ滻")then + begin + if d["replace"]<> d["target"]then + begin + FFindListWnd.Clean(); + ShowFindWnd(); + ReplaceAllInCurrent(d,o,nil,idx); + o.SetStatusText(format("滻 %d",idx)); + end + return EndFind(); + end else + if(d["section"]in array("ļ"))and(d["btn"]="ȫ滻")then + begin + FFindListWnd.Clean(); + ShowFindWnd(); + FindInFiles(d,o,true,ct); + o.SetStatusText(format("ܹ滻 %d",ct)); + return EndFind(); + end else + if(d["section"]in array("ļ"))and(d["btn"]="")then + begin + FFindListWnd.Clean(); + ShowFindWnd(); + FindInFiles(d,o,false,ct); + o.SetStatusText(format("ܹ %d",ct)); + return EndFind(); + end + end + o.SetStatusText("ܿ...."); + EndFind(); + end + function DebugPageItem(it,h); + begin + if not it then return; + showdbugwnd(); + FTslDebug.Debuglocal(it); + end + function Debugremote(it); + begin + showdbugwnd(); + FTslDebug.Debugremote(it); + end + function DbgNextLine(); + begin + FTslDebug.DbgNextLine(); //FDebuger + end + function ExecutePageItem(it,h); + begin + if not it then return; + ShowEchoWnd(); + //exe :=(FTslExe and ifstring(FTslExe))?FTslExe:SysExecName(); + if FEchoWnd.Exeing()then FEchoWnd.Endexe(); + s := FExecuteEditer.GetCurrentExuteString(it.Scriptpath); + // echo s,"\r\n"; + FEchoWnd.Exec(s,"",h); + //FEchoWnd.Exec(exe,format('"%s" -libpath "%s"',it.ScriptPath,getdirfromfile(it.ScriptPath)),h); + end + {function ExecutePageItemWithCmd(it); + begin + s := FExecuteEditer.GetCurrentExuteString(it.Scriptpath); + hd := "d:\\test\\execmd.cmd"; + //RewriteString(hd,s); + _wapi.WinExec("cmd.exe",1); + //_wapi.WinExec("",1); + //SysExec("","cmd.exe /c " + s,nil,false,c,nil); + //echo "===\r\n"; + end } + function SavePageItem(it,f); + begin + if not it then return -1; + if f or it.PrePareSave()then + begin + it.FEditer.ChangedFlag := false; + s := it.LastText; + case it.EnCode of + "UTF8": + begin + s := AnsiToutf8(it.LastText); + end + "UTF8 BOM": + begin + //0xEF, 0xBB, 0xBF + s := " "; + s[1]:= 0xEF; + s[2]:= 0xBB; + s[3]:= 0xBF; + s += AnsiToutf8(it.LastText); + //ECHO "SAVE UTFB-BOM\r\n"; + end + "UCS2-little": + begin + s := " "; + s[1]:= 0xFF; + s[2]:= 0xFE; + s += multibytetounicode(it.LastText,936); + end + "UCS2-big": + begin + s2 := " "; + s2[1]:= 0xFF; + s2[2]:= 0xFE; + s2 += multibytetounicode(it.LastText,936); + s := ""; + setlength(s,length(s2)); + for i := 1 to length(s2)-1 step 2 do + begin + s[i]:= s2[i+1]; + s[i+1]:= s2[i]; + end + end + end; + fp := it.OrigScriptPath; + if it.FISstm then + begin + try + v := eval(&s); + //s := tostm(v); + r := exportfile(ftstream(),"",fp,v); + it.ReGetLastLoadTime(); + return r; + except + end + end + r := ReWriteString(fp,s); + it.ReGetLastLoadTime(); + return r; + end + return 1; + end + function ShowFindWnd(); + begin + FInfoShowWnd.ShowByTag(FFindListWnd); + ShowLogWnd(true); + end + function showdbugwnd(); + begin + FInfoShowWnd.ShowByTag(FTslDebug); + ShowLogWnd(true); + end + function ShowEchoWnd(); + begin + FInfoShowWnd.ShowByTag(FEchoWnd); + ShowLogWnd(true); + end + function SwitchLogWnd(); + begin + FInfoShowWnd.Visible := not(FInfoShowWnd.Visible); + DoControlAlign(); + end + function SetFindHistroy(d); + begin + FFindWnd.SetHistory(d); + end + function GetFindHistory(); + begin + return FFindWnd.GetHistory(); + end + function ShowLogWnd(flg); + begin + n :=(ifnil(flg)or flg)?true:false; + if n=FInfoShowWnd.Visible then return; + FInfoShowWnd.Visible := n; + DoControlAlign(); + end + function JudgeItemState(it); //״̬ + begin + lt := it.GetLastLoadTime(); + nlt := it.ReGetLastLoadTime(); + if not lt then return; + if nlt <> lt then + begin + FPageEditer.FCanDraged := false; + FPageEditer.MouseDrageLeave(); //˴֪Ϊʲôᱨ + if not nlt then //Ѿɾ + begin + if Messageboxa("ļѾɾ,Ȼ밴ȷ","ʾ",1,self)=IDOK then + begin + CreateDirWithFileName(it.OrigScriptPath); //½ + SavePageItem(it,true); + end else + begin + DeletepageItem(it); //ɾ + return true; + end + end else //޸ + begin + if Messageboxa(format("%s\r\n޸Ƿ¼",it.ScriptPath),"ʾ",1,self)=IDOK then + begin + LoadFromFile(it,true); + end else + begin + it.FEditer.ChangedFlag := true; + end + end + end + end + function PageItemTextChanged(o,flg); + begin + its := FPageEditer.Pageitems; + cit := GetCurrentItem(); + for i := 0 to its.Length()-1 do + begin + it := Its[i]; + if it.FEditer=o then + begin + if cit=it then + begin + if it.fisnewfile then Caption := (flg?"*":"")+" new "; + else + Caption :=(flg?"*":"")+it.OrigScriptPath; + end + callDatafunction(OnPageEditerChanged,it,flg); + it.BitmapA := flg?GetNeedSaveBmp():GetNneedSaveBmp(); + return; + end + end + end + function DeletePageItem(it); + begin + idx := FPageEditer.GetItemIndex(it); + if idx >= 0 then + begin + //f := it.OrigScriptPath; + FPageEditer.DeleteItemByIndex(idx); + it.Recycling(); + it := GetCurrentItem(); + if it then it.FEditer.ReCreateCaret(); + //if it.fisnewfile then filedelete("",f); + + end + end + function PageItemSelChanged(o,e);virtual; + begin + it := GetCurrentItem(); + if not it then return; + //if JudgeItemState(it) then return ; + FCurrentItemCode[length(FCurrentItemCode)]:= it; + if it.fisnewfile then + begin + Caption :=(it.FEditer.ChangedFlag?"*":"")+" new "; + end + else + begin + Caption :=(it.FEditer.ChangedFlag?"*":"")+it.OrigScriptPath; + end + CallDatafunction(FOnPageItemSelChanged,self(true),it); + cp := it.FEditer.Completion; + if cp and it.FInitCompletion then + begin + it.FInitCompletion := false; + cp.PrePareCompletion(it.Caption); + end + EditerCaretChanged(it.FEditer,nil); + end + function PageMenuClick(o,e); + begin + it := GetCurrentItem(); + if not it then return; + case o.Caption of + "ر": + begin + if it.fisnewfile then //½ر + begin + f := it.OrigScriptPath; + DeletePageItem(it); + if fileexists("",f) then filedelete("",f); + + return ; + end + if JudgeItemState(it)then return; + if it.FEditer.ChangedFlag then + begin + mr := MessageboxA(format("Ƿ񱣴:%s",it.OrigScriptPath),"ʾ",3,self); + if mr=IDYES then + begin + if SavePageItem(it)=0 then + begin + it.FEditer.ChangedFlag := true; + return 0; + end + end else + if mr=IDCANCEL then + begin + return; + end + end + DeletePageItem(it); + end + "رǩ": + begin + Cit := it; + its := GetAllPageItems(); + for i := 0 to its.Length()-1 do + begin + it := its[i]; + if it.FEditer.ChangedFlag then + begin + r := MessageBoxA("δļ,Ƿ񱣴!","ʾ",3,self); + if r=IDYES then + begin + SaveAllPageItems(); + break; + end else + if r=IDCANCEL then + begin + return; + end else + begin + end + break; + end + end + CloseAllPageItems(Cit); + end + "Ϊ": + begin + if JudgeItemState(it)then return; + //FFileopen.OverwritePrompt := true; + if FFileSave.OpenDlg()then + begin + fn := FFileSave.FileName; + dfn := it.ScriptPath; + CreateDirWithFileName(fn); + //echo format('FileCopy("","%s","","%s",false)',dfn,fn); + ret := FileCopy("",dfn,"",fn,false); + if ret then + begin + it.ScriptPath := fn; + if SavePageItem(it)=0 then + begin + it.FEditer.ChangedFlag := true; + end + if it.fisnewfile then + begin + FileDelete("",dfn); + it.fisnewfile := false; + end + end + end + //FFileopen.OverwritePrompt := false; + end + "¼": + begin + LoadFromFile(it,true); + end + "ļȫ": + begin + if not FCliper then FCliper := new TClipBoard(self); + FCliper.text := it.OrigScriptPath; + end + "ļ": + begin + if not FCliper then FCliper := new TClipBoard(self); + FCliper.text := it.Caption; + end + "Ŀ¼": + begin + p := it.ScriptPath; + if FileExists("",p)then + begin + for i := length(p)downto 3 do + begin + if p[i]="\\" then + begin + p := p[1:i]; + break; + end + end + //_wapi.WinExec('cmd.exe /C start "" "'+p,1); + _wapi.openresourcemanager(p); + end + end + "cmdִ": + begin + //ExecutePageItemWithCmd(it); + end + end + end + function PageItemOnRClick(o,e); + begin + if FPageEditer.GetItemIndexByPos(e.pos)>= 0 then o.PopUpMenu := FPageMenu; + else o.PoPupMenu := nil; + end + function PageEditerMenuClick(o,e); + begin + if pos("",o.caption)=1 then + begin + it := GetCurrentItem(); + if it then + begin + ed := it.FEditer; + if ed then + begin + ed.ExecuteCommand(ed.ecCopy); + end + //it.FEditer.ReadOnly := not(o.Checked); + end + return; + end else + if pos("ճ",o.caption)=1 then + begin + it := GetCurrentItem(); + if it then + begin + ed := it.FEditer; + if ed then + begin + ed.ExecuteCommand(ed.ecPaste); + end + //it.FEditer.ReadOnly := not(o.Checked); + end + return; + end else + if pos("",o.caption)=1 then + begin + it := GetCurrentItem(); + if it then + begin + ed := it.FEditer; + if ed then + begin + ed.ExecuteCommand(ed.ecCut); + end + //it.FEditer.ReadOnly := not(o.Checked); + end + return; + end else + if pos("λ",o.caption)=1 then + begin + InitShowWndPos(FGotoLineWnd,"g",200,200); + FGotoLineWnd.ShowGoto(); + return; + end else + if pos("鿴",o.caption)=1 then + begin + cs := o.Caption; + if length(cs)<6 then return; + s :=(o.Caption)[6:]; + GetCurrentEditer().Tryjump(s); + return; + end else + if pos("ֻ",o.caption)=1 then + begin + it := GetCurrentItem(); + if it then + begin + it.FEditer.ReadOnly := not(o.Checked); + end + return; + end else + if pos("ִ",o.Caption)=1 then + begin + it := GetCurrentItem(); + ExecutePageItem(it); + return; + end else + if pos("ֹͣ",o.Caption)=1 then + begin + if FEchoWnd.Exeing()then FEchoWnd.EndExe(); + return; + end else + if o.Caption = "תΪд" then + begin + upperorlowercase(1); + end else + if o.Caption = "תΪСд" then + begin + upperorlowercase(0); + end else + if o.Caption = "ɾβհ" then + begin + seltrimright(); + end + end + function PageEditerOnRClick(o,e); + begin + o.popupMenu := nil; + if not FPageEditerMenu then + begin + FPageEditerMenu := new TPopUpMenu(self); + FPageEditerMenus := array(); + for i,v in array("鿴","(C)","ճ(V)","(X)","λ(G)","ֻ","תΪд","תΪСд","ɾβհ","ִ(F9)","ִֹͣ") do + begin + it := new TMenu(self); + it.Caption := v; + it.parent := FPageEditerMenu; + FPageEditerMenus[v]:= it; + it.OnClick := thisfunction(PageEditerMenuClick); + end + end + rd := FPageEditerMenus["ֻ"]; + if rd then + begin + zd := GetCurrentItem().FEditer.Readonly; + rd.Checked := zd; + it := FPageEditerMenus["ճ(V)"]; + if it then it.Enabled := not zd; + it := FPageEditerMenus["(X)"]; + if it then it.Enabled := not zd; + end + rd := FPageEditerMenus["鿴"]; + if rd then + begin + mtic; + it := GetCurrentEditer(); + s := it.CanJump(); + if s then + begin + rd.Caption := "鿴:"+s; + rd.Enabled := true; + end else + begin + rd.Caption := "鿴"; + rd.Enabled := false; + end + end + ex := FEchoWnd.Exeing()?true:false; + rd := FPageEditerMenus["ִ(F9)"]; + if rd then rd.Enabled := not ex; + rd := FPageEditerMenus["ִֹͣ"]; + if rd then rd.Enabled := ex; + rd := FPageEditerMenus["ִ"]; + if rd then + begin + end + o.popupMenu := FPageEditerMenu; + //MessageBoxA("MESSAGErclick","tis",0); + end + function createparams(p);override; + begin + inherited; + P.ExStyle := P.ExStyle .| WS_EX_ACCEPTFILES; + end + {$ifdef linux} + function DragQueryFileA(); + {$else} + function DragQueryFileA(hDrop:pointer;iFile:integer;lpszFile:string;cch:integer):integer;stdcall;external "Shell32.dll" name "DragQueryFileA"; + {$endif} + function WMDROPFILES(o,e):WM_DROPFILES; + begin + dn := ""; + opends := array(); + for i := 1 to DragQueryFileA(e.wparam,0xFFFFFFFF,"",0) do + begin + len := DragQueryFileA(e.wparam,i-1,nil,0); + if len>0 then + begin + setlength(dn,len+10); + if DragQueryFileA(e.wparam,i-1,dn,len+1)>0 then + begin + opends[length(opends)]:= dn[1:len]; + end + end + end + for i,v in opends do + begin + arr := FileList("",v); + if not(pos("D",arr[0,"Attr"]))then OpenAndGotoFileByName(v); + end + end + function GetOpendPageItemByFileName(n); + begin + its := FPageEditer.PageItems; + for i := 0 to its.Length()-1 do + begin + it := its[i]; + if it.ScriptPathIs(n)then return it; + end + end + function EditerCaretChanged(o,e); + begin + if GetCurrentEditer()=o then + begin + FStatus.setitemtext(format("col:%d | %s",o.CaretX,o.PageItem.EnCode),1); + end + end + function OpenScriptByFileName(n); + begin + if not ifstring(n)then return false; + it := GetOpendPageItemByFileName(n); + if it then return it; + fl := FileList("",n); + if not(length(fl)=1)then return false; + nn := fl[0,"FileName"]; + if(POS("d",fl[0,"Attr"]))then return false; + it := new TPageEditerItem(FPageEditer); + it.FDebuger := FTslDebug; + it.FEditer.OnCaretChanged := thisfunction(EditerCaretChanged); + it.FEditer.Parent := FPageEditer; + it.FEditer.TabChar := FTabChar; + it.FEditer.PageItem := it; + it.FEditer.QuckKeys := Thisfunction(EditerQuckKeys); + it.FEditer.OnTextSetFocus := function(o,e) + begin + //echo "\r\n",o.PageItem.Scriptpath; + JudgeItemState(o.PageItem); + end + FPageEditer.PageItems.push(it); + nn1 := n; + nn1[(length(n)-length(nn)+1):]:= nn; + //echo nn1,"==",n,"\r\n"; + it.ScriptPath := nn1; + it.BitmapA := GetNneedSaveBmp(); + it.BitmapB := Closebmp(); + LoadFromFile(it,true); + for i,v in FReadDirs do + begin + if not ifstring(v)then continue; + if pos(v,n)=1 then + begin + it.FEditer.ReadOnly := true; + break; + end + end + //DoControlAlign(); + if it then + begin + SetHistoryFiles(n); + it.FEditer.OnRclick := thisfunction(PageEditerOnRClick); + it.FEditer.OnTextChanged := thisfunction(PageITEMtextChanged); + end + return it; + end + function GetHistoryFiles(); + begin + return FOpenHistory.Data; + end + function SetHistoryFiles(v); + begin + if ifarray(v)then + begin + for i,vi in v do + begin + SetHistoryFiles(vi); + end + return; + end + if ifstring(v)and v then + begin + fcadd := true; + for i,vi in FOpenHistory.Data do + begin + if filenameIsTheSame(v,vi)then + begin + fcadd := false; + break; + end + end + if fcadd then + begin + FOpenHistory.Push(v); + if FOpenHistory.Length()>30 then FOpenHistory.shift(); + end + end + end + function ShowHistoryWnd(); + begin + if not FHistoryWnd then + begin + FHistoryWnd := new TMouseMoveList(self); + FHistoryWnd.Visible := false; + FHistoryWnd.WSpOPUp := true; + FHistoryWnd.Parent := self; + FHistoryWnd.Caption := "ʷ...."; + FHistoryWnd.WSsysMenu := true; + FHistoryWnd.WsSizeBox := true; + FHistoryWnd.Width := 400; + FHistoryWnd.Height := 600; + {FHistoryClearMenuPop := new TPopUpMenu(self); + FHistoryClearMenu := new TMenu(self); + FHistoryClearMenu.Caption := "ʷ¼"; + FHistoryClearMenu.Parent := FHistoryClearMenuPop; + FHistoryWnd.PopUpMenu := FHistoryClearMenu; + FHistoryClearMenu.OnClick := function(o,e)begin + FHistoryWnd.SetData(array()); + FOpenHistory.Splices(0,FOpenHistory.Length()); + end } + FHistoryWnd.OnClose := function(o,e) + begin + o.EndModal(); + o.Visible := false; + e.skip := true; + end + FHistoryWnd.OnClick := function(o,e) + begin + idx := o.getCurrentSelection(); + if idx >= 0 then + begin + n := o.GetItem(idx); + o.EndModal(); + O.Visible := false; + OpenAndGotoFileByName(n); + end + end + end + if FOpenHistory.Length()>0 then + begin + FHistoryWnd.SetData(FOpenHistory.Data); + InitShowWndPos(FHistoryWnd,"history",100,100); + FHistoryWnd.ShowModal(); + end + end + function OpenAndGoLineByName(n,L); + begin + it := OpenScriptByFileName(n); + if it then + begin + if l>0 then + begin + ed := it.FEditer; + ed.ExecuteCommand(ed.ecGoToXY,array(L,1)); + end + end + return it; + end + function OpenAndGotoFileByName(n,L); + begin + bit := GetCurrentItem(); + if bit then + begin + if not((ifnil(L)or(L=bit.FEditer.CaretY))and(filenameIsTheSame(n,bit.ScriptPath)))then + begin + bit := array("file":bit.OrigScriptPath,"line":bit.FEditer.CaretY); + if FRebackFlag then FGoBackB.Push(bit); + else FGoBackA.Push(bit); + end + end + it := OpenAndGoLineByName(n,L); + if it then FPageEditer.SetSel(it); + return it; + end + function CommetCurrentSel(); //עѡ + begin + it := GetCurrentEditer(); + if it then + begin + if it.ReadOnly then return; + bg := it.BlockBegin; + ed := it.BlockEnd; + if bg and ed and ed[0]<> bg[0]then + begin + it.ExecuteCommand(it.ecTab,"//"); + end else + begin + it.ExecuteCommand(it.ecLineStart); + it.ExecuteCommand(it.ecString,"//"); + end + end + end + function UnCommentCurrentSel(); //ȡע + begin + it := GetCurrentEditer(); + if it then + begin + if it.ReadOnly then return; + bg := it.BlockBegin; + ed := it.BlockEnd; + if bg and ed and bg[0]<> ed[0]then + begin + it.ExecuteCommand(it.ecShifttab,array("//")); + end else + begin + s := it.LineText; + if pos("//",s)=1 then + begin + it.ExecuteCommand(it.ecLineStart); + it.ExecuteCommand(it.ecSelLineEnd); + if length(s)>= 3 then it.ExecuteCommand(it.ecString,s[3:]); + else it.ExecuteCommand(it.ecString,""); + end + end + end + end + function UnDoCurrentEditer(); + begin + it := GetCurrentEditer(); + if it then + begin + if it.ReadOnly then return; + self.Enabled := false; + it.ExecuteCommand(it.ecUndo); + self.Enabled := true; + if it.ChangedFlag then + begin + cit := GetCurrentItem(); + if it.Text=cit.LastText then // + begin + it.ChangedFlag := false; + end + end + end + end + function ToolClick(o,e); // + begin + case o.caption of + "ļ": + begin + OpenAFile(); + //FPages.OpenAFile(); + end + "½": + begin + CreateAFile(); + //FPages.CreateAFile(); + end + "ȫ": + begin + return SaveAllPageItems(); + end + "": + begin + it := GetCurrentItem(); + if SavePageItem(it)=0 then + begin + it.FEditer.ChangedFlag := true; + end + end + "ȡע": + begin + UnCommentCurrentSel(); + end + "ע": + begin + CommetCurrentSel(); + end + "ݼ˵": + begin + s := ""; + s += "ctrl+o \r\n"; + s += "ctrl+N ½\r\n"; + s += "ctrl+s \r\n"; + s += "ctrl+F Ҵ\r\n"; + s += "ctrl+R 滻\r\n"; + s += "ctrl+a ȫѡ\r\n"; + s += "ctrl+c ѡ\r\n"; + s += "ctrl+D Ʊ뵱ǰ\r\n"; + s += "ctrl+v ճ\r\n"; + s += "ctrl+x ѡ\r\n"; + s += "ctrl+G λ\r\n"; + s += "ctrl+L|Y ɾǰ\r\n"; + s += "tab | shift+tab ѡʱ\r\n"; + s += "ctrl+/ ע͵ǰѡ\r\n"; + s += "ctrl+\\ ȡǰע\r\n"; + s += "ctrl+U \r\n"; + s += "ctrl+z \r\n"; + s += "ctrl+tab лǩ\r\n"; + s += "F2 תһϵ\r\n"; + s += "F5 ɾϵ\r\n"; + s += "Alt+F5 ѡַתΪд\r\n"; + s += "ctl+F5 ѡַתΪСд\r\n"; + s += "F3 ǰַ\r\n"; + s += "ctrl+F3 ǰַ\r\n"; + s += "ctrl+tab лǩҳ\r\n"; + s += "F9 ִеǰҳĴ\r\n"; + s += "ctrl+F9 ִд༭\r\n"; + s += "F7 ʾ־\r\n"; + s += "F1 tslԲҵǰλõİ\r\n"; + s += "alt+m tslͼ\r\n"; + messageboxa(s,"ݼ˵",0,self); + end + "": + begin + UnDoCurrentEditer(); + end + "": + begin + it := GetCurrentEditer(); + if it then + begin + if it.ReadOnly then return; + self.Enabled := false; + it.ExecuteCommand(it.ecRedo); + self.Enabled := true; + end + end + "tsl﷨": + begin + it := GetCurrentEditer(); + if it then + begin + if not CheckTslCode(it.Text,err)then + begin + Messageboxa(err,"ʾ",0,self); + end else + messageboxa("tsl﷨","ʾ",0,self); + end + end + "tslʽ": + begin + it := GetCurrentEditer(); + if it then + begin + if 1 <> MessageboxA("ʽ!!","ʾ",1,self.Handle)then return; + if it.ReadOnly then return; + //sel := FCodeFormatInfo["sel"]; + syn := FCodeFormatInfo["syn"]; + arraytype := FCodeFormatInfo["arraytype"]; + cftype :=(FCodeFormatInfo["cmt"]=1); + arraytype :=(arraytype in array(0,1,3))?arraytype:1; + sel := true; + sel2 := false; + if sel then + begin + s := it.SelText; + if s then sel2 := true; + end + if not s then + begin + s := it.Text; + end + if not s then return; + if syn then + begin + if not CheckTslCode(s,err)then + begin + return Messageboxa(err,"ʾ-tsl﷨",0,self); + end + end + try + Enabled := false; + fs := UNIT(UTslCodeFormat).FormatTsl(s,FTabWidth,wordct,charct,arraytype,cftype); + if fs <> s then + begin + if sel and sel2 then + begin + it.SelText := fs; + end else + begin + it.Text := fs; + it.ExecuteCommand(it.ecGotoXY,array(1,1)); + end + end + finally + Enabled := true; + end; + end + end + "": + begin + FFindWnd.Show(); + end + "ǰ": + begin + GoToReBack(); + end + "": + begin + GoToBack(); + end + "ͼ(alt+m)": + begin + InitShowWndPos(FCodeMap,"cm",250,100); + FCodeMap.ShowMap(); + end + end + end + function GetCurrentItem(); + begin + return FPageEditer.CurrentItem; + end + function GetCurrentEditer(); + begin + it := GetCurrentItem(); + if it then return it.FEditer; + end + function DoControlAlign();override; // + begin + if not(FPageEditer and FPageEditer.parent=self)then return; + rr := ClientRect; + r := rr; + th := FToolbar.CalcHeightFixWidth(rr[2]-rr[0]); + //FToolbar.Height := th; + r[3]:= r[0]+th; + FToolBar.SetBoundsRect(r); + r := rr; + r[1]:= r[3]-FStatus.Height; + FStatus.SetBoundsRect(r); + rr := rr; + rr[1]:= FToolbar.Height+1; + rr[3]:= rr[3]-FStatus.Height-1; + {if ffolderdlg and ffolderdlg.Visible then + begin + r := rr; + fwd := min(ffolderdlg.Width,integer(r[2] * 0.6)); + r[2] := r[0]+fwd; + rr[0] := r[2]+1; + ffolderdlg.SetBoundsRect(r); + end } + if FInfoShowWnd.Visible and not(FInfoShowWnd.WSpOPUp)then + begin + r := rr; + + r[1]:= r[3]-min(FInfoShowWnd.Height,integer(r[3] * 0.6)); + rr[3]:= r[1]-1; + + {fwd := min(FInfoShowWnd.Width,integer(r[2] * 0.6)); //Ҳ + r[0] := r[2]-fwd; + rr[2] := r[0]-1;} + FInfoShowWnd.SetBoundsRect(r); + end + FPageEditer.SetBoundsRect(rr); + end + function CreateAFile(); //ļ + begin + if FTslCacheDir then + begin + idx := 0; + while true do + begin + idx++; + fn := FTslCacheDir+"newfile"+ioFileseparator()+"new"+inttostr(idx); + if fileexists("",fn) then continue; + r := ReWriteString(fn,""); + if r=1 then + begin + it := OpenAndGotoFileByName(fn); + it.fisnewfile := true; + end + return ; + end + end + FFileopen.Caption := "½ļ--ļ"; + FFileopen.Multiselected := false; + it := GetCurrentItem(); + if it then + begin + s := it.ScriptPath; + sp := ioFileseparator(); + for i := length(s)downto 2 do + begin + if s[i]=sp then + begin + FFileopen.initialDir := s[1:i-1]; + break; + end + end + end + if FFileopen.Opendlg()then + begin + exen := FFileopen.FileName; + if FileExists("",exen)then + begin + r := true; + end else + r := ReWriteString(exen,""); //exportfile(ftstream(),"",exen,"//createBytsl"); + if r=1 then OpenAndGotoFileByName(exen); + end + end + function OpenAFile(); //ļ + begin + FFileopen.Caption := "ļ"; + FFileopen.Multiselected := true; + it := GetCurrentItem(); + if it then + begin + if not it.fisnewfile then + begin + s := it.ScriptPath; + sp := ioFileseparator(); + for i := length(s)downto 3 do + begin + if s[i]=sp then + begin + FFileopen.initialDir := s[1:i-1]; + break; + end + end + end + end + if FFileopen.Opendlg()then + begin + rs := FFileopen.getResults(); + //echo tostn(rs); + lenrs := length(rs); + for i,v in rs do + begin + if lenrs=1 and not(FileList("",v))then + begin + if MessageboxA("ļ,ȷ½.ȡ˳","ʾ",1)=IDOK then + begin + ReWriteString(v,""); + end + end + OpenAndGotoFileByName(v,1); + end + end + end + function GoToBack(); + begin + FRebackFlag := true; + it := FGoBackA.Pop(); + if it then OpenAndGotoFileByName(it["file"],it["line"]); + FRebackFlag := false; + end + function GoToReBack(); + begin + it := FGoBackB.Pop(); + if it then OpenAndGotoFileByName(it["file"],it["line"]); + end + function seltrimright(); + begin + ed := GetCurrentEditer(); + IF not ed then return; + //ed.Lines.SetValueByIndex + b := ed.BlockBegin; + e1 := ed.BlockEnd; + + + try + if b and e1 then + begin + ed.IncPaintLock(); + for i := b[0] to e1[0] do + begin + s1 := ed.Lines.GetValueByIndex(i-1).FStr; + s := trimright(s1); + if s1=s then continue; + ed.Lines.SetValueByIndex(i-1,s); + end + ed.ExecuteCommand(ed.ecGoToXY,b); + ed.ExecuteCommand(ed.ecSelGotoXY,e1); + ed.DecPaintLock(); + end else + begin + s1 := ed.LineText; + s := trimright(s1); + if s1<>s then ed.LineText :=s; + end + + except + + end; + + + end + function upperorlowercase(f); + begin + ed := GetCurrentEditer(); + IF not ed then return; + s := ed.SelText; + if s then + begin + b := ed.BlockBegin; + e1 := ed.BlockEnd; + ed.SelText := f?uppercase(s):lowercase(s); + ed.ExecuteCommand(ed.ecGoToXY,b); + ed.ExecuteCommand(ed.ecSelGotoXY,e1); + end + end + function EditerQuckKeys(o,e);virtual; //ݼ + begin + if e.Result=0 and(ssAlt in e.shiftstate)then + begin + case e.charcode of + VK_F5: //д + begin + upperorlowercase(1); + e.skip := true; + return true; + end + ord("M"): + begin + InitShowWndPos(FCodeMap,"cm",250,100); + FCodeMap.ShowMap(); + e.skip := true; + return true; + end + end + end + if ssCtrl in e.ShiftState then + begin + if e.Result=0 then //down + begin + case e.CharCode of + 220,191: + begin + if e.CharCode=220 then UnCommentCurrentSel(); + else CommetCurrentSel(); + e.skip := true; + return true; + end + VK_F5: //Сд + begin + upperorlowercase(0); + return true; + end + ord("D"): + begin + ed := GetCurrentEditer(); + if not ed then return; + if ed.ReadOnly then return; + //xy := ed.CaretY; + ed.ExecuteCommand(ed.ecLineEnd,nil); + S := ed.LineText; + ed.ExecuteCommand(ed.ecString,"\r\n"+s); + return; + end + ord("R"): + begin + InitShowWndPos(FFindWnd,"fr",200,150); + FFindWnd.oPENreplace(); + FFindWnd.Show(); + return true; + end + ord("E"): + begin + ed := GetCurrentEditer(); + IF not ed then return; + s := ed.CaretWords(); + if s then ed.Tryjump(s); + return true; + end + ord("F"): + begin + InitShowWndPos(FFindWnd,"fr",200,150); + FFindWnd.OpenFind(); + FFindWnd.Show(); + return true; + end + ord("G"): + begin + InitShowWndPos(FGotoLineWnd,"g",200,200); + FGotoLineWnd.ShowGoto(); + return true; + end + ord("O"): + begin + OpenAfile(); + return true; + end + ord("N"): + begin + CreateAfile(); + return true; + end + ord("Z"): + begin + UnDoCurrentEditer(); + return true; + end + ord("S"): + begin + it := GetCurrentItem(); + if 0=SavePageItem(it)then + begin + it.FEditer.ChangedFlag := true; + end + return true; + end + end + end else //up + begin + case e.CharCode of + VK_TAB: + begin + TabChecking(ssShift in e.ShiftState); + return true; + end + VK_F3: + begin + d := FFindWnd.GetINfo(); + d["section"]:= ""; + d["btn"]:= ""; + d["c_revers"]:= 1; + DoFind(d,FFindWnd); + return true; + end + end + end + end + if e.Result=1 then + begin + case e.CharCode of + 17: + begin + if e.Result then + begin + TabCheckChanged(); + end + end + VK_F7: + begin + SwitchLogWnd(); + return true; + end + VK_F8: + begin + DbgNextLine(); + return true; + end + VK_F9: + begin + if ssctrl in e.ShiftState()then + begin + ShowExeEditer(); + return true; + end + ExecutePageItem(GetCurrentItem()); + return true; + end + VK_F3: + begin + d := FFindWnd.GetINfo(); + d["section"]:= ""; + d["btn"]:= ""; + d["c_revers"]:= 0; + DoFind(d,FFindWnd); + return true; + end + VK_F1: + begin + it := GetCurrentItem(); + if it.FSynType="tsl" then + begin + ed := it.FEditer; + IF not ed then return; + s := ed.CaretWords(); + if s then FTslChmHelp.SearchWord(s); + end + return true; + end + end; + end + end + function ShowTslLangChm(); + begin + FTslChmHelp.ShowTslLangChm(); + end + function InitShowWndPos(wnd,n,ix,iy); //ʼλ + begin + if not FFistShows[n]then + begin + FFistShows[n]:= true; + xy := Clienttoscreen(ix,iy); + wnd.left := xy[0]; + wnd.top := xy[1]; + end + end + function SetPageItemSyn(it,n); + begin + if not it then return; + if not ifstring(n)then return; + if it.FSynType=n then return; + hc := GetFreeSynObjectByName(n); + if hc then + begin + cp := hc[1]; + it.FEditer.IncPaintLock(); + it.FEditer.HighLighter := hc[0]; + it.FEditer.Completion := hc[1]; + it.FEditer.DecPaintLock(); + cp.OnJumpChoosed := function(cmp,d); + begin + f := d["file"]; + nf :=(f?(cmp.GetFileFullPath(f)):GetCurrentItem().OrigScriptPath); + //echo "\r\n",nf,"===",d["line"]; + OpenAndGotoFileByName(nf,d["line"]); + end + cit := GetCurrentItem(); + if cit=it then + begin + it.FInitCompletion := false; + cp.PrePareCompletion(it.Caption); + end else + begin + it.FInitCompletion := true; + end + it.FSynType := n; + end else + begin + it.FEditer.IncPaintLock(); + it.FEditer.HighLighter := nil; + it.FEditer.Completion := nil; + it.FEditer.DecPaintLock(); + it.FSynType := n; + end + end + function Recycling();override; + begin + inherited; + FSynHCS := nil; + FCurrentItemCode := array(); + FPageEditer := nil; + FToolbar := nil; + FStatus := nil; + FInfoShowWnd := nil; + FPageMenu := nil; + FPageEditerMenu := nil; + FPageEditerMenus := array(); + FOnPageEditerChanged := nil; + fOnPageItemSelChanged := nil; + FListPages := nil; + FCodeMap := nil; + FEchoWnd := nil; + FFindListWnd := nil; + FTempPageItem := nil; + FExecuteEditer := nil; + FTslDebug := nil; + end + function GetSynTypeNames(); + begin + return FSynClasses.IndexNames(); + end + function SetCodeFormatInfo(d); + begin + if ifarray(d)then FCodeFormatInfo := d; + else return FCodeFormatInfo; + end + function getexecuteparams(f); //õǰִв + begin + return FExecuteEditer.GetCurrentExuteparams(f); + end + function ShowExeEditer(flg); + begin + if ifnil(flg)or flg then + begin + InitShowWndPos(FExecuteEditer,"exe",200,200); + FExecuteEditer.showexeediter(); + + end else + begin + FExecuteEditer.Visible := false; + end + + end + function getlibpathstr(); + begin + dirs := ""; + fio := ioFileseparator(); + for i,v in FTslSearchDir do + begin + if ifstring(v)then + begin + if v[length(v)]=fio then + begin + dirs += v; + end else + begin + dirs += v; + dirs += fio; + end + end + dirs += ";"; + end + return dirs; + end + function echoAppendString(s); + begin + FEchoWnd.AppendString(s); + end + published //property λ + FHistoryDir; + property OnPageEditerChanged read FOnPageEditerChanged write FOnPageEditerChanged; + property OnPageItemSelChanged read FOnPageItemSelChanged write FOnPageItemSelChanged; + property TslSearchDir read FTslSearchDir write SetTslSearchDir; + property TslCacheDir read FTslCacheDir write SetTslCacheDir; + property TabWidth read FTabWidth write SetTabWidth; + property TabChar read FTabChar; + property Tslexe read FTslExe write FTslExe; + property ReadOnlyDirs read FReadDirs write FReadDirs; + protected + class function Sinit();override; + begin + inherited; + if not FSynClasses then FSynClasses := new TMyArrayA(); + end + class function GetSynTypeByFileType(ft); + begin + if not string(ft)then return "txt"; + nft := lowercase(ft); + for i,v in FSynClasses.IndexNames() do + begin + dv := FSynClasses[v]; + dvf := dv[2]; + if ifstring(dvf)then + begin + if pos(";"+nft+";",dvf)then + begin + return v; + end + end + end + return "None"; + end + class function RegSynType(n,h,c,files); + begin + if ifstring(n)and(h is class(TSynhighLighter))and(c is TSynCompletion)then + begin + FSynClasses[n]:= array(h,c,files); + end + end + class function UnRegSynType(n,h,c); + begin + if ifstring(n)then + begin + FSynClasses.DeleteIndex(n); + end + end + { + r["section"] := CurrentITem.Caption; + r["target"]:= FEdit_target.Editer.Text; + r["replace"]:= FEdit_repace.Editer.Text; + r["filetype"] := FEdit_type.Editer.Text; + r["dir"] := FEdit_dir.Editer.Text; + r["c_revers"]:=FCheck_revers.Checked; + r["c_cycle"]:= FCheck_cycle.Checked; + r["c_wrap"] := FCheck_wrap.Checked; + r["c_case"] := FCheck_case.Checked; + r["c_reg"] := FCheck_reg.Checked; + r["c_dir"] := FCheck_subdir.Checked; + } + function ReplaceAllInCurrent(data,fo,it,idx); + begin + data["c_revers"]:= 0; + data["c_cycle"]:= 0; + if not it then it := GetCurrentItem(); + if not it then return; + ed := it.FEditer; + if not ed then return; + idx := 0; + try + ed.IncPaintLock(); + ed.ExecuteCommand(ed.ecGotoXY,array(1,1)); + cidx := 0; + while FindInCurrent(data,fo,it,1)=0 do + begin + if idx=0 then + begin + FFindListWnd.AppendItem(array("caption":format("replace:%s in file:%s",data["target"],it.OrigScriptPath))); + end + if idx>0 then + begin + ed.MergeLastUndo(); + end + idx++; + L := ed.CaretY; + if cidx=L then continue; + cidx := L; + scap := format(" %d:(%d) ",idx,L)+trim(ed.LineText); + FFindListWnd.AppendItem(array("caption":scap,"file":it.OrigScriptPath,"line":L)); + end + finally + ed.DecPaintLock(); + end + //fo.SetStatusText(format("滻:%d ",idx)); + end + function FindInFiles(d,o,rep,ct); + begin + fs := GetFilesFormSearchInfo(d); + ct := 0; + for i,v in fs do + begin + if not FIsFinding then break; + o.SetStatusText("ļ:"+i); + it := GetOpendPageItemByFileName(i); + if not it then + begin + FTempPageItem.ScriptPath := i; + LoadFromFile(FTempPageItem,false); + it := FTempPageItem; + end + if rep then + begin + ReplaceAllInCurrent(d,o,it,idx); + SavePageItem(it); + end else + begin + FindAllInCurrent(d,o,it,idx); + end + ct += idx; + end + end + function FindInCurrent(data,fo,it,rep); + begin + if not it then it := GetCurrentItem(); + if not it then return-2; + ed := it.FEditer; + if not ed then return-2; + cy := ed.CaretY; + cx := ed.CaretX; + wordwrap := data["c_wrap"]; + fs := data["target"]; + if not(fs and ifstring(fs))then + begin + fo.SetStatusText("Ϊ!"); + return-2; + end + stringiswrapword := isCaseWords(fs); + if data["c_case"]then fs := lowercase(fs); + rstring := data["replace"]; + lfs := length(fs); + L := ed.Lines; + ct := L.length(); + if data["c_revers"]then + begin + for i := cy-1 downto cy-ct do + begin + ridx := i; + if data["c_cycle"]then + begin + ridx :=(ridx<0)?(ridx+ct):ridx; + end + if ridx<0 then + begin + fo.SetStatusText("ﶥ"); + return-2; + end + s := L.GetStringByIndex(ridx); + ls := length(s); + while cx-lfs+1>1 do + begin + if not FIsFinding then return-2; + TryDispatch(); + subs := s[cx-lfs:cx-1]; + if data["c_case"]then subs := lowercase(subs); + if subs=fs and(wordwrap?((stringiswrapword=3)or(((stringiswrapword .& 1)or IsWordsChar(s,cx-1,ls))and((stringiswrapword .& 2)or IsWordsChar(s,cx+lfs,ls)))):true)then //ҵ + begin + ed.ExecuteCommand(ed.ecGotoXY,array(ridx+1,cx)); + ed.ExecuteCommand(ed.ecSelGotoXY,array(ridx+1,cx-lfs)); + if rep then + begin + ed.SelText := rstring; + end + fo.SetStatusText(format("λ: %d %d",ridx+1,cx-lfs)); + return 0; + end + cx--; + end + tidx := ridx-1; + if data["c_cycle"]then + begin + tidx += ct; + tidx := tidx mod ct; + end else + begin + if tidx<0 then + begin + fo.SetStatusText("ﶥ"); + return-2; + end + end + s := L.GetStringByIndex(tidx); + cx := length(s)+1; + end + fo.SetStatusText("ﶥ"); + return-2; + end + for i := 0 to ct do + begin + ridx := i+cy-1; + if data["c_cycle"]then + begin + ridx := ridx mod ct; + end + if ridx >= ct then + begin + fo.SetStatusText("ײ"); + return-2; + end + s := L.GetStringByIndex(ridx); + ls := length(s); + while cx+lfs-1 <= ls do + begin + if not FIsFinding then return-2; + //GetAndDispatchMessageA(); + TryDispatch(); + subs := s[cx:cx+lfs-1]; + if data["c_case"]then subs := lowercase(subs); + if subs=fs and(wordwrap?((stringiswrapword=3)or(((stringiswrapword .& 1)or IsWordsChar(s,cx-1,ls))and((stringiswrapword .& 2)or IsWordsChar(s,cx+lfs,ls)))):true)then //ҵ + begin + ed.ExecuteCommand(ed.ecGotoXY,array(ridx+1,cx)); + ed.ExecuteCommand(ed.ecSelGotoXY,array(ridx+1,cx+lfs)); + if rep then + begin + ed.SelText := rstring; + end + fo.SetStatusText(format("λ: %d %d",ridx+1,cx)); + return 0; + end + //ûҵ + cx++; + end + cx := 1; + end + fo.SetStatusText("ײ"); + return-2; + end + function FindListChoosed(o,e); + begin + it := o.GetItem(o.GetCurrentSelection()); + if ifarray(it)then + begin + f := it["file"]; + l := it["line"]; + if ifstring(f)and l >= 0 then + begin + OpenAndGotoFileByName(f,l); + end + end + end + function TryDispatch(); + begin + {$ifdef linux} + return; + {$endif} + t := now(); + if(t-FLastDispathTime)>0.25e-5 then + begin + FLastDispathTime := t; + GetAndDispatchMessageA(); + end + end + function FindAllInCurrent(data,fo,it,rt); + begin + rt := 0; + if not it then it := GetCurrentItem(); + if not it then return; + ed := it.FEditer; + if not ed then return; + wordwrap := data["c_wrap"]; + fs := data["target"]; + if not(fs and ifstring(fs))then return fo.SetStatusText("ҵ 0 "); + if data["c_case"]then fs := lowercase(fs); + stringiswrapword := isCaseWords(fs); + lfs := length(fs); + L := ed.Lines; + ct := L.length(); + cidx := 0; + for i := 0 to ct-1 do + begin + s := L.GetStringByIndex(i); + ls := length(s); + cx := 1; + while cx+lfs-1 <= ls do + begin + if not FIsFinding then return rt; + //GetAndDispatchMessageA(); + TryDispatch(); + subs := s[cx:cx+lfs-1]; + if data["c_case"]then subs := lowercase(subs); + //((stringiswrapword .& 2) and (IsWordsChar(s,cx-1,ls)) ( (stringiswrapword .& 1) and IsWordsChar(s,cx+lfs,ls)) ) + if subs=fs and(wordwrap?((stringiswrapword=3)or(((stringiswrapword .& 1)or IsWordsChar(s,cx-1,ls))and((stringiswrapword .& 2)or IsWordsChar(s,cx+lfs,ls)))):true)then //ҵ + begin + if rt=0 then FFindListWnd.AppendItem(array("caption":format("find:%s in file:%s",fs,it.OrigScriptPath),"file":it.OrigScriptPath,"line":1)); + cx += lfs; + rt++; + if cidx=i+1 then continue; + cidx := i+1; + scap := format(" %d:(%d) ",rt,i+1)+trim(s); + FFindListWnd.AppendItem(array("caption":scap,"file":it.OrigScriptPath,"line":i+1)); + continue; + end + //ûҵ + cx++; + end + end + return rt; + end + function isCaseWords(s); //жȫƥ + begin + if ifstring(s)and s then + begin + len := length(s); + if len=1 then return IsWordsChar(s,1,1); + return IsWordsChar(s,1,1).|(2 * IsWordsChar(s,len,len)); + end + end + function IsWordsChar(s,idx,len); + begin + if not(len>0)then len := length(s); + if idx>len then return true; + if idx<1 then return true; + ivi := ord(s[idx]); + if(ivi<48)or(ivi>57 and ivi<65)or(ivi>90 and ivi<95)or(ivi>95 and ivi<97)or(ivi>122 and ivi <= 127)then return true; + end + function TabCheckChanged(); + begin + if not FListPages.Visible then return; + FListPages.Visible := false; + n := FListPages.GetSelFileName; + OpenAndGotoFileByName(n); + end + function TabChecking(f); + begin + its := FPageEditer.PageItems; + if not(its.Length()>1)then return FCurrentItemCode := array(); + if FListPages.Visible then + begin + FListPages.IncIndex((f>0)?1:(-1)); + end else + begin //ʼ + bit := GetCurrentItem(); + for i := 0 to its.Length()-1 do + begin + it := its[i]; + it.FPageOrderId := 0; + end + idx := 1; + for i := length(FCurrentItemCode)-1 downto 0 do + begin + it := FCurrentItemCode[i]; + if it.FPageOrderId<1 then it.FPageOrderId := idx++; + end + sr := array(); + for i := 0 to its.Length()-1 do + begin + it := its[i]; + sv := it.OrigScriptPath; + if it.FEditer.ChangedFlag then sv := "*"+sv; + sr[i,0]:= sv; + sr[i,1]:= it.FPageOrderId; + sr[i,2]:= it; + if it.FPageOrderId=0 then + begin + it.FPageOrderId := idx++; + end + end + sit := sselect[0]from sr order by[1]asc end; + FCurrentItemCode := sselect[2]from sr order by[1]desc end; + FListPages.SetData(sit); + FListPages.IncIndex(-1); + xy := ClientToScreen(100,100); + FListPages.Top := xy[1]; + FListPages.Left := xy[0]; + //FListPages.SetBoundsRect(array(xy[0],xy[1],xy[0]+600,xy[1]+600)); + //FListPages.Visible := true; + FListPages.Show(SW_SHOWNOACTIVATE); + //bit.FEditer.SetFocus(); + end + end + function GetFreeSynObjectByName(n); + begin + if not ifstring(n)then return; + lns := FSynHCS[n]; + if not lns then + begin + lns := new TMyARRayB(); + FSynHCS[n]:= lns; + end + for i := 0 to lns.length()-1 do + begin + vi := lns[i]; + if not(vi[0].Memo)then return vi; + end + hc := CreateASynObject(n,self); + if hc then + begin + lns.Push(hc); + return hc; + end + end + public + FExecuteEditer; + private + class function CreateASynObject(n,ow); + begin + c := FSynClasses[n]; + //if not c then c := FSynClasses["txt"]; + if c then + begin + if ifobj(c[0])and ifobj(c[1])then return array(CreateObject(c[0],ow),CreateObject(c[1],ow)); + end + end + static FSynClasses; + FCodeFormatInfo; + FTslChmHelp; + FFistShows; + FSynHCS; + FLastDispathTime; + FIsFinding; + FOnPageEditerChanged; + FPageEditerMenu; + FPageEditerMenus; + fOnPageItemSelChanged; + FReadDirs; + FCurrentItemCode; + FGoBackA; // := new TMyarrayB(); + FGoBackB; // := new TMyarrayB(); + FRebackFlag; + FPageEditer; + FToolbar; + FStatus; + FInfoShowWnd; + FCodeMap; + FListPages; + FFindWnd; + FFindListWnd; + FEchoWnd; + FGotoLineWnd; + FFileopen; + FFileSave; + FPageMenu; + //ͼ + FNeedSaveBmp; + FNotNeedSaveBmp; + FBmpClose; + FTabWidth; + FTabChar; + FTslexe; + FTslSearchDir; + FTslCacheDir; + FTempPageItem; + FOpenHistory; + FHistoryWnd; + FTslDebug; + private + function GetFilesFormSearchInfo(d); + begin + r := array(); + dir := d["dir"]; + if not dir then return r; + ft := d["filetype"]; + if ft then + begin + ft := str2array(ft,";"); + end + if not ft then ft := array("*"); + FindFiles(dir,ft,d["c_dir"],r); + return r; + end + function FindFiles(dir,ft,sub,ret); + begin + dir_ := dir; + sp := ioFileseparator(); + if not(dir_[length(dir_)]=sp)then dir_ += sp; + if sub then + begin + dirs := FileList("",dir_+"*"); + for i,v in dirs do + begin + TryDispatch(); + if not FIsFinding then return; + fn := v["FileName"]; + if(pos("D",v["Attr"]))and not(fn in array(".",".."))then + begin + FindFiles(dir_+fn,ft,sub,ret); + end + end + end + for i,v in ft do + begin + vi := trim(v); + if not vi then continue; + fs := FileList("",dir_+vi); + for j,vj in fs do + begin + if(POS("D",vj["Attr"]))then continue; + ret[dir_+vj["FileName"]]:= true; + end + end + end + function SetTslCacheDir(d); + begin + if FTslCacheDir=d then return; + if ifstring(d)then + begin + FTslCacheDir := d; + class(TTSLCompletion).SetCacheDir(d); + end + end + function SetTslSearchDir(d); + begin + if FTslSearchDir=d then return; + if ifarray(d)then + begin + FTslSearchDir := d; + class(TTSLCompletion).SetFindDirs(d); + its := GetAllPageItems(); + for i := 0 to its.Length()-1 do + begin + it := its[i]; + it.RepreComple := true; + end + end + end + function SetTabWidth(n); + begin + if not(n >= 0)then return; + nn := integer(n); + if nn >= 0 and nn <> FTabWidth then + begin + FTabWidth := nn; + if nn=0 then FTabChar := "\t"; + else + begin + FTabChar := ""; + for i := 1 to nn do + begin + FTabChar += " "; + end + end + its := FPageEditer.PageITems; + for i := 0 to its.Length()-1 do its[i].FEditer.TabChar := FTabChar; + end + end + function getdirfromfile(p); + begin + r := ""; + if not ifstring(p)then return r; + sp := ioFileseparator(); + for i := length(p)downto 1 do + begin + if p[i]=sp then return p[1:i]; + end + return r; + end + function LoadFromFile(it,ifinit); + begin + p := it.ScriptPath; + sz := filesize("",p); + if readFile(rwRaw(),"",p,0,sz,s)then + begin + it.ReGetLastLoadTime(); + if lowercase(p[length(p)-3:length(p)])=".stm" then + begin + try + if s then + begin + v := stm(s); + s := tostn(v); + end + it.FEditer.ReadOnly := true; + it.FISstm := true; + except + end + end + edt := it.FEditer; + tl := edt.TopLine; + cxy := edt.CaretXY; + it.SetLoadScript(s); + if ifinit then + begin + + InitScriptHighLighter(it); + edt.TopLine := tl; + edt.ExecuteCommand(edt.ecGotoXY,cxy); + end + end else + begin + //MessageBoxA(s,"ʾ",0,self); + it.ReGetLastLoadTime(); + it.SetLoadScript(s); + it.FEditer.ReadOnly := true; //ΪԶ + end + end + function InitScriptHighLighter(it); + begin + p := it.ScriptPath; + for i := length(p)downto 3 do + begin + if p[i]="." then + begin + synt := GetSynTypeByFileType(p[i+1:]); + return SetPageItemSyn(it,synt); + end + end + end + function GetNNeedSaveBmp(); + begin + if not FNOTneedSaveBmp then + begin + s := "0502000000060400000074797065000203000000696D670006040000006461746 +100027701000089504E470D0A1A0A0000000D4948445200000030000000300806 +0000005702F987000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000010C49444154 +6843ED9AC1AA83500C05FBFFBFE84E45117521A21B955B023790B6E73D5B29490 +A199876D148CFACDB5B5DD7A9288A9FB1AAAA741C47626EE8C8BBEBBAE6F92701 +C3309889F6B06F07C8436DD01E360234407BD808D000ED61234003B4878D000DD +01E360234407BD808D000ED61234003B4878D000DD01E360234407BD88F02AC44 +7B58FA9CF937C0AB11606D04581B01D64680B59702BE0D8D40DFF38E11F00D222 +0732960DFF7D434CD8BD334E58B73CC03D08D4940DBB6F0E85989AB007AE9BA0E +1E4A25EE0288B30889CB00A2EF7BF80029711B40FC1521711D40A01F9A25EE038 +8711C1F1E9258069465F9F85F89FCFE11DBB6A5799E5F5C96255FE87129C0133F +1E90D21D478EF0B86077F81A0000000049454E44AE42608200"; + FNOTneedSaveBmp := new TBitmap(); + FNOTneedSaveBmp.ReadVcon(HexFormatStrToTsl(s)); + end + return FNOTneedSaveBmp; + end + function Closebmp(); + begin + if not FBmpClose then + begin + FBmpClose := new TBitmap(); + s := "0502000000060400000074797065000203000000696D670006040000006461746 +100025601000089504E470D0A1A0A0000000D494844520000001C000000100806 +00000005CF1FEF000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000EB49444154 +484B63F88F03FC7DFCF0FFEF3327C9C6B8005E0BDF19A89285BFB637424DC1040 +42DFC36B1FBFFD7E61A0C43D1F17B0BDDFF7FAE5DFEFFC1C789320B3F0679FEFF +73E7365E4BDF3B9881D57C9F3E09CCA7C84210865BDA5A0F1783E10F1E7628968 +130C5168230CCD26F3D6D08B100370CCB40982A168230DCD2C9BD7036BA65204C +350B411866112ECB40983616DEBE497B0B9183F163A007381BD02C48B1C5D9072 +F47AC96526C21CCB26FD326A2180CC21F5CAC302CA5C842B865FD9D7003D1F17B +5B63144B29B2105CB4B537A058800DBF37D7A14ED1460E26DB426CD50EB1183BF +8FF1F00B989BEC710621E4C0000000049454E44AE42608200"; + FBmpClose.ReadVcon(HexformatStrToTsl(s)); + end + return FBmpClose; + end + function GetNeedSaveBmp(); + begin + if not FNeedSaveBmp then + begin + s := "0502000000060400000074797065000203000000696D670006040000006461746 +10002A701000089504E470D0A1A0A0000000D4948445200000030000000300806 +0000005702F987000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000013C49444154 +6843ED8FBB4A43511045F32F7E908D95BDAD551A6DAC6C6CB4110276368282852 +00ADAD908B6E94212141F49A110BC820FC2918133307A3737C925CC4C6016AC34 +9993ECD5E8AF1EA4F6D2E6C2D85B69A5F1C757621AE8C8BBC56D37CF9F1030DCB +B3613ED61A70E9087DAA03D6C046880F6B011A001DAC3468006680F1B011AA03D +6C046880F6B011A001DAC3468006680F1B011AA03D6C046880F6B033055889F6B +0F43D5319E0D508B03602AC8D006B23C0DA5A01F38646A0FF99C60898071190A9 +15F0F35AA4FBB5C3926FC777F96232E601E8C624E061FD081EFD57E22A803E1E9 +B27F0502A7117403C6D9CC26356E2328078DE3A830F4889DB00E265FB1C3E92B8 +0E20063B97A54712F701C470F7EACF2389654077793F8D8BCFFC2B1501557C0F4 +66974D12EF97ED3C9177AD40AF0C48207A4F40B898CCDD8EC600A800000000049 +454E44AE42608200"; + FNeedSaveBmp := new TBitmap(); + FNeedSaveBmp.ReadVcon(HexFormatStrToTsl(s)); + end + return FNeedSaveBmp; + end + end + implementation + type tdbgselwnd=class(tdcreateform) + uses tslvcl; + label1:tlabel; + furl:tedit; + label2:tlabel; + fport:tedit; + label3:tlabel; + fusr:tedit; + label4:tlabel; + label5:tlabel; + fpwd:tpassword; + fdir:tedit; + fdiag:tfolderchooseadlg; + flist:tlistview; + fcbtn:tbtn; + flogout:tbtn; + flogin:tbtn; + fdbg:tbtn; + cancel_clk; + save_clk; + dbg_clk; + fhistorydir; + function Create(AOwner);override; // + begin + inherited; + Visible := false; + Loader.LoadFromTfmScript(self,getinfo()); + flist.Columns := array( + ("text":"ID","width":150), + ("text":"Ϣ","width":300), + ("text":"ʱ","width":100) + ); + flogout.top := 140; + flogout.OnClick := function(o,e) + begin + calldatafunction(cancel_clk,self,e); + end + flogin.OnClick := function(o,e) + begin + if fhistorydir and ifstring(fhistorydir)then + begin + Fremotepath := fhistorydir+"remoteinfo.tsm"; + d := getdata(); + Exportfile(ftstream(),"",Fremotepath,d); + end + calldatafunction(save_clk,self,e); + end + fdbg.onclick := function(o,e) + begin + calldatafunction(dbg_clk,self,e); + end + setlist(); + end + function setattachwait(flg); //õ½ʽ + begin + if flg then + begin + Height := 210; + end else + begin + Height := 550; + end + end + function loaddata(); // + begin + if fhistorydir and ifstring(fhistorydir)then + begin + Fremotepath := fhistorydir+"remoteinfo.tsm"; + if fileexists("",Fremotepath)and(1=importfile(ftstream(),"",Fremotepath,d))then + begin + setdata(d); + end + end + end + function getdata(); + begin + r := array(); + r["addr"]:= furl.text; + r["port"]:= fport.text; + r["usr"]:= fusr.text; + r["pwd"]:= fpwd.text; + r["dir"]:= fdir.text; + return r; + end + function tserlogersimplewnd1_close(o;e);virtual; + begin + e.skip := true; + end + function Recycling();override; //ձ + begin + inherited; + ci := self.classinfo(); //ԱֵΪnilѭ + for i,v in ci["members"] do + begin + if v["static"]then continue; + invoke(self,v["name"],nil); + end + end + function getdir(); + begin + if fdiag.ChooseDlg()then + begin + fdir.text := fdiag.Folder; + end + end + function setlist(d); + begin + FList.DeleteAllItems(); + fdbg.Enabled := false; + if d and ifarray(d)then + begin + FList.appendItems(d); + FList.SelectedId := 0; + fdbg.Enabled := true; + end + end + function getstartfilename(sv); + begin + dirt := fdir.Text; + if not sv then sv := FList.SelectedValue; + if dirt and sv then + begin + if sv then + begin + fs := sv["info"]; + if fs then + begin + for i := length(fs)-1 downto 1 do + begin + if fs[i]in array("\\","/")then + begin + fs := fs[i+1:]; + break; + end + end + return gettruefile(dirt,fs,ioFileseparator()); + end + end + end + end + private + function getinfo(); + begin + return %% +object tserlogersimplewnd1:tserlogersimplewnd + caption="Զ̵" + color=0xFFFFFF + top=100 + height=550 + minmaxbox=false + onclose=tserlogersimplewnd1_close + width=580 + wsdlgmodalframe=true + wssizebox=false + object label1:tlabel + left=4 + top=3 + width=80 + height=25 + caption="ַ" + end + object furl:tedit + height=25 + left=88 + tabstop=true + top=3 + width=204 + end + object label2:tlabel + left=296 + top=3 + width=34 + height=25 + caption="˿" + end + object fport:tedit + height=25 + left=333 + tabstop=true + top=3 + width=62 + end + object label3:tlabel + left=2 + top=38 + width=80 + height=25 + caption=" û" + end + object fusr:tedit + height=25 + left=88 + tabstop=true + top=38 + width=300 + end + object label4:tlabel + left=2 + top=72 + width=80 + height=25 + caption=" " + end + object label5:tlabel + left=2 + top=100 + width=80 + height=25 + caption=" űĿ¼" + end + + object fpwd:tpassword + height=25 + left=88 + tabstop=true + top=72 + width=300 + end + object fdir:tedit + height=25 + left=88 + tabstop=true + top=100 + width=300 + end + object fcbtn:tbtn + caption="..." + height=25 + left=390 + tabstop=true + top=100 + width=22 + onclick=getdir + end + object flogout:tbtn + an1chors=[akright akbottom] + caption="ȡ" + height=23ff + left=375 + tabstop=true + top=480 + width=74 + end + object fdbg:tbtn + an1chors=[akright akbottom] + caption="" + height=23 + left=470 + tabstop=true + top=480 + width=74 + end + object flogin:tbtn + caption="" + height=23 + left=470 + tabstop=true + top=140 + width=74 + end + object flist:tlistview + anch1ors=[akTop akright akLeft akBottom] + height=290 + left=2 + top=180 + width=560 + end + object fdiag:tfolderchooseadlg + caption="ִĿ¼" + end +end +%%; + end + private + function setdata(d); + begin + if not ifarray(d)then return; + furl.text := d["addr"]; + fport.text := d["port"]; + fusr.text := d["usr"]; + fpwd.text := d["pwd"]; + fdir.text := d["dir"]; + end + function gettruefile(dir,n,fio); + begin + if dir and ifstring(dir)then + begin + rfile := dir+fio+n; + if fileexists("",rfile)then return rfile; + for i,v in FileList("",dir+fio+"*") do + begin + fn := v["FileName"]; + if pos("D",v["Attr"])and not(fn in array(".",".."))then + begin + rfile := gettruefile(dir+fio+fn,n,fio); + if rfile then return rfile; + end + end + end + end + end + function tdbgcallback(); + begin + global g_tsldbgcallback_handle; + if g_tsldbgcallback_handle then call(g_tsldbgcallback_handle,sysparams); + end + function filenameIsTheSame(p1,p2); + begin + if not(ifstring(p1)and ifstring(p2))then return 0; + if p1=p2 then return 1; + {$ifdef linux} + {$else} + return lowercase(p1)=lowercase(p2); + {$endif} + end + type TMouseMoveList=class(TListBox) + function Create(AOwner);override; + begin + inherited; + FCurrentIndex :=-1; + end + function MouseMove(o,e);override; + begin + inherited; + idx := GetIdxByYpos(e.ypos); + if FCurrentIndex <> idx then + begin + FCurrentIndex := idx; + InValidateRect(nil,false); + end + end + function getItemText(i);override; + begin + r := inherited; + return " "+r; + end + function PaintIdx(idx,rc_,cvs);virtual; + begin + {** + @explan(˵) %% + @param(item)(TCustomListItem) %% + @param(rc)(array) %% + @param(cvs)(tcanvas) %% + **} + inherited; + if idx=FCurrentIndex then + begin + rc := rc_; + rc[2:3]-= 1; + cvs.pen.Color := rgb(30,144,255); + cvs.draw("Polyline",array(rc[0:1],(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),rc[0:1])); + end + end + private + FCurrentIndex; + end + type TTSLDataGrid=class(TDrawGrid) + {** + @explan(˵)TSLͶչʾ %% + **} + private + static FHGS; + ftext; + FCols; + Fdata; + FMRWD; + FGridControl; + FRows; + FShowTwo; + FCControls; + FColumnWidth; + FRowHeader; + FControlIndex; + FStringAlign; + FNumberAlign; + FDefAlign; + FCanedit; + function showstring(f); + begin + if ifarray(Fdata)then + begin + gettxtobj(); + ftext.text := ""; + if f then + begin + ftext.HighLighter := FHGS[1]; //FHGS[1]; + ftext.Caption := "json"; + ftext.text := ejsonformat(Fdata); + end else + begin + ftext.HighLighter := FHGS[0]; + ftext.Caption := "ԭ...."; + ftext.text := tostn(Fdata); + end + ftext.show(); + end + end + function getdata(i,j,cp,indexs); + begin + {** + @explan(˵) ȡ + **} + if j=0 and FRowHeader then return FRows[i]; + r := FRows[i]; + if FCols and FShowTwo then + begin + if FRowHeader then c := FCols[j-1]; + else c := FCols[j]; + d := FData[r][c]; + if cp then cp := "["+tostn(r)+"]"; + if cp then cp += "["+tostn(c)+"]"; + if indexs then indexs := array(r,c); + end else + begin + d := FData[FRows[i]]; + if cp then + begin + cs := r; + if ifstring(cs)then cs := replacetext(cs,".","\\o"); + cp := "["+tostn(cs)+"]"; + end + if indexs then indexs := array(r); + end + return d; + end + function SetStringAlign(v); + begin + if v <> FStringAlign then + begin + FStringAlign := v; + InvalidateRect(nil,true); + end + end + function SetNumberAlign(v); + begin + if v <> FNumberAlign then + begin + FNumberAlign := v; + InvalidateRect(nil,true); + end + end + function SetdefAlign(v); + begin + if v <> FDefAlign then + begin + FDefAlign := v; + InvalidateRect(nil,true); + end + end + function GetTSLData(); + begin + return FData; + end + function StrToNumber(s); + begin + if pos(".",s)then + begin + return StrToFloatDef(s,0); + end else + begin + return StrToIntDef(s,0); + end + end + function SetRowHeader(v); + begin + nv := v?true:false; + if FRowHeader <> nv then + begin + FRowHeader := nv; + FD := FData; + SetData(array()); + SetData(FD); + end + end + function SetTwoD(v); + begin + //if parent is class(TTSLDataGrid)then exit; + nv := v?true:false; + if nv <> FShowTwo then + begin + if FCanedit and nv then return; //༭ + FD := FData; + SetData(array()); + FShowTwo := nv; + SetData(FD); + end + end + function setdatap(); + begin + if not Fdata then exit; + FCols := nil; + FRows := mrows(Fdata,1); + FCL := mcols(Fdata,1); + allFCL := true; + if FShowTwo then + begin + for i,v in FData do + begin + if not ifarray(v)then + begin + allFCL := false; + break; + end + end + end + fcs := array(); + wd := 150; + for i,v in FRows do + begin + if ifstring(v)then + begin + wd := max(wd,length(v) * 9); + if wd>200 then break; + end + end + if RowHeader then + begin + fcs[0]:= array("text":" ","width":min(200,wd)); + end + if FCL and allFCL and FShowTwo then + begin + FCols := FCl; + for i,v in FCols do + begin + fcs[length(fcs)]:= array("text":ifstring(v)?v:inttostr(v),"width":FMRWD); + end + end else + begin + fcs[length(fcs)]:= array("text":" ","width":ColumnWidth>20?ColumnWidth:150); + end + Columns := fcs; + ItemCount := length(FRows); + end + function gettxtobj(); + begin + if not ftext then + begin + FText := new TFTSLScriptMemo(self); //tmemo(self); + //ftext.HighLighter := FHGS[0]; + ftext.readonly := true; + ftext.left := left+20; + ftext.top := top+20; + ftext.width := 500; + ftext.height := 400; + ftext.wspopup := true; + FText.WsSysMenu := true; + ftext.WsSizeBox := true; + FText.onclose := function(o,e) + begin + e.skip := true; + o.visible := false; + end + FText.parent := self; + end + return ftext; + end + function SetData(data,f); + begin + if Fdata=data then return; + DeleteAllColumns(); + if ftext then ftext.Visible := false; + for i,v in mrows(FCControls,1) do + begin + obj := FCControls[v]; + obj.TSLdata := nil; + obj.Visible := false; + obj.Parent := nil; + end + FCControls := array(); + FData := data; + setdatap(); + end + function itemishow(r,r2); + begin + return r[2]r2[2]; + end + function getdtobject(); + begin + global Fdtobjects; + if not ifarray(Fdtobjects)then Fdtobjects := array(); + for i,v in Fdtobjects do + begin + p := v.Parent; + if not p then + begin + return v; + end + end + o := new TTSlDataGrid(initializeapplication()); + o.ControlIndexs(idexs); + o.height := 500; + o.width := 500; + o.Twodimensional := Twodimensional; + o.Visible := false; + o.wspopup := true; + o.WsSysMenu := true; + o.WsSizeBox := true; + o.onclose := thisfunction(ShowDataClose); + Fdtobjects[length(Fdtobjects)]:= o; + return o; + end + function getitemcontrol(d,p,i,j,tp,cp,idexs); + begin + idx := format("%d*%d",i,j); + o := FCControls[idx]; + if tp="grid" then + begin + if not o then + begin + o := getdtobject(); + o.parent := self; + FCControls[idx]:= o; + end + //o.Twodimensional := Twodimensional; + if o.wspopup then p := ClientToScreen(p[0],p[1]); + o.left := p[0]-20; + o.top := p[1]-20; + o.caption := caption+"."+cp; + o.TSLdata := d; + o.show(); + end + end + public + function create(AOwner);override; + begin + inherited; + if not fhgs then + begin + FHGS := array(); + FHGS[0]:= new TTslSynHighLighter(initializeapplication()); + FHGS[1]:= new TJsonSynHighLighter(initializeapplication()); + end + GridLine := true; + FCControls := array(); + FRowHeader := true; + FixedColumns := 1; + itemheight := 25; + caption := ""; + FMRWD := 150; + FShowTwo := false; + OndblClick := thisfunction(GridCellDblClick); + FNumberAlign := AL9_CENTERRIGHT; + FStringAlign := AL9_CENTERLEFT; + FDefAlign := AL9_CENTER; + mu := new TPopupmenu(self); + for i,v in array("һά","ά","ԭ","json") do + begin + mi := new TMenu(self); + mi.parent := mu; + mi.caption := v; + mi.OnClick := function(o,e) + begin + case o.caption of + "һά": + begin + Twodimensional := false; + end + "ά": + begin + if FCanedit then return; + Twodimensional := true; + end + "ԭ": + begin + showstring(); + end + "json": + begin + showstring(1); + end + end + end + end + PopupMenu := mu; + end + function DoDrawSubItem(o,e);override; + begin + inherited; + if e.skip then exit; + dc := e.canvas; + i := e.itemid; + j := e.subitemid; + d := getdata(i,j); + src := e.SubItemRect; + if j=0 and FRowHeader then + begin + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,DFCS_BUTTONPUSH); + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_BUTTON,DFCS_BUTTONPUSH); + end + ds := ""; + dc.font.color := 0; + if ifarray(d)then + begin + ds := format("",length(d)); + //dc.drawtext(ds,src); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FDefAlign); + end else + if ifstring(d)then + begin + ds := d; + //dc.drawtext(ds,src); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FStringAlign); + end else + begin + ds := tostn(d); + if d<0 then dc.font.color := rgb(200,0,0); + if ifnumber(d)and j>0 then + begin + //dc.drawtext(ds,src,DT_RIGHT); + class(TLabel).CanvasDrawAlignText(dc,src,ds,FNumberAlign); + end else + begin + //dc.drawtext(ds,src); + if not ifnil(d)then class(TLabel).CanvasDrawAlignText(dc,src,ds,FStringAlign); + end + end + end + function GridCellDblClick(o,e);virtual; + begin + cp := 1; + cl := e.isubitem; + if cl<1 and FRowHeader then exit; + indexs := 1; + d := getdata(e.iitem,cl,cp,indexs); + p := e.ptaction; + if ifarray(d)then + begin + if d then getitemcontrol(d,p,e.iitem,cl,"grid",cp,indexs); + end else + begin + gettxtobj(); + ftext.caption := Caption+"."+cp; + FText.text := tostn(d); + FText.show(); + end + end + function ShowDataClose(o,e); + begin + o.show(false); + o.TSLdata := array(); + e.skip := true; + end + function Recycling();override; + begin + inherited; + ftext := nil; + FCols := nil; + Fdata := nil; + FControls := array(); + end + function ControlIndexs(dx); + begin + {** + @ignore() %% + **} + if dx then FControlIndex := dx; + return FControlIndex; + end + property Twodimensional:bool read FShowTwo write SetTwoD; + property TSLdata:variable read GetTSLData write SetData; + property ColumnWidth:integer read FColumnWidth write FColumnWidth; + property RowHeader:bool read FRowHeader write SetRowHeader; + property StringAlign:AlignStyle9 read FStringAlign write SetStringAlign; + property NumberAlign:AlignStyle9 read FNumberAlign write SetNumberAlign; + property DefAlign:AlignStyle9 read FDefAlign write SetdefAlign; + {** + @param(Twodimensional)(BOOL) Ƿάǿƶάչʾ %% + @param(TSLdata)(array) tsl %% + **} + end + type TGroupGridA=class(TDrawGrid) + {** + @explan(˵)㼶ܵı %% + **} + {** + @expample() + FGrid := new TGroupGridA(self); + FGrid.border := true; + FGrid.OddLineBKColor := 0xFF0000; //бɫ + FGrid.EvenLineBKColor := 0x00FF00;//żбɫ + cls := array(("text":"a","width":300),("text":"b","width":30)); //ñ + FGrid.Columns := cls; + d := array( + ("id":1,"data":("",true)), + ("id":2,"data":("a",false)), + ("id":3,"pid":1,"data":(("value":"a","type":"string","font":("color":rgb(200,0,0))),true)), + ("id":4,"pid":1,"data":("a",false)), + ("id":5,"pid":3,"data":("a",false)) + ); + FGrid.SetNodeData(d); // + //ʹ FGrid.GetNodeData(); + **} + uses tslvcl; + function Create(AOwner);override; + begin + inherited; + GridLine := true; + FOddLineBKColor := 0xFAF3F1; + FEvenLineBKColor := 0xFFFFFF; + FNodeManger := new TGroupManger(); + GridLine := true; + FNodes := array(); + FCellediter := new tedit(self); + FCellediter.Visible := false; + FCellediter.Parent := self; + FCellediter.onkeyup := thisfunction(doeditcell); + FCellediter.onKillFocus := function(o,e) + begin + o.Visible := false; + end + //inherited SetColumns(array(("text":"","width":25))); + end + function doeditcell(o,e); + begin + //echo "\r\nkey up:",e.charcode; + case e.charcode of + 13: + begin + e.skip := true; + o.Visible := false; + callDatafunction(FCelledit,o._Tag,o.text); + end + end; + end + function SetNodeData(d,ncls); // + begin + FCellediter.Visible := false; + if not ncls then + begin + FCurrentNode_a := nil; + FNodeManger.RootNode.RecyclingChildren(); + FNodeData := array(); + FNodeIds := array(); + end + for i,v in d do + begin + id := v["id"]; + nd := FNodeData[id]; + if nd then + begin + for j,vj in v["data"] do + begin + nd[j]:= vj; + end + continue; + end + pid := v["pid"]; + nd := CreateNode(); + nd.FNodeid := id; + nd.FNNNODE := V["nnp"]; + nd.Expanded := false; + pnd := FNodeData[pid]; + for j,vj in v["data"] do + begin + nd[j]:= vj; + end + if not(pnd)then AppendNode(nd); + else AppendNode(nd,pnd); + FNodeData[id]:= nd; + FNodeIds[id]:= pid; + end + UpdateWindow(); + InValidateRect(nil,false); + end + function GetNodeData(); // + begin + r := array(); + ri := 0; + for i,v in FNodeData do + begin + r[ri,"id"]:= i; + r[ri,"pid"]:= FNodeIds[i]; + r[ri,"data"]:= v.FData; + ri++; + end + return r; + end + function getcurrentnodedata(); + begin + if FCurrentNode_a then + begin + d := FCurrentNode_a.Fdata; + if d[3]="sysparams+" then return; + d[2]:= "*"; + FNodeManger.getcdnodes(FCurrentNode_a,r); + reindex(FNodeData,r); + reindex(FNodeIds,r); + FCurrentNode_a.RecyclingChildren(); + FCurrentNode_a.Expanded := false; + calldatafunction(FCelldbclk,self,array(1,d,FCurrentNode_a)); + end + end + function MouseDown(o,e);override; + begin + // + inherited; + if e.shiftdouble()then + begin + r := HitTestItem(e.xpos,e.ypos); + if r[0]>= 0 and r[1]=1 then + begin + nd := FNodes[r[0]]; + d := nd.Fdata; + if d[2]in array("str","int","lstr","double","nil","int64")then + begin + try + rc := o.GetSubItemRect(r[0],r[1]); + FCellediter.SetBoundsRect(rc); + try + FCellediter.Text := d[1]["value"]; + except + FCellediter.Text := ""; + end; + FCellediter._Tag := array(r[1],d,nd); + FCellediter.show(); + FCellediter.SetFocus(); + except + end; + return; + end else + if d[2]="array" then + begin + calldatafunction(FShowarray,d); + return; + end + calldatafunction(FCelldbclk,o,array(r[1],d,nd)); + end + end + FCellediter.Visible := false; + end + function MouseUp(o,e);override; //չ۵ + begin + inherited; + r := HitTestItem(e.xpos+5,e.ypos); + if r[0]>= 0 then + begin + nd := FNodes[r[0]]; + if FCurrentNode_a <> nd then + begin + FCurrentNode_a := nd; + InValidateRect(nil,false); + end + if r[1]=0 then + begin + if nd and nd.NodeCount>0 then + begin + if nd.Expanded then nd.UnExpand(); + else nd.Expand(); + UpDateWindow(); + end + return; + end + v := nd[r[1]]; + if ifarray(v)then + begin + if v["type"]="link" then + begin + return CallMessgeFunction(OnLinkCellClik,o,v); + end + end + end + end + function AppendNode(nd,pnd); //ڸڵ׷ӽڵ + begin + if not(pnd is class(TNode))then _pnd := FNodeManger.RootNode; + else _pnd := pnd; + _pnd.AppendNode(nd); + end + function InsertNode(nd,idx,pnd); //ڵ + begin + if not(pnd is class(TNode))then _pnd := FNodeManger.RootNode; + else _pnd := pnd; + _pnd.InsertNode(nd,idx); + end + function CreateNode(); //ڵ + begin + return FNodeManger.CreateNode(); + end + function InsertNodes(nds,idx,pnd); //ӽڵ + begin + if not(pnd is class(TNode))then _pnd := FNodeManger.RootNode; + else _pnd := pnd; + _pnd.InsertNodes(nds,idx); + end + function GetNodeByIndex(idx); //ͨŻýڵ,update + begin + return FNodes[idx]; + end + function UpDateWindow(); //updateڵ + begin + //´ + FNodes := FNodeManger.ListNodes(); + ItemCount := length(FNodes); + end + function DoDrawItem(o,e);override; //ƵԪ + begin + inherited; + j := e.Subitemid; + i := e.itemid; + DObject := FNodes[i]; + if not DObject then return; + dc := e.canvas; + e.rcitem := rec; + rec := e.SubItemRect; + wd := 4; + if FCurrentNode_a=DObject then + begin + dc.Brush.Color := 0xffce87; + end else + begin + if i mod 2 then + begin + dc.Brush.Color := FOddLineBKColor; // FOddLineBKColor := 0xFAF3F1; + end else + dc.Brush.Color := FEvenLineBKColor; // FEvenLineBKColor := 0xFFFFFF; + end + dc.FillRect(rec); + dc.pen.color := 0xa8a8a8; + //dc.pen.style := PS_DASHDOT; + dc.pen.width := 2; + dc.moveto(array(rec[2],rec[1])); + dc.LineTo(array(rec[2],rec[3])); + if j=0 then + begin + cj :=-1; + pd := DObject.Parent; + while pd do + begin + if not(pd.FNNNODE)then cj++; + pd := pd.Parent; + end + wd := cj * 20+4; + if DObject.NodeCount>0 then + begin + if DObject.Expanded then bmp := FBmpExpand; + else bmp := FBmpUnexpand; + bmp.Draw(dc,rec[0]+wd+1,rec[1]+10,SRCAND); + //dc.stretchdraw(array(rec[0]+2+wd,rec[1]+2,rec[0]+15+wd,rec[1]+15),bmp); + end + //rec[0]+=wd+4+18; + rec[0]+= wd+16; + end + if j >= 0 and DObject then + begin + rec[0]+= 4; + v := DObject[j]; + if ifstring(v)then + begin + //if j=0 and v="sysparams" then dc.font.color := 0x0000ff; + //else dc.font.color := 0; + dc.DrawText(v,rec,DT_SINGLELINE .| DT_VCENTER); + end else + begin + if ifarray(v)then + begin + val := v["value"]; + typ := v["type"]; + ft := v["font"]; + rebk := false; + if ifarray(ft)and ft then + begin + bf := dc.font.fontinfo(); + dc.font.setvalues(ft); + rebk := true; + end + if typ="link" then + begin + udl := dc.font.underline; + fcl := dc.Font.Color; + dc.font.underline := true; + dc.Font.Color := rgb(0,0,254); + end + if ifstring(val)then + begin + dc.drawtext(val,rec,DT_SINGLELINE .| DT_VCENTER .| DT_NOPREFIX); + end else + if ifarray(val)then + begin + dc.drawtext(format("ARRAY<[%d]>",Length(val)),rec,DT_SINGLELINE .| DT_VCENTER .| DT_NOPREFIX); + end + //ԭ + if rebk then + begin + dc.font.SetValues(bf); + end else + if typ="link" then + begin + dc.font.underline := udl; + dc.Font.Color := fcl; + end + end else + begin + if not ifnil(v)then dc.drawtext(tostn(v),rec,DT_SINGLELINE .| DT_VCENTER .| DT_NOPREFIX); + end + end + end + end + function Recycling();override; + begin + inherited; + FCurrentNode_a := nil; + FCelldbclk := nil; + FShowarray := nil; + FCelledit := nil; + FOnLinkCellClik := nil; + FBoolColumns := nil; + FOddLineBKColor := nil; + FEvenLineBKColor := nil; + FNodeData := nil; + FNodeIds := nil; + FCellediter := nil; + end + published // + property OddLineBKColor read FOddLineBKColor write FOddLineBKColor; + property EvenLineBKColor read FEvenLineBKColor write FEvenLineBKColor; + property BoolColumns read FBoolColumns write FBoolColumns; + property OnLinkCellClik read FOnLinkCellClik write FOnLinkCellClik; + property celldbclk read FCelldbclk write FCelldbclk; + property celledit read FCellEdit write FCelledit; + property Showarray read FShowarray write FShowarray; + private + function GetChildAllChecked(nd,j,ck); + begin + nck := not(ck); + for i := 0 to nd.NodeCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + if ifobj(cnd)then + begin + if cnd.NodeCount=0 then + begin + if cnd[j]=nck then return 0; + end + if 0=GetChildAllChecked(cnd,j,ck)then return 0; + end + end + return 1; + end + function CheckAllChild(nd,j,ck); + begin + for i := 0 to nd.NodeCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + if ifobj(cnd)then + begin + vi := nd[j]; + if vi=0 or vi=1 then cnd[j]:= ck; + CheckAllChild(cnd,j,ck); + end + end + end + FBoolColumns; + FOddLineBKColor; + FEvenLineBKColor; + FNodeData; + FNodeIds; + FOnLinkCellClik; + FCelldbclk; + FCelledit; + FShowarray; + FCellediter; + protected + type TGroupNode=class(TNode) //groupgridڵ + uses tslvcl; + function Create(); + begin + inherited; + FData := array(); + end + function Operator[](idx); + begin + return FData[idx]; + end + function Operator[1](idx,val); + begin + return FData[idx]:= val; + end + FNodeid; + FNNNODE; + //private + FData; + end + type TGroupManger=class(TNodeManger) //groupڵ + function Create(); + begin + inherited; + end + function CreateNode();override; + begin + return new TGroupNode(); + end + end + class function Sinit();override; + begin + inherited; + GetSJPng(); + end + private + FCurrentNode_a; + FNodes; + FNodeManger; + static FBmpExpand; + static FBmpUnexpand; + class function GetSJPng(); + begin + if not FBmpExpand then + begin + FBmpExpand := new TBitmap(); + FBmpExpand.readvcon(HexFormatStrToTsl("0502000000060400000074797065000203000000696D670006040000006461746 +10002C700000089504E470D0A1A0A0000000D494844520000000A0000000A0806 +0000008D32CFBD000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000005C49444154 +285363F84F24204DE1EA7DF8F1ABF740851FBFFEFF9FD9F3FF7F443D6E7CF53ED +4C41B0FFFFF8F6FC1AEE8D005900A24379EBA86A968D729A82410A07866F76984 +A2CD47A1825080E16B9807D00186425C804885FFFF030081696EBEB08C861D000 +0000049454E44AE42608200")); + end + if not FBmpUnexpand then + begin + FBmpUnexpand := new TBitmap(); + FBmpUnexpand.readvcon(HexFormatStrToTsl("0502000000060400000074797065000203000000696D670006040000006461746 +10002BF00000089504E470D0A1A0A0000000D494844520000000A0000000A0806 +0000008D32CFBD000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000005449444154 +285363F88F0672FAFEFF3F7A09CA4102180A23EA2178DF39A80014E05408C23B4 +E40058100AF4210DE7404224E502108AFDE474D852045208057214C1108E05488 +AC08043014164DC654F4FFFFFFFF0022DF66E2EA30F3BB0000000049454E44AE4 +2608200")); + end + end + end + type TNodeManger=class //ڵ + uses tslvcl; + function Create(); + begin + FRootNode := CreateNode(); + end + function CreateNode();virtual; + begin + return new TNode(); + end + function ListNodes();virtual; + begin + r := array(); + GetExpandedNodes(FRootNode,r,0); + return r; + end + function GetNodeByListIndex(id);virtual; + begin + return GetExpandedNodeById(FRootNode,0,id); + end + function getcdnodes(nd,r); + begin + if not ifarray(r)then r := array(); + for i := 0 to nd.NodeCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + r[cnd.FNodeid]:= nil; + getcdnodes(cnd,r); + end + end + Property RootNode read FRootNode; + Private + function GetExpandedNodes(nd,r,ct); + begin + for i := 0 to nd.NodeCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + r[ct++]:= cnd; + if cnd.NodeCount>0 and cnd.Expanded then GetExpandedNodes(cnd,r,ct); + end + end + function GetExpandedNodeById(nd,ct,id); + begin + for i := 0 to nd.NodeCount-1 do + begin + cnd := nd.GetNodeByIndex(i); + if ct=id then return cnd; + ct++; + if cnd.NodeCount>0 and cnd.Expanded then + begin + r := GetExpandedNodeById(cnd,ct,id); + if r then return r; + end + end + end + private + FRootNode; + end + function getdebugicons(); + begin + r := array(); + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100021003000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000002A549444154 +484BAD958952DA501486592ACAA652A4E2C6BE18A22202A540DDA6639FABCB540 +58D200AA22C21019EAF8FF0F704AE89B59A9982DFCC9924E4DEF3DD73C84D0C60 +7CED7238E96CB2ABB743157C11E314511C53BC25AAE044A2E4BD108EC4200EBB0 +1F6EBF46815C8611CCB945CF2E340F461BFBBC1EE4C872A381E0470D8A7C4FD75 +14A555E4452FF22D2FBB3B39AAE068E8C7FE601D85FE0AF2D2077CEC2D21DB762 +37BBFC4464C862A38186EE0F380920F3CC8C8EF91E92D22DD5944AAB580BD3B17 +1BF5FFA882FDE11A0AC36564FB6EA4E505A47A4EECB41D483ED8B1DDA0E3ED3C1 +BF92FBF396E14CFCF15544171B88ADCD083ECC08594E4C0B668C5567B167C93A2 +318BC48D157CD5C146BFCCD3C48FA802A53DB901ADBE3F8F64CF06BE330BAEFD0 +EF1A609F1BA199BB5197095396C09AF4B7405C5A177D49E3D995A23CE21D19941 +ECDE8448C38048CD8068D584A8402281AA29BF2CD115140624905DD895ECE0BBB +4FA0733227794FCDA80B06040F0928E17242A5355E7566C979C6CA686BE405E46 +5A2281E800DFB62046AD89DE8C93874A2438A5E319C5B911B1730B36CF6C6CA68 +6AEE093444F50CF8564DB8EC403B5A76142A8AA250FFE64F18BAA3A35B3597FA3 +2B50766EA64B15B49C48DC5910AD1B11BE52563C4E1CF83E0EE5FC35F42BE890A +0E5C64E93047512DC90807A1EA0D58F927F1B871EFA15D07B27D37423D97082AB +CD21563523541EB74411F874922B891F933F3D57D02AB85F41A64102DAB1FCB50 +D316106E1B2712CF8A1BF723DD499B90609EA1EECD616C05FD910BFB4205232D3 +1F6C642326436BD1ED1AB2B565EC565CA3DDCA95ADA3C7715A5441A1B6814CD58 +BD4951B5B17F3E04A7676673AB40AAA3EE42AAB480B1E242F267F3D3F47ABA0EA +474E5843E672FAAFD8535441B112445EF0B1ABB702F803D2475555757FB6FA000 +0000049454E44AE42608200"; + return r; + end + function GetEditIcons(); + begin + r := array(); + r["ļ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002DB02000089504E470D0A1A0A0000000D4948445200000026000000200806 +0000007E640AB3000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000027049444154 +5847ED97DF4B537114C0EFDF104410414808D54B62504F113D590FBDF86A083E0 +4820FD10F028320EAA51E7ACD880C451DA8A5A258334B1333FAF51211856E7777 +D3DAE62CE6E6D674DB3D9D73EEF56EB77D37B6D5BE97A00F1C3676B7EFF9F03DE +7FB63CAB43F011D3361383DB652760C2DC6A0D6280D7D9A3079A9D8716709FCB1 +2D7388DAA050124A562EB7DE7D67B1F995A4F9496DF82F5629158B3D0F2458ACD +A689B0AC2C3C5B8395A712A168B6D66E1DAAB08FFA69AA07CADEEA0395A712A16 +FB53CACDF76F8A851219B8F976ADAAA045220ACA77A8CF277CB61D6A74ABB4D88 +9E1000FE44414157BAA6DF0177A3EADF3D6202B86F1B82B2976793EC25F904DE7 +4B23AF502CA3EBD0D8AF712965D334B20CC787026231B7666CA25446997C8CA46 +067D7125CC159138A5D9A5B75A48CBD38119477528D178A6D6674D8DFA3C2499C +52D99C9B0DB35834952D147BECCBAD4699A4B33A1C1BF45B7D5D2076FE85612D9 +B37C19F9C97FA8BB089A5B08C7BEF7BA179DCDE7332E8FA10B5FA8BB0894D789D +292371763AC4B9A9BF089B58FBB3102E570FBF97C93A5EA50E0F68D0F428B7E02 +CB1445AE73DE4CC936FE62379CC2E2779B6AE2E18FD455862639E383F1CF82CBF +8CB7DFFFB0F5176189D1AD921ADF095AB04ABBEEE6FA8B60B153B899D22BF5986 +C8278E73BD8EBC3C9B16FE82C76D4E567B1512CA76C26556327B8FE7ACDFCC480 +C5F675AB70008F2127B88142E4E0C613271F16A3B88007B713344F7C853DF73CB +6FE222CB129BCB1CAC68B77FBBA6EF149A3D43F5061371AD7E18AAC5960F2EDA0 +1D203F6852E8CFCBEF28AE2F3138E2D2C403FE8DC89312895D9C0B43326D2F230 +0C02FA1DC4D3F567030CC0000000049454E44AE42608200"; + r["ȫ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100025302000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001E849444154 +5847ED974D4B42411486EF7FE9EFB40A8268518B68578B9605EDA25D50B4A88C2 +40C8A5A5408B5882430C122888220B2FC46F2A696A9842935F91EEF19A68B9479 +3F16D50B0766CE9999F771D0EB3D9A3054BDD545767A5F447B16C455D7842381B +3E1012F16013CCC055A6E7032F4D9C326402DFB2C93A991755139898A78FFB25C +84B995E00F873331CF8C6F4B3F786BF7537BD28CA50258950AC04A0EFB28076FE +DAE7B9E26A0635901C09EC4D0AA281FDDD0BC1540C117A61CBC350CEC0430EF6D +05002FF6FDBD003086FE1E40D17F29729EA03CCF7500B32C03206F253A028031E +7ED0AF536BF05803293BB446D47E02C556D0138A97F808E005037AFF92A67CEAB +42EDC700BC4E15FFC45471CE5680F271446E78DA3937B22E02A44637E8252231E +815B13E8F917509E0AD5AA77A29702DF499031ABFBFD4A8C60F2C55B60314FD17 +B25E398DD138BF12A29A2B00E9C6F5F31A8EF880976AAD0038670B405D2F512DB +7D4FC7B45608CDC6BB220CDF8918B39DF00E7F0A66D56DB0085B5301D520E468C +4CE317D11823875ADE1B92460806507396009CD227006EC5DC0478DC3A234F786 +BE8D53041C7E29662BD8BE4096F0D8D2226083C6CD034E0369C089C9D1EDB947E +F0A6E694BFCD6E063C21D99EA35144AFC6AD9A1381B3E101AFA684F80055B3808 +F56B6A2590000000049454E44AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100022702000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001BC49444154 +5847ED97CD2E035114C7EF4AB045B011ED0295D06D173E1296880891B0A88588F +00E3C000F6021165D88442CBD869022AA3A65CC0C8BAA36165A334D8FFEAF7B5B +7442FA35ABF927279973EE9C737E776E663287514196A191B1BE48515F1B457A9 +A1A6AE8A1AFCDD387728BD6C4D03C36DC657B73232D36D4C937CEB07304B49559 +B29E0DCA84CFB81F1F1B20538DD7C5500B3551DB7AD2490BCE70DFD85822261F3 +B16A022C0A49FFB952A6F59A4AFCE91693C8A08F15A1200C2CEE1477DEDC47001 +93AA15207B73C9F3D3C7211129078064DFBA03C8FCD4E1BE88380C90BD3AE7F9E +9A303117118209F79A758C0C38F42AA2280ECF505F7EFC77D2252BBE45B80DA52 +B26F19402E99A0486F3345BDAD646A0F225ABDF01A463C2DBC662E9514D13F002 +02D38CD63CA683FA5427BF4767A5295215719E9E3B5F09DF92ED9D716C0D4557E +8E72AD565302DE1FDF0548AED90240388AC4CE16A90B13A44E05AAB3426E62779 +B72AF2FA26A49FF02345A2E800BE002B8002E800BE00214017E0F264EA838980C +7610C3A00807E3921310682E7FF98CCD65629852312822E0A4DDF9BBF9864BE37 +96150C4AC6677733D0D3DB0F3AFA74DF409837977A59FB64D730000000049454E +44AE42608200"; + r["ȡע"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100022001000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000B549444154 +5847ED95C109C5200C40FF4E4EE15D07D0832B787142F1EC0C2EE03925FC2A9F9 +2160A7EE3C10739546DF220113FC0CC16D8026B0AD45A21A5343430270529E09C +0321C4D0C09C146B0AB0B76026EB0B78EF2184707E8DE751008BB721C23EFE035 +2A094024AA95EDC180331C63E5039E7F3E497B6FE14AF86504AD98BDF45039353 +FBD778750DD905B0055AEBFEB3B5766E0B1A6C43F80BEB359CC19A02EC8F11FB7 +3CC2EC0DE82996C812DC02C0070005765629339C9EFE60000000049454E44AE42 +608200"; + r["ע"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100021201000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000A749444154 +5847ED94410A80201045BB9377F20A6EBD9757F03A82BB8909021333B56F1AF8E +0D3A2181F8CFD8D06B30496C09C02CE39B2D642C333532405A4942484808667A6 +985360F80ABEE41F02C6986387FC445324105E26B444D125D45A6725C26FEF02E +F81538287A7DEC781F740578170058C52EA32ACFB0A42BCF7D9C3DFF228C0F0A1 +437FC39ECC2910F70022F01EA80DBC076AD3DC03A834F7406F96C012182C40B40 +319335F36295E4B140000000049454E44AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100022A03000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000002BF49444154 +5847BD974B681341188073F289F80005116C6BA10F15D48B56A8AF832858A8288 +8F460412A420F05A9079182E2C1E20391422B88A055F060050F2282482D689552 +2A5AA14DB24D9A3449D39A36469B64934DB2BFFB4FA6D34C36AF26BBFBC17FC8F +E9BFFFF6676323B314101486E2744C67ED24FDA925720F47500849A8D602E5B09 +A12FFDF4AA76E414C0E6D6EA0D60DEBE824468F013CD68475681F0D067106A37B +1E6735D9D34A32D1905B8E6CAD4FB9F74D18CF6A80454CD9F76D38C3E7002E9CD +FFF43EA219FD60025CF38AD51078D54B33FA4204D29BFF7DFD82245359F8F80E7 +E775E2F2870C1E200A2360BFD76764CAAE66F5ED2D412F1791F98CB5725EF5966 +D88FEE26EB4896A2B41A8FC9D5DCC86E7634D667BC518EC5C0717C1F5778B9613 +B540DE1916FB4E212A644380453E74FB01B5D171A408E88349D422241B664C969 +CF1BE2F72108F43D0777CB19B0EE58C36A5B2AD7A96698AC8182258A202A8C73B +5F13107073ED02C1540F49480781C663ADA586DEBAE2D109B769314B70F1089A6 +93FA48C832785A9B586DEFD54BE4322780C862583789B87F0EAC3B37276B2B8F4 +29A9A540B207A4AF8EEDF6475FD8F1F661640D2D784FBE269F24B2895C8F82F56 +13079955004997107F0CD34C6990038E52CF565F955B0041096F7B0B9901AD1E8 +3FD700D11B054ADCF2FA00713FBCB8880B067ABF102388B8BBB236EEF860B04FB +DF93E618D36DCDC60B782E9F6302FFDEF6192B101E1E24272D6C2EECDD0689E08 +2710231DF2C4C1C2867A3F73FEB21D70D11C093D1E4915AD6DC79F69872C69048 +4E578178C00FBE07B7D8C68361AFAB24B3B1082780070EDC9FE77BEE151FDD776 +1F6C615B2CD5A2BD6B2C6188E868310F37A68B7249C007770D030F0EF9DEF4E07 +79C9A5C309CC5C6BCD58A0A85056BBF3549D7242BEAD1A752AFC1A50DE7691B15 +11047474A0AC9E500391AA1457301F01FDA4F2FDFE8B101E70000000049454E44 +AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100028202000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000021749444154 +584763F83FC060D401A30E1875004D1DF06ED684FF6F2677FCFFFFE70F540413D +0D401B73485FFDF9063FBFF28DCEDFFEFD72FA1A2A880A60EB8A9C403760008DF +3690FEFFF5C83EA80C02D0CD01207C4B89EBFFEBBEA6FFFFFFFE85AAA0B30360F +8496AF0FFBF9F3E80D5E075C0D7A3FBFFBFA8C8FAFFD0DBE2FF1D53B9FF7774C5 +49C2D82C87E16779F1603BB03AE0F7B327C084E38A5523B5F0D3AC28B05D180EF +879EFF6FFBB26726045F71C75FF7F58B9E0FFEF17CFFEFFFFF70FAA8278802B0A +1E4579FCFFF3F635580D8A03FE7DFFF6FF9E830E58D1F3A2E4FFFF7EFD84CA900 +7301C20CFFEFF557B154AB980E280B733FB202E8C70C75B78100B50B2A1BEE4FF +2FFB7740651000C501F7ED35C18A7F5CBF0C15A10CDCD610049BF7C0D7EAFFAF2 +70FA1A2A800EE805F4F1F8115DF7731808A500E4079FE556BC5FF7F3F7F404530 +01DC01DFCE1C033BE0496A0854843E00EE80EF174E431C90140015A10F803BE0C +F9B57E0547AD74289AC2C472E404984A0C4020A852F87F64045680F501CF069E3 +4AB0034065C1DFCF1FA1A2B405280E00D5524F62BDC18E78E86F0B2E92690D501 +D00047F3FBEFFFFC0CF1AEC08503E7E599BFFFFF3EE2DFFBF5F3A4B3206A52B42 +00C30120F0EFC7F7FF2F9B4BFFDF54E6053B845C0C2AFDFEFDFE0535153BC0EA0 +018F8FDEAC5FFF74B66FD7F5E96F1FF496200B8122105BF6AAB849A841BE07500 +3DC0A80306D801FFFF03006C2FCBC409CD25D50000000049454E44AE42608200"; + r["tsl﷨"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100020204000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000039749444154 +5847AD97F94B545114C7FB5FFA2DA41FDAC8A00CCA225A7EA9205A208A8222081 +222FA413335CD25358D448BCC32CA16111754D250C9164D2575F66677369D71C6 +D91A47E734E7BEFB5E6FF4CD7B6FC6F9C0859973BFE7DCEFBB73EF7D7736419AA +C8622E0EB99266D35B44CA3A993B281D09405EC0F7A40BDAF1C6636DF254DB3BF +021CE5BD109AB652957C641958F185C0F36E0C8C175F708362335D69212D2176F +515783BA620B6BC42B3C51135101C3382BDA80BD47BCAB801D4D965E0ACF90C51 +E712550144ED3E7054F681725B11A7D31CA80267553F849576AA12669D81154F1 +03CAD3FC078E139570C1B3EE9D2A08AAA92836BC270EE5962EEF556F076FD0688 +51118F040373F91DA0DC55C225E2D3BAEA07613518A10AF9E0ACD88BBB61764B3 +E574F7BB886CC1E1FCE80F5F6074E68BEF61A823F0DB467E3E0ACE84F3570F56D +859DB4876780ED4C075FEF0C18CE3641E0FB1F1A1106FB710CD4B26CD8406054C +74D333EA918193780FB5E955D4AF2F06C9022A30622C605D01EAA2639D63B1F69 +549C8C19882EF8417F9A5954E6F8168B45A2B4479C8C18C0C18C979A9942F1FDC +E3F90A4C8880157ED00D1E98E3E86C54F1364BFCB45D4806A37B398A49E088B68 +0F3EE20C133327EAC9A123B50BFC032AA2B7DC7C4B233C03FA934F496770DC482 +3E204BEEAC0F1B01774C7EA12CCAC3DE9F878DB27194D451F8DF00CA02BEC4451 +AAB8EA0649AE3AA71CC2AAE42F1F77F328D1B9E3EF1A16CE00BA927A0221E61B8 +7491E1E46FE112D8D0A83B551EB1F52D308CF4070D24C3A75C7EB68441A77CB37 +92836DB17D824693A3D9CB5C62F036C5C21940B4476A89203C3B4723C9F1B48D7 +383CF370DD368727081A2D674F9258D30241860A748EA67C0773B3BB8A354FA08 +46D89BD342D3088D302418082B6CA0D85A088AAC02D159C07D8CC5AC79EF69441 +C76B6943B4BC8187C120C20F30D4344CCDFAB6B8998DCB2176BD413004D2E736E +A091B5AC338018CE3357AA5477841096BC3652CB16BF6D09216800A79F5DB178F +4A68BBDA49BD4D09F69A491F5081A40961D3EB216B0C05CFC758BDFE5825ACCC1 +5CE58E621A1526A90116754E0529A4CDAD066F77FC662B016A508B39982B85A40 +1C47CE30D2988CD7EBF1322160FEDF90FC6B08FD5618E1C641940F0CAC516C763 +D77AAB0D82BF4CA4E167F65EA8C8BA07CECA7E9A258D6C0308BE01F9B3C16FCAE +DC5602BE880BF6A0755CB2325032C38DDAE275FC881840DFF37C6C2E9FD434ECB +40E600F8077525AC9F3D612B2D0000000049454E44AE42608200"; + r["tslʽ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002E601000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017B49444154 +484BCD96CD2B04611CC7FD390E8E5C1D957273578E0E2E4AED897FC045EBA58D1 +4DBA675D8C8A64424D12E566B6D1B4931C94611C9719E9FF93EBF999E31EF333B +C9A77E87797E2F9F79E6ADE92293A90341DD593D561C3F0AB3DB1F29687F916CA +83E89483152E2404FF936582205684271542CC1E239F7151AFE928E0460A9C6BD +0B67DE928E0560B5CEFDD98A7B462A02B07EED2D492C185873D76FDDF09CB9AA9 +22712945A5C3F54E09D380339CC0489040067E9351C918A2088FF2FC0E539D5D4 +8D74D29160A349345C0CAE8D2CC85FF14DB33398D7A9D8E435E4F0FC3B0915E42 +E04F5E6749AD81574FF6E2E1AD49E897AE6551D72A8E9336A972F952850603D7E +56819D4963D8CC897B1DB5E899AD702E74078D17A2F11D215FA46DF373FCFACD8 +DDAA73C9420879AB1B2A07A5B89430516B804993D2EC4376674530D01997D4177 +6FE6818DC8023BFD2B828E1E7E0BFC882D40DE6A8842A21DC4E1EF05DA875A4C2 +3300B3F12400AC0F42127D208FC0231443F28BE427F9C549A270000000049454E +44AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100021B03000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000002B049444154 +5847E597CB6B13511487FD5F5CB8115C09EE74A12E4437D58D2B455011DC88822 +86215AD8A2DA1A550954A7D9582A4565B4DB56A158D4A11ADD6BE93B44D62D264 +92A6499C344D3331C79CE39921D3492693718C0B3FB884FBE33E3EEECCBD77B20 +6FE31550B48C20F488F06203D16845C2CC5A9792A0A64A6C310BAE880D93DD761 +6CED694D99D8701EBCFB6F41F8CA5358F12E702FE3E80A084DCF6162FD399AC87 +BE036241E7D858C5B809F6206A4A808A2D305D1F6B710386E2FB4AB87A94D9720 +76E703F736465901FFD12E9A187F97867D9C9667E9E31C7876B52AB2462929202 +F6FB27F9413E3044ED895FE46D008A0BDD1CEE548BDF7D01842F34B4ECAA312C0 +E7871DC397FB3931CF42C73B1A0BDF1B3D14017C83F1259AA96BE3E4CFF11DBC0 +B737BDBB9561A452074E10919E3F25985383845638A4E37275A1481E9CD8DB4D7 +AD06572170F201D7B490406A68864CF1C0B19AE88D37E0DA66E39A161248F48D9 +080996D5789B8FD138D9D5FCE72A28604A2379DD4480A2529B412F1D5EFF76079 +32C4891A1290B74C3618A7D04A6401BC534A4102B8F4D828D1ABBF67CD808F607 +CDD19C84B394ED49040C6132181F9B3BD145A49A4ED357876B6724D0B0920B3BB +AF8167470BD7AC037798DE91AC08445A06691516BB3F73521B14815C220DEEC27 +EC503A9962802C862E710AD42F0540F277F1F950062C5758CDB1A8B113402080A +60A9F664942222CCD7F729FDABFE1E28A6DA4FB2F8C32FE0DA6AA33EA106077C3 +F76DF9044590104F7B07B7B330D84178AFFF03D101A0720F17804928E6F20D85E +80AF90B9B634511BEFBE0EFA3694C15BB09284AE0092CFE620DE330CFE239D345 +87199DCD800BE4305A9C204C98171EEA1060F373D898A02AB91FF98ACF8629C54 +061F094AE059B39AAA05CC12BEFAACE44AD44C00C1C951A2989A0A94E27F1700F +805D0F3420D05EDA5310000000049454E44AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100027501000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000010A49444154 +5847EDD3218B84501405E0FD8B16AB60325A15C162325A0C2641D0603319AC822 +641EC62B2984C8270969179CBCC70C75D771FCAC23B708A70BD1F3CEE072E8E00 +088000FC5F405DD7304D13711CDFBFFC2E8701E338C2F77D4892B4F5544096655 +055F56BF96980A66960DBF6D3E25300D3342108027231AB65591BE2481FF31690 +E739344D2397FEB56DDBDEB71080AEEBE0380E39C8AB6F0161189203BC4B02E67 +9866118E400EFEE3E4151145014851CE4D55DC02DCBB2208A22729847BF05B0F4 +7D0FD775C99FB052679824C96E1FB30B6029CB12BAAE9380D7BB3E9A1F016E59D +715699A4296E56B002CC330C0F3BCEB002C55556D677B19805704400004E06200 +F00985F34928814F15230000000049454E44AE42608200"; + r["ǰ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002E501000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017A49444154 +5847C5963D4BC3501486F33B440DE220520D3AA888ABAB8A28A26DA9F5A355549 +42EAE4E8E8E6ECE4EFE011737870E8E82AB38EB0FB8E7B6C79EF6857EA569D2DC +9B3CE585F4DE03EF43C897C331D9A0031C8D466C8129B5C05B94C3BFE81811185 +3B3BC4D79AC44C3988064870A580D8F5101C92E15B1130EE302923D3AC2EE70AC +0848F6E90413C158139064A984A9C1581590E4A98C497F9CF75A95E3649880A44 +0E7A8EBC7918165B51E2BBD857E39D417A8ECA62990548A7489DA36890A488EE9 +0AD52D1217909CEA6BD4A7242029D14DBA02923255D213985073E99D0157CD37C +B85C4055CF250DD2251015779AC1ABF4E121390D3FE5BFF436D9BA680DFE3B533 +2B149CDEB2DE4C362EB86FFE416537D65F4672B57FD6BF50D78FD5D7F1B8CA70B +5FE81497FAC0ABCD6DE3035182B021EADF1B37EC14430C605326A951FF5137687 +635460462DF1BD7EC04E388C094CAB45BED577580D8F1101B9D5CE74052BD1302 +290D3C15FBE41C416D8A42C8E4681F91F06F7DA0A168403F80000000049454E44 +AE42608200"; + r["ݼ˵"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002C601000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000015B49444154 +5847ED96314B03411085ADFC019616F676292D2DD2091616B63682A545B0B4505 +BD1D2DA562C03762155AAD4225148F49010541051C1588CBCF1DEB91956B9856C +C2E13D781C6F7676E7BBBDE66664CA2A014A800CE0A37329FD9D2DB95BAF46F56 +0775BDEDBAD746A0AF0D66ACAD5C2ECC4DC599C9397FAF90FC0EDDA72B6D8AF6D +CAC3D17E6E3F1E1FE436FA3907B79101B038D8AB6931A69ECF4E7F070021844FE +2DA57B3B63D36BBB55C00ACB1114FD6B0EE5E27F731C390DD031507000D34E466 +0230739FDB637310404C0503B86F61330E83DD9AEDB10A06E01A0C61233301987 +928336C553C000E816DF6D9F658A1160400B90786D827D4830150674F5EFFF532 +582F1E00368478AC00E39417E0BA32AF45FC0B0C939E2EC4D2D3C9A1CE4A36563 +52B0006F3162665DEB602BC362EA4B7B2E46D8CE16EB5A2C32105A086DD1BFD46 +31FD799FA4D3BE3502300D9500FF1D40E40B036C6466EFBB13F70000000049454 +E44AE42608200"; + r["ͼ(alt+m)"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002A405000089504E470D0A1A0A0000000D4948445200000020000000200806 +000000737A7AF4000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000053949444154 +5847C5577D4C95551847304021958FED22134190217B5F750C192226384030705 +302455D3304FF409BB32205755CBED2A2D41495BBA29CAC81F63186D4D614E707 +96C628FE486B4BD104CBC972E2951C9AECD7F31CCF7BE1CAB978B1B97EDB6FEFD +D79CE739EDF39CF739EF7BD2EF89FE1B4804B972EA1B6B616797979A8A8A8C099 +3367A4E5BFE1A902FAFBFB317DFA74F8F8F8206BC912588A8B51919D8DE52929F +01A3F1EADADAD72E6B3614401E7CF9F87C964C2E7F5F5B85F5E0EEBA245766C9B +370F73838361369BA5C7E831A2006F6F6F0C5CBF6E0B7868D62C644F9E8CB2F07 +0B4C6C5D9C6E7F8FAE2D4A953D26B747028203A3A1ACDCDCDF87BDD3AFCB26001 +5C5C5C7078F66CDC2A2D45C7CE9D707375457158984D04DB9F050EBD7C6957FD7 +575B6C57F4B4810A73114251B36E0939933C59C147F7F946565498BF3500AB871 +E30602030371BFA4041DF3E7232B20008F2E5E94D6417474746075529210F04D4 +C0CA2283DA38552404B4B0B121313D1B772254EC7C66213ED5285BB77EFE2E5E4 +6421E02ACDF7F5F09016E7E13005E154687D6BD6A093164E0E0A92A3F6686A6AC +2A6820221605764245684864A8BF3702860ECD8B1E8AAAC148BE7D155ABADAA92 +9641B8B9B9E19CC522E6E44E998286DC5C69711E0E05A4A5A5A1913A1E2FCE7C8 +36E00DFF7C6C64654575763C28409E204EE519AD89EE4E78787274E486FE7E150 +405B5B1BBCC68DB309607653D57F4727F12B5DCF07478FE2DEAA5562BC6AC60CA +CA6A21DE8EA92DECEC3A100467A7A3A8ED0D51A2A42C5A924B43127477A8D0E23 +0AE0174E0C15972AA8C11A5D47F4C489F8E7EC59E9353A8C2880111515852F972 +D530667A652033A9C9121678F1EC3049452ABD5340D4B972E457E7E3E32333391 +4005A80ACEBB8F9D34090F8F1F17DD9253B670E14258AD56B11617726A6A2A62A +99744444420801A9AA7A7A76872C6BBC34E406F6FAF6840AF1DBE89B995D76DF4 +D333B0272E759880006A3CFBE317DBCD359873A41B71F464AAECC6BBC34EC0B16 +3C7F0E6B672686FFF6EC7D0579BE0EAEA66179C77BF96EE7E51DE67C3E66BDBAE +41AFBE327C7C0859C0C53FFBED05141616A2E8D3166825D786D13FBE00DB631EF +77DA6BFBB3B1AD25643DB71157A5527F4DD574450BDE632B47768EC7D1AA3DFFA +41228FEF21F2D8CE4E841534C3332012753FF4DA0B888F8FC7E27DDD4A01330A7 +F8487879708CEAFE1726AD5AFAFFF0ADA76B23F417D3FED5EB1864153CA56F8C5 +E6C2FA60C05E40DFC301E845EA23630666EC40CAB44878D2B7C0B7991B957398F +A3E12B0596D637A4F4B44489645C4B413F0F1F777940E06F9085DC68C111F2639 +EB4F2AE77060FD834EB54D728CDB0B48A8FC59C414027A7A7A44F5675AFE503A1 +8E49C9A92B6A02187AEAAC22EC8C75C71556D9374F7094141C3CD4101EDEDEDE2 +45137F90F2C7C5B48B8A8576218A860BEC3D492E26CB65A4ECBE209E23D228C00 +344AA09E14BA989283B07AFD018D45EB83328A0A6A6065FFC6455AAB5B18C76F5 +949D695BE89468034A9B64F02B87E017BD16576E3F782C80BB1677BE151F8D7CF +C7CB5B4AD74BC2A9B4133D9E95A2A6D92A68422042DD92D82335CEAE99BDF6C2E +C5AC62B583C1A7151693EFB8A80185CDA0ABC78B8879EBA40C4F02B2E95FCEC67 +20BF40F29477B65AE38679C3BCE21E792734AF5C01D4E33D30E2BA9D1BC4B35C1 +75C27EEC738048CD4608E079FCE4B4D15C8D84895AA2DA72F70FC6E6AF6FC9F02 +480BFFD7D4C53956A0D8A8515E34F9205ABC60D86E41C112D78EFE9DB32BC2C42 +6DCE4BC2F0BCE9E11F8ED0E507F057DF23119C616B443DD647A2373F6FDA03F81 +751AD08E04A61DA310000000049454E44AE42608200"; + return r union dbugicos(); + end + function dbugicos(); + begin + r := array(); + r["/ɾϵF5"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100022B01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000C049444154 +484B63F84F6330022CB0769FF85F58A98A280C528B0EF05A1095BAE8FFCEBD37A +03CC200A416A40719E0B500E42A5201BA1EFA5AB076D3C5FFF6DE93C16179E4F8 +5DEA5B6064DFFDFFF6DDD7501E0D7C802E396A01088C5A800148B2A073E2DEFF3 +9A56BFE6FD87A99280C52DB31610F543704E0B500040E1CB9FD3F2967195118A4 +161D10B4801000F9121FA0AF0520C5DA961D58BD8F0DFB45CEFE7FEFC11BA86EE +C00C50210F8F0F13BD608C48689011816501B0C750BFEFF070066B64F1FB7C689 +CB0000000049454E44AE42608200"; + r["ͣ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100022401000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000B949444154 +484BED8FBB0AC2401045AD2CC4CA0FB0D0CA5E1B7F401B3F3C820A29825A98F8C +A0F988744E2C459278F6598ADB450F6C06DE6C23D4C0BBECC1F0B1EE105B2E3E1 +9D934FD79AAA7B258F6E74E58882FDA807DB7EBBCA3389A90148374BAD0B16536 +A38A2A03980C9E3881A8064EDB05E4214EC061D6DC024F067636A3856A062052A +56C0B0821251D01CC098041809F98361571B300982F9841A8E28B87BAE1AC2A4E +E8AAE356587C9AE67BA7244C1A7F875014001DF29EF2FFBC3E1B1000000004945 +4E44AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002E201000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000017749444154 +484BAD95CB2E035118C73D835BB4112511D61E80A7B0747900AFC003D892A84E1 +B246CEC24166A8145C3A60B21128BCE8CA6F4128AD665A42EF93B47BF3363B43A +9D73E697FC33E93933DFAFFDE6CB690788C5F43DB4F30A7D0A0E5B90BAB1108AE +9984916706B7DD2AA3A2E4124AEA3279A41E74A06CBA70FB4A3864B3098307E8A +F3441226C636B338BAB6E80E39DC82B82310E16D9BDD2F4AB7CD53C0A3D2B6B60 +422036CDF6FDB7C0944FC4C9B9480C769DB2355688EB440A4DEB62B1CE65EA992 +1B6581482866603AD9386D81097844DBCCCA3B550D5AB0AA63FEF88E2AD609443 +0C44E8089ED1CD2A537AAE6A024E863DFB88B5DA367FF4F92B420ACE998DA2B22 +5B75FADD0CDF827ECDC0C8BA891DFD999E6C8D6FC1C249194FB52F7ACA9BB6046 +176348CB39798CAFB3FBADD825FFF0722DD6CB6973C8E8356FC119876613E1D93 +BB795C946B74871C0D82DEA88EE135135B9755DA51C316F0711BDD3031775042E +1E58356D5B1051CFE2B8205F806770EAF93F6C525FA0000000049454E44AE4260 +8200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100028401000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000011949444154 +484BB5954B0AC2301086BD9E3771E3C643780B578AA2A0541405A122EE558A4F7 +C811B372E4410DF1219496B8393F4B7EA0759740AF36566DA2422FE8C2248778E +62B5BDCB2795F6F2F25C9FE209287934B513B1D29E95D03B5AD9DE494630940A9 +2CD835692E99E3C49C139CB68306F334025C53E56093B6454620D832B6105042A +A98ECD83D70A0854529FE8254601814A1A53BE5D8102C224713F6F5AF6FCBD124 +840A095B416AA041610AE245EDECBC80BBFC4595F6534A42051310B669B9B8CFE +A845FE39846A11DA7F7B1662C8E8CE1B53FE5F300AD0E4B589FEC8D00AD0B6544 +6FCCE5D58019ADC1A8438ECD0E4C53E762728023479DEC16F354F805E99B96FAE +4C9270C909FA527427A60976C8BF43880799B976B3940BD8ED0000000049454E4 +4AE42608200"; + r[""]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002ED01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000018249444154 +484BCD933B4BC3601486FD0F3A3938D841872E0A0AD2C1C141271727577111A48 +30E855625A09680507410844E2E2A88508428B45EF082850A2254F1822288E0CF +3872EC39C9C9E5FB92140B3EF041F39E93F7214DDB062DE67F09CCF513D8DEADD +15534220BA66677A0BD3BFB7BF2850AA5E14412C8723E86794C533DA102598E9F +E5F5C28A455B6AB4026F3923F38C714869304A81AA9C91F3B95C89523F8182B07 +246EEA5330794BAF109A29633727F667E9F520797206E3923EF9B4EEF51DAC016 +E09F48575EB2EA901ADD80B1892D7878FAA6D4414A16F347940A01FEAE75E57C3 +39EC19102DCD7BF68EAC092CDE215258A972CF196F3E91F5E83DBBB4FDA52A315 +78CBF15A66C92113AAB50FDA0E4629082A67E4AC6760152E6FDE68E22750A02B6 +7E44EA26F194E2F5E69E2C6278852CEC8DDAEA401E5B3679A38B80471CA19794F +67EF1258E5479A34B00595F397D8E58C947424B2705D7DA789108C4F169B2A67A +404BB185B80561CE093340B7E3DB21CF1BDE4BFA6C502801FF275D8DB8771B6A3 +0000000049454E44AE42608200"; + {r[""] := "0502000000060400000074797065000203000000696D670006040000006461746 + 100025701000089504E470D0A1A0A0000000D4948445200000018000000180806 + 000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 + BFC6105000000097048597300000EC300000EC301C76FA864000000EC49444154 + 484BC5D5CD09C240108661EBB003CBB0801460035E723087282A117F886024A0A + 0276F962558893B616565844427BB331B832F783003DF83E46047B7DCFF819BBE + EB0B5CF19B3C2B60C6FB2AD0DD474F0F21C2A7B26A81F2F8FBE383587F41561C2 + B800FE27C079B62DF087102A604B6DE080B304D60E985B0015304733122024C21 + 8C45881830E5707A8D72102FE073FC05A81F01D478A862BC7E2702A8F111CCF04 + AC706A8F1181678AD8F0550E35358E3D59E13A0C61348F1EACE0A50E32BC8F0CA + CB0A046A50194F21C70B3F2B50FE4FD8C1019FCA72BE0383E4C519BFC973024D6 + B19D0FA0973865C3E24DD42ED0000000049454E44AE42608200";} + r["һ(F8)"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100025E01000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000000F349444154 +484BED93CD0A015118865D835BB0B37509EEC2CE6DB8105694B29C859548766E4 +0ACFC6450148A1AA349C3A7777E0E66CE9C9F290BE5A96F31DF999EA74E9D0C7D +997F400A0B5C6E77AA8D4E3458DBC1261D8EFBA0C6E44CFBABEB7DB340D1D850B +63AF3A6DCDB055B3DDA738BF2CD25F3F457B61F30A6165B86A31B813CEA28B44C +3F303E3AB1438C6A8427C7943ADBD71541C6FB4916499263BA66704521BA11911 +C67E0230054232A72100B005944550EB801208AF0F698A81C24068048161D9E1C +08034025922407D200D0BD96779402801791C9817200548607CAD517DE0B55910 +3AD401AFE0129BF1E207A02B9FA383F9BCBB70F0000000049454E44AE42608200 +"; + r["ֹ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100026602000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001FB49444154 +484BED94596B145114847DC8BEAF6423FBBE424296FFFF3F444386CC609C314EA +2AD498629EBEBE92B361C8982C197141C98BEC3AD3A5DA74EBFD10BE355E059FC +1F81F6D999F46B9D9E4AC7C7D2D191B4BFAF2757B6B7A7A6ABE1AAF9B9727050D +C2E237E03482F2E3A757EDE793E39E908ECEE4A9B9B7A747DDDD8D0EDD6966EB6 +B755D9D9292E97F16702E90D0E0F2593696D4DAD951565CBCB6AAEAEEAA39FABE +BEBC5E5327E2F007122A77BC8E91EA2A525696E4EDFE7E775B7B0A0FAE2A2AA16 +8B100B409ABC4FD6D86BAC913B9789DB53537A74DDCDCCA8313BABAACF22C402D +80171B205727B9D93BB6399B83D36A607D7FDF8B81A9393AA4D4F1797CB8805E8 +984AB6D0B9BDCEC9211A1D556B6848DF5CF7C3C3AA8F8CA83631515C2E231670E +C7262068AE7A9F3825CFDFD7AEAEB53D6DBABE6C080EA16AA5A24422840CEF3AE +9D8E7CA0F86B5B1279CBE40F3D3DFAD2DDAD4F16B9B1C8F5DF08B044E49C28921 +6068AE7D842E790675D5DFA6C8186AB66D18AFF8B100AB0A12C1139278AA48581 +E27966323A4FE41FFC06D73EBB1A1C2C6E97110AB0FE6C284B44CE89226961A07 +88E2D3FC95D573E7BEFFF2284027C5B587F36942522E74491B430503CC796BC73 +FFBEF4D93BE6132014E0C3C5B785F567435922724E14490B03C5F34B774DE790B +F75031142817F89578167F1C202D20F98CF9591BE2EF7850000000049454E44AE +42608200"; + r["ˢ·ű"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100027702000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000020C49444154 +484BC596DD4B145118C6FBEBBA13C12B6FBAE8224C414A08BA116BD584C050171 +752D02093B6442D2F84CA34B520D35CBFC036493445CAAC50776D5D9DF771DEF3 +313B677766F6EBA21F3C3767E73CCF9CF39EF3CE5E42996CEF03D7C2845B7DA44 +64C0203D2E7C0EE0110FB068C2F1086DE1396364DA3CE1784CB8D96D0444C0DBA +F00D189F275C699713BD74B5C342FB70C69C551B21A4D2E60BE404ECFC025A9E9 +A138BD1E05440006F49436FE9E6ACAA7B16BEDB75D118010F46CB33D7EAB0EBA2 +71020626A5F9F56E0B8FDF5A58DF31977A74024C2E93D8F7EAFBDEC66E2D6CC87 +94E4043AF4C3E4CAA81003E7E81A7A95BFC928C08F89B80335008AD51FFADAC6A +B5C4EF7C3F181130B3666E473EF8526943DEAEBB8384E88CBC23E933F590C2287 +2A1FCF80361B6F75B0D0450524031FCFF80AD9F843731C2A7787175D2E40424FE +01EF5608E131428D7D277431FDBAA51FF35FE5F34E001FD31B3D19C36CF5BF2E2 +CE0E4541E63DD2E44009B7B99BAB5B6259E0F64D16EEBF50F65173E55C755046C +EC0115216F63AD8A10A1E909E1F92C612E2E8FA9D6C807C2ED4799BBF1EA7366B +5CE16E95E54AEBA5E9A1DC10948A581BA88F7A44275C75E61364E0033B592BF89 +F9697A5599646104306DCFCC89BCE49B76A7AD6C36C759B5F631E60E1CDF55933 +DC80970173CBBC31EDBDF84ED7D59D8644A0DE62127806163FE2BA25B6EE90017 +13C9EE8D2E4822C60000000049454E44AE42608200"; + r["ˢµǰ"]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100027802000089504E470D0A1A0A0000000D4948445200000018000000180806 +000000E0773DF8000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000020D49444154 +484BB594DD2BA74114C7F7EF70A914529262BD5C798B645F5A2552EE5C4872837 +2B1524A6D5C59C566A98D52ECC55228B4ED850B3724424A5A89B8D9B597CFBC1C +7D4F679EE691C76EC37E6AFACD3933BFF93E73E63BF382FE3309815DBB4F8BF61 +B4DE8695AB7DF25FB34628151F39132A29C442B5655321A0E0B1CDAE378D1CF66 +96CEE827B5EA768E87F4084F0C8505E6CC022F76BF2CF9513995A81A89C260812 +F669E05F0E53E9DBA87B2A32289C260814B7BC502288B0F726DBA43A230E243C6 +D7624194A5570F701FED5FDC8439701E1C0827FAC402E0AB59A6DCE8252FDCAEB +B69D9ACC9483A709AFB18D7E04847420038BBD6AA46C9A40387612E4A8BF38303 +9D089C095205D046F498641F060E43497D502EFC17CE04A9020366987FDFA936D +AB17B329A24332AE0B3F3C14EF03F9C09481500AB6683AAD55B8E1B54330DEA0F +B465B669D12CD1A499A14AF5269EEB7017D499E35101704B7F68CC7CA20AF59AF +37E2B53B5BC0BF4E13C940B7DFF89F9AB800FC40EEC119DD853C910EFE8956AA1 +2C55C86772FF694908F836456D7FD16F1909271670170D027E7FD3FC901961B0C +0B9BDE005BB741F271DC8F5E8F71285C102D37241AEE986930E1C5C5E542A5118 +2C80370402B8893E285179542751182C80070A0268F02F76827221EED6FD3C319 +4F890FD27C2B57AD524A3E1C402000F14DE907133452B765DB24F2321F0FC10DD +0144332BF870524ED00000000049454E44AE42608200"; + return r; + end + function ejsonformat(d,tbw,ct); + begin + //d: + //tbw : ַ,tab + //ct ݹ, + case datatype(d)of + 0,20:return inttostr(d); + 1:return floattostr(d); + 2:return tostn(d); + 8,10,11,12:return "null"; + end; + if not(ct>0)then ct := 0; + if not ifstring(tbw)then tbw := " "; + tbstr := ""; + tbstra := ""; + for i := 0 to ct do + begin + tbstr += tbw; + if i>0 then tbstra += tbw + end + if ifarray(d)then + begin + if not d then return "[]"; + idx := 0; + for i,v in d do + begin + if idx <> i then + begin + fobj := true; + break; + end + idx++; + end + if fobj then + begin + r := "{"; + for i,v in d do + begin + if ifstring(i)then ii := tostn(i); + else ii := tostn(tostn(i)); + r += "\r\n"+tbstr+ii+":"; + if ifarray(v)and v then + begin + r += "\r\n"+tbstr; + end + r += ejsonformat(v,tbw,ct+1)+","; + end + lr := length(r); + r[lr:]:= "\r\n"+tbstra+"}"; + end else + begin + r := "["; + for i,v in d do + begin + r += "\r\n"+(tbstr)+ejsonformat(v,tbw,ct+1)+","; + end + lr := length(r); + r[lr:]:= "\r\n"+tbstra+"]"; + end + return r; + end else + if ifobj(d)then + begin + try + //return "{}"; + //˴ԱϢ + objtoarray(d,dinfo); + for i,v in mrows(dinfo,1) do + begin + nv := invoke(d,v); + if ifobj(nv)then nv := nil; //ѭ + dinfo[v]:= nv; + end + return ejsonformat(dinfo,tbw,ct); + except + return "{}"; + end + end else + return "null"; + end + function objtoarray(o,r); + begin + d := o.classinfo(); + if not ifarray(r)then r := array(); + for i,v in d["inherited"] do + begin + objtoarray(findclass(v,o),r); + end + for i,v in d["members"] do + begin + n := v["name"]; + if v["access"]in array(0,1)then + begin + r[n]:= 0; + end else + begin + reindex(r,array(n:nil)); + end + end + for i,v in d["properties"] do + begin + n := v["name"]; + if v["read"]and(v["access"]in array(0,1))then + begin + r[n]:= 0; + end else + begin + reindex(r,array(n:nil)); + end + end + end + function ReWriteString(fn,d); + begin + if not ifstring(d)then return 0; + als := ""; + len := length(d); + if FileExists(als,fn)and(filesize(als,fn)>len)then + begin + lfn := FileList(als,fn); //ļСд + if lfn then + begin + nfn := lfn[0,"FileName"]; + if nfn then + begin + for i := length(fn)downto 1 do + begin + if fn[i]="\\" then + begin + fn := fn[1:i]+nfn; + break; + end + end + end + end + FileDelete(als,fn); + end else + begin + CreateDirWithFileName(fn); + end + spos := 0; + return writefile(rwraw(),als,fn,spos,len,d); + end + function gettslexe(); + begin + return static gettslexefullpath(); + end + function gettslexefullpath(); + begin + plg := pluginpath(); + sp := ioFileseparator(); + for i:= length(plg)-1 downto 1 do + begin + if plg[i]=sp then + begin + if sp="/" then + begin + return plg[1:i]+"TSL"; + end else + begin + return plg[1:i]+"tsl.exe"; + end + end + end + return ""; + end + {$ifdef linux} + function HtmlHelpA() + begin + return 0; + end + function GetDesktopWindow() + begin + return 0; + end + {$else} + function HtmlHelpA(hwndCaller:pointer;pszFile:string;uCommand:integer;dwData:pointer):pointer;stdcall;external "HHCTRL.OCX" name "HtmlHelpA"; + function GetDesktopWindow():pointer;stdcall;external "User32.dll" name "GetDesktopWindow"; + {$endif} +end. diff --git a/designer/utslcodeformat.tsf b/designer/utslcodeformat.tsf new file mode 100644 index 0000000..573db3b --- /dev/null +++ b/designer/utslcodeformat.tsf @@ -0,0 +1,1649 @@ +unit UTslCodeFormat; +interface +//TSLʽ code Ϊ,tabwidth Ϊո LineWordCount ΪĴĿ linelength ַ +//20210311 ˺廻е +//20210406 LineWordCount linelength Ѿ +//20210308 ABComment ,ƿע͵ +function FormatTsl(Code,tabwidth,LineWordCount,linelength,arraytype,ABComment); +type TTslFParser = class(TFormatParser) + function Create(); + begin + inherited; + end +end +implementation +function FormatTsl(Code,tabwidth,LineWordCount,linelength,arraytype,AlignBlockComment); +begin + pser := static new TFormatParser(); + pser.Script := code; + pser.ArrayType := ArrayType; + if tabwidth>1 then pser.HierarchyWidth := tabwidth; + pser.AlignBlockComment := AlignBlockComment; + //if LineWordCount>0 or LineWordCount<0 then pser.MaxLineCount := LineWordCount; + //if linelength>0 or linelength<0 then pser.MaxLineLength := linelength; + return pser.FormatCode(); +end +type TFormatParser = class + TK_STR; //ַ + TK_W; // + TK_C; //ע + TK_C_S; //ע + TK_C_D1; // { + TK_C_D2; // (* + TK_SYN ;// + TK_SYN_S;// + TK_TSLX ;// ע + TK_KEY; + TK_TYPE; + TK_CLASS; + TK_FUNCTION; + TK_SELECT; + TK_UNIT; + TK_IF; + TK_THEN; + TK_ELSE; + TK_BEGIN; + TK_END; + TK_TRY; + TK_EXCEPT; + TK_FINALLY; + TK_CASE; + TK_OF; + + TK_EXTERNAL ; + TK_CDECL ; + TK_STDCALL ; + TK_NAME ; + TK_keepresident ; + TK_OPERATOR; + TK_PRIVATE; + TK_ARRAY; + TK_NEW; + TK_DO; + BT_DEF; + BT_UNIT; + BT_TYPE; + + BT_BEGIN; + BT_CASE; + BT_SELECT; + BT_TRY; + BT_ARRAY; + BT_CALC; + FSynParser; + FSynParser2; + FHtmlParser; + function Create(); + begin + TK_STR := 1; //ַ + TK_W := 2; // + TK_C := 4; //ע + TK_C_S := 8; //ע + TK_C_D1 := 16; // { + TK_C_D2 := 32 ; // (* + TK_SYN := 64;// + TK_SYN_S := 128;// + TK_TSLX := 256;// ע + TK_KEY := 512; + // + TK_TYPE := 1; + TK_CLASS := 2; + TK_FUNCTION := 4; + TK_SELECT := 8; + TK_UNIT:=16; + TK_IF := 32; + TK_THEN := 64; + TK_ELSE := 128; + TK_BEGIN := 256 ; + TK_END := 512; + TK_TRY := 1024; + TK_EXCEPT := 2048; + TK_FINALLY := 4096; + TK_CASE := 8192; + TK_OF := 16384; + n := 15; + TK_EXTERNAL := 2^(n++); + TK_CDECL := 2^(n++); + TK_STDCALL := 2^(n++); + TK_NAME := 2^(n++); + TK_keepresident :=2^(n++); + TK_PRIVATE := 2^(n++); + TK_ARRAY := 2^(n++); + TK_NEW := 2^(n++); + TK_DO := 2^(n++); + //.............................. + BT_DEF := 1; + BT_UNIT := 1+2; + BT_TYPE := 1+4; + BT_BEGIN := 8; + BT_CASE := 8+16; + BT_SELECT := 8+32; + BT_TRY := 8+64; + BT_ARRAY := 8+128; + BT_CALC := 8+256; + //................................. + FHierarchyWidth := 4; + TslSyn := array(":=","<>",">=","<=",".>",".<",".>=",".<=",".=","++","--","?:",".!!",".&&",".||",".&",".|",".^", + ":*",":/",":\\",":^",":|","::","::=","->", + "+=","-=","*=","/=","\\=","^=","~=","%=",".|=",".&=",".||=",".&&=",".^=","|=",":|=","&=",":*=",":/=",":\\=",":^=", + //"div=","union2=","intersect=","outersect=","minus=","end.", + "##","l'",'l"',"*", + "%%","(*","//","#!", + "", + "?>", + //"0x","0O","0b", + ); + TslSyn2 := array("div=","union2=","intersect=","outersect=","minus=","end.",); + // "union2=","intersect=","outersect=","minus=","end.", + FMaxLineCount := 20; + FMaxLineLength := -1; + FSynParser := new TTire(); + FSynParser2 := new TTire(); + for i,v in TslSyn do + begin + FSynParser.add(v); + end + for i,v in TslSyn2 do + begin + FSynParser2.add(v); + end + FHtmlParser := NEW TTire(); + FHtmlParser.Add("=1 then return FTokens[cidx-1]; + end + function PrevTK(); + begin + if FTkIndex>0 then + begin + FTkIndex--; + return FTokens[FTkIndex]; + end + end + function PrevNComTK(); + begin + while FTkIndex>0 do + begin + FTkIndex--; + tk := FTokens[FTkIndex]; + if tk.FType .& TK_C then continue; + return tk; + end + end + function GetPrevNComTK(cidx); + begin + cidx := FTkIndex; + while cidx>0 do + begin + cidx--; + tk := FTokens[cidx]; + if tk.FType .& TK_C then + begin + continue; + end + return tk; + end + end + function ChangeLine(); + begin + if FCWordCount then + begin + FFormatStr+="\r\n"; + FCWordCount := 0; + FLWordLength := 0; + end + end + function AddTokenToStr(idx); + begin + tk := FTokens[idx]; + if not tk then return ; + bidx := FTkIndex; + FTkIndex := idx; + {if idx>1 and (tk.FType .& TK_KEY) and (tk.FTypeSub .& TK_ELSE) and (ptk := GetPrevTK(ttidx)) and (ptk.FTypeSub .& TK_END) then //else + begin + fl := length(FFormatStr); + if FFormatStr[fl]="\n" then + begin + FFormatStr[fl-5] := ptk.FStr+" "+tk.FStr+"\r\n"; + end else + begin + FCWordCount++; + FLWordLength+=tk.FStrL; + end + + end else } + fl := length(FFormatStr); + if idx>1 and (tk.FType .& TK_KEY) and (tk.FTypeSub .& TK_ELSE) and (ptk := GetPrevTK(ttidx)) and (ptk.FTypeSub .& TK_END) and (FFormatStr[fl]="\n") then //else + begin + FFormatStr[fl-1:] := " "+tk.FStr+"\r\n"; + FCWordCount := 0; + FLWordLength := 0; + end else + if (tk.FType .& TK_C_S) and tk.FFirst=0 then + begin + fl := length(FFormatStr); + if fl>2 and (FFormatStr[fl-1:fl]="\r\n") then + begin + FFormatStr[fl-1:fl]:=" "+tk.FStr+"\r\n"; + end + else FFormatStr+= " "+tk.FStr+ "\r\n"; + FCWordCount :=0; + FLWordLength :=0; + end else + if (tk.FType .& TK_SYN_S) and (tk.FStr="*") then //(**) + begin + FFormatStr+= " "+tk.FStr+" "; + end else + if (tk.FType .& TK_SYN) and (tk.FStr=";") then + begin + fl := length(FFormatStr); + if fl>2 and (FFormatStr[fl-1:fl]="\r\n") then + begin + FFormatStr[fl-1:fl]:=";\r\n"; + end + else FFormatStr+=";\r\n"; + FCWordCount :=0; + FLWordLength :=0; + end else + if (tk.FType .& TK_KEY) and ((tk.FTypeSub .& TK_PRIVATE)) then + begin + ChangeLine(); + FFormatStr+= FHier.HierStr()+ tk.FStr+"\r\n"; + end else + if tk.FType .& TK_C then + begin + // + if tk.FType .& TK_C_S then + begin + + if FCWordCount then + begin + FFormatStr +=" "+tk.FStr; + end else + begin + FFormatStr+= FHier.HierStr()+ tk.FStr; + end + FFormatStr+="\r\n"; + FCWordCount := 0; + FLWordLength := 0; + //ChangeLine(); + end else + begin + // + mcs := tk.FStr; + if FAlignBlockComment then + begin + mcss := str2array(mcs,"\n"); + lenmcss := length(mcss); + if lenmcss>1 then + begin + mcs := mcss[0]+"\n"; + for i,v in mcss do + begin + if i=0 then continue; + cz := false; + for j:= 1 to length(v) do + begin + if v[j] in array(" ","\t","\r") then continue; + cz := true; + break; + end + if cz then + begin + vs := v; + vs[1:j-1]:=FHier.HierStr(); + mcs +=vs; + end else + begin + mcs+=v; + end + if lenmcss>i+1 then + begin + mcs+="\n"; + end + end + + end + //mcs := replacetext(mcs,"\r\n","\r\n"+FHier.HierStr()) ; + end + if tk.FFirst then + begin + ChangeLine(); + end + if FCWordCount then FFormatStr+= " "+ mcs; + else + FFormatStr+= FHier.HierStr()+ mcs; + ttk := GetNextTK(); + if ttk and ttk.FFirst then + begin + FFormatStr+="\r\n"; + FCWordCount := 0; + FLWordLength := 0; + end + else FCWordCount++; + end + + end else + begin + state := Fstates.GetState(); + + if ((state = BT_ARRAY and FArrayType=0) or (state = BT_SELECT)) and tk.FFirst then + begin + if FCWordCount then + begin + FCWordCount := 0; + FLWordLength := 0; + FFormatStr+="\r\n"; + end + end + if FCWordCount then + begin + ttk := GetPrevTK(); + if ttk and ( (tk.FTypeSub .& TK_DO) or (tk.FTypeSub .& TK_END) or (((ttk.FType .& TK_W) or (ttk.FType .& TK_KEY) or (ttk.FType .& TK_STR) ) and ((tk.FType .& TK_W) or (tk.FType .& TK_KEY) or (tk.FType .& TK_STR))) ) then + // if ttk and ((ttk.FType .& TK_W) or (ttk.FType .& TK_KEY)) or ((tk.FType .& TK_W) or (tk.FType .& TK_KEY)) then + begin + FFormatStr+=" "+tk.FStr; + end + else FFormatStr+=tk.FStr + end else + begin + FFormatStr+=FHier.HierStr()+tk.FStr; + end + FCWordCount++; + FLWordLength+=tk.FStrL; + if false and ((FMaxLineCount>0 and FCWordCount>=FMaxLineCount) or (FMaxLineLength>5 and FMaxLineLength "hsm" then return 1 ; + if hssmok then + begin + goto jump1; + end + return 0; + label jump1; + PrevNComTK(); + //PrevTK(); + if nhsmame then return 3; + return 1; + label jump2; + if nhsmame then return 3; + return 2; + end + function FormatCode(); + begin + ParserTslToken(); + //FOR I,V IN FTokens do ECHO v.FStr,"\r\n"; + //return ; + DelTokens(); + ctk := CurrentTK(); + state := Fstates.GetState(); + while ctk do + begin + bkindex := FTkIndex; + if (state .& BT_DEF) and (ctk.FType .& TK_KEY ) and (ctk.FTypeSub .& TK_TYPE) then //type class + begin + bctk := ctk; + ctk := NextNComTk(); //name + if not ctk then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + ctk := NextNComTk();//= + if not(ctk) then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + ctk := NextNComTk();//class + if not ctk then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + if {lowercase(ctk.FStr)<>"class"} not( ctk.FTypeSub .& TK_CLASS) then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + ctk := NextNComTk(); //( + if ctk and ctk.FStr="(" then + begin + while true do + begin + ctk := NextNComTk(); + if not(ctk) or ctk.FStr=")" then + begin + break; + end + end + end else + begin + PrevNComTK(); + end + ChangeLine(); + Formataline(bkindex,FTkIndex); + ChangeLine(); + FHier.Push(); + FStates.Push(BT_TYPE); + state := BT_TYPE; + end else + if (state .& BT_DEF) and (ctk.FType .& TK_KEY ) and (ctk.FTypeSub .& TK_UNIT) then //unit + begin + ctk := NextNComTk(); //name + if not(ctk) then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + ctk := NextNComTk();// ; + if not(ctk) or(ctk.FStr<>";") then + begin + AddTokenToStr(bkindex); + FTkIndex := bkindex; + ctk := NextTK(); + continue; + end + ChangeLine(); + Formataline(bkindex,FTkIndex); + ChangeLine(); + FHier.Push(); + FStates.Push(BT_UNIT); + state := BT_UNIT; + //return ""; + end else + if {(state .& BT_BEGIN) and} (ctk.FType .& TK_KEY ) and (ctk.FTypeSub .& TK_CASE) then //case of + begin + while true do + begin + ctk := NextNComTk(); + if (ctk.FType .& TK_KEY) and (ctk.FTypeSub .& TK_OF) then + begin + break; + end + end + ChangeLine(); + Formataline(bkindex,FTkIndex); + ChangeLine(); + FHier.Push(); + state := BT_TYPE; + Fstates.Push(BT_BEGIN); + end else + if(ctk.FType .& TK_KEY) and ((ctk.FTypeSub .& TK_TRY) ) then //TRY + begin + ChangeLine(); + AddTokenToStr(FTkIndex); + ChangeLine(); + FHier.Push(); + state := BT_TRY; + Fstates.Push(BT_TRY); + end else + if(ctk.FType .& TK_KEY) and ((ctk.FTypeSub .& TK_BEGIN) ) then //begin + begin + ChangeLine(); + AddTokenToStr(FTkIndex); + ChangeLine(); + FHier.Push(); + state := BT_BEGIN; + Fstates.Push(BT_BEGIN); + end else + if (ctk.FType .& TK_KEY) and ((ctk.FTypeSub .& TK_END) ) then //end + begin + //select end + if state<>BT_SELECT then + begin + ChangeLine(); + end + FHier.Pop(); + AddTokenToStr(FTkIndex); + //select end βҲ + if state<>BT_SELECT then + begin + ChangeLine(); + end + Fstates.Pop(); + state := Fstates.GetState(); + ChangeLine(); + end else + if (ctk.FType .& TK_KEY) and (ctk.FTypeSub .& TK_SELECT) then //select + begin + AddTokenToStr(FTkIndex); + //ChangeLine(); + FHier.push(); + state := BT_SELECT; + Fstates.Push(BT_SELECT); + end else + {if (ctk.FType .& TK_KEY) and (ctk.FTypeSub .& TK_TRY) then//try + begin + ChangeLine(); + AddTokenToStr(FTkIndex); + ChangeLine(); + state := BT_TRY; + FHier.push(); + Fstates.Push(BT_TRY); + end else } + if (state .& BT_TRY) and (ctk.FType .& TK_KEY) and (ctk.FTypeSub .& TK_EXCEPT) then + begin + ChangeLine(); + FFormatStr+=FHier.HierStr(-1)+ ctk.FStr+"\r\n"; + end else + if (ctk.FType .& TK_KEY) and ((ctk.FTypeSub .& TK_CLASS)) and (state .& BT_TYPE) then + begin + + ntk := NextNComTk(); + if ntk and (ntk.FTypeSub .& TK_FUNCTION ) then + begin + ChangeLine(); + r := Findftokens(); + if r=0 then + begin + FTkIndex := bkindex; + AddTokenToStr(bkindex); + end else + begin + ChangeLine(); + Formataline(bkindex,FTkIndex); + ChangeLine(); + end + end else + begin + FTkIndex := bkindex; + AddTokenToStr(bkindex); + end + end else + if (ctk.FType .& TK_KEY) and ((ctk.FTypeSub .& TK_FUNCTION)) then //function + begin + r := Findftokens(); + if r=0 then + begin + FTkIndex := bkindex; + AddTokenToStr(FTkIndex); + end else + begin + if r<>3 then + ChangeLine(); + Formataline(bkindex,FTkIndex); + ChangeLine(); + end + end else + if (ctk.FTypeSub .& TK_ARRAY) then + begin + AddTokenToStr(FTkIndex); + state := BT_ARRAY; + end else + if (ctk.FStr ="(") then + begin + AddTokenToStr(FTkIndex); + FHier.push(); + if state = BT_ARRAY then + begin + //ƶ· + ptk := GetPrevTK(); + if ptk.FTypeSub .& TK_ARRAY then + begin + Fstates.Push(BT_ARRAY); + end else + if (ptk.FStr="+") or (ptk.FType .& TK_W) then // + begin + Fstates.Push(BT_CALC); + state := BT_CALC; + end else + begin + Fstates.Push(BT_ARRAY); + end + //ƶλ + if (state = BT_ARRAY)and (FArrayType .& 2) and (ptk := GetNextTK()) and ( ptk.FStr<>")") then + begin + ChangeLine(); + end + end else + begin + Fstates.Push(BT_CALC); + end + end else + if ( ctk.FStr =")") then + begin + lstate := state; + ischangelined := false; + if ctk.FFirst and (state=BT_ARRAY) and (FArrayType=0) then + begin + ChangeLine(); + ischangelined := true; + end + FHier.Pop(); + Fstates.Pop(); + if not(FArrayType .&2) then + begin + AddTokenToStr(FTkIndex); + end + state := Fstates.GetState(); + if (ischangelined =false) and FArrayType and (lstate = BT_ARRAY) and (state=BT_ARRAY) then + begin + tt := GetPrevNComTK(ttid); + ttstr := tt.FStr; + if ttstr<>"(" then + begin + ChangeLine(); + end + end + if (FArrayType .&2) then + begin + AddTokenToStr(FTkIndex); + end + end else + if (FArrayType .& 2 ) and (state = BT_ARRAY) and (ctk.FStr =",") then + begin + AddTokenToStr(FTkIndex); + ChangeLine(); + end else + if FArrayType and (ctk.FTypeSub .& TK_ARRAY) then + begin + AddTokenToStr(FTkIndex); + state := BT_ARRAY; + end + else //ͨ + begin + AddTokenToStr(FTkIndex); + end + ctk := NextTK(); + end + return FFormatStr; + end + function AddToken(sp,ep,t); + begin + if not(ep>=sp) then return; + ls := FScriptL[sp:ep]; + tklen := length(FTokens); + + if ls=";" then + begin + ltk := FTokens[tklen-1]; + if ltk and not(ltk.FType .& TK_STR) and (ltk.FStr=";") then return ; + end + t1 := t; + stype := 0; + if t = TK_W then + begin + nchange := false; + case ls of + "*": + begin + stype := TK_DO; + end + "array": stype := TK_ARRAY; + "if": + begin + stype := TK_IF; + end + "new": + begin + stype := TK_NEW; + end + "then" : + begin + stype := TK_THEN; + end + "rdo2","rdo","do": + begin + stype := TK_DO; + end + "else" : stype := TK_ELSE; + "begin" : stype := TK_BEGIN; + "end": + begin + stype := TK_END; + end + "end.": + begin + stype := TK_END; + end + "class": + begin + stype := TK_CLASS; + end + "unit": + begin + stype := TK_UNIT; + end + "private","public","published","interface","implementation","initialization" : stype := TK_PRIVATE; + "function","procedure": stype := TK_FUNCTION; + "type": stype := TK_TYPE; + "try": stype := TK_TRY; + "except","finally": stype := TK_EXCEPT; + "case" : stype := TK_CASE; + "of" : stype := TK_OF; + "select","mselect","vselect","sselect","update": + begin + stype := TK_SELECT; + end + "external": stype := TK_EXTERNAL; + "cdecl": stype := TK_CDECL; + "name": stype := TK_NAME; + "stdcall":stype := TK_STDCALL; + else + begin + nchange := true; + end + end ; + if not nchange then t1 := TK_KEY; + end + TK := new TTK(FScript[sp:ep],t1,stype); + TK.FFirst := FAtRowFirst; + tk.FStrL := ep-sp+1; + //tk.FLstr := ls; + FTokens[tklen] := tk;//array("type":t,"str":FScript[sp:ep],"subtype":stype); + FAtRowFirst := 0; + end + function iswordchar(s,idx); + begin + if idx<1 then return 0;//һ + cchar := s[idx]; + occhar := ord(cchar); + if 0= bytetype(s,idx) then //ascii + begin + return (occhar>=46 and occhar<=57 ) or // + (occhar>=65 and occhar<=90) or //ĸ + (occhar>=97 and occhar<=122) //Сĸ + end + // + return 1; + + end + function ParserTslToken(); + begin + FTokens := array(); + FAtRowFirst := true; + if not ifstring(FScript) then return ; + strl := length(FScriptL); + cwrd := ""; + cwrdstart:=1; + idx := 1; + while idx<=strl do + begin + if FSynParser.Find(FScriptL,strl,idx,outidx,outstr) then + begin + inidx := idx; + idx := outidx; + AddToken(cwrdstart,inidx-1,TK_W); + cwrdstart := outidx; + case outstr of + "0x": //16 + begin + idx2 := idx; + while idx2<=strl do + begin + cchar := FScriptL[idx2]; + if cchar in array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f") then + begin + + end else + if cchar="l" then + begin + idx := idx2+1; + break; + end else + begin + idx := idx2; + break; + end + idx2++; + end + if idx2>strl then + begin + idx := idx2; + return AddToken(inidx,idx-1,TK_W); + end else + begin + AddToken(inidx,idx-1,TK_W); + end + end + "0o": //8 + begin + idx2 := idx; + while idx2<=strl do + begin + cchar := FScriptL[idx2]; + if cchar in array("0","1","2","3","4","5","6","7") then + begin + + end else + if cchar="l" then + begin + idx := idx2+1; + break; + end else + begin + idx := idx2; + break; + end + idx2++; + end + if idx2>strl then + begin + idx := idx2; + return AddToken(inidx,idx-1,TK_W); + end else + begin + AddToken(inidx,idx-1,TK_W); + end + end + "0b": //2 + begin + idx2 := idx; + while idx2<=strl do + begin + cchar := FScriptL[idx2]; + if cchar in array("0","1") then + begin + + end else + if cchar="l" then + begin + idx := idx2+1; + break; + end else + begin + idx := idx2; + break; + end + idx2++; + end + if idx2>strl then + begin + idx := idx2; + return AddToken(inidx,idx-1,TK_W); + end else + begin + AddToken(inidx,idx-1,TK_W); + end + end + "%%": + begin + idx2 := idx; + while idx2<=strl do + begin + cchar := FScriptL[idx2]; + if pos(cchar," \r\n\t") then + begin + if FindStrInStr(FScriptL,strl,FScriptL[inidx:idx2-1],idx2,outidx,outstr) then + begin + idx := outidx; + AddToken(inidx,idx-1,TK_STR); + end else + begin + return AddToken(inidx,strl,TK_STR); + end + break; + end + idx2++; + end + end + "l'": + begin + idx2 := idx; + while idx2<=strl do + begin + tcchar := FScriptL[idx2]; + if tcchar="\\" then idx2++; + else + if tcchar="'" then + begin + AddToken(inidx,idx2,TK_STR); + idx := idx2+1; + cwrdstart := idx+1; + break; + end + idx2++; + end + IF idx2>strl then + begin + return AddToken(inidx,strl,TK_STR);; + end + end + 'l"': + begin + idx2 := idx; + while idx2<=strl do + begin + tcchar := FScriptL[idx2]; + if tcchar="\\" then idx2++; + else + if tcchar='"' then + begin + AddToken(inidx,idx2,TK_STR); + idx := idx2+1; + cwrdstart := idx+1; + break; + end + idx2++; + end + IF idx2>strl then + begin + return AddToken(inidx,strl,TK_STR);; + end + end + "//","#!": + begin + idx2 := idx ; + while idx2<=strl do + begin + cchar := FScriptL[idx2]; + if cchar="\r" or cchar = "\n" then + begin + idx := idx2+1; + AddToken(inidx,idx2-1,TK_C .| TK_C_S); + + FAtRowFirst := true; + break; + end + idx2++; + end + if idx2>strl then + begin + return AddToken(inidx,strl,TK_C .| TK_C_S); + end + end + "(*": + begin + idx2 := idx; + if FindStrInStr(FScriptL,strl,"*)",idx2,outidx,outstr) then + begin + idx := outidx; + AddToken(inidx,idx-1,TK_C .| TK_C_D2); + end else + begin + return AddToken(inidx,strl,TK_C .| TK_C_D2); + end + end + "","?>": + begin + idx2 := idx; + if FindStrInStr(FScriptL,strl,"strl then + begin + idx := idx2; + return AddToken(inidx,idx-1,TK_W); + end else + begin + echo + AddToken(inidx,idx-1,TK_W); + end + + end else } + if cchar="{" then + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart:= idx; + idx2 := idx+1; + while idx2<=strl do + begin + tcchar := FScriptL[idx2]; + if tcchar="}" then + begin + AddToken(idx,idx2,TK_C .| TK_C_D1); + idx := idx2; + cwrdstart := idx2+1; + break; + end + idx2++; + end + if idx2>strl then + begin + return AddToken(inidx,strl,TK_C .| TK_C_D1); + end + end else + if cchar="'" then + begin + AddToken(cwrdstart,idx-1,TK_W); + idx2 := idx+1; + while idx2<=strl do + begin + tcchar := FScriptL[idx2]; + if tcchar="\\" then idx2++; + else + if tcchar="'" then + begin + AddToken(idx,idx2,TK_STR); + idx := idx2; + cwrdstart := idx+1; + break; + end + idx2++; + end + IF idx2>strl then + begin + return AddToken(idx,strl,TK_STR);; + end + end else + if cchar='"' then + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart := idx+1; + idx2 := idx+1; + while idx2<=strl do + begin + tcchar := FScriptL[idx2]; + if tcchar="\\" then idx2++; + else + if tcchar='"' then + begin + AddToken(idx,idx2,TK_STR); + idx := idx2; + cwrdstart := idx+1; + break; + end + idx2++; + end + IF idx2>strl then + begin + return AddToken(idx,strl,TK_STR);; + end + end else + if cchar="\n" then + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart := idx+1; + FAtRowFirst := true; + end else + if pos(cchar," \r\t") then // + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart := idx+1; + end else + if pos(cchar,"()[]") then + begin + AddToken(cwrdstart,idx-1,TK_W); + AddToken(idx,idx,TK_SYN); + cwrdstart := idx+1; + end else + if cchar=";" then + begin + AddToken(cwrdstart,idx-1,TK_W); + AddToken(idx,idx,TK_SYN); + cwrdstart := idx+1; + //ָ + end else + if cchar="," then + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart := idx+1; + AddToken(idx,idx,TK_SYN); + end else + if pos(cchar,"*=+-*/\\`~!@#$%^&*?><.:") then + begin + AddToken(cwrdstart,idx-1,TK_W); + cwrdstart := idx+1; + AddToken(idx,idx,TK_SYN); + end + idx++; + end + AddToken(cwrdstart,strl,TK_W); + end + published + property AlignBlockComment read FAlignBlockComment write FAlignBlockComment; + Property Tokens read FTokens; + property Script read FScript write SetScript; + property HierarchyWidth read FHierarchyWidth write FHierarchyWidth; + property MaxLineCount Read FMaxLineCount write FMaxLineCount; + property MaxLineLength read FMaxLineLength write FMaxLineLength; + property ArrayType read FArrayType write SetArrayType; + private + function FindStrInStr(s,slen,fs,idx,outidx,outstr); + begin + tfinder := new TTire(); + tfinder.Add(fs); + tidx := idx; + while tidx<=slen do + begin + if tfinder.Find(s,slen,tidx,outidx,outstr) then + begin + return true; + end + tidx++; + end + return false; + end + function SetScript(s); + begin + if s<>FScript then + begin + FScriptL := ""; + FScript := ""; + FTokens := array(); + if ifstring(s) then + begin + FScript := s; + FScriptL := lowercase(s); + end + end + end + function Setarraytype(t); + begin + if FArrayType=t then return ; + if t in array(0,1,2,3) then + begin + FArrayType := t; + end + end + private + FAlignBlockComment; + FAtRowFirst; + FArrayType; + FTokens; + FHierarchyWidth; + FSym; + FScript; + FScriptL; +end +Type TTK = class + FType; + FTypeSub; + FStr; + FLstr; + FStrL; + FFirst; + function Create(s,t,st); + begin + FStr := s; + FType := t; + FTypeSub := st ; + end +end +type TTire = class + type TTireNode = class + FChar; + FSub; + FEnd; + function Create(v); + begin + FChar := v; + FSub := array(); + FEnd := false; + end + function Add(s); + begin + v0 := s[1]; + vsub := FSub[v0]; + if not vsub then + begin + vsub := new TTireNode(v0); + FSub[v0] := vsub; + end + ls := length(s); + if ls>1 then + vsub.Add(s[2:]); + else + begin + vsub.FEnd := true; + end + end + function Find(s,slen,idx); + begin + if idx>slen then return FEnd; + v0 := s[idx]; + vsub := FSub[v0]; + if vsub then + begin + idx++; + return vsub.Find(s,slen,idx); + end + return FEnd ; + end + end + function Add(s); + begin + FRoot.Add(s); + end + function Create(); + begin + FRoot := new TTireNode(); + end + function Find(s,slen,idx,outidx,ostr); + begin + tid := idx; + r := FRoot.Find(s,slen,idx); + if r then + begin + ostr := s[tid:idx-1]; + outidx := idx; + end + idx := tid; + return r; + end + FRoot; +end +Type TStateStack = class + function Create(); + begin + FStates := array(); + FIndex := -1; + end + function GetState(); + begin + if FIndex>=0 then + begin + return FStates[FIndex]; + end + return 1; + end + function Push(s); + begin + if s>0 then + begin + FIndex++; + FStates[FIndex] := s; + end + end + function Pop(); + begin + if FIndex>=0 then + begin + r := FStates[FIndex]; + FIndex--; + return r; + end + return 0; + end + private + FStates; + FIndex; +end +TYPE THStack = class + function Create(w); + begin + FLength := 0; + FHierarchyWidth := w; + FCache := array(); + end + function Push(); + begin + FLength++; + end + function Pop(); + begin + r := FLength; + if FLength>0 then FLength--; + return r; + end + function HierStr(es); + begin + if not(es>0 or es<0) then es := 0; + cct := (FLength+es)*FHierarchyWidth; + r := FCache[cct]; + if r then return r; + r := ""; + for i:=1 to cct do + begin + r+=" "; + end + FCache[cct] := r; + return r; + end + property Hier read FLength; + FHierarchyWidth; + FLength; + FVS; + FCache; + +end + +end. +{else + if FArrayType and (ctk.FStr ="(") then + begin + AddTokenToStr(FTkIndex); + FHier.push(); + if state = BT_ARRAY then + begin + //ƶ· + ptk := GetPrevTK(); + if ptk.FTypeSub .& TK_ARRAY then + begin + Fstates.Push(BT_ARRAY); + end else + if (ptk.FStr="+") or (ptk.FType .& TK_W) then // + begin + Fstates.Push(BT_CALC); + state := BT_CALC; + end else + begin + Fstates.Push(BT_ARRAY); + end + //ƶλ + if (state = BT_ARRAY)and (FArrayType .& 2) and (ptk := GetNextTK()) and ( ptk.FStr<>")") then + begin + ChangeLine(); + end + end else + begin + Fstates.Push(BT_CALC); + end + end else + if FArrayType and ( ctk.FStr =")") then + begin + lstate := state; + FHier.Pop(); + Fstates.Pop(); + AddTokenToStr(FTkIndex); + state := Fstates.GetState(); + if (lstate = BT_ARRAY) and (state=BT_ARRAY) then + begin + tt := GetPrevNComTK(ttid); + ttstr := tt.FStr; + if ttstr<>"(" then + begin + ChangeLine(); + end + end + end } \ No newline at end of file diff --git a/designer/utslsynmemo.tsf b/designer/utslsynmemo.tsf new file mode 100644 index 0000000..0ad79fe --- /dev/null +++ b/designer/utslsynmemo.tsf @@ -0,0 +1,2052 @@ +unit UTslSynMemo; +interface +{** + @explan(˵) tsl﷨༭ +**} +uses TslVcl,UTslMemo; +function FileSaveThreader(o,d); +type TTSLCompletion= class(TSynCompletion) +{** + @explan(˵) tslʾԶ +**} + static FCodeBlocks; + function Create(AOwner); + begin + inherited; + GetTslParser(); + end + function GetFileFullPath(f);//ȫ + begin + return FTslParser.DispatchMethod(0,array("method":"getfullpath","value":f)); + end + class function SetFindDirs(dirs); //Ŀ¼ + begin + return GetTslParser().DispatchMethod(0,array("method":"finddirs","value":dirs)); + end + class function SetCacheDir(dir); //ûĿ¼ + begin + return GetTslParser().DispatchMethod(0,array("method":"cachedir","value":dir)); + end + class function getdirtsfs(); + begin + return GetTslParser().DispatchMethod(0,array("method":"getprojecttsfs")); + end + class function GetCodeBlocks(); + begin + r := array(); + {try + FCodeBlocks := GetTslCompletionCodeBlocks(); + except + FCodeBlocks := array(); + end} + if ifarray(FCodeBlocks) then + begin + idx := 0; + for i ,vv in FCodeBlocks do + begin + if not ifarray(vv) then continue; + cp := vv["caption"]; + if not(cp and ifstring(cp)) then continue; + v := vv["value"]; + if not(v and ifstring(v)) then continue; + ve := vv["valueext"]; + if not(ve and ifstring(ve)) then continue; + r[idx]["caption"] := cp; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(cp); + r[idx]["order"] := 0; + r[idx]["valueext"] := ve; + if vv["prefix"] then r[idx]["prefix"]:=true; + idx++; + + end + end + return r; + end + function PrepareCompletion(m);override; + begin + // + if not Memo then return ; + //mtic; + { + setprofiler(7); + t := now();} + sd := static GetTslKeyWords(); + d := FTslParser.DispatchMethod(0,array("method":"parserstring","value":Memo.Text,"minus":m)); + if ifarray(d) and d then sd union=d; + sd union=GetCodeBlocks(); + //sd[length(sd)] := array("caption":"try except end","value":"try","lvalue":"try","vlen":3,"clen":14,"order":0,"valueext":"\r\nexcept\r\nend;"); + SetCompData(sd); + //echo "\r\ntime:",mtoc; + {if (now()-t)>(1/24/60/60/3) then + begin + except + end; + + d := getprofilerinfo(true); + exportfile(ftstream(),"",format("d:\\tst\\profile\\%ssynprofile.stm",tostn(random())),d); + end} + //FTslParser + end + function GetTslKeyWords(); //ؼ + begin + gjz := TSL_ReservedKeys2(); + r := array(); + idx := 0; + for i,v in gjz do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 0; + idx++; + end + gjz := tslL_getfunctions_2_(); + for i,v in gjz do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 2; + idx++; + end + //cfk "abstract","break","case","class","continue","delete","do","else","eval","false","goto","if","new","while","with","for","function","in","interface","finally","private","protected","public","return","static","true","try","var", + for i,v in array("arguments","boolean","byte","catch","char","const","debugger","default","double","enum","export","extends","final","float","implements","import","instanceof","int","let","long","native","null","package","short","super","switch","synchronized","this","typeof","throw","throws","transient","void","volatile","yield") + do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 4; + idx++; + + end + //"Array","function","length","eval", + for i,v in array("Date","hasOwnProperty","Infinity","isFinite","isNaN","isPrototypeOf","Math", + "NaN","name","Number","Object","prototype","String","toString","undefined","valueOf") + do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 4; + idx++; + end + //"all","select","self", + for i,v in array("$","alert","anchor","anchors","area","assign","blur","button","checkbox", + "clearInterval","clearTimeout","clientInformation","close","closed","confirm", + "constructor","crypto","decodeURI","decodeURIComponent","defaultStatus","document", + "element","elements","embed","embeds","encodeURI","encodeURIComponent","escape","event", + "fileUpload","focus","form","forms","frame","innerHeight","innerWidth","layer","layers", + "link","location","mimeTypes","navigate","navigator","frames","frameRate","hidden","history", + "image","images","offscreenBuffering","open","opener","option","outerHeight","outerWidth","packages", + "pageXOffset","pageYOffset","parent","parseFloat","parseInt","password","pkcs11","plugin","prompt", + "propertyIsEnum","radio","reset","screenX","screenY","scroll","secure","setInterval", + "setTimeout","status","submit","taint","text","textarea","top","unescape","untaint","window") + do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 4; + idx++; + end + for i,v in array("onblur","onclick","onerror","onfocus","onkeydown","onkeypress","onkeyup","onmouseover","onload","onmouseup","onmousedown","onsubmit") + do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 4; + idx++; + end + for i,v in array("align-content","align-items","align-self","all","animation","animation-delay", + "animation-direction","animation-duration","animation-fill-mode","animation-iteration-count", + "animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility", + "background","background-attachment","background-blend-mode","background-clip","background-color", + "background-image","background-origin","background-position","background-repeat","background-size", + "border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius", + "border-bottom-style","border-bottom-width","border-collapse","border-color","border-image", + "border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width", + "border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right", + "border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top", + "border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width", + "border-width","bottom","box-align","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group", + "box-orient","box-pack","box-shadow","box-sizing","caption-side","clear","clip","color","column-count","column-fill", + "column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width", + "columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex", + "flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-face","font-family", + "font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","grid-columns","grid-rows", + "hanging-punctuation","height","icon","justify-content","keyframes","left","letter-spacing","line-height","list-style", + "list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top", + "max-height","max-width","media","min-height","min-width","mix-blend-mode","object-fit","object-position","nav-down","nav-index", + "nav-left","nav-right","nav-up","opacity","order","outline","outline-color","outline-offset","outline-style","outline-width", + "overflow","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after", + "page-break-before","page-break-inside","perspective","perspective-origin","position","punctuation-trim","quotes","resize","right", + "rotation","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last", + "text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-justify", + "text-outline","text-overflow","text-shadow","text-transform","text-wrap","top","transform","transform-origin","transform-style", + "transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align", + "visibility","white-space","width","word-break","word-spacing","word-wrap","z-index","writing-mode") + do + begin + c := v+" "; + r[idx]["caption"] := c; + r[idx]["value"] := v; + r[idx]["lvalue"] := lowercase(v); + r[idx]["vlen"] := length(v); + r[idx]["clen"] := length(c); + r[idx]["order"] := 5; + idx++; + end + return r; + end + private + class function GetTslParser(); + begin + if not FTslParser then FTslParser := new TTsfFileParser(); + return FTslParser; + end + static FTslParser; +end +type TTslSynHighLighter = class(TSynHighLighter) +{** + @explan(˵) tsl﷨ +**} + function Create(AOwner); + begin + inherited; + FSynBranch := 0;// 0, "tsl" "tslx" + Clean(); + FChangeDeal := true; + if not ifarray(FKeyWords) then + begin + FKeyWords := array(); + for i,v in TSL_ReservedKeys2() do + begin + FKeyWords[v] := v; + end + FBinFunc := array(); + for i,v in tslL_getfunctions_2_() do + begin + FBinFunc[v]:=v; + end + FJsKeyWords := array(); + for i,v in array("abstract","arguments","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","eval","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield") + do + begin + FJsKeyWords[v]:=v; + + end + FJsSysClass := array(); + for i,v in array("Array","Date","eval","function","hasOwnProperty","Infinity","isFinite","isNaN","isPrototypeOf","length","Math","NaN","name","Number","Object","prototype","String","toString","undefined","valueOf") + do + begin + FJsSysClass[v]:=true; + end + FJsWindows := array(); + for i,v in array("$","alert","all","anchor","anchors","area","assign","blur","button","checkbox","clearInterval","clearTimeout","clientInformation","close","closed","confirm","constructor","crypto","decodeURI","decodeURIComponent","defaultStatus","document","element","elements","embed","embeds","encodeURI","encodeURIComponent","escape","event","fileUpload","focus","form","forms","frame","innerHeight","innerWidth","layer","layers","link","location","mimeTypes","navigate","navigator","frames","frameRate","hidden","history","image","images","offscreenBuffering","open","opener","option","outerHeight","outerWidth","packages","pageXOffset","pageYOffset","parent","parseFloat","parseInt","password","pkcs11","plugin","prompt","propertyIsEnum","radio","reset","screenX","screenY","scroll","secure","select","self","setInterval","setTimeout","status","submit","taint","text","textarea","top","unescape","untaint","window") + do + begin + FJsWindows[v]:=true; + end + FJsHtmlEvent := array(); + for i,v in array("onblur","onclick","onerror","onfocus","onkeydown","onkeypress","onkeyup","onmouseover","onload","onmouseup","onmousedown","onsubmit") + do + begin + FJsHtmlEvent[v]:=true; + end + FCssPropertys := array(); + for i,v in array("align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","caption-side","clear","clip","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-face","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","grid-columns","grid-rows","hanging-punctuation","height","icon","justify-content","keyframes","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","media","min-height","min-width","mix-blend-mode","object-fit","object-position","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","position","punctuation-trim","quotes","resize","right","rotation","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-transform","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","width","word-break","word-spacing","word-wrap","z-index","writing-mode") + do + begin + FCssPropertys[v]:=true; + end + + end + FLastDispathTime := 0; + end + function Clean();override; + begin + // { ' " %% 0 + FTokens := array(); + FSates := array(0); //״̬ + FSynSates := array(0); + FBBStates := array(new TBBState(")")); + FBEStates := array(new TBBState("end")); + FMBStates := array(new TBBState("]")); + FJsxkhs := array(new TBBState(")")); + FJshkhs := array(new TBBState("}")); + FJsDkhs := array(new TBBState("]")); + FSatesCount := 1; //ı + + end + function Recycling();override; + begin + Clean(); + inherited; + end + function SetInValidateIndex(idx);override; //Ч + begin + idx := max(1,idx); + if not(FChangeDeal) and idx>FSatesCount then return ; + if length(FSates)>=idx then + FSatesCount := idx; + else FSatesCount := length(FSates)-1; + if FSatesCount = 1 then Clean(); + FChangeDeal := false; + end + function SetJsToken(tokens,ttk,idx,tp); + begin + bttk := ttk; + if not ttk then return nil; + d := inherited SetTToken(tokens,ttk,idx,tp); + case tp of + '//','/*': + begin + d.FFColor := 0x8D9600; + end + '"',"'": + begin + d.FFColor := 0x968080; + end + "{": + begin + if bttk="{" then + begin + FJshkh.GetLeft(); + d.FMate := FJshkh.GetSate(); + end else + begin + FJshkh.GetRight(); + d.FMate := FJshkh.GetSate(); + end + end + "(": + begin + if bttk="(" then + begin + FJsxkh.GetLeft(); + d.FMate := FJsxkh.GetSate(); + end else + begin + FJsxkh.GetRight(); + d.FMate := FJsxkh.GetSate(); + end + end + "[": + begin + if bttk="[" then + begin + FJsDkh.GetLeft(); + d.FMate := FJsDkh.GetSate(); + end else + begin + FJsDkh.GetRight(); + d.FMate := FJsDkh.GetSate(); + end + end + else + begin + if FJsWindows[bttk] then // + begin + d.FFColor := 0xFF0000; + end else + if FJsKeyWords[bttk] then // FE0064 + begin + d.FFColor := 0xFF0000; + end else + if FJsSysClass[bttk] then // + begin + d.FFColor := 0xFF0000; + end else + if FJsHtmlEvent[bttk] then // + begin + d.FFColor := 0xFF0000; + end else + if FCssPropertys[bttk] then + begin + d.FFColor := 0x0000FF; + end + + end + + end + return d; + end + function SetTToken(tokens,ttk,idx,tp);override; + begin + if not ttk then return ; + ottk := ttk; + d := inherited; + tkl := d.FLen; + lwttk := lowercase(ottk); + donext := true; + //if tp in array("'",'"') then + if tp='"' or tp="'" or (tp=array("%%")) then + begin + d.FFcolor := 0x8B008B; + donext := false; + end else + if tp="//" or tp="{" or tp="(*" then //if tp in array("//","{","(*") then + begin + d.FFcolor := 0x228B22; + donext := false; + end else + if FKeyWords[lwttk] then + begin + d.FFcolor := 0x0000FF; + end + else + if FBinFunc[lwttk] then + begin + d.FFcolor := 0xcd0000; + //d.FFfacename := "MS Mincho"; + //d["vtype"] := "function"; + donext := false; + end + if donext then + begin + if (tkl=1) and pos(ottk,";.`~!@#$%^&*-+,><.,=:"; + if cst=0 then + begin + while idx<=e do + begin + vi := s[idx]; + viod := ord(vi); + if vi="<" and ( e-b)>2 and s[idx+1:idx+3]="!--" then + begin + //FindRightChars + SetJsToken(tokens,"",s,b,e); + if r=0 then + begin + SetJsToken(tokens,s[b:],e,"/*"); + return cst; + end else + if r<=e then + begin + SetJsToken(tokens,s[b:r],r,"/*"); + if r0x40 and viod<0x5B) or (viod>0x60 and viod<0x7B) or (viod>0x2F and viod<0x3A) then + begin + ttk+=vi; + end else + if FSynBranch="tsl" and vi="?" then + begin + SetTToken(tokens,ttk,idx-1); + if idx",idx+1); + FSynBranch := "tslx"; + return ParserTslxTokenLines(s,idx+2,e,cst,tokens); + end else + begin + SetTToken(tokens,"?",idx); + end + end else + if (vi=" ") or (vi="\t") then //ո + begin + SetTToken(tokens,ttk,idx-1); + end else + if vi ="'" then + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,"'",idx,"'"); + if idx=e then return "'"; + r := FindRightChar("'",s,idx+1,e,"\\"); + if r = 0 then + begin + SetTToken(tokens,s[idx+1:],e,"'"); + return "'"; + end else + begin + if r>idx+1 then + begin + SetTToken(tokens,s[idx+1:r-1],r-1,"'"); + end + SetTToken(tokens,s[r:r],r,"'"); + idx := r+1; + continue; + end + //return ParserTokenLines(s,idx+1,e,"'",tokens); + end else + if vi = '"' then + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,'"',idx,'"'); + if idx=e then return '"'; + r := FindRightChar('"',s,idx+1,e,"\\"); + if r = 0 then + begin + SetTToken(tokens,s[idx+1:],e,'"'); + return '"'; + end else + begin + if r>idx+1 then + begin + SetTToken(tokens,s[idx+1:r-1],r-1,'"'); + end + SetTToken(tokens,s[r:r],r,'"'); + idx := r+1; + continue; + end + //return ParserTokenLines(s,idx+1,e,'"',tokens); + end else + if vi="{" then + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,'{',idx,'{'); + return ParserTokenLines(s,idx+1,e,'{',tokens); + end else + if vi="/" then + begin + SetTToken(tokens,ttk,idx-1); + if idx=e then + begin + SetTToken(tokens,vi,idx); + end else + begin + if s[idx+1]="/" then + begin + SetTToken(tokens,s[idx:],e,"//"); + return 0; + end else + begin + SetTToken(tokens,vi,idx); + end + end + end else + if vi="#" then + begin + SetTToken(tokens,ttk,idx-1); + if idx=e then + begin + SetTToken(tokens,vi,idx); + end else + begin + if s[idx+1]="!" then + begin + SetTToken(tokens,s[idx:],e,"//"); + return 0; + end else + begin + SetTToken(tokens,vi,idx); + end + end + end else + if vi="(" then + begin + SetTToken(tokens,ttk,idx-1); + if idx=e then + begin + FCBBState.GetLeft(); + SetTToken(tokens,"(",idx,array("(")); + end else + begin + if s[idx+1]="*" then + begin + SetTToken(tokens,"(*",idx+1,"(*"); + return ParserTokenLines(s,idx+2,e,"(*",tokens); + end else + begin + FCBBState.GetLeft(); + SetTToken(tokens,"(",idx,array("(")); + end + + end + end else + if vi="%" then + begin + SetTToken(tokens,ttk,idx-1); + idx++; + if idx<=e then + begin + tvi:=s[idx]; + typeidx := idx-1; + if tvi="%" then // + begin + ccs := "%%"; + while idx<=e do + begin + idx++; + if idx>e then + begin + SetTToken(tokens,const ccs,e,array("%%")); + return ccs; + end + tvi := s[idx]; + if tvi=" " or tvi="\t" then + begin + + + SetTToken(tokens,const ccs,idx-1,array("%%")); + return ParserTokenLines(s,idx+1,e,ccs,tokens); + end + else ccs+=tvi; + end + end else + begin + SetTToken(tokens,"%",idx-1); + idx--; + end + end + else + begin + SetTToken(tokens,"%",idx-1); + end + end else + if vi="<" then + begin + SetTToken(tokens,ttk,idx-1); + if (idx+6<=e) and s[idx+1]="?" and lowercase(s[idx+2:idx+6])="tslx>" then + begin + d := SetTToken(tokens,s[idx:idx+6],idx+6); + d.FFColor := 0xFF00FF; + FSynBranch := "tslx"; + if idx+6=e then + begin + + return 0; + end + return ParserTSlxTokenLines(s,idx+7,e,0,tokens);; + end else + begin + + SetTToken(tokens,"<",idx); + end + end else + if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then + //if vi in array("`","~","@","#","$","^","&","*",")","+","-",";",",",".","?",":","[","]","|","\\","=",">","<","%") then + begin + SetTToken(tokens,ttk,idx-1); + if vi=")" then + begin + FCBBState.GetRight(); + SetTToken(tokens,")",idx,array("(")); + end else + if vi="[" then + begin + FCMBState.GetLeft(); + SetTToken(tokens,"[",idx,array("[")); + end else + if vi="]" then + begin + FCMBState.GetRight(); + SetTToken(tokens,"]",idx,array("[")); + end + else + begin + SetTToken(tokens,vi,idx); + end + end else + begin + ttk+=vi; + end + idx++; + end + SetTToken(tokens,ttk,idx-1); + end else + if cst="'" or cst='"' then + begin + if b>e then return cst; + r := FindRightChar(cst,s,b,e,"\\"); + if r=0 then //ûҵ + begin + Setttoken(tokens,s[b:],e,cst); + return cst; + end else //ҵ + if r<=e then + begin + if be then return cst; + r := FindRightChar("}",s,b,e); + if r=0 then //ûҵ + begin + Setttoken(tokens,s[b:e],e,cst); + return cst; + end else //ҵ + if r<=e then + begin + Setttoken(tokens,s[b:r],r,cst); + if re then return cst; + r := FindRightChars(cst,s,b,e); + if r=0 then + begin + Setttoken(tokens,s[b:e],e,array("%%")); + return cst; + end else + if r<=e then + begin + Setttoken(tokens,s[b:r],r,array("%%")); + if re then return cst; + r := FindRightChars("*)",s,b,e); + if r=0 then + begin + Setttoken(tokens,s[b:],e,cst); + return cst; + end else + if r<=e then + begin + Setttoken(tokens,s[b:r],r,cst); + if r(1/24/60/60) then + begin + echo "\r\ntime:",mtoc; + d := getprofilerinfo(true); + exportfile(ftstream(),"",format("d:\\tst\\profile\\%ssynprofile.stm",tostn(random())),d); + end} + //if tks then echo "\r\ntokencount:",tks[0].FTokenCount,"\r\n"; + end + function TryDispatch(); + begin + t := now(); + if (t-FLastDispathTime)>1.5e-5 then + begin + FLastDispathTime := t; + GetAndDispatchMessageA(); + end + end + function GetLineTokens(idx);override; + begin + if idxe then return 0; + continue; + end + if s[i]=c then //ҵ + begin + return i; + end + i++; + end + return 0; //ûҵ + for i := b to e do + begin + if s[i]=c then //ҵ + begin + return i; + end + end + + end + function FindRightChars(cs,s,b,e); + begin + lcs := length(cs)-1; + for i:= b to e-lcs do + begin + if s[i:i+lcs]=cs then return i+lcs; + end + return 0; + end + function StrIsANumber(s); + begin + if not s then return 0; + c1 := ord(s[1]); + return c1<58 and c1>47; + return (1=ParseRegExpr("^0x[0-9 a-f A-F]+$",s,"i",result,MPos,Mlen)) or (1=ParseRegExpr("^\\d+$",s,"i",result,MPos,Mlen)); + //ParseRegExpr("0x\\d+|\\d+",s,"i",result,MPos,Mlen); + end + FTokens; + FSynSates; + FSates; + FSatesCount; + FJsxkhs; + FJsxkh; + FJshkhs; + FJsHkh; + FJsDkhs; + FJsDkh; + FBBStates; + FCBBState; + FBEStates; + FCBEState; + FCMBState; + FMBStates; + FLastDispathTime; + static FKeyWords; + static FBinFunc; + static FJSWindows; + static FJsKeyWords; + static FJsSysClass; + static FJsHtmlEvent; + static FCssPropertys; + private + FChangeDeal; + //Է֧ + FSynBranch; + +end +type TBatSynHigLighter = class(TSynHighLighter) + function Create(AOwner); + begin + inherited; + end + function CharInSyn(v);override; + begin + if not(FSyns) then FSyns := "'`!@#$^&*()-+=[]{}|\\?/';,.><"+'"'; + return pos(v,FSyns); + end + function SetInValidateIndex(idx); virtual; + begin + inherited; + end + function GetLineTokens(idx);override; + begin + r := inherited; + rem := false; + for i,v in r do + begin + if rem then + begin + v.FFColor := 0x80CD43; + end + else + begin + vv := v.FValue; + lvv := lowercase(vv); + case lvv of + "rem": + begin + v.FFColor := 0x80CD43; + rem := true; + end + "if","else","echo","for","in","dir","cmd": + begin + v.FFColor := 0xFF0000; + end + "@","~","#","%","&","*","=": + begin + v.FFColor := 0x0000FF; + end else + begin + if i=0 then + begin + if pos("::",lvv) then + begin + v.FFColor := 0x80CD43; + rem := true; + end else + begin + v.FFColor := 0xFF9900;// #0099FF + end + end else + begin + if pos("%",lvv) then + begin + v.FFColor := 0xFF0000; + end + end + end + end + end + end + return r; + end +end +type TINISynHigLighter = class(TSynHighLighter) + function Create(AOwner); + begin + inherited; + end + function GetLineTokens(idx);override; + begin + r := inherited; + if r and ifarray(r) then + begin + if r[0].FValue="[" then + begin + for i,v in r do + begin + v.FFColor := 0xE22B8A; + end + end else + if r[0].FValue in array(";","!","#") then + begin + for i,v in r do + begin + v.FFColor := 0x80CD43; //#43CD80 + end + end else + if r[0].FValue = "@" then + begin + r[0].FFColor := 0x0000FF; + end else + begin + for i,v in r do + begin + if v.FValue="=" then + begin + v.FFColor := 0x0000F0; + break; + end + end + end + end + return r; + end +end +type TJsonSynHighLighter = class(TSynHighLighter) + function Create(AOwner); + begin + inherited; + Clean(); + FChangeDeal := true; + end + function Clean();override; + begin + // { " + FTokens := array(); + FSates := array(0); //״̬ + FBBStates := array(new TBBState(")")); + FBEStates := array(new TBBState("}")); + FMBStates := array(new TBBState("]")); + FSatesCount := 1; //ı + + end + function Recycling();override; + begin + + inherited; + Clean(); + end + function SetInValidateIndex(idx); override; //ǰı + begin + idx := max(1,idx); + if not(FChangeDeal) and idx>FSatesCount then return ; + if length(FSates)>=idx then + FSatesCount := idx; + else FSatesCount := length(FSates)-1; + if FSatesCount = 1 then Clean(); + FChangeDeal := false; + end + function ParserTokenLines(s,b,e,cst,tokens); + begin +label L_XCDG; + if cst=0 then + begin + idx := b; + ttk := ""; + while idx<=e do + begin + vi := s[idx]; + case vi of + " ","\t": + begin + SetTToken(tokens,ttk,idx-1); + end + "(",")": + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,vi,idx,")"); + end + "{","}": + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,vi,idx,"}"); + end + "[","]": + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,vi,idx,"]"); + end + ":",",": + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,vi,idx,vi); + end + '"': + begin + SetTToken(tokens,ttk,idx-1); + SetTToken(tokens,vi,idx,'"'); + return ParserTokenLines(s,idx+1,e,'"',tokens); + end else + begin + ttk+=vi; + end + + end ; + idx++; + end + SetTToken(tokens,ttk,idx-1); + end else // + begin + if b>e then return cst; + r := FindRightChar(cst,s,b,e,"\\"); + if r=0 then //ûҵ + begin + Setttoken(tokens,s[b:],e,cst); + return cst; + end else //ҵ + if r<=e then + begin + if be then return 0; + continue; + end + if s[i]=c then //ҵ + begin + return i; + end + i++; + end + return 0; //ûҵ + for i := b to e do + begin + if s[i]=c then //ҵ + begin + return i; + end + end + + end + + private + FTokens; + FSates; + FSatesCount; + + FCBBState; + FCBEState; + FCMBState; + FBBStates; + FBEStates; + FMBStates ; +end +implementation +type TBBState =class //״̬ + function Create(t); + begin + FType := ifstring(t)?t:""; + FCJ := 0; + FState := 0; + FIndexs := array(0); + FIndex := 0; + FCstate := false; + end + function GetLeft(); + begin + FCstate := true; + if FState then // һ + begin + FCJ++; + FIndex++; + FIndexs[FIndex]:=0; + end else //һ + begin + + FIndexs[FIndex]++; + end + FState := true; + end + function GetRight(); + begin + FCstate := true; + //if FCJ=0 then return ; + if FState then // һ + begin + + //FIndexs[FIndex]++; + end else //һ + begin + if FCJ>0 then + begin + FCJ--; + DeleteIndex(FIndexs,FIndex); + FIndex--; + end else + begin + FCstate := false; + end + end + FState := false; + end + function GetSate(); + begin + if FCstate then + begin + //return inttostr(FIndexs[FCJ])+FType; + return tostn(FIndexs)+FType;// inttostr(FCJ)+"+"+inttostr(FIndexs[FIndex])+FType; length(FIndexs)+FType ;// + end + end + function Show(); + begin + echo "㼶:",FCJ," :",FIndexs[FIndex],"״̬:", FCstate; + end + function Clone(); + begin + r := new TBBState(FType); + r.FCstate := FCstate; + r.FState := FState; + r.FCJ := FCJ; + r.FIndexs := FIndexs; + r.FIndex := FIndex; + return r; + end + protected + FCstate; + FState; + FCJ; + FIndexs; + FIndex; + FType; + +end +type TTsfFileParser = class //ļ + function Create(); + begin + + FCacheDir :=TS_GetUserProfileHome()+"TslSynMemo"+ioFileseparator()+"cmpCaches";// d["value"]; + //FCacheAbsFileName := FCacheDir+"\\cacheabstruct.stm"; + //FFileWorker := new TThreadWorker("this.OnMessage :=findfunction('UTslSynMemo.FileSaveThreader') ;"); + FFindDirs := array(); + end + function DispatchMethod(o,d);//ַϢ + begin + if not ifarray(d) then return ; + case d["method"] of + "cachedir": //Ŀ¼ + begin + scache := d["value"] ; + r := FCacheDir; + if not(scache and ifstring(scache)) then return r; + FCacheDir := scache; + Clearcache(); + return r; + end + "getbyname": // + begin + return LoadByName(d["value"]); + end + "finddirs": //Ŀ¼ + begin + return DirSet(d["value"]); + end + "getfinddirs": + begin + return FFindDirs; + end + "filechanged": //ļı + begin + filechanged(d["value"]); + end + "getfullpath": + begin + if not ifarray(FFilePaths) then return ""; + return FFilePaths[lowercase(d["value"])+".tsf"]; + end + "getprojecttsfs": + begin + return getprojecttsfs(); + end + "parserstring": + begin + rti := 0; + rt := array(); + m := d["minus"]; + if ifstring(m) then m := lowercase(m); + filechanged(m); + FormatFile(rti,FCacheS,rt,3,m); + + if m and ifarray(FCacheS) then + begin + r := FCacheS[m]; + end + if r then + begin + //echo "\r\nlodad"; + end else + begin + s := d["value"]; + if not(s and ifstring(s)) then return rt ; + r := tsl_tokenizeex_2_(s,1); + if not( r and ifarray(r)) then return rt; + + cls := array(); + ScriptDelBlocks(r["blcks"],str2array(s,"\n"),cls); + r["blcks"] := cls; + + vmsg := getmsgd_Crc32(s);//GetMsgdigest(s,0); + end + ext := array(); + FormatFunction(rti,r["functions"],rt,"",r["lines"],ext,1); + FormatBlocks(rti,r["blcks"],rt,"",nil,ext,1); + FormatWords(rti,r["words"],rt,"",ext,1); + + + for i,v in r["units"] do //Ԫ + begin + + vfn := checknamespacename(v); + if m=(lowercase(vfn)+".tsf") then continue; + vi := LoadByName(vfn); + if vi then + begin + if vmsg=vi["msg"] then continue; + ext := array(); + FormatFunction(rti,vi["functions"],rt,vfn,vi["lines"],ext,4); + FormatBlocks(rti,vi["blcks"],rt,vfn,nil,ext,4); + FormatWords(rti,vi["words"],rt,vfn,ext,4); + + end + end + for i,v in r["class"] do // + begin + vfn := checknamespacename(v); + if m=(lowercase(vfn)+".tsf") then continue; + vi := LoadByName(vfn); + if vi then + begin + if vmsg=vi["msg"] then continue; + ext:= array(); + FormatFunction(rti,vi["functions"],rt,vfn,vi["lines"],ext,4); + FormatWords(rti,vi["words"],rt,vfn,ext,4); + //ident ļ + end + end + //FormatFile(rti,FCacheS,rt,3,m); + return rt; + //return o.postmessage(r); + end + end + end + private + function checknamespacename(v); + begin + for ii in FCacheS do + begin + if pos(v+"@",ii)=1 then + begin + return ii[1:length(ii)-4]; + end + + end + return v; + end + function FormatFile(idx,r,d,od,m); //ļ + begin + for v,vv in r do + begin + if v=m then continue; + wd := vv["functions"][0]; + if wd and ifarray(wd) and (wd0:=wd[0]) and wd0 and (v=lowercase(wd0)+vv["nspace"]+".tsf") then // + begin + t := Formatfparams(wd)+" "+inttostr(vv["lines"][0]); + d[idx]["value"]:= wd0; + d[idx]["lvalue"] := lowercase(wd0); + d[idx]["vlen"] := length(wd0); + d[idx]["clen"] := length(t); + d[idx]["jump"] := true; + d[idx]["caption"] :=t; + d[idx]["file"] := wd0+vv["nspace"]; + if od>=0 then d[idx]["order"] := od; + d[idx]["line"] := vv["lines"][0]; + idx++; + continue; + end else + begin + if length(v)>4 then + begin + wd0 := vv["words"][0]; + + if wd0 and ( (lowercase(wd0)+vv["nspace"]+".tsf")=v) then + begin + + end else + wd0 := v[1:length(v)-4]; + d[idx]["value"]:= wd0; + d[idx]["lvalue"] := lowercase(wd0); + d[idx]["vlen"] := length(wd0); + t := wd0+" " ; + d[idx]["jump"] := true; + d[idx]["caption"] := t; + d[idx]["clen"] := length(t); + d[idx]["file"] := wd0+vv["nspace"]; + d[idx]["line"] := 1; + idx++; + end + end + continue; + wd0 := vv["words"][0]; + if wd0 and ifstring(wd0) and ( v=lowercase(wd0)+vv["nspace"]+".tsf") then // + begin + d[idx]["value"]:= wd0; + d[idx]["lvalue"] := lowercase(wd0); + d[idx]["vlen"] := length(wd0); + t := wd0+" " ; + d[idx]["jump"] := true; + d[idx]["caption"] := t; + d[idx]["clen"] := length(t); + d[idx]["file"] := wd0+vv["nspace"]; + d[idx]["line"] := 1; + idx++; + end + + end + end + function FormatWords(idx,r,d,f,ext,od); // + begin + if not ifarray(ext) then ext := array(); + for i,v in r do + begin + llv := lowercase(v); + if ext[llv] then + begin + continue; + end + d[idx]["value"]:= v; + d[idx]["lvalue"] := llv; + d[idx]["vlen"] := length(v); + c := v+" "; + if f then + begin + c+= f; + end + d[idx]["caption"] := c; + d[idx]["clen"] := length(c); + if od>=0 then + d[idx]["order"] := od; + idx++; + end + end + function ScriptDelBlocks(blcks,strs,r); + begin + if not blcks then return ; + for i,v in blcks do + begin + if v["mtype"]=3 then + begin + idx := v["mbeg"]-1; + s := strs[idx]; + if ifstring(s) and s then + begin + if ParseRegExpr("type\\s+(\\w+)\\s*=\\s*Class",s,"i",result,MPos,Mlen)=1 then + begin + r[length(r)] := array(result[0,1],idx+1); + end + end + end + ScriptDelBlocks(v["msub"],strs,r); + end + end + function FormatBlocks(idx,r,d,f,rr,ext,od); + begin + if not ifarray(ext) then ext := array(); + for i,v in r do + begin + //if not(lines[i]>0) then continue; + v0 := v[0]; + li := v[1]; + d[idx]["jump"] := 1; + t := v0+" "; + d[idx]["value"]:= v0; + lvl := lowercase(v0); + d[idx]["lvalue"]:= lvl; + ext[lvl] := true; + d[idx]["vlen"] := length(v0); + if f then t+=" "+f; + if li>=0 then t+="("+inttostr(li)+")"; + d[idx]["clen"] := length(t); + d[idx]["caption"] := t; + d[idx]["file"] := f; + d[idx]["line"] := li; + if od>=0 then + d[idx]["order"] := od; + idx++; + end + end + function FormatFunction(idx,r,d,f,lines,ext,od) // + begin + if not ifarray(ext) then ext := array(); + for i,v in r do + begin + //if not(lines[i]>0) then continue; + v0 := v[0]; + li := lines[i]; + d[idx]["jump"] := 1; + if li .& 0x40000000 then //pro + begin + t := v0 +" "; + li := li .& 0x3FFFFFFF; + //d[idx]["type"] := "pro"; + + end else + begin + if li>0 then t := Formatfparams(v)+ " "; + else t := Formatfparams(v)+ " "; + if li .& 0x80000000 then + begin + li := li .& 0x3FFFFFFF; + end + end + + d[idx]["value"]:= v0; + lvl := lowercase(v0); + d[idx]["lvalue"]:= lvl; + ext[lvl] := true; + d[idx]["vlen"] := length(v0); + if f then t+=" "+f; + if li>=0 then t+="("+inttostr(li)+")"; + d[idx]["clen"] := length(t); + d[idx]["caption"] := t; + d[idx]["file"] := f; + d[idx]["line"] := li; + if od>=0 then + d[idx]["order"] := od; + idx++; + end + end + function Formatfparams(d); // + begin + r := ""; + r+=d[0]; + lend := length(d)-1; + r+="("; + for i:= 1 to lend do + begin + r+=d[i]; + if i0 then + begin + p := _tool.tmalloc(n); + if p <> 0 then + begin + if f=1 then _tool.tmset(p,n); + opblocks(p,1,n); + end + end + return p; + end + function tfree(p); // + begin + {** + @explan(˵)ͷڴ %% + @param(p)(integer) ָ %% + **} + pt := opblocks(p,0); + if pt then + begin + _tool.tfree(p); + opblocks(p,2); + end + return pt; + end + function trealloc(p,n,f); //ط + begin + {** + @explan(˵)ط %% + @param(p)(integer) ָ %% + @param(n)(integer) С %% + @param(f)(integer) 0 ȡ 1 2 ɾ %% + **} + pt := opblocks(p,0); + if pt and n>0 then + begin + //writeloglen(n); + ptt := _tool.trealloc(p,n); + if ppt <> pt then + begin + opblocks(p,2); + if ptt <> 0 then + begin + if f=1 then _tool.tmset(ptt,n); + opblocks(ptt,1,n); + end + end + end + return ptt; + end + class function mtool(); //ڴ + begin + {** + @explan(˵)ȡײ %% + @return (aefclassobj_)ڴײ + **} + if not ifobj(_tool)then _tool := new aefclassobj_(); + return _tool; + end + function create(); + begin + _blocks := array(); + mtool(); + end + function destroy();virtual; + begin + for i,v in _blocks do //ַռ + begin + if ifstring(i)and ifnumber(v)then + begin + _tool.tfree(strtoint(i)); + //echo "\r\n:",i; + end + end + _blocks := array(); + end +end + + //ɵڴ,֧** +type ctslctrans = class(tmemoryclass) + (** + @example(--ڴ--1) + sa := array(("f","int",2), + ("a","char[3]","cd"), + ("b","user",(("c","char[5]","ab"), + ("d","int",5))), + ("c","user*",(("c","char[5]","ab"), + ("d","int",5), + ("e","char*","abcd"))) + + ); + data := tslarraytocstructcalc(sa); + o := new ctslctrans(data); + return echo o._size_(),"****", + o._getvalue_("c")._size_(),"***", + o._getvalue_("b")._size_,"***",o._getvalue_("c")._getvalue_("e"); + **) + private + _nomalloc; + //protected + //_blocks ;//ڴ;ԵַΪ,ֵΪĴС; + _ptr;//ַ + _objs;//Ӷ + _objstart;//ʼλ + _objsize;//ֽڳ + _objst;// + _objss;// + _charexten;//ַչ + _size;//С + function setcharext(v); //ַ*Ƿչ + begin + _charexten := v; + end + function _setvalue_base(i,v); // ֵ,Ŀǰֵûֵ + begin + {** + @explan(˵) ֵ,Ŀǰֻûֵ %% + @param(i)() %% + @param(v)()ֵ %% + **} + p := _objs[i]; + l := _objss[i]; + ret :=-1; + //echo tostn(array(_objst[i],i,v)),","; + case _objst[i]of + "char": + begin + if ifstring(v)and length(v)<= l then + begin + _tool.writestr(p,v); + ret := 1; + end + end + "uint": + begin + if ifnumber(v)then + begin + _tool.writeuint(p,v); + ret := 1; + end + end + "int": + begin + if ifnumber(v)then + begin + _tool.writeint(p,v); + ret := 1; + end + end + "intptr": + begin + if ifnumber(v)then + begin + //echo "wirtptr\r\n"; + _tool.writeptr(p,v); + ret := 1; + end + ret := 1; + end + "double": + begin + if ifnumber(v)then + begin + _tool.writedouble(p,v); + ret := 1; + end + end + "float": + begin + if ifnumber(v)then + begin + _tool.writefloat(p,v); + ret := 1; + end + end + "char*": + begin + if ifstring(v)and length(v)<= l then + begin + //echo tostn(array("char*",i,l,v)),","; + p1 := _tool.readptr(p); + _tool.writestr(p1,v); + //echo tostn(array(p,p1, _tool.readstr(p1))); + ret := 1; + end else + if ifstring(v)and _charexten then + begin + p1 := pointmalloc(i,v); + _tool.writestr(p1,v); + ret := 1; + end + end + "byte": + begin + if ifnumber(v)then + begin + _tool.writebyte(p,v); + ret := 1; + end + end + "short": + begin + if ifnumber(v)then + begin + _tool.writeshort(p,v); + ret := 1; + end + end + "shortarray": + begin + if arraynumberchek(v)and length(v)<= l then + begin + _tool.writeshorts(p,length(v),v); + ret := true; + end + end + "bytearray": + begin + if arraynumberchek(v)and length(v)<= l then + begin + //echo tostn(array("bytearray",i,l,v)),","; + _tool.writebytes(p,length(v),v); + ret := true; + end + end + "intarray": + begin + if arraynumberchek(v)and length(v)<= l then + begin + _tool.writeints(p,length(v),v); + ret := true; + end + end + "uintarray": + begin + if arraynumberchek(v)and length(v)<= l then + begin + _tool.writeuints(p,length(v),v); + ret := true; + end + end + "doublearray": + begin + if arraynumberchek(v)and length(v)<= l then + begin + _tool.writedoubles(p,length(v),v); + ret := true; + end + end + //else echo "\r\n error: type:",_objst[i]; + end; + return ret; + end + function pointmalloc(v0,v2); //ָڴ洦 + begin + {** + @explan(˵)ָڴ洦 %% + @param(v0)() %% + @param(v2)() %% + **} + ps := _objs[v0]; + op := _tool.readptr(ps); + if ifstring(v2)then + begin + len := length(v2)+1; + end else + if ifnumber(v2)then + begin + len := v2; + end else + if ifarray(v2)then + begin + len := length(v2); + end + if opblocks(op,0)then + begin + //writeloglen(len); + p := trealloc(op,len); //ط + end else + begin + p := tmalloc(len); // + end + if p=0 then raise "ڴʧ"; + if ifstring(v)then _objss[v0]:= len-1; // + else _objss[v0]:= len; + _objsize[v0]:= len; + _tool.tmset(p,len); //ʼ + _tool.writeptr(ps,p); + return p; + end + {** + @explan(˵)ɵڴ,֧** %% + @param(_ptr)(integer) ַ %% + @param(_objs)(array) Ӷ %% + @param(_objstart)(integer) ʼλ %% + @param(_objsize)(integer) ֽڳ %% + @param(_objst)(string) %% + @param(_objss)(integer) ͳ%% + @param(_charexten)(bool) ַչ %% + @param(_size)(integer) С %% + **} + public + function operator[1](index,v); + begin + {** + @explan(˵) óԱ %% + @param(index)(tslobj) ± %% + @param(v)(tslobj) ֵ + **} + return _setvalue_(index,v); + end + function operator[](index); + begin + {** + @explan(˵) ȡԱ %% + @param(index)(tslobj) ± %% + @return(tslobj) ֵ %% + **} + return _getvalue_(index); + end + function create(data,ptr,ifset); // + begin + {** + @explan(˵) %% + @param(data)(array) õڴֲ%% + @param(ptr)(integer) ڴָ%% + @param(ifset)(integer) ݹ鹹ʱʹ%% + **} + class(tmemoryclass).create(); + _ptr := 0; + if not(ifarray(data)and mcols(data)>3)then + begin + raise "ڴ!"; + return; + end + _objsize := _objstart := _blocks := _objss := _objst := _objs := array(); + ldata := length(data)-1; + _size := data[ldata,3]+data[ldata,4]-data[0,3]; + if ifnumber(ptr)and ptr then + begin + _ptr := ptr; + _nomalloc := true; + for i,v in data do + begin + v0 := v[0]; //id + v1 := v[5]; //type + _objst[v0]:= v1; + _objss[v0]:= v[6]; + _objstart[v0]:= v[3]; //ʼλ + _objsize[v0]:= v[4]; //ֽڳ + v3 := v[3]; + v2 := v[2]; + //_iindex[i] := v0; + if v1="user*" then + begin + if ifset then + begin + no := new ctslctrans(v2,nil,nil); + _objs[v0]:= no; + _tool.writeptr(ptr+v3,no._getptr_); //޸ԭеֵ + end else + begin + tptr := _tool.readptr(ptr+v3); //ȡԭеֵ + _objs[v0]:= new ctslctrans(v2,tptr,nil); + end + end else + if v1="userarray" then + begin + _objs[v0]:= new ctslctrans(v2,ptr,ifset); + end else + _objs[v0]:= ptr+v3; + if ifset then + begin + if v1="char*" then + begin + pointmalloc(v0,v2); + end + _setvalue_base(v0,v2); + end + end + end else + begin + _ptr := tmalloc(_size,1); + //_tool.tmset(_ptr,size); + for i,v in data do + begin + v0 := v[0]; + v1 := v[5]; + _objst[v0]:= v1; + _objss[v0]:= v[6]; + _objstart[v0]:= v[3]; //ʼλ + _objsize[v0]:= v[4]; //ֽڳ + v2 := v[2]; + v3 := v[3]; + _objs[v0]:= _ptr+v3; + if v1="user*" then + begin + no := new ctslctrans(v2,nil,nil); + _objs[v0]:= no; + _tool.writeptr(_ptr+v3,no._ptr); + end else + if v1="userarray" then + begin + no := new ctslctrans(v2,_ptr,true); + _objs[v0]:= no; + end else + if v1="char*" then + begin + pointmalloc(v0,v2); //ڴ + end + _setvalue_base(v0,v2); + end + end + //echo "\r\nڴ:" ,_ptr,tostn(data); + end + function _getptr2_(); + begin + {** + @explan(˵)ڴָ %% + + **} + x := 0; + for i,v in _objstart do + begin + x := v; + break; + end + return _getptr_()+x; + end + function _getptr_(); //õַ + begin + {** + @explan(˵)ڴָ %% + + **} + return _ptr; + end + function _setcptr_(ptr); //öַ + begin + {** + @explan(˵)öַ %% + **} + if ifnumber(ptr)and ptr and _nomalloc then _ptr := ptr; + end + function _size_(); //öռÿռС + begin + {** + @explan(˵)ڴС %% + **} + return _size; + end + function _setvalue_(i,v);virtual; + begin + _setvalue_base(i,v); + end + function arraynumberchek(v); // + begin + {** + @explan(˵) %% + @param(v)(array) %% + **} + ok := 0; + if ifarray(v)and length(v)>0 then + begin + ok := true; + for i,vi in v do if not ifnumber(vi)then + begin + ok := false; + break; + end + end + return ok; + end + function _getvalue_(v);virtual; //vöӦֵ + begin + {** + @explan(˵)vöӦֵ %% + @param(v)() %% + **} + p := _objs[v]; + //echo tostn(_objs); + l := _objss[v]; + case _objst[v]of + "char": + begin + ret := _tool.readstr(p); + end + "int": + begin + ret := _tool.readint(p); + end + "intptr": + begin + ret := _tool.readptr(p); + end + "double": + begin + ret := _tool.readdouble(p); + end + "float": + begin + //echo "get:",p,"\r\n"; + ret := _tool.readfloat(p); + end + "char*": + begin + p1 := _tool.readptr(p); + //echo "\r\nstr:",p,"***",p1; + ret := _tool.readstr(p1); + //echo "\r\n",(ret); + end + "byte": + begin + ret := _tool.readbyte(p); + end + "short": + begin + ret := _tool.readshort(p); + end + "shortarray": + begin + ret := _tool.readshorts(p,l); + end + "bytearray": + begin + ret := _tool.readbytes(p,l); + end + "intarray": + begin + ret := _tool.readints(p,l); + end + "uintarray": + begin + ret := _tool.readuints(p,l); + end + "doublearray": + begin + ret := _tool.readdoubles(p,l); + end else + ret := _objs[v]; + end; + return ret; + end + function _getvalueaddr_(i); //ֵӦڴַ + begin + {** + @explan(˵)ֵӦڴַ %% + @param(i)() %% + **} + return _objs[i]; + end + + function _getvalueaddr2_(i); //ȡֵӦֵַΪַ; + begin + {** + @explan(˵)ȡֵӦֵַΪַ %% + @param(i)() %% + **} + t := _objs[i]; + if ifnumber(t)then + begin + return _tool.readptr(t); + end + if t is class(ctslctrans)then + begin + return t._getptr_(); + end + end + function _getdata_();virtual; // + begin + {** + @explan(˵) %% + @return(array) %% + **} + ret := array(); + for i,v in _objs do + begin + if v is class(ctslctrans)then + begin + ret[i]:= v._getdata_(); + end else + ret[i]:= _getvalue_(i); + end + return ret; + end + function destroy();override; // + begin + inherited; + //class(tmemoryclass).destroy(); + _objss := _objst := _objs := array(); + end + function CopyToString(); + begin + {** + @explan(˵)ڴתΪַ%% + @return(string) + **} + r := ""; //binary(""); + ptr := _getptr2_(); + sz := _size_(); + if ptr and sz>0 then + begin + setlength(r,sz); + for i := 0 to sz-1 do r[i+1]:= _tool.readbyte(ptr+i); + end + return r; + end + function CopyFromString(s); + begin + {** + @explan(˵)ַڴ %% + @param(s)(string) + **} + ptr := _getptr2_(); + sz := _size_(); + if ifstring(s)and ptr and sz>0 and sz <= length(s)then + begin + for i := 0 to sz-1 do + begin + _tool.writebyte(ptr+i,ord(s[i+1])); + end + end + end +end +type tslcstructureobj=class(ctslctrans) //ṹ + {** + @explan(˵)tslݽṹڴ潻ӿװ + **} + (** + @example(--ڴṹ) + sc := array(("a","int",1),("b","double",2)("c","intptr",1234)); + //cе co = new struct{int a = 1; double b = 2.0; intptr = 1234} + co := new tslcstructureobj(MemoryAlignmentCalculate(sc)); + co._setvalue_("a",5); //óԱ aֵ + echo co._getvalue_("b");//óԱ b ֵ + echo co._size_();//ڴС + echo co._getptr_() ;//Ӧڴָ + + **) + function create(data,ptr); + begin + {** + @explan(˵) ڴ %% + @param(data)(array) ڴṹ,ʹ MemoryAlignmentCalculate %% + @param(ptr)(integer|nil) ڴָ,,Զ,ڴȡ %% + **} + //return inherited create(data,ptr,nil); + class(ctslctrans).create(data,ptr,nil); + end + function destroy();override; + begin + inherited; + end +end + +//*********ַض************************************** +type tcbytearray=class + reallen; + len; // + obj; // + {** + @explan(˵) byteڴ %% + @param(len)(integer) ռó %% + @param(reallen)(integer) ʵڴ泤 %% + @param(obj)(tslcstructureobj) ڴ%% + **} + function create(n); + begin + {** + @explan(˵) %% + @param(n)(integer|array of integer) ַ Ԥ%% + + **} + reallen := len := 0; + if not(n>0)then n := 128; + setv(n); + end + function reset(n); + begin + {** + @explan(˵) %% + @param(n)(array of byte) ֵ%% + **} + t := true; + if ifnumber(n)and n>0 and n>reallen then + begin + len := reallen := n; + obj := new ctslctrans(MemoryAlignmentCalculate(array((0,format("byte[%d]",reallen),array(0))))); //tslcstructure(array((0,format("byte[%d]",reallen),array(0)))); + end else + if ifarray(n)and length(n)>reallen then + begin + len := reallen := length(n); + obj := new ctslctrans(MemoryAlignmentCalculate(array((0,format("byte[%d]",reallen),n)))); //tslcstructure(array((0,format("byte[%d]",reallen),n))); + t := false; + end + if ifarray(n)and t then + begin + len := length(n); + obj._setvalue_(0,n); + end else + if ifnumber(n)and t then len := n; + end + function occupancy(); + begin + {** + @explan(˵)ȡڴռ %% + @return(integer) ռôС + **} + return reallen; + end + function length(n); //ó + begin + {** + @explan(˵)ó ߻ȡռó%% + @param(n)(integer|nil) nilΪȡ,Ϊó %% + **} + if ifnumber(n)then reset(n); + return len; + end + function _getptr_(); + begin + {** + @explan(˵)ڴָ %% + **} + return obj._getptr_(); + end + function setv(n);virtual; + begin + {** + @explan(˵)byte %% + @param(n)(array of byte) %% + + **} + return reset(n); + end + function getv(); + begin + {** + @explan(˵)byte %% + @return(array of byte ) ص%% + **} + if ifobj(obj)then + begin + return obj._getvalue_(0); + end + end + function ptr(); + begin + {** + @explan(˵)ڴָ %% + **} + return _getptr_(); + end +end +type tcstring=class(tcbytearray) + {** + @explan(˵)ַڴ %% + @param(_flag)(integer) ַǷ\0β%% + **} + private + _flag; + public + function create(n); + begin + inherited; + end + function getv(n); + begin + {** + @explan(˵)ַ %% + @param(n)(integer)ȡַij %% + @return(string) ַ%% + **} + ret := ""; + nhn := not(n); + v := class(tcbytearray).getv(); + if _flag then + begin + for i := 0 to self.length()-2 do + begin + vi := v[i]; + if n and i >= n then break; + ret += chr(v[i]); + end + end else + begin + for i := 0 to reallen-1 do + begin + vi := v[i]; + if(vi=0)and nhn then break; + if n and i >= n then break; + ret += chr(v[i]); + end + end + return ret; + end + function setv(v);override; + begin + {** + @explan(˵)ַ %% + @param(v)(string) ַ%% + **} + r := array(); + if ifstring(v)then + begin + for i := 1 to length(v) do r[i-1]:= ord(v[i]); + r[i]:= ord("\0"); + end else + if ifnumber(v)and v >= 0 then r := v+1; + else r := 1; + class(tcbytearray).setv(r); + end + property endzero read _flag write _flag; + {** + @param(endzero)(bool) ĬΪfalseַ\0 %%; + **} +end +type tcstructwithcharptr=class(ctslctrans) + private + _strso; //ַ󼯺; + _strn; + {** + @explan(˵)ڴṹ %% + @param(_strso)(array of tcstring) ַ󼯺 %% + @param(_strn)(array) ַȱ + array("str1":"str1len","str2":str2len)ʾ + str1,str2ֶαʾַ + str1len str2len ֱʾַ󳤶%% + + **} + public + function create(stc,strn1,strn2); + begin + {** + @explan(˵)ڴ %% + @param(stc)(array) ڴṹ%% + @param(strn)(array) ֶַ%% + **} + strn := array(); + if ifarray(strn1)then strn union=strn1; + if ifarray(strn2)then strn union=strn2; + for i in strn do // + begin + for j := 0 to length(stc)-1 do + begin + if stc[j,0]=i then + begin + stc[j,1]:= "intptr"; + end + end + end + class(ctslctrans).create(MemoryAlignmentCalculate(stc),nil,nil); + if not ifarray(strn)then return; + _strn := strn; + _strso := array(); + for i,v in _strn do + begin + setstringi(i,v,128); + end + for i,v in strn2 do + begin + _strso[i].endzero := true; + end + end + function destroy();override; + begin + _strso := nil; + _strn := nil; + inherited; + end + function operator[1](index,v); + begin + {** + @explan(˵) óԱ %% + @param(index)(tslobj) ± %% + @param(v)(tslobj) ֵ + **} + return _setvalue_(index,v); + end + function operator[](index); + begin + {** + @explan(˵) ȡԱ %% + @param(index)(tslobj) ± %% + @return(tslobj) ֵ %% + **} + return _getvalue_(index); + end + function _setvalue_(id,v);override; + begin + {** + @explan(˵)óԱֵ %% + @param(id)(string) Աid%% + @param(v)(string|integer) õֵ%% + **} + os := _strso[id]; + if ifobj(os)then + begin + cn := _strn[id]; + return setstringi(id,cn,v); + end + return inherited; + end + function _getvalue_(id,n);override; + begin + {** + @explan(˵)ȡԱֵ %% + @param(id)(string) Աid%% + @param(n)(integer) Ϊַȡַij,ĬΪ\0β%% + @return(obj) tsl%% + **} + os := _strso[id]; + if ifobj(os)then return os.getv(n); + return inherited _getvalue_(id); + end + function _getdata_();override; + begin + {** + @explan(˵)ýṹֵ %% + @return(array) tsl%% + **} + r := class(ctslctrans)._getdata_(); + for i,v in _strso do if ifobj(v)then r[i]:= v.getv(); + return r; + end + protected + function setstringi(i,v,n); + begin + {** + @explan(˵)ַ %% + @param(i)(string) ַid%% + @param(v)(string) ַ%% + @param(n)(string) ֶַ%% + **} + os := _strso[i]; + if ifnil(os)then + begin + os := new tcstring(n); + end else + os.setv(n); + _strso[i]:= os; + obj := class(ctslctrans); + if obj._getvalue_(i)<> os.ptr then + begin + obj._setvalue_(i,os.ptr); + end + if not ifnil(v)then obj._setvalue_(v,os.occupancy()-1); //޸ + end +end + + + //cṹ嶨 +type tcstruct= class + //_tag; + _size; //С + _maxitem; //Ԫ + _name; // + _struct; //ڴŲ + static _basetypes; // + static _structs; //עĽṹ + {** + @ignore %% + @explan(˵)cṹ嶨 %% + @param(_size)(integer) С%% + @param(_maxitem)(integer) Ԫ%% + @param(_name)(string) %% + @param(_basetypes)(array) ͱ%% + @param(_structs)(array) ѾעĽṹ%% + **} + type typeclass=class + _st; //ʼλ; + _n; // + _t; // + _s; //size; + _mxi; //size + _fa; // + _lt; //ָӴ + _ltp; //ӵ + _ms; //ڴռ + _ot; //ԭʼ; + _fb; //Ƿ + _stc; //ṹ + _plen; //ָ䳤 + _wlen; //дij; + _oot; //ԭʼַ; + {** + @explan(˵)Ͷ %% + @param(_st)(integer) ʼλ%% + @param(_t)(string) %% + @param(_mxi)(integer) size%% + @param(_s)(integer) С%% + @param(_fa)(integer) %% + @param(_lt)(integer) ָӴ%% + @param(_ltp)(string) ӵ%% + @param(_ms)(integer) ڴռ%% + @param(_ot)(string) ԭʼ%% + @param(_fb)(integer) Ƿ%% + @param(_fb)(integer) Ƿ%% + @param(_stc)(tcstruct) ṹ%% + @param(_plen)(integer) ָ䳤%% + @param(_wlen)(integer) дij%% + @param(_oot)(string) ԭʼַ%% + **} + function show(i); + begin + {** + @explan(˵)չʾ %% + @param(i)(integer) չʾ%% + **} + if ifnil(i)then echo "\r\nֶ,\t\tԭ\tλ\tС\tڴ\t\tָ\tָ\t\t"; + echo "\r\n",_n,"\t",_t,"\t",_ot,"\t",_st,"\t",_s,"\t",_ms,"\t",_fa,"\t",_lt,"\t",_ltp,"\t",_fb,"\t",_plen; + end + function destroy(); + begin + _stc := nil; + end + function copy(); // + begin + {** + @explan(˵) %% + **} + o := new typeclass(); + o._st := _st; + o._n := _n; + o._t := _t; + o._s := _s; + o._mxi := _mxi; + o._fa := _fa; + o._lt := _lt; + o._ltp := _ltp; + o._ms := _ms; + o._ot := _ot; + o._fb := _fb; + o._wlen := _wlen; + o._plen := _plen; + o._oot := _oot; + if _stc is class(tcstruct)then + begin + o._stc := _stc.copy(); + end + return o; + end + end + function create(name,data,alim,fr); + begin + {** + @explan(˵) %% + @param(name)(string) %% + @param(data)(array) ڴ%% + @param(alim)(integer) ䷽ʽ%% + @param(fr)(integer) б%% + **} + _sinit_(); + if ifnil(name)then return; + if ifarray(name)then + begin + _name := name[0]; + _size := name[1]; + _maxitem := name[1]; + return 1; + end + if ifstring(name)then + begin + if pos("*,",name)=length(name)then raise "ע岻*β"; + _name := name; + end else + raise "ƴ"; + if ifobj(_structs[name])and not(fr)then raise(name+"Ѿע"); + ssize := 0; + tslarraytocstructcalcs(data,alim,ssize,maxitem); + if ifarray(data)and ssize>0 then + begin + _size := ssize; + _struct := data; + _maxitem := maxitem; + _structs[_name]:= self; + end + end + function hasstc(); //ṹhash + begin + {** + @explan(˵)ṹhash %% + **} + ret := array(); + for i,v in _struct do + begin + ret[v["n"]]:= v["tfo"]; + end + return ret; + end + function findstruct(n); //ṹ + begin + {** + @explan(˵)ṹ %% + @param(n)(string) %% + **} + ov := new typeclass(); + typedeal(n,ov); + return ov; + end + function copy(); + begin + {** + @explan(˵) %% + **} + o := new tcstruct(); + o._name := _name; + o._size := _size; + o._maxitem := _maxitem; + s := array(); + for i,v in _struct do + begin + s[i]:= v; + s[i]["tfo"]:= v["tfo"].copy(); + end + o._struct := s; + return o; + end + function show(); + begin + {** + @explan(˵)չʾ %% + **} + echo "\r\n:",_name; + echo "\r\nڴС:",_size; + echo "\r\nԱ:",_maxitem; + echo "\r\nڴֲ:"; //,tostn(_struct); + echo "\r\nֶ,\t\tԭ\tλ\tС\tڴ\t\tָ\tָ\t\t"; + for i,v in _struct do + begin + o := v["tfo"]; + o.show(1); + end + end + class function getptrchain(vt_,ret); //ָ + begin + {** + @explan(˵)ָ %% + @param(vt_)(string) %% + @param(ret)() %% + **} + vt := vt_; + ret := 0; + while(vt[length(vt)]="*") do + begin + ret += 1; + vt := vt[1:length(vt)-1]; + end + return vt; + end + class function setpptrchain(vt,n); //ָ + begin + {** + @explan(˵)ָ %% + @param(n)(integer) ָ%% + @param(vt)(string) %% + **} + ret := vt; + for i := 1 to n do + begin + ret += "*"; + end + return ret; + end + function typedeal(vt,ov,pt); //ָ봦 char*[5] ʾ5ַָ + begin + {** + @explan(˵)ָ봦 char*[5] ʾ5ַָ %% + **} + ov._oot := vt; + if not ifobj(ov)then raise "жϲ"; + {ctrl := "\\w+[*]*"; + ParseRegExpr(ctrl,vt,"",result,MPos,Mlen); + if length(result)>2 then raise "ʹ"; + vt_ := result[0,0]; + len := result[1,0];//С + ov._ot := vt_; //ԭ + if len then // + begin + sz := strtoint(len); + end + else + begin + sz := 0; + end } + parserctypestr(vt,vt_,len); + if len then sz := len; + else sz := 0; + pt := 0; + vt := getptrchain(vt_,pt); + ot := _structs[vt]; + if ifobj(ot)then //жǷѾע + begin + o := ot; + if pt then //ָ + begin + o := _structs["pointer"]; + if sz>0 then + begin + vt := setpptrchain(vt,pt); + ov._ot := vt; + end else + begin + vt := setpptrchain(vt,pt-1); + ov._ot := vt; + end + ov._lt := pt; + ov._ltp := vt; + end + ov._s := o._size; //ߴ + ov._mxi := o._maxitem; //Ԫ + ov._t := o._name; // + ov._fa := sz; // + ov._fb := _basetypes[ov._ot]; //ԭǷΪ; + _stc := _structs[ov._ot]; + if ifnil(_stc)then ov._stc := o.copy(); + else ov._stc := _stc.copy(); + end else + raise "Ͳ"; + return ret; + end + function tslarraytocstructcalcs(data,alim,ssize,maxitem); //䳤 + begin + {** + @explan(˵)䳤 %% + + **} + if not ifnumber(alim)then + begin + {$ifdef linux} + alim := 4; + {$else} + alim := 8; + {$endif} + end + fmaxitem := function(d,alim) //䳤 + begin + ret := array(); + for i,v in d do + begin + vt := v["t"]; + vo := v["tfo"]; + typedeal(vt,vo); + end + return ret; + end; + preddata := function(data) + begin + if not ifarray(data)then return-1; + cols := array(0,1,mcols(data,1))->(mcols(data)-1); + masthave := array("n","t"); + for i,v in masthave do + begin + if ifnil(cols[v])then return-1; + end + for i := 0 to length(data)-1 do + begin + data[i,"tfo"]:= new typeclass(); + end + end + if call(preddata,data)=-1 then raise functionname()+"ṹݴ!"; + npoint := 0; //ʼλ + names := data[:,"n"]; + len1 := length(names); + if(len1>length(names union2 array()))then raise functionname()+"ṹظ"; + call(fmaxitem,data,alim); //䳤 + maxitem := 0; + for i,vi in data do + begin + name := vi["n"]; // + ot := vi["tfo"]; // + ot._n := name; + len := size := ot._fa; // + tpbyte := ot._s; //ǰռõֽ + if maxitem "char" then + begin + _write_(_ptr,n+"array",ivalue,length(ivalue)); + _desc._wlen := length(ivalue); + end + end else + begin + for i,v in ivalue do + begin + if i=_desc._fa then break; + n := _desc._ot; + _subobj[i]:= new tcpointer(n,v,_ptr+_stc.getsteps(i)); + end + end + end else + if _fpa="p" then //ָ + begin + if ifnumber(ivalue)then + begin + len := ivalue; + _desc._plen := len; + sz := _stc.getsteps(len); + if not(_ptr)then _ptr := tmalloc(sz,1); + end else + if ifarray(ivalue)then + begin + if _desc._ot="char" then raise "ָͺ͸ֵ"; + len := length(ivalue); + _desc._plen := len; + sz := _stc.getsteps(len); + if not(_ptr)then _ptr := tmalloc(sz,1); + if _desc._fb then // + begin + _write_(_ptr,_desc._ot+"array",ivalue,len); + _desc._wlen := len; + end else + begin + for j,sv in ivalue do + begin + o := new tcpointer(_desc._ltp,sv,_ptr+_stc.getsteps(j)); + _subobj[j]:= o; + end + end + end else + if ifstring(ivalue)then + begin + if _desc._ot <> "char" then raise "ַ͸ֵ"; + len := length(ivalue)+1; + _desc._plen := len; + sz := len; + if not(_ptr)then _ptr := tmalloc(sz,1); + _tool.writestr(_ptr,ivalue); + _desc._wlen := len; + end + end else //ͨ + begin + if not(_ptr)then _ptr := tmalloc(_desc._s,1); + for i,v in ivalue do + begin + si := _hashstrc[i]; + if ifobj(si)then + begin + ptr := _ptr+si._st; //λ + n := si._t; + if si._fa>0 then // + begin + _subobj[i]:= new tcpointer(si,v,ptr); + end else + if si._lt>0 then //ָ + begin + o := new tcpointer(si,v); + _subobj[i]:= o; + _tool.writeptr(ptr,o._ptr); + end else //ͨ + begin + if si._fb then + begin + _write_(ptr,n,v); + end else + begin + _subobj[i]:= new tcpointer(si,v,ptr); + end + end + end else + raise "ֵ±"; + end + end + end + function _getptr2_(); + begin + {** + @explan(˵) ȡڴַ %% + **} + x := 0; + for i,v in _objstart do + begin + x := v; + break; + end + return _getptr_()+x; + end + function _getptr_(); //õַ + begin + return _ptr; + end + function _size_(); //öռÿռС + begin + siz := _desc._size; + if _desc._fa then siz *= _desc._fa; + return siz; + end + function _getvalueaddr_(i); //ֵӦڴַ + begin + if ifnil(i)then return _ptr; + tv := _hashstrc[i]; + if ifobj(tv)then + begin + return _ptr+tv._st; //Ԫصַ + end + end + function _setcptr_(ptr); //öַ + begin + if ifnumber(ptr)and ptr then _ptr := ptr; + end + function _read_(p,t,l); //Ͷȡ + begin + case t of + "char": + begin + ret := _tool.readstr(p); + end + "int": + begin + ret := _tool.readint(p); + end + "intptr": + begin + ret := _tool.readptr(p); + end + "double": + begin + ret := _tool.readdouble(p); + end + "float": + begin + ret := _tool.readfloat(p); + end + "byte": + begin + ret := _tool.readbyte(p); + end + "short": + begin + ret := _tool.readshort(p); + end + "bytearray": + begin + ret := _tool.readbytes(p,l); + end + "intarray": + begin + ret := _tool.readints(p,l); + end + "doublearray": + begin + ret := _tool.readdoubles(p,l); + end + end; + return ret; + end + function _write_(p,t,v,l); //д + begin + case t of + "char": + begin + if ifstring(v)then + begin + if ifnumber(l)and length(v)>l then + begin + //echo "\r\nstringwrite:",l,"****",length(v); + return-1; + end + _tool.writestr(p,v); + ret := 1; + end + end + "int": + begin + if ifnumber(v)then + begin + _tool.writeint(p,v); + ret := 1; + end + end + "intptr": + begin + if ifnumber(v)then + begin + _tool.writeptr(p,v); + ret := 1; + end + ret := 1; + end + "double": + begin + if ifnumber(v)then + begin + _tool.writedouble(p,v); + ret := 1; + end + end + "float": + begin + if ifnumber(v)then + begin + _tool.writefloat(p,v); + ret := 1; + end + end + "byte": + begin + if ifnumber(v)then + begin + _tool.writebyte(p,v); + ret := 1; + end + end + "short": + begin + if ifnumber(v)then + begin + _tool.writeshort(p,v); + ret := 1; + end + end + "bytearray": + begin + _tool.writebytes(p,min(length(v),l),v); + ret := true; + end + "intarray": + begin + _tool.writeints(p,min(length(v),l),v); + ret := true; + end + "doublearray": + begin + _tool.writedoubles(p,min(length(v),l),v); + ret := true; + end + end; + return ret; + end + function _getdata_(); //е + begin + t := _desc._ot; + fp := _fpa; + if fp="a" then + begin + if _desc._fb then + begin + if t="char" then + begin + //echo "\r\nreade:",_ptr; + v := _tool.readstr(_ptr); + //echo "readv:" ,v,datatype(v); + return v; + end else + begin + return _read_(_ptr,t+"array",_desc._fa); + end + end else + begin + ret := array(); + for i := 0 to _desc._fa-1 do + begin + ret[i]:= getindexi(i)._getdata_(); + end + return ret; + end + end else + if fp="p" then + begin + t := _desc._ot; + if _desc._fb then + begin + if t="char" then + begin + return _tool.readstr(_ptr); + end else + begin + return _read_(_ptr,t+"array",_desc._plen); + end + end else + begin + ret := array(); + if ifnumber(_desc._plen)then + begin + for i := 0 to _desc._plen-1 do + begin + ret[i]:= getindexi(i)._getdata_(); + end + end + return ret; + end + end else + begin + ret := array(); + for i,v in _hashstrc do + begin + n := v._n; + o := _getvalue_(n); + if ifobj(o)then ret[n]:= o._getdata_(); + else ret[n]:= o; + end + return ret; + end + end + function getindexi(i); //ָiԪ,ͷֵ,ͷض + begin + if(_fpa="a" and i >= 0 and i<_desc._fa)then // + begin + // + ret := _subobj[i]; + if ifobj(ret)then return ret; + psi :=(_desc._s * i+_ptr); + if not(_desc._fb)then //ǻ + begin + return new tcpointer(_desc._t,nil,psi); + end else // + begin + if _desc._t <> "char" then + begin + return _read_(psi,_desc._ot); + end + end + end else + if _desc._lt>0 and i >= 0 then + begin + ret := _subobj[i]; + if ifobj(ret)then return ret; + ps := _ptr; + if ps=0 then return nil; + if _desc._lt>1 then + begin + psi :=(ps+_desc._ms * i); + o := new tcpointer(_desc._ot,nil,psi); + _subobj[i]:= o; + return o; + end else + begin + psi := ps+(_desc._stc._size * i); + if not(_desc._fb)then //ǻ + begin + o := new tcpointer(_desc._ot,nil,psi); + _subobj[i]:= o; + return o; + end else // + begin + if _desc._ot <> "char" then + begin + return _read_(psi,_desc._ot); + end else + return _read_(psi,"char"); + end + end + end + end + function _setvalue_(i,v); //±ֵֶ,ֻֻ֧ + begin + if ifnil(i)then + begin + ds := _desc; + //ds.show(); + end else + ds := _hashstrc[i]; + if not ifobj(ds)then return nil; + ptr := _ptr+ds._st; + if ds._fb then // + begin + if not(ds._fa or ds._lt)then //ָ + begin + _write_(ptr,ds._t,v); + end else + if ds._fa then + begin + if ds._ot="char" and ifstring(v)then + begin + _write_(ptr,ds._ot,v,ds._fa); + end else + if ds._ot <> "char" and ifarray(v)then + begin + _write_(ptr,ds._ot+"array",v,ds._fa); + end + end else + if ds._lt then //ָ + begin + if(v is class(tcpointer))then //ֵ + begin + if(ds._ot=v._desc._ot)and(ds._lt=v._desc._lt)then + begin + begin + _subobj[i]:= v; + _write_(ptr,"intptr",v._ptr); + end + end + return; + end + ptr := _read_(ptr,"intptr"); + if ptr then + begin + if ds._ot="char" and ifstring(v)and(length(v) "char" and ifarray(v)then + begin + _write_(ptr,ds._ot+"array",v,ifnumber(ds._plen)?(ds._plen):(length(v))); + end + end + end + end + end + function _getvalue_(i,L); //ȡֵ,ֻ֧,iΪ±,lΪָʱָ + begin + v := _hashstrc[i]; + if not ifobj(v)then return nil; + ptr := _ptr+v._st; + t := v._ot; + if v._fb then // + begin + if v._fa then + begin + if v._ot="char" then return _read_(ptr,"char"); + return _read_(ptr,v._ot+"array",ifnumber(L)?min(v._fa,L):v._fa); + end else + if v._lt then + begin + ptr := _read_(ptr,"intptr"); + if ptr <> 0 then + begin + if v._ot="char" then return _read_(ptr,"char"); + return _read_(ptr,v._ot+"array",ifnumber(L)?L:v._plen); + end + end else + begin + return _read_(ptr,v._ot); + end + end else + begin + if not ifobj(_subobj[i])then + begin + if v._fa then //ֵ + begin + _subobj[i]:= new tcpointer(v,nil,ptr); + end else + if v._lt then //ָ + begin + ptr := _read_(ptr,"intptr"); + if ptr <> 0 then + begin + _subobj[i]:= new tcpointer(v,nil,ptr); + end + end else + begin + //echo v.show; + _subobj[i]:= new tcpointer(v,nil,ptr); + end + end + return _subobj[i]; + end + end + function destroy(); // + begin + _subobj := array(); + class(tmemoryclass).destroy(); + end + function activefree(); //,Ŀǰ,ҪȽṹú󲹳 + begin + if _desc._lt then activefreesub(ptr_); + end + protected + function activefreesub(ptr_); + begin + ptr := opblocks(ptr_,0); + if ifnil(ptr)then + begin + _tool.tfree(ptr_); + end + end +end + + +Implementation +function ReadStringFromPtr(ptr); +begin + {** + @explan(˵) ȡһָ\0ֵַָ %% + @param(ptr)(pointer) ָ %%; + @return(string) ַ %% + + **} + if ptr and ifnumber(ptr)then return getmemtool().readstr(ptr); + return ""; +end +function WriteStringToPtr(ptr,str); +begin + {** + @explan(˵) һָд\0βַ %% + @param(ptr)(pointer) ָ %%; + @param(str)(string) ַ %% + **} + if ifnumber(ptr)and ifstring(str)and ptr then return getmemtool().writestr(ptr,str); + return 0; +end +function ReadBytesFromPtr(ptr,L); +begin + {** + @explan(˵) ȡһֵָָ %% + @param(ptr)(pointer) ָ %%; + @param(L)(integer) %%; + @return(array of integer) ַ %% + **} + if ptr and ifnumber(ptr)and L>0 then return getmemtool().readbytes(ptr,L); +end +function WriteBytesToPtr(ptr,bytes); +begin + {** + @explan(˵) һָдֽ %% + @param(ptr)(pointer) ָ %%; + @param(bytes)(array of integer) %% + **} + if ifnumber(ptr)and ptr and ifarray(bytes)then return getmemtool().writebytes(ptr,length(bytes),bytes); + return 0; +end +function getmemtool(); +begin + return static new aefclassobj_(); +end +function MemoryAlignmentCalculate(data,baselen,ssize,pack); +begin + {** + @explan(˵) ṹŲ %% + @param(data)(array) ṹϢ,ο cstructurelib tslarraytocstructcalc %% + @param(baselen)(integer) ׼λĬΪ0 %% + @param(ssize)(integer) С %% + @param(pack)(integer) ䷽ʽ windows Ĭ8 linux Ĭ4 %% + **} + if not ifnumber(baselen)then baselen := 1; //С + if not ifnumber(ssize)then ssize := 0; //С + if not ifnumber(pack)then + begin + {$ifdef linux} + pack := 4; + {$else} + pack := 8; // + {$endif} + end + //return tslcstructure_calc(data,baselen,ssize,pack); + return tslarraytocstructcalc(data,pack,0,ssize); +end +function ctypedefine(name,stc,alim,f); //ṹ嶨 +begin + {** + @explan(˵)ṹ嶨 %% + @param(name)(string) %% + @param(stc)(array) ڴֲ %% + @param(alim)(integer) ䷽ʽ %% + @return(tcstruct) + **} + return new tcstruct(name,stc,alim,f); +end +function tslarraytocstructcalc(data,alim,bsi,ssize); //䳤 +begin + {** + @explan(˵)ڴ䳤 %% + @param(data)(array) + tslݽṹ ά + ÿΪc ṹһ + 0 Ϊ ַ͵ı + 1 Ϊ ,ַ ( short,short[n],intptr,intptr[n],int,int[n],double,double[n],char[n],byte,byte[n] nΪС) + Ϊchar*ʱҪڴռ, 2Ϊstringֵ stringij + 2 Ϊ ֵ + %% + @param(alim)(integer) ䷽ʽ %% + @param(bsi)(integer) ַ,ĬΪ0 %% + @param(ssize)(array) ṹС %% + @return(array) ֵڲdata ֶ + 3 Ϊ ƫ + 4 Ϊ С + 5 Ϊ + 6 Ϊ Ϊʾ + **} + { + data + alim + bsi ַ //ĬΪ0 + ssize ṹС + ṹƫ;cӿڶԽ + : data tslݽṹ ά + ÿΪc ṹһ + 0 Ϊ ַ͵ı + 1 Ϊ ,ַ ( short,short[n],intptr,intptr[n],int,int[n],double,double[n],char[n],byte,byte[n] nΪС) + Ϊchar*ʱҪڴռ, 2Ϊstringֵ stringij + 2 Ϊ ֵ + ֵ ֶ + 3 Ϊ ƫ + 4 Ϊ С + 5 Ϊ + 6 Ϊ Ϊʾ + baselen + ssize ṹС; + pack //䷽ʽ + } + if not ifnumber(alim)then + begin + {$ifdef linux} + alim := 4; + {$else} + alim := 8; + {$endif} + end + if not ifnumber(bsi)then bsi := 0; + fmaxitem := function(d,cl) //䳤 + begin + ret := array(); + for i,v in d do + begin + vt := v[1]; + {ctrl := "\\w+[*]?"; + ParseRegExpr(ctrl,vt,"",result,MPos,Mlen); + vt := result[0,0];} + parserctypestr(vt,tt,len); + vt := tt; + //echo tt,"\r\n"; + if vt="user" then ret[i]:= maxvalue(call(thisfunction,v[2],cl)); + else ret[i]:= cl[vt]; + end + return ret; + end; + if ifnumber(data)then return data; //Ϊ + if not ifarray(data)then raise functionname()+"ṹݴ!"; + if mcols(data)<1 then raise functionname()+"ṹݴ"; + ret := data; //ֵ + npoint := bsi; //ʼλ + names := data[:,0]; + len1 := length(names); + if(len1>length(names union2 array()))then raise functionname()+"ṹظ"; + ctypebytes := static getctypesize(); + ctypebytes["user*"]:= ctypebytes["intptr"]; + ctypenames := mrows(ctypebytes,1); + itemslen := call(fmaxitem,data,ctypebytes); //䳤 + for i,vi in data do + begin + name := vi[0]; // + tp := vi[1]; // + v := vi[2]; //ֵ + ctrl := "\\w+[*]?"; + {ParseRegExpr(ctrl,tp,"",result,MPos,Mlen); + tp1 := result[0,0]; // + size := result[1,0];//С + if ifstring(size) then size := strtoint(size);} + parserctypestr(tp,tp1,size); + //echo "*************************",size; + tpbyte := itemslen[i]; //ǰռõֽ + if(tp1 in array("uint","char","float","double","int","intptr","byte","short","char*","user*"))then + begin + tpn := tp1; + ret[i,5]:= tpn; + if not(size)then + begin + if(tpn in array("char"))then + begin + raise "ʹʽ"; + end; + size := 1; + if ifstring(v)then size := length(v)+1; + end else + begin + if ifarray(v)then + begin + if length(v)>size then raise "ʼֵСռ"; + end else + if ifstring(v)then + begin + //echo "*********************************************************88"; + //echo size,tostn(v),length(v); + if length(v)>(size-1)then raise "ʼֵСռ"; + end + if not(tpn in array("char"))then ret[i,5]+= "array"; + end + if tp1="char*" then + begin + sz := tpbyte; + end else + begin + sz := tpbyte * size; //ݴС + end + if(tp1="user*")then //ṹָ + begin + ret[i,2]:= tslarraytocstructcalc(v,alim,0,0); + sz := tpbyte; //ԪشС + end + dp1 := min(alim,tpbyte); + npoint := ceil(npoint/dp1)* dp1; + end else + if(tp1="user")then + begin + ret[i,5]:= "userarray"; + size := 1; + sz := 0; + dp1 := min(alim,tpbyte); + npoint := ceil(npoint/dp1)* dp1; + ret1 := tslarraytocstructcalc(v,alim,npoint,sz); + ret[i,2]:= ret1; + end else + raise "ʹ"; + ret[i,3]:= npoint; //Ԫؿʼĵַ + ret[i,4]:= sz; //Ԫռÿռ + ret[i,6]:= size; //Ԫظ + npoint += sz; + end + st := npoint-bsi; + alimlen := min(alim,maxvalue(itemslen)); + ssize :=(ceil(st/alimlen)* alimlen); + ret[length(ret)-1,4]+=(ssize-st); + return ret; +end +function parserctypestr(ts,t,s,n); +begin + {** + @explan(˵)ͽ %% + @param(ts)(string) ַ "char[100]" %% + @param(t)(string) %% + @param(s)(integer) 鳤 %% + @param(n)(string) %% + **} + t := ""; + s := ""; + n := ""; + lx := 1; // + len := length(ts); + i := 1; + while i <= len do + begin + vi := ts[i]; + if vi="[" then //鳤 + begin + i++; + while i <= len do + begin + vi := ts[i]; + ixvi := ord(vi); + if vi="]" then //ת + begin + if s then s := strtoint(s); + return; + end else + if(ixvi >= 48 and ixvi <= 57)then s += vi; //Ӽ¼ַ + i++; + end + return; + end else + if vi="*" then + begin + t += vi; + end else + if(vi="\t" or vi=" ")and lx=1 and t then + begin + lx := 2; + end else + if not(vi="\t" or vi=" ")then + begin + if lx=2 then n += vi; + else if lx=1 then t += vi; + end + i++; + end +end +function addtable(d,n); +begin + tbs := ""; + for i := 1 to n do tbs += "\t"; + r := ""; + for i,v in str2array(d,"\r\n") do if v then r += tbs+v+"\r\n"; + return r; +end +function cstructtotslclass(data,name,fz); +begin + {** + @explan(˵)ṹתΪ %% + **} + s := format("type %s = class(tslcstructureobj)\r\n",name); + s += "uses cstructurelib;\r\n"; + s += "private\r\n\tstatic SSTRUCT;\r\n"; + fs := ""; + fp := ""; + sf := ""; + gsf := ""; + intf := format("\tclass function getstruct()\r\n\tbegin\r\n\t\tif not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(\r\n%s\r\n\t\treturn SSTRUCT;\r\n\tend\r\n",addtable(tostn(data)+");",3)); + if fz then cf2 := "public\r\nclass function memsize();\r\nbegin\r\n\tif not SSTRUCT then getstruct();\r\n\tif SSTRUCT then \r\n\tbegin\r\n\t\tldata := length(SSTRUCT)-1;\r\n\t\treturn SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3];\r\n\tend \r\n\treturn 0;\r\nend"; + else cf2 := ""; + cf := "\tpublic\r\n\tfunction create(ptr)\r\n\tbegin\r\n\t\tinherited create(getstruct(),ptr); \r\n\tend\r\n"; + for i,v in data do + begin + v0 := v[0]; + //fs += "\tF"+ v[0]+";\r\n"; + fp += format('\tproperty %s index "%s" read _getvalue_ write _setvalue_;\r\n',v0,v0); + {sf += format("\tfunction Set%s(v)\r\n\tbegin\r\n",v0); + sf += format("\t\t_setvalue_('%s',v);\r\n",v0,v0,v0); + sf +="\tend\r\n"; + gsf += format("\tfunction Get%s()\r\n\tbegin\r\n",v0); + gsf += format("\t\treturn _getvalue_('%s');\r\n",v0); + gsf +="\tend\r\n";} + end + s += gsf; + s += intf; + s += sf; + s += addtable(cf2,1); + s += cf; + s += fp; + s += "end"; + return s; +end +//*************ɾcע***************** +function dealcppcomment(strs) +begin + {** + @explan(˵)ɾcע %% + @param(strs)(string) cṹַ %% + @return(string) + **} + rets := ""; + len := length(strs); + i := 1; + while ilen then return 0; + if str[vpos]<> f[i]then + begin + bud := false; + break; + end + end + if bud then + begin + pos +=(fl-1); + end + return bud; +end +function findstringv(str,f,len,pos,zy,hl); +begin + {** + @explan(˵)fβַ + **} + vs := ""; + fl := length(f); + while pos=",indx,"sym"); + end else + setvalue(ret,">",indx,"sym"); + end else + if vi="<" then + begin + setvalue(ret,vs,indx,"token"); + vip := gdis[indx+1]; + if vip="=" then + begin + indx++; + setvalue(ret,"<=",indx,"sym"); + end else + setvalue(ret,"<",indx,"sym"); + end else + if vi="=" then + begin + setvalue(ret,vs,indx,"token"); + vip := gdis[indx+1]; + if vip="=" then + begin + indx++; + setvalue(ret,"==",indx,"sym"); + end else + setvalue(ret,"=",indx,"sym"); + end else + if vi="[" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"[",indx,"sym"); + end else + if vi="]" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"]",indx,"sym"); + end else + if vi="&" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"&",indx,"sym"); + end else + if vi="*" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"*",indx,"*"); + end else + if vi="," then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,",",indx,","); + end else + if vi=";" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,";",indx,";"); + end else + if vi="(" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"(",indx,"("); + end else + if vi=")" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,")",indx,")"); + end else + if vi="{" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"{",indx,"sym"); + end else + if vi="}" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"}",indx,"sym"); + end else + if vi="|" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,vi,indx,"sym"); + end else + if vi="?" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,vi,indx,"sym"); + end else + if vi=":" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,vi,indx,"sym"); + end else + if vi="'" then + begin + setvalue(ret,vs,indx,"token"); + vs := findstringv(gdis,"'",len,indx,"\\"); + setvalue(ret,vs,indx,"'"); + end else + if vi='"' then + begin + setvalue(ret,vs,indx,"token"); + vs := findstringv(gdis,'"',len,indx,'\\'); + setvalue(ret,vs,indx,'"'); + end else + if vi="/" then + begin + setvalue(ret,vs,indx,"token"); + vip := gdis[indx+1]; + if vip="/" then + begin + indx += 1; + vs := findstringv(gdis,"\n",len,indx,nil,"\r"); + setvalue(ret,vs,indx,"//"); + end else + if vip="*" then + begin + indx += 1; + vs := findstringv(gdis,"*/",len,indx,nil); + setvalue(ret,vs,indx,"/*"); + end else + begin + setvalue(ret,"/",indx,"/"); + end + end else + if vi in kg then + begin + setvalue(ret,vs,indx,"token"); + end else + if vi="\n" then + begin + setvalue(ret,vs,indx,"token"); + setvalue(ret,"\n",indx,"\n"); + end else + vs += vi; + end + setvalue(ret,vs,indx,"token"); + return ret; + //writetofile("",ret); + //parsergdifunction(ret); +end +function nexttoken(tokens,indx,f); +begin + if not(f)then indx++; + return tokens[indx]; +end +function backtoken(tokens,indx,f); +begin + if not(f)then indx--; + return tokens[indx]; +end +function parsergdifunction(tokens); +begin + {** + @explan(˵) ȡͷļ + **} + len := length(tokens)-1; + indx :=-1; + isyms := array("GDIPCONST","_In_","_Out_"); + ret := array(); + retl := 0; + hst := array(); + s := "type TGdiplusflat=class\r\n"; + s += "{** + @explan(˵)gdi+ cӿں %% + **}\r\n"; + zs := ""; + while indx1)?"var ":"")+gzhparam(pn); + ps += ":"+plx; + pn := 0; + ps += ";"; + plx := 0; + havlx := true; + ddpoint := 0; + end else + if plx and(tvi="token")then + begin + pn := vi; + end else + if vi="*" then + begin + ddpoint++; + if plx in array("integer","single","hbitmap")then + begin + ddpoint++; + end else + if plx="string" then + begin + end else + plx := "pointer"; + end else + if havlx and lex[vi]then + begin + havlx := false; + plx := lex[vi]; + end else + if havlx then + begin + havlx := false; + plx := "pointer"; + end else + if vi="[" {or vi = "]"}or vi="&" then + begin + plx := "pointer"; + end + end + if plx then + begin + if not(pn)then pn := dpn+inttostr(i); + ps +=((ddpoint>1)?"var ":"")+gzhparam(pn)+":"+plx; + end + ret += ps; + //echo tostn(array(tp,ct,fn)); + ret += format(')%s;%s;external "gdiplus.dll" name "%s";',tp,ct,fn); + //echo tostn(ret),"\r\n"; + return ret; +end +function gzhparam(p); +begin + {** + @explan(˵) 滻 + **} + if p="order" then return "order_"; + else if p="unit" then return "unit_"; + else if p="on" then return "on_"; + return p; +end +function parenthesis(tokens,pos,len,iffunc,isyms); +begin + {** + @explan(˵) + **} + ret := array(); + retl := 0; + tkv := ""; + while pos0 then + begin + image := r; + r := 1; + end + return r; + end + + class function GdiplusStartup(); //gdi+ + class function GdipDisposeImage(img); //image + begin + imageunref(img); + end + class function GdipSaveImageToFile(image:pointer;filename:string;clsidEncoder:pointer;encoderParams:pointer); // + begin + s := unit(cstructurelib).ReadStringFromPtr(clsidEncoder); + //"png","jpeg","bmp","gif","tiff" + case s of + "image/png": + begin + return gdk_pixbuf_save(image,filename,"png",nil,nil,nil,nil,nil,nil) + end + "image/jpeg": + begin + ps := array("quality":"100"); + if ifarray(conf) and conf["quality"]>0 and conf["quality"]<=100 then ps["quality"] := inttostr(conf["quality"]); + return gdk_pixbuf_save(image,filename,"jpeg",nil,"quality",ps["quality"],nil,nil,nil); + end + "image/bmp": + begin + return gdk_pixbuf_save(image,filename,"bmp",nil,nil,nil,nil,nil,nil); + end + end + return 0; + end + + class function GdipCreateHBITMAPFromBitmap(bitmap:pointer;var hbmReturn:pointer;background:integer); //bitmap to hbitmap + begin + hbmReturn := bitmap; + imageref(hbmReturn); + return 1; + end + class function GdipCreateBitmapFromHBITMAP(hbm:pointer;hpal:pointer;var bitmap:pointer); // hbitmap to bitmap + begin + bitmap := hbm; + imageref(bitmap); + return 1; + end + class function GdipCreateBitmapFromHICON(hicon:pointer;var bitmap:pointer); //bitmap to icon + begin + bitmap := hicon; + imageref(bitmap); + return 1; + end + class function GdipCreateHICONFromBitmap(bitmap:pointer;var hbmReturn:pointer); // icon to bitmap + begin + hbmReturn := bitmap; + imageref(hbmReturn); + return 1; + end + class function GdipGetbmpSurface(h); + begin + s := GetImageProperty(h,"surface"); + if s then return s; + p := GetImageProperty(h,"file"); + s := cairo_image_surface_create_from_png(p); + SetImageProperty(h,"surface",s); + return s ; + end + class function GdipGetbmppattern(h); + begin + r := GetImageProperty(h,"pattern"); + if r then return r; + s := GdipGetbmpSurface(h); + r := cairo_pattern_create_for_surface(s); + SetImageProperty(h,"pattern",r); + return r; + end + class function imagetostring(h,vp,conf); //bitamp to str + begin + t := unit(cstructurelib).ReadStringFromPtr(vp._getptr_()); + //"png","jpeg","bmp","gif","tiff" + case t of + "image/png": + begin + s := GetImageProperty(h,"pngdata"); + if s and ifstring(s) then return s; + tf := new TTempFile(); + p := GetImageProperty(h,"file"); + tf.GetData(s,p); + SetImageProperty(h,"pngdata",s); + end + "image/jpeg": + begin + s := GetImageProperty(h,"jpegdata"); + if s and ifstring(s) then return s; + tf := new TTempFile(p); + p := tf.path; + ps := array("quality":"100"); + if ifarray(conf) and conf["quality"]>0 and conf["quality"]<=100 then ps["quality"] := inttostr(conf["quality"]); + if 1<> gdk_pixbuf_save(pixbuf,p,"jpeg",nil,"quality",ps["quality"],nil,nil,nil) then return 0; + tf.GetData(s); + SetImageProperty(h,"jpegdata",s); + + end + "image/ico": + begin + s := GetImageProperty(h,"icodata"); + if s and ifstring(s) then return s; + tf := new TTempFile(p); + p := tf.path; + ps := array("depth":"32","x_hot":"16","y_hot":"16"); + if ifarray(conf) and conf["depth"]>0 and conf["depth"]<=512 then ps["depth"] := inttostr(conf["depth"]); + if ifarray(conf) and conf["x_hot"]>0 and conf["x_hot"]<=128 then ps["x_hot"] := inttostr(conf["x_hot"]); + if ifarray(conf) and conf["y_hot"]>0 and conf["y_hot"]<=128 then ps["y_hot"] := inttostr(conf["y_hot"]); + if 1<> gdk_pixbuf_save(pixbuf,p,"ico","depth",ps["depth"],"x_hot",ps["x_hot"],"y_hot",ps["y_hot"]) then return 0; + tf.GetData(s); + SetImageProperty(h,"icogdata",s); + end + "image/bmp": + begin + s := GetImageProperty(h,"bmpdata"); + if s and ifstring(s) then return s; + tf := new TTempFile(p); + p := tf.path; + if 1<> gdk_pixbuf_save(pixbuf,p,"bmp",nil,nil,nil,nil,nil,nil) then return 0; + tf.GetData(s); + SetImageProperty(h,"bmpdata",s); + end + end + return s; + end + class function stringtoimage(b,hd); //string to bitmap + begin + tf := new TTempFile(p); + p := tf.path; + if 1<>writefile(rwraw(),"",p,0,length(b),b) then return 0; + hd := gdk_pixbuf_new_from_file(p,0); + if hd then r := 0; + else return -1; + np := unit(tslvcl).getmsgd_Crc32(p); + nnp := "/tmp/tinysoft/tslvcl/"+np[1]+"/"+np[2]+"/"+np+".png"; + imageref(hd); + SetImageProperty(hd,"file",nnp); + unit(tslvcl).CreateDirWithFileName(nnp); + gdk_pixbuf_save(hd,nnp,"png",nil,nil,nil,nil,nil,nil); + return r; + end + private + class function SetImageProperty(img,p,pv); // + begin + global g_gtk_images_propertys; + if not ifarray(g_gtk_images_propertys) then g_gtk_images_propertys := array(); + return g_gtk_images_propertys[inttostr(img),p] := pv; + end + class function GetImageProperty(img,p); // + begin + global g_gtk_images_propertys; + if not ifarray(g_gtk_images_propertys) then g_gtk_images_propertys := array(); + return g_gtk_images_propertys[inttostr(img),p]; + end + class function imageref(img); // + begin + rf := GetImageProperty(img,"ref"); + SetImageProperty(img,"ref",((rf>0)?(rf+1):(1))); + g_object_ref(img); + end + class function imageunref(img); // + begin + rf := GetImageProperty(img,"ref"); + if ifnil(rf) then return ; + if rf<=1 then + begin + return DeleteImages(img); + end + else SetImageProperty(img,"ref",rf-1); + end + + class function DeleteImages(img); //ɾ + begin + global g_gtk_images_propertys; + if not ifarray(g_gtk_images_propertys) then return ; + id := inttostr(img); + idfile := g_gtk_images_propertys[id,"file"]; + if not idfile then return ; + if fileexists("",idfile) then //ɾļ + begin + filedelete("",idfile); + end + pt := GetImageProperty(img,"pattern"); + if pt then + begin + cairo_pattern_destroy(pt); //Ƴpattern + end + sf := GetImageProperty(img,"surface"); + if sf then + begin + //cairo_surface_destroy(sf); //Ƴsurface + end + reindex(g_gtk_images_propertys,array(id:nil)); + g_object_unref(img); + end +{$else} + //stream + class function imagetostring(h,vp,conf); + begin + CreateStreamOnHGlobal(0,true,st); + r := GdipSaveImageToStream(h,st,vp._getptr_,0); + if r<>0 then exit; + GetHGlobalFromStream(st,memo); + len := GlobalSize(memo); + s := ""; + lm := GlobalLock(memo); + setlength(s,len); + memcpy2(s,lm,len); + tuicloseistream(st); + return s; + end + class function stringtoimage(b,hd); + begin + len := length(b); + hm := GlobalAlloc(2,len+1);// + lm := GlobalLock(hm);// + if lm <> 0 then + begin + memcpy(lm,b,len);//ڴ濽 + GlobalUnlock(hm);// + end + CreateStreamOnHGlobal(hm,true,st); + r := GdipLoadImageFromStream(st,hd); + tuicloseistream(st); + return r; + end + class function CreateStreamOnHGlobal(hGlobal:pointer;fDeleteOnRelease:integer; var ppstm:pointer):pointer;stdcall;external "Ole32.dll" name "CreateStreamOnHGlobal"; + class function GetHGlobalFromStream(pstm:pointer; var phglobal:pointer):pointer;stdcall;external "Ole32.dll" name "GetHGlobalFromStream"; + class function GlobalLock(mem :pointer):pointer;stdcall;external "Kernel32.dll" name "GlobalLock"; + class function GlobalUnlock(mem :pointer):integer;stdcall;external "Kernel32.dll" name "GlobalUnlock"; + class function GlobalSize(menm:pointer):integer;stdcall;external "Kernel32.dll" name "GlobalSize"; + class function memcpy(dst:pointer;src:string;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; + class function memcpy2(var dst:string;src:pointer;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; + class function tuicloseistream(sm:pointer):integer;cdecl;external "TSLUIL.dll" name "tuicloseistream"; + class function GlobalAlloc(uFlags :integer;dwBytes:integer):pointer;stdcall;external "Kernel32.dll" name "GlobalAlloc"; + + class Function GdipCreatePath(brushMode:integer;var path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePath"; + class Function GdipCreatePath2(pn2:pointer;pn5:pointer;pn7:integer;pn9:integer;var path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePath2"; + class Function GdipCreatePath2I(pn2:pointer;pn5:pointer;pn7:integer;pn9:integer;var path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePath2I"; + class Function GdipClonePath(path:pointer;var clonePath:pointer):integer;stdcall;external "gdiplus.dll" name "GdipClonePath"; + class Function GdipDeletePath(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeletePath"; + class Function GdipResetPath(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetPath"; + class Function GdipGetPointCount(path:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPointCount"; + class Function GdipGetPathTypes(path:pointer;types:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathTypes"; + class Function GdipGetPathPoints(pn2:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathPoints"; + class Function GdipGetPathPointsI(pn2:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathPointsI"; + class Function GdipGetPathFillMode(path:pointer;var fillmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathFillMode"; + class Function GdipSetPathFillMode(path:pointer;fillmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathFillMode"; + class Function GdipGetPathData(path:pointer;pathData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathData"; + class Function GdipStartPathFigure(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipStartPathFigure"; + class Function GdipClosePathFigure(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipClosePathFigure"; + class Function GdipClosePathFigures(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipClosePathFigures"; + class Function GdipSetPathMarker(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathMarker"; + class Function GdipClearPathMarkers(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipClearPathMarkers"; + class Function GdipReversePath(path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipReversePath"; + class Function GdipGetPathLastPoint(path:pointer;lastPoint:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathLastPoint"; + class Function GdipAddPathLine(path:pointer;x1:single;y1:single;x2:single;y2:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathLine"; + class Function GdipAddPathLine2(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathLine2"; + class Function GdipAddPathArc(path:pointer;x:single;y:single;width:single;height:single;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathArc"; + class Function GdipAddPathBezier(path:pointer;x1:single;y1:single;x2:single;y2:single;x3:single;y3:single;x4:single;y4:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathBezier"; + class Function GdipAddPathBeziers(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathBeziers"; + class Function GdipAddPathCurve(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurve"; + class Function GdipAddPathCurve2(path:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurve2"; + class Function GdipAddPathCurve3(path:pointer;points:pointer;count:integer;offset:integer;numberOfSegments:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurve3"; + class Function GdipAddPathClosedCurve(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathClosedCurve"; + class Function GdipAddPathClosedCurve2(path:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathClosedCurve2"; + class Function GdipAddPathRectangle(path:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathRectangle"; + class Function GdipAddPathRectangles(path:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathRectangles"; + class Function GdipAddPathEllipse(path:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathEllipse"; + class Function GdipAddPathPie(path:pointer;x:single;y:single;width:single;height:single;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathPie"; + class Function GdipAddPathPolygon(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathPolygon"; + class Function GdipAddPathPath(path:pointer;addingPath:pointer;connect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathPath"; + class Function GdipAddPathString(path:pointer;string:string;length:integer;family:pointer;style:integer;emSize:single;layoutRect:pointer;format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathString"; + class Function GdipAddPathStringI(path:pointer;string:string;length:integer;family:pointer;style:integer;emSize:single;layoutRect:pointer;format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathStringI"; + class Function GdipAddPathLineI(path:pointer;x1:integer;y1:integer;x2:integer;y2:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathLineI"; + class Function GdipAddPathLine2I(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathLine2I"; + class Function GdipAddPathArcI(path:pointer;x:integer;y:integer;width:integer;height:integer;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathArcI"; + class Function GdipAddPathBezierI(path:pointer;x1:integer;y1:integer;x2:integer;y2:integer;x3:integer;y3:integer;x4:integer;y4:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathBezierI"; + class Function GdipAddPathBeziersI(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathBeziersI"; + class Function GdipAddPathCurveI(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurveI"; + class Function GdipAddPathCurve2I(path:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurve2I"; + class Function GdipAddPathCurve3I(path:pointer;points:pointer;count:integer;offset:integer;numberOfSegments:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathCurve3I"; + class Function GdipAddPathClosedCurveI(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathClosedCurveI"; + class Function GdipAddPathClosedCurve2I(path:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathClosedCurve2I"; + class Function GdipAddPathRectangleI(path:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathRectangleI"; + class Function GdipAddPathRectanglesI(path:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathRectanglesI"; + class Function GdipAddPathEllipseI(path:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathEllipseI"; + class Function GdipAddPathPieI(path:pointer;x:integer;y:integer;width:integer;height:integer;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipAddPathPieI"; + class Function GdipAddPathPolygonI(path:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipAddPathPolygonI"; + class Function GdipFlattenPath(path:pointer;matrix:pointer;flatness:single):integer;stdcall;external "gdiplus.dll" name "GdipFlattenPath"; + class Function GdipWindingModeOutline(path:pointer;matrix:pointer;flatness:single):integer;stdcall;external "gdiplus.dll" name "GdipWindingModeOutline"; + class Function GdipWidenPath(nativePath:pointer;pen:pointer;matrix:pointer;flatness:single):integer;stdcall;external "gdiplus.dll" name "GdipWidenPath"; + class Function GdipWarpPath(path:pointer;matrix:pointer;points:pointer;count:integer;srcx:single;srcy:single;srcwidth:single;srcheight:single;warpMode:pointer;flatness:single):integer;stdcall;external "gdiplus.dll" name "GdipWarpPath"; + class Function GdipTransformPath(path:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTransformPath"; + class Function GdipGetPathWorldBounds(path:pointer;bounds:pointer;matrix:pointer;pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathWorldBounds"; + class Function GdipGetPathWorldBoundsI(path:pointer;bounds:pointer;matrix:pointer;pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathWorldBoundsI"; + class Function GdipIsVisiblePathPoint(path:pointer;x:single;y:single;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisiblePathPoint"; + class Function GdipIsVisiblePathPointI(path:pointer;x:integer;y:integer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisiblePathPointI"; + class Function GdipIsOutlineVisiblePathPoint(path:pointer;x:single;y:single;pen:pointer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsOutlineVisiblePathPoint"; + class Function GdipIsOutlineVisiblePathPointI(path:pointer;x:integer;y:integer;pen:pointer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsOutlineVisiblePathPointI"; +//---------------------------------------------------------------------------- +// PathIterator APIs +//---------------------------------------------------------------------------- + class Function GdipCreatePathIter(var iterator:pointer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePathIter"; + class Function GdipDeletePathIter(iterator:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeletePathIter"; + class Function GdipPathIterNextSubpath(iterator:pointer;var resultCount:integer;var startIndex:integer;var endIndex:integer;isClosed:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterNextSubpath"; + class Function GdipPathIterNextSubpathPath(iterator:pointer;var resultCount:integer;path:pointer;isClosed:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterNextSubpathPath"; + class Function GdipPathIterNextPathType(iterator:pointer;var resultCount:integer;pathType:pointer;var startIndex:integer;var endIndex:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterNextPathType"; + class Function GdipPathIterNextMarker(iterator:pointer;var resultCount:integer;var startIndex:integer;var endIndex:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterNextMarker"; + class Function GdipPathIterNextMarkerPath(iterator:pointer;var resultCount:integer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterNextMarkerPath"; + class Function GdipPathIterGetCount(iterator:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterGetCount"; + class Function GdipPathIterGetSubpathCount(iterator:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterGetSubpathCount"; + class Function GdipPathIterIsValid(iterator:pointer;valid:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterIsValid"; + class Function GdipPathIterHasCurve(iterator:pointer;hasCurve:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterHasCurve"; + class Function GdipPathIterRewind(iterator:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterRewind"; + class Function GdipPathIterEnumerate(iterator:pointer;var resultCount:integer;points:pointer;types:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterEnumerate"; + class Function GdipPathIterCopyData(iterator:pointer;var resultCount:integer;points:pointer;types:pointer;startIndex:integer;endIndex:integer):integer;stdcall;external "gdiplus.dll" name "GdipPathIterCopyData"; +//---------------------------------------------------------------------------- +// Matrix APIs +//---------------------------------------------------------------------------- + class Function GdipCreateMatrix(var matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMatrix"; + class Function GdipCreateMatrix2(m11:single;m12:single;m21:single;m22:single;dx:single;dy:single;var matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMatrix2"; + class Function GdipCreateMatrix3(rect:pointer;dstplg:pointer;var matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMatrix3"; + class Function GdipCreateMatrix3I(rect:pointer;dstplg:pointer;var matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMatrix3I"; + class Function GdipCloneMatrix(matrix:pointer;var cloneMatrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneMatrix"; + class Function GdipDeleteMatrix(matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteMatrix"; + class Function GdipSetMatrixElements(matrix:pointer;m11:single;m12:single;m21:single;m22:single;dx:single;dy:single):integer;stdcall;external "gdiplus.dll" name "GdipSetMatrixElements"; + class Function GdipMultiplyMatrix(matrix:pointer;matrix2:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyMatrix"; + class Function GdipTranslateMatrix(matrix:pointer;offsetX:single;offsetY:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateMatrix"; + class Function GdipScaleMatrix(matrix:pointer;scaleX:single;scaleY:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScaleMatrix"; + class Function GdipRotateMatrix(matrix:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotateMatrix"; + class Function GdipShearMatrix(matrix:pointer;shearX:single;shearY:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipShearMatrix"; + class Function GdipInvertMatrix(matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipInvertMatrix"; + class Function GdipTransformMatrixPoints(matrix:pointer;pts:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipTransformMatrixPoints"; + class Function GdipTransformMatrixPointsI(matrix:pointer;pts:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipTransformMatrixPointsI"; + class Function GdipVectorTransformMatrixPoints(matrix:pointer;pts:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipVectorTransformMatrixPoints"; + class Function GdipVectorTransformMatrixPointsI(matrix:pointer;pts:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipVectorTransformMatrixPointsI"; + class Function GdipGetMatrixElements(matrix:pointer;var matrixOut:single):integer;stdcall;external "gdiplus.dll" name "GdipGetMatrixElements"; + class Function GdipIsMatrixInvertible(matrix:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsMatrixInvertible"; + class Function GdipIsMatrixIdentity(matrix:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsMatrixIdentity"; + class Function GdipIsMatrixEqual(matrix:pointer;matrix2:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsMatrixEqual"; +//---------------------------------------------------------------------------- +// Region APIs +//---------------------------------------------------------------------------- + class Function GdipCreateRegion(var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegion"; + class Function GdipCreateRegionRect(rect:pointer;var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegionRect"; + class Function GdipCreateRegionRectI(rect:pointer;var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegionRectI"; + class Function GdipCreateRegionPath(path:pointer;var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegionPath"; + class Function GdipCreateRegionRgnData(regionData:pointer;size:integer;var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegionRgnData"; + class Function GdipCreateRegionHrgn(hRgn:pointer;var region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateRegionHrgn"; + class Function GdipCloneRegion(region:pointer;var cloneRegion:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneRegion"; + class Function GdipDeleteRegion(region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteRegion"; + class Function GdipSetInfinite(region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetInfinite"; + class Function GdipSetEmpty(region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetEmpty"; + class Function GdipCombineRegionRect(region:pointer;rect:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCombineRegionRect"; + class Function GdipCombineRegionRectI(region:pointer;rect:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCombineRegionRectI"; + class Function GdipCombineRegionPath(region:pointer;path:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCombineRegionPath"; + class Function GdipCombineRegionRegion(region:pointer;region2:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCombineRegionRegion"; + class Function GdipTranslateRegion(region:pointer;dx:single;dy:single):integer;stdcall;external "gdiplus.dll" name "GdipTranslateRegion"; + class Function GdipTranslateRegionI(region:pointer;dx:integer;dy:integer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateRegionI"; + class Function GdipTransformRegion(region:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTransformRegion"; + class Function GdipGetRegionBounds(region:pointer;graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionBounds"; + class Function GdipGetRegionBoundsI(region:pointer;graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionBoundsI"; + class Function GdipGetRegionHRgn(region:pointer;graphics:pointer;hRgn:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionHRgn"; + class Function GdipIsEmptyRegion(region:pointer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsEmptyRegion"; + class Function GdipIsInfiniteRegion(region:pointer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsInfiniteRegion"; + class Function GdipIsEqualRegion(region:pointer;region2:pointer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsEqualRegion"; + class Function GdipGetRegionDataSize(region:pointer;var bufferSize:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionDataSize"; + class Function GdipGetRegionData(region:pointer;buffer:pointer;bufferSize:integer;sizeFilled:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionData"; + class Function GdipIsVisibleRegionPoint(region:pointer;x:single;y:single;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRegionPoint"; + class Function GdipIsVisibleRegionPointI(region:pointer;x:integer;y:integer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRegionPointI"; + class Function GdipIsVisibleRegionRect(region:pointer;x:single;y:single;width:single;height:single;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRegionRect"; + class Function GdipIsVisibleRegionRectI(region:pointer;x:integer;y:integer;width:integer;height:integer;graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRegionRectI"; + class Function GdipGetRegionScansCount(region:pointer;var count:integer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionScansCount"; + class Function GdipGetRegionScans(region:pointer;rects:pointer;var count:integer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionScans"; + class Function GdipGetRegionScansI(region:pointer;rects:pointer;var count:integer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetRegionScansI"; +//---------------------------------------------------------------------------- +// Brush APIs +//---------------------------------------------------------------------------- + class Function GdipCloneBrush(brush:pointer;var cloneBrush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneBrush"; + class Function GdipDeleteBrush(brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteBrush"; + class Function GdipGetBrushType(brush:pointer;type:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetBrushType"; +//---------------------------------------------------------------------------- +// HatchBrush APIs +//---------------------------------------------------------------------------- + class Function GdipCreateHatchBrush(hatchstyle:pointer;forecol:integer;backcol:integer;var brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateHatchBrush"; + class Function GdipGetHatchStyle(brush:pointer;hatchstyle:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetHatchStyle"; + class Function GdipGetHatchForegroundColor(brush:pointer;var forecol:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetHatchForegroundColor"; + class Function GdipGetHatchBackgroundColor(brush:pointer;var backcol:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetHatchBackgroundColor"; +//---------------------------------------------------------------------------- +// TextureBrush APIs +//---------------------------------------------------------------------------- + class Function GdipCreateTexture(image:pointer;wrapmode:integer;var texture:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateTexture"; + class Function GdipCreateTexture2(image:pointer;wrapmode:integer;x:single;y:single;width:single;height:single;var texture:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateTexture2"; + class Function GdipCreateTextureIA(image:pointer;imageAttributes:pointer;x:single;y:single;width:single;height:single;var texture:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateTextureIA"; + class Function GdipCreateTexture2I(image:pointer;wrapmode:integer;x:integer;y:integer;width:integer;height:integer;var texture:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateTexture2I"; + class Function GdipCreateTextureIAI(image:pointer;imageAttributes:pointer;x:integer;y:integer;width:integer;height:integer;var texture:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateTextureIAI"; + class Function GdipGetTextureTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetTextureTransform"; + class Function GdipSetTextureTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetTextureTransform"; + class Function GdipResetTextureTransform(brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetTextureTransform"; + class Function GdipMultiplyTextureTransform(brush:pointer;matrix:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyTextureTransform"; + class Function GdipTranslateTextureTransform(brush:pointer;dx:single;dy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateTextureTransform"; + class Function GdipScaleTextureTransform(brush:pointer;sx:single;sy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScaleTextureTransform"; + class Function GdipRotateTextureTransform(brush:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotateTextureTransform"; + class Function GdipSetTextureWrapMode(brush:pointer;wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetTextureWrapMode"; + class Function GdipGetTextureWrapMode(brush:pointer;var wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetTextureWrapMode"; + class Function GdipGetTextureImage(brush:pointer;var image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetTextureImage"; +//---------------------------------------------------------------------------- +// SolidBrush APIs +//---------------------------------------------------------------------------- + class Function GdipCreateSolidFill(color:integer;var brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateSolidFill"; + class Function GdipSetSolidFillColor(brush:pointer;color:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetSolidFillColor"; + class Function GdipGetSolidFillColor(brush:pointer;var color:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetSolidFillColor"; +//---------------------------------------------------------------------------- +// LineBrush APIs +//---------------------------------------------------------------------------- + class Function GdipCreateLineBrush(point1:pointer;point2:pointer;color1:integer;color2:integer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrush"; + class Function GdipCreateLineBrushI(point1:pointer;point2:pointer;color1:integer;color2:integer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrushI"; + class Function GdipCreateLineBrushFromRect(rect:pointer;color1:integer;color2:integer;mode:pointer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrushFromRect"; + class Function GdipCreateLineBrushFromRectI(rect:pointer;color1:integer;color2:integer;mode:pointer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrushFromRectI"; + class Function GdipCreateLineBrushFromRectWithAngle(rect:pointer;color1:integer;color2:integer;angle:single;isAngleScalable:pointer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrushFromRectWithAngle"; + class Function GdipCreateLineBrushFromRectWithAngleI(rect:pointer;color1:integer;color2:integer;angle:single;isAngleScalable:pointer;wrapMode:integer;var lineGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateLineBrushFromRectWithAngleI"; + class Function GdipSetLineColors(brush:pointer;color1:integer;color2:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetLineColors"; + class Function GdipGetLineColors(brush:pointer;var colors:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineColors"; + class Function GdipGetLineRect(brush:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineRect"; + class Function GdipGetLineRectI(brush:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineRectI"; + class Function GdipSetLineGammaCorrection(brush:pointer;useGammaCorrection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetLineGammaCorrection"; + class Function GdipGetLineGammaCorrection(brush:pointer;useGammaCorrection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineGammaCorrection"; + class Function GdipGetLineBlendCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineBlendCount"; + class Function GdipGetLineBlend(brush:pointer;var blend:single;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineBlend"; + class Function GdipSetLineBlend(brush:pointer;var blend:single;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetLineBlend"; + class Function GdipGetLinePresetBlendCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLinePresetBlendCount"; + class Function GdipGetLinePresetBlend(brush:pointer;var blend:integer;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLinePresetBlend"; + class Function GdipSetLinePresetBlend(brush:pointer;var blend:integer;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetLinePresetBlend"; + class Function GdipSetLineSigmaBlend(brush:pointer;focus:single;scale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetLineSigmaBlend"; + class Function GdipSetLineLinearBlend(brush:pointer;focus:single;scale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetLineLinearBlend"; + class Function GdipSetLineWrapMode(brush:pointer;wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetLineWrapMode"; + class Function GdipGetLineWrapMode(brush:pointer;var wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineWrapMode"; + class Function GdipGetLineTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineTransform"; + class Function GdipSetLineTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetLineTransform"; + class Function GdipResetLineTransform(brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetLineTransform"; + class Function GdipMultiplyLineTransform(brush:pointer;matrix:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyLineTransform"; + class Function GdipTranslateLineTransform(brush:pointer;dx:single;dy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateLineTransform"; + class Function GdipScaleLineTransform(brush:pointer;sx:single;sy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScaleLineTransform"; + class Function GdipRotateLineTransform(brush:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotateLineTransform"; +//---------------------------------------------------------------------------- +// PathGradientBrush APIs +//---------------------------------------------------------------------------- + class Function GdipCreatePathGradient(points:pointer;count:integer;wrapMode:integer;var polyGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePathGradient"; + class Function GdipCreatePathGradientI(points:pointer;count:integer;wrapMode:integer;var polyGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePathGradientI"; + class Function GdipCreatePathGradientFromPath(path:pointer;var polyGradient:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePathGradientFromPath"; + class Function GdipGetPathGradientCenterColor(brush:pointer;var colors:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientCenterColor"; + class Function GdipSetPathGradientCenterColor(brush:pointer;colors:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientCenterColor"; + class Function GdipGetPathGradientSurroundColorsWithCount(brush:pointer;var color:integer;count:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientSurroundColorsWithCount"; + class Function GdipSetPathGradientSurroundColorsWithCount(brush:pointer;var color:integer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientSurroundColorsWithCount"; + class Function GdipGetPathGradientPath(brush:pointer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientPath"; + class Function GdipSetPathGradientPath(brush:pointer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientPath"; + class Function GdipGetPathGradientCenterPoint(brush:pointer;points:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientCenterPoint"; + class Function GdipGetPathGradientCenterPointI(brush:pointer;points:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientCenterPointI"; + class Function GdipSetPathGradientCenterPoint(brush:pointer;points:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientCenterPoint"; + class Function GdipSetPathGradientCenterPointI(brush:pointer;points:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientCenterPointI"; + class Function GdipGetPathGradientRect(brush:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientRect"; + class Function GdipGetPathGradientRectI(brush:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientRectI"; + class Function GdipGetPathGradientPointCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientPointCount"; + class Function GdipGetPathGradientSurroundColorCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientSurroundColorCount"; + class Function GdipSetPathGradientGammaCorrection(brush:pointer;useGammaCorrection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientGammaCorrection"; + class Function GdipGetPathGradientGammaCorrection(brush:pointer;useGammaCorrection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientGammaCorrection"; + class Function GdipGetPathGradientBlendCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientBlendCount"; + class Function GdipGetPathGradientBlend(brush:pointer;var blend:single;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientBlend"; + class Function GdipSetPathGradientBlend(brush:pointer;var blend:single;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientBlend"; + class Function GdipGetPathGradientPresetBlendCount(brush:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientPresetBlendCount"; + class Function GdipGetPathGradientPresetBlend(brush:pointer;var blend:integer;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientPresetBlend"; + class Function GdipSetPathGradientPresetBlend(brush:pointer;var blend:integer;var positions:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientPresetBlend"; + class Function GdipSetPathGradientSigmaBlend(brush:pointer;focus:single;scale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientSigmaBlend"; + class Function GdipSetPathGradientLinearBlend(brush:pointer;focus:single;scale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientLinearBlend"; + class Function GdipGetPathGradientWrapMode(brush:pointer;var wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientWrapMode"; + class Function GdipSetPathGradientWrapMode(brush:pointer;wrapmode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientWrapMode"; + class Function GdipGetPathGradientTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientTransform"; + class Function GdipSetPathGradientTransform(brush:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientTransform"; + class Function GdipResetPathGradientTransform(brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetPathGradientTransform"; + class Function GdipMultiplyPathGradientTransform(brush:pointer;matrix:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyPathGradientTransform"; + class Function GdipTranslatePathGradientTransform(brush:pointer;dx:single;dy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslatePathGradientTransform"; + class Function GdipScalePathGradientTransform(brush:pointer;sx:single;sy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScalePathGradientTransform"; + class Function GdipRotatePathGradientTransform(brush:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotatePathGradientTransform"; + class Function GdipGetPathGradientFocusScales(brush:pointer;var xScale:single;var yScale:single):integer;stdcall;external "gdiplus.dll" name "GdipGetPathGradientFocusScales"; + class Function GdipSetPathGradientFocusScales(brush:pointer;xScale:single;yScale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPathGradientFocusScales"; +//---------------------------------------------------------------------------- +// Pen APIs +//---------------------------------------------------------------------------- + class Function GdipCreatePen1(color:integer;width:single;unit_:pointer;var pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePen1"; + class Function GdipCreatePen2(brush:pointer;width:single;unit_:pointer;var pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreatePen2"; + class Function GdipClonePen(pen:pointer;var clonepen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipClonePen"; + class Function GdipDeletePen(pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeletePen"; + class Function GdipSetPenWidth(pen:pointer;width:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPenWidth"; + class Function GdipGetPenWidth(pen:pointer;var width:single):integer;stdcall;external "gdiplus.dll" name "GdipGetPenWidth"; + class Function GdipSetPenUnit(pen:pointer;unit_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenUnit"; + class Function GdipGetPenUnit(pen:pointer;unit_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenUnit"; + class Function GdipSetPenLineCap197819(pen:pointer;startCap:pointer;endCap:pointer;dashCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenLineCap197819"; + class Function GdipSetPenStartCap(pen:pointer;startCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenStartCap"; + class Function GdipSetPenEndCap(pen:pointer;endCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenEndCap"; + class Function GdipSetPenDashCap197819(pen:pointer;dashCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenDashCap197819"; + class Function GdipGetPenStartCap(pen:pointer;startCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenStartCap"; + class Function GdipGetPenEndCap(pen:pointer;endCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenEndCap"; + class Function GdipGetPenDashCap197819(pen:pointer;dashCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenDashCap197819"; + class Function GdipSetPenLineJoin(pen:pointer;lineJoin:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenLineJoin"; + class Function GdipGetPenLineJoin(pen:pointer;lineJoin:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenLineJoin"; + class Function GdipSetPenCustomStartCap(pen:pointer;customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenCustomStartCap"; + class Function GdipGetPenCustomStartCap(pen:pointer;var customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenCustomStartCap"; + class Function GdipSetPenCustomEndCap(pen:pointer;customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenCustomEndCap"; + class Function GdipGetPenCustomEndCap(pen:pointer;var customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenCustomEndCap"; + class Function GdipSetPenMiterLimit(pen:pointer;miterLimit:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPenMiterLimit"; + class Function GdipGetPenMiterLimit(pen:pointer;var miterLimit:single):integer;stdcall;external "gdiplus.dll" name "GdipGetPenMiterLimit"; + class Function GdipSetPenMode(pen:pointer;penMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenMode"; + class Function GdipGetPenMode(pen:pointer;penMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenMode"; + class Function GdipSetPenTransform(pen:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenTransform"; + class Function GdipGetPenTransform(pen:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenTransform"; + class Function GdipResetPenTransform(pen:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetPenTransform"; + class Function GdipMultiplyPenTransform(pen:pointer;matrix:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyPenTransform"; + class Function GdipTranslatePenTransform(pen:pointer;dx:single;dy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslatePenTransform"; + class Function GdipScalePenTransform(pen:pointer;sx:single;sy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScalePenTransform"; + class Function GdipRotatePenTransform(pen:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotatePenTransform"; + class Function GdipSetPenColor(pen:pointer;argb:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenColor"; + class Function GdipGetPenColor(pen:pointer;var argb:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenColor"; + class Function GdipSetPenBrushFill(pen:pointer;brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenBrushFill"; + class Function GdipGetPenBrushFill(pen:pointer;var brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenBrushFill"; + class Function GdipGetPenFillType(pen:pointer;type:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenFillType"; + class Function GdipGetPenDashStyle(pen:pointer;dashstyle:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenDashStyle"; + class Function GdipSetPenDashStyle(pen:pointer;dashstyle:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenDashStyle"; + class Function GdipGetPenDashOffset(pen:pointer;var offset:single):integer;stdcall;external "gdiplus.dll" name "GdipGetPenDashOffset"; + class Function GdipSetPenDashOffset(pen:pointer;offset:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPenDashOffset"; + class Function GdipGetPenDashCount(pen:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenDashCount"; + class Function GdipSetPenDashArray(pen:pointer;var dash:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenDashArray"; + class Function GdipGetPenDashArray(pen:pointer;var dash:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenDashArray"; + class Function GdipGetPenCompoundCount(pen:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenCompoundCount"; + class Function GdipSetPenCompoundArray(pen:pointer;var dash:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetPenCompoundArray"; + class Function GdipGetPenCompoundArray(pen:pointer;var dash:single;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPenCompoundArray"; +//---------------------------------------------------------------------------- +// CustomLineCap APIs +//---------------------------------------------------------------------------- + class Function GdipCreateCustomLineCap(fillPath:pointer;strokePath:pointer;baseCap:pointer;baseInset:single;var customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateCustomLineCap"; + class Function GdipDeleteCustomLineCap(customCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteCustomLineCap"; + class Function GdipCloneCustomLineCap(customCap:pointer;var clonedCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneCustomLineCap"; + class Function GdipGetCustomLineCapType(customCap:pointer;capType:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapType"; + class Function GdipSetCustomLineCapStrokeCaps(customCap:pointer;startCap:pointer;endCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetCustomLineCapStrokeCaps"; + class Function GdipGetCustomLineCapStrokeCaps(customCap:pointer;startCap:pointer;endCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapStrokeCaps"; + class Function GdipSetCustomLineCapStrokeJoin(customCap:pointer;lineJoin:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetCustomLineCapStrokeJoin"; + class Function GdipGetCustomLineCapStrokeJoin(customCap:pointer;lineJoin:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapStrokeJoin"; + class Function GdipSetCustomLineCapBaseCap(customCap:pointer;baseCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetCustomLineCapBaseCap"; + class Function GdipGetCustomLineCapBaseCap(customCap:pointer;baseCap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapBaseCap"; + class Function GdipSetCustomLineCapBaseInset(customCap:pointer;inset:single):integer;stdcall;external "gdiplus.dll" name "GdipSetCustomLineCapBaseInset"; + class Function GdipGetCustomLineCapBaseInset(customCap:pointer;var inset:single):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapBaseInset"; + class Function GdipSetCustomLineCapWidthScale(customCap:pointer;widthScale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetCustomLineCapWidthScale"; + class Function GdipGetCustomLineCapWidthScale(customCap:pointer;var widthScale:single):integer;stdcall;external "gdiplus.dll" name "GdipGetCustomLineCapWidthScale"; +//---------------------------------------------------------------------------- +// AdjustableArrowCap APIs +//---------------------------------------------------------------------------- + class Function GdipCreateAdjustableArrowCap(height:single;width:single;isFilled:pointer;var cap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateAdjustableArrowCap"; + class Function GdipSetAdjustableArrowCapHeight(cap:pointer;height:single):integer;stdcall;external "gdiplus.dll" name "GdipSetAdjustableArrowCapHeight"; + class Function GdipGetAdjustableArrowCapHeight(cap:pointer;var height:single):integer;stdcall;external "gdiplus.dll" name "GdipGetAdjustableArrowCapHeight"; + class Function GdipSetAdjustableArrowCapWidth(cap:pointer;width:single):integer;stdcall;external "gdiplus.dll" name "GdipSetAdjustableArrowCapWidth"; + class Function GdipGetAdjustableArrowCapWidth(cap:pointer;var width:single):integer;stdcall;external "gdiplus.dll" name "GdipGetAdjustableArrowCapWidth"; + class Function GdipSetAdjustableArrowCapMiddleInset(cap:pointer;middleInset:single):integer;stdcall;external "gdiplus.dll" name "GdipSetAdjustableArrowCapMiddleInset"; + class Function GdipGetAdjustableArrowCapMiddleInset(cap:pointer;var middleInset:single):integer;stdcall;external "gdiplus.dll" name "GdipGetAdjustableArrowCapMiddleInset"; + class Function GdipSetAdjustableArrowCapFillState(cap:pointer;fillState:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetAdjustableArrowCapFillState"; + class Function GdipGetAdjustableArrowCapFillState(cap:pointer;fillState:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetAdjustableArrowCapFillState"; +//---------------------------------------------------------------------------- +// Image APIs +//---------------------------------------------------------------------------- + class Function GdipLoadImageFromStream(stream:pointer;var image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipLoadImageFromStream"; + class Function GdipLoadImageFromFile(filename:string;var image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipLoadImageFromFile"; + class Function GdipLoadImageFromStreamICM(stream:pointer;var image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipLoadImageFromStreamICM"; + class Function GdipLoadImageFromFileICM(filename:string;var image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipLoadImageFromFileICM"; + class Function GdipCloneImage(image:pointer;var cloneImage:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneImage"; + class Function GdipDisposeImage(image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDisposeImage"; + class Function GdipSaveImageToFile(image:pointer;filename:string;clsidEncoder:pointer;encoderParams:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSaveImageToFile"; + class Function GdipSaveImageToStream(image:pointer;stream:pointer;clsidEncoder:pointer;encoderParams:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSaveImageToStream"; + class Function GdipSaveAdd(image:pointer;encoderParams:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSaveAdd"; + class Function GdipSaveAddImage(image:pointer;newImage:pointer;encoderParams:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSaveAddImage"; + class Function GdipGetImageGraphicsContext(image:pointer;var graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageGraphicsContext"; + class Function GdipGetImageBounds(image:pointer;srcRect:pointer;srcUnit:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageBounds"; + class Function GdipGetImageDimension(image:pointer;var width:single;var height:single):integer;stdcall;external "gdiplus.dll" name "GdipGetImageDimension"; + class Function GdipGetImageType(image:pointer;type:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageType"; + class Function GdipGetImageWidth(image:pointer;var width:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageWidth"; + class Function GdipGetImageHeight(image:pointer;var height:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageHeight"; + class Function GdipGetImageHorizontalResolution(image:pointer;var resolution:single):integer;stdcall;external "gdiplus.dll" name "GdipGetImageHorizontalResolution"; + class Function GdipGetImageVerticalResolution(image:pointer;var resolution:single):integer;stdcall;external "gdiplus.dll" name "GdipGetImageVerticalResolution"; + class Function GdipGetImageFlags(image:pointer;var flags:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageFlags"; + class Function GdipGetImageRawFormat(image:pointer;format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageRawFormat"; + class Function GdipGetImagePixelFormat(image:pointer;format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImagePixelFormat"; + class Function GdipGetImageThumbnail(image:pointer;thumbWidth:integer;thumbHeight:integer;var thumbImage:pointer;callback:pointer;callbackData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageThumbnail"; + class Function GdipGetEncoderParameterListSize(image:pointer;clsidEncoder:pointer;var size:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetEncoderParameterListSize"; + class Function GdipGetEncoderParameterList(image:pointer;clsidEncoder:pointer;size:integer;buffer:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetEncoderParameterList"; + class Function GdipImageGetFrameDimensionsCount(image:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipImageGetFrameDimensionsCount"; + class Function GdipImageGetFrameDimensionsList(image:pointer;dimensionIDs:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipImageGetFrameDimensionsList"; + class Function GdipImageGetFrameCount(image:pointer;dimensionID:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipImageGetFrameCount"; + class Function GdipImageSelectActiveFrame(image:pointer;dimensionID:pointer;frameIndex:integer):integer;stdcall;external "gdiplus.dll" name "GdipImageSelectActiveFrame"; + class Function GdipImageRotateFlip(image:pointer;rfType:pointer):integer;stdcall;external "gdiplus.dll" name "GdipImageRotateFlip"; + class Function GdipGetImagePalette(image:pointer;palette:pointer;size:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetImagePalette"; + class Function GdipSetImagePalette(image:pointer;palette:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImagePalette"; + class Function GdipGetImagePaletteSize(image:pointer;var size:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetImagePaletteSize"; + class Function GdipGetPropertyCount(image:pointer;var numOfProperty:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPropertyCount"; + class Function GdipGetPropertyIdList(image:pointer;numOfProperty:integer;list:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPropertyIdList"; + class Function GdipGetPropertyItemSize(image:pointer;propId:pointer;var size:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPropertyItemSize"; + class Function GdipGetPropertyItem(image:pointer;propId:pointer;propSize:integer;buffer:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPropertyItem"; + class Function GdipGetPropertySize(image:pointer;var totalBufferSize:integer;var numProperties:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetPropertySize"; + class Function GdipGetAllPropertyItems(image:pointer;totalBufferSize:integer;numProperties:integer;allItems:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetAllPropertyItems"; + class Function GdipRemovePropertyItem(image:pointer;propId:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRemovePropertyItem"; + class Function GdipSetPropertyItem(image:pointer;item:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPropertyItem"; + class Function GdipImageForceValidation(image:pointer):integer;stdcall;external "gdiplus.dll" name "GdipImageForceValidation"; +//---------------------------------------------------------------------------- +// Bitmap APIs +//---------------------------------------------------------------------------- + class Function GdipCreateBitmapFromStream(stream:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromStream"; + class Function GdipCreateBitmapFromFile(filename:string;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromFile"; + class Function GdipCreateBitmapFromStreamICM(stream:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromStreamICM"; + class Function GdipCreateBitmapFromFileICM(filename:string;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromFileICM"; + class Function GdipCreateBitmapFromScan0(width:integer;height:integer;stride:integer;format:pointer;):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromScan0"; + class Function GdipCreateBitmapFromGraphics(width:integer;height:integer;target:pointer;var bitmap:pointer):pointer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromGraphics"; + class Function GdipCreateBitmapFromDirectDrawSurface(surface:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromDirectDrawSurface"; + class Function GdipCreateBitmapFromGdiDib(gdiBitmapInfo:pointer;gdiBitmapData:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromGdiDib"; + class Function GdipCreateBitmapFromHBITMAP(hbm:pointer;hpal:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromHBITMAP"; + class Function GdipCreateHBITMAPFromBitmap(bitmap:pointer;var hbmReturn:pointer;background:integer):integer;stdcall;external "gdiplus.dll" name "GdipCreateHBITMAPFromBitmap"; + class Function GdipCreateBitmapFromHICON(hicon:pointer;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromHICON"; + class Function GdipCreateHICONFromBitmap(bitmap:pointer;var hbmReturn:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateHICONFromBitmap"; + class Function GdipCreateBitmapFromResource(hInstance:pointer;lpBitmapName:string;var bitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateBitmapFromResource"; + class Function GdipCloneBitmapArea(x:single;y:single;width:single;height:single;format:pointer;srcBitmap:pointer;var dstBitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneBitmapArea"; + class Function GdipCloneBitmapAreaI(x:integer;y:integer;width:integer;height:integer;format:pointer;srcBitmap:pointer;var dstBitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneBitmapAreaI"; + class Function GdipBitmapLockBits(bitmap:pointer;rect:pointer;flags:integer;format:pointer;lockedBitmapData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipBitmapLockBits"; + class Function GdipBitmapUnlockBits(bitmap:pointer;lockedBitmapData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipBitmapUnlockBits"; + class Function GdipBitmapGetPixel(bitmap:pointer;x:integer;y:integer;var color:integer):integer;stdcall;external "gdiplus.dll" name "GdipBitmapGetPixel"; + class Function GdipBitmapSetPixel(bitmap:pointer;x:integer;y:integer;color:integer):integer;stdcall;external "gdiplus.dll" name "GdipBitmapSetPixel"; + class Function GdipBitmapSetResolution(bitmap:pointer;xdpi:single;ydpi:single):integer;stdcall;external "gdiplus.dll" name "GdipBitmapSetResolution"; +//---------------------------------------------------------------------------- +// ImageAttributes APIs +//---------------------------------------------------------------------------- + class Function GdipCreateImageAttributes(var imageattr:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateImageAttributes"; + class Function GdipCloneImageAttributes(imageattr:pointer;var cloneImageattr:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneImageAttributes"; + class Function GdipDisposeImageAttributes(imageattr:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDisposeImageAttributes"; + class Function GdipSetImageAttributesToIdentity(imageattr:pointer;type:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesToIdentity"; + class Function GdipResetImageAttributes(imageattr:pointer;type:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetImageAttributes"; + class Function GdipSetImageAttributesColorMatrix(imageattr:pointer;type:pointer;enableFlag:pointer;colorMatrix:pointer;grayMatrix:pointer;flags:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesColorMatrix"; + class Function GdipSetImageAttributesThreshold(imageattr:pointer;type:pointer;enableFlag:pointer;threshold:single):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesThreshold"; + class Function GdipSetImageAttributesGamma(imageattr:pointer;type:pointer;enableFlag:pointer;gamma:single):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesGamma"; + class Function GdipSetImageAttributesNoOp(imageattr:pointer;type:pointer;enableFlag:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesNoOp"; + class Function GdipSetImageAttributesColorKeys(imageattr:pointer;type:pointer;enableFlag:pointer;colorLow:integer;colorHigh:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesColorKeys"; + class Function GdipSetImageAttributesOutputChannel(imageattr:pointer;type:pointer;enableFlag:pointer;channelFlags:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesOutputChannel"; + class Function GdipSetImageAttributesOutputChannelColorProfile(imageattr:pointer;type:pointer;enableFlag:pointer;colorProfileFilename:string):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesOutputChannelColorProfile"; + class Function GdipSetImageAttributesRemapTable(imageattr:pointer;type:pointer;enableFlag:pointer;mapSize:integer;map:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesRemapTable"; + class Function GdipSetImageAttributesWrapMode(imageAttr:pointer;wrap:pointer;argb:integer;clamp:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesWrapMode"; + class Function GdipSetImageAttributesICMMode(imageAttr:pointer;on_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesICMMode"; + class Function GdipGetImageAttributesAdjustedPalette(imageAttr:pointer;colorPalette:pointer;colorAdjustType:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageAttributesAdjustedPalette"; +//---------------------------------------------------------------------------- +// Graphics APIs +//---------------------------------------------------------------------------- + class Function GdipFlush(graphics:pointer;intention:pointer):integer;stdcall;external "gdiplus.dll" name "GdipFlush"; + class Function GdipCreateFromHDC(hdc:pointer;var graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFromHDC"; + class Function GdipCreateFromHDC2(hdc:pointer;hDevice:pointer;var graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFromHDC2"; + class Function GdipCreateFromHWND(hwnd:pointer;var graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFromHWND"; + class Function GdipCreateFromHWNDICM(hwnd:pointer;var graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFromHWNDICM"; + class Function GdipDeleteGraphics(graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteGraphics"; + class Function GdipGetDC(graphics:pointer;hdc:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetDC"; + class Function GdipReleaseDC(graphics:pointer;hdc:pointer):integer;stdcall;external "gdiplus.dll" name "GdipReleaseDC"; + class Function GdipSetCompositingMode(graphics:pointer;compositingMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetCompositingMode"; + class Function GdipGetCompositingMode(graphics:pointer;compositingMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCompositingMode"; + class Function GdipSetRenderingOrigin(graphics:pointer;x:integer;y:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetRenderingOrigin"; + class Function GdipGetRenderingOrigin(graphics:pointer;var x:integer;var y:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetRenderingOrigin"; + class Function GdipSetCompositingQuality(graphics:pointer;compositingQuality:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetCompositingQuality"; + class Function GdipGetCompositingQuality(graphics:pointer;compositingQuality:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCompositingQuality"; + class Function GdipSetSmoothingMode(graphics:pointer;smoothingMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetSmoothingMode"; + class Function GdipGetSmoothingMode(graphics:pointer;var smoothingMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetSmoothingMode"; + class Function GdipSetPixelOffsetMode(graphics:pointer;pixelOffsetMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPixelOffsetMode"; + class Function GdipGetPixelOffsetMode(graphics:pointer;pixelOffsetMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPixelOffsetMode"; + class Function GdipSetTextRenderingHint(graphics:pointer;mode:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetTextRenderingHint"; + class Function GdipGetTextRenderingHint(graphics:pointer;var mode:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetTextRenderingHint"; + class Function GdipSetTextContrast(graphics:pointer;contrast:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetTextContrast"; + class Function GdipGetTextContrast(graphics:pointer;var contrast:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetTextContrast"; + class Function GdipSetInterpolationMode(graphics:pointer;interpolationMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetInterpolationMode"; + class Function GdipGetInterpolationMode(graphics:pointer;interpolationMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetInterpolationMode"; + class Function GdipSetWorldTransform(graphics:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetWorldTransform"; + class Function GdipResetWorldTransform(graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetWorldTransform"; + class Function GdipMultiplyWorldTransform(graphics:pointer;matrix:pointer;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMultiplyWorldTransform"; + class Function GdipTranslateWorldTransform(graphics:pointer;dx:single;dy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateWorldTransform"; + class Function GdipScaleWorldTransform(graphics:pointer;sx:single;sy:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipScaleWorldTransform"; + class Function GdipRotateWorldTransform(graphics:pointer;angle:single;order_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRotateWorldTransform"; + class Function GdipGetWorldTransform(graphics:pointer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetWorldTransform"; + class Function GdipResetPageTransform(graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetPageTransform"; + class Function GdipGetPageUnit(graphics:pointer;unit_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetPageUnit"; + class Function GdipGetPageScale(graphics:pointer;var scale:single):integer;stdcall;external "gdiplus.dll" name "GdipGetPageScale"; + class Function GdipSetPageUnit(graphics:pointer;unit_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetPageUnit"; + class Function GdipSetPageScale(graphics:pointer;scale:single):integer;stdcall;external "gdiplus.dll" name "GdipSetPageScale"; + class Function GdipGetDpiX(graphics:pointer;var dpi:single):integer;stdcall;external "gdiplus.dll" name "GdipGetDpiX"; + class Function GdipGetDpiY(graphics:pointer;var dpi:single):integer;stdcall;external "gdiplus.dll" name "GdipGetDpiY"; + class Function GdipTransformPoints(graphics:pointer;destSpace:pointer;srcSpace:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipTransformPoints"; + class Function GdipTransformPointsI(graphics:pointer;destSpace:pointer;srcSpace:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipTransformPointsI"; + class Function GdipGetNearestColor(graphics:pointer;var argb:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetNearestColor"; +// Creates the Win9x Halftone Palette (even on NT) with correct Desktop colors + class Function GdipCreateHalftonePalette():pointer;stdcall;external "gdiplus.dll" name "GdipCreateHalftonePalette"; + class Function GdipDrawLine(graphics:pointer;pen:pointer;x1:single;y1:single;x2:single;y2:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawLine"; + class Function GdipDrawLineI(graphics:pointer;pen:pointer;x1:integer;y1:integer;x2:integer;y2:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawLineI"; + class Function GdipDrawLines(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawLines"; + class Function GdipDrawLinesI(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawLinesI"; + class Function GdipDrawArc(graphics:pointer;pen:pointer;x:single;y:single;width:single;height:single;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawArc"; + class Function GdipDrawArcI(graphics:pointer;pen:pointer;x:integer;y:integer;width:integer;height:integer;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawArcI"; + class Function GdipDrawBezier(graphics:pointer;pen:pointer;x1:single;y1:single;x2:single;y2:single;x3:single;y3:single;x4:single;y4:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawBezier"; + class Function GdipDrawBezierI(graphics:pointer;pen:pointer;x1:integer;y1:integer;x2:integer;y2:integer;x3:integer;y3:integer;x4:integer;y4:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawBezierI"; + class Function GdipDrawBeziers(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawBeziers"; + class Function GdipDrawBeziersI(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawBeziersI"; + class Function GdipDrawRectangle(graphics:pointer;pen:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawRectangle"; + class Function GdipDrawRectangleI(graphics:pointer;pen:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawRectangleI"; + class Function GdipDrawRectangles(graphics:pointer;pen:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawRectangles"; + class Function GdipDrawRectanglesI(graphics:pointer;pen:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawRectanglesI"; + class Function GdipDrawEllipse(graphics:pointer;pen:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawEllipse"; + class Function GdipDrawEllipseI(graphics:pointer;pen:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawEllipseI"; + class Function GdipDrawPie(graphics:pointer;pen:pointer;x:single;y:single;width:single;height:single;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawPie"; + class Function GdipDrawPieI(graphics:pointer;pen:pointer;x:integer;y:integer;width:integer;height:integer;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawPieI"; + class Function GdipDrawPolygon(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawPolygon"; + class Function GdipDrawPolygonI(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawPolygonI"; + class Function GdipDrawPath(graphics:pointer;pen:pointer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawPath"; + class Function GdipDrawCurve(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurve"; + class Function GdipDrawCurveI(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurveI"; + class Function GdipDrawCurve2(graphics:pointer;pen:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurve2"; + class Function GdipDrawCurve2I(graphics:pointer;pen:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurve2I"; + class Function GdipDrawCurve3(graphics:pointer;pen:pointer;points:pointer;count:integer;offset:integer;numberOfSegments:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurve3"; + class Function GdipDrawCurve3I(graphics:pointer;pen:pointer;points:pointer;count:integer;offset:integer;numberOfSegments:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawCurve3I"; + class Function GdipDrawClosedCurve(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawClosedCurve"; + class Function GdipDrawClosedCurveI(graphics:pointer;pen:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawClosedCurveI"; + class Function GdipDrawClosedCurve2(graphics:pointer;pen:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawClosedCurve2"; + class Function GdipDrawClosedCurve2I(graphics:pointer;pen:pointer;points:pointer;count:integer;tension:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawClosedCurve2I"; + class Function GdipGraphicsClear(graphics:pointer;color:integer):integer;stdcall;external "gdiplus.dll" name "GdipGraphicsClear"; + class Function GdipFillRectangle(graphics:pointer;brush:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipFillRectangle"; + class Function GdipFillRectangleI(graphics:pointer;brush:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillRectangleI"; + class Function GdipFillRectangles(graphics:pointer;brush:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillRectangles"; + class Function GdipFillRectanglesI(graphics:pointer;brush:pointer;rects:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillRectanglesI"; + class Function GdipFillPolygon(graphics:pointer;brush:pointer;points:pointer;count:integer;fillMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillPolygon"; + class Function GdipFillPolygonI(graphics:pointer;brush:pointer;points:pointer;count:integer;fillMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillPolygonI"; + class Function GdipFillPolygon2(graphics:pointer;brush:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillPolygon2"; + class Function GdipFillPolygon2I(graphics:pointer;brush:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillPolygon2I"; + class Function GdipFillEllipse(graphics:pointer;brush:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipFillEllipse"; + class Function GdipFillEllipseI(graphics:pointer;brush:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillEllipseI"; + class Function GdipFillPie(graphics:pointer;brush:pointer;x:single;y:single;width:single;height:single;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipFillPie"; + class Function GdipFillPieI(graphics:pointer;brush:pointer;x:integer;y:integer;width:integer;height:integer;startAngle:single;sweepAngle:single):integer;stdcall;external "gdiplus.dll" name "GdipFillPieI"; + class Function GdipFillPath(graphics:pointer;brush:pointer;path:pointer):integer;stdcall;external "gdiplus.dll" name "GdipFillPath"; + class Function GdipFillClosedCurve(graphics:pointer;brush:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillClosedCurve"; + class Function GdipFillClosedCurveI(graphics:pointer;brush:pointer;points:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillClosedCurveI"; + class Function GdipFillClosedCurve2(graphics:pointer;brush:pointer;points:pointer;count:integer;tension:single;fillMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillClosedCurve2"; + class Function GdipFillClosedCurve2I(graphics:pointer;brush:pointer;points:pointer;count:integer;tension:single;fillMode:integer):integer;stdcall;external "gdiplus.dll" name "GdipFillClosedCurve2I"; + class Function GdipFillRegion(graphics:pointer;brush:pointer;region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipFillRegion"; + class Function GdipDrawImage(graphics:pointer;image:pointer;x:single;y:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawImage"; + class Function GdipDrawImageI(graphics:pointer;image:pointer;x:integer;y:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImageI"; + class Function GdipDrawImageRect(graphics:pointer;image:pointer;x:single;y:single;width:single;height:single):integer;stdcall;external "gdiplus.dll" name "GdipDrawImageRect"; + class Function GdipDrawImageRectI(graphics:pointer;image:pointer;x:integer;y:integer;width:integer;height:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImageRectI"; + class Function GdipDrawImagePoints(graphics:pointer;image:pointer;dstpoints:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePoints"; + class Function GdipDrawImagePointsI(graphics:pointer;image:pointer;dstpoints:pointer;count:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePointsI"; + class Function GdipDrawImagePointRect(graphics:pointer;image:pointer;x:single;y:single;srcx:single;srcy:single;srcwidth:single;srcheight:single;srcUnit:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePointRect"; + class Function GdipDrawImagePointRectI(graphics:pointer;image:pointer;x:integer;y:integer;srcx:integer;srcy:integer;srcwidth:integer;srcheight:integer;srcUnit:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePointRectI"; + class Function GdipDrawImageRectRect(graphics:pointer;image:pointer;dstx:single;dsty:single;dstwidth:single;dstheight:single;srcx:single;srcy:single;srcwidth:single;srcheight:single;srcUnit:pointer;imageAttributes:pointer;callback:pointer;callbackData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImageRectRect"; + class Function GdipDrawImageRectRectI(graphics:pointer;image:pointer;dstx:integer;dsty:integer;dstwidth:integer;dstheight:integer;srcx:integer;srcy:integer;srcwidth:integer;srcheight:integer;srcUnit:pointer;imageAttributes:pointer;callback:pointer;callbackData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImageRectRectI"; + class Function GdipDrawImagePointsRect(graphics:pointer;image:pointer;points:pointer;count:integer;srcx:single;srcy:single;srcwidth:single;srcheight:single;srcUnit:pointer;imageAttributes:pointer;callback:pointer;callbackData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePointsRect"; + class Function GdipDrawImagePointsRectI(graphics:pointer;image:pointer;points:pointer;count:integer;srcx:integer;srcy:integer;srcwidth:integer;srcheight:integer;srcUnit:pointer;imageAttributes:pointer;callback:pointer;callbackData:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawImagePointsRectI"; + class Function GdipEnumerateMetafileDestPoint(graphics:pointer;metafile:pointer;destPoint:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestPoint"; + class Function GdipEnumerateMetafileDestPointI(graphics:pointer;metafile:pointer;destPoint:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestPointI"; + class Function GdipEnumerateMetafileDestRect(graphics:pointer;metafile:pointer;destRect:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestRect"; + class Function GdipEnumerateMetafileDestRectI(graphics:pointer;metafile:pointer;destRect:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestRectI"; + class Function GdipEnumerateMetafileDestPoints(graphics:pointer;metafile:pointer;destPoints:pointer;count:integer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestPoints"; + class Function GdipEnumerateMetafileDestPointsI(graphics:pointer;metafile:pointer;destPoints:pointer;count:integer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileDestPointsI"; + class Function GdipEnumerateMetafileSrcRectDestPoint(graphics:pointer;metafile:pointer;destPoint:pointer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestPoint"; + class Function GdipEnumerateMetafileSrcRectDestPointI(graphics:pointer;metafile:pointer;destPoint:pointer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestPointI"; + class Function GdipEnumerateMetafileSrcRectDestRect(graphics:pointer;metafile:pointer;destRect:pointer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestRect"; + class Function GdipEnumerateMetafileSrcRectDestRectI(graphics:pointer;metafile:pointer;destRect:pointer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestRectI"; + class Function GdipEnumerateMetafileSrcRectDestPoints(graphics:pointer;metafile:pointer;destPoints:pointer;count:integer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestPoints"; + class Function GdipEnumerateMetafileSrcRectDestPointsI(graphics:pointer;metafile:pointer;destPoints:pointer;count:integer;srcRect:pointer;srcUnit:pointer;callback:pointer;callbackData:pointer;imageAttributes:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEnumerateMetafileSrcRectDestPointsI"; + class Function GdipPlayMetafileRecord(metafile:pointer;recordType:pointer;flags:integer;dataSize:integer;data:pointer):integer;stdcall;external "gdiplus.dll" name "GdipPlayMetafileRecord"; + class Function GdipSetClipGraphics(graphics:pointer;srcgraphics:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipGraphics"; + class Function GdipSetClipRect(graphics:pointer;x:single;y:single;width:single;height:single;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipRect"; + class Function GdipSetClipRectI(graphics:pointer;x:integer;y:integer;width:integer;height:integer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipRectI"; + class Function GdipSetClipPath(graphics:pointer;path:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipPath"; + class Function GdipSetClipRegion(graphics:pointer;region:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipRegion"; + class Function GdipSetClipHrgn(graphics:pointer;hRgn:pointer;combineMode:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetClipHrgn"; + class Function GdipResetClip(graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipResetClip"; + class Function GdipTranslateClip(graphics:pointer;dx:single;dy:single):integer;stdcall;external "gdiplus.dll" name "GdipTranslateClip"; + class Function GdipTranslateClipI(graphics:pointer;dx:integer;dy:integer):integer;stdcall;external "gdiplus.dll" name "GdipTranslateClipI"; + class Function GdipGetClip(graphics:pointer;region:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetClip"; + class Function GdipGetClipBounds(graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetClipBounds"; + class Function GdipGetClipBoundsI(graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetClipBoundsI"; + class Function GdipIsClipEmpty(graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsClipEmpty"; + class Function GdipGetVisibleClipBounds(graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetVisibleClipBounds"; + class Function GdipGetVisibleClipBoundsI(graphics:pointer;rect:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetVisibleClipBoundsI"; + class Function GdipIsVisibleClipEmpty(graphics:pointer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleClipEmpty"; + class Function GdipIsVisiblePoint(graphics:pointer;x:single;y:single;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisiblePoint"; + class Function GdipIsVisiblePointI(graphics:pointer;x:integer;y:integer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisiblePointI"; + class Function GdipIsVisibleRect(graphics:pointer;x:single;y:single;width:single;height:single;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRect"; + class Function GdipIsVisibleRectI(graphics:pointer;x:integer;y:integer;width:integer;height:integer;result:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsVisibleRectI"; + class Function GdipSaveGraphics(graphics:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSaveGraphics"; + class Function GdipRestoreGraphics(graphics:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRestoreGraphics"; + class Function GdipBeginContainer(graphics:pointer;dstrect:pointer;srcrect:pointer;unit_:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipBeginContainer"; + class Function GdipBeginContainerI(graphics:pointer;dstrect:pointer;srcrect:pointer;unit_:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipBeginContainerI"; + class Function GdipBeginContainer2(graphics:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipBeginContainer2"; + class Function GdipEndContainer(graphics:pointer;state:pointer):integer;stdcall;external "gdiplus.dll" name "GdipEndContainer"; + class Function GdipGetMetafileHeaderFromWmf(hWmf:pointer;wmfPlaceableFileHeader:pointer;header:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileHeaderFromWmf"; + class Function GdipGetMetafileHeaderFromEmf(hEmf:pointer;header:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileHeaderFromEmf"; + class Function GdipGetMetafileHeaderFromFile(filename:string;header:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileHeaderFromFile"; + class Function GdipGetMetafileHeaderFromStream(stream:pointer;header:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileHeaderFromStream"; + class Function GdipGetMetafileHeaderFromMetafile(metafile:pointer;header:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileHeaderFromMetafile"; + class Function GdipGetHemfFromMetafile(metafile:pointer;hEmf:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetHemfFromMetafile"; + class Function GdipCreateStreamOnFile(filename:string;access:integer;var stream:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateStreamOnFile"; + class Function GdipCreateMetafileFromWmf(hWmf:pointer;deleteWmf:pointer;wmfPlaceableFileHeader:pointer;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMetafileFromWmf"; + class Function GdipCreateMetafileFromEmf(hEmf:pointer;deleteEmf:pointer;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMetafileFromEmf"; + class Function GdipCreateMetafileFromFile(file:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMetafileFromFile"; + class Function GdipCreateMetafileFromWmfFile(file:string;wmfPlaceableFileHeader:pointer;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMetafileFromWmfFile"; + class Function GdipCreateMetafileFromStream(stream:pointer;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateMetafileFromStream"; + class Function GdipRecordMetafile(referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafile"; + class Function GdipRecordMetafileI(referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafileI"; + class Function GdipRecordMetafileFileName(fileName:string;referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafileFileName"; + class Function GdipRecordMetafileFileNameI(fileName:string;referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafileFileNameI"; + class Function GdipRecordMetafileStream(stream:pointer;referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafileStream"; + class Function GdipRecordMetafileStreamI(stream:pointer;referenceHdc:pointer;type:pointer;frameRect:pointer;frameUnit:pointer;description:string;var metafile:pointer):integer;stdcall;external "gdiplus.dll" name "GdipRecordMetafileStreamI"; + class Function GdipSetMetafileDownLevelRasterizationLimit(metafile:pointer;metafileRasterizationLimitDpi:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetMetafileDownLevelRasterizationLimit"; + class Function GdipGetMetafileDownLevelRasterizationLimit(metafile:pointer;var metafileRasterizationLimitDpi:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetMetafileDownLevelRasterizationLimit"; + class Function GdipGetImageDecodersSize(var numDecoders:integer;pn4:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageDecodersSize"; + class Function GdipGetImageDecoders(numDecoders:integer;size:integer;decoders:pointer):pointer;stdcall;external "gdiplus.dll" name "GdipGetImageDecoders"; + class Function GdipGetImageEncodersSize(var numEncoders:integer;pn4:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetImageEncodersSize"; + class Function GdipGetImageEncoders(numEncoders:integer;size:integer;encoders:pointer):pointer;stdcall;external "gdiplus.dll" name "GdipGetImageEncoders"; + class Function GdipComment(graphics:pointer;sizeData:integer;data:pointer):integer;stdcall;external "gdiplus.dll" name "GdipComment"; +//---------------------------------------------------------------------------- +// FontFamily APIs +//---------------------------------------------------------------------------- + class Function GdipCreateFontFamilyFromName(name:string;fontCollection:pointer;var fontFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFontFamilyFromName"; + class Function GdipDeleteFontFamily(fontFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteFontFamily"; + class Function GdipCloneFontFamily(fontFamily:pointer;var clonedFontFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneFontFamily"; + class Function GdipGetGenericFontFamilySansSerif(var nativeFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetGenericFontFamilySansSerif"; + class Function GdipGetGenericFontFamilySerif(var nativeFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetGenericFontFamilySerif"; + class Function GdipGetGenericFontFamilyMonospace(var nativeFamily:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetGenericFontFamilyMonospace"; + class Function GdipGetFamilyName(family:pointer;name:pointer;language:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetFamilyName"; + class Function GdipIsStyleAvailable(family:pointer;style:integer;IsStyleAvailable:pointer):integer;stdcall;external "gdiplus.dll" name "GdipIsStyleAvailable"; + class Function GdipFontCollectionEnumerable(fontCollection:pointer;graphics:pointer;var numFound:integer):integer;stdcall;external "gdiplus.dll" name "GdipFontCollectionEnumerable"; + class Function GdipFontCollectionEnumerate(fontCollection:pointer;numSought:integer;gpfamilies:pointer;var numFound:integer;graphics:pointer):integer;stdcall;external "gdiplus.dll" name "GdipFontCollectionEnumerate"; + class Function GdipGetEmHeight(family:pointer;style:integer;EmHeight:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetEmHeight"; + class Function GdipGetCellAscent(family:pointer;style:integer;CellAscent:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCellAscent"; + class Function GdipGetCellDescent(family:pointer;style:integer;CellDescent:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetCellDescent"; + class Function GdipGetLineSpacing(family:pointer;style:integer;LineSpacing:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLineSpacing"; +//---------------------------------------------------------------------------- +// Font APIs +//---------------------------------------------------------------------------- + class Function GdipCreateFontFromDC(hdc:pointer;var font:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFontFromDC"; + class Function GdipCreateFontFromLogfontA(hdc:pointer;logfont:pointer;var font:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFontFromLogfontA"; + class Function GdipCreateFontFromLogfontW(hdc:pointer;logfont:pointer;var font:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFontFromLogfontW"; + class Function GdipCreateFont(fontFamily:pointer;emSize:single;style:integer;unit_:pointer;var font:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateFont"; + class Function GdipCloneFont(font:pointer;var cloneFont:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneFont"; + class Function GdipDeleteFont(font:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteFont"; + class Function GdipGetFamily(font:pointer;var family:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetFamily"; + class Function GdipGetFontStyle(font:pointer;var style:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetFontStyle"; + class Function GdipGetFontSize(font:pointer;var size:single):integer;stdcall;external "gdiplus.dll" name "GdipGetFontSize"; + class Function GdipGetFontUnit(font:pointer;unit_:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetFontUnit"; + class Function GdipGetFontHeight(font:pointer;graphics:pointer;var height:single):integer;stdcall;external "gdiplus.dll" name "GdipGetFontHeight"; + class Function GdipGetFontHeightGivenDPI(font:pointer;dpi:single;var height:single):integer;stdcall;external "gdiplus.dll" name "GdipGetFontHeightGivenDPI"; + class Function GdipGetLogFontA(font:pointer;graphics:pointer;logfontA:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLogFontA"; + class Function GdipGetLogFontW(font:pointer;graphics:pointer;logfontW:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetLogFontW"; + class Function GdipNewInstalledFontCollection(var fontCollection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipNewInstalledFontCollection"; + class Function GdipNewPrivateFontCollection(var fontCollection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipNewPrivateFontCollection"; + class Function GdipDeletePrivateFontCollection(var fontCollection:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeletePrivateFontCollection"; + class Function GdipGetFontCollectionFamilyCount(fontCollection:pointer;var numFound:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetFontCollectionFamilyCount"; + class Function GdipGetFontCollectionFamilyList(fontCollection:pointer;numSought:integer;gpfamilies:pointer;var numFound:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetFontCollectionFamilyList"; + class Function GdipPrivateAddFontFile(fontCollection:pointer;filename:string):integer;stdcall;external "gdiplus.dll" name "GdipPrivateAddFontFile"; + class Function GdipPrivateAddMemoryFont(fontCollection:pointer;memory:pointer;length:integer):integer;stdcall;external "gdiplus.dll" name "GdipPrivateAddMemoryFont"; +//---------------------------------------------------------------------------- +// Text APIs +//---------------------------------------------------------------------------- + class Function GdipDrawString(graphics:pointer;string:string;length:integer;font:pointer;layoutRect:pointer;stringFormat:pointer;brush:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawString"; + class Function GdipMeasureString(graphics:pointer;string:string;length:integer;font:pointer;layoutRect:pointer;stringFormat:pointer;boundingBox:pointer;var codepointsFitted:integer;var linesFilled:integer):integer;stdcall;external "gdiplus.dll" name "GdipMeasureString"; + class Function GdipMeasureCharacterRanges(graphics:pointer;string:string;length:integer;font:pointer;layoutRect:pointer;stringFormat:pointer;regionCount:integer;var regions:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMeasureCharacterRanges"; + class Function GdipDrawDriverString(graphics:pointer;text:pointer;length:integer;font:pointer;brush:pointer;positions:pointer;flags:integer;matrix:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDrawDriverString"; + class Function GdipMeasureDriverString(graphics:pointer;text:pointer;length:integer;font:pointer;positions:pointer;flags:integer;matrix:pointer;boundingBox:pointer):integer;stdcall;external "gdiplus.dll" name "GdipMeasureDriverString"; +//---------------------------------------------------------------------------- +// String format APIs +//---------------------------------------------------------------------------- + class Function GdipCreateStringFormat(formatAttributes:integer;language:pointer;var format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateStringFormat"; + class Function GdipStringFormatGetGenericDefault(var format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipStringFormatGetGenericDefault"; + class Function GdipStringFormatGetGenericTypographic(var format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipStringFormatGetGenericTypographic"; + class Function GdipDeleteStringFormat(format:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteStringFormat"; + class Function GdipCloneStringFormat(format:pointer;var newFormat:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCloneStringFormat"; + class Function GdipSetStringFormatFlags(format:pointer;flags:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatFlags"; + class Function GdipGetStringFormatFlags(format:pointer;var flags:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatFlags"; + class Function GdipSetStringFormatAlign(format:pointer;align:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatAlign"; + class Function GdipGetStringFormatAlign(format:pointer;align:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatAlign"; + class Function GdipSetStringFormatLineAlign(format:pointer;align:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatLineAlign"; + class Function GdipGetStringFormatLineAlign(format:pointer;align:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatLineAlign"; + class Function GdipSetStringFormatTrimming(format:pointer;trimming:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatTrimming"; + class Function GdipGetStringFormatTrimming(format:pointer;trimming:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatTrimming"; + class Function GdipSetStringFormatHotkeyPrefix(format:pointer;hotkeyPrefix:integer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatHotkeyPrefix"; + class Function GdipGetStringFormatHotkeyPrefix(format:pointer;var hotkeyPrefix:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatHotkeyPrefix"; + class Function GdipSetStringFormatTabStops(format:pointer;firstTabOffset:single;count:integer;var tabStops:single):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatTabStops"; + class Function GdipGetStringFormatTabStops(format:pointer;count:integer;var firstTabOffset:single;var tabStops:single):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatTabStops"; + class Function GdipGetStringFormatTabStopCount(format:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatTabStopCount"; + class Function GdipSetStringFormatDigitSubstitution(format:pointer;language:pointer;substitute:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatDigitSubstitution"; + class Function GdipGetStringFormatDigitSubstitution(format:pointer;language:pointer;substitute:pointer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatDigitSubstitution"; + class Function GdipGetStringFormatMeasurableCharacterRangeCount(format:pointer;var count:integer):integer;stdcall;external "gdiplus.dll" name "GdipGetStringFormatMeasurableCharacterRangeCount"; + class Function GdipSetStringFormatMeasurableCharacterRanges(format:pointer;rangeCount:integer;ranges:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetStringFormatMeasurableCharacterRanges"; +//---------------------------------------------------------------------------- +// Cached Bitmap APIs +//---------------------------------------------------------------------------- + class Function GdipCreateCachedBitmap(bitmap:pointer;graphics:pointer;var cachedBitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipCreateCachedBitmap"; + class Function GdipDeleteCachedBitmap(cachedBitmap:pointer):integer;stdcall;external "gdiplus.dll" name "GdipDeleteCachedBitmap"; + class Function GdipDrawCachedBitmap(graphics:pointer;cachedBitmap:pointer;x:integer;y:integer):integer;stdcall;external "gdiplus.dll" name "GdipDrawCachedBitmap"; + class Function GdipEmfToWmfBits(hemf:pointer;cbData16:integer;pData16:pointer;iMapMode:integer;eFlags:integer):integer;stdcall;external "gdiplus.dll" name "GdipEmfToWmfBits"; + class Function GdipSetImageAttributesCachedBackground(imageattr:pointer;enableFlag:pointer):integer;stdcall;external "gdiplus.dll" name "GdipSetImageAttributesCachedBackground"; + class Function GdipTestControl(control:pointer;param:pointer):integer;stdcall;external "gdiplus.dll" name "GdipTestControl"; + class Function GdiplusNotificationHook(token:pointer):integer;stdcall;external "gdiplus.dll" name "GdiplusNotificationHook"; + class procedure GdiplusNotificationUnhook(token:pointer);stdcall;external "gdiplus.dll" name "GdiplusNotificationUnhook"; + class Function GdiplusStartup(var token:pointer;input:pointer;var output:integer){@explan(˵)gdi+%%}:integer;stdcall;external "gdiplus.dll" name "GdiplusStartup"; + class procedure GdiplusShutdown(token:pointer){@explan(˵)رgdi+%%};stdcall;external "gdiplus.dll" name "GdiplusShutdown"; +{$endif} +end \ No newline at end of file diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf new file mode 100644 index 0000000..76ebd5a --- /dev/null +++ b/funcext/tvclib/tslvcl.tsf @@ -0,0 +1,42247 @@ +unit tslvcl; +{** + @explan(˵) tslԿӻ,֧windowsԼgtk(linux)%% + @auther Ƽ %% + @date(20220223) +**} +{ + ˵ + 20220328 + 20200721 ޸Եʾ,Գ־û + 20200515 ȥһЩҪʹõĴ + 20190612 ӻ TCacheItem,TCacheList + ̶listview ̶ģʽ±ͷ + 20191115 ɾpopupھ +} +///////////ƽ̨ж//////// +{$ifdef linux} + {$define gtkpaint} + {$define linuxgtk} +{$else} + {$define gdipaint} +{$endif} +interface +uses cstructurelib,UVCPropertyTypesPersistence,ugtkinterface; +function initializeapplication(); //app +function RegisterComponentType(n,typ); //עؼ +function GetAndDispatchMessageA(hwnd,minm,maxm); //win32 ַϢ +function ExitMessageLoop(); //˳ѭ +function ShowErrorMessage(msg); +function gettswin32api(); //win32 api +function NotifyComponent(Sender,Act,ToComponent); //notfiy +//////////////////////Ϊ///////////////////// +function getbitsfrominteger(n,b,e); +function lowuperdword(value_,lvalue,uvalue,ptrl); +function unsignedtosigned(v,n); +function signedtounsigned(v,n); +function intasposition(xy); +function makeposition(x,y); +function makelong(low,high,ptrl);//λλϲ +Function tslcstructure(data,dsize,pack,ptr); +////////////////////////////////////// +function pointinrect(p,rec); +function intersectrect(rec1,rec2,irec); +function CompareRect(orect,nrect); +function pointtovector(pts);//תΪ +function calldatafunction(); +function CallMessgeFunction(f,o,e); +//////////////////////ִtslű//////////////////// +function tslScriptGo(script); +//function TSL_Check(func,funclen,oResult); +function CheckTslCode(code,err); //tsl﷨ +function SysExecWait(handle,exe,cmd,dir,fui); //ִ win32 +function gettemppath(); //ʱĿ¼ +function TS_ModulePath(); +function TS_ExecPath(); +function TS_GetAppPath(); +function TS_GetUserProfileHome(); +function TSL_ReservedKeys2(); //ؼ +function TS_GetIniPath(hometype,IniName); +function CopyUsedTslDllToNewDir(p); +///////////////////////////////////////////// +function DeleteAllFiles(path); +function CreateDirWithFileName(fname); +function GetPathFromFullName(fullname,fname,ftype); +function GetTextWidthAndHeightWidthFont(s,f,mul); +//**************************** +function FormatTslData(d,sj,tn); +function HexStrToTsl(hex); +function TslToHexStr(d); +function TslToHexFormatStr(tsl); +function HexFormatStrToTsl(D); +//************************ +function GetGdipStatus(v); +function LoginTslServer(usr,pwd,addr,port); +//******************************* +function MessageBoxA(txt,title,flag,hd); +function _timeproc_(hwnd,message,wparam,lparam);//win32Ϣַ +function _twinproc_(hwnd,message,wparam,lparam);//win32Ϣַ +function _MessgeHook_a(hwnd,message,wparam,lparam); +function remotetslcallback(data); +//*************** +Function getmsgd_Crc32(s); //Ϣָƺ +//**********ϵͳغ********************* +function ioFileseparator(); //ļĿ¼ָ +function initlib(); +//////////////////////////////////// +function controlisCustomPaint(id); +/////////////////// +function ParserCommandLine(s); //в +type tidcreater=class + {** + @ignore() + **} + private + __sid; + cid; + Reuseids; + usedids; + //protected + {** + @explan(˵) ظid %% + @param(cid)(integer) ǰidֵ %% + @param(Reuseids) (array) Ѿյid %% + + **} + public + function clean(); + begin + Reuseids := array(); + cid := __sid; + end + function create(sid); + begin + {** + @explan(˵) 캯 %% + @param(sid)(integer) ʼidֵ + **} + if ifnumber(sid)then cid := sid; + else cid := 0; + __sid := cid; + usedids := Reuseids := array(); + end + function createid(); + begin + {** + @explan(˵) id %% + @return(integer) idֵ %% + + **} + ret := nil; + for i in Reuseids do + begin + if ifnumber(i)then + begin + ret := i; + break; + end + end + if ifnumber(ret)then + begin + reindex(Reuseids,array(ret:nil)); + usedids[ret]:= ret; + return ret; + end + cid += 1; + usedids[cid]:= cid; + return cid; + end + function deleteid(id); + begin + {** + @explan(˵) ظid %% + @param(id)(integer) Ҫյidֵ %% + @return(bool) Ƿɹ + **} + if ifnumber(id)then + begin + Reuseids[integer(id)]:= id; + reindex(usedids,array(integer(id):nil)); + return 1; + end + return 0; + end + function addid(id); + begin + if ifnumber(id)and id>0 then + begin + cid := max(cid,id); + usedids[id]:= id; + end + end +end + +type Ttagdrawtextparams=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("cbsize","int",0) + ,("itablength","int",4) + ,("ileftmargin","int",0) + ,("irightmargin","int",0) + ,("uilengthdrawn","int",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + cbsize := _size_(); + end + property cbsize index "cbsize" read _getvalue_ write _setvalue_; + property itablength index "itablength" read _getvalue_ write _setvalue_; + property ileftmargin index "ileftmargin" read _getvalue_ write _setvalue_; + property irightmargin index "irightmargin" read _getvalue_ write _setvalue_; + property uilengthdrawn index "uilengthdrawn" read _getvalue_ write _setvalue_; +end + + + type tswin32api = class({$ifdef linuxgtk}tgtkapis{$endif}) //windowsӿ + {** + @explan(˵) win32apiӿں + 1. ˲win32api + 2. winuserͷļĺ궨 + 3. ˲ֽṹ嶨嵽Ա + 4. externalwin32apimsdnвҾ÷ + **} + private + + + _DLLID; + public + function destroy(); + begin + {for i,v in _DLLID do + begin + FreeLibrary(v); + end} + end + + function create(); + begin + {DLLID := array("Kernel32.dll","User32.dll","Gdi32.dll","Comctl32.dll","Comdlg32.dll","Shell32.dll"); + _DLLID := array(); + for i,v in DLLID do + begin + _DLLID[v]:= LoadLibraryA(v); + end} + end + + function getpathbyprocid(id); + begin + {** + @explan(˵) ȡн· %% + @param(id)(integer) id + **} + strFilePath := ""; + len := 1024; + setlength(strFilePath,len); + hd := OpenProcess(0x000F0000L .| 0x00100000L .| 0xFFFF,0,id); + GetModuleFileNameExA(hd,0,strFilePath,len); + //QueryFullProcessImageNameA(hd, 1, strFilePath, len); + r := ""; + for i := 1 to length(strFilePath) do + begin + vi := strFilePath[i]; + if vi="\0" then break; + r += vi; + end + if hd then CloseHandle(hd); + return r; + end + function EnumProcesses(); + begin + {** + @explan(˵) ȡнid + **} + {** + @example(ȡнid,·) + t := EnumProcesses(); + for i,v in t do echo getpathbyprocid(v),"\r\n"; + **} + ret := zeros(2048); + EnumProcesses_(ret,length(ret)* 4,t); + r := ""; + if t>0 then r := ret[0:t/4]; + return r; + end + + function Toolhelp32Snapshot(); + begin + {** + @explan(˵) ȡнϢ %% + @param() + @return(array) Ϣ %% + **} + currentProcess := new Ttagprocessentry32(); + hProcess := CreateToolhelp32Snapshot(2,0); //ϵͳڵнһ + r := array(); + if hProcess=-1 then return r; + bMore := Process32First(hProcess,currentProcess._getptr_); //ȡһϢ + countProcess := 0; + while(bMore) do + begin + r[countProcess]:= currentProcess._getdata_; + bMore := Process32Next(hProcess,currentProcess._getptr_); //һ + countProcess++; + end + CloseHandle(hProcess); //hProcess + return r; + end + + function Toolhelp32Snapshotmodule(id); + begin + {** + @explan(˵) ȡmoduleϢ + **} + if not(id >= 0)then id := 0; + currentProcess := new TtagMODULEENTRY32(); + hProcess := CreateToolhelp32Snapshot(8,id); //ϵͳڵнһ + r := array(); + if hProcess=-1 then return r; + bMore := Module32First(hProcess,currentProcess._getptr_); //ȡһϢ + countProcess := 0; + while(bMore) do + begin + r[countProcess]:= currentProcess._getdata_; + bMore := Module32Next(hProcess,currentProcess._getptr_); //һ + countProcess++; + end + CloseHandle(hProcess); //hProcess + return r; + end + function Comctl32version(); + begin + {** + @explan(˵) ȡcomctl32.dll汾 + **} + o := tslcstructure(array( + ("cbsize","int",0), + ("dwmajorversion","int",0), + ("dwminorversion","int",0), + ("dwbuildnumber","int",0), + ("dwplatformid","int",0))); + o._setvalue_("cbsize",o._size_); + Comctl32DllGetVersion(o._getptr_); + return o._getdata_(); + end + function shell32Version(); + begin + {** + @explan(˵) ȡshell32.dll汾 + **} + o := tslcstructure(array( + ("cbsize","int",0), + ("dwmajorversion","int",0), + ("dwminorversion","int",0), + ("dwbuildnumber","int",0), + ("dwplatformid","int",0))); + o._setvalue_("cbsize",o._size_); + shell32DllGetVersion(o._getptr_); + return o._getdata_(); + end + function GetCursorInfo(); + begin + {** + @explan(˵) ȡcursor Ϣ %% + @param(array) ֶ: + flags Ϊ0 ʾ The cursor is hidden. + Ϊ1 ʾ The cursor is showing. + Ϊ2 ʾ The cursor is suppressed + hcursor + ptscreenpos λ + + **} + o := new ctslctrans(array( + ("cbsize","int",0,0,4,"int",1), + ("flags","int",0,4,4,"int",1), + ("hcursor","intptr",0,8,4,"intptr",1), + ("ptscreenpos","int[2]", + (0,0),12,8,"intarray",2)),nil,nil); + o._setvalue_("cbsize",o._size_()); + if(GetCursorInfo_(o._getptr_()))then + begin + return o._getdata_(); + end + end + function GetScreenRect(); + begin + {** + @explan(˵) ȡĻС%% + @return(array) %% + **} + rc := new tcrect(); + SystemParametersInfoA(0x30,0,rc._getptr_(),0); + return rc._getdata_(); + end + function GetMonitor(mhandle,r); + begin + {** + @explan(˵) ʾϢ%% + **} + r := new TMONITORINFO(); + return GetMonitorInfoA(mhandle,r._getptr_()); + end + + + + {$ifdef linuxgtk} + + class function AnsiToWidChar(c); + begin + if not ifstring(c) then return ""; + return c; + end + function ShowWindow(hwd :pointer;f:integer); + begin + {SW_HIDE := 0x0;SW_SHOWNORMAL := 0x1;SW_NORMAL := 0x1; + SW_SHOWMINIMIZED := 0x2;SW_SHOWMAXIMIZED := 0x3;SW_MAXIMIZE := 0x3; + SW_SHOWNOACTIVATE := 0x4;SW_SHOW := 0x5;SW_MINIMIZE := 0x6; + SW_SHOWMINNOACTIVE := 0x7;SW_SHOWNA := 0x8;SW_RESTORE := 0x9; + SW_SHOWDEFAULT := 0xA;SW_FORCEMINIMIZE := 0xB;SW_MAX := 0xB;} + global G_GTK_WINDOW_ACTIVATE; + + if not hwd then return ; + if not GTK_WIDGET(hwd) then return ; + if f =0 then + begin + + if gtk_widget_is_toplevel(hwd) then + begin + p := GetParent(hwd); + if p then gtk_window_set_transient_for(hwd,0); + end + gtk_widget_hide(hwd); + end else + if f=0xc then + begin + if gtk_widget_is_toplevel(hwd) then + begin + p := GetParent(hwd); + if p and GTK_WIDGET(p) then + begin + if gtk_widget_is_toplevel(p) then pp := p; + else + pp := gtk_widget_get_toplevel(p); + if pp then gtk_window_set_transient_for(hwd,pp); + end + end + gtk_widget_show_all(hwd); + end else + begin + if gtk_widget_is_toplevel(hwd) then + begin + global g_current_get_focus_widget; + cf := g_current_get_focus_widget; + p := GetParent(hwd); + if p and GTK_WIDGET(p) then + begin + if gtk_widget_is_toplevel(p) then pp := p; + else + pp := gtk_widget_get_toplevel(p); + if pp then gtk_window_set_transient_for(hwd,pp); + end + if 2 =g_object_get_data(hwd,"gtk_popwp") then + begin + x := g_object_get_data(hwd,"gtk_layout_x"); + y := g_object_get_data(hwd,"gtk_layout_y"); + w := g_object_get_data(hwd,"gtk_layout_width"); + h := g_object_get_data(hwd,"gtk_layout_height"); + gtk_window_move(hwd,x,y); + if w>=0 and h>=0 then + gtk_widget_set_size_request(hwd,w,h); + end + if f=0x4 then + begin + if not gtk_window_get_decorated(hwd) then + gtk_window_set_type_hint((hwd),3); + if cf and cf<>g_current_get_focus_widget then //һfocus + begin + tplev := gtk_widget_get_toplevel(cf); + if tplev then gtk_window_set_focus(tplev,cf); + end + end + end + gtk_widget_show(hwd); + if f<>0x4 and G_GTK_WINDOW_ACTIVATE<>hwd then + begin + if G_GTK_WINDOW_ACTIVATE then + AddMessageToGtkMessageQueue(G_GTK_WINDOW_ACTIVATE,0x6,0,0,0); + G_GTK_WINDOW_ACTIVATE := hwd; + AddMessageToGtkMessageQueue(hwd,0x6,1,0,0); + end + end + return true; + end + function MessageBoxA(hwnd :pointer;txt:string;cap:string;flag:integer); + begin + return gtk_MessageBoxA(hwnd,txt,cap,flag); + end + function IsWindow(h); + begin + wt := static gtk_widget_get_type(); + r := g_type_check_instance_is_a(h,wt); + return r; + end + function GetWindowTextA(h,s,l); + begin + if not(h>0 or h<0) then return ; + if not ifstring(s) then return ; + wt := static gtk_window_get_type(); + if g_type_check_instance_is_a(h,wt) then + begin + rs := GtkStringToTsl(gtk_window_get_title(h)); + end else + begin + lbl := g_object_get_data(h,"gtk_layout_label"); + if lbl then + begin + rs := GtkStringToTsl(gtk_label_get_text(lbl)); + end else + begin + et := g_object_get_Data(h,"gtk_layout_editer"); + if et then + begin + rs := GtkStringToTsl( gtk_entry_get_text(h)); + end else + begin + et := g_object_get_Data(h,"gtk_layout_memo"); + if et then + begin + rs := gtk_executeMessageA(h,0xd,0,0); + end + end + end + end + if rs then + begin + for i:= 1 to min(length(s),min(length(rs),l)) do + begin + s[i] := rs[i]; + end + return i; + end + end + function SetWindowTextA(h,s); + begin + if not(h>0 or h<0) then return ; + if not ifstring(s) then return ; + wt := static gtk_window_get_type(); + us := TslStringToGtk(s); + if g_type_check_instance_is_a(h,wt) then + begin + gtk_window_set_title(h,us); + end else + begin + return ; + lbl := g_object_get_data(h,"gtk_layout_label"); + if lbl then + begin + return gtk_label_set_text(lbl,us); + end + et := g_object_get_Data(h,"gtk_layout_editer"); + if et then + begin + return gtk_entry_set_text(h,us); + end + et := g_object_get_Data(h,"gtk_layout_memo"); + if et then + begin + gtk_executeMessageA(h,0xc,0,us); + end + + //et := g_object_get_Data(h,"gtk_layout_memo"); + //if et then return gtk_entry_set_text(et,us); + end + end + function GetScrollInfo(hWnd:pointer;x:integer;info:pointer) + begin + return gtk_GetScrollInfo(hwnd,x,info); + end + function SetScrollInfo(hwnd:pointer; nBar:integer; lpsi:pointer;redraw:integer) + begin + return gtk_SetScrollInfo(hwnd,nBar,lpsi,redraw); + end + function SystemParametersInfoA(uiAction:integer;uiParam:integer; pvParam:pointer; fWinIni:integer); + begin + if (uiAction = 0x30) and (pvParam>0 or pvParam<0) then + begin + w := static gdk_screen_width(); + h := static gdk_screen_height(); + rc := new tcrect(pvParam); + rc._setvalue_(0,0); + rc._setvalue_(1,0); + rc._setvalue_(2,w); + rc._setvalue_(3,h); + end + end + function GetClientRect(h :pointer;var rec:array of integer); + begin + if h then + begin + x0 := g_object_get_data(h,"gtk_layout_width"); + y0 := g_object_get_data(h,"gtk_layout_height"); + end + rec := array(0,0,x0, y0); + return true; + end + function GetWindowRect(hwnd :pointer;var rec:array of integer):integer; + begin + xy := array(0,0); + ClientToScreen(hwnd,xy); + h := g_object_get_data(hwnd,"gtk_layout_height"); + w := g_object_get_data(hwnd,"gtk_layout_width"); + rec := array(xy[0],xy[1],xy[0]+w,xy[1]+h); + end + function GetWindowInfo(hwnd :pointer;f:pointer):integer; + begin + if not(f>0 or f<0 ) then return 0; + //info := new TWINDOWINFO(f); + end + function SetWindowPos(h:pointer;hWndInsertAfter:pointer; X:integer; Y:integer; cx:integer;cy:integer; uFlags:integer); + begin + + if 0x400 .& uFlags then + begin + //echo "border set \r\n"; + InvalidateRect(h,nil,false); + return ; + end + if not(h>0 or h<0) then return ; + flg := 0; + wt := static gtk_window_get_type(); + if g_type_check_instance_is_a(h,wt) then // + begin + x0 := g_object_get_data(h,"gtk_layout_x"); + y0 := g_object_get_data(h,"gtk_layout_y"); + if (x>=0 and y>=0) and (x<>x0 or y<>y0) then //λ + begin + gtk_window_move(h,x,y); + g_object_set_data(h,"gtk_layout_x",x); + g_object_set_data(h,"gtk_layout_y",y); + flg .|=2; + end + w0 := g_object_get_data(h,"gtk_layout_width"); + h0 := g_object_get_data(h,"gtk_layout_height"); + if (cx>=0 and cy>=0) and ( cx<>w0 or cy<>h0) then + begin + if gtk_window_get_resizable(h) then + begin + gtk_widget_get_size_request(h,cx0,cy0); //Сһ + if cx0>cx or cy0>cy then + begin + gtk_widget_set_size_request(h,cx,cy); + end + gtk_window_resize(h,cx,cy); + end + else + begin + //gtk_widget_get_size_request(h,cx0,cy0); + //echo "\r\noldsize:",cx0,"====",cy0; + //gtk_window_resize(wh,cx,cy); + gtk_widget_set_size_request(h,cx,cy); + //gtk_window_set_decorated(h,true); + //gtk_window_set_resizable(h,true); + + //gtk_window_resize(h,cx,cy); + //gtk_window_set_decorated(h,false); + //gtk_window_resize_to_geometry(h,cx,cy); + end + g_object_set_data(h,"gtk_layout_width",cx); + g_object_set_data(h,"gtk_layout_height",cy); + flg .|=1; + end + if flg then //෢һϢ + begin + Gtk_TrigMoveSizeEvent(h,x,y,cx,cy,flg); + end + end else + if isGtkWidget(h) then + begin + lot := gtk_widget_get_parent(h); + //flg := 0; + if lot then + begin + x0 := g_object_get_data(h,"gtk_layout_x"); + y0 := g_object_get_data(h,"gtk_layout_y"); + if x<>x0 or y<>y0 then + begin + gtk_layout_move(lot,h,x,y); + g_object_set_data(h,"gtk_layout_x",x); + g_object_set_data(h,"gtk_layout_y",y); + flg .|=2; + end + end + w0 := g_object_get_data(h,"gtk_layout_width"); + h0 := g_object_get_data(h,"gtk_layout_height"); + if (cx>=0 and cy>=0) and ( cx<>w0 or cy<>h0) then + begin + gtk_widget_set_size_request(h,cx,cy); + g_object_set_data(h,"gtk_layout_width",cx); + g_object_set_data(h,"gtk_layout_height",cy); + //lbl := g_object_get_data(h,"gtk_layout_lable"); + //if lbl then gtk_widget_set_size_request(lbl,cx-5,cy-5); + flg .|=1; + end + if flg then + begin + Gtk_TrigMoveSizeEvent(h,x,y,cx,cy,flg); + end + + end + end + function IsGtkWidget(h); + begin + wt := static gtk_widget_get_type(); + return g_type_check_instance_is_a(h,wt); + end + function gtk_window_showmodal(w); //shomodal + begin + dialog := w.handle; + pt := GetParent(dialog); + if (pt) and GTK_WIDGET(pt) then + begin + if (not gtk_widget_is_toplevel(pt)) then + begin + pt := gtk_widget_get_toplevel(pt); + end + w.Visible := true; + gtk_window_set_type_hint((dialog),0); + //gtk_window_set_modal(GTK_WINDOW( dialog),TRUE); //εshowmodal + gtk_window_set_transient_for( GTK_WINDOW(dialog),GTK_WINDOW(pt)); + + return true; + end + end + function gtk_window_endmodal(w); //shomodal + begin + dialog := w.handle; + pt := GetParent(dialog); + if (pt) then + begin + if (not gtk_widget_is_toplevel(pt)) then + begin + pt := gtk_widget_get_toplevel(pt); + end + //gtk_window_set_modal(GTK_WINDOW( dialog),false); //εshowmodal + gtk_window_set_transient_for( GTK_WINDOW(dialog),0); + w.Visible := false; + end + end + function GetParent(h); //ø + begin + if not IsGtkWidget(h) then return 0; + if gtk_widget_is_toplevel(h) then return g_object_get_data(h,"gtk_layout_parent"); + p := gtk_widget_get_parent(h); + if p then + return g_object_get_data(p,"gtk_layout_owner"); + return 0; + end + function SetParent(h :pointer;phwnd:pointer); //gtk + begin + if h=phwnd then return 0; + if not IsGtkWidget(h) then return 0; + if gtk_widget_is_toplevel(h) then + begin + r := g_object_get_data(h,"gtk_layout_parent"); + if r=phwnd then return ; + g_object_set_data(h,"gtk_layout_parent",IsGtkWidget(phwnd)?phwnd:0); + + if gtk_widget_is_visible(h) then //ʾӴڴ + begin + if GTK_WIDGET(phwnd) then + begin + if gtk_widget_is_toplevel(phwnd) then pp := phwnd; + else + pp := gtk_widget_get_toplevel(phwnd); + gtk_window_set_transient_for(h,pp); + end + end else + begin + gtk_window_set_transient_for(h,0); //20211020 + end + return r; + end + lot :=gtk_widget_get_parent(h); ;//g_object_get_data(h,"gtk_layout_parent");// //ԭlayout + if lot then + begin + r := g_object_get_data(lot,"gtk_layout_owner"); + if r=phwnd then return 0; + gtk_container_remove(lot,h); + end + if not phwnd then return r; + lot := g_object_get_data(phwnd,"gtk_layout"); + if lot then + begin + x := g_object_get_data(h,"gtk_layout_x"); + y := g_object_get_data(h,"gtk_layout_y"); + gtk_layout_put(lot,h,x,y); + + end + return r; + end + function hittestwidget(h,x,y); + begin + wd := class(TGlobalComponentcache).getwndbyhwnd(h); + if wd then return wd.gethitstyle(x,y); + return 0; + end + function GetTopWidgetList(h,x,y,r); + begin + wd := class(TGlobalComponentcache).getwndbyhwnd(h); + if wd and wd.Visible and wd.Enabled then + begin + xy := wd.ScreenToClient(x,y); + if xy[0]>0 and xy[1]>0 and wd.width>xy[0] and wd.height>xy[1] then + begin + r[length(r)] := array(h,xy); + ctls := wd.Controls; + for i:= 0 to ctls.count-1 do + begin + ci := ctls[i]; + if (ci is class(TWinControl)) and ci.HandleAllocated() and (not ci.WsPopUp) then + begin + GetTopWidgetList(ci.Handle,x,y,r); + end + end + end + end + end + // class(TGlobalComponentcache).getwndbyhwnd(hwnd); + function Gtk_TrigMoveSizeEvent(h,aleft,atop,AWidth,AHeight,flg); + begin + SWP_NOMOVE := 2; + SWP_NOSIZE := 1; + WM_WINDOWPOSCHANGED := 0x47; + d := new tvclwindowpos_class(0); + SizeChanged := flg .& 1; + PosChanged := flg .& 2; + + if SizeChanged then + begin + vb := g_object_get_data(h,"gtk_window_vscroll_bar"); + hb := g_object_get_data(h,"gtk_window_hscroll_bar"); + if vb and gtk_widget_is_visible(vb) then + begin + d.cx := max(AWidth-10,0); + end + else d.cx := AWidth; + if hb and gtk_widget_is_visible(hb) then + begin + d.cy := max(AHeight-10,0); + end + else + d.cy := AHeight; + D.flags := SWP_NOMOVE; + _twinproc_(h,WM_WINDOWPOSCHANGED,0,d._getptr_); + end + if PosChanged then + begin + d.x := ALeft; + d.y := ATop; + d.flags := SWP_NOSIZE; + _twinproc_(h,WM_WINDOWPOSCHANGED,0,d._getptr_); + end + if SizeChanged then //DzӦ÷ǰ + begin + gtk_widgetsizechanged(h,AHeight,AWidth); + end + {if SizeChanged then + begin + _twinproc_(h,0x5,0,makeposition(AWidth,AHeight)); + end} + if PosChanged then + begin + _twinproc_(h,0x3,0,makeposition(ALeft,ATop)); + end + + end + function GetCursorPos(var p:array of integer); + begin + gdk_display_get_pointer(gdk_display_get_default(), nil, x, y, nil) ; + p := array(x,y); + return true; + end + function PostQuitMessage(c); + begin + gtk_main_quit(); + return c; + end + ///////////////////////////////////////// + + ///////////////////////////////////////// + + Function LoadCursorA2(hd:pointer;n:pointer) + begin + rn := array(0x7F01:152,0x7F8A:126,0x7F89:24,0x7F88:0,0x7F87:0, + 0x7F86:58,0x7F85:138,0x7F84:70,0x7F83:12,0x7F82:14,0x7F80:58,0x7F04:6, + 0x7F03:30,0x7F02:150)[n]; + if ifnil(rn) then rn := 2; + return gdk_cursor_new(rn); + end + function RegisterClassExA(wc:pointer); + begin + return gtk_RegisterClassExA(wc); + end + function GetClassInfoExA(HH:pointer;lpszClass:string;lpwcx:pointer); + begin + return gtk_GetClassInfoExtA(hh,lpszClass,lpwcx); + end + function CreateWindowExA(dwExStyle:integer; lpClassName:string; lpWindowName:string; + dwStyle:integer;x:integer;y:integer;nWidth:integer;nHeight:integer; + hWndParent:pointer;hMenu:pointer; hInstance:pointer;lpParam:pointer); + begin + return gtk_createwindowexa(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam); + end + ///////////////////////սӿ + class function LoadLibraryA(txt:string)begin end; + class function FreeLibrary(hd:pointer)begin end; + class function GetModuleHandleA(name:pointer)begin return 1; end; + + function SetClassLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer)begin end; + function GetClassLongPtrA(HH:pointer;idx:integer)begin end; + //////////////////////////////////////// + function CallWindowProcA(lpPrevWndFunc:pointer;hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer) + begin + //Ĭϴ + //echo "call defalt handler\r\n"; + end + function GetKeyState(key); + begin + return gtk_GetKeyState(key); + end + function GetAsyncKeyState(key); + begin + return gtk_GetAsyncKeyState(key); + end + function GetSysColor(idx:integer):integer; + begin + if idx = 0x5 then + begin + return 0xffffff; + end + return 0xf0f0f0; + end + function SendMessageA(h,msg,w,l); + begin + return gtk_sendmessagea(h,msg,w,l); + end + function PostMessageA(h,msg,w,l,d); + begin + return gtk_postmessagea(h,msg,w,l,d); + end + function SetWindowLongPtrA(h,n,v); + begin + if not(h>0 or h<0) then return 0; + return gtk_SetWindowLongPtrA(h,n,v); + end + function GetWindowLongPtrA(h,idx); + begin + if not(h>0 or h<0) then return 0; + return gtk_GetWindowLongPtrA(h,idx); + end + function DestroyWindow(h:pointer); + begin + if h>0 or h<0 then + begin + SetParent(h,0); + if IsGtkWidget(h) then + begin + gtk_widget_destroy(h); + end + end + end + class function MultiByteToWideChar_a(CodePage:integer;dwFlags:integer;lpMultiByteStr:string;cbMultiByte:integer;var lpWideCharStr:string;cchWideChar:integer):integer; + class function tuicloseistream(sm:pointer):integer; + class function GetEncoderClsid(n:String;ed:pointer):integer; + begin + WriteStringToPtr(ed,n); // + return -1; + end + function EnableWindow(w,c); + begin + //ܻ + if not(w>0 or w<0) then return false; + r := gtk_widget_get_sensitive(w); + nc := c?true:false; + issetfc := false; + if r<>nc then + begin + if not nc then //ƺе + begin + cf := GetFocus(); + pcf := cf; + while pcf do //ϲ㴰 + begin + if pcf = w then + begin + g_object_set_data(w,"gtk_focus_widget_handle",cf); + issetfc := true; + break; + end + pcf := gtk_widget_get_parent(pcf); + end + if not issetfc then //浱ǰʧĴ + begin + g_object_set_data(w,"gtk_focus_widget_handle",0); + end + end + gtk_widget_set_sensitive(w,nc); + global g_current_get_focus_widget; + if nc and 0=g_current_get_focus_widget then + begin + fh := g_object_get_data(w,"gtk_focus_widget_handle") ; + if fh and GTK_WIDGET(fh) then + begin + SetFocus(fh); + end + end + end + return r; + end + function CreateStreamOnHGlobal(hGlobal:pointer;fDeleteOnRelease:integer; var ppstm:pointer):pointer; + begin + ppstm := ""; + return true; + end + function GetHGlobalFromStream(pstm:string; var phglobal:string):pointer; + begin + // + phglobal := pstm; + end + function memcpy2(var dst:string;src:string;size_t:integer):pointer; + begin + //ַ + dst := src; + return ;// + end + function GlobalUnlock(mem :string):integer; + begin + return mem; + end + function GlobalSize(menm:pointer):integer; + begin + return 0;// + end + function InvalidateRect(hwnd :pointer;rec:array of integer;f:integer):integer; + begin + h := g_object_get_data(hwnd,"gtk_clientwideget"); + if h then + begin + //return gtk_widget_queue_draw(h); + if ifarray(rec) and ifnumber(rec[0]) and ifnumber(rec[1]) and ifnumber(rec[2]) and ifnumber(rec[3]) then + begin + + gtk_widget_queue_draw_area(h,rec[0],rec[1],rec[2]-rec[0],rec[3]-rec[1]); + end + else + begin + gtk_widget_queue_draw(h); + + end + end + end + function InvalidateRect2(hwnd :pointer;rec:pointer;f:integer):integer; + begin + InvalidateRect(hwnd,0,f); + end + + //////////////////////////////gdi/////////////////////////////////////////// + function SelectObject(hdc :pointer;gdiobj:pointer); + begin + // + if not hdc then return 0; + if not(gdiobj>0 or gdiobj<0) then return 0; + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then return 0; + obj := gtk_gdi_object_globals[inttostr(gdiobj)]; + if not obj then return 0; + t := obj[1]; + o := obj[0]; + case obj[1] of + "pen": + begin + r := gtk_object_get_data(hdc,"pen"); + gtk_object_set_data(hdc,"pen",gdiobj); + gtk_object_set_data(hdc,"pen.color",o.color); + gtk_object_set_data(hdc,"pen.width",o.width); + gtk_object_set_data(hdc,"pen.style",o.style); + end + "brush": + begin + r := gtk_object_get_data(hdc,"brush"); + gtk_object_set_data(hdc,"brush",gdiobj); + gtk_object_set_data(hdc,"brush.color",o.color); + end + "font": + begin + r := gtk_object_get_data(hdc,"font"); + gtk_object_set_data(hdc,"font",gdiobj); + end + "rgn": + begin + r := gtk_object_get_data(hdc,"rgn"); + gtk_object_set_data(hdc,"rgn",gdiobj); + end + end ; + return r; + end + Function TextOutA(hdc :pointer;X:integer;y:integer;txt:string;len:integer):integer; + begin + cl := gtk_object_get_data(hdc,"text.color"); +// gtk_rgb_color_rgb(cl,r,g,b); +// cairo_set_source_rgb(hdc, r, g, b); + xb := gtk_object_get_data(hdc,"viewport.x"); + yb := gtk_object_get_data(hdc,"viewport.y"); + ft := gtk_object_get_data(hdc,"font"); + global gtk_gdi_object_globals; + if ft and ifarray(gtk_gdi_object_globals) then + begin + fto := gtk_gdi_object_globals[inttostr(ft)]; + if fto then fto := fto[0]; + if fto then //ִ + begin + fc := fto._getvalue_("facename"); + ht := fto._getvalue_("height"); + wd := fto._getvalue_("width"); + it := fto._getvalue_("italic"); + wt := fto._getvalue_("weight")=700; + udl := fto._getvalue_("underline"); + fnotset := false; + {fns := static pango_font_family_get_names(); + for i,v in fns do + begin + if v=fc then + begin + fnotset := true; + break; + end + end } + cft := (fnotset?fc:"AR PL UKai CN"); + global g_gtk_font_get_size ; + if not ifarray(g_gtk_font_get_size) then g_gtk_font_get_size := array(); + cfinfo := g_gtk_font_get_size[cft,ht,wd,it,wt]; + if cfinfo then + begin + wd := cfinfo["width"]; + dkzt := cfinfo["zczw"]; + iwd2 := cfinfo["iwd2"]; + cairo_select_font_face(hdc,cft,it,wt); + cairo_set_font_size(hdc,cfinfo["iwd2"]); + end else + begin + cairo_select_font_face(hdc,cft,it,wt); + ext := new _cairo_text_extents_t(nil); + brk := 0; + wd2 := wd*2-2-wt; //΢Сһ + iwd2 := wd2; + brk_Ct := 0; + dkzt := false; + while not brk do + begin + brk_Ct++; + cairo_set_font_size(hdc,iwd2); + cairo_text_extents(hdc, U"", ext._getptr_()); + nwd := ext.width; + if brk_Ct = 1 then + begin + cairo_text_extents(hdc, U"i", ext._getptr_()); + nwd2 := ext.width; + dkzt := (nwd2/nwd)>0.6; + //echo "\r\n*********************",(nwd2/nwd); + if dkzt then //֧,΢Ŵһ + begin + wd2 := wd+1+it-wt; + iwd2 := wd+1+it-wt; + end + end + if nwd>(wd2+0.4) then + begin + iwd2-=0.25; + end else + if nwd<(wd2) then + begin + iwd2+=0.25; + end else + begin + brk := true; + end + if brk_Ct>50 then break; + end + g_gtk_font_get_size[cft,ht,wd,it,wt] := array("width":wd,"zczw":dkzt,"iwd2":iwd2); + end + end + + end + + wid := wd; + idx := 1 ; + tlen := (len<0)?length(txt):(min(len,length(txt))); + xp := x+xb; + yp := y+yb+ht; + //////////////////////////////////////////////////////////// + if gtk_object_get_data(hdc,"font.bkmode") = 2 then + begin + gtk_rgb_color_rgb(gtk_object_get_data(hdc,"font.bkcolor"),r,g,b); + //cairo_fill + cairo_move_to(hdc,xp,yp); + cairo_line_to(hdc,xp+wid*tlen,yp); + cairo_line_to(hdc,xp+wid*tlen,yp-ht); + cairo_line_to(hdc,xp,yp-ht); + cairo_line_to(hdc,xp,yp); + cairo_set_source_rgb(hdc, r, g, b); + cairo_fill(hdc); + end + gtk_rgb_color_rgb(cl,r,g,b); + cairo_set_source_rgb(hdc, r, g, b); + //////////////////////////////////////////////////////// + if udl then + begin + cairo_set_line_width(hdc,0.5); + end + while idx<=tlen do + begin + if udl then bxp := xp; + ci := GetChar(txt,idx); + {if ci=13 then // \n + begin + idx++; + yp+=ht; + continue; + end else // \r + if ci = 10 then + begin + idx++; + xp := x+xb; + continue; + end } + cairo_move_to(hdc,xp,yp); + if (ci .& 0x80) then + begin + if idx14 then + cairo_show_text(hdc,TslStringToGtk2( txt[idx])); + end + xp+=wid; + idx++; + if udl then + begin + cairo_move_to(hdc,bxp,yp); + cairo_line_to(hdc,xp,yp); + end + //cairo_move_to(hdc,xp,yp); + end + cairo_stroke(hdc); + return 1; + end + Function DrawTextA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer):integer; + begin + //ַ + //λ + return DrawTextExA(hdc,txt,len,rec,fmt,0); + end + Function DrawTextExA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer;lpdtp:pointer):integer; + begin + slen := length( txt); + if slen<1 then return ; + ft := gtk_object_get_data(hdc,"font"); + global gtk_gdi_object_globals; + if ft and ifarray(gtk_gdi_object_globals) then + begin + fto := gtk_gdi_object_globals[inttostr(ft)]; + if fto then fto := fto[0]; + wd := fto._getvalue_("width"); + ht := fto._getvalue_("height"); + end + //DT_LEFT := 0; + DT_RIGHT := 0x2; + //DT_TOP := 0; + DT_BOTTOM:= 0x8; + DT_CENTER := 0x1; + DT_VCENTER:= 0x4; + //DT_SINGLELINE:= 0x20; + //DT_TABSTOP:= 0x80; + rw := rec[2]-rec[0]; + nlen := min(len, min(integer(rw/wd),slen)); + sx := rec[0]; + rh := rec[3]-rec[1]; + sy := rec[1]; + if fmt=0 or not(fmt>0 or fmt<0 ) then + begin + + end + if (fmt .& DT_CENTER)=DT_CENTER then // + begin + if nlen = slen then + begin + sx +=(rw-(nlen*wd))/2; + end + + end + if (fmt .& DT_VCENTER)=DT_VCENTER then // + begin + if rh>ht then + begin + sy+=(rh-ht)/2; + end + end + if (fmt .& DT_RIGHT)=DT_RIGHT then // + begin + if rw>(nlen*wd) then + begin + sx := rec[2]-((nlen*wd)); + end + end + if (fmt .& DT_BOTTOM)=DT_BOTTOM then // + begin + sy := rec[3]-3-ht; + end + r := TextOutA(hdc,sx,sy,txt,nlen); + return r; + rr := gtk_object_get_data(hdc,"rgn"); + if rr then + begin + p := new TCRect(gdiobj); + rc := p._getdata_(); + cairo_reset_clip(hdc); + cairo_rectangle(hdc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1]); + cairo_clip(hdc); + end else + begin + cairo_reset_clip(hdc); + end + return r; + end + Function SetTextColor(hdc :pointer;col:integer):integer; + begin + gtk_object_set_data(hdc,"text.color",col); + return true; + end + Function FillRect(dc:pointer;rec:array of integer;br:pointer):integer; + begin + if not dc then return ; + if ifarray(rec) then + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + brs := gtk_gdi_object_globals[inttostr(br)]; + if not brs then return 0; + cl := brs[0].Color; + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + cairo_rectangle(dc, x+rec[0], y+rec[1], rec[2]-rec[0], rec[3]-rec[1]); + gtk_rgb_color_rgb(cl,r,g,b); + cairo_set_source_rgb(dc,r,g,b); + cairo_fill(dc); + end + end + Function InvertRect(dc:pointer;rec:array of integer;br:pointer):integer; + begin + if not dc then return ; + if ifarray(rec) then + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + brs := gtk_gdi_object_globals[inttostr(br)]; + if not brs then return 0; + cl := brs[0].Color; + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + cairo_rectangle(dc, x+rec[0], y+rec[1], rec[2]-rec[0], rec[3]-rec[1]); + gtk_rgb_color_rgb(cl,r,g,b); + cairo_set_source_rgb(dc,1-r,1-g,1-b); + cairo_fill(dc); + end + end + function ReleaseDC(hwd :pointer;hdc:pointer):integer; + begin + + end + function SelectClipRgn(hdc :pointer;gdiobj:pointer); + begin + + r := SelectObject(hdc,gdiobj); + if not(gdiobj) then + begin + gtk_object_set_data(hdc,"rgn",nil); + cairo_reset_clip(hdc); + end + else + begin + rr := gtk_object_get_data(hdc,"rgn"); + if rr <> gdiobj then return ; + p := new TCRect(gdiobj); + rc := p._getdata_(); + cairo_reset_clip(hdc); + x := gtk_object_get_data(dc,"viewport.x"); //ƻ׼λ + y := gtk_object_get_data(dc,"viewport.y"); + cairo_rectangle(hdc,rc[0]+x,rc[1]+y,rc[2]-rc[0],rc[3]-rc[1]); + cairo_clip(hdc); + //gtk_object_set_data(hdc,"rgn",gdiobj); + end + return r; + end + function CreateRectRgn(nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer):pointer; + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + p := new TCRect(); + p.left := nLeftRect; + p.top := nTopRect; + p.right := nRightRect; + p.bottom := nBottomRect; + ptr := p._getptr_(); + gtk_gdi_object_globals[inttostr(ptr)] := array(p,"rgn"); + return ptr; + end + function CombineRgn(hrgnDest:pointer;hrgnSrc1:pointer;hrgnSrc2:pointer; fnCombineMode:integer):integer; + begin + //RGN_ERROR := 0x0;RGN_AND := 0x1;RGN_OR := 0x2;RGN_XOR := 0x3;RGN_DIFF := 0x4;RGN_COPY := 0x5; + rd := new TCRect(hrgnDest); + rs1 := new TCRect(hrgnSrc1); + if fnCombineMode=0x1 then + begin + rs2 := new TCRect(hrgnSrc2); + rd.left := max(rs1.left,rs2.left); + rd.top := max(rs1.top,rs2.top); + rd.right := min(rs1.right,rs2.right); + rd.bottom := min(rs1.bottom,rs2.bottom); + end else + if fnCombineMode=0x5 then + begin + rd.left := rs1.left ; + rd.top := rs1.top ; + rd.right := rs1.right ; + rd.bottom := rs1.bottom ; + end + return ret; + end + + function SetViewportOrgEx(dc:pointer;x:integer;y:integer;var pt:array of integer):integer; + begin + if not dc then return 0; + gtk_object_set_data(dc,"viewport.x",x); + gtk_object_set_data(dc,"viewport.y",y); + return 1; + end + + function DeleteObject(gdiobj :pointer);//ɾgdi + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then return 0; + r := gtk_gdi_object_globals[inttostr( gdiobj)]; + if r then + begin + reindex(gtk_gdi_object_globals,array(inttostr(gdiobj):nil)); + return true; + end + class(TGdiplusflat).GdipDisposeImage(gdiobj); + return 0; + end + function DestroyIcon(icon:pointer):integer; + begin + return DeleteObject(icon); + end + function DestroyCursor(cursor:pointer):integer; + begin + return DeleteObject(cursor); + end + function CreatePen(FS,w,FC); //gtk ģ pen + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + p := new ttgtk_pen(); + p.width := w; + p.color := FC; + p.style := fs; + ptr := p._getptr_(); + gtk_gdi_object_globals[inttostr(ptr)] := array(p,"pen"); + return ptr; + //컭 + end + function CreateSolidBrush(crColor:integer); + begin + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + p := new ttgtk_brush(); + p.color := crColor; + ptr := p._getptr_(); + gtk_gdi_object_globals[inttostr(ptr)] := array(p,"brush"); + return ptr; + end + function CreateFontIndirectA(lplf:pointer); + begin + + global gtk_gdi_object_globals; + if not ifarray(gtk_gdi_object_globals) then gtk_gdi_object_globals := array(); + p := new ttgtk_font(); + p2 := new ttgtk_font(lplf); + for i,v in array("height","width","escapement","orientation","weight","italic","underline","strikeout","charset","outprecision","clipprecision","quality","pitchandfamily","facename") do + p._setvalue_(v,p2._getvalue_(v)); + ptr := p._getptr_(); + gtk_gdi_object_globals[inttostr(ptr)] := array(p,"font"); + return ptr; + end + Function GetTextMetricsA(hdc :pointer;TM:pointer):integer; + begin + + end + Function MoveToEx(hdc :pointer;x:integer;y:integer;var point:array of integer):integer; + begin + xb := gtk_object_get_data(hdc,"viewport.x"); + yb := gtk_object_get_data(hdc,"viewport.y"); + //cairo_move_to(hdc,x+xb,y+yb); + xy := gtk_object_get_data(hdc,"movepointto"); + if xy then + begin + point := xy; + end else point := array(0,0); + gtk_object_set_data(hdc,"movepointto",array(x,y)); + end + Function LineTo(dc :pointer;x:integer;y:integer):integer; + begin + xb := gtk_object_get_data(dc,"viewport.x"); + yb := gtk_object_get_data(dc,"viewport.y"); + pc := gtk_object_get_data(dc,"pen.color"); + pw := gtk_object_get_data(dc,"pen.width"); + pt := gtk_object_get_data(dc,"pen.style"); + if pw>0 then cairo_set_line_width(dc,pw); + else cairo_set_line_width(dc,1); + if pc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(pc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_applay_pen_style(dc); + xy := gtk_object_get_data(dc,"movepointto"); + if xy then + begin + cairo_move_to(dc,xy[0]+xb,xy[1]+yb); + end + gtk_object_set_data(dc,"movepointto",array(x,y)); + cairo_line_to(dc,x+xb,y+yb); + cairo_stroke(dc); + + end + + //////////////////////////gtk ˵////////////////// + Function CreateMenu():pointer; + begin + r := gtk_menu_bar_new(); + gtk_widget_show(r); + return r; + end + Function CreatePopupMenu():pointer; + begin + //˵ + r := gtk_menu_new(); + gtk_widget_show(r); + g_object_set_data(r,"popmenubar",true); + return r; + end + Function DestroyMenu(hMenu:pointer):integer; + begin + return gtk_widget_destroy(hMenu); + end + Function DrawMenuBar(hwd:pointer):integer; //˵ + begin + h :=g_object_get_data(hwd,"gtk_layout_height"); + w :=g_object_get_data(hwd,"gtk_layout_width"); + gtk_widgetsizechanged(hwd,h,w); + end + Function SetMenu(hwd:pointer;hmenu:pointer):integer; //ò˵ + begin + vb := g_object_get_data(hwd,"gtk_vbox"); + if not vb then return ; + mb := g_object_get_data(hwd,"menubar"); + if mb = hmenu then return ; + if mb then + begin + gist := gtk_container_get_children(mb); + ridx := 0; + while gist do + begin + og := new _gslist(gist); + dt := og.data; + if dt then + gtk_container_remove(mb,dt); + ridx++; + gist := og.next; + end + gtk_widget_destroy(mb); + end + if hmenu then + begin + g_object_set_data(hwd,"menubar",hmenu); + g_object_set_data(hmenu,"menubarwindow",hwd); + gtk_box_pack_start(vb,hmenu,0,0,0); + gtk_widget_realize(hmenu); + //gtk_widget_show_all(hmenu); + end + else + begin + g_object_set_data(hwd,"menubar",0); + end + h :=g_object_get_data(hwd,"gtk_layout_height"); + w :=g_object_get_data(hwd,"gtk_layout_width"); + gtk_widgetsizechanged(hwd,h,w); + //Ƴԭд + //menubar ӵ + end + Function RemoveMenu( hMenu:pointer; uPosition:integer;uFlags:integer):integer; + begin + mi := gtk_menu_shell_get_by_positon(hmenu,uPosition); + if mi then + begin + g_object_ref(mi); + gtk_container_remove(hMenu,mi); + return true; + end + + //Ƴ˵Ŀ + end + Function SetMenuItemInfoA( hMenu:pointer; uItem:integer;fByPosition:integer;lpmii:pointer):integer; + begin + return gtk_SetMenuItemInfoA(hMenu,uitem,fbyposition,lpmii); + //Ӳ˵ + end + Function InsertMenuItemA( hMenu:pointer;uItem:integer;fByPosition:integer;lpmii:pointer):integer; + begin + return gtk_insertmenuitema(hMenu,uitem,fbyposition,lpmii); + //Ӳ˵ + end + Function TrackPopupMenu( hMenu:pointer;uFlags:integer; x:integer; y:integer; nReserved:integer;hWnd:pointer; prcRect: array of integer):integer; + begin + //echo "\r\n===trackmenu:",hmenu,"===",x,"===",y,"===",nReserved,"===hwnd:",hwnd,"===rect:",tostn(prcRect); + if g_object_get_data(hMenu,"popmenubar") then + begin + g_object_set_data(hMenu,"popmenubarwindow",hWnd); + gtk_menu_popup(hmenu,0,0,0,0,3,0);// + return 1; + end else + begin + + end + //˵ + end + + function ClientToScreen(hwnd :pointer;var p:array of integer):integer; // Ŭ + begin + if not hwnd then return ; + if not GTK_WIDGET(hwnd) then return ; + x := g_object_get_data(hwnd,"gtk_layout_x"); + y := g_object_get_data(hwnd,"gtk_layout_y"); + p[0]+=x; + p[1]+=y; + if not gtk_widget_is_toplevel(hwnd) then + begin + phwnd := GetParent(hwnd); + return ClientToScreen(phwnd,p); + end else + begin + mb := g_object_get_data(hwnd,"menubar"); + if mb and gtk_widget_is_visible(mb) then + begin + rec := zeros(4); + gtk_widget_get_allocation(mb,rec); + if rec[3]>1 then + begin + p[1]+= rec[3] ;//max(rec[3],25); + end + + end + end + return true; + end + function ScreenToClient(hwnd :pointer;var p:array of integer):integer;// Ŭ + begin + p1 := array(0,0); + ClientToScreen(hwnd,p1); + p[0]-=p1[0]; + p[1]-=p1[1]; + return true; + end + function BeginPaint(hwd :pointer;strc:pointer):pointer; + begin + psc := new TPAINTSTRUCT(strc); + dc := g_object_get_data(hwd,"paint_dc"); + h := g_object_get_data(hwd,"paint_height"); + w := g_object_get_data(hwd,"paint_width"); + psc._setvalue_("hdc",dc); + psc._setvalue_("rcpaint",array(0,0,w,h)); + return dc; + end + function EndPaint(hwd :pointer;strc:pointer):integer; + begin + return 0; + end + function SaveDC(hdc :pointer):integer; + begin + if not(hdc>0 or hdc<0) then return ; + cairo_save(hdc); //Ҫ + end + function RestoreDC(hdc :pointer;nSavedDC:integer):integer; + begin + if not(hdc>0 or hdc<0) then return ; + cairo_restore(hdc); //Ҫ + end + function DeleteDC(hdc :pointer):integer; + begin + if not(hdc>0 or hdc<0) then return ; + gtk_object_set_data(hdc); // + cairo_destroy(hdc); //Ҫ + end + function GetTextExtentPoint32A(hdc:pointer;lpString:string;c:integer; psizl:pointer):integer; + begin + end + function GetTextExtentPoint32A2(hdc:pointer;lpString:string;c:integer; var psizl:array of integer):integer; + begin + psizl := array(0,0); + if not(hdc>0 or hdc<0) then return 0; + if not( ifstring(lpString) and c>0 and c>=length(lpString)) then return 0; + ft := gtk_object_get_data(hdc,"font"); + global gtk_gdi_object_globals; + wd := 8; + ht := 16; + if ft and ifarray(gtk_gdi_object_globals) then + begin + fto := gtk_gdi_object_globals[inttostr(ft)]; + if fto then fto := fto[0]; + if fto then //ִ + begin + fc := fto._getvalue_("facename"); + ht := fto._getvalue_("height"); + wd := fto._getvalue_("width"); + end + end + psizl[0] := wd*length(lpString); + psizl[1] := ht; + return 1; + + end + function GetCharWidthA(hdc:pointer;iFirst:integer;iLast:integer;var lpBuffer:array of integer):integer; + begin + + + end + Function Rectangle(dc :pointer;l:integer;t:integer;r:integer;b:integer):integer; + begin + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + pc := gtk_object_get_data(dc,"pen.color"); + pw := gtk_object_get_data(dc,"pen.width"); + if pw>0 then cairo_set_line_width(dc,pw); + else cairo_set_line_width(dc,1); + if pc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(pc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_applay_pen_style(dc); + cairo_move_to(dc,l+x,t+y); + cairo_line_to(dc,r+x,t+y); + cairo_line_to(dc,r+x,b+y); + cairo_line_to(dc,l+x,b+y); + cairo_line_to(dc,l+x,t+y); + cairo_stroke(dc); + //return + cairo_stroke_preserve(dc); + bsh := gtk_object_get_data(dc,"brush.color"); + gtk_rgb_color_rgb(bsh,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + cairo_fill(dc); + end + Function Ellipse(dc :pointer;l:integer;t:integer;r:integer;b:integer):integer; + begin + //Բ + // + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + pc := gtk_object_get_data(dc,"pen.color"); + pw := gtk_object_get_data(dc,"pen.width"); + brc := gtk_object_get_data(dc,"brush.color"); + if pw>0 then cairo_set_line_width(dc,pw); + else cairo_set_line_width(dc,1); + + mx := (l+r)/2+x; + my := (b+t)/2+y; + cairo_translate(dc,mx,my); + rx := (r-l)/2; + ry := (b-t)/2; + cairo_scale(dc,1,ry/rx); + cairo_applay_pen_style(dc); + cairo_arc(dc, 0, 0, rx, 0, 2 * 3.14); + if brc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(brc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_fill_preserve(dc); + if pc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(pc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_stroke(dc); + cairo_scale(dc,1,rx/ry); + cairo_translate(dc,0-mx,0-my); + end + Function RoundRect(dc :pointer;l:integer;t:integer;r:integer;b:integer;wid:integer;ht:integer):integer; + begin + xb := gtk_object_get_data(dc,"viewport.x"); + yb := gtk_object_get_data(dc,"viewport.y"); + pc := gtk_object_get_data(dc,"pen.color"); + pw := gtk_object_get_data(dc,"pen.width"); + + if pw>0 then cairo_set_line_width(dc,pw); + else cairo_set_line_width(dc,1); + cairo_applay_pen_style(dc); + cairo_draw_round_rectangle(dc,l,t,r-l,b-t,wid); + + bsh := gtk_object_get_data(dc,"brush.color"); + gtk_rgb_color_rgb(bsh,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + cairo_fill_preserve(dc); //Ƶɫ + if pc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(pc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_stroke(dc);//Ʊ߿ + return ; + end + Function Chord(hdc :pointer;l:integer;t:integer;r:integer;b:integer;wid:integer;ht:integer):integer; + begin + + end + Function Pie(hdc :pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer;nXRadial1:integer;nYRadial1:integer;nXRadial2:integer;nYRadial2:integer):integer; + begin + + end + Function SetArcDirection(hdc :pointer;direct:integer):integer; + begin + + end + Function Arc(hdc :pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer;nXRadial1:integer;nYRadial1:integer;nXRadial2:integer;nYRadial2:integer):integer; + begin + + end + Function Polygon(hdc :pointer;points:array of integer;n:integer):integer; + begin + + end + Function PolyBezier(hdc :pointer;points:array of integer;n:integer):integer; + begin + + end + Function SetPolyFillMode(hdc :pointer;md:integer):integer; + begin + + end + Function Polyline(dc :pointer;points:array of integer;n:integer):integer; + begin + if n<2 then return ; + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + pc := gtk_object_get_data(dc,"pen.color"); + pw := gtk_object_get_data(dc,"pen.width"); + if pw>0 then cairo_set_line_width(dc,pw); + else cairo_set_line_width(dc,1); + if pc=0 then + begin + cairo_set_source_rgb(dc,0,0,0); + end else + begin + gtk_rgb_color_rgb(pc,rc,gc,bc); + cairo_set_source_rgb(dc,rc,gc,bc); + end + cairo_move_to(dc,points[0]+x,Points[1]+y); + cairo_applay_pen_style(dc); + for i := 1 to n-1 do + begin + cairo_line_to(dc,Points[i*2]+x,Points[i*2+1]+y); + end + cairo_stroke(dc); + end + Function PolyPolyline(hdc :pointer;points:array of integer;pc:array of integer;n:integer):integer; + begin + + end + Function DrawFrameControl(DC:pointer; var LPRECT: array of integer ; dr1 :integer;dr2:integer):integer; + begin + { + DFC_SCROLL := 0x3;DFC_BUTTON := 0x4;DFC_POPUPMENU := 0x5; + DFCS_CAPTIONCLOSE := 0x0;DFCS_CAPTIONMIN := 0x1;DFCS_CAPTIONMAX := 0x2; + DFCS_CAPTIONRESTORE := 0x3;DFCS_CAPTIONHELP := 0x4;DFCS_MENUARROW := 0x0; + DFCS_MENUCHECK := 0x1;DFCS_MENUBULLET := 0x2;DFCS_MENUARROWRIGHT := 0x4; + DFCS_SCROLLUP := 0x0;DFCS_SCROLLDOWN := 0x1;DFCS_SCROLLLEFT := 0x2; + DFCS_SCROLLRIGHT := 0x3;DFCS_SCROLLCOMBOBOX := 0x5;DFCS_SCROLLSIZEGRIP := 0x8; + DFCS_SCROLLSIZEGRIPRIGHT := 0x10;DFCS_BUTTONCHECK := 0x0;DFCS_BUTTONRADIOIMAGE := 0x1; + DFCS_BUTTONRADIOMASK := 0x2;DFCS_BUTTONRADIO := 0x4;DFCS_BUTTON3STATE := 0x8; + DFCS_BUTTONPUSH := 0x10;DFCS_INACTIVE := 0x100;DFCS_PUSHED := 0x200; + DFCS_CHECKED := 0x400;DFCS_TRANSPARENT := 0x800;DFCS_HOT := 0x1000; + DFCS_ADJUSTRECT := 0x2000;DFCS_FLAT := 0x4000;DFCS_MONO := 0x8000; + + } + x := gtk_object_get_data(dc,"viewport.x"); + y := gtk_object_get_data(dc,"viewport.y"); + case dr1 of + 0x4 : //DFC_BUTTON + begin + //if dr2 = 0x10 then // DFCS_BUTTONPUSH + //begin + + //end else + cairo_applay_pen_style(dc); + if dr2 = 0 then // DFCS_BUTTONCHECK + begin + cairo_set_source_rgb(dc,135/255,135/255,135/255); + cairo_set_line_width(dc,5); + + cairo_rectangle (dc, LPRECT[0]+x, LPRECT[1]+y, LPRECT[2]-LPRECT[0], LPRECT[3]-LPRECT[1]); + cairo_stroke_preserve(dc); + cairo_set_source_rgb(dc,1,1,1); + cairo_fill(dc); + end else + if dr2 = 0x400 then // DFCS_CHECKED + begin + cairo_set_source_rgb(dc,135/255,135/255,135/255); + cairo_set_line_width(dc,5); + + cairo_rectangle (dc, LPRECT[0]+x, LPRECT[1]+y, LPRECT[2]-LPRECT[0], LPRECT[3]-LPRECT[1]); + cairo_stroke_preserve(dc); + cairo_set_source_rgb(dc,1,1,1); + cairo_fill(dc); + + cairo_move_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/3); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,LPRECT[3]-2); + cairo_line_to(dc,LPRECT[2]-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/4); + cairo_set_source_rgb(dc,100/255,100/255,100/255); + cairo_set_line_width(dc,4); + cairo_stroke(dc); + end else + if dr2 = 0x1 then // DFCS_BUTTONRADIOIMAGE + begin + cairo_set_source_rgb(dc,135/255,135/255,135/255); + cairo_set_line_width(dc,5); + l := LPRECT[0]; + r := LPRECT[2]; + t := LPRECT[1]; + b := LPRECT[3]; + mx := (l+r)/2+x; + my := (b+t)/2+y; + cairo_translate(dc,mx,my); + rx := (r-l)/2; + ry := (b-t)/2; + cairo_scale(dc,1,ry/rx); + + cairo_arc(dc, 0, 0, rx, 0, 2 * 3.14); + cairo_stroke_preserve(dc); + cairo_set_source_rgb(dc,1,1,1); + cairo_fill(dc); + cairo_set_line_width(dc,1); + cairo_arc(dc, 0, 0, max(rx-5,3), 0, 2 * 3.14); + cairo_set_source_rgb(dc,100/255,100/255,100/255); + cairo_fill(dc); + cairo_scale(dc,1,rx/ry); + cairo_translate(dc,0-mx,0-my); + end else + if dr2 = 0x4 then // DFCS_BUTTONRADIO + begin + cairo_set_source_rgb(dc,135/255,135/255,135/255); + cairo_set_line_width(dc,5); + l := LPRECT[0]; + r := LPRECT[2]; + t := LPRECT[1]; + b := LPRECT[3]; + mx := (l+r)/2+x; + my := (b+t)/2+y; + cairo_translate(dc,mx,my); + rx := (r-l)/2; + ry := (b-t)/2; + cairo_scale(dc,1,ry/rx); + + cairo_arc(dc, 0, 0, rx, 0, 2 * 3.14); + cairo_stroke_preserve(dc); + cairo_set_source_rgb(dc,1,1,1); + cairo_fill(dc); + cairo_scale(dc,1,rx/ry); + cairo_translate(dc,0-mx,0-my); + end else + begin + cairo_set_line_width(dc,4); + + cairo_rectangle(dc, LPRECT[0]+x, LPRECT[1]+y, LPRECT[2]-LPRECT[0], LPRECT[3]-LPRECT[1]); + {cairo_move_to(dc,LPRECT[0]+x,LPRECT[1]+y); + cairo_line_to(dc,LPRECT[2]+x,LPRECT[1]+y); + cairo_line_to(dc,LPRECT[2]+x,LPRECT[3]+y); + cairo_line_to(dc,LPRECT[0]+x,LPRECT[3]+y); + cairo_line_to(dc,LPRECT[0]+x,LPRECT[1]+y); + cairo_set_source_rgb(dc,200/255,200/255,200/255); + cairo_stroke_preserve(dc); + cairo_set_source_rgb(dc,221/255,221/255,221/255); + cairo_fill(dc);} + + cairo_set_source_rgb(dc,221/255,221/255,221/255); + cairo_fill_preserve(dc); + cairo_set_source_rgb(dc,210/255,207/255,205/255); + cairo_stroke(dc); + end + end + 0x3 : // DFC_SCROLL + begin + cairo_set_source_rgb(dc,221/255,221/255,221/255); + cairo_set_line_width(dc,0.1); + cairo_applay_pen_style(dc); + cairo_rectangle(dc, LPRECT[0]+x, LPRECT[1]+y, LPRECT[2]-LPRECT[0], LPRECT[3]-LPRECT[1]); + cairo_fill(dc); + + if dr2 = 0 then // DFCS_SCROLLUP + begin + cairo_move_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/1.5); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/2,LPRECT[1]+3); + cairo_line_to(dc,LPRECT[2]-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/1.5); + cairo_line_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/1.5); + cairo_set_source_rgb(dc,10/255,10/255,10/255); + cairo_fill(dc); + end else + if dr2 = 1 then // DFCS_SCROLLDOWN + begin + cairo_move_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/3); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/2,LPRECT[3]-3); + cairo_line_to(dc,LPRECT[2]-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/3); + cairo_line_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/3); + cairo_set_source_rgb(dc,10/255,10/255,10/255); + cairo_fill(dc); + end + if dr2 = 2 then //DFCS_SCROLLLEFT; + begin + cairo_move_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])*2/3,LPRECT[1]+y+2); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])*2/3,LPRECT[3]+y-2); + cairo_line_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/2); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])*2/3,LPRECT[1]+y+2); + + cairo_set_source_rgb(dc,10/255,10/255,10/255); + cairo_fill(dc); + end else + if dr2 = 3 then //DFCS_SCROLLRIGHT; + begin + cairo_move_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,LPRECT[1]+y+2); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,LPRECT[3]+y-2); + cairo_line_to(dc,LPRECT[2]+x-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/2); + cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,LPRECT[1]+y+2); + + cairo_set_source_rgb(dc,10/255,10/255,10/255); + cairo_fill(dc); + end + end + end + + end + Function SetBkColor(dc:pointer;clrref:integer):integer; + begin + //fontɫ + gtk_object_set_data(dc,"font.bkcolor",clrref); + end + Function GetBkColor(dc:pointer):integer; + begin + return gtk_object_get_data(dc,"font.bkcolor"); + end + Function SetBkMode(dc:pointer;clrref:integer):integer; + begin + gtk_object_set_data(dc,"font.bkmode",clrref); + end + Function GetBkMode(dc:pointer):integer; + begin + return gtk_object_get_data(dc,"font.bkmode"); + end + Function FillRgn(dc:pointer;rgn:pointer;br:pointer):integer; + begin + + end + Function SetTextAlign(dc:pointer;fMode:integer):integer; + begin + + end + Function SetWorldTransform(dc:pointer;lpXform:pointer):integer; + begin + + end + + function UpdateWindow(hwnd :pointer):integer; + begin + w :=g_object_get_data(hwnd,"gtk_layout_width"); + h := g_object_get_data(hwnd,"gtk_layout_height"); + gtk_widgetsizechanged(hwnd,h,w); + return true; + end + function ClipCursor(rec:array of integer):integer; + begin + + end + function SetFocus(hwnd :pointer):pointer; + begin + cfcs := GetFocus(); + if cfcs = hwnd then return 0; + if not(hwnd>0 or hwnd<0) then return 0; + ph := hwnd; + if not GTK_WIDGET(hwnd) then return 0; + if not gtk_widget_is_toplevel(hwnd) then + begin + ph := gtk_widget_get_toplevel(hwnd); + end + //if not lot then + //lot := hwnd; + //gtk_widget_grab_focus(lot); + //echo "\r\n+++setfocus>>>",ph,">>>",hwnd; + gtk_window_set_focus(ph,hwnd); + return 0; + + end + function GetFocus():pointer; + begin + global g_current_get_focus_widget; + if g_current_get_focus_widget then return g_current_get_focus_widget; + return 0; + end + Function LoadImageA(hinst:pointer;lpszName:string; uType:integer; cxDesired:integer;cyDesired:integer;fuLoad:integer):pointer; + begin + + end + function LoadBitmapA(hin:pointer;lpsz:string):pointer; + begin + + end + function LoadBitmapA2(hin:pointer;lpsz:pointer):pointer; + begin + + end + Function GetObjectA(hgdiobj:pointer;cbBuffer:integer;lpvObject:pointer):integer; + begin + bmpobj := new TSHBMP(lpvObject); + bmpobj.bmwidth := gdk_pixbuf_get_width(hgdiobj); + bmpobj.bmheight := gdk_pixbuf_get_height(hgdiobj); + return ; + end + function GetIconInfo(hIcon:pointer; piconinfo:pointer):integer; + begin + //icoobj := new TSHICON(lpvObject); + //icoobj.bmwidth := gdk_pixbuf_get_width(hgdiobj); + //icoobj.bmheight := gdk_pixbuf_get_height(hgdiobj); + return ; + end + function CreateCompatibleDC(hdc :pointer):pointer; + begin + sf := cairo_image_surface_create(0,100,100); + r := cairo_create(sf); + return r; + return 0; + end + Function SetCursor(hd:pointer):pointer; + begin + global g_show_cursor_window; + if g_show_cursor_window and hd<>0 then + gdk_window_set_cursor(g_show_cursor_window,hd); + end + function drawbitmaptodc(bm,hdc,x,y,rc,flag,thdc); + begin + if not hdc then return ; + xb := gtk_object_get_data(hdc,"viewport.x"); + yb := gtk_object_get_data(hdc,"viewport.y"); + img := class(TGdiplusflat).GdipGetbmpSurface(bm); + //cairo_set_source(hdc, img); + //cairo_pattern_set_extend(cairo_get_source(hdc),1); + cairo_set_source_surface(hdc, img, x-rc[0], y-rc[1]); + cairo_rectangle(hdc,xb+x,yb+y,rc[2]-rc[0],rc[3]-rc[1]); + if flag = 0x8800c6 or flag = 0x4 then + begin + //echo "\r\nset alopha***********"; + //cairo_paint_with_alpha(hdc,0.5); + //cairo_set_source_rgba(hdc, 0.6, 0.6, 0.6, 0.5); + end else + begin + //cairo_paint_with_alpha(hdc,0); + //cairo_paint_with_alpha(hdc,1); + //cairo_set_source_rgba(hdc, 1.0, 1.0, 1.0, 0); + //cairo_fill(hdc); + end + cairo_fill(hdc); + //cairo_set_source_surface(hdc, img, x-rc[0], y-rc[1]); + end + function drawbitmapstretchtodc(bm,hdc,drect,rc,flag,thdc); + begin + if not hdc then return ; + xb := gtk_object_get_data(hdc,"viewport.x"); + yb := gtk_object_get_data(hdc,"viewport.y"); + img := class(TGdiplusflat).GdipGetbmpSurface(bm); + if not img then return ; + x := drect[0]; + y := drect[1]; + p1 := (drect[2]-drect[0])/(rc[2]-rc[0]); + p2 := (drect[3]-drect[1])/(rc[3]-rc[1]); + if p1<0 or p2<0 then return 0; + cairo_translate(hdc,xb+x,yb+y); + cairo_scale(hdc,p1,p2); + cairo_set_source_surface(hdc, img, 0, 0); + cairo_rectangle(hdc,0,0,rc[2]-rc[0],rc[3]-rc[1]); + if flag = 0x8800c6 or flag = 0x4 then + begin + //echo "\r\nset alopha*******+++****************"; + //cairo_paint_with_alpha(hdc,0.5); + //cairo_set_source_rgba(hdc, 0.6, 0.6, 0.6, 0.5); + end else + begin + //cairo_paint_with_alpha(hdc,0); + //cairo_paint_with_alpha(hdc,1); + //cairo_set_source_rgba(hdc, 1.0, 1.0, 1.0, 0); + + end + cairo_fill(hdc); + cairo_scale(hdc,1/p1,1/p2); + cairo_translate(hdc,0-xb-x,0-yb-y); + end + function DrawIcon(hDC:pointer;X:integer;Y:integer;hIcon:pointer):integer; + begin + if not hdc then return ; + xb := gtk_object_get_data(hdc,"viewport.x"); + yb := gtk_object_get_data(hdc,"viewport.y"); + img := class(TGdiplusflat).GdipGetbmpSurface(hIcon); + if not img then return 0; + cairo_set_source_surface(hdc, img, x+xb, y+yb); + cairo_paint(hdc); + return true; + end + //////////////////////imagelist///////////////////////////////////////////////////////////////////////// + function ImageList_Add(himl:pointer;hbmImage:pointer; hbmMask:pointer):integer; + begin + if not(himl>0 or himl<0) then return 0; + if not(hbmImage>0 or hbmImage<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then g_image_list_caches := array(); + sptr := inttostr(himl); + obj := g_image_list_caches[sptr,"imglist"] ; + if not obj then return ; + class(TGdiplusflat).GdipCreateBitmapFromHBITMAP(hbmImage,r1,0); + bmp := new TBitmap(); + bmp.Handle := r1; + obj.Push(bmp); + end + function ImageList_AddMasked(himl:pointer;hbmImage:pointer; crMask:integer):integer; + begin + return ImageList_Add(himl,hbmImage,crMask); + end + function ImageList_BeginDrag(himlTrack:pointer; iTrack:integer;x:integer;y:integer):integer; + begin + global g_gtk_drag_window,g_image_list_caches,g_gtk_dragxy ; + if not ifarray(g_image_list_caches) then return ; + if not(himlTrack>0 or himlTrack<0) then return ; + sptr := inttostr(himlTrack); + if not g_gtk_drag_window then + begin + g_gtk_drag_window := new TCustomControl(getapplication()); + g_gtk_drag_window.color := rgb(180,180,180); + g_gtk_drag_window.Border := false; + g_gtk_drag_window.WsPopUp := true; + g_gtk_drag_window.Enabled := false; + g_gtk_drag_window.Visible := false; + end + cx := g_image_list_caches[sptr,"width"] ; + cy := g_image_list_caches[sptr,"height"] ; + obj := g_image_list_caches[sptr,"imglist"] ; + if not(cx>0 and cy>0) then return ; + if obj then + begin + g_gtk_drag_window.BKBitmap := obj[i]; + cx+=2; + cy+=2; + end + g_gtk_drag_window.SetBounds(0,0,cx,cy); + g_gtk_dragxy := array(x,y); + end + function ImageList_DragMove(x:integer;y:integer):integer; + begin + global g_gtk_drag_window,g_gtk_drag_lock_window,g_gtk_dragxy; + if not g_gtk_drag_window then return ; + xy := g_gtk_drag_lock_window.ClientToScreen(x,y); + SetWindowPos(g_gtk_drag_window.Handle,0,xy[0]-g_gtk_dragxy[0],xy[1]-g_gtk_dragxy[1],-1,-1,0); + end + function ImageList_DragEnter(hwndLock:pointer;x:integer;y:integer):integer; + begin + global g_gtk_drag_window,g_gtk_drag_lock_window; + if not g_gtk_drag_window then return ; + g_gtk_drag_lock_window := class(TGlobalComponentcache).getwndbyhwnd(hwndLock); + if not g_gtk_drag_lock_window then return ; + g_gtk_drag_window.Parent := g_gtk_drag_lock_window; + g_gtk_drag_window.Enabled := false; + ImageList_DragMove(x,y); + g_gtk_drag_window.show( 0x4); + end + function ImageList_DragLeave(hwndLock:pointer):integer; + begin + global g_gtk_drag_window,g_gtk_drag_lock_window; + g_gtk_drag_lock_window := nil; + if not g_gtk_drag_window then return ; + g_gtk_drag_window.show(0); + end + procedure ImageList_EndDrag(); + begin + //global g_gtk_drag_window; + //g_gtk_drag_window.show(0); + end + function ImageList_Create(cx:integer; cy:integer; flags:integer; cInitial:integer;cGrow:integer):pointer; + begin + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then g_image_list_caches := array(); + ptr := new tcstring(8)._getptr_(); + sptr := inttostr(ptr); + g_image_list_caches[sptr,"width"] := cx; + g_image_list_caches[sptr,"height"] := cy; + g_image_list_caches[sptr,"flags"] := flags; + g_image_list_caches[sptr,"initial"] := cInitial; + g_image_list_caches[sptr,"grow"] := cGrow; + g_image_list_caches[sptr,"imglist"] := new TMyArrayB(); + return ptr; + end + function ImageList_Draw(himl:pointer;i:integer;hdcDst:pointer;x:integer;y:integer;fStyle:integer):integer; + begin + if not(himl>0 or himl<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + sptr := inttostr(himl); + obj := g_image_list_caches[sptr,"imglist"]; + if not obj then return ; + bmp := obj[i]; + if not bmp then return ; + cx := g_image_list_caches[sptr,"width"]; + cy := g_image_list_caches[sptr,"height"]; + drawbitmapstretchtodc(bmp.Handle,hdcDst,array(x,y,x+cx,y+cy),array(0,0,bmp.bmwidth,bmp.bmheight),fStyle,0); + end + function ImageList_Destroy(himl:pointer):integer; + begin + if not(himl>0 or himl<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + reindex(g_image_list_caches,array(inttostr(himl):nil)); + end + function ImageList_Replace(himl:pointer;id:integer;hbmImage:pointer; hbmMask:pointer):integer; + begin + if not(himl>0 or himl<0) then return 0; + if not(hbmImage>0 or hbmImage<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + obj := g_image_list_caches[inttostr(himl),"imglist"]; + if not obj then return ; + class(TGdiplusflat).GdipCreateBitmapFromHBITMAP(hbmImage,0,r1); + bmp := new TBitmap(); + bmp.Handle := r1; + if id=-1 then obj.Push(bmp); + else + obj.splice(id,1,bmp); + end + function ImageList_Remove(himl:pointer;id:integer):integer; + begin + if not(himl>0 or himl<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + obj := g_image_list_caches[inttostr(himl),"imglist"]; + if not obj then return ; + if id=-1 then obj.pop(); + else + obj.splice(id,1); + end + function ImageList_SetBkColor(himl:pointer;clrBk:integer):integer; + begin + + end + function ImageList_LoadImageA2(hi:pointer;lpbmp:pointer;cx:integer;cGrow:integer; crMask:integer;uType:integer;uFlags:integer):pointer; + begin + + end + function ImageList_GetBkColor(himl:pointer):integer; + begin + + end + function ImageList_GetDragImage(ppt:pointer;pptHotspot:pointer):pointer; + function ImageList_GetImageCount(himl:pointer):integer; + begin + if not(himl>0 or himl<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + obj := g_image_list_caches[inttostr(himl),"imglist"]; + if not obj then return 0; + return obj.length(); + end + function ImageList_SetImageCount(himl:pointer;clrBk:integer):integer; + function ImageList_Copy(himlDst:pointer;iDst:integer; himlSrc:pointer;iSrc:integer;uFlags:integer):integer; + function ImageList_Duplicate(himl:pointer):pointer; + function ImageList_Merge(himl1:pointer;i1:integer;himl2:pointer;i2:integer;dx:integer;dy:integer):pointer; + function ImageList_SetDragCursorImage(himlDrag:pointer;iDrag:integer;dxHotspot:integer;dyHotspot:integer):integer; + function ImageList_GetImageInfo(himl:pointer; i:integer;pImageInfo:pointer):integer; + begin + + end + function ImageList_ReplaceIcon(himl:pointer;i:integer;hicon:pointer):integer; + begin + return ImageList_Replace(himl,i,hicon,0); + end + function ImageList_SetIconSize(himl:pointer;cx:integer;cy:integer):integer; + function ImageList_GetIconSize(himl:pointer;var cx:integer;var cy:integer):integer; + begin + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + sptr := inttostr(himl); + cx := g_image_list_caches[sptr,"width"]; + cy := g_image_list_caches[sptr,"height"]; + return 1; + end + function ImageList_GetIcon(himl:pointer;i:integer;flags:integer):pointer; + begin + if not(himl>0 or himl<0) then return 0; + global g_image_list_caches ; + if not ifarray(g_image_list_caches) then return 0; + obj := g_image_list_caches[inttostr(himl),"imglist"]; + if not obj then return ; + r := obj[i]; + if r then return r.Handle; + return 1; + end + function ImageList_DrawIndirect(pimldp:pointer):pointer; + function ImageList_DragShowNolock(fShow:integer):integer; + ////////////////////////////////////////////////////// + ////////////////////////clipboard//////////////////////////////////////// +function OpenClipboard(h); +begin + return true; +end +function EmptyClipboard(); +begin + +end +function CloseClipboard(); +begin + return true; +end +function IsClipboardFormatAvailable(fmt); +begin + return true; +end +function getclipboardtext(clpd); +begin + c := gtk_clipboard_get(69); + r := gtk_clipboard_wait_for_text(c); + if r then r := GtkStringToTsl(r); + //echo "\r\ncop wire:",writefile(rwraw(),"","/tmp/test12.txt",0,length(r),r); + + return r; +end +function setclipboardtext(clbd,s); +begin + c := gtk_clipboard_get(69); + if ifstring(s) and s then + begin + gs := TslStringToGtk(s); + return gtk_clipboard_set_text(c,gs,length(gs)); + end else + if ifnil(s) then gtk_clipboard_set_text(c,"",0); + return 1; +end +function getclipboardbmp(); +begin + return 0; +end +function setclipboardbmp(); +begin + return false; +end +//////////////////////////////////////end clip board ////////////////////////////////// + +//////////////////////////////timmer////////////////// + class function SetTimer(hWnd:pointer; nIDEvent:pointer; uElapse:integer;lpTimerFunc:pointer):integer; + begin + global g_gtk_ttimer_cache; + if not ifarray(g_gtk_ttimer_cache) then g_gtk_ttimer_cache := array(); + sc := array( + (0,"int",0), + (1,"int",0)); + obj := tslcstructure(sc); + + rt := g_timeout_add(uElapse,lpTimerFunc,obj._getptr_() ); + g_gtk_ttimer_cache[rt] := obj; + obj._setvalue_(0,rt); + return rt; + + end + class function KillTimer(hWnd:pointer; nIDEvent:pointer):integer; + begin + global g_gtk_ttimer_cache; + if not ifarray(g_gtk_ttimer_cache) then return 0; + obj := g_gtk_ttimer_cache[nIDEvent] ; + g_source_remove(obj._getvalue_(0)); + reindex(g_gtk_ttimer_cache,array(nIDEvent:nil)); + return true; + end + //////////////////////////////////////////////////////////////////// + type TtagOFNA_ = class(tslcstructureobj) + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("lstructsize","int",152), + ("hwndowner","intptr",0), + ("hinstance","intptr",0), + ("lpstrfilter","intptr",0), + ("lpstrcustomfilter","intptr",0), + ("nmaxcustfilter","int",0), + ("nfilterindex","int",1), + ("lpstrfile","intptr",2049), + ("nmaxfile","int",2048), + ("lpstrfiletitle","intptr",512), + ("nmaxfiletitle","int",511), + ("lpstrinitialdir","intptr",0), + ("lpstrtitle","intptr",0), + ("flags","int",0), //6148 + ("nfileoffset","byte[2]",(0,0)), + ("nfileextension","byte[2]",(0,0)), + ("lpstrdefext","intptr",0), + ("lcustdata","intptr",0), + ("lpfnhook","intptr",0), + ("lptemplatename","intptr",0), + ("pvreserved","intptr",0), + ("dwreserved","int",0), + ("flagsex","int",0))); + //lpstrdefext + return SSTRUCT; + end + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + end + function GetOpenFileNameA(LPOPENFILENAMEA:pointer):integer; + begin + + r := GetSaveFileNameA(LPOPENFILENAMEA); + + return r; + end + function GetSaveFileNameA(LPOPENFILENAMEA:pointer):integer; + begin + global g_open_file_flag; + r := false; + obj := new TtagOFNA_(LPOPENFILENAMEA); + wd := obj._getvalue_("hwndowner"); + wd := wd?:nil; + if wd then wd := gtk_widget_get_toplevel(wd); + mulsel := false; + if obj._getvalue_("flags") .& 0x200 then mulsel := true; + //echo "\r\n>>>", obj._getvalue_("nmaxfiletitle"); + if mulsel then + begin + cdlg := gtk_file_chooser_dialog_new("file selector",wd,0,"open",100,"cancel",50,nil); + gtk_file_chooser_set_select_multiple(cdlg,true); + end else + begin + cdlg := gtk_file_chooser_dialog_new("file selector",wd,1,"open",100,"cancel",50,nil); + end + dfdir := obj._getvalue_("lpstrinitialdir"); + if dfdir then //Ĭλ + begin + df := ReadStringFromPtr(dfdir); + if df then + begin + gtk_file_chooser_set_filename(cdlg,TslStringToGtk( df)); + end + end + if 100=gtk_dialog_run(cdlg)then + begin + mf := obj._getvalue_("nmaxfile"); + if mulsel then + begin + gfs := gtk_file_chooser_get_filenames(cdlg); + gf := ""; + ff1 := true; + fodpos := 0; + ffd := "/"; + while gfs do + begin + if mf1 then + ffd := dts[1:fodpos-1]; + else ffd := "/"; + gf :=ffd; + gf+="\0"; + end + if fodpos 1 then + begin + bts := ReadBytesFromPtr(obj._getvalue_("lpstrfilter"),obj._getvalue_("nmaxfiletitle")); + fndx := ""; + for i ,v in bts do + begin + if bts[i]=0 and bts[i+1]=0 then break; + fndx+=chr(bts[i]); + end + stp := str2array(fndx,"\0")[fidx*2-1]; + for i := length(stp) downto 1 do + begin + if stp[i] = "." then + begin + stype := stp[i:]; + end + end + for i := length(gf) downto 1 do + begin + gfi := gf[i]; + if gfi="/" then + begin + gf+=stype; + break; + end else + if gfi = "." then + begin + break; + end + end + end + end + if gf then + begin + gf := GtkStringToTsl( gf); + fptr := obj._getvalue_("lpstrfile"); + bts := zeros(length(gf)+1); + for i := 1 to length(gf) do + begin + bts[i-1] := ord(gf[i]); + end + WriteBytesToPtr(fptr,bts); + r := true; + end + end + gtk_widget_destroy(cdlg); + return r; + end + function ChooseFontA(LOGFONTA:pointer):integer; + begin + + obj := new ttagCHOOSEFONTA(LOGFONTA); + lgobj := obj._getvalue_("lplogfont"); + ht := lgobj._getvalue_("height"); + hts := ""; + if ht>5 then hts := inttostr(ht); + ss := lgobj._getvalue_("facename")+" "+(lgobj._getvalue_("italic")?"Italic":"")+" "+((lgobj._getvalue_("weight")=700)?"Bold":"") + " "+ hts;; + cdlg := gtk_font_selection_dialog_new("font select"); + gtk_font_selection_dialog_set_preview_text(cdlg,"test fonttext"); + gtk_font_selection_dialog_set_font_name(cdlg,TslStringToGtk(ss)); + if gtk_dialog_run(cdlg)=-5 then //ȷ + begin + s := GtkStringToTsl( gtk_font_selection_dialog_get_font_name(cdlg)); + fns := static pango_font_family_get_names(); + for i,v in fns do + begin + if pos(v,s)=1 then + begin + lgobj._setvalue_("facename",GtkStringToTsl(v)); + if pos("Italic",s) then + begin + lgobj._setvalue_("italic",1); + end else + begin + lgobj._setvalue_("italic",0); + end + if pos("Bold",s) then + begin + lgobj._setvalue_("weight",700); + end else + begin + lgobj._setvalue_("weight",400); + end + nms := inttostr(0->9); + for j := 1 to length(s) do + begin + if s[j] in nms then + begin + nm := s[j]; + for jj:= j+1 to length(s) do + begin + if s[jj] in nms then + begin + nm+=s[jj]; + end else break; + end + break; + end + end + if nm then + begin + ht := strtoint(nm); + lgobj._setvalue_("height",ht); + lgobj._setvalue_("width",integer(ht/2)); + end + break; + end + end + r := true; + end + gtk_widget_destroy(cdlg); + return r; + end + function ChooseColorA(LOGFONTA:pointer):integer;//ɫѡ + begin + obj := new ttagCHOOSECOLORA(LOGFONTA); + cdlg := gtk_color_selection_dialog_new("color select dialog"); + btnptr := tsl_gtk_color_selection_property(cdlg); //λ + cpbtns := tslcstructure(array((0,"intptr",0)),nil,nil,btnptr); + cbtnobj := cpbtns._getvalue_(0); + color := new _GdkColor(); + rc := obj.rgbresult ; + rcs := array(getrvalue(rc),getgvalue(rc),getbvalue(rc)); + color.setrgb((_shl( rcs[0],8)),(_shl(rcs[1],8)),(_shl( rcs[2],8))); + gtk_color_selection_set_current_color(cbtnobj,color._getptr_()); + r := gtk_dialog_run(cdlg); + //rt := Gtk_dlg_get_response_name_by_id(r); + gtk_color_selection_get_current_color(cbtnobj,color._getptr_()); + obj.rgbresult := rgb( _shr(color.r,8),_shr(color.g,8),_shr(color.b,8)); + gtk_widget_destroy(cdlg); + return r=-5; + end + function tsl_gtk_color_selection_property(w:pointer):pointer;cdecl;external "./plugin/libTSLUIL.so"; + type TBrowseinfoA_ = class(tslcstructureobj) + {** + @explan(˵)ļѡṹ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("hwndowner","intptr",0), + ("pidlroot","intptr",0), + ("pszdisplayname","intptr",0), + ("lpsztitle","intptr",0), + ("ulflags","int",0), + ("lpfn","intptr",0), + ("lparam","intptr",0), + ("iimage","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + + end + end + function SHBrowseForFolderA(LPITEMIDLIST:pointer):pointer; + begin + obj := new TBrowseinfoA_(LPITEMIDLIST); + wd := obj._getvalue_("hwndowner"); + wd := wd?:nil; + if wd and not(gtk_widget_is_toplevel(wd)) then wd := gtk_widget_get_toplevel(wd); //top level + r := 0; + cdlg := gtk_file_chooser_dialog_new("folder selector",wd,3,"open",100,"cancel",50,nil); + dir := obj._getvalue_("pidlroot"); + if dir then //Ĭλ + begin + df := ReadStringFromPtr(dir); + if df then + begin + gtk_file_chooser_set_filename(cdlg,TslStringToGtk( df)); + end + end + if 100=gtk_dialog_run(cdlg) then + begin + r := GtkStringToTsl( gtk_file_chooser_get_filename(cdlg)); + end + gtk_widget_destroy(cdlg); + return r; + + end + function SHGetPathFromIDListA(LPBROWSEINFOA:pointer;var buf:string ):integer; + begin + for i := 1 to length(LPBROWSEINFOA) do + begin + buf[i] := LPBROWSEINFOA[i]; + end + buf[i+1] := 0; + return true; + end + function ILCreateFromPathA(pszPath:string):pointer; + begin + mt := static new aefclassobj_(); + len := length(pszPath)+1; + bts := zeros(n); + for i:= 1 to len-1 do bts[i-1] :=ord(pszPath[i]); + r := mt.tmalloc(len); + WriteBytesToPtr(r,bts); + return r; + end + procedure ILFree(pidl:pointer); + begin + mt := static new aefclassobj_(); + mt.tfree(pidl); + end + //caret + function CreateCaret(hWnd :pointer;hBitmap:pointer;nWidth:integer;nHeight:integer):integer; + begin + if not(hwnd>0 or hwnd<0) then return 0; + global g_gtk_caret_cache_timer; // + if not g_gtk_caret_cache_timer then + begin + g_gtk_caret_cache_timer := new TTimer(); + g_gtk_caret_cache_timer.Interval := 680; + g_gtk_caret_cache_timer.Ontimer := function(o,e)begin + global g_current_get_focus_widget; + h := g_current_get_focus_widget; + if not h then return ; + if not g_object_get_data(h,"caretshow") then return ; + ct := g_object_get_data(h,"gtk_window_caret"); + //if not gtk_widget_is_visible(ct) then gtk_widget_show(ct); + //return ; + if gtk_widget_is_visible(ct) then gtk_widget_hide(ct); + else + gtk_widget_show(ct); + end + g_gtk_caret_cache_timer.start(); + end + h := g_object_get_data(hwnd,"gtk_window_caret"); //caret + if not h then + begin + h := gtk_event_box_new(); + c := new _GdkColor(nil); + c.SetRgb(0,0,0); + gtk_widget_modify_bg(h,0,c._getptr_()); + gtk_widget_hide(h); + lot := g_object_get_data(hWnd,"gtk_layout"); + g_object_set_data(hwnd,"gtk_window_caret",h); + //g_object_set_data(h,"gtk_caret_window",hwnd); // + gtk_layout_put(lot,h,0,0); //λ + end + if nWidth>=0 and nHeight>=0 then + gtk_widget_set_size_request(h,nWidth,nHeight); + //g_gtk_caret_cache_caret := h; + return h; + end + function DestroyCaret():integer; + begin + global g_current_get_focus_widget; + hwnd := g_current_get_focus_widget; + if not(hwnd>0 or hwnd<0) then return ; + if not IsGtkWidget(hwnd) then return ; + g_object_set_data(hwnd,"caretshow",0); + ct := g_object_get_data(hwnd,"gtk_window_caret"); + if IsGtkWidget(ct) then + begin + gtk_widget_hide(ct); + end + return ; + // focus + end + function SetCaretPos(x:integer;y:integer):integer; + begin + global g_current_get_focus_widget; + hwnd := g_current_get_focus_widget; + if IsGtkWidget(hwnd) then + begin + lot := g_object_get_data(hwnd,"gtk_layout"); + crt := g_object_get_data( hwnd,"gtk_window_caret"); + if lot and crt then + begin + gtk_layout_move(lot,crt,x,y); + gtk_object_set_data(hwnd,"caret_x_pos",x); + gtk_object_set_data(hwnd,"caret_y_pos",y); + end + + end + return ; + end + function GetCaretPos(lp:array of integer):integer; + begin + global g_current_get_focus_widget; + hwnd := g_current_get_focus_widget; + if IsGtkWidget(hwnd) then + begin + x := gtk_object_get_data(hwnd,"caret_x_pos"); + y := gtk_object_get_data(hwnd,"caret_y_pos"); + lp := array(x,y); + end + lp := array(0,0); + return ; + end + function HideCaret(hwnd :pointer):integer; + begin + // focus widget + if not(hwnd>0 or hwnd<0) then return ; + if not IsGtkWidget(hwnd) then return ; + ct := g_object_get_data(hwnd,"gtk_window_caret"); + g_object_set_data(hwnd,"caretshow",0); + if IsGtkWidget(ct) then + begin + gtk_widget_hide(ct); + end + return ; + end + + + function ShowCaret(hwnd :pointer):integer; + begin + if not(hwnd>0 or hwnd<0) then return ; + if not IsGtkWidget(hwnd) then return ; + g_object_set_data(hwnd,"caretshow",1); + return 1; + end + function GetCaretBlinkTime():integer; + begin + + end + function SetCaretBlinkTime(uMSeconds :integer):integer; + begin + + end + Function WinExec(lpCmdLine:string;nCmdShow:integer):integer; + begin + + end; + function SetForegroundWindow(hwd :pointer):integer; + begin + end + function Shell_NotifyIconA(dwMessage:integer; lpData:pointer):integer; + begin + end + function BringWindowToTop(hwd :pointer); + begin + end + //socket + function socket(af:integer;tp:integer;protocol:integer):pointer;begin end + function WSAStartup(af:SHORT;DA:pointer):integer;begin end + function WSACleanup():integer;begin end + function htonl(hostlong:integer):integer;begin end + function htons(hostshort:short):short;begin end + function ntohs(hostshort:short):short;begin end + function bind(s:pointer;name:pointer;len:integer):integer;begin end + function accept(s:pointer;name:pointer;var len:integer):pointer;begin end + function send(s:pointer;bufer:string;len:integer;flag:integer):integer;begin end + function recv(s:pointer;var bufer:string;len:integer;flag:integer):integer;begin end + function listen(s:pointer;port:integer):integer;begin end + function closesocket(s:pointer):integer;begin end + function connect(s:pointer;name:pointer;len:integer):integer;begin end + function inet_addr(s:string):integer;begin end + function WSAGetLastError():integer;begin end + function inet_ntoa(ad:integer):string;begin end + function shutdown(s:pointer;how:integer):integer;begin end + function WSAAsyncSelect(s:pointer;hWnd:pointer;wMsg:integer;lEvent:integer):integer;begin end + function ioctlsocket(s:pointer;cmd:integer;var argp:integer):integer;begin end + function setsockopt(s:pointer;level:integer;optname:integer;optval:string;optlen:integer):integer;begin end + function getsockopt(s:pointer;level:integer;optname:integer;var optval:string;var optlen:integer):integer;begin end + + + {$else} + function openresourcemanager(p); //Դ + begin + if ifstring(p) then + return WinExec('cmd.exe /C start "" "'+p,1); + end + ////////////////////////clipboar////////////////////// + function OpenClipboard(hwd :pointer):integer;stdcall;external "User32.dll" name "OpenClipboard"; + function EmptyClipboard():integer;stdcall;external "User32.dll" name "EmptyClipboard"; + function CloseClipboard():integer;stdcall;external "User32.dll" name "CloseClipboard"; + function SetClipboardData(uflags:integer;mem:pointer):pointer;stdcall;external "User32.dll" name "SetClipboardData"; + function GetClipboardData(uflags:integer):pointer;stdcall;external "User32.dll" name "GetClipboardData"; + function IsClipboardFormatAvailable(format:integer):integer;stdcall;external "User32.dll" name "IsClipboardFormatAvailable"; +function getclipboardtext(clpd); +begin + sid := GetClipboardData(0x7); + r := ReadStringFromPtr(sid); + return r; +end +function setclipboardtext(clbd,s); +begin + len := length(s); + hm := GlobalAlloc(2,len+1);// + if hm <>0 then + begin + lm := GlobalLock(hm);// + if lm <> 0 then + begin + memcpy(lm,s,len);//ڴ濽 + GlobalUnlock(hm);// + r := SetClipboardData(1,hm); + if r<>0 then + begin + ret := 1; + end + end + end + return ret; +end +function getclipboardbmp(); +begin + return GetClipboardData(0x2); + +end +function setclipboardbmp(bmp); +begin + r := SetClipboardData(0x2,bmp); + if r<>0 then + begin + ret := 1; + end + return ret; +end + +////////////////////////////////////////////////////////////////////////////////////////////////////// + class function AnsiToWidChar(c); + begin + if not ifstring(c) then return ""; + iSize := MultiByteToWideChar_a(0, 0, C , -1, "", 0); + if not(iSize>0) then return ""; + pwszUnicode := ""; + setlength(pwszUnicode,isize*2); //ټȥ2 + MultiByteToWideChar_a(0, 0, c , -1, pwszUnicode , iSize-1); + return pwszUnicode; + end + class function GetEncoderClsid(n:String;ed:pointer):integer;cdecl;external "TSLUIL.dll" name "GetEncoderClsid"; + class function tuicloseistream(sm:pointer):integer;cdecl;external "TSLUIL.dll" name "tuicloseistream"; + //*********** + function GetDpiForMonitor(hmonitor:pointer; dpiType:integer;var dpiX:integer;var dpiY:integer):pointer;stdcall;external "Shcore.dll" name "GetDpiForMonitor"; + //Kernel32.dll + //̺ڴ + class function SetTimer(hWnd:pointer; nIDEvent:pointer; uElapse:integer;lpTimerFunc:pointer):integer;stdcall;external "User32.dll" name "SetTimer"; + class function KillTimer(hWnd:pointer; nIDEvent:pointer):integer;stdcall;external "User32.dll" name "KillTimer"; + + class function MultiByteToWideChar_a(CodePage:integer;dwFlags:integer;lpMultiByteStr:string;cbMultiByte:integer;var lpWideCharStr:string;cchWideChar:integer):integer;stdcall;external "Kernel32.dll" name "MultiByteToWideChar"; + class function GetModuleHandleA(name:pointer):pointer;stdcall;external "Kernel32.dll" name "GetModuleHandleA"; + class function GetComputerNameA(var lpBuffer:string;var nSize:integer):integer;stdcall;external "Kernel32.dll" name "GetComputerNameA"; + class function LoadLibraryA(txt:string):POINTER;stdcall;external "Kernel32.dll" name "LoadLibraryA"; + class function FreeLibrary(hd:pointer):integer;stdcall;external "Kernel32.dll" name "FreeLibrary"; + class function GetLastError():integer;stdcall;external "Kernel32.dll" name "GetLastError"; + class function GetEnvironmentVariableA(lpName:string;lpBuffer:string;nSize:integer):integer;stdcall;external "Kernel32.dll" name "GetEnvironmentVariableA"; + class function SetEnvironmentVariableA(lpName:string; lpValue:string):integer;stdcall;external "Kernel32.dll" name "SetEnvironmentVariableA"; + class function GetLogicalDriveStringsA(BUFSIZE:integer; szLogicDriveStrings:string):integer;stdcall;external "Kernel32.dll" name "GetLogicalDriveStringsA"; + class function GetDiskFreeSpaceExA(lpDirectoryName:string;var lpFreeBytesAvailableToCaller:int64;var lpTotalNumberOfBytes:int64;var lpTotalNumberOfFreeBytes:int64):integer;stdcall ;external "Kernel32.dll" name "GetDiskFreeSpaceExA"; + function GlobalAlloc(uFlags :integer;dwBytes:integer):pointer;stdcall;external "Kernel32.dll" name "GlobalAlloc"; + function CreateStreamOnHGlobal(hGlobal:pointer;fDeleteOnRelease:integer; var ppstm:pointer):pointer;stdcall;external "Ole32.dll" name "CreateStreamOnHGlobal"; + function GetHGlobalFromStream(pstm:pointer; var phglobal:pointer):pointer;stdcall;external "Ole32.dll" name "GetHGlobalFromStream"; + function GlobalLock(mem :pointer):pointer;stdcall;external "Kernel32.dll" name "GlobalLock"; + function GlobalUnlock(mem :pointer):integer;stdcall;external "Kernel32.dll" name "GlobalUnlock"; + function GlobalSize(menm:pointer):integer;stdcall;external "Kernel32.dll" name "GlobalSize"; + function GetStartupInfoA(lpStartupInfo:pointer):integer;stdcall ;external "Kernel32.dll" name "GetStartupInfoA" ; + function GetExitCodeProcess(hProcess:pointer;var lpExitCode:integer):integer;stdcall ;external "Kernel32.dll" name "GetExitCodeProcess" ; + function CreateProcessA(lpApplicationName:string;lpCommandLine:string;lpProcessAttributes:pointer; + lpThreadAttributes:pointer;bInheritHandles:integer;dwCreationFlags:integer;lpEnvironment:pointer; + lpCurrentDirectory:string;lpStartupInfo:pointer; + lpProcessInformation:pointer):integer;stdcall ;external "Kernel32.dll" name "CreateProcessA" ; + function CreatePipe(var hReadPipe:pointer;var hWritePipe : pointer; + lpPipeAttributes:pointer;nSize:integer):integer;stdcall;external "Kernel32.dll" name "CreatePipe"; + function PeekNamedPipe(hNamedPipe:pointer;var lpBuffer:string; nBufferSize:integer; var lpBytesRead:integer; + varlpTotalBytesAvail:integer;var lpBytesLeftThisMessage:integer):integer;stdcall;external "Kernel32.dll" name "PeekNamedPipe"; + function GetStdHandle(nStdHandle:integer):pointer;stdcall;external "Kernel32.dll" name "GetStdHandle"; + function SetStdHandle(nStdHandle:integer;hHandle:pointer):integer;stdcall;external "Kernel32.dll" name "SetStdHandle"; + function CreateFileA(var lpFileName:string;dwDesiredAccess:integer; + dwShareMode:integer;lpSecurityAttributes:pointer;dwCreationDisposition:integer; + dwFlagsAndAttributes:integer;hTemplateFile:pointer):pointer;stdcall;external "Kernel32.dll" name "CreateFileA"; + function WriteFile(hFile:pointer; lpBuffer:pointer;nNumberOfBytesToWrite:integer;var lpNumberOfBytesWritten:integer; lpOverlapped:pointer):integer;stdcall;external "Kernel32.dll" name "WriteFile"; + function WriteFile2(hFile:pointer; var lpBuffer:string;nNumberOfBytesToWrite:integer;var lpNumberOfBytesWritten:integer; lpOverlapped:pointer):integer;stdcall;external "Kernel32.dll" name "WriteFile"; + function ReadFile__(hFile:pointer;var lpBuffer:string;nNumberOfBytesToRead:integer;var lpNumberOfBytesRead:integer;pOverlapped:pointer):integer;stdcall;external "Kernel32.dll" name "ReadFile"; + function OpenProcess(dwDesiredAccess:integer;bInheritHandle:integer;dwProcessId:integer):pointer;stdcall;external "Kernel32.dll" name "OpenProcess"; + function GetHandleInformation(hObject:pointer;var lpdwFlags:integer):integer;stdcall;external "Kernel32.dll" name "GetHandleInformation"; + function CloseHandle(hObject:pointer):integer;stdcall ;external "Kernel32.dll" name "CloseHandle" ; + function _lclose(hObject:pointer):pointer;stdcall ;external "Kernel32.dll" name "_lclose" ; + function CreateToolhelp32Snapshot(dwFlags:integer;th32ProcessID:integer):pointer;stdcall;external "Kernel32.dll" name "CreateToolhelp32Snapshot"; + function Process32First(hSnapshot:pointer;lppe:pointer):integer;stdcall;external "Kernel32.dll" name "Process32First"; + function Process32Next(hSnapshot:pointer; lppe:pointer):integer;stdcall;external "Kernel32.dll" name "Process32Next"; + function Module32First(hSnapshot:pointer;lpme:pointer):integer;stdcall;external "Kernel32.dll" name "Module32First"; + function Module32Next(hSnapshot:pointer; lppe:pointer):integer;stdcall;external "Kernel32.dll" name "Module32Next"; + function GetCurrentDirectoryA(nBufferLength:integer; var lpBuffer:string):integer;stdcall;external "Kernel32.dll" name "GetCurrentDirectoryA"; + function SetCurrentDirectoryA(lpPathName:string):integer;stdcall;external "Kernel32.dll" name "SetCurrentDirectoryA"; + Function WinExec(lpCmdLine:string;nCmdShow:integer):integer;stdcall; external "kernel32.dll" name "WinExec" ; + function GetDriveTypeA(lpRootPathName:string):integer;stdcall; external "kernel32.dll" name "GetDriveTypeA" ; + (* + DRIVE_UNKNOWN = 0; {δ֪} + DRIVE_NO_ROOT_DIR = 1; {ƶ} + DRIVE_REMOVABLE = 2; {} + DRIVE_FIXED = 3; {Ӳ} + DRIVE_REMOTE = 4; {} + DRIVE_CDROM = 5; {CD-ROM} + DRIVE_RAMDISK = 6; {RAM } + *) + function EnumProcesses_(var lpidProcess:array of integer;cb:integer; var lpcbNeeded:integer):integer;stdcall;external "Kernel32.dll" name "K32EnumProcesses"; + function GetModuleFileNameExA(hProcess:pointer; hModule:pointer;var lpFilename:string;nSize:integer):integer;stdcall;external "Kernel32.dll" name "K32GetModuleFileNameExA"; + function QueryFullProcessImageNameA(hProcess:pointer; dwFlags:integer;var lpFilename:string;var nSize:integer):integer;stdcall;external "Kernel32.dll" name "QueryFullProcessImageNameA"; + function GetCurrentProcess():pointer;stdcall;external "Kernel32.dll" name "GetCurrentProcess"; + function OpenProcessToken(ProcessHandle:pointer;DesiredAccess:integer; var TokenHandle:pointer):integer;stdcall;external "Advapi32.dll" name "OpenProcessToken"; + //SeDebugPrivilege + function LookupPrivilegeValueA(var PolicyHandle:string;var Name:string; lpLuid:pointer):integer;stdcall;external "Advapi32.dll" name "LookupPrivilegeValueA"; + function AdjustTokenPrivileges(TokenHandle:pointer; DisableAllPrivileges:integer; NewState:pointer ; BufferLength:integer; + PreviousState:pointer; ReturnLength:pointer):integer;stdcall;external "Advapi32.dll" name "AdjustTokenPrivileges"; + //Snapshot from Psapi.lib C WinSDK V7.0* + (* #if (PSAPI_VERSION > 1) + #define EnumProcesses K32EnumProcesses + #define EnumProcessModules K32EnumProcessModules + #define EnumProcessModulesEx K32EnumProcessModulesEx + #define GetModuleBaseNameA K32GetModuleBaseNameA + #define GetModuleBaseNameW K32GetModuleBaseNameW + #define GetModuleFileNameExA K32GetModuleFileNameExA + #define GetModuleFileNameExW K32GetModuleFileNameExW + #define GetModuleInformation K32GetModuleInformation + #define EmptyWorkingSet K32EmptyWorkingSet + #define QueryWorkingSet K32QueryWorkingSet + #define QueryWorkingSetEx K32QueryWorkingSetEx + #define InitializeProcessForWsWatch K32InitializeProcessForWsWatch + #define GetWsChanges K32GetWsChanges + #define GetWsChangesEx K32GetWsChangesEx + #define GetMappedFileNameW K32GetMappedFileNameW + #define GetMappedFileNameA K32GetMappedFileNameA + #define EnumDeviceDrivers K32EnumDeviceDrivers + #define GetDeviceDriverBaseNameA K32GetDeviceDriverBaseNameA + #define GetDeviceDriverBaseNameW K32GetDeviceDriverBaseNameW + #define GetDeviceDriverFileNameA K32GetDeviceDriverFileNameA + #define GetDeviceDriverFileNameW K32GetDeviceDriverFileNameW + #define GetProcessMemoryInfo K32GetProcessMemoryInfo + #define GetPerformanceInfo K32GetPerformanceInfo + #define EnumPageFilesW K32EnumPageFilesW + #define EnumPageFilesA K32EnumPageFilesA + #define GetProcessImageFileNameA K32GetProcessImageFileNameA + #define GetProcessImageFileNameW K32GetProcessImageFileNameW + #endif *) + + + + //ʱ + //function SetClassLongA(hWnd:pointer; nIDEvent:pointer):integer;stdcall;external "User32.dll" name " SetClassLongA"; + function GetDpiFromDpiAwarenessContext(v:pointer):integer;stdcall;external "User32.dll" name "GetDpiFromDpiAwarenessContext"; + function GetDpiForWindow(hwnd:pointer):integer;stdcall;external "User32.dll" name "GetDpiForWindow"; + function GetMonitorInfoA(hMonitor:pointer;lpmi:pointer):integer;stdcall;external "User32.dll" name "GetMonitorInfoA"; + function MonitorFromWindow(hwnd:pointer;dwFlags:integer):pointer;stdcall;external "User32.dll" name "MonitorFromWindow"; + function GetSysColor(idx:integer):integer;;stdcall;external "User32.dll" name "GetSysColor"; + function SystemParametersInfoA(uiAction:integer;uiParam:integer; pvParam:pointer; fWinIni:integer):integer;stdcall;external "User32.dll" name "SystemParametersInfoA"; + + //˫ + function SetDoubleClickTime(it:integer):integer;stdcall;external "User32.dll" name "SetDoubleClickTime"; + function GetDoubleClickTime():integer;stdcall;external "User32.dll" name "GetDoubleClickTime"; + //ȼ + function RegisterHotKey(hWnd:pointer;id:integer; fsModifiers:integer; vk:integer):integer;stdcall;external "User32.dll" name "RegisterHotKey"; + function UnregisterHotKey(hWnd:pointer;id:integer):integer;stdcall;external "User32.dll" name "UnregisterHotKey"; + function MapVirtualKeyA(uCode:integer; uMapType:integer):integer;stdcall;external "User32.dll" name "MapVirtualKeyA"; + function GetKeyNameTextA(lParam:integer;var lpString:string;cchSize:integer):integer;stdcall;external "User32.dll" name "GetKeyNameTextA"; + + // + class function FindWindowA(lpClassName:string;lpWindowName:string):pointer;stdcall;external "User32.dll" name "FindWindowA"; + class function GetForegroundWindow():pointer;stdcall;external "User32.dll" name "GetForegroundWindow"; + class function GetActiveWindow():pointer;stdcall;external "User32.dll" name "GetActiveWindow"; + class function SetActiveWindow(h:pointer):pointer;stdcall;external "user32.dll" name "SetActiveWindow"; + function UpdateLayeredWindow(hWnd:pointer;hdcDst:pointer;pptDst:pointer;psize:pointer;hdcSrc:pointer;pptSrc:pointer; crKey:integer;pblend:pointer; dwFlags:pointer):integer;stdcall;external "User32.dll" name "UpdateLayeredWindow"; + function GetFocus():pointer;stdcall;external "User32.dll" name "GetFocus"; + function SetLayeredWindowAttributes(hwnd:pointer;crKey:integer;bAlpha:byte;dwFlags:integer):integer;stdcall;external "User32.dll" name "SetLayeredWindowAttributes"; + class function IsWindow(hd:pointer):integer;stdcall;external "User32.dll" name "IsWindow"; + class function IsWindowVisible(hd:pointer):integer;stdcall;external "User32.dll" name "IsWindowVisible"; + function GetWindow(hd:pointer;cd:integer):pointer;stdcall;external "User32.dll" name "GetWindow"; + function GetNextWindow(hd:pointer;cd:integer):pointer;stdcall;external "User32.dll" name "GetNextWindow"; + function GetTopWindow(hd:pointer):pointer;stdcall;external "User32.dll" name "GetTopWindow"; + function IsChild(hd:pointer;cd:pointer):integer;stdcall;external "User32.dll" name "IsChild"; + function RegisterClassExA(wc:pointer):short;stdcall;external "User32.dll" name "RegisterClassExA"; + function EnableWindow(wc:pointer;b:integer):integer;stdcall;external "User32.dll" name "EnableWindow"; + //ڲ + function ShowWindow(hwd :pointer;f:integer):integer;stdcall;external "User32.dll" name "ShowWindow"; + function BringWindowToTop(hwd :pointer):integer;stdcall;external "User32.dll" name "BringWindowToTop"; + function SetForegroundWindow(hwd :pointer):integer;stdcall;external "User32.dll" name "SetForegroundWindow"; + function SetWindowPos(wd:pointer;hWndInsertAfter:pointer; + X:integer; Y:integer; cx:integer;cy:integer; uFlags:integer):pointer;stdcall;external "User32.dll" name "SetWindowPos"; + function MoveWindow(wd:pointer; X:integer; Y:integer; cx:integer;cy:integer; bRepaint:integer):pointer;stdcall;external "User32.dll" name "MoveWindow"; + //ڴС + function GetClientRect(hwnd :pointer;var rec:array of integer):integer;stdcall;external "User32.dll" name "GetClientRect"; + function GetWindowRect(hwnd :pointer;var rec:array of integer):integer;stdcall;external "User32.dll" name "GetWindowRect"; + function GetWindowInfo(hwnd :pointer;f:pointer):integer;stdcall;external "User32.dll" name "GetWindowInfo"; + + function GetSystemMetrics(ndx :integer):integer;stdcall;external "User32.dll" name "GetSystemMetrics"; + function ClientToScreen(hwnd :pointer;var p:array of integer):integer;stdcall;external "User32.dll" name "ClientToScreen"; + function ScreenToClient(hwnd :pointer;var p:array of integer):integer;stdcall;external "User32.dll" name "ScreenToClient"; + + function GetParent(hwnd :pointer):pointer;stdcall;external "User32.dll" name "GetParent"; + function SetParent(hwnd :pointer;phwnd:pointer):pointer;stdcall;external "User32.dll" name "SetParent"; + function UpdateWindow(hwnd :pointer):integer;stdcall;external "User32.dll" name "UpdateWindow"; + function GetUpdateRect(hWnd:pointer; var lpRect:array of integer;bErase:integer):integer;stdcall;external "User32.dll" name "GetUpdateRect"; + function InvalidateRect(hwnd :pointer;rec:array of integer;f:integer):integer;stdcall;external "User32.dll" name "InvalidateRect"; + function InvalidateRect2(hwnd :pointer;rec:pointer;f:integer):integer;stdcall;external "User32.dll" name "InvalidateRect"; + function ValidateRect(hwnd :pointer;rec:array of integer):integer;stdcall;external "User32.dll" name "ValidateRect"; + function SetFocus(hwnd :pointer):pointer;stdcall;external "User32.dll" name "SetFocus"; + function GetWindowTextLengthA(hwnd :pointer):integer;stdcall;external "User32.dll" name "GetWindowTextLengthA"; + function GetWindowTextA(hwnd :pointer;var s:string;l:integer):integer;stdcall;external "User32.dll" name "GetWindowTextA"; + function SetWindowTextA(hwnd :pointer;s:string):integer;stdcall;external "User32.dll" name "SetWindowTextA"; + function GetClassInfoExA(HH:pointer;lpszClass:string;lpwcx:pointer):integer;stdcall;external "User32.dll" name "GetClassInfoExA"; + function DefWindowProc(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):integer;stdcall;external "User32.dll" name "DefWindowProc"; + {$IFDEF win64} + function SetWindowLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer):pointer;stdcall;external "User32.dll" name "SetWindowLongPtrA"; + function GetWindowLongPtrA(HH:pointer;idx:integer):pointer;stdcall;external "User32.dll" name "GetWindowLongPtrA"; + function SetClassLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer):pointer;stdcall;external "User32.dll" name "SetClassLongPtrA"; + function GetClassLongPtrA(HH:pointer;idx:integer):pointer;stdcall;external "User32.dll" name "GetClassLongPtrA"; + + {$ELSE} + function SetWindowLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer):pointer;stdcall;external "User32.dll" name "SetWindowLongA"; + function GetWindowLongPtrA(HH:pointer;idx:integer):pointer;stdcall;external "User32.dll" name "GetWindowLongA"; + function SetClassLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer):pointer;stdcall;external "User32.dll" name "SetClassLongA"; + function GetClassLongPtrA(HH:pointer;idx:integer):pointer;stdcall;external "User32.dll" name "GetClassLongA"; + {$ENDIF} + //function SetWindowLongA(HH:pointer;idx:integer;dwNewLong:pointer):pointer;stdcall;external "User32.dll" name "SetWindowLongA"; + //function GetWindowLongA(HH:pointer;idx:integer):pointer;stdcall;external "User32.dll" name "GetWindowLongA"; + function GetClassNameA(HH:pointer;var name:string;len:integer):pointer;stdcall;external "User32.dll" name "GetClassNameA"; + function CreateWindowExA(dwExStyle:integer; lpClassName:string; lpWindowName:string; + dwStyle:integer;x:integer;y:integer;nWidth:integer;nHeight:integer; + hWndParent:pointer;hMenu:pointer; hInstance:pointer;lpParam:pointer):pointer;stdcall;external "User32.dll" name "CreateWindowExA"; + function DestroyWindow(hWnd:pointer):integer;stdcall;external "User32.dll" name "DestroyWindow"; + //Ϣ + function CallWindowProcA(lpPrevWndFunc:pointer;hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):pointer;stdcall;external "User32.dll" name "CallWindowProcA"; + function DefWindowProcA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):pointer;stdcall;external "User32.dll" name "DefWindowProcA"; + function SendMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):pointer;stdcall;external "User32.dll" name "SendMessageA"; + function PostMessageA(hWnd:pointer;Msg:integer;wParam:pointer;lParam:pointer):integer;stdcall;external "User32.dll" name "PostMessageA"; + function GetMessageA(lpMsg:pointer;hWnd:pointer;wMsgFilterMin:integer;wMsgFilterMax:integer):integer;stdcall;external "User32.dll" name "GetMessageA"; + function PeekMessageA(lpMsg:pointer; hWnd:pointer; wMsgFilterMin:integer; wMsgFilterMax:integer;wRemoveMsg:integer):integer ;stdcall;external "User32.dll" name "PeekMessageA"; + function PostQuitMessage(code:integer);stdcall;external "User32.dll" name "PostQuitMessage"; + function PostThreadMessageA(idThread:integer ;Msg:integer;wParam:pointer;lParam:pointer):integer;stdcall;external "User32.dll" name "PostThreadMessageA"; + function TranslateMessage(msg:pointer):integer;stdcall;external "User32.dll" name "TranslateMessage"; + function DispatchMessageA(msg:pointer):integer;stdcall;external "User32.dll" name "DispatchMessageA"; + function TranslateAcceleratorA(hWnd:pointer; hAccTable:pointer;lpMsg:pointer):integer;stdcall;external "User32.dll" name "TranslateAcceleratorA"; + function CreateAcceleratorTableA(paccel:pointer;cAccel:integer):pointer;stdcall;external "User32.dll" name "CreateAcceleratorTableA"; + function DestroyAcceleratorTable(hAccel:pointer):integer;stdcall;external "User32.dll" name "DestroyAcceleratorTable"; + //״̬ + Function GetKeyState(key:integer):short;stdcall;external "User32.dll" name "GetKeyState"; + Function GetAsyncKeyState(key:integer):short;stdcall;external "User32.dll" name "GetAsyncKeyState"; + + // + function WindowFromPoint(X:integer; Y:integer):pointer;stdcall;external "User32.dll" name "WindowFromPoint"; + function ClipCursor(rec:array of integer):integer;stdcall;external "User32.dll" name "ClipCursor"; + + function GetCursorPos(var point: array of integer):integer;stdcall;external "User32.dll" name "GetCursorPos"; + function GetCursorInfo_( pci:pointer):integer;stdcall;external "User32.dll" name "GetCursorInfo"; + function ShowCursor(bshow:integer):integer;stdcall;external "User32.dll" name "ShowCursor"; + function SetCursorPos(x:integer;y:integer):integer;stdcall;external "User32.dll" name "SetCursorPos" ; + Function LoadCursorA(hd:pointer;n:string):pointer;stdcall;external "User32.dll" name "LoadCursorA"; + Function LoadCursorA2(hd:pointer;n:pointer):pointer;stdcall;external "User32.dll" name "LoadCursorA"; + Function SetCursor(hd:pointer):pointer;stdcall;external "User32.dll" name "SetCursor"; + function CreateCursor(hInst:pointer; xHotSpot:integer;yHotSpot:integer; nWidth:integer; nHeight:integer; pvANDPlane:pointer; pvXORPlane:pointer):pointer;stdcall;external "User32.dll" name "CreateCursor"; + //caret + function CreateCaret(hWnd :pointer;hBitmap:pointer;nWidth:integer;nHeight:integer):integer;stdcall;external "User32.dll" name "CreateCaret"; + function SetCaretPos(x:integer;y:integer):integer;stdcall;external "User32.dll" name "SetCaretPos"; + function HideCaret(hwnd :pointer):integer;stdcall;external "User32.dll" name "HideCaret"; + function DestroyCaret():integer;stdcall;external "User32.dll" name "DestroyCaret"; + function SetCaretBlinkTime(uMSeconds :integer):integer;stdcall;external "User32.dll" name "SetCaretBlinkTime"; + function ShowCaret(hwnd :pointer):integer;stdcall;external "User32.dll" name "ShowCaret"; + function GetCaretBlinkTime():integer;stdcall;external "User32.dll" name "GetCaretBlinkTime"; + function GetCaretPos(lp:array of integer):integer;stdcall;external "User32.dll" name "GetCaretPos"; + + function memcpy(dst:pointer;src:string;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; + function memcpy2(var dst:string;src:pointer;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; + function fopen(filename:string; mode:string):pointer;cdecl;external "msvcrt.dll" name "fopen"; + function fclose(f:pointer):integer;cdecl;external "msvcrt.dll" name "fclose"; + function LockFile(hFile:pointer; dwFileOffsetLow:integer; dwFileOffsetHigh:integer;nNumberOfBytesToLockLow:integer;nNumberOfBytesToLockHigh:integer):integer;stdcall;external "Kernel32.dll" name "LockFile"; + function UnlockFile(hFile:pointer; dwFileOffsetLow:integer; dwFileOffsetHigh:integer;nNumberOfBytesToLockLow:integer;nNumberOfBytesToLockHigh:integer):integer;stdcall;external "Kernel32.dll" name "UnlockFile"; + //icon + function DrawIcon(hDC:pointer;X:integer;Y:integer;hIcon:pointer):integer;stdcall;external "User32.dll" name "DrawIcon"; + function CreateIcon(hInstance:pointer;nWidth:integer;nHeight:integer;cPlanes:byte;cBitsPixel:byte ;lpbANDbits:pointer;lpbXORbits:pointer):pointer;stdcall;external "User32.dll" name "CreateIcon"; + function CreateIconIndirect(info:pointer):pointer;stdcall;external "User32.dll" name "CreateIconIndirect"; + function CreateIcon2(hInstance:pointer;nWidth:integer;nHeight:integer;cPlanes:byte;cBitsPixel:byte ;var lpbANDbits:string;var lpbXORbits:string):pointer;stdcall;external "User32.dll" name "CreateIcon"; + function DestroyIcon(icon:pointer):integer;stdcall;external "User32.dll" name "DestroyIcon"; + function GetIconInfo(hIcon:pointer; piconinfo:pointer):integer;stdcall;external "User32.dll" name "GetIconInfo"; + function DestroyCursor(cursor:pointer):integer;stdcall;external "User32.dll" name "DestroyCursor"; + //scroll + function SetScrollRange(hWnd:pointer;nBar:integer;nMinPos:integer; nMaxPos:integer;bRedraw:integer):integer;stdcall;external "User32.dll" name "SetScrollRange"; + function GetScrollRange(hWnd:pointer;nBar:integer;var nMinPos:integer; var nMaxPos:integer):integer;stdcall;external "User32.dll" name "GetScrollRange"; + function SetScrollPos(hWnd:pointer;nBar:integer;Pos:integer;bRedraw:integer):integer;stdcall;external "User32.dll" name "SetScrollPos"; + function GetScrollPos(hWnd:pointer;nBar:integer):integer;stdcall;external "User32.dll" name "GetScrollPos"; + function ScrollWindow(hWnd:pointer;x:integer;y:integer; var lpRect:array of integer;var lpClipRect:array of integer):integer;stdcall;external "User32.dll" name "ScrollWindow"; + function ScrollDC(hDC:pointer;dx:integer;dy:integer;var lprcScroll:array of integer; var lprcClip:array of integer;hrgnUpdate:pointer;lprcUpdate:pointer):integer;stdcall;external "User32.dll" name "ScrollDC"; + function GetScrollInfo(hWnd:pointer;x:integer;info:pointer):integer;stdcall;external "User32.dll" name "GetScrollInfo"; + function SetScrollInfo(hwnd:pointer; nBar:integer; lpsi:pointer;redraw:integer):integer;stdcall;external "User32.dll" name "SetScrollInfo"; + //menu˵***************************************************** + Function CreateMenu():pointer;stdcall;external "User32.dll" name "CreateMenu"; + Function CreatePopupMenu():pointer;stdcall;external "User32.dll" name "CreatePopupMenu"; + Function DestroyMenu(hMenu:pointer):integer;stdcall;external "User32.dll" name "DestroyMenu"; + Function IsMenu(hMenu:pointer):integer;stdcall;external "User32.dll" name "IsMenu"; + function DeleteMenu(hMenu:pointer;uPosition:integer;uFlags:integer):integer;stdcall;external "User32.dll" name "DeleteMenu"; // + Function GetMenuInfo(hMenu:pointer;lpcmi:pointer):integer;stdcall;external "User32.dll" name "GetMenuInfo"; + Function SetMenuInfo(hMenu:pointer;lpcmi:pointer):integer;stdcall;external "User32.dll" name "SetMenuInfo"; + Function GetSubMenu(hMenu:pointer;nPos:integer):pointer;stdcall;external "User32.dll" name "GetSubMenu"; + Function GetSystemMenu(hWnd:pointer;bRevert:integer):pointer;stdcall;external "User32.dll" name "GetSystemMenu"; + + Function RemoveMenu( hMenu:pointer; uPosition:integer;uFlags:integer):integer;stdcall;external "User32.dll" name "RemoveMenu"; + Function SetMenuItemInfoA( hMenu:pointer; uItem:integer;fByPosition:integer;lpmii:pointer):integer;stdcall;external "User32.dll" name "SetMenuItemInfoA"; + Function InsertMenuItemA( hMenu:pointer;uItem:integer;fByPosition:integer;lpmii:pointer):integer;stdcall;external "User32.dll" name "InsertMenuItemA"; + function AppendMenuA(hMenu:pointer;uFlags:integer;uIDNewItem:pointer; var lpNewItem:string):integer;stdcall ;external "User32.dll" name "AppendMenuA"; + function HiliteMenuItem(hWnd:pointer; hMenu:pointer; uIDHiliteItem:integer; uHilite:integer):integer;stdcall;external "User32.dll" name "HiliteMenuItem"; + Function GetMenuItemInfoA( hMenu:pointer; uItem:integer;fByPosition:integer;lpmii:pointer):integer;stdcall;external "User32.dll" name "GetMenuItemInfoA"; + Function TrackPopupMenu( hMenu:pointer;uFlags:integer; x:integer; y:integer; nReserved:integer;hWnd:pointer; prcRect: array of integer):integer;stdcall;external "User32.dll" name "TrackPopupMenu"; + function TrackPopupMenuEx(hMenu:pointer;uFlags:integer;x:integer;y:integer;hwnd:pointer;lptpm:pointer):integer;stdcall;external "User32.dll" name "TrackPopupMenuEx"; + Function ModifyMenuA( hMenu:pointer; uItem:integer;fByPosition:integer;lpmii:pointer;lpNewItem:string):integer;stdcall;external "User32.dll" name "ModifyMenuA"; + Function GetMenuStringA(hMenu:pointer; uIDItem:integer; var lpString:string; nMaxCount:integer;uFlag:integer):integer;stdcall;external "User32.dll" name "GetMenuStringA"; + Function RedrawWindow(hWnd:pointer;lprcUpdate:array of integer; hrgnUpdate:pointer;flags:integer):integer;stdcall;external "User32.dll" name "RedrawWindow"; + + //***************window menu************************* + Function DrawMenuBar(hwd:pointer):integer;stdcall;external "User32.dll" name "DrawMenuBar"; + Function SetMenu(hwd:pointer;hmenu:pointer):integer;stdcall;external "User32.dll" name "SetMenu"; + Function GetMenu(hwd:pointer):pointer;stdcall;external "User32.dll" name "GetMenu"; + //********************************************** + function GetDesktopWindow():pointer;stdcall;external "User32.dll" name "GetDesktopWindow"; + Function GetDC(hwd :pointer):pointer;stdcall;external "User32.dll" name "GetDC"; + function GetWindowDC(hWnd:pointer):pointer;stdcall;external "User32.dll" name "GetWindowDC"; + Function GetDCEx(hwd :pointer;hrgnClip:pointer;flags:integer):pointer;stdcall;external "User32.dll" name "GetDCEx"; + Function LoadImageA(hinst:pointer;lpszName:string; uType:integer; cxDesired:integer;cyDesired:integer;fuLoad:integer):pointer;stdcall;external "User32.dll" name "LoadImageA"; + function LoadBitmapA(hin:pointer;lpsz:string):pointer;stdcall;external "User32.dll" name "LoadBitmapA"; + function LoadBitmapA2(hin:pointer;lpsz:pointer):pointer;stdcall;external "User32.dll" name "LoadBitmapA"; + Function LoadIconA(hd:pointer;n:string):pointer;stdcall;external "User32.dll" name "LoadIconA"; + Function LoadIconA2(hd:pointer;n:pointer):pointer;stdcall;external "User32.dll" name "LoadIconA"; + Function DrawTextA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer):integer;stdcall;external "User32.dll" name "DrawTextA"; + Function DrawTextExA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer;lpdtp:pointer):integer;stdcall;external "User32.dll" name "DrawTextExA"; + Function DrawFrameControl(DC:pointer; var LPRECT: array of integer ; dr1 :integer;dr2:integer):integer;stdcall;external "User32.dll" name "DrawFrameControl"; + function DrawEdge(hdc:pointer;var qrc:array of integer;edge:integer;grfFlags:integer):integer;;stdcall;external "User32.dll" name "DrawEdge"; + function DrawFocusRect(hDC:pointer; var rect:array of integer):integer;stdcall;external "User32.dll" name "DrawFocusRect"; + Function FillRect(dc:pointer;rec:array of integer;br:pointer):integer;stdcall;external "User32.dll" name "FillRect"; + Function InvertRect(dc:pointer;rec:array of integer;br:pointer):integer;stdcall;external "User32.dll" name "InvertRect"; + function ReleaseDC(hwd :pointer;hdc:pointer):integer;stdcall;external "User32.dll" name "ReleaseDC"; + function BeginPaint(hwd :pointer;strc:pointer):pointer;stdcall;external "User32.dll" name "BeginPaint"; + function EndPaint(hwd :pointer;strc:pointer):integer;stdcall;external "User32.dll" name "EndPaint"; + function WindowFromDC(dc:pointer):pointer;stdcall;external "User32.dll" name "WindowFromDC"; + function MessageBoxA(hwnd :pointer;txt:string;cap:string;flag:integer):integer;stdcall;external "User32.dll" name "MessageBoxA"; + function TrackMouseEvent(lpEventTrack:pointer):integer;stdcall;external "User32.dll" name "TrackMouseEvent"; + //Gdi32.dll + function SaveDC(hdc :pointer):integer;stdcall;external "Gdi32.dll" name "SaveDC"; + function RestoreDC(hdc :pointer;nSavedDC:integer):integer;stdcall;external "Gdi32.dll" name "RestoreDC"; + function DeleteDC(hdc :pointer):integer;stdcall;external "Gdi32.dll" name "DeleteDC"; + { + https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(WINGDI%2FCreateCompatibleDC);k(CreateCompatibleDC);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true + If the function succeeds, the return value is the handle to a memory DC. + If the function fails, the return value is NULL. + } + function CreateCompatibleDC(hdc :pointer):pointer;stdcall;external "Gdi32.dll" name "CreateCompatibleDC"; + { + https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(WINGDI%2FGetTextColor);k(GetTextColor);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true + } + Function GetTextColor(hdc :pointer):integer;stdcall;external "Gdi32.dll" name "GetTextColor"; + Function SetTextColor(hdc :pointer;col:integer):integer;stdcall;external "Gdi32.dll" name "SetTextColor"; + function GetTextExtentPoint32A(hdc:pointer;lpString:string;c:integer; psizl:pointer):integer;stdcall;external "Gdi32.dll" name "GetTextExtentPoint32A"; + function GetTextExtentPoint32A2(hdc:pointer;lpString:string;c:integer; var psizl:array of integer):integer;stdcall;external "Gdi32.dll" name "GetTextExtentPoint32A"; + function GetCharWidthA(hdc:pointer;iFirst:integer;iLast:integer;var lpBuffer:array of integer):integer;stdcall;external "Gdi32.dll" name "GetCharWidthA"; + function GetCharABCWidthsA(hdc:pointer;wFirst:integer;wLast:integer; lpABC:pointer):integer;stdcall;external "Gdi32.dll" name "GetCharABCWidthsA"; + function GetFontLanguageInfo(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "GetFontLanguageInfo"; + Function SetDCPenColor(hdc :pointer;col:integer):integer;stdcall;external "Gdi32.dll" name "SetDCPenColor"; + Function GetDCPenColor(hdc :pointer):integer;stdcall;external "Gdi32.dll" name "GetDCPenColor"; + Function GetDCBrushColor(hdc :pointer):integer;stdcall;external "Gdi32.dll" name "GetDCBrushColor"; + Function SetDCBrushColor(hdc :pointer;col:integer):integer;stdcall;external "Gdi32.dll" name "SetDCBrushColor"; + { + https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(WINGDI%2FRectangle);k(Rectangle);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true + } + Function Rectangle(hdc :pointer;l:integer;t:integer;r:integer;b:integer):integer;stdcall;external "Gdi32.dll" name "Rectangle"; + Function Ellipse(hdc :pointer;l:integer;t:integer;r:integer;b:integer):integer;stdcall;external "Gdi32.dll" name "Ellipse"; + Function RoundRect(hdc :pointer;l:integer;t:integer;r:integer;b:integer;wid:integer;ht:integer):integer;stdcall;external "Gdi32.dll" name "RoundRect"; + Function Chord(hdc :pointer;l:integer;t:integer;r:integer;b:integer;wid:integer;ht:integer):integer;stdcall;external "Gdi32.dll" name "Chord"; + Function Pie(hdc :pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer;nXRadial1:integer;nYRadial1:integer;nXRadial2:integer;nYRadial2:integer):integer;stdcall;external "Gdi32.dll" name "Pie"; + Function SetArcDirection(hdc :pointer;direct:integer):integer;stdcall;external "Gdi32.dll" name "SetArcDirection"; + Function Arc(hdc :pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer;nXRadial1:integer;nYRadial1:integer;nXRadial2:integer;nYRadial2:integer):integer;stdcall;external "Gdi32.dll" name "Arc"; + Function Polygon(hdc :pointer;points:array of integer;n:integer):integer;stdcall;external "Gdi32.dll" name "Polygon"; + Function PolyBezier(hdc :pointer;points:array of integer;n:integer):integer;stdcall;external "Gdi32.dll" name "PolyBezier"; + Function SetPolyFillMode(hdc :pointer;md:integer):integer;stdcall;external "Gdi32.dll" name "SetPolyFillMode"; + Function Polyline(hdc :pointer;points:array of integer;n:integer):integer;stdcall;external "Gdi32.dll" name "Polyline"; + Function PolyPolyline(hdc :pointer;points:array of integer;pc:array of integer;n:integer):integer;stdcall;external "Gdi32.dll" name "PolyPolyline"; + function ExtFloodFill(hdc:pointer;nXStart:integer; nYStart:integer;crColor:integer;fuFillType:integer):integer;stdcall;external "Gdi32.dll" name "ExtFloodFill"; + function SetTextJustification(hdc:pointer;nBreakExtra:integer;nBreakCount:integer):integer;stdcall;external "Gdi32.dll" name "SetTextJustification"; + function TransparentBlt( hdcDest:pointer; xoriginDest:integer; yoriginDest:integer; wDest:integer; hDest:integer; + hdcSrc:pointer; xoriginSrc:integer; yoriginSrc:integer; wSrc:integer; hSrc:integer; crTransparent:integer):integer;stdcall;external "Msimg32.dll" name "TransparentBlt"; + function AlphaBlend( hdcDest:pointer; xoriginDest:integer; yoriginDest:integer; wDest:integer; hDest:integer; + hdcSrc:pointer; xoriginSrc:integer; yoriginSrc:integer; wSrc:integer; hSrc:integer; ftn:integer):integer;stdcall;external "Msimg32.dll" name "AlphaBlend"; + function SetWindowExtEx(hdc:pointer;nXExtent:integer;nYExtent:integer;lpSize:pointer):integer;stdcall;external "Gdi32.dll" name "SetWindowExtEx"; + function IntersectClipRect(hdc :pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer):integer;stdcall;external "Gdi32.dll" name "IntersectClipRect"; + function GetDIBits(hdc:pointer; hbm:pointer;start:integer; cLines:integer;lpvBits:pointer;lpbmi:pointer; usage:integer):integer;stdcall;external "Gdi32.dll" name "GetDIBits"; + function GetDIBits2(hdc:pointer; hbm:pointer;start:integer; cLines:integer;var lpvBits:string;lpbmi:pointer; usage:integer):integer;stdcall;external "Gdi32.dll" name "GetDIBits"; + function SetDIBits2(hdc:pointer; hbmp:pointer;uStartScan:integer;cScanLines:integer;var lpvBits:string;lpbmi:pointer;fuColorUse:integer):integer;stdcall;external "Gdi32.dll" name "SetDIBits"; + Function GetBitmapBits(bmp :pointer;len:integer;bf:pointer{var bf: array of integer }):integer;stdcall;external "Gdi32.dll" name "GetBitmapBits"; + Function GetBitmapBits2(bmp :pointer;len:integer;var bf:string):integer;stdcall;external "Gdi32.dll" name "GetBitmapBits"; + Function SetBitmapBits(bmp :pointer;len:integer;bf:pointer{var bf: array of integer }):integer;stdcall;external "Gdi32.dll" name "SetBitmapBits"; + Function SetBitmapBits2(bmp :pointer;len:integer;var bf:string):integer;stdcall;external "Gdi32.dll" name "SetBitmapBits"; + Function SetBitmapDimensionEx(hBitmap:pointer;nWidth:integer; nHeight:integer;VAR lpSize:array of integer):integer;stdcall;external "Gdi32.dll" name "SetBitmapDimensionEx"; + Function GetBitmapDimensionEx(hBitmap:pointer;VAR ps:array of integer):integer;stdcall;external "Gdi32.dll" name "GetBitmapDimensionEx"; + { + https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(WINGDI%2FGetTextMetrics);k(GetTextMetrics);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true + } + Function GetTextMetricsA(hdc :pointer;TM:pointer):integer;stdcall;external "Gdi32.dll" name "GetTextMetricsA"; + Function MoveToEx(hdc :pointer;x:integer;y:integer;var point:array of integer):integer;stdcall;external "Gdi32.dll" name "MoveToEx" keepresident; + Function LineTo(hdc :pointer;x:integer;y:integer):integer;stdcall;external "Gdi32.dll" name "LineTo" keepresident; + Function TextOutA(hdc :pointer;X:integer;y:integer;txt:string;len:integer):integer;stdcall;external "Gdi32.dll" name "TextOutA"; + //gdi path******************** + function BeginPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "BeginPath"; + function EndPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "EndPath"; + function FillPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "FillPath"; + function StrokePath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "StrokePath"; + function StrokeAndFillPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "StrokeAndFillPath"; + function AbortPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "AbortPath"; + function CloseFigure(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "CloseFigure"; + function FlattenPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "FlattenPath"; + function GetMiterLimit(hdc:pointer;var plimit:Single):integer;stdcall;external "Gdi32.dll" name "GetMiterLimit"; + function GetPath(hdc:pointer;apt:array of integer;aj:integer;cpt:integer):integer;stdcall;external "Gdi32.dll" name "GetPath"; + function PathToRegion(hdc:pointer):pointer;stdcall;external "Gdi32.dll" name "PathToRegion"; + function SetMiterLimit(hdc:pointer;limit:Single;var od:Single):integer;stdcall;external "Gdi32.dll" name "SetMiterLimit"; + function WidenPath(hdc:pointer):integer;stdcall;external "Gdi32.dll" name "WidenPath"; + function PatBlt(hdc:pointer;nleftrect:integer;ntoprect:integer;nwidth:integer;nheight:pointer;fdwrop:integer):integer;stdcall;external "Gdi32.dll" name "PatBlt"; + function drawbitmaptodc(bm,hdc,x,y,rc,flag,thdc); + begin + oldmp := SelectObject(thdc,bm); + if not flag then flag := 0xcc0020; + r := BitBlt(hdc,x,y,rc[2]-rc[0],rc[3]-rc[1],thdc,rc[0],rc[1],flag); + if oldmp then SelectObject(thdc,oldmp); + return r; + end + function drawbitmapstretchtodc(bm,hdc,drect,rc,flag,thdc); + begin + oldmp := SelectObject(thdc,bm); + if not flag then flag := 0xcc0020; + r := StretchBlt(hdc,drect[0],drect[1],drect[2]-drect[0],drect[3]-drect[1],thdc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1],flag); + if oldmp then SelectObject(thdc,oldmp); + return r; + end + + Function BitBlt(hdcDest:pointer;nXDest:integer;nYDest:integer;nWidth:integer;nHeight:integer; + hdcSrc :pointer;nXSrc:integer;nYSrc:integer;dwRop:integer):integer;stdcall;external "Gdi32.dll" name "BitBlt"; + Function StretchBlt(hdcDest:pointer;nXOriginDest:integer; nYOriginDest:integer;nWidthDest:integer; nHeightDest:integer; + hdcSrc :pointer;nXOriginSrc:integer;nYOriginSrc:integer; nWidthSrc:integer; nHeightSrc:integer; dwRop:integer + ):integer;stdcall;external "Gdi32.dll" name "StretchBlt"; + Function SetStretchBltMode(hdc:pointer;iStretchMode:integer):integer;stdcall;external "Gdi32.dll" name "SetStretchBltMode"; + function SelectObject(hdc :pointer;gdiobj:pointer):pointer;stdcall;external "Gdi32.dll" name "SelectObject"; + function DeleteObject(gdiobj :pointer):integer;stdcall;external "Gdi32.dll" name "DeleteObject"; + function CreateBitmap(nWidth:integer; nHeight:integer; cPlanes:integer;cBitsPerPel:integer; + lpvBits:pointer):pointer;stdcall;external "Gdi32.dll" name "CreateBitmap"; + function CreateBitmap2(nWidth:integer; nHeight:integer; cPlanes:integer;cBitsPerPel:integer; + var lpvBits:string):pointer;stdcall;external "Gdi32.dll" name "CreateBitmap"; + function CreateBitmaplndirect(bmp:pointer):pointer;stdcall;external "Gdi32.dll" name "CreateBitmaplndirect"; + function CreateCompatibleBitmap(hdc:pointer;x:integer;y:integer):pointer;stdcall;external "Gdi32.dll" name "CreateCompatibleBitmap"; + function CreatePen(fnPenStyle:integer;nWidth:integer;crColor:integer):pointer;stdcall;external "Gdi32.dll" name "CreatePen"; + function CreatePenIndirect(LOGPEN :pointer):pointer;stdcall;external "Gdi32.dll" name "CreatePen"; + function CreateSolidBrush(crColor:integer):pointer;stdcall;external "Gdi32.dll" name "CreateSolidBrush"; + function CreateBrushIndirect(Logb:pointer):pointer;stdcall;external "Gdi32.dll" name "CreateBrushIndirect"; + function CreatePatternBrush(bmp:pointer):pointer;stdcall;external "Gdi32.dll" name "CreatePatternBrush"; + function CreateHatchBrush(fnStyle:integer;clrref:integer):pointer;stdcall;external "Gdi32.dll" name "CreateHatchBrush"; + function CreateFontA(nHeight:integer;nWidth:integer;nEscapement:integer; nOrientation:integer;fnWeight:integer; + fdwItalic:integer;fdwUnderline:integer;fdwStrikeOut:integer;fdwCharSet:integer;fdwOutputPrecision:integer; + fdwClipPrecision:integer; fdwQuality:integer; fdwPitchAndFamily:integer;lpszFace:string):pointer;stdcall;external "Gdi32.dll" name "CreateFontA"; + function CreateFontIndirectA(lplf:pointer):pointer;stdcall;external "Gdi32.dll" name "CreateFontIndirectA"; + //https://msdn.microsoft.com/zh-cn/library/windows/desktop/dd183436(v=vs.85).aspx clipping functions + function GetStockObject(fnObject:integer):pointer;stdcall;external "Gdi32.dll" name "GetStockObject"; + function CreatePalette(LOGPALETTE:pointer):pointer;stdcall;external "Gdi32.dll" name "CreatePalette"; + function GetDeviceCaps(dc:pointer;idex:integer):integer;stdcall;external "Gdi32.dll" name "GetDeviceCaps"; + function SetPixel(dc:pointer;x:integer;y:integer;col:integer):integer;stdcall;external "Gdi32.dll" name "SetPixel"; + function CreateEllipticRgn(nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer):pointer;stdcall;external "Gdi32.dll" name "CreateEllipticRgn"; + + function CreatePolyPolygonRgn(ps:array of integer;pc:array of integer;len:integer;md:integer):pointer;stdcall;external "Gdi32.dll" name "CreatePolyPolygonRgn"; + function SetROP2(hdc:pointer;fnDrawMode:integer):integer;stdcall;external "Gdi32.dll" name "SetROP2"; + function CreateRectRgn(nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer):pointer;stdcall;external "Gdi32.dll" name "CreateRectRgn"; + function CreatePolygonRgn(ps:array of integer;len:integer;md:integer):pointer;stdcall;external "Gdi32.dll" name "CreatePolygonRgn"; + function CombineRgn(hrgnDest:pointer;hrgnSrc1:pointer;hrgnSrc2:pointer; fnCombineMode:integer):integer;stdcall;external "Gdi32.dll" name "CombineRgn"; + function SelectClipRgn(dc:pointer;rgn:pointer):integer;stdcall;external "Gdi32.dll" name "SelectClipRgn"; + function PtVisible(dc:pointer;x:integer;y:integer):integer;stdcall;external "Gdi32.dll" name "PtVisible"; + function RectVisible(dc:pointer;rect:array of integer):integer;stdcall;external "Gdi32.dll" name "RectVisible"; + function ExcludeClipRect(hdc:pointer;nLeftRect:integer;nTopRect:integer;nRightRect:integer;nBottomRect:integer;):integer;stdcall;external "Gdi32.dll" name "ExcludeClipRect"; + function SetWindowOrgEx(hdc:pointer;x:integer;y:integer;var lppt: array of integer):integer;stdcall;external "Gdi32.dll" name "SetWindowOrgEx"; + function SetViewportOrg(dc:pointer;x:integer;y:integer):integer;stdcall;external "Gdi32.dll" name "SetViewportOrg"; + function SetViewportOrgEx(dc:pointer;x:integer;y:integer;var pt:array of integer):integer;stdcall;external "Gdi32.dll" name "SetViewportOrgEx"; + Function FillRgn(dc:pointer;rgn:pointer;br:pointer):integer;stdcall;external "Gdi32.dll" name "FillRgn"; + Function SetTextAlign(dc:pointer;fMode:integer):integer;stdcall;external "Gdi32.dll" name "SetTextAlign"; + Function SetWorldTransform(dc:pointer;lpXform:pointer):integer;stdcall;external "Gdi32.dll" name "SetWorldTransform"; + Function SetGraphicsMode(dc:pointer;iMode:integer):integer;stdcall;external "Gdi32.dll" name "SetGraphicsMode"; + Function GetGraphicsMode(dc:pointer):integer;stdcall;external "Gdi32.dll" name "GetGraphicsMode"; + Function SetMapMode(dc:pointer;iMode:integer):integer;stdcall;external "Gdi32.dll" name "SetMapMode"; + Function SetBkColor(dc:pointer;clrref:integer):integer;stdcall;external "Gdi32.dll" name "SetBkColor"; + Function GetBkColor(dc:pointer):integer;stdcall;external "Gdi32.dll" name "GetBkColor"; + Function SetBkMode(dc:pointer;clrref:integer):integer;stdcall;external "Gdi32.dll" name "SetBkMode"; + Function GetBkMode(dc:pointer):integer;stdcall;external "Gdi32.dll" name "GetBkMode"; + Function GetObjectA(hgdiobj:pointer;cbBuffer:integer;lpvObject:pointer):integer;stdcall;external "Gdi32.dll" name "GetObjectA"; + //**************Comctl32.dll*************************************************************** + procedure GetEffectiveClientRect(hWnd:pointer;lprc:array of integer;lpInfo:array of integer);stdcall;external "Comctl32.dll" name "GetEffectiveClientRect"; + function ImageList_Add(himl:pointer;hbmImage:pointer; hbmMask:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_Add"; + function ImageList_AddMasked(himl:pointer;hbmImage:pointer; crMask:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_AddMasked"; + function ImageList_BeginDrag(himlTrack:pointer; iTrack:integer;dxHotspot:integer;dyHotspot:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_BeginDrag"; + function ImageList_DragMove(x:integer;y:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_DragMove"; + function ImageList_DragEnter(hwndLock:pointer;x:integer;y:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_DragEnter"; + function ImageList_DragLeave(hwndLock:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_DragLeave"; + procedure ImageList_EndDrag();stdcall;external "Comctl32.dll" name "ImageList_EndDrag"; + function ImageList_Create(cx:integer; cy:integer; flags:integer; cInitial:integer;cGrow:integer):pointer;stdcall;external "Comctl32.dll" name "ImageList_Create"; + function ImageList_Draw(himl:pointer;i:integer;hdcDst:pointer;x:integer;y:integer;fStyle:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_Draw"; + function ImageList_Destroy(himl:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_Add"; + function ImageList_Replace(himl:pointer;id:integer;hbmImage:pointer; hbmMask:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_Replace"; + function ImageList_Remove(himl:pointer;id:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_Remove"; + function ImageList_SetBkColor(himl:pointer;clrBk:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_SetBkColor"; + function ImageList_LoadImageA2(hi:pointer;lpbmp:pointer;cx:integer;cGrow:integer; crMask:integer;uType:integer;uFlags:integer):pointer;stdcall;external "Comctl32.dll" name "ImageList_LoadImageA"; + function ImageList_GetBkColor(himl:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_GetBkColor"; + function ImageList_GetDragImage(ppt:pointer;pptHotspot:pointer):pointer;stdcall;external "Comctl32.dll" name "ImageList_GetDragImage"; + function ImageList_GetImageCount(himl:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_GetImageCount"; + function ImageList_SetImageCount(himl:pointer;clrBk:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_SetImageCount"; + function ImageList_Copy(himlDst:pointer;iDst:integer; himlSrc:pointer;iSrc:integer;uFlags:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_Copy"; + function ImageList_Duplicate(himl:pointer):pointer;stdcall;external "Comctl32.dll" name "ImageList_Duplicate"; + function ImageList_Merge(himl1:pointer;i1:integer;himl2:pointer;i2:integer;dx:integer;dy:integer):pointer;stdcall;external "Comctl32.dll" name "ImageList_Merge"; + function ImageList_SetDragCursorImage(himlDrag:pointer;iDrag:integer;dxHotspot:integer;dyHotspot:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_SetDragCursorImage"; + function ImageList_GetImageInfo(himl:pointer; i:integer;pImageInfo:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_GetImageInfo"; + function ImageList_ReplaceIcon(himl:pointer;i:integer;hicon:pointer):integer;stdcall;external "Comctl32.dll" name "ImageList_ReplaceIcon"; + function ImageList_SetIconSize(himl:pointer;cx:integer;cy:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_SetIconSize"; + function ImageList_GetIconSize(himl:pointer;var cx:integer;var cy:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_GetIconSize"; + function ImageList_GetIcon(himl:pointer;i:integer;flags:integer):pointer;stdcall;external "Comctl32.dll" name "ImageList_GetIcon"; + function ImageList_DrawIndirect(pimldp:pointer):pointer;stdcall;external "Comctl32.dll" name "ImageList_DrawIndirect"; + function ImageList_DragShowNolock(fShow:integer):integer;stdcall;external "Comctl32.dll" name "ImageList_DragShowNolock"; + function InitCommonControlsEx(it:pointer):integer;stdcall;external "Comctl32.dll" name "InitCommonControlsEx"; + function Comctl32DllGetVersion(it:pointer):pointer;stdcall;external "Comctl32.dll" name "DllGetVersion"; + function GetOpenFileNameA(LPOPENFILENAMEA:pointer):integer;stdcall;external "Comdlg32.dll" name "GetOpenFileNameA" keepresident; + function GetSaveFileNameA(LPOPENFILENAMEA:pointer):integer;stdcall;external "Comdlg32.dll" name "GetSaveFileNameA"; + function ChooseFontA(LOGFONTA:pointer):integer;stdcall;external "Comdlg32.dll" name "ChooseFontA"; + function ChooseColorA(LOGFONTA:pointer):integer;stdcall;external "Comdlg32.dll" name "ChooseColorA"; + //************************************ + function Shell_NotifyIconA(dwMessage:integer; lpData:pointer):integer;stdcall;external "Shell32.dll" name "Shell_NotifyIconA"; + function ILCreateFromPathA(pszPath:string):pointer;stdcall;external "Shell32.dll" name "ILCreateFromPathA"; + procedure ILFree(pidl:pointer);stdcall;external "Shell32.dll" name "ILFree"; + function SHBrowseForFolderA(LPITEMIDLIST:pointer):pointer;stdcall;external "Shell32.dll" name "SHBrowseForFolderA"; + function SHGetPathFromIDListA(LPBROWSEINFOA:pointer;var buf:string ):integer;stdcall;external "Shell32.dll" name "SHGetPathFromIDListA"; + function shell32DllGetVersion(it:pointer):pointer;stdcall;external "Shell32.dll" name "DllGetVersion"; + function ShellExecuteExA(pExecInfo :pointer):integer;stdcall;external "Shell32.dll" name "ShellExecuteExA"; + function SHGetFolderPathA(hwnd:pointer;csidl:integer;hToken:pointer;dwFlags:integer;var pszPath:string):integer;stdcall;external "Shell32.dll" name "SHGetFolderPathA"; + //socket + function socket(af:integer;tp:integer;protocol:integer):pointer;stdcall;external "Ws2_32.dll" name "socket"; + function WSAStartup(af:SHORT;DA:pointer):integer;stdcall;external "Ws2_32.dll" name "WSAStartup"; + function WSACleanup():integer;stdcall;external "Ws2_32.dll" name "WSACleanup"; + function htonl(hostlong:integer):integer;stdcall;external "Ws2_32.dll" name "htonl"; + function htons(hostshort:short):short;stdcall;external "Ws2_32.dll" name "htons"; + function ntohs(hostshort:short):short;stdcall;external "Ws2_32.dll" name "ntohs"; + function bind(s:pointer;name:pointer;len:integer):integer;stdcall;external "Ws2_32.dll" name "bind"; + function accept(s:pointer;name:pointer;var len:integer):pointer;stdcall;external "Ws2_32.dll" name "accept"; + function send(s:pointer;bufer:string;len:integer;flag:integer):integer;stdcall;external "Ws2_32.dll" name "send"; + function recv(s:pointer;var bufer:string;len:integer;flag:integer):integer;stdcall;external "Ws2_32.dll" name "recv"; + function listen(s:pointer;port:integer):integer;stdcall;external "Ws2_32.dll" name "listen"; + function closesocket(s:pointer):integer;stdcall;external "Ws2_32.dll" name "closesocket"; + function connect(s:pointer;name:pointer;len:integer):integer;stdcall;external "Ws2_32.dll" name "connect"; + function inet_addr(s:string):integer;stdcall;external "Ws2_32.dll" name "inet_addr"; + function WSAGetLastError():integer;stdcall;external "Ws2_32.dll" name "WSAGetLastError"; + function inet_ntoa(ad:integer):string;stdcall;external "Ws2_32.dll" name "inet_ntoa"; + function shutdown(s:pointer;how:integer):integer;stdcall;external "Ws2_32.dll" name "shutdown"; + function WSAAsyncSelect(s:pointer;hWnd:pointer;wMsg:integer;lEvent:integer):integer;stdcall;external "Ws2_32.dll" name "WSAAsyncSelect"; + function ioctlsocket(s:pointer;cmd:integer;var argp:integer):integer;stdcall;external "Ws2_32.dll" name "ioctlsocket"; + function setsockopt(s:pointer;level:integer;optname:integer;optval:string;optlen:integer):integer;stdcall;external "Ws2_32.dll" name "setsockopt"; + function getsockopt(s:pointer;level:integer;optname:integer;var optval:string;var optlen:integer):integer;stdcall;external "Ws2_32.dll" name "getsockopt"; + + {$endif} + end + +type TByteData=class() //λ + {** + @explan(˵) λװ + **} + {** + @example(:byteת) + oa := new TByteData(); + echo tostn(oa.bytesasint(array(1,1,1,1))); + + **} + {** + @example(:תbyte) + oa := new TByteData(); + echo tostn(oa.intasbytes(235); + + **} + class function BytesAsInt(a); + begin + {** + @explan(˵) ĸbyteתΪinteger %% + @param(a)(array) ʽʾֽ %% + @return(integer) װõ %% + **} + uu := a[0]; + ul := a[1]; + lu := a[2]; + ll := a[3]; + l := makelong(ll,lu,8); + u := makelong(ul,uu,8); + return makelong(l,u); + end + class function IntAsBytes(v); + begin + {** + @explan(˵) תΪbyte (ģ) %% + @param(v)(integer) %% + @return(array) ģbyte %% + **} + lowuperdword(v,l,u); + lowuperdword(l,ll,lu); + lowuperdword(u,ul,uu); + return array(uu,ul,lu,ll); + end + class function ShortsToInt(a); + begin + {** + @explan(˵) shortתΪһint %% + @param(a)(array) Ԫص %% + @return(integer) %% + **} + l := a[1]; + u := a[0]; + return makelong(l,u); + end + class function IntToShorts(v); + begin + {** + @explan(˵) תΪshort (ģ) %% + @param(v)(integer) %% + @return(array) ģshort %% + **} + lowuperdword(v,l,u); + return array(l,u); + end + class function StrAsBytes(s); + begin + {** + @explan(˵) ַתΪbyte %% + @param(s)(string) ַ %% + @return(array) ģbyte %% + **} + r := array(); + for i := 0 to length(s) do r[i]:= ord(s[i]); + return r; + end + class function BytesAsStr(b); + begin + {** + @explan(˵) byteתַ %% + @param(b)(array) byte %% + @return(string) ַ + **} + r := ""; + for i := 0 to length(b)-1 do r += chr(b[i]); + return r; + end +end + +type TSLUIBASE=class(TSLUICONST) //ͼ + {** + @explan(˵)ͼ,ṩĵײͳ %% + **} + private + FReCycleState; + static FTSLkeyWords; + static TSLRCS_NONE; + static TSLRCS_BEGIN; + static TSLRCS_END; + static FHAPP; + static FEditTypes; + _hashdata; + _temppath; + function Gethapp(); + begin + return FHAPP; + end + function SetHapp(v); + begin + end + public + static _wapi; //windows api; + function create();virtual; // + begin + _hashdata := array(); + sinit(); + FReCycleState := TSLRCS_NONE; + end + class function sinit();virtual; + begin + {** + @explan(˵)ʼwin32ӿڶ_wapi + **} + if not(_wapi)then + begin + _wapi := gettswin32api(); + FTSLkeyWords := TSL_ReservedKeys2(); + end + if not FHAPP then + begin + FHAPP := _wapi.GetModuleHandleA(0); + TSLRCS_NONE := 0; + TSLRCS_BEGIN := 1; + TSLRCS_END := 2; + end + end + class Function isKeyWords(key); + begin + {** + @explan(˵) жǷΪtslؼ %% + @param(key)(string) + **} + return ifstring(key)and ifarray(FTSLkeyWords)and(lowercase(key)in FTSLkeyWords); + return false; + end + class function DeleteItemsByIndexs(r,dxs); + begin + {** + @explan(˵) ɾ±, %% + @param(r)(array) ɾ±,ַ±,η%%; + **} + if not ifarray(r)then exit; + rdx := array(); + for i,v in dxs do rdx[v]:= nil; + return reindex(r,rdx); + end + class function xor(a,b); + begin + {** + @explan(˵) %% + @return(bool) + **} + return(a and not(b))or(b and not(a)); + end + class function bitcombination(s,v,f); + begin + {** + @explan(˵)bitλ %% + @param(s)(integer) ԭֵ %% + @param(v)(integer) ׷ӻɾ %% + @param(f)(integer) 0 Ϊ or ,1 Ϊ and ;2 ʾ ɾ vֵ %% + **} + if not(ifnumber(s)and ifnumber(v))then return 0; + case f of + 0:return s .| v; + 1:return s .& v; + 2:return(.!v).& s; + else return s; + end + hv :=((s .& v)=v); + if(hv)and f=2 then + begin + return(.!v).& s; + end else + if(f=0)and not(hv)then + begin + return s .| v; + end else + if(f=1)and not(hv)then + begin + return s .& v; + end else + return s; + end + function destroy();virtual; + begin + if FReCycleState=TSLRCS_NONE then Recycling(); + end + function NoRecycled(); + begin + {** + @explan(˵) Ƿûб %% + @return(bool) ûлշtrue ,򷵻false; + **} + return FReCycleState=TSLRCS_NONE; + end + function Recycling();virtual; + begin + {** + @explan(˵)׼;Ϊѭõ + **} + if FReCycleState=TSLRCS_END then return; + _Tag := nil; + _hashdata := array(); + FReCycling := true; + FReCycleState := TSLRCS_END; + end + function _execute_(); //ִ + begin + return callinarray(thisfunction(class(TSLUIBASE)._eventexec_),params); + end + function _eventexec_();virtual; //¼ִк + begin + if paramcount<1 then return 0; + ps := params; //¼ִб + fun := ps[0]; // + if datatype(fun)=7 then + begin + return callinarray(fun,ps[1:]); + end + end + function hashset(i,v,f); + begin + {** + @explan(˵)һϣֵ %% + @param(i)(string | integer) ± %% + @param(f)(bool) i=nil and f=1 and v=array 滻ϣ %% + @param(v)() ֵ + **} + if ifstring(i)or ifint(i)then + begin + _hashdata[i]:= v; + end else + if(ifnil(i)and ifarray(v)and(f=1))then _hashdata := v; + end + function hashget(i); + begin + {** + @explan(˵)ȡһϣֵ %% + @param(i)(string | integer) ± %% + @return() ֵ + **} + if ifstring(i)or ifint(i)then + begin + return _hashdata[i]; + end else + if ifnil(i)then return _hashdata; + end + function hashdel(i,f); + begin + {** + @explan(˵)ɾһϣֵ %% + @param(i)(string | integer) ± %% + @param(f)(bool) i=nil and f=1 hash %% + @return(bool)Ƿɹ + **} + if ifstring(i)or ifint(i)then + begin + return reindex(_hashdata,array(i:nil)); + end else + if ifnil(i)and f=1 then _hashdata := array(); + end + function caption(s);virtual; + begin + return ""; + end + function temppath(); + begin + {** + @explan(˵) ȡһԶдļ %% + @return(string) Ŀ¼· %% + **} + if not(ifstring(_temppath)and _temppath)then _temppath := gettemppath()+"tinysoft"; + return _temppath; + end + class function RegPropertyType(v); //ע༭ + begin + RegComponentPropertyType(v); + end + class function GetPropertyType(n); //༭ + begin + return GetComponentPropertyType(n); + end + property happ read Gethapp write SetHapp; + property ReCycleState read FReCycleState; //write FReCycleState; + _Tag; //ǩ + {** + @param(_wapi)(tswin32api) win32궨,Լapiӿ %% + @param(_Tag)(obj) ʹõijԱ %% + **} +end + + + ///////////////////////////ڴ////////////////////////////// +type T_startupinfoa=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("cb","int",0), + ("lpreserved","intptr",0), + ("lpdesktop","intptr",0), + ("lptitle","intptr",0), + ("dwx","int",0), + ("dwy","int",0), + ("dwxsize","int",0), + ("dwysize","int",0), + ("dwxcountchars","int",0), + ("dwycountchars","int",0), + ("dwfillattribute","int",0), + ("dwflags","int",0), + ("wshowwindow","short",0), + ("cbreserved2","short",0), + ("lpreserved2","intptr",0), + ("hstdinput","intptr",0), + ("hstdoutput","intptr",0), + ("hstderror","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + cb := _size_(); + end + property cb index "cb" read _getvalue_ write _setvalue_; + property lpreserved index "lpreserved" read _getvalue_ write _setvalue_; + property lpdesktop index "lpdesktop" read _getvalue_ write _setvalue_; + property lptitle index "lptitle" read _getvalue_ write _setvalue_; + property dwx index "dwx" read _getvalue_ write _setvalue_; + property dwy index "dwy" read _getvalue_ write _setvalue_; + property dwxsize index "dwxsize" read _getvalue_ write _setvalue_; + property dwysize index "dwysize" read _getvalue_ write _setvalue_; + property dwxcountchars index "dwxcountchars" read _getvalue_ write _setvalue_; + property dwycountchars index "dwycountchars" read _getvalue_ write _setvalue_; + property dwfillattribute index "dwfillattribute" read _getvalue_ write _setvalue_; + property dwflags index "dwflags" read _getvalue_ write _setvalue_; + property wshowwindow index "wshowwindow" read _getvalue_ write _setvalue_; + property cbreserved2 index "cbreserved2" read _getvalue_ write _setvalue_; + property lpreserved2 index "lpreserved2" read _getvalue_ write _setvalue_; + property hstdinput index "hstdinput" read _getvalue_ write _setvalue_; + property hstdoutput index "hstdoutput" read _getvalue_ write _setvalue_; + property hstderror index "hstderror" read _getvalue_ write _setvalue_; +end + +type T_process_information=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hprocess","intptr",0), + ("hthread","intptr",0), + ("dwprocessid","int",0), + ("dwthreadid","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hprocess index "hprocess" read _getvalue_ write _setvalue_; + property hthread index "hthread" read _getvalue_ write _setvalue_; + property dwprocessid index "dwprocessid" read _getvalue_ write _setvalue_; + property dwthreadid index "dwthreadid" read _getvalue_ write _setvalue_; +end + +type T_security_attributes=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("nlength","int",0), + ("lpsecuritydescriptor","intptr",0), + ("binherithandle","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + nlength := _size_(); + end + property nlength index "nlength" read _getvalue_ write _setvalue_; + property lpsecuritydescriptor index "lpsecuritydescriptor" read _getvalue_ write _setvalue_; + property binherithandle index "binherithandle" read _getvalue_ write _setvalue_; +end +type Ttagminmaxinfo=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ptreserved","int[2]", + (0,0)), + ("ptmaxsize","int[2]", + (0,0)), + ("ptmaxposition","int[2]", + (0,0)), + ("ptmintracksize","int[2]", + (0,0)), + ("ptmaxtracksize","int[2]", + (0,0)))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ptreserved index "ptreserved" read _getvalue_ write _setvalue_; + property ptmaxsize index "ptmaxsize" read _getvalue_ write _setvalue_; + property ptmaxposition index "ptmaxposition" read _getvalue_ write _setvalue_; + property ptmintracksize index "ptmintracksize" read _getvalue_ write _setvalue_; + property ptmaxtracksize index "ptmaxtracksize" read _getvalue_ write _setvalue_; +end + + +type TTagMSG=class(tslcstructureobj) + {** + @explan(˵) Ϣѭ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hwnd","intptr",0), + ("message","int",0), + ("wparam","intptr",0), + ("lparam","intptr",0), + ("time","int",0), + ("pt","int[2]", + (0,0)), + ("lprivate","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hwnd index "hwnd" read _getvalue_ write _setvalue_; + property message index "message" read _getvalue_ write _setvalue_; + property wparam index "wparam" read _getvalue_ write _setvalue_; + property lparam index "lparam" read _getvalue_ write _setvalue_; + property time index "time" read _getvalue_ write _setvalue_; + property pt index "pt" read _getvalue_ write _setvalue_; + property lprivate index "lprivate" read _getvalue_ write _setvalue_; +end +type TtagSIZE=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + (0,"int",0), + (1,"int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property cx index 0 read _getvalue_ write _setvalue_; + property cy index 1 read _getvalue_ write _setvalue_; +end +type TCPoint=class(TtagSIZE) + function create(p); + begin + inherited; + end +end + +type TCRect=class(tslcstructureobj) + {** + @explan(˵)ڴ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + (0,"int",0), + (1,"int",0), + (2,"int",0), + (3,"int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property left index 0 read _getvalue_ write _setvalue_; + property top index 1 read _getvalue_ write _setvalue_; + property right index 2 read _getvalue_ write _setvalue_; + property bottom index 3 read _getvalue_ write _setvalue_; +end + +type TCRectF=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + (0,"float",0), + (1,"float",0), + (2,"float",0), + (3,"float",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property left index 0 read _getvalue_ write _setvalue_; + property top index 1 read _getvalue_ write _setvalue_; + property right index 2 read _getvalue_ write _setvalue_; + property bottom index 3 read _getvalue_ write _setvalue_; +end +type TCPointF=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + (0,"float",0), + (1,"float",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property cx index 0 read _getvalue_ write _setvalue_; + property cy index 1 read _getvalue_ write _setvalue_; +end +type TNOTIFYICONDATAA=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("cbsize","int",0), + ("hwnd","intptr",0), + ("uid","int",0), + ("uflags","int",0), + ("ucallbackmessage","int",0), + ("hicon","intptr",0), + ("sztip","char[128]",0), + ("dwstate","int",0), + ("dwstatemask","int",0), + ("szinfo","char[256]",0), + ("dummyunionname","int",0), + ("szinfotitle","char[64]",0), + ("dwinfoflags","int",0), + ("guiditem","user",( + ("data1","int",0),("data2","short",0),("data3","short",0),("data4","char[8]","") + )), + ("hballoonicon","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + cbsize := _size_(); + end + property cbsize index "cbsize" read _getvalue_ write _setvalue_; + property hwnd index "hwnd" read _getvalue_ write _setvalue_; + property uid index "uid" read _getvalue_ write _setvalue_; + property uflags index "uflags" read _getvalue_ write _setvalue_; + property ucallbackmessage index "ucallbackmessage" read _getvalue_ write _setvalue_; + property hicon index "hicon" read _getvalue_ write _setvalue_; + property sztip index "sztip" read _getvalue_ write _setvalue_; + property dwstate index "dwstate" read _getvalue_ write _setvalue_; + property dwstatemask index "dwstatemask" read _getvalue_ write _setvalue_; + property szinfo index "szinfo" read _getvalue_ write _setvalue_; + property uTimeout index "dummyunionname" read _getvalue_ write _setvalue_; + property uVersion index "dummyunionname" read _getvalue_ write _setvalue_; + property dummyunionname index "dummyunionname" read _getvalue_ write _setvalue_; + property szinfotitle index "szinfotitle" read _getvalue_ write _setvalue_; + property dwinfoflags index "dwinfoflags" read _getvalue_ write _setvalue_; + property guiditem index "guiditem" read _getvalue_ write _setvalue_; + property hballoonicon index "hballoonicon" read _getvalue_ write _setvalue_; +end + +type TSHBMP=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("bmtype","int",0), + ("bmwidth","int",0), + ("bmheight","int",0), + ("bmwidthbytes","int",0), + ("bmplanes","short",0), + ("bmbitspixel","short",0), + ("bmbits","intptr",0))); + return SSTRUCT; + end + function getstruct2() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("bmtype","int",0), + ("bmwidth","int",0), + ("bmheight","int",0), + ("bmwidthbytes","int",0), + ("bmplanes","byte",0), + ("bmbitspixel","byte",0), + {$ifdef win64} + ("nop1","byte[6]",array(0,0,0,0,0,0)), + {$else} + ("nop1","byte[2]",array(0,0)), + {$endif} + ("bmbits","intptr",100))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property bmtype index "bmtype" read _getvalue_ write _setvalue_; + property bmwidth index "bmwidth" read _getvalue_ write _setvalue_; + property bmheight index "bmheight" read _getvalue_ write _setvalue_; + property bmwidthbytes index "bmwidthbytes" read _getvalue_ write _setvalue_; + property bmplanes index "bmplanes" read _getvalue_ write _setvalue_; + property bmbitspixel index "bmbitspixel" read _getvalue_ write _setvalue_; + property nop1 index "nop1" read _getvalue_ write _setvalue_; + property bmbits index "bmbits" read _getvalue_ write _setvalue_; + {** + @ignore() %% + @param(bmwidth)(integer) %%; + @param(bmheight)(integer) ߶%%; + @param(bmwidthbytes)(integer) ֽ%%; + @param(bmplanes)(integer) ɫλ%%; + @param(bmbitspixel)(integer) %%; + **} +end + + +type TSHICON=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ficon","int",0), + ("xhotspot","int",0), + ("yhotspot","int",0), + ("hbmmask","intptr",0), + ("hbmcolor","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ficon index "ficon" read _getvalue_ write _setvalue_; + property xhotspot index "xhotspot" read _getvalue_ write _setvalue_; + property yhotspot index "yhotspot" read _getvalue_ write _setvalue_; + property hbmmask index "hbmmask" read _getvalue_ write _setvalue_; + property hbmcolor index "hbmcolor" read _getvalue_ write _setvalue_; +end + +type ttagCHOOSECOLORA=class(tslcstructureobj) + {** + @explan(˵) ɫѡṹ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("lstructsize","int",0), + ("hwndowner","intptr",0), + ("hinstance","intptr",0), + ("rgbresult","int",0), + ("lpcustcolors","user*",array((0,"int[16]",array(0)))), + ("flags","int",0), + ("lcustdata","intptr",0), + ("lpfnhook","intptr",0), + ("lptemplatename","char*",100))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + lstructsize := _size_(); + end + property lstructsize index "lstructsize" read _getvalue_ write _setvalue_; + property hwndowner index "hwndowner" read _getvalue_ write _setvalue_; + property hinstance index "hinstance" read _getvalue_ write _setvalue_; + property rgbresult index "rgbresult" read _getvalue_ write _setvalue_; + property lpcustcolors index "lpcustcolors" read _getvalue_ write _setvalue_; + property flags index "flags" read _getvalue_ write _setvalue_; + property lcustdata index "lcustdata" read _getvalue_ write _setvalue_; + property lpfnhook index "lpfnhook" read _getvalue_ write _setvalue_; + property lptemplatename index "lptemplatename" read _getvalue_ write _setvalue_; +end + +type ttagCHOOSEFONTA=class(tslcstructureobj) + {** + @explan(˵)ѡṹ %% + **} + private + static SSTRUCT; + Flogfont; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("lstructsize","int",0), + ("hwndowner","intptr",0), + ("hdc","intptr",0), + ("lplogfont","intptr",0), + ("ipointsize","int",0), + ("flags","int",0), + ("rgbcolors","int",0), + ("lcustdata","intptr",0), + ("lpfnhook","intptr",0), + ("lptemplatename","char*",100), + ("hinstance","intptr",0), + ("lpszstyle","intptr",100), + ("nfonttype","short",0), + ("___missing_alignment__","short",0), + ("nsizemin","int",0), + ("nsizemax","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + lg := inherited _getvalue_("lplogfont"); + Flogfont := new ttagLOGFONTA(lg ?: nil); + lplogfont := Flogfont._getptr_; + lstructsize := _size_(); + end + function _getvalue_(id);override; + begin + if id="lplogfont" then + begin + return new ttagLOGFONTA(inherited); + end else + return inherited; + end + function _setvalue_(id,v);override; + begin + if id="lplogfont" and ifnumber(v)and v then + begin + inherited _setvalue_(id,v); + end else + if v is class(ttagLOGFONTA)then + begin + inherited _setvalue_(id,v._getptr_); + end else + inherited; + end + function SetFontInfo(v); + begin + if ifarray(v)then + begin + for i,vi in v do + begin + Flogfont._setvalue_(i,vi); + end + end + end + property lstructsize index "lstructsize" read _getvalue_ write _setvalue_; + property hwndowner index "hwndowner" read _getvalue_ write _setvalue_; + property hdc index "hdc" read _getvalue_ write _setvalue_; + property lplogfont index "lplogfont" read _getvalue_ write _setvalue_; + property ipointsize index "ipointsize" read _getvalue_ write _setvalue_; + property flags index "flags" read _getvalue_ write _setvalue_; + property rgbcolors index "rgbcolors" read _getvalue_ write _setvalue_; + property lcustdata index "lcustdata" read _getvalue_ write _setvalue_; + property lpfnhook index "lpfnhook" read _getvalue_ write _setvalue_; + property lptemplatename index "lptemplatename" read _getvalue_ write _setvalue_; + property hinstance index "hinstance" read _getvalue_ write _setvalue_; + property lpszstyle index "lpszstyle" read _getvalue_ write _setvalue_; + property nfonttype index "nfonttype" read _getvalue_ write _setvalue_; + //property ___missing_alignment__ index "___missing_alignment__" read _getvalue_ write _setvalue_; + property nsizemin index "nsizemin" read _getvalue_ write _setvalue_; + property nsizemax index "nsizemax" read _getvalue_ write _setvalue_; +end + +type ttagLOGFONTA=class(tslcstructureobj) + {** + @explan(˵) ߼ṹʾ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("height","int",15), + ("width","int",0), + ("escapement","int",0), + ("orientation","int",0), + ("weight","int",400), + ("italic","byte",0), + ("underline","byte",0), + ("strikeout","byte",0), + ("charset","byte",134), + ("outprecision","byte",3), + ("clipprecision","byte",2), + ("quality","byte",1), + ("pitchandfamily","byte",FIXED_PITCH), + ("facename","char[32]",""))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property height index "height" read _getvalue_ write _setvalue_; + property width index "width" read _getvalue_ write _setvalue_; + property escapement index "escapement" read _getvalue_ write _setvalue_; + property orientation index "orientation" read _getvalue_ write _setvalue_; + property weight index "weight" read _getvalue_ write _setvalue_; + property italic index "italic" read _getvalue_ write _setvalue_; + property underline index "underline" read _getvalue_ write _setvalue_; + property strikeout index "strikeout" read _getvalue_ write _setvalue_; + property charset index "charset" read _getvalue_ write _setvalue_; + property outprecision index "outprecision" read _getvalue_ write _setvalue_; + property clipprecision index "clipprecision" read _getvalue_ write _setvalue_; + property quality index "quality" read _getvalue_ write _setvalue_; + property pitchandfamily index "pitchandfamily" read _getvalue_ write _setvalue_; + property facename index "facename" read _getvalue_ write _setvalue_; +end +type TtagOFNA=class(tcstructwithcharptr) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := array( + ("lstructsize","int",152), + ("hwndowner","intptr",0), + ("hinstance","intptr",0), + ("lpstrfilter","intptr",0), + ("lpstrcustomfilter","intptr",0), + ("nmaxcustfilter","int",0), + ("nfilterindex","int",1), + ("lpstrfile","char*",2049), + ("nmaxfile","int",2048), + ("lpstrfiletitle","char*",512), + ("nmaxfiletitle","int",511), + ("lpstrinitialdir","intptr",0), + ("lpstrtitle","intptr",0), + ("flags","int",0), //6148 + ("nfileoffset","byte[2]",(0,0)), + ("nfileextension","byte[2]",(0,0)), + ("lpstrdefext","intptr",0), + ("lcustdata","intptr",0), + ("lpfnhook","intptr",0), + ("lptemplatename","intptr",0), + ("pvreserved","intptr",0), + ("dwreserved","int",0), + ("flagsex","int",0)); + return SSTRUCT; + end + public + function create() + begin + inherited create(getstruct(),array( + "lpstrfiletitle":"nmaxfiletitle", + "lpstrfile":"nmaxfile", + "lpstrcustomfilter":"nmaxcustfilter", + "lpstrtitle":nil, + "lpstrdefext":nil),array( + "lpstrfilter":nil + )); + lstructsize := _size_(); + end + property lstructsize index "lstructsize" read _getvalue_ write _setvalue_; + property hwndowner index "hwndowner" read _getvalue_ write _setvalue_; + property hinstance index "hinstance" read _getvalue_ write _setvalue_; + property lpstrfilter index "lpstrfilter" read _getvalue_ write _setvalue_; + property lpstrcustomfilter index "lpstrcustomfilter" read _getvalue_ write _setvalue_; + property nmaxcustfilter index "nmaxcustfilter" read _getvalue_ write _setvalue_; + property nfilterindex index "nfilterindex" read _getvalue_ write _setvalue_; + property lpstrfile index "lpstrfile" read _getvalue_ write _setvalue_; + property nmaxfile index "nmaxfile" read _getvalue_ write _setvalue_; + property lpstrfiletitle index "lpstrfiletitle" read _getvalue_ write _setvalue_; + property nmaxfiletitle index "nmaxfiletitle" read _getvalue_ write _setvalue_; + property lpstrinitialdir index "lpstrinitialdir" read _getvalue_ write _setvalue_; + property lpstrtitle index "lpstrtitle" read _getvalue_ write _setvalue_; + property flags index "flags" read _getvalue_ write _setvalue_; + property nfileoffset index "nfileoffset" read _getvalue_ write _setvalue_; + property nfileextension index "nfileextension" read _getvalue_ write _setvalue_; + property lpstrdefext index "lpstrdefext" read _getvalue_ write _setvalue_; + property lcustdata index "lcustdata" read _getvalue_ write _setvalue_; + property lpfnhook index "lpfnhook" read _getvalue_ write _setvalue_; + property lptemplatename index "lptemplatename" read _getvalue_ write _setvalue_; + property lpeditinfo index "lpeditinfo" read _getvalue_ write _setvalue_; + property lpstrprompt index "lpstrprompt" read _getvalue_ write _setvalue_; + property pvreserved index "pvreserved" read _getvalue_ write _setvalue_; + property dwreserved index "dwreserved" read _getvalue_ write _setvalue_; + property flagsex index "flagsex" read _getvalue_ write _setvalue_; +end +type ttagTEXTMETRICA=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("tmheight","int",0), + ("tmascent","int",0), + ("tmdescent","int",0), + ("tminternalleading","int",0), + ("tmexternalleading","int",0), + ("tmavecharwidth","int",0), + ("tmmaxcharwidth","int",0), + ("tmweight","int",0), + ("tmoverhang","int",0), + ("tmdigitizedaspectx","int",0), + ("tmdigitizedaspecty","int",0), + ("tmfirstchar","byte",0), + ("tmlastchar","byte",0), + ("tmdefaultchar","byte",0), + ("tmbreakchar","byte",0), + ("tmitalic","byte",0), + ("tmunderlined","byte",0), + ("tmstruckout","byte",0), + ("tmpitchandfamily","byte",0), + ("tmcharset","byte",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property tmheight index "tmheight" read _getvalue_ write _setvalue_; + property tmascent index "tmascent" read _getvalue_ write _setvalue_; + property tmdescent index "tmdescent" read _getvalue_ write _setvalue_; + property tminternalleading index "tminternalleading" read _getvalue_ write _setvalue_; + property tmexternalleading index "tmexternalleading" read _getvalue_ write _setvalue_; + property tmavecharwidth index "tmavecharwidth" read _getvalue_ write _setvalue_; + property tmmaxcharwidth index "tmmaxcharwidth" read _getvalue_ write _setvalue_; + property tmweight index "tmweight" read _getvalue_ write _setvalue_; + property tmoverhang index "tmoverhang" read _getvalue_ write _setvalue_; + property tmdigitizedaspectx index "tmdigitizedaspectx" read _getvalue_ write _setvalue_; + property tmdigitizedaspecty index "tmdigitizedaspecty" read _getvalue_ write _setvalue_; + property tmfirstchar index "tmfirstchar" read _getvalue_ write _setvalue_; + property tmlastchar index "tmlastchar" read _getvalue_ write _setvalue_; + property tmdefaultchar index "tmdefaultchar" read _getvalue_ write _setvalue_; + property tmbreakchar index "tmbreakchar" read _getvalue_ write _setvalue_; + property tmitalic index "tmitalic" read _getvalue_ write _setvalue_; + property tmunderlined index "tmunderlined" read _getvalue_ write _setvalue_; + property tmstruckout index "tmstruckout" read _getvalue_ write _setvalue_; + property tmpitchandfamily index "tmpitchandfamily" read _getvalue_ write _setvalue_; + property tmcharset index "tmcharset" read _getvalue_ write _setvalue_; +end + +type TBrowseinfoA=class(tcstructwithcharptr) + {** + @explan(˵)ļѡṹ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hwndowner","intptr",0), + ("pidlroot","intptr",0), + ("pszdisplayname","intptr",0), + ("lpsztitle","intptr",0), + ("ulflags","int",0), + ("lpfn","intptr",0), + ("lparam","intptr",0), + ("iimage","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),nil,array("lpsztitle":nil,"pszdisplayname":nil)); + lpsztitle := 1024; + pszdisplayname := 1024; + end + property hwndowner index "hwndowner" read _getvalue_ write _setvalue_; + property pidlroot index "pidlroot" read _getvalue_ write _setvalue_; + property pszdisplayname index "pszdisplayname" read _getvalue_ write _setvalue_; + property lpsztitle index "lpsztitle" read _getvalue_ write _setvalue_; + property ulflags index "ulflags" read _getvalue_ write _setvalue_; + property lpfn index "lpfn" read _getvalue_ write _setvalue_; + property lparam index "lparam" read _getvalue_ write _setvalue_; + property iimage index "iimage" read _getvalue_ write _setvalue_; +end + +type TNMHDR=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hwndfrom","intptr",0), + ("idfrom","intptr",0), + ("code","int",0))); + return SSTRUCT; + end + public + class function memsize(); + begin + if not SSTRUCT then getstruct(); + if SSTRUCT then + begin + ldata := length(SSTRUCT)-1; + return SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3]; + end + return 0; + end + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hwndfrom index "hwndfrom" read _getvalue_ write _setvalue_; + property idfrom index "idfrom" read _getvalue_ write _setvalue_; + property code index "code" read _getvalue_ write _setvalue_; +end +type TWINDOWINFO=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("cbsize","int",0), + ("rcwindow","int[4]", + (0,0,0,0)), + ("rcclient","int[4]", + (0,0,0,0)), + ("dwstyle","int",0), + ("dwexstyle","int",0), + ("dwwindowstatus","int",0), + ("cxwindowborders","int",0), + ("cywindowborders","int",0), + ("atomwindowtype","byte[2]",(0,0)), + ("wcreatorversion","short",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property cbsize index "cbsize" read _getvalue_ write _setvalue_; + property rcwindow index "rcwindow" read _getvalue_ write _setvalue_; + property rcclient index "rcclient" read _getvalue_ write _setvalue_; + property dwstyle index "dwstyle" read _getvalue_ write _setvalue_; + property dwexstyle index "dwexstyle" read _getvalue_ write _setvalue_; + property dwwindowstatus index "dwwindowstatus" read _getvalue_ write _setvalue_; + property cxwindowborders index "cxwindowborders" read _getvalue_ write _setvalue_; + property cywindowborders index "cywindowborders" read _getvalue_ write _setvalue_; + property atomwindowtype index "atomwindowtype" read _getvalue_ write _setvalue_; + property wcreatorversion index "wcreatorversion" read _getvalue_ write _setvalue_; +end +////////////////////////socket ṹ//////////////////////////////////// +type TSockaddr=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("sa_family","short",0), + ("sa_data","char[14]",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property sa_family index "sa_family" read _getvalue_ write _setvalue_; + property sa_data index "sa_data" read _getvalue_ write _setvalue_; +end +type TSockaddr_in=class(tslcstructureobj) + private + static SSTRUCT; + FOpr; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("sin_family","short",0), + ("sin_port","short",0), + ("sin_addr","int",0), + ("sin_zero","char[8]",0))); + return SSTRUCT; + end + function writeIntShortN(n,V); + begin + if not(n >= 0 and n <= 1)then exit; + nv := sin_addr; + bs := FOpr.IntToShorts(nv); + bs[n]:= v; + sin_addr := FOpr.ShortsToInt(bs); + end + function writeIntByteN(n,V); + begin + if not(n >= 0 and n <= 3)then exit; + nv := sin_addr; + bs := FOpr.IntAsBytes(nv); + bs[n]:= v; + sin_addr := FOpr.bytesasint(bs); + end + function ReadIntShortN(N); + begin + if not(n >= 0 and n <= 1)then exit; + nv := sin_addr; + bs := FOpr.IntToShorts(nv); + return bs[n]; + end + function ReadIntByteN(N); + begin + if not(n >= 0 and n <= 3)then exit; + nv := sin_addr; + bs := FOpr.IntAsBytes(nv); + return bs[n]; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + FOpr := new TByteData(); + end + property s_b1 index 0 read ReadIntByteN write writeIntByteN; + property s_b2 index 1 read ReadIntByteN write writeIntByteN; + property s_b3 index 2 read ReadIntByteN write writeIntByteN; + property s_b4 index 3 read ReadIntByteN write writeIntByteN; + property s_w1 index 0 read ReadIntShortN write writeIntShortN; + property s_w2 index 1 read ReadIntShortN write writeIntShortN; + property sin_family index "sin_family" read _getvalue_ write _setvalue_; + property sin_port index "sin_port" read _getvalue_ write _setvalue_; + property sin_addr index "sin_addr" read _getvalue_ write _setvalue_; + property sin_zero index "sin_zero" read _getvalue_ write _setvalue_; +end +type TSockaddr_in6=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("sin6_family","short",0), + ("sin6_port","short",0), + ("sin6_flowinfo","long",0), + ("sin6_addr","byte[16]",array()), //union byte16 short8 + ("sin6_scope_id","long",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property sin6_family index "sin6_family" read _getvalue_ write _setvalue_; + property sin6_port index "sin6_port" read _getvalue_ write _setvalue_; + property sin6_flowinfo index "sin6_flowinfo" read _getvalue_ write _setvalue_; + property sin6_addr index "sin6_addr" read _getvalue_ write _setvalue_; + property sin6_scope_id index "sin6_scope_id" read _getvalue_ write _setvalue_; +end +type TWSADATA=class(tslcstructureobj) //е㲻 + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then + {$IFDEF win64} + SSTRUCT := MemoryAlignmentCalculate(array( + ("wversion","short",0), + ("whighversion","short",0), + ("imaxsockets","short",0), + ("imaxudpdg","short",0), + ("lpvendorinfo","char*",100), + ("szdescription","char[257]",0), + ("szsystemstatus","char[129]",0))); + {$ELSE} + SSTRUCT := MemoryAlignmentCalculate(array( + ("wversion","short",0), + ("whighversion","short",0), + ("szdescription","char[157]",0), + ("szsystemstatus","char[129]",0), + ("imaxsockets","short",0), + ("imaxudpdg","short",0), + ("lpvendorinfo","char*",100))); + {$ENDIF} + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property wversion index "wversion" read _getvalue_ write _setvalue_; + property whighversion index "whighversion" read _getvalue_ write _setvalue_; + property imaxsockets index "imaxsockets" read _getvalue_ write _setvalue_; + property imaxudpdg index "imaxudpdg" read _getvalue_ write _setvalue_; + property lpvendorinfo index "lpvendorinfo" read _getvalue_ write _setvalue_; + property szdescription index "szdescription" read _getvalue_ write _setvalue_; + property szsystemstatus index "szsystemstatus" read _getvalue_ write _setvalue_; +end +/////////////////////////////////////////////////////////////// +type tagWNDCLASSA=class(tslcstructureobj) // %% + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate(array( + ("cbsize","int",0), + ("style","int",0), + ("lpfnwndproc","intptr",0), + ("cbclsextra","int",0), + ("cbwndextra","int",0), + ("hinstance","intptr",0), + ("hicon","intptr",0), + ("hcursor","intptr",0), + ("hbrbackground","intptr",0), + ("lpszmenuname","intptr",0), //("lpszmenuname","char*",100), + ("lpszclassname","char*",100), + ("hiconsm","intptr",0))); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + _setvalue_("cbsize",_size_()); + end + property style:integer index "style" read _getvalue_ write _setvalue_; + property cbsize:integer index "cbsize" read _getvalue_ write _setvalue_; + property lpfnwndproc:pointer index "lpfnwndproc" read _getvalue_ write _setvalue_; + property cbclsextra:integer index "cbclsextra" read _getvalue_ write _setvalue_; + property cbwndextra:integer index "cbwndextra" read _getvalue_ write _setvalue_; + property hinstance:pointer index "hinstance" read _getvalue_ write _setvalue_; + property cbwndextra:integer index "cbwndextra" read _getvalue_ write _setvalue_; + property hicon:pointer index "hicon" read _getvalue_ write _setvalue_; + property hcursor:pointer index "hcursor" read _getvalue_ write _setvalue_; + property lpszmenuname:pointer index "lpszmenuname" read _getvalue_ write _setvalue_; + property hbrbackground:pointer index "hbrbackground" read _getvalue_ write _setvalue_; + property lpszclassname:string index "lpszclassname" read _getvalue_ write _setvalue_; + property hiconsm:pointer index "hiconsm" read _getvalue_ write _setvalue_; +end + + //////////////////////////////////ڴֹ//////////////////////////////////////////////////// + //******************************************************************** +type array1dlk=class //0ʼ + private + _len; + FCompareValue; + protected _data; // + public + {** + @explan(˵) һά %% + @param(_len)(integer) %% + @param(_data)(array) %% + @param(CompareValue)(fpointer) ص function(v1,v2)begin return v1 = v2 ; end %% + **} + function setdata(data); + begin + {** + @explan(˵) һ %% + @param(data)(array) %% + **} + _data := data; + _len := length(data); + end + function clean(); + begin + {** + @explan(˵) %% + **} + _data := array(); + _len := 0; + end + function create(); // + begin + {** + @explan(˵) %% + **} + _data := array(); + _len := 0; + end + function CallCompare(v1,v2,f); + begin + if datatype(f)=7 then return call(f,v1,v2); + if dataisfunction(FCompareValue)then return call(FCompareValue,v1,v2); + return v1=v2; + end + function append(v) //׷ + begin + {** + @explan(˵) ׷ %% + @param(v)() tsl %% + **} + _data[_len++]:= v; + end; + function geti(i); //ȡ + begin + {** + @explan(˵) %% + @param(i)(integer) id %% + **} + return _data[i]; + end + function seti(i,v); //ֵ + begin + {** + @explan(˵) ֵ %% + @param(i)(integer) id %% + @param(v)() tsl %% + **} + if i >= 0 and i<_len then + begin + _data[i]:= v; + end + end + function deli(i); //ɾ + begin + {** + @explan(˵) ɾ %% + @param(i)(integer) id %% + **} + //len := length(_data)-1; + if i<0 or i >= _len then return-1; + _len -= 1; + return deleteindex(_data,i,1); + end + function delis(i); + begin + {** + @explan(˵) ɾ %% + @param(i)(array) ɾid %% + **} + dels := getdels(i); + for ii,v in dels do deli(v); + end + function getdels(i); //ɾ + begin + {** + @ignore () %% + @explan(˵) ɾ %% + @param(i)(array) ɾid %% + **} + ii := sselect thisrow from(i union2 array())where(thisrow >= 0 and thisrow<_len)order by thisrow end; + dels := array(); + ix := 0; + for iv in ii do + begin + dels[iv]:= ii[iv]-ix; + ix++; + end + return dels; + end + function insertbefor(v,i); //֮ǰ + begin + {** + @explan(˵) i֮ǰ %% + @param(v)() %% + @param(i)(integer) id %% + **} + if not ifnumber(i)then return; + if i >= _len then return append(v); + else if i <= 0 then + begin + _data := array(v)union _data; + end else + begin + _data := _data[0:(i-1)]union array(v)union _data[i:]; + end + _len++; + end + function insertafter(v,i); //֮ + begin + {** + @explan(˵) i֮ %% + @param(v)() %% + @param(i)(integer) id %% + **} + if not ifnumber(i)then return; + if i >= _len then return append(v); + else if i<0 then + begin + _data := array(v)union _data; + end else + begin + _data := _data[0:i]union array(v)union _data[i+1:]; + end + _len++; + end + function findvid(v1,func,lx); //,funcͨıȽϺ + begin + {** + @explan(˵) źv1 ƥid %% + @param(v1)(any) tsl %% + @param(lx)(bool) %% + @param(func)(fpointer) ȽϺ һΪ ж,ڶΪж %% + **} + ret :=-1; + if lx then + begin + for i := length(_data)downto 0 do + begin + if CallCompare(_data[i],v1,func)then return i; + end + return ret; + end + for i,v in _data do + begin + if CallCompare(v,v1,func)then + begin + return i; + end + end + return ret; + end + function getprev(v1); //һ + begin + {** + @explan(˵) һ ƥid %% + @param(v1)() tsl %% + **} + if _len<2 then return nil; + id :=-1; + for i,v in _data do + begin + if CallCompare(v,v1)then + begin + id := i; + break; + end + end + return _data[id-1]; + end + function getnext(v1); //һ + begin + {** + @explan(˵) һ ƥid %% + @param(v1)() tsl %% + **} + if _len<2 then return nil; + id := _len; + for i,v in _data do + begin + if CallCompare(v,v1)then + begin + id := i; + break; + end + end + return _data[id+1]; + end + function ergodic(f); //ѭ + begin + {** + @explan(˵) ѭ %% + @param(f)(fpointer) function(id,v) begin end %% + **} + if(datatype(f)<> 7)then return nil; + for i,v in _data do + begin + ret := call(f,i,v); //## f(i,v); + if ret=-1 then break; + end + return 1; + end + function data(); // + begin + {** + @explan(˵) %% + **} + return _data; + end + function replace(i,v) //滻 + begin + {** + @explan(˵) 滻 %% + @param(i)(integer) %% + @param(v)() tsl %% + **} + if i >= 0 and i<_len then + begin + ret := _data[i]; + _data[i]:= v; + return ret; + end else + return nil; + end + function len(); //С + begin + {** + @explan(˵) %% + **} + //return length(_data); + return _len; + end + function setorder(i,j); + begin + {** + @explan(˵) Ԫλ %% + @param(i)(integer)ԭʼλ %% + @param(j)(integer) ƶλ + **} + if j>_len-1 then j := _len-1; + if j<0 then j := 0; + if i=j or(i<0 and i>_len)then exit; + sl := createserial(i,j); + for ii := 0 to length(sl)-2 do + begin + SwapNoCheck(sl[ii],sl[ii+1]); + end + end + function swap(i,j); // + begin + {** + @explan(˵) %% + @param(i)(integer) %% + @param(j)(integer) %% + **} + if ifnumber(i)and ifnumber(j)and i <> j and i >= 0 and j >= 0 and i<_len and j<_len then + begin + SwapNoCheck(i,j); + //vi := _data[i]; + //_data[i]:=_data[j]; + //_data[j] := vi; + end + end + property CompareValue read FCompareValue write FCompareValue; + private + function SwapNoCheck(i,j); + begin + vi := _data[i]; + _data[i]:= _data[j]; + _data[j]:= vi; + end + function createserial(i,j); + begin + if j>i then return i -> j; + r := array(); + kk := 0; + for ii := i downto j do r[kk++]:= ii; + return r; + end + function moveto(i,j); //iƶjǰ + begin + {** + @ignore %% + @explan(˵) iƶjǰ %% + @param(i)(integer) %% + @param(j)(integer) %% + **} + if not(ifnumber(i)and i >= 0 and i<_len)then return-1; + if ifnil(j)then j := 0; + if i=j then return-1; + vi := geti(i); + insertbefor(vi,j); + if i>j then + begin + deli(i+1); + end else + begin + deli(i); + end + end +end + +type TFpList=class(array1dlk) + {** + @explan(˵) list %% + **} + function create(); + begin + inherited; + end + function indexof(v,f,lx); + begin + {** + @explan(˵) ֵvеλ %% + @param(v)(any) κ %% + @return(integer) λ ,-1 ʾûҵ %% + **} + return findvid(v,f,lx); + end + function operator[](index); + begin + {** + @explan(˵)ȡΪindexֵ %% + @return(any) %% + **} + return geti(index); + end + function add(v); + begin + {** + @explan(˵)׷ݵ %% + @param(v)(any) %% + **} + return append(v); + end + function Remove(v); + begin + {** + @explan(˵)ɾV %% + @param(v)(any) %% + **} + return deli(indexof(v)); + end + function last(); + begin + {** + @explan(˵)ȡһ %% + @return(any) %% + **} + return geti(self.Count()-1); + end + function Count(); + begin + {** + @explan(˵)ȡݸ %% + @return(integer) %% + **} + return len(); + end +end +type TCharDiscrimi=class + static CD_SMA; + static CD_BGA; + static CD_SMZ; + static CD_BGZ; + static CD_UDL; + static CD_NIN; + static CD_ZER; + static CD_ISOK; + class function sinit();virtual; + begin + if not CD_ISOK then + begin + K := 1; + CD_SMA := ord("a"); + CD_BGA := ord("A"); + CD_SMZ := ord("z"); + CD_BGZ := ord("Z"); + CD_UDL := ord("_"); + CD_NIN := ord("9"); + CD_ZER := ord("0"); + CD_ISOK := 1; + end + end + class function IsLetter(cc); + begin + return IsUppercaseLetter(CC)OR IsLowercaseLetter(cc); + end + class function IsLowercaseLetter(cc); + begin + return(cc >= CD_SMA)and(cc <= CD_SMZ); + end + class function IsUppercaseLetter(cc); + begin + return(cc >= CD_BGA)and(cc <= CD_BGZ); + end + class function IsNumber(cc); + begin + return(cc >= CD_ZER)and(cc <= CD_NIN); + end + class function IsVariableName(s); + begin + if ifstring(s)and length(s)>= 1 then + begin + cc := ord(s[1]); + if IsLetter(cc)or cc=CD_UDL then + begin + for i := 2 To length(s) do + begin + cc := ord(s[i]); + if not(IsLetter(cc)or IsNumber(cc)or(cc=CD_UDL))then + begin + return false; + end + end + return true; + end + end + return 0; + end + function create(); + begin + sinit(); + end +end +type TCreateParams=class() + {** + @explan(˵) ڿؼ %% + **} + {** + @ignore() + **} + private + FParams; + public + {** + @param(Caption)(string) ؼ %% + @param(Style)(integer) ؼʽ %% + @param(ExStyle)(integer) ؼչʽ %% + @param(winclass)() ʽ %% + **} + Caption:string; + Style:integer; + ExStyle:integer; + X,Y:Integer; + CreateWithSubClass; + Width,Height:Integer; + WndParent:HWnd; + Param:Pointer; + winclass:tagWNDCLASSA; + subclass:tagWNDCLASSA; + WinClassName:string; + {** + @param(tagWNDCLASSA)() ׼ؼ %% + @param(WinClassName)() %% + @param(SubClassName)() ڻ %% + @param(subclasswndproc)() ڻϢ %% + @param(Winclasswndproc)() Ϣ %% + @param(cstyle)(integer) ʽ %% + @param(id)(integer) id Զ %% + @param(happ)(pointer) ̾ Զ %% + **} + SubClassName:string; + subclasswndproc:pointer; + Winclasswndproc:pointer; + id; + cstyle; + //cbrush; + happ; + public + function create(); + begin + FParams := array(); + Caption := ""; + Style := 0; + ExStyle := 0; + id := x := y := 0; + Width := Height := 0; + WndParent := 0; + Param := 0; + WinClassName := 0; + SubClassName := 0; + WinClassName := "tsui_window"; + subclasswndproc := 0; + Winclasswndproc := 0; + winclass := new tagWNDCLASSA(); + subclass := new tagWNDCLASSA(); + cbsize := winclass._size_(); + winclass._setvalue_("cbsize",cbsize); + subclass._setvalue_("cbsize",cbsize); + cstyle := 0; + end + function operator[](index); + begin + if ifstring(index)then + begin + nindex := lowercase(index); + try + return invoke(self(true),nindex); + except + return FParams[nindex]; + end + end else + return FParams[index]; + end + function operator[1](index,value); + begin + if ifstring(index)then + begin + nindex := lowercase(index); + try + invoke(self(true),index,1,value); + except + FParams[nindex]:= value; + end + end else + FParams[index]:= value; + end +end + +//**************************************************** +type tenumeration=class + {** + @explan(˵) ,ľ̬Աһֵ %% + **} + class function basevalue();virtual; + begin + {** + @explan(˵)ڸúû׼ֵ,ڸ %%; + **} + end + class function initenumeration(o,ival); + begin + {** + @explan(˵)ʼ %%; + @param(o)(tenumeration)tenumeration %% + @param(ival)(integer) ʼֵ,Ĭ0ʼ %% + **} + if not(o is class(tenumeration))then exit; + if ifnumber(ival)then val := integer(ival); + else val := 0; + o.basevalue(); + t := o.classinfo(); + par := t["inherited"]; + for i,v in par do + begin + initenumeration(findclass(v,o),ival); + end + for i,v in t["members"] do + begin + vl := invoke(o,v["name"]); + if ifnumber(vl)then val := integer(vl+1); + else invoke(o,v["name"],1,val++); + end + end +end +type TFPPenEndCap=class(tenumeration) + static pecRound; + static pecSquare; + static pecFlat; +end +type TFPPenMode=class(tenumeration) + static pmBlack; + static pmWhite; + static pmNop; + static pmNot; + static pmCopy; + static pmNotCopy; + static pmMergePenNot; + static pmMaskPenNot; + static pmMergeNotPen; + static pmMaskNotPen; + static pmMerge; + static pmNotMerge; + static pmMask; + static pmNotMask; + static pmXor; + static pmNotXor; +end +type TMouseButton=class(tenumeration) + static mbLeft; + static mbRight; + static mbMiddle; + static mbExtra1; + static mbExtra2; +end + +type TDragKind=class(tenumeration) + static dkDrag; + static dkDock; +end +type TDragMode=class(tenumeration) + static dmManual; + static dmAutomatic; +end +type TPairSplitterType=class(tenumeration) + static pstHorizontal; + static pstVertical; +end +type TDockOrientation=class(tenumeration) + static doNoOrient; // zone contains a TControl and no child zones.; + static doHorizontal; // zone's children are stacked top-to-bottom.; + static doVertical; // zone's children are arranged left-to-right.; + static doPages; // zone's children are pages arranged left-to-right.; +end +type TShiftStateEnum=class(tenumeration) + static ssShift; + static ssAlt; + static ssCtrl; + static ssLeft; + static ssRight; + static ssMiddle; + static ssDouble; + static ssMeta; //// Extra additions + static ssSuper; + static ssHyper; + static ssAltGr; + static ssCaps; + static ssNum; + static ssScroll; + static ssTriple; + static ssQuad; + static ssExtra1; + static ssExtra2; +end +type TControlFlag=class(tenumeration) + static cfLoading; // set by TControl.ReadState; unset by TControl.Loaded when all on form finished loading; + static cfAutoSizeNeeded; + static cfLeftLoaded; // cfLeftLoaded is set; when 'Left' is set during loading.; + static cfTopLoaded; + static cfWidthLoaded; + static cfHeightLoaded; + static cfClientWidthLoaded; + static cfClientHeightLoaded; + static cfBoundsRectForNewParentValid; + static cfBaseBoundsValid; + static cfPreferredSizeValid; + static cfPreferredMinSizeValid; + static cfOnChangeBoundsNeeded; + static cfProcessingWMPaint; + static cfKillChangeBounds; + static cfKillInvalidatePreferredSize; + static cfKillAdjustSize; +end + +type TFormStyle=class(tenumeration) + static fsMDIChild; + static fsMDIForm; + static fsStayOnTop; + static fsSplash; + static fsSystemStayOnTop; +end +type TComponentState=class(tenumeration) + static csLoading; + static csReading; + static csWriting; + static csDestroying; + static csDesigning; + static csAncestor; + static csUpdating; + static csFixups; + static csFreeNotification; + static csInline; + static csDesignInstance; +end +type TComponentStyle=class(tenumeration) + static csInheritable; + static csCheckPropAvail; + static csSubComponent; + static csTransient; +end +type TOperation=class(tenumeration) + static opInsert; + static opRemove; +end +type TAlign=class(tenumeration) + {** + @explan(˵) Զͳ %% + **} + static alNone; + static alTop; + static alBottom; + static alLeft; + static alRight; + static alClient; + static alCustom; +end + +type TAnchorKind=class(tenumeration) + //akTop, akLeft, akRight, akBottom + static akTop; + static akLeft; + static akRight; + static akBottom; +end + +type TWinControlFlag=class(tenumeration) + static wcfClientRectNeedsUpdate; + static wcfColorChanged; + static wcfFontChanged; + static wcfAllAutoSizing; + static wcfAligningControls; + static wcfEraseBackground; + static wcfCreatingHandle; + static wcfInitializing; + static wcfCreatingChildHandles; + static wcfRealizingBounds; + static wcfBoundsRealized; + static wcfUpdateShowing; + static wcfHandleVisible; + static wcfAdjustedLogicalClientRectValid; + static wcfKillIntfSetBounds; +end + +type TControlStyleType=class(tenumeration) + static csAcceptsControls; // can have children in the designer; + static csCaptureMouse; // auto capture mouse when clicked; + static csDesignInteractive; // wants mouse events in design mode; + static csClickEvents; // handles mouse events; + static csFramed; // not implemented; has 3d frame; + static csSetCaption; // if Name=Caption; changing the Name changes the Caption; + static csOpaque; // the control paints its area completely; + static csDoubleClicks; // understands mouse double clicks; + static csTripleClicks; // understands mouse triple clicks; + static csQuadClicks; // understands mouse quad clicks; + static csFixedWidth; // cannot change its width; + static csFixedHeight; // cannot change its height (for example combobox); + static csNoDesignVisible; // is invisible in the designer; + static csReplicatable; // PaintTo works; + static csNoStdEvents; // standard events such as mouse; key; and click events are ignored.; + static csDisplayDragImage; // display images from dragimagelist during drag operation over control; + static csReflector; // not implemented; the controls respond to size; focus and dlg messages - it can be used as ActiveX control under Windows; + static csActionClient; // Action is set; + static csMenuEvents; // not implemented; + static csNoFocus; // control will not take focus when clicked with mouse.; + static csNeedsBorderPaint; // not implemented; + static csParentBackground; // tells WinXP to paint the theme background of parent on controls background; + static csDesignNoSmoothResize; // when resizing control in the designer do not SetBounds while dragging; + static csDesignFixedBounds; // can not be moved nor resized in designer; + static csHasDefaultAction; // implements useful ExecuteDefaultAction; + static csHasCancelAction; // implements useful ExecuteCancelAction; + static csNoDesignSelectable; // can not be selected at design time; + static csOwnedChildrenNotSelectable; // child controls owned by this control are NOT selectable in the designer; + static csAutoSize0x0; // if the preferred size is 0x0 then control is shrinked ot 0x0; + static csAutoSizeKeepChildLeft; // when AutoSize=true do not move children horizontally; + static csAutoSizeKeepChildTop; // when AutoSize=true do not move children vertically; + static csRequiresKeyboardInput; // If the device has no physical keyboard then show the virtual keyboard when this control gets focus (therefore available only to TWinControl descendents); +end + +type TControlStateType=class(tenumeration) + static csLButtonDown; + static csClicked; + static csPalette; + static csReadingState; + static csFocusing; + static csCreating; + static csPaintCopy; + static csCustomPaint; + static csDestroyingHandle; + static csDocking; + static csVisibleSetInLoading; +end + +type TDragState=class(tenumeration) + static dsDragEnter; + static dsDragLeave; + static dsDragMove; +end +type TDragMessage=class(tenumeration) + static dmDragEnter; + static dmDragLeave; + static dmDragMove; + static dmDragDrop; + static dmDragCancel; + static dmFindTarget; +end +type TCanvasStates=class(tenumeration) + static csHandleValid; + static csFontValid; + static csPenvalid; + static csBrushValid; + static csRegionValid; +end +type TFPPenStyle=class(tenumeration) + static psSolid; + static psDash; + static psDot; + static psDashDot; + static psDashDotDot; + static psinsideFrame; + static psPattern; + static psClear; +end +type TFPPenJoinStyle=class(tenumeration) + static pjsRound; + static pjsBevel; + static pjsMiter; +end + +type TFormBorderStyle=class(tenumeration) + static bsNone; + static bsSingle; + static bsSizeable; + static bsDialog; + static bsToolWindow; + static bsSizeToolWin; +end +type TActionListState=class(tenumeration) + static asNormal; + static asSuspended; + static asSuspendedEnabled; +end + +type TAlignStyleH3=class(tenumeration) + {** + @explan(˵) ˮƽ볣 %% + **} + static AL3_LEFT; //0 + static AL3_RIGHT; //1 + static AL3_CENTER; //2 +end +type TAlignStyle9=class(tenumeration) + {** + @explan(˵) Ź볣 %% + **} + static AL9_DEFAULT; //0 + static AL9_TOPLEFT; //1 + static AL9_TOPCENTER; //2 + static AL9_TOPRIGHT; //3 + static AL9_CENTERLEFT; //4 + static AL9_CENTER; //5 + static AL9_CENTERRIGHT; //6 + static AL9_BOTTOMLEFT; //7 + static AL9_BOTTOMCENTER; //8 + static AL9_BOTTOMRIGHT; //9 +end +type TToolButtonStyle=class(tenumeration) + static tbsButton; + static tbsCheck; + static tbsDropDown; + static tbsSeparator; + static tbsDivider; + static tbsButtonDrop; +end + +type TRasterOperationConst=class + {** + @explan(˵) դ볣 %% + **} + static SRCCOPY; + static SRCPAINT; + static SRCAND; + static SRCINVERT; + static SRCERASE; + static NOTSRCCOPY; + static NOTSRCERASE; + static MERGECOPY; + static MERGEPAINT; + static PATCOPY; + static PATPAINT; + static PATINVERT; + static DSTINVERT; + static BLACKNESS; + static WHITENESS; + static NOMIRRORBITMAP; +end + +type TSystemBitmap=class + {** + @explan(˵) ϵͳṩbitmap id %% + **} + static OBM_CLOSE; + static OBM_UPARROW; + static OBM_DNARROW; + static OBM_RGARROW; + static OBM_LFARROW; + static OBM_REDUCE; + static OBM_ZOOM; + static OBM_RESTORE; + static OBM_REDUCED; + static OBM_ZOOMD; + static OBM_RESTORED; + static OBM_UPARROWD; + static OBM_DNARROWD; + static OBM_RGARROWD; + static OBM_LFARROWD; + static OBM_MNARROW; + static OBM_COMBO; + static OBM_UPARROWI; + static OBM_DNARROWI; + static OBM_RGARROWI; + static OBM_LFARROWI; + static OBM_OLD_CLOSE; + static OBM_SIZE; + static OBM_OLD_UPARROW; + static OBM_OLD_DNARROW; + static OBM_OLD_RGARROW; + static OBM_OLD_LFARROW; + static OBM_BTSIZE; + static OBM_CHECK; + static OBM_CHECKBOXES; + static OBM_BTNCORNERS; + static OBM_OLD_REDUCE; + static OBM_OLD_ZOOM; + static OBM_OLD_RESTORE; +end + +type TSystemCursor=class + {** + @explan(˵) 곣,Ϊο %% + **} + static OCR_WAIT; //150 + static OCR_CROSS; //30; + static OCR_UP; //6 + static OCR_SIZE; //0 + static OCR_SIZENWSE; //14 + static OCR_SIZENESW; //12 + static OCR_SIZEWE; //70 + static OCR_SIZENS; //138 + static OCR_SIZEALL; //58 + static OCR_ICOCUR; // 0 + static OCR_NO; //0 + static OCR_HAND; //24 + static OCR_APPSTARTING; //126 + static OCR_IBEAM; //152 +end + +type TSysCursor=class(tenumeration) + class function basevalue();override; + begin + { + //gtk + IDC_ARROW :=2 ; + IDC_IBEAM :=152; + IDC_WAIT :=150 ; + IDC_CROSS :=30; + IDC_UPARROW := 6; + IDC_SIZE :=0; //*** + IDC_ICON := 64; + IDC_SIZENWSE := 14; + IDC_SIZENESW := 12; + IDC_SIZEWE :=70; + IDC_SIZENS :=138; + IDC_SIZEALL := 58; + IDC_NO :=0; + IDC_HAND := 24; + IDC_APPSTARTING := 126; + IDC_HELP :=92; + return ; + } + IDC_ARROW := 32512; + IDC_SIZE := 32540; + IDC_NO := 32548; + end + static IDC_ARROW; //MAKEINTRESOURCE(32512) + static IDC_IBEAM; //MAKEINTRESOURCE(32513) + static IDC_WAIT; //MAKEINTRESOURCE(32514) + static IDC_CROSS; //MAKEINTRESOURCE(32515) + static IDC_UPARROW; //MAKEINTRESOURCE(32516) + static IDC_SIZE; //MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */ + static IDC_ICON; //MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */ + static IDC_SIZENWSE; // MAKEINTRESOURCE(32642) + static IDC_SIZENESW; // MAKEINTRESOURCE(32643) + static IDC_SIZEWE; //MAKEINTRESOURCE(32644) + static IDC_SIZENS; //MAKEINTRESOURCE(32645) + static IDC_SIZEALL; //MAKEINTRESOURCE(32646) + static IDC_NO; //MAKEINTRESOURCE(32648) + static IDC_HAND; //MAKEINTRESOURCE(32649) + static IDC_APPSTARTING; // MAKEINTRESOURCE(32650) + static IDC_HELP; //MAKEINTRESOURCE(32651) +end + +type tconstant = class(talign,TAnchorKind,TFormStyle,TComponentState, + TComponentStyle,TOperation,TWinControlFlag, + TControlStyleType,TMouseButton,TShiftStateEnum, + TControlFlag,TDockOrientation,TDragKind,TDragMode, + TDragState,TDragMessage,TCanvasStates,TFPPenMode, + TFPPenEndCap,TFPPenJoinStyle,TControlStateType, + TFormBorderStyle,TAlignStyle9,TAlignStyleH3,TSysCursor, + TActionListState,TToolButtonStyle,TPairSplitterType + ) + {** + @explan(˵) ༯ %% + **} +end + //**************************************************** + ///////////////////////////////// + type TResourcescache=class + {** + @ignore() %% + @explan(˵)gdiԴȵĻ + **} + private + FCache; + _wapi; + public + function create(); + begin + FCache := array(); + _wapi := gettswin32api(); + end + function reference(name);virtual; + begin + {** + @explan(˵)Դ %% + @param(name)(string) Դ %% + **} + v := Fcache[name]; + if ifarray(v)then + begin + Fcache[name,"count"]+= 1; + return Fcache[name,"value"]; + end + return 0; + end + function unreference(name);virtual; + begin + {** + @explan(˵)ȡԴ %% + @param(name)(string) Դ %% + **} + v := Fcache[name]; + if ifarray(v)then + begin + count := v["count"]; + if count >= 1 then + begin + Fcache[name]["count"]-= 1; + return 1; + end + {else + begin + destroyresource(name); + end} + end + return 0; + end + function addsource(name,value);virtual; + begin + {** + @explan(˵)Դ %% + @param(name)(string) Դ %% + @param(value)(obj) Դֵ %% + **} + //RETURN ; // + v := Fcache[name]; + if not(v)then + begin + Fcache[name]["value"]:= value; + Fcache[name]["count"]:= 1; + //return 1; + end else + begin + if Fcache[name]["value"]=value then + begin + Fcache[name]["count"]++; + end else + if value then + begin + destroyresource(name); + return addsource(name,value); + end + end + FCacheLength := length(FCache); + maxlen := 256; + if FCacheLength>maxlen then + begin + ct := 0; + rdxs := array(); + for i,v in FCache do + begin + if v["count"]=0 then + begin + rdxs[ct++]:= i; + end + if FCacheLength-ct <= maxlen then + begin + break; + end + end + for i,v in rdxs do + begin + destroyresource(v); + end + end + return 0; + end + function destroyresource(name);virtual; + begin + {** + @explan(˵)ɾָԴ %% + @param(name)(string) Դ %% + **} + v := Fcache[name]; + if v then + begin + hd := v["value"]; + reindex(Fcache,array(name:nil)); + _wapi.DeleteObject(hd); + end + end +end + +type TCHECK_RESULT=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("errline","int",0), + ("errmsg","char[4096]",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property errline index "errline" read _getvalue_ write _setvalue_; + property errmsg index "errmsg" read _getvalue_ write _setvalue_; +end + +type TCREATESTRUCT=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("lpcreateparams","intptr",0), + ("hinstance","intptr",0), + ("hmenu","intptr",0), + ("hwndparent","intptr",0), + ("cy","int",0), + ("cx","int",0), + ("y","int",0), + ("x","int",0), + ("style","int",0), + ("lpszname","char*",100), + ("lpszclass","char*",100), + ("dwexstyle","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property lpcreateparams index "lpcreateparams" read _getvalue_ write _setvalue_; + property hinstance index "hinstance" read _getvalue_ write _setvalue_; + property hmenu index "hmenu" read _getvalue_ write _setvalue_; + property hwndparent index "hwndparent" read _getvalue_ write _setvalue_; + property cy index "cy" read _getvalue_ write _setvalue_; + property cx index "cx" read _getvalue_ write _setvalue_; + property y index "y" read _getvalue_ write _setvalue_; + property x index "x" read _getvalue_ write _setvalue_; + property style index "style" read _getvalue_ write _setvalue_; + property lpszname index "lpszname" read _getvalue_ write _setvalue_; + property lpszclass index "lpszclass" read _getvalue_ write _setvalue_; + property dwexstyle index "dwexstyle" read _getvalue_ write _setvalue_; +end +type TNMMOUSE=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hdr","user",array( + ("hwndfrom","intptr",0), + ("idfrom","intptr",0), + ("code","int",0))), + ("dwitemspec","intptr",0), + ("dwitemdata","intptr",0), + ("pt","int[2]", + (0,0)), + ("dwhitinfo","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hdr index "hdr" read _getvalue_ write _setvalue_; + property dwitemspec index "dwitemspec" read _getvalue_ write _setvalue_; + property dwitemdata index "dwitemdata" read _getvalue_ write _setvalue_; + property pt index "pt" read _getvalue_ write _setvalue_; + property dwhitinfo index "dwhitinfo" read _getvalue_ write _setvalue_; +end + + ///////////////////////////////// + + ///////////////////////////Ϣ//////////////////////////////////// +type tuieventbase=class(TSLUICONST) + {** + @explan(˵) Ϣ %% + **} + public + Message:integer; + Wparam:pointer; + Lparam:pointer; + Hwnd:pointer; + _tag; + {** + @param(Message)(integer) Ϣid %% + @param(Wparam)(pointer) Ϣwparam %% + @param(Lparam)(pointer) Ϣlparam %% + @param(Hwnd)(pointer) ھ %% + **} + private + Fhwparam; + Flwparam; + Fhlparam; + Fllparam; + //з + Fuhwparam; + Fulwparam; + Fuhlparam; + Fullparam; + // + FSkip; + Fresult; + FSender; + function setSkip(v); + begin + if v then + begin + FSkip := true; + end else + begin + FSkip := false; + end + end + function GetSender(); + begin + return FSender; + end + Function SetSender(v); + begin + return FSender := v; + end + public + //FLparamdata; + //FWparamdata; + function create(m,w,l,h);virtual; + begin + {** + @explan(˵) Ϣ %% + @param(m)(integer) Ϣid %% + @param(w)(pointer) Ϣwparam %% + @param(l)(pointer) Ϣlparam %% + @param(h)(pointer) ھ %% + **} + Message := m; + Wparam := w; + Lparam := l; + Hwnd := h; + end + function hilparam(); + begin + {** + @explan(˵) ֽ %% + **} + if ifnil(Fhlparam)then + begin + lowuperdword(Lparam,Fllparam,Fhlparam); + end + return Fhlparam; + end + function lolparam(); + begin + {** + @explan(˵) ֽ %% + **} + if ifnil(Fllparam)then + begin + lowuperdword(Lparam,Fllparam,Fhlparam); + end + return Fllparam; + end + function hiwparam(); + begin + {** + @explan(˵) ֽ %% + **} + if ifnil(Fhwparam)then + begin + lowuperdword(Wparam,Flwparam,Fhwparam); + end + return Fhwparam; + end + function lowparam(); + begin + {** + @explan(˵) ֽ %% + **} + if ifnil(Flwparam)then + begin + lowuperdword(Wparam,Flwparam,Fhwparam); + end + return Flwparam; + end + function hilparamsigned(); + begin + {** + @explan(˵) Ϊ + **} + if ifnil(Fuhlparam)then Fuhlparam := unsignedtosigned(hilparam()); + return Fuhlparam; + end + function lolparamsigned(); + begin + {** + @explan(˵) Ϊ + **} + if ifnil(Fullparam)then Fullparam := unsignedtosigned(lolparam()); + return Fullparam; + end + function hiwparamsigned(); + begin + {** + @explan(˵) Ϊ + **} + if ifnil(Fuhwparam)then Fuhwparam := unsignedtosigned(hiwparam()); + return Fuhwparam; + end + function lowparamsigned(); + begin + {** + @explan(˵) Ϊ + **} + if ifnil(Fulwparam)then Fulwparam := unsignedtosigned(lowparam()); + return Fulwparam; + end + property msg read Message; + property skip read FSkip write setSkip; + property Result read Fresult write Fresult; + property Handle read Hwnd write Hwnd; + property Sender read GetSender write SetSender; + {** + @param(msg)(integer) Ϣid %% + @param(skip)(bool) ǷԵײϢ %% + @param(Result)(integer) Ϣ %% + @param(Handle)(pointer) ھ %% + @param(sender)(TControl) ϢĿؼ,˵ϢĴ %% + **} +end + + +type TPAINTSTRUCT=class(tslcstructureobj) + {** + @expaln(˵)wm_paintϢṹ %% + **} + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hdc","intptr",0), + ("ferase","int",0), + ("rcpaint","int[4]", + (0,0,0,0)), + ("frestore","int",0), + ("fincupdate","int",0), + ("rgbreserved","byte[32]",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hdc index "hdc" read _getvalue_; + property ferase index "ferase" read _getvalue_; + property rcpaint index "rcpaint" read _getvalue_; + property frestore index "frestore" read _getvalue_; + property fincupdate index "fincupdate" read _getvalue_; + property rgbreserved index "rgbreserved" read _getvalue_; +end +type TMNOTIFY=class(tuieventbase,tslcstructureobj) + {** + @explan(˵) ϵͳؼ֪ͨϢ %% + **} + STATIC SFSTRUCT; + function getstruct(); + begin + if not SFSTRUCT then SFSTRUCT := MemoryAlignmentCalculate(array( + ("hwndfrom","intptr",0), + ("idfrom","intptr",0), + ("code","int",0))); + return SFSTRUCT; + end + function create(m,w,l,h);override; + begin + inherited; + class(tslcstructureobj).create(getstruct(),l); + end + property hwndfrom index "hwndfrom" read _getvalue_; + property code index "code" read _getvalue_; + {** + @param(hwndfrom)(pointer) ӿؼ %% + @param(code)(integer) ֪ͨ %% + **} +end +type TMALIGN=class(tuieventbase) + value; + top:integer; + left:integer; + width:integer; + height:integer; + function create(m,w,l,h); + begin + inherited; + top := left := right := bottom := 0; + end +end +type TMANCHOR=class(tuieventbase) + prec; + function create(m,w,l,h); + begin + inherited; + prec := array(0,0,0,0); + end +end + +type TMMENUSELECT=class(tuieventbase) + {** + @explan(˵) ˵ѡϢ %% + **} + function create(m,w,l,h);override; + begin + inherited; + end + property itemid read lowparam; + property flags read hiwparam; + {** + @param(itemid)(integer) ˵id %% + @param(flags)(integer) ״̬ %% + **} +end +type TMKEY=class(tuieventbase) + {** + @param(˵) Ϣ + **} + private + FShiftsate; + function getshiftsate(); + begin + if not ifarray(FShiftsate)then + begin + FShiftsate := array(); + w32 := gettswin32api(); + if getbitsfrominteger(w32.GetKeyState(VK_SHIFT),15,15)then FShiftsate[length(FShiftsate)]:= ssShift; + if getbitsfrominteger(w32.GetKeyState(VK_CONTROL),15,15)then FShiftsate[length(FShiftsate)]:= ssCtrl; + if getbitsfrominteger(w32.GetKeyState(VK_MENU),15,15)then FShiftsate[length(FShiftsate)]:= ssAlt; + //echo tostn(FShiftsate); + //echo getbitsfrominteger( w32.GetKeyState(VK_MENU),15,15),"*************\r\n"; + end + return FShiftsate; + end + FChar; + public + function create(m,w,l,h);override; + begin + inherited; + FChar := chr(w); + end + property char read FChar; + property CharCode read wparam; + property shiftstate read getshiftsate; + {** + @param(char)(string) %% + @param(CharCode)(integer) ascii %% + @param(shiftstate)(arry of TShiftStateEnum member ) ascii %% + **} +end +type TDrawitemState=class + {** + @explan(˵) ϵͳؼʱ״̬ %% + **} + static ODS_SELECTED; + static ODS_GRAYED; + static ODS_DISABLED; + static ODS_CHECKED; + static ODS_FOCUS; + static ODS_DEFAULT; + static ODS_COMBOBOXEDIT; + static ODS_HOTLIGHT; + static ODS_INACTIVE; + static ODS_NOACCEL; + static ODS_NOFOCUSRECT; +end +Type TtageDrawItem=class(tslcstructureobj) + private + static SFSTRUCT; + class function getstruct();virtual; + begin + if not SFSTRUCT then SFSTRUCT := MemoryAlignmentCalculate(array( + ("ctltype","int",0), + ("ctlid","int",0), + ("itemid","int",0), + ("itemaction","int",0), + ("itemstate","int",0), + ("hwnditem","intptr",0), + ("hdc","intptr",0), + ("rcitem","int[4]", + (0,0,0,0)), + ("itemdata","intptr",0))); + return SFSTRUCT; + end + public + function create(ptr); + begin + inherited create(getstruct(),ptr); + end + {** + @param(ctltype)(integer) ؼ %% + @param(ctlid)(integer) ؼid %% + @param(id)(integer) Ƶ %% + @param(itemstate)(member of TDrawitemState ) ״̬%% + @param(hdc)(pointer) canvas %% + @param(hwnditem)(pointer) windows %% + @param(rcitem)(array of integer) array(,,,) %% + @param(itemaction)(integer) ODA_DRAWENTIRE or ODA_FOCUS or ODA_SELECT %% + **} + property ctltype index "ctltype" read _getvalue_ write _setvalue_; + property ctlid index "ctlid" read _getvalue_ write _setvalue_; + property id index "itemid" read _getvalue_ write _setvalue_; + property itemid index "itemid" read _getvalue_ write _setvalue_; + property itemaction index "itemaction" read _getvalue_ write _setvalue_; + property itemstate index "itemstate" read _getvalue_ write _setvalue_; + property rcitem index "rcitem" read _getvalue_ write _setvalue_; + property hdc index "hdc" read _getvalue_ write _setvalue_; + property hwnditem index "hwnditem" read _getvalue_ write _setvalue_; +end +type TMDRAWITEM=class(tuieventbase,TtageDrawItem) + public + function create(m,w,l,h);override; + begin + inherited; + class(TtageDrawItem).create(l); + end + function destroy();override; + begin + inherited; + class(TtageDrawItem).destroy(); + end + canvas; +end +type TGRIDMDRAWITEM=class(TMDRAWITEM) + {** + @explan(˵) ؼϢ %% + **} + private + FSubitemid; + FSubItemRect; + public + function create(m,w,l,h);override; + begin + inherited; + end + property Subitemid read FSubitemid write FSubitemid; + property SubItemRect read FSubItemRect write FSubItemRect; +end +type TMMEASUREITEM=class(tuieventbase,tslcstructureobj) + {** + @explan(˵) ϵͳؼϢ + **} + static SFSTRUCT; + class function getstruct(); + begin + if not SFSTRUCT then SFSTRUCT := MemoryAlignmentCalculate(array( + ("ctltype","int",0), + ("ctlid","int",0), + ("itemid","int",0), + ("itemwidth","int",0), + ("itemheight","int",0), + ("itemdata","intptr",0))); + return SFSTRUCT; + end + function create(m,w,l,h);override; + begin + inherited; + class(tslcstructureobj).create(getstruct(),l); + end + property ctlid index "ctlid" read _getvalue_; + property ctltype index "ctltype" read _getvalue_; + property id index "itemid" read _getvalue_; + property width index "itemwidth" read _getvalue_ write _setvalue_; + property height index "itemheight" read _getvalue_ write _setvalue_; + property itemid index "itemid" read _getvalue_; + property itemwidth index "itemwidth" read _getvalue_ write _setvalue_; + property itemheight index "itemheight" read _getvalue_ write _setvalue_; + {** + @param(ctlid)(integer) ؼid %% + @param(itemid)(integer) ؼڸе %% + @param(width)(integer) û߻ȡ %% + @param(height)(integer) û߻ȡ߶ %% + **} +end +type TSIFTSTATE = class(TSLUICONST) + protected + FKeyState; + class function KeysToShiftState(Keys: PtrUInt): TShiftState; + begin + {** + @explan(˵) ״̬ %% + **} + Result := array(); + if (Keys .& MK_Shift) <> 0 then includestate(Result, ssShift); + if (Keys .& MK_Control) <> 0 then includestate(Result, ssCtrl); + if (Keys .& MK_LButton) <> 0 then includestate(Result, ssLeft); + if (Keys .& MK_RButton) <> 0 then includestate(Result, ssRight); + if (Keys .& MK_MButton) <> 0 then includestate(Result, ssMiddle); + if (Keys .& MK_XBUTTON1) <> 0 then includestate(Result, ssExtra1); + if (Keys .& MK_XBUTTON2) <> 0 then includestate(Result, ssExtra2); + if (Keys .& MK_DOUBLECLICK) <> 0 then includestate(Result, ssDouble); + if (Keys .& MK_TRIPLECLICK) <> 0 then includestate(Result, ssTriple); + if (Keys .& MK_QUADCLICK) <> 0 then includestate(Result, ssQuad); + v := gettswin32api().GetKeyState(VK_MENU); + if _shr(v,15) then includestate(Result, ssAlt); + //if gettswin32api().GetKeyState(VK_MENU) < 0 then includestate(Result, ssAlt); + //if (GetKeyState(VK_LWIN) < 0) or (GetKeyState(VK_RWIN) < 0) then Include(Result, ssMeta); + return Result; + end; + + end +type TMMOUSEWHEEL=class(tuieventbase,TSIFTSTATE) + {** + @explan(˵)Ϣ %% + **} + function create(m,w,l,h);override; + begin + inherited; + end + function shiftstate(); + begin + {** + @explan(˵) ״̬ %% + @return(array of TShiftStateEnum menuber) shift + **} + if ifnil(FKeyState)then + begin + FKeyState := KeysToShiftState(lowparam()); + end + return FKeyState; + end + property delta read hiwparamsigned; + property ypos read hilparamsigned; + property xpos read lolparamsigned; + {** + @param(ypos)(integer)y %% + @param(xpos)(integer)x %% + @param(delta)(integer)˶ %% + **} +end +type TMMouse=class(tuieventbase,TSIFTSTATE) + {** + @explan(˵) Ϣ %% + **} + protected FButton; + public + function create(m,w,l,h);override; + begin + inherited; + end + {** + @param(xpos)(integer) x λ %% + @param(ypos)(integer) y λ %% + @param(FButton)(integer) ״̬,̳ʱʹ %% + **} + property xpos:integer read lolparamsigned; + property ypos:integer read hilparamsigned; + function pos(); + begin + return array(xpos(),ypos()); + end + property Dummy read Lparam; + function SetButton(v); + begin + {** + @ignore() %% + **} + if ifnumber(v)then FButton := v; + else return FButton; + end + function button(); + begin + {** + @explan(˵) 갴 %% + @return(member of TMouseButton) + **} + return FButton; + end + function shiftstate(); + begin + {** + @explan(˵) ״̬ %% + @return( array of TShiftStateEnum menuber) %% + **} + if ifnil(FKeyState)then + begin + FKeyState := KeysToShiftState(Wparam); + end + return FKeyState; + end + function setshiftdouble(v); + begin + {** + @ignore() %% + **} + shiftstate(); + if ifnumber(v)then + begin + includestate(FKeyState,v); + end + end + function shiftdouble(); + begin + {** + @explan(˵) Ƿ˫ %% + @return(bool) Ƿ˫ + **} + shiftstate(); + return(ssDouble in FKeyState); + end +end +type TSTYLESTRUCT=class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("styleold","int",0), + ("stylenew","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end +end +type tvclwindowpos_class= class(tslcstructureobj) //λϢ + private + static SSTRUCT; + function getstruct(); + begin + if not SSTRUCT then + begin + SSTRUCT := MemoryAlignmentCalculate( + array(("hwndinsertafter","intptr",0), + ("hwnd","intptr",0), + ("x","int",0), + ("y","int",0), + ("cx","int",0), + ("cy","int",0), + ("flags","int",0))); + end + return SSTRUCT; + end + public + function create(ptr);override; + begin + inherited create(getstruct(),ptr); + end + property x:integer index "x" read _getvalue_ write _setvalue_; + property y:integer index "y" read _getvalue_ write _setvalue_; + property cx:integer index "cx" read _getvalue_ write _setvalue_; + property cy:integer index "cy" read _getvalue_ write _setvalue_; + property flags:integer index "flags" read _getvalue_ write _setvalue_; + property hwndinsertafter:integer index "hwndinsertafter" read _getvalue_ write _setvalue_; + property hwnd:integer index "hwnd" read _getvalue_ write _setvalue_; +end +type TMSTYLECHANG=class(tuieventbase) + {** + @explan(˵)ʽıϢ %% + **} + private + FSTyle; + function _getvalue_(n); + begin + return FSTyle._getvalue_(n); + end + function _setvalue_(n,v); + begin + return FSTyle._setvalue_(n,v); + end + public + function create(m,w,l,h);override; + begin + inherited; + FSTyle := new TSTYLESTRUCT(l); + end + property styleold index "styleold" read _getvalue_ write _setvalue_; + property stylenew index "stylenew" read _getvalue_ write _setvalue_; + {** + @param(stylenew)(integer) ʽ %% + @param(styleold)(integer) ʽ %% + **} +end + + ///////////////////////////Ϣ//////////////////////////////////// +type TWMNCHITTEST=class(TSLUICONST) // hittestϢ + function hitstyle(o,e); + begin + return hitstyle2(o,e.lolparam,e.hilparam); + end + function hitstyle2(o,x,y); + begin + //rec := o.clientrect(); //ͻ + //p := o.screentoclient(e.lolparam,e.hilparam); + rec := zeros(4); + o._wapi.GetWindowRect(o.Handle,rec); + p := array(x,y); // + r := borerhittest(p,rec,4); + r := inttohit(r); + return r; + end + function inttohit(i); + begin + r := HTCLIENT; + case i of + 1:r := HTTOPLEFT; + 2:r := HTTOPRIGHT; + 3:r := HTBOTTOMRIGHT; + 4:r := HTBOTTOMLEFT; + 5:r := HTLEFT; + 6:r := HTTOP; + 7:r := HTRIGHT; + 8:r := HTBOTTOM; + end; + return r; + end + function borerhittest(p,rec,dv); + begin + rec[0]+= 1; + rec[1]+= 1; + rec[2]-= 1; + rec[3]+= 1; + ps := array(rec[0:1],(rec[2],rec[1]),(rec[2],rec[3]),(rec[0],rec[3])); + ds := array(); + for i,v in ps do + begin + ds[i]:= integer(sqrt((p[0]-v[0])^2+(p[1]-v[1])^2)); + end + minds := minvalue(ds); + if minds"tdcreateform") and (cn<>"tdcreatepanel")) then + begin + Loadinherited(findclass(ic,o)); + phs := static GetSourceDirs(); + Loadtfmtoform(o,phs,cn); + end + end + function Loadinherited_sub(o); + begin + if not ifobj(o) then return ; + if not((o is class(TDCreateForm)) or (o is class(TDCreatePanel))) then return ;//ж + o2 := o; + phs := static GetSourceDirs(); + objs := array(); + while true do + begin + ci := o2.classinfo(); + cn := ci["classname"]; + ic := ci["inherited"][0]; + if((cn<>"tdcreateform") and (cn<>"tdcreatepanel")) then + begin + objs[length(objs)] := cn; + o2 := findclass(ic,o2); + end else break; + end + for i := length(objs)-1 downto 0 do + begin + Loadtfmtoform(o,phs,objs[i]); + end + end + function GetSourceDirs(); + begin + lps := GetLibPaths(); + lps[length(lps)] := static GetCurrentTslDir()+"funcext"+ioFileseparator(); + lps union2=array(); + r := array(); + for i,v in lps do + begin + GetReSourcetfmdir(v,r); + end + return r; + end + function GetReSourcetfmdir(p,rp); + begin + if not ifarray(rp) then rp := array(); + iofp := ioFileseparator(); + for ii,vv in filelist("",p+"*") do + begin + fn := vv["FileName"]; + if fn="." or fn=".." then continue; + if Pos("D",vv["Attr"]) then + begin + if lowercase(fn)="resource.tfm" then + begin + rp[length(rp)] := p+"resource.tfm"+iofp; + end else + begin + GetReSourcetfmdir(p+fn+iofp,rp); + end + end + end + end + function GetLibPaths(); + begin + p := tsl_getlibpath_(); + if not p then return array(); + FCurrentp := ""; + {$ifdef linux} + FCurrentp := tsl_getcurrentdir_(); + {$else} + s := ""; + setlength(s,1024); + wapi := gettswin32api(); + N := wapi.GetCurrentDirectoryA(1023,s); + FCurrentp := s[1:N]; + {$endif} + FCurrentp1 := ""; + iofp := ioFileseparator(); + for i:= length(FCurrentp)-1 downto 1 do + begin + if FCurrentp[i] = iofp then + begin + FCurrentp1 := FCurrentp[1:i-1]; + break; + end + end + ri := 0; + r := array(); + iofp2 := "."+iofp; + iofp3 := ".."+iofp; + for i,v in str2array(p,";") do + begin + vi := trim(v); + if not vi then continue; + if vi[length(vi)]<>iofp then continue; + if pos(iofp2,vi)=1 then + begin + r[ri] := FCurrentp+vi[2:]; + end else + if pos(iofp3,vi)=1 then + begin + r[ri] := FCurrentp1+vi[3:]; + end + else + begin + r[ri] := vi; + end + ri++; + end + return r; + end +end +type tcomponent = class(TSLUIBASE) + {** + @explan(˵) ӻ %% + **} + private + {** + @param(FOwner)(tcomponent) %% + @param(FComponents)( TFpList ) %% + @param(FComponentState)( array of integer) ڵ״̬ %% + @param(FComponentStyle)( array of integer) ڵʽ %% + @param(FFreeNotifies)( TFpList) ֪ͨڵ %% + **} + FOwner; + FName; + FComponents; + FFreeNotifies: TFpList; + FComponentState; + FComponentStyle; + FComponentCreated; + FLoader; + function ComponentGetParent();virtual; + begin + + end + function ComponentSetParent();virtual; + begin + + end +#!begin //private methods + function GetLoader(); + begin + if not FLoader then FLoader := new Ttfm2Component(); + return FLoader; + end + function GetPropInfo(); + begin + o := self(true); + r := getPropInfo2(o); + ret := array(); + ii := 0; + for i,v in r do + begin + ret[ii++]:= v; + end + return select * from ret order by["name"] end; + end + static FClassDigestB; + class function GetClassDigestB(idx,d); + begin + if not ifarray(FClassDigestB)then FClassDigestB := array(); + if ifnil(d)then return FClassDigestB[idx]; + else FClassDigestB[idx]:= d; + end + function getPropInfo2(o); + begin + if not(o is class(tcomponent))then return array(); + t := o.classinfo; + idx := getmsgd_Crc32(tostm(t))+"&&"; + r := GetClassDigestB(idx); + if ifarray(r)then return r; + r := array(); + hs := t["inherited"]; + for i,v in hs do + begin + r union=static call(thisfunction,findclass(v,o))name v+"&&_&&"; + end + for i,v in t["properties"] do + begin + n := v["name"]; + if((v["access"]in array(2,3))or(not(v["read"])))or not(v["type"])then + begin + deleteindex(r,n); + continue; + end + if v["read"]and v["type"]then + begin + r union=array(n:v[array("name","type","write","parser")]); + end + end + for i,v in t["members"] do + begin + n := v["name"]; + if(v["access"]in array(2,3))or not(v["type"])then + begin + deleteindex(r,n); + continue; + end + tr := v[array("name","type","write","parser")]; + tr["write"]:= true; + r union=array(n:tr); + end + GetClassDigestB(idx,r); + return r; + end + function GetComponent(AIndex); + begin + {** + @explan(˵) ȡӽڵ %% + @param(AIndex)( integer ) %% + **} + return FComponents.geti(AIndex); + end + function SetComponentState(v); + begin + if ifarray(v)then FComponentState := v; + end + function GetComponentCount(); + begin + {** + @explan(˵) ȡӽ%% + @return(AIndex)( integer ) %% + **} + return FComponents.count(); + end + function GetComponentIndex(); + begin + {** + @explan(˵) ȡӽ%% + @return(AIndex)( integer ) %% + **} + if FOwner is class(tcomponent)then + begin + return FOwner.Components.findvid(self); + end + return-1; + end + procedure Insert(AComponent:TComponent); //˴Ҫ޸ + begin + {** + @explan(˵)ӽڵ %% + **} + FComponents.Add(AComponent); + AComponent.FOwner := Self(true); + end + procedure Remove(AComponent:TComponent); + begin + {** + @explan(˵)Ƴӽڵ %% + **} + if FComponents.Remove(AComponent)>0 then + begin + AComponent.FOwner := Nil; + return true; + end + return false; + end; + procedure RemoveNotification(AComponent:TComponent); + begin + FFreeNotifies.Remove(AComponent); + if FFreeNotifies.count()<1 then includestate(FComponentState,csFreeNotification); + end +#!end + protected +#!begin //protected methods + function SetName(v);virtual; + begin + if ifstring(v)and length(v)>1 and v <> FName then + begin + if isKeyWords(v)then return; + nv := lowercase(v); + if new TCharDiscrimi().IsVariableName(v)then + begin + r := RootOwner().FindComponentByName(nv); + if not r then + begin + FName := nv; + end + end + end + end + Procedure SetAncestor(Value:Boolean); + begin + If Value then includestate(FComponentState,csAncestor)else excludestate(FCOmponentState,csAncestor); + For Runner := 0 To FComponents.Count-1 do + begin + FComponents.geti(Runner).SetAncestor(Value); + end + end; + function ValidateContainer(AComponent:TComponent);virtual; + begin + if AComponent is class(tcomponent)then return AComponent.ValidateInsert(Self); + end + function ValidateInsert(AComponent:TComponent);virtual; + begin + return true; + end +public + Procedure Notification(AComponent,Operation);virtual; + begin + {** + @explan(˵) ֪ͨ %% + @param(AComponent)(tcomponent) ıĶ %% + @param(Operation)(member of TOperation) ֪ͨ %% + **} + If(Operation=opRemove)then + begin + RemoveFreeNotification(AComponent); + end + data := FComponents.data(); + C := length(data)-1; + While(C >= 0) do + begin + data[c].Notification(AComponent,Operation); + c--; + end; + end; +private + Procedure SetDesignInstance(Value); + begin + If Value then + includestate(FComponentState,csDesignInstance) + else + excludestate(FComponentState,csDesignInstance); + end; +public + procedure RemoveFreeNotification(AComponent:TComponent); + begin + RemoveNotification(AComponent); + AComponent.RemoveNotification(self); + end; +Procedure SetDesigning(Value,SetChildren);virtual; +begin + {** + @explan(˵) ʹ÷,Ϊ״̬,߽״̬ %% + @param(Value)(bool) ״ֵ̬ %% + @param(SetChildren)(bool) Ƿ޸ӿؼ״̬ %% + **} + if ifnil(SetChildren)then SetChildren := true; + If Value then + includestate(FComponentState,csDesigning); + else + excludestate(FComponentState,csDesigning); + if SetChildren then + begin + items := FComponents.data; + For Runner := 0 To length(items)-1 do + begin + items[Runner].SetDesigning(Value); + end + end +end; +protected + function SetParentComponent(Value);virtual; + begin + end + function GetChildren();virtual; + begin + end + procedure Updating;virtual; + begin + includestate(FComponentState,csUpdating); + end + procedure Updated;virtual; + begin + excludestate(FComponentState,csUpdating); + end + +#!end +public +#!begin //public methods + function create(AOwner);virtual; + begin + class(TSLUIBASE).create(); + FComponents := NEW TFpList(); + FFreeNotifies := NEW TFpList(); + FComponentStyle := array(csInheritable); + FComponentstate := array(); + SetOwner(AOwner); + FEventsProperties := array(); + FVariableProperties := array(); + FComponentCreated := true; + return; + If AOwner is class(tcomponent)then + begin + FOwner := AOwner; + AOwner.InsertComponent(Self); + end + end + function RootOwner(); + begin + if not(FOwner is class(TComponent))then return self(true); + return FOwner.RootOwner(); + end + function FindComponentByName(n); + begin + if n and n=FName then return self(true); + cps := Components; + for i := 0 to cps.Count-1 do + begin + r := cps[i].FindComponentByName(n); + if r then return r; + end + return false; + end + function isDescendant(cd); + begin + {** + @explan(˵) жϽڵǷΪӽڵ %% + @param(cd)(tcomponent) жϽڵ %% + @return(bool) true Ϊӽڵ false ӽڵ %% + **} + if cd=self then return true; + for i := 0 to FComponents.count()-1 do + begin + if FComponents[i].isDescendant(cd)then return true; + end + return false; + end + function SetOwner(AOwner); + begin + {** + @explan(˵) ,עֻܳɹһ,֮Ч %% + @param(AOwner)(tcomponent) %% + **} + if ifnil(FOwner)and(AOwner is class(tcomponent))then + begin + if isDescendant(AOwner)then exit; + FOwner := AOwner; + AOwner.InsertComponent(self(true)); + end + end + function Recycling();override; + begin + if not FComponentCreated then exit; + Destroying(); + DestroyComponents(); + If FOwner is class(tcomponent)Then FOwner.RemoveComponent(Self); + inherited; + end + function Destroy();virtual; + begin + inherited; + end; + function Destroying(); + begin + If csDestroying in FComponentstate Then Exit; + includestate(FComponentState,csDestroying); + if not FCOmponents then exit; + data := FCOmponents.data(); + for i,v in data do v.Destroying(); + end; + function ExecuteAction(act:TBasicAction):Boolean;virtual; + begin + {** + @explan(˵)ִaction %% + **} + if act.HandlesTarget(Self)then + begin + act.ExecuteTarget(Self); + return True; + end else + return False; + end + function UpdateAction(act:TBasicAction):Boolean;virtual; + begin + {** + @explan(˵) action %% + **} + if act.HandlesTarget(Self)then + begin + act.UpdateTarget(Self); + return True; + end else + return False; + end + function DestroyComponents(); + begin + {** + @explan(˵)ɾ %% + **} + if not FComponents then exit; + FName := nil; + data := FComponents.data(); + FComponents.clean(); + for i,Acomponent in data do + begin + Acomponent.Recycling(); + end + end; + Procedure FreeNotification(AComponent:TComponent); + begin + {** + @explan(˵) ,ͷŵʱ໥֪ͨ %% + @param(AComponent)(TComponent) %% + **} + if not(AComponent is class(tcomponent))then exit; + If(Owner <> Nil)and(AComponent=Owner)then exit; + If FFreeNotifies.IndexOf(AComponent)=-1 then + begin + FFreeNotifies.Add(AComponent); + AComponent.FreeNotification(self(true)); //ӵǰ + end; + end; + //function GetParentComponent(); virtual;begin end + //function HasParent(); virtual;begin end + function InsertComponent(AComponent);virtual; + begin + {** + @explan(˵)ڵ %% + **} + if AComponent.ValidateContainer(Self)then + begin + self.Insert(AComponent); + If csDesigning in FComponentState then AComponent.SetDesigning(true); + Notification(AComponent,opInsert); + end + end; + Procedure RemoveComponent(AComponent); + begin + {** + @explan(˵)Ƴӽڵ %% + **} + Notification(AComponent,opRemove); + if Remove(AComponent)then Acomponent.Setdesigning(False); + end; + function Assigned(o);virtual; + begin + return ifobj(o); + end +#!end + private + FEventsProperties; + FChangedProperties; + FVariableProperties; + function GetPublishInfo(); + begin + r := publishs(); + rr := array(); + ri := 0; + for i,v in r do + begin + if ifstring(v) then rr[ri++] := lowercase(v); + end + return rr; + end + function OrderPublish(r,od); //򷢲Ķ + begin + if od then + begin + r1 := array(); + for i,v in od do + begin + vi := r[v]; + if vi then r1[v]:= vi; + end + r := r1; + end + end +public + function publishs();virtual; + begin + //return array("currentcolor","lazyitems","range","firstdayofweek","align","mbbtnstyle","textalign","text","imagelist","canvs","images","items","bkbitmap","icon","popupmenu","mainmenu","cursor","height","width","left","top","enabled","visible","caption","color","font","onclick","rootfolder","initialdir"); + end + function GetPublishproperties();virtual; + begin + {** + @explan(˵) properties,ʹ%% + **} + ps := GetPropInfo(); + r := array(); + pps := GetPublishInfo(); + for i,v in ps do + begin + typ := v["type"]; + if typ="eventhandler" then continue; + otype := GetPropertyType(typ); + if otype then + begin + n := v["name"]; + if pps and not(n in pps)then continue; + if typ in array("variable","popupmenu","syscursor","tmainmenu")then + begin + r[n]:= otype.FormatEdit(FVariableProperties[n],v["write"]?true:false); + end else + r[n]:= otype.FormatEdit(invoke(self(true),n),v["write"]?true:false); + end + end + // + //////////////////// + OrderPublish(r,pps); + //////////////////// + return r; + end + function GetPublishEvents();virtual; + begin + {** + @explan(˵) eventֵ,ʹ %% + @return(array) + **} + ps := GetPropInfo(); + r := array(); + pps := GetPublishInfo(); + for i,v in ps do + begin + typ := v["type"]; + if typ <> "eventhandler" then continue; + otype := GetPropertyType(typ); + if otype then + begin + n := v["name"]; + if pps and not(n in pps)then continue; + ne := FEventsProperties[n]; + r[n]:= otype.FormatEdit(ne,v["write"]?true:false); + end + end + OrderPublish(r,pps); + return r; + end + function GetChangedPropertiesn(n);virtual; + begin + return FChangedProperties[n]; + end + function GetChangedPublish();virtual; + begin + {** + @explan(˵)ȡ޸Ĺpublish,ʹ %% + **} + r := array(); + if not FChangedProperties then return r; + ps := GetPropInfo(); + for i,vi in ps do + begin + n := vi["name"]; + vv := FChangedProperties[n]; + if ifnil(vv)then continue; + vit := vi["type"]; + otype := GetPropertyType(vit); + if vi["write"]and otype then + begin + r[n]:= otype.FormatTMF(vv); + end + end + return r; + end + function SetChangedPublish(n,v);virtual; + begin + {** + @explan(˵) غ %% + **} + if not ifarray(FChangedProperties)then FChangedProperties := array(); + //reindex(FChangedProperties,array(n:nil)); + FChangedProperties[n]:= v; + end + function DeleteChangedPublish(n);virtual; + begin + if n and ifstring(n)then + begin + if not ifarray(FChangedProperties)then FChangedProperties := array(); + reindex(FChangedProperties,array(n:nil)); + end + end + function SetPublish(n,v);virtual; + begin + {** + @explan(˵) ޸ĵֵ,ʹ %% + @param(n)(string) %% + @param(v)(any) ֵ %% + **} + ps := GetPropInfo(); + for i,vi in ps do //ȡϢ + begin + if n=vi["name"]then + begin + vit := vi["type"]; + otype := GetPropertyType(vit); //ת + if ifobj(otype)then + begin + iv := otype.UnformatEdit(v); //ת + SetChangedPublish(n,iv); // + if vit="eventhandler" then //ౣ + begin + FEventsProperties[n]:= iv; + end else + begin + if vit in array("variable","popupmenu","syscursor","tmainmenu")then //ౣ + begin + FVariableProperties[n]:= iv; + if vit="tmainmenu" then + begin + try + invoke(self(true),n,1,iv); + except + return false; + end; + end + end else + //if not ifnil(iv) then //õƿؼ + begin + try + //if n="visible" and (not((self(true) is class(tform)) and (self(true) is class(tpanelform)))) then + //else + invoke(self(true),n,1,iv); + except + return false; + end; + end + end + end + return true; + end + end + end + property Owner:tcomponent read FOwner; + {** + @param(Owner)(tcomponent) %% + @param(ComponentState)() ״̬ %% + @param(ComponentStyle)() ʽ %% + @param(ComponentCreated)(bool) ʽ %% + **} + //property DesignInfo read FDesignInfo write FDesignInfo; + property ComponentCreated read FComponentCreated; + property Components read FComponents; + property ComponentState read FComponentState write SetComponentState; + property ComponentStyle read FComponentStyle; + property Name:string read FName write SetName; + property Parent read ComponentGetParent write ComponentSetParent; + property Loader read GetLoader; +end + +type TGlobalComponentcache=class + {** + @ignore() %% + @explan(˵) ڴ洢 %% + @param(FWidowhandes)(array) ȫִ洢 %% + **} + STATIC FWidowhandes; + class function getwndbyhwnd(hwnd); + begin + {** + @explan(˵) id %% + **} + sinit(); + if ifnumber(hwnd)then return FWidowhandes[inttostr(hwnd)]; + end + class function registerhandle(handle,o); + begin + {** + @explan(˵) %% + **} + sinit(); + if o is class(tcomponent)then + begin + //o.handle := handle; + if ifnumber(handle)then FWidowhandes[inttostr(handle)]:= o; + end + end + class function unregisterhandle(handle); + begin + {** + @explan(˵)ɾ %% + **} + sinit(); + if ifnumber(handle)then + begin + reindex(FWidowhandes,array(inttostr(handle):nil)); + end + end + class function sinit(); + begin + {** + @ignore() %% + @explan(˵)ʼ %% + **} + if not ifarray(FWidowhandes)then + begin + FWidowhandes := array(); + end + end +end + + + //Ӧ +type tapplication=class(tcomponent) + {** + @explan(˵) application %% + **} + private + static FApplicationWindow; + static FMessageObj; + //static Ftooltips; + FVisible; + FHandle; // + Fmainform; // + FDebug; + //FTiptimer; + //FTiptimertag1; + Foldforminfo; + function SetVisible(v); + begin + FVisible := v?true:false; + if FApplicationWindow is class(TWinControl)then + begin + FApplicationWindow.visible := FVisible; + end + end + function SetMainForm(f); + begin + if not(f is class(tform))then exit; + if f=Fmainform then exit; + if Fmainform then + begin + odf := Fmainform; + odf.onclose := Foldforminfo["close"]; + odf.OnMinimize := Foldforminfo["minimize"]; + end + Fmainform := f; + //{$ifdef linuxgtk} + //{$else} + if not(FApplicationWindow)then initialize(); + if not(f.HandleAllocated())then + begin + f.parent := FApplicationWindow; + end + IC := f.FormIcon; + if(ic is class(TIcon))and ic.HandleAllocated then + begin + FApplicationWindow._send_(WM_SETICON,1,ic.handle,1); + end + FApplicationWindow.caption := f.caption; + //{$endif} + Foldforminfo := array("close":Fmainform.onclose,"minimize":Fmainform.OnMinimize); + Fmainform.onclose := thisfunction(mainformclose); + Fmainform.OnMinimize := thisfunction(mainformminmize); + end + function CreateHandle(); + begin + if not FApplicationWindow then + begin + FApplicationWindow := new tapplicationwindow(self); + FApplicationWindow.Visible := FVisible; + end + //echo "???",tostn(FApplicationWindow.classinfo()); + FHandle := FApplicationWindow.Handle; + end + public + function create(AOwner);override; + begin + inherited; + FVisible := false; + //FTiptimer := new ttimer(); + //FTiptimer.Interval := 2000; + //FTiptimer.Ontimer := thisfunction(ontiptimer); + end + function WMACTIVATEAPP(o,e);virtual; + begin + {** + @explan(˵) active + **} + if Fmainform then + begin + if e.wparam then + begin + //_wapi.SetWindowPos(Fmainform.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE .|SWP_NOSIZE); + //Fmainform.Visible := true;// + Fmainform.show(); + end //Fmainform.Visible := true; + //else _wapi.SetWindowPos(Fmainform.Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE .|SWP_NOSIZE); + end + end + function initialize(); + begin + {** + @explan(˵) ʼ %% + **} + CreateHandle(); + FApplicationWindow.bindmessage(WM_ACTIVATEAPP,thisfunction(WMACTIVATEAPP)); + end + function createform(classname,varable); + begin + {** + @explan(˵) %% + @param(classname)(class of tform) %% + @param(varable)() tslClassName Ĵڶ %% + **} + if paramcount<2 then exit; // + if classname is class(tcomponent)then + begin + if not(FApplicationWindow)then initialize(); + varable := createobject(classname,FApplicationWindow); + if varable is class(tform)then + begin + varable.parent := FApplicationWindow; + if not Fmainform then + begin + SetMainForm(varable); + end + end + end + end + function mainformclose(o,e); + begin + {** + @ignore() %% + **} + CallMessgeFunction(Foldforminfo["close"],o,e); + if e.skip then exit; + FApplicationWindow._send_(WM_CLOSE,0,0); + end + function mainformminmize(o,e); + begin + {** + @ignore() %% + **} + CallMessgeFunction(Foldforminfo["minimize"],o,e); + //e.skip := true; + //if Fmainform then Fmainform.Visible := false; + //FApplicationWindow._send_(,0,0); + end + function run(); + begin + {** + @explan(˵) ѭ %% + **} + initialize(); + {$ifdef linuxgtk} + idledata :=(new tcbytearray(4))._getptr_(); + id := _wapi.tsl_gtk_idle_interface(idledata); //idle + _wapi.gtk_main(); + _Wapi.g_idle_remove_by_data(idledata); //ɾidle + return 1; + {$endif} + if not FMessageObj then FMessageObj := new TTagMSG(); + ptr := FMessageObj._getptr_; + while true do + begin + if(_wapi.PeekMessageA(ptr,0,0,0,0x1))then + begin + if FMessageObj.message=0x12 then + begin + return 1; + end else + begin + _wapi.TranslateMessage(ptr); + _wapi.DispatchMessageA(ptr); + end + end else + begin + tslprocessmessages(false); + RunWorkerThreadLoop(); + end + end + {while (_wapi.GetMessageA(ptr, 0, 0, 0)) do + begin + _wapi.TranslateMessage(ptr); + _wapi.DispatchMessageA(ptr); + end} + return 1; + end + function GetApplicationWindow(); + begin + return FApplicationWindow; + end + function ShowErrorMessage(msg); + begin + {** + @explan(˵)ʾϢ %% + **} + if FDebug and ifstring(msg)then messageboxA(msg,"ʾ",1); + end + function CloseMainForm(); + begin + {** + @explan(˵) ر %% + **} + if FApplicationWindow is class(tform)then FApplicationWindow._send_(WM_CLOSE,0,0); + else _wapi.PostQuitMessage(0); + end + function Close(); + begin + CloseMainForm(); + end + property Visible read FVisible write SetVisible; + property handle read FHandle; + property IfDebug read FDebug write FDebug; + property MainForm read Fmainform write SetMainForm; +end + + // +type TTray=class(TComponent) + {** + @explan(˵) %% + **} + private + FNid; + FTrayID; + FIcon; + FHaveadd; + FPopupMenu; + FOnclick; + FOnMouseMove; + static FSIDC; //id + FCaption; + FForm; + function SetCaption(v); + begin + if v <> FCaption then + begin + if ifstring(v)then + begin + FCaption := v; + end else + begin + FCaption := ""; + end + FNid.sztip := FCaption; + if FHaveadd then + begin + _wapi.Shell_NotifyIconA(NIM_MODIFY,FNid._getptr_); + end + end + end + function seticonhandle(ic); + begin + if(ic is class(ticon))and ic.HandleAllocated()and FHaveadd then + begin + Fnid.uFlags := NIF_ICON .| NIF_MESSAGE .| NIF_TIP .| NIF_INFO; + Fnid.hicon := ic.Handle; + _wapi.Shell_NotifyIconA(NIM_MODIFY,FNid._getptr_); + end + end + function SetIcon(v); + begin + if v=FIcon then exit; + FIcon := v; + seticonhandle(FIcon); + end + function SetForm(f); + begin + if FForm=f then exit; + if FHaveadd then + begin + TrayDelete(); + end + FForm := f; + TrayAdd(); + end + public + function Create(AOwner);override; + begin + inherited; + FHaveadd := false; + if not FSIDC then FSIDC := new tidcreater(1); + FTrayID := FSIDC.CreateId(); + FNid := new TNOTIFYICONDATAA(); + FNid.uID := FTrayID; + FNid.ucallbackmessage := WM_TRAY; + end + function ShowTrayMessage(title,text); + begin + {** + @ignore() %% + @explan(˵) ʾϢ %% + @param(title)(string) %% + @param(text)(string) Ϣ %% + + **} + if not FHaveadd then exit; + if not(ifstring(title)and ifstring(text))then exit; + if not((FForm is class(tform))and FForm.HandleAllocated)then exit; + FNid.szinfotitle := title+"\0"; + FNid.szinfo := text+"\0"; + FNid.utimeout := 1000; + _wapi.Shell_NotifyIconA(NIM_MODIFY,FNid._getptr_); + end + function ShowPopUpMenu(); + begin + if not FHaveadd then exit; + if FPopupMenu is class(TPopUpmenu)then + begin + ps := array(x,y); + _wapi.GetCursorPos(ps); + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + hd := FForm.Handle; + _wapi.SetForegroundWindow(hd); + _wapi.TrackPopupMenu(FPopupMenu.Handle,uf,ps[0],ps[1],0,hd,nil); + return true; + end + end + procedure Notification(AComponent:TComponent;Operation:TOperation);override; + begin + {** + @explan(˵) ֪ͨϢ %% + **} + if Operation=opRemove then + begin + if FPopupMenu=AComponent then + begin + FPopupMenu := nil; + end + if FForm=AComponent then + begin + Form := nil; + end + end; + inherited; + end; + function Recycling();override; + begin + FIcon := nil; + TrayDelete(); + FForm := nil; + FPopupMenu := nil; + inherited; + end + //ӵ + function TrayAdd(); + begin + {** + @ignore() %% + @explan(˵) %% + **} + if FHaveadd then exit; + if(FForm is class(tform))and FForm.HandleAllocated()then + begin + FNid.hWnd := FForm.Handle; + if not FIcon then FIcon := FForm.FormIcon; + if FIcon is class(ticon)then + begin + FNid.hIcon := FIcon.Handle; + end + if ifstring(FCaption)then FNid.sztip := FCaption; + else FNid.sztip := FForm.Caption; + //FNid.dwInfoFlags := 1; + Fnid.uFlags := NIF_ICON .| NIF_MESSAGE .| NIF_TIP .| NIF_INFO; + _wapi.Shell_NotifyIconA(NIM_ADD,FNid._getptr_); + FHaveadd := true; + end + end + //ɾ + function TrayDelete(); + begin + {** + @ignore() %% + @explan(˵) ɾ %% + **} + if FHaveadd then + begin + _wapi.Shell_NotifyIconA(nim_delete,FNid._getptr_); + FHaveadd := false; + end + end + function publishs();override; + begin + return array("name","caption","icon","popupmenu","onclick"); + end + property Form read FForm write SetForm; + property Caption:string read FCaption write SetCaption; + property OnClick:eventhandler read FOnclick write FOnclick; + property OnMouseMove:eventhandler read FOnMouseMove write FOnMouseMove; + property Icon:ticon read FIcon write SetIcon; + property PopupMenu:TPopUpmenu read FPopupMenu write FPopupMenu; + property TrayId read FTrayID; +end + + +type tcontrol = class(tcomponent) + private // + #!begin //members + STATIC FSIDC; + FActionLink: TControlActionLink; + FCanvas: TCanvas; + FMessagehandle;//Ϣ + FtagPAINTSTRUCT; + + //; + //private + FAnchors; + FAnchorBounds; + + FCaption;// + FCaptureMouseButtons;//ʽ + FColor;//ɫ + FBKBitmap; + FControlFlags;//ؼ + FControlStyle;//ؼʽ + FDesktopFont; + FDockOrientation; + FDragCursor; + FFont; // + FHostDockSite: TWinControl; + FLastDoChangeBounds: TRect; + FLastDoChangeClientSize: TPoint; + FLastResizeClientHeight: integer; + FLastResizeClientWidth: integer; + FLastResizeHeight: integer; + FLastResizeWidth: integer; + FOnClick; // + Fonrclick; + FOnContextPopup; + FOnDblClick; //˫ + FOnDragDrop; + FOnDragOver; + FOnSize; + FOnMove; + FOnEditingDone; + FOnEndDock; + FOnEndDrag; + FOnMouseDown; // + FOnMouseEnter; // + FMouseEntereded; + FOnMouseLeave; //뿪 + FOnMouseMove; //ƶ + FOnPopupMenu; + FOnMouseUp; // + FOnMouseWheel; // + FOnMouseWheelDown; // + FOnMouseWheelUp; // + //FOnQuadClick; + //FOnResize; // + FOnShowHint; + FOnStartDock; + FOnStartDrag; + //FOnTripleClick; + FBorder; + protected + // + FAlign;//뷽ʽ + FUnAlignBounds; + + FParent;// TWinControl; //ڵ + //public + //FParentBiDiMode;//: Boolean; + FPopupMenu;//: TPopupMenu; + //FIsControl;//: Boolean; + FShowHint;//: Boolean; + //FParentColor;//: Boolean; + FParentFont;//: Boolean; + //FParentShowHint;//: Boolean; + //FAutoSizingAll;//: boolean; + //FAutoSizingSelf;//: Boolean; + FEnabled;//: Boolean; //Ч + //FMouseEntered;//: boolean; + FVisible;//: Boolean; //ɼ + FID; + + FOnMeasureItem; + FOnDrawItem; + #!end + + //λϢ + //protected + FLeft:integer; // + FTop:integer;//: Integer; // + FWidth:integer; + FHeight:integer; //߶ + FControls; + FControlState; + FCursor; + {** + @param(FLeft)(integer) %% + @param(FTop)(integer) ϱ %% + @param(FWidth)(integer) %% + @param(FHeight)(integer) ߶ %% + **} + function SetAction(Value);virtual; + begin + if csDesigning in ComponentState then + begin + FActionLink := Value; + return; + end + if ifnil(Value)then + begin + if FActionLink then + begin + FActionLink.SetAction(nil); + end + excludestate(FControlStyle,csActionClient); + end else + if Value is class(TBasicAction)then + begin + includestate(FControlStyle,csActionClient); + if ifnil(FActionLink)then FActionLink := createobject(GetActionLinkClass(),self); + FActionLink.Action := Value; + FActionLink.Onchange := thisfunction(DoActionChange); + ActionChange(Value,csLoading in Value.ComponentState); + Value.FreeNotification(Self); + end + end + procedure DoActionChange(Sender:TObject); + begin + if Sender=Action then ActionChange(Sender,False); + end + function GetAction();virtual; + begin + if csDesigning in ComponentState then + begin + return FActionLink; + end + if FActionLink then + begin + return FActionLink.Action; + end + end + function SetEnabled(v);virtual; + begin + nv := v?true:false; + if FEnabled <> nv then + begin + FEnabled := nv; + end + end + //protected + procedure SetAlign(Value:TAlign);virtual; + begin + if not(Value in array(alLeft,alRight,alBottom,alTop,alNone,alClient))then exit; + if FAlign=Value then exit; + bds := UnAlignBounds; + FAlign := Value; + //ֵܽڵλ %% + if FParent is class(TWincontrol)and FParent.HandleAllocated()then + begin + if FAlign=alNone then + begin + //bds := UnAlignBounds; + SetBounds(bds[0],bds[1],bds[2],bds[3]); + end + FParent.DoControlAlign(); + end + end + procedure SetAnchors(Value);virtual; + begin + if not ifarray(Value)then exit; + if FAnchors=Value then exit; + FAnchorBounds := 0; + val := Value union2 array(); + aks := array(akLeft,akRight,akTop,akBottom); + for i,v in val do + begin + if not(v in aks)then exit; + end + FAnchors := val; + end + + private + function SetUnAlignBounds(Value); + begin + {** + @explan(˵) ÷ǶķΧ %% + **} + if(align in array(alTop,alLeft,alRight,alBottom,alClient))then exit; + if CheckArrayIsControlBounds(Value)and FUnAlignBounds <> Value then + begin + FUnAlignBounds := Value; + if parent and(Align <> alNone)and Parent.HandleAllocated()then Parent.DoControlAlign(); + end + end + Function GetUnAlignBounds();virtual; //type_tcontrol + begin + if alNone=FAlign then + begin + FUnAlignBounds := GetBoundsRect(); + end + if not ifarray(FUnAlignBounds)then FUnAlignBounds := GetBoundsRect(); + return FUnAlignBounds; + end + function GetEnabled();virtual; + begin + return FEnabled; + end + + procedure SetLeft(Value:Integer); //type_tcontrol + begin + if Value>-5000000 and Value<5000000 and Value <> FLeft then SetBounds(Value,FTop,FWidth,FHeight); + end + procedure SetTop(Value:Integer); //type_tcontrol + begin + if Value>-5000000 and Value<5000000 and Value <> FTop then SetBounds(FLeft,Value,FWidth,FHeight); + end + procedure SetWidth(Value:Integer); //type_tcontrol + begin + if Value>-5000000 and Value<5000000 and Value <> FWidth then SetBounds(FLeft,FTop,Max(0,Value),FHeight); + end + procedure SetHeight(Value:Integer); //type_tcontrol + begin + if Value>-5000000 and Value<5000000 and Value <> FHeight then SetBounds(FLeft,FTop,FWidth,Max(0,Value)); + end + function GetText(); //type_tcontrol + begin + return RealGetText(); + end + procedure SetText(Value:string); //type_tcontrol + begin + return RealSetText(Value); + end + function SetParentFont(v:bool); + begin + nv := v?true:false; + if FParentFont <> nv then + begin + FParentFont := nv; + if nv then + begin + hd := GetParentFontHandle(); + if Parent then Parent.Perform(New tuieventbase(CMFONTCHANGED,hd,1)); + end + end + end + public + function PaintStruct(); + begin + {** + @explan(˵) ȡϢ %% + @return(TPAINTSTRUCT) + **} + if not FtagPAINTSTRUCT then + begin + FtagPAINTSTRUCT := new TPAINTSTRUCT(); + end + return FtagPAINTSTRUCT; + end + function bindmessage(id,func); //type_tcontrol + begin + {** + @ignore %% + @explan(˵) 󶨴Ϣid %% + **} + if not ifarray(FMessagehandle)then FMessagehandle := array(); + if ifnumber(id)and dataisfunction(func)then FMessagehandle[id]:= func; + end + private + static FClassDigestA; + class function CtlInfoAndDigest(idx,d); //ָͨƱ߻ȡؼϢ + begin + if not ifarray(FClassDigestA)then FClassDigestA := array(); + if ifnil(d)then return FClassDigestA[idx]; + else FClassDigestA[idx]:= d; + end + function FindMessageFunctionstr(o);virtual; //type_tcontrol + begin + { + @explan(˵) ԶϢϢid %% + } + if not(o is class(tcontrol))then return array(); + t := o.classinfo; + idx := getmsgd_Crc32(tostm(t))+"%%"; + r := CtlInfoAndDigest(idx); + if ifarray(r)then return r; + r := array(); + hs := t["inherited"]; + for i,v in hs do + begin + //sbf := static call(thisfunction,findclass(v,o)) name v+"%%_%%"; + sbf := call(thisfunction,findclass(v,o)); + for ii,vv in sbf do + begin + r[ii]:= vv; + end + end + for i,v in t["subs"] do + begin + if v["access"]in array(2,3)then continue; + fstring := v["functionname"]; + if not ifstring(fstring)then continue; + //f := findfunction(fstring,o); + returntype := v["returntype"]; + try + if returntype then + begin + mid := invoke(o,returntype); + r[mid]:= fstring; + //bindmessage(mid,f); + end + except + end + end + CtlInfoAndDigest(idx,r); + return r; + end + function bindmessages(o);virtual; //type_tcontrol + begin + { + @explan(˵) ԶϢϢid %% + } + s := FindMessageFunctionstr(o); + for i,v in s do + begin + bindmessage(i,findfunction(v,o)); + end + return; + if not(o is class(tcontrol))then return; + t := o.classinfo; + hs := t["inherited"]; + for i,v in hs do + begin + call(thisfunction,findclass(v,o)); + end + for i,v in t["subs"] do + begin + if v["access"]in array(2,3)then continue; + fstring := v["functionname"]; + if not ifstring(fstring)then continue; + f := findfunction(fstring,o); + returntype := v["returntype"]; + try + if returntype then + begin + mid := invoke(o,returntype); + bindmessage(mid,f); + end + except + end; + end + end + protected + function GetControlFont();virtual; + begin + return FFont; + end + function SetControlFont(v);virtual; + begin + if ifarray(v)then + begin + FFont.SetValues(v); + end else + if v is class(tfont)then + begin + FFont.copyfont(v); + end + end + function CurrentFont(); + begin + if ParentFont and Parent then return Parent.CurrentFont(); + return Font; + end + function GetParentFontHandle();virtual; + begin + if ParentFont and Parent then return Parent.GetParentFontHandle(); + return Font.Handle; + end + function SetBorder(v);virtual; + begin + FBorder := v?true:false; + end + function SetZorder(n); + begin + f := Parent; + if f is class(TWincontrol)then + begin + return f.MoveControlOrder(self,n); + end + end + function GetZorder(); + begin + f := Parent; + if f is class(TWincontrol)then + begin + return f.Controls.indexof(self); + end + end + function RealGetText: + TCaption; + virtual; //type_tcontrol + begin + return FCaption; + end + procedure RealSetText(Value:TCaption);virtual; //type_tcontrol + begin + FCaption := Value; + end + +#!begin //Դ + function GetCursor();virtual; + begin + return FCursor; + end + procedure SetCursor(Value);virtual; + begin + if(FCursor is class(tcursor))and ifnumber(Value)and FCursor.id <> Value then + begin + FCursor.id := Value; + Perform(new tuieventbase(CM_CURSORCHANGED,0,0)); + end; + end + procedure SetVisible(Value);virtual; + begin + FVisible := Value?true:false; + end + procedure DoOnParentHandleDestruction;virtual; + begin + end + +#!end + protected + function messagecreater(hwnd,message,wparam,lparam);virtual; ////type_tcontrol + begin + {** + @explan(˵)ϢϢ; + **} + if message in array(WM_MOUSEMOVE,WM_LBUTTONDOWN, + WM_RBUTTONDOWN,WM_LBUTTONUP, + WM_RBUTTONUP,WM_LBUTTONDBLCLK, + WM_RBUTTONDBLCLK,WM_MBUTTONDOWN,WM_MBUTTONUP,WM_MBUTTONDBLCLK)then + begin + r := new TMMouse(message,wparam,lparam,hwnd); + end else + if message=WM_MENUSELECT then + begin + r := new TMMENUSELECT(message,wparam,lparam,hwnd); + end else + if message=WM_MEASUREITEM then + begin + r := new TMMEASUREITEM(message,wparam,lparam,hwnd); + end else + if message in array(WM_KEYDOWN,WM_KEYUP,WM_CHAR,WM_SYSKEYDOWN,WM_SYSKEYUP)THEN + begin + r := new TMKEY(message,wparam,lparam,hwnd); + end else + if message=WM_DRAWITEM then + begin + r := new TMDRAWITEM(message,wparam,lparam,hwnd); + end else + if message=WM_NOTIFY then + begin + r := new TMNOTIFY(message,wparam,lparam,hwnd); + end else + if message=WM_MOUSEWHEEL then + begin + r := new TMMOUSEWHEEL(message,wparam,lparam,hwnd); + end else + if message=WM_STYLECHANGED or message=WM_STYLECHANGING then + begin + r := new TMSTYLECHANG(message,wparam,lparam,hwnd); + end else + r := new tuieventbase(message,wparam,lparam,hwnd); + return r; + //return new tuieventbase(message,wparam,lparam,hwnd); + end + function GetClientOrigin();virtual; ////type_tcontrol + begin + if FParent then base := FParent.ClientOrigin(); + return array(base[0]+FLeft,base[1]+FTop); + end + function GetLogicalClientRect();virtual; //type_tcontrol + begin + return GetClientRect(); + end; + function GetClientScrollOffset();virtual; //type_tcontrol + begin + return array(0,0); + end + function GetScrolledClientRect();virtual; //type_tcontrol + begin + Result := GetClientRect(); + ScrolledOffset := GetClientScrollOffset(); + Result[0]+= ScrolledOffset[0]; + Result[1]+= ScrolledOffset[1]; + Result[2]+= ScrolledOffset[0]; + Result[3]+= ScrolledOffset[1]; + return Result; + end; + function GetControlOrigin();virtual; //type_tcontrol + begin + Result := array(FLeft,FTop); + if FParent <> nil then + begin + ParentsClientOrigin := FParent.ClientOrigin(); + Result[0]+= ParentsClientOrigin[0]; + Result[1]+= ParentsClientOrigin[1]; + end; + return Result; + end + function OnControlAppend(AControl);virtual; + begin + {** + @explan(˵) ӿؼ %% + **} + end + function OnControlDelete(AControl);virtual; + begin + {** + @explan(˵) ӿؼɾ %% + **} + end + function operatectrl(actrl,op);virtual; //type_tcontrol + begin + idx := FControls.indexof(actrl); + if op=opRemove then + begin + if(idx >= 0)then + begin + FControls.deli(idx); + aparent := actrl.FParent; + actrl.FParent := nil; + OnControlDelete(actrl); + //if (actrl.Align<>alNone) and (aparent is class(TWincontrol)) then aparent.DoControlAlign(); + ifop := true; + end + end else + if op=opInsert then + begin + if idx=-1 then + begin + FControls.append(actrl); + actrl.FParent := self(true); + OnControlAppend(actrl); + ifop := true; + end + end + return ifop; + end + function SetParent(NewParent);virtual; //type_tcontrol + begin + //1.Ϊ + //2.Ϊ + //3.api Գɹ + if NewParent=self then return; + if NewParent=FParent then return; + if NewParent is class(TWinControl)then + begin + if FParent then + begin + FParent.operatectrl(self(true),opRemove); + end + np := NewParent.Parent; + while np is class(TWinControl) do + begin + if np=self then return; + np := np.Parent; + end + NewParent.operatectrl(self(true),opInsert); + end else + begin + if Parent then FParent.operatectrl(self(true),opRemove); + end + end + procedure SetParentComponent(NewParentComponent);override; //type_tcontrol + begin + SetParent(NewParentComponent); + end + public + procedure Notification(AComponent:TComponent;Operation:TOperation);override; //type_tcontrol + begin + {** + @explan(˵) ֪ͨϢ %% + **} + if Operation=opRemove then + begin + if AComponent=PopupMenu then + PopupMenu := nil ; + else + if AComponent=Action then Action := nil; + idx := FControls.indexof(AComponent); //ɾӿؼ + if idx >= 0 then + begin + FControls.deli(idx); + end + end; + inherited; + end; + protected + procedure UpdateMouseCursor(X, Y: integer); + begin + end + procedure ChangeBounds(ALeft,ATop,AWidth,AHeight:integer;KeepBase:boolean);virtual; //type_tcontrol + begin + SizeChanged :=(FWidth <> AWidth)or(FHeight <> AHeight); + PosChanged :=(FLeft <> ALeft)or(FTop <> ATop); + if(not SizeChanged)and(not PosChanged)then Exit; + // d := new ttagWINDOWPOS(); + d := new tvclwindowpos_class(0); + if SizeChanged then + begin + d.cx := AWidth; + d.cy := AHeight; + D.flags := SWP_NOMOVE; + e := new tuieventbase(WM_WINDOWPOSCHANGED,0,d._getptr_); + //e := new tuieventbase(WM_SIZE,0,makeposition(AWidth,AHeight)); + class(tcontrol).wndproc(e); + end + if PosChanged then + begin + d.x := ALeft; + d.y := ATop; + d.flags := SWP_NOSIZE; + e := new tuieventbase(WM_WINDOWPOSCHANGED,0,d._getptr_); + //e := new tuieventbase(WM_MOVE,6,makeposition( ALeft,ATop)); + class(tcontrol).wndproc(e); + end + {if SizeChanged or PosChanged then + begin + if (Parent is class(TWinControl)) and Parent.HandleAllocated then + begin + Parent.DoControlAlign(); + end + end } + end + function MouseHover(o,e);virtual; + begin + if not FMouseEntereded then + begin + DoMouseEnter(o,e); + FMouseEntereded := true; + end + end + function MouseLeave(o,e);virtual; + begin + if FMouseEntereded then + begin + DoMouseLeave(o,e); + FMouseEntereded := false; + end + end + function defaulthandler(e);virtual; + begin + return 0; + end + public + function MouseMove(o,e);virtual; + begin + end + function MouseDown(o,e);virtual; + begin + {** + @explan(˵) 갴Ϣ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMMouse) Ϣ %% + **} + end + function MouseUp(o,e);virtual; + begin + {** + @explan(˵) ɿϢ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMMouse) Ϣ %% + **} + end + function ContextMenu(o,e);virtual; + begin + {** + @explan(˵) Ҽ˵ %% + @param(o)(TWinControl) ؼ %% + @param(e)(tuieventbase) Ϣ %% + **} + if e.Result then exit; + if FPopupMenu is class(TPopUpmenu)then + begin + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + _wapi.TrackPopupMenu(FPopupMenu.Handle,uf,e.lolparamsigned,e.hilparamsigned,0,e.wparam,nil); + e.skip := true; + end + end + public + procedure FontChanged(Sender:TObject);virtual; + begin + if parent then parent.FontChanged(Sender); + end + function GetClientRect();virtual; // //type_tcontrol visual size of client area + begin + {** + @explan(˵) ȡͻ%% + @return( array of integer) %% + **} + return array(0,0,FWidth,Height); + end + +#!begin //Ϣ + function DoCNCOMMAND(o,e);virtual; + begin + {** + @explan(˵) ֪ͨϢ %% + @param(o)(tcontrol) ؼ %% + @param(e)(tuieventbase) Ϣ %% + **} + end + function CNCOMMAND(o,e):CN_COMMAND;virtual; + begin + DoCNCOMMAND(o,e); + end + function CNMEASUREITEM(o,e):CN_MEASUREITEM;virtual; + begin + CallMessgeFunction(FOnMeasureItem,o,e); + DoMeasureItem(o,e); + end + function DoMeasureItem(o,e);virtual; + begin + {** + @explan(˵) ؼ֪ͨϢ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMMEASUREITEM) Ϣ %% + **} + end + function CNDRAWITEM(o,e):CN_DRAWITEM;virtual; + begin + //tb := new tbrush(); + //tbh := tb.handle; + //odh := _wapi.SelectObject(canvas.Handle,tbh); + DoDrawItem(o,e); + //_wapi.SelectObject(canvas.Handle,odh); + end + function DoDrawItem(o,e);virtual; + begin + { + @explan(˵) ؼ֪ͨϢ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMDRAWITEM) Ϣ %% + } + CallMessgeFunction(FOnDrawItem,o,e); + end + function DoMouseEnter(o,e);virtual; + begin + { + @explan(˵) ؼص %% + } + CallMessgeFunction(FOnMouseEnter,o,e); + end + function DoMouseLeave(o,e);virtual; + begin + { + @explan(˵) 뿪ؼص %% + } + CallMessgeFunction(FOnMouseLeave,o,e); + end + function DoCnNotify(o,e);virtual; + begin + {** + @expaln(˵) ֪ͨص %% + **} + end + function CNNOTIFY(o,e):CN_NOTIFY;virtual; + begin + DoCnNotify(o,e); + end + function WMERASEBKGND(o,e):WM_ERASEBKGND;virtual; + begin + end + function WMCancelMode(o,e):LM_CANCELMODE;virtual; + begin + end + function WMContextMenu(o,e):LM_CONTEXTMENU;virtual; + begin + CallMessgeFunction(FOnPopupMenu,o,e); + ContextMenu(o,e); + end + function WMLButtonDown(o,e):LM_LBUTTONDOWN;virtual; + begin + e.SetButton(mbLeft); + CallMessgeFunction(FOnMouseDown,o,e); + MouseDown(o,e); + end + function WMRButtonDown(o,e):LM_RBUTTONDOWN;virtual; + begin + e.SetButton(mbRight); + CallMessgeFunction(FOnMouseDown,o,e); + MouseDown(o,e); + end + function WMMButtonDown(o,e):LM_MBUTTONDOWN;virtual; + begin + e.SetButton(mbMiddle); + CallMessgeFunction(FOnMouseDown,o,e); + MouseDown(o,e); + end + function WMLButtonDBLCLK(o,e):LM_LBUTTONDBLCLK;virtual; + begin + e.SetButton(mbLeft); + e.setshiftdouble(ssDouble); + CallMessgeFunction(FOnMouseDown,o,e); + MouseDown(o,e); + return; + if not(e.skip)then + begin + CallMessgeFunction(FOnDblClick,o,e); + end + end + function WMRButtonDBLCLK(o,e):LM_RBUTTONDBLCLK;virtual; + begin + { + @explan(˵) ˫Ϣ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMMouse) Ϣ %% + } + e.SetButton(mbRight); + e.setshiftdouble(ssDouble); + CallMessgeFunction(FOnMouseDown,o,e); + MouseDown(o,e); + end + function WMMOUSEHOVER(o,e):WM_MOUSEHOVER;virtual; + begin + MouseHover(o,e); + end + function WMMOUSELEAVE(o,e):WM_MOUSELEAVE;virtual; + begin + MouseLeave(o,e); + end + function WMMouseMove(o,e):LM_MOUSEMOVE;virtual; + begin + CallMessgeFunction(FOnMouseMove,o,e); + MouseMove(o,e); + end + function WMLButtonUp(o,e):LM_LBUTTONUP;virtual; + begin + e.SetButton(mbLeft); + CallMessgeFunction(FOnMouseUp,o,e); + MouseUp(o,e); + end + function WMRButtonUp(o,e):LM_RBUTTONUP;virtual; + begin + e.SetButton(mbRight); + CallMessgeFunction(FOnMouseUp,o,e); + MouseUp(o,e); + if not e.skip then + begin + CallMessgeFunction(FOnrbuttonup,o,e); //Ҽ + end + end + function WMMButtonUp(o,e):LM_MBUTTONUP;virtual; + begin + e.SetButton(mbMiddle); + CallMessgeFunction(FOnMouseUp,o,e); + MouseUp(o,e); + end + function DoMouseWheel(o,e);virtual; + begin + {** + @explan(˵) Ϣ %% + @param(o)(TWinControl) ؼ %% + @param(e)(TMMOUSEWHEEL) Ϣ %% + **} + end + function WMMouseWheel(o,e):LM_MOUSEWHEEL;virtual; + begin + CallMessgeFunction(FOnMouseWheel,o,e); + if not e.Result then + begin + if e.delta<0 then CallMessgeFunction(FOnMouseWheelDown,o,e); + else CallMessgeFunction(FOnMouseWheelUp,o,e); + end + DoMouseWheel(o,e); + end + function DoCNALIGN(o,e);virtual; + begin + if FAlign=alNone then exit; + if not(Visible)then exit; + if(o is class(TWincontrol))and not(o.HandleAllocated())then + begin + exit; + end + if e.width<1 then exit; + if e.height<1 then exit; + bds := UnAlignBounds; + case Align of + alTop: + begin + ht := min(e.height,bds[3]-bds[1]); + if ht then + begin + SetBounds(e.left,e.top,e.width,ht); + //SetBoundsRect(array(e.left,e.top,e.width+e.left,e.top+ht)); + e.top += ht; + e.height -= ht; + end + end + alRight: + begin + wd := min(e.width,bds[2]-bds[0]); + SetBounds(e.left+e.width-wd,e.top,wd,e.height); + e.width := e.width-wd; + end + alLeft: + begin + wd := min(e.width,bds[2]-bds[0]); + SetBounds(e.left,e.top,wd,e.height); + e.left := e.left+wd; + e.width := e.width-wd; + end + alBottom: + begin + ht := min(e.height,bds[3]-bds[1]); + SetBounds(e.left,e.top+e.height-ht,e.width,ht); + e.height -= ht; + end + alClient: + begin + SetBounds(e.left,e.top,e.width,e.height); + e.height := 0; + e.width := 0; + end + end + {if self is class(TWinControl) then + begin + //InvalidateRect(nil,true); updateWindow(); + end } + end + function CNALIGN(o,e):CN_ALIGN;virtual; + begin + DoCNALIGN(o,e); + end + public + function CNANCHOR(o,e):CN_ANCHOR;virtual; + begin + if Align <> alNone then exit; + if not ifarray(FAnchors)then exit; + if not(Visible)then exit; + if(o is class(TWincontrol))and not(o.HandleAllocated())then + begin + exit; + end + if akLeft+akTop=sum(FAnchors)then exit; // + c := e.Prec; + bds := GetBoundsRect(); + if not FAnchorBounds then + begin + FAnchorBounds := array(bds[0],bds[1],c[2]-bds[2],c[3]-bds[3]); + return; + end + w := width; + h := height; + dx := c[2]-c[0]-(FAnchorBounds[0]+w+FAnchorBounds[2]); + dy := c[3]-c[1]-(FAnchorBounds[1]+h+FAnchorBounds[3]); + dx1 := integer(dx/2); + dx2 := dx-dx1; + dy1 := integer(dy/2); + dy2 := dy-dy1; + L := bds[0]; + r := bds[2]; + t := bds[1]; + b := bds[3]; + if(akLeft in FAnchors)and(akRight in FAnchors)then + begin + R := c[2]-FAnchorBounds[2]; + end + if not(akLeft in FAnchors)and(akRight in FAnchors)then + begin + R := c[2]-FAnchorBounds[2]; + L := r-w; + end + if not(akLeft in FAnchors)and not(akRight in FAnchors)then + begin + L := FAnchorBounds[0]+dx1; + R := l+w; + end + //********************************** + if(akTop in FAnchors)and(akBottom in FAnchors)then + begin + T := FAnchorBounds[1]; + B := c[3]-FAnchorBounds[3]; + end + if not(akTop in FAnchors)and(akBottom in FAnchors)then + begin + B := c[3]-FAnchorBounds[3]; + T := b-h; + //T := bds[1]+dy; + // + end + if not(akTop in FAnchors)and not(akBottom in FAnchors)then + begin + b := c[3]-FAnchorBounds[3]+dy1; + t := B-h; + end + SetBoundsRect(array(L,T,R,B)); + return; + + end + function WMMove(o,e):LM_MOVE;virtual; + begin + CallMessgeFunction(OnMove,o,e); + end + function DoWMSIZE(o,e);virtual; + begin + end + function WMSize(o,e):LM_SIZE;virtual; + begin + CallMessgeFunction(OnSize,o,e); + DoWMSIZE(o,e); + end + + + function CMCursorChanged(o,e):CM_CURSORCHANGED;virtual; + begin + //if SetTempCursor(o.Cursor) then e.skip := true; + //return ; + if not(csDesigning in ComponentState)then + begin + if SetTempCursor(o.Cursor)then e.skip := true; + end else + begin + cr := new tcursor(); + cr.id := IDC_ARROW; + if SetTempCursor(cr)then e.skip := true; + end + end + public //ʱõϢ + { + function WMWindowPosChanged(o,e):LM_WINDOWPOSCHANGED;virtual; + begin + end + function CMChanged(o,e):CM_CHANGED;virtual; + begin + end + function LMCaptureChanged(o,e):LM_CaptureChanged;virtual; + begin + end + function CMBiDiModeChanged(o,e):CM_BIDIMODECHANGED;virtual; + begin + end + function CMSysFontChanged(o,e):CM_SYSFONTCHANGED;virtual; + begin + end + function CMEnabledChanged(o,e):CM_ENABLEDCHANGED;virtual; + begin + end + function CMHitTest(o,e):CM_HITTEST;virtual; + begin + end + function CMMouseEnter(o,e):CM_MOUSEENTER;virtual; + begin + end + function CMMouseLeave(o,e):CM_MOUSELEAVE;virtual; + begin + end + function CMHintShow(o,e):CM_HINTSHOW;virtual; + begin + end + function CMParentBiDiModeChanged(o,e):CM_PARENTBIDIMODECHANGED;virtual; + begin + end + function CMParentColorChanged(o,e):CM_PARENTCOLORCHANGED;virtual; + begin + end + function CMParentFontChanged(o,e):CM_PARENTFONTCHANGED;virtual; + begin + end + function CMParentShowHintChanged(o,e):CM_PARENTSHOWHINTCHANGED;virtual; + begin + end + function CMVisibleChanged(o,e):CM_VISIBLECHANGED;virtual; + begin + end + function CMTextChanged(o,e):CM_TEXTCHANGED;virtual; + begin + end } + +#!end //Ϣ + protected //key and mouse + function SetColor(v);virtual; + begin + if v <> FColor and ifnumber(v)then + begin + FColor := v; + end + end + function SetBitmap(v);virtual; + begin + if v <> FBKBitmap then + begin + FBKBitmap := v; + end + end + function GetActionLinkClass();virtual; + begin + {** + @explan(˵) actionlinkclass %% + @return(TControlActionLink class) + **} + return class(TControlActionLink); + end + procedure ActionChange(Sender:TObject;CheckDefaults:Boolean);virtual; + begin + if Sender is class(TCustomAction)then + begin + NewAction := Sender; + if(not CheckDefaults)or(Caption='')or(Caption=Name)then Caption := NewAction.Caption; + if not CheckDefaults or Enabled then Enabled := NewAction.Enabled; + if not CheckDefaults or Visible then Visible := NewAction.Visible; + { + if not CheckDefaults or (Hint = '') then + Hint := NewAction.Hint; + if not CheckDefaults or (Self.HelpContext = 0) then + Self.HelpContext := HelpContext; + if not CheckDefaults or (Self.HelpKeyword = '') then + Self.HelpKeyword := HelpKeyword; + } + // HelpType is set implicitly when assigning HelpContext or HelpKeyword + end; + end + function click(o,e);virtual; //type_tcontrol + begin + end + function DblClick(o,e);virtual; //type_tcontrol + begin + end + public + function ScreenToClient(X,Y);virtual; + begin + if Parent then + begin + ps := Parent.ScreenToClient(x,y); + return array(ps[0]-Left,ps[1]-Top); + end + return array(x,y); + end + function ClientToScreen(x,y);virtual; + begin + if Parent then + begin + ps := array(x+Left,y+Top); + return Parent.ClientToScreen(x+Left,y+Top); + end + return array(x,y); + end + function IsContainer(cd);virtual; + begin + { + @explan(˵)жϵǰǷΪ %% + @param(cd)(tcontrol ) cd ǷΪ %% + } + return false; + end + function getid(); + begin + return Fid; + end + function create(Owner);override; //type_tcontrol + begin + inherited; + if ifnil(FSIDC)then FSIDC := new tidcreater(100); + FId := FSIDC.createid(); + //init(); + bindmessages(self(true)); + FControlStyle := array(csCaptureMouse,csClickEvents,csSetCaption,csDoubleClicks); + FAlign := alNone; + FAnchors := array(akLeft,akTop); + FControls := new TFpList(); + FVisible := True; + FParentBidiMode := True; + FParentColor := True; + FParentFont := false; + FDesktopFont := True; + FParentShowHint := True; + FIsControl := False; + FEnabled := True; + FDragCursor := crDrag; + FCaption := "title"; + FLeft := 10; + FTop := 10; + FFont := new TFontControl(); + FFont.Control := self(true); + FWidth := 120; + FHeight := 40; + FBorder := false; + FColor := 0xffffff; //_wapi.GetSysColor(COLOR_WINDOW);//0xffffff; + FCanvas := new TControlCanvs(); + FCursor := new tcursor(); + FCursor.id := IDC_ARROW; + end + procedure CheckNewParent(AParent:TWinControl);virtual; //type_tcontrol + begin + { + @ignore() + @explan(˵) жǷΪڵ + } + return(AParent is class(TWinControl))and AParent.IsContainer(self(true)); + return false; + end + function Recycling();override; //type_tcontrol + begin + {** + @explan(˵) Դ,override÷Ȼdestroyе %% + **} + FFont := nil; + FMessagehandle := array(); + {while true do + begin + ci := FControls.Count; + if ci<1 then break; + cvi := FControls[ci-1]; + cvi.SetParent(nil); + end } + FSIDC.deleteid(FID); + SetParent(nil); + FOnClick := nil; // + FOnContextPopup := nil; + FOnDblClick := nil; //˫ + FOnDragDrop := nil; + FOnDragOver := nil; + FOnSize := nil; + FOnMove := nil; + FOnEditingDone := nil; + FOnEndDock := nil; + FOnEndDrag := nil; + FOnMouseDown := nil; // + FOnMouseEnter := nil; // + FMouseEntereded := nil; + FOnMouseLeave := nil; //뿪 + FOnMouseMove := nil; //ƶ + FOnPopupMenu := nil; + FOnMouseUp := nil; // + FOnMouseWheel := nil; // + FOnMouseWheelDown := nil; // + FOnMouseWheelUp := nil; // + //FOnQuadClick := nil; + //FOnResize := nil; // + FOnShowHint := nil; + FOnStartDock := nil; + FOnStartDrag := nil; + FOnTripleClick := nil; + FBKBitmap := nil; + if FActionLink is class(TControlActionLink)then + begin + FActionLink.Recycling(); + FActionLink := nil; + end + inherited; + end + function destroy();override; + begin + inherited; + end + function GetBoundsRect(); //type_tcontrol + begin + {** + @explan(˵)ȡηΧ %% + **} + return array(FLeft,FTop,FLeft+FWidth,FTop+FHeight); + end; + function SetBoundsRect(rect); + begin + {** + @explan(˵) þηΧ %% + **} + nt := 100000; + if ifarray(rect)and rect[0]0 and aHeight>0 then + begin + ChangeBounds(integer(ALeft),integer(ATop),integer(AWidth),integer(AHeight),false); + end + end + function GetBounds();virtual; //type_tcontrol + begin + //aLeft, aTop, aWidth, aHeight: integer + {** + @explan(˵) ȡؼΧ %% + @return( array of integer) array(aLeft, aTop, aWidth, aHeight: integer) %% + + **} + return array(Left,top,Width,height); + //ChangeBounds(ALeft, ATop, AWidth, AHeight, false); + end + procedure SetTempCursor(Value);virtual; + begin + if Parent then return Parent.SetTempCursor(Value); + end + // drag and dock + function Dragging(); + begin + //return DragManager.Dragging(Self); + end; + procedure BeginDrag(Immediate:Boolean;Threshold); + begin + if not ifnumber(Threshold)then Threshold :=-1; + //DragManager.DragStart(Self, Immediate, Threshold); + end + procedure EndDrag(Drop:Boolean); + begin + //if Dragging() then DragManager.DragStop(Drop); + end + function getmessagehandle(id);virtual; + begin + if ifnumber(id)and FMessagehandle then return FMessagehandle[id]; + end + function dispatch(o,e);virtual; //type_tcontrol + begin + {** + @explan(˵)Ϣַ %% + @param(o)()ؼ %% + @param(e)(tuieventbase) Ϣ༰ %% + **} + func := getmessagehandle(e.Msg); + if func then call(func,o,e); + end + procedure DoControlAlign();virtual; + begin + end + procedure DoControlAnchor();virtual; + begin + end + procedure WndProc(TheMessage);virtual; //type_tcontrol + begin + {** + @explan(˵) Ϣѭ %% + @param(e)(tuieventbase) Ϣ %% + **} + TheMessage.Sender := self(true); + tmsg := TheMessage.msg; + case tmsg of + WM_WINDOWPOSCHANGED: + begin + //d := new ttagWINDOWPOS(TheMessage.lparam); + d := new tvclwindowpos_class(TheMessage.lparam); + flags := d.flags; + if not((flags .& SWP_NOMOVE)=SWP_NOMOVE)then + begin + x := d.x; + y := d.y; + if x <> FLeft then FLeft := x; + if y <> FTop then FTop := y; + end + if not((flags .& SWP_NOSIZE)=SWP_NOSIZE)then + begin + cx := d.cx; + cy := d.cy; + if cx <> FWidth then FWidth := cx; + if cy <> FHeight then FHeight := cy; + end + end + {WM_SIZE: + begin + x := TheMessage.lolparamsigned(); + dxsize := x-FClientWdith; + if FClientWdith<> x then FClientWdith := x; + y := TheMessage.hilparamsigned(); + dysize := y-FClientHeight; + if FClientHeight <> y then FClientHeight := y; + DoControlAnchor(array(dxsize,dysize)); + DoControlAlign(array(FClientLeft,FClientTop,x,y)); + end + WM_MOVE: + begin + x := TheMessage.lolparamsigned(); + if FClientLeft<> x then FClientLeft := x; + y := TheMessage.hilparamsigned(); + if FClientTop <> y then FClientTop := y; + end } + end; + if(csDesigning in ComponentState)then + begin + //calldatafunction(,self(true),TheMessage); + end else + if(tmsg >= LM_KEYFIRST)and(tmsg <= LM_KEYLAST)then + begin + // keyboard messages + //Form := GetParentForm(Self); + //if (Form <> nil) and (Form.WantChildKey(Self,TheMessage)) then exit; + end else + if((tmsg >= LM_MOUSEFIRST)and(tmsg <= LM_MOUSELAST))or((tmsg >= LM_MOUSEFIRST2)and(tmsg <= LM_MOUSELAST2))then + begin + // mouse messages + case tmsg of + LM_MOUSEMOVE: + begin + //Application.HintMouseMessage(Self, TheMessage); + end; + LM_LBUTTONDOWN,LM_LBUTTONDBLCLK: + begin + includestate(FControlState,csLButtonDown); + if FDragMode=dmAutomatic then + begin + end; + //BeginAutoDrag(); + end; + LM_LBUTTONUP: + begin + excludestate(FControlState,csLButtonDown); + end; + end; + end; + if tmsg=LM_PAINT then + begin + includestate(FControlFlags,cfProcessingWMPaint); + try + Dispatch(self(true),TheMessage); + finally + excludestate(FControlFlags,cfProcessingWMPaint); + end; + end else + begin + Dispatch(self(true),TheMessage); + end + end; + function Perform(e); + begin + {** + @explan(˵) Ϣִ֪ͨ %% + @param(e)(tuieventbase) + **} + WndProc(e); + return e.Result; + end + property ActionLink read FActionLink; //write FActionLink; + {public + procedure AdjustSize;virtual; // smart calling DoAutoSize + begin + includestate(FControlFlags,cfAutoSizeNeeded); + if Parent then + begin + Parent.AdjustSize(); // + end + end } + public + // standard properties, which should be supported by all descendants + property Action:taction read GetAction write SetAction; + property Anchors:anchors read FAnchors write SetAnchors; + property Align:align read FAlign write SetAlign; + protected + property UnAlignBounds read GetUnAlignBounds write SetUnAlignBounds; + {** + @param(Action)(taction) action %% + @param(UnAlignBounds)(array of integer) ȥԶʱķΧ %% + @param(Align)(member of TAlign ) Ĭ alNone 뷽ʽ %% + @param(Anchors)( array of TAnchorKind member) êλ ,Ĭ array(akTop,akLeft) %% + **} + public + property ParentFont:bool read FParentFont write SetParentFont; + property Caption:string read GetText write SetText ; + property Enabled:bool read GetEnabled write SetEnabled; + property Cursor:syscursor read GetCursor write SetCursor; + {** + @param(Cursor)(tcursor ͨ member of TSystemCursor ) ϵͳ %% + **} + property Font:font read GetControlFont write SetControlFont;//write SetFont; + property OnMouseWheel read FOnMouseWheel write FOnMouseWheel; + {** + @param(Caption)(string) ؼ %% + @param(Enabled)(bool) ؼǷЧ %% + @param(OnMouseWheel)(function[TControl,TMMOUSEWHEEL]) ص %% + **} + //property MouseEntered read FMouseEntered; + property OnSize:eventhandler read FOnSize write FOnSize; + property OnMove:eventhandler read FOnMove write FOnMove; + property OnMouseMove:eventhandler read FOnMouseMove Write FOnMouseMove; + property OnPopupMenu read FOnPopupMenu write FOnPopupMenu; + property OnMouseDown:eventhandler read FOnMouseDown write FOnMouseDown; + {** + @param(OnMouseMove)(function[TControl,TMMouse]) ƶص %% + @param(OnPopupMenu)(function[TControl,TMMouse]) ˵ص %% + @param(OnMouseDown)(function[TControl,TMMouse]) 갴»ص %% + @param(OnMouseUp)(function[TControl,TMMouse]) ɿص %% + @param(OnClick)(function[TControl,TMMouse]) ص %% + @param(OnDblClick)(function[TControl,TMMouse]) ˫ص %% + @param(PopupMenu)(tpopupmenu) ˵%% + @param(Parent)(tcontrol) ؼ %% + @param(Visible)(bool) Ƿɼ %% + **} + property OnMouseUp:eventhandler read FOnMouseUp write FOnMouseUp; + property OnClick:eventhandler read FOnClick write FOnClick; + property onrclick:eventhandler read Fonrclick write Fonrclick; + property OnDblClick:eventhandler read FOnDblClick write FOnDblClick; + //property OnResize read FOnResize write FOnResize; + property OnShowHint read FOnShowHint write FOnShowHint; + property Parent read FParent write SetParent; + property PopupMenu:tpopupmenu read FPopupMenu write FPopupMenu{read GetPopupmenu write SetPopupMenu}; + //property ShowHint read FShowHint write SetShowHint ; + property Visible:bool read FVisible write SetVisible ; + property ClientRect read GetClientRect; + property Height: Integer read FHeight write SetHeight; + property Width :integer read FWidth write SetWidth; + property Left :integer read FLeft write SetLeft; + property Top :integer read FTop write SetTop; + property Border:bool read FBorder write SetBorder; + {** + @param(ClientRect)(array of integer) ͻarray(left,top,right,bottom) %% + @param(BoundsRect)(array of integer) ؼarray(left,top,right,bottom) %% + @param(Height)(integer) ߶ %% + @param(Width)(integer) %% + @param(Zorder)(integer) ÿؼڸڵĴ,ײΪ 0 %% + @param(Top)() Ϸλ %% + @param(Left)() %% + **} + property BoundsRect read GetBoundsRect write SetBoundsRect; + property Zorder read GetZorder write SetZorder; + property ControlState: TControlState read FControlState write FControlState; + property Color:color read FColor write SetColor;//FColor; + property BKBitmap:tbitmap read FBKBitmap write SetBitmap; + property OnMeasureItem read FOnMeasureItem write FOnMeasureItem; + property OnDrawItem read FOnDrawItem write FOnDrawItem; + //property OnMouseEnter:eventhandler read FOnMouseEnter write FOnMouseEnter; + //property OnMouseLeave:eventhandler read FOnMouseLeave write FOnMouseLeave; + property Controls read FControls; + property Canvas: TCanvas read FCanvas; + {** + @param(Canvas)(TCanvas) %% + @param(Controls)(TFpList of tcontrol) %% + @param(OnMouseLeave)(function[TControl,tuieventbase]) 뿪ص %% + @param(OnMouseEnter)(function[TControl,tuieventbase]) ص %% + @param(OnMeasureItem)(function[TControl,TMMEASUREITEM]) ؼص %% + @param(OnDrawItem)(function[TControl,TMDRAWITEM]) ؼƻص %% + @param(Color)(integer) ɫ %% + **} + function isCustomPaint(); + begin + return csCustomPaint in FControlState ; + end +end +type TGraphicControl = class(TControl) + {** + @explan(˵) Իƿؼ %% + **} + private + //FCanvas: TCanvas; + FOnPaint:TNotifyEvent; + protected + procedure ChangeBounds(ALeft,ATop,AWidth,AHeight:integer;KeepBase:boolean);override; //type_tcontrol + begin + rect1 := array(FLeft,FTop,FLeft+FWidth,FTop+FHeight); + rect2 := array(ALeft,ATop,ALeft+AWidth,ATop+AHeight); + inherited; + if rect1 <> rect2 then + begin + if Parent then + begin + //Parent.InvalidateRect(nil,false); + Parent.InvalidateRect(rect1,false); + Parent.InvalidateRect(rect2,false); + //Parent.updateWindow(); + end + end + end + function RealSetText(s);override; + begin + {** + @explan(˵) ޸ı %% + **} + if ifstring(s)and caption <> s then + begin + inherited; + InvalidateRect(rec,true); + end + end + procedure Paint();virtual; + begin + {** + @explan(˵)ؼƵ ,ʹCanvasԺPAINTSTRUCTṹ ƿؼ %% + **} + if(datatype(FOnPaint)<> 7)or(not call(FOnPaint,self(true)))then + begin + canvas.Font := font; + Canvas.DrawText(self.caption,self.ClientRect,DT_VCENTER .| DT_SINGLELINE .| DT_CENTER .| DT_NOPREFIX); + end + //_wapi.DrawFrameControl(Canvas.handle,const ClientRect,DFC_BUTTON,DFCS_BUTTONCHECK); + //_wapi.DrawEdge(Canvas.handle,const ClientRect,EDGE_ETCHED,BF_RECT); + //_wapi.DrawFocusRect(Canvas.Handle,const ClientRect); + end + procedure DoOnChangeBounds();override; + begin + end + procedure DoOnParentHandleDestruction;override; + begin + end + function InvalidateRectForce(); + begin + if Parent then + begin + nrec := array(FLeft,FTop,FLeft+FWidth,FTop+FHeight); + //return Parent.InvalidateRect(nrec,true); + return Parent.InvalidateRect(nrec,false); + end + end + public + procedure SetVisible(Value);virtual; + begin + nv := Value?true:false; + if nv <> Visible then + begin + inherited; + InvalidateRectForce(); + end + end + function InvalidateRect(rec,f); + begin + {** + @explan(˵)ôЧ %% + @param(rec)(array) Ч,nilʾЧ,array() %% + @param(f)(bool) Ƿػ %% + **} + if Visible {and Parent}then + begin + if not ifarray(rec)then return InvalidateRectForce(); + nrec := array(FLeft+rec[0],FTop+rec[1],FLeft+rec[2],FTop+rec[3]); + return Parent.InvalidateRect(nrec,false); + end + end + function WMPaint(o,Message:TLMPaint):LM_PAINT;override; + begin + //if csCustomPaint in ControlState then if Message.lparam<>2 then return ; + dc := Message.wparam; + if dc then + begin + //_wapi.ReleaseDC(Canvas.Handle); + //odh := canvas.Handle; + Canvas.Handle := dc; + try + _wapi.SetViewportOrgEx(dc,FLeft,FTop,nil); + //_send_(WM_ERASEBKGND,dc,1,1); + //Perform(new tuieventbase(WM_ERASEBKGND,dc,1)); + //Perform(messagecreater(nil,WM_ERASEBKGND,dc,1)); + WMERASEBKGND(self(true),messagecreater(nil,WM_ERASEBKGND,dc,2)); + Canvas.SaveDC(); + Paint(); + Canvas.RestoreDC(); + //Canvas. + finally + Canvas.Handle := odh; + end; + //Canvas.Handle := _wapi.GetDC(self.Handle); + end + end + function WMERASEBKGND(o,e):WM_ERASEBKGND;override; + begin + if e.wparam and e.lparam then + begin + if(BKBitmap is class(TBitmap))and BKBitmap.HandleAllocated()then + begin + //Canvas.StretchDraw(GetClientRect(),self.BKBitmap);//20210812 Ĭϵıͼ + Canvas.DrawBitmap(self.BKBitmap,GetClientRect()); + end else + begin + cl := Color; + if ifnumber(cl)then + begin + Canvas.Brush.Color := cl; + Canvas.FillRect(GetClientRect()); + end + end + e.skip := true; + return 1; + end + end + function CMCursorChanged(var Message:TLMessage):CM_CURSORCHANGED;override; + begin + inherited; + end + procedure FontChanged(Sender:TObject);override; + begin + inherited; + end + function IsContainer(cd);override; + begin + return false; + end + function Create(AOwner:TComponent);override; + begin + inherited; + //inherited Create(AOwner); + FLeft := 10; + FTop := 10; + FWidth := 80; + FHeight := 25; + includestate(FControlState,csCustomPaint); + end + function Recycling();override; + begin + FOnPaint := nil; + inherited; + end + function SetParent(NewParent);override; //type_tcontrol + begin + op := parent; + if op=NewParent then return; + inherited; + if NewParent is class(TWinControl)then + begin + InvalidateRect(); + end + end + property OnPaint:eventhandler read FOnPaint write FOnPaint; + {** + @param(OnPaint)(function[TGraphicControl]:bool) ƻص,trueִĬϻ %% + **} +end; +type TLabel = class(TGraphicControl) + {** + @explan(˵)ǩؼ %% + **} + private + FTextAlign; + function SetTextAlign(v); + begin + if v <> FTextAlign then + begin + FTextAlign := v; + InvalidateRect(nil,true); + end + end + protected + function SetControlFont(v);override; + begin + inherited; + //invalidaterect(nil,true); + invalidaterect(nil,false); + end + public + function paint();override; + begin + dc := canvas; + dc.font := font; + rc := ClientRect; + if border then + begin + rc[0]+= 1; + rc[1]+= 1; + rc[2]-= 1; + rc[3]-= 1; + end + CanvasDrawAlignText(dc,rc,self.Caption,FTextAlign); + if border then + begin + dc.Draw("polyline",array((rc[0],rc[1]),(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),(rc[0],rc[1]))); + end + end + function create(AOwner);override; + begin + inherited; + caption := "label"; + FTextAlign := 0; + //border := true; + end + class function CanvasDrawAlignText(dc,rect,txt,al); + begin + {** + @explan(˵) ָڰն뷽ʽı%% + @param(al)(member of TAlignStyle9) 뷽ʽ %% + **} + if not(dc is class(TCanvas))then exit; + als := array(36,0,33 + ,2,36 + ,37 + ,38,40 + ,41 + ,42); + val := als[al]; + if ifnil(val)then val := 36; + return dc.drawtext(txt,rect,val .| DT_NOPREFIX); + end + property TextAlign:AlignStyle9 read FTextAlign write SetTextAlign; + function publishs();override; + begin + return array("name","action","align","anchors","caption","enabled","font", + "popupmenu","visible", + "height","width","left","top","color","bkbitmap", + "onpopupmenu","onmousedown","onmouseup"); + end + {** + @param(TextAlign)(member of TAlignStyle9) ֶ %% + **} +end + // +type TWinControl = class(tcontrol) + {** + @explan(˵) ڿؼ %% + **} + private //Ա + __wstyle; //ʽ + __wexstyle; //չʽ + __wstylestruct; //ʽϢṹ + __clientsize; //ͻС + __oldclientsize; //ɿͻС + FClientleft; + FClientTop; + FClientWdith; + FClientHeight; + FWsPopUp; + //FTtageDrawItem; //ѾƳ + FWMNCHITTEST; + FImageList; + //FTRACKMOUSEEVENT; + FHandle:HWND; //ھ + private // + FBorderStyle; + FParentWindow:HWND; //ھ + static FDefaultProc; //windowsĬϾ + FWndproc; //Ϣ + protected //Ϣ + FDefWndproc; //ĬϢ + private //ʱָ + FonKillFocus; + FonSetFocus; + FControlStyle; //ؼʽ + FOnClose; + FOnDesinedsel; + FOnDesigDBLClick; + FOnDesinedRclick; + FOnActivate; + FOnKeyDown; + FOnKeyPress; + FOnKeyUp; + FTabStop; + FWsCaption; + FWsSizeBox; + FWsSysMenu; + FWsDlgModalFrame; + private //ģ̬ + //*******showmodal****************** + FModaling; + FModalCode; + FMinWidth; + FMinHeigt; + //Ftagminmaxinfo; + FMaxWidth; + FMaxHeight; + FGtkEventOjbect; //gtkobject + private // + function SetMaxWidth(v); + begin + if v>0 and FMaxWidth <> V then + begin + FMaxWidth := v; + end + end + function SetMaxHeight(v); + begin + if v>0 and FMaxHeight <> v then + begin + FMaxHeight := v; + end + end + function SetMinWidth(v); + begin + if v>0 and FMinWidth <> v then + begin + FMinWidth := v; + if FMinWidth>width then width := FMinWidth; + end + end + function SetMinHeight(v); + begin + if v>0 and FMinHeigt <> v then + begin + FMinHeigt := v; + if FMinHeigt>height then height := FMinHeigt; + end + end + function DoModal() + begin + //ʶģ̬״̬ + if not WsPopUp then + begin + exit; + end +{$ifdef gtkpaint} + if FModaling then exit; + if _wapi.gtk_window_showmodal(self(true))then + begin + FModaling := true; + initializeapplication().run(); + end + return FModalCode; + exit; +{$endif} + modp := parent; + {if not(modp is class(TWinControl)) then + begin + return -1; + end } + hWnd := Handle; + FModaling := TRUE; + FMSG := new TTagMSG(); + msg := FMSG._getptr_; + //ʾԼ + _wapi.ShowWindow(hWnd,SW_SHOW); + _wapi.BringWindowToTop(hWnd); + //disable + FModalRootWnd := 0; + if(modp is class(TWinControl))and modp.HandleAllocated()then + begin + hParentWnd := modp.Handle; + while(hParentWnd) do + begin + _wapi.EnableWindow(hParentWnd,FALSE); + wdobj := class(TGlobalComponentcache).getwndbyhwnd(hParentWnd); + if wdobj and wdobj.Modaling then + begin + FModalRootWnd := hParentWnd; + break; + end + hParentWnd := _wapi.GetParent(hParentWnd); + end + end + //ӹϢѭ + while(FModaling) do + begin + ///////////////////////////////////////////// + if(_wapi.PeekMessageA(msg,0,0,0,0x1))then + begin + if FMSG.message=0x12 then + begin + return 1; + end else + begin + _wapi.TranslateMessage(msg); + _wapi.DispatchMessageA(msg); + end + end else + begin + tslprocessmessages(false); + RunWorkerThreadLoop(); + end + ////////////////////////////////////////// + {if (not _wapi.GetMessageA(msg, 0, 0, 0)) then break; + _wapi.TranslateMessage(msg); + _wapi.DispatchMessageA(msg);} + end + //ģ̬Ѿ˳ + //ָڵenable״̬ + if(modp is class(TWinControl))and modp.HandleAllocated()then + begin + hParentWnd := modp.Handle; + while(hParentWnd) do + begin + _wapi.EnableWindow(hParentWnd,TRUE); + if FModalRootWnd=hParentWnd then break; + hParentWnd := _wapi.GetParent(hParentWnd); + end + end + //Լ + _wapi.ShowWindow(hWnd,SW_HIDE); + return FModalCode; + end + private //ʽ + function SetWSsizeBox(v); + begin + nv := v?true:false; + if nv <> FWsSizeBox then + begin + FWsSizeBox := nv; + if HandleAllocated()then RecreateWnd(); + end + end + function GetWsSysMenu();virtual; + begin + return FWsSysMenu; + end + function SetWsSysMenu(v);virtual; + begin + nv := v?true:false; + if nv <> FWsSysMenu then + begin + FWsSysMenu := nv; + if HandleAllocated()then RecreateWnd(); + end + end + function SetWsDlgModalFrame(v);virtual; + begin + nv := v?true:false; + if nv <> FWsDlgModalFrame then + begin + FWsDlgModalFrame := nv; + if HandleAllocated()then + begin + RecreateWnd(); + end + end + end + protected + function SetWsPopUp(v);virtual; + begin + nv := v?true:false; + if nv <> FWsPopUp then + begin + FWsPopUp := nv; + if HandleAllocated()then RecreateWnd(); + end + end + function GetWsPopUp();virtual; + begin + return FWsPopUp; + end + private + function GetWsCaption(v);virtual; + begin + return FWsCaption; + end + function SetWsCaption(v);virtual; + begin + nv := v?true:false; + if nv <> FWsCaption then + begin + FWsCaption := nv; + if HandleAllocated()then RecreateWnd(); + end + end + function GetHandle(); //type_twinctrol + begin + //if not HandleAllocated then DebugLn('TWinControl.GetHandle Creating handle on the fly: ',DbgSName(Self)); + HandleNeeded(); + return FHandle; + end; + procedure SetHandle(NewHandle); //type_twinctrol + begin + if {NewHandle and}not(FHandle)then FHandle := NewHandle; + //if (NewHandle=0) and (AnsiCompareText(ClassName,'TPAGE')=0) then + // RaiseGDBException('TWincontrol.SetHandle'); + //FHandle:=NewHandle; + //InvalidatePreferredSize(); + end; + function SetTabStop(v); + begin + nv := V?true:false; + if nv <> FTabStop then + begin + FTabStop := nv; + if HandleAllocated()then + begin + if nv then appendwstyle(WS_TABSTOP); + else minuswstyle(WS_TABSTOP); + end + end + end + function GetControlCount():Integer; //type_twinctrol + begin + return FControls.Count(); + end; + procedure SetParentWindow(const AValue:HWND); //type_twinctrol + begin + {** + @ignore() %% + **} + if(ParentWindow=AValue)or Assigned(Parent)then Exit; + FParentWindow := AValue; + if HandleAllocated()then + begin + if(AValue <> 0)then //LCLIntf.SetParent(Handle, AValue) + else DestroyHandle(); + end + UpdateControlState(); + end + protected + function SetImageList(v); + begin + if FImageList=v then exit; + if FImageList is class(TControlImageList)then + begin + ti := FImageList; + FImageList := nil; + ti.deleteControl(self); + end + FImageList := v; + if v is class(TControlImageList)then v.addControl(self); + ImageChanged(); + end + class function getwndbyhwnd(hwnd); //type_twinctrol + begin + return class(TGlobalComponentcache).getwndbyhwnd(hwnd); + end + class function registerhandle(handle,o); //type_twinctrol + begin + //ע %% + return class(TGlobalComponentcache).registerhandle(handle,o); + end + class function unregisterhandle(handle); //type_twinctrol + begin + //ɾ %% + return class(TGlobalComponentcache).unregisterhandle(handle); + end + class function sinit();override; + begin + {** + @explan(˵)ʼ %% + **} + if ifnil(FDefaultProc)then FDefaultProc := getwinprocptr(1); + end + function SetBorder(v);override; //type_twinctrol + begin + nv := v?true:false; + if nv <> Border then + begin + inherited; + if nv then appendwstyle(WS_BORDER); + else minuswstyle(WS_BORDER); + Refresh(); + end + end + procedure CreateHandle();virtual; //type_twinctrol + begin + if csCreating in ControlState then return; + if(not HandleAllocated())then + begin + includestate(ControlState,csCreating); + CreateWnd(); + excludestate(ControlState,csCreating); + end + end; + procedure InitializeWnd();virtual; //type_twinctrol + begin + {** + @explan(˵) ھʼ,ڸúôھһЩϢ %% + **} + //Щ + if HandleAllocated()then + begin + //Canvas.Handle := _wapi.GetDC(self.Handle); + if(Parent is class(TWinControl))and Parent.HandleAllocated()then + begin + //if Align<>alNone then + Parent.DoControlAlign(); + end + if ParentFont then + begin + hd := GetParentFontHandle(); + end else + hd := Font.Handle; + if hd then + begin + _send_(WM_SETFONT,hd,1,1); //send ޸Ϊ post + end + ImageChanged(); + // "id:",self.caption,_wapi.GetWindowLongPtrA(FHandle,GWLP_ID); + end + end + function GetBorderStyle(); + begin + return FBorderStyle; + end + function SetBorderStyle(NewStyle);virtual; + begin + if FBorderStyle=NewStyle then exit; + if FBorderStyle in array(bsNone,bsSingle)then + begin + FBorderStyle := NewStyle; + if FBorderStyle=bsNone then + begin + minuswexstyle(WS_EX_CLIENTEDGE); + end else + appendwexstyle(WS_EX_CLIENTEDGE); + end + end + function CreateParams(p);virtual; //type_twinctrol + begin + {** + @explan(˵)ܴھʹ %% + @param(p)(var TCreateParams) η %% + **} + if not(p is class(TCreateParams))then p := new TCreateParams(); + p.Caption := Caption; + //p.Style := WS_CHILD .| WS_CLIPSIBLINGS .| WS_CLIPCHILDREN ; + p.Style := WS_CHILD; + if FWsPopUp then + begin + p.Style := WS_POPUP; + end else + begin + p.Style := WS_CHILD; + end + //p.style .|= WS_CAPTION; //WS_SYSMENU .| + if WsCaption then p.style .|= WS_CAPTION; + if FWsSysMenu then P.Style .|= WS_CAPTION .| WS_SYSMENU; + if FWsSizeBox then p.style .|= WS_SIZEBOX; + if Border then p.Style := p.Style .| WS_BORDER; + if csAcceptsControls in FControlStyle then p.ExStyle := p.ExStyle .| WS_EX_CONTROLPARENT; + if BorderStyle=bsSingle then p.ExStyle := p.ExStyle .| WS_EX_CLIENTEDGE; + if WSDlgModalFrame then + begin + p.ExStyle .|= WS_EX_DLGMODALFRAME; + end + if TabStop then p.Style .|= WS_TABSTOP; + //op := parent; + if not(Enabled)then p.Style .|= WS_DISABLED; + if Visible then p.Style .|= WS_VISIBLE; + if Parent is class(TWinControl)then //if Parent.HandleAllocated() then + p.WndParent := Parent.Handle; + else p.WndParent := ParentWindow; + p.X := Left; + p.Y := Top; + p.Width := Width; + p.Height := Height; + p.happ := happ; + p.Style .|= WS_CLIPSIBLINGS .| WS_CLIPCHILDREN; + p.cstyle := CS_HREDRAW .| CS_VREDRAW .| CS_OWNDC .| CS_DBLCLKS; + end + procedure RealSetText(Value:TCaption);override; //type_twinctrol + begin + {** + @explan(˵) ñ %% + @param(value)(string) %% + **} + if ifstring(Value)and(Caption <> Value)then + begin + inherited; + if HandleAllocated()then + begin + _wapi.SetWindowTextA(self.handle,self.Caption); + end + end + end + function createwndclass(p); //type_twinctrol + begin + {** + @param(p)(TCreateParams) עᴰ %% + @explan(˵)עᴰ %% + **} + classobj := p.winclass; //new tagWNDCLASSA(); + subclass := p.subclass; + uiproc := getwinprocptr(); + dfproc := getwinprocptr(1); + p.subclasswndproc := dfproc; + tclass := new tagWNDCLASSA(); + classobj._setvalue_("lpszclassname",p.WinClassName); + for i,v in classobj._getdata_() do + begin + if i="lpfnwndproc" then tclass._setvalue_(i,uiproc); + else tclass._setvalue_(i,v); + end + regptr := _wapi.GetClassInfoExA(p.happ,p.WinClassName,classobj._getptr_); + if not regptr then + begin + for i,v in tclass._getdata_() do + begin + classobj._setvalue_(i,v); + end + end + if ifstring(p.SubClassName)and p.SubClassName then //subclass + begin + tcn := p.SubClassName; + subregptr := _wapi.GetClassInfoExA(p.Happ,tcn,subclass._getptr_); + if subregptr then + begin + p.subclasswndproc := subclass._getvalue_("lpfnwndproc"); + if p.subclasswndproc=uiproc then + begin + p.subclasswndproc := dfproc; + end + if not regptr then //ûע + begin + for i,v in subclass._getdata_() do //ӴϢ + begin + if i="lpfnwndproc" then + begin + classobj._setvalue_(i,uiproc); + end else + if i="lpszclassname" then + begin + tcn := p.WinClassName; + classobj._setvalue_(i,tcn); + end else + begin + classobj._setvalue_(i,v); + end + end + end + end + end else //subclass ĬϻصΪ defaultproc + begin + if p.cstyle then classobj.style := p.cstyle; + p.subclasswndproc := dfproc; + end + if regptr then + begin + if uiproc <> classobj._getvalue_("lpfnwndproc")then + begin + messageboxA("עͻ!","",1); + end + end else + begin + regptr := _wapi.RegisterClassExA(classobj._getptr_); + end + end + function UpdateControlState(); ////type_twinctrol + begin + end + procedure ChangeBounds(ALeft,ATop,AWidth,AHeight:integer;KeepBase:boolean);override; //type_twinctrol + begin + if HandleAllocated()then + begin + //_wapi.MoveWindow(self.Handle,ALeft,ATop,AWidth,AHeight,true); + _wapi.SetWindowPos(self.Handle,0,integer(ALeft),integer(ATop),integer(AWidth),integer(AHeight),SWP_NOZORDER .| SWP_NOACTIVATE); //.| SWP_NOACTIVATE + end else + begin + inherited; + //class(tcontrol).ChangeBounds(ALeft, ATop, AWidth, AHeight,KeepBase); + end + end + function SetEnabled(v);override; + begin + inherited; + if HandleAllocated()then _wapi.EnableWindow(FHandle,v?true:false); + end + function SetVisible(v);override; + begin + inherited; + if HandleAllocated()then + begin + _wapi.ShowWindow(FHandle,v?SW_SHOW:SW_HIDE); + if(Parent is class(TWinControl))and parent.HandleAllocated()then + begin + if Align <> alNone then Parent.DoControlAlign(); + end + {if V then + begin + DoControlAlign(); + end } + end + end + function Hitcontrol(p); + begin + {** + @explan(˵) пؼ %% + **} + for i := ControlCount-1 downto 0 do + begin + it := Controls[i]; + if it is class(TGraphicControl)then + begin + if it.Enabled and it.Visible and pointinrect(p,it.GetBoundsRect)then + begin + return it; + end + end + end + end + function MouseHover(O,e);override; + begin + inself := true; + initem := 0; + for i := ControlCount-1 downto 0 do + begin + it := FControls[i]; + if(it is class(TGraphicControl))and it.visible then + begin + if inself and pointinrect(array(e.lolparamsigned,e.hilparamsigned),it.GetBoundsRect)and it.Enabled then + begin + initem := it; + inself := false; + end else + begin + it.Perform(messagecreater(nil,WM_MOUSELEAVE,0,0)); + end + end + end + if inself then return inherited; + else self.Perform(messagecreater(nil,WM_MOUSELEAVE,0,0)); + if initem then initem.Perform(messagecreater(nil,WM_MOUSEHOVER,0,0)); + end + function GetParentFontHandle();override; + begin + {** + @explan(˵) ȡľ %% + @return(pointer) + **} + if ParentFont and Parent then return Parent.GetParentFontHandle(); + if HandleAllocated()then + begin + return _send_(WM_GETFONT,0,0); + end else + return inherited; + end + public //Ϣ󶨺 + function WMMouseMove(o,e):LM_MOUSEMOVE;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMMouseMove(it,new TMMouse(LM_MOUSEMOVE,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + //return it.Perform(new TMMouse(LM_MOUSEMOVE,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMLButtonUp(o,e):LM_LBUTTONUP;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMLButtonUp(it,new TMMouse(LM_LBUTTONUP,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMRButtonUp(o,e):LM_RBUTTONUP;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMRButtonUp(it,new TMMouse(LM_RBUTTONUP,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMMButtonUp(o,e):LM_MBUTTONUP;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMMButtonUp(it,new TMMouse(LM_MBUTTONUP,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMContextMenu(o,e):LM_CONTEXTMENU;override; + begin + ps := array(e.lolparamsigned,e.hilparamsigned); + _wapi.ScreenToClient(Handle,ps); + it := Hitcontrol(ps); + if it then + begin + ev := new TMMouse(e.msg,e.wparam,e.lparam); + return it.Perform(ev); + end + return inherited; + end + function WMLButtonDown(o,e):LM_LBUTTONDOWN;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMLButtonDown(it,new TMMouse(LM_LBUTTONDOWN,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMRButtonDown(o,e):LM_RBUTTONDOWN;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMRButtonDown(it,new TMMouse(LM_RBUTTONDOWN,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + //return it.Perform(new TMMouse(LM_MOUSEMOVE,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMMButtonDown(o,e):LM_MBUTTONDOWN;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMMButtonDown(it,new TMMouse(LM_MBUTTONDOWN,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + function WMLButtonDBLCLK(o,e):LM_LBUTTONDBLCLK;override; + begin + it := Hitcontrol(e.pos); + if it then + begin + return it.WMLButtonDBLCLK(it,new TMMouse(LM_LBUTTONDBLCLK,e.wparam,makelong(e.xpos-it.left,e.ypos-it.top))); + end + inherited; + end + public // + class function CaptionHeight(); + begin + {** + @explan(˵) captionĸ߶ %% + @return(integer) ߶ %% + **} + return _wapi.GetSystemMetrics(SM_CYCAPTION); + end + function DesigningSelect(v); + begin + if ifnil(FDesignSelect)then FDesignSelect := false; + if ifnil(v)then return FDesignSelect; + if WsPopUp then return; + if not(csDesigning in ComponentState)then return; + nv := v?true:false; + if nv=FDesignSelect then return; + FDesignSelect := nv; + {$ifdef linux} + return InvalidateRect(nil,false); + {$endif} + rec := array(left,top,left+width,top+height); + rec[2:3]+= 1; + SetBoundsRect(rec); + rec[2:3]-= 1; + SetBoundsRect(rec); + end + private + FDesignSelect; + public //Ϣ󶨺 + function ImageChanged();virtual; + begin + end + + function WMNCPAINT(o,e):LM_NCPAINT;virtual; + begin + if (csDesigning in ComponentState) and FDesignSelect then + begin + hWnd := Handle; + rec := zeros(4); + {$ifdef linux} + + cvs := Canvas; + cvs.Handle := e.lparam;; + pc := cvs.pen.Color; + cvs.Pen.Color := rgb(224,0,0); + ps := cvs.Pen.Style; + pw := cvs.Pen.width; + cvs.Pen.Style := PS_SOLID; + cvs.Pen.width := 2; + _wapi.gtk_widget_get_allocation(hWnd,rec); + rec[0]:=0; + rec[1] := 0; + //rec[2]-=2; + //rec[3]-=2; + //cvs.FillRect(array(0,0,width,height)); //array(0,0,width,height) + cvs.Draw("Polyline",array((0,0),(rec[2]-rec[0]-1,0),(rec[2]-rec[0]-1,rec[3]-rec[1]-1),(0,rec[3]-rec[1]-1),(0,0))); + cvs.Pen.Color := pc; + cvs.Pen.width := pw; + cvs.Pen.Style := ps; + cvs.Handle := 0; + return ; + {$endif} + _wapi.GetWindowRect(hwnd,rec); + rect := array(0,0,0,0); + _wapi.GetClientRect(self.Handle,rect); + region := new TRGNRECT(); + region.Rect := rec; + if e.wparam =1 then + begin + end else + begin + _wapi.CombineRgn(region.Handle,e.wparam,nil,RGN_COPY); + end + hdc := _wapi.GetDCEx(hWnd, region.Handle, DCX_WINDOW .| DCX_CACHE .| DCX_INTERSECTRGN .| DCX_LOCKWINDOWUPDATE); + if hdc=0 then return ; + cvs := Canvas; + cvs.Handle := hdc; + cvs.Pen.Color := rgb(224,0,0); + cvs.Pen.Style := PS_SOLID; + cvs.Pen.width := 2; + defaulthandler(e); + //cvs.FillRect(array(0,0,width,height)); //array(0,0,width,height) + cvs.Draw("Polyline",array((0,0),(rec[2]-rec[0]-1,0),(rec[2]-rec[0]-1,rec[3]-rec[1]-1),(0,rec[3]-rec[1]-1),(0,0))); + _wapi.ReleaseDC(hWnd,hdc); + e.skip := true; + e.Result := 0; + end + end + procedure FontChanged(Sender:TObject);override; + begin + if(HandleAllocated()and not(ParentFont))then + begin + _send_(WM_SETFONT,Font.Handle,1); + end + end + function CMPARENTFONTCHANGED(o,e):CM_PARENTFONTCHANGED;virtual; + begin + if ParentFont then + begin + _send_(WM_SETFONT,e.wparam,1); + end + end + function WMGETMINMAXINFO(o,e):WM_GETMINMAXINFO;virtual; + begin + {** + @explan(˵) С %% + **} + k := 0; + if FMinWidth>0 then + begin + k .|= 1; + end + if FMinHeigt>0 then + begin + k .|= 2; + end + if FMaxHeight>0 then + begin + k .|= 4; + end + if FMaxWidth>0 then + begin + k .|= 8; + end + if k then + begin + d := new Ttagminmaxinfo(e.lparam); + ts := d.ptmintracksize; + case k of + 1:ts[0]:= FMinWidth; + 2:ts[1]:= FMinHeigt; + 3:ts := array(FMinWidth,FMinHeigt); + end; + d.ptmintracksize := ts; + end + end + function CMFONTCHANGED(o,e):CM_FONTCHANGED;virtual; + begin + hd := e.wparam; + for i := 0 to ControlCount-1 do + begin + it := Controls[i]; + it.Perform(new tuieventbase(CM_PARENTFONTCHANGED,hd,1)); + end + end + function WMSETFONT(o,e):WM_SETFONT;virtual; + begin + defaulthandler(e); + Perform(new tuieventbase(CM_FONTCHANGED,e.wparam,e.lparam)); + end + function WMACTIVATE(o,e):WM_ACTIVATE;virtual; + begin + CallMessgeFunction(OnActivate,o,e); + end + function GetClientRect();override; + begin + {** + @explan(˵)ÿͻС %% + @return(array of integer) ͻ %% + **} + ret := inherited; + if HandleAllocated()then + begin + if ifnumber(FClientWdith)and ifnumber(FClientHeight)then + begin + ret := array(0,0,FClientWdith,FClientHeight); + end else + _wapi.GetClientRect(self.Handle,ret); + end + //else ret := array(0,0,FClientWdith,FClientHeight); + return ret; + end + +#!begin //Ϣ + function DoCNALIGN(o,e);override; + begin + if(wstyle().& WS_POPUP)=WS_POPUP then exit; + inherited; + end + function DoWMCLOSE(o,e);virtual; + begin + EndModal(); + end + function WMCLOSE(o,e):WM_CLOSE;virtual; + begin + CallMessgeFunction(OnClose,o,e); + DoWMCLOSE(o,e); + end + function WMCREATE(o,e):WM_CREATE;virtual; + begin + if e.lparam then + begin + co := new TCREATESTRUCT(e.lparam); + __wstyle := co.style; + __wexstyle := co.dwexstyle; + end + end + function WMSETCURSOR(o,e):WM_SETCURSOR;virtual; + begin + if e.lolparam=HTCLIENT then + begin + ne := new tuieventbase(CM_CURSORCHANGED,0,0); + Perform(ne); + if ne.skip then + begin + e.skip := true; + e.result := true; + end + end + end + function WMSTYLECHANGING(o,e):WM_STYLECHANGING;virtual; + begin + end + function WMNCDESTROY(o,e):WM_NCDESTROY;virtual; + begin + FHandle := nil; + for i := 0 to FControls.count-1 do + begin + item := FControls.geti(i); + if(item is class(TWinControl))and item.WsPopUp then + begin + item.DestroyHandle(); + end + end + end + function WMSTYLECHANGED(o,e):WM_STYLECHANGED;virtual; + begin + end + function WMNCCALCSIZE(o,e):WM_NCCALCSIZE;virtual; + begin + if(csDesigning in ComponentState)and FDesignSelect then + begin + wd := 1; + hwd := wd; + rc := new TCRect(e.lparam); + rc.top += hwd; + rc.left += wd; + rc.bottom -= wd; + rc.right -= wd; + end + end + function WMMOUSEHOVER(o,e):WM_MOUSEHOVER;virtual; + begin + MouseHover(o,e); + end + function WMMOUSELEAVE(o,e):WM_MOUSELEAVE;virtual; + begin + MouseLeave(o,e); + end + function WMMENURBUTTONUP(o,e):WM_MENURBUTTONUP;virtual; + begin + if PopupMenu is class(TPopUpmenu)then PopupMenu.dispatch(e); + end + function WMMENUSELECT(o,e):WM_MENUSELECT;virtual; + begin + if PopupMenu is class(TPopUpmenu)then PopupMenu.dispatch(e); + end + function WMINITMENUPOPUP(o,e):WM_INITMENUPOPUP;virtual; + begin + if PopupMenu is class(TPopUpmenu)then PopupMenu.dispatch(e); + end + function WMERASEBKGND(o,e):WM_ERASEBKGND;override; + begin + {** + @explan(˵) %% + **} + if not HandleAllocated()then return; + mtic; + //if not(csCustomPaint in ControlState) and not(e.lparam) then return ; + dc := e.wparam; + if dc {and e.lparam}then + begin + cl := Color; + rect := array(0,0,0,0); + if e.lparam=2 then + begin + rect := PAINTSTRUCT().rcpaint(); + end + _wapi.GetClientRect(self.Handle,rect); + if ifnumber(cl)then + begin + Canvas.Brush.Color := cl; + Canvas.Handle := dc; + Canvas.FillRect(rect); + end else + begin + cl := _wapi.GetStockObject(WHITE_BRUSH); + _wapi.FillRect(dc,rect,cl); + end + if(BKBitmap is class(TBitmap))and BKBitmap.HandleAllocated()then + begin + Canvas.Handle := dc; + //Canvas.StretchDraw(rect,BKBitmap); + Canvas.DrawBitmap(self.BKBitmap,rect); + end + e.skip := true; + e.Result := 1; + end + end + Function WMDRAWITEM(o,e):WM_DRAWITEM;virtual; //type_twinctrol + begin + {** + @ignore() %% + @explan(˵) ԻϢ %% + @param(o)(TWincontrol) ڿؼ %% + @param(e)(TMDRAWITEM) Ϣ %% + **} + e.canvas := canvas; + dc := e.hdc; + //dc := _wapi.GetDC(SELF.hANDLE); + //dcid := _wapi.SaveDC(dc); + canvas.handle := dc; + if(e.wparam=0)and(PopupMenu is class(TPopUpmenu))then + begin + r := PopupMenu.dispatch(e); + if r then + begin + e.canvas := nil; + exit; + end + end + ctrl := getwndbyhwnd(e.hwndItem); + if ctrl then + begin + e.message := CN_DRAWITEM; + h := e.hwnd; + try + ctrl.Perform(const e); + except + end; + e.hwnd := h; + e.message := WM_DRAWITEM; + end + //if dcid then + // "\r\nrestor:",_wapi.RestoreDC(dc,-1); + e.canvas := nil; + // _wapi.ReleaseDC(Handle,Canvas.handle); + end + function WMMEASUREITEM(o,e):WM_MEASUREITEM;virtual; + begin + {** + @ignore() %% + @explan(˵) Ϣ %% + @param(o)()ؼ %% + @param(e)(TMMEASUREITEM)Ϣ %% + **} + if(e.wparam=0 and e.ctltype=ODT_MENU)and(PopupMenu is class(tpopupmenu))and PopupMenu.Dispatch(e)then exit; + for i := 0 to FControls.count-1 do + begin + it := FControls[i]; + if it and it.getid=e.ctlid then + begin + h := e.hwnd; + e.message := CN_MEASUREITEM; + it.Perform(e); + e.message := WM_MEASUREITEM; + e.hwnd := h; + return; + end + end + end + function WMNOTIFY(o,e):WM_NOTIFY;virtual; + begin + {** + @explan(˵) ӿؼ֪ͨؼ %% + @param(e)(TMNOTIFY) ֪ͨϢ %% + **} + hd := e.hwndfrom; + if hd then + begin + ctrl := getwndbyhwnd(hd); + if ctrl then + begin + nr := new tuieventbase(CN_NOTIFY,e.code,e.lparam); + ctrl.Perform(nr); + e.skip := nr.skip; + end + end + end + function WMCTLCOLORBTN(o,e):WM_CTLCOLORBTN;virtual; + begin + hd := e.lparam; + if hd then + begin + ctrl := getwndbyhwnd(hd); + if ctrl then + begin + ce := new tuieventbase(CN_CTLCOLORBTN,e.wparam,e.lparam,e.lparam); + ctrl.Canvas.handle := e.lparam; + ctrl.Perform(ce); + if ce.Result then + begin + e.result := ce.result; + e.skip := true; + end + end + end + end + function WMSYSCOMMAND(o,e):WM_SYSCOMMAND;virtual; + begin + //sysmenu.dispatch(); + end + function WMCOMMAND(o,e):WM_COMMAND;virtual; + begin + if(popupmenu is class(tmenu))and popupmenu.dispatch(e)then exit; + hd := e.lparam; + if hd then + begin + ctrl := getwndbyhwnd(hd); + if ctrl then + begin + wp := e.wparam; + ctrl.Perform(new tuieventbase(CN_COMMAND,wp,0)); + end + end + end + function WMKEYDOWN(o,e):WM_KEYDOWN;virtual; + begin + CallMessgeFunction(FOnkeyDown,o,e); + if e.skip then return; + if HandleAllocated()and(e.wParam=VK_TAB)then + begin + cfoc := _wapi.GetFocus(); + if Handle=cfoc then + begin + if TabStop then //͸ؼ + begin + if Parent then Parent._Send_(WM_KEYDOWN,VK_TAB,e.lparam,nil); + end + end else //ӿؼ һfocus + begin + cts := Controls; + Thec := false; + pc := 0; + for i := 0 to cts.Count-1 do + begin + ci := cts[i]; + if(ci is class(TWinControl))and ci.Enabled and ci.Visible and ci.TabStop and ci.HandleAllocated()then + begin + if ci.Handle=cfoc then //ҵ˵ǰ + begin + Thec := true; + if pc and(ssShift in e.shiftstate)then + begin + pc.SetFocus(); + break; + end + continue; + end + pc := ci; + if Thec then + begin + ci.SetFocus(); + break; + end + end + end + end + end + return KeyDown(o,e); + end + function WMKEYUP(o,e):WM_KEYUP;virtual; + begin + CallMessgeFunction(FOnKeyUp,o,e); + keyup(o,e); + end + function WMCHAR(o,e):WM_CHAR;virtual; + begin + CallMessgeFunction(FOnKeyPress,o,e); + return keypress(o,e); + end + function WMSETFOCUS(o,e):WM_SETFOCUS;virtual; + begin + CallMessgeFunction(FonSetFocus,o,e); + dosetfocus(o,e); + end + function WMKILLFOCUS(o,e):WM_KILLFOCUS;virtual; + begin + CallMessgeFunction(FonKillFocus,o,e); + dokillfocus(o,e); + end + function WMPAINT(O,e):LM_PAINT;virtual; + begin + hd := e.hwnd; + if e.wparam then + begin + PaintHandler(e); + end else + if csCustomPaint in ControlState then + begin + ps := PaintStruct(); + DC := _wapi.BeginPaint(hd,ps._getptr_); + if DC=0 then exit; + try + c := ClientRect; + memdc := dc; +{$ifdef gdipaint} + mdc := _wapi.GetDC(0); + if not mdc then exit; + mbit := _wapi.CreateCompatibleBitmap(mdc,c[2],c[3]); + if not mbit then exit; + memdc := _wapi.CreateCompatibleDC(0); + if not memdc then exit; + oldmp := _wapi.SelectObject(memdc,mbit); +{$endif} + e.wparam := memdc; + if Color then + begin + Dispatch(o,new tuieventbase(LM_ERASEBKGND,memdc,2)); + end + Dispatch(o,e); + e.wparam := 0; + rc := ps.rcpaint; +{$ifdef gdipaint} + _wapi.BitBlt(dc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1],memdc,rc[0],rc[1],SRCCOPY); //_wapi.BitBlt(dc,c[0],c[1],c[2],c[3],memdc,0,0,SRCCOPY); +{$endif} + finally + _wapi.EndPaint(hd,ps._getptr_); +{$ifdef gdipaint} + _wapi.ReleaseDC(0,mdc); + _wapi.SelectObject(memdc,oldmp); + _wapi.DeleteDC(memdc); + _wapi.DeleteObject(mbit); +{$endif} + end + end else + begin +{$ifdef gdipaint} + ctls := Controls; + if not ctls then return; // e.skip := false; + if ctls.Count<1 then return; // e.skip := false ; + flag := true; + for i := 0 to ctls.Count-1 do + begin + ci := ctls[i]; + if ci is class(TGraphicControl)then + begin + flag := false; + break; + end + end + if flag then + begin + return; + end + rec := zeros(4); + _wapi.GetUpdateRect(hd,rec,false); + defaulthandler(e); + dc := _wapi.GetDC(hd); + if not dc then + begin + return e.skip := true; + end + e.wparam := dc; + try + pts := PaintStruct(); + pts._setvalue_("rcpaint",rec); + pts._setvalue_("hdc",dc); + //Perform(e); + Dispatch(o,e); + finally + _wapi.ReleaseDC(hd,dc); + e.wparam := 0; + e.skip := true; + end +{$endif} + end + e.skip := true; + e.result := true; + end + +#!end + function KeyUp(o,e);virtual; + begin + {** + @explan(˵) key ɿ %% + @param(o)(TWinControl) ؼ %% + @Param(e)(TMKEY) Ϣ %% + **} + end + function KeyDown(o,e);virtual; + begin + {** + @explan(˵) key %% + @param(o)(TWinControl) ؼ %% + @Param(e)(TMKEY) Ϣ %% + **} + end + function keypress(o,e);virtual; + begin + {** + @explan(˵) char Ϣ %% + @param(o)(TWinControl) ؼ %% + @Param(e)(TMKEY) Ϣ %% + **} + end + function dosetfocus(o,e);virtual; + begin + {** + @explan(˵) ؼý %% + @param(o)(TWinControl) ؼ %% + @Param(e)(tuieventbase) Ϣ %% + **} + end + function dokillfocus(o,e);virtual; + begin + {** + @explan(˵) ؼʧȥ %% + @param(o)(TWinControl) ؼ %% + @Param(e)(tuieventbase) Ϣ %% + **} + end + protected //ʽ + function SetColor(v);override; + begin + oc := color; + if oc <> v and ifnumber(v)then + begin + inherited; + if HandleAllocated()then invalidaterect(nil,false); + end + end + function SetBitmap(v);override; + begin + if v <> BKBitmap then + begin + inherited; + if HandleAllocated()then invalidaterect(nil,false); + end + end + function Refresh(); + begin + if HandleAllocated()then + begin + _wapi.SetWindowPos(self.Handle,0,0,0,0,0,SWP_DEFERERASE .| SWP_NOMOVE .| SWP_NOSIZE .| SWP_NOZORDER .| SWP_NOSENDCHANGING .| SWP_NOACTIVATE .| SWP_DRAWFRAME); + end + end + procedure PaintControls(DC:HDC;First:TControl); //type_twinctrol + begin + end + procedure PaintHandler(var TheMessage:TLMPaint); //type_twinctrol + begin + PaintWindow(TheMessage.wparam); + //c := ClientRect; + c := array(0,0); //û׼,Ϊ00 20201112 ޸ + rcpaint := PaintStruct().rcpaint; + if sum(rcpaint)<4 then exit; + rgC := _wapi.CreateRectRgn(0,0,10,10); + rga := _wapi.CreateRectRgn(rcpaint[0],rcpaint[1],rcpaint[2],rcpaint[3]); + try + for i := 0 to ControlCount-1 do + begin + it := FControls[i]; + if it is class(TGraphicControl)then + begin + if not(it.Visible)then continue; + itbounds := it.GetBoundsRect(); + if not(intersectrect(itbounds,rcpaint,outrect))then + begin + continue; + end + //rgb := _wapi.CreateRectRgn(itbounds[0],itbounds[1],itbounds[2],itbounds[3]); //ؼ + rgb := _wapi.CreateRectRgn(outrect[0],outrect[1],outrect[2],outrect[3]); //ؼ + _wapi.CombineRgn(rgC,rga,rgb,RGN_AND); //ؼ滭 + bkrg := _wapi.SelectClipRgn(TheMessage.wparam,rgc); //ü + try + pts := it.PaintStruct(); + pts._setvalue_("rcpaint",array(outrect[0]-itbounds[0],outrect[1]-itbounds[1],outrect[2]-itbounds[0],outrect[3]-itbounds[1])); + pts._setvalue_("hdc",TheMessage.wparam); + ne := new tuieventbase(LM_PAINT,TheMessage.wparam,TheMessage.lparam,TheMessage.hwnd); + it.Perform(ne); + _wapi.SetViewportOrgEx(TheMessage.wparam,c[0],c[1],nil); //ָ׼ + finally + _wapi.SelectClipRgn(TheMessage.wparam,bkrg); //ָ + _wapi.DeleteObject(rgb); // + end; + end + end + finally + _wapi.DeleteObject(rga); + _wapi.DeleteObject(rgc); + end; + end + procedure PaintWindow(DC:HDC);virtual; + begin + end + function SetTempCursor(Value);override; + begin + if(Value is class(tcursor))and Value.HandleAllocated()and HandleAllocated()and Enabled and Visible then + begin + return Value.Show(); + end + end + //public + function wstyle(v); + begin + { + @explan(˵)û߻ȡʽ %% + @param(v)(integer)Ϊջȡʽ,Ϊ ʽ%% + @return(integer)ǰʽ + } + if v and ifnumber(v)then + begin + if(v <> __wstyle)and HandleAllocated()then _wapi.SetWindowLongPtrA(FHandle,GWL_STYLE,v); + end else + return __wstyle; + end + function wexstyle(v); + begin + { + @explan(˵)û߻ȡչʽ %% + @param(v)(integer)Ϊջȡʽ,Ϊ ʽ%% + @return(integer)ǰչʽ + } + if v and ifnumber(v)then + begin + if(v <> __wexstyle)and HandleAllocated()then _wapi.SetWindowLongPtrA(FHandle,GWL_EXSTYLE,v); + end else + return __wexstyle; + end + function minuswstyle(v); + begin + { + @explan(˵)޳ʽ %% + @param(v)(integer) ޳ʽ %% + } + if ifnumber(v)then + begin + s := wstyle(); + ns := bitcombination(s,v,2); + if ns <> s then + begin + wstyle(ns); + end + end + end + function appendwstyle(v); + begin + { + @explan(˵)ԭʽ׷ ʽ%% + @param(v)(integer) ׷ӵʽ %% + } + if ifnumber(v)then + begin + s := wstyle(); + ns := bitcombination(s,v,0); + if ns <> s then + begin + wstyle(ns); + end + end + end + function minuswexstyle(v); + begin + { + @explan(˵)޳չʽ %% + @param(v)(integer) ޳ʽ %% + } + if ifnumber(v)then + begin + s := wexstyle(); + ns := bitcombination(s,v,2); + if ns <> s then + begin + wexstyle(ns); + end + end + end + function appendminuswstyple(ap,mi); + begin + { + @explan(˵)and޳ʽ %% + @param(ap)(integer) ӵʽ %% + @param(mi)(integer) ޳ʽ %% + } + if ifnumber(ap)or ifnumber(mi)then + begin + s := wstyle(); + ns := s; + if ifnumber(ap)then ns := bitcombination(ns,ap,0); + if ifnumber(mi)then ns := bitcombination(ns,mi,2); + if ns <> s then + begin + wstyle(ns); + end + end + end + + function appendminuswexstyple(ap,mi); + begin + { + @explan(˵)and޳ʽ %% + @param(ap)(integer) ӵʽ %% + @param(mi)(integer) ޳ʽ %% + } + if ifnumber(ap)or ifnumber(mi)then + begin + s := wexstyle(); + ns := s; + if ifnumber(ap)then ns := bitcombination(ns,ap,0); + if ifnumber(mi)then ns := bitcombination(ns,mi,2); + if ns <> s then + begin + wexstyle(ns); + end + end + end + function appendwexstyle(v); + begin + { + @explan(˵)ԭչʽ׷ ʽ%% + @param(v)(integer) ׷ӵʽ %% + } + if ifnumber(v)then + begin + s := wexstyle(); + ns := bitcombination(s,v,0); + if ns <> s then + begin + wexstyle(ns); + end + end + end + public //ýӿ + function MonitorHandle(); + begin + if HandleAllocated()then + begin + return _wapi.MonitorFromWindow(self.Handle,MONITOR_DEFAULTTONEAREST); + end + return 0; + end + function clienttowindow(x,y); + begin + {** + @explan(˵) ͻ굽ת%% + **} + if WsPopUp and HandleAllocated()then + begin + xy := clienttoscreen(0,0); + rect := zeros(4); + _wapi.GetWindowRect(self.Handle,rect); + nxy := xy-rect[0:1]; + r := array(x,y)+nxy; + return r; + end + return array(x,y); + end + function ClientToScreen(x,y);override; + begin + ps := array(x,y); + if HandleAllocated()then + begin + _wapi.ClientToScreen(self.Handle,ps); + end + return ps; + end + function ScreenToClient(x,y);override; + begin + ps := array(x,y); + if HandleAllocated()then + begin + _wapi.ScreenToClient(self.Handle,ps); + end + return ps; + end + function show(sw); + begin + {** + @explan(˵) ʾ %% + @param(sw)(nil) %% + **} + if ifnil(sw)then sw := SW_SHOW; + if not(sw >= 0)then return; + h := self.Handle; + if SW=SW_SHOW then return Visible := true; + if SW=SW_HIDE then return Visible := false; + _wapi.ShowWindow(h,sw); + class(TControl).Visible := true; + end +function showmodal();virtual; +begin + return DoModal(); +end + function EndModal(endc);virtual; + begin + {** + @explan(˵)رģ̬ %% + @param(endc)(any) Ϊnil ΪEndModalCode %% + **} + if not ifnil(endc)then EndModalCode := endc; +{$ifdef gtkpaint} + if FModaling then + begin + if HandleAllocated()then _wapi.gtk_window_endmodal(self(true)); + FModaling := false; + ExitMessageLoop(); + end + return EndModalCode; +{$endif} + if not FModaling then return EndModalCode; + FModaling := FALSE; + if not HandleAllocated()then return EndModalCode; + _wapi.PostMessageA(0,0,0,0); + if Parent and Parent.HandleAllocated()then + begin + hParentWndt := parent.Handle; + hParentWnd := hParentWndt; + while(hParentWnd) do + begin + hParentWndt := _wapi.GetParent(hParentWnd); + if not hParentWndt then + begin + _wapi.BringWindowToTop(hParentWnd); + end + hParentWnd := hParentWndt; + end + end + return EndModalCode; + end + function UpdateWindow(); + begin + {** + @explan(˵) ˢ´ڿͻ %% + @return(integer) 0 ɹ %% + **} + if HandleAllocated()then return _wapi.UpdateWindow(self.Handle); + end + function SetFocus(); + begin + if HandleAllocated()then + begin + _wapi.SetFocus(self.Handle); + end + end + function DescendantHwnd(hwnd); + begin + { + @explan(˵)жϴھǷΪǰھӴ %% + } + if not _wapi.IsWindow(hwnd)then return 0; + if not HandleAllocated()then return 0; + shd := self.Handle; + wnd := hwnd; + while wnd do + begin + if wnd=shd then return true; + nwnd := _wapi.GetParent(wnd); + wnd := nwnd; + end + return false; + end + function MoveControlOrder(Acomponent,n); + begin + {** + + @explan(˵) ƶؼIJ %% + @param(Acomponent)(tcontrol) ؼ %% + @param(n)(integer) %% + **} + dqid := FControls.IndexOf(Acomponent); + odp := FControls[n]; + if n <> dqid and n >= 0 then + begin + FControls.setorder(dqid,n); + end + if odp is class(TWincontrol)and Acomponent is class(TWincontrol)and(Acomponent.HandleAllocated())and(odp.HandleAllocated())then + begin + _wapi.SetWindowPos(Acomponent.Handle,odp.Handle,0,0,0,0,SWP_NOMOVE .| SWP_NOSIZE); + end + if HandleAllocated()and(Acomponent.Align <> alNone)then + begin + DoControlAlign(); + end + end + function BeginUpDate(); + begin + FUpDateCount++; + end + function IsUpDating(); + begin + return FUpDateCount; + end + function EndUpDate(); + begin + if FUpDateCount>0 then + begin + FUpDateCount--; + DoEndUpDate(); + end + end + function DoEndUpDate();virtual; + begin + if FUpDateCount=0 then + begin + if FPaintRects then + begin + if HandleAllocated()then + begin + ValidFlag := true; + for i,v in FPaintRects do + begin + if ifnil(v)then + begin + _wapi.InvalidateRect2(FHandle,nil,0); + ValidFlag := false; + break; + end + end + if ValidFlag then + begin + for i,v in FPaintRects do + begin + _wapi.InvalidateRect(FHandle,v,f); + end + end + end + FPaintRects := array(); + end + end + end + function InvalidateRect(rec,f);virtual; + begin + {** + @explan(˵)ôЧ %% + @param(rec)(array) Ч,nilʾЧ,array() %% + @param(f)(bool) Ƿػ %% + **} + if HandleAllocated()then + begin + if IsUpDating()then + begin + if not ifarray(FPaintRects)then FPaintRects := array(); + FPaintRects[length(FPaintRects)]:= rec; + return; + end + if not(ifarray(rec)and rec)then r := _wapi.InvalidateRect2(FHandle,nil,f); + else r := _wapi.InvalidateRect(FHandle,rec,f); + return r; + end + end + function ContainsControl(Control:TControl):bool; + begin + while(Control <> nil)and(Control <> Self) do Control := Control.Parent; + return Control=Self; + end + function create(owner);override; //type_twinctrol + begin + inherited; + FUpDateCount := 0; + FTabStop := false; + FControls := new TFpList(); + FBorderStyle := bsNone; + //FTRACKMOUSEEVENT := NEW TTRACKMOUSEEVENT(); + FWsPopUp := false; + FWsSysMenu := false; + FWsCapton := false; + WSSizebox := FALSE; + __wstyle := 0; //ʽ + __wexstyle := 0; //չʽ + FWsDlgModalFrame := false; + //FTtageDrawItem := new TtageDrawItem(); //Ƴ + FWMNCHITTEST := new TWMNCHITTEST(); + FMinWidth := 1; //С + FMinHeigt := 1; + end + function destroy();override; //type_twinctrol + begin + inherited; + end + function Recycling();override; + begin + DestroyHandle(); + //FTtageDrawItem := nil; + FOnClose := nil; + FOnDesinedsel := nil; + FOnDesigDBLClick := nil; + FOnDesinedRclick := nil; + FOnDesignBeginMove := nil; + FOnDesignEndMove := nil; + FOnActivate := nil; + FOnKeyDown := nil; + FOnKeyPress := nil; + FOnKeyUp := nil; + ImageList := nil; + FonSetFocus := nil; + FonKillFocus := nil; + inherited; + end + function RecreateWnd();virtual; + begin + if csDestroying in ComponentState then exit; + if HandleAllocated()then + begin + DestroyHandle(); + HandleNeeded(); + end + end + function CreateWnd();virtual; //type_twinctrol + begin + {** + @explan(˵)ھ %% + **} + //if not(Parent and Parent.HandleAllocated or (self(true) is class(tapplicationwindow))) then exit; + CreateParams(p); + //_wapi.GetSystemMetrics(SM_CXSCREEN) DIV 2; + //˴ + id := 0; + if p.style .& WS_CHILD then id := getid(); + tcc := p.Caption; + stl := p.style; + x := p.x; + y := p.y; + sx := p.width; + sy := p.height; + try + selfid := int64(self(true)); + except + selfid := gettslvariableptr(self(true)); + end; + saveobj := new TGlobalValues(selfid,self(true)); + createwndclass(p); + FDefWndproc := p.subclasswndproc; + tcn := P.WinClassName; + f := _wapi.CreateWindowExA(p.ExStyle,tcn,tcc,stl,x,y,sx,sy,p.WndParent,id,p.happ,selfid); + InitializeWnd(); + if HandleAllocated()then ControlCreateWnd(); + end + protected + function ControlCreateWnd(); + begin + for i := 0 to FControls.count-1 do + begin + item := FControls.geti(i); + if(item is class(TWinControl))then + begin + item.HandleNeeded(); + end + end + end + public + function HandleAllocated(); //type_twinctrol + begin + {** + @explan(˵)ھǷ %% + @param(bool) + **} + //return ifnumber(FHandle) and _wapi.IsWindow(FHandle); + return ifnumber(FHandle)and(FHandle <> 0); + end; + function DestroyHandle();virtual; + begin + {** + @explan(˵)ھ %% + **} + EndModal(); + if HandleAllocated()then + begin + {FTRACKMOUSEEVENT.hwndtrack := handle; + if OnMouseEnter or OnMouseLeave then + begin + FTRACKMOUSEEVENT.dwflags := TME_CANCEL .| TME_HOVER .| TME_LEAVE; + _wapi.TrackMouseEvent(FTRACKMOUSEEVENT._getptr_); + end } + _wapi.DestroyWindow(self.Handle); + end + FHandle := 0; + end + procedure HandleNeeded();virtual; //type_twinctrol + begin + {** + @explan(˵)ھ,Լӿؼ %% + @return(pointer) ھ + **} + {if (not HandleAllocated()) then + begin + if self.Parent = Self then + begin + + end + else begin + if (Parent is class(TWinControl)) then + begin + Parent.HandleNeeded(); + if HandleAllocated() then exit; + end; + end; + CreateHandle(); + end; } + if(not HandleAllocated())and(not(csDestroying in ComponentState))then + begin + if self.Parent=Self then + begin + end else + begin + if {(Parent <> nil)}(Parent is class(TWinControl))then + begin + Parent.HandleNeeded(); + if HandleAllocated()then exit; + end; + end; + CreateHandle(); + end; + end + function SetParent(NewParent);override; //type_twinctrol + begin + if(NewParent=parent)and(NewParent is class(TWinControl))then //wrapcontrolı + begin + if HandleAllocated()and NewParent.HandleAllocated()then + begin + if _wapi.GetParent(self.Handle)=NewParent.Handle then return; + end + end + if NewParent is class(TWinControl)then + begin + //if not CheckNewParent(NewParent) then return ; + //о + callparent := false; + callalocate := false; + if HandleAllocated()and NewParent.HandleAllocated()then + begin + if WsPopUp then + begin + DestroyHandle(); + callalocate := true; + end else + if _wapi.SetParent(FHandle,NewParent.handle)then callparent := true; + end else + if HandleAllocated()and not(NewParent.HandleAllocated())then + begin + DestroyHandle(); + callparent := true; + end else + if not(HandleAllocated())and NewParent.HandleAllocated()then + begin + callparent := true; + callalocate := true; + end else + begin + callparent := true; + end + if callparent then + begin + class(tcontrol).SetParent(NewParent); + if Align <> alNone then + begin + NewParent.DoControlAlign(); + end + end + if callalocate then HandleNeeded(); + end else + begin + if HandleAllocated()then DestroyHandle(); + inherited SetParent(NewParent); + end + end + procedure SetBounds(ALeft,ATop,AWidth,AHeight:integer);override; //type_twinctrol + begin + {** + @explan(˵)ôھ %% + **} + //bonds + OldBounds := BoundsRect; + OldBounds := array(OldBounds[0],OldBounds[1],OldBounds[2]-OldBounds[0],OldBounds[3]-OldBounds[1]); + newbounds := array(ALeft,ATop,AWidth,AHeight); + if not(CompareRect(OldBounds,newbounds))then + begin + inherited; + //class(tcontrol).SetBounds(ALeft, ATop, AWidth, AHeight); + end + end + private //سԱ + FPaintRects; + FUpDateCount; + public + function gethitstyle(x,y); + begin + return FWMNCHITTEST.hitstyle2(self(true),x,y); + end + public //Ϣַ + function MainWndProc(hwnd,message,wparam,lparam);virtual; //type_twinctrol + begin + {** + @explan(˵)ѭ %% + **} + //if message=0x85 and not( WsCaption or border or WsDlgModalFrame) then return ; + e := messagecreater(hwnd,message,wparam,lparam); + e.sender := self(true); + if message=WM_NCCREATE then + begin + FHandle := hwnd; + //echo "\r\nsethandle:",hwnd; + class(TGlobalComponentcache).registerhandle(hwnd,self(true)); + end else + if message=WM_SIZE then + begin + x := e.lolparamsigned(); + if x <> 0 then + begin + //dxsize := x-FClientWdith; + cc := 0; + if FClientWdith <> x then + begin + FClientWdith := x; + cc := true; + end + y := e.hilparamsigned(); + //dysize := y-FClientHeight; + if FClientHeight <> y then + begin + FClientHeight := y; + //cc := true; + end + if true then + begin + DoControlAnchor(); + DoControlAlign(); + end + end + end else + if message=WM_MOVE then + begin + x := e.lolparamsigned(); + if FClientLeft <> x then FClientLeft := x; + y := e.hilparamsigned(); + if FClientTop <> y then FClientTop := y; + end else + //if message = WM_MOUSEMOVE then + if message=WM_NCHITTEST then // + begin + {if OnMouseEnter or OnMouseLeave then + begin + FTRACKMOUSEEVENT.hwndtrack := hwnd; + FTRACKMOUSEEVENT.dwflags := TME_HOVER .| TME_LEAVE; + FTRACKMOUSEEVENT.dwhovertime := 600; + _wapi.TrackMouseEvent(FTRACKMOUSEEVENT._getptr_); + end } + end else + if message=WM_STYLECHANGED then + begin + if e.wparam=GWL_EXSTYLE then + begin + __wexstyle := e.stylenew; + end else + begin + __wstyle := e.stylenew; + end + end + (**else + if message = WM_NCCALCSIZE then + begin + if e.wparam=1 then + begin + dt := new tNCCALCSIZE_PARAMS(e.lparam)._getvalue_("rgrc"); + if dt[0]=-32000 then + begin + //echo "\r\nص"; + end + else if dt[4] = -32000 then + begin + //echo "\r\nӹ"; + end + else + begin + //rect1 := dt[0:3]; + //rect2 := dt[4:7]; + //rect3 := dt[8:]; + {dx := dt[2]-dt[0]-(dt[6]-dt[4]); + dy := dt[3]-dt[1]-(dt[7]-dt[5]); + __clientsize := array(dt[10]-dt[8]+dx,dt[11]-dt[9]+dy); + x := __clientsize[0]; + dxsize := x-FClientWdith; + if FClientWdith<> x then FClientWdith := x; + y := __clientsize[1]; + dysize := y-FClientHeight; + if FClientHeight <> y then FClientHeight := y; + DoControlAnchor(array(dxsize,dysize)); + DoControlAlign(array(0,0,x,y));} + //__oldclientsize := array(dt[10]-dt[8],dt[11]-dt[9]); + end + + end + else + begin + //echo "\r\n++++calc:",caption,tostn(new tcrect(e.lparam)._getdata_); + end + //echo "\r\ncalcsize:",o.caption,"****",e.wparam; + //echo "\r\nleft:", new tcrect(e.lparam).left; + end + **) + WndProc(const e); + if not(e.skip)then + begin + ret := defaulthandler(e); + end else + begin + {$ifdef linuxgtk} + if WM_NCHITTEST=e.msg then return e.Result; + return true; + {$endif} + ret := e.Result; + end + return ret; + end + function DesigningSizer();virtual; + begin + {** + @explan(˵) ģʽǷԵС %% + @return(bool) + **} + return true; + end + function DesigningClick();virtual; + begin + {** + @explan(˵) ģʽǷӦԭеĵϢ %% + @return(bool) + **} + return false; + end + function DesigningMove();virtual; + begin + {** + @explan(˵) ģʽǷƶ %% + @return(bool) + **} + return true; + end + function HitWindowborder(o,e,hit);virtual; + begin + if not(WsSizeBox)and DesigningSizer()and(Align=alNone)then + begin + e.Result := hit; + e.skip := true; + end + end + private //,Ϣ + FClickTime; + FClickPos; + public //Ϣַ + procedure WndProc(e);override; //type_twinctrol + begin + //WM_NCHITTEST + if (csDesigning in ComponentState) then + begin + msg := e.msg; + if msg = WM_NCHITTEST then + begin + + r := FWMNCHITTEST.hitstyle(self(true),e); + if r<>HTCLIENT then + begin + HitWindowborder(self(true),e,r); + end else + begin + return e.Result := Wnddefaulthandler(e); + end + end else + if msg= WM_LBUTTONDOWN then + begin + if not(WsCaption) and DesigningMove() and (Align=alNone) then + begin + _Send_(WM_NCLBUTTONDOWN,HTCAPTION,0,0); + e.skip := true; + end + CallMessgeFunction(OnDesignClick,self(true),e); + //ԭеĵϢ + {if DesigningClick() then + begin + CallMessgeFunction(FOnMouseUp,self(true),e); + end } + end else + if msg = WM_LBUTTONDBLCLK then + begin + CallMessgeFunction(OnDesignDBLClick,self(true),e); + end else + if msg = WM_RBUTTONDOWN then + begin + CallMessgeFunction(OnDesignRClick,self(true),e); + end + end + inherited; + end; + procedure DoControlAlign({rect});override; + begin + {** + @explan(˵) ؼ %% + **} + if not HandleAllocated()then exit; + if not ifarray(rect)then + begin + rect := ClientRect; + {$ifdef linuxgtk} + if Border or WSSizebox or WSDlgModalFrame then //gtk + begin + rect[0]+=1; + rect[1]+=1; + rect[2]-=1; + rect[3]-=1; + end + {$endif} + end + e := new TMALIGN(CN_ALIGN,0,0,0); + E.left := rect[0]; + e.top := rect[1]; + e.width := rect[2]; + e.height := rect[3]; + for i := 0 to ControlCount-1 do + begin + it := Controls[i]; + if it is class(tcontrol)then + begin + //if it.Align=alNone then continue; + it.Dispatch(it,e); + //it.Perform(e); + end + end + end + procedure DoControlAnchor();override; + begin + {** + @explan(˵) ؼê %% + **} + if not HandleAllocated()then exit; + e := new TMANCHOR(CN_ANCHOR,0,0,0); + c := ClientRect; + for i := 0 to ControlCount-1 do + begin + it := Controls[i]; + if not it then continue; + if it.Align <> alNone then continue; + if not ifarray(it.Anchors)then continue; + if it is class(TWinControl)then + begin + if it.WsPopUp then continue; + end + e.prec := c; + it.Dispatch(it,e); + end + end + function Wnddefaulthandler(e); //type_twinctrol + begin + {** + @explan(˵)win32ĬϢ %% + @param(e)(tuieventbase) + **} + r := _wapi.CallWindowProcA(FDefaultProc,e.Hwnd,e.msg,e.wparam,e.lparam); + e.skip := true; + return r; + end + function defaulthandler(e);override; + begin + {** + @explan(˵) ִĬϾ %% + @param(e)(tuieventbase) + **} + r := _wapi.CallWindowProcA(FDefWndproc,e.Hwnd,e.msg,e.wparam,e.lparam); + e.skip := true; + return r; + end + procedure BroadCast(e); + begin + {** + @explan(˵) 㲥Ϣ %% + @param(e)(tuieventbase) + **} + for I := 0 to ControlCount-1 do + begin + Controls[I].WindowProc(e); + if e.skip then Exit; + if not ifnil(e.Result)then Exit; + end; + end; + procedure NotifyControls(Msg); //type_twinctrol + begin + ToAllMessage := new tuieventbase(msg,0,0,0); + Broadcast(ToAllMessage); + end + function _send_(msg,wparam,lparam,f,d);virtual; //type_twinctrol + begin + {** + @explan(˵) Ϣ %% + @param(msg)(integer)Ϣ %% + @param(wparam)(integer)wparam %% + @param(lparam)(integer)lparam %% + @param(param)(bool) true post false send %% + @return(pointer) + + **} + if not(ifnumber(msg)and ifnumber(wparam)and ifnumber(lparam))then + begin + //messagebox("Ϊ,ַ,tslcstructreȻָ!","ʾ",1); + exit; + end + if HandleAllocated()then + begin + if f then + begin + return _wapi.PostMessageA(FHandle,msg,wparam,lparam {$ifdef linux},d {$endif}); + end else + begin + return _wapi.SendMessageA(FHandle,msg,wparam,lparam); + end + end else + begin + e := messagecreater(nil,msg,wparam,lparam); + Perform(e); + return e.result; + end + end + function setwndhandle(h); + begin + {** + @ignore %% + **} + DestroyHandle(); + if _wapi.IsWindow(h)then + begin + ph := _wapi.SetWindowLongPtrA(h,_wapi.GWLP_WNDPROC,getwinprocptr()); + FDefWndproc := ph; + MainWndProc(h,WM_NCCREATE,0,0); + end + end + public //property + property MinWidth:natural read FMinWidth write SetMinWidth; + property MinHeight:natural read FMinHeigt write SetMinHeight; + //property MaxWidth:integer read FMaxWidth write SetMaxWidth; + //property MaxHeight:integer read FMaXHeight write SetMaxHeight; + property BorderStyle read GetBorderStyle write SetBorderStyle; + //property ParentWindow read FParentWindow write SetParentWindow; + property Handle read GetHandle write SetHandle; + property TabStop:bool read FTabStop write SetTabStop; + property ControlCount read GetControlCount; + property OnActivate:eventhandler read FOnActivate write FOnActivate; + property OnClose:eventhandler read FOnClose write FOnClose; + property OnKeyDown:eventhandler read FOnKeyDown write FOnKeyDown; + property OnKeyUp:eventhandler read FOnKeyUp write FOnKeyUp; + property OnKeyPress:eventhandler read FOnKeyPress write FOnKeyPress; + property OnDesignClick read FOnDesinedsel write FOnDesinedsel; + property OnDesignDBLClick read FOnDesigDBLClick write FOnDesigDBLClick; + property OnDesignRClick read FOnDesinedRclick write FOnDesinedRclick; + property WsPopUp:bool read GetWsPopUp write SetWsPopUp; + property WsDlgModalFrame:bool read FWsDlgModalFrame write SetWsDlgModalFrame; + property WsCaption:bool read GetWsCaption write SetWsCaption; + Property WSSizebox:bool read FWsSizeBox Write SetWSsizeBox; + property WSsysMenu:bool read FWsSysMenu write SetWsSysMenu; + property EndModalCode read FModalCode write FModalCode; + property ImageList:tcontrolimagelist read FImageList write SetImageList; + property onKillFocus:eventhandler read FonKillFocus write FonKillFocus; + property onSetFocus:eventhandler read FonSetFocus write fonSetFocus; + private //ģ̬ + property Modaling read FModaling; + {** + @param(BorderStyle)(bsNone|bsSingle) ߿ʽ %% + @param(Handle)(pointer) ھ %% + @param(WsDlgModalFrame)(bool) dlg߿Ч %% + @param(ControlCount)(integer) ӿؼ %% + @param(OnClose)(function[TWincontrol,tuieventbase]) ڹرϢص %% + @param(OnKeyDown)(function[TWincontrol,TMKEY]) »ص %% + @param(OnKeyUp)(function[TWincontrol,TMKEY]) ɿ %% + @param(OnKeyPress)(function[TWincontrol,TMKEY]) ַϢ %% + **} +end +type TSysControl=class(TWincontrol) + {** + @explan(˵) ϵͳƴ,λƺͱ,ӿٶ %% + **} + function Create(AOwner);override; + begin + inherited; + end + function WMPAINT(o,e):WM_PAINT;override; + begin + if not Font.HandleAllocated()then + begin + FontChanged(); + end + end + function WMERASEBKGND(o,e):WM_ERASEBKGND;override; + begin + end +end +type TWinControlWraper=class(TWinControl) + {** + @explan(˵) window,̳и,CreateWnd ע͵ʾдú + ʵڿ(뺬о)tslvclĶ%% + **} + private + FWindowInfo; + protected + function WrapHandle(h); + begin + {** + @explan(˵) ,д CreateWndе %% + **} + oh := Handle; + if _wapi.IsWindow(h)and h <> oh then + begin + if oh then + begin + WMNCDESTROY(self(true),new tsluibase(0,0,0,0)); + end + _wapi.GetWindowInfo(h,FWindowInfo._getptr_); + rc := FWindowInfo.rcwindow; + FLeft := rc[0]; + FTop := rc[1]; + FWidth := rc[2]-rc[0]; + FHeight := rc[3]-rc[1]; + old := _wapi.SetWindowLongPtrA(h,GWLP_WNDPROC,getwinprocptr()); + FDefWndproc := old; + class(TGlobalComponentcache).registerhandle(h,self(true)); + Handle := h; + end + end + public + function Create(AOwner);override; + begin + inherited; + FWindowInfo := new TWINDOWINFO(); + end + function WMNCDESTROY(o,e):WM_NCDESTROY;override; + begin + if HandleAllocated()then + begin + h := Handle; + _wapi.SetWindowLongPtrA(h,GWLP_WNDPROC,FDefWndproc); + class(TGlobalComponentcache).unregisterhandle(h); + end + inherited; + end + function CreateWnd();override; + begin + {** + @explan(˵) дú + //************ù************************* + CreateParams(p); // + tcc := p.Caption; // + stl := p.style; + x := p.x; //± + y := p.y; //ϱ + w := p.width;// + h := p.height; //߶ + phandle := p.WndParent; //ھ + //***************************** + //**************************************** + //************************************ + WrapHandle(thandle); // + //************ʼ************************* + InitializeWnd(); //ʼ + ControlCreateWnd(); //Ӵھ + **} + end +end +type TCustomControl=class(TWinControl) + {** + @explan(˵) Իƴڿؼ %% + **} + private + FOnPaint:TNotifyEvent; + protected + procedure PaintWindow(DC:HDC);override; + begin + //odh := canvas.Handle; + Canvas.Handle := dc; + Canvas.ClipRect := PAINTSTRUCT().rcpaint(); + try + Paint(); + finally + Canvas.Handle := odh; + end; + end + procedure Paint();override; + begin + inherited; + if datatype(FOnPaint)=7 then call(FOnPaint,self(true)); + end + public + function Create(AOwner:TComponent);override; + begin + inherited; + includestate(FControlState,csCustomPaint); + //FCanvas := new tcanvas(); + end + function CreateParams(p);override; + begin + inherited; + //p.style .|= WS_CLIPSIBLINGS .| WS_CLIPCHILDREN; + end + function Recycling();override; + begin + FOnPaint := nil; + inherited; + end + function DoVScroll(o,e);virtual; + begin + end + function DoHScroll(o,e);virtual; + begin + end + public + function WMVScroll(o,e):LM_VScroll;virtual; + begin + return DoVScroll(o,e); + end + function WMHScroll(o,e):LM_HSCROLL;virtual; + begin + return DoHScroll(o,e); + end + property OnPaint:eventhandler read FOnPaint write FOnPaint; + {** + @param(OnPaint)(function[TCustomControl,tuieventbase]) ڹرϢص %% + **} +end; + +type TCustomScrollControl = class(TCustomControl) + {** + @explan(˵) Իƴ %% + **} + private + FLocalX;//ˮƽ׼ + FLocalXold; + FLocalY;//ֱ׼ + FLocalYold; + FSI; //ṹ + FAutoScroll; //Զ + FThumbTrack; //thunmtrack + FWhileStep ;// + function SetAutoScroll(v); + begin + if(v in array(0,1,2,3))and v <> FAutoScroll then + begin + FAutoScroll := v; + InitialScroll(); + end + end + + function SetWhileStep(v); + begin + if not v>=1 then return ; + nv := integer(v); + if FWhileStep=nv then return ; + FWhileStep := nv; + end + protected + function GetXScrollDelta();virtual; //x + begin + {** + @explan(˵) x %% + **} + return 10; + end + function GetYScrollDelta();virtual; //y + begin + {** + @explan(˵) y %% + **} + return 10; + end + function GetClientXCapacity();virtual; // + begin + {** + @explan(˵) ͻx %% + **} + return 0; + end + function GetClientYCapacity();virtual; //߶ + begin + {** + @explan(˵) ͻy %% + **} + return 0; //integer((yClient) / FDeltaY); + end + function GetClientXCount();virtual; //ȼ + begin + {** + @explan(˵) ͻx %% + **} + return 0; + end + function GetClientYCount();virtual; //߶ + begin + {** + @explan(˵) ͻy %% + **} + return 0; + end + function PositionChanged();virtual; //׼ı + begin + {** + @explan(˵) ׼ıص %% + **} + end + function GetDeltaXpos();virtual; //ˮƽ仯 + begin + r := FLocalX-FLocalXold; + FLocalXold := FLocalX; + return r; + end + function GetDeltaYpos();virtual; //ֱ仯 + begin + r := FLocalY-FLocalYold; + FLocalYold := FLocalY; + return r; + end + function GetXPos();virtual; + begin + return FLocalX; + end + function GetYPos();virtual; + begin + return FLocalY; + end + function SetXpos(x);virtual; + begin + nx := integer(x); + if not HandleAllocated()then return FLocalX := nx; + if nx <> FLocalX then + begin + hwnd := Handle; + FSI.fMask := SIF_POS; //SIF_ALL; + _wapi.GetScrollInfo(hwnd,SB_HORZ,FSI._getptr_); + ypos := FSI.nPos; + hwnd := Handle; + FSI.fMask := SIF_POS; + FSI.nPos := nx; + _wapi.SetScrollInfo(hwnd,SB_HORZ,FSI._getptr_,TRUE); + // ùλãڴڵܲͬһֵ + _wapi.GetScrollInfo(hwnd,SB_HORZ,FSI._getptr_); + if FSI.nPos <> ypos then + begin + FLocalXold := FLocalX; + FLocalX := FSI.nPos; + PositionChanged(); + end + end + end + function SetYpos(y);virtual; + begin + nx := integer(y); + if not HandleAllocated()then return FLocalY := nx; + if nx <> FLocalY then + begin + hwnd := Handle; + FSI.fMask := SIF_POS; //SIF_ALL; + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + ypos := FSI.nPos; + FSI.nPos := nx; + FSI.fMask := SIF_POS; + _wapi.SetScrollInfo(hwnd,SB_VERT,FSI._getptr_,TRUE); + // ùλãڴڵܲͬһֵ + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + if FSI.nPos <> ypos then + begin + FLocalYold := FLocalY; + FLocalY := FSI.nPos; + PositionChanged(); + end + end + end + function InitialScroll();virtual; + begin + if not HandleAllocated()then return; + hwnd := Handle; + // ôֱΧҳСҳСĴϸ + FSI.fMask := SIF_POS .| SIF_RANGE .| SIF_PAGE; + FSI.nMin := 0; + FSI.nPos := FLocalY; //20200709 + FSI.nMax :=(FAutoScroll .& 1)?(GetClientYCount()):0; + FSI.nPage := GetClientYCapacity(); + _wapi.SetScrollInfo(hwnd,SB_VERT,FSI._getptr_,true); + {if FSI.nMax>FSI.nPage then + begin + FLocalYold := FLocalY; + FLocalY := 0; + end else + begin } + FSI.fMask := SIF_POS; + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + FLocalYold := FLocalY; + FLocalY := FSI.nPos; + //end + // ˮƽΧҳСҳСĴϸ + FSI.cbSize := FSI._size_; + FSI.fMask := SIF_RANGE .| SIF_PAGE .| SIF_POS; + FSI.nMin := 0; + FSI.nPos := FLocalX; + FSI.nMax :=(FAutoScroll .& 2)?(GetClientXCount()):0; + FSI.nPage := GetClientXCapacity(); + _wapi.SetScrollInfo(hwnd,SB_HORZ,FSI._getptr_,TRUE); + {if FSI.nMax>FSI.nPage then + begin + FLocalXold := FLocalX; + FLocalX := 0; + end else + begin } + FSI.fMask := SIF_POS; + _wapi.GetScrollInfo(hwnd,SB_HORZ,FSI._getptr_); + FLocalXold := FLocalX; + FLocalX := FSI.nPos; + //end + PositionChanged(); + end + function DoVScroll(o,e);override; + begin + // ôֱϢ + if csDesigning in ComponentState then return; + FSI.fMask := SIF_ALL; + hwnd := e.hwnd; + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + // 浱ǰλãЩбȽ + yPos := FSI.nPos; + case e.lowparam of + // û Home + SB_TOP: + begin + FSI.nPos := FSI.nMin; + end + // û End + SB_BOTTOM: + begin + FSI.nPos := FSI.nMax; + end + // ûϱߵ + SB_LINEUP: + begin + FSI.nPos -= 1; + end + // û±ߵ + SB_LINEDOWN: + begin + FSI.nPos += 1; + end + // ûϱߵĹ + SB_PAGEUP: + begin + //return ; + FSI.nPos -= FSI.nPage; + end + // û±ߵĹ + SB_PAGEDOWN: + begin + //return ; + FSI.nPos += FSI.nPage; + end + // û϶ + SB_THUMBTRACK: + begin + if ThumbTrack then + begin + FSI.nPos := FSI.nTrackPos; + end + end + SB_THUMBPOSITION: + begin + FSI.nPos := FSI.nTrackPos; + end + end + // ùλ + if FSI.nPos=yPos then return; + return SetYpos(FSI.nPos); + FSI.fMask := SIF_POS; + _wapi.SetScrollInfo(hwnd,SB_VERT,FSI._getptr_,TRUE); + // ùλãڴڵܲͬһֵ + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + // ǰıֵбȽϣͬ + FLocalY := FSI.nPos; + if(FSI.nPos <> yPos)then + begin + PositionChanged(); + end + return 0; + end + function DoHScroll(o,e);override; + begin + if csDesigning in ComponentState then return; + FSI.fMask := SIF_ALL; + _wapi.GetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_); + // 浱ǰλãЩбȽ + xPos := FSI.nPos; + case e.lowparam of + // ûߵ + SB_LEFT: + begin + FSI.nPos := FSI.nMin; + end + SB_RIGHT: + begin + FSI.nPos := FSI.nMax; + end + SB_LINELEFT: + begin + FSI.nPos -= 1; + end + // ûұߵ + SB_LINERIGHT: + begin + FSI.nPos += 1; + end + // ûߵĹ + SB_PAGELEFT: + begin + FSI.nPos -= FSI.nPage; + end + // ûұߵĹ + SB_PAGERIGHT: + begin + FSI.nPos += FSI.nPage; + end + // û϶ + SB_THUMBTRACK: + begin + if ThumbTrack then + begin + FSI.nPos := FSI.nTrackPos; + end + end + SB_THUMBPOSITION: + begin + //return ; + FSI.nPos := FSI.nTrackPos; + end + end; + if FSI.nPos=xPos then return; + return SetXpos(FSI.nPos); + // ùλ + FSI.fMask := SIF_POS; + _wapi.SetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_,TRUE); + // ùλãڴڵܲͬһֵ + _wapi.GetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_); + // ǰıֵбȽϣͬ + FLocalX := FLocalX; + FLocalX := FSI.nPos; + if(FSI.nPos <> xPos)then + begin + PositionChanged(); + end + end + function DoMouseWheel(o,e);override; + begin + if csDesigning in ComponentState then return; + hwnd := self.Handle; + FSI.fMask := SIF_ALL; + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + // 浱ǰλãЩбȽ + yPos := FSI.nPos; + dd := 0; + if e.delta<0 and FSI.nMax>yPos then + begin + //dd++; + dd += FWhileStep; + end + if e.delta>0 and FSI.nMin FMaxminbox then + begin + FMaxminbox := nv; + if HandleAllocated()then + begin + if nv then appendwstyle(WS_MAXIMIZEBOX .| WS_MINIMIZEBOX); + else minuswstyle(WS_MAXIMIZEBOX .| WS_MINIMIZEBOX); + end + end + end + function SetFormBorderStyle(NewStyle); + begin + //if FFormBorderStyle = NewStyle then exit; + end + function SetMainMenu(mu); + begin + if FMainMenu <> mu then + begin + OM := FMainMenu; + if OM is class(tmainmenu)then + begin + OM.DestroyHandle(); //ɾ %% + OM.Hwnd := 0; + //if HandleAllocated() then _wapi.SetMenu(self.Handle,0); //ɾIJ˵ + end + if(mu is class(tmainmenu))then + begin + if HandleAllocated()then + begin + mu.Hwnd := handle; + //_wapi.SetMenu(self.Handle,mu.handle); + end + end + FMainMenu := mu; + end + end + function GetWsSysMenu();override; + begin + return true; + end + function SetWsSysMenu(v);override; + begin + end + function SetBorder(v);override; + begin + end + function SetWsPopUp(v);override; + begin + end + function GetWsPopUp();override; + begin + return true; + end + { + function GetWsCaption(v);override; + begin + return true; + end + function SetWsCaption(v);override; + begin + + end } + public + class function MenuBarHeight(); + begin + {** + @explan(˵) ò˵ĸ߶ %% + @return(integer) ߶ %% + **} + return _wapi.GetSystemMetrics(SM_CYMENU); + end + function create(AOwner);override; + begin + inherited; + FFormBorderStyle := bsNone; + caption := "tform"; + rc := _wapi.GetScreenRect(); + wd :=(rc[2]-rc[0])/2; + h :=(rc[3]-rc[1])/2; + FLeft := rc[0]+wd/2; + FTop := rc[1]+h/2; + FHeight := h; + FWidth := wd; + Color := 0x00FFFFFF; + cursor := IDC_ARROW; //OCR_NORMAL; + WsPopUp := true; + FMaxminbox := true; + WsCaption := true; + WSSizebox := true; + end + function WMTIMER(o,e):WM_TIMER;virtual; + begin + //echo "\r\ntimer"; + end + function WMTRAY(o,e):WM_TRAY;virtual; + begin + if not(FTray is class(TTray))then exit; + case e.lParam of + WM_RBUTTONUP: + begin + // + FTray.ShowPopUpMenu(); + end + WM_LBUTTONUP: + begin + if Visible and HandleAllocated()then _wapi.SetForegroundWindow(self.Handle); + CallMessgeFunction(FTray.OnClick,FTray,e); + end + WM_MOUSEMOVE: + begin + CallMessgeFunction(FTray.OnMouseMove,FTray,e); + end + end; + end + function IsContainer(cd);override; + begin + {** + @explan(˵) д÷,Ϊ %% + **} + if cd is class(TComponent)then return Controls.indexof(cd)<0; + return true; + end + function paint();override; + begin + inherited; + end + function WMSYSCOMMAND(o,e):WM_SYSCOMMAND;override; + begin + {** + @explan(˵)ϵͳ˵Ϣ %% + **} + if e.wparam=SC_MINIMIZE then + begin + CallMessgeFunction(OnMinimize,o,e); + end else + begin + inherited; + end + end + function WMCOMMAND(o,e):WM_COMMAND;override; + begin + {** + @explan(˵) command Ϣ + **} + if(FMainMenu is class(TMainmenu))and FMainMenu.dispatch(e)then exit; + trp := traypopmenu(); + if trp and trp.dispatch(e)then exit; + inherited; + end + function wmcreate(o,e):WM_CREATE;override; + begin + inherited; + //echo "\r\ncreate:",o.caption; + end + function WMMEASUREITEM(o,e):WM_MEASUREITEM;override; + begin + if e.wparam=0 and(FMainMenu is class(TMainmenu))and FMainMenu.dispatch(e)then exit; + trp := traypopmenu(); + if trp and trp.dispatch(e)then exit; + inherited; + end + function WMMENURBUTTONUP(o,e):WM_MENURBUTTONUP;override; + begin + if(FMainMenu is class(TMainmenu))and FMainMenu.dispatch(e)then exit; + trp := traypopmenu(); + if trp and trp.dispatch(e)then exit; + inherited; + end + function WMMENUSELECT(o,e):WM_MENUSELECT;override; + begin + if(FMainMenu is class(TMainmenu))and FMainMenu.dispatch(e)then exit; + trp := traypopmenu(); + if trp and trp.dispatch(e)then exit; + inherited; + end + function WMINITMENUPOPUP(o,e):WM_INITMENUPOPUP;override; + begin + if(FMainMenu is class(TMainmenu))and FMainMenu.dispatch(e)then exit; + trp := traypopmenu(); + if trp and trp.dispatch(e)then exit; + inherited; + end + function WMDRAWITEM(o,e):WM_DRAWITEM;override; + begin + if e.wparam=0 and(FMainMenu is class(tmainmenu))then + begin + e.canvas := canvas; + canvas.handle := e.hdc; + r := FMainMenu.Dispatch(e); + e.canvas := nil; + if r then exit; + end + trp := traypopmenu(); + if e.wparam=0 and trp then + begin + e.canvas := canvas; + canvas.handle := e.hdc; + r := trp.Dispatch(e); + e.canvas := nil; + if r then exit; + end + inherited; + end + function createparams(p);override; + begin + inherited; + p.WinClassName := "tsui_form"; //"tsui_form"; + //p.style :=( p.style .| WS_TILEDWINDOW );// .& (.! ( WS_CHILD));//WS_GROUP .| WS_TABSTOP .| + p.style .|= WS_OVERLAPPED .| WS_SYSMENU .| WS_POPUP .| WS_MINIMIZEBOX .| WS_MAXIMIZEBOX; + p.style := bitcombination(p.style,WS_CHILD .| WS_GROUP .| WS_TABSTOP,2); + //P.style .|= WS_CLIPSIBLINGS; + if minmaxbox then + begin + p.style .|= WS_MAXIMIZEBOX .| WS_MINIMIZEBOX; + end else + begin + p.style := bitcombination(p.style,WS_MAXIMIZEBOX .| WS_MINIMIZEBOX,2); + end + P.ExStyle := P.ExStyle .| WS_EX_APPWINDOW; + //p.style :=0xcf0000 .| 0x0008 .| 0x02000000L .|0x04000000L ;//.| WS_VSCROLL .| WS_HSCROLL;// WS_VISIBLE .| WS_POPUP .| WS_CAPTION .| WS_CLIPSIBLINGS .| WS_SYSMENU .| WS_MINIMIZE .| WS_MAXIMIZEBOX; + p.cstyle := CS_HREDRAW .| CS_VREDRAW .| CS_OWNDC .| CS_DBLCLKS; + end + procedure FontChanged(Sender:TObject);override; + begin + if(HandleAllocated())then + begin + _send_(WM_SETFONT,Font.Handle,1); + end else + inherited; + end + function DestroyHandle();override; + begin + if FMainMenu is class(tmainmenu)then + begin + FMainMenu.DestroyHandle(); + end + if FTray is class(TTray)then + begin + FTray.TrayDelete(); + end + inherited; + end + function InitializeWnd();override; + begin + if HandleAllocated()then + begin + if FMainMenu is class(TMainmenu)then + begin + FMainMenu.Hwnd := handle; + end + seticonhandle(); + if FTray is class(TTray)then + begin + FTray.TrayAdd(); + end + end + end + procedure Notification(AComponent:TComponent;Operation:TOperation);override; + begin + {** + @explan(˵) ֪ͨϢ %% + **} + if Operation=opRemove then + begin + if AComponent=FMainMenu then FMainMenu := nil; + if FTray=AComponent then + begin + FTray := nil; + end + end; + inherited; + end; + property OnMinimize:eventhandler read FOnMinimize write FOnMinimize; + property MainMenu:tmainmenu read FMainMenu write SetMainMenu; + property minmaxbox:bool read FMaxminbox write SetMaxMinBox; + {** + @param(MainMenu)(tmainmenu) ˵ %% + @param(OnMinimize)(function[self,tuieventbase]) ˵ %% + **} + property BorderStyle:TFormBorderStyle read FFormBorderStyle write SetFormBorderStyle; + property FormIcon:ticon read GetFormIcon write SetFormIcon; + property Tray:ttray READ FTray write SetTray; + function publishs();override; + begin + return array( + "name","action","caption","cursor","font", + "popupmenu","visible", + "height","width","left","top", + "color","bkbitmap", + "minwidth","minheight","wssizebox","wsdlgmodalframe", + "mainmenu","minmaxbox","formicon","tray", + "onsize","onmove","onmousemove", + "onmousedown","onmouseup", + "onactivate","onclose", + "onkeyup","onkeydown","onkeypress" + ); + end + +end +type TVCForm=class(TForm) + {** + @explan(˵) Ϊȫṩڽӿ %% + **} + function Create(AOwner);override; + begin + inherited; + end +end +type TpanelForm=class(tpanel) + {** + @explan(˵) 崰 ,ʹ %% + **} + protected + function SetWsPopUp(v);override; + begin + if csDesigning in ComponentState then + begin + end else + begin + inherited; + end + end + function GetWsPopUp();override; + begin + if csDesigning in ComponentState then + begin + return true; + end else + begin + return inherited; + end + end + public + function Create(AOwner);override; + begin + inherited; + rc := _wapi.GetScreenRect(); + wd :=(rc[2]-rc[0])/3; + h :=(rc[3]-rc[1])/3; + FLeft := rc[0]+wd/2; + FTop := rc[1]+h/2; + FHeight := h; + FWidth := wd; + wspopup := true; + end + function SetDesigning(f,fc);override; + begin + if f then wspopup := true; + inherited; + end +end +type TDCreateForm=class(TVCForm) + function Create(AOwner);override; + begin + inherited; + Loader.LoadFromTfm(self(true)); + end +end +type TDCreatePanel=class(TpanelForm) + function Create(AOwner);override; + begin + inherited; + Loader.LoadFromTfm(self(true)); + end +end + + //ť +type tbtn = class(TCustomControl) + {** + @explan(˵) ͨť %% + **} + function Create(aowner); + begin + inherited; + Caption:="button"; + Left:=0; + Top:=0; + Width:=94; + Height:=31; + Color := _wapi.GetSysColor(COLOR_MENUBAR); + end + function click();virtual; + begin + {** + @explan(˵)ģťһµIJ%% + **} + if handleAllocated() then _send_(BM_CLICK,0,0); + end + function BMCLICK(o,e):BM_CLICK;virtual; + begin + if csDesigning in ComponentState then return ; + if FdoingClick then return ; + FdoingClick := true; + //try + calldatafunction(onClick,self(true),e); + // finally + FdoingClick := false; + // end; + end + function WMKEYDOWN(o,e);override; + begin + inherited; + case e.CharCode of + 13 : + begin + click(); + end + + end ; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + if not Fbtnstate then + begin + Fbtnstate := true; + InvalidateRect(nil,false); + end + inherited; + end + function WMLBUTTONUP(o,e):WM_LBUTTONUP;override; + begin + if csDesigning in ComponentState then return ; + click(); + if Fbtnstate then + begin + Fbtnstate := 0; + InvalidateRect(nil,false); + end + end + function WMRBUTTONUP(o,e):WMRBUTTONUP;override; + begin + if csDesigning in ComponentState then return ; + click(); + if Fbtnstate then + begin + Fbtnstate := 0; + InvalidateRect(nil,false); + end + end + function dosetfocus(o,e);override; + begin + {** + @explan(˵) ؼý %% + @param(o)(TWinControl) ؼ %% + @Param(e)(tuieventbase) Ϣ %% + **} + inherited; + FBtnfocused := true; + InvalidateRect(nil,false); + end + function dokillfocus(o,e);override; + begin + {** + @explan(˵) ؼʧȥ %% + @param(o)(TWinControl) ؼ %% + @Param(e)(tuieventbase) Ϣ %% + **} + inherited; + FBtnfocused := false; + InvalidateRect(nil,false); + end + + function paint();override; + begin + if Fbtnstate then + begin + PaintMouseDown(); + end else + if FBtnfocused then + begin + paintfocus(self.Canvas,self.ClientRect); + end + rec := GetBtntextRect(); + if not ifarray(rec) then return ; + if not (rec[2]>rec[0] and rec[3]>rec[1]) then return ; + { + AL9_DEFAULT := 0;//0 + AL9_TOPLEFT := 1;//1 + AL9_TOPCENTER := 2 ;//2 + AL9_TOPRIGHT := 3;//3 + AL9_CENTERLEFT := 4 ;//4 + AL9_CENTER := 5 ;//5 + AL9_CENTERRIGHT := 6;//6 + AL9_BOTTOMLEFT := 7 ;//7 + AL9_BOTTOMCENTER := 8;//8 + AL9_BOTTOMRIGHT := 9;//9 + } + df := 0; + case FtextPosition of + 1: df := DT_LEFT; + 2: df := DT_CENTER; + 3: df := DT_RIGHT + 4: df := DT_LEFT .| DT_VCENTER; + 6: df := DT_RIGHT .| DT_VCENTER; + 7: d := DT_BOTTOM .| DT_LEFT; + 8: df := DT_BOTTOM .|DT_CENTER; + 9: df := DT_BOTTOM .| DT_RIGHT; + else + begin + df := DT_CENTER .| DT_VCENTER .| DT_SINGLELINE; + end + end ; + dc := Canvas; + c := caption; + + if ifstring(c) and c then + begin + dc.font := font; + flg := 0; + if not Enabled then + begin + bc := dc.font.color; + dc.font.color := 0xc0c0c0; + flg := 1; + end + dc.drawtext(c,rec,df); + if flg then + begin + dc.font.color := bc; + end + end + + end + function FontChanged(o);override; + begin + inherited; + InvalidateRect(nil,false); + end + function Recycling();override; + begin + inherited; + FonSetFocus := nil; + FonKillFocus := nil; + end + property textPos:AlignStyle9 read FtextPosition write setTextPosition; + property pushLike:bool read FpushLike write setPushLike; + property multiLine:bool read FmultiLine write setMultiLine; + {** + @param(textPos)(member of TAlignStyle9) ıλ%% + @param(pushLike)(bool)ǷΪͨť%% + @param(multiLine)(bool)ıǷΪʾ%% + **} + function publishs();override; + begin + return array("name","action","left","top","width","height", + "align","anchors","caption","font","enabled","visible","bkbitmap","color","tabstop","onclick","onmousemove"); + end + protected + function SetEnabled(v);override; + begin + nv := v?true:false; + if nv<>Enabled then + begin + inherited; + if HandleAllocated() then + InvalidateRect(nil,false); + end + end + function RealSetText(s);override; + begin + bs := caption; + inherited; + if bs = caption then return ; + InvalidateRect(nil,false); + end + function PaintMouseDown();virtual; + begin + r := ClientRect; + dc := Canvas; + bps := dc.pen.style; + {dc.pen.color := rgb(150,200,230); + dc.pen.width := 1; + dc.pen.style := PS_SOLID; + drawrc(dc,r,1);} + paintfocus(dc,r); + dc.pen.style := PS_DOT; + dc.pen.color := rgb(170,220,250); + drawrc(dc,r,4); + dc.pen.style := bps; + end + private + function paintfocus(dc,r); + begin + dc.pen.color := rgb(150,200,230); + dc.pen.width := 1; + dc.pen.style := PS_SOLID; + drawrc(dc,r,1); + end + function drawrc(dc,r,n); + begin + r[0] += n; + r[2] -= n; + r[1] += n; + r[3] -= n; + dc.moveto(r[array(0,1)]); + dc.LineTo(r[array(2,1)]); + dc.LineTo(r[array(2,3)]); + dc.LineTo(r[array(1,3)]); + dc.LineTo(r[array(0,1)]); + end + function setPushLike(); + begin + + end + function setMultiLine(); + begin + + end + function GetBtnTextRect();virtual; + begin + return ClientRect; + end + function setTextPosition(n); + begin + if not ifnumber(n) or n<0 or n>9 then + n:=0; + else + n:=integer(n); + if FtextPosition=n then return ; + FtextPosition:=n; + InvalidateRect(nil,false); + end + private + FBtnfocused; + FdoingClick; + FpushLike; + FmultiLine; + FtextPosition; + Fbtnstate; +end +type tcheckbtn=class(tbtn) + {** + @explan(˵) ѡ %% + **} + //BM_SETCHECK + public + function create(aowner);override; + begin + inherited; + FcheckState:=0; + FleftText:=0; + end + function click();override; + begin + FcheckState := not FcheckState; + _send_(BM_SETCHECK,FcheckState,0 ); + inherited; + end + function paint();override; + begin + inherited; + drawchekd(FCheckRect); + end + function BMSETCHECK(o,e):BM_SETCHECK;virtual; + begin + FcheckState := e.wparam; + InvalidateRect(nil,false); + end + property checked:bool read FcheckState write setChecked; + property leftText:bool read FleftText write setLeftText; + function publishs();override; + begin + return array("name","left","top","width","height", + "caption","anchors","enabled","color","visible","font", + "textpos","checked","lefttext","tabstop","onclick","onmousemove","onmousedown","onmouseup"); + end + {** + @param(checked)(integer)ѡ״̬ + 0δѡС + 1ѡС + @param(leftText)(bool)ıǷ%% + **} + private + FleftText; + FcheckState; + FCheckRect; + private + function drawchekd(r);virtual; + begin + if r then + begin + dc := Canvas; + dc.pen.style := PS_SOLID; + dc.brush.color := rgb(200,0,0); + dc.Draw("framecontrol",array(r[0:1],r[2:3]),DFC_BUTTON,(checked)?DFCS_CHECKED:DFCS_BUTTONCHECK); + end + end + function setChecked(v);virtual; + begin + nv := v?true:false; + if nv<>FcheckState then + begin + FcheckState := nv; + if handleAllocated() then _send_(BM_SETCHECK,FcheckState,0); + end + end + function setLeftText(v); + begin + nv := v?true:false; + if FleftText<>nv then + begin + FleftText := nv; + InvalidateRect(nil,false); + end + end + function GetBtnTextRect();virtual; + begin + r := ClientRect; + h := r[3]-r[1]; + dh := integer( (h-16)/2)+1; + if FleftText then + begin + FCheckRect := array(r[2]-18,r[1]+dh,r[2]-2,r[3]-dh); + r[2] -=20; + end else + begin + FCheckRect := array(r[0]+2,r[1]+dh,r[0]+18,r[3]-dh); + r[0] +=20; + end + return r; + end +end +type tradiobtn = class(tcheckbtn) + {** + @explan(˵)radiobtnѡťؼ + **} + public + function create(owner);override; + begin + inherited; + end + function InitializeWnd();override; + begin + inherited; + ck := checked; + if ck then + _send_(BM_SETCHECK,ck,0); + end + function click();override; + begin + if checked then + begin + _send_(BM_CLICK,0,0); + end else + inherited; + end + function BMSETCHECK(o,e):BM_SETCHECK;override; + begin + t := e.wparam; + inherited; + if t then + begin + p := parent ; + ctls := p.Controls; + for i := 0 to ctls.count-1 do + begin + ci := ctls[i]; + if ci is class(tradiobtn) then + begin + if ci=self(true) then continue; + if ci.checked then + begin + ci.checked := false; + end + end + end + end + end + private + function drawchekd(r);override; + begin + if r then + begin + dc := Canvas; + dc.pen.style := PS_SOLID; + dc.brush.color := rgb(200,0,0); + dc.Draw("framecontrol",array(r[0:1],r[2:3]),DFC_BUTTON,DFCS_BUTTONRADIO); + if checked then + begin + r2 := array(r[0:1]+3,r[2:3]-3); + dc.brush.color := 0; + dc.draw("ellipse",r2); + end + end + end +end + type TPopMenuBtn=class(TBtn) + {** + @ignore() %% + @explan(˵) ˵İť %% + **} + private + FInfo; + public + function Create(AOwner);override; + begin + inherited; + caption := "menubtn"; + end + function SetInfo(info); + begin + if FInfo=info then exit; + mu := nil; + if ifarray(info)then + begin + mu := new TPopUpMenu(self); + mu.caption := info["caption"]; + CreateMenu(mu,info["menus"]); + FInfo := info; + end + PopUpMenu := mu; + end + function BMCLICK(o,e):BM_CLICK;override; + begin + DoClick(o,e); + end + property PopupMenu:tpopupmenu read GetPopUpMenu write SetPopUpMenu; + private + function SetPopUpMenu(p); + begin + if p is class(TPopUpmenu)then + begin + caption := p.caption; + end + class(TBtn).PopupMenu := p; + end + function GetPopUpMenu(); + begin + return class(TBtn).PoPupMenu; + end + function ContextMenu(o,e);override; + begin + e.skip := true; + end + function DoClick(o,e); + begin + xy := array(0,height+1); + xy := clienttoscreen(xy[0],xy[1]); + if PopupMenu is class(TPopUpmenu)then + begin + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + _wapi.TrackPopupMenu(PopupMenu.Handle,uf,xy[0],xy[1],0,self.Handle,nil); + end + end + function CreateMenu(o,info); + begin + for i,v in info do + begin + if ifarray(v)then + begin + mi := new TMenu(o); + mi.caption := v["caption"]; + mi.onclick := v["onclick"]; + mi.Bitmap := v["bitmap"]; + mi.parent := o; + CreateMenu(mi,v["menus"]); + end + end + end +end +type teditable = class(TSLUIBASE) + private + FInsertState; + FReadOnly; + FLineWrap; + FString; + FCaretX; + FLeftCharCount; + Flimitlength; + + FSelBegin; + FSelLength; + + FCanShowCaret; + FFontWidth; + FFontHeight; + FCaretY; + FMouseLbuttonDown; + FHafChar; // + FBorder; + ////////////////////// + FHost; // + FHostDc; + FClientRect; + FFont; + FVisible; + function SetVisible(v); + begin + nv := v?true:false; + if nv<>FVisible then + begin + FVisible := nv; + if not(FVisible) and FSetFocused then + begin + KillFocus(); + InvalidateRect(nil,false); + end + CalcFontSize(); + end + end + function SetFont(f); + begin + if f then + begin + FFont := f; + if FCanShowCaret and FHost and FHost.HandleAllocated() and FHost.Handle=_wapi.GetFocus() then + begin + recreateCarete(); + return InvalidateRect(nil,false); + end + CalcFontSize(); + InvalidateRect(nil,false); + updatecaret(); + end + end + function InvalidateRect(rec,flg); + begin + if FHost and FHost.HandleAllocated() then + begin + FHost.InvalidateRect(rec?rec:FClientRect,flg); + end + end + function SetHost(host); + begin + if FHost=host then return ; + ohost := FHost; + FHost := nil; + if host is class(TWinControl) then + begin + + SetFont(host.font); + FHost := host; + end else + begin + if ohost then ohost.InvalidateRect(GetEntryRect(),false); + end + end + function SetBorder(v); + begin + n := v?true:false; + if n<>FBorder then + begin + FBorder := n; + InvalidateRect(nil,false); + end + end + Function Setplaceholder(p); + begin + if p and ifstring(p) and Fplaceholder<>p then + begin + Fplaceholder := p; + if FHost and not(FString) and FHost.HandleAllocated() then InvalidateRect(nil,false); + end + end + function recreateCarete(); + begin + DestroyCaret(); + CreateCaret(); + end + function CreateCaret(); // + begin + if not(FReadOnly) and not(FCanShowCaret) and FHost and FHost.HandleAllocated() then + begin + CalcFontSize(); + h := FFontHeight+4; + hd := FHost.Handle; + _wapi.CreateCaret(hd, nil, 1, h ); + _wapi.ShowCaret(hd); + FCanShowCaret := true; + end + FIsCaretShow := true; + end + function DestroyCaret(); //ٹ + begin + if FCanShowCaret and FHost and FHost.HandleAllocated() then + begin + _wapi.HideCaret(FHost.Handle); + _wapi.DestroyCaret(); + FCanShowCaret := false; + end + FIsCaretShow := false; + end + function updatecaret(); + begin + if FCanShowCaret and FHost and FHost.HandleAllocated() then + begin + rec := GetEntryRect(); + cx := (FCaretX-FLeftCharCount-1)*FFontWidth+rec[0]; + _Wapi.SetCaretPos(cx,FCaretY); + end + end + function InitSel(); + begin + FSelBegin :=FCaretX; + FSelLength := 0; + end + function GetCharPosByX(x); + begin + rc := GetEntryRect(); + cp := FLeftCharCount+ integer((x-rc[0])/FFontWidth+0.4)+1; + if bytetype(FString,cp) =2 then return cp+1; + return cp; + end + function CalcFontSize(); + begin + FFontWidth := font.width; + FFontHeight := font.Height; + rec := GetEntryRect(); + FCaretY := max(0,integer((rec[1]+(rec[3]-rec[1]-FFontHeight)/2))-2); + end + function setReadOnly(v); + begin + nv := v?true:false; + if nv<>FReadOnly then + begin + FReadOnly := nv; + InvalidateRect(nil,false); + end + end + function setEditText(s); + begin + if ifstring(s) and s<>FString then + begin + s1 := filterstring(s); + if s1=fstring then return ; + FString := s1; + if FCaretX=1 then + begin + InitSel(); + InvalidateRect(nil,false); + end + else + MoveCaretTo(1,0); + doOnChange(); + end + end + function setLimitLength(n); + begin + if n>=0 and n<>Flimitlength then + begin + Flimitlength := n; + end + end + + function MoveCaretTo(x_,ifsel); + begin + if x_<1 then x := 1 ; + else + x := min(x_,length(FString)+1); + if x=FCaretX then return ; + rec := GetEntryRect(); + x1 := FLeftCharCount+1;//rec[0]; + fw := font.width; + x2 := integer((rec[2]-rec[0])/fw); + if x(x1+x2) then + begin + FLeftCharCount+=(x-x1-x2); + end + FCaretX := x; + ////////////ʾλ//////////////////// + //_wapi.SetCaretPos(); + if ifsel then + begin + FSelLength := x-FSelBegin; + end else InitSel(); + InvalidateRect(nil,false); + updatecaret(); + end + + function selectall(); + begin + if FString and (FSelBegin<>1 or FSelLength<>length(FString)) then + begin + FSelBegin := 1; + FSelLength := length(FString); + InvalidateRect(nil,false); + end + end + function getselstring(b,e); + begin + if FSelLength<>0 then + begin + x1 := FSelBegin-(FSelLength<0); + X2 :=FSelBegin+FSelLength-(FSelLength>0); + b := min(x1,x2); + e := max(x1,x2); + return FString[b:e]; + end + return ""; + end + function DeleteSel(); + begin + if FSelLength<>0 then + begin + x1 := FSelBegin-(FSelLength<0); + X2 :=FSelBegin+FSelLength-(FSelLength>0); + b := min(x1,x2); + e := min(max(x1,x2),length(FString)); + FString[b:e] := ""; + cx := max(1,min(x1,x2)); + InitSel(); + BeginUpDate(); + InvalidateRect(nil,false); + MoveCaretTo(cx,0); + DeletePerfect(); + EndUpDate(); + doOnChange(); + end + end + function DeletePerfect(); + begin + if FLeftCharCount>0 then + begin + sz := FFontWidth*(length(FString)-FLeftCharCount); + rec := GetEntryRect(); + syl := ((rec[2]-rec[0]-sz)/FFontWidth); + if syl>1 then + begin + FLeftCharCount := max(0,FLeftCharCount-integer(syl)); + updatecaret(); + InvalidateRect(nil,false); + end + end + end + function dodelete(); + begin + if FReadOnly then return ; + if FSelLength<>0 then return deletesel(); + len := length(FString); + if FCaretX<=length(FString) then + begin + if bytetype(FString,FCaretX)=1 then + begin + FString[(FCaretX):(FCaretX+1)]:=""; + end else + begin + FString[(FCaretX):(FCaretX)]:=""; + end + BeginUpDate(); + InvalidateRect(nil,false); + DeletePerfect(); + EndUpDate(); + doOnChange(); + end + end + function BeginUpDate(); + begin + if FHost and FHost.HandleAllocated() then + begin + FHost.BeginUpDate(); + end + end + function EndUpDate(); + begin + if FHost and FHost.HandleAllocated() then + begin + FHost.EndUpDate(); + end + end + function dobackspace(); + begin + if FReadOnly then return ; + if FSelLength<>0 then return deletesel(); + len := length(FString); + if FCaretX>1 then + begin + cx := FCaretX; + if bytetype(FString,FCaretX-1)=2 then + begin + FString[(FCaretX-2):(FCaretX-1)]:=""; + cx-=2; + end else + begin + FString[(FCaretX-1):(FCaretX-1)]:=""; + cx--; + end + BeginUpDate(); + MoveCaretTo(cx,0); + DeletePerfect(); + EndUpDate(); + doOnChange(); + end + end + function GetCBoard(); + begin + if not FCopyer then + begin + FCopyer := new TClipBoard(initializeapplication()); + end + return FCopyer; + end + function CopyToClipboard(); //ѡ + begin + r := getselstring(); + GetCBoard().text := r; + end + function PasteFromClipBoard(); + begin + if readonly then return ; + t := GetCBoard().text; + if t then InsertChar(t); + end + protected + function doOnChange();virtual; + begin + + end + function doonmaxtext();virtual; + begin + + end + function doonsetfocus();virtual; + begin + + end + function doonkillfocus();virtual; + begin + + end + function filterstring(c);virtual; // + begin + s1 := ""; + if ifstring(c) and c then + begin + s1 := replacetext(c,"\r",""); + s1 := replacetext(s1,"\n",""); + s1 := replacetext(s1,"\t"," "); + end + return s1; + end + function PaintBorder();virtual; + begin + if FBorder or (FFocusBorder and FSetFocused) then + begin + + rbc := ClientRect; + if ifarray(rbc) and rbc[2]>rbc[0] and rbc[3]>rbc[1] then + begin + dc := FHost.Canvas; + dc.pen.width := 1; + if FSetFocused then dc.pen.color := rgb(200,150,150); + else + dc.pen.color := rgb(180,180,180); + dc.brush.Color := FHost.Color; + dc.draw("RoundRect",array(rbc[0:1],rbc[2:3],array(3,3))); + end + end + end + function PaintPlaceHolder(rec);virtual; + begin + if not(FString) and Fplaceholder and ifstring(Fplaceholder) then + begin + dc := FHost.Canvas; + bc := dc.font.color ; + dc.font.color := Fplaceholdercolor; + dc.drawtext(Fplaceholder,rec,DT_VCENTER .| DT_SINGLELINE); + dc.font.color := bc; + return true; + end + end + function PaintText(s,rec);virtual; + begin + if FHost and FHost.HandleAllocated() and ifstring(s) and s then + begin + dc := FHost.Canvas; + if not dc.HandleAllocated() then return ; + neb := not(FHost.Enabled) ; + if neb then + begin + dc.font.Color := 0xc0c0c0; + end + if FMarked then + begin + ns := s; + if ifstring(FPassWordChar) and FPassWordChar then vc := FPassWordChar[1]; + else vc := "#"; + for i:= 1 to length(ns) do + begin + ns[i] := vc; + end + dc.drawtext(ns,rec,DT_VCENTER .| DT_SINGLELINE); + end else + dc.drawtext(s,rec,DT_VCENTER .| DT_SINGLELINE); + end + end + public + function create(); + begin + Fplaceholdercolor := rgb(200,200,200); + fselbkcolor := rgb(51,153,255); + freadonlyColor := rgb(240,240,240); + FVisible := true; + FReadOnly := false; + FFocusBorder := true; + FString := ""; + FSelBegin := 1; + FSelLength := 0; + FBorder := true; + FCaretX := 1; + FLeftCharCount := 0;//1; + FFont := new TFont(); + end + function InsertChar(c_);// + begin + if FSelLength<>0 then + begin + dobackspace(); + end + len := length(FString); + c := filterstring(c_); + if not(ifstring(c) and c) then return ; + if Flimitlength>0 then + begin + if Flimitlength<=len then + begin + doonmaxtext(); + return ; + end else + begin + clen := length(c); + nct := Flimitlength-len; + if nct(rc[2]-rc[0]) then return ; + end + if FCaretX=1 then + begin + FString := c+FString; + end else + if FCaretX = length(FString)+1 then + begin + FString +=c; + end else + begin + FString[FCaretX:0]:=c; + end + MoveCaretTo(FCaretX+length(c),0); + doOnChange(); + end + function ExecuteCommand(cmd,pm);virtual; + begin + case cmd of + "echome": + begin + MoveCaretTo(1,pm); + end + "ecend": + begin + MoveCaretTo(length(FString)+1,pm); + end + "ecreadonlycolor": + begin + if pm>0 or pm<0 then freadonlyColor := pm; + return freadonlyColor; + end + "ecselbkcolor": + begin + if pm>0 or pm<0 then fselbkcolor := pm; + return fselbkcolor; + end + "ecplaceholdercolor": + begin + if pm>0 or pm<0 then Fplaceholdercolor := pm; + return Fplaceholdercolor; + end + "ecinsert": + begin + if ifstring(pm) and pm then InsertChar(pm); + end + "ecleft": + begin + if FCaretX>1 then + MoveCaretTo(FCaretX-(1+(bytetype(FString,FCaretX-1)=2)),pm); + end + "ecright": + begin + if FCaretX<=length(FString) then + MoveCaretTo(FCaretX+(1+(bytetype(FString,FCaretX)=1)),pm); + end + "ecselall": + begin + selectall(); + end + "ecsel": + begin + if ifarray(pm) and pm[0]>0 and pm[1]>0 then + begin + MoveCaretTo(pm[0],0); + MoveCaretTo(Pm[1],1); + end + end + "ecclcsel": + begin + if FSelLength<>0 then + begin + InitSel(); + InvalidateRect(nil,false); + end + end + "ecgetsel": + begin + r := getselstring(b,e); + pm := array(b,e); + return r; + end + "ecdelete": + begin + dodelete(); + end + "ecbackspace": + begin + dobackspace(); + end + "eccopy": + begin + CopyToClipboard(); + end + "ecpaste": + begin + PasteFromClipBoard(); + end + "eccut": + begin + CopyToClipboard(); + DeleteSel(); + end + "ecpasswordchar": + begin + if ifstring(pm) and pm then FPassWordChar := pm[1]; + else return FPassWordChar; + end + "ecmarked": + begin + if ifnil(pm) then + begin + return FMarked; + end else + begin + nv := pm?true:false; + if FMarked<>nv then + begin + FMarked := nv; + InvalidateRect(nil,false); + end + end + end + "ecgetposbyx": + begin + if x>=0 or x<0 then + return GetCharPosByX(x); + end + "eccaretpos": + begin + return FCaretX; + end + end; + end + function GetEntryRect();virtual; + begin + r := ClientRect; + if not ifarray(r) then return array(0,0,0,0); + r[0]+=1; + r[2]-=1; + r[1]+=1; + r[3]-=1; + return r; + end + function WMKEYDOWN(o,e);virtual; + begin + fsft := ssShift in e.shiftstate; + fctl := ssCtrl in e.shiftstate; + case e.CharCode of + VK_INSERT: + begin + FInsertState := not FInsertState ; + end + VK_LEFT: + begin + ExecuteCommand("ecleft",fsft); + end + VK_RIGHT: + begin + ExecuteCommand("ecright",fsft); + end + VK_DELETE: + begin + dodelete(); + end + VK_HOME: + begin + ExecuteCommand("echome",fsft); + end + VK_END: + begin + ExecuteCommand("ecend",fsft); + end + ord("C"): + begin + if fctl then + begin + ExecuteCommand("eccopy"); + end + end + ord("V"): + begin + if fctl then + begin + ExecuteCommand("ecpaste"); + end + end + ord("X"): + begin + if fctl then + begin + ExecuteCommand("eccut"); + end + end + ord("A"): + begin + if fctl then selectall(); + end + end + end + function WMCHAR(o,e);virtual; + begin + c := e.CharCode; + case c of + VK_BACK: + begin + return dobackspace(); + end + end + if c<32 then return ; + if FReadOnly then return ; + if c .& 0x80 then + begin + if FHafChar then + begin + InsertChar(FHafChar+e.char); + FHafChar :=""; + end + else + begin + FHafChar := e.char; + end + end else InsertChar(e.char); + end + function FontChanged(o);override; + begin + if FHost and FHost.HandleAllocated() then + begin + if _wapi.GetFocus() = FHost.Handle then + begin + recreateCarete(); + end else + begin + CalcFontSize(); + InvalidateRect(nil,false); + end + end + end + function Paint(); + begin + if not FVisible then return ; + if not(FHost and FHost.HandleAllocated() and FHost.Canvas.HandleAllocated()) then return ; + dc := FHost.Canvas; + dc.font := font; + rec := GetEntryRect(); + if FReadOnly then + begin + dc.brush.color := freadonlyColor; + dc.FillRect(rec); + end + PaintBorder(); + if PaintPlaceHolder(rec) then return ; + fw := FFontWidth; + fh := FFontHeight; + if FSelLength<>0 then //Ӱ + begin + x1 := FSelBegin-FLeftCharCount-1; + if FSelLength>0 then + begin + x2 := x1+ FSelLength; + end else + begin + x2 := x1; + x1 := x2+FSelLength; + end + x1 := max(0,x1); + x2 := max(0,x2); + if x2>x1 then + begin + bc := dc.brush.color; + dc.brush.color := fselbkcolor;////rgb(0,220,220); + rcb := rec; + rcb[0] := x1*fw+rec[0]; + rcb[2] := x2*fw+rec[0]; + if dh>0 then + begin + rcb[1]+= FCaretY; + rcb[3]-= FCaretY; + end + dc.FillRect(rcb); + dc.brush.color := bc; + + end + end + if FLeftCharCount>0 then + begin + if bytetype(FString,FLeftCharCount)=1 then + begin + rec[0]-=fw; + dstr := FString[FLeftCharCount:]; + end else dstr := FString[(FLeftCharCount+1):]; + end else dstr := FString; + PaintText(dstr,rec); + //dc.drawtext(dstr,rec,DT_VCENTER .| DT_SINGLELINE); + end + function MouseUp(o,e); + begin + if not (FHost and FHost.HandleAllocated()) then return ; + FMouseLbuttonDown := false; + _wapi.ClipCursor(0); + end + function MouseMove(o,e); + begin + if not FVisible then return ; + if not (FHost and FHost.HandleAllocated()) then return ; + //move ; + if not FMouseLbuttonDown then return ; + rec := GetEntryRect(); + x := e.xpos; + if xrec[2]-2 then x+=FFontWidth*3; + nx := GetCharPosByX(x); + MoveCaretTo(nx,true); + end + function MouseDown(o,e); + begin + if not FVisible then return ; + if not (FHost and FHost.HandleAllocated()) then return ; + rec := GetEntryRect(); + if not(pointinrect(e.pos,FClientRect)) then return ; + x := e.xpos; + if xrec[0] then + begin + if e.button()= mbLeft then + begin + x := GetCharPosByX(e.xpos); + MoveCaretTo(x,0); + FMouseLbuttonDown := true; + crect := rec; + if FHost then //̶ + begin + ps := array(FHost.clienttoscreen(crect[0],crect[1]),FHost.clienttoscreen(crect[2],crect[3])); + _wapi.ClipCursor(ps); + end + end + if not FIsCaretShow then + return SetFocus(); + end + end + function SetFocus(); + begin + if not FVisible then return ; + FSetFocused := true; + if FHost and FHost.HandleAllocated() then + begin + if _wapi.GetFocus()<>FHost.Handle then return FHost.SetFocus(); + end + CreateCaret(); + updatecaret(); + if FFocusBorder then InvalidateRect(nil,false); + doonsetfocus(); + end + function KillFocus(); + begin + FMouseLbuttonDown := false; _wapi.ClipCursor(0); //뽹㴦 + FSetFocused := false; + DestroyCaret(); + if FFocusBorder then InvalidateRect(nil,false); + doonkillfocus(); + end + function Recycling();override; + begin + FKillFocus := 0; + FOnSetFocus := 0; + FPassWordChar := "#"; + FMarked := 0; + FOnMaxText := 0; + FOnUpdate := 0; + FOnChange := 0; + Fplaceholder := 0; + FHost := nil; + FFont := nil; + inherited; + end + property Visible read FVisible write SetVisible; + property text:string read FString write setEditText; + property onmaxtext:eventhandler read FOnMaxText write FOnMaxText;//eventhandler ޸ + property placeholder:string read Fplaceholder write Setplaceholder; + property readonly:bool read FReadOnly write setReadOnly; + property limitlength:integer read Flimitlength write setLimitLength; + property LineWrap:bool read FLineWrap write FLineWrap; + property Border read FBorder write SetBorder; + property Font read FFont write SetFont; + property ClientRect read FClientRect write FClientRect; // + property host read FHost write SetHost; + property HasFocus read FSetFocused ; + property Focusedborder read FFocusBorder write FFocusBorder; + private + FIsCaretShow; + FKillFocus; + FOnSetFocus; + FPassWordChar; + FMarked; + FOnMaxText; + FOnUpdate; + FOnChange; + Fplaceholder; + FSetFocused; + FFocusBorder; + Fplaceholdercolor; + fselbkcolor; + freadonlyColor; + static FCopyer; +end + //edit +type tedit =class(TCustomControl) +{** + @explan(˵) ı༭ %% + **} + private + FEditable; + type TEntryEditable = class(teditable) + function Create(); + begin + inherited; + end + function doonmaxtext();override; + begin + if host then host.doonmaxtext(); + end + function doOnChange();override; + begin + if host then host.DoChanged(); + end + end + public + function Create(AOwner);override; + begin + inherited; + Left := 10; + Top := 10; + //Ftextalign := 0; + Width := 80; + Height := 25; + FEditable := new TEntryEditable(); + FEditable.host := self(true); + end + function ExecuteCommand(cmd,pm);virtual; + begin + if FEditable then return FEditable.ExecuteCommand(cmd,pm); + end + function SetSel(bgid,edid); + begin + {** + @explan(˵)ѡı %% + @param(bgid)(integer) ʼλ ĬΪ0 %% + @param(edid)(integer) λ ĬΪ峤 %% + **} + + return ExecuteCommand("ecsel",array(bgid+1,edid+1)); + end + function Paint();override; + begin + if FEditable then FEditable.Paint(); + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return ; + + if e.skip then return ; + if FEditable then FEditable.MouseUp(o,e); + inherited; + + end + function MouseMove(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + if FEditable then FEditable.MouseMove(o,e); + inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + + if e.skip then return ; + if FEditable then FEditable.MouseDown(o,e); + inherited; + end + + function dosetfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + if FEditable then + begin + FEditable.SetFocus(); + end + inherited; + end + function dokillfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + if FEditable then + begin + FEditable.killFocus(); + end + inherited; + end + function DoWMSIZE(o,e);override; + begin + if FEditable then + begin + rc := ClientRect; + FEditable.ClientRect := rc; + end + inherited; + end + function keypress(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + if FEditable then + begin + FEditable.WMCHAR(o,e); + end + inherited; + end + function KeyDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + if FEditable then FEditable.WMKEYDOWN(o,e); + inherited; + end + function doonmaxtext(); + begin + calldatafunction(FOnMaxText,self(true),new tuieventbase(0,0,0,0)); + end + function DoChanged(); + begin + calldatafunction(FOnChange,self(true),new tuieventbase(0,0,0,0)); + calldatafunction(FOnUpdate,self(true),new tuieventbase(0,0,0,0)); + end + function FontChanged(sender);override; + begin + inherited; + FEditable.font := Font; + end + function Recycling();override; + begin + inherited; + FOnUpdate := nil; + FOnChange := nil; + fonmaxtext := nil; + if FEditable then FEditable.Recycling(); + FEditable := nil; + end + function publishs();override; + begin + return array("name","align","anchors","font","enabled","popupmenu","visible","height","width","left","top","text","placeholder" + ,"readonly","limitlength","linewrap","tabstop","onmousemove","onpopupmenu","onmousedown","onmouseup","onkeyup" + ,"onkeydown","onkeypress","onmaxtext","onkillfocus","onsetfocus","onchange"); + end + property text:string read getentrytext write setentrytext; + property onmaxtext:eventhandler read Fonmaxtext write fonmaxtext; + property onupdate read FOnUpdate write FOnUpdate; + property onchange read FOnChange write FOnChange; + property readonly:bool read getReadOnly write setReadOnly; + property limitlength:integer read getlimitlength write setLimitLength; + property LineWrap:bool read getLineWrap write setLineWrap; + property placeholder:string read getplaceholder write Setplaceholder; + property Border read getBorder write SetBorder; + {** + @param(LineWrap)(bool)Զ,ĬΪfalseԶ%% + @param(onmaxtext)(fpointer)ﵽıص%% + @param(onupdate)(fpointer)ı»ص%% + @param(onchange)(fpointer)ııص%% + @param(readonly)(bool)ֻ%% + @param(onlimitlength)(integer)ַij%% + **} + private + function getBorder(); + begin + if FEditable then return FEditable.Border; + end + function setBorder(s);override; + begin + if FEditable then return FEditable.Border := s; + end + function getentrytext(); + begin + if FEditable then return FEditable.text; + return ""; + end + function setentrytext(s); + begin + if FEditable then return FEditable.text := s; + end + function getplaceholder(); + begin + if FEditable then return FEditable.placeholder; + end + function setplaceholder(v); + begin + if FEditable then return FEditable.placeholder := v; + end + function getReadOnly(); + begin + if FEditable then return FEditable.readonly; + end + function setReadOnly(v); + begin + if FEditable then return FEditable.readonly := v; + end + function getlimitlength(); + begin + if FEditable then return FEditable.limitlength; + end + function setLimitLength(n); + begin + if FEditable then return FEditable.limitlength := n; + end + function getLineWrap(); + begin + if FEditable then return FEditable.LineWrap; + end + function setLineWrap(v); + begin + if FEditable then return FEditable.LineWrap := v; + end + FOnUpdate; + FOnChange; + fonmaxtext; +end +type tpassword = class(tedit) + {** + @explan(˵) ༭ %% + **} + private + function SetPassWordChar(v); + begin + return ExecuteCommand("ecpasswordchar",v); + end + function getPassWordChar(); + begin + return ExecuteCommand("ecpasswordchar"); + end + public + function create(owner);override; + begin + inherited; + ExecuteCommand("ecmarked",true); + Left := 10; + Top := 10; + Width := 80; + Height := 25; + caption := "tpassword"; + end + function KeyDown(o,e);override; + begin + if ( ssCtrl in e.shiftstate) and (ord("C")=e.CharCode) then + begin + return ; + end + inherited; + end + property PassWordChar:string read getPassWordChar write SetPassWordChar; + function publishs();override; + begin + return array("name", + "align","anchors","font", + "popupmenu","visible", + "height","width","left","top", + "text","placeholder","readonly","limitlength","tabstop", + "passwordchar","onmousemove","onpopupmenu", + "onmousedown","onmouseup", + "onkeyup","onkeydown","onkeypress", + "onmaxtext","onkillfocus","onsetfocus","onchange"); + end + end +type tmemo = class(TSynMemoNorm) + uses UTslMemo; + {** + @explan(˵) ıؼ %% + **} + function create(aowner); + begin + inherited; + Left := 10; + Top := 10; + Width := 150; + Height := 90; + GutterCharCnt := 0; + Border := true; + end + function DoTextChanged(p);override;//ıı + begin + inherited; + end + + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return ; + inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + inherited; + end + function getlinecount(); + begin + return Lines.length(); + end + function getline(i); + begin + ls := lines; + r := ls.GetStringByIndex(i-1); + if ifstring(r) then return r; + return ""; + end + function Recycling();override; + begin + inherited; + Fonchange := nil; + FTabspace := nil; + FLineWrap := nil; + FonSetFocus := nil; + FonKillFocus := nil; + end + public + property onupdate read Fonchange write Fonchange; + property onchange read Fonchange write Fonchange; + property LineWrap read FLineWrap write FLineWrap; + property tabspace read FTabspace write FTabspace; + {** + @param(LineWrap)(bool)Զ,ĬΪfalseԶ%% + @param(onupdate)(fpointer)ı»ص%% + @param(onchange)(fpointer)ııص%% + **} + function publishs();override; + begin + return array("name","font", + "popupmenu","visible", + "height","width","anchors","left","top", + "text","readonly", + "tabspace","onmousewheel","onmousemove","onpopupmenu", + "onmousedown","onmouseup", + "onkeyup","onkeydown","onkeypress", + "onchange"); + end + private + Fonchange; + FLineWrap; + FTabspace; + FonSetFocus; + fonKillFocus; +end + + //goupbox +type tgroupbox = class(TCustomControl) + {** + @explan(˵) groupbox %% + **} + function create(owner);override; + begin + inherited; + Left := 10; + Top := 10; + Width := 185; + Height := 105; + caption := "group"; + Color := rgb(240,240,240); + FtextPosition := 0; + end + function Paint();override; + begin + c := caption; + if Parent and ParentFont then + begin + ft := Parent.Font; + end else + ft := Font; + wf := ft.width; + hf := ft.height+2; + cvs := Canvas; + cvs.pen.color := rgb(170,170,170); + cvs.pen.width := 1; + cwd := 0; + if c then + begin + cwd := wf*length(c)+1; + end + rc := ClientRect; + hf2 := integer(hf/2); + /////////////////////////////////////// + + cvs.moveto(array(3,hf2)); + cvs.LineTo(array(3,rc[3]-3)); + cvs.LineTo(array(rc[2]-3,rc[3]-3)); + cvs.LineTo(array(rc[2]-3,hf2)); + cvs.LineTo(array(3,hf2)); + /////////////////////////////////////// + ///////////////////////////////////////// + + txpos := 10; + if c then + begin + if cwd<(rc[2]-rc[0]-20) then + begin + case FtextPosition of + 2: + begin + txpos := 10+integer((rc[2]-rc[0]-20-cwd)/2); + end + 3: + begin + txpos := rc[2]-rc[0]-10-cwd; + end + + end ; + + end + cvs.pen.color := Color; + cvs.moveto(array(txpos-1,hf2)); + cvs.LineTo(array(txpos+cwd+1,hf2)); + cvs.textout(c,array(txpos,0)); + end + ///////////////////////////////// + end + property textPos:AlignStyle9 read FtextPosition write setTextPosition ; + function publishs();override; + begin + return array("name","left","top","width","height", + "align","anchors","border","caption","color","enabled","font","visible","textpos","wsdlgmodalframe"); + end + private + function setTextPosition(n); + begin + if ( n in array(0,1,2,3)) and n<>FtextPosition then + begin + FtextPosition := n; + InvalidateRect(nil,false); + end + end + FtextPosition; +end +type TCheckGroupBox=class(TRadioGroupBox) + {** + @explan(˵) checkgroupbox %% + @ignore() %% + **} + private + FItemIndexs; + function GetSelected();virtual; + begin + return GetItemByIndex(FItemIndexs); + end + function SetItemIndex();override; + begin + end + function GetItemIndexs(); + begin + r := array(); + k := 0; + for i,v in FItemIndexs do + begin + if ifstring(GetItemByIndex(v))then + begin + r[k++]:= v; + end + end + return r; + end + function SetItemIndexs(v); + begin + if v=FItemIndexs then exit; + FItemIndexs := array(); + for i,vi in v do if vi >=-1 then FItemIndexs[k++]:= vi; + if Items then + begin + ReDrawItems(); + end + end + public + function Create(AOwner);override; + begin + inherited; + caption := "check groupbox"; + FItemIndexs := array(); + end + function Drawbox(dc,src,idx);override; + begin + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,(idx in FItemIndexs)?DFCS_CHECKED:DFCS_BUTTONCHECK); + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_BUTTON,(idx in FItemIndexs)?DFCS_CHECKED:DFCS_BUTTONCHECK); + end + function GridClick(o,e);override; + begin + i := e.iitem; + j := e.isubitem; + idx := rctoindex(i,j); + it := GetItemByIndex(idx); + if not(i >= 0 and j >= 0)then exit; + if not ifstring(it)then exit; + if idx in FItemIndexs then + begin + FItemIndexs minus= array(idx); + end else + begin + FItemIndexs union=array(idx); + end + InvalidateSubItem(idx,true); + CallMessgeFunction(OnSelectionChanged,self,e); + end + property ItemIndexs:integers read GetItemIndexs write SetItemIndexs; + function publishs();override; + begin + return array("name","left","top","width","height", + "align","border","ItemIndexs","caption","color","enabled","font", + "minheight","minwidth","parentfont","visible","textpos","wsdlgmodalframe"); + end +end + +type TRadioGroupBox=class(TGroupbox) + {** + @explan(˵) radiogroupbox %% + @ignore() %% + **} + private + FGrid; + FItemIndex; + FColumns; + FRows; + FItems; + FSelectionChanged; + FColumnLayout; + function SetColumnLayout(v); + begin + if FColumnLayout <> V and(v in array(pstHorizontal,pstVertical))then + begin + FColumnLayout := v; + if FColumns>1 and FItems then + begin + ReDrawItems(); + end + end + end + Function SetColumns(n); + begin + if n>0 and n <> FColumns then + begin + FColumns := n; + fcs := array(); + for i := 1 to n do fcs[i-1]:= array("text":" ","width":100); + FGrid.Columns := fcs; + FRows := ceil(length(FItems)/FColumns); + FGrid.ItemCount := FRows; + GRIDsize(FGrid); + end + end + function SetItemIndex(idx);virtual; + begin + if idx>-2 and idx <> FItemIndex then + begin + FItemIndex := idx; + FGrid.InvalidateRect(nil,true); + end + end + function SetItems(v); + begin + its := array(); + k := 0; + for i,vi in v do + begin + if ifstring(vi)then + begin + its[k++]:= vi; + end + end + if FItems=its then exit; + FItems := its; + FRows := ceil(length(its)/FColumns); + FGrid.ItemCount := FRows; + GRIDsize(FGrid); + end + protected + function GetControlFont();override; + begin + return FGrid.Font; + end + function SetControlFont(v);override; + begin + if FGrid then + begin + FGrid.font := v; + end + end + function rctoindex(i,j); + begin + if FColumnLayout=pstHorizontal then return i * Columns+j; + return idx := j * FRows+i; + end + function indextorc(idx,i,j); + begin + case FColumnLayout of + pstHorizontal: + begin + j := idx mod FColumns; + i := idx div FColumns; + end + pstVertical: + begin + i := idx mod FRows; + j := idx div FRows; + end + end; + end + function ReDrawItems(); + begin + if FGrid and FGrid.HandleAllocated()and FItems then FGrid.InvalidateRect(nil,true); + end + function GetSelected();virtual; + begin + return GetItemByIndex(array(FItemIndex)); + end + public + function SetItemByIndex(idx,v); + begin + if not ifstring(v)then exit; + s := GetItemByIndex(idx); + if ifstring(s)then FItems[idx]:= v; + return 1; + end + function GetItemByIndex(idx); + begin + if ifarray(idx)then + begin + r := array(); + k := 0; + for i,v in idx do + begin + vi := call(thisfunction,v); + if ifstring(vi)then r[v]:= vi; + end + return r; + end else + if ifnumber(idx)then return FItems[idx]; + end + function SetDesigning(f,fc);override; + begin + {** + @explan(˵) ʹ÷,Ϊ״̬,߽״̬ %% + @param(f)(bool) ״ֵ̬ %% + @param(fc)(bool) Ƿ޸ӿؼ״̬ %% + **} + inherited; + if not FGrid then exit; + if f then + begin + FGrid.Enabled := false; + end else + FGrid.Enabled := true; + end + function create(AOwner);override; + begin + inherited; + caption := "radio groupbox"; + color := _wapi.GetSysColor(COLOR_WINDOW); + FRows := 0; + FColumnLayout := pstHorizontal; + border := true; + FGrid := new TDrawGrid(self); + FGrid.border := false; + FGrid.ColumnHeader := false; + FGrid.GridLine := false; + FGrid.MouseSizeCell := 0; + FItems := array(); + FItemIndex :=-1; + FGrid.Onclick := thisfunction(GridClick); + FGrid.parent := self; + FGrid.onsize := thisfunction(GRIDsize); + FGrid.OnDoDrawSubItem := thisfunction(DrawGrid); + SetColumns(1); + end + function DoControlAlign();override; + begin + cr := ClientRect; + cr[1]+= 20; + cr[0]+= 2; + cr[2]-= 2; + cr[3]-= 2; + if FGrid then FGrid.SetBoundsRect(cr); + end + function InitializeWnd();override; + begin + if csDesigning in ComponentState then + begin + FGrid.enabled := false; + end + end + function GRIDsize(o,e); + begin + if length(FItems)<1 then exit; + wd := floor((o.width-4)/(FColumns)); + if wd<22 then exit; + for i := 0 to FColumns-1 do + begin + o.SetColumnWidth(i,wd); + end + end + function Drawbox(dc,src,idx);virtual; + begin + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,(idx=FItemIndex)?DFCS_BUTTONRADIOIMAGE:DFCS_BUTTONRADIO); + dc.Draw("framecontrol",array(src[0:1],src[2:3]),DFC_BUTTON,(idx=FItemIndex)?DFCS_BUTTONRADIOIMAGE:DFCS_BUTTONRADIO); + end + function DrawGrid(o,e); + begin + i := e.itemid; + j := e.subitemid; + idx := rctoindex(i,j); + it := FItems[idx]; + if not ifstring(it)then exit; + rc := e.SubItemRect; + dc := e.canvas; + //src := array(rc[0]+1,rc[1]+1,rc[0]+18,rc[1]+18); + tp :=(rc[3]-rc[1])/2+rc[1]-7; + src := array(rc[0]+1,tp,rc[0]+15,tp+14); + Drawbox(dc,src,idx); + src := array(rc[0]+19,rc[1]+1,rc[2],rc[3]); + dc.font := o.font; + class(TLabel).CanvasDrawAlignText(dc,src,it,AL9_CENTERLEFT); + e.skip := true; + end + function InvalidateSubItem(idx,f); + begin + indextorc(idx,i,j); + rec := FGrid.GetSubItemRect(i,j); + FGrid.invalidaterect(rec,f); + end + function GridClick(o,e);virtual; + begin + i := e.iitem; + j := e.isubitem; + idx := rctoindex(i,j); + it := FItems[idx]; + if not(i >= 0 and j >= 0)then exit; + if not ifstring(it)then exit; + odx := FItemIndex; + if FItemIndex=idx then + begin + exit; + end else + FItemIndex := idx; + if odx >= 0 then + begin + InvalidateSubItem(odx,false); + end + if FItemIndex >= 0 then + begin + InvalidateSubItem(FItemIndex,true); + end + CallMessgeFunction(OnSelectionChanged,self,e); + end + function SetItemText(i,c); + begin + {** + @explan(˵) ޸ %% + @param(i)(integer) %% + @param(c)(string) ı %% + **} + vi := FItems[i]; + if ifstring(c)and vi <> c then + begin + FItems[i]:= c; + InvalidateSubItem(i,true); + end + end + function DeleteItem(i); + begin + vi := FItems[i]; + if ifstring(vi)then + begin + nits := FItems; + reindex(nits,array(i:nil)); + Items := nits; + end + end + property OnSelectionChanged:eventhandler read FSelectionChanged write FSelectionChanged; + property Columns:integer read FColumns write SetColumns; + property ItemIndex:integer read FItemIndex write SetItemIndex; + property Items:strings read FItems write SetItems; + property Selected read GetSelected; + property ColumnLayout:SplitterType read FColumnLayout write SetColumnLayout; + function publishs();override; + begin + r := array("name","left","top","width","height", + "align","border","ItemIndexs","caption","color","enabled","font", + "minheight","minwidth","parentfont","visible","textpos","wsdlgmodalframe","onselectionchanged"); + return r; + end + {** + @param(OnSelectionChanged)(function[TRadioGroupBox,tuieventbase]) ѡıʱص %% + @param(Columns)(integer) %% + @param(ItemIndex)(integer) ѡĿ%% + @param(Items)(array of string) Ŀǩ%% + + **} +end + //listbox +type TCustomListBox=class(TCustomScrollControl) + {** + @explan(˵) listbox + **} + private + FItemCount; + FMaxItemWidth; + protected /////////////////////////////////////////////////////////// + function GetClientXCapacity();virtual; // + begin + r := integer(ClientRect[2]/GetXScrollDelta()); + return r; + end + function GetClientYCapacity();virtual; //߶ + begin + return integer(ClientRect[3]/GetYScrollDelta()); + end + function GetClientXCount();virtual; //ȼ + begin + return FMaxItemWidth; + end + function GetClientYCount();virtual; //߶ + begin + return FItemCount-1; + end + function GetXScrollDelta();override; + begin + return FFontWidth; + end + function GetYScrollDelta();override; + begin + return FFontHeight+4; + end + function PositionChanged();virtual; + begin + InvalidateRect(nil,false); + end + private + function PaintLines(FirstLine,LastLine); + begin + cvs := Canvas; + for i := FirstLine to LastLine do + begin + rc := GetIdxRect(i); + PaintIdx(i,rc,cvs); + end + end + public + function Create(AOwner);override; + begin + inherited; + FMaxItemWidth := 1; + FItemCount := 0; + FFontHeight := font.Height; + FFontWidth := font.Width; + left := 0; + top := 0; + height := 100; + width := 125; + autoscroll := 1; + ThumbTrack := true; + FScroolChanged := false; + end + function UpDateScrollBar(); //ı + begin + DoControlAlign(); + end + function IncPaintLock(); //ˢ + begin + BeginUpdate(); + end + function DecPaintLock(); //ͷˢ + begin + EndUpdate(); + end + function DoEndUpDate();override; //ˢͷ + begin + if not(IsUpDating())then + begin + if FScroolChanged then + begin + FScroolChanged := false; + return UpDateScrollBar(); + end + end + inherited; + end + function paint();override; + begin + xpos := GetXpos(); + ypos := GetYPos(); + // Ҫػ + ps := PAINTSTRUCT().rcPaint; + tp := ps[1]; + bo := ps[3]; + FirstLine := integer(max(0,yPos+(tp)/GetYScrollDelta())); + LastLine := integer(min(FItemCount-1,yPos+(bo)/GetYScrollDelta())); + cvs := Canvas; + cvs.Font := font; + PaintLines(FirstLine,LastLine); + end + function MouseUp(o,e);override; + begin + if e.Button()=mbLeft then + begin + calldatafunction(onclick,o,e); + end + e.skip := true; + end + function MouseDown(o,e);override; + begin + if e.Button()=mbLeft and e.shiftdouble()then + begin + CallDataFunction(ondblclick,o,e); + e.skip := true; + end + end + function PaintIdx(idx,rc,cvs);virtual; + begin + {** + @explan(˵) %% + @param(idx)(integer) %% + @param(rc)(array) %% + @param(cvs)(tcanvas) %% + **} + end + function InvalidateIdxRect(idx,cnt);virtual; + begin + if idx >= 0 and idx= 1)then cnt := 1; + rc := ClientRect; + y := GetYPos(); + dy := GetYScrollDelta(); + idxtop :=(idx-y)* dy; + if idxtop >= rc[3]then + begin + return; + end + if(idxtop+cnt * dy)<= 0 then + begin + return; + end + rc[1]:= idxtop; + rc[3]:= min(rc[3],idxtop+cnt * dy); + InvalidateRect(rc,false); + end + end + function GetIdxByYpos(y);virtual; + begin + py := GetYPos(); + r := integer(y/GetYScrollDelta())+py; + if r >= FItemCount then return-1; + return r; + end + function GetIdxRect(idx);virtual; + begin + {** + @explan(˵)ͨŻ %% + @param(idx)(integer) %% + @return(array) array() %% + **} + if idx >= 0 then + begin + rc := ClientRect; + yp := GetYPos(); + xp := GetXpos(); + DY := GetYScrollDelta(); + rc[1]:=(idx-yp)* DY; + rc[0]:=(0-xp)* GetXScrollDelta(); + rc[3]:= rc[1]+DY; + return rc; + end + return array(); + end + function InsureIdxInClient(idx); //ȷָ + begin + {** + @explan(˵)ȷָ %% + @param(idx)(integer) %% + **} + rc := GetIdxRect(idx); + c := ClientRect; + if rc[1]c[3]then + begin + SetYpos(1+GetYPos()+(rc[3]-c[3]+1)/GetYScrollDelta()); + end + end + function GetClientIdxs();virtual; + begin + {** + @explan(˵)ÿͻ %% + @return(array) %% + **} + rc := ClientRect; + r := GetRectIdxs(rc); + return r[0]-> r[1]; + end + function doControlALign();override; + begin + if(IsUpDating())then + begin + FScroolChanged := true; + end else + begin + FMaxItemWidth := GetMaxItemWidth(); + InitialScroll(); + end + end + function EnsureIdxVisible(idx); + begin + if idx >= FItemCount then idx := FItemCount-1; + if not(idx >= 0)then return; + rc := ClientRect; + idxs := GetRectIdxs(rc); + if idx <= idxs[0]then + begin + SetYpos(idx); + end else + if idx >= idxs[1]then + begin + ndx := integer((rc[3]-rc[1])/GetYScrollDelta()); + SetYpos(idx-ndx); + end + end + function FontChanged(o);override; + begin + wd := font.width; + h := font.Height; + if h <> FFontHeight or wd <> FFontWidth then + begin + FFontHeight := h; + FFontWidth := wd; + UpDateScrollBar(); + end + end + function GetItemCount();virtual; + begin + return FItemCount; + end + property ItemCount read GetItemCount write SetItemCount; + property ItemHeight read GetYScrollDelta; + {** + @param(ItemCount)(integer) %% + **} + protected + function SetItemCount(n);override; + begin + if not(n >= 0)then return; + nn := integer(n); + if nn <> FItemCount then + begin + FItemCount := nn; + UpDateScrollBar(); + end + end + private + FFontHeight; + FFontWidth; + FScroolChanged; //޸ + function GetRectIdxs(rc); + begin + yp := GetYPos(); + tp := rc[1]; + bo := rc[3]; + FirstLine := integer(tp/GetYScrollDelta())+yp; + LastLine := integer((bo)/GetYScrollDelta())+yp; + return array(FirstLine,LastLine); + end + function GetMaxItemWidth();virtual; + begin + return 1; + end +end +type TListBox = class(TCustomListBox) + {** + @explan(˵) listboxؼ %% + **} + function Create(AOwner);override; + begin + inherited; + border := true; + FitemData := new TMyArrayB(); + FSelBegin :=-1; + FSelEnd :=-1; + FMultisel := false; + end + function MouseUp(o,e);override; + begin + if FIsMouseDown then + begin + _wapi.clipcursor(ps); + FIsMouseDown := false; + selchange := 0; + case FMultisel of + 0: + begin + selchange := FFormerSelBegin <> FSelBegin; + end + 1: + begin + selchange :=((FFormerSelBegin <> FSelBegin)or(FFormerSelEnd <> FSelEnd))and((FFormerSelBegin <> FSelEnd)or(FFormerSelEnd <> FSelBegin)); + end + 2: + begin + selchange := 1; + end + end; + if selchange then calldatafunction(FselectionChange,o,e); + end + inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return; + if(e.Button()=mbLeft)and not(e.shiftdouble())then + begin + FFormerSelBegin := FSelBegin; + FFormerSelEnd := FSelEnd; + idx := GetIdxByYpos(e.ypos); + IncPaintLock(); + if FMultisel=2 then + begin + if FMultisel3Data[idx]then Reindex(FMultisel3Data,array(idx:nil)); + else FMultisel3Data[idx]:= not FMultisel3Data[idx]; + InvalidateIdxRect(idx); + end else + if idx <> FSelBegin and idx <> FSelEnd then + begin + SelRange(false); + FSelBegin := FSelEnd := idx; + SelRange(true); + end + DecPaintLock(); + FIsMouseDown := true; + crect := ClientRect; + ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3])); + _wapi.clipcursor(ps); + end else + FIsMouseDown := false; + inherited; + end + function MouseMove(o,e);override; + begin + if FIsMouseDown then + begin + rc := ClientRect; + y := e.ypos; + dy := GetYScrollDelta(); + if y>rc[3]-4 then + begin + y += dy; + end else + if y<4 then + begin + y -= dy; + end + idx := GetIdxByYpos(y); + if idx<0 then return; + if FMultisel=2 then + begin + end else + if idx <> FSelEnd then + begin + IncPaintLock(); + SelRange(false); + if FMultisel=1 then FSelEnd := idx; + else + begin + FSelBegin := FSelEnd := idx; + end + SelRange(true); + DecPaintLock(); + end + EnsureIdxVisible(idx); + end + end + function PaintIdx(idx,rc,cvs);virtual; + begin + {** + @explan(˵) %% + @param(item)(TCustomListItem) %% + @param(rc)(array) %% + @param(cvs)(tcanvas) %% + **} + PaintIdxBkg(idx,rc,cvs); + PaintIdexText(idx,rc,cvs); + end + function PaintIdexText(idx,rc,cvs);virtual; + begin + cvs.DrawText(getItemText(idx),rc,DT_NOPREFIX); + end + function getCurrentSelection();virtual; + begin + {** + @explan(˵)ȡǰѡڵѡб%% + **} + if FMultisel=0 then + begin + return FSelBegin; + end + return-1; + end + function setCurrentSelection(n);virtual; + begin + {** + @explan(˵)õǰѡڵѡб%% + @param(n)(integer)%% + **} + if FMultisel=1 then + begin + if isValidIndex(n)then + begin + FSelBegin := FSelEnd := n; + InvalidateRect(nil,false); + end else + if ifarray(n)and isValidIndex(n[1])and isValidIndex(n[0])then + begin + FSelBegin := MinValue(n); + FSelEnd := MaxValue(n); + end + return; + end else + if FMultisel=2 then + begin + FMultisel3Data := array(); + if isValidIndex(n)then + begin + FMultisel3Data[n]:= true; + end else + if ifarray(n)then + begin + for i,v in n do + begin + if isValidIndex(v)then + begin + FMultisel3Data[v]:= true; + end + end + end + return; + end + if not isValidIndex(n)or n=FSelBegin then return; + SelRange(false); + FSelBegin := FSelEnd := n; + SelRange(true); + calldatafunction(FselectionChange,self(true),new tuieventbase(0,0,0,0)); + end + function getItemSelectedState(n); + begin + {** + @explan(˵)ȡָѡ״̬%% + @param(n)(integer)ָ±%% + @return(bool)Ƿѡ%% + **} + if not isValidIndex(n)then return nil; + case FMultisel of + 0: + begin + return n=FSelBegin; + end + 1: + begin + if FSelBegin <= FSelEnd then return n >= FSelBegin and n <= FSelEnd; + return n >= FSelEnd and n <= FSelBegin; + end + 2: + begin + return FMultisel3Data[n]=1; + end + end + return nil; + end + function setItemSelectedState(n,state); + begin + {** + @explan(˵)ָѡ״̬ڷѡб%% + @param(n)(integer)ָ%% + @param(state)(bool)״̬%% + **} + b := state?1:0; + if FMultisel <> 2 or not isValidIndex(n)or b=getItemSelectedState(n)then return; + if b then FMultisel3Data[n]:= b; + else reindex(FMultisel3Data,array(n:nil)); + calldatafunction(FselectionChange,self(true),new tuieventbase(0,0,0,0)); + InvalidateIdxRect(n); + end + function appendItem(item);virtual; + begin + {** + @explan(˵)бһ%% + @param(item)(string)Ҫӵַ%% + @return(integer)бе%% + **} + if CheckListItem(item)then + begin + FitemData.Push(item); + class(TCustomListBox).ItemCount := FitemData.length(); + return ItemCount-1; + end + return-1; + end + function appendItems(ari);virtual; + begin + {** + @explan(˵)бӶ%% + @param(ari)(array)Ҫӵַɵ%% + @return(integer)ӵһбе%% + **} + if CheckListItems(ari)then + begin + FitemData.Pushs(ari); + class(TCustomListBox).ItemCount := FitemData.length(); + return ItemCount-1; + end + return-1; + end + function insertItem(item,n);virtual; + begin + {** + @explan(˵)ָһ%% + @param(item)(string)ַ%% + @param(n)(integer)ָ±%% + @return(integer)زַ±꣬򷵻-1%% + **} + if ifnil(n)then return appendItem(item); + if FitemData.Length()<1 then return appendItem(item); + if isValidIndex(n)and CheckListItem(item)then + begin + SelectedChangeSwitch(n,1,1); + FitemData.splice(n,0,item); + class(TCustomListBox).ItemCount := FitemData.length(); + return n; + end + return-1; + end + function insertItems(ari,n);virtual; + begin + {** + @explan(˵)ָúڶѡб򽫻ᵼѡʧ%% + @param(ari)(array of string)ɵ%% + @param(n)(integer)ָ±ȱʡĩβ%% + @return(integer)زַ±꣬򷵻-1%% + **} + if ifnil(n)then return appendItems(ari); + if FitemData.Length()<1 then return appendItems(item); + if CheckListItems(ari)and isValidIndex(n)then + begin + SelectedChangeSwitch(n,length(ari),1); + FitemData.splices(n,0,ari); + class(TCustomListBox).ItemCount := FitemData.length(); + return n+length(ari)-1; + end else + return-1; + end + function deleteItem(n);override; + begin + {** + @explan(˵)ɾָĺϷ±%% + @param(n)(integer)ָ±%% + @return(integer)ʣ򷵻-1%% + **} + if not isValidIndex(n)then return-1; + SelectedChangeSwitch(n,1,0); + FitemData.splice(n,1); + class(TCustomListBox).ItemCount := FitemData.length(); + return FitemData.Length(); + end + function deleteItems(n,cnt); + begin + {** + @explan(˵)ɾָĺϷ±괦ʼ%% + @param(n)(integer)ָ±%% + @param(cnt)(integer)ɾɾβʱɾβ%% + @return(integer)ʣ򷵻-1%% + **} + if not isValidIndex(n)or cnt <= 0 then return-1; + SelectedChangeSwitch(n,cnt,0); + FitemData.splice(n,cnt); + class(TCustomListBox).ItemCount := FitemData.length(); + return FitemData.Length(); + end + function DeleteSelectedItems(); + begin + {** + @explan(˵) ɾѡеĿ %% + **} + if FMultisel=2 then + begin + if FMultisel3Data then + begin + r := array(); + ri := 0; + for i := 0 to FitemData.length()-1 do + if not FMultisel3Data[i] then r[ri++]:= FitemData[i]; + setdata(r); + end + end else + begin + if FSelBegin >= 0 and FSelEnd >= FSelBegin then + deleteItems(const FSelBegin,FSelEnd-FSelBegin+1); + end + end + function findStrBeginwith(str,b,n);virtual; + begin + {** + @explan(˵)бַָ֮ͷĩβͷʼ%% + @param(str)(string)ַ%% + @param(b)(bool)1:ִСд0:ִСд%% + @param(n)(integer)ָ±꣬ĬΪ-1%% + @return(integer)ҵ±꣬δҵ򷵻-1%% + **} + if ifnil(b)then b := 0; + if ifnil(n)then n :=-1; + if CheckListItem(str)and ifnumber(n)then + begin + if not isValidIndex(n)then n :=-1; + if b then + begin + return findBeginwithCaseIndepent(str,n); + end else + return findBeginwith(str,n); + end + ShowErrorMessage("function findStrBeginwith:ErrorParameter(s)"); + return-1; + end + function findStrExact(str,b,n);virtual; + begin + {** + @explan(˵)бַָ֮ͬĩβͷʼ%% + @param(str)(string)ַ%% + @param(b)(bool)1:ִСд0:ִСдĬΪ0%% + @param(n)(integer)ָ±꣬ĬΪ-1%% + @return(integer)ƥʧ򷵻-1%% + **} + if ifnil(b)then b := 0; + if ifnil(n)then n :=-1; + if CheckListItem(str)and ifnumber(n)then + begin + if not isValidIndex(n)then n :=-1; + if b then return findExactCaseIndepent(str,n); + else return findExact(str,n); + end + ShowErrorMessage("function findStrExact:ErrorParameter(s)"); + return-1; + end + function setData(ari);virtual; + begin + IncPaintLock(); + Clean(); + AppendItems(ari); + DecPaintLock(); + end + function getSelectedIndexes();virtual; + begin + {** + @explan(˵)ȡбڵǰѡɵ%% + @return(array)δѡκʱؿ%% + **} + r := array(); + case FMultisel of + 0: + begin + return FSelBegin=-1?r:array(FSelBegin); + end + 1: + begin + if FSelBegin<0 then return r; + if FSelBegin <= FSelEnd then return FSelBegin -> FSelEnd; + else return FSelEnd -> FSelBegin; + end + 2: + begin + ri := 0; + for i,v in FMultisel3Data do r[ri++]:= i; + return r; + end + end + end + function getItem(n); + begin + {** + @explan(˵)ȡָ%% + @param(n)(integer)ָ±%% + @return()ָ%% + **} + return FitemData[n]; + end + function getItemText(i);virtual; + begin + {** + @explan(˵) itemı %% + @param(i)(integer) %% + @return(string) ʾַ %% + **} + r := FitemData[i]; + if ifstring(r)then return r; + return ""; + end + function clean();virtual; + begin + FitemData.splice(0,FitemData.Length()); + cleanAllSelectedState(); + class(TCustomListBox).ItemCount := 0; + end + function Recycling();override; + begin + FselectionChange := nil; + return inherited; + end + property ItemCount read GetItemCount; + property Multisel:bool read FMultisel write SetMultisel; + property onSelectionChange:eventhandler read FselectionChange write FselectionChange; + property Items:strings read GetData write setData; + function publishs();override; + begin + return array("name","caption","anchors","align","enabled", + "font","visible","border","color", + "height","width","left","top","items", + "multisel","popupmenu","wsdlgmodalframe", + "onmousedown","onmouseup", + "onselectionchange" + ); + end + protected + function CheckListItems(s); + begin + if ifarray(s)then + begin + for i := 0 to length(s)-1 do if not CheckListItem(s[i])then return 0; + return 1; + end else + return 0; + end + function CheckListItem(s);virtual; + begin + {** + @explan(˵) ,д÷Կ %% + **} + return ifstring(s); + end + function isValidIndex(n); + begin + return(n >= 0)and n= min(FSelBegin,FSelEnd)and idx <= max(FSelBegin,FSelEnd))or(FMultisel=2 and FMultisel3Data[idx])then + begin + cvs.brush.Color := rgb(204,231,255); + end else + cvs.Brush.Color := Color; + cvs.FillRect(rc); + end + function SetMultisel(n); + begin + if n <> FMultisel and(n in array(0,1,2))then + begin + SelRange(false); + FSelBegin := FSelEnd :=-1; + if n=2 then + begin + FMultisel3Data := array(); + end + FMultisel := n; + end + end + function GetData(); + begin + return FitemData.Data; + end + function findBeginwith(str,n); + begin + len := class(TCustomListBox).ItemCount; + while i++<> len do if AnsiStartsStr(str,getItem((i+n)%len))then return(i+n)%len; + return-1; + end + function findBeginwithCaseIndepent(str,n); + begin + len := class(TCustomListBox).ItemCount; + while i++<> len do if AnsiStartsText(str,getItem((i+n)%len))then return(i+n)%len; + return-1; + end + function findExact(str,n); + begin + len := class(TCustomListBox).ItemCount; + while i++<> len do if getItem((i+n)%len)=str then return(i+n)%len; + return-1; + end + function findExactCaseIndepent(str,n); + begin + len := class(TCustomListBox).ItemCount; + while i++<> len do if UpperCase(getItem((i+n)%len))=UpperCase(str)then return(i+n)%len; + return-1; + end + function SelRange(sel); + begin + if FSelBegin >= 0 and FSelEnd >= 0 then + begin + InvalidateIdxRect(min(FSelBegin,FSelEnd),abs(FSelBegin-FSelEnd)+1); + end + end + function SelectedChangeSwitch(idx,cnt,isAdd); + begin + case FMultisel of + 0: + begin + SelectedChange(idx,cnt,isAdd); + end + 1: + begin + cleanAllSelectedState(); + end + 2: + begin + MultiSelectedChange(idx,cnt,isAdd); + end + end; + end + function SelectedChange(idx,cnt,isAdd); + begin + //ѡббӻɾʱѡı䶯 + //idx ɾʼ + //cnt Ԫ + //isAdd 1ӣ0ɾ + if FSelBegin= idx+cnt then t := FSelBegin-cnt; + else + begin + t :=-1; + selchange := 1; + end + end + FSelBegin := FSelEnd := t; + if selchange then calldatafunction(FselectionChange,self(true),nil); + end + function MultiSelectedChange(idx,cnt,isAdd); + begin + //Ķѡбӻɾʱѡı䶯 + //idx ɾʼ + //cnt Ԫ + //isAdd 1ӣ0ɾ + d := array(); + if isAdd then + begin + for i,v in FMultisel3Data do if v then d[i >= idx?i+cnt:i]:= 1; + end else + begin + selchange := 0; + back := idx+cnt; + for i,v in FMultisel3Data do if v then + begin + if i= back then d[i-cnt]:= 1; + else selchange := 1; + end + end + FMultisel3Data := d; + if selchange then calldatafunction(FselectionChange,self(true),nil); + end + function cleanAllSelectedState(); + begin + selchange := 0; + if FMultisel=2 then + begin + for i,v in FMultisel3Data do if v then selchange := 1; + FMultisel3Data := array(); + end else + begin + if FSelBegin <>-1 then selchange := 1; + FSelBegin := FSelEnd :=-1; + FFormerSelBegin := FFormerSelEnd :=-1; + end + if selchange then calldatafunction(FselectionChange,self(true),nil); + end + // FselectionCancel; + FselectionChange; + FSelBegin; + FSelEnd; + FIsMouseDown; + FMultisel; + FMultisel3Data; + FFormerSelBegin; + FFormerSelEnd; +end +type TColorbox=class(TListBox) + {** + @explan(˵) color box ؼ %% + **} + public + function create(aOwner);override; + begin + inherited; + arr := array( + ("value":"Black","color":0), + ("value":"Maroon","color":128), + ("value":"Green","color":32768), + ("value":"Olive","color":32896), + ("value":"Navy","color":8388608), + ("value":"Purple","color":8388736), + ("value":"Teal","color":8421376), + ("value":"Gray","color":8421504), + ("value":"Silver","color":12632256), + ("value":"Red","color":255), + ("value":"Lime","color":65280), + ("value":"Yellow","color":65535), + ("value":"Blue","color":16711680), + ("value":"Fuchsia","color":16711935), + ("value":"Aqua","color":16776960), + ("value":"LtGray","color":12632256), + ("value":"DkGray","color":8421504), + ("value":"White","color":16777215), + ("value":"MoneyGreen","color":12639424), + ("value":"SkyBlue","color":15780518), + ("value":"Cream","color":15793151), + ("value":"MedGray","color":10789024)); + setData(arr); + end + function getColor(n); + begin + {** + @explan(˵)ȡָ±ɫֵ%% + @param(n)(integer)ָ±%% + @return(tcolor)ɫֵ%% + **} + r := FitemData[n]; + if ifarray(r)then r := r["color"]; + if ifnumber(r)then return r; + return nil; + end + function getColorName(n); + begin + {** + @explan(˵)ȡָ±ɫ%% + @param(n)(integer)ָ±%% + @return(string)ɫֵ%% + **} + r := FitemData[n]; + if ifarray(r)then r := r["value"]; + if ifstring(r)then return r; + return ""; + end + function addColor(name,clr); + begin + //Ӧʹrgb()ɫֵ + {** + @explan(˵)бβָɫ%% + @param(name)(string)ָɫ%% + @param(clr)(tcolor)ָɫֵ%% + **} + if ifnumber(clr)and ifstring(name)then appendItem(array("value":name,"color":clr)); + end + function AppendColors(d); + begin + {** + @expaln(˵) ׷Ӷ ɫֵ %% + @param(d)(array) "value" "color" ֶ %% + **} + appendItems(d); + end + function CheckListItem(v);override; + begin + return ifarray(v)and ifstring(v["value"])and ifnumber(v["color"]); + end + function PaintIdexText(idx,rc,cvs);override; + begin + rl := integer((rc[3]-rc[1])* 0.15); + rrect := array(rc[0]+rl,rc[1]+rl,rc[0]-rl+rc[3]-rc[1],rc[3]-rl); + cvs.brush.color := getColor(idx); + cvs.fillrect(rrect); + rc[0]+= rc[3]-rc[1]; + cvs.drawtext(getColorName(idx),rc,DT_NOPREFIX); + end + function publishs();override; + begin + return array("name","align","anchors","font", + "visible","border","enabled", + "height","width","left","top", + "wsdlgmodalframe","popupmenu", + "onmousedown","onmouseup", + "onselectionchange" + ); + end + private + multiSel; +end + + //combobox +type TCustomComboBox = class(TCustomControl) + {** + @explan(˵) combox %% + **} + function Create(AOwner);override; + begin + inherited; + FBtnWidth := 20; + FmaxListItemShow := 10; + FScreenRect := _wapi.GetScreenRect(); + FListBox := CreateAlist(); + if FListBox is class(TWinControl)then + begin + //FListBox.Parent := self(true); + FListBox.OnClose := function(o,e) + begin + e.skip := true; + o.Visible := false; + end + end + SetBoundsRect(array(0,0,100,23)); + end + function CreateAlist();virtual; + begin + {** + @expaln(˵) һ %% + @return(twincontrol) %% + **} + return ""; + end + function Paint();override; + begin + rc := ClientRect; + FBtnRect := rc; + dc := canvas; + FBtnRect[0]:= FBtnRect[2]-FBtnWidth; + dc.Draw("framecontrol",array(FBtnRect[0:1],FBtnRect[2:3]),DFC_SCROLL,1); + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return; + x := e.xpos; + y := e.ypos; + if x>FBtnRect[0]and xFBtnRect[1]and y0 then + begin + nv := integer(v); + if nv <> FmaxListItemShow then + begin + FmaxListItemShow := nv; + end + end + end + function SetBtnWidth(n); + begin + if not(n>10 and n<100)then return; + nn := int(n); + if nn <> FBtnWidth then + begin + SetBtnWidth := nn; + InValidateRect(nil,false); + DoControlAlign(); + end + end + function GetItemIndex();virtual; + begin + end + function SetItemIndex();virtual; + begin + end +end +type TColorCombobox=class(TCustomComboBox) + {** + @explan(˵) Tcolorcombobox һɫѡcombobox%% + **} + function Create(AOwner);override; + begin + inherited; + FListBox.visible := false; + FListBox.WsPopUp := true; + FListBox.onSelectionChange := function(o,e) + begin + if o.visible then + begin + ShowDropDown(false); + InvalidateRect(nil,false); + CallDataFunction(OnSelchanged,self(true),e); + end + end + FListBox.Parent := self; + itemindex := 0; + end + function CreateAlist();override; + begin + r := new tcolorbox(self); + return r; + end + function Paint();override; + begin + inherited; + idx := ItemIndex; + if not(idx >= 0)then return; + dc := canvas; + rc := ClientRect; + rc[2]-= BtnWidth; + FListBox.PaintIdx(idx,rc,dc); + return; + cl := getColorValue(idx); + txt := getColorName(idx); + dc.brush.Color := cl; + rc[2]-= BtnWidth; + rc2 := rc; + rc2[2]:= 20; + rc[0]+= 22; + bd := 2; + rc2[0]+= bd; + rc2[1]+= bd; + rc2[2]-= bd; + rc2[3]-= bd; + dc.Draw("rectangle",array(rc2[0:1],rc2[2:3])); + dc.DrawText(txt,rc,DT_VCENTER .| DT_SINGLELINE .| DT_NOPREFIX); + end + function addColor(name,clr); + begin + {** + @explan(˵)ɫ%% + @param(colorName)(string)ɫ"Red"% + @param(colorValue)(integer)ɫֵ%% + **} + FListBox.addColor(name,clr); + end + function AppendColors(d); + begin + {** + @expaln(˵) ׷Ӷ ɫֵ %% + @param(d)(array) "value" "color" ֶ %% + **} + return FListBox.AppendColors(d); + end + function Clean(); + begin + {** + @explan(˵)ɫֵ %% + **} + FListBox.Clean(); + end + function getcurrentColor(); + begin + {** + @explan(˵)ñѡеɫ%% + @return(integer) ɫ %% + **} + idx := ItemIndex; + return getColorValue(idx); + end + function getColorName(id) + begin + {** + @explan(˵)ȡɫ%% + @param(id)(integer)id%% + @return(string)ɫ%% + **} + return FListBox.getColorName(id); + end + function getColorValue(id) + begin + {** + @explan(˵)ȡɫֵ%% + @param(id)(integer)id%% + @return(integer)ɫֵ%% + **} + return FListBox.getColor(id); + end + function publishs();override; + begin + return array("name","anchors","font", + "visible", + "height","width","left","top", + "readonly","itemindex", + "onselchanged","ondropdown","oncloseup"); + end + private + function SetItemIndex(idx);override; + begin + FListBox.SetCurrentSelection(idx); + InvalidateRect(nil,false); + end + function GetItemIndex();override; + begin + return FListBox.GetCurrentSelection(); + end +end +type TComboBox=class(TCustomComboBox) + {** + @explan(˵) comboBox %% + **} + private + type TComboListBox=class(TListBox) + function Create(AOwner); + begin + inherited; + caption := "combox list box"; + end + function MouseUp(o,e);override; + begin + inherited; + visible := false; + end + end + public + function create(AOwner);override; + begin + inherited; + FEdit := new TEdit(self); + FEdit.OnKeyDown := function(o,e) + begin + case e.charcode of + VK_UP: + begin + ItemIndex -= 1; + e.skip := true; + end + VK_DOWN: + begin + ItemIndex += 1; + e.skip := true; + end + end; + end + FEdit.onchange := function(o,e); + begin + if not o.Readonly then + begin + CallDataFunction(Foneditchanged,o,e); + end + end + FEdit.onupdate := function(o,e); + begin + if not o.Readonly then + begin + CallDataFunction(FoneditUpdate,o,e); + end + end + Freadonly := true; + FListBox.Border := true; + FListBox.Visible := false; + FListBox.WsPopUp := true; + FListBox.onselectionchange := function(o,e); + begin + FEdit.Text := getCurrentItemText(); + ShowDropDown(false); + calldatafunction(OnSelchanged,self,true); + end + FEdit.Readonly := Freadonly; + FListBox.parent := self; + FEdit.parent := self; + end + function CreateAlist();override; + begin + r := new TComboListBox(self); + return r; + end + function SetDesigning(Value,SetChildren);override; + begin + inherited; + if FEdit then FEdit.Enabled := not Value; + end + function DoControlAlign();override; + begin + rc := ClientRect; + rc[2]-= 20; + FEdit.SetBoundsRect(rc); + end + function appendItem(str);virtual; + begin + {** + @explan(˵)%% + @param(str)(string) ַ%% + **} + FListBox.appendItem(str); + end + function AppendItems(arr);virtual; + begin + {** + @explan(˵)%% + @param(arr)(array of string) ַ%% + **} + FListBox.appendItems(arr); + end + function insertItem(str,i);virtual; + begin + {** + @explan(˵) %% + @param(str)(string) ʾ %% + @param(i)(integer) iǰ %% + **} + FListBox.insertItem(str,i); + end + function deleteItem(i);virtual; + begin + {** + @explan(˵)ɾ %% + @param(i)(integer) ɾλ %% + **} + FListBox.deleteItem(i); + end + function clean() + begin + {** + @explan(˵) %% + **} + FListBox.Clean(); + end + function getitems(); + begin + {** + @explan(˵) %% + @return(array of string) ַ %% + **} + return FListBox.items(); + end + function GetItem(n); + begin + return FListBox.GetItem(n); + end + function getItemCount(); + begin + {** + @explan(˵)ͳ %% + @return(integer) %% + **} + //return _send_(CB_GETCOUNT,0,0); + return FListBox.ItemCount; + end + function getItemText(i); + begin + {** + @explan(˵)ȡi %% + @param(i)(integer) λ %% + @return(string) %% + **} + return FListBox.getItemText(i); + end + function getCurrentItemText(); + begin + {** + @explan(˵)ȡѡеַ %% + @return(string) ַ %% + **} + return getItemText(FListBox.GetCurrentSelection()); + end + property readonly:bool read Freadonly write setReadOnly; + property textheight read FTextHeight Write FTextHeight; + property itemheight read FItemHeight write FItemHeight; + property items:strings read Getitems write setItems; + property oneditchanged:eventhandler read Foneditchanged write Foneditchanged; + property onEditUpdate:eventhandler read FoneditUpdate write FoneditUpdate; + property onkillfocus read Fonkillfocus write Fonkillfocus; + property onsetfocus read Fonsetfocus write Fonsetfocus; + property Editer read FEdit; + {** + @param(oneditchanged)(function[tcomboBox,tuieventbase])ııص,ıʾ%% + **} + function publishs();override; + begin + return array("name","font","border", + "visible","anchors","align","enabled", + "height","width","left","top", + "readonly","itemindex", + "items","oncloseup","ondropdown","onselchanged","oneditchanged","oneditupdate"); + end + function setReadOnly(v); + begin + nv := v?true:false; + if nv <> Freadonly then + begin + Freadonly := nv; + FEdit.Readonly := nv; + end + end + private + function GetItemIndex();override; + begin + return FListBox.GetCurrentSelection(); + end + function SetItemIndex(idx);override; + begin + return FListBox.SetCurrentSelection(idx); + end + FTextHeight; + FItemHeight; + Freadonly; + Foneditchanged; + FoneditUpdate; + Fonkillfocus; + Fonsetfocus; + FEdit; + function setItems(d); + begin + return FListBox.SetData(d); + end +end + +//,״̬ +type ttagNMCUSTOMDRAWINFO=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hdr","user", + ( + ("hwndfrom","intptr",0), + ("idfrom","intptr",0), + ("code","int",0))), + ("dwdrawstage","int",0), + ("hdc","intptr",0), + ("rc","int[4]", + (0,0,0,0)), + ("dwitemspec","intptr",0), + ("uitemstate","int",0), + ("litemlparam","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property hdr index "hdr" read _getvalue_ write _setvalue_; + property dwdrawstage index "dwdrawstage" read _getvalue_ write _setvalue_; + property hdc index "hdc" read _getvalue_ write _setvalue_; + property rc index "rc" read _getvalue_ write _setvalue_; + property dwitemspec index "dwitemspec" read _getvalue_ write _setvalue_; + property uitemstate index "uitemstate" read _getvalue_ write _setvalue_; + property litemlparam index "litemlparam" read _getvalue_ write _setvalue_; +end + + + type TToolButton = class(tcomponent) +{** + @explan(˵) %% +**} + function Create(AOwner);override; + begin + inherited; + FCaption := "toolbtn"; // + FImageId := -1; //imageid + FEnabled := true; //Ч Ե + FVisible := true; //ɼ + end + function DoOnClick(o,e);virtual; + begin + CallMessgeFunction(OnClick,o,e); + end + function GetRect(); + begin + {** + @explan(˵) %% + @return(array) %% + **} + if parent and parent.HandleAllocated() then + return parent.GetItemRect(self); + end + function publishs();override; + begin + return array("name","caption","enabled","imageid","visible","onclick"); + end + function Recycling();override; + begin + if FToolbar then + begin + FToolbar.DeleteButton(self(true)); + end + FToolbar := nil; + inherited; + FCaption := ""; // + FOnClick := nil; // + FImageId := -1; //imageid + FEnabled := true; //Ч Ե + FVisible := true; //ɼ + end + property OnClick:eventhandler read FOnClick write FOnClick; + property Caption:string read FCaption write SetCaption; + property ImageId:integer read FImageId write SetImageId; + property Enabled:bool read FEnabled write SetEnabled; + property Visible:bool read FVisible write SetVisible; + property ToolBar read FToolbar write SetParent; + property Parent read FToolbar write SetParent; + property willaddBar read FWillAddbar; + {** + @param(OnClick)(function[o:TToolButton;e:tuieventbase]) Ϣ %% + @param(Caption)(string) %% + @param(ImageId)(integer) ͼid %% + @param(Enabled)(bool) ǷЧ %% + @param(Visible)(bool) Ƿɼ %% + **} + private + function SetParent(tb); + begin + if FToolbar=tb then return ; //ͬ + if FWillAddbar = tb and tb then + begin + FToolbar :=tb; + FWillAddbar := nil; + return ; + end + if FToolbar<>tb then + begin + if FToolbar is class(TToolBar) then //ɾ + begin + FWillAddbar := -1986; + FToolbar.DeleteButton(self(true)); + FWillAddbar := nil; + FToolbar := nil; + end + end + if tb is class(TToolBar) then + begin + FWillAddbar := tb; + tb.AddButton(self(true)); + SetParent(tb); + end + FWillAddbar := nil; + end + function SetCaption(s); + begin + if ifstring(s) and s<>FCaption then + begin + FCaption := s; + end + end + function SetEnabled(v); + begin + nv := v?true:false; + if nv <> FEnabled then + begin + FEnabled := nv; + if FToolbar then FToolbar.BtnChanged(); + end + end + function SetVisible(v); + begin + nv := v?true:false; + if nv<>FVisible then + begin + FVisible := nv; + if FToolbar then FToolbar.BtnChanged(); + end + end + + protected + function SetImageId(id);virtual; + begin + if ifnumber(id) and id<>FImageId then + begin + FImageId := id; //ˢһ + if FToolbar then FToolbar.BtnChanged();//FToolbar.InvalidateRect(nil,false); + end + end + private + FCaption; // + FOnClick; // + FCommandId; //command id ԲҪ + FImageId; //imageid + FEnabled; //Ч Ե + FVisible; //ɼ + FToolbar; // + FWillAddbar; +end +type TToolBar = class(TCustomControl) + {** + @explan(˵) ؼ %% + **} + function Create(AOwner);override; + begin + inherited; + height := 34; + Width := 300; + Align := alTop; + FButtons := new TMyArrayB(); + caption := "ToolBar"; + FBtnRects := array(); + FTipWnd := new TTipWnd(self); + FTipWnd.Parent := self; + FTimer := new TTimer(self); + FTimer.Interval := 200; + FTimer.Ontimer := thisfunction(DoTimerShowTip); + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + FShowLoked := true; + if e.Button()= mbLeft then + begin + FMouseDownIdx := PosInBtn(e.pos); + EndShowWnd(); + if FMouseDownIdx>=0 then + begin + if not(FButtons[FMouseDownIdx].Enabled) then + begin + FMouseDownIdx := -1; + return; + end + InvalidateRect(nil,false); + end + end + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return ; + FShowLoked := false; + if e.Button()= mbLeft then + begin + idx := PosInBtn(e.pos); + if idx>=0 then + begin + if FMouseDownIdx = idx then begin + bi := FButtons[idx]; + bi.DoOnClick(bi,e); + end ; + end + end + if FMouseDownIdx >=0 then + begin + FMouseDownIdx := -1; + InvalidateRect(nil,false); + end + end + function MouseMove(o,e);override; + begin + if csDesigning in ComponentState then return ; + if FTimer.Enabled then return ; + idx := PosInBtn(e.pos); + if idx<0 then return; + FShowtimeIndexA := idx; + FTimer.Start(); + end + function CNALIGN(o,e):CN_ALIGN;override; + begin + case Align of + alTop,alBottom: + begin + bs := UnAlignBounds; + nh := CalcHeightFixWidth(e.width); + dh := nh-(bs[3]-bs[1]); + bs[3] +=dh; + FUnAlignBounds := bs; + end + alLeft,alRight: + begin + bs := UnAlignBounds; + nh := CalcWidthFixHeight(e.height); + dh := nh-(bs[2]-bs[0]); + bs[2] +=dh; + FUnAlignBounds := bs; + end + end + inherited; + end + function DoTimerShowTip(); //ʱ + begin + FCurrentPos := array(0,0); + _wapi.getcursorPos(FCurrentPos); + + FCurrentPos := ScreenToClient(FCurrentPos[0],FCurrentPos[1]); + idx := PosInBtn(FCurrentPos); + if idx<0 then + begin + EndShowWnd(); + FShowLoked := false; + FMouseDownIdx := -1; + InvalidateRect(nil,false); + return ; + end + if FShowLoked then return; + if FShowTimeIndexA = idx then //Ȼ + begin + if not FTipWnd.Visible then + begin + FTipWnd.Tip := FButtons[idx].Caption; + FTipWnd.ShowTIp(); + end + end else + begin + EndShowWnd(); + end + end + + function AddButton(btn); + begin + {** + @explan(˵) ӹ%% + **} + InsertButton(btn); + end + function SetBtnIndex(btn,idx); + begin + {** + @explan(˵) ޸İťλ %%; + @param(btn)(TToolButton) %% + @param(idx)(TToolButton | integer) λ %% + **} + if not(idx>=0) then return -1; + cidx := IndexOfBtn(btn); + if cidx<0 then return -1; + if cidx=idx then return idx; + btnlength := FButtons.Length(); + if idx>cidx then + begin + for i := cidx to min(btnlength-1,idx)-1 do + begin + FButtons.swap(i,i+1); + end + end else + begin + for i:= idx to cidx-1 do + begin + FButtons.swap(i,i+1); + end + end + if Btn.Visible then InvalidateRect(nil,false); + return cidx; + end + function InsertButton(btn,idx); + begin + {** + @explan(˵) ָλò밴ť %% + @param(btn)(TToolButton) %% + @param(idx)(TToolButton | integer) λ %% + **} + if not(btn is class(TToolButton)) then return ; + cidx := IndexOfBtn(btn); + //λü + if cidx>=0 then return ; + if btn.willaddBar<>self then + begin + return btn.parent := self(true); + end + FButtons.push(btn); + + nidx := nil; + if idx>=0 then nidx := idx; + else + if ifobj(idx) then nidx := IndexOfBtn(idx); + if nidx>=0 then + SetBtnIndex(btn,nidx); + + if btn.Visible then + begin + IncPaintLock(); + InvalidateRect(nil,false); + FWillModifyToolbar := true; + DecPaintLock(); + end + + end + function DeleteButton(btn); //ɾť + begin + {** + @explan(˵) ɾť %% + @explan(˵) ɾbutton %% + @param(btn)(TToolButton) %% + **} + idx := IndexOfBtn(btn); + if idx=-1 then return -1; + if btn.willaddBar<>-1986 then + begin + return btn.Parent := nil; + end + FButtons.splice(idx,1); + if btn.Visible then + begin + IncPaintLock(); + InvalidateRect(nil,false); + FWillModifyToolbar := true; + DecPaintLock(); + end + + end + function GetItemRect(btn); //ðť + begin + {** + @explan(˵) ðť %% + @param(btn)(TToolButton) %% + @return(array) %% + **} + idx := IndexOfBtn(btn); + if idx>=0 then + begin + return FBtnRects[idx]; + end + end + function IncPaintLock(); //ˢ + begin + {** + @explan(˵) , DecPaintLock() ɶʹ %% + **} + BeginUpdate(); + end + function DecPaintLock(); //ͷˢ + begin + {** + @explan(˵) ȡ, IncPaintLock() ɶʹ %% + **} + EndUpdate(); + end + function CalcHeightFixWidth(w); + begin + {** + @explan(˵) ̶ȼ㹤߶ %% + @param(w)(integer) %% + @return(intger) ĸ߶ %% + **} + bw := 0; + if WSSizebox then + begin + bw := 16; + end else + if WsDlgModalFrame then + begin + bw := 6; + end else + if Border then bw := 2; + imglst := ImageList; //ͼ + imgw := 36; + imgh := 36; + if imglst is class(TCustomImageList) then + begin + imgw := imglst.Width+4; + imgh := imglst.height+4; + end + nh := w-bw; + bct := 0; + for i:= 0 to FButtons.Length()-1 do //С + begin + bi := FButtons[i]; + if not(bi.Visible) then + begin + continue; + end + bct++; + end + if bct=0 then return imgh+bw; + rct := integer((nh+2)/(imgw+1)); + if rct<1 then rct := 1; + //echo "ܹ:",bct,"ÿ:",rct,"===",(integer( bct/rct)+1),"\r\n"; + nt := bct/rct; + return ((frac(nt)>0)?(integer(nt)+1):(nt))*(imgh+1)+bw; + return (integer( bct/rct)+1)*(imgh+1)+bw; + end + function CalcWidthFixHeight(h); + begin + {** + @explan(˵) ̶߶ȼ㹤 %% + @param(w)(integer) ߶ %% + @return(intger) %% + **} + bw := 0; + if WSSizebox then + begin + bw := 16; + end else + if WsDlgModalFrame then + begin + bw := 6; + end else + if Border then bw := 2; + imglst := ImageList; //ͼ + imgw := 36; + imgh := 36; + if imglst is class(TCustomImageList) then + begin + imgw := imglst.Width+4; + imgh := imglst.height+4; + end + nh := h-bw; + bct := 0; + for i:= 0 to FButtons.Length()-1 do + begin + bi := FButtons[i]; + if not(bi.Visible) then + begin + continue; + end + bct++; + end + if bct=0 then return imgw+bw; + rct := integer((nh+2)/(imgh+1)); + if rct<1 then rct := 1; + nt := bct/rct; + return ((frac(nt)>0)?(integer(nt)+1):(nt))*(imgw+1)+bw; + return (integer( bct/rct)+1)*(imgw+1)+bw; + end + function Paint();override; + begin + c := canvas; + for i := 0 to FButtons.length()-1 do + begin + bi := FButtons[i]; + if not(bi.Visible) then continue; + ci := FBtnRects[i]; + if not ifarray(ci) then return ; + if FMouseDownIdx=i then + begin + c.draw("framecontrol",array(ci[0:1],ci[2:3]),DFC_BUTTON,DFCS_BUTTONCHECK); + end else + c.draw("framecontrol",array(ci[0:1],ci[2:3]),DFC_BUTTON,DFCS_BUTTONPUSH); + igslist := ImageList; + if igslist is class(TCustomImageList) then + begin + igid := bi.ImageId; + if igid>=0 and igid=0ʾȷ %% + **} + for i := 0 to FButtons.Length()-1 do + begin + if btn=FButtons[i] then return i; + end + return -1; + end + function Recycling();override; + begin + while FButtons.Length()>0 do + begin + DeleteButton(FButtons[0]); + end + inherited; + FShowLoked := true; + FBtnRects := nil; + FButtons := nil; + FTipWnd := nil; + FShowtimeIndexA := nil; + FTimer := nil; + FCurrentPos := nil; + FMouseDownIdx := -1; + end + function BtnChanged(); + begin + CalcButtonsRect(); + InvalidateRect(nil,false); + end + function publishs();override; + begin + return array("name","align","caption","enabled","font","left","top","width","height", + "visible","imagelist"); + if Align<>alNone then + begin + return array("name","align","caption","enabled","font", + "visible","imagelist"); + end else + return array("name","align","caption","enabled","font","left","top","width","height", + "visible","imagelist"); + end + protected + procedure SetAlign(Value: TAlign); override; + begin + if Align = Value then exit; + if Value in array(alClient) then + begin + return ; + end + inherited; + end + function ImageChanged();override; + begin + if IsUpDating() then return ; + if Parent then + begin + Parent.DoControlAlign(); + CalcButtonsRect(); + InvalidateRect(nil,false); + end + end + private + function EndShowWnd(); + begin + FShowTimeIndexA := -1; + FTimer.Stop(); + FTipWnd.Visible := false; + end + function CalcButtonsRect(); + begin + if (IsUpDating()) then + begin + FWillModifyToolbar := true; + return ; + end + imglst := ImageList; //ͼ + imgw := 36; + imgh := 36; + if imglst is class(TCustomImageList) then + begin + imgw := imglst.Width+4; + imgh := imglst.height+4; + end + rc := ClientRect; + FBtnRects := array(); + x := y := 0; + rct := 0; + + case Align of + alLeft,alRight: + begin + for i:= 0 to FButtons.Length()-1 do //С + begin + bi := FButtons[i]; + if not(bi.Visible) then + begin + FBtnRects[i] := array(0,0,0,0); + continue; + end + if y+imgh>rc[3] then + begin + if rct=0 then + begin + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + y := 0; + x+=imgw+1; + end else + begin + y := 0; + x+=imgw+1; + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + y+=imgh+1; + rct := 1; + end + end else + begin + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + y+=imgh+1; + rct++; + end + end + end + else + begin + for i:= 0 to FButtons.Length()-1 do //С + begin + bi := FButtons[i]; + if not(bi.Visible) then + begin + FBtnRects[i] := array(0,0,0,0); + continue; + end + if x+imgw>rc[2] then + begin + if rct=0 then + begin + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + x := 0; + y+=imgh+1; + end else + begin + x := 0; + y+=imgh+1; + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + x+=imgw+1; + rct := 1; + end + end else + begin + FBtnRects[i] := array(x,y,x+imgw,y+imgh); + x+=imgw+1; + rct++; + end + end + end + end; + end + function PosInBtn(p); + begin + for i := 0 to FButtons.length()-1 do + begin + ri := FBtnRects[i]; + + if ri and pointinrect(p,ri) then + begin + return i; + end + end + return -1; + end + FShowLoked; + FBtnRects; + FButtons; + FTipWnd; + FShowtimeIndexA; + FTimer; + FCurrentPos; + FMouseDownIdx; + FWillModifyToolbar; +end +type TStatusBar=class(TCustomControl) + {** + @explan(˵) ״̬ %% + **} + private + Fitems; + FCwid; + FCHei; + function itemidok(id); + begin + ct := length(Fitems); + return id >= 0 and id0 and wd<1.0001 then + begin + wd *= FCwid; + end + DrawStatItem(cvs,v,array(p,0,p+wd,FCHei)); + p += wd; + if p>FCwid then return; + end + end + if p0)then wd := 100; + Fitems[Length(Fitems)]:= array("text":str,"width":wd); + if HandleAllocated()then + begin + InvalidateRect(nil,false); + end + end + function deleteitem(id); + begin + {** + @explan(˵) ɾĿ %% + @param(id)(integer) %% + **} + if not(itemidok(id))then return-1; + deleteindex(Fitems,id,true); + if HandleAllocated()then + begin + InValidateRect(nil,false); + end + end + function setitemtext(str,id); + begin + {** + @explan(˵) ޸ֶ %% + @param(str)(string) ı%% + @param(id)(integer) %% + **} + if not ifstring(str)then return-1; + if not(itemidok(id))then return-1; + Fitems[id,"text"]:= str; + if HandleAllocated()then + begin + InvalidateRect(nil,false); + end + end + property Items:statusitems read Fitems Write SetItems; + function publishs();override; + begin + return array("name","caption","enabled","border", + "font","visible","items","ondblclick","onmousedown","onmouseup"); + end + {** + @param(Items)(array) ,ά text ,width ֶ array(("text":"abc","width":200),("text":"part2","width":0.4))%% + **} +end + //ؼ +type TTreeCtlNode = class(TVirtualListItem) + {** + @explan(˵) %% + **} + protected + FItems; // + FParent; //ڵ + private + FBasePos;//ܱ߻׼λ + FCheckPos; //checkboxλ + FExpandPos; //չťλ + FExpandWidth; //չť + FCheckWidth; //checkbox + FFocusColor; + //FNodeHash; + FHierarchyWidth; + function DrawCheckBox(cvs,x,rec,sz,flag); //checkbox + begin + y := rec[1]; + h := rec[3]; + ys := y+(h-sz)/2; + dr := array((x,ys),(x+sz,ys+sz)); + ow := Owner; + dflg := flag; + if ow.OnlyLeafNodeCheckMark and ItemCount>0 then dflg := false; + cvs.Draw("FrameControl",dr,DFC_BUTTON,dflg?DFCS_CHECKED:DFCS_BUTTONCHECK); + if(not dflg)and(ItemCount>0)then + begin + if allChildChecked()then + begin + cvs.Draw("FrameControl",dr,DFC_BUTTON,DFCS_CHECKED); + end else + if ChildChecked()then + begin + cvs.brush.color := rgb(10,10,10); + cvs.fillrect(dr[0]+8 union dr[1]-4); + ow := Owner; + if self=ow.CurrentNode then cvs.brush.color := FFocusColor[ow.hasFocus()]; + else cvs.brush.color := ow.Color; + end + end + end + function DrawExpand(cvs,x,rec,sz,flag); //չť + begin + sz2 := integer(sz/2); + y := rec[1]; + h := rec[3]; + ys := y+(h-sz)/2; + dr := array(array(x,ys),array(x+sz,ys+sz)); + cvs.draw("rectangle",dr); + cvs.MoveTo(array(x+2,ys+sz/2)); + cvs.LineTo(array(x+sz-2,ys+sz/2)); + if not flag then + begin + cvs.MoveTo(array(x+sz/2,ys+2)); + cvs.LineTo(array(x+sz/2,ys+sz-2)); + end + end + + function ChildChecked(); + begin + for i := 0 to FItems.Count-1 do + begin + it := FItems[i]; + ow := Owner; + if ow and ow.OnlyLeafNodeCheckMark then + begin + if it.checked and it.ItemCount<1 then return true; + if it.ChildChecked()then return true; + end else + begin + if it.Checked then return true; + if it.ChildChecked()then return true; + end + end + return false; + end + function allChildChecked(); + begin + if FItems.Count<1 then return false; + for i := 0 to FItems.Count-1 do + begin + it := FItems[i]; + if it.ItemCount<1 then + begin + if not it.Checked then return false; + end else + begin + if not it.allChildChecked()then return false; + end + end + return true; + end + public + function Paint(cvs,x,y,w,h);override; // + begin + {** + @explan(˵)ƽڵ%% + **} + ow := Owner; + if not ow then return; + cvs.Pen.Color := rgb(50,50,50); + cvs.Pen.style := PS_SOLID; + cvs.Pen.width := 1; + inv := 3; + BasePos := FBasePos+x; + FCheckPos := BasePos; + fitemcountflg := ItemCount or FDirtype; + for i := 1 to Hierarchy do + BasePos += FHierarchyWidth; + cbase := BasePos; + itc := 0; + ExpWidth := FExpandWidth; + ifsel := false; + if self=ow.CurrentNode then + begin + ifsel := true; + cvs.brush.Color := FFocusColor[ow.hasFocus()]; + end else + cvs.brush.Color := ow.Color; + if fitemcountflg then + begin + itc := true; + BasePos += inv; + FExpandPos := BasePos; + DrawExpand(cvs,BasePos,array(x,y,w,h),ExpWidth-2,FExpanded); + BasePos += ExpWidth; + end else //else ExpWidth := 0; + begin + BasePos += ExpWidth+inv; + end + CheckWidth := FCheckWidth; + if ow.CheckBox then + begin + BasePos += inv; + FCheckPos := BasePos; + DrawCheckBox(cvs,BasePos,array(x,y,w,h),CheckWidth,FChecked); + BasePos += CheckWidth; + BasePos += inv; + end else + CheckWidth := false; + img := ow.ImageList; + iwidth := 0; + if(img and img.HandleAllocated())then + begin + if(ifsel and FSelImgId >= 0)or(FImgId >= 0)or(FExpandImgId >= 0 and fitemcountflg>0 and FExpanded)then //selimage + begin + if(FExpandImgId >= 0)and fitemcountflg>0 and FExpanded then + begin + img.Draw(FExpandImgId,cvs,BasePos,y+1,nil); + end else + if(ifsel and FSelImgId >= 0)then + begin + img.Draw(FSelImgId,cvs,BasePos,y+1,nil); + end else + if FImgId >= 0 then + begin + img.Draw(FImgId,cvs,BasePos,y+1,nil); + end + BasePos += img.Height; + BasePos += inv; + end + //echo "\r\nimg"; + end + FCaptionRect := array(BasePos,y,x+1000,y+h); + cvs.FillRect(FCaptionRect); + cvs.drawtext(FCaption,FCaptionRect,DT_VCENTER .| DT_SINGLELINE .| DT_NOPREFIX); + if ow.HasLine then + begin + cvs.Pen.Color := rgb(150,150,150); + cvs.Pen.style := PS_DOT; + for i,v in ow.GetHierarchyByHandle(self.Handle) do + begin + FLG := TRUE; + //nx := cbase-FHierarchyWidth*(i+1)+6; + nx := cbase+FHierarchyWidth *(i-FHierarchy-1)+6; + if nx>cbase-5 then break; + cvs.MoveTo(array(nx,y)); + if i=FHierarchy and Parent.LastChild=self then + cvs.LineTo(array(nx,y+h/2+1)); + else cvs.LineTo(array(nx,y+h)); + end + cvs.MoveTo(array(cbase+ExpWidth,y+h/2)); + cvs.LineTo(array(cbase-FHierarchyWidth+6,y+h/2)); + end + end + function MouseUp(o,e); + begin + {** + @explan(˵) Ϣ + **} + ps := e.pos; + px := ps[0]; + rec := o.GetIndexRect(o.GetItemIndexByYpos(e.ypos)); //λ + recx := rec[0]; + if(FItems.Count or FDirtype)and px >= FExpandPos and px <=(FExpandPos+FExpandWidth)then //չ + begin + if mbLeft=e.button()then + begin + if FExpanded then UnExpand(); + else Expand(); + end else + begin + e.skip := true; + end + end else + if Owner.CheckBox and MouseCanChecked and px >= FCheckPos and px <=(FCheckPos+FCheckWidth)then //checkbox + begin + //setprofiler(1+2+4); + if mbLeft=e.button()then + begin + Checked := not FChecked; + p := parent; + while p and(p is class(TTreeCtlNode)) do + begin + Owner.InvalidateItem(p,0); + p := p.parent; + end + end else + e.skip := true; + //exportfile(ftstream(),"","d:\\tst\\abc.stm",getprofilerinfo(true)); + end else + if px>FCheckPos then //ı + begin + return true; + end + return false; + end + function Create(AOwner);override; + begin + inherited; + FMouseCanChecked := true; + FModifyChildrenChecked := true; + FFocusColor := array(rgb(230,240,250),rgb(0,192,250)); + //FNodeHash := array(); + FCheckWidth := 16; + FExpandWidth := 12; + FBasePos := 10; + FHierarchyWidth := 20; + FItems := new TFpList(); // + FHierarchy :=-1; + FEexpanded := false; + FChecked := false; + FExpandImgId :=-1; + end + function GetNodeByIndex(idx); + begin + {** + @explan(˵) ͨŻӽڵ%% + @param(idx)(TTreeCtlNode) %% + **} + if idx >= 0 then return FItems[idx]; + return nil; + end + function indexof(v); // + begin + return FItems.indexof(v); + end + function UpDateHierarchy(); //²㼶 + begin + if not Parent then return; + ph := Parent.Hierarchy; + nh := ph+1; + if FHierarchy <> nh then + begin + FHierarchy := nh; + for i := 0 to FItems.Count-1 do + begin + FItems[i].UpDateHierarchy(); + end + end + UpDateWidth(); + end + function AppendNodeStr(s);override; + begin + {** + @explan(˵) ׷һڵ %% + @param(s)(string) ַ %% + @return(TTreeCtlNode) ½ڵ %% + **} + ow := Owner; + idx := FItems.Count; + return InsertNodeStr(s,idx); + end + function InsertNodeStr(s,idx);override; + begin + {** + @explan(˵) һڵ %% + @param(s)(string) ַ %% + @param(idx)(integer) %% + @return(TTreeCtlNode) ½ڵ %% + **} + if not(idx >= 0)then idx := 0; + ow := Owner; + if not ow then return; + it := ow.CreateTreeNode(ow); //new TTreeCtlNode(ow); + it.Caption := s; + InsertNode(it,idx); + return it; + end + function GetIndex();virtual; + begin + {** + @explan(˵) ڸڵе %% + @return(integer) %% + **} + if Parent then Parent.indexof(self); + end + function AncestorIsExpand();virtual; + begin + {** + @explan(˵) Ƿһչ %% + @return(bool) չΪtrue,Ϊfalse %% + **} + r := Expanded; + if not(r)then return false; + if Parent then return Parent.AncestorIsExpand(); + return r; + end + function AppendNode(it);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)(TTreeCtlNode) ڵ %% + @return(bool) Ƿɹ %% + **} + return InsertNode(it,FItems.Count); + end + function HasNode(nd);virtual; + begin + {** + @explan(˵) ǷΪijڵȽڵ %% + @param(nd)(TTreeCtlNode) ӽڵ %% + @return(TTreeCtlNode|0) ΪȽڵ,ͷزѯڵĸڵ %% + **} + if not(nd is class(TTreeCtlNode))then return 0; + ow := Owner; + if not ow then return; + if ow <> nd.Owner then return 0; + p1 := nd.Parent; + p := p1; + while p do + begin + if p=self then return p1; + if p is class(TTreeCtlNode)then p := p.Parent; + end + return 0; + end + function DeleteNode(nd);virtual; + begin + {** + @explan(˵) ɾڵ %% + @param(nd)(TTreeCtlNode) ɾڵ %% + **} + if nd=self then return 0; + pn := HasNode(nd); + if not pn then return; + return pn.DeleteChildNode(nd); + end + + function DeleteChildNode(nd); + begin + {** + @explan(˵) ɾӽڵ%% + @param(nd)(TTreeCtlNode) ڵ %% + **} + idx :=-1; + idx := indexof(nd); + if idx=-1 then return 0; + return DeleteNodeByIndex(idx); + end + function DeleteNodeByIndex(idx); + begin + {** + @explan(˵) λɾڵ%% + @param(idx)(integer) %% + **} + nd := FItems[idx]; + if not nd then return; + try + Owner.IncPaintLock(); + nd.UnExpand(); + if Owner.NodeInList(nd)then //ʾ + begin + Owner.DeleteItemByIndex(Owner.GetItemIndex(nd)); + end + FItems.Deli(idx); + CurrentDeleteNode := nd; + nd.parent := self(true); + CurrentDeleteNode := nil; + finally + Owner.DecPaintLock(); + end + return true; + end + function DeleteChildren();virtual; // + begin + {** + @explan(˵) ɾеӽڵ%% + **} + try + Owner.IncPaintLock(); + r := true; + if self=Owner.RootNode then + begin + while ItemCount>0 DO + begin + DeleteChildNode(FItems[0]); + end + r := false; + end + if r then + begin + UnExpand(); //۵ + while ItemCount>0 do + begin + idx := 0; //ItemCount-1; + it := FItems[idx]; + CurrentDeleteNode := it; + it.parent := self(true); + CurrentDeleteNode := nil; + FItems.Deli(idx); + end + end + finally + Owner.DecPaintLock(); + end + end + function GetLastShowNode(); + begin + {** + @explan(˵) չʾһڵ %% + @return(TTreeCtlNode) %% + **} + if FItems.Count<1 or not(FExpanded)then return self; + it := FItems[FItems.Count-1]; + return it.GetLastShowNode(); + end + function InsertNodes(its,idx);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)( array of TTreeCtlNode) ַ %% + @param(idx)(integer) %% + **} + idx0 := idx; + if not(idx >= 0)then idx0 := 0; + if idx>FItems.Count then idx0 := FItems.Count; + nits := array(); + nitsi := 0; + flag := false; + bidx := idx0; + for i,it in its do + begin + if(it is class(TTreeCtlNode))and(not it.Parent)then + begin + odexp := it.Expanded; + it.UnExpand(); + FItems.InsertBefor(it,idx0); + CurrentAddNode := it; + it.Parent := self(true); + CurrentAddNode := nil; + it.UpDateHierarchy(); + nits[nitsi++]:= it; + idx0++; + flag := true; + end + end + if flag and Expanded and Owner.NodeInList(self)then + begin + preItem := FItems[bidx-1]; + bx := 0; + //if preItem then bx := Owner.GetItemIndex( preItem.GetLastShowNode())+1; + if preItem then bx := Owner.GetItemIndex(preItem.GetLastShowNode(),bidx)+1; + else bx := owner.GetItemIndex(self)+1; + owner.InsertItems(nits,bx); + end + end + function InsertNode(it,idx);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)(TTreeCtlNode) ַ %% + @param(idx)(integer) %% + **} + if(it is class(TTreeCtlNode))and(not it.Parent)then + begin + if idx<0 then idx := 0; + if idx>FItems.Count then idx := FItems.Count; + if not(idx >= 0)then idx := 0; + odexp := it.Expanded; + it.UnExpand(); + FItems.InsertBefor(it,idx); + CurrentAddNode := it; + it.Parent := self(true); + CurrentAddNode := nil; + it.UpDateHierarchy(); + if Expanded and Owner.NodeInList(self)then + begin + preItem := FItems[idx-1]; + bx := 0; + if preItem then bx := Owner.GetItemIndex(preItem.GetLastShowNode())+1; + else bx := owner.GetItemIndex(self)+1; + owner.InsertItem(it,bx); + end + return true; + end + end + function Expand();virtual; //չ + begin + {** + @explan(˵) չڵ %% + **} + if Owner and Owner.RootNode=self then return; + if FExpanded then return; + if ItemCount<1 then //սڵչ + begin + if FDirtype then + begin + Owner.EmptyNodeExpanding(self(true)); + end + return; + end + //if not Owner.NodeInList(self) then return; + idx :=-1; + if(Owner.NodeInList(self))then + begin + its := GetShowNodes(); + idx := Owner.GetItemIndex(self); + Owner.InsertItems(its,idx+1); + end + FExpanded := true; + //return true; + if Owner.SingleExpand then + begin + p := Parent; + if p is class(TTreeCtlNode)then + begin + PItems := p.FItems; + ct := PItems.Count; + if ct>1 then + begin + Owner.UpDateWindow(); + for i := 0 to ct-1 do + begin + vi := PItems[i]; + if vi=self then continue; + vi.UnExpand(); + end + end + end + end + if idx >= 0 then + begin + owner.InvalidateItem(self,flag); + end + return true; + end + function UnExpand();virtual; //۵ + begin + {** + @explan(˵) ۵ڵ %% + **} + if Owner and Owner.RootNode=self then return; + if not FExpanded then return; + if ItemCount<1 then return; + idx :=-1; + idx := Owner.GetItemIndex(self); + it := GetLastShowNode(); + idx2 := Owner.GetItemIndex(it,idx); + owner.DeleteItemByBounds(idx+1,idx2); + //ڵΪչ + FExpanded := false; + if idx >= 0 then + begin + Owner.InvalidateItem(self,flag); + end + end + function RecyclingChildren();virtual; + begin + while ItemCount>0 do + begin + it := FItems[0]; + //echo "\r\nɾ",it.Caption; + it.Recycling(); + end + end + function Recycling();override; + begin + p := FParent; + if p then + begin + p.DeleteNode(self); + end + while ItemCount>0 do + begin + it := FItems[0]; + it.Recycling(); + end + //if self<>Owner.RootNode then + inherited; + end + function GetShowItemCount(); + begin + r := 1; + if not FExpanded then return r; + for i := 0 to FItems.Count-1 do + begin + it := FItems[i]; + r++; + if it.ItemCount and it.Expanded then r += it.GetShowItemCount(); + end + return r; + end + function GetShowNodes(); + begin + {** + @explan(˵) չӽڵ %% + @return(array of TTreeCtlNode) %% + **} + lst := array(); + for i := 0 to FItems.Count-1 do + begin + it := FItems[i]; + lst union=array(it); + if it.ItemCount and it.Expanded then lst union=it.GetShowNodes(); + end + return lst; + end + function toarray();virtual; + begin + {** + @explan(˵) תΪ %% + **} + r := array(); + r["type"]:= "treenode"; + r["caption"]:= FCaption; + mid := FImgId; + smid := FSelImgId; + r["imgid"]:= mid >= 0?mid:(-1); + r["selimgid"]:= smid >= 0?smid:(-1); + if _tag then r["tag"]:= _tag; + if Checked then r["checked"]:= true; + if ItemCount then + begin + r["nodes"]["type"]:= "treenodes"; + for i := 0 to ItemCount-1 do + begin + r["nodes"]["items"][i]:= GetNodeByIndex(i).toarray(); + end + end + return r; + end + property ImgId read FImgId write SetImgId; + property SelImgId read FSelImgId write SetSelImgId; + property ExpandImgId read FExpandImgId write SetExpandImgId; + property ItemCount read GetItemCount; //ڵ + property Hierarchy Read FHierarchy; // + property Expanded read GetExpanded; //չ + property Parent read FParent write SetParent; //ڵ + property Checked read FChecked write SetChecked; //ѡ + property LastChild read GetLstChild; + property dirtype read FDirtype write FDirtype; //Ŀ¼ + property Caption read FCaption write SetCaption; // + property MouseCanChecked read FMouseCanChecked write FMouseCanChecked; + property ModifyChildrenChecked read FModifyChildrenChecked write FModifyChildrenChecked; + {** + @param(ItemCount)(integer) ӽڵ %% + @param(Hierarchy)(integer) 㼶 %% + @param(Handle)(pointer) %% + @param(Expanded)(bool) Ƿչ %% + @param(Parent)(TTreeCtlNode) ڵ %% + **} + protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode; + property CurrentAddNode read FCurrentAddNode write FCurrentAddNode; + function Gitems(); + begin + return FItems; + end + function SetParent(V);virtual; + begin + ow := Owner; + if not ow then return; + if ow.RootNode=self then return; + tp := Parent; + if(v is class(TTreeCtlNode))and v.Owner=ow then + begin + if v.CurrentAddNode=self then + begin + FParent := v; //½ڵ + end else + if v.CurrentDeleteNode=self then //ӽڵƳ + begin + FParent := nil; + end else + begin + if tp=v then return; + if tp then + begin + tp.DeleteNode(self(true)); + end + v.InsertNode(self(true),v.ItemCount); + end + end else + begin + if tp then tp.DeleteNode(self(true)); + end + end + function SetChecked(v);virtual; //checked + begin + nv := v?true:false; + if nv <> FChecked then + begin + FChecked := nv; + if ModifyChildrenChecked then + begin + for i := 0 to ItemCount-1 do + begin + FItems[i].Checked := nv; + end + end + ow := Owner; + if ow then ow.InvalidateItem(self,false); + end + end + private + function GetLstChild(); + begin + return FItems[FItems.Count-1]; + end + function SetImgId(id); + begin + if(id>-2)and(id<1000)and id <> FImgId then + begin + FImgId := integer(id); + end + end + function SetExpandImgId(id); + begin + if id>-2 and(id<1000)and id <> FExpandImgId then + begin + FExpandImgId := integer(id); + end + end + function SetSelImgId(id); + begin + if(id>-2)and(id<1000)and id <> FSelImgId then + begin + FSelImgId := id; + end + end + FDirtype; + FImgId; + FMouseCanChecked; + FModifyChildrenChecked; + FSelImgId; + FCurrentDeleteNode; + FCurrentAddNode; + FExpanded; + FExpandImgId; + FHierarchy; //㼶 + FCaption; // + FChecked; //ѡ + function SetCaption(v);virtual; //ñ + begin + if ifstring(v)and V <> FCaption then + begin + FCaption := v; + UpDateWidth(); + end + end + function UpDateWidth(); + begin + bwid := 60; + for i := 1 to FHierarchy do + begin + bwid += FHierarchyWidth; + end + if ifstring(FCaption)and FCaption then + begin + fw := 8; + if Owner then + begin + ft := Owner.Font; + fw := abs(ft.Width); + if fw=0 then fw := integer(abs(ft.Height)/2); + end + bwid += length(FCaption)* fw; + end + width := bwid; + end + function GetExpanded();virtual; //Ѿչ + begin + if Owner and Owner.RootNode=self then return true; + return FExpanded; + end + function GetItemCount(); //ӽڵ + begin + return FItems.Count; + end +end +type TTreeCtl = class(TVirtualList) + {** + @explan(˵) ؼ %% + **} + type TTreeSelCHngedEvent=class(tuieventbase) + {** + @explan(˵) ѡıϢ%% + **} + function create(m,w,l,h);override; + begin + inherited; + end + ItemOld; + ItemNew; + Item; + end + function Create(AOwner);override; + begin + inherited; + FSingleExpand := false; + FCheckBox := false; + FHasLine := false; + FNodeHierarchyWidth := 20; + FMulSelected := false; + FMulSelects := array(); + end + function InsertItem(it,idx);override; + begin + if it is class(TTreeCtlNode)then return inherited; + return false; + end + function InsertItems(its,idx);override; + begin + lst := array(); + lsti := 0; + for i,it in its do if it is class(TTreeCtlNode)then lst[lsti++]:= it; + inherited InsertItems(lst,idx); + end + function WMKEYUP(o,e):WM_KEYUP;virtual; + begin + if not FCurrentNode then return; + case e.charcode of + VK_UP,VK_DOWN: + begin + id := GetItemIndex(FCurrentNode); + setsel(GetItemByIndex((VK_UP=e.charcode)?(id-1):(id+1))); + end + VK_LEFT: + begin + if FCurrentNode.Expanded then + begin + FCurrentNode.UnExpand() + end + else + begin + p := FCurrentNode.Parent; + if RootNode=p then return ; + SetSel(p); + end + end + VK_RIGHT: + begin + FCurrentNode.Expand(); + end + end; + end + function hasFocus();virtual; + begin + return true; + end + function AppendItem(it);override; + begin + if it is class(TTreeCtlNode)then return inherited; + return false; + end + function SetSel(it);virtual; + begin + {** + @explan(˵) ѡнڵ %% + @param(it)(TTreeCtlNode) ڵ %% + **} + if(it is class(TTreeCtlNode))and it.Owner=self then + begin + r := CallSelChange(it); + if r then return; + IF HandleAllocated()then + begin + GoToNode(it); + end + if not r then InValidateRect(nil,false); + //CallSelChange(it); + end + end + function GoToNode(it); + begin + if NodeInList(it)then + begin + //return SetTopLine(GetItemIndex(it)); // + idxs := GetClientItemIndexs(); + id := GetItemIndex(it); + if(idxs[0]<= id)and(idxs[length(idxs)-1]>= id)then //ڿӴڲҪ + begin + return; + end else + begin + return SetTopLine(max(0,id-integer(length(idxs)/2))); // +integer(length(idxs)/2) + end + end else + begin + p := it.Parent; + while p do + begin + p.Expand(); + if NodeInList(p)then + begin + f := true; + break; + end + p := p.parent; + end + if f then return GoToNode(it); + end + end + function InitializeWnd();override; + begin + inherited; + if FCurrentNode then GoToNode(FCurrentNode); + end + function imageChanged();override; + begin + if imageList is class(TCustomImageList)then + begin + FBKItemHeight := ItemHeight; + ItemHeight := imageList.Height+2; + end else + begin + if FBKItemHeight>5 then ItemHeight := FBKItemHeight; + end + inherited; + end + function CreateNode();virtual; + begin + {** + @ignore() %% + **} + return CreateTreeNode(); + r := new TTreeCtlNode(self(true)); + return r; + end + function CreateTreeNode();virtual; + begin + r := new TTreeCtlNode(self(true)); + return r; + end + function DeleteNode(nd);virtual; + begin + if FRootItem then FRootItem.DeleteNode(nd); + end + function NodeInList(it); + begin + {** + @explan(˵)ڵǷڴչʾ %% + **} + if it=FRootItem then return FRootItem; + return ItemInList(it); + end + function MouseDown(o,e);override; + begin + if e.shiftdouble()and e.button()=mbLeft then //˫ + begin + //˫۵չ + it := GetItemByYpos(e.ypos); + if it and(it.ItemCount or it.dirtype)and not(it.Expanded)then it.Expand(); + else if it and it.ItemCount and it.Expanded then + begin + it.UnExpand(); + end else + CallMessgeFunction(ondblclick,o,e); + end + end + function MouseUp(o,e);override; + begin + {** + @explan(˵)%% + **} + if csDesigning in ComponentState then return; + it := GetItemByYpos(e.ypos); + if it then + begin + if it.MouseUp(o,e)then + begin + SetSel(it); + //CallSelChange(it); //ѡ + //ѡ + end + end + bt := e.button(); + if bt=mbRight then + begin + CallMessgeFunction(onrclick,o,e); + end else + if bt=mbLeft then + begin + CallMessgeFunction(onclick,o,e); + end + //e.skip := true; + end + function Recycling();override; + begin + //setprofiler(1+2+4); + //exportfile(ftstream(),"","d:\\tst\\abc.stm",getprofilerinfo(true)); + if FRootItem then FRootItem.Recycling(); + FRootItem := nil; + FCurrentNode := nil; + FOnSelChanging := nil; + FonEmptyNodeExapanding := nil; + FNodeHierarchyWidth := 20; + inherited; + end + function GetHierarchyByHandle(h); + begin + if FPaintArray then return FPaintArray[h]; + end + function EmptyNodeExpanding(item); + begin + if HandleAllocated()then + begin + e := new TTreeSelCHngedEvent(self.Handle,0,0,0); + e.item := item; + e.ItemNew := item; + e.ItemOld := item; + calldatafunction(onEmptyNodeExapanding,self(true),e); + end + end + function Clean();override; + begin + if FRootItem then + begin + FRootItem.DeleteChildren(); + end + end + property CurrentNode read FCurrentNode; + property CheckBox:bool read FCheckBox write SetCheckBox; + property HasLine:bool read FHasLine write SetHasLine; + property OnlyLeafNodeCheckMark read FOnlyLeafNodeCheckMark write FOnlyLeafNodeCheckMark; + //property NodeHierarchyWidth read FNodeHierarchyWidth write SetNodeHierarchyWidth; + property RootNode read GetRootNode; + //property MulSelected read FMulSelected write FMulSelected; + property SingleExpand read FSingleExpand write FSingleExpand; + property OnSelChanged:eventhandler read FOnSelChanged write FOnSelChanged; + property OnSelChanging:eventhandler read FOnSelChanging write FOnSelChanging; + property onEmptyNodeExapanding read FonEmptyNodeExapanding write FonEmptyNodeExapanding; + protected + function GetRootNode();virtual; //øڵ + begin + if not(FRootItem)or(ifobj(FRootItem)and(FRootItem.ReCycleState <> 0))then + begin + FRootItem := CreateTreeNode(); + end + //echo FRootItem.Owner,"\r\n"; + return FRootItem; + end + private + FOnlyLeafNodeCheckMark; + FNodeHierarchyWidth; + FMulSelected; + FMulSelects; + function SetNodeHierarchyWidth(v); + begin + if v >= 0 and FNodeHierarchyWidth <> v then + begin + end + end + function CallSelChange(it); + begin + r := 0; + if FCurrentNode <> it then + begin + t1 := FCurrentNode; + //if t1 then InvalidateItem(t1,false); + //InvalidateItem(it,false); + ne := new TTreeSelCHngedEvent(self.Handle,1,1,1); + ne.ItemOld := t1; + ne.ItemNew := it; + ne.Item := it; + CallDatafunction(FOnSelChanging,self(true),ne); + if ne.Skip then return true; + FCurrentNode := it; + CallDataFunction(FOnSelChanged,self(true),ne); + end + return r; + end + FOnSelChanging; + FonEmptyNodeExapanding; + FSingleExpand; + FBKItemHeight; + FOnSelChanged; + FCurrentNode; + FRootItem; + FCheckBox; + FHasLine; + FPaintArray; + function PrevPaint(begid,endid);virtual; + begin + if not FHasLine then return; + currentline := array(); + FPaintArray := array(); + lasthi := 0; + Chi := 0; + //sh := new TMyArrayB(); + for i := ItemCount-1 downto begid do + begin + if not it then + begin + it := GetItemByIndex(i); + lasthi := it.Hierarchy; + if lasthi<1 then continue; + currentline[lasthi]:= 1; + end else + begin + it2 := GetItemByIndex(i); + chi := it2.Hierarchy; + if chi>0 then + begin + currentline[chi]:= 1; + if chi= lasthi then + begin + currentline[chi]:= 1; + end + end + end + lasthi := chi; + if it2 then it := it2; + if i <= endid and it then + begin + FPaintArray[it.Handle]:= currentline; + //sh.unshift( array(array2str(mrows( currentline,1),","),"===>"+inttostr(it.Hierarchy),"%%"+it.caption)); + end + end + end + function SetHasLine(v); //hasline + begin + nv := v?true:false; + if nv <> FHasLine then + begin + FHasLine := nv; + InvalidateRect(nil,false); + end + end + function SetCheckBox(v); + begin + bv := v?true:false; + if bv <> FCheckBox then + begin + FCheckBox := bv; + end + end +end + +type TTreeNode=class(TTreeCtlNode) + {** + @explan(˵)treeؼڵ %% + **} + public + function create(AOwner);override; + begin + inherited; + end + function GetSibling(id); + begin + {** + @explan(˵) ֵܽڵ%% + @param(id)(integer) ,ԼλΪ0%% + **} + r := nil; + if id=0 then return self(true); + if not(Parent is class(TTreeNode))then return r; + if(id>-100000)and(id<100000)then + begin + idx := Parent.indexof(self); + return Parent.GetNodeByIndex(idx+id); + end + return r; + end + function deletenode(nd);override; + begin + DeleteChildNode(nd); + end + function InsertSibling(node,ifprev); + begin + {** + @explan(˵) ֵܽڵ %% + @param(node)(TTreeNode) ڵ %% + @param(ifprev)(bool) + **} + if not(Parent is class(TTreeNode))then exit; + idx := Parent.IndexOf(self); + if ifprev then + begin + return Parent.InsertNode(node,idx); + end else + begin + return Parent.InsertNode(node,idx+1); + end + end + function Recycling();override; + begin + inherited; + end + function Destroy();override; + begin + inherited; + end + function moveup();virtual; + begin + {** + @explan(˵) ڵ %% + @return(bool) Ƿƶɹ %% + **} + bf := GetSibling(-1); + if not bf then return false; + ndp := parent; + nd := self(true); + if ndp then + begin + ndp.deletenode(nd); + ndp.insertnode(nd,bf); + return true; + end + return false; + end + function movedown();virtual; + begin + {** + @explan(˵) ڵ%% + **} + bf := GetSibling(1); + if not bf then return false; + ndp := parent; + if ndp then + begin + nd := self(true); + ndp.deletenode(nd); + ndp.insertnode(nd,ndp.indexof(bf)+1); + end + return false; + end + function insertbefor(node,befor); + begin + {** + @ignore() + **} + insertnode(node,befor); + end + function append(node); + begin + {** + @ignore() + **} + insertnode(node,self.ItemCount); + end + function deleteAllChild(); + begin + DeleteChildren(); + end + function HandleAllocated(); + begin + {** + @explan(˵)ǷЧ%% + @return(bool) + **} + return true; + end + function CreateHandle();virtual; + begin + {** + @explan(˵) %% + **} + end + function InsertNode(node,bnode);override; + begin + {** + @expaln(˵) ӽڵbnode ǰµӽڵnode %% + @param(node)(TTreeNode) ڵ %% + @param(bnode)(TTreeNode|TVI_FIRST|TVI_LAST) ׼ڵ %% + **} + if ifarray(node)then return Owner.InsertNode(node,self(true),bnode); + if ifnil(bnode)then bnode := TVI_LAST; + ct := ItemCount; + if bnode=TVI_LAST then + begin + pos := ct; + end else + if bnode=TVI_FIRST then + begin + pos := 0; + end else + if bnode is class(TTreeNode)then + begin + pos := IndexOf(bnode); + if pos<0 then return 0; + end else + if bnode= 0 then + begin + pos := bnode; + end else + if bnode >= ct then + begin + pos := ct; + end else + begin + pos := ct; + end + return inherited InsertNode(node,pos); + end + function GetNodeByPosition(id); + begin + {** + @expaln(˵) ͨλûӽڵ%% + **} + return GetNodeByIndex(id); + end + function GetNodeCount(); + begin + {** + @explan(˵) õǰڵнڵ %% + @return(integer) %%; + **} + r := 0; + ct := ItemCount; + for i := 0 to ct-1 do + begin + it := GetNodeByIndex(i); + r += it.GetNodeCount(); + end + r += ct; + return r; + end + property items read Gitems; +end +type TTreeView=class(TTreeCtl) + {** + @explan(˵) treeؼ %% + **} + private + FBackColor; + FHaveFocus; + function SetLazyItems(v); + begin + if ifarray(v)and v["type"]="treenodes" then + begin + RootItem.RecyclingChildren(); + InsertNodes(v); + end + end + function GetLazyItems(); + begin + return(RootItem.toarray())["nodes"]; + end + protected + function GetitemByCursorPos(); + begin + ps := array(x,y); + _wapi.GetCursorPos(ps); + pt := ScreentoClient(ps[0],ps[1]); + return TvHittest(pt[0],pt[1]); + end + function TvHittest(x,y,flag); + begin + {** + @explan(˵) ȡָλõitem %% + **} + id := GetItemIndexByYpos(y); + if id >= 0 then return GetItemByIndex(id); + end + public + function hasFocus();override; + begin + return FHaveFocus; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return; + inherited; + if not FHaveFocus then + begin + SetFocus(); + FHaveFocus := true; + InvalidateItem(self.CurrentNode); + end + end + function WMKILLFOCUS(o,e):WM_KILLFOCUS;override; + begin + FHaveFocus := false; + InvalidateItem(self.CurrentNode); + end + function create(AOwner);override; + begin + inherited; + height := 150; + border := true; + HasLine := true; + end + function expand(item); + begin + {** + @explan(˵) չڵ %% + @param(item)(TTreeNode) ; + **} + if item is class(TTreeNode)then item.Expand(); + end + function collapse(item); + begin + {** + @explan(˵) £ڵ %% + @param(item)(TTreeNode) ; + **} + if item is class(TTreeNode)then item.UnExpand(); + end + function SwitchCollapse(item); + begin + {** + @explan(˵) л£չ %% + @param(item)(TTreeNode) ; + **} + if item is class(TTreeNode)then + begin + if Item.Expaned then Item.UnExpand(); + else Item.UnExpand(); + end + end + function InsertNodes(iteminfos,pnode,bnode); + begin + {** + @explan(˵) ڵ %% + **} + if ifarray(iteminfos)and iteminfos["type"]="treenodes" then + begin + its := iteminfos["items"]; + for i,v in its do + begin + InsertNode(v,pnode,bnode); + end + end + end + function InsertNode(iteminfo,pnode,bnode); + begin + {** + @explan(˵)뵥ڵ %% + @param(iteminfo)(array) array("type":"treenode","caption":"","imgid":id,"nodes":array()) ڵϢ + nodesֶΪӽڵϢ %% + %% + @param(pnode)(TTreeNode) ڵ %% + @param(bnode)(TTreeNode) ǰһڵ %% + **} + if not(pnode is class(TTreeNode))then pnode := RootItem; + if self <> pnode.Owner then return; + if iteminfo is class(TTreeNode)then + begin + return pnode.InsertNode(iteminfo,bnode); + end + if not(ifarray(iteminfo)and iteminfo)then return nil; + item := CreateTreeNode(); + item.Checked := iteminfo["checked"]; + item.caption := iteminfo["caption"]; + item.SelImgId := iteminfo["selimgid"]; + item.ImgId := iteminfo["imgid"]; + item._tag := iteminfo["tag"]; + pnode.InsertNode(item,bnode); + InsertNodes(iteminfo["nodes"],item); + return item; + end + function deleteitem(node); + begin + {** + @explan(˵) ɾ ڵ,ǽڵ㲻,node.recycling %% + @param(node)(TTreeNode) + **} + if node is class(TTreeNode)then + begin + end else + return; + np := RootItem.HasNode(node); + if np then np.DeleteChildNode(node); + end + function CreateTreeNode();override; + begin + r := new TTreeNode(self(true)); + return r; + end + public + function Recycling();override; + begin + inherited; + end + function Destroy();override; + begin + inherited; + end + function GetItemCount(); + begin + {** + @explan(˵) item %% + @return(integer) %% + **} + RootItem.GetNodeCount(); + end + function clean();override; + begin + {** + @explan(˵)ɾڵ㲢 %% + **} + BeginUpdate(); + RootItem.RecyclingChildren(); + EndUpDate(); + end + property RootItem read GetRootNode; + property LazyItems:TreeData read GetLazyItems Write SetLazyItems; + function publishs();override; + begin + return array("name", + "left","top","width","height","caption","align","anchors", + "checkbox","visible","itemheght","imagelist","hasline","singleexpand", + "lazyitems","onselchanged"); + end + //property OnDeleteItem read FOnDeleteItem write FOnDeleteItem; + //property OnItemExpand:eventhandler read FOnItemExpand write FOnItemExpand; + {** + @param(RootItem)(TTreeNode) ڵ %% + @param(LazyItems)(array) ṹ %% + **} +end +//tabؼ +type TTCITEMA=class(tcstructwithcharptr) + {** + @explan(˵)tabؼǩڴ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := array( + ("mask","int",0), + ("dwstate","int",0), + ("dwstatemask","int",0), + ("psztext","intptr",0), + ("cchtextmax","int",0), + ("iimage","int",0), + ("lparam","intptr",0)); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),array("psztext":"cchtextmax"),nil); + end + property mask index "mask" read _getvalue_ write _setvalue_; + property dwstate index "dwstate" read _getvalue_ write _setvalue_; + property dwstatemask index "dwstatemask" read _getvalue_ write _setvalue_; + property psztext index "psztext" read _getvalue_ write _setvalue_; + property cchtextmax index "cchtextmax" read _getvalue_ write _setvalue_; + property iimage index "iimage" read _getvalue_ write _setvalue_; + property lparam index "lparam" read _getvalue_ write _setvalue_; +end + +type TTableItem = class(TTCITEMA) + {** + @explan(˵)tabؼǩ %% + **} + private + FPageCtrl; + FCaption; + FVisible; + FPageSheet; + function SetVisible(v); + begin + nv := v?true:false; + if nv<>FVisible then + begin + FVisible := v; + end + end + function SetCaption(s); + begin + if ifstring(s) and s<>FCaption then + begin + FCaption := s; + psztext := FCaption; + if PageSheet is class(TTabSheet) then PageSheet.Caption := s; + end + end + public + function Create(); + begin + inherited create(nil); + FVisible:= true; + end + property Caption read FCaption write SetCaption; + property PageSheet read FPageSheet Write FPageSheet; +end +type TTabSheet = class(TCustomControl) + {** + @explan(˵)pageؼҳ %% + **} + private + FImageIndex; + protected + function RealSetText(s);override; + begin + inherited; + if ifstring(s) and Parent then + begin + id := parent.GetPageID(self(true)); + Parent.SetTabText(id,s); + end + end + function SetParent(p);override; + begin + if (P is class(TPageControl) ) and parent<>p then + begin + oldparent := Parent; + if oldparent then + begin + oldparent.RemovePage(self); + end + inherited; + parent.addtabitem(self); + end else + if not(p is class(TWincontrol)) then + begin + if Parent then + begin + id := Parent.GetPageID(self); + Parent.RemovePageTab(id); + end + inherited; + end + end + public + function paint();override; + begin + + end + function DesigningMove();override; + begin + return false; + end + function DesigningSizer();override; + begin + return false; + end + function create(AOwner);override; + begin + inherited; + Caption := "tab"; + Visible := false; + FTabVisible := True; + end + function CreateParams(p);override; + begin + inherited; + p.exstyle := 0x101; + end + function publishs();override; + begin + return array("name","caption","color","border","wsdlgmodalframe","onsize"); + end +end +type TPageControl = class(TCustomControl) + private + FirstViewIndex; + FCurrentid; + FPrevid; + FTabItems; // + + FOnSelChange; + FOnSelChanging; + //FOnrclick; + FTabPosition; + FTabHeight; + FTabItemswidth; + FScrollBtnRect; + Fprevrect; + fnextrect; + FTabRects; + FClientarea; + function SetTabPosition(v); + begin + if FTabPosition=v then exit; + if not(v in array(alTop,alBottom,alLeft,alRight)) then exit; + FTabPosition := v; + InvalidateRect(nil,false); + DoControlAlign(); + end + function GetTabCount(); + begin + return FTabItems.length(); + end + function CreateTableItem(cp); + begin + r := new TTableItem(); + r.caption := cp; + return r; + end + function CalcTabs(); // + begin + rec := ClientRect; // + ft := font; + fw := ft.width; + fh := ft.height; + FTabHeight := fh+7; + FTabItemswidth := array(); + for i := 0 to FTabItems.length()-1 do + begin + pg := FTabItems[i]; + ta := pg.Caption; + FTabItemswidth[i] := max(20, length(ta)*fw+8 ); + end + FMaxsize := 0; + if FTabPosition in array(alLeft,alRight) then + begin + FTabItemswidth := zeros(length(FTabItemswidth))+maxvalue(FTabItemswidth); + FMaxsize := length(FTabItemswidth)*FTabHeight; + end else + begin + FMaxsize := sum(FTabItemswidth); + end + FClientarea := rec; + FScrollBtnRect := 0; + Fprevrect := 0; + fnextrect := 0; + FTabRects := array(); + case FTabPosition of + alLeft: + begin + if FTabItemswidth then + begin + FClientarea[0] :=rec[0]+FTabItemswidth[0]; + if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then + begin + FScrollBtnRect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabItemswidth[0],rec[3]); + Fprevrect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabItemswidth[0],rec[3]-FTabHeight); + Fnextrect := array(rec[0],rec[3]-FTabHeight,rec[0]+FTabItemswidth[0],rec[3]); + end else + begin + FirstViewIndex := 0; + end + ybase := 0; + for i,v in FTabItemswidth do + begin + if i>=FirstViewIndex then + begin + FTabRects[i] := array(0,ybase,FTabItemswidth[0],ybase+FTabHeight); + ybase+=FTabHeight; + if xbase>(rec[3]-FTabHeight-FTabHeight) then break; + end + else FTabRects[i] := nil; + end + end + end + alRight: + begin + if FTabItemswidth then + begin + + FClientarea[2] :=rec[2]-FTabItemswidth[0]; + if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then + begin + FScrollBtnRect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight*2,rec[2],rec[3]); + Fprevrect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight*2,rec[2],rec[3]-FTabHeight); + Fnextrect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight,rec[2],rec[3]); + end else + FirstViewIndex := 0; + ybase := 0; + for i,v in FTabItemswidth do + begin + if i>=FirstViewIndex then + begin + FTabRects[i] := array(rec[2]-FTabItemswidth[0],ybase,rec[2],ybase+FTabHeight); + ybase+=FTabHeight; + if xbase>(rec[3]-FTabHeight-FTabHeight) then break; + end + else FTabRects[i] := nil; + end + end + end + alTop: + begin + if FTabItemswidth then + begin + + FClientarea[1] :=rec[1]+FTabHeight; + if length(FTabItemswidth)>1 and (FMaxsize>(rec[2]-rec[0])) then + begin + FScrollBtnRect := array(rec[2]-FTabHeight*2,rec[1],rec[2],rec[1]+FTabHeight); + + Fnextrect := array(rec[2]-FTabHeight,rec[1],rec[2],rec[1]+FTabHeight); + Fprevrect := array(rec[2]-FTabHeight*2,rec[1],rec[2]-FTabHeight,rec[1]+FTabHeight); + end else FirstViewIndex := 0; + xbase := 0; + for i,v in FTabItemswidth do + begin + if i>=FirstViewIndex then + begin + FTabRects[i] := array(xbase,0,xbase+FTabItemswidth[i],FTabHeight); + xbase+=FTabItemswidth[i]; + if xbase>(rec[2]-FTabHeight-FTabHeight) then break; + end else + FTabRects[i] := nil; + end + end + end + alBottom: + begin + if FTabItemswidth then + begin + + FClientarea[3] :=rec[3]-FTabHeight; + if length(FTabItemswidth)>1 and (FMaxsize>(rec[2]-rec[0])) then + begin + FScrollBtnRect := array(rec[2]-FTabHeight*2,rec[3]-FTabHeight,rec[2],rec[3]); + Fnextrect := array(rec[2]-FTabHeight,rec[3]-FTabHeight,rec[2],rec[3]); + Fprevrect := array(rec[2]-FTabHeight*2,rec[3]-FTabHeight,rec[2]-FTabHeight,rec[3]); + end else FirstViewIndex := 0; + xbase := 0; + for i,v in FTabItemswidth do + begin + if i>=FirstViewIndex then + begin + FTabRects[i] := array(xbase,rec[3]-FTabHeight,xbase+FTabItemswidth[i],rec[3]); + xbase+=FTabItemswidth[i]; + if xbase>(rec[2]-FTabHeight-FTabHeight) then break; + end else + FTabRects[i] := nil; + end + end + end + end + end + function InsureIdxVisible(id); //ȷɼ + begin + if FScrollBtnRect and (not FTabRects[id]) then + begin + if id>FirstViewIndex then + begin + while(not FTabRects[min(id+1,(FTabItems.length()-1))]) do + begin + FirstViewIndex++; + CalcTabs(); + end + end else + if id=0 and id0 then + begin + FirstViewIndex-- ; + CalcTabs(); + InvalidateRect(nil,false); + end + end + function scrollnext(); //һ + begin + if FScrollBtnRect and FirstViewIndex0 then return FTabItems[AIndex].Caption; + return r; + end + function IsContainer(cd);override; + begin + if cd is class(TTabSheet) then return true; + return false; + end + function GetPageID(page); + begin + {** + @explan(˵)ȡpage %% + **} + r := -1; + if page is class(TTabSheet) then + begin + for it := 0 to FTabItems.length()-1 do + begin + if FTabItems[it].PageSheet = page then + begin + return it; + end + end + end + return r; + end + function DoControlAlign();override; + begin + CalcTabs(); + for i := 0 to FTabItems.length()-1 do + begin + it := FTabItems[i]; + if it and it.PageSheet then + begin + pg := it.PageSheet; + if i=FCurrentid then + begin + pg.Visible := true; + rc := getsheetrect(); + if not rc then return ; + rc[1]+=1; + if csDesigning in ComponentState then + begin + rc[0]+=2; + rc[2]-=2; + rc[3]-=2; + end + pg.SetBoundsrect(rc); + end else + pg.Visible := false; + end + end + end + function RemovePageTab(id); + begin + if not(id>=0) then return ; + FTabItems.splice(id,1); + if id = FCurrentid then + begin + if id = 0 then + begin + if FTabItems.length()=0 then + begin + FCurrentid := -1; + end + end + return setselidx(id-1); + end else + if id=FTabItems.length() then return ; + item := FTabItems[ii]; + if ifobj(item) then + begin + pg := item.PageSheet; + if pg then pg.parent := nil; + end + //setselidx(0); //Ƴ + end + function addcontrol(page); + begin + {** + @explan(˵) ӿؼ %% + @param(page)(TTabSheet) sheet; + **} + if not(page is class(TTabSheet)) then return -1; + add := true; + for i := 0 to Controls.count-1 do + begin + if Controls[i]=page then add := false; + end + if add then + begin + page.Visible := false; + page.parent := self; + end + end + function addtabitem(page);//sheet + begin + if not(page is class(TTabSheet)) then return -1; + add := true; + for i := 0 to FTabItems.length()-1 do + begin + if FTabItems[i].PageSheet = page then add := false; + end + add1 := false; + for i := 0 to Controls.count-1 do + begin + if Controls[i]=page then add1 := true; + end + if add and add1 then + begin + it := CreateTableItem(page.caption); + FTabItems.Push(it); + if FTabItems.length()>1 then page.visible := false; + it.PageSheet := Page; + if {HandleAllocated() and} FCurrentid=-1 then + begin + setselidx(0); + end + end + end + function InitializeWnd();override; + begin + inherited; + end + + function AppendPage(page); + begin + {** + @explan(˵)pagesheet %% + @param(page)(TTabSheet)sheet %%; + **} + if not(page is class(TTabSheet)) then return -1; + addcontrol(page); + end + function SetTabText(i,Value); + begin + {** + @explan(˵)޸tabǩ %% + @param(i)(integer) %%; + @param(Value)(string)ı %%; + **} + it := FTabItems[i]; + if it then + begin + if Value = it.caption then + begin + CalcTabs(); + InvalidateRect(nil,false); + end else + begin + it.Caption := Value; + end + end + end + function SetTabIndex(AIndex,AIndexnew); + begin + {** + @explan(˵) ޸ıǩĴ %% + @param(AIndex)(integer) λ %% + @param(AIndexnew)(integer) λ %% + + **} + if (AIndex<>AIndexnew) and (AIndex>=0) and + (AIndex=0) and (AIndexnew p then + begin + oldparent := Parent; + if oldparent then + begin + oldparent.RemoveSide(self); + end + inherited; + parent.AddSide(self); + end else + if not(p is class(TWincontrol))then + begin + odp := Parent; + inherited; + if odp then odp.RemoveSide(self); + end + end + function Recycling();override; + begin + inherited; + end + function publishs();override; + begin + return array("name","border","caption","color","popupmenu","bkbitmap","wsdlgmodalframe","onsize"); + end +end +type TPairSplitter=class(TSysControl) + {** + @explan(˵)ָؼ %% + **} + private + FDRageimglist; + FWill_Drag; + FIs_Draging; + FPosition; + FSides; + FSplitterType; + Fhimgelist; + FEnables; + function EnabledChild(f); + begin + if f then + begin + if FEnables[0]then FSides[0].enabled := true; + if FEnables[1]then FSides[1].enabled := true; + return; + end + FEnables := array(); + s1 := FSides[0]; + S2 := FSides[1]; + if s1 then + begin + FEnables[0]:= s1.enabled; + s1.enabled := false; + end + if s2 then + begin + FEnables[1]:= s2.enabled; + s2.enabled := false; + end + end + Function SetSplitterType(v); + begin + if v in array(pstHorizontal,pstVertical)and v <> FSplitterType then + begin + FSplitterType := v; + if FSplitterType=pstVertical then cursor := OCR_SIZENS else cursor := OCR_SIZEWE; + DoControlAlign(); + end + end + function GetPosition(); + begin + if ifnil(FPosition)then + begin + if FSplitterType=pstHorizontal then + begin + FPosition := Width * 0.3; + end else + begin + FPosition := Height * 0.7; + end + end + return FPosition; + end + function SetPosition(AValue); + begin + if AValue>0 and AValue <> FPosition then + begin + FPosition := integer(AValue); + DoControlAlign(); + end + end + protected + function GetSides(index); + begin + return FSides[index]; + end + public + function create(AOwner);override; + begin + inherited; + caption := "pairspliter"; + width := 200; + height := 200; + Border := false; + WsDlgModalFrame := true; + FSides := new TFpList(); + FSplitterType := pstHorizontal; + cursor := OCR_SIZEWE; + FWill_Drag := true; + end + function CreateParams(p);override; + begin + inherited; + end + function AddSide(ASide); + begin + {** + @explan(˵) side + **} + if not(ASide is class(TPairSplitterSide))then return-1; + if ASide.Parent=self then + begin + if FSides.indexof(ASide)<0 {and FSides.count<2}then + begin + FSides.add(ASide); + DoControlAlign(); + end + end else + begin + ASide.parent := self; + end + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then exit; + if e.button=mbLeft then + begin + if FIs_Draging then + begin + _wapi.ImageList_DragLeave(self.Handle); + _wapi.ImageList_EndDrag(); + if FSplitterType=pstHorizontal then + begin + FPosition := e.xpos; + end else + begin + FPosition := e.ypos; + end + EnabledChild(true); + FWill_Drag := true; + FIs_Draging := false; + _wapi.clipcursor(0); + DoControlAlign(); + end + end + inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then exit; + if e.button=mbLeft then + begin + nxy := clienttowindow(e.xpos,e.ypos); + if FWill_Drag then + begin + FWill_Drag := false; + FIs_Draging := true; + if FDRageimglist then _wapi.ImageList_Destroy(FDRageimglist); + crect := clientrect; + if FSplitterType=pstHorizontal then + begin + FDRageimglist := _wapi.ImageList_Create(5,crect[3],ILC_COLOR16 .| ILC_MASK,5,1); + _wapi.ImageList_BeginDrag(FDRageimglist,0,2,nxy[1]); + end else + begin + FDRageimglist := _wapi.ImageList_Create(crect[2],5,ILC_COLOR16 .| ILC_MASK,5,1); + _wapi.ImageList_BeginDrag(FDRageimglist,0,nxy[0],2); + end + _wapi.ImageList_DragEnter(self.Handle,nxy[0],nxy[1]); + //_wapi.ImageList_DragEnter(self.Handle,e.xpos,e.ypos); + ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3])); + _wapi.clipcursor(ps); + EnabledChild(false); + end + end + inherited; + end + function MouseMove(o,e);override; + begin + if FIs_Draging then + begin + nxy := clienttowindow(e.xpos,e.ypos); + _wapi.ImageList_DragMove(nxy[0],nxy[1]); + end + inherited; + end + function RemoveSide(ASide); + begin + {** + @explan(˵)pairsider %% + **} + id := FSides.indexof(ASide); + if id<0 then exit; + FSides.deli(id); + DoControlAlign(); + if ASide.parent=self then + begin + ASide.parent := nil; + end + end + function Notification(AComponent,Operation);override; + begin + inherited; + if Operation=opRemove then + begin + RemoveSide(AComponent); + end + end + function DoControlAlign();override; + begin + {** + @explan(˵) %% + **} + if not HandleAllocated()then return; + sd1 := GetSides(0); + sd2 := GetSides(1); + if not(sd1 or sd2)then return; + rc := GetClientRect(); + pz := GetPosition(); + pbdr := 0; + {if (csDesigning in ComponentState) then + begin + pbdr := 2; + end } + if sd1 and sd1.HandleAllocated()then + begin + if FSplitterType=pstHorizontal then sd1.setboundsrect(array(rc[0]+pbdr,rc[1]+pbdr,rc[0]+pz,rc[3]-pbdr)); + else sd1.setboundsrect(array(rc[0]+pbdr,rc[1]+pbdr,rc[2]-pbdr,rc[1]+pz)); + end + if sd2 and sd2.HandleAllocated()then + begin + if FSplitterType=pstHorizontal then sd2.setboundsrect(array(rc[0]+pz+4,rc[1]+pbdr,rc[2]-pbdr,rc[3]-pbdr)); + else sd2.setboundsrect(array(rc[0]+pbdr,rc[1]+pz+4,rc[2]-pbdr,rc[3]-pbdr)); + end + end + function Destroy();override; + begin + inherited; + end + function Recycling();override; + begin + if FDRageimglist then _wapi.ImageList_Destroy(FDRageimglist); + inherited; + end + function WMERASEBKGND(o,e):WM_ERASEBKGND;override; + begin + dc := e.wparam; + if dc then + begin + cl := Color; + rect := array(0,0,0,0); + if e.lparam=2 then + begin + rect := PAINTSTRUCT().rcpaint(); + end else + if HandleAllocated()then + begin + _wapi.GetClientRect(self.Handle,rect); + end else + return; + rc := rect; + wd := 5; + if pstHorizontal=FSplitterType then + begin + rc[0]:= FPosition-wd; + rc[2]:= FPosition+wd; + end else + begin + rc[1]:= FPosition-wd; + rc[3]:= FPosition+wd; + end + rect := rc; + if ifnumber(cl)then + begin + Canvas.Brush.Color := cl; + Canvas.Handle := dc; + Canvas.FillRect(rect); + end else + begin + cl := _wapi.GetStockObject(WHITE_BRUSH); + _wapi.FillRect(dc,rect,cl); + end + e.skip := true; + e.Result := 1; + end + end + property Position:integer read GetPosition write SetPosition; + property SplitterType:SplitterType read FSplitterType write SetSplitterType; + function publishs();override; + begin + return array("name","left","top","width","height", + "align","anchors","border","caption","enabled","visible","SplitterType","position", + "wsdlgmodalframe","wscaption","wspopup","wssizebox","wssysmenu"); + end + {** + @param(Position)(integer) ָλ %% + @param(SplitterType)(menuber of TPairSplitterType) ָλ %% + **} +end + + //ؼ +type TTlvnActiveEvent=class(tuieventbase) + {** + @explan(˵) listview active ֪ͨϢ %% + **} + private + FNmList; + function _getvalue_(n); + begin + return FNmList._getvalue_(n); + end + function _setvalue_(n,v); + begin + return FNmList._setvalue_(n,v); + end + public + function create(m,w,l,h);override; + begin + inherited; + FNmList := new ttagNMLISTVIEW(l); + end + property hdr index "hdr" read _getvalue_ write _setvalue_; + property iitem index "iitem" read _getvalue_ write _setvalue_; + property isubitem index "isubitem" read _getvalue_ write _setvalue_; + property unewstate index "unewstate" read _getvalue_ write _setvalue_; + property uoldstate index "uoldstate" read _getvalue_ write _setvalue_; + property uchanged index "uchanged" read _getvalue_ write _setvalue_; + property ptaction index "ptaction" read _getvalue_ write _setvalue_; + property lparam index "lparam" read _getvalue_ write _setvalue_; +end +type ttagNMLISTVIEW=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("hdr","user", + ( + ("hwndfrom","intptr",0), + ("idfrom","intptr",0), + ("code","int",0))), + ("iitem","int",0), + ("isubitem","int",0), + ("unewstate","int",0), + ("uoldstate","int",0), + ("uchanged","int",0), + ("ptaction","int[2]", + (0,0)), + ("lparam","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end +end + +type TGridCtl = class(TCustomControl) + {** + @explan(˵) ԻƱؼ %% + **} + function Create(AOwner);override; + begin + inherited; + FLocalX := 0; + FLocalY := 0; + Width := 300; + Height := 260; + FMouseSizeColumnWidth := 1; + FAutoScroll := 3; + FItemCount := 0; + FFixedRows := 1; + FColumFixed := 0; + FColWidth := 5; //10; + FRowWidth := 10; + FC_NORMAL := OCR_NORMAL; + FC_SIZE := OCR_SIZEWE; + FC_SIZE2 := OCR_SIZENS; + FMarginLeft := 1; + FMarginTop := 1; + FMarginRight := 0; + FMarginBottom := 0; + FRowHeight := 30; + FColsWidths := new TMyArrayB(); + FRowsHeight := new TMyArrayB(); + FVariableRows := false; + FSI := new TScrollinfo(); + end + function GetItemRect(i);virtual; + begin + {** + @explan(˵) е %% + @param(i)(integer) к %% + @return(array) array(,,,); + **} + yrct := GetItemYBound(i); + if not yrct then return nil; + basex := FMarginLeft-FColWidth * GetXpos(); + //r := array(basex,yrct[0],yrct[1],0); + r := array(basex,yrct[0],0,yrct[1]); + for ii := 0 to FColsWidths.length()-1 do + begin + basex += FColsWidths[ii]; + end + r[2]:= basex; + return r; + end + function GetItemStartY(i);virtual; + begin + {** + @explan(˵) еΧ %% + @param(i)(integer) к %% + @return(array) array(,); + **} + if(i<0 or i >= GetItemCount())then return nil; + yb := FMarginTop; + itv := FRowHeight; + if FVariableRows then + begin + for ii := 0 to i-1 do + begin + yb += FRowsHeight[ii]; + end + itv := FRowWidth; + end else + yb += i * FRowHeight; + if i= 0 and j= x then return i; + if basex >= x then return i; + end + return r; + end + function InvalidateItem(i);virtual; + begin + {** + @explan(˵) ˢ%% + @param(i)(integer) к %% + **} + bd := GetItemYBound(i); + if not bd then return false; + rec := ClientRect; + if bd[1]>rec[3]or bd[0]rec[3]or rec1[3]rec[2]or rec1[2]= x then return i; + if basex >= x then return i; + end + end else + begin + r := integer((y-FMarginTop)/FRowHeight); + if y <= FYfiexed then + begin + if r >= FItemCount then return-1; + return r; + end + ybase := GetYPos(); + r += ybase; + if r >= FItemCount then return-1; + return r; + end + return r; + end + function SetColumns(cls,beg,len);virtual; + begin + {** + @explan(˵) пϢ %% + @param(cls)(array of integer) п %% + @param(beg)(integer) ʼλ %% + @param(len)(integer) %% + **} + clsa := array(); + for i,v in cls do + begin + if v >= 0 then clsa[length(clsa)]:= v; + end + FColsWidths.splices(beg>0?beg:0,len >= 0?len:FColsWidths.Length(),clsa); + InitialScroll(nil,nil,0); + end + function SetRows(rows,beg,len);virtual; + begin + if not FVariableRows then return; + clsa := array(); + for i,v in rows do + begin + if v>0 then clsa[length(clsa)]:= v; + end + FRowsHeight.splices(beg>0?beg:0,len >= 0?len:FRowsHeight.Length(),clsa); + InitialScroll(nil,nil,0); + end + function GetColumnWidth(i); + begin + {** + @explan(˵) õiп %% + @param(i)(integer) к %% + @return(integer) %% + **} + return FColsWidths[i]; + end + function SetColumnWidth(i,w); + begin + {** + @explan(˵) п %% + @param(i)(integer) %% + @param(w)(integer) ¿ 0 %% + **} + vi := FColsWidths[i]; + if vi >= 0 and w >= 0 and vi <> w then UpDateColumWidth(i,w); + end + function DrawCell(cvs,rec,i,j);virtual; + begin + {** + @explan(˵) ƵԪ %% + @param(cvs)(tcanvas) %% + @param(rec)(array) array() %% + @param(i)(integer) к %% + @param(j)(integer) к %% + **} + dr := array(rec[0:1],rec[2:3]); + if i0 then ps[2]:= min(ClientRect[2]-FMarginRight,ps[2]); + if FMarginBottom>0 then ps[3]:= min(ClientRect[3]-FMarginBottom,ps[3]); + FValidateRect := ps; + tp := ps[1]; + bo := ps[3]; + //***************ͷ******************* + basex := FMarginLeft-xpos * FColWidth; + x := basex; + x2 := FMarginLeft; + cvs.Font := font; + drawcol := array(); + for i,v in FColsWidths.Data do + begin + if i= ps[0])and x2= FColumFixed then + begin + if(x+v >= ps[0])and x= ps[1])and y2= FFixedRows then + begin + if(y+v >= ps[1])and y= vj[1]then continue; + for i,vi in drawrow do + begin + if i= FColumFixed then + begin + if FindMerge(i,j,mergb)then + begin + end else + partb[partbl++]:= array(array(vj[0],vi[0],vj[1],vi[1]),i,j); + end else + if i >= FFixedRows and j= FFixedRows and j >= FColumFixed then + begin + if FindMerge(i,j,mergd)then + begin + end else + partd[partdl++]:= array(array(vj[0],vi[0],vj[1],vi[1]),i,j); + end + end + end + if parta or merga then + begin + DrawAllParts(cvs,parta,merga,array(FMarginLeft,FMarginTop,FXfiexed,FYfiexed)); + end + if partb or mergb then + begin + DrawAllParts(cvs,partb,mergb,array(FXfiexed,FMarginTop,ps[2],FYfiexed)); + end + if partc or mergc then + begin + DrawAllParts(cvs,partc,mergc,array(FMarginLeft,FYfiexed,FXfiexed,ps[3])); + end + if partd or mergd then + begin + DrawAllParts(cvs,partd,mergd,array(FXfiexed,FYfiexed,ps[2],ps[3])); + end + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return false; + if e.button()<> mbLeft then return false; + if FC_CURRENT=FC_SIZE then //С + begin + FSizeColum := 1; + _wapi.ClipCursor(FCursorRect); + return true; + end else + if FC_CURRENT=FC_SIZE2 then + begin + FSizeColum := 2; + _wapi.ClipCursor(FCursorRect); + return true; + end + end + function MouseUp(o,e);override; + begin + if FSizeColum then + begin + FSizeColum := false; + _wapi.ClipCursor(0); + return true; + end + end + function MouseMove(o,e);override; + begin + if csDesigning in ComponentState then return false; + if not FMouseSizeColumnWidth then + begin + setcursornormal(); + return 0; + end + y := e.yPos; + X := e.xpos; + if FMouseSizeColumnWidth .& 1>0 then + begin + if x0)and FVariableRows then + begin + basey := FMarginTop; + if y >= FYfiexed then + begin + xdx := GetYpos(); + basey := FMarginTop-FRowWidth * xdx; + end + end + if(FMouseSizeColumnWidth=0)then + begin + setcursornormal(); + return 0; + end + if FColsWidths.length()>0 and GetItemCount()>0 and x>(FMarginLeft+5)and y>(FMarginTop+5) {and y<(FMarginTop+FRowHeight*FFixedRows) }then + begin + if FSizeColum=1 then + begin + wd := FColsWidths[FCurrentSizeId]; + UpDateColumWidth(FCurrentSizeId,wd+x-FCurrentSizePos); + FCurrentSizePos := x; + return true; + end else + if FSizeColum=2 then + begin + wd := FRowsHeight[FCurrentSizeId]; + UpDateRowWidth(FCurrentSizeId,wd+y-FCurrentSizePos); + FCurrentSizePos := y; + return true; + end else + begin + bx := basex; + rc := ClientRect; + if FMouseSizeColumnWidth .& 1>0 then + begin + for i,v in FColsWidths.Data do + begin + if abs(x-bx-v)<3 then + begin + FCurrentSizeId := i; + FCurrentSizePos := x; + FCursorRect := array(clientToScreen(max(bx+6,rc[0]+6),y-10),clientToScreen(rc[2],y+10)); + setcursorsize(); + return true; + end + bx += v; + end + end + if FVariableRows and(FMouseSizeColumnWidth .& 2>0)then + begin + bx := basey; + for i,v in FRowsHeight.Data do + begin + if abs(y-bx-v)<3 then + begin + FCurrentSizeId := i; + FCurrentSizePos := y; + FCursorRect := array(clientToScreen(x-10,max(rc[1]+6,bx+6)),clientToScreen(x+10,rc[3])); + setcursorsize2(); + return true; + end + bx += v; + end + end + end + end + setcursornormal(); + return false; + end + //ϵͳ + function DoWMSIZE(o,e);override; //С + begin + InitialScroll(e.lolParam,e.hilparam); + inherited; + end + function DoMouseWheel(o,e);override; + begin + hwnd := self.Handle; + FSI.fMask := SIF_ALL; + _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); + // 浱ǰλãЩбȽ + yPos := FSI.nPos; + dd := 0; + if e.delta<0 and FSI.nMax>yPos then + begin + dd++; + end + if e.delta>0 and FSI.nMin yPos)then + begin + //_wapi.ScrollWindow(hwnd, 0, FRowHeight * (yPos - FSI.nPos), nil, ClipScroll()); + ivrect := ClientRect; + ivrect[1]:= FYfiexed; //FMarginTop+FRowHeight*FFixedRows; + InvalidateRect(ivrect,false); + //UpdateWindow(hwnd); + end + return 0; + end + function DoHScroll(o,e);override; + begin + FSI.fMask := SIF_ALL; + _wapi.GetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_); + // 浱ǰλãЩбȽ + xPos := FSI.nPos; + case e.lowparam of + // ûߵ + SB_LEFT: + begin + FSI.nPos := FSI.nMin; + end + SB_RIGHT: + begin + FSI.nPos := FSI.nMax; + end + SB_LINELEFT: + begin + FSI.nPos -= 1; + end + // ûұߵ + SB_LINERIGHT: + begin + FSI.nPos += 1; + end + // ûߵĹ + SB_PAGELEFT: + begin + FSI.nPos -= FSI.nPage; + end + // ûұߵĹ + SB_PAGERIGHT: + begin + FSI.nPos += FSI.nPage; + end + // û϶ + SB_THUMBTRACK: + begin + FSI.nPos := FSI.nTrackPos; + end + end; + if FSI.nPos=xPos then return; + // ùλ + FSI.fMask := SIF_POS; + _wapi.SetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_,TRUE); + // ùλãڴڵܲͬһֵ + _wapi.GetScrollInfo(e.hwnd,SB_HORZ,FSI._getptr_); + // ǰıֵбȽϣͬ + FLocalX := FSI.nPos; + if(FSI.nPos <> xPos)then + begin + //_wapi.ScrollWindow(e.hwnd, FColWidth * (xPos - FSI.nPos), 0, NIL,ClipScroll()); + ivrect := ClientRect; + ivrect[0]:= FXfiexed; //FMarginTop+FRowHeight*FFixedRows; + InvalidateRect(ivrect,false); + //UpdateWindow(hwnd); + end + end + function MergeCells(cells); + begin + {** + @explan(˵) Ԫ %% + @param(cells)(array) array(ʼ,ʼ,,) %% + **} + nm := new TMerger(); + nm.SetMergeCells(cells); + if nm.isok then + begin + if not ifarray(FMergers)then FMergers := array(); + FMergers[length(FMergers)]:= nm; + end + end + function GetMergeInfo(); + begin + {** + @explan(˵) úϲϢ %% + **} + r := array(); + for i,v in FMergers do + begin + r[i]:= v.FCells; + end + return r; + end + function CleanMergeCells(); + begin + {** + @explan(˵) պϲϢ %% + **} + FMergers := array(); + end + function GetGridMargin(); + begin + return array(FMarginLeft,FMarginTop,FMarginRight,FMarginBottom); + end + function SetGridMargin(l,t,r,b); + begin + if l >= 0 then nl := integer(l); + if t >= 0 then nt := integer(t); + if r >= 0 then nr := integer(r); + if b >= 0 then nb := integer(b); + f := false; + if nl >= 0 and nl <> FMarginLeft then + begin + f := true; + FMarginLeft := nl; + end + if nt >= 0 and nt <> FMarginTop then + begin + f := true; + FMarginTop := nt; + end + if nr >= 0 and nr <> FMarginRight then + begin + //f := true; + FMarginRight := nr; + end + if nb >= 0 and nb <> FMarginBottom then + begin + //f := true; + FMarginBottom := nb; + end + if f then InitialScroll(nil,nil,0); + end + //******************* + property AutoScroll read FAutoScroll write setAutoScroll; + property ItemCount read GetItemCount write SetItemCount; + property ItemHeight read FRowHeight write SetRowHeigt; + property MouseSizeCell read FMouseSizeColumnWidth write FMouseSizeColumnWidth; + property FixedRows read FFixedRows write SetFixedRows; + property FixedColumns read FColumFixed write SetFixedColumns; + property ColumnCount read GetColumnCount; + property VariableRows read FVariableRows write SetVariableRows; + {** + @param(ItemCount)(integer) %% + @param(MouseSizeCell)(bool) ıп %% + @param(FixedRows)(integer) ̶Ϊб %% + **} + protected + function ItemUpDated(flag,idx);virtual; + begin + {** + @explan(˵) ״̬ %% + @param(flag)(bool) Ƿǿˢ,ĬϵȲʱˢ %% + @param(idx)(integer) idԺ %% + **} + if HandleAllocated()and not(IsUpDating())then + begin + InitialScroll(nil,nil,idx); + end + end + function InitialScroll(x,y,idx);virtual; + begin + if not HandleAllocated()then return; + UpDateFixed(); + if IsUpDating()then return; + if not(x>0 and y>0)then + begin + rc := ClientRect; + xClient := rc[2]; + yClient := rc[3]; + end else + begin + xClient := x; + yClient := y; + end + xClient -= FXfiexed; + yClient -= FYfiexed; + if xClient FVariableRows then + begin + if not FVariableRows then + begin + if FItemCount>0 then + begin + FRowsHeight.splices(0,FRowsHeight.length(),(zeros(FItemCount)+FRowHeight)); + end + end else + begin + FItemCount := FRowsHeight.Length(); + end + FVariableRows := nv; + InitialScroll(nil,nil,0); + end + end + function setAutoScroll(sc); + begin + if not(nv in array(0,1,2,3))then return 0; + if FAutoScroll <> sc then + begin + FAutoScroll := sc; + InitialScroll(nil,nil,0); + end + end + function GetColumnCount(); + begin + return FColsWidths.length(); + end + + function SetItemCount(ct); + begin + if FItemCount <> ct and ct >= 0 then + begin + FItemCount := ct; + if not FVariableRows then InitialScroll(nil,nil,0); + end + end + function SetRowHeigt(h); + begin + if FRowHeight <> h and h >= 5 then + begin + FRowHeight := h; + InitialScroll(nil,nil,0); + end + end + function SetFixedColumns(rs); + begin + if rs >= 0 and FColumFixed <> rs then + begin + FColumFixed := rs; + InitialScroll(nil,nil,0); + end + end + function SetFixedRows(rs); + begin + if rs >= 0 and FFixedRows <> rs then + begin + FFixedRows := rs; + InitialScroll(nil,nil,0); + end + end + + function UpDateColumWidth(idx,value); + begin + if idx >= 0 and value >= 0 then + begin + if FColsWidths[idx]=value then return; + FColsWidths[idx]:= value; + InitialScroll(nil,nil,0); + end + end + function UpDateRowWidth(idx,value); + begin + if FVariableRows and idx >= 0 and value>0 then + begin + if FRowsHeight[idx]=value then return; + FRowsHeight[idx]:= value; + InitialScroll(nil,nil,0); + end + end + + function UpDateFixed(); //¹̶ + begin + xfix := 0; + FxWidth := 0; + nx := min(FColumFixed,FColsWidths.length())-1; + for i := 0 to FColsWidths.length()-1 do + begin + vi := FColsWidths[i]; + if i <= nx then xfix += vi; + FxWidth += vi; + end + if FVariableRows then + begin + FyHeight := FMarginTop; + FYfiexed := FMarginTop; + ny := min(FFixedRows,FRowsHeight.length())-1; + for i := 0 to FRowsHeight.length()-1 do + begin + vi := FRowsHeight[i]; + if i <= ny then FYfiexed += vi; + FyHeight += vi; + end + end else + begin + FYfiexed := FMarginTop+FFixedRows * FRowHeight; + end + FXfiexed := FMarginLeft+xfix; + end + function setcursorsize2(); + begin + IF FC_CURRENT <> FC_SIZE2 then + begin + cursor := FC_SIZE2; + FC_CURRENT := FC_SIZE2; + end + end + function setcursorsize(); + begin + IF FC_CURRENT <> FC_SIZE then + begin + cursor := FC_SIZE; + FC_CURRENT := FC_SIZE; + end + end + function setcursornormal(); + begin + if FC_CURRENT <> FC_NORMAL then + begin + cursor := FC_NORMAL; + FC_CURRENT := FC_NORMAL; + end + end + function GetHeaderRect(); + begin + end + type TPAINTCOUNT=class + {** + @explan(˵) Ƽ %% + **} + function create(v); + begin + if v is class(TControl)then + begin + FPainter := v; + v.BeginUpDate(); + end + end + function Destroy(); + begin + if FPainter then FPainter.EndUpDate(); + FPainter := nil; + end + FPainter; + end + type TMerger=class + public + FCells; + function Create(); + begin + FCells := array(); // r,c value + end + function isok(); + begin + return length(FCells); + end + function mergeid(i,j); + begin + i := FCells[0]; + j := FCells[1]; + end + function CellInMerge(i,j); + begin + if isok()then + begin + if i >= FCells[0]and i <= FCells[2]and j >= FCells[1]and j <= FCells[3]then return true; + end + return false; + end + function GetRange(); + begin + r := array(); + if isok()then + begin + return FCells; + end + return r; + end + function SetMergeCells(rec); + begin + FCells := array(); + if not ifarray(rec)then return; + if(rec[2]>= rec[0]and rec[3]>rec[1])or(rec[2]>rec[0]and rec[3]>= rec[1])then FCells := rec; + end + end + FMergers; + FAutoScroll; + //̶*********** + FXfiexed; + FYfiexed; + //********************* + FC_NORMAL; + FC_SIZE; + FC_SIZE2; + FC_CURRENT; + //******λ*************** + FMarginLeft; + FMarginTop; + FMarginRight; + FMarginBottom; + //*******ͷ*********** + FColWidth; + FRowWidth; // ߻߶ + FxWidth; + FyHeight; + FFixedRows; + FColsWidths; + FRowsHeight; + FColumFixed; + FRowHeight; + FVariableRows; //и߿ɱ + //*********************************** + FItemCount; + //************** + FSI; + //п + FMouseSizeColumnWidth; + FSizeColum; + FCursorRect; + FCurrentSizeId; + FCurrentSizePos; +end +type TGRidBase = class(TGridCtl) + {** + @explan(˵) %% + **} + private + FGridLine; + FColumHeader; + FonColumnClick; + FColumTexts; + private + function SetGridLine(v); + begin + nv := v?true:false; + if nv <> FGridLine then + begin + FGridLine := nv; + end + end + function SetColumHeader(v); + begin + nv := v?true:false; + if nv <> FColumHeader then + begin + ct := ItemCount; + FColumHeader := nv; + if nv then + begin + FixedRows := 1; + end else + FixedRows := 0; + ItemCount := ct; + end + end + + function SetItemCount(r); + begin + if r >= 0 then + begin + if ColumnHeader then + begin + class(TGridCtl).ItemCount := r+1; + end else + class(TGridCtl).ItemCount := r; + end + end + function GetItemCount(); + begin + if ColumnHeader then + begin + return class(TGridCtl).ItemCount-1; + end else + return class(TGridCtl).ItemCount; + end + function GetColumInfo(); + begin + r := array(); + for i := 0 to FColumTexts.Length()-1 do + begin + r[i,"text"]:= FColumTexts[i]; + r[i,"width"]:= GetColumnWidth(i); + end + return r; + end + protected + function GetColumns();virtual; + begin + return GetColumInfo(); + end + function ClickedGridItem(o,e);virtual; + begin + {** + @explan(˵)ʱ %% + **} + end + function RClickedGridItem(o,e);virtual; + begin + {** + @explan(˵)ʱ %% + **} + end + function CreateVclick(o,e); + begin + ne := new TTlvnActiveEvent(100,0,0,o.handle); + ne.iitem := GetRowIndexByPos(e.ypos); + ne.isubitem := GetColIndexByPos(e.xpos); + ne.ptaction := array(e.xpos,e.ypos); + return ne; + end + public + function GetRowIndexByPos(y);override; + begin + r := inherited; + if r >= 0 and FColumHeader then r--; + return r; + end + function Create(AOwner);override; + begin + inherited; + caption := "grid"; + FixedRows := 1; + FGridLine := true; + FColumHeader := true; + ItemCount := 0; + Visible := true; + FColumTexts := new TMyarrayB(); + end + function Recycling();override; + begin + onColumnClick := nil; + inherited; + end + function GetSubItemRect(i,j);override; + begin + {** + @explan(˵) %% + @return(array) array(,,,); + **} + i1 := i; + if FColumHeader then + begin + i1 := i+1; + end + r := inherited GetSubItemRect(i1,j); + if not r then return zeros(4); + return r; + end + function InvalidateItem(i);override; + begin + i1 := i; + if FColumHeader then i1++; + inherited InvalidateItem(i1); + end + function GetItemRect(id);override; + begin + {** + @explan(˵) е %% + @return(array) array(,,,); + **} + i1 := id; + if FColumHeader then + begin + i1 += 1; + end + r := inherited GetItemRect(i1); + if r then return r; + return array(0,0,0,0); + end + function HitTestItem(x,y) + begin + {** + @explan(˵)λ %% + **} + i := GetRowIndexByPos(y); + return array(i,ifnumber(x)?GetColIndexByPos(x):0); + end + function SetColumns(cs,beg,len);override; + begin + if not cs then + begin + FColumTexts.splices(beg>0?beg:0,len >= 0?len:FColumTexts.Length(),array()); + Inherited SetColumns(array(),beg,len); + return; + end + if ifarray(cs)then + begin + wds := array(); + cls := array(); + idx := 0; + for i,v in cs do + begin + if ifarray(v)and ifstring(v["text"])then + begin + wd := v["width"]; + owd := GetColumnWidth(i); + wds[idx]:= v["width"]>= 0?v["width"]:(owd >= 0?owd:100); + cls[idx++]:= v["text"]; + end + end + owds := array(); + for i := 0 to ColumnCount-1 do + begin + owds[i]:= GetColumnWidth(i); + end + if(cls=FColumTexts.Data)and(owds=wds)then exit; + if ifnil(beg)and ifnil(len)then DeleteAllColumns(); + FColumTexts.splices(beg>0?beg:0,len >= 0?len:FColumTexts.Length(),cls); + Inherited SetColumns(wds,beg,len); + end + end + function DeleteColumn(i);virtual; + begin + {** + @explan(˵) ɾij + **} + SetColumns(array(),i,1); + end + function InSertColumn(txt,wd,idx);virtual; + begin + {** + @explan(˵) %% + @param(txt)(string) %% + @param(wd)(integer) %% + @param(idx)(integer) ֮ǰ%% + **} + if not(ifstring(txt)and wd >= 0)then return-1; + if idx >= 0 then p := idx; + else p := ColumnCount; + SetColumns(array(("text":txt,"width":wd)),p,0); + end + function DeleteAllColumns();virtual; + begin + {** + @explan(˵) ɾ %% + **} + DeleteAllItems(); + SetColumns(array(),nil,nil); + end + function DeleteAllItems();virtual; + begin + {** + @explan(˵) %% + **} + ItemCount := 0; + end + function DeleteItem(i);virtual; + begin + ItemCount := ItemCount-1; + end + function InsertItem(item);virtual; + begin + ItemCount := ItemCount+1; + end + function SetColumnText(n,t); + begin + FColumTexts[n]:= t; + end + function GetColumnText(n); + begin + return FColumTexts[n]; + end + function clean(); + begin + {** + @explan(˵) ĿԼͷ %% + **} + DeleteAllColumns(); + end + function DrawHeader(o,e);virtual; + begin + rec := e.rcitem; + cvs := e.canvas; + j := e.Subitemid; + dr := array(rec[0:1],rec[2:3]); + cvs.Draw("FrameControl",dr,DFC_BUTTON,DFCS_BUTTONPUSH); + cs := GetColumnText(j); + if ifstring(cs)then cvs.drawtext(cs,rec,DT_VCENTER .| DT_SINGLELINE .| DT_CENTER .| DT_NOPREFIX); + end + function DrawCell(cvs,rec,i,j);override; //Ʊͷ + begin + if not HandleAllocated()then return; + //Ϣ + hd := self.Handle; + e := new TGRIDMDRAWITEM(WM_DRAWITEM,0,0,hd); + e.canvas := cvs; + if FColumHeader then e.itemid := i-1; + else e.itemid := i; + e.rcitem := rec; + e.SubItemRect := rec; + e.Subitemid := j; + if FColumHeader and i=0 then + begin + return DrawHeader(self(true),e); + end + DoDrawItem(self(true),e); + end + function DoDrawItem(o,e);virtual; + begin + DoDrawSubItem(o,e); + end + function DoDrawSubItem(o,e);virtual; + begin + if FGridLine then + begin + rc := e.rcitem; + dc := e.canvas; + dc.Pen.Color := rgb(200,200,200); + dc.moveto(array(rc[2],rc[1])); + dc.LineTo(array(rc[2],rc[3])); + dc.LineTo(array(rc[0],rc[3])); + if e.Subitemid=0 then + begin + dc.LineTo(array(rc[0],rc[1])); + end + if e.itemid=0 then + begin + dc.MoveTo(array(rc[0],rc[1])); + dc.LineTo(array(rc[2],rc[1])); + end + end + end + function DoSelectChanged(o,nindex,oindex);virtual; + begin + end + function MouseDown(o,e);override; + begin + r := inherited; + if r then return r; + if e.shiftdouble()and e.button()=mbLeft then //˫ + begin + ne := CreateVclick(o,e); + ClickedGridItem(o,ne); + CallMessgeFunction(ondblclick,o,ne); + end + end + function MouseUp(o,e);override; + begin + r := inherited; + if r then return r; + ne := CreateVclick(o,e); + bt := e.button(); + if bt=mbRight then + begin + RClickedGridItem(o,ne); + CallMessgeFunction(onrclick,o,ne); + end else + if bt=mbLeft then + begin + if FColumHeader and(inherited GetRowIndexByPos((ne.ptaction)[1]))=0 then + begin + CallMessgeFunction(onColumnClick,o,ne); + end else + begin + ClickedGridItem(o,ne); + CallMessgeFunction(onclick,o,ne); + end + end + //e.skip := true; + //rclick + //click + //LVN_COLUMNCLICK + end + property GridLine:bool read FGridLine write SetGridLine; + property ColumnHeader:bool read FColumHeader write SetColumHeader; + property ItemCount:integer read GetItemCount write SetItemCount; + property onColumnClick:eventhandler read FonColumnClick write FonColumnClick; + property Columns:statusitems read GetColumns write SetColumns; + { + @param(GridLine)(bool) Ƿ %% + @param(ColumnHeader)(bool) Ƿбͷ %% + @param(color)(integer) ɫ %% + @param(onColumnClick)(function[TGRidBase,TTlvnActiveEvent]) б %% + } +end +type TDrawGrid=class(TGRidBase) + {** + @explan(˵)Ի %% + **} + Private + FOnDoDrawSubItem; + protected + public + function Create(AOwner);override; + begin + inherited; + end + function DoDrawSubItem(o,e);override; + begin + inherited; + CallMessgeFunction(OnDoDrawSubItem,o,e); + end + function Recycling();override; + begin + FOnDoDrawSubItem := nil; + inherited; + end + property OnDoDrawSubItem read FOnDoDrawSubItem write FOnDoDrawSubItem; + {** + @param(OnDoDrawSubItem)(function[tdrawgrid,TGRIDMDRAWITEM]) %% + @param(ItemCount)(integer) %% + **} +end + +type TListView = class(TDrawGrid) + {** + @explan(˵) listviewؼ %% + **} + private + FMouseCurrentTime; + FList; + FIntAlign; + FSelected; + FMoueonItem; + FSelBkColor; + FMouseOnBkColor; + FMenus; + FSelectedChanged; + FOnCheckItem; + FCanSelected; + FColumnBool; + FPrevSelectedId; + Function SetIntAlign(v); + begin + if v in array(DT_CENTER,DT_LEFT,DT_RIGHT)then + begin + if v <> FIntAlign then + begin + FIntAlign := v; + InvalidateRect(nil,false); + end + end + end + function CallSelChanged(); + begin + return calldatafunction(OnSelChanged,self(true),new tuieventbase(0,0,0,0)); + end + function SetCanSelected(v); + begin + vn := v?true:false; + if FCanSelected <> vn then + begin + FCanSelected := vn; + if not UnSelected then UnSelected(); + end + end + function SetSelected(id); + begin + if not FCanSelected then exit; + if id=FSelected then exit; + if id<0 then exit; + odid := FSelected; + FPrevSelectedId := odid; + FSelected := id; + if odid >= 0 then + begin + InvalidateItem(odid); + end + InvalidateItem(id); + CallSelChanged(); + end + function GetSelected(); + begin + if FSelected >= 0 then return FList[FSelected]; + return nil; + end + + function GetListValues(); + begin + r := array(); + for i := 0 to FList.count-1 do + begin + r[i]:= FList[i]; + end + return r; + end + function CreateMenu(); + begin + if FMenus then return FMenus; + createmenubyarray(menus(),FMenus); + return FMenus; + end + function createmenubyarray(ms,pm); + begin + if not(ifarray(ms)and ms)then exit; + if ms["type"]="menu" then + begin + if not pm then pm := new TPopUpmenu(FCwnd); + if ifstring(ms["caption"])then + begin + mu := new tmenu(FCwnd); + mu.caption := ms["caption"]; + o := ms["onclick"]; + mu.onclick := ms["onclick"]; + mu.parent := pm; + call(thisfunction,ms["items"],mu); + end + end else + for i,v in ms do + begin + call(thisfunction,v,pm); + end + end + public + function menus();virtual; + begin + {** + @explan(˵) ز˵ %% + @return(array) array(("type":"menu","caption":"ɾ") + ,("type":"menu","caption":"")) + **} + return array(); + return array(("type":"menu","caption":"ɾ") + ,("type":"menu","caption":"")); + end + function DeleteAllItems();override; + begin + {** + @explan(˵) %% + **} + UnSelected(); + FList.clean(); + inherited; + end + function GridDrawItem(id); + begin + {** + @explan(˵) Ƶid %% + **} + InvalidateItem(id); + end + function SetSelectedValue(v); + begin + {** + @explan(˵) ѡĿ %% + **} + id := FList.indexof(v); + if id >= 0 and id= 0 and id <> FMoueonItem then + begin + odid := FMoueonItem; + FMoueonItem := id; + if odid >= 0 and odid <> FSelected then + begin + InvalidateItem(odid); + end + if id <> FSelected then + begin + InvalidateItem(id); + end + end} + end + protected + function ClickedGridItem(o,e);override; + begin + {** + @explan(˵)ʱ %% + **} + id := e.iitem; + j := e.isubitem; + BJ := FColumnBool[j]; + if BJ then + begin + if ifarray(BJ)and BJ[1]then + begin + it := o.GetItem(id); + if ifarray(it)then + begin + idx := mrows(it,1)[j]; + if ifnumber(idx)or ifstring(idx)then + begin + tti := it[idx]; + if tti=inf or tti=-inf then exit; + it[idx]:= not tti; + o.SetItem(id,it); + rec := o.GetSubItemRect(i,j); + o.InvalidateRect(rec,false); + return; + end + end + end + end + return SetSelected(id); + end + function RClickedGridItem(o,e);override; + begin + {** + @explan(˵)ʱ %% + **} + id := e.iitem; + return SetSelected(id); + end + public + function DoDrawItem(o,e);override; // + begin + { + @explan(˵) %% + } + if not Visible then exit; + if FSelected=e.itemid then + begin + if ifnumber(SelBkColor)then e.canvas.brush.color := SelBkColor; + else e.canvas.brush.color := rgb(255,255,255); + end else + if FMoueonItem=e.itemid then + begin + if ifnumber(MouseOnBkColor)then e.canvas.brush.color := MouseOnBkColor; + else e.canvas.brush.color := rgb(255,255,255); + end else + begin + e.canvas.brush.color := rgb(255,255,255); + end + rec := e.rcitem; + rec[0]+= 1; + rec[1]+= 1; + rec[2]-= 1; + rec[3]-= 1; + e.canvas.fillrect(rec); + DoDrawSubItem(o,e); + end + function moveup(); + begin + {** + @explan(˵) ѡ %% + **} + sd := FSelected; + if sd>0 then + begin + FList.swap(sd,sd-1); + FSelected -= 1; + GridDrawItem(sd); + GridDrawItem(sd-1); + end + end + function movedown(); + begin + {** + @explan(˵) ѡ %% + **} + sd := FSelected; + if sd >= 0 and sd= 0 and id= 0 then + begin + FMoueonItem := nil; + FList.deli(sd); + ct := FList.Count-1; + if sd>ct then + begin + FPrevSelectedId := FSelected; + FSelected := ct; + CallSelChanged(); + end + deleteitem(sd); + end + end + function create(AOwner);override; + begin + inherited; + FMouseCurrentTime := 0; + FIntAlign := DT_RIGHT; + border := true; + FList := new TFpList(); + SelBkColor := 0xface87;//0xffbf00;//0xB0E0E6; //rgb(200,200,0); + ItemHeight := 30; + //MouseOnBkColor := nil;// 0xface87;//0xF8F8FF; //rgb(0,200,200); + CreateMenu(); + PopupMenu := FMenus; + FCanSelected := true; + FPrevSelectedId :=-1; + FColumnBool := array(); + end + function CheckItem(v);virtual; + begin + {** + @explan(˵) Ŀ %% + **} + if datatype(FOnCheckItem)=7 then + begin + return call(FOnCheckItem,v); + end + return true; + end + function InsertItem(v,id);virtual; + begin + {** + @explan(˵) idĿ %% + @param(v)() Ŀ %% + @param(id)(integer) λ %% + **} + if CheckItem(v)then + begin + if id >= 0 and id <= FList.Count+1 then + begin + FList.insertafter(v,id-1); + ItemCount := FList.Count; + if FSelected >= 0 and(id-1)= 0 and id <= FList.Count then + begin + FList.insertafter(v,id); + ItemCount := FList.Count; + if FSelected >= 0 and id= 0 and idx= 0 and idx v then + begin + FList.seti(idx,v); + if HandleAllocated()then + begin + rec := GetItemRect(idx); + InvalidateRect(rec,false); + end + end + end + end + end + function DeleteItem(i);override; + begin + sd := i; + if sd >= 0 and sd= 0 then FPrevSelectedId := dsf; + CallSelChanged(); + end + inherited; + end + end + function AppendItems(arr); + begin + {** + @expaln(˵) ׷ӶĿ %% + @param(arr)(array) %% + **} + cv := array(); + FMoueonItem := nil; + for i,v in arr do + begin + if CheckItem(v)then + begin + FList.append(v); + end + end + ItemCount := FList.Count; + end + function DoDrawSubItem(o,e);override; + begin + {** + @explan(˵) %% + **} + inherited; + if e.skip then exit; + dc := e.canvas; + if not dc.Handle then exit; + i := e.itemid; + di := FList[i]; + if not ifarray(di)then exit; + j := e.subitemid; + iddx := mrows(di,1)[j]; + if ifnil(iddx)then exit; + dij := di[iddx]; + src := e.subItemRect; + if FColumnBool[j]then + begin + //src[0] := src[2]-20-10; + //src[2]-=10; + src[1]+= 3; + src[3]-= 3; + v := List[i]; + if ifarray(v)then + begin + if dij=-inf then dij := false; + else if dij=inf then dij := true; + rrx := integer(src[0]-10+(src[2]-src[0])/2); + rry := integer(src[1]-10+(src[3]-src[1])/2); + dc.Draw("framecontrol",array((rrx,rry),(rrx+18,rry+18)),DFC_BUTTON,dij?DFCS_CHECKED:DFCS_BUTTONCHECK); + //_wapi.DrawFrameControl(dc.Handle,src,DFC_BUTTON,dij?DFCS_CHECKED:DFCS_BUTTONCHECK); + end + end else + begin + if ifstring(dij)and dij then + begin + dc.font := font; + dc.DrawText(dij,src,DT_VCENTER .| DT_LEFT .| DT_SINGLELINE .| DT_NOPREFIX); + end else + if ifnumber(dij)then + begin + dc.font := font; + dc.DrawText(tostn(dij),src,DT_VCENTER .| FIntAlign .| DT_SINGLELINE .| DT_NOPREFIX); + end + end + end + function SetSelectedByValue(v);virtual; + begin + {** + @explan(˵) ֵͨȷѡ + **} + if ifnil(v)then UnSelected(); + for i := 0 to List.Count-1 do + begin + if v=List[i]then + begin + SelectedId := i; + end + end + end + function ColumnAsBool(n,f,ce); + begin + {** + @expaln(˵) ijΪbool %% + @param(n)(integer) к %% + @param(f)(bool) ȡ,ĬΪtrue %% + @param(ce)(bool) ǷԱ༭ %% + **} + if not(n >= 0)then exit; + //if not ifarray(FColumnBool) then FColumnBool := array(); + nv := ifnil(f)?:(f?true:false); + ov := FColumnBool[n]; + ov := ov?true:false; + if ov <> nv then + begin + FColumnBool[n]:= array(nv,ce); + if HandleAllocated()and n= 0 then + begin + sd := FSelected; + FPrevSelectedId := sd; + Fselected :=-1; + GridDrawItem(sd); + //calldatafunction(SelectedChanged,self(true)); + end + end + property SelectedChanged read FSelectedChanged write FSelectedChanged; + property OnSelChanged:eventhandler read FSelectedChanged write FSelectedChanged; + property List read FList; + property CanSelected read FCanSelected write SetCanSelected; + property SelectedId:integer read Fselected write SetSelected; + property PrevSelectedId read FPrevSelectedId; + property SelectedValue read GetSelected; + property SelBkColor:color read FSelBkColor write FSelBkColor; + property MouseOnBkColor:color read FMouseOnBkColor write FMouseOnBkColor; + property ListValues read GetListValues; + property OnCheckItem:eventhandler read FOnCheckItem write FOnCheckItem; + property NumberAlign read FIntAlign write SetIntAlign; + function publishs();override; + begin + return array("name","height","width","left","top","border","anchors","align", + "autoscroll","itemcount","itemheight","mousesizecell", + "fixedrows","fixedcolumns","columncount", + "gridline","columnheader","columns", + "selectedid","selbkcolor","mouseonbkcolor", + "onmousewheel","onmousemove", + "onmousedown","onmouseup","ondblclick", + "onkeyup","onkeydown","onkeypress","oncolumnclick","oncheckitem"); + end + {** + @param(SelectedId)(integer) ǰѡе,<0ʾûѡ %% + @param(PrevSelectedId)(integer) ѡлǰѡid %% + @param(onselchanged)(function[tlistview]) ѡиıص %% + @param(SelectedValue)(any) ѡֵ %% + @param(SelBkColor)(integer) ɫrgbֵ %% + @param(MouseOnBkColor)(integer) ɫrgbֵ %% + @param(ListValues)(array) %% + @param(OnCheckItem)(function[any]:bool) ʱļĻص %% + **} +end + + + + //ؼ +type tprogressbar=class(TCustomControl) + {** + @explan(˵) + ʾɶȵĿؼǽλÿƶ + ΧͨrangeԻȡ޸ģĬֵarray(0,100)λÿͨ + positionԻȡ޸ġIJÿεincreaseByStep + λƶͨstepԻȡ޸ģĬֵ10. + ĬǷֶɢģͨ޸smoothԱΪƽġĬ + ˮƽƶͨ޸verticalԱΪֱӵײƶ + **} + public + function create(AOwner);override; + begin + inherited; + Caption:="prograssbar"; + FLeft := 10; + FTop := 10; + Width := 150; + Height :=20; + Fsmooth:=0; + Fvertical:=0; + Frange:=array(0,100); + Fposition:=0; + Fstep:=10; + FbarColor:=0xD77800; + color:=0xf0f0f0; + end + function isContainer(cd);override; + begin + return 0; + end + function paint();override; + begin + inherited; + dc := Canvas; + r := ClientRect; + h := r[3]-r[1]; + w := r[2]-r[0]; + br := r; + rt := (Fposition/(Frange[1]-Frange[0])); + if Fvertical then + begin + d := rt *h; + br[0] +=(h-d); + end else + begin + d := floor(rt*w); + br[2] := br[0]+d; + end + dc.brush.color := FbarColor; + dc.FillRect(br); + end + function increaseByStep();begin + {** + @explan(˵)ղƶǰλã䳬޶λԱڴͷ¿ʼ%% + @return(integer)ǰλã-1%% + **} + r:=Fposition; + Fposition+= Fstep; + if Fposition>Frange[1] then + Fposition := Frange[0]; + else if Fposition0 then + begin + setPosition(n*Fstep); + end + return r; + end + property smooth:bool read Fsmooth write setSmooth; + property vertical:bool read Fvertical write setVertical; + {** + @param(smooth)(bool)ƽƶ%% + @param(vertical)(bool)ֱƶ%% + **} + property range:pairint read Frange write setRangeA; + property position:integer read Fposition write setPosition; + property stepincrement:integer read Fstep write setStep; + property barColor:color read FbarColor write setIndicatorBarColor; + {** + @param(range)(array of integer)%% + @param(position)(integer)λ%% + @param(stepincrement)(integer)IJ%% + **} + function publishs();override; + begin + return array("name", + "align","anchors", + "popupmenu","visible","enabled", + "height","width","left","top", + "vertical","range","position","barcolor","onmousemove","onpopupmenu", + "onmousedown","onmouseup"); + end + private + Fsmooth; + Fvertical; + Frange; + Fposition; + Fstep; + FbarColor; + private + function setSmooth(n); + begin + Fsmooth := n; + end + function setVertical(n); + begin + nv := n?true:false; + if nv = Fvertical then return ; + Fvertical := nv; + InvalidateRect(nil,false); + end + function isValidPosition(n); + begin + return n>=Frange[0] and n<=Frange[1]; + end + function isValidColorValue(n); + begin + if ifint(n) then + return not (n.&0xFF000000); + else + if ifint64(n) then + return not (n.&0xFFFFFFFFFF000000); + else return 0; + end + function setRange(l,h);begin + {** + @explan(˵)ýޣҪ޸ҽԷǸ%% + @param(l)(integer)%% + @param(h)(integer)%% + @return(integer)1:ɹ;0:ʧ;-1:%% + **} + if Frange=array(l,h) then return ; + if ifnumber(l) and ifnumber(h) and l>=0 and h>=l+1 then + begin + l:=integer(l); + h:=integer(h); + Frange:=array(l,h); + Fposition:=Fpositionh?h:Fposition); + return 1; + end + + end + function setRangeA(arr);begin + return setRange(arr[0],arr[1]); + end + function setPosition(n); + begin + {** + @explan(˵)ýλã䳬޶λ޶%% + @param(n)(integer)Ҫõλ%% + @return(integer)ǰλã򷵻-1%% + **} + r := Fposition; + if ifnumber(n) and isValidPosition(n) then + begin + Fposition:=n; + InvalidateRect(nil,false); + end + return r; + end + function setStep(n);begin + {** + @explan(˵)ý%% + @param(n)(integer)Ҫõֵ%% + @return(integer)1:ɹ;0:ʧ;-1:%% + **} + if Fstep=n then return ; + d := Frange[1]-Frange[0]; + if ifnumber(n) and n<=d then + begin + Fstep:=integer(n); + InvalidateRect(nil,false); + return 1; + end + end + function setIndicatorBarColor(clr); + begin + {** + @explan(˵)ýɫ%% + @param(clr)(integer)Ҫõɫrgbֵ%% + @return(integer)1:ɹ;0:ʧ;-1:%% + **} + if ifnumber(clr) and FbarColor<>clr and isValidColorValue(clr) then + begin + FbarColor:=integer(clr); + InvalidateRect(nil,false); + return 1; + end + end +end +type tVirtualCalender = class(TSLUIBASE) +{** + @explan(˵) ؼ +**} + function create(); + begin + inherited; + FFont := new TFont(); + FDateRows := 8; + FCalenderState := 3; + FLeft := 0; + FTop := 0; + FCellWidth := 30; + FCellHeight := 16; + FYear := 2021; + FMonth := 3; + FDate := 3; + FHasMonthSel := true; + FHasToday := true; + FTodayHeight := 20; + FMonthselheight := 25; + FDateMatrix := array(); + CalcDateMatrx(); + end + function InvalidateRect(rec,f); + begin + if FHost and FHost.HandleAllocated() then + begin + FHost.InvalidateRect(rec?:GetCalenderRect,f); + end + end + function dodatechanged();virtual; + begin + if FHost and FHost.HandleAllocated() then + begin + FHost.DoDatechanged(); + end + end + function ExecuteCommand(cmd,p); + begin + case cmd of + "metodaybutton": + begin + if ifnil(p) then return FHasToday; + else + begin + nv := p?true:false; + if FHasToday<>nv then + begin + FHasToday := nv ; + CalcDateMatrx(); + InvalidateRect(nil,false); + end + end + end + "mestate": + begin + if (p<> FCalenderState) and (p in array(1,2,3)) then + begin + FCalenderState := p; + CalcDateMatrx(); + InvalidateRect(nil,false); + end else + return FCalenderState; + end + "meyear": + begin + // + if (p>0 or p<=0) and p<>FYear then + begin + FYear := p; + CalcDateMatrx(); + InvalidateRect(nil,false); + dodatechanged(); + end + return FYear; + end + "meminc": + begin + d := incmonth(encodedate(FYear,FMonth,FDate),not(p>0 or p<1)?1:(p)); + decodedate(d,y,m,d); + FYear := y; + FMonth := max(m,1); + FDate := max(d,1); + CalcDateMatrx(); + InvalidateRect(nil,false); + dodatechanged(); + end + "memonth": + begin + // + if FMonth<>p and (p>0 or p<13) then + begin + ModifyDate(FYear,p,FDate); + FMonth := p; + CalcDateMatrx(); + InvalidateRect(nil,false); + dodatechanged(); + end + return FMonth; + end + "meyearmonth": + begin + //, + if ifarray(p) and ifnumber(p[0]) and ifnumber(p[1]) then + begin + if p[0]<>FYear or p[1]<>FMonth then + begin + ExecuteCommand("meymd",encodedate(p[0],p[1],FDate)); + end + end + end + "medate": + begin + if p<>FDate and p>0 and p<= getmonthdates(FYear,FMonth) then + begin + FDate := p; + CalcDateMatrx(); + InvalidateRect(nil,false); + dodatechanged(); + end + return FDate; + end + "meymd": + begin + if p>=0 or p<0 then + begin + decodedate(p,y,m,d); + if y<>FYear or FMonth <>m or FDate<>d then + begin + FYear := y; + FMonth := m; + FDate := d ; + CalcDateMatrx(); + InvalidateRect(nil,false); + dodatechanged(); + end + end else + return encodedate(FYear,FMonth,FDate); + end + "meselbypos": + begin + r := ExecuteCommand("megetbypos",p); + if not r then return ; + if r = "today" then + begin + FCalenderState := 3; + ExecuteCommand("meymd",date()); + end + case FCalenderState of + 3: + begin + ExecuteCommand("medate",r); + end + 2: + begin + FCalenderState := 3; + m := FMonth; + d := FDate; + y := FYear; + ExecuteCommand("memonth",r); + if (m=FMonth ) and (d=FDate) and (y := FYear) then + begin + CalcDateMatrx(); + InvalidateRect(nil,false); + end + end + 1:begin + FCalenderState := 2; + m := FMonth; + d := FDate; + y := FYear; + ExecuteCommand("meyear",r); + if (m=FMonth ) and (d=FDate) and (y := FYear) then + begin + CalcDateMatrx(); + InvalidateRect(nil,false); + end + end + end ; + + return r; + end + "mestatebypos": //л״̬ + begin + r := ExecuteCommand("megetstatepos",p); + ExecuteCommand("mestate",r); + return r; + end + "megetstatepos": //״̬ı + begin + if not(FYearRect and FMonthRect) then return ; + if(p) then + begin + p0 := p[0]; + p1 := p[1]; + if not(p0>0 or p0<0 ) then return ; + if not(p1>0 or p1<0 ) then return ; + x := p0-FLeft; + y := p1-FTop; + pp := array(x,y); + if pointinrect(pp,FYearRect) then return 1; + if pointinrect(pp,FMonthRect) then return 2; + return 0; + end + end + "megetincpos": //month inc month dec + begin + if not(FIncRect and FDecRect) then return ; + if(p) then + begin + p0 := p[0]; + p1 := p[1]; + if not(p0>0 or p0<0 ) then return ; + if not(p1>0 or p1<0 ) then return ; + x := p0-FLeft; + y := p1-FTop; + pp := array(x,y); + if pointinrect(pp,FIncRect) then return 1; + if pointinrect(pp,FDecRect) then return -1; + end + end + "megetbypos": + begin + if ifarray(p) then + begin + p0 := p[0]; + p1 := p[1]; + if not(p0>0 or p0<0 ) then return ; + if not(p1>0 or p1<0 ) then return ; + x := p0-FLeft; + y := p1-FTop-(FHasMonthSel*FMonthselheight); + pp := array(x,y); + if pointinrect(pp,FTodyRect) then + begin + return "today"; + end + if FCalenderState = 3 then + begin + for i:= 1 to 6 do + begin + for j := 0 to 6 do + begin + d := FDateMatrix[i,j]; + if ifarray(d) then + begin + rec := d["rec"]; + if pointinrect(pp,rec) then + begin + return d["value"]; + end + end + end + end + end else + if FCalenderState in array(2,1) then + begin + for i,d in FDateMatrix do + begin + if ifarray(d) then + begin + rec := d["rec"]; + if pointinrect(pp,rec) then + begin + return d["value"]; + end + end + end + end + end + end + end + end + function paint(); + begin + if not (host and host.HandleAllocated()) then return ; + dc := host.Canvas; + if not(dc and dc.HandleAllocated()) then return ; + dc.font := font; + if FHasMonthSel then + begin + dc.brush.color := rgb(200,220,220); + dc.fillrect(array(FLeft,FTop,FLeft+FCellWidth*7,FTop+FMonthselheight)); + + if FDecRect then + dc.draw("framecontrol",array((FDecRect[0]+FLeft,FDecRect[1]+FTop),(FDecRect[2]+FLeft,FDecRect[3]+FTop)),DFC_SCROLL,DFCS_SCROLLLEFT); + if FIncRect then + dc.draw("framecontrol",array((FIncRect[0]+FLeft,FIncRect[1]+FTop),(FIncRect[2]+FLeft,FIncRect[3]+FTop)),DFC_SCROLL,DFCS_SCROLLRIGHT); + if FYearRect then + begin + rec := FYearRect; + rec[0]+=FLeft; + rec[2]+=FLeft; + rec[1]+=FTop; + rec[3] += FTop; + if FCalenderState = 1 then + begin + dc.brush.color := rgb(240,240,250); + dc.fillrect(rec); + end + dc.font.weight:= 700; + dc.drawtext(inttostr(FYear)+"",rec,DT_CENTER); + end + if FMonthRect then + begin + rec := FMonthRect; + rec[0]+=FLeft; + rec[2]+=FLeft; + rec[1]+=FTop; + rec[3] += FTop; + if FCalenderState = 2 then + begin + dc.brush.color := rgb(240,240,250); + dc.fillrect(rec); + end + dc.font.weight:= 700; + dc.drawtext(inttostr(FMonth)+"",rec,DT_CENTER); + end + end + t := FTop+(FMonthselheight*FHasMonthSel); + if FCalenderState in array(1,2) then + begin + for i,d in FDateMatrix do + begin + if not ifarray(d) then continue ; + rec := d["rec"]; + if not rec then continue ; + + rec[0]+=FLeft; + rec[2]+=FLeft; + rec[1]+=t; + rec[3] += t; + if d["sel"] then + begin + dc.brush.color := rgb(200,200,100); + dc.FillRect(rec); + end + dc.drawtext(d["text"],rec,DT_CENTER .|DT_VCENTER .| DT_SINGLELINE); + end + end else + if FCalenderState = 3 then + begin + for i:=0 to 6 do + begin + for j := 0 to 6 do + begin + d := FDateMatrix[i,j]; + if not ifarray(d) then continue ; + rec := d["rec"]; + if not rec then continue ; + rec[0]+=FLeft; + rec[2]+=FLeft; + + rec[1]+=t; + rec[3] += t; + if d["sel"] then + begin + dc.brush.color := rgb(200,200,100); + dc.FillRect(rec); + end + if i=0 then dc.font.weight:= 700; + else dc.font.weight:= 400; + dc.drawtext(d["text"],rec,DT_CENTER .| DT_VCENTER .| DT_SINGLELINE); + end + end + dc.pen.width := 1; + dc.pen.color := 0; + dc.moveto(array(FLeft,t+FCellHeight)); + dc.LineTo(array(FLeft+FCellWidth*7,t+FCellHeight)); + end + if FTodyRect then + begin + rec := FTodyRect; + rec[0]+=FLeft; + rec[2]+=FLeft; + rec[1]+=t; + rec[3] += t; + dc.brush.color := rgb(200,200,200); + dc.fillrect(rec); + dc.drawtext(" today: "+datetimetostr(date()),rec,DT_LEFT); + end + end + function recycling();override; + begin + inherited; + FHost := nil; + FFont := nil; + end + public + property Left read FLeft write SetLeft; + property top read FTop write SetTop; + property host read FHost write sethost; + property ClientRect read GetCalenderRect; + private + function ModifyDate(y,m,d); + begin + ct := getmonthdates(y,m); + if d>ct then d := ct; + end + function sethost(h); + begin + if host <> h then + begin + FHost := h; + end + end + function SetLeft(v); + begin + if FLeft<>v then + begin + + FLeft := integer(v); + InvalidateRect(nil,false); + end + end + function settop(v); + begin + if FTop<>v then + begin + FTop := integer(v); + InvalidateRect(nil,false); + end + end + function GetCalenderRect(); + begin + return array(FLeft,FTop,FLeft+FCellWidth*7,FTop+FHasMonthSel*FMonthselheight+FCellHeight*FDateRows+FHasToday*FTodayHeight); + end + function CalcDateMatrx(); + begin + FDecRect := array(); + FIncRect := array(); + FTodyRect := array(); + if FHasMonthSel then + begin + FDecRect := array(5,2,25,22); + x := 7*FCellWidth-25; + FIncRect := array(x,2,x+20,22); + FYearRect := array(60,2,110,22); + FMonthRect := array(115,2,165,22); + end + if FHasToday then + begin + x := 7*FCellWidth; + y := FDateRows*FCellHeight; + FTodyRect := array(0,y,x,y+FTodayHeight); + end + FDateMatrix:= array(); + if FCalenderState = 3 then + begin + for i,v in array("","һ","","","","","") do + begin + x0 := i*FCellWidth; + x1 := x0+FCellWidth; + y0 := cidx*FCellHeight; + y1 := y0+FCellHeight; + data := array(); + data["rec"] := array(x0,y0,x1,y1); + data["text"] := v; + FDateMatrix[0,i] := data; + end + if FYear>0 and FMonth>0 then + begin + ct := getmonthdates(FYear,FMonth); + cidx := 1; + for i:= 1 to ct do + begin + dt := encodedate(FYear,FMonth,i); + dw := (dayofweek(dt)-1); + if i = 1 then //֮ǰ + begin + //һ + end + x0 := dw*FCellWidth; + x1 := x0+FCellWidth; + y0 := cidx*FCellHeight; + y1 := y0+FCellHeight; + data := array(); + data["rec"] := array(x0,y0,x1,y1); + data["text"] := inttostr(i); + data["value"] := i; + data["sel"] := (FDate = i); + FDateMatrix[cidx,dw] := data; + if dw = 6 then + begin + cidx++; + end + if i = ct then + begin + //һ + end + + end + end + end else + if FCalenderState = 2 then //ѡ + begin + cw := integer(FCellWidth*1.5); + ch := integer(FCellHeight*2); + for i := 1 to 12 do + begin + data := array(); + divmod(i-1,4,a,b); + x0 := b*cw+10; + x1 := x0+cw; + y0 := a*ch+10; + y1 := y0+ch; + data := array(); + data["rec"] := array(x0,y0,x1,y1); + data["text"] := inttostr(i)+""; + data["value"] := i; + data["sel"] := (FMonth = i); + FDateMatrix[i]:= data; + end + end else + if FCalenderState = 1 then //ѡ + begin + cw := integer(FCellWidth*1.5); + ch := (FCellHeight); + for i,v in ((FYear-13) -> (FYear+14)) do + begin + data := array(); + divmod(i,4,a,b); + x0 := b*cw+10; + x1 := x0+cw; + y0 := a*ch+10; + y1 := y0+ch; + data := array(); + data["rec"] := array(x0,y0,x1,y1); + data["text"] := inttostr(v); + data["value"] := v; + data["sel"] := (FYear = v); + FDateMatrix[i]:= data; + end + end + + + end + private + FFont; + FDateRows; + FYearRect; + FMonthRect; + FCalenderState; + FTodyRect; + FHasToday; + FTodayHeight; + FIncRect; + FDecRect; + FMonthselheight; + FHasMonthSel; + FDateMatrix; + FDate; + FMonth; + FYear; + FHost; + FLeft; + FTop; + FCellWidth; + FCellHeight; + +end +type tmonthcalendar = class(TCustomControl) +{** + @explan(˵)ؼ + ÿؼĺܵķֵ + array/1ɹ + -1һǺʽȷ + nilڿؼȷδĬֵδùù + 0ʧܣܵԭ + 1.ʽȷڿؼĵǰ״̬Զѡõǰѡʱѡơ + 2.ؼʹԵѡѡƵĺ + 3.Ҫؼſɵõĺڿؼ֮ǰá + 4.δ֪ + **} + function create(aowner); + begin + inherited; + width := 213; + height := 175; + FCalender := new tVirtualCalender(); + FCalender.ExecuteCommand("memymd",date()); + FCalender.Left := 1; + FCalender.top := 1; + FCalender.host := self(true); + //TodayButton := false; + end + function isContainer(cd);override; + begin + return 0; + end + function paint();override; + begin + if FCalender then FCalender.paint(); + end + function MouseUp(o,e);override; + begin + inherited; + if e.skip then return ; + if not FCalender then return ; + if e.button()= mbLeft then + begin + r := FCalender.ExecuteCommand("mestatebypos",e.pos); + if r then return ; + r := FCalender.ExecuteCommand("megetincpos",e.pos); + if r then return FCalender.ExecuteCommand("meminc",r); + std := FCalender.ExecuteCommand("mestate"); + r := FCalender.ExecuteCommand("meselbypos",e.pos); + if std=3 or r="today" then + begin + calldatafunction(FonSelect,self(true),new tuieventbase(0,0,0,0)); + end + end + end + function getCurrentSelection();begin + {** + @explan(˵)ȡǰѡڣúڵѡؼ%% + @return(array/integer/nil)array:ɹ;0:ʧ;nil:δù + array(2019,2,1) + **} + if FCalender then + begin + r := FCalender.ExecuteCommand("meymd"); + decodedate(r,y,m,d); + return array(y,m,d); + end + return 0; + end + function setCurrentSelection(y,m,d); + begin + {** + @explan(˵)õǰѡڣúڵѡؼ%% + @param(y)(integer)%% + @param(m)(integer)%% + @param(d)(integer)%% + @return(integer)1:ɹ;0:ʧ;-1:%% + **} + if ifnumber(y) and ifnumber(m) or ifnumber(d) then + begin + dt := encodedate(y,m,d); + if FCalender then + begin + FCalender.ExecuteCommand("meymd",dt); + return 1; + end + end + end + function DoDatechanged(); + begin + calldatafunction(FonSelectChange,self(true),new tuieventbase(0,0,0,0)); + end + function recycling();override; + begin + FCalender.recycling(); + inherited; + FCalender := nil; + FonSelect := nil; + FonSelectChange := nil; + end + property TodayButton:bool read getnoTodayButton write setNoTodayButton; + property onSelect:eventhandler read FonSelect write FonSelect; + property onSelectChange:eventhandler read FonSelectChange write FonSelectChange; + {** + @param(todayButton)(bool)ʾաťĬϿ%% + @param(onSelect)(function[tmonthcalendar,tuieventbase])ʽѡ%% + @param(onSelectChange)(function[tmonthcalendar,tuieventbase])ѡڸı%% + **} + function publishs();override; + begin + return array("name","caption","anchors","enabled","font", + "popupmenu","visible", + "height","width","left","top","border","onmousemove","onpopupmenu", + "onmousedown","onmouseup","onselect","onselectchange"); + end + private + function setNoTodayButton(v); + begin + if FCalender then return FCalender.ExecuteCommand("metodaybutton",v); + end + function getnoTodayButton(); + begin + if FCalender then return FCalender.ExecuteCommand("metodaybutton"); + end + private + FCalender; + FMousedownState; + FonSelect; + FonSelectChange; +end + +type tthreeEntry = class(TCustomControl) + private + type tpickerEditer = class(teditable) + function Create(); + begin + inherited; + border := false; + end + function valuemodify(); + begin + //޸ + if host then + Host.ExecuteCommand("dtchanged",self); + end + fprev; + fnext; + protected + function doonsetfocus();override; + begin + ExecuteCommand("ecselall"); + end + function doonkillfocus();override; + begin + valuemodify(); + ExecuteCommand("ecclcsel"); + end + public + function GetEntryRect();override; + begin + r := ClientRect; + if not ifarray(r) then return array(0,0,0,0); + return r; + end + function WMCHAR(o,e);override; + begin + case e.char of + "0" to "9" : return inherited; + end ; + case e.CharCode of + VK_DELETE,VK_BACK : inherited; + end ; + end + function WMKEYDOWN(o,e);override; + begin + case e.CharCode of + 13: + begin + return valuemodify(); + end + VK_LEFT: + begin + return GoToPrev(); + end + VK_RIGHT: + begin + return gotonext(); + end + VK_UP: + begin + return inc(); + end + VK_DOWN: + begin + return dec(); + end + end + inherited; + end + function inc(); + begin + s := text; + text := inttostr( strtointdef(s,0)+1); + valuemodify(); + end + function dec(); + begin + s := text; + text := inttostr( strtointdef(s,0)-1); + valuemodify(); + end + private + function gotonext(); + begin + valuemodify(); + if fnext then + begin + KillFocus(); + fnext.SetFocus(); + end + end + function GoToPrev(); + begin + valuemodify(); + if fprev then + begin + KillFocus(); + fprev.SetFocus(); + end + end + end + public + function create(aowner); + begin + inherited; + border := true; + left:=0; + top:=0; + height:=24; + width:=105; + FFontWidth := font.width; + //color := rgb(100,100,100); + FEntrys := array(); + for i := 0 to 2 do + begin + o := new tpickerEditer(); + FEntrys[i] := o; + o.limitlength := getEntryWidth(i); + end + + for i:= 0 to 2 do + begin + FEntrys[i].fnext := FEntrys[(i+1) mod 3]; + FEntrys[(i+1) mod 3].Fprev := FEntrys[i]; + end + calcCtls(); + FEntrys::mcell.host := self(true); + + end + function paint();override; + begin + for i,v in FEntrys do + begin + v.paint(); + end + dc := Canvas; + for i,v in FSymInfo do + begin + if not ifarray(v) then continue; + dc.drawtext(v["sym"],v["rec"],DT_CENTER .| DT_VCENTER .| DT_SINGLELINE); + end + PaintBtn(); + end + function PaintBtn();virtual; + begin + if FBtnRect then + begin + dc := Canvas; + dc.Draw("framecontrol",array(FBtnRect[0:1],FBtnRect[2:3]),DFC_SCROLL,DFCS_SCROLLDOWN); + end + end + function ExecuteCommand(cmd,p);virtual; + begin + + end + function DoWMSIZE(o,e);override; + begin + calcCtls(); + InvalidateRect(nil,false); + inherited; + end + function dosetfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEntrys do + begin + if v.HasFocus then return v.SetFocus(); + end + for i,v in FEditable do + begin + return v.SetFocus(); + end + inherited; + end + function dokillfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEntrys do + begin + if v.HasFocus then return v.killFocus(); + end + inherited; + end + function keypress(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + for i,v in FEntrys do + begin + if v.HasFocus then return v.WMCHAR(o,e); + end + inherited; + end + function KeyDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + + if e.skip then return ; + for i,v in FEntrys do + begin + if v.HasFocus then return v.WMKEYDOWN(o,e); + end + inherited; + end + function btnClicked(p);virtual; + begin + if pointinrect(p,FBtnRect) then + begin + return 1; + end + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + if e.button()=mbLeft then + begin + p := e.pos; + if btnClicked(p) then return ; + for i,v in FEntrys do + begin + if v.HasFocus then + return v.MouseUp(o,e); + end + end + inherited; + end + function MouseMove(o,e);override; + begin + if csDesigning in ComponentState then return ; + + if e.skip then return ; + for i,v in FEntrys do + begin + if v.HasFocus then + begin + return v.MouseMove(o,e); + end + end + inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + if e.skip then return ; + if e.button()=mbLeft then + begin + p := e.pos; + if pointinrect(p,FBtnRect) then return ; + idx := -1; + for i,v in FEntrys do + begin + if pointinrect(p,v.GetEntryRect()) then + begin + idx := i; + end else v.KillFocus(); + end + if idx>=0 then return FEntrys[idx].MouseDown(o,e); + end + inherited; + end + function recycling();override; + begin + inherited; + For i,v in FEntrys do + begin + v.recycling(); + end + FEntrys := array(); + FSymInfo := array(); + end + function FontChanged(o);override; + begin + //ı + FFontWidth := font.width; + for i,v in FEntrys do v.Font := font; + calcCtls(); + end + protected + function calcCtls();virtual; + begin + rec := ClientRect; + h := rec[3]-rec[1]; + wd := rec[2]-rec[0]; + FBtnRect := array(max(0,integer(rec[2]-min(25,h))),rec[1],rec[2]-1,rec[3]-1); + x := rec[0]+1; + FSymInfo := array(); + for i,v in FEntrys do + begin + nx := x+integer(FFontWidth*(getEntryWidth(i))+2); + rc := array(x,rec[1],nx,rec[3]); + v.ClientRect := rc; + x := nx; + if i =2 then return ; + nx := x+FFontWidth+1; + rc := array(x,rec[1],nx,rec[3]); + FSymInfo[i,"sym"] := getSym(i); + FSymInfo[i,"rec"] := rc; + x := nx; + end + end + property BtnRect Read FBtnRect; + property entrys read FEntrys; + private + function getEntryWidth(i);virtual; + begin + case i of + 0: return 4; + else return 2; + + end + end + function getSym(i);virtual; + begin + return "/"; + end + FSymInfo ; + FBtnRect; + FFontWidth; + FEntrys; + +end +type tdatetimepicker = class(tthreeEntry) +{** + @explan(˵) ѡؼ %% +**} + function create(aowner); + begin + inherited; + caption:="Date/TimePicker"; + FCalender := new tmonthcalendar(self); + FCalender.border := true; + FCalender.WsPopUp := true; + FCalender.parent := self; + FCalender.Visible := false; + FScreenRect := _wapi.GetScreenRect(); + decodedate(date(),y,m,d); + setDate(y,m,d); + FCalender.onSelect := function(o,e)begin + FCalender.Visible := false; + d := FCalender.getCurrentSelection(); + setDate(d[0],d[1],d[2]); + end + FCalender.OnActivate := function(o,e)begin + if e.wparam=0 then + begin + FCalender.Visible := false; + end + end + end + function btnclicked(p);override; + begin + rec := BtnRect; + if pointinrect(p,rec) then + begin + ShowDropDown(true); + return true; + end + end + + function ExecuteCommand(cmd,p);override; + begin + case cmd of + "dtchanged": + begin + es := entrys; + if p = es[2] then // + begin + pn := getenumber(p); + y := getenumber(es[0]); + m := getenumber(es[1]); + if pn<1 then p.text := inttostr(getmonthdates(y,m)); + else + if pn>28 and pn>getmonthdates(y,m) then + begin + p.text := "1"; + end + end else + if p = es[1] then // + begin + y := getenumber(es[0]); + m := getenumber(es[1]); + bm := m; + if m>12 then + begin + m := 1; + end else + if m<1 then m := 12; + if bm<>m then + begin + p.text := inttostr(m); + end + d := getenumber(es[2]); + if d<1 then es[2].text := "1"; + else + if d>28 then + begin + ct := getmonthdates(y,m); + if d>ct then es[2].text := inttostr(ct); + end + end else + if p = es[0] then // + begin + y := getenumber(p); + m := getenumber(es[1]); + d := getenumber(es[2]); + if dt>28 then + begin + ct := getmonthdates(y,m); + if d>ct then es[2].text := inttostr(ct); + end + end + calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); + end + "dtadate": + begin + es := entrys; + if ifarray(p) and ifnumber(p[0]) and ifnumber(p[1]) and ifnumber(p[2]) then + begin + dt := encodedate(p[0],p[1],p[2]); + decodedate(dt,y,m,d); + es[0].text := inttostr(y); + es[1].text := inttostr(m); + es[2].text := inttostr(d); + calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); + end else + begin + y := strtointdef(es[0].text,2021); + m := strtointdef(es[1].text,1); + d := strtointdef(es[2].text,1); + return array(y,m,d); + end + + end + + end + end + function ShowDropDown(f);virtual; + begin + {** + @explan(˵) õʾ %% + **} + if not(FCalender ) then return ; + nv := ifnil(f)?true:(f?true:false); + if FCalender.Visible = nv then return FCalender.show(0); + rc := ClientRect; + nrc := ClientToScreen(rc[0],rc[3]); + if FScreenRect[3]-nrc[1]<200 then + begin + nrc[1]:= nrc[0]-height-FCalender.height-2; + end + FCalender.Left := nrc[0]; + FCalender.top := nrc[1]; + dt := getDate(); + FCalender.setCurrentSelection(dt[0],dt[1],dt[2]); + FCalender.show(); + end + function getDate(); + begin + {** + @explan(˵) %% + @return(array) array(y,m,d) %% + **} + return ExecuteCommand("dtadate"); + end + function setDate(y,m,d); + begin + {** + @explan(˵) %% + @param(y)(integer) %% + @param(m)(integer) %% + @param(d)(integer) %% + **} + return ExecuteCommand("dtadate",array(y,m,d)); + end + function recycling();override; + begin + inherited; + FCalender := nil; + Fonselectchange := nil; + end + function publishs();override; + begin + return array("name","caption","anchors","enabled","font", + "popupmenu","visible", + "height","width","left","top","border","onmousemove","onpopupmenu", + "onmousedown","onmouseup","onselectchange"); + end + property onselectchange:eventhandler read Fonselectchange write Fonselectchange; + { + @param(onSelectChange)(function[tmonthcalendar,tuieventbase])ѡڸı%% + } + private + function getenumber(e); + begin + t := e.text; + ti := strtointdef(t,1); + return ti; + end + FScreenRect; + FCalender; + Fonselectchange; +end +type ttimepicker = class(tthreeEntry) + function create(aowner); + begin + inherited; + caption := "timepicker"; + width := 120; + ExecuteCommand("dttime",now()); + end + function ExecuteCommand(cmd,p);override; + begin + case cmd of + "dttime": + begin + if ifnumber(p) then + begin + decodedatetime(p,y,mt,d,h,m,s,ms); + ExecuteCommand("dtatime",array(h,m,s)); + + end else + begin + r := ExecuteCommand("dtatime"); + r2 := encodedatetime(2021,1,1,r[0],r[1],r[2],0); + if ifarray(r) then + begin + return frac(r2); + end + end + end + "dtatime": + begin + es := entrys; + if ifarray(p) and ifnumber(p[0]) and ifnumber(p[1]) and ifnumber(p[1]) then + begin + es[0].text := inttostr(p[0]); + es[1].text := inttostr(p[1]); + es[2].text := inttostr(p[2]); + ExecuteCommand("dtchanged",es[2]); + end else + begin + r := array(); + for i,v in es do r[i] := strtointdef(v.text,0); + return r; + end + end + "dtchanged": + begin + es := entrys; + if es[2]=p then + begin + t := p.text; + ti := strtointdef(t,0); + if ti<0 then + begin + p.text := "59"; + es[1].dec(); + end else + if ti>59 then + begin + p.text := "0"; + es[1].inc(); + end + end else + if es[1] = p then + begin + t := p.text; + ti := strtointdef(t,0); + if ti<0 then + begin + p.text := "59"; + es[0].dec(); + end else + if ti>59 then + begin + p.text := "0"; + es[0].inc(); + end + end else + if es[0] = p then + begin + t := p.text; + ti := strtointdef(t,0); + if ti<0 then p.text := "24"; + else if ti>24 then p.text := "0"; + end + calldatafunction(Fonselectchange,self(true),new tuieventbase(0,0,0,0)); + end + end + end + function PaintBtn();override; + begin + if FRectUp then + begin + dc := Canvas; + dc.Draw("framecontrol",array(FRectUp[0:1],FRectUp[2:3]),DFC_SCROLL,DFCS_SCROLLUP); + dc.Draw("framecontrol",array(FRectDown[0:1],FRectDown[2:3]),DFC_SCROLL,DFCS_SCROLLDOWN); + end + end + function btnClicked(p);virtual; + begin + if pointinrect(p,FRectUp) then + begin + for i,v in entrys do + begin + if v.HasFocus then + begin + v.inc(); + return 1; + end + end + + end else + if pointinrect(p,FRectDown) then + begin + for i,v in entrys do + begin + if v.HasFocus then + begin + v.dec(); + return 1; + end + end + + end + end + function isContainer(cd);override; + begin + return 0; + end + function getTime();override;begin + {** + @explan(˵)ȡؼǰѡʱ%% + @return(array)%% + **} + return ExecuteCommand("dtatime"); + end + function setTime(h,m,s);override;begin + {** + @explan(˵)ÿؼǰѡʱ%% + @param(h)(integer)ʱ24Сʱ%% + @param(m)(integer)%% + @param(s)(integer)%% + **} + return ExecuteCommand("dtatime",array(h,m,s)); + end + function recycling();override; + begin + inherited; + end + function publishs();override; + begin + return array("name","align","anchors","caption","enabled","font", + "popupmenu","visible", + "height","width","left","top","border","onmousemove","onpopupmenu", + "onmousedown","onmouseup","onkeyup","onkeydown","onselectchange"); + end + property onselectchange:eventhandler read Fonselectchange write Fonselectchange; + { + @param(onSelectChange)(function[tmonthcalendar,tuieventbase])ѡڸı%% + } + protected + function calcCtls();override; + begin + inherited; + rec := BtnRect; + FRectUp := array(rec[0],rec[1],rec[2],integer(rec[1]+rec[3]/2)); + FRectDown := array(rec[0],integer(rec[1]+rec[3]/2),rec[2],rec[3]); + end + private + function getEntryWidth(i);virtual; + begin + return 2; + end + function getSym(i);virtual; + begin + return ":"; + end + FRectUp; + FRectDown; + Fonselectchange; +end + +type tIPAddr = class(TCustomControl) + {** + @explan(˵) ipؼ %% + **} + private + type tipeditor = class(teditable) + function create(); + begin + inherited; + border := false; + FRange := array(0,1); + UnLocked := true; + end + function doonmaxtext();override; + begin + if FNext and Fnext.Visible then + begin + KillFocus(); + ExecuteCommand("ecclcsel"); + FNext.SetFocus(); + FNext.ExecuteCommand("ecsel",array(1,10)); + end + end + function doOnChange();override; + begin + if host and UnLocked then + begin + host.DoIpChanged(); + end + end + function GoToPrev(); + begin + if FPrev then + begin + KillFocus(); + ExecuteCommand("ecclcsel"); + FPrev.SetFocus(); + FPrev.ExecuteCommand("ecsel",array(10,1)); + end + end + function WMCHAR(o,e);override; + begin + case e.char of + "0" to "9" : + begin + inherited; + end + " ","\t",".": + begin + doonmaxtext(); + end + chr(VK_BACK): + begin + inherited; + idx := ExecuteCommand("eccaretpos"); + if idx=1 then return GoToPrev(); + end + end + end + function WMKEYDOWN(o,e);override; + begin + case e.CharCode of + VK_LEFT: + begin + idx := ExecuteCommand("eccaretpos"); + if idx=1 then return GoToPrev(); + end + VK_RIGHT: + begin + idx := ExecuteCommand("eccaretpos"); + if idx>length(self.Text) then + begin + return doonmaxtext(); + end + end + end ; + inherited; + end + function GetNumValue(); + begin + t := Text; + r := StrToIntDef(t,FRange[0]); + return r; + end + function GetTureText(); + begin + return Inttostr(GetNumValue()); + end + function SetNumValue(v); + begin + if v<=FRange[0] then return text := inttostr(FRange[0]); + if v>=FRange[1] then return text := inttostr(FRange[1]); + if vFRange[0] then text := inttostr(v); + end + function SetRange(a,b); + begin + if a>=0 and b>a then + begin + if a <> FRange[0] or b<>FRange[1] then + begin + FRange := array(a,b); + L := 1; + while 10^L=0 and i<=4 then + FEditors[integer(i)].SetRange(low,high); + end + function DoControlAlign();override; + begin + calcportsize(); + end + function MouseUp(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then + return v.MouseUp(o,e); + end + return inherited; + end + function MouseMove(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then + return v.MouseMove(o,e); + end + return inherited; + end + function MouseDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + idx := -1; + for i,v in FEditors do + begin + if pointinrect(e.pos,v.GetEntryRect()) then + begin + idx := i; + //v.MouseDown(o,e); + end else v.KillFocus(); + end + if idx>=0 then return FEditors[idx].MouseDown(o,e); + return inherited; + end + function dosetfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then return v.SetFocus(); + end + for i,v in FEditors do + begin + return v.SetFocus(); + end + inherited; + end + function dokillfocus(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then return v.killFocus(); + end + inherited; + end + function keypress(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then return v.WMCHAR(o,e); + end + + inherited; + end + function KeyDown(o,e);override; + begin + if csDesigning in ComponentState then return ; + for i,v in FEditors do + begin + if v.HasFocus then return v.WMKEYDOWN(o,e); + end + inherited; + end + + function Recycling();override; + begin + FaddrChange := nil; + FIpe1 := nil; + FIpe2 := nil; + FIpe3 := nil; + FIpe4 := nil; + FPort := nil; + for i,v in FEditors do v.Recycling(); + FEditors := array(); + inherited; + end + property HasPort:bool read FHasPort write SetHasPort; + property ipaddr:string read getAddress write setAddress; + property onAddrChange:eventhandler read FaddrChange write FaddrChange; + {** + @param(ipaddr)(string)ipַ%% + @param(onAddrChange)(function[tIPAddr,tuieventbase])idַ仯ص%% + **} + private + FEditors; + FHasPort; + FIpe1; + FIpe2; + FIpe3; + FIpe4; + FPort; + FFontwidth; + FaddrChange; + Fsynrects; + function getAddress(); + begin + r := ""; + for i:= 0 to 3 do + begin + r+=FEditors[i].GetTureText(); + if i<3 then r+="."; + end + if FHasPort then + begin + r += ":"+ FPort.GetTureText(); + end + return r; + end + function setAddress(v); + begin + if not ifstring(v) then return ; + r := getAddress(); + v1 := str2array(v,":"); + vs := str2array(v1[0],"."); + fipe1.UnLocked := false; + for i:=0 to min(length(vs)-1,3) do + FEditors[i].SetNumValue(StrToIntDef(vs[i],0)); + if v1[1] then + begin + FPort.SetNumValue(StrToIntDef(v1[1],0)) ; + end + fipe1.UnLocked := true; + r1 := getAddress(); + if r<>r1 then + begin + DoIpChanged(); + end + end + function SetHasPort(v); + begin + nv := v?true:false; + if FHasPort <>nv then + begin + FHasPort := nv; + + calcportsize(); + FPort.Visible := nv; + InvalidateRect(nil,false); + end + end + function calcportsize(); + begin + if not( FIpe1 and FIpe2 and FIpe3 and FIpe4 and FPort) then return ; + rc := ClientRect; + wd := rc[2]-rc[0]-2; + h := rc[3]-rc[1]-2; + if wd<56 then return ; + ewd := integer((wd-FFontwidth*(3+FHasPort)-10)/(4+FHasPort)); + rc1 := array(1,1,ewd,h); + FIpe1.ClientRect := rc1; + rc1 := array(rc1[2]+FFontwidth+1,1,rc1[2]+FFontwidth+ewd,h); + FIpe2.ClientRect := (rc1); + rc1 := array(rc1[2]+FFontwidth+1,1,rc1[2]+FFontwidth+ewd,h); + FIpe3.ClientRect := (rc1); + if FHasPort then rc1 := array(rc1[2]+FFontwidth+1,1,rc1[2]+FFontwidth+ewd,h); + else + rc1 := array(rc1[2]+FFontwidth+1,1,rc[2],h); + FIpe4.ClientRect := (rc1); + if FHasPort then + begin + rc1 := array(rc1[2]+FFontwidth+1,1,rc[2],h); + FPort.ClientRect := (rc1); + FPort.visible := true; + end + Fsynrects := array(); + wd+=2; + ewd := integer((wd-FFontwidth*(3+FHasPort)-10)/(4+FHasPort)); + rc1 := rc; + rc1[1] := integer(rc1[3]/5); + rc1[0]:= (FIpe1.ClientRect)[2];; + rc1[2] := rc1[0]+FFontwidth; + Fsynrects[0][0] := "."; + Fsynrects[0][1] := rc1; + rc1[0]:= (FIpe2.ClientRect)[2]; + rc1[2] := rc1[0]+FFontwidth; + Fsynrects[1,0] := "."; + Fsynrects[1,1] := rc1; + rc1[0]:= (FIpe3.ClientRect)[2];; + rc1[2] := rc1[0]+FFontwidth; + Fsynrects[2,0] := "."; + Fsynrects[2,1] := rc1; + rc1[0]:= (FIpe4.ClientRect)[2];; + rc1[2] := rc1[0]+FFontwidth; + Fsynrects[3,0] := ":"; + Fsynrects[3,1] := rc1; + end + public + function publishs();override; + begin + return array("name","align","anchors","caption","visible","height","width","left","top", + "ipaddr","HasPort","onAddrChange","border","wsdlgmodalframe"); + end +end +type TCustomSpinEdit = class(TCustomControl) + {** + @explan(˵)spineditؼ + **} + private + FEdit; + FUDwidth; + FUPrect; + FDownrect; + FCI; + CI_UP; + CI_DOWN; + CIS_NONE; + CIS_MOUSEDOWN; + CIS_MOUSEUP; + CIS_MOUSEON; + FIncrement: Double; + FDecimals: Integer; + FMaxValue: Double; + FMinValue: Double; + FValue: Double; + FOnIncrease; + FOnDecrease; + FLeveTimer; + function DrawItem(id,f); + begin + ys := 0; + case id of + CI_UP: + begin + rec := FUPrect; + ys := DFCS_SCROLLup; + end + CI_DOWN: + begin + rec := FDownrect; + ys := DFCS_SCROLLDOWN; + end else + return; + end + case f of + CIS_MOUSEDOWN: + begin + //_wapi.DrawFrameControl(Canvas.Handle,rec,DFC_BUTTON,DFCS_BUTTONPUSH); + Canvas.Draw("framecontrol",array(rec[0:1],rec[2:3]),DFC_BUTTON,DFCS_BUTTONPUSH) + end + CIS_NONE: + begin + Canvas.Draw("framecontrol",array(rec[0:1],rec[2:3]),DFC_SCROLL,ys); + end + CIS_MOUSEON: + begin + //canvas.pen.color := rgb(100,200,100); + //canvas.draw("Rectangle",array(rec[0:1],rec[2:3])); + end + end; + end + type TSpinCEdit=class(tedit) + function create(AOwner);override; + begin + inherited; + border := false; + caption := "0"; + end + function SetDesigning(f,fc); + begin + if f then Enabled := false; + else Enabled := true; + end + end + FChar; + protected + function UpdateControl();virtual; + begin + FEdit.Text := inttostr(FValue); + end + function GetValue();virtual; + begin + if FEdit.HandleAllocated()then + begin + r := FEdit.text; + r := StrToIntDef(r,FValue); + if r <> FValue then + begin + FValue := r; + end + end + return FValue; + end + procedure SetValue(const AValue:Double);virtual; + begin + if AValue <> FValue then + begin + if AValue >= FMinValue and AValue <= FMaxValue then + begin + FValue := AValue; + UpdateControl(); + end + end + end + procedure SetMaxValue(const AValue:Double);virtual; + begin + if AValue <> FMaxValue then + begin + FMaxValue := AValue; + end + end + procedure SetMinValue(const AValue:Double);virtual; + begin + if AValue <> FMinValue then + begin + FMinValue := AValue; + end + end + procedure SetIncrement(const AIncrement:Double);virtual; + begin + nv := integer(AIncrement); + if FIncrement <> nv and nv>0 then + begin + FIncrement := nv; + end + end + function doIncrease(o,e);virtual; + begin + nv := GetValue()+FIncrement; + if nv <= FMaxValue and nv >= FMinValue then + begin + CallMessgeFunction(FOnDecrease,o,e); + if not e.skip then + begin + FValue := nv; + UpdateControl(); + end + end else + begin + if nv>FMaxValue then SetValue(FMaxValue); + else if nv= FMinValue then + begin + CallMessgeFunction(FOnDecrease,o,e); + if not e.skip then + begin + FValue := nv; + UpdateControl(); + end + end else + begin + if nv>FMaxValue then SetValue(FMaxValue); + else if nv FBKColor then + begin + FBKColor := c; + if HandleAllocated()then + begin + _wapi.ImageList_SetBkColor(FHandle,c); + end + end + end + function readinfo() + begin + {** + @explan(˵) ȡϢ %% + **} + if HandleAllocated()then + begin + FimageCount := 0; + FimageCount := _wapi.ImageList_GetImageCount(FHandle); + xy := GetIconSize(); + FBKColor := _wapi.ImageList_GetBkColor(FHandle); + FWidth := xy[0]; + FHeight := xy[1]; + end + end + function indexvalidate(i); + begin + {** + @explan(˵) ǷЧ %% + **} + return HandleAllocated()and i-0.5; + end + function hcreateimagelist(); + begin + if not HandleAllocated()then + begin + hd := _wapi.ImageList_Create(FWidth,FHeight,0x00000001,FInitialCount,FcGrow); + if hd then + begin + _wapi.ImageList_SetBkColor(hd,FBKColor); + SetHandle(hd); + FAutoDestroy := true; + FChanged := true; + change(); + end + end + end + protected + function SetHandle(H); + begin + {** + @explan(˵) þ %% + **} + if h and ifnumber(h)and h <> FHandle then + begin + DestroyHandle(); + FHandle := h; + readinfo(); + FAutoDestroy := true; + end + end + function SetWidth(w); + begin + if w>0 and w <> FWidth then + begin + FWidth := w; + FChanged := true; + DestroyHandle(); + addbmps(); + if inDesigning()then change(); + end + end + function SetHeight(h); + begin + if h>0 and FHeight <> h then + begin + FHeight := h; + FChanged := true; + DestroyHandle(); + addbmps(); + if inDesigning()then change(); + //if not inDesigning() then DestroyHandle(); + end + end + function HandleNeeded(); + begin + if not HandleAllocated()then hcreateimagelist(); + return FHandle; + end + public + function create(Owner);override; + begin + FcGrow := 100; + FWidth := 24; + FHeight := 24; + FInitialCount := 100; + FAutoDestroy := true; + FimageCount := 0; + FBKColor := rgb(255,255,255); + FBmpItems := new TMyArrayB(); + //FDrawBimpFirst := true; + inherited; + end + function HandleAllocated(); + begin + {** + @explan(˵) ǷЧ %% + **} + return ifnumber(FHandle)and FHandle <> 0; + end + function DestroyHandle(); + begin + {** + @explan(˵)پ %% + **} + if HandleAllocated()and FAutoDestroy then _wapi.ImageList_Destroy(FHandle); + FHandle := 0; + FimageCount := 0; + FBmpItems := new TMyArrayB(); + end + function add(Image,Mask); + begin + {** + @ignore %% + @explan(˵) λͼ %% + **} + if not FAutoDestroy then exit; + if not(Image is class(tbitmap))then exit; + HandleNeeded(); + r :=-1; + if mask is class(tbitmap)then + begin + r := _wapi.ImageList_Add(FHandle,Image.Handle,Mask.Handle); + end else + if ifnumber(mask)then + begin + r := _wapi.ImageList_AddMasked(FHandle,Image.Handle,Mask); + end else + r := _wapi.ImageList_Add(FHandle,Image.Handle,nil); + if r>-0.5 then + begin + FimageCount := _wapi.ImageList_GetImageCount(FHandle); + end + return r; + end + function addbmp(bmp); + begin + {** + @explan(˵) bitmap imagelist %% + @param(bmp)(tbitmap) %% + **} + if not FAutoDestroy then exit; + if not(bmp is class(tbitmap))then exit; + HandleNeeded(); + if not(HandleAllocated())then exit; + ct := FimageCount; + FBmpAdding := true; + try + addIcon(bmp.ToIcon()); + if FimageCount>ct then + begin + //////////////bitamp/////////////////// + nbmp := new TBitmap(); + bmp.AutoDestroy := false; + nbmp.Handle := bmp.Handle; + nbmp.AutoDestroy := true; + ////////////////////////////// + FBmpItems.push(nbmp); + end + finally + FBmpAdding := false; + end; + end + function addIcon(ico); + begin + {** + @explan(˵) ͼ %%; + **} + if not(ico is class(ticon))then exit; + if not(ico.HandleAllocated())then exit; + HandleNeeded(); + if not(HandleAllocated())then exit; + h := Handle; + _wapi.ImageList_ReplaceIcon(h,-1,ico.Handle); + ct := FimageCount; + FimageCount := _wapi.ImageList_GetImageCount(h); + if not FBmpAdding then + begin + if FimageCount>ct then + begin + FBmpItems.push(ico.Tobitmap()); + end + end + return; + end + function draw(i,dc,x,y,flag); + begin + {** + @explan(˵) imge %% + @param(i)(integer) %% + @param(dc)(tcanvas) dc %% + @param(x)(integer) x %% + @param(y)(integer) y %% + @param(flag)(member of TImageListDrawStyle) %% + **} + if not(dc is class(tcanvas))then exit; + if not dc.HandleAllocated()then exit; + if indexvalidate(i)then + begin + if not(flag >= 0)then flag := ILD_NORMAL; + if DrawBimpFirst then + begin + bmp := FBmpItems[i]; + if bmp then + begin + rc := array(x,y,x+height,y+width); + bmp.StretchDraw(dc,rc,(flag=ILC_COLOR4?SRCAND:nil)); // + end else + begin + _wapi.ImageList_Draw(Fhandle,i,DC.Handle,x,y,flag); + end + end else + begin + _wapi.ImageList_Draw(Fhandle,i,DC.Handle,x,y,flag); + end + end + end + function Removeimge(i); + begin + {** + @explan(˵) ɾ %% + **} + if indexvalidate(i)then + begin + if _wapi.ImageList_Remove(FHandle,i)then + begin + FBmpItems.splices(i,1); + FimageCount--; + end + end + end + function Replaceimge(i,btmap,msk); + begin + {** + @explan(˵) 滻 image %% + @param(i)(integer) λ %%; + @param(btmap)(tbitmap) λͼ %% + @param(msk)(tbitmap|hbitmap) mask %% + **} + hmsk := 0; + if indexvalidate(i)then + begin + if(btmap is class(tbitmap))and(btmap.HandleAllocated())then + begin + if(msk is class(tbitmap))and(msk.HandleAllocated())then hmsk := msk.Handle; + else if ifnumber(mask)then hmsk := mask; + if _wapi.ImageList_Replace(FHandle,i,btmap.Handle,hmsk)then + begin + FBmpItems.splices(i,1,array(btmap)); + end + end + end + end + function GetIcon(i,flag); + begin + {** + @explan(˵) ȡticon %% + @param(i)(integer) %% + @param(flag)(member of TImageListDrawStyle) ʽ %% + **} + if HandleAllocated()and i-0.5 then + begin + hi := _wapi.ImageList_GetIcon(FHandle,i,flag); + if hi then + begin + r := new ticon(); + r.handle := hi; + r.AutoDestroy := true; + return r; + end + end + end + function loadfromsysbmp(id,cx,cGrow); + begin + {** + @ignore %% + @explan(˵) ϵͳλͼimagelist %% + **} + hd := _wapi.ImageList_LoadImageA2(nil,id,cx,cGrow,CLR_NONE,IMAGE_BITMAP,LR_SHARED); + SetHandle(hd); + end + function GetHotSpot();virtual; + begin + return array(0,0); + end + function Recycling();override; + begin + DestroyHandle(); + FOnChange := nil; + inherited; + end + function destroy();override; + begin + inherited; + end + function SetSysImageListHandle(h); + begin + {** + @ignore %% + @explan(˵) ùõiamgelist ,Ĭϲ %% + **} + if h <> FHandle then + begin + SetHandle(H); + FAutoDestroy := false; + end + end + property Handle read HandleNeeded write SetHandle; + property AutoDestroy read FAutoDestroy write FAutoDestroy; + property ImageCount read FimageCount; + property Height:integer read FHeight write Setheight; + property Width:integer read FWidth write SetWidth; + property imgHeight:integer read FHeight write Setheight; + property imgWidth:integer read FWidth write SetWidth; + property OnChange read FOnChange write FOnChange; + property BkColor:COLORREF read FBKColor write setbkcolor; + property Images:imagesdata read GetImages write SetImages; + property DrawBimpFirst read FDrawBimpFirst write FDrawBimpFirst; + function publishs();override; + begin + return array("name","images","imgwidth","imgheight","bkcolor"); + end + {** + @param(Handle)(HIMAGELIS) imagelist %% + @param(AutoDestroy)(bool) Ƿپ %% + @param(ImageCount)(integer) ͼ %% + @param(OnChange)(function[TCustomImageList]) ıʱĻص %% + **} +end + +type TControlImageList=class(TCustomImageList) + {** + @explan(˵) ؼimagleit %% + **} + private + FImageControls; + public + function HandleChanged();virtual; + begin + {** + @explan(˵) 仯 %% + **} + for i := 0 to FImageControls.Count-1 do + begin + FImageControls[i].ImageChanged(); + end + end + function create(AOwner);override; + begin + inherited; + FImageControls := new TFpList(); + OnChange := thisfunction(HandleChanged); + end + function addControl(v); + begin + id := FImageControls.indexof(v); + if id=-1 then + begin + FImageControls.append(v); + end + end + function deleteControl(v); + begin + {** + @explan(˵) ɾؼ %% + **} + id := FImageControls.indexof(v); + if id >= 0 then + begin + v.ImageList := nil; //Ϊ + FImageControls.deli(id); + end + end + function Recycling();override; + begin + {** + @explan(˵) տռ%% + **} + while FImageControls.Count>0 do + begin + deleteControl(FImageControls[0]); + end + inherited; + end +end + +type TDragImageList=class(TCustomImageList) + {** + @ignore() %% + **} + private + FDragCursor:TCursor; + FDragging:Boolean; + FDragHotspot:TPoint; + FOldCursor:TCursor; + FImageIndex:Integer; + FLastDragPos:TPoint; + FLockedWindow:HWND; // window where drag started and locked via DragLock, invalid=NoLockedWindow=High(PtrInt) + procedure SetDragCursor(AValue); + begin + if ifnumber(AValue)and FDragCursor.id <> AValue then + begin + FDragCursor.id := AValue; + end + end + protected + procedure Initialize;override; + public + function create(Owner);override; + begin + inherited; + FDragCursor := new TCursor(); + end + function BeginDrag(Window:HWND;X,Y:Integer):Boolean; + begin + if not HandleAllocated()then exit; + if not FDragging then + begin + FDragCursor.show(); + FDragging := true; + DragLock(Window,x,y); + FDragHotspot := array(x,y); + px := integer(Width/2); + py := integer(Height/2); + _wapi.ImageList_BeginDrag(self.Handle,FImageIndex>0?FImageIndex:0,px,py); + _wapi.ImageList_DragEnter(Window,x,y); + end else + DragMove(x,y); + end + function DragLock(Window:HWND;XPos,YPos:Integer):Boolean; + begin + FLockedWindow := HWND; + end + function DragMove(X,Y:Integer):Boolean; + begin + if FDragging then + begin + _wapi.ImageList_DragMove(x,y); + end + end + procedure DragUnlock; + function EndDrag: + Boolean; + begin + if FDragging then + begin + _wapi.ImageList_DragLeave(FLockedWindow); + _wapi.ImageList_EndDrag(); + FDragging := false; + end + end + function GetHotSpot: + TPoint; + override; + begin + return FDragHotspot; + end + procedure HideDragImage; + function SetDragImage(Index,HotSpotX,HotSpotY:Integer):Boolean; + //procedure ShowDragImage; + property DragCursor:TCursor read FDragCursor write SetDragCursor; + property DragHotspot:TPoint read FDragHotspot write FDragHotspot; + property Dragging:Boolean read FDragging; + property ImageIndex read FImageIndex write FImageIndex; +end +type TImage=class(TSLUIBASE) + {** + @explan(˵)imagegdiflatװ %% + **} + private + FHandle; + FGdi; + Static FImageTypes; + class function GetFileType(t_); + begin + if not(t_ and ifstring(t_))then t := "png"; + else t := lowercase(t_); + if not(t in array("png","jpeg","bmp","gif","tiff"))then exit; + vp := FImageTypes[t]; + if vp then return vp; + vp := tslcstructure(array((0,"byte[20]",array()))); //ԭ16; + //messagebox("image/"+t,"123",0); + nt := _wapi.AnsiToWidChar("image/"+t); + vvp := _wapi.GetEncoderClsid(nt,vp._getptr_); + if vvp <>-1 then + begin + FImageTypes[t]:= vp; + end + return vp; + end + function IFhandle(h); + begin + return ifnumber(h)and h; + end + private + function ImageToStream(t); + begin + {** + @ignore() %% + @explan(˵) image תΪstream %% + **} + if not FHandle then exit; + vp := GetFileType(t); + _wapi.CreateStreamOnHGlobal(0,true,st); + r := gdi.GdipSaveImageToStream(FHandle,st,vp._getptr_,0); + if r <> 0 then exit; + return st; + end + public + class function sinit();override; + begin + inherited; + if not ifarray(FImageTypes)then + begin + //return ; + FImageTypes := array(); + for i,v in array("png","jpeg","bmp","gif","tiff") do + begin + GetFileType(v); + end + end + end + function create(); + begin + inherited; + FHandle := 0; + FGdi := new TGdiplusflat(); + end + function DestroyHandle(); + begin + {** + @explan(˵) پ %% + **} + if IFhandle(FHandle)then + begin + gdi.GdipDisposeImage(FHandle); + end + FHandle := 0; + end + function Recycling();override; + begin + {** + @explan(˵) %% + **} + DestroyHandle(); + inherited; + end + function Destroy();override; + begin + inherited; + end + function LoadFromFile(path); + begin + {** + @explan(˵)ļ %% + @param(path)(string) · %% + **} + if not ifstring(path)then exit; + size := filesize("",path); //ȡļС + r :=-1; + if readFile(rwraw(),"",path,0,size,data)then + begin + r := StringToImage(data); + end + return r; + //***********GdipLoadImageFromFile **************** + fn := _wapi.AnsiToWidChar(path); + r := gdi.GdipLoadImageFromFile(fn,hd); + if hd then + begin + DestroyHandle(); + FHandle := hd; + end + return r; + end + function SavetoFile(p,t); + begin + {** + @explan(˵) 浽ļ%% + @param(p)(string)· %% + @param(t)(string) ,"png" "bmp" "gif" + **} + if not ifstring(p)then return-1; + if not ifstring(t)then t := "png"; + if not FHandle then return-1; + vp := GetFileType(t); + fn := _wapi.AnsiToWidChar(p); + return Gdi.GdipSaveImageToFile(FHandle,fn,vp._getptr_(),0); + end + function ImageToString(t); + begin + {** + @explan(˵) õͼƬڴ%% + @param(t)(string) png bmp %% + **} + if not FHandle then exit; + /////////imagetostring////////// + vp := GetFileType(t); + s := gdi.imagetostring(FHandle,vp); + return s; + ///////////////// + st := ImageToStream(t); + _wapi.GetHGlobalFromStream(st,memo); + len := _wapi.GlobalSize(memo); + s := ""; + lm := _wapi.GlobalLock(memo); + setlength(s,len); + _wapi.memcpy2(s,lm,len); + _wapi.tuicloseistream(st); + return s; + end + function StringToImage(b); + begin + {** + @explan(˵) ַͼƬ %% + @param(b)(string) ڴ %% + **} + if not(b and ifstring(b))then return 3; + ////////////////////////////// + r := gdi.stringtoimage(b,hd); + if hd then + begin + DestroyHandle(); + FHandle := hd; + end + return r; + //////////////////////////////////// + len := length(b); + hm := _wapi.GlobalAlloc(2,len+1); // + lm := _wapi.GlobalLock(hm); // + if lm <> 0 then + begin + _wapi.memcpy(lm,b,len); //ڴ濽 + _wapi.GlobalUnlock(hm); // + end + _wapi.CreateStreamOnHGlobal(hm,true,st); + r := gdi.GdipLoadImageFromStream(st,hd); + if hd then + begin + DestroyHandle(); + FHandle := hd; + end + _wapi.tuicloseistream(st); + return r; + end + function ToHbitmap(); + begin + {** + @explan(˵) תΪbitmap %% + @return(pointer) + **} + if not FHandle then exit; + gdi.GdipCreateHBITMAPFromBitmap(FHandle,fhbmp,rgb(255,255,255)); + return fhbmp; + end + function FromHBitmap(bmp); + begin + {** + @explan(˵) bitmapõͼƬ %% + @param(bmp)(pointer) hbitmap + **} + if not(IFhandle(bmp))then exit; + if bmp=FHandle then exit; + gdi.GdipCreateBitmapFromHBITMAP(bmp,0,hd); + if hd then + begin + DestroyHandle(); + FHandle := hd; + end + end + function FromHIcon(ico); + begin + {** + @explan(˵) hiconõͼƬ %% + @param(ico)(pointer) hicon %% + **} + if not(ifnumber(ico)and ico)then exit; + if bmp=ico then exit; + gdi.GdipCreateBitmapFromHICON(ico,hd); + if hd then + begin + DestroyHandle(); + FHandle := hd; + end + end + function tohicon(); + begin + {** + @explan(˵) õhcion %% + @return(pointer)hicon + **} + if not FHandle then exit; + gdi.GdipCreateHICONFromBitmap(FHandle,hd); + return hd; + end + property Gdi read FGdi; + property Handle Read FHandle; + {** + @param(gdi)(TGdiplusflat) gdi %% + @param(handle)(pointer) %% + **} +end + +type TPicturebase=class(TSLUIBASE) + {** + @explan(˵)bitmap,ico %% + **} + private + FImage; + public + function Create();override; + begin + inherited; + try + FImage := new timage(); + except + raise "^~^ gdi support err!"; + FImage := 0; + end; + end + function Recycling();override; + begin + FImage := nil; + inherited; + end + property Image read FImage; +end +type TBitmap = class(TPicturebase) + {** + @explan(˵) bitmap %% + **} + private + FHandle; + FId; + FDestroy; + FBytes; + FDIBites; + FBitmap; + static FsysBitmaps; + static FSHDC; + static FSHDC2; + class function sinitdc(); + begin + if not FSHDC then + begin + FSHDC := _wapi.CreateCompatibleDC(0); + FSHDC2 := _wapi.CreateCompatibleDC(0); + end + end + function getvalue(n); + begin + case n of + "bmtype":return FBitmap.bmtype; + "bmwidth":return FBitmap.bmwidth; + "bmheight":return FBitmap.bmheight; + "bmwidthbytes":return FBitmap.bmwidthbytes; + "bmplanes":return FBitmap.bmplanes; + "bmbitspixel":return FBitmap.bmbitspixel; + end + end + + function setvalue(n,v); + begin + case n of + "bmtype" : FBitmap.bmtype :=v ; + "bmwidth" : FBitmap.bmwidth :=v ; + "bmheight" : FBitmap.bmheight :=v ; + "bmwidthbytes" : FBitmap.bmwidthbytes:=v ; + "bmplanes" : FBitmap.bmplanes :=v ; + "bmbitspixel" : FBitmap.bmbitspixel :=v ; + end ; + end + function SetHandle(h); + begin + {** + @explan(˵) þ %% + **} + if h=FHandle then exit; + if HandleAllocated()then DestroyHandle(); + FDIBites := FBytes := ""; + FHandle := h; + ReadhInfo(); + end + Function ReadhInfo(); + begin + {** + @explan(˵) ȡϢ %% + **} + if HandleAllocated()and FBitmap then + begin + _wapi.GetObjectA(FHandle,FBitmap._size_(),FBitmap._getptr_()); + end + end + function setid(id);virtual; + begin + {** + @explan(˵) id %%; + **} + if id <> FId then + begin + Fid := id; + DestroyHandle(); + if ifnumber(id)then h := loadsysbmp(id); + if h then + begin + AutoDestroy := false; //ɾ + end else + begin + h := getresourcebyid(id,array("type":"bmp")); + if not h then + begin + if Image then + begin + //echo "\r\nloadok:", + Image.LoadFromFile(id); + //echo "\r\n=================readhandle:",Image.Handle; + h := Image.ToHbitmap(); + end + end + AutoDestroy := true; //ɾ + end + if h then + begin + SetHandle(H); + end + end + end + protected + class function loadsysbmp(id);virtual; + begin + {** + @explan(˵) ȡϵͳbitmap %% + @param(id)(menuber of TSystemBitmap) id %% + @return(hbitmap) %% + **} + if not ifarray(FsysBitmaps)then FsysBitmaps := array(); + r := FsysBitmaps[id]; + if r then return r; + else + begin + r := _wapi.LoadBitmapA2(nil,id); + FsysBitmaps[id]:= r; + end + return r; + end + function DestroyHandle();virtual; + begin + {** + @explan(˵) %% + **} + if HandleAllocated()and FDestroy then _wapi.DeleteObject(FHandle); + FHandle := 0; + FBytes := ""; + end + public + function HandleAllocated(); + begin + {** + @explan(˵) жо %% + @return(bool) + **} + return ifnumber(FHandle)and(FHandle <> 0); + end + function create();override; + begin + inherited; + FBitmap := new TSHBMP(nil); + FDestroy := true; + end + function draw(dc,x,y,flag,rect); + begin + {** + @explan(˵) ճhdc %% + @param(dc)(tcanvas) canvas %% + @param(x)(integer) canvas еxλ%% + @param(y)(integer) canvas еyλ%% + @param(rect)(array) bimap ķΧ array()%% + @param(flag)(member of TRasterOperationConst) դ %% + **} + if(dc is class(tcanvas))and dc.HandleAllocated()and HandleAllocated()then + begin + sinitdc(); + bw1 := FBitmap.bmwidth; + bh1 := FBitmap.bmheight; + rc := array(0,0,bw1,bh1); + if ifarray(rect)then + begin + if intersectrect(rc,rect,irect)then rc := irect; + end + return _wapi.drawbitmaptodc(FHandle,dc.Handle,x,y,rc,flag,FSHDC); + oldmp := _wapi.SelectObject(FSHDC,FHandle); + if not flag then flag := SRCCOPY; + r := _wapi.BitBlt(dc.handle,x,y,rc[2]-rc[0],rc[3]-rc[1],FSHDC,rc[0],rc[1],flag); + if oldmp then _wapi.SelectObject(FSHDC,oldmp); + return r; + end + end + function StretchDraw(dc,drect,flag,brect); + begin + {** + @explan(˵) ճhdc %% + @param(dc)(tcanvas) canvas %% + @param(drect)(array) canvas ķΧ array()%% + @param(brect)(array) bimap ķΧ array()%% + @param(flag)(member of TRasterOperationConst) դ %% + **} + if not(ifarray(drect))then return-1; + if(dc is class(tcanvas))and dc.HandleAllocated()and HandleAllocated()then + begin + sinitdc(); + bw1 := FBitmap.bmwidth; + bh1 := FBitmap.bmheight; + rc := array(0,0,bw1,bh1); + if ifarray(brect)then if intersectrect(rc,brect,irect)then rc := irect; + return _wapi.drawbitmapstretchtodc(FHandle,dc.Handle,drect,rc,flag,FSHDC); + oldmp := _wapi.SelectObject(FSHDC,FHandle); + if not flag then flag := SRCCOPY; + r := _wapi.StretchBlt(dc.handle,drect[0],drect[1],drect[2]-drect[0],drect[3]-drect[1],FSHDC,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1],flag); + if oldmp then _wapi.SelectObject(FSHDC,oldmp); + end + return r; + end + function Readvcon(d);override; + begin + {** + @expaln(˵)ȡϢ %% + **} + if Image and ifarray(d)and d["type"]="img" then + begin + Image.StringToImage(d["data"]); + bthandle := Image.ToHbitmap(); + SetHandle(bthandle); + AutoDestroy := true; + return; + end + end + function tovcon();override; + begin + {** + @expaln(˵)תΪ %% + **} + r := nil; + if Image and HandleAllocated()then + begin + r := array(); + r["type"]:= "bmp"; + Image.FromHBitmap(FHandle); + r["type"]:= "img"; + r["data"]:= Image.ImageToString("png"); + end + return r; + end + function CopyRect(x,y,w,h); + begin + {** + @explan(˵) λͼ %% + **} + r := nil; + if HandleAllocated()then + begin + if x<0 or y<0 or w<0 or h<0 then return r; + if x+wd>FBitmap.bmwidth then return r; + if y+h>FBitmap.bmheight then return r; + wd1 := FBitmap.bmwidthbytes/FBitmap.bmwidth; + r := array(); + r["type"]:= "bmp"; + r["width"]:= w; + r["bmwidthbytes"]:= wd1 * w; + r["bmplanes"]:= FBitmap.bmplanes; + r["bmbitspixel"]:= FBitmap.bmbitspixel; + r["height"]:= h; + sbt := BmpBits; + sbt2 := ""; + setlength(sbt2,wd1 * w * h * 2); + hr := FBitmap.bmwidthbytes; + jj := 1; + sx := x * wd1; + ex := sx+w * wd1-1; //(x+w)*wd1-1; + for ri := y to y+h-1 do + begin + for ci := sx to ex do + begin + if ri * hr+ci+1>length(sbt)then break; + v := sbt[ri * hr+ci+1]; + sbt2[jj++]:= v; + end + end + r["bytes"]:= sbt2[1:(wd1 * w * h)]; + rt := new tbitmap(); + rt.readvcon(r); + return rt; + end + return r; + end + function ToBMPFileString(); + begin + if Image and HandleAllocated()then + begin + r := array(); + Image.FromHBitmap(FHandle); + return Image.ImageToString("bmp"); + end + return ""; + end + function ToIcon(); + begin + {** + @explan(˵)λͼתΪicon %% + @return(ticon|nil) ɹͼ %% + **} + if HandleAllocated()then + begin + Image.FromHBitmap(FHandle); + thandle := Image.tohicon(); //gdi+ + if not thandle then return 0; + r := new ticon(); + r.Handle := tHandle; + return r; + end + return nil; + end + function Recycling();override; + begin + DestroyHandle(); + FBitmap := nil; + inherited; + end + property id read FId write SetID; + property Handle:pointer read FHandle write SetHandle; + property AutoDestroy:bool read FDestroy write FDestroy; + //property BmpBits read GetBits; + //property DIBits read GetDIBits; + property bmtype index "bmtype" read getvalue write setvalue ; + property bmwidth index "bmwidth" read getvalue write setvalue; + property bmheight index "bmheight" read getvalue write setvalue; + property bmwidthbytes index "bmwidthbytes" read getvalue write setvalue; + property bmplanes index "bmplanes" read getvalue write setvalue; + property bmbitspixel index "bmbitspixel" read getvalue write setvalue; + {** + @param(id)() Դid %% + @param(Handle)() %% + @param(AutoDestroy)() ʱپ %% + **} +end +type TIcon = class(TPicturebase) + private + {** + @explan(˵) ͼ %% + **} + FHandle; + FId; + FMask; + FDestroy; + FMaskBMP; + FColorBMP; + FHICON; + FHandleChanged; + static FSystemIcons; + function getvalue(n); + begin + if not FHICON then return 0; + if FHandleChanged then ReadhInfo(); + case n of + "ficon": return FHICON.ficon; + "xhotspot": return FHICON.xhotspot; + "yhotspot": return FHICON.yhotspot; + "hbmmask": return FHICON.yhotspot; + "hbmcolor": return FHICON.hbmcolor; + end + end + function setvalue(n,v); + begin + if not FHICON then return 0; + if FHandleChanged then ReadhInfo(); + case n of + "ficon": return FHICON.ficon := v; + "xhotspot": return FHICON.xhotspot := v; + "yhotspot": return FHICON.yhotspot := v; + "hbmmask": return FHICON.yhotspot := v; + "hbmcolor": return FHICON.hbmcolor := v; + end + end + function SetHandle(h); + begin + {** + @explan(˵) þ %% + **} + if HandleAllocated()then DestroyHandle(); + FHandle := h; + FHandleChanged := true; + end + function GetMaskBitMap(); + begin + if FHandleChanged then ReadhInfo(); + return FMaskBMP; + end + function GetColorBitMap(); + begin + if FHandleChanged then ReadhInfo(); + return FColorBMP; + end + Function ReadhInfo(); + begin + {** + @explan(˵) ȡϢ %% + **} + if FHandleChanged and HandleAllocated()and FHICON then + begin + _wapi.GetIconInfo(FHandle,FHICON._getptr_()); + FHandleChanged := false; + if hbmcolor then + begin + FColorBMP := new tbitmap(); + FColorBMP.AutoDestroy := true; + FColorBMP.Handle := hbmcolor; + end + if hbmmask then + begin + FMaskBMP := new tbitmap(); + FMaskBMP.AutoDestroy := true; + FMaskBMP.handle := hbmmask; + end + end + FHandleChanged := false; + end + function setid(r); + begin + {** + @explan(˵) id %%; + **} + if r <> FId then + begin + Fid := r; + DestroyHandle(); + if ifnumber(r)then h := loadsysico(r); + if h then + begin + FDestroy := false; + end else + begin + h := getresourcebyid(r,array("type":"ico")); + if not h then + begin + if Image then + begin + Image.LoadFromFile(r); + h := Image.tohicon(); + end + end + FDestroy := true; + end + if H then SetHandle(H); + end + end + protected + class function loadsysico(id);virtual; + begin + if not ifarray(FSystemIcons)then FSystemIcons := array(); + r := FSystemIcons[id]; + if r then return r; + r := _wapi.LoadIconA2(nil,id); + FSystemIcons[id]:= r; + return r; + end + function DestroyHandle();virtual; + begin + {** + @explan(˵) %% + @return(bool) + **} + if HandleAllocated()and FDestroy then _wapi.DestroyIcon(FHandle); + FBitmap := nil; + FMaskBMP := nil; + FColorBMP := nil; + FHandle := 0; + end + public + function HandleAllocated(); + begin + {** + @explan(˵) жо %% + **} + return ifnumber(FHandle)and(FHandle <> 0); + end + function create(); + begin + inherited; + FHICON := new TSHICON(nil); + FDestroy := true; + end + function Recycling();override; + begin + DestroyHandle(); + FHICON := nil; + inherited; + end + function destroy();override; + begin + inherited; + end + function Tobitmap(); + begin + {** + @explan(˵) icoתΪbitmap %% + @return(nil|TBitmap) + **} + if HandleAllocated()and FImage then + begin + FImage.FromHIcon(FHandle); + Hbm := FImage.ToHbitmap(); + if hbm then + begin + r := new TBitmap(); + TBitmap.Handle := Hbm; + return r; + end + end + return nil; + end + function readvcon(d);override; + begin + if Image and ifarray(d)and d["type"]="img" then + begin + Image.StringToImage(d["data"]); + bthandle := Image.tohicon(); + SetHandle(bthandle); + AutoDestroy := true; + end + end + function tovcon();override; + begin + r := nil; + if Image and HandleAllocated()then + begin + r := array("type":"ico"); + r["ficon"]:= ficon; + r["type"]:= "img"; + Image.FromHIcon(FHandle); + r["data"]:= Image.ImageToString("png"); + end + return r; + end + property id read FId write SetID; + property Handle read FHandle write SetHandle; + property MaskBMP:tbitmap read GetMaskBitMap; + property ColorBMP:tbitmap read GetColorBitMap; + property AutoDestroy read FDestroy write FDestroy; + property ficon index "ficon" read getvalue write setvalue; + property xhotspot index "xhotspot" read getvalue write setvalue; + property yhotspot index "yhotspot" read getvalue write setvalue; + property hbmmask index "hbmmask" read getvalue write setvalue; + property hbmcolor index "hbmcolor" read getvalue write setvalue; + {** + @param(id)(integer|string) Դid %% + @param(Handle)(intptr) %% + @param(MaskBMP)(tbitmap) maskλͼ %% + @param(ColorBMP)(tbitmap) colorλͼ %% + @param(AutoDestroy)(bool) ǷԶǷԴ %% + **} +end + +type TCursor=class(ticon) + {** + @explan(˵) %% + **} + private + static FSystemCursors; + protected + class function loadsysico(id);override; + begin + {** + @param(id)(member of TSystemCursor) cursor id %% + @return(pointer) %% + **} + if not ifarray(FSystemCursors)then FSystemCursors := array(); + r := FSystemCursors[id]; + if r then return r; + r := _wapi.LoadCursorA2(nil,id); + if r then FSystemCursors[id]:= r; + return r; + end + public + function create();override; + begin + inherited; + end + function show();override; + begin + {** + @explan(˵) ʾ + **} + if HandleAllocated()then + begin + //hd := _wapi.SetCursor(_wapi.LoadCursorA2(0,IDC_WAIT)); + hd := _wapi.SetCursor(self.Handle); + return hd; + end + end + function Recycling();override; + begin + inherited; + end +end + +type TGdi = class(TSLUIBASE) + private + static GDICache; + FCanvas; + function SetCanvas(c); + begin + FCanvas := c; + Onchange(); + end + protected FHandle; //gdi + FGdistate; + FGDIstruct; + class function sinit();override; + begin + inherited; + if not GDICache then GDICache := new TResourcescache(); + end + public + function HandleAllocated();virtual; + begin + return FHandle <> 0 and ifnumber(FHandle); + end + function HandleNeeded();virtual; + begin + return FHandle; + end + function DestroyHandle();virtual; + begin + if HandleAllocated()then + begin + unreference(); + FHandle := 0; + end + end + function GetGDIinfo();virtual; + begin + if not FGDIstruct then + begin + FGDIstruct := 1; + end + //return array(); + end + function Onchange();virtual; + begin + end + function GetFormatGdiStr(); + begin + v := gdiformatstr(); + if ifstring(v)then return getmsgd_Crc32(v); + return ""; + end + function reference();virtual; + begin + return GDICache.reference(GetFormatGdiStr()); + end + function addsource(v);virtual; + begin + GDICache.addsource(GetFormatGdiStr(),v); + end + function unreference();virtual; + begin + GDICache.unreference(GetFormatGdiStr()); + end + + function destroyresource();virtual; + begin + GDICache.destroyresource(GetFormatGdiStr()); + end + function gdiformatstr();virtual; + begin + return 0; + end + function create();override; + begin + inherited; + FGdistate := array(); + end + function Recycling();override; + begin + FCanvas := nil; + DestroyHandle(); + inherited; + end + property Canvas read FCanvas write SetCanvas; + property Handle read HandleNeeded; +end +type TRgn = class(TSLUIBASE) + {** + @explan(˵) %% + **} + private + FHandle; + function GetHandle(); + begin + if not HandleAllocated()then FHandle := CreateRgn(); + return FHandle; + end + function SetHandle(v); + begin + if v <> FHandle then + begin + DestroyHandle(); + if ifnumber(v)and v then FHandle := v; + end + end + public + function Create();override; + begin + inherited; + end + function HandleAllocated(); + begin + return FHandle and ifnumber(FHandle); + end + function DestroyHandle(); + begin + if HandleAllocated()then _wapi.DeleteObject(FHandle); + FHandle := 0; + end + function CreateRgn();virtual; + begin + return _wapi.createrectrgn(0,0,0,0); + end + class function CombineRgn(rgn1,rgn2,f,rgn); + begin + {** + @explan(˵)rgnϲ%% + @param(rgn1)(trgn) 1 %% + @param(rgn2)(trgn) 2 %% + @param(rgn)(trgn) غϲ %% + @param(f)(integer) ϲʽ RGN_AND RGN_COPY RGN_DIFF RGN_OR RGN_XOR %% + @param(integer) NULLREGION COMPLEXREGION SIMPLEREGION ERROR + **} + if(rgn1 is class(TRGN))and(rgn2 is class(TRGN))then + begin + rgn := new TRgn(); + return _wapi.CombineRgn(rgn.Handle,s1.Handle,rgn2.Handle,f); + end + end + function Recycling();override; + begin + DestroyHandle(); + inherited; + end + property Handle read GetHandle write SetHandle; +end +type TRGNELLIP=class(TRGN) //Բ + {** + @explan(˵)Բrgn + **} + private + FRect; + function SetRect(v); + begin + if v <> FRect and ifarray(v) and ifnumber(v[0])and ifnumber(v[1])and v[2]>v[0]and v[3]>v[1] then + begin + FRect := v; + DestroyHandle(); + end + end + public + function create();override; + begin + inherited; + FRect := array(0,0,0,0); + end + function CreateRgn();override; + begin + return _wapi.CreateEllipticRgn(FRect[0],FRect[1],FRect[2],FRect[3]); + end + property Rect read FRect write SetRect; +end +type TRGNRECT=class(TRGNELLIP) + {** + @explan(˵)%% + + **} + function create();override; + begin + inherited; + end + function CreateRgn();override; + begin + rec := Rect; + return _wapi.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); + end +end +type TRGNRoundRect=class(TRGNELLIP) + {** + @explan(˵) RoundRect rgn %% + **} + private + FEllipseWidth; + FEllipseHeight; + function SetEllipseWidth(v); + begin + if v >= 0 and v <> FEllipseWidth then + begin + FEllipseWidth := v; + DestroyHandle(); + end + end + function SetEllipseHeight(); + begin + if v >= 0 and v <> FEllipseHeight then + begin + FEllipseHeight := v; + DestroyHandle(); + end + end + public + function Create(AOwner);override; + begin + inherited; + FEllipseHeight := 1; + FEllipseWidth := 1; + end + function CreateRgn();override; + begin + rec := Rect; + return _wapi.CreateRoundRectRgn(rec[0],rec[1],rec[2],rec[3],FEllipseWidth,FEllipseHeight); + end + property EllipseWidth:integer read FEllipseWidth write SetEllipseWidth; + property EllipseHeight:integer read FEllipseHeight write SetEllipseHeight; +end +type TRGNPOLY=class(TRGN) // + {** + @explan(˵)%% + **} + private + FPoints; + FImode; + function SetImode(v); + begin + if(v in array(1,2))and v <> FImode then + begin + FImode := v; + DestroyHandle(); + end + end + function SetPoints(v); + begin + if v <> FPoints then + begin + FPoints := v; + DestroyHandle(); + end + end + public + function create(); // ģʽ + begin + inherited; + FImode := ALTERNATE; + end + function CreateRgn();override; + begin + t := pointtovector(FPoints); + len := length(t); + if len>5 then return _wapi.CreatePolygonRgn(t,len/2,FImode); + end + property Points read FPoints write SetPoints; + property Imode read FImode write SetImode; +end + +type TFont = class(tgdi) + private + FHeight; + FWidth; + Fescapement; + Forientation; + Fweight; + Fitalic; + Funderline; + Fstrikeout; + Fcharset; + Foutprecision; + Fclipprecision; + Fquality; + Fpitchandfamily; + Ffacename; + FColor; + FBKColor; + FBkmode; + static LOGSTRUCT; + static LOGSTRUCTarray; + class function sinit();override; + begin + inherited; + if not LOGSTRUCTarray then + begin + LOGSTRUCTarray := array( + ("height","int",15), + ("width","int",0), + ("escapement","int",0), + ("orientation","int",0), + ("weight","int",400), + ("italic","byte",0), + ("underline","byte",0), + ("strikeout","byte",0), + ("charset","byte",134), + ("outprecision","byte",3), + ("clipprecision","byte",2), + ("quality","byte",1), + ("pitchandfamily","byte",FIXED_PITCH), + ("facename","char[32]","")); + LOGSTRUCT := tslcstructure(LOGSTRUCTarray); + end + end + function SetColor(c); + begin + if ifnumber(c)and c <> FColor then + begin + FColor := c; + if Canvas then Canvas.OnFontColorChange(); + end + end + function SetbkColor(c); + begin + if ifnumber(c)and c <> FBKColor then + begin + FBKColor := c; + if Canvas then Canvas.OnFontbkColorChange(); + end + end + function SetbkMode(c); + begin + nc :=(c=OPAQUE)?OPAQUE:TRANSPARENT; + if FBkmode <> nc then + begin + FBkmode := nc; + if Canvas then Canvas.OnFontbkmodeChange(); + end + end + function Setheight(v) + begin + if ifnumber(v)and v <> Fheight then + begin + Fheight := v; + onchange(); + end + end + function Setwidth(v) + begin + if ifnumber(v)and v <> Fwidth then + begin + Fwidth := v; + onchange(); + end + end + function Setescapement(v) + begin + if ifnumber(v)and v <> Fescapement then + begin + Fescapement := v; + onchange(); + end + end + function Setorientation(v) + begin + if ifnumber(v)and v <> Forientation then + begin + Forientation := v; + onchange(); + end + end + function Setweight(v) + begin + if not(v=400 or v=700)then return; + if v <> Fweight then + begin + Fweight := v; + onchange(); + end + end + function Setitalic(v) + begin + nv := v?true:false; + if nv <> Fitalic then + begin + Fitalic := nv; + onchange(); + end + end + function Setunderline(v) + begin + nv := v?true:false; + if nv <> Funderline then + begin + Funderline := nv; + onchange(); + end + end + function Setstrikeout(v) + begin + nv := v?true:false; + if nv <> Fstrikeout then + begin + Fstrikeout := nv; + onchange(); + end + end + function Setcharset(v) + begin + if ifnumber(v)and v <> Fcharset then + begin + Fcharset := v; + onchange(); + end + end + function Setoutprecision(v) + begin + if not(v in array(OUT_DEFAULT_PRECIS,OUT_DEVICE_PRECIS,OUT_OUTLINE_PRCIS,OUT_RASTER_PRECIS, + OUT_STRING_PRECIS,OUT_STROKE_PRECIS,OUT_TT_ONLY_PRECIS,OUT_TT_PRECIS))then return; + if v <> Foutprecision then + begin + Foutprecision := v; + onchange(); + end + end + function Setclipprecision(v) + begin + if not ifnumber(v)then return; + if(v .&(CLIP_DEFAULT_PRECIS .| CLIP_STROKE_PRECIS .| CLIP_MASK .| CLIP_LH_ANGLES .| CLIP_TT_ALWAYS))and v <> Fclipprecision then + begin + Fclipprecision := v; + onchange(); + end + end + function Setquality(v) + begin + if not(v in array(DEFAULT_QUALITY,DRAFT_QUALITY,PROOF_QUALITY))then return; + if v <> Fquality then + begin + Fquality := v; + onchange(); + end + end + function Setpitchandfamily(v) + begin + if not(v in array(DEFAULT_PITCH,FIXED_PITCH,VARIABLE_PITCH, + FF_DECORATIVE,FF_MODERN,FF_ROMAN,FF_SCRIPT,FF_SWISS))then return; + if v <> Fpitchandfamily then + begin + Fpitchandfamily := v; + onchange(); + end + end + function Setfacename(v) + begin + if ifstring(v)and v <> Ffacename and length(v)<= 32 then + begin + Ffacename := v; + onchange(); + end + end + protected + function gdiformatstr();override; + begin + s := ""; + for i,v in LOGSTRUCTarray do + begin + v0 := v[0]; + s += v0; + s += ":"; + if v0="facename" then + begin + s += invoke(self,"f"+v0); + end else + vvi := invoke(self,"f"+v0); + if ifnumber(vvi)then s += inttostr(vvi); + else s += "0"; + s += ";"; + end + r := "class:font;"+s; + return r; + end + public + function HandleNeeded();override; + begin + if not HandleAllocated()then + begin + hp := reference(); + if not hp then + begin + for i,v in LOGSTRUCTarray do + begin + v0 := v[0]; + LOGSTRUCT._setvalue_(v0,invoke(self,"f"+v0)); + end + hp := _wapi.CreateFontIndirectA(LOGSTRUCT._getptr_); + addsource(hp); + end + FHandle := hp; + end + return FHandle; + end + function fontinfo(); + begin + {** + @explan(˵) Ϣ %% + **} + r := array(); + for i,v in LOGSTRUCTarray do + begin + r[v[0]]:= invoke(self,v[0]); + end + r["color"]:= color; + r["bkcolor"]:= bkcolor; + return r; + end + function create();override; + begin + inherited; + fheight := 15; + fwidth := 7; + fescapement := 0; + forientation := 0; + fweight := 400; + fitalic := 0; + funderline := 0; + fstrikeout := 0; + fcharset := 134; + foutprecision := 3; + fclipprecision := 2; + fquality := 1; + fpitchandfamily := FIXED_PITCH; + ffacename := ""; + FColor := 0; + Onchange(); + end + function Onchange();override; + begin + if Canvas then Canvas.OnFontChange(); + DestroyHandle(); + end + function copyfont(f);virtual; + begin + {** + @explan(˵) Ϣ %% + @param(f)(tfont) + **} + if not(f is class(tfont))then exit; + return SetValues(f.fontinfo()); + val := array(); + for i,v in LOGSTRUCTarray do + begin + v0 := v[0]; + fvi := invoke(f,v0); + val[v0]:= fvi; + end + val["color"]:= f.color; + val["bkcolor"]:= f.bkcolor; + return SetValues(val); + end + function SetValues(vs);virtual; + begin + {** + @explan(˵) ͨ %% + @param(vs)(array)Ϣ %% + **} + if not ifarray(vs)then exit; + for i,v in LOGSTRUCTarray do + begin + v0 := v[0]; + vsv := vs[v0]; + if not ifnil(vsv)then + begin + ovi := invoke(self,"f"+v0); + if ovi <> vsv then + begin + invoke(self,"f"+v0,1,vsv); + cg := true; + end + end + end + if ifnumber(vs["color"])then + begin + cg := true; + SetColor(vs["color"]); + end + if cg then Onchange(); + return cg; + end + function GetFontWidth(); + begin + if FWidth>0 then return FWidth; + return abs(FHeight)/2; + end + property height read Fheight write Setheight; + property width read Fwidth write Setwidth; + property escapement read Fescapement write Setescapement; + property orientation read Forientation write Setorientation; + property weight read Fweight write Setweight; + property italic read Fitalic write Setitalic; + property underline read Funderline write Setunderline; + property strikeout read Fstrikeout write Setstrikeout; + property charset read Fcharset write Setcharset; + property outprecision read Foutprecision write Setoutprecision; + property clipprecision read Fclipprecision write Setclipprecision; + property quality read Fquality write Setquality; + property pitchandfamily read Fpitchandfamily write Setpitchandfamily; + property facename read Ffacename write Setfacename; + property Color read FColor write SetColor; + property bkColor read FBKColor Write SetBkColor; + property bkmode read FBkmode Write SetBkMode; +end + +type TFontControl=class(tfont) + {** + @explan(˵) ؼ %% + **} + private + FControl; + Function SetControl(v); + begin + if(v <> FControl)and(v is class(tcontrol))then + begin + FControl := v; + end + end + protected + function Onchange();override; + begin + inherited; + if FControl then + begin + FControl.FontChanged(); + end + end + public + function create();override; + begin + inherited; + end + function Recycling();override; + begin + FControl := nil; + inherited; + end + property Control read FControl write SetControl; +end +type TPen=class(tgdi) + private + FStyle; + FColor; + FWidth; + static LOGSTRUCT; + class function sinit();override; + begin + inherited; + if not LOGSTRUCT then LOGSTRUCT := tslcstructure(array(("lopenstyle","int",0), + ("lopnwidth","int",1), + ("lopnwidth2","int",0), + ("lopncolor","int",0))); + end + function HandleNeeded();override; + begin + if not HandleAllocated()then + begin + hp := reference(); + if not hp then + begin + if fStyle in array(PS_NULL,PS_SOLID,PS_INSIDEFRAME)then + begin + w := FWidth; + end else + w := 0; + hp := _wapi.CreatePen(FStyle,w,FColor); + addsource(hp); + end + FHandle := hp; + end + return FHandle; + end + function gdiformatstr();override; + begin + return format("class:pen;style:%d;color:%d;width:%d",FStyle,FColor,FWidth); + end + function Onchange();override; + begin + if Canvas then Canvas.OnPenChange(); + DestroyHandle(); + end + function SetColor(c); + begin + if ifnumber(c)and c <> FColor then + begin + Onchange(); + FColor := c; + end + end + function SetStyle(s); + begin + if(s in array(0,1,2,3,4,5,6)) and s <> FStyle then + begin + Onchange(); + FStyle := s; + end + end + function SetWidth(w); + begin + if w >= 0 and w<20 and c <> FWidth then + begin + Onchange(); + FWidth := w; + end + end + function copypen(p); + begin + {** + @explan(˵)pen %% + @param(p)(tpen) Դ %% + **} + if p is class(tpen)then + begin + ps := p.style; + wd := p.width; + cl := p.color; + if ps <> FStyle or wd <> FWidth or cl <> FColor then + begin + Onchange(); + FStyle := ps; + FWidth := wd; + FColor := cl; + end + end + end + public + function create(); + begin + inherited; + FStyle := PS_SOLID; + FWidth := 1; + FColor := 0; + end + property Color read FColor write SetColor; + property Width read FWidth write SetWidth; + property Style read FStyle write SetStyle; +end + +type TBrush=class(tgdi) + private + FStyle; + FColor; + FHatch; + static LOGSTRUCT; + function SetColor(c); + begin + if ifnumber(c)and c <> FColor then + begin + onchange(); + FColor := c; + end + end + public + class function sinit();override; + begin + inherited; + if not LOGSTRUCT then + begin + LOGSTRUCT := tslcstructure(array(("lbstyle","int",BS_SOLID), + ("lbcolor","int",0), + ("lbhatch","intptr",0))); + end + end + function onchange();override; + begin + if Canvas then Canvas.OnBrushChange(); + DestroyHandle(); + end + function HandleNeeded();override; + begin + if not HandleAllocated()then + begin + hp := reference(); + if not hp then + begin + //LOGSTRUCT._setvalue_("lbstyle",FStyle); + //LOGSTRUCT._setvalue_("lbcolor",FColor); + //LOGSTRUCT._setvalue_("lbhatch",FHatch); + //hp := _wapi.CreateBrushIndirect(LOGSTRUCT._getptr_); + hp := _wapi.CreateSolidBrush(FColor); + addsource(hp); + end + FHandle := hp; + end + return FHandle; + end + function gdiformatstr();override; + begin + return format("class:brush;style:%d;color:%d;hatch:%d",FStyle,FColor,FHatch); + end + function create();override; + begin + inherited create(); + sinit(); + FStyle := BS_SOLID; + FHatch := 0; + FColor := 0; + end + function copybrush(b); + begin + if b is class(tbrush)then + begin + if FColor <> b.color then + begin + onchange(); + FColor := b.color; + end + end + end + //property Style read FStyle write SetStyle; + property Color read FColor write SetColor; + //property Hatch read FHatch write SetHatch; +end +type TCanvsRgnClipAutoSave=class + {** + @expan(˵) ücanvas,ʱԭ %% + **} + function Create(cvs,rec); + begin + {** + @explan(˵)ü %% + @param(cvs)(tcanvas) canvas %% + @param(rec)(array()) %% + **} + if(cvs is class(TCanvas))and cvs.HandleAllocated()and ifarray(rec)then + begin + FW32api := cvs._wapi; + FCvsHandle := cvs.Handle; + FCrg := FW32api.CreateRectRgn(rec[0],rec[1],rec[2],rec[3]); + FBKrg := FW32api.SelectClipRgn(FCvsHandle,FCrg); //ü + end + end + function Destroy(); + begin + if FW32api and FCvsHandle and FBKrg and FCrg then + begin + FW32api.SelectClipRgn(FCvsHandle,FBKrg); //ָ + FW32api.DeleteObject(FCrg); // + end + FW32api := nil; + end + private + FBKrg; + FCrg; + FCvsHandle; + FW32api; +end +type TControlCanvs=class(TCanvas) + function Create(); + begin + inherited; + end + property ClipRect read FClipRect write SetClipRect; + private + Function SetClipRect(v); + begin + if ifarray(v)and v[0]0 then FCurrentId--; + end + property CurrenId read FCurrentId; + end + function SetTextTabLen(v); + begin + nv := integer(v); + if nv <> FTabLength then + begin + FTabLength := nv; + if not FTabLenParam then FTabLenParam := new Ttagdrawtextparams(); + FTabLenParam.itablength := nv; + end + end + function SetPen(p); + begin + FPen.copypen(p); + end + function SetFont(f); + begin + if ifarray(f)then + begin + FFont.SetValues(f); + end else + FFont.copyfont(f); + end + function SetBrush(b); + begin + FBrush.copybrush(b); + end + function SelectObject(hgdi); + begin + if HandleAllocated()then + begin + return _wapi.SelectObject(FHandle,hgdi); + end + end + function SetHandle(h); + begin + if ifnumber(h)then + begin + flashhandle(); + if FHandle <> h then + begin + FCounter.clean(); + end + FHandle := h; + if h then + begin + _wapi.GetTextMetricsA(FHandle,FTEXTMETRICA._getptr_); + end + end + end + function flashhandle(); + begin + FState := 1+2+4+8+16+32+64; + end + function ifrect(rect); + begin + return ifarray(rect)and ifnumber(rect[0])and ifnumber(rect[1])and ifnumber(rect[2])and ifnumber(rect[3]); + end + public + function GetTextExtent(s,mul); + begin + {** + @explan(˵) ַƿȺ͸߶ %% + @param(s)(string) ַ %% + @param(mul)(bool) Ĭ϶true%% + **} + r := array(0,0); + if ifstring(s)and HandleAllocated()then + begin + requiregdi(); + if ifnil(mul)then mul := true; + if mul then + begin + ss := str2array(s,"\n"); + if length(ss)then + begin + for i,v in ss do + begin + ri := array(0,0); + vi := trim(v); + if not vi then vi := "\r"; + _wapi.GetTextExtentPoint32A2(FHandle,vi,length(v),ri); + r[0]:= max(r[0],ri[0]); + r[1]+= ri[1]; + end + end + end else + _wapi.GetTextExtentPoint32A2(FHandle,s,length(s),r); + end + return r; + end + function SelectClipRgn(rgn); + begin + {** + @explan(˵) %% + @param(rgn)(TRgn) ѡ %% + **} + if rgn=FRgn then exit; + r := FRgn; + FRgn := rgn; + if not HandleAllocated()then exit; + if FRgn is class(TRgn)then + begin + r1 := _wapi.SelectClipRgn(FHandle,FRgn.Handle); + end else + begin + r1 := _wapi.SelectClipRgn(FHandle,nil); + end + if r is class(trgn)then return r; + return r1; + end + function create();override; + begin + inherited; + FTabLength := 0; + FCounter := new TCounter(); + FHandle := 0; + FState := 0; + FPen := new tpen(); + FPen.Canvas := self; + FBrush := new tbrush(); + FBrush.Canvas := self; + FFont := new tfont(); + FFont.Canvas := self; + FTEXTMETRICA := new ttagTEXTMETRICA(); + end + function Recycling();override; + begin + {** + @explan(˵)Դ %% + **} + FBrush.Recycling(); + FPen.Recycling(); + FBrush := nil; + FPen := nil; + FState := nil; + inherited; + end + function destroy();override; + begin + inherited; + end + function HandleAllocated(); + begin + {** + @explan(˵) жcanvasǷ %% + @return(bool) + **} + return ifnumber(FHandle)and(FHandle <> 0); + end; + procedure requiregdi(rq); + begin + {** + @explan(˵) ʼgdi 续ˢ %% + **} + if HandleAllocated()then + begin + if FState .& 1 then + begin + SelectObject(FPen.Handle); + end + if FState .& 2 then + begin + SelectObject(FBrush.Handle); + end + if FState .& 4 then + begin + SelectObject(FFont.Handle); + end + if FState .& 8 then + begin + _wapi.SetTextColor(FHandle,FFont.Color); + end + if FState .& 16 then + begin + _wapi.SetBkColor(FHandle,FFont.bkColor); + end + if FState .& 32 then + begin + _wapi.SetbkMode(FHandle,(FFont.bkmode=OPAQUE)?OPAQUE:TRANSPARENT); //OPAQUE + end + if FRgn is class(trgn)then + begin + _wapi.SelectClipRgn(FHandle,FRgn.Handle); + end + FState := 0; + end + end + function OnFontbkmodeChange(); + begin + FState .|= 32; + end + function OnPenChange(); + begin + FState .|= 1; + end + function OnBrushChange(); + begin + FState .|= 2; + end + function OnFontChange(); + begin + FState .|= 4; + end + function OnFontColorChange(); + begin + FState .|= 8; + end + function OnFontbkColorChange(); + begin + FState .|= 16; + end + function SetViewportOrg(xy); + begin + {** + @explan(˵)ѡ׼ %% + @param(xy)(array) array(x,y)%% + @return(integer) %% + **} + if HandleAllocated()then + begin + if not ifarray(xy)then return 0; + return _wapi.SetViewportOrgEx(FHandle,xy[0],xy[1],nil); + end + end + function SetPixel(xy,colr); + begin + {** + @explan(˵) һ %% + @param(xy)(array) array(x,y)%% + @param(colr)(integer) ɫrgbֵ %% + @return(integer) %% + **} + if HandleAllocated()then return _wapi.SetPixel(FHandle,xy[0],xy[1],colr); + end + function fillrgn(rgn); + begin + {** + @explan(˵) %% + @param(rgn)(trgn) %% + **} + if not HandleAllocated()then exit; + if not(rgn is class(TRgn))then exit; + _wapi.FillRgn(FHandle,rgn.Handle,FBrush.Handle); + end + function FillRect(rec); // + begin + {** + @explan(˵)rect %% + @param(rec)(array) array(,,,)%% + @param(br)(tbrush) ˢ %% + **} + if HandleAllocated()then + begin + return _wapi.FillRect(FHandle,(ifrect(rec)?rec:zeros(4)),FBrush.Handle); + end + end + function InvertRect(rec); //,rec,brˢ + begin + {** + @explan(˵) %% + @param(rec)(array) array(,,,)%% + **} + if not HandleAllocated()then exit; + return _wapi.InvertRect(FHandle,rec,FBrush.Handle); + end + function moveto(pos); + begin + {** + @explan(˵)ƶǰ%% + @param(pos)(array) λarray(x,y) %% + @return(array) ԭλ %% + **} + ret := array(0,0); + if not ifarray(pos)then return-1; + if HandleAllocated()then + begin + _wapi.MoveToEx(FHandle,pos[0],pos[1],ret); + end + return ret; + end + function lineto(pos); // + begin + {** + @explan(˵)ߵ%% + @param(pos)(array) λarray(x,y) %% + **} + if not ifarray(pos)then return-1; + if HandleAllocated()then + begin + requiregdi(); + return _wapi.LineTo(FHandle,pos[0],pos[1]); + end + end + function textout(str,pos); //,str,posʼλ + begin + {** + @explan(˵)ı%% + @param(str)(string) ַ %% + @param(pos)(array) λarray(x,y) %% + **} + if not ifstring(str)then return 0; + if not ifarray(pos)then pos := array(0,0); + if HandleAllocated()then + begin + requiregdi(); + return _wapi.TextOutA(FHandle,pos[0],pos[1],str,length(str)); + end + end + function drawtext(str,rec,uft); //л + begin + {** + @explan(˵)ָı%% + @param(str)(string) Ƶ %% + @param(rec)(array) array(left,top,right,bottom) %% + @param(uft)(integer) DT_CALCRECTȽҪʹDrawTextıijߴ硣ıжУDrawTextʹlpRectľεĿȣչεĵײıһСıֻһУDrawTextıεұ߽磬еһַκһDrawTextظʽıĸ߶ȣǻı + DT_CENTERָıˮƽʾ + DT_VCENTERָıֱʾñֻڵıʱЧDT_SINGLELINEʹá + DT_SINGLELINEʾıسͻзС + %% + **} + if not ifstring(str)then return-1; + if not ifnumber(uft)then uft := DT_NOPREFIX; //ĬϺ &ռλ + if not ifarray(rec)then rec := nil; + if HandleAllocated()then + begin + requiregdi(); + if FTabLength then + begin + return _wapi.DrawTextExA(FHandle,str,length(str),rec,uft .| DT_EXPANDTABS .| DT_TABSTOP,FTabLenParam._getptr_()); + end else + return _wapi.DrawTextA(FHandle,str,length(str),rec,uft); + // + end + end + function StretchDraw(rec,bmp); + begin + {** + @explan(˵) bitmap %% + @param(rec)(array of integer) array(,,,) %% + @param(bmp)(tbitmap) λͼ %% + **} + if not(bmp is class(tbitmap))then exit; + bmp.StretchDraw(self,rec); + end + function DrawBitmap(bmp,p); + begin + {** + @explan(˵)bitmap %% + @param(bmp)(tbitmap) ͼ %% + @param(p)( array of integer) λ array(x,y) + **} + if not(bmp is class(tbitmap))then return-1; + if not ifarray(p)then p := array(0,0); + bmp.draw(self,p[0],p[1]); + end + function DrawIcon(ico,p); + begin + {** + @explan(˵)icon %% + @param(ico)(ticon) ͼ %% + @param(p)( array of integer) λ array(x,y) + **} + if HandleAllocated()then + begin + if not(ifarray(p)and ifnumber(p[1])and ifnumber(p[0]))then p := array(0,0); + if(ico is class(ticon))and ico.Handle then return _wapi.DrawIcon(FHandle,p[0],p[1],ico.Handle); + end + end + function draw(name_,points,f,m); + begin + {** + @explan(˵)gdiͼ%% + @param(name_)(string) ͼ, rectangle ;ellipse Բ;roundrect ԲǾ;chord ;pie ;polybezier ;polygonֱ %% + @param(points)(array) array((0,0),(1,2)) ,Ķٸname_ȷ %% + @param(f)(integer) ͼ ڻߵʱõķ %% + @param(m)(integer) polypolyline ʹñʾͼʽ %% + **} + if not HandleAllocated()then return 0; + requiregdi(); + if not ifstring(name_)then return 0; + _name_1 := lowercase(name_); + r := length(points); + c := mcols(points); + if not(r>1 and c=2)then return 0; + if "framecontrol"=_name_1 then + begin + if r<2 then return 0; + nrc := array(points[0][0],points[0][1],points[1][0],points[1][1]); + ret := _wapi.DrawFrameControl(FHandle,nrc,(f 4 then return 0; + if not ifnil(f)then SetArcDirection(FHandle,f); + ret := _wapi.Arc(FHandle,points[0,0],points[0,1],points[1,0],points[1,1],points[2,0],points[2,1],points[3,0],points[3,1]); + end else + if(("polygon"=_name_1)or("polyline"=_name_1))then + begin + if r<2 then return 0; + pt := pointtovector(points); + if "polygon"=_name_1 then + begin + if r<3 then return 0; + ret := _wapi.Polygon(FHandle,pt,r); + end else + ret := _wapi.polyline(FHandle,pt,r); + end else + if "polypolyline"=_name_1 then + begin + if ifarray(f)and(sum(f)=length(points))then + begin + pt := pointtovector(points); + ret := _wapi.polypolyline(FHandle,pt,f,m); + end + end else + if("polybezier"=_name_1)then + begin + if r<3 then return 0; + pt := pointtovector(points); + ret := _wapi.PolyBezier(FHandle,pt,r); + end + return ret; + end + + function CopyBitmap(rect); + begin + {** + @explan(˵) ȡcanvasλͼ %% + @param(array of integer) array(,,,); + @return(tbitmap|nil) ɹλͼ %% + **} + r := nil; + if not(ifarray(rect)and rect[2]>rect[0]and rect[3]>rect[1])then return r; + if not HandleAllocated()then return r; + if not FHDC then FHDC := _wapi.CreateCompatibleDC(0); + if not FHDC then return r; + bthandle := _wapi.CreateCompatibleBitmap(FSHDC2,w,h); + if not bthandle then return r; + oldb := _wapi.SelectObject(FHDC,bthandle); + _wapi.BitBlt(FHDC,0,0,rect[2]-rect[0],rect[3]-rect[1],FHandle,rect[0],rect[1],SRCCOPY); + if oldb then _wapi.SelectObject(FHDC,oldb); + R := new tbitmap(); + R.handle := bthandle; + return r; + end + function SetWorldTransform(trans); + begin + {** + @explan(˵)ıת%% + @param(trans)(array) array(cos,-sin,sin,cos,x,y)%% + **} + _xformobj._setvalue_("em11",trans[0]); + _xformobj._setvalue_("em12",trans[1]); + _xformobj._setvalue_("em21",trans[2]); + _xformobj._setvalue_("em22",trans[3]); + _xformobj._setvalue_("edx",trans[4]); + _xformobj._setvalue_("edy",trans[5]); + return _wapi.SetWorldTransform(FHandle,_xformobj._getptr_); + end + function SetPolyFillMode(md); //ʽ + begin + {** + @explan(˵)ģʽ %% + @param(md)(integer) ģʽ ALTERNA WINDING %% + **} + if HandleAllocated()then if ifnumber(md)then return _wapi.SetPolyFillMode(FHandle,md); + return-1; + end + function SetBkMode(m); + begin + {** + @explan(˵)ıʽ%% + @param(m)(integer) ʽOPAQUE or TRANSPARENT %% + **} + if HandleAllocated()then return _wapi.SetBkMode(FHandle,m); + end + function GetBkMode(); + begin + {** + @explan(˵)ıʽ%% + @return(integer) ʽ%% + **} + if HandleAllocated()then return _wapi.GetBkMode(FHandle); + end + function SetTextAlign(fmt); + begin + {** + @explan(˵)ֶ䷽ʽ%% + @param(fmt)(integer) ䷽ʽTA_LEFT; + TA_RIGHT; + TA_CENTER; + TA_TOP; + TA_BOTTOM;Ĭ %% + **} + if not ifnumber(fmt)then fmt := _wapi.TA_LEFT; + if HandleAllocated()then return _wapi.SetTextAlign(FHandle,fmt); + end + function ReleaseDC();virtual; + begin + //if HandleAllocated() then _wapi.ReleaseDC(FHandle); + end + + {function BeginPath(); + begin + if HandleAllocated() then return _wapi.BeginPath(FHandle); + end + function EndPath(); + begin + if HandleAllocated() then return _wapi.EndPath(FHandle); + end + function StrokePath(); + begin + requiregdi(); + if HandleAllocated() then return _wapi.StrokePath(FHandle); + end + function FillPath(); + begin + requiregdi(); + if HandleAllocated() then return _wapi.FillPath(FHandle); + end + function StrokeAndFillPath(); + begin + requiregdi(); + if HandleAllocated() then return _wapi.StrokeAndFillPath(FHandle); + end} + function DeleteDC(); + begin + if HandleAllocated()then _wapi.DeleteDC(FHandle); + FHandle := 0; + end + function SaveDC(); + begin + {** + @explan(˵) 浱ǰdc %% + **} + if HandleAllocated()then + begin + FCounter.InCrease(); + _wapi.SaveDC(FHandle); + end + end + function RestoreDC(); + begin + {** + @explan(˵) ԭdc %% + **} + if HandleAllocated()then + begin + if FCounter.CurrenId>0 then + begin + FCounter.DeCrease(); + _wapi.RestoreDC(FHandle,-1); + end + end + end + property Handle read FHandle write SetHandle; + property pen read FPen write SetPen; + property font read FFont write SetFont; + property brush read FBrush write SetBrush; + property bkmode write SetBkMode; + property TextMetric read FTEXTMETRICA; + property TextTabLength read FTabLength write SetTextTabLen; + {** + @param(pen)(tpen) %% + @param(brush)(TBRUSH) ˢ %% + @param(font)(tfont) %% + @param(bkmode)(integer) ʽ OPAQUE or TRANSPARENT Ĭ TRANSPARENT %% + @param(TextMetric)(ttagTEXTMETRICA) ıʽϢ %% + **} +end + +type TTimer = class(tcomponent)//ʱ + {** + @explan(˵)ʱ,ԺΪСλ %% + **} + {** + @example(--ʱ) + //,һΪ(),ڶΪָ + tm := new ttimer(1000,function(o,e)begin echo now(); end ); + tm.start();//ʱ + tm.stop();//ֹͣ + **} + private + static _STIMERS; //TIMER + static FSIDC; //id + class function Sgettimer(id); + begin + {** + @explan(˵) ͨidöʱ %% + @param(id)(integer) ʱid %% + **} + return _STIMERS[id]; + end + class function Ssettimer(tm); + begin + {** + @explan(˵)洢ʱ %% + @param(tm)(ttimer) ʱ%% + **} + _STIMERS[tm.id]:= tm; + end + class function Sdeltimer(tid); + begin + {** + @explan(˵) ɾʱ %% + @param(tid)(integer) id%% + **} + if tid and(ifnumber(tid))then reindex(_STIMERS,array(tid:nil)); + end + protected FOntimeout; + private + FOntimer; + Fid; + FInterval; + FStart; + _kill0; // + function SetEnabled(f); + begin + if f then start(); + else stop(); + end + function SetInterval(intv); //ü + begin + {** + @explan(˵)ü %% + @param(intv)(integer) , %% + **} + if not(ifnumber(intv))then return FInterval; + if FStart then + begin + ndstart := 1; + stop(); + end + if intv <> FInterval and ifnumber(intv)and intv>0 then //ʱ䲻 + begin + FInterval := intv; + end + if ndstart then start(); + end + public + {** + @param(FSIDC)(tidcreater) id%% + @param(_STIMERS)(array) ȫִ洢%% + @param(FOntimer)(fpointer) timeoutִж%% + @param(_kill0)(bool) %% + **} + function create(AOwner);override; + begin + inherited; + FID := FSIDC.createid(); + FStart := false; + FInterval := 1000; + end + function timeout(cmd,t); //һ¼ + begin + {** + @explan(˵) һ¼ %% + @param(cmd)(fpointer) ִлص %% + @param(t)(integer) tִ %% + **} + FOntimeout := cmd; + if ifnumber(t)then SetInterval(t); + FOntimer := function(o,e) + begin + try + stop(); + calldatafunction(FOntimeout,o,e); + finally + FOntimeout := nil; + end; + end; + start(); + end + function start(); //ʼ + begin + {** + @explan(˵) %% + **} + if not(dataisfunction(FOntimer)and FInterval)>0 then return-1; + if FStart then return FStart; + ret := _wapi.SetTimer(nil,Fid,FInterval,getwinprocptr(2)); + _kill0 := ret; + Ssettimer(self(true)); + FStart := ret <> 0; + return FStart; + end + function stop(); //ֹͣ + begin + {** + @explan(˵)ֹͣ %% + **} + if FStart then + begin + if _kill0 then + begin + FStart := not((_wapi.KillTimer(nil,_kill0))<> 0); + if FStart=false then _kill0 := 0; + end + Sdeltimer(FID); + end + return not FStart; + end + function Recycling();override; + begin + {** + @explan(˵)Ԥ %% + **} + stop(); + FSIDC.deleteid(FID); + FOntimer := nil; + FOntimeout := nil; + FTimerStrc := nil; + inherited; + end + function destroy();override; + begin + inherited; + end + class function _timeproc_(hwnd,message,wparam,lparam); + begin + {** + @explan(˵) ʱصӿ %% + @param(hwnd)(integer) ھ %% + @param(message)(integer) Ϣid %% + @param(lparam)(integer) Ϣ2 %% + @param(wparam)(integer) Ϣ1 %% + **} + e := new tuieventbase(message,wparam,lparam,hwnd); + for i,iv in mrows(_STIMERS,1) do + begin + v := _STIMERS[iv]; + if v is class(ttimer)then if v.tproc(e)then return; + end + //return _twinproc_(hwnd,message,wparam,lparam); + end + class function Sinit();override; + begin + {** + @explan(˵)ʼʱȫ %% + **} + if not FSIDC then + begin + _STIMERS := array(); + FSIDC := new tidcreater(); + end + inherited; + end + function tproc(e);virtual; + begin + if e.wparam and(e.wparam=_kill0)then + begin + CallMessgeFunction(FOntimer,self(true),e); + return 1; + end + end + property Interval:integer read FInterval write SetInterval; + property Ontimer:eventhandler read FOntimer write FOntimer; + property Enabled:bool read FStart Write SetEnabled; + property id read FID; + function publishs();override; + begin + return array("name","interval","ontimer"); + end + {** + @param(Interval)(integer) м %% + @param(Ontimer)(funtion[self,tuieventbase]) ʱ %% + @param(Enabled)(bool) ǷѾ %% + **} +end +//******action ***************************************** +type TBasicAction=class(TComponent) + private + FActionComponent:TComponent; //ִеtcomponent + FOnChange:TNotifyEvent; + FOnExecute:TNotifyEvent; + FOnUpdate:TNotifyEvent; + FParent; + function SetParent(p); + begin + if FParent <> p then + begin + if FParent is class(TActionList)then + begin + FParent.DeleteAction(self); + end + if p is class(TActionList)then + begin + p.AddAction(self); + end + Fparent := p; + end + end + protected FClients; + {** + @param(FClients)( TFpList of TActionLink) %% + **} + procedure Change;virtual; + begin + calldatafunction(FOnChange,self); + end + procedure SetOnExecute(Value:TNotifyEvent);virtual; + begin + for i := 0 to FClients.count-1 do + begin + FClients[i].SetOnExecute(value); + end + FOnExecute := Value; + Change(); + end + public + function Create(AOwner:TComponent);override; + begin + inherited; + FClients := new TFpList(); + end + function Recycling();override; + begin + if FActionComponent then + begin + FActionComponent.RemoveFreeNotification(self); + end + while FClients.Count>0 do + begin + UnRegisterChanges(FClients.Last()); + end + inherited; + end + function Destroy();override; + begin + inherited; + end + function HandlesTarget(Target:TObject):Boolean;virtual; + begin + return false; + end + procedure UpdateTarget(Target:TObject);virtual; + begin + end + procedure ExecuteTarget(Target:TObject);virtual; + begin + end + function Execute():Boolean;virtual; + begin + if FOnExecute then + begin + calldatafunction(FOnExecute,self); + return true; + end + return false; + end + procedure RegisterChanges(Value:TBasicActionLink); + begin + Value.FAction := Self(true); + FClients.add(Value); + end + procedure UnRegisterChanges(Value:TBasicActionLink); + begin + for i := 0 to FClients.count-1 do + begin + if FClients[i]=Value then + begin + Value.FAction := nil; + FClients.deli(i); + break; + end + end + end + {function Update(): Boolean; virtual; + begin + if FOnUpdate then + begin + calldatafunction(FOnUpdate,self); + return true; + end + return false; + end } + function Notification(AComponent,Operation);override; + begin + inherited; + if Operation=opRemove and AComponent=FActionComponent then + begin + FActionComponent := nil; + if FParent is class(TActionList)then + begin + FParent.DeleteAction(self); + end + end + end + function SetActionComponent(Value); + begin + if FActionComponent <> Value then + begin + if FActionComponent is class(TComponent)then FActionComponent.RemoveFreeNotification(self); + FActionComponent := Value; + if FActionComponent is class(TComponent)then FActionComponent.FreeNotification(self); + end + end + property ActionComponent:TComponent read FActionComponent write SetActionComponent; + property OnExecute:eventhandler read FOnExecute write SetOnExecute; + property OnUpdate:TNotifyEvent read FOnUpdate write FOnUpdate; + property OnChange:TNotifyEvent read FOnChange write FOnChange; + property parent read FParent Write SetParent; + {** + @param(OnExecute)(fpointer) ִлص %% + @param(OnUpdate)(fpointer) »ص %% + @param(OnChange)(fpointer) ıص %% + **} +end; +type TContainedAction=class(TBasicAction) + function create(AOwner);override; + begin + inherited; + end + function Destroy();override; + begin + inherited; + end +end + +type TCustomAction=class(TContainedAction) + {** + @explan(˵) action %% + **} + private + FCaption:string; + FChecked:Boolean; + FChecking:Boolean; + FEnabled:Boolean; + FGroupIndex:Integer; + FHint:string; + FVisible:Boolean; + procedure SetCaption(const Value:string); + begin + if Value=FCaption then exit; + for I := 0 to FClients.Count-1 do + begin + FClients[I].SetCaption(Value); + end + FCaption := Value; + Change(); + end + procedure SetChecked(Value:Boolean); + begin + if Value=FChecked then exit; + for I := 0 to FClients.Count-1 do + begin + FClients[I].SetChecked(Value); + end + FChecked := Value; + Change(); + end + procedure SetEnabled(Value:Boolean); + begin + nValue := Value?true:false; + if nValue=FEnabled then exit; + for I := 0 to FClients.Count-1 do FClients[I].SetEnabled(nValue); + FEnabled := nValue; + Change(); + end + procedure SetVisible(Value:Boolean); + begin + nValue := Value?true:false; + if nValue=FVisible then exit; + for I := 0 to FClients.Count-1 do FClients[I].SetVisible(nValue); + FVisible := nValue; + Change(); + end + protected + procedure AssignTo(Dest:TPersistent);override; + begin + {** + @explan(˵) ֵ %% + **} + if Dest=Self then exit; + if Dest is class(TCustomAction)then + begin + ps := array("checked","caption","visible","enabled"); + for i,v in ps do invoke(Dest,v,1,invoke(self,v)); + end else + inherited; + end + public + function Create(AOwner:TComponent);override; + begin + {** + @explan(˵) %% + **} + inherited; + FEnabled := True; + FVisible := True; + end + function Recycling();override; + begin + inherited; + end + function Destroy;override; + begin + inherited; + end + function Execute():Boolean;override; + begin + Result := False; + Result := Enabled and inherited Execute(); + return Result; + end + published + property Caption:string read FCaption write SetCaption; + property Checked:bool read FChecked write SetChecked; + property Enabled:bool read FEnabled write SetEnabled; + property Visible:bool read FVisible write SetVisible; +end; +type TAction=class(TCustomAction) + {** + @explan(˵) action / command ӿ,ο TCustomAction %% + **} + function create(AOwner);override; + begin + inherited; + end + function destroy();override; + begin + inherited; + end + function publishs();override; + begin + r := array("name","caption","enabled"); + return r; + end +end + +type TBasicActionLink=class(TSLUIBASE) + {** + @explan(˵) action component %% + **} + private + FOnChange; + protected + procedure AssignClient(AClient:TObject);virtual; + begin + end + procedure Change;virtual; + begin + calldatafunction(OnChange,FAction); + end + function IsOnExecuteLinked():Boolean;virtual; + begin + return true; + end + procedure SetAction(Value:TBasicAction);virtual; + begin + if Value <> FAction then + begin + if FAction then FAction.UnRegisterChanges(Self(true)); + FAction := Value; + if Value then Value.RegisterChanges(Self(true)); + end; + end + procedure SetOnExecute(Value:TNotifyEvent);virtual; + begin + end + public + FAction:TBasicAction; + function Create(AClient:TObject);override; + begin + inherited create(); + AssignClient(AClient); + end + Function Recycling();override; + begin + if FAction is class(TBasicAction)then FAction.UnRegisterChanges(self); + inherited; + end + function Destroy;override; + begin + inherited; + end + function Execute(AComponent:TComponent):Boolean;virtual; + begin + {** + @explan(˵) ִ %% + **} + if not(FAction is class(TBasicAction))then exit; + FAction.ActionComponent := AComponent; + try + r := FAction.Execute(); + finally + FAction.ActionComponent := nil; + end; + return r; + end + {function Update(): Boolean; virtual; + begin + if FAction is class(TBasicAction) then return FAction.Update(); + end } + property Action:TBasicAction read FAction write SetAction; + property OnChange:TNotifyEvent read FOnChange write FOnChange; + {** + @param(OnChange)(function[sender:tcomponent]) ıĻص %% + @param(Action)(taction) action %% + **} +end; +type TActionLink=class(TBasicActionLink) + {** + @explan(˵) actionؼ %% + **} + public + procedure SetCaption(const Value:string);virtual; + begin + end + procedure SetChecked(Value:Boolean);virtual; + begin + end + procedure SetEnabled(Value:Boolean);virtual; + begin + end + procedure SetVisible(Value:Boolean);virtual; + begin + end + function create(AClient);override; + begin + inherited; + end + protected + function IsCheckedLinked():Boolean;virtual; + begin + return Action is CLASS(TCustomAction); + end + function IsEnabledLinked():Boolean;virtual; + begin + return Action is CLASS(TCustomAction); + end + function IsCaptionLinked():Boolean;virtual; + begin + return Action is CLASS(TCustomAction); + end + function IsOnExecuteLinked():Boolean;virtual; + begin + return Action is CLASS(TCustomAction); + end + function IsVisibleLinked: + Boolean; + virtual; + begin + return Action is CLASS(TCustomAction); + end +end; +type TMenuActionLink=class(TControlActionLink) + {** + @explan(˵) ˵actionlink %% + **} + protected + procedure AssignClient(AClient);override; + begin + {** + @explan(˵)ֵcontrol %% + @param(AClient)(tcontrol) %% + **} + if AClient is class(tmenu)then FClient := AClient; + end + function IsVisibleLinked():Boolean;override; + begin + return false; + end + function IsCheckedLinked():Boolean;override; + begin + return FClient and(Action is CLASS(TCustomAction)); + end + public + function create(AOwner);override; + begin + inherited; + end + procedure SetChecked(Value:Boolean);override; + begin + if IsCheckedLinked()then return FClient.Checked := Value; + end +end +type TControlActionLink=class(TActionLink) + {** + @explan(˵)tcontrol taction %% + **} + protected FClient:TControl; + procedure AssignClient(AClient);override; + begin + {** + @explan(˵)ֵcontrol %% + @param(AClient)(tcontrol) %% + **} + if AClient is class(tcontrol)then FClient := AClient; + end + function IsCaptionLinked():Boolean;override; + begin + return FClient and inherited; + end + function IsEnabledLinked():Boolean;override; + begin + return FClient and inherited; + end + function IsVisibleLinked():Boolean;override; + begin + return FClient and inherited; + end + function IsOnExecuteLinked():Boolean;override; + begin + return FClient and inherited; + end + function IsCheckedLinked():Boolean;virtual; + begin + return false; + end + public + function create(AClient);override; + begin + inherited; + end + function destroy();override; + begin + inherited; + end + function Recycling();override; + begin + FClient := nil; + inherited; + end + procedure SetCaption(const Value:string);override; + begin + if IsCaptionLinked()then return FClient.Caption := Value; + end + procedure SetEnabled(Value:Boolean);override; + begin + if IsEnabledLinked()then return FClient.Enabled := Value; + end + procedure SetVisible(Value:Boolean);override; + begin + if IsVisibleLinked()then return FClient.Visible := Value; + end + procedure SetOnExecute(Value:TNotifyEvent);override; + begin + return inherited; + end +end; +type TActionList=class(TComponent) + {** + @explan(˵) actionlist %% + **} + private + FActionList; + function DeleteAllActions(); + begin + while FActionList.Count>0 do + begin + it := FActionList[0]; + if it is class(TBasicAction)then + begin + it.parent := nil; + end else + FActionList.deli(0); + end + end + public + function create(AOwner);override; + begin + inherited; + FActionList := new TFpList(); + end + function DeleteAction(v); + begin + {** + @explan(˵) ɾ %% + @param(v)(TBasicAction) + **} + if not(v is class(TBasicAction))then return 0; + idx := FActionList.indexof(v); + if not(idx >= 0)then return 0; + FActionList.deli(idx); + v.parent := nil; + end + function AddAction(V); + begin + {** + @explan(˵) ɾAction %% + @param(v)(TBasicAction) + **} + if v is class(TBasicAction)then + begin + if FActionList.indexof(v)>= 0 then return 0; + FActionList.add(v); + v.parent := self; + end + end + function Notification(AComponent,Operation);override; + begin + inherited; + if Operation=opRemove and AComponent=FActionComponent then + begin + DeleteAllActions(); + end + end + function Recycling();override; + begin + DeleteAllActions(); + inherited; + end + function publishs();override; + begin + return array("name"); + end +end +//***************************** +type TCommDlg=class(tcomponent) + {** + @explan(˵) ѡԻ %% + **} + private + FChooseOk; + FWndOwner; + FCaption; + function SetParent(p); + begin + FWndOwner := p; + end + protected + function SetCaption(v);virtual; + begin + FCaption := v; + end + public + function create(AOwner);override; + begin + inherited; + end + function Notification(AComponent,Operation);override; + begin + if Operation=opRemove then + begin + if AComponent=FWndOwner then FWndOwner := nil; + end + inherited; + end + function OpenDlg(); + begin + {** + @explan(˵) 򿪶Ի %% + **} + return FChooseOk := ChooseDlg(); + end + function ChooseDlg();virtual; + begin + {** + @explan(˵) 򿪶Ի麯 + **} + end + property ChooseOk read FChooseOk; + property WndOwner:variable read FWndOwner write FWndOwner; + property Parent read FWndOwner write SetParent; + property Caption:string read FCaption write SetCaption; + {** + @param(ChooseOk)(bool) Ƿִгɹ %% + @param(WndOwner)(TWinControl) %% + **} +end +type TMBbtnstyle=class() + {** + @explan(˵) TMessageboxADlg ťʽ%% + **} + static MB_OK; + static MB_OKCANCEL; + static MB_ABORTRETRYIGNORE; + static MB_YESNOCANCEL; + static MB_YESNO; + static MB_RETRYCANCEL; + static MB_CANCELTRYCONTINUE; + static MB_HELP; +end +type TMBiconstyle=class() + {** + @explan(˵)TMessageboxADlg ͼʽ%% + **} + static MB_ICONWARNING; + static MB_ICONASTERISK; + static MB_ICONQUESTION; + static MB_ICONSTOP; +end +type TMessageboxADlg=class(TCommDlg) + {** + @explan(˵) Ϣʾ %% + **} + private + FmbText; + Fbtnvals; + Ficonvals; + Fbtnval; + Ficonval; + function setMbtext(v) + begin + if FmbText <> v then + begin + FmbText := v; + end + end + function setcaption(v);override; + begin + if caption=v then exit; + inherited; + end + function setmbbtnstyle(v) + begin + if Fbtnval <> v and(v in Fbtnvals)then + begin + Fbtnval := v; + end + end + function setmbiconstyle(v) + begin + if Ficonval <> v and(v in Ficonvals)then + begin + Ficonval := v; + end + end + public + function create(AOwner);override; + begin + inherited; + FmbText := ""; + caption := "ʾ"; + Fbtnval := 0; + Ficonval := 48; + Fbtnvals := array(0,1,2,3,4,5,6,16384); + Ficonvals := array(48,64,32,16); + end + function ChooseDlg();override; + begin + hd := 0; + if Parent is class(TWinControl)then hd := Parent.Handle; + r := _wapi.MessageBoxA(hd,mbText,self.caption,Fbtnval .| Ficonval); + return r; + end + { + жmessageboxťǷ񱻰£ ChooseDlg()ķֵж + ֵ + IDABORT 3 "ֹ"ťѡ + IDCANCEL 2 "ȡ"ťѱѡ + IDCONTINUE 11 ""ťѡ + IDIGNORE 5 ""ťѱѡ + IDNO 7 "NO"ťѡ + IDOK 1 "OK"ťѡ + IDRETRY 4 ""ť + IDTRYAGAIN 10 "һ"ť + IDYES 6 "yes"ťѡ + } + property mbText:string read FmbText write setMbtext; + property mbbtnstyle:MBbtnstyle read Fbtnval write setmbbtnstyle; + property mbiconstyle:MBiconstyle read Ficonval write setmbiconstyle; + {** + @param(mbText)(string)ַ%% + @param(mbbtnstyle)(TMBbtnstyle)ťʽ%% + @param(mbiconstyle)(TMBiconstyle)ͼʽ%% + **} + function publishs();override; + begin + return array("name","chooseok","caption", + "mbtext","mbbtnstyle","mbiconstyle"); + end +end +type TColorChooseADlg=class(TCommDlg) + {** + @explan(˵)ɫѡ %% + **} + private + Fdlgcolor; + function SetCustomColors(cols); + begin + if ifarray(cols)then + begin + Fdlgcolor.lpcustcolors._setvalue_(0,cols); + end + end + function GetCustomColors(); + begin + return Fdlgcolor.lpcustcolors._getdata_(); + end + function SetResult(c); + begin + Fdlgcolor.rgbresult := c; + end + function GetResult() + begin + r := Fdlgcolor.rgbresult; + return r; + end + public + function create(AOwner);override; + begin + inherited; + Fdlgcolor := new ttagCHOOSECOLORA(); + end + function ChooseDlg();override; + begin + Fdlgcolor.flags := CC_RGBINIT .| CC_SOLIDCOLOR; //.| CC_SHOWHELP .| CC_SOLIDCOLOR; + if WndOwner is class(TWinControl)then Fdlgcolor.hwndowner := WndOwner.Handle; + r := _wapi.ChooseColorA(Fdlgcolor._getptr_); + return r; + end + {** + @param(CustomColors)(array of integer) Զɫ %% + @param(RgbResult)(integer) ɫrgbaֵ %% + **} + property CustomColors read GetCustomColors write SetCustomColors; + property Result:color read GetResult write SetResult; + function publishs();override; + begin + return array("name","chooseok","caption", + "customcolors","result"); + end +end +type TFontChooseADlg=class(TCommDlg) + {** + @explan(˵) ѡԻ %% + **} + private + FFontChoose; + function SetFontInfo(v); + begin + FFontChoose.SetFontInfo(v); + if ifnumber(v["color"])then FFontChoose.rgbcolors := v["color"]; + end + function GetFontInfo(); + begin + r := GetFont(); + if r is class(ttagLOGFONTA)then r := r._getdata_(); + if ifarray(r)then + begin + r["color"]:= FFontChoose.rgbcolors; + fh := r["height"]; + if fh<0 then r["height"]:= abs(fh); + fw := r["width"]; + if fw=0 then r["width"]:= integer(abs(fh/2)); + else if fw<0 then r["width"]:= abs(fw); + end + return r; + end + function GetFont(); + begin + return FFontChoose.lplogfont; + end + function SetColor(v); + begin + FFontChoose.rgbcolors := V; + end + public + function create(AOwner);override; + begin + inherited; + FFontChoose := new ttagCHOOSEFONTA(); + FFontChoose.flags := CF_EFFECTS .| CF_INITTOLOGFONTSTRUCT; //.|CF_BOTH ; + end + function ChooseDlg();override; + begin + if WndOwner is class(TWinControl)then FFontChoose.hwndowner := WndOwner.Handle; + return _wapi.ChooseFontA(FFontChoose._getptr_); + end + property FontInfo:font read GetFontInfo write SetFontInfo; + property color Write SetColor; + function publishs();override; + begin + array("name","chooseok","caption","color"); + end + {** + @param(LogFont)(ttagLOGFONTA) ߼%% + @param(FontInfo)(array) Ϣ %% + **} +end +type TSavefileADlg = class(TCommDlg) + {** + @explan(˵) ļ,ļ %% + @param(FFileTag)(TtagOFNA)openfile %% + **} + protected FFileTag; + function dlgType();virtual; + begin + //Իͣ0x1Ϊڡ0x2򿪴ڡ + return 1; + end + function setCaption(s);override; + begin + if ifstring(s)then + begin + inherited; + FFileTag.lpstrtitle := s; + end + end + private + FFilter; + Ffilterindex; + fIsShowHidden; + fIsMultiselected; + fIsOverwritePrompt; + fIsLinkFilePath; + fIsCreatePrompt; + fIsFileMustExist; + finitialdir; + function setFlagsBit(b,m,n); + begin + //bҪõλֵmҪõλֵıԱnҪõλ + if xor(b,m)then + begin + if b then FFileTag.Flags .|= n; + else FFileTag.Flags :=.!((.!FFileTag.Flags).| n); + m := b; + end + end + function setShowHidden(b); + begin + setFlagsBit(b,fIsShowHidden,0x10000000); + end + function setMultiSelected(b); + begin + tb := fIsMultiselected; + setFlagsBit(b,fIsMultiselected,0x200); + if b and tb <> fIsMultiselected then + begin + s := ""; + setlength(s,1024 * 16); + FFileTag.lpstrfile := s; + end + end + function setOverwritePrompt(b); + begin + setFlagsBit(b,fIsOverwritePrompt,0x2); + end + function setLinkFilePath(b); + begin + setFlagsBit(b,fIsLinkFilePath,0x100000); + end + function setCreatePrompt(b); + begin + setFlagsBit(b,fIsCreatePrompt,0x2000); + end + function setFileMustExist(b); + begin + //FFileTag.SetValue(); + setFlagsBit(b,fIsFileMustExist,0x1000); + end + function GetResult(); + begin + return FFileTag.lpstrfile; + end + function setfilter(f); + begin + {** + @explan(˵)ɸѡ%% + @param(f)(array)ɸѡַ±ַ,±Ϊʾ,ֵΪɸѡ + array("ļ":"*.*","tslļ":"*.stm") + %% + **} + if FFilter=f then exit; + s := ""; + rf := array(); + if ifarray(f)then + begin + for i,v in f do + begin + if v and ifstring(v)and ifstring(i)then + begin + s += i+"\0"+v+"\0"; + rf[i]:= v; + end + end + end + if length(s)then + begin + s += "\0"; + FFileTag.lpstrfilter := s; + FFilter := rf; + end + Ffilterindex := 1; + end + function OpenFileDlg();virtual; + begin + r := _wapi.GetSaveFileNameA(FFileTag._getptr_); + return r; + end + function setDefaultFileExtension(s); + begin + if ifstring(s)then FFileTag.lpstrdefext := s; + end + function getDefaultFileExtension(); + begin + return FFileTag.lpstrdefext; + end + function setInitialDir(s); + begin + if ifstring(s)and s <> "" then + begin + finitialdir.setv(s); + FfileTag.lpstrinitialdir := finitialdir.ptr; + end else + FfileTag.lpstrinitialdir := 0; + end + function getInitialDir(); + begin + if FFileTag.lpstrinitialdir=finitialdir.ptr then return finitialdir.getv(); + else return ""; + end + public + function create(AOwner);override; + begin + inherited; + FFileTag := new TtagOFNA(); + FFileTag.Flags .|= 0x80000; // .| OFN_ENABLEHOOK; + //FFileTag.hinstance := happ; + //FFileTag.lpfnHook := getwinprocptr(0x10); + finitialdir := new tcstring(512); + //FFileTag.lcustdata := finitialdir._getptr_;// 0x178; + //echo tostn(FFileTag._getdata_); + end + function getSelectedItemName(); + begin + {** + @explan(˵)ȡѡļļ%% + @return(string)ѡֹһļʱúļ%% + **} + return FFileTag.lpstrfiletitle; + end + function ChooseDlg();override; + begin + {** + @explan(˵)һԻʹûѡҪ򿪻򱣴ļ·%% + @return(bool)ǷѡЧļ·%% + **} + if WndOwner is class(TWinControl)then FFileTag.hwndowner := WndOwner.Handle; + if Ffilterindex>0 and FFilter then FFileTag.nfilterindex := Ffilterindex; + FFileTag.lpstrfile := "\0\0"; + FFileTag.lpstrfiletitle := ""; + r := OpenFileDlg(); + if FFilter then Ffilterindex := FFileTag.nfilterindex; + return r; + end + function getResults(); + begin //r2 + {** + @explan(˵)ȡѡļ·%% + @return(array)ѡļ·%% + **} + s := FFileTag._getvalue_("lpstrfile",FFileTag.nmaxfile); + r := array(); + i := 0; + l := length(s); + while i <= l and s[++i]<> '\0' do; + if not i then return r; + t := s[1:i-1]; + if not Multiselected or(i l do if s[i]='\0' then + begin + r[j++]:= t+s[b+1:i-1]; + if s[i+1]='\0' then break; + b := i; + end + return r; + end + property filter:filefilter read FFilter write setfilter; + property filterindex read Ffilterindex write Ffilterindex; + property FileName read GetResult; + // property struct read FFileTag write FFileTag; + property DefaultFileExtension:string read getDefaultFileExtension write setDefaultFileExtension; + property initialDir:filename read getInitialDir write setInitialDir; + property ShowHidden:bool read fIsShowHidden write setShowHidden; + property Multiselected:bool read fIsMultiselected write setMultiselected; + property OverwritePrompt:bool read fIsOverwritePrompt write setOverwritePrompt; + property LinkFilePath:bool read fIsLinkFilePath write setLinkFilePath; + property FileMustExist:bool read fIsFileMustExist write setFileMustExist; + property CreatePrompt:bool read fIsCreatePrompt write setCreatePrompt; + function publishs();override; + begin + return array("name","caption","filter","filterindex","filename","defaultfileextension","initialdlg", + "showhidden","multiselected","overwriteprompt","linkfilepath","filemustexist","createprompt"); + end + {** + @param(filter)(array) array("ļ":"*.*","tslļ":"*.stm")%% + @param(FileName)(string) ļ,ɹһεĽ %% + @param(DefaultFileExtension)(string) Ĭչļδָչδѡ񱣴ʱʹøչڱԻ %% + @param(initialDir)(string) Ĭϴ· %% + @param(caption)(string) Իơ%% + @param(ShowHidden)(bool) Ƿǿʾļ %% + @param(Multiselected)(bool) ɶѡڴ򿪶Ի %% + @param(OverwritePrompt)(bool) DZѣڱԻ %% + @param(LinkFilePath)(bool) ѡΪݷʽļ򷵻ظļ·ĬϷָļ· %% + @param(CreatePrompt)(bool) ļ벻ڵļʾǷ񴴽Ĭʾֱӷ·ڴ򿪶Ի %% + @param(FileMustExist)(bool) ļ벻ڵļʾļڣĬʾֱӷ·ڴ򿪶Ի %% + **} +end +type TOpenFileADlg=class(TSavefileADlg) + {** + @explan(˵) ļԻ %% + **} + private + function OpenFileDlg();virtual; + begin + r := _wapi.GetOpenFileNameA(FFileTag._getptr_); + return r; + end + protected + function dlgType();virtual; + begin + return 2; + end + public + function create(AOwner);override; + begin + inherited; + end + function publishs();override; + begin + return array("name","caption","filter","filterindex","filename", + "defaultfileextension","initialdlg","showhidden","multiselected","linkfilepath"); + end +end +type TFolderChooseADlg=class(TCommDlg) + {** + @explan(˵) ļ·ѡԻ %% + **} + private + FBrowse; + FFolder; + FRootFold; + FRootStr; + FEditBox; + FDefaultDirstr; + FDefaultDir; + function SetDefaultDir(d); + begin + if ifstring(d)and d <> FDefaultDirstr then + begin + FDefaultDirstr := d; + FDefaultDir.setv(d); + end + end + function freeil(); + begin + if FRootFold then _wapi.ILFree(FRootFold); + FRootFold := nil; + FRootStr := nil; + end + function SetEditBox(v); + begin + nv := v?true:false; + if FEditBox <> nv then + begin + FEditBox := nv; + end + end + function SetRootFold(p); + begin + if ifnil(p)then freeil(); + if not(p and ifstring(p))then exit; + if FRootStr=p then exit; + freeil(); + FRootFold := _wapi.ILCreateFromPathA(p); + if FRootFold then FRootStr := p; + end + public + function create(AOwner);override; + begin + inherited; + FEditBox := true; + FDefaultDir := new tcstring(1024); + FBrowse := new TBrowseinfoA(); + end + function ChooseDlg();override; + begin + if WndOwner is class(TWinControl)then FBrowse.hwndowner := WndOwner.Handle; + if FRootFold then FBrowse.pidlroot := FRootFold; + flg := 0x8; + if FEditBox then flg .|= 0x00000010; + //if FNewFolder then flg .|= 0x00000040 .| 0x00000100 .| 0x00000080; + FBrowse.ulflags := flg; + if FDefaultDirstr then + begin + FBrowse.lparam := FDefaultDir.ptr; + FBrowse.lpfn := getwinprocptr(0x11); + end + ft := _wapi.SHBrowseForFolderA(FBrowse._getptr_); + if not ft then return 0; + s := s1 := ""; + setlength(s1,1024); + f := _wapi.SHGetPathFromIDListA(ft,s1); + if not f then return 0; + for i := 1 to length(s1) do + begin + ts := s1[i]; + if ts="\0" then break; + s += ts; + end + FFolder := s; + return true; + end + property DefaultDir read FDefaultDirstr write SetDefaultDir; + property RootFolder:directory read FRootStr write SetRootFold; + property Folder read FFolder; + property EditBox:bool read FEditBox write SetEditBox; + function publishs();override; + begin + return array("name","caption", + "defaultdir","rootfolder","folder"); + end + {** + @param(Folder)(string) ļ· %% + **} +end + + //˵ +type TMenu = class(tcomponent) + {** + @explan(˵) ˵ %% + **} +private +#!begin + static FSIDC; //command + FActionLink:TMenuActionLink; + Fhandle:hmenu; + FCaption:string; + FParent:tmenu; + FShortCut; + FItems; + FAutoChecked:bool; + FChecked :bool; + FEnabled :bool; + FVisible :bool; + FCommand :integer; + FOnclick; + FOwnerDraw; + FOnselect; + FOnDrawItem; // + FOnMeasureItem; // + FOninitmenupopup; + FOnrbuttonup; + FMtype; //ʽ + FMenuitemInfo; + FOnDesignClick; + FBitmap; + function SetShortCut(v); + begin + if v <> FShortCut then + begin + end + end + function SetBitmap(v); //bmp + begin + if v <> FBitmap then SetBitmapsub(v); + end + function SetBitmapsub(v); //bmp + begin + FBitmap := v; + if v is class(tbitmap)then + begin + if FBitmap.HandleAllocated()then + begin + if Parent then + begin + if not(Parent is class(tmainmenu))then + begin + return parent.setmenuiteminfo(indexof(),MIIM_BITMAP,"hbmpitem",v.Handle); + end + end + end + end else + begin + if Parent then + begin + if not(Parent is class(tmainmenu))then + begin + parent.setmenuiteminfo(indexof(),MIIM_BITMAP,"hbmpitem",-1); + end + end + end + end + function ancestor(); + begin + if parent then return parent.ancestor(); + else return self(true); + end + function ancestorof(item); + begin + {** + @explan(˵) жitemǷΪӽڵ %% + @param(item)(tmenu) жϵĽڵ %% + **} + if item is class(tmenu)then + begin + if item=self then return 1; + for i := 0 to FItems.count-1 do + begin + if FItems[i].ancestorof(item)then return 1; + end + end + return 0; + end + function inmenutree(item); + begin + ac := ancestor(); + if ac.ancestorof(item)then return true; + return 0; + end + function removehmenuitem(item,pi); + begin + {** + @explan(˵) ɾhmenuڵ %% + **} + if _wapi.RemoveMenu(FHandle,pi,MF_BYPOSITION)then menuchanged(); + end + function addhmenuitem(item,bef); + begin + {** + @explan(˵) ӵhmenu %% + **} + mif := item.Itemstruct; + mif._setvalue_("wid",item.command); + mif._setvalue_("dwtypedata",item.caption); + bm := item.Bitmap; + if(bm is class(tbitmap))and bm.HandleAllocated()and(not(self is class(tmainmenu)))then + begin + mif._setvalue_("hbmpitem",bm.handle); + bsk := true; + end + if item.HandleAllocated()then + begin + mif._setvalue_("hsubmenu",item.handle); + mif._setvalue_("fmask",MIIM_ID .| MIIM_STRING .| MIIM_STATE .| MIIM_FTYPE .| MIIM_SUBMENU .|(bsk?MIIM_BITMAP:0)); + end else + begin + mif._setvalue_("fmask",MIIM_ID .| MIIM_STRING .| MIIM_STATE .| MIIM_FTYPE .|(bsk?MIIM_BITMAP:0)); + end + IF item.TSeparator then + begin + mif._setvalue_("ftype",MFT_SEPARATOR); + end else + if item.TOwnerdraw then + begin + mif._setvalue_("ftype",MFT_OWNERDRAW); + end else + begin + mif._setvalue_("ftype",MFT_STRING); + end + state := 0; + if item.Checked then + begin + state .|= MFS_CHECKED; + end else + state .|= MFS_UNCHECKED; + if item.Enabled then + begin + state .|= MFS_ENABLED; + end else + state .|= MFS_DISABLED; + mif._setvalue_("fstate",state); + _wapi.InsertMenuItemA(FHandle,bef,true,mif._getptr_); + menuchanged(); + end + Function SetMenuType(nms,n); + begin + if not(n)then + begin + ms := MF_STRING; + end else + begin + ms := nms; + end + if FMtype <> ms then + begin + FMtype := ms; + if ms=MF_STRING then ft := MFT_STRING; + if ms=MF_SEPARATOR then ft := MFT_SEPARATOR; + if ms=MF_OWNERDRAW then ft := MFT_OWNERDRAW; + if parent then + begin + parent.setmenuiteminfo(indexof(),MIIM_FTYPE,"ftype",ft); + end + end + end + function getitems(); + begin + return FItems.data(); + end + function GetItemcount(); + begin + return FItems.count; + end + function GetMenuType(ms); + begin + return FMtype=ms; + end + function ifchild(item); + begin + if item is class(tmenu)then + begin + for i := 0 to FItems.count-1 do if FItems[i]=item then return 1; + end + return 0; + end + function dispatchrbuttonup(e); + begin + if e.lparam=FHandle then + begin + it := FItems[e.wparam]; + CallMessgeFunction(it.Onrbuttonup,it,e); + return 1; + end + return itemsdispatch(e); + end + function dispatchloop(e); + begin + if e.wparam=FHandle then + begin + CallMessgeFunction(Oninitmenupopup,self(true),e); + return 1; + end + return itemsdispatch(e); + end + function dispatchcommand(e); + begin + if e.lowparam=FCommand then + begin + //if FAutoChecked then checked := not(checked); + doClick(self(true),e); + return 1; + end else + begin + return itemsdispatch(e); + end + return 0; + end + function itemsdispatch(e); + begin + for i := 0 to FItems.count-1 do if FItems[i].dispatch(e)then return 1; + end + function dispatchselect(e); + begin + cmd := e.lowparam; + if cmd>1000 then + begin + if cmd=FCommand then + begin + CallMessgeFunction(FOnselect,self(true),e); + return 1; + end else + begin + return itemsdispatch(e); + end + end else + begin + if FHandle=e.lparam then + begin + it := FItems[cmd]; + if ifobj(it)then CallMessgeFunction(it.Onselect,it,e); + return 1; + end else + return itemsdispatch(e); + end + end + function dispatchbycmdid(e); + begin + if e.itemID=FCommand then + begin + case e.msg of + WM_MEASUREITEM: + begin + DoMeasureItem(self(true),e); + end + WM_DRAWITEM: + begin + DoDrawItem(self(true),e); + end + end; + return 1; + end else + begin + return itemsdispatch(e); + end + end + function itemsate(); + begin + state := 0; + if FEnabled then state .|= MF_ENABLED; + else state .|= MF_DISABLED; + if FChecked then state .|= MF_CHECKED; + else state .|= MF_UNCHECKED; + return state; + end + function doClick(o,e);virtual; + begin + if csDesigning in ComponentState then + begin + CallMessgeFunction(FOnDesignClick,o,e); + end + CallMessgeFunction(Onclick,o,e); + end + function DoMeasureItem(o,e);virtual; + begin + return CallMessgeFunction(OnMeasureItem,o,e); + end + function DoDrawItem(o,e);virtual; + begin + return CallMessgeFunction(OnDrawItem,o,e); + end + function modifyitem(item,uflags); + begin + {** + @explan(˵) ޸IJ˵״̬ %% + @param(item)(tmenu) ˵ %% + @param(uflags)(integer) ״̬ %% + **} + if HandleAllocated()then + begin + idx := indexof(item); + vv := vid := array(); + vvdx := 0; + if((uflags .& MIIM_STRING)=MIIM_STRING)then + begin + vid[vvdx]:= "dwtypedata"; + vv[vvdx++]:= item.caption; + end + if(uflags .& MF_POPUP)=MF_POPUP then + begin + vid[vvdx]:= "hsubmenu"; + vv[vvdx++]:= item.handle; + end + setmenuiteminfo(idx,uflags,vid,vv); + menuchanged(); + return; + end + end + function GetZorder(); + begin + r := indexof(); + return r; + end + function SetZorder(n); + begin + if not(n >= 0)then exit; + f := Parent; + if f is class(tmenu)then + begin + odn := indexof(); + if odn=n then exit; + nn := f.GetItemByIndex(n); + if nn then f.RemoveItem(self(true)); + f.insertitem(self(true),nn); + end + end + +#!end + protected + function SetAction(Value);virtual; + begin + if ifnil(Value)then + begin + if FActionLink then + begin + FActionLink.SetAction(nil); + end + excludestate(FControlStyle,csActionClient); + end else + if Value is class(TBasicAction)then + begin + includestate(FControlStyle,csActionClient); + if ifnil(FActionLink)then FActionLink := createobject(GetActionLinkClass(),self); + FActionLink.Action := Value; + FActionLink.Onchange := thisfunction(DoActionChange); + ActionChange(Value,csLoading in Value.ComponentState); + Value.FreeNotification(Self); + end + end + procedure DoActionChange(Sender:TObject); + begin + if Sender=Action then ActionChange(Sender,False); + end + function GetAction();virtual; + begin + if FActionLink then + begin + return FActionLink.Action; + end + end + function GetActionLinkClass();virtual; + begin + {** + @explan(˵) actionlinkclass %% + @return(TMenuActionLink class) + **} + return class(TMenuActionLink); + end + procedure ActionChange(Sender:TObject;CheckDefaults:Boolean);virtual; + begin + if Sender is class(TCustomAction)then + begin + NewAction := Sender; + if(not CheckDefaults)or(Caption='')or(Caption=Name)then Caption := NewAction.Caption; + if not CheckDefaults or Enabled then Enabled := NewAction.Enabled; + if not CheckDefaults or FChecked then Checked := NewAction.Checked; + end; + end + function SetCaption(v);virtual; + begin + if not(ifstring(v)and(FCaption <> v))then exit; + FCaption := v; + if Parent then + begin + parent.setmenuiteminfo(indexof(),MIIM_STRING,"dwtypedata",v); + end + end + function SetVisible(v);virtual; + begin + nv := v?true:false; + if FVisible=nv then exit; + FVisible := nv; + TOwnerDraw := FVisible?false:true; + end + function SetChecked(v);virtual; + begin + nv := v?true:false; + if nv <> FChecked then + begin + FChecked := nv; + if parent then parent.setmenuiteminfo(indexof(),MIIM_STATE,"fstate",itemsate()); + end + end + function SetEnabled(v);virtual; + begin + nv := v?true:false; + if nv <> FEnabled then + begin + FEnabled := nv; + if parent then + begin + parent.setmenuiteminfo(indexof(),MIIM_STATE,"fstate",itemsate()); + end + end + end + function HandleNeeded(); + begin + {** + @explan(˵) ȡڵ,ӽڵ%% + @return(pointer) ڵ %% + **} + if not HandleAllocated()then CreateHandle(); + return Fhandle; + end + //FCompStyle:integer; + public + function Notification(AComponent:TComponent;Operation:TOperation);override; + begin + inherited; + if Operation=opRemove then + begin + if AComponent=Action then Action := nil; + end + end + class function sinit();override; + begin + {** + @explan(˵) ʼԱ %%; + **} + inherited; + if not FSIDC then + begin + FSIDC := new tidcreater(5000); + end + end + function dispatch(e);override; //ַ + begin + {** + @explan(˵) ˵Ϣַ %% + @param(e)(tuieventbase) Ϣ %% + **} + case e.msg of + WM_COMMAND: + begin + return dispatchcommand(e); + end + WM_MENUSELECT: + begin + return dispatchselect(e); + end + WM_INITMENUPOPUP: + begin + return dispatchloop(e); + end + WM_MENURBUTTONUP: + begin + return dispatchrbuttonup(e); + end else + return dispatchbycmdid(e); + end; + return 0; + end + Function create(AOwner:tcomponent);override; + begin + inherited; + FMtype := MF_STRING; + FParent := nil; + FShortCut := nil; + FChecked := False; + FVisible := True; + FEnabled := True; + FItems := new TFpList(); + FCaption := "menu"; + FCommand := FSIDC.createid(); + menustr := array( + ("cbsize","int",0), + ("fmask","int",0), + ("ftype","int",0), + ("fstate","int",0), + ("wid","int",0), + ("hsubmenu","intptr",0), + ("hbmpchecked","intptr",0), + ("hbmpunchecked","intptr",0), + ("dwitemdata","intptr",0), + ("dwtypedata","intptr",0), + ("cch","int",90), + ("hbmpitem","intptr",0)); + FMenuitemInfo := new tcstructwithcharptr(menustr,array("dwtypedata":"cch")); + FMenuitemInfo._setvalue_("cbsize",FMenuitemInfo._size_()); + end + function HandleAllocated(); + begin + {** + @explan(˵)˵ǷЧ%% + **} + return ifnumber(FHandle)and FHandle; + end + function DestroyHandle(); + begin + {** + @explan(˵) ٲ˵ %% + **} + if HandleAllocated()then + begin + for i := 0 to FItems.count-1 do + begin + it := FItems[i]; + if it is class(tmenu)then it.DestroyHandle(); + end + _wapi.DestroyMenu(FHandle); + FHandle := 0; + end + end + function CreateMenu();virtual; + begin + {** + @explan(˵) ˵,ͨoverrid˺ʵֲͬͲ˵ %% + @return(pointer) %% + **} + return _wapi.CreatePopupMenu(); + end + function CreateHandle(); + begin + {** + @explan(˵)½ڵ %% + **} + if not HandleAllocated()then + begin + IF FItems.count>0 then + begin + FHandle := CreateMenu(); + end else + if self(true)is class(tmainmenu)then //޸ + begin + FHandle := CreateMenu(); + end + end + for i := 0 to FItems.count-1 do + begin + it := FItems[i]; + ch := it.handle; + addhmenuitem(it,i+1); + end + end + function Recycling();override; + begin + {** + @explan(˵) ˵Դ%% + **} + //DestroyHandle(); + if parent is class(tmenu)then + begin + parent.RemoveItem(self); + end + FSIDC.deleteid(FCommand); + FItems.clean(); + FOnDesignClick := nil; + FOnclick := nil; + FOwnerDraw := nil; + FOnselect := nil; + FOnDrawItem := nil; + FOnMeasureItem := nil; + FOninitmenupopup := nil; + FOnrbuttonup := nil; + inherited; + end + function removefromparent(); + begin + {** + @explan(˵) ӸڵɾԼ %% + **} + if Fparent then + begin + Fparent.removeitem(self); + FParent := nil; + end + return self; + end + function indexof(item); + begin + {** + @explan(˵) 鿴λ %% + @param(item)(tmenu | nil) Ϊnil Լڸڵλ,Ϊ˵ظò˵,ڱ˵λ %% + **} + if ifnil(item)then + begin + if FParent then return FParent.indexof(self(true)); + return-1; + end + return FItems.indexof(item); + end + function GetItemByIndex(idx); + begin + {** + @explan(˵) id ò˵%% + @param(idx)(integer) id %% + @return(TMenu|nil) ڷز˵,nil + **} + if ifnumber(idx)>= 0 then + begin + return FItems.geti(idx); + end + return nil; + end + function setmenuiteminfo(idx,mv,vid,vv); //Ϣ + begin + {** + @explan(˵)ò˵Ϣ %% + @param(mv)(integer) mask %% + @param(vid)(string) ± %% + @param(vv)() ֵ %% + **} + FMenuitemInfo._setvalue_("fmask",mv); + if ifstring(vid)then + begin + FMenuitemInfo._setvalue_(vid,vv); + end else + if ifarray(vid)and ifarray(vv)and(length(vid)=length(vv))then + begin + for i,v in vid do + begin + FMenuitemInfo._setvalue_(v,vv[i]); + end + end + if HandleAllocated()then return _wapi.SetMenuItemInfoA(Fhandle,idx,true,FMenuitemInfo._getptr_); + end + function insertitem(item,bef);virtual; + begin + {** + @explan(˵) ӽڵ %% + @param(item)(tmenu) ӵĽڵ %% + @param(bef)(tmenu | integer) ׼λ %% + **} + if not(item is class(tmenu))then return-2; + if not ifchild(item)then + begin + if bef is class(tmenu)then + begin + beforid := indexof(bef); + end else + if ifnumber(bef)then + begin + beforid := bef; + end else + beforid := FItems.count(); + item.removefromparent(); + flagprant := false; + if FItems.count=0 then + begin + if Fparent then + begin + if Fparent.HandleAllocated()then + begin + flagprant := true; + end + end + end + FItems.insertbefor(item,beforid); + item.setfparent(self(true)); + if HandleAllocated()then + begin + addhmenuitem(item,beforid); + end + if flagprant then + begin + mks := MIIM_SUBMENU .| MIIM_STRING; + mksv := array("dwtypedata","hsubmenu"); + mksvv := array(FCaption,self.handle); + if FBitmap is class(tbitmap)and FBitmap.HandleAllocated()then + begin + mks .|= MIIM_BITMAP; + mksv[2]:= "hbmpitem"; + mksvv[2]:= FBitmap.Handle; + end + Fparent.setmenuiteminfo(indexof(),mks,mksv,mksvv); + end + end + return-1; + end + function setfparent(p); + begin + {** + @ignore() %% + @explan(˵) fprent %% + **} + FParent := p; + end + function removeItemByIndex(idx); + begin + {** + @explan(˵)ɾӲ˵ %% + @param(idx)(integer) id %% + **} + it := GetItemByIndex(idx); + if it is class(tmenu)then + begin + return removeItem(it); + end + return nil; + end + function RecyclingAllItems(); + begin + {** + @explan(˵) ٵǰڵ ӽڵ,ӽڵ㲻ٱʹ %% + **} + while FItems.count >= 1 do + begin + it := FItems[0]; + it.Recycling(); + end + end + function removeitem(item);virtual; + begin + {** + @explan(˵) ɾڵ %% + @param(item)(tmenu) ɾIJ˵ %% + **} + pi := FItems.indexof(item); + if pi<0 then return-1; + if HandleAllocated()then removehmenuitem(item,pi); + FItems.deli(pi); + if FItems.count<1 then + begin + if Fparent then + begin + DestroyHandle(); //ٲ˵ + Fparent.setmenuiteminfo(indexof(),MIIM_STRING .| MIIM_SUBMENU,array("dwtypedata","hsubmenu"),array(Caption,0)); + //Fparent.modifyitem(self(true),FMtype.|MF_POPUP); //޸ʽ + end + end + item.setfparent(nil); + end + private + function setparentforproperty(f); + begin + if f is class(tmenu)then + begin + f.insertitem(self); + end else + if parent is class(tmenu)then + begin + parent.removeitem(self); + end + end + public + function SetChangedPublish(n,v);virtual; + begin + {** + @explan(˵) غ %% + **} + ts := array("tstring","tseparator","townerdraw"); + if(n in ts)then + begin + for i,vi in ts do DeleteChangedPublish(vi); + if v then inherited; + return; + end + inherited; + end + function menuchanged();virtual; + begin + {** + @explan(˵) ˵ıʱĻص %% + **} + end + published + //property Visible read FVisible write SetVisible; + property Action:taction read GetAction write SetAction; + {** + @param(Action)(taction) action %%; + **} + property caption:string read FCaption write SetCaption; + property Enabled:bool read FEnabled write SetEnabled; + property ItemCount read GetItemcount; + property Items read getitems; + property Handle read HandleNeeded; + property Parent read FParent write setparentforproperty; + property Command read FCommand; + property Bitmap:tbitmap read FBitmap write SetBitmap; + property Onclick:eventhandler read FOnclick write FOnclick; + {** + @param(caption)(string) ˵ʾ %%; + @param(ItemCount)(integer) ˵ %% + @param(Handle)(pointer) ˵ %% + @param(Parent)(tmenu) ڵ %% + @param(Command)(integer) ˵id %% + @param(onclick)(function[tmenu,tuieventbase]) ˵ص %% + **} + //property OwnerDraw read FOwnerDraw write FOwnerDraw; + property TSeparator:bool index 0x800 read GetMenuType write SetMenuType; + property Itemstruct read FMenuitemInfo; + property TString index 0 read GetMenuType write SetMenuType; + Property TOwnerdraw:bool index 0x100 read GetMenuType write SetMenuType; + property Checked:bool read FChecked write SetChecked; + property OnDrawItem:eventhandler read FOnDrawItem write FOnDrawItem; + property OnMeasureItem:eventhandler read FOnMeasureItem write FOnMeasureItem; + property OnSelect:eventhandler read FOnselect write FOnselect; + property Oninitmenupopup read FOninitmenupopup write FOninitmenupopup; + property Onrbuttonup:eventhandler read FOnrbuttonup write FOnrbuttonup; + property Zorder read GetZorder write SetZorder; + property OnDesignClick read FOnDesignClick write FOnDesignClick; + property ShortCut read FShortCut write SetShortCut; + function publishs();override; + begin + return array("action","bitmap","caption","checked","enabled","name","townerdraw","tseparator", + "onclick","onrbuttonup","onselect"); + end + {** + @param(Parent)(tmenu|nil)Ӹڵ,tmenu,ӸڵƳ %% + @param(OnDrawItem)(function[tmenu,TMDRAWITEM]) ԻƲ˵ص %% + @param(OnMeasureItem)(function[tmenu,TMMEASUREITEM]) ԻƲ˵߶ȿûص %% + @param(Onrbuttonup)(function[tmenu,tuieventbase]) ˵һص %% + @param(OnSelect)(function[tmenu,TMMENUSELECT]) ˵ѡлص %% + @param(Oninitmenupopup)(function[tmenu,tuieventbase]) ˵ѭ˵ص %% + **} +end + +type TPopupmenu=class(tmenu) + {** + @explan(˵) ˵ %% + **} + function create(AOwner);override; + begin + inherited; + end + function publishs();override; + begin + return array("name","caption","enabled","onrbuttonup"); + end +end + +type TMainmenu=class(tmenu) + {** + @explan(˵) ˵ %% + **} + private + FWndHandle; + function setmenu(); + begin + if _wapi.IsWindow(FWndHandle)then + begin + _wapi.SetMenu(FWndHandle,self.handle); + end + end + function setwndhandle(v); + begin + if FWndHandle <> v then + begin + if _wapi.IsWindow(FWndHandle)then + begin + _wapi.SetMenu(FWndHandle,0); + end + FWndHandle := v; + setmenu(); + end + end + function DrawMenuBar(); + begin + if HandleAllocated()and _wapi.IsWindow(FWndHandle)then + begin + _wapi.DrawMenuBar(FWndHandle); + end + end + public + function insertitem(item,bef);override; + begin + inherited; + DrawMenuBar(); + end + function removeitem(item);override; + begin + inherited; + DrawMenuBar(); + end + function menuchanged();override; + begin + if _wapi.IsWindow(FWndHandle)then _wapi.DrawMenuBar(FWndHandle); + end + function create(AOwner);override; + begin + inherited; + end + function CreateMenu();override; + begin + r := nil; + r := _wapi.CreateMenu(); + return r; + end + property Hwnd:pointer read FWndHandle write setwndhandle; + function publishs();override; + begin + return array("name"); + end + {** + @param(Hwnd)()ھ %%; + **} +end + +type TApplicationProperties=class(TComponent) + {** + + @ignore() %% + @explan(˵)Ӧ %% + **} + private + FApplication; + FTrayData; + function SetShowTray(); + begin + end + function SetPopupMenu(); + begin + end + public + function Create(AOwner); + begin + inherited; + FApplication := getapplication(); + FTrayData := new TNOTIFYICONDATAA(); + end + property TrayMenu:tpopupmenu read FPopupMenu write SetPopupMenu; + property TrayIcon:icondata read FTrayIcon write FTrayIcon; + property ShowTray:bool read FShowTray write SetShowTray; +end + + + //windoes socketͨ +type TSocketInterface=class(TComponent) + {** + @explan(˵) windows socket ӿ %% + **} + private + FPort; + FIp; + FHandle; + FCSocket; + FIPproto; + //******************* + FOnRead; + FOnConnect; + FOnWrite; + FOnAccept; + FOnError; + FOnClose; + FCache; + FErrorId; + //********************** + static FNetWindow; // + static FRootSocket; //socket + static FWSDATA; //ṹ + function SetIPproto(V);virtual; + begin + if v in array(IPPROTO_TCP,IPPROTO_UDP)and v <> FIPproto then + begin + FIPproto := v; + if HandleAllocated()then CloseSocket(); + end + end + protected + class function sinit();override; + begin + inherited; + if not FNetWindow then + begin + FNetWindow := new TCustomControl(getapplication()); + FNetWindow.visible := false; + FNetWindow.WSPopUp := true; + FNetWindow.bindmessage(WM_SOCKET,thisfunction(WMSOCKET)); + FWSDATA := new TWSADATA(); + _wapi.WSAStartup(2^9+1,FWSDATA._getptr_); + FRootSocket := array(); + end + end + class function BindSoketEvents(sk,flag); + begin + {** + @expaln(˵)¼ %% + **} + if sk is class(TSocketInterface)then + begin + if not(ifnumber(flag))then flag := FD_ALL_EVENTS; + if flag=0 then + begin + reindex(FRootSocket,array(inttostr(sk.Handle):nil)); + _wapi.WSAAsyncSelect(sk.Handle,FNetWindow.Handle,0,0); + end else + begin + _wapi.WSAAsyncSelect(sk.Handle,FNetWindow.Handle,WM_SOCKET,(FD_READ .| FD_WRITE .| FD_CONNECT .| FD_CLOSE .| FD_ACCEPT //flag + )); + FRootSocket[inttostr(sk.Handle)]:= sk; + end + end + end + class function GetSocket(id); + begin + {** + @param(id)(pointer) %% + **} + return FRootSocket[inttostr(id)]; + end + class function WMSOCKET(o,e); + begin + gw := _wapi; + sk := GetSocket(e.wparam); + if not sk then exit; + if e.hilparam then // + begin + FErrorId := e.hilparam; + return sk.DoError(); + end + FErrorId := 0; + case e.lolparam of + FD_ACCEPT: + begin + sk.DoAccept(); + end + FD_CLOSE: + begin + sk.CloseSocket(); + sk.DoClose(); + end + FD_WRITE: + begin + sk.DoWrite(); + end + FD_READ: + begin + sk.DoRead(); + end + FD_CONNECT: + begin + sk.DoConnected(); + end + end + end + type TSocketCache=class + {** + @explan(˵) %% + **} + FData; + FBottom; + FTop; + function create(); + begin + init(); + end + function size(); + begin + return FTop-FBottom; + end + function init(); + begin + FData := array(); + FTop := FBottom := 0; + end + function GetBottom(); + begin + if FBottom0 then + begin + FBottom--; + if v then + begin + FData[FBottom]:= v; + end + end + end + function add(v); // + begin + if v then + begin + FData[FTop++]:= v; + end + end + end + function GetHandle(); + begin + if not HandleAllocated()then CreateHandle(); + return FHandle; + end + function InitCSocket();virtual; + begin + adr := _wapi.inet_addr(FIp); + FCSocket.sin_family := AF_INET; + FCSocket.sin_addr := adr; + FCSocket.sin_port := _wapi.htons(FPort); + return adr=INADDR_NONE; + end + function CreateInitialStr(n); + begin + {** + @explan(˵) ʼַ %% + @param(n)(integer) ַ %% + @return(string) %% + **} + ret := "\0"; + if n>0 then + begin + setlength(ret,n); + for i := 1 to n-1 do + begin + ret[i]:= "\0"; + end + end + return ret; + end + function CreateHandle();virtual; + begin + if csDesigning in ComponentState then exit; + if not HandleAllocated()then FHandle := _wapi.socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); + MD := 1; + //_wapi.ioctlsocket(FHandle,FIONBIO,MD); + BindSoketEvents(self(true),nil); + end + function SetIp(v);virtual; + begin + if v <> FIp and ifstring(v)then + begin + FIp := v; + end + end + function SetPort(v);virtual; + begin + if v <> FProt and v>0 then + begin + FPort := v; + end + end + public + function HandleAllocated(); + begin + return ifnumber(FHandle)and FHandle <> 0 and INVALID_SOCKET <> FHandle; + end + function create(AOwner);override; + begin + inherited; + FCSocket := new tsockaddr_in(); + FCache := new TSocketCache(); + FIPproto := IPPROTO_TCP; + FIp := "127.0.0.1"; + FPort := 1025; + end + function CloseSocket();virtual; + begin + if not HandleAllocated()then exit; + _wapi.ShutDown(FHandle,SD_BOTH); + rt := _wapi.closesocket(FHandle); + BindSoketEvents(self,0); + FHandle := 0; + if rt=0 then FHandle := 0; + else + begin + end + return rt; + end + function Recycling();override; + begin + CloseSocket(); + FOnRead := nil; + FOnConnect := nil; + FOnWrite := nil; + FOnAccept := nil; + FOnError := nil; + FOnClose := nil; + FCache := array(); + inherited; + end + function DoRead();virtual; + begin + calldatafunction(FOnRead,self(true)); + end + function DoAccept();virtual; + begin + calldatafunction(FOnAccept,self(true)); + end + function DoWrite();virtual; + begin + WriteData(); + calldatafunction(FOnWrite,self(true)); + end + function DoError();virtual; + begin + calldatafunction(FOnError,self(true)); + end + function DoConnected();virtual; + begin + calldatafunction(FOnConnect,self(true)); + end + function DoClose();virtual; + begin + calldatafunction(FOnClose,self(true)); + end + function writeData(data);virtual; + begin + if data then FCache.add(data); + while FCache.size() do + begin + d := FCache.GetBottom(); + if not(d and ifstring(d))then continue; + len := length(d); + ret := _wapi.send(FHandle,d,len,0); + if ret=WSAEWOULDBLOCK then + begin + return FCache.back(); + end else + if ret0 then + begin + FCache.back(d[(ret+1):]); + end + end + end + function ReceiveDataLen(); + begin + {** + @explan(˵) ݳ %% + @return(integer) %% + **} + len := 0; + if HandleAllocated()then ret := _wapi.ioctlsocket(self.Handle,FIONREAD,len); + return len; + end + function ReadData(len);virtual; + begin + {** + @explan(˵) %% + @param(len)(integer) ȡ %% + @return(string) %% + **} + if not ifnumber(len)then len := ReceiveDataLen(); + if len<1 then return ""; + dt := CreateInitialStr(len); + if HandleAllocated()then r := _wapi.recv(self.Handle,dt,length(dt),0); + return dt; + end + property Handle read GetHandle write FHandle; + property IP:string read FIp write SetIp; + property Port:integer read FPort write SetPort; + property CSocket read FCSocket; + property OnClose:eventhandler read FOnClose write FOnClose; + property OnConnected:eventhandler read FOnConnect write FOnConnect; + property OnRead:eventhandler read FOnRead write FOnRead; + property OnWrite:eventhandler read FOnWrite write FOnWrite; + property OnAccept:eventhandler read FOnAccept write FOnAccept; + property OnError:eventhandler read FOnError write FOnError; + property IPPROTO read FIPproto write SetIPproto; + property ErrorId read FErrorId; + {** + @param(ErrorId)(integer) Ϣ %% + **} +end + +type TSocketClient=class(TSocketInterface) + {** + @explan(˵) windows socketͻ %% + **} + private + FConnected; + protected + function SetIp(v);override; + begin + t := self.ip; + inherited; + if csDesigning in ComponentState then exit; + t1 := self.ip; + if t <> t1 and FConnected then + begin + CloseSocket(); + end + end + function SetPort(v);override; + begin + t := self.Port; + inherited; + if csDesigning in ComponentState then exit; + t1 := self.Port; + if t <> t1 and FConnected then + begin + CloseSocket(); + end + end + public + function Create(AOwner);override; + begin + inherited; + FConnected := false; + end + function CloseSocket();override; + begin + inherited; + FConnected := false; + end + function DoClose();override; + begin + FConnected := false; + inherited; + end + function DoConnected();override; + begin + FConnected := true; + inherited; + end + function connect(); + begin + {** + @explan(˵) ӷ %% + **} + if csDesigning in ComponentState then exit; + if InitCSocket()then return-1; + if not FConnected then + begin + r := _wapi.Connect(self.Handle,CSocket._getptr_(),CSocket._size_()); + end + return r; + end + function publishs();override; + begin + return array("name","handle","ip","port","ipproto", + "onclose","onconnected","onread","onwrite","onaccept","onerror"); + end +end +type TSocketAccept=class(TSocketInterface) + {** + @explan(˵) windows socket socket %% + **} + private + FServer; + function DeleteFromServer(); + begin + if FServer then + begin + FServer.DeleteNode(self); + end + end + function SetIPproto(V);override; + begin + end + public + function Create(server);override; + begin + inherited; + FServer := server; + if(FServer is class(TSocketServer))and(FServer.HandleAllocated)then + begin + Handle := _wapi.accept(server.Handle,CSocket._getptr_(),CSocket._size_()); + self.OnRead := server.OnRead; + self.OnWrite := server.OnWrite; + self.OnClose := Server.OnClose; + self.onerror := Server.OnError; + if Handle then + begin + BindSoketEvents(self(true),nil); + end + end + end + function CreateHandle();override; + begin + end; + function DoClose(sk);override; + begin + inherited; + DeleteFromServer(); + end + function CloseSocket();override; + begin + inherited; + DeleteFromServer(); + end + property Server read FServer write FServer; + function publishs();override; + begin + return array("name","handle","ip","port","ipproto", + "onread","onwrite","onaccept","onerror"); + end +end +type TSocketServer=class(TSocketInterface) + {** + @explan(˵) windows socket + **} + private + FChildren; + FBinded; + FAccept; + FListenCount; + function SetListenCount(v); + begin + if v >= 0 and v <> FListenCount then + begin + FListenCount := v; + end + end + function SetIp(v);override; + begin + t := self.ip; + inherited; + t1 := self.ip; + if t <> t1 and FBinded then + begin + CloseSocket(); + end + end + function SetPort(v);override; + begin + t := self.Port; + inherited; + t1 := self.Port; + if t <> t1 and FBinded then + begin + CloseSocket(); + end + end + public + function CreateHandle();override; + begin + inherited; + FAccept := false; + end + function DoAccept();override; + begin + FAccept := true; + r := new TSocketAccept(self(true)); + FChildren[length(FChildren)]:= r; + inherited; + end + function Create(AOwner);override; + begin + inherited; + FListenCount := 100; + FChildren := array(); + FConnected := false; + FBinded := false; + end + function CloseSocket();override; + begin + len := length(FChildren); + while len>0 do + begin + vi := FChildren[len-1]; + vi.CloseSocket(); + len := length(FChildren); + end + FBinded := false; + FAccept := false; + return inherited; + end + function DeleteNode(acp); + begin + {** + @explan(˵) ɾڵ %% + **} + idx :=-1; + if acp.HandleAllocated()then return acp.CloseSocket(); + for i,v in FChildren do + begin + if acp=V then + begin + idx := i; + end + end + if idx>-0.5 then + begin + acp.Server := nil; + DeleteIndex(FChildren,idx,true); + end + end + function listen(); + begin + {** + @explan(˵) %% + **} + if FBinded then exit; + lsn := FListenCount; + if InitCSocket()then return-1; + r := _wapi.bind(self.Handle,CSocket._getptr_(),CSocket._size_()); + if r=0 then + begin + FBinded := true; + if ifnil(lsn)then lsn := 10; + r := _wapi.listen(self.Handle,lsn); + return r; + end else + begin + return-1; + end + return r; + end + property ListenCount:integer read FListenCount write SetListenCount; + function publishs();override; + begin + return array("name","handle","ip","port","ipproto", + "onclose","onconnected","onread","onwrite","onaccept","onerror"); + end +end + + //߳ +type TThreadWorker =class(TCustomThreadworker) + {** + @explan(˵) ߳ %% + **} + uses uvclthreadworker; + function create(s,libs,declaration); + begin + inherited; + end + protected + function Check_TslCode(FScript,err);override; + begin + return CheckTslCode(FScript,err); + end +end + //ע +type TRegKey = class + {** + @explan(˵) windowsע %% + **} + static HKEY_CLASSES_ROOT; + static HKEY_CURRENT_USER; + static HKEY_LOCAL_MACHINE; + static HKEY_USERS; + static HKEY_PERFORMANCE_DATA; + static HKEY_PERFORMANCE_TEXT; + static HKEY_PERFORMANCE_NLSTEXT; + {$ifdef linux} + class function RegEnumValueA(hKey:pointer;dwIndex:integer;var lpValueName:string;var lpcchValueName:integer;lpReserved:pointer;lpType:pointer;lpData:pointer;lpcbData:pointer):integer; + class function RegEnumKeyA(hKey:pointer;dwindex:integer;var lpName:string;ccname:integer):integer; + class function RegQueryValueExA(hKey:pointer;lpValueName:string;lpReserved:integer;var lpType:integer;var lpData:string;var lpcbData:integer):integer; + class function RegSetValueExA(hkey:pointer;keyValueName:string;lpReserved:integer;lpType:integer;data:string;len:integer):integer; + class function RegOpenKeyA(Key:pointer;lpSubKey:string;var phkResult:pointer):integer; + class function RegCloseKey(hKey:pointer):integer; + class function RegOpenKeyExA(Key:pointer;lpSubKey:string;rs:integer;ac:integer;var phkResult:pointer):integer; + class function RegCreateKeyExA(hKey:pointer;lpSubKey:string;Reserved:integer;lpClass:string;dwOptions:integer;samDesired:integer;lpSecurityAttributes:pointer;var phkResult:pointer;var lpdwDisposition:integer):integer; + class function RegDeleteKeyExA(hKey:pointer;lpSubKey:string;samDesired:integer;Reserved:integer):integer; + class function RegDeleteKeyA(hKey:pointer;lpSubKey:string):integer; + class function RegDeleteValueA(hKey:pointer;lpValueName:string):integer; + class function RegDeleteKeyValueA(hKey:pointer;lpSubKey:string;lpValueName:string):integer; + class function RegDeleteTreeA(hKey:pointer;lpSubKey:string):integer; + class function FormatMessageA(dwFlags:integer;lpSource:pointer;dwMessageId:integer;dwLanguageId:integer;var pBuffer:string;nSize:integer;):integer; + {$else} + class function RegEnumValueA(hKey:pointer;dwIndex:integer;var lpValueName:string;var lpcchValueName:integer;lpReserved:pointer;lpType:pointer;lpData:pointer;lpcbData:pointer):integer;stdcall;external "Advapi32.dll" name "RegEnumValueA"; + class function RegEnumKeyA(hKey:pointer;dwindex:integer;var lpName:string;ccname:integer):integer;stdcall;external "Advapi32.dll" name "RegEnumKeyA"; + class function RegQueryValueExA(hKey:pointer;lpValueName:string;lpReserved:integer;var lpType:integer;var lpData:string;var lpcbData:integer):integer;stdcall;external "Advapi32.dll" name "RegQueryValueExA"; + class function RegSetValueExA(hkey:pointer;keyValueName:string;lpReserved:integer;lpType:integer;data:string;len:integer):integer;stdcall;external "Advapi32.dll" name "RegSetValueExA"; + class function RegOpenKeyA(Key:pointer;lpSubKey:string;var phkResult:pointer):integer;stdcall;external "Advapi32.dll" name "RegOpenKeyA"; + class function RegCloseKey(hKey:pointer):integer;stdcall;external "Advapi32.dll" name "RegCloseKey"; + class function RegOpenKeyExA(Key:pointer;lpSubKey:string;rs:integer;ac:integer;var phkResult:pointer):integer;stdcall;external "Advapi32.dll" name "RegOpenKeyExA"; + class function RegCreateKeyExA(hKey:pointer;lpSubKey:string;Reserved:integer;lpClass:string;dwOptions:integer;samDesired:integer;lpSecurityAttributes:pointer;var phkResult:pointer;var lpdwDisposition:integer):integer;stdcall;external "Advapi32.dll" name "RegCreateKeyExA"; + class function RegDeleteKeyExA(hKey:pointer;lpSubKey:string;samDesired:integer;Reserved:integer):integer;stdcall;external "Advapi32.dll" name "RegDeleteKeyExA"; + class function RegDeleteKeyA(hKey:pointer;lpSubKey:string):integer;stdcall;external "Advapi32.dll" name "RegDeleteKeyA"; + class function RegDeleteValueA(hKey:pointer;lpValueName:string):integer;stdcall;external "Advapi32.dll" name "RegDeleteValueA"; + class function RegDeleteKeyValueA(hKey:pointer;lpSubKey:string;lpValueName:string):integer;stdcall;external "Advapi32.dll" name "RegDeleteKeyValueA"; + class function RegDeleteTreeA(hKey:pointer;lpSubKey:string):integer;stdcall;external "Advapi32.dll" name "RegDeleteTreeA"; + class function FormatMessageA(dwFlags:integer;lpSource:pointer;dwMessageId:integer;dwLanguageId:integer;var pBuffer:string;nSize:integer;):integer;stdcall;external "Kernel32.dll" name "FormatMessageA"; + {$endif} + class function GetRegKeyRoot(); + begin + {** + @explan(˵) HKEY_CLASSES_ROOTkey %% + @return(TRegKey|integer) ɹ key %% + **} + sinit(); + return new TRegKey(HKEY_CLASSES_ROOT); + end + class function GetRegKeyUser(); + begin + {** + @explan(˵) HKEY_CURRENT_USERkey %% + @return(TRegKey|integer) ɹ key %% + **} + sinit(); + return new TRegKey(HKEY_CURRENT_USER); + end + class function GetRegKeyMachine(); + begin + {** + @explan(˵) HKEY_LOCAL_MACHINEkey %% + @return(TRegKey|integer) ɹ key %% + **} + sinit(); + return new TRegKey(HKEY_LOCAL_MACHINE); + end + class function GetEnviromentKey(); + begin + {** + @explan(˵) ûkey %% + @return(TRegKey|integer) ɹ key %% + **} + sinit(); + k1 := new TRegKey(HKEY_LOCAL_MACHINE); + return k1.openKeyA("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"); + end + class function EnvironmentPath(k2); + begin + {** + @explan(˵) û·ֵ%% + @return(array of string) · %% + **} + if ifnil(k2)then k2 := GetEnviromentKey(); + if not ifobj(k2)then return nil; + r := str2array(k2.GetValueA("path"),";"); + rt := array(); + for i,v in r do + begin + vi := trim(v); + if vi then rt[length(rt)]:= lowercase(vi); + end + return rt; + end + private + FHandle; + FResult; + function CloseRegKey(); + begin + if ifnumber(FHandle)and not(FHandle in array(HKEY_CLASSES_ROOT,HKEY_CURRENT_USER,HKEY_LOCAL_MACHINE,HKEY_USERS,HKEY_PERFORMANCE_DATA,HKEY_PERFORMANCE_TEXT,HKEY_PERFORMANCE_NLSTEXT))then + RegCloseKey(FHandle); + end + function SetHandle(h); + begin + if h <> FHandle then + begin + CloseRegKey(); + FHandle := h; + end + end + public + function create(h); + begin + if not HKEY_CLASSES_ROOT then sinit(); + SetHandle(h); + end + function Destroy(); + begin + CloseRegKey(); + end + function openKeyA(vn); + begin + {** + @explan(˵) 򿪻½ key%% + @param(vn)(string) value %% + @return(TRegKey) ֵ %% + **} + if not FHandle then return-1; + if not(ifstring(vn)and vn)then return-1; + h2 := 0; + rr := RegOpenKeyExA(FHandle,vn,0,0xF003F,h2); + if 0=rr then + begin + r := new TRegKey(h2); + return r; + end + state := 0; + hk2 := 0; + rr := RegCreateKeyExA(FHandle,vn,0,"",0,0,0,hk2,state); + if rr=0 then + begin + r := openKeyA(vn); //new TRegKey(hk2); + return r; + end + return rr; + end + function GetValueA(vn,vt); + begin + {** + @explan(˵) valueֵ%% + @param(vn)(string) value %% + @param(vt)(integer) %% + @return(string) ֵ %% + **} + if not FHandle then return-1; + if not(ifstring(vn)or ifnil(vn))then return-1; + if not ifnumber(vt)then vt := 0; + d := ""; + setlength(d,2064); + len := 2063; + rr := RegQueryValueExA(FHandle,vn,0,vt,d,len); + if 0=rr then + begin + return d[1:len-1]; + end + return rr; + end + function SetValueStringA(vn,v); + begin + {** + @explan(˵) valueֵ%% + @param(vn)(string) value ,nilΪĬֵ%% + @param(v)(string) ֵ %% + **} + if not FHandle then return-1; + if not(ifstring(vn)or ifnil(vn))then return-1; + rs := 0; + tp := 1; + return RegSetValueExA(FHandle,vn,rs,tp,v,length(v)); + end + + function DeleteValueA(vn); + begin + {** + @explan(˵) ɾvalue %% + @param(vn)(string) value %% + **} + if not FHandle then return-1; + if not(ifstring(vn))then return-1; + return RegDeleteValueA(FHandle,vn); + end + function DeleteKeyA(vn); + begin + {** + @explan(˵) key %% + @param(vn)(string) key %% + **} + if not FHandle then return-1; + if not(ifstring(vn))then return-1; + return RegDeleteKeyExA(FHandle,vn,0x0100,0); + end + function DeleteTreeA(vn); + begin + {** + @explan(˵) ɾĿ¼ %% + @param(vn)(string) Ŀ¼ %% + **} + if not FHandle then return-1; + if not(ifstring(vn))then return-1; + return RegDeleteTreeA(FHandle,vn); + end + function GetValueNames(); + begin + {** + @explan(˵) value %% + @return(array of string) %% + **} + r := array(); + if FHandle then + begin + s := ""; + ls := 1024; + setlength(s,1024); + idx := 0; + while true do + begin + ls := 1024; + sc := RegEnumValueA(FHandle,idx,s,ls,0,0,0,0); + if sc=0 then + begin + r[idx]:= s[1:ls]; + idx++; + end else + break; + end + end + return r; + end + function GetSubKeyNames(); + begin + {** + @explan(˵) %% + @return(array of string) %% + **} + r := array(); + if FHandle then + begin + s := ""; + ls := 1024; + setlength(s,1024); + idx := 0; + while true do + begin + sc := RegEnumKeyA(FHandle,idx,s,ls); + if sc=0 then + begin + for i := 1 to 1024 do + begin + if s[i]="\0" then + begin + r[idx]:= s[1:(i-1)]; + break; + end + end + idx++; + end else + break; + end + end + return r; + end + class function sinit();override; + begin + {** + @explan(˵) ʼ %% + **} + if not HKEY_CLASSES_ROOT then + begin + HKEY_CLASSES_ROOT := 0x80000000; + HKEY_CURRENT_USER := 0x80000001; + HKEY_LOCAL_MACHINE := 0x80000002; + HKEY_USERS := 0x80000003; + HKEY_PERFORMANCE_DATA := 0x80000004; + HKEY_PERFORMANCE_TEXT := 0x80000050; + HKEY_PERFORMANCE_NLSTEXT := 0x80000060; + end + inherited; + end + property Handle read FHandle write SetHandle; + {** + @param(Handle)(pointer) regkey %% + **} +end +type TWinEnviroment=class() + {** + @explan(˵) windows %% + **} + function Create(); + begin + FRegkey := class(TRegKey).GetEnviromentKey(); + if not(ifobj(FRegkey))then raise "ǹԱܲ!"; + end + function GetPaths(); + begin + {** + @explan(˵) û· %% + @return(array of string) · %% + **} + PathInPaths("===",r); + return r; + end + function AppendPath(p); + begin + {** + @explan(˵) ׷ӻ· %% + @param(p)(string) · %% + @return(bool) true ɹ false ʧ %% + **} + if not(PathOk(p))then return false; + if not PathInPaths(p,paths)then + begin + return 0=FRegkey.SetValueStringA("path",array2str(paths,";")+";"+p); + end + end + function RemovePath(p); + begin + {** + @explan(˵) Ƴ· %% + @param(p)(string) · %% + @return(bool)true ɹ false ʧ %% + **} + if not PathOk(p)then return false; + if PathInPaths(p,paths)then + begin + return 0=FRegkey.SetValueStringA("path",array2str(paths,";")); + end + end + private + function PathOk(p); + begin + if not(ifstring(p)and p)then return false; + for i,v in array(";","?",'"',"|","*") do + begin + if pos(v,p)then return false; + end + return true; + end + function PathInPaths(p,paths); + begin + pv := lowercase(RegularPath(p)); + if not pv then return 0; + d := FRegkey.GetValueA("path"); + nothavepath := false; + paths := array(); + LP := 0; + for i,v in str2array(d,";") do + begin + vi := RegularPath(v); + if not vi then continue; + if lowercase(vi)=pv then + begin + nothavepath := true; + continue; + end + paths[LP++]:= v; + end + return nothavepath; + end + function RegularPath(p); + begin + {** + @explan(˵) %% + **} + r := ""; + if p and ifstring(p)then + begin + r := trim(p); + len := length(r); + if r[len]="\\" and len>1 then return r[1:(len-1)]; + end + return r; + end + FRegkey; +end + +//а +type TClipBoard=class(tcomponent) + {** + @explan(˵) а %% + **} + private + private + FIsopen; + function CloseClipboard(); + begin + if FIsopen then FIsopen := not _wapi.CloseClipboard(); + return not(FIsopen); + end + function OpenClipboard(); + begin + {** + @explan(˵) 򿪼а %% + **} + IF not(FIsopen)then FIsopen := _wapi.OpenClipboard(0); + return FIsopen; + end + function EmptyClipboard(); + begin + {** + @explan(˵) ռа %% + **} + if FIsopen then _wapi.EmptyClipboard(); + end + function SetText(s); + begin + {** + @explan(˵) ַа %% + @param(s)(string|nil) ַΪnil %% + **} + ret :=-1; + if not(ifstring(s)and length(s)>0)then + begin + return-1; + end + OpenClipboard(); + try + EmptyClipboard(); + _wapi.setclipboardtext(0,s); + finally + CloseClipboard(); + end; + return ret; + end + function GetText(); + begin + {** + @explan(˵) üаַ %% + @return(string) ַ %% + **} + OpenClipboard(); + try + if _wapi.IsClipboardFormatAvailable(CF_TEXT)then + begin + r := _Wapi.getclipboardtext(0); + end + finally + CloseClipboard(); + end; + return r; + end + function SetBitmap(v); + begin + if v is class(tbitmap)then + begin + if V.HandleAllocated()then + begin + OpenClipboard(); + try + EmptyClipboard(); + _wapi.setclipboardbmp(v.Handle); + finally + CloseClipboard(); + end; + return ret; + end + end + end + function Getbitmap(); + begin + OpenClipboard(); + try + if _wapi.IsClipboardFormatAvailable(CF_BITMAP)then + begin + sid := _wapi.getclipboardbmp(); + if sid then + begin + bmp := new tbitmap(); + bmp.Handle := sid; + return bmp; + end + return false; + end + finally + CloseClipboard(); + end; + return r; + end + public + function create(AOwner);override; + begin + {** + @explan(˵) а %% + **} + inherited; + end + function Recycling();override; + begin + CloseClipboard(); + inherited; + end + function destroy();override; + begin + inherited; + end + property Text read GetText write SetText; + property Bmp read GetBitmap write SetBitmap; + function publishs();override; + begin + return array("name","text","bmp"); + end + {** + @explan(Text)(string) û߻ȡаı %% + **} +end +type TQuotations=class(tcomponent) + {** + @explan(˵) 鶩ԼԶִ %% + **} + private + static FSQuotations; + static RE_ERROR; + static RE_FUNCRESULT; + static RE_FUNCSTATE; + static RE_ECHO; + static RE_QUERY; + FOncallBack; //ص + FChannel; //ͨ + FData; // + FIds; + FSUbs; + FScript; + FGlobalVariable; + function EndRemoteExecute(); + begin + if FChannel then + begin + EndExecute(FChannel); + reindex(FSQuotations,array(FChannel:nil)); + FChannel := 0; + FData := array(); + end + end + protected + class function sinit();override; + begin + inherited; + if not ifarray(FSQuotations)then + begin + FSQuotations := array(); + RE_ERROR := 0; + RE_FUNCRESULT := 0x0201; + RE_FUNCSTATE := 0x0301; + RE_ECHO := 0x0401; + RE_QUERY := 0x0402; + end + end + function RemoteCallBack(d);virtual; + begin + {** + @explan(˵) صִ %% + **} + if not ifarray(d)then exit; + FData := d; + calldatafunction(FOncallBack,self(true)); + end + public + function create(AOwner);override; + begin + inherited; + FData := array(); + FIds := array(); + FGlobalVariable := array(); + FSUbs := array(); + FScript := ""; + end + function RemoteExecute(); + begin + {** + @explan(˵) Զִд %% + @return(integer) channel %% + **} + if not ifstring(FScript)then return 0; + if not ifarray(FGlobalVariable)then sysp := array(); + else sysp := FGlobalVariable; + EndRemoteExecute(); + FChannel := SendExecute(FScript,sysp,"return unit(tslvcl).remotetslcallback(sysparams);",1); + if not FChannel then return 0; + FSQuotations[FChannel]:= self(true); + return FChannel; + end + function MarketSubscription(); + begin + {** + @explan(˵) 鶩 %% + @return(integer) channel %% + **} + EndRemoteExecute(); + if not(FIds and ifarray(FIds)and FSUbs and ifarray(FSUbs))then + begin + return 0; + end + qts := array("Type":1); + qts["IDs"]:= FIds; + qts["SUBs"]:= FSUbs; + FChannel := SendExecute("",qts,"return unit(tslvcl).remotetslcallback(sysparams);",0); + if not FChannel then return 0; + FSQuotations[FChannel]:= self(true); + return FChannel; + end + function Recycling();override; + begin + EndRemoteExecute(); + FOncallBack := nil; + inherited; + end + function destroy();override; + begin + inherited; + end + class function Dispatch(dt); + begin + {** + @explan(˵) Ϣַ %% + **} + if ifarray(dt)then + begin + // 0:֪ͨ + // 0x0201:ִк + // 0x0301:ύίк״̬ + // 0x0401:Echo + // 0x0402:RunningData/Ľ + o := FSQuotations[dt["channel"]]; + if ifobj(o)then o.RemoteCallBack(dt); + end + end + function echodata(); + begin + {** + @explan(˵) ȡecho Ϣ %% + @return(string|nil) echo ͷnil%% + **} + if FData["recvtype"]=RE_ECHO then + begin + return FData["errmsg"]; + end + return nil; + end + function errormessage(); + begin + {** + @explan(˵) ȡϢ %% + @return(string|nil) ޴󷵻nil%% + **} + if FData["recvtype"]=RE_ERROR then + begin + return FData["errmsg"]; + end + return nil; + end + function result(); + begin + {** + @explan(˵) ȡִн %% + **} + if FData["recvtype"]in array(RE_FUNCRESULT,RE_QUERY)then + begin + return FData["result"]; + end + return nil; + end + property OnCallBack:eventhandler read FOncallBack write FOncallBack; + property Ids:strings read FIds write FIds; + property SUBs:strings read FSUbs write FSUbs; + property GlobalVariable:tsldata read FGlobalVariable write FGlobalVariable; + property Script:text read FScript write FScript; + function publishs();override; + begin + return array("name","ids","subs","globalvariable","script","oncallback"); + end + {** + @param(OnCallBack)(function[TQuotations]) ִлص %% + @param(ids)(array of stockid) ֤ȯ array("SZ000001","SZ000002") %% + @param(SUBs)(array of string) ֶ array("StockName", "date","price", "open") %% + **} +end + +type tlogincontrol=class(tpanel) + {** + @explan(˵) ½ؼ %% + **} + private + FserverEdit; + FserverLabel; + FuserLabel; + FpwdLabel; + Fstatus; + FportEdit; + FpwdEdit; + FlogoutBtn; + FloginBtn; + FuserEdit; + FCacheFile; + FOnLogined; + function LoadCacheData(); // + begin + importfile(ftStream(),"",FCacheFile,configinfos); + if ifarray(configinfos)then + begin + FserverEdit.text := configinfos["server"]; + FportEdit.text := configinfos["port"]; + FuserEdit.text := configinfos["user"]; + FpwdEdit.text := configinfos["pwd"]; + end + end + function SaveCacheData() //滺 + begin + exportfile(ftStream(),"",FCacheFile,array("server":FserverEdit.text,"port":FportEdit.text,"user":FuserEdit.text,"pwd":FpwdEdit.text)); + end + function closelogin(); //رյ½ + begin + SaveCacheData(); + if Parent then EndModal(); + else show(0); + end + function setsatus(s); + begin + if ifstring(s)then Fstatus.setitemtext(s,1); + end + function clklogin(o,e); + begin + clklogin2(o,e); + CallMessgeFunction(FOnLogined,self,e); + end + function clklogin2(o,e); //½ť + begin + //½ ״̬ + //ο LoginTslServer + setsatus("ڵ½..."); + logintext := FuserEdit.text; + loginpwd := FpwdEdit.text; + loginserve := FserverEdit.text+":"+FportEdit.text; + if(CheckConnected()or(ConnectServer(FserverEdit.text,StrToFloatDef(FportEdit.text,443))=0))then + begin + msg := ""; + setlength(msg,200); + if(CheckLogined()or LoginServer(logintext,loginpwd,msg)=0)then + begin + setsatus("½ɹ"); + FloginBtn.enabled := false; + FlogoutBtn.enabled := true; + hidenwindow(); + return 0; + end else + begin + setsatus("½ʧ"); + messageboxA(msg,"½ʧ",1); + return 1; + end + end else + begin + setsatus("ӷʧ"); + messageboxA("ӷʧ","ʾ",1); + return 2; + end + return-1; + end + function clklogout(o,e); //˳½ť + begin + //˳½״̬ + setsatus("Ͽ"); + FloginBtn.enabled := true; + FlogoutBtn.enabled := false; + DisconnectServer(); + end + function hidenwindow(o,e); //رհť + begin + //e.skip := true; + closelogin(); + end + function GetUsrName(); + begin + return FuserEdit.text; + end + function SetUsrName(v); + begin + FuserEdit.text := v; + end + function GetPort(); + begin + return FportEdit.text; + end + function SetPort(v); + begin + FportEdit.text := v; + end + function SetIp(v); + begin + FserverEdit.text := v; + end + function GetIp(); + begin + return FserverEdit.text; + end + public + function create(AOwner);override; + begin + inherited; + visible := false; + FCacheFile := temppath()+ioFileseparator()+"loginer.stm"; + self.caption := "TinySoftLogin"; + rc := _wapi.GetScreenRect(); + self.height := 306; + self.left :=(rc[2]-rc[0])/2-350; + self.top :=(rc[3]-rc[1])/2-210; + self.width := 428; + self.wscaption := true; + self.wspopup := true; + self.wssizebox := true; + self.wssysmenu := true; + FserverEdit := new tedit(self); + FserverEdit.parent := self; + FserverEdit.height := 25; + FserverEdit.left := 106; + FserverEdit.text := "tsl.tinysoft.com.cn"; + FserverEdit.top := 26; + FserverEdit.width := 179; + FserverLabel := new tlabel(self); + FserverLabel.parent := self; + FserverLabel.left := 22; + FserverLabel.top := 23; + FserverLabel.width := 60; + FserverLabel.height := 25; + FserverLabel.caption := ""; + FuserLabel := new tlabel(self); + FuserLabel.parent := self; + FuserLabel.left := 22; + FuserLabel.top := 68; + FuserLabel.width := 59; + FuserLabel.height := 25; + FuserLabel.caption := "û"; + FpwdLabel := new tlabel(self); + FpwdLabel.parent := self; + FpwdLabel.caption := ""; + FpwdLabel.left := 21; + FpwdLabel.top := 112; + FpwdLabel.width := 57; + FpwdLabel.height := 25; + Fstatus := new tstatusbar(self); + Fstatus.parent := self; + Fstatus.left := 0; + Fstatus.top := 244; + Fstatus.Items := array(("text":"״̬","width":40),("text":"","width":200)); + FportEdit := new tedit(self); + FportEdit.parent := self; + FportEdit.height := 25; + FportEdit.left := 298; + FportEdit.text := "443"; + FportEdit.top := 25; + FportEdit.width := 80; + FlogoutBtn := new tbtn(self); + FlogoutBtn.parent := self; + FlogoutBtn.caption := "˳"; + FlogoutBtn.height := 31; + FlogoutBtn.left := 80; + FlogoutBtn.top := 173; + FlogoutBtn.width := 94; + FloginBtn := new tbtn(self); + FloginBtn.parent := self; + FloginBtn.caption := "½"; + FloginBtn.height := 31; + FloginBtn.left := 226; + FloginBtn.top := 173; + FloginBtn.width := 94; + FuserEdit := new tedit(self); + FuserEdit.parent := self; + FuserEdit.height := 25; + FuserEdit.left := 107; + FuserEdit.top := 68; + FuserEdit.width := 177; + FpwdEdit := new tpassword(self); + FpwdEdit.parent := self; + FpwdEdit.height := 25; + FpwdEdit.left := 107; + FpwdEdit.top := 114; + FpwdEdit.width := 174; + FloginBtn.onclick := thisfunction(clklogin); + FlogoutBtn.onclick := thisfunction(clklogout); + self.onclose := thisfunction(hidenwindow); + FlogoutBtn.enabled := false; + end + function openlogin() //򿪵¼ + begin + LoadCacheData(); + if getloginstatus()then + begin + setsatus("½ɹ"); + end else + setsatus("δ¼"); + if Parent then ShowModal(); + else show(); + end + function getloginstatus(); //״̬ + begin + {** + @explan(˵) õ½״̬ %% + @return(bool) true Ѿ½ false δ½ + **} + if CheckLogined()then return true; + else return false; + end + function publishs();override; + begin + return lowercase(array("name","port","ip","usrname","onlogined")); + end + property Port:string read GetPort write SetPort; + property Ip:string read GetIp write SetIp; + property UsrName:string read GetUsrName write SetUsrName; + property OnLogined:eventhandler read FOnLogined write FOnLogined; + {** + @param(port)(string) ˿ں%% + @param(ip)(string) %% + @param(UsrName)(string) û %% + @param(OnLogined)(function[tlogincontrol,tuieventbase]) ½ص %% + **} +end + +type TArrayTreeClass = class + {** + @explan(˵) %% + @param(FIdName)(integer | string) id %% + @param(FPIdName)(integer | string) ڵ %% + **} + {** + @example(ת) %% + d := array(("id":1,"pid":5,"caption":"jd1"), + ("id":4,"pid":2,"caption":"jd2"), + ("id":2,"pid":1,"caption":"jd3"), + ("id":3,"pid":2,"caption":"jd4"), + ("id":5,"pid":7,"caption":"jd5"), + ); + dt := class(TArrayTreeClass).ToTreeArray(d,array("id":"id","pid":"pid","sub":"sub")); + return dt; + **} + private + class function ClumnNameOk(id); + begin + return ifnumber(id) or ifstring(id) ; + end + static FCounter; + static FIdName; + Static FPIdName; + static FSubName; + static FSInToArray; + FRecyce; + FInToArray; + FComponents; //ڵ + FId; //id + FValue; // + class function initconter(); + begin + FCounter := 1; + end + class function GetCounter(); + begin + return FCounter++; + end + public + class function SetIdName(id,pid,sub); + begin + if(id <> pid)and(ifstring(id)or ifnumber(id))and(ifstring(pid)or ifnumber(pid))and(ifstring(sub)or ifnumber(sub))then + begin + FIdName := id; + FPIdName := pid; + FSubName := sub; + end + end + + function create(v); + begin + {** + @explan(˵) ڵ %% + **} + FId := v[FIdName]; + FValue := v; + FComponents := array(); + end + function addcomponent(o); + begin + {** + @explan(˵) ӽڵ %% + **} + len := length(FComponents); + for i:= 0 to len-1 do if o= FComponents[i] then exit; + FComponents[len] := o; + end + function Recycle(); + begin + {** + @explan(˵) ѭʱĴ %% + **} + if FRecyce then return ; + FRecyce := true; + for i,v in FComponents do + begin + v.Recycle(); + end + FComponents := array(); + end + function toarray(); + begin + {** + @explan(˵) תΪarray %% + **} + if FInToArray=FSInToArray then + begin + Recycle(); + raise "ڵϵѭ"; + end + FInToArray := FSInToArray; + ret := array(); + sub := array(); + for i := 0 to length( FComponents)-1 do + begin + ret[FSubName,i] := FComponents[i].toarray(); + end + for i,v in FValue do + begin + if i =FSubName then continue; + ret[i] := v; + end + return ret; + end + + class function SetColumnName(info); + begin + if not ifarray(info) then info := array("id":"id","pid":"pid","sub":"sub"); + if not ClumnNameOk(info["id"]) then info["id"] := "id"; + if not ClumnNameOk(info["pid"]) then info["pid"] := "pid"; + if not ClumnNameOk(info["sub"]) then info["sub"] := "sub"; + SetIdName(info["id"],info["pid"],info["sub"]); + end + class function ToTree(d,info); + begin + {** + @explan(˵) άתΪṹ %% + @param(d)(array) ݰ Ϣ %% + @param(info)(array) ֶϢ "id" ǰڵֶ,"pid" ǰڵĸڵֶ,"sub" ,ӽڵֶ + Ĭֵ array("id":"id","pid":"pid","sub":"sub"); %% + @return(TArrayTreeClass) + **} + SetColumnName(info); + root := new TArrayTreeClass(array(FIdName:nil,FPIdName:nil)); + oarray := array(); + oarray[-inf] := root; + for i,v in d do //id + begin + id := v[FIdName]; + ido := oarray[id]; + if ifnil(ido) then + begin + ido := new TArrayTreeClass(v); + oarray[id] := ido; + end + end + ifcycle := true; + for i,v in d do + begin + id := v[FIdName]; + ido := oarray[id]; + pid := v[FPIdName]; + pdo := oarray[pid]; + if not pdo then + begin + pdo := oarray[-inf]; + ifcycle := false; + end + + pdo.addcomponent(ido); + end + if ifcycle and oarray then + begin + for i,v in oarray do + begin + v.Recycle(); + raise "ڵϵѭ"; + break; + end + end + return root; + end + class function CreateRow(d,id,r); + begin + for i,v in d do + begin + ri := array(); + if not v then continue; + ri[FIdName] := GetCounter(); + ri[FPIdName] := id; + for j,vi in v do + begin + if j = FSubName then + begin + call(thisfunction,vi,ri[FIdName],r); + end + {else if j=FIdName or j = FPIdName then + begin + + end} else + begin + ri[j] := vi; + end + end + if ri then + begin + r[length(r)] := ri; + end + end + end + class function TreeArrayToArray(d,info); + begin + {** + @explan(˵) ṹתΪά %% + @param(d)(array) ݰ Ϣ %% + @param(info)(array) ֶϢ "id" ǰڵֶ,"pid" ǰڵĸڵֶ,"sub" ,ӽڵֶ + Ĭֵ array("id":"id","pid":"pid","sub":"sub"); %% + @return(array) + **} + if not ifarray(d) then exit; + SetColumnName(info); + r := array(); + initconter(); + CreateRow(d,GetCounter(),r); + return r; + end + class function ToTreeArray(d,info); + begin + {** + @explan(˵) άתΪṹ %% + @param(d)(array) ݰ Ϣ %% + @param(info)(array) ֶϢ "id" ǰڵֶ,"pid" ǰڵĸڵֶ,"sub" ,ӽڵֶ + Ĭֵ array("id":"id","pid":"pid","sub":"sub"); %% + @return(array) νṹarray + **} + root := ToTree(d,info); + if not root then return ; + FSInToArray := tostn(now()); + r := (root.toarray()); + return r; + end + end + type TIniFileExta = class() + {** + @explan(˵) iniļдװ %% + **} + private + FTStringa; + Fini; + FVtype; + FLowerKey; + FLowerValue; + function CheckSK(s,k); + begin + return ifstring(s) and s and ifstring(k) and k; + end + function ChangeV(V); + begin + vv := v; + case Vtype of + 1:vv := vv="0"?false:true; + 2:vv := StrToIntDef(vv,0); + else + begin + if FLowerValue then vv := lowercase(vv); + end + end + return vv; + end + function STNVA(); + begin + {** + @explan(˵) תΪname,value еĶά %% + **} + r := array(); + for i:=0 to FTStringa.Count-1 do + begin + n := FTStringa.Names(i); + if n then + begin + if FLowerKey then n := lowercase(n); + vv := FTStringa.Values(n); + r[length(r)] := array("name":n,"value":ChangeV(vv)); + end + end + FTStringa.Clear(); + return r; + end + + function STNV(); + begin + {** + @explan(˵) תΪname:value һά %% + **} + nr := STNVA(); + r := array(); + for i,v in nr do + begin + r[v["name"]] := v["value"]; + end + return r; + end + function STA(); + begin + {** + @explan(˵) תΪһά %% + **} + r := array(); + for i:=0 to FTStringa.Count-1 do + begin + vi := FTStringa.Strings(i); + r[i] := FLowerKey?lowercase(vi):vi ; + end + FTStringa.Clear(); + return r; + end + public + function create(al,Fname);override; + begin + {** + @explan(˵) 캯 %% + @param(al)(string) %% + @param(name)(string) ļ %% + **} + if ifstring(al) and ifstring(Fname) then + begin + FIni := new TIniFile(al,Fname); + FTStringa := new TStringlist(); + end else + raise "iniд"; + end + function readSection(sn);virtual; + begin + {** + @explan(˵) ȡsection key %% + **} + if ifstring(sn) and sn then + Fini.readSection(sn,FTStringa); + return STA(); + end + function ReadSections();virtual; + begin + {** + @explan(˵) ȡsection %% + **} + FIni.ReadSections(FTStringa); + return STA(); + end + function ReadSectionValues(sn);virtual; + begin + {** + @explan(˵) ȡsectionkey:value %% + **} + if ifstring(sn) and sn then + FIni.ReadSectionValues(sn,FTStringa); + return STNV(); + end + function RenameSection(sn1,sn2);virtual; + begin + {** + @explan(˵) section %% + @param(sn1)(string) %% + @param(sn2)(string) %% + **} + if not(sn1 and sn2 and ifstring(sn1)) and ifstring(sn2) then exit; + vs1 := ReadSectionValues(sn1); + EraseSection(sn1); + for i,v in vs1 do + begin + WriteKey(sn2,i,v); + end + end + function RenameKey(sec,k1,k2);virtual; + begin + {** + @explan(˵) key %% + @param(sec)(string) section %% + @param(k1)(string) %% + @param(k2)(string) %% + **} + if (sec and k2 and k1 and ifstring(sec) and ifstring(k1) and ifstring(k2)) then exit; + v := ReadKey(sec,k1); + DeleteKey(sec,k1); + WriteKey(sec,k2,v); + end + function ReadSectionValues2(sn); + begin + {** + @explan(˵) section ,ά,name,value + **} + if ifstring(sn) and sn then + FIni.ReadSectionValues(sn,FTStringa); + return STNVA(); + end + function ReadSectionValues3(sn); + begin + {** + @explan(˵) section ,ά,0Ϊkey,1Ϊvalue + **} + d := ReadSectionValues2(sn); + r := array(); + for i,v in d do + begin + r[length(r)] := array(v["name"],v["value"]); + end + return r; + end + function ReadKey(sn,key,def);virtual; + begin + {** + @explan(˵) ȡkey %% + **} + if CheckSK(sn,key) then + return FIni.ReadString(sn,key,ifstring(def)?def:""); + return nil; + end + function WriteKey(sn,key,v);virtual; + begin + {** + @explan(˵) дkey %% + **} + + if ifnil(v) then v := ""; + if CheckSK(sn,key) then + return FIni.WriteString(sn,key,ifstring(v)?v:tostn(v)); + return 0; + end + function DeleteKey(sn,key);virtual; + begin + if CheckSK(sn,key) then + return FIni.DeleteKey(sn,key); + end + function EraseSection(sn);virtual; + begin + {** + @explan(˵)ɾsection %% + **} + if ifstring(sn) and sn then + return FIni.EraseSection(sn); + end + function Destroy();virtual; + begin + FIni := nil; + FTStringa := nil; + end + property VType read FVtype write FVtype; + property LowerKey read FLowerKey write FLowerKey; + property LowerValue read FLowerValue write FLowerValue; + _tag; + end +type TCreateProcessA = class() + {** + @explan(˵) ̹ %% + **} + private + FOnEcho; + FBufSize; + {$ifdef linux} + static FProcesswnd; + function parserasexeclevparam(exe,cmd,e,arg,envp); + begin + arg := ParserCommandLine(exe+" "+cmd); + if not arg then return 0; + e := arg[0]; + for i := length(e) downto 2 do + begin + if e[i]="/" then + begin + ph := e[1:i]; + break; + end + end + arg[length(arg)] := nil; + envp := array(); + if ph then + begin + envp[length(envp)] := "LD_LIBRARY_PATH=LD_LIBRARY_PATH:"+ph; + end + envp[length(envp)] := "DISPLAY=:0"; + envp[length(envp)] :=nil; + return 1; + end + + type tprocesswnd = class(TCustomControl) + private + fidarraya; + fidarrayb; + fidarray; + Fmsg; + public + function create(AOwner); + begin + inherited; + Visible := false; + WsPopUp := true; + ht :=Handle ; + fidarray := array(); + fidarraya := array(); + fidarrayb := array(); + Fmsg := ""; + setlength(fmsg,1024); + //bindmessage(WM_USER,thisfunction(wmuser)); + end + function addproc(pid,fid,obj,t); + begin + fidarray[pid] := fid; + fidarraya[pid] := obj; + fidarrayb[pid] := t; + CallDatafunction(obj.OnPressStart,obj,pid); + _send_(WM_USER,pid,fid,1); + + end + function proccount(); + begin + return length(fidarrayb); + end + function clearproc(); + begin + for i,v in mrows(fidarray,1) do + begin + deleteproc(v); + end + end + function deleteproc(pid,flg); + begin + _wapi.tsl_gtk_closehandle(fidarray[pid]);//ɾfid + reindex(fidarray,array(pid:nil)); + reindex(fidarraya,array(pid:nil)); + tp := fidarrayb[pid]; + if (tp .& 2) and ifnil(flg) then + begin + SysTerminate(1,pid); + end + if tp .& 1 then + begin + ExitMessageLoop(); + end + reindex(fidarrayb,array(pid:nil)); + end + function wmuser(o,e):WM_USER;override; + begin + pid := e.wparam; + fid := e.lparam; + if pid and fid then + begin + r := _wapi.tsl_gtk_pipread(fid,Fmsg,1024); + if r=0 then + begin + deleteproc(pid,1); + return ; + end else + if r>0 then + begin + obj := fidarraya[pid]; + obj.DoOnEcho(obj,Fmsg[1:r]); + end else + begin + sleep(20); + end + _send_(WM_USER,pid,fid,1); + end + end + function Recycling();override; + begin + inherited; + deleteproc(); + end + end + {$endif} +public + function DoOnEcho(o,s);virtual; + begin + {** + @explan(˵) ӡ + **} + if not(CallMessgeFunction(FOnEcho,o,s))then + begin + echo s; + end + end + function create();override; + begin + inherited; + {$ifdef linux} + if not FProcesswnd then FProcesswnd := new tprocesswnd(initializeapplication()); + {$endif} + FBufSize := 1024; + end + function CreateProcessThread(exe,cmd); + begin + {$ifdef linux} + if parserasexeclevparam(exe,cmd,e,arg,envp)then + begin + //echo tostn(arg); + id := FProcesswnd._wapi.tsl_gtk_createprocessa(e,arg,envp,rh); + //1 ˳ 2 4 + ct := FProcesswnd.proccount(); + FProcesswnd.addproc(id,rh,self(true),0); + end + return id; + {$endif} + si := new T_startupinfoa(); + sa := new T_security_attributes(); + pi := new T_process_information(); + sa.bInheritHandle := TRUE; //ΪTRUE̵ĶдԱӽ̼̳ + sa.nLength := sa._size_; + //ܵ + w32 := gettswin32api(); + bRet := w32.CreatePipe(hRead,hWrite,sa._getptr_,0); + if not bRet then return 0; + w32.GetStartupInfoA(si._getptr_); + si.dwflags := 0x100; + si.hStdOutput := hWrite; + si.hStdError := hwrite; + p := w32.CreateProcessA(nil,format('%s %s ',exe,cmd),0,0,true,0,0,nil,si._getptr_,pi._getptr_); + return pi.hProcess; + end + function CreateProcessWaitRead(exe,cmd,hd,exitWithParent); + begin + {** + @explan(˵) ִд,ǰ߳ %% + @param(exe)(string) %% + @param(cmd)(string) %% + @param(hd)(pointer) , %% + @return(integer) ˳ %% + **} + if FCurrentExeHandle then return; + {$ifdef linux} + if parserasexeclevparam(exe,cmd,e,arg,envp)then + begin + //echo tostn(arg); + id := FProcesswnd._wapi.tsl_gtk_createprocessa(e,arg,envp,rh); + hd := id; + FCurrentExeHandle := id; + //1 ˳ 2 4 + ct := FProcesswnd.proccount(); + FProcesswnd.addproc(id,rh,self(true),(((exitWithParent or ifnil(exitWithParent))* 2).| 1)); + initializeapplication().run(); + if ct <> FProcesswnd.proccount()then + begin + FProcesswnd.clearproc(); + end + FCurrentExeHandle := 0; + end + id := 0; + return 0; + {$endif} + if not(FBufSize>100)then FBufSize := 1024; + w32 := gettswin32api(); + si := new T_startupinfoa(); + sa := new T_security_attributes(); + pi := new T_process_information(); + sa.bInheritHandle := TRUE; //ΪTRUE̵ĶдԱӽ̼̳ + sa.nLength := sa._size_; + //ܵ + bRet := w32.CreatePipe(hRead,hWrite,sa._getptr_,0); + if not bRet then return 0; + w32.GetStartupInfoA(si._getptr_); + si.dwflags := 0x100; + si.hStdOutput := hWrite; + si.hStdError := hwrite; + p := w32.CreateProcessA(nil,format('%s %s ',exe,cmd),0,0,true,0,0,nil,si._getptr_,pi._getptr_); + hd := pi.hProcess; + FCurrentExeHandle := hd; + w32.CloseHandle(hWrite); + if p then + begin + CallDatafunction(FOnPressStart,self(true),hd); + szReadBuf := ""; + setlength(szReadBuf,FBufSize); + nReadNum := 0; + ct1 := 0; + ct2 := 0; + ct3 := 0; + s := "123456"; + while w32.PeekNamedPipe(hRead,s,3,ct1,ct2,ct3) do + begin + if ct1 then + begin + if w32.ReadFile__(hRead,szReadBuf,FBufSize-1,nReadNum,nil)=0 then + begin + break; + end + tcs := szreadbuf[1:nreadnum]; + DoOnEcho(self(true),tcs); + end + MSG := new TTagMSG(); + hmsg := MSG._getptr_; + ///////////////////////////////////////////////////// + if(w32.PeekMessageA(hmsg,0,0,0,0x1))then + begin + if MSG.message=0x12 then + begin + if exitWithParent or ifnil(exitWithParent)then SysTerminate(1,hd); + w32.PostQuitMessage(0); + break; + end else + begin + w32.TranslateMessage(hmsg); + w32.DispatchMessageA(hmsg); + end + end else + begin + tslprocessmessages(false); + RunWorkerThreadLoop(); + end + ////////////////////////////////////////// + end + hd := 0; + w32.GetExitCodeProcess(pi.hProcess,cd); + w32.CloseHandle(hRead); + FCurrentExeHandle := 0; + end + return cd; + end + function CreateProcessWaitReadBlockThread(exe,cmd); + begin + {** + @explan(˵) ǰ̵߳ȴ %% + @param(exe)(string) %% + @param(cmd)(string) %% + @return(integer) ˳ %% + **} + {$ifdef linux} + return 0; + {$endif} + if not(FBufSize>100)then FBufSize := 1024; + w32 := gettswin32api(); + si := new T_startupinfoa(); + sa := new T_security_attributes(); + pi := new T_process_information(); + sa.bInheritHandle := TRUE; //ΪTRUE̵ĶдԱӽ̼̳ + sa.nLength := sa._size_; + //ܵ + bRet := w32.CreatePipe(hRead,hWrite,sa._getptr_,0); + if not bRet then return 0; + w32.GetStartupInfoA(si._getptr_); + si.dwflags := 0x100; + si.hStdOutput := hWrite; + si.hStdError := hwrite; + p := w32.CreateProcessA(nil,format('%s %s ',exe,cmd),0,0,true,0,0,nil,si._getptr_,pi._getptr_); + w32.CloseHandle(hWrite); + if p then + begin + CallDatafunction(FOnPressStart,self(true),pi.hProcess); + szReadBuf := ""; + setlength(szReadBuf,FBufSize); + nReadNum := 0; + while(w32.ReadFile__(hRead,szReadBuf,FBufSize-1,nReadNum,nil)) do + begin + tcs := szreadbuf[1:nreadnum]; + DoOnEcho(self(true),tcs); + nreadnum := 0; + end + end + w32.GetExitCodeProcess(pi.hProcess,cd); + w32.CloseHandle(hRead); + return cd; + end + property BufSize read FBufSize write FBufSize; + property OnEcho read FOnEcho write FOnEcho; + property LastExeHandle read FCurrentExeHandle; + property OnPressStart read FOnPressStart write FOnPressStart; + private + FOnPressStart; + FCurrentExeHandle; + {** + @param(OnEcho)(function[TCreateProcessA,s:string]) %% + **} +end +type TMyArrayA = class + {** + @explan() ַ±ĴСд%% + **} + function create(); + begin + FData := array(); + FRows := array(); + end + function DeleteIndex(idx); + begin + {** + @explan(˵) ɾָ± %% + **} + if ifnil(idx)or ifobj(idx)then return 0; + if ifstring(idx)then + begin + lidx := lowercase(idx); + ::deleteindex(FData,lidx,0); + return ::deleteindex(FRows,lidx,0); + end + ::deleteindex(FData,idx,0); + return ::deleteindex(FRows,idx,0); + end + function Operator[1](index,value); + begin + if ifstring(index)then + begin + li := lowercase(index); + end else + li := index; + if ifnone(value)then + begin + r := FData[li]; + if r then return r; + r := new TMyArrayA(); + FData[li]:= r; + FRows[li]:= index; + return r; + end + FRows[li]:= index; + if ifarray(value)and value then + begin + r := new TMyArrayA(); + FData[li]:= r; + for i,v in value do + begin + r[i]:= v; + end + return; + end + FData[li]:= value; + end + function Operator[](index); + begin + if ifstring(index)then r := FData[lowercase(index)]; + else r := FData[index]; + //if ifnil(r) then return NeW TMyArrayA(); + return r; + end + function Size(); + begin + {** + @explan(˵) ó %% + **} + return Length(FData); + end + function toarray(n); + begin + {** + @explan(˵) tsl array %% + @param(n)(bool) false Сд±꣬true ԭʼ± %% + **} + r := array(); + for i,v in FData do + begin + if v is class(TMyArrayA)then + begin + r[n?i:FRows[i]]:= v.toarray(n); + end else + r[n?i:FRows[i]]:= v; + end + return r; + end + function IndexNames(); + begin + {** + @explan(˵) ± %% + **} + return FRows; + end + function HaveIndex(); + begin + {** + @explan(˵) жǷij± %% + **} + o := self(true); + for i := 1 to Paramcount do + begin + if not(o is class(TMyArrayA))then return false; + id := params[i]; + if ifnil(o.TrueIndex(id))then return false; + o := o[id]; + end + return true; + end + function TrueIndex(n); + begin + {** + @explan(˵) öӦ± %% + **} + if ifstring(n)then idx := lowercase(n); + else idx := n; + return FRows[idx]; + end + property Data write SetData; + function destroy(); + begin + FData := nil; + FRows := nil; + end +private + function SetData(d); + begin + if not ifarray(d)then return false; + FRows := array(); + FData := array(); + si := self(true); + for i,v in d do + begin + si[i]:= v; + end + return true; + end + FData; + FRows; +end +type TMyArrayB = Class + {** + @explan(˵) ± %% + **} + private + FData; + public + function Create();virtual; + begin + {** + @explan(˵) 캯 %% + **} + FData := array(); + end + function Operator[1](idx,v); + begin + {** + @explan(˵)ͨ±Ԫ %% + **} + return SetValueByIndex(idx,v); + end + function Operator[](idx); + begin + {** + @explan(˵) ͨ±ȡԪ %% + **} + return GetValueByIndex(idx); + end + function length(); + begin + {** + @explan(˵) ݳ %% + @return(integer) %% + **} + return length(FData); + end + function Push({value1,value2,....}); + begin + {** + @explan(˵) ĩβ׷Ԫ, %% + **} + r := length(FData); + r1 := r; + for i := 0 to ParamCount-1 do + begin + FData[r]:= Params[i+1]; + r++; + end + if r1 <> r then LengthChanged(r1-r); + return r; + end + function Pop(); + begin + {** + @explan(˵) ĩβԪ %% + **} + if FData then + begin + id := length(FData)-1; + r := FData[id]; + deleteindex(FData,id); + LengthChanged(-1); + return r; + end + return nil; + end + function IndexOf(v); + begin + for i,vi in FData do + begin + if vi=v then return i; + end + return-1; + end + function LastIndexOf(v); + begin + for i := length(FData)-1 downto 0 do + begin + if v=FData[i]then return i; + end + return-1; + end + function GetValueByIndex(idx);virtual; + begin + return FData[idx]; + end + function SetValueByIndex(idx,v);virtual; + begin + len := length(FData); + if idx<0 then return nil; + if idx <= len then + begin + FData[idx]:= v; + end else + begin + for i := len to idx do FData[i]:= nil; + FData[idx]:= v; + return v; + end + end + function splice({startid,sellength,value1,valfue2,....}); + begin + {** + @explan(˵) 滻Ԫ,һΪʼλ,ڶΪ滻ĸ,ԺIJΪ滻ֵ,ر滻ֵ%% + **} + p := params; + st := p[0]; + sl := p[1]; + sl := ifnil(sl)?inf:sl; + sl := sl<0?0:sl; + len := length(FData); + st := st<0?0:st; + st := st >= len?(len):st; + et := st+sl; + et := et >= len?(len):et; + r := array(); + idx := 0; + for i := st to et-1 do + begin + r[idx++]:= FData[i]; + end + r1 := FData[0:st-1]; + r2 := FData[et:len-1]; + FData := r1 union p[2:]union r2; + if len <> length(FData)then LengthChanged(length(FData)-len); + return r; + end + function shift(); + begin + {** + @explan(˵) ͷԪ %% + **} + r := nil; + len := length(FData); + if len>0 then + begin + deleteindex(FData,0); + LengthChanged(-1); + end + return len<1?(len):(len-1); + end + function unshift({value1,value2,....}); + begin + {** + @explan(˵) ͷԪ, %% + **} + p := Params; + if p then + begin + FData := p union FData; + LengthChanged(1); + end + return length(FData); + end + function swap(i,j); + begin + {** + @explan(˵) ±еֵ %% + **} + if i=j then return false; + len := length(FData); + if i >= 0 and i= 0 and j nil then + begin + isConstIconSize := 1; + iconSidelength := l; + end else + isConstIconSize := 0; + end + function getIconSize(); + begin + {** + @explan(˵) ȡʾͼı߳%% + @return(integer)߳%% + **} + if isConstIconSize then return iconSidelength; + reset_tn(); + return iconSidelength; + end + function setIconType(i); + begin + {** + @explan(˵) ʾʾͼ%% + @param(l)(integer)0:ʣĬ + 1 + 2Ϣ + 3%% + **} + if(ifint(i)or ifint64(i))and i >= 0 and i<5 then + begin + if fimageType <> i then + begin + fimageType := i; + if parent then invalidateRect(nil,1); + end + return 1; + end + return 0; + end + property messageText:string read fmessageText write setMessageText; + property messageCaption:string read fmessageCaption write setMessageCaption; + property showInfomationIcon:bool read isInfomationIcon write setInfomationIcon; + {** + @param(messageText)(string)ҪʾʾԻ%% + @param(messageCaption)(string)ҪʾʾԻı%% + @param(showInfomationIcon)(bool)ʾԻǷʾһϢͼ%% + **} + protected + class function Sinit();override; + begin + inherited; + if not ftipImage then ftipImage := new TTipImage(); + end + + private + type TTipImage=class + public + function create(); + begin + init(); + end + function getImage(n); + begin + return imageData[n]; + end + private + { + 0:state_unknown ? + 1:state_error ! + 2:state_hint i + 3:state_warning ! + 4:state_infomation + } + function init(); + begin + imageData := array(); + imageData[0]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100026502000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA864000001FA49444154 +384FA590C16BD37014C7FD63A617118F3B78F0A6C2849D062AEEB08322E261301 +0E7CDE1C58975177187ECB0218A8843F0302C8C6DB0D16DD0DAAEB16BBB68D3AD +59D3C43499499A768D7ECD7BD01FCD7612BFF08197F7BEDF6F48CEE03F75AAC07 +4427C5CF1F1447270FFB9C5D04C3BBA9D54AC6035ED623CA1E1CD928DEFB56304 +9D3F0CCDB4A31B79FA250A92290B77A68A500E5A08C310DD6E3706EDE8461EF2F +6C40587668091896D942ABFD06EB71104012E8DAEC5D8CC36F8461EF2524614CC +2CEC627A4E86EFFB705D97997D5F661E25BEE2C2F067CCCCE7794F9E6792CC195 +170FD5E12E96F061CC71198A6095555F142DAC4C0950F989C5E462693412EB783 +D594C21951707EE8132CDB43B3D9846118D8DB5322631ED2DB14CE5E5DC4AD893 +528CA0F64B33BCC6EB1C2195170713809ABE941D3EA2814CA90E52273EEDA1253 +A91C881D51285639230A46C6B3D14F32502E57512AA902CB3A62FA77C4F27A953 +3A2E0D5BB46F41335ECEF1BD1DBEA82C19B05A67FA7AA3A9EBEAE724614D4CD2E +6E3CD491CEBBD16738A8D56CE6F298C6F49E8954DA662F654401E9CB4607A3933 +6327280462380AE07F0BC90A19976DBB9166E471EF2F6240A485CF2D8C1CB053F +321F43AB87D00E436CE53A48CC7B51D8898549B10292FEF337A4C516EE4E1D61E +881CDD04C3BBA9DD4A9827F13F017E5DF89FE289AB2290000000049454E44AE42 +608200"; + imageData[1]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002C502000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000025A49444154 +384FA592FB4B53611CC6FB63C2B40B2111843F686988D9C598E6A5EDB09B735B2 +DA78C4CCAA9BB485B91E8424C22B6650E85A0A00B545A1121116194457431529B +6B37DBDCA6672B787ADF77E76C893F450FBC3F7D9FCFF3BD9CB309FFA90D01BFF +B4E2063D7236DD562AD578354B71A892E25E267E5F87986135C79AD0BC8823A2C +DB5A91F4B9C0DFF5B097F00D2268D6216C6A42B0BD5E7067950B48DB74E02D2D8 +80FDBF16B6A02FCE805AC3A4FB2C75F772233398E88AB07DF0D122CE86B044A08 +E02D5AACF668101BB631386555B3272AD1AD246B28907EE043E8D2397C6DAEC66 +75515ABB100BA67C462C8C3161592BD2A66A0A2FBC73AC90D3A38F0F7C630D7C6 +E10357C16A2C801AE89EBCD7C140B1A3280A2E9B6488B44911BF6C45E48A136F1 +B4B598D05443BA4E0EF7B91B46B1928761445C170EB71840CE4884639E2E35731 +535BC26A2C20D8DE80B53B1EAC90CF268E4A3B663ECE3213057FE81B11D036206 +0E0101F1BC1CB9ADDACC602FCA72488B9FB911CB1E746A51DE3D70690B8E563E0 +92A61E7ED531849D660406FB305D5D9C0F98D71DC13793824C7123372AED288A8 +28BCA3A2CC86BB132E1C61BE5513CABDCC16A2CE08BFA003E292AB1E4E844EAF6 +68AE63D4E524DFDEC1C0794EC2E039B3114FF76FC3E3F2A27C00D57B5939669BC +AB0683F8DE44D2F2217C94FA39561B1458AD07933391C81BB8C78525184A97D5B +04EAAF00AAD775257825D98377CD120406C83D3C4388BA87E0EFB761863B44C04 +23C2A2B10DC59AD0BA07A717817A60F16E379D54EB2E77632EE56326E2126F716 +E061E966C195D786807F13F007E8743A916FA8D5250000000049454E44AE42608 +200"; + imageData[2]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100026F01000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000010449444154 +384FC590CD4EC24014467D4C1FC23720AE890FC082858961876B6358E24A59904 +0F83102024A2920CA6F202632F7F3DEA197D0306D349A709259F44ECF99764EF0 +47FE2F709ACCFD6A29A140F6AE81AF8D09266E6E0A9D50C406746088305B13460 +B823F277853C2CB84D07E2734DF0C5ABC84C4D5FD61E02C95B783218BFE8CD063 +B9FB41780EE4C7A141CDDF062EAE8BD1813ECBAF7CAA95C784C6682B57592E7B3 +10159F20BF2F91D3EB535367862B93E30A8B05C62B9EC6DAC749E7908070419C8 +254A641FF99A52CFD8B0E0BC444187FBEB32570B7681E9F2D33EEB9EB20BB8901 +707939553542203F272FAB61A292ACE804A71A212FB0B3FE1D801E01BC7E9AA1F +1B492A780000000049454E44AE42608200"; + imageData[3]:= "0502000000060400000074797065000203000000696D670006040000006461746 +100029B02000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000023049444154 +384FA5924B68135114860342C1858208BA1041B42A528A146BADA5ED4A70272AD +5048D2EA48B2E74D195B85044280A165D3488A216DA8A521F68D5FAC65402DAE2 +BBCD63F268A3C699BC6D329919F398CCEF99C9A531A45D883FFC309C7BFEEF70C +F5C13FE530B0212F636C45FB522F6A2059167DB59B55A0B02F470DAD983D4D733 +088F6E63D56ACD0BD0C3519A5CCCA7919F754178B8153FEF6F61A7959A17107DD +E0291B3415333D0F261A4A62E2274B7819D56AA0AA087234F9B81620EB9A80DF9 +783F4112F83EBC19DF6ED6B3AEB2AA007A580A0E533E09F750BB61557622ED19C +4CC501DEB2AAB021079D28CE47837A0E520050EC335D86E58F25AA11592E05F76 +C17F6D03EB2E690EA08785C74DF81D1BA7E509907C87E01A68332C7ACC5033EF2 +085C6E0BD520BEED25A96FA0B203C6A426AB29726C590156C04B0627A642703EC +87ECB7A2989D4178EC249C1756B31403E8617EA491C2191444079480D50028C14 +EC4DF9B21BAF741F676201BB6A12085F0E5EC4A7C3CBDBC0CE01F34D292AED3E2 +C2C8F2E7A1F80F10E060F90AEE0EC8DC5E48EEDD50150EBCFD1C264E2C2D01F47 +0C47E84FEB9448F6614B2CF6238C3D1648F85C2165AA299007B20797641F1512F +5D73B26F071CC76A600ADD6B801C7A6D00B4C22CF957C92A7DEB9EAB259913541 +711FF74076FBA16C1F4E3363D905BF508DEA8C3F4C02604FA37C277753DBC97D7 +C1DDB70653BDABF0B967053E9C5A8689E34BF0B67B311C476B8CB0BDD354F90EF +E5DC01F26687F1D27F303B60000000049454E44AE42608200"; + imageData[4]:= "0502000000060400000074797065000203000000696D670006040000006461746 +10002F002000089504E470D0A1A0A0000000D4948445200000010000000100806 +0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0 +BFC6105000000097048597300000EC300000EC301C76FA8640000028549444154 +384FA591CB4F136114C5FD9F9C71634C646188090644C18588A60852C028442D6 +2202A1429EFB6D08729050BC8A3CAAB552A9456DA0E15C7D287057948DA8AC1C4 +44571A8D28C73BD3490B61653CC959CD3DBF7BCF7C87F09F3A00C835ACE2942E8 +A2C4D04275A03C868E171BC6591ECC7B1079C3495D63E40B67E0527D56194F585 +D0E78E638CDB12DDEB8C41A67F05B6760E6C9D539A4E2A0510B666B605D13AB50 +647601B3D337128ADEF707F64056ADB1AAC9E041AC7A260CB27C15E9B94521220 +4B1B4166FB9218B6BDDE462D856E0F8631ECFB80616F02B72C212806C2B0CC6D4 +2F92404B6C40AB678240DC8542FA1D414809DFF849AC1281454E1863988EF3F77 +44579A7954F6F0503C0A60F0650CE79B5F802918480332DA79EA1987D6B6819B7 +D41549903A834F1E8776FC2422E3772491B7C542B0CFDCC2AD87C731A7054C961 +62F1236AFA43B4E90D2A1EFA6938F9C777C9729D17A55DF3640FAE1ABCB072313 +067BAC5EF2280AD7363DCBF2576153695E97D14F2211AFF8A6F3F7650D2E94671 +870B97C9728D0BA30B04C8D1EC053861726E40F5741915063FE4DD5E5CD1CEE36 +DEC0B017EA1A8651645D45BD6EC40750F07AD2302F674E71E40B503856A37863D +7154E838C8D51E38F8047EFFD9152B84DE7F46A1D24EB6C1F82C8AFC3B6304E81 +0A212E0FA3858B915F74683B038D751A27641D63A838BAA691436D870A17E1205 +F513681B0DD0F32ED0F92AB0E4144010231BC2E1BC5ED40ED18BCCAE4261F2D2C +9CF71A9D18E2A9D0B7A5B188A7E0E6C76432A2C280510C4E4F782C933E2DCDD29 +68A797F1D8BB415E47A73D82DC1A2B98EC460A3749D349ED030862CFEAE989BAC +0E46AE8D4660A35891B051FC96990A6D23A00F837017F01AE4B3263C856875900 +00000049454E44AE42608200"; + for i := 0 to length(imageData)-1 do + begin + t := new tbitmap(); + t.Readvcon(HexFormatStrToTsl(imageData[i])); + imageData[i]:= t; + end + end + imageData; + end + function setMessageText(str); + begin + fmessageText := str; + fmessagebox.mbText := str; + end + function setMessageCaption(str); + begin + fmessageCaption := str; + fmessagebox.Caption := str; + end + function setInfomationIcon(b); + begin + isInfomationIcon := b?1:0; + fmessagebox.mbiconstyle := isInfomationIcon?0x40:0; + end + function reset_tn(); + begin + //¼ͼı߳λ + if not isConstIconSize then iconSidelength := height50?(c[0]-50):100; + top := c[1]>50?(c[1]-50):100; + return ShowDlg(result,t); + end + function OnOkClk(); + begin + EndModal(1); + end + function OnCancelClk(); + begin + EndModal(0); + end + function DoWMSIZE(o,e);override; + begin + h := clientrect; + ht := h[3]-h[1]; + wd := h[2]-h[0]; + FBOk.Left := wd/2-50; + FBOK.top := ht-33; + FBCancel.Left := FBOk.Left+FBOK.Width+20; + FBCancel.top := ht-33; + end + class function RegisterInputType(t); + begin + {** + @explan(˵) עinput %% + @param(t)(TInputEditor) ༭ %% + **} + if t is class(TInputEditor)then + begin + if not SFInputType then SFInputType := new TMyArrayA(); + return SFInputType[t.classtype]:= t; + end else + if ifarray(t)then + begin + for i,v in t do RegisterInputType(v); + end + end + class function GetInputType(n); + begin + {** + @explan(˵) ע %% + **} + if SFInputType and ifstring(n)then return SFInputType[n]; + end + function Recycling();override; + begin + inherited; + FSetData := nil; + FInfoa := nil; + FInfo := nil; + FBOk := nil; + FBCancel := nil; + FLabels := nil; + FEdits := nil; + FTips := nil; + end + private + function RebuildInput(); + begin + ld := length(FInfoa); + lb := length(FLabels); + lp := length(FTips); + for i := 0 to lp-1 do FTips[i].Recycling(); + for i := 0 to lb-1 do + begin + FLabels[i].Recycling(); + FEdits[i].Recycling(); + end + FLabels := array(); + FEdits := array(); + for i := 0 to ld-1 do + begin + FLabels[i]:= new TLabel(self); + tp := FInfoa[i]["type"]; + if ifstring(tp)then + begin + tp := GetInputType(tp); + end + if ifobj(tp)then FEdits[i]:= createobject(tp,self); + else FEdits[i]:= new TInputString(self); + syg := FEdits[i-1]; + if syg then + begin + syg.NextCtrl := FEdits[i]; + end + if i=ld-1 then FEdits[i].NextCtrl := FBOk; + end + sp := 5; + for i,v in FInfoa do + begin + lb := FLabels[i]; + le := FEdits[i]; + lb.caption := v["caption"]; + lb.left := 20; + vtp := v["tip"]; + if ifstring(vtp)and vtp then + begin + tp := new TTipMessageButton(self); + tp.caption := vtp; + tp.left := 2; + tp.top := sp+3; + FTips[length(FTips)]:= tp; + tp.parent := self; + end + lb.top := sp; + lb.width := length(v["caption"])* 8+3; + le.value := v["value"]; + le.top := lb.top; + le.left := lb.width+lb.left; + if v["readonly"]then + begin + if le is class(tedit)then le.readonly := true; + else le.Enabled := false; + end else + begin + if le is class(tedit)then le.readonly := false; + else le.Enabled := true; + end + wd := max(le.left+le.width+10,wd); + sp += max(lb.height,le.height); + sp += 4; + le.SetInfo(v); + le.parent := self; + lb.parent := self; + end + width := wd+10; + height := sp+60+10; + //echo "\r\nin thisf function:",wd,"===",(sp+60); + //echo "\r\nin thisf function:",width,"===",height; + end + type tinputbool=class(tcheckbtn,TInputEditor) + {** + @explan(˵) %% + **} + class function ClassType();override; + begin + return "bool"; + end + function Create(AOwner);override; + begin + inherited; + width := 16; + height := 17; + OnKeyPress := thisfunction(OnNextKeyPress); + end + function Recycling();override; + begin + NextCtrl := nil; + inherited; + end + private + function GetValue();virtual; + begin + return Checked; + end + function SetValue(v);virtual; + begin + Checked := v; + end + end + type TInputString=class(TEdit,TInputEditor) + {** + @explan(˵) %% + **} + class function ClassType();override; + begin + return "string"; + end + function Create(AOwner);override; + begin + inherited; + width := 300; + OnKeyPress := thisfunction(OnNextKeyPress); + end + function Recycling();override; + begin + NextCtrl := nil; + inherited; + end + private + function GetValue();virtual; + begin + return text; + end + function SetValue(v);virtual; + begin + text := v; + end + end + type TInputPassWord=class(tpassword,TInputEditor) + {** + @explan(˵) %% + **} + class function ClassType();override; + begin + return "password"; + end + function Create(AOwner);override; + begin + inherited; + width := 300; + OnKeyPress := thisfunction(OnNextKeyPress); + end + function Recycling();override; + begin + NextCtrl := nil; + inherited; + end + private + function GetValue();virtual; + begin + return text; + end + function SetValue(v);virtual; + begin + text := v; + end + end + type TInputInteger=class(TInputString) + class function ClassType();override; + begin + return "integer"; + end + function Create(AOwner);override; + begin + inherited; + OnKeyPress := thisfunction(InPutChar); + end + function InPutChar(o,e); + begin + cd := e.CharCode; + if cd=VK_BACK or cd=VK_DELETE then return; + if cd=VK_TAB then OnNextKeyPress(o,e); + else + begin + if not(cd >= ord("0")and cd <= ord("9"))then + begin + e.skip := true; + end + end + end + private + function GetValue();override; + begin + return StrToIntDef(self.Text,0); + end + function SetValue(v);override; + begin + if ifnumber(v)then Text := IntToStr(v); + end + end + type TInputBtn=class(TBtn,TInputEditor) + {** + @explan(˵) ť %% + **} + function Create(AOwner);override; + begin + inherited; + height := 25; + OnKeyPress := thisfunction(OnNextKeyPress); + end + function Recycling();override; + begin + NextCtrl := nil; + inherited; + end + end + type TEditAndBtnUni=class(TWincontrol) + {** + @explan(˵) edit button %% + **} + private + FBtn; + FText; + public + function BtnClick(o,e);virtual; + function WMSETFOCUS(o,e):WM_SETFOCUS;override; + begin + if FBtn then FBtn.SetFocus(); + end + function Create(AOwner);override; + begin + inherited; + Height := 22; + FBtn := new tbtn(self); + FBtn.caption := ".."; + FText := new tedit(self); + FText.caption := ""; + FBtn.Parent := self; + FText.Parent := self; + FBtn.OnClick := thisfunction(BtnClick); + FText.OnKeyUP := function(o,e) + begin + if e.CharCode=VK_TAB then + begin + self.parent._send_(WM_USER,3,self.Handle); + end + end + end + function DoControlAlign();override; + begin + c := clientRect; + FBtn.top := 1; + FBtn.Left := C[2]-C[0]-18; + FBtn.Width := 15; + FBtn.Height := c[3]-c[1]-2; + FText.top := 1; + FText.Left := 1; + FText.Height := c[3]-c[1]-2; + FText.Width := C[2]-C[0]-22; + end + property Text read GetText Write SetText; + private + function GetText(); + begin + return FText.Text; + end + function SetText(v); + begin + FText.Text := v; + end + end + type TInputFile=class(TEditAndBtnUni,TInputEditor) + class function ClassType();override; + begin + return "file"; + end + function Create(AOwner);override; + begin + inherited; + width := 300; + height := 30; + end + function BtnClick(o,e);override; + begin + if not FFile then + begin + FFile := new TOpenFileADlg(self); + FFile.parent := self; + end + if FFile.ChooseDlg()then + begin + text := FFile.FileName; + end + end + private + function GetValue();override; + begin + return text; + end + function SetValue(v);override; + begin + text := v; + end + FFile; + end + type TInputPath=class(TEditAndBtnUni,TInputEditor) + class function ClassType();override; + begin + return "path"; + end + function Create(AOwner);override; + begin + inherited; + width := 300; + height := 30; + end + function BtnClick(o,e);override; + begin + if not FFile then + begin + FFile := new TFolderChooseADlg(self); + FFile.parent := self; + end + if FFile.ChooseDlg()then + begin + text := FFile.Folder; + end + end + private + function GetValue();override; + begin + return text; + end + function SetValue(v);override; + begin + text := v; + end + FFile; + end + function Tostr(v); + begin + if not ifstring(v)then return tostn(v); + return v; + end + function RegularData(d); + begin + r := array(); + FInfo := New TMyArrayA(); + v := new TMyArrayA(); + for i in d do + begin + vi := d[i]; + if not ifarray(vi)then continue; + v.Data := vi; + vn := v["name"]; + //if not ifstring(vn) then continue; + if FInfo[vn]then continue; + FInfo[vn]:= 1; + r[idx,"name"]:= vn; + r[idx,"caption"]:= v["caption"]?:(v["Comment"]?: wn); + for j in v.IndexNames() do + begin + if j in array("caption","name")then continue; + vj := v[j]; + r[idx,j]:= vj; + end + idx++; + end + return r; + end + FSetData; + FInfoa; + FInfo; + FBOk; + FBCancel; + FLabels; + FEdits; + FTips; + static SFInputType; + static SHashInited; +end +type TVirtualListItem = class(tsluibase) + {** + @ignore() %% + @explan(˵) list itemĿ + **} + type THandleClass=class + end + function Create(List);override; + begin + {** + @explan(˵) 캯%% + @param(list)(TVirtualList) item,TVirtualList %% + **} + if(List is class(TVirtualList))then + begin + FOwner := List; + end + hd := new THandleClass(); + try + FHandle := inttostr(int64(hd)); ////ǰΨһʶ + except + FHandle := inttostr(gettslvariableptr(hd)); + end; + inherited create(); + FWidth := 30; + end + function paint(cvs,x,y,xwidth,yheight);virtual; + begin + {** + @explan(˵) %% + @param(cvs)(TCanvas) canvas %% + @param(x)(integer) ǰxλ %% + @param(y)(integer) ǰyλ %% + @param(xwidth)(integer) Ŀ %% + @param(yheight)(integer) ߶ %% + **} + end + property Width read FWidth write SetWidth; + property Handle read FHandle; + property Owner read FOwner; + {** + @param(width)(integer) %% + @param(Owner)(TVirtualList) %% + **} + function Recycling();override; + begin + FOwner := nil; + inherited; + end + private + FHandle; + function SetWidth(w);virtual; + begin + if w>0 and w <> FWidth then + begin + if Owner and(Owner.ItemMaxWidth=FWidth)or(Owner.ItemMaxWidth= 0 then + begin + rc := ClientRect; + yp := GetYPos(); + rc[1]:=(idx-yp)* FItemHeight; + rc[3]:= rc[1]+FItemHeight; + return rc; + end + end + function GetIndexRect(idx);virtual; + begin + {** + @explan(˵) ͨiditem %% + @param(idx)(integer) %% + @return(array) array(,,,) %% + **} + r := GetIndexClientRect(idx); + if r then + begin + r[0]:= FColWidth *(0-GetXpos()); + end + return r; + end + function GetClientItemIndexs();virtual; + begin + rc := ClientRect; + r := GetRectItemIndexs(rc); + return r[0]-> r[1]; + end + function doControlALign();override; + begin + if(IsUpDating())then + begin + FScroolChanged := true; + end else + begin + InitialScroll(); + end + end + property ItemCount read GetItemCount write SetItemCount; + property ItemHeight read FItemHeight write SetItemHeight; + property ColCount read FColCount write SetColCount; + property ColWidth read FColWidth write SetColWidth; + private + FValidateRect; + FItemCount; // + FItemHeight; // + FColCount; // + FColWidth; //п + FScroolChanged; //޸ + function GetRectItemIndexs(rc); + begin + yp := GetYPos(); + tp := rc[1]; + bo := rc[3]; + FirstLine := integer(tp/GetYScrollDelta())+yp; + LastLine := integer((bo)/GetYScrollDelta())+yp; + return array(FirstLine,LastLine); + end + function SetColWidth(h); + begin + if FColWidth <> h and h>5 then + begin + FColWidth := h; + UpDateScrollBar(); + end + end + function SetColCount(v); + begin + nv := GZNumber(v); + if nv >= 0 and nv <> FColCount then + begin + FColCount := nv; + UpDateScrollBar(); + end + end + function GetItemCount();virtual; + begin + return FItemCount; + end + function SetItemCount(v);virtual; + begin + nv := GZNumber(v); + if nv >= 0 and nv <> FItemCount then + begin + FItemCount := nv; + UpDateScrollBar(); + end + end + function SetItemHeight(v); + begin + nv := GZNumber(v); + if FItemHeight <> nv then + begin + FItemHeight := nv; + UpDateScrollBar(); + end + end + function GZNumber(v); + begin + return v>0?integer(v):0; + end +end +type TVirtualList = class(TVirtualListFixed) + {** + @ignore() %% + @explan(˵) list + **} + function GetClientYCount();override; //߶ + begin + return FItems.Count; + end + function GetClientXCount();override; //ȼ + begin + return integer(FxClientMax/ColWidth); + end + function Create(AOwner);override; + begin + inherited; + FxClientMax := ColWidth; + FItemMinWidth := FxClientMax; + FHashItems := array(); + FItems := new TFpList(); + end + function GetItemByIndex(idx); + begin + {** + @explan(˵) ͨid %% + @param(idx)(integer) %% + @return(TVirtualListItem) %% + **} + if idx >= 0 and IdxFItems.Count-1 then idx :=-1; + return idx; + end + Function GetItemByYPos(y); + begin + {** + @explan(˵) ͨyλûitem %% + @param(y)(integer) yλ %% + @return(TVirtualListItem) %% + **} + idx := GetItemIndexByYpos(y); + if idx >= 0 then return FItems[idx]; + end + function GetItemIndex(item,guess); + begin + {** + @explan(˵) item %% + @param(item)(TVirtualListItem) item %% + @return(integer) %% + **} + for i :=(guess>0?guess:0)to FItems.Count-1 do + begin + if item=FItems[i]then return i; + end + return-1; + return FItems.Indexof(item); + end + function GetItemRect(item); + begin + {** + @explan(˵) item %% + @param(item)(TVirtualListItem) item %% + @return(array) array(,,,) %% + **} + idx := GetItemIndex(item); + if idx >= 0 then return GetItemRectByIndex(idx); + return array(); + end + function GetItemRectByIndex(idx);virtual; + begin + {** + @explan(˵) ͨiditem %% + @param(idx)(integer) %% + @return(array) array(,,,) %% + **} + if idx >= 0 and idx= 0 and idx= 0 and idxFxClientMax then + begin + FItemMaxItemIndex := idx0; + FxClientMax := it.Width; + end else + begin + if FItemMaxItemIndex >= idx0 then FItemMaxItemIndex++; + end + FItems.InsertBefor(it,idx0); + idx0++; + FHashItems[it.handle]:= it; + end + end + ItemUpDated(); + finally + DecPaintLock(); + end; + end + function InsertItem(it,idx);virtual; + begin + {** + @explan(˵) λó %% + @param(it)(TVirtualListItem) item %% + @param(idx)(integer) λ %% + **} + //idx0 := FItems.Count; + try + IncPaintLock(); + idx0 :=(idx >= 0 and idxFxClientMax then + begin + FItemMaxItemIndex := idx0; + FxClientMax := it.Width; + end else + begin + if FItemMaxItemIndex >= idx0 then FItemMaxItemIndex++; + end + FItems.InsertBefor(it,idx0); + FHashItems[it.handle]:= it; + r := true; + end + end + ItemUpDated(); + finally + DecPaintLock(); + end; + return r; + end + function DeleteItemByBounds(b,e);virtual; + begin + idx := b; + ei := e; + if not(idx >= 0 and idx)then return false; + Try + IncPaintLock(); + while idx <= ei do + begin + ei--; + if FItemMaxItemIndex>idx then FItemMaxItemIndex -= 1; + else if FItemMaxItemIndex=idx then FItemMaxItemIndex := nil; + it := FItems[idx]; + if it then reindex(FHashItems,array(it.Handle:nil)); + FItems.Deli(idx); + end + ItemUpDated(); + finally + DecPaintLock(); + end + end + function DeleteItemByIndex(idx);virtual; + begin + {** + @explan(˵) ɾλõ %% + @param(idx)(integer) λ %% + **} + if idx >= 0 and idxidx then FItemMaxItemIndex -= 1; + else if FItemMaxItemIndex=idx then FItemMaxItemIndex := nil; + it := FItems[idx]; + if it then reindex(FHashItems,array(it.Handle:nil)); + FItems.Deli(idx); + ItemUpDated(); + finally + DecPaintLock(); + end; + return true; + end + return false; + end + function AppendItem(v);virtual; + begin + {** + @explan(˵) ׷ %% + @param(v)(TVirtualListItem) item %% + **} + return InsertItem(v,FItems.Count); + end + function AppendItems(vs);virtual; + begin + {** + @explan(˵) ׷ %% + @param(v)(array of TVirtualListItem)  %% + **} + //O := new TPAINTCOUNT(self); + id := FItems.count; + try + IncPaintLock(); + for i,v in vs do + begin + if v is class(TVirtualListItem)then + begin + if FHashItems[v.handle]then continue; + wd := v.width; + if not(FItemMaxItemIndex >= 0)then + begin + FxClientMax := CalcMaxItemWidth(); + owd := FxClientMax; + end + if FxClientMax mx)then + begin + FxClientMax := mx; + end + UpDateScrollBar(); + DecPaintLock(); + end + function PaintRect(cvs,yPos,ht,FirstLine,LastLine,xPos,wd,FirstCol,LastCol);override; + begin + x := wd *(0-xPos); + rc := ClientRect; + PrevPaint(FirstLine,LastLine); + for i := FirstLine to LastLine do + begin + nrc := GetIndexRect(i); + //ri GetItemRectByIndex(i); + it := FItems[i]; + //y := ht * (i - yPos)+100; + it.paint(cvs,x,nrc[1],rc[2]-rc[1]-x,ht); + end + end + function SetTopLine(idx);override; + begin + {** + @explan(˵) idxзclient %% + @param(idx)(integer) к %% + **} + if idx >= 0 and idx5 and FItemMinWidth <> w then + begin + FItemMinWidth := w; + if FItemMinWidth>FxClientMax then + begin + FxClientMax := FItemMinWidth; + ColCount := integer(FxClientMax/ColWidth+0.5); + end + end + end + function CalcMaxItemWidth();virtual; + begin + {** + @explan(˵)item %% + **} + mx := FItemMinWidth; + if ifnil(FItemMaxItemIndex)then + begin + FItemMaxItemIndex := 0; + for i := 0 to FItems.Count-1 do + begin + nwd := FItems[i].Width; + if nwd>mx then + begin + mx := nwd; + FItemMaxItemIndex := i; + end + end + end else + begin + return FxClientMax; + end + return mx; + end + + private + FHashItems; + function PrevPaint(begid,endid);virtual; + begin + end + function GetItemCount();override; + begin + return FItems.Count; + end + function SetColWidth();override; + begin + end + function SetItemCount();override; + begin + end + function GetItems(); + begin + r := array(); + for i := 0 to FItems.Count-1 do r[i]:= FItems[i]; + return r; + end + FItemMinWidth; + FItemMaxItemIndex; + FItems; //Ŀ + FxClientMax; //ˮƽ +end + +type TNode = class() + {** + @explan(˵) %% + **} + private + FItems; // + FParent; //ڵ + public + function Create();virtual; + begin + inherited; + FExpanded := true; + FItems := new TFpList(); // + end + function CreateNode();virtual; + begin + return CreateObject(self(true).Classinfo(1)); + end + function CreateNodeAndAppend();virtual; //첢׷ + begin + nd := CreateNode(); + AppendNode(nd); + return nd; + end + function GetNodeByIndex(idx); + begin + {** + @explan(˵) ͨŻӽڵ%% + @param(idx)(TNode) %% + **} + if idx >= 0 then return FItems[idx]; + return nil; + end + function indexof(v); // + begin + return FItems.indexof(v); + end + function GetIndex();virtual; + begin + {** + @explan(˵) ڸڵе %% + @return(integer) %% + **} + if Parent then Parent.indexof(self); + end + function AppendNode(it);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)(TNode) ڵ %% + @return(bool) Ƿɹ %% + **} + return InsertNode(it,FItems.Count); + end + function HasNode(nd);virtual; + begin + {** + @explan(˵) ǷΪijڵȽڵ %% + @param(nd)(TNode) ӽڵ %% + @return(TNode|0) ΪȽڵ,ͷزѯڵĸڵ %% + **} + if not(nd is class(TNode))then return 0; + p1 := nd.Parent; + p := p1; + while p do + begin + if p=self then return p1; + if p is class(TNode)then p := p.Parent; + end + return 0; + end + function DeleteNode(nd);virtual; + begin + {** + @explan(˵) ɾڵ %% + @param(nd)(TNode) ɾڵ %% + **} + if nd=self then return 0; + pn := HasNode(nd); + if not pn then return; + return pn.DeleteChildNode(nd); + end + function DeleteChildNode(nd); + begin + {** + @explan(˵) ɾӽڵ%% + @param(nd)(TNode) ڵ %% + **} + idx :=-1; + idx := indexof(nd); + if idx=-1 then return 0; + return DeleteNodeByIndex(idx); + end + function DeleteNodeByIndex(idx); + begin + {** + @explan(˵) λɾڵ%% + @param(idx)(integer) %% + **} + nd := FItems[idx]; + if not nd then return; + //Ƿʾ + FItems.Deli(idx); + CurrentDeleteNode := nd; + nd.parent := self(true); + CurrentDeleteNode := nil; + return true; + end + function DeleteChildren();virtual; // + begin + {** + @explan(˵) ɾеӽڵ%% + **} + while NodeCount>0 do + begin + idx := 0; + it := FItems[idx]; + CurrentDeleteNode := it; + it.parent := self(true); + CurrentDeleteNode := nil; + FItems.Deli(idx); + end + end + function InsertNodes(its,idx);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)( array of TNode) ַ %% + @param(idx)(integer) ĬΪ0 %% + **} + idx0 := idx; + if idx<0 then idx0 := 0; + if idx>FItems.Count then idx0 := FItems.Count; + bidx := idx0; + for i,it in its do + begin + if(it is class(TNode))and(not it.Parent)then + begin + FItems.InsertBefor(it,idx0); + CurrentAddNode := it; + it.Parent := self(true); + CurrentAddNode := nil; + idx0++; + end + end + end + function InsertNode(it,idx);virtual; + begin + {** + @explan(˵) һڵ %% + @param(it)(TNode) ַ %% + @param(idx)(integer) ĬΪ0 %% + **} + if(it is class(TNode))and(not it.Parent)then + begin + if idx<0 then idx := 0; + if idx>FItems.Count then idx := FItems.Count; + if not(idx >= 0)then idx := 0; + FItems.InsertBefor(it,idx); + CurrentAddNode := it; + it.Parent := self(true); + CurrentAddNode := nil; + return true; + end + end + function Expand();virtual; //չ + begin + FExpanded := true; + end + function UnExpand();virtual; //۵ + begin + FExpanded := false; + end + function RecyclingChildren();virtual; + begin + while NodeCount>0 do + begin + it := FItems[0]; + it.Recycling(); + end + end + function Recycling();virtual; + begin + p := FParent; + if p then + begin + p.DeleteNode(self); + end + while NodeCount>0 do + begin + it := FItems[0]; + it.Recycling(); + end + //inherited; + end + property NodeCount read GetNodeCount; //ڵ + property Expanded read FExpanded write SetExpand; //չ + property Parent read FParent write SetParent; //ڵ + property LastChild read GetLstChild; + {** + @param(NodeCount)(integer) ӽڵ %% + @param(Expanded)(bool) Ƿչ %% + @param(Parent)(TNode) ڵ %% + **} + protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode; + property CurrentAddNode read FCurrentAddNode write FCurrentAddNode; + {** + @ignoremembers(CurrentDeleteNode,CurrentAddNode) + **} + function SetParent(V);virtual; + begin + tp := Parent; + if v=tp then return; + if(v is class(TNode))then + begin + if v.CurrentAddNode=self then + begin + FParent := v; //½ڵ + end else + if v.CurrentDeleteNode=self then //ӽڵƳ + begin + FParent := nil; + end else + begin + if tp=v then return; + if tp then + begin + tp.DeleteNode(self(true)); + end + v.InsertNode(self(true),v.NodeCount); + end + end else + begin + if tp then tp.DeleteNode(self(true)); + end + end + private + function GetLstChild(); + begin + return FItems[FItems.Count-1]; + end + FCurrentDeleteNode; + FCurrentAddNode; + FExpanded; + function SetExpand(v);virtual; //Ѿչ + begin + if v then Expanded(); + else UnExpand(); + end + function GetNodeCount(); //ӽڵ + begin + return FItems.Count; + end +end + +implementation +type Ttagprocessentry32=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("dwsize","int",0) + ,("cntusage","int",0) + ,("th32processid","int",0) + ,("th32defaultheapid","intptr",0) + ,("th32moduleid","int",0) + ,("cntthreads","int",0) + ,("th32parentprocessid","int",0) + ,("pcpriclassbase","int",0) + ,("dwflags","int",0) + ,("szexefile","char[260]",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + dwsize := _size_(); + end + property dwsize index "dwsize" read _getvalue_ write _setvalue_; + property cntusage index "cntusage" read _getvalue_ write _setvalue_; + property th32processid index "th32processid" read _getvalue_ write _setvalue_; + property th32defaultheapid index "th32defaultheapid" read _getvalue_ write _setvalue_; + property th32moduleid index "th32moduleid" read _getvalue_ write _setvalue_; + property cntthreads index "cntthreads" read _getvalue_ write _setvalue_; + property th32parentprocessid index "th32parentprocessid" read _getvalue_ write _setvalue_; + property pcpriclassbase index "pcpriclassbase" read _getvalue_ write _setvalue_; + property dwflags index "dwflags" read _getvalue_ write _setvalue_; + property szexefile index "szexefile" read _getvalue_ write _setvalue_; +end + +type Ttagmoduleentry32=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("dwsize","int",0) + ,("th32moduleid","int",0) + ,("th32processid","int",0) + ,("glblcntusage","int",0) + ,("proccntusage","int",0) + ,("modbaseaddr","intptr",0) + ,("modbasesize","int",0) + ,("hmodule","intptr",0) + ,("szmodule","char[256]",0) + ,("szexepath","char[260]",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + dwsize := _size_(); + end + property dwsize index "dwsize" read _getvalue_ write _setvalue_; + property th32moduleid index "th32moduleid" read _getvalue_ write _setvalue_; + property th32processid index "th32processid" read _getvalue_ write _setvalue_; + property glblcntusage index "glblcntusage" read _getvalue_ write _setvalue_; + property proccntusage index "proccntusage" read _getvalue_ write _setvalue_; + property modbaseaddr index "modbaseaddr" read _getvalue_ write _setvalue_; + property modbasesize index "modbasesize" read _getvalue_ write _setvalue_; + property hmodule index "hmodule" read _getvalue_ write _setvalue_; + property szmodule index "szmodule" read _getvalue_ write _setvalue_; + property szexepath index "szexepath" read _getvalue_ write _setvalue_; +end +type TMONITORINFO=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("cbsize","int",0), + ("rcmonitor","int[4]", + (0,0,0,0)), + ("rcwork","int[4]", + (0,0,0,0)), + ("dwflags","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + cbsize := _size_(); + end + property cbsize index "cbsize" read _getvalue_ write _setvalue_; + property rcmonitor index "rcmonitor" read _getvalue_ write _setvalue_; + property rcwork index "rcwork" read _getvalue_ write _setvalue_; + property dwflags index "dwflags" read _getvalue_ write _setvalue_; +end + +function getmonthdates(y,m); +begin + if m = 2 then return (not(y mod 4) and ( (y mod 100)))+ 28; + if m in array(1,3,5,7,8,10,12) then return 31; + return 30; +end +function GetPathFromFullName(fullname,fname,ftype); +begin + {** + @explan(˵) õǰִtslļ· %% + @param(fullname)(string) ȫ %% + @param(fname)(string) ļ ,η%% + @param(ftype)(string) ļ ,η%% + @return(string) · %% + **} + ph := fullname; + n := ""; + rp := ""; + fname := ""; + ftype := ""; + firstd := true; + iofp := ioFileseparator(); + for i := length(ph)downto 1 do + begin + vi := ph[i]; + if vi="." and firstd then + begin + ftype := n; + n := ""; + firstd := false; + end else + if vi=iofp then + begin + rp := ph[1:i-1]; + break; + end else + n := vi+n; + end + FName := n; + return rp; +end + +function GetAndDispatchMessageA(hwnd,minm,maxm); +begin + {** + @explan(˵) úͷַϢ %% + @param(hwnd)(pointer) ھ ĬΪ0 %% + @param(minm)(integer) СϢֵ ĬΪ %% + @param(maxm)(integer) Ϣֵ ĬΪ %% + @return(integer)0ʾWM_QUIT ,-1ʾ,ش0 %% + **} + FMSG := new TTagMSG(); + ptr := FMSG._getptr_(); + API := gettswin32api(); + /////////////////////////////////////////////// + if(API.PeekMessageA(ptr,0,0,0,0x1))then + begin + if FMSG.message=0x12 then + begin + return 0; + end else + begin + API.TranslateMessage(ptr); + API.DispatchMessageA(ptr); + end + end else + begin + tslprocessmessages(false); + RunWorkerThreadLoop(); + end + return-1; + ////////////////////////////////////////////////////// + {r := API.GetMessageA(ptr, hwnd>0?hwnd:0, minm>0?minm:0, maxm>0?maxm:0); + if r=0 then + begin + return r; + end + API.TranslateMessage(ptr); + API.DispatchMessageA(ptr);} + return r; +end + +function GetGdipStatus(v); +begin + {** + @explan(˵) gdiflat״̬˵ %% + @param(v)(integer) ״ֵ̬ %% + @return(string) ״̬˵ %% + **} + vs := static array( + "Ok", + "GenericError", + "InvalidParameter", + "OutOfMemory", + "ObjectBusy", + "InsufficientBuffer", + "NotImplemented", + "Win32Error", + "WrongState", + "Aborted", + "FileNotFound", + "ValueOverflow", + "AccessDenied", + "UnknownImageFormat", + "FontFamilyNotFound", + "FontStyleNotFound", + "NotTrueTypeFont", + "UnsupportedGdiplusVersion", + "GdiplusNotInitialized", + "PropertyNotFound", + "PropertyNotSupported", + "ProfileNotFound"); + return vs[v]; +end + +function RegisterComponentType(n,typ); +begin + {** + @explan(˵) עcomponent %% + **} + class(Ttfm2Component).RegisterComponentType(n,typ); +end + +function HexHash(); +begin + c := array("A","B","C","D","E","F"); + idxs := inttostr(0 -> 9)union c union lowercase(c); + r := array(); + for i,v in idxs do + begin + if i<16 then r[v]:= i; + else r[v]:= i-6; + end + return r; +end +function TslToHexStr(t); +begin + {** + @explan(˵) tslתΪ16ַ %% + @param(t)(any) tsl %%; + @return(string) 16ַ %% + **} + r := ""; + str := tostm(t); + ky := static(inttostr(0 -> 9)union array("A","B","C","D","E","F")); + idx := 1; + setlength(r,length(str)* 2); + for i := 0 to length(str)-1 do + begin + vi := ord(str[i]); + //r += ky[_shr(vi,4) .& 0xf]; + //r += ky[vi .& 0xf] ; + r[idx]:= ky[_shr(vi,4).& 0xf]; + r[idx+1]:= ky[vi .& 0xf]; + idx += 2; + end + return r; +end + +function HexFormatStrToTsl(hex); +begin + {** + @explan(˵)лз16ַתΪtsl %% + @param(hex)(string) 16ַ %% + @return(any) tsl %% + **} + r := ""; + hs := static HexHash(); + //rs := inttostr(0 -> 9)union array("A","B","C","D","E","F","a","b","c","d","e","f"); + for i := 1 to length(hex) do + begin + ri := hex[i]; + if hs[ri]>=0 then + begin + r += ri; + end + end + return HexStrToTsl(r); +end +function TslToHexFormatStr(tsl); +begin + s := TslToHexStr(tsl); + r := ""; + n := length(s); + i := 1; + bc := 64; + while true do + begin + if i>n then break; + ij := i+bc; + if ij>n and i <= n then + begin + r += s[i:n]; + break; + end else + r += s[i:ij]; + if ij>n then break; + r += "\r\n"; + i := ij+1; + end + return r; +end +function HexStrToTsl(hex); +begin + {** + @explan(˵)16ַתΪtsl %% + @param(hex)(string) 16ַ %% + @return(any) tsl %% + **} + if not(hex and ifstring(hex)) then return nil; + r := tostm(nil); + setlength(r,Integer(length(hex)/2)); + hs := static HexHash(); + idx := 0; + for i := 1 to length(hex)-1 step 2 do + begin + vi := hs[hex[i]]; + vi1 := hs[hex[i+1]]; + r[idx]:= _shl(vi,4).| vi1; + idx++; + end + return stm(r); +end +function initializeapplication(); +begin + {** + @explan(˵) ʼapplication %% + @return(tapplication) ڳ %% + **} + return getapplication(); +end +function includestate(u,s); +begin + {** + @explan(˵) ״̬չ %% + **} + if not ifarray(u)then u := array(); + if ifarray(s)then u union2= s; + else u union2= array(s); + return u; +end +function excludestate(u,s); +begin + {** + @explan(˵) ״̬%% + **} + if not ifarray(u)then u := array(); + if ifarray(s)then u minus= s; + else u minus= array(s); + return u; +end +function signedtounsigned(v,n); +begin + {** + @explan(˵) תΪ޷ %% + @param(v)(integer) %% + @param(n)(integer) Чλ %% + @return(integer) + **} + if not ifnumber(n)then n := 16; + if n>64 then n := 64; + mkv2 := 1; + ret := mkv2 .& v; + for i := 1 to n-1 do + begin + mkv2 := _shl(mkv2,1); + ret +=(mkv2 .& v); + end + mkv2 := _shl(mkv2,1); + if v<0 then + begin + ret .|= mkv2; + end else + begin + ret .&=(.! mkv2); + end + return ret; +end +function getbitsfrominteger(n,b,e); +begin + {** + @explan(˵) ȡֵλתΪ %% + @param(b)(integer) ʼλ %% + @param(e)(integer) ֹλ %% + @param(n)(integer) %% + @return(integer) + **} + r := 0; + if b<0 then return 0; + mk := 2^(b); + for i := b to e do + begin + if(mk .& n)>0 then r += _shr(mk,b); + mk := _shl(mk,1); + end + return r; +end + +function unsignedtosigned2(v,n); +begin + {** + @explan(˵) ޷תΪ %% + @param(v)(integer) %% + @param(n)(integer) Чλ %% + @return(integer) + **} + if not ifnumber(n)then n := 16; + if n>64 then n := 64; + vv := 1 .& v; + for i := 1 to n-1 do vv +=(v .& _shr(1,i)); + mkv := _shr(1,n); + if(v .& mkv)then + begin + return 0-((_not(vv) .& mkv2)+1); + end + return vv; +end +function unsignedtosigned(v,n); +begin + {** + @explan(˵) ޷תΪ %% + @param(v)(integer) %% + @param(n)(integer) Чλ %% + @return(integer) + **} + if not ifnumber(n)then n := 16; + if n>64 then n := 64; + mkv := 0; + mkv := _shl(1,n-1); + mkv2 := 1; + for i := 1 to n-1 do + begin + mkv2 := _shl(mkv2,1); + mkv2 += 1; + end + vv := v .& mkv2; + if(v .& mkv)then + begin + return 0-((_not(vv) .& mkv2)+1); + end + return vv; +end +function getapplication(); +begin + {** + @explan(˵) application%% + @return(tapplication) Ӧö %% + **} + r := class(UIglobalData).uigetdata("tuiapplication"); + if not(r)then + begin + r := new tapplication(); + class(UIglobalData).uisetdata("tuiapplication",r); + end + return r; + //return static new tapplication(); +end +function gettswin32api(); //win32 api +begin + {** + @explan(˵) win32api + **} + return static new tswin32api(); +end +Function tslcstructure(data,dsize,pack,ptr); +Begin + {** + @explan(˵) ṹŲ %% + @param(data)(array) ṹϢ,ο cstructurelib tslarraytocstructcalc %% + @param(ssize)(integer) С %% + @param(pack)(integer) ䷽ʽ %% + @return(tslcstructureobj) ڴֲ %% + **} + dt := unit(cstructurelib).MemoryAlignmentCalculate(data,1,dsize,pack); + r := new tslcstructureobj(dt,ptr); + return r; +End; + +function tslcstructure_calc(data,baselen,ssize,pack); +begin + {** + @explan(˵) ṹŲ %% + @param(data)(array) ṹϢ,ο cstructurelib tslarraytocstructcalc %% + @param(baselen)(integer) ׼%% + @param(ssize)(integer) С %% + @param(pack)(integer) ䷽ʽ %% + **} + return tslarraytocstructcalc(data,pack,0,ssize); +end + + //*************makelong***************************** +function ShowErrorMessage(msg); +begin + {** + @explan(˵) Ϣʾ %% + @param(msg)(string) ʾϢ %% + **} + if ifstring(msg)then getapplication().ShowErrorMessage(msg); +end +function makeposition(x,y); +begin + {** + @explan(˵)x,yΪһint %% + @return(integer) + **} + if ifnumber(x)and ifnumber(y)then return makelong(signedtounsigned(x),signedtounsigned(y)); + return 0; +end +function intasposition(i); +begin + if ifnumber(i)then + begin + return lowuperdword(i); + end + return array(0,0); +end + +function makelong(low,high,ptrl); +begin + {** + @explan(˵) ϲߵΪ %% + @return(integer) %% + @param(low)(integer) λ %% + @param(high)(integer) λ %% + @param(ptrl)(integer) ĬΪ 8 %% + **} + if not ifnumber(ptrl)then ptrl := 16; + mask := 2^(ptrl)-1; + low1 := low .& mask; + high1 := high .& mask; + return _shl(high1,ptrl).| low1; +end +function lowuperdword(value_,lvalue,uvalue,ptrl); +begin + {** + @explan(˵) ߵλȡ %% + @param(value_)(integer) %% + @param(lvalue)(integer) λ %% + @param(uvalue)(integer) λ %% + @param(ptrl)(integer) ĬΪ 8 %% + **} + lvalue := uvalue := 0; + if not ifnumber(value_)then return array(0,0); + if not ifnumber(ptrl)then ptrl := 16; + value :=(value_); + mask := 2^(ptrl)-1; + uvalue := _shr(value,ptrl).& mask; + //t := _shl(value,ptrl); + //lvalue := _shr(t,ptrl) .& mask; + lvalue := value .& mask; + return array(lvalue,uvalue); +end; + +function remotetslcallback(data); +begin + {** + @explan(˵) 鶩Ļص %% + **} + class(TQuotations).Dispatch(data); + //return class(TQuotations)._SWINDOWS._send_(0X4400,0,data,1); +end + +type TTipWnd = class( TCustomControl) //tip +{** + @ignore() %% +**} + function Create(AOwner);override; + begin + inherited; + Visible := false; + WsPopUp:= true; + Enabled := false; + color := rgb(244,246,224); + border := false; + FTip := ""; + end + function ShowTip(); + begin + if FTip then + begin + if Visible then return ; + xy := array(0,0); + _wapi.GetCursorPos(xy); + //left := xy[0]+10; + //top := xy[1]+10; + show( SW_SHOWNOACTIVATE);// + SetBounds(xy[0]+10,xy[1]+10,FSize[0],FSize[1]); + end + else Visible := false; + end + Function Paint();override; + begin + dc := Canvas; + dc.DrawText(FTip,self.ClientRect,DT_LEFT .|DT_NOPREFIX); + end + property Tip read FTip write SetTip; + private + FTip; + function SetTip(s); + begin + if ifstring(s) and s<>FTip then + begin + FTip := s; + wh := GetTextWidthAndHeightWidthFont(s,seLF.font,1); + //width := wh[0]+5; + //height := wh[1]+5; + FSize := array(wh[0]+5,wh[1]+5); + end + end + private + FSize; +end +type _shellapi_=class() + static abm_new; + static abm_remove;static abm_querypos;static abm_setpos;static abm_getstate;static abm_gettaskbarpos; + static abm_activate;static abm_getautohidebar;static abm_setautohidebar;static abm_windowposchanged;static abm_setstate; + static abm_getautohidebarex;static abm_setautohidebarex;static abn_statechange;static abn_poschanged;static abn_fullscreenapp; + static abn_windowarrange;static abs_autohide;static abs_alwaysontop;static abe_left;static abe_top; + static abe_right;static abe_bottom;static fo_move;static fo_copy;static fo_delete; + static fo_rename;static fof_multidestfiles;static fof_confirmmouse;static fof_silent;static fof_renameoncollision; + static fof_noconfirmation;static fof_wantmappinghandle;static fof_allowundo;static fof_filesonly;static fof_simpleprogress; + static fof_noconfirmmkdir;static fof_noerrorui;static fof_nocopysecurityattribs;static fof_norecursion;static fof_no_connected_elements; + static fof_wantnukewarning;static fof_norecursereparse;static fof_no_ui;static po_delete;static po_rename; + static po_portchange;static po_ren_port;static se_err_fnf;static se_err_pnf;static se_err_accessdenied; + static se_err_oom;static se_err_dllnotfound;static se_err_share;static se_err_associncomplete;static se_err_ddetimeout; + static se_err_ddefail;static se_err_ddebusy;static se_err_noassoc;static see_mask_default;static see_mask_classname; + static see_mask_classkey;static see_mask_idlist;static see_mask_invokeidlist;static see_mask_icon;static see_mask_hotkey; + static see_mask_nocloseprocess;static see_mask_connectnetdrv;static see_mask_noasync;static see_mask_flag_ddewait;static see_mask_doenvsubst; + static see_mask_flag_no_ui;static see_mask_unicode;static see_mask_no_console;static see_mask_asyncok;static see_mask_hmonitor; + static see_mask_nozonechecks;static see_mask_noqueryclassstore;static see_mask_waitforinputidle;static see_mask_flag_log_usage;static see_mask_flag_hinst_is_site; + static dummyunionname;static dummyunionname2;static dummyunionname3;static dummyunionname4;static dummyunionname5; + static sherb_noconfirmation;static sherb_noprogressui;static sherb_nosound;static nin_select;static ninf_key; + static nin_keyselect;static nin_balloonshow;static nin_balloonhide;static nin_balloontimeout;static nin_balloonuserclick; + static nin_popupopen;static nin_popupclose;static nim_add;static nim_modify;static nim_delete; + static nim_setfocus;static nim_setversion;static notifyicon_version;static notifyicon_version_4;static nif_message; + static nif_icon;static nif_tip;static nif_state;static nif_info;static nif_guid; + static nif_realtime;static nif_showtip;static nis_hidden;static nis_sharedicon;static niif_none; + static niif_info;static niif_warning;static niif_error;static niif_user;static niif_icon_mask; + static niif_nosound;static niif_large_icon;static niif_respect_quiet_time;static shgfi_icon;static shgfi_displayname; + static shgfi_typename;static shgfi_attributes;static shgfi_iconlocation;static shgfi_exetype;static shgfi_sysiconindex; + static shgfi_linkoverlay;static shgfi_selected;static shgfi_attr_specified;static shgfi_largeicon;static shgfi_smallicon; + static shgfi_openicon;static shgfi_shelliconsize;static shgfi_pidl;static shgfi_usefileattributes;static shgfi_addoverlays; + static shgfi_overlayindex;static shgsi_icon;static shgsi_sysiconindex;static shgsi_linkoverlay;static shgsi_selected; + static shgsi_largeicon;static shgsi_smallicon;static shgsi_shelliconsize;static siid_invalid;static shgnli_pidl; + static shgnli_prefixname;static shgnli_nounique;static shgnli_nolnk;static shgnli_nolocname;static shgnli_useurlext; + static printaction_open;static printaction_properties;static printaction_netinstall;static printaction_netinstalllink;static printaction_testpage; + static printaction_opennetprn;static printaction_documentdefaults;static printaction_serverproperties;static print_prop_force_name;static offline_status_local; + static offline_status_remote;static offline_status_incomplete;static shil_large;static shil_small;static shil_extralarge; + static shil_syssmall;static shil_jumbo;static shil_last;static wc_netaddress;static ncm_getaddress; + static ncm_setallowtype;static ncm_getallowtype;static ncm_displayerrortip; + class function sinit() + begin + abm_new := 0; + abm_remove := 1;abm_querypos := 2;abm_setpos := 3;abm_getstate := 4;abm_gettaskbarpos := 5; + abm_activate := 6;abm_getautohidebar := 7;abm_setautohidebar := 8;abm_windowposchanged := 9;abm_setstate := 10; + abm_getautohidebarex := 11;abm_setautohidebarex := 12;abn_statechange := 0;abn_poschanged := 1;abn_fullscreenapp := 2; + abn_windowarrange := 3;abs_autohide := 1;abs_alwaysontop := 2;abe_left := 0;abe_top := 1; + abe_right := 2;abe_bottom := 3;fo_move := 1;fo_copy := 2;fo_delete := 3; + fo_rename := 4;fof_multidestfiles := 1;fof_confirmmouse := 2;fof_silent := 4;fof_renameoncollision := 8; + fof_noconfirmation := 16;fof_wantmappinghandle := 32;fof_allowundo := 64;fof_filesonly := 128;fof_simpleprogress := 256; + fof_noconfirmmkdir := 512;fof_noerrorui := 1024;fof_nocopysecurityattribs := 2048;fof_norecursion := 4096;fof_no_connected_elements := 8192; + fof_wantnukewarning := 16384;fof_norecursereparse := 32768;fof_no_ui := 1556;po_delete := 19;po_rename := 20; + po_portchange := 32;po_ren_port := 52;se_err_fnf := 2;se_err_pnf := 3;se_err_accessdenied := 5; + se_err_oom := 8;se_err_dllnotfound := 32;se_err_share := 26;se_err_associncomplete := 27;se_err_ddetimeout := 28; + se_err_ddefail := 29;se_err_ddebusy := 30;se_err_noassoc := 31;see_mask_default := 0;see_mask_classname := 1; + see_mask_classkey := 3;see_mask_idlist := 4;see_mask_invokeidlist := 12;see_mask_icon := 16;see_mask_hotkey := 32; + see_mask_nocloseprocess := 64;see_mask_connectnetdrv := 128;see_mask_noasync := 256;see_mask_flag_ddewait := 256;see_mask_doenvsubst := 512; + see_mask_flag_no_ui := 1024;see_mask_unicode := 16384;see_mask_no_console := 32768;see_mask_asyncok := 1048576;see_mask_hmonitor := 2097152; + see_mask_nozonechecks := 8388608;see_mask_noqueryclassstore := 16777216;see_mask_waitforinputidle := 33554432;see_mask_flag_log_usage := 67108864;see_mask_flag_hinst_is_site := 134217728; + dummyunionname := 0;dummyunionname2 := 0;dummyunionname3 := 0;dummyunionname4 := 0;dummyunionname5 := 0; + sherb_noconfirmation := 1;sherb_noprogressui := 2;sherb_nosound := 4;nin_select := 1024;ninf_key := 1; + nin_keyselect := 1025;nin_balloonshow := 1026;nin_balloonhide := 1027;nin_balloontimeout := 1028;nin_balloonuserclick := 1029; + nin_popupopen := 1030;nin_popupclose := 1031;nim_add := 0;nim_modify := 1;nim_delete := 2; + nim_setfocus := 3;nim_setversion := 4;notifyicon_version := 3;notifyicon_version_4 := 4;nif_message := 1; + nif_icon := 2;nif_tip := 4;nif_state := 8;nif_info := 16;nif_guid := 32; + nif_realtime := 64;nif_showtip := 128;nis_hidden := 1;nis_sharedicon := 2;niif_none := 0; + niif_info := 1;niif_warning := 2;niif_error := 3;niif_user := 4;niif_icon_mask := 15; + niif_nosound := 16;niif_large_icon := 32;niif_respect_quiet_time := 128;shgfi_icon := 256;shgfi_displayname := 512; + shgfi_typename := 1024;shgfi_attributes := 2048;shgfi_iconlocation := 4096;shgfi_exetype := 8192;shgfi_sysiconindex := 16384; + shgfi_linkoverlay := 32768;shgfi_selected := 65536;shgfi_attr_specified := 131072;shgfi_largeicon := 0;shgfi_smallicon := 1; + shgfi_openicon := 2;shgfi_shelliconsize := 4;shgfi_pidl := 8;shgfi_usefileattributes := 16;shgfi_addoverlays := 32; + shgfi_overlayindex := 64;shgsi_icon := 256;shgsi_sysiconindex := 16384;shgsi_linkoverlay := 32768;shgsi_selected := 65536; + shgsi_largeicon := 0;shgsi_smallicon := 1;shgsi_shelliconsize := 4;siid_invalid := NIL;shgnli_pidl := 1; + shgnli_prefixname := 2;shgnli_nounique := 4;shgnli_nolnk := 8;shgnli_nolocname := 16;shgnli_useurlext := 32; + printaction_open := 0;printaction_properties := 1;printaction_netinstall := 2;printaction_netinstalllink := 3;printaction_testpage := 4; + printaction_opennetprn := 5;printaction_documentdefaults := 6;printaction_serverproperties := 7;print_prop_force_name := 1;offline_status_local := 1; + offline_status_remote := 2;offline_status_incomplete := 4;shil_large := 0;shil_small := 1;shil_extralarge := 2; + shil_syssmall := 3;shil_jumbo := 4;shil_last := 4;wc_netaddress := "msctls_netaddress";ncm_getaddress := 1025; + ncm_setallowtype := 1026;ncm_getallowtype := 1027;ncm_displayerrortip := 1028; + end +end +type ws2def_h=class() + static AF_UNSPEC;static AF_UNIX;static AF_INET; + static AF_IMPLINK;static AF_PUP;static AF_CHAOS; + static AF_NS;static AF_IPX;static AF_ISO; + static AF_OSI;static AF_ECMA;static AF_DATAKIT; + static AF_CCITT;static AF_SNA;static AF_DECNET; + static AF_DLI;static AF_LAT;static AF_HYLINK; + static AF_APPLETALK;static AF_NETBIOS;static AF_VOICEVIEW; + static AF_FIREFOX;static AF_UNKNOWN1;static AF_BAN; + static AF_ATM;static AF_INET6;static AF_CLUSTER; + static AF_12844;static AF_IRDA;static AF_NETDES; + static AF_TCNPROCESS;static AF_TCNMESSAGE;static AF_ICLFXBM; + static AF_BTH;static AF_LINK;static AF_MAX; + static SOCK_STREAM;static SOCK_DGRAM;static SOCK_RAW; + static SOCK_RDM;static SOCK_SEQPACKET;static SOL_SOCKET; + static SO_DEBUG;static SO_ACCEPTCONN;static SO_REUSEADDR; + static SO_KEEPALIVE;static SO_DONTROUTE;static SO_BROADCAST; + static SO_USELOOPBACK;static SO_LINGER;static SO_OOBINLINE; + static SO_DONTLINGER;static SO_EXCLUSIVEADDRUSE;static SO_SNDBUF; + static SO_RCVBUF;static SO_SNDLOWAT;static SO_RCVLOWAT; + static SO_SNDTIMEO;static SO_RCVTIMEO;static SO_ERROR; + static SO_TYPE;static SO_BSP_STATE;static SO_GROUP_ID; + static SO_GROUP_PRIORITY;static SO_MAX_MSG_SIZE;static SO_CONDITIONAL_ACCEPT; + static SO_PAUSE_ACCEPT;static SO_COMPARTMENT_ID;static SO_RANDOMIZE_PORT; + static SO_PORT_SCALABILITY;static WSK_SO_BASE;static TCP_NODELAY; + static _SS_MAXSIZE;static IOC_UNIX;static IOC_WS2; + static IOC_PROTOCOL;static IOC_VENDOR;static IOC_WSK; + static IPPROTO_IP;static IPPORT_TCPMUX;static IPPORT_ECHO; + static IPPORT_DISCARD;static IPPORT_SYSTAT;static IPPORT_DAYTIME; + static IPPORT_NETSTAT;static IPPORT_QOTD;static IPPORT_MSP; + static IPPORT_CHARGEN;static IPPORT_FTP_DATA;static IPPORT_FTP; + static IPPORT_TELNET;static IPPORT_SMTP;static IPPORT_TIMESERVER; + static IPPORT_NAMESERVER;static IPPORT_WHOIS;static IPPORT_MTP; + static IPPORT_TFTP;static IPPORT_RJE;static IPPORT_FINGER; + static IPPORT_TTYLINK;static IPPORT_SUPDUP;static IPPORT_POP3; + static IPPORT_NTP;static IPPORT_EPMAP;static IPPORT_NETBIOS_NS; + static IPPORT_NETBIOS_DGM;static IPPORT_NETBIOS_SSN;static IPPORT_IMAP; + static IPPORT_SNMP;static IPPORT_SNMP_TRAP;static IPPORT_IMAP3; + static IPPORT_LDAP;static IPPORT_HTTPS;static IPPORT_MICROSOFT_DS; + static IPPORT_EXECSERVER;static IPPORT_LOGINSERVER;static IPPORT_CMDSERVER; + static IPPORT_EFSSERVER;static IPPORT_BIFFUDP;static IPPORT_WHOSERVER; + static IPPORT_ROUTESERVER;static IPPORT_RESERVED;static IPPORT_REGISTERED_MIN; + static IPPORT_REGISTERED_MAX;static IPPORT_DYNAMIC_MIN;static IPPORT_DYNAMIC_MAX; + static IN_CLASSA_NET;static IN_CLASSA_NSHIFT;static IN_CLASSA_HOST; + static IN_CLASSA_MAX;static IN_CLASSB_NET;static IN_CLASSB_NSHIFT; + static IN_CLASSB_HOST;static IN_CLASSB_MAX;static IN_CLASSC_NET; + static IN_CLASSC_NSHIFT;static IN_CLASSC_HOST;static IN_CLASSD_NET; + static IN_CLASSD_NSHIFT;static IN_CLASSD_HOST;static INADDR_ANY; + static INADDR_LOOPBACK;static INADDR_BROADCAST;static INADDR_NONE; + static SCOPEID_UNSPECIFIED_INIT;static IOCPARM_MASK;static IOC_VOID; + static IOC_OUT;static IOC_IN;static IOC_INOUT; + static _WSACMSGHDR;static CMSGHDR_ALIGN;static CMSGDATA_ALIGN; + static CMSG_FIRSTHDR;static CMSG_NXTHDR;static CMSG_SPACE; + static CMSG_LEN;static MSG_TRUNC;static MSG_CTRUNC; + static MSG_BCAST;static MSG_MCAST;static AI_PASSIVE; + static AI_CANONNAME;static AI_NUMERICHOST;static AI_NUMERICSERV; + static AI_ALL;static AI_ADDRCONFIG;static AI_V4MAPPED; + static AI_NON_AUTHORITATIVE;static AI_SECURE;static AI_RETURN_PREFERRED_NAMES; + static AI_FQDN;static AI_FILESERVER;static AI_DISABLE_IDN_ENCODING; + static AI_EXTENDED;static ADDRINFOEX_VERSION_2;static ADDRINFOEX_VERSION_3; + static NS_ALL;static NS_SAP;static NS_NDS; + static NS_PEER_BROWSE;static NS_SLP;static NS_DHCP; + static NS_TCPIP_LOCAL;static NS_TCPIP_HOSTS;static NS_DNS; + static NS_NETBT;static NS_WINS;static NS_NLA; + static NS_BTH;static NS_NBP;static NS_MS; + static NS_STDA;static NS_NTDS;static NS_EMAIL; + static NS_PNRPNAME;static NS_PNRPCLOUD;static NS_X500; + static NS_NIS;static NS_NISPLUS;static NS_WRQ; + static NS_NETDES;static NI_NOFQDN;static NI_NUMERICHOST; + static NI_NAMEREQD;static NI_NUMERICSERV;static NI_DGRAM; + static NI_MAXHOST;static NI_MAXSERV;static IPPROTO_HOPOPTS; + static IPPROTO_ICMP;static IPPROTO_IGMP;static IPPROTO_GGP; + static IPPROTO_IPV4;static IPPROTO_ST;static IPPROTO_TCP; + static IPPROTO_CBT;static IPPROTO_EGP;static IPPROTO_IGP; + static IPPROTO_PUP;static IPPROTO_UDP;static IPPROTO_IDP; + static IPPROTO_RDP;static IPPROTO_IPV6;static IPPROTO_ROUTING; + static IPPROTO_FRAGMENT;static IPPROTO_ESP;static IPPROTO_AH; + static IPPROTO_ICMPV6;static IPPROTO_NONE;static IPPROTO_DSTOPTS; + static IPPROTO_ND;static IPPROTO_ICLFXBM;static IPPROTO_PIM; + static IPPROTO_PGM;static IPPROTO_L2TP;static IPPROTO_SCTP; + static IPPROTO_RAW;static IPPROTO_MAX;static IPPROTO_RESERVED_RAW; + static IPPROTO_RESERVED_IPSEC;static IPPROTO_RESERVED_IPSECOFFLOAD;static IPPROTO_RESERVED_WNV; + static IPPROTO_RESERVED_MAX; + + class function sinit(); + begin + + AF_UNSPEC := 0x0;AF_UNIX := 0x1;AF_INET := 0x2; + AF_IMPLINK := 0x3;AF_PUP := 0x4;AF_CHAOS := 0x5; + AF_NS := 0x6;AF_IPX := 0x6;AF_ISO := 0x7; + AF_OSI := 0x7;AF_ECMA := 0x8;AF_DATAKIT := 0x9; + AF_CCITT := 0xA;AF_SNA := 0xB;AF_DECNET := 0xC; + AF_DLI := 0xD;AF_LAT := 0xE;AF_HYLINK := 0xF; + AF_APPLETALK := 0x10;AF_NETBIOS := 0x11;AF_VOICEVIEW := 0x12; + AF_FIREFOX := 0x13;AF_UNKNOWN1 := 0x14;AF_BAN := 0x15; + AF_ATM := 0x16;AF_INET6 := 0x17;AF_CLUSTER := 0x18; + AF_12844 := 0x19;AF_IRDA := 0x1A;AF_NETDES := 0x1C; + AF_TCNPROCESS := 0x1D;AF_TCNMESSAGE := 0x1E;AF_ICLFXBM := 0x1F; + AF_BTH := 0x20;AF_LINK := 0x21;AF_MAX := 0x22; + SOCK_STREAM := 0x1;SOCK_DGRAM := 0x2;SOCK_RAW := 0x3; + SOCK_RDM := 0x4;SOCK_SEQPACKET := 0x5;SOL_SOCKET := 0xFFFF; + SO_DEBUG := 0x1;SO_ACCEPTCONN := 0x2;SO_REUSEADDR := 0x4; + SO_KEEPALIVE := 0x8;SO_DONTROUTE := 0x10;SO_BROADCAST := 0x20; + SO_USELOOPBACK := 0x40;SO_LINGER := 0x80;SO_OOBINLINE := 0x100; + SO_DONTLINGER := 0xFFFFFF7F;SO_EXCLUSIVEADDRUSE := 0xFFFFFFFB;SO_SNDBUF := 0x1001; + SO_RCVBUF := 0x1002;SO_SNDLOWAT := 0x1003;SO_RCVLOWAT := 0x1004; + SO_SNDTIMEO := 0x1005;SO_RCVTIMEO := 0x1006;SO_ERROR := 0x1007; + SO_TYPE := 0x1008;SO_BSP_STATE := 0x1009;SO_GROUP_ID := 0x2001; + SO_GROUP_PRIORITY := 0x2002;SO_MAX_MSG_SIZE := 0x2003;SO_CONDITIONAL_ACCEPT := 0x3002; + SO_PAUSE_ACCEPT := 0x3003;SO_COMPARTMENT_ID := 0x3004;SO_RANDOMIZE_PORT := 0x3005; + SO_PORT_SCALABILITY := 0x3006;WSK_SO_BASE := 0x4000;TCP_NODELAY := 0x1; + _SS_MAXSIZE := 0x80;IOC_UNIX := 0x0;IOC_WS2 := 0x8000000; + IOC_PROTOCOL := 0x10000000;IOC_VENDOR := 0x18000000;IOC_WSK := 0xF000000; + IPPROTO_IP := 0x0;IPPORT_TCPMUX := 0x1;IPPORT_ECHO := 0x7; + IPPORT_DISCARD := 0x9;IPPORT_SYSTAT := 0xB;IPPORT_DAYTIME := 0xD; + IPPORT_NETSTAT := 0xF;IPPORT_QOTD := 0x11;IPPORT_MSP := 0x12; + IPPORT_CHARGEN := 0x13;IPPORT_FTP_DATA := 0x14;IPPORT_FTP := 0x15; + IPPORT_TELNET := 0x17;IPPORT_SMTP := 0x19;IPPORT_TIMESERVER := 0x25; + IPPORT_NAMESERVER := 0x2A;IPPORT_WHOIS := 0x2B;IPPORT_MTP := 0x39; + IPPORT_TFTP := 0x45;IPPORT_RJE := 0x4D;IPPORT_FINGER := 0x4F; + IPPORT_TTYLINK := 0x57;IPPORT_SUPDUP := 0x5F;IPPORT_POP3 := 0x6E; + IPPORT_NTP := 0x7B;IPPORT_EPMAP := 0x87;IPPORT_NETBIOS_NS := 0x89; + IPPORT_NETBIOS_DGM := 0x8A;IPPORT_NETBIOS_SSN := 0x8B;IPPORT_IMAP := 0x8F; + IPPORT_SNMP := 0xA1;IPPORT_SNMP_TRAP := 0xA2;IPPORT_IMAP3 := 0xDC; + IPPORT_LDAP := 0x185;IPPORT_HTTPS := 0x1BB;IPPORT_MICROSOFT_DS := 0x1BD; + IPPORT_EXECSERVER := 0x200;IPPORT_LOGINSERVER := 0x201;IPPORT_CMDSERVER := 0x202; + IPPORT_EFSSERVER := 0x208;IPPORT_BIFFUDP := 0x200;IPPORT_WHOSERVER := 0x201; + IPPORT_ROUTESERVER := 0x208;IPPORT_RESERVED := 0x400;IPPORT_REGISTERED_MIN := 0x400; + IPPORT_REGISTERED_MAX := 0xBFFF;IPPORT_DYNAMIC_MIN := 0xC000;IPPORT_DYNAMIC_MAX := 0xFFFF; + IN_CLASSA_NET := 0xFF000000;IN_CLASSA_NSHIFT := 0x18;IN_CLASSA_HOST := 0xFFFFFF; + IN_CLASSA_MAX := 0x80;IN_CLASSB_NET := 0xFFFF0000;IN_CLASSB_NSHIFT := 0x10; + IN_CLASSB_HOST := 0xFFFF;IN_CLASSB_MAX := 0x10000;IN_CLASSC_NET := 0xFFFFFF00; + IN_CLASSC_NSHIFT := 0x8;IN_CLASSC_HOST := 0xFF;IN_CLASSD_NET := 0xF0000000; + IN_CLASSD_NSHIFT := 0x1C;IN_CLASSD_HOST := 0xFFFFFFF;INADDR_ANY := 0x0; + INADDR_LOOPBACK := 0x7F000001;INADDR_BROADCAST := 0xFFFFFFFF;INADDR_NONE := 0xFFFFFFFF; + SCOPEID_UNSPECIFIED_INIT := 0x0;IOCPARM_MASK := 0x7F;IOC_VOID := 0x20000000; + IOC_OUT := 0x40000000;IOC_IN := 0x80000000;IOC_INOUT := 0xC0000000; + _WSACMSGHDR := 0x0;CMSGHDR_ALIGN := 0x0;CMSGDATA_ALIGN := 0x0; + CMSG_FIRSTHDR := 0x0;CMSG_NXTHDR := 0x0;CMSG_SPACE := 0x0; + CMSG_LEN := 0x0;MSG_TRUNC := 0x100;MSG_CTRUNC := 0x200; + MSG_BCAST := 0x400;MSG_MCAST := 0x800;AI_PASSIVE := 0x1; + AI_CANONNAME := 0x2;AI_NUMERICHOST := 0x4;AI_NUMERICSERV := 0x8; + AI_ALL := 0x100;AI_ADDRCONFIG := 0x400;AI_V4MAPPED := 0x800; + AI_NON_AUTHORITATIVE := 0x4000;AI_SECURE := 0x8000;AI_RETURN_PREFERRED_NAMES := 0x10000; + AI_FQDN := 0x20000;AI_FILESERVER := 0x40000;AI_DISABLE_IDN_ENCODING := 0x80000; + AI_EXTENDED := 0x80000000;ADDRINFOEX_VERSION_2 := 0x2;ADDRINFOEX_VERSION_3 := 0x3; + NS_ALL := 0x0;NS_SAP := 0x1;NS_NDS := 0x2; + NS_PEER_BROWSE := 0x3;NS_SLP := 0x5;NS_DHCP := 0x6; + NS_TCPIP_LOCAL := 0xA;NS_TCPIP_HOSTS := 0xB;NS_DNS := 0xC; + NS_NETBT := 0xD;NS_WINS := 0xE;NS_NLA := 0xF; + NS_BTH := 0x10;NS_NBP := 0x14;NS_MS := 0x1E; + NS_STDA := 0x1F;NS_NTDS := 0x20;NS_EMAIL := 0x25; + NS_PNRPNAME := 0x26;NS_PNRPCLOUD := 0x27;NS_X500 := 0x28; + NS_NIS := 0x29;NS_NISPLUS := 0x2A;NS_WRQ := 0x32; + NS_NETDES := 0x3C;NI_NOFQDN := 0x1;NI_NUMERICHOST := 0x2; + NI_NAMEREQD := 0x4;NI_NUMERICSERV := 0x8;NI_DGRAM := 0x10; + NI_MAXHOST := 0x401;NI_MAXSERV := 0x20;IPPROTO_HOPOPTS := 0x0; + IPPROTO_ICMP := 0x1;IPPROTO_IGMP := 0x2;IPPROTO_GGP := 0x3; + IPPROTO_IPV4 := 0x4;IPPROTO_ST := 0x5;IPPROTO_TCP := 0x6; + IPPROTO_CBT := 0x7;IPPROTO_EGP := 0x8;IPPROTO_IGP := 0x9; + IPPROTO_PUP := 0xC;IPPROTO_UDP := 0x11;IPPROTO_IDP := 0x16; + IPPROTO_RDP := 0x1B;IPPROTO_IPV6 := 0x29;IPPROTO_ROUTING := 0x2B; + IPPROTO_FRAGMENT := 0x2C;IPPROTO_ESP := 0x32;IPPROTO_AH := 0x33; + IPPROTO_ICMPV6 := 0x3A;IPPROTO_NONE := 0x3B;IPPROTO_DSTOPTS := 0x3C; + IPPROTO_ND := 0x4D;IPPROTO_ICLFXBM := 0x4E;IPPROTO_PIM := 0x67; + IPPROTO_PGM := 0x71;IPPROTO_L2TP := 0x73;IPPROTO_SCTP := 0x84; + IPPROTO_RAW := 0xFF;IPPROTO_MAX := 0x100;IPPROTO_RESERVED_RAW := 0x101; + IPPROTO_RESERVED_IPSEC := 0x102;IPPROTO_RESERVED_IPSECOFFLOAD := 0x103;IPPROTO_RESERVED_WNV := 0x104; + IPPROTO_RESERVED_MAX := 0x105; + end +end + +type _socketdef_=class(ws2def_h ) + static _WINSOCKAPI_;static INCL_WINSOCK_API_PROTOTYPES;static INCL_WINSOCK_API_TYPEDEFS; + static WINSOCK_API_LINKAGE;static FD_SETSIZE;static IOCPARM_MASK; + static IOC_VOID;static IOC_OUT;static IOC_IN; + static IOC_INOUT;static H_ADDR;static IPPORT_ECHO; + static IPPORT_DISCARD;static IPPORT_SYSTAT;static IPPORT_DAYTIME; + static IPPORT_NETSTAT;static IPPORT_FTP;static IPPORT_TELNET; + static IPPORT_SMTP;static IPPORT_TIMESERVER;static IPPORT_NAMESERVER; + static IPPORT_WHOIS;static IPPORT_MTP;static IPPORT_TFTP; + static IPPORT_RJE;static IPPORT_FINGER;static IPPORT_TTYLINK; + static IPPORT_SUPDUP;static IPPORT_EXECSERVER;static IPPORT_LOGINSERVER; + static IPPORT_CMDSERVER;static IPPORT_EFSSERVER;static IPPORT_BIFFUDP; + static IPPORT_WHOSERVER;static IPPORT_ROUTESERVER;static IPPORT_RESERVED; + static IMPLINK_IP;static IMPLINK_LOWEXPER;static IMPLINK_HIGHEXPER; + static ADDR_ANY;static WSADESCRIPTION_LEN;static WSASYS_STATUS_LEN; + static INVALID_SOCKET;static SOCKET_ERROR;static FROM_PROTOCOL_INFO; + static SOCK_STREAM;static SOCK_DGRAM;static SOCK_RAW; + static SOCK_RDM;static SOCK_SEQPACKET;static SO_DEBUG; + static SO_ACCEPTCONN;static SO_REUSEADDR;static SO_KEEPALIVE; + static SO_DONTROUTE;static SO_BROADCAST;static SO_USELOOPBACK; + static SO_LINGER;static SO_OOBINLINE;static SO_DONTLINGER; + static SO_EXCLUSIVEADDRUSE;static SO_SNDBUF;static SO_RCVBUF; + static SO_SNDLOWAT;static SO_RCVLOWAT;static SO_SNDTIMEO; + static SO_RCVTIMEO;static SO_ERROR;static SO_TYPE; + static SO_GROUP_ID;static SO_GROUP_PRIORITY;static SO_MAX_MSG_SIZE; + static SO_PROTOCOL_INFOA;static SO_PROTOCOL_INFOW;static PVD_CONFIG; + static SO_CONDITIONAL_ACCEPT;static PF_UNSPEC;static PF_UNIX; + static PF_INET;static PF_IMPLINK;static PF_PUP; + static PF_CHAOS;static PF_NS;static PF_IPX; + static PF_ISO;static PF_OSI;static PF_ECMA; + static PF_DATAKIT;static PF_CCITT;static PF_SNA; + static PF_DECNET;static PF_DLI;static PF_LAT; + static PF_HYLINK;static PF_APPLETALK;static PF_VOICEVIEW; + static PF_FIREFOX;static PF_UNKNOWN1;static PF_BAN; + static PF_ATM;static PF_INET6;static PF_BTH; + static PF_MAX;static SOL_SOCKET;static SOMAXCONN; + static MSG_OOB;static MSG_PEEK;static MSG_DONTROUTE; + static MSG_WAITALL;static MSG_PUSH_IMMEDIATE;static MSG_PARTIAL; + static MSG_INTERRUPT;static MSG_MAXIOVLEN;static MAXGETHOSTSTRUCT; + static FIONBIO;static FIONREAD;static FIOASYNC; + static FD_READ_BIT;static FD_READ;static FD_WRITE_BIT; + static FD_WRITE;static FD_OOB_BIT;static FD_OOB; + static FD_ACCEPT_BIT;static FD_ACCEPT;static FD_CONNECT_BIT; + static FD_CONNECT;static FD_CLOSE_BIT;static FD_CLOSE; + static FD_QOS_BIT;static FD_QOS;static FD_GROUP_QOS_BIT; + static FD_GROUP_QOS;static FD_ROUTING_INTERFACE_CHANGE_BIT;static FD_ROUTING_INTERFACE_CHANGE; + static FD_ADDRESS_LIST_CHANGE_BIT;static FD_ADDRESS_LIST_CHANGE;static FD_MAX_EVENTS; + static FD_ALL_EVENTS;static WSABASEERR;static WSAEINTR; + static WSAEBADF;static WSAEACCES;static WSAEFAULT; + static WSAEINVAL;static WSAEMFILE;static WSAEWOULDBLOCK; + static WSAEINPROGRESS;static WSAEALREADY;static WSAENOTSOCK; + static WSAEDESTADDRREQ;static WSAEMSGSIZE;static WSAEPROTOTYPE; + static WSAENOPROTOOPT;static WSAEPROTONOSUPPORT;static WSAESOCKTNOSUPPORT; + static WSAEOPNOTSUPP;static WSAEPFNOSUPPORT;static WSAEAFNOSUPPORT; + static WSAEADDRINUSE;static WSAEADDRNOTAVAIL;static WSAENETDOWN; + static WSAENETUNREACH;static WSAENETRESET;static WSAECONNABORTED; + static WSAECONNRESET;static WSAENOBUFS;static WSAEISCONN; + static WSAENOTCONN;static WSAESHUTDOWN;static WSAETOOMANYREFS; + static WSAETIMEDOUT;static WSAECONNREFUSED;static WSAELOOP; + static WSAENAMETOOLONG;static WSAEHOSTDOWN;static WSAEHOSTUNREACH; + static WSAENOTEMPTY;static WSAEPROCLIM;static WSAEUSERS; + static WSAEDQUOT;static WSAESTALE;static WSAEREMOTE; + static WSASYSNOTREADY;static WSAVERNOTSUPPORTED;static WSANOTINITIALISED; + static WSAEDISCON;static WSAENOMORE;static WSAECANCELLED; + static WSAEINVALIDPROCTABLE;static WSAEINVALIDPROVIDER;static WSAEPROVIDERFAILEDINIT; + static WSASYSCALLFAILURE;static WSASERVICE_NOT_FOUND;static WSATYPE_NOT_FOUND; + static WSA_E_NO_MORE;static WSA_E_CANCELLED;static WSAEREFUSED; + static WSAHOST_NOT_FOUND;static WSATRY_AGAIN;static WSANO_RECOVERY; + static WSANO_DATA;static WSA_QOS_RECEIVERS;static WSA_QOS_SENDERS; + static WSA_QOS_NO_SENDERS;static WSA_QOS_NO_RECEIVERS;static WSA_QOS_REQUEST_CONFIRMED; + static WSA_QOS_ADMISSION_FAILURE;static WSA_QOS_POLICY_FAILURE;static WSA_QOS_BAD_STYLE; + static WSA_QOS_BAD_OBJECT;static WSA_QOS_TRAFFIC_CTRL_ERROR;static WSA_QOS_GENERIC_ERROR; + static WSA_QOS_ESERVICETYPE;static WSA_QOS_EFLOWSPEC;static WSA_QOS_EPROVSPECBUF; + static WSA_QOS_EFILTERSTYLE;static WSA_QOS_EFILTERTYPE;static WSA_QOS_EFILTERCOUNT; + static WSA_QOS_EOBJLENGTH;static WSA_QOS_EFLOWCOUNT;static WSA_QOS_EUNKOWNPSOBJ; + static WSA_QOS_EPOLICYOBJ;static WSA_QOS_EFLOWDESC;static WSA_QOS_EPSFLOWSPEC; + static WSA_QOS_EPSFILTERSPEC;static WSA_QOS_ESDMODEOBJ;static WSA_QOS_ESHAPERATEOBJ; + static WSA_QOS_RESERVED_PETYPE;static HOST_NOT_FOUND;static TRY_AGAIN; + static NO_RECOVERY;static NO_DATA;static WSANO_ADDRESS; + static NO_ADDRESS;static EWOULDBLOCK;static EINPROGRESS; + static EALREADY;static ENOTSOCK;static EDESTADDRREQ; + static EMSGSIZE;static EPROTOTYPE;static ENOPROTOOPT; + static EPROTONOSUPPORT;static ESOCKTNOSUPPORT;static EOPNOTSUPP; + static EPFNOSUPPORT;static EAFNOSUPPORT;static EADDRINUSE; + static EADDRNOTAVAIL;static ENETDOWN;static ENETUNREACH; + static ENETRESET;static ECONNABORTED;static ECONNRESET; + static ENOBUFS;static EISCONN;static ENOTCONN; + static ESHUTDOWN;static ETOOMANYREFS;static ETIMEDOUT; + static ECONNREFUSED;static ELOOP;static ENAMETOOLONG; + static EHOSTDOWN;static EHOSTUNREACH;static ENOTEMPTY; + static EPROCLIM;static EUSERS;static EDQUOT; + static ESTALE;static EREMOTE;static WSAAPI; + static WSAEVENT;static LPWSAEVENT;static WSAOVERLAPPED; + static WSA_IO_PENDING;static WSA_IO_INCOMPLETE;static WSA_INVALID_HANDLE; + static WSA_INVALID_PARAMETER;static WSA_NOT_ENOUGH_MEMORY;static WSA_OPERATION_ABORTED; + static WSA_INVALID_EVENT;static WSA_MAXIMUM_WAIT_EVENTS;static WSA_WAIT_FAILED; + static WSA_WAIT_EVENT_0;static WSA_WAIT_IO_COMPLETION;static WSA_WAIT_TIMEOUT; + static WSA_INFINITE;static LPQOS;static CF_ACCEPT; + static CF_REJECT;static CF_DEFER;static SD_RECEIVE; + static SD_SEND;static SD_BOTH;static SG_UNCONSTRAINED_GROUP; + static SG_CONSTRAINED_GROUP;static MAX_PROTOCOL_CHAIN;static BASE_PROTOCOL; + static LAYERED_PROTOCOL;static WSAPROTOCOL_LEN;static PFL_MULTIPLE_PROTO_ENTRIES; + static PFL_RECOMMENDED_PROTO_ENTRY;static PFL_HIDDEN;static PFL_MATCHES_PROTOCOL_ZERO; + static PFL_NETWORKDIRECT_PROVIDER;static XP1_CONNECTIONLESS;static XP1_GUARANTEED_DELIVERY; + static XP1_GUARANTEED_ORDER;static XP1_MESSAGE_ORIENTED;static XP1_PSEUDO_STREAM; + static XP1_GRACEFUL_CLOSE;static XP1_EXPEDITED_DATA;static XP1_CONNECT_DATA; + static XP1_DISCONNECT_DATA;static XP1_SUPPORT_BROADCAST;static XP1_SUPPORT_MULTIPOINT; + static XP1_MULTIPOINT_CONTROL_PLANE;static XP1_MULTIPOINT_DATA_PLANE;static XP1_QOS_SUPPORTED; + static XP1_INTERRUPT;static XP1_UNI_SEND;static XP1_UNI_RECV; + static XP1_IFS_HANDLES;static XP1_PARTIAL_MESSAGE;static XP1_SAN_SUPPORT_SDP; + static BIGENDIAN;static LITTLEENDIAN;static SECURITY_PROTOCOL_NONE; + static JL_SENDER_ONLY;static JL_RECEIVER_ONLY;static JL_BOTH; + static WSA_FLAG_OVERLAPPED;static WSA_FLAG_MULTIPOINT_C_ROOT;static WSA_FLAG_MULTIPOINT_C_LEAF; + static WSA_FLAG_MULTIPOINT_D_ROOT;static WSA_FLAG_MULTIPOINT_D_LEAF;static WSA_FLAG_ACCESS_SYSTEM_SECURITY; + static WSA_FLAG_NO_HANDLE_INHERIT;static WSA_FLAG_REGISTERED_IO;static TH_NETDEV; + static TH_TAPI;static SERVICE_MULTIPLE;static NS_ALL; + static NS_SAP;static NS_NDS;static NS_PEER_BROWSE; + static NS_SLP;static NS_DHCP;static NS_TCPIP_LOCAL; + static NS_WINS;static NS_BTH;static NS_NBP; + static NS_MS;static NS_STDA;static NS_NTDS; + static NS_EMAIL;static NS_X500;static NS_NIS; + static NS_NISPLUS;static NS_WRQ;static NS_NETDES; + static NS_TCPIP_HOSTS;static NS_DNS;static NS_NETBT; + static NS_NLA;static NS_LOCALNAME;static NS_PNRPNAME; + static NS_PNRPCLOUD;static RES_UNUSED_1;static RES_FLUSH_CACHE; + static RES_SERVICE;static SERVICE_TYPE_VALUE_IPXPORTA;static SERVICE_TYPE_VALUE_IPXPORTW; + static SERVICE_TYPE_VALUE_SAPIDA;static SERVICE_TYPE_VALUE_SAPIDW;static SERVICE_TYPE_VALUE_TCPPORTA; + static SERVICE_TYPE_VALUE_TCPPORTW;static SERVICE_TYPE_VALUE_UDPPORTA;static SERVICE_TYPE_VALUE_UDPPORTW; + static SERVICE_TYPE_VALUE_OBJECTIDA;static SERVICE_TYPE_VALUE_OBJECTIDW;static LUP_DEEP; + static LUP_CONTAINERS;static LUP_NOCONTAINERS;static LUP_NEAREST; + static LUP_RETURN_NAME;static LUP_RETURN_TYPE;static LUP_RETURN_VERSION; + static LUP_RETURN_COMMENT;static LUP_RETURN_ADDR;static LUP_RETURN_BLOB; + static LUP_RETURN_ALIASES;static LUP_RETURN_QUERY_STRING;static LUP_RETURN_ALL; + static LUP_RES_SERVICE;static LUP_FLUSHCACHE;static LUP_FLUSHPREVIOUS; + static LUP_NON_AUTHORITATIVE;static LUP_SECURE;static LUP_RETURN_PREFERRED_NAMES; + static LUP_ADDRCONFIG;static LUP_DUAL_ADDR;static LUP_FILESERVER; + static LUP_DISABLE_IDN_ENCODING;static LUP_API_ANSI;static RESULT_IS_ALIAS; + static RESULT_IS_ADDED;static RESULT_IS_CHANGED;static RESULT_IS_DELETED; + static POLLRDNORM;static POLLRDBAND;static POLLIN; + static POLLPRI;static POLLWRNORM;static POLLOUT; + static POLLWRBAND;static POLLERR;static POLLHUP; + static POLLNVAL; + + class function sinit(); + begin + class(ws2def_h).sinit(); + _WINSOCKAPI_ := NIL;INCL_WINSOCK_API_PROTOTYPES := 0x1;INCL_WINSOCK_API_TYPEDEFS := 0x0; + WINSOCK_API_LINKAGE := 0x0;FD_SETSIZE := 0x40;IOCPARM_MASK := 0x7F; + IOC_VOID := 0x20000000;IOC_OUT := 0x40000000;IOC_IN := 0x80000000; + IOC_INOUT := 0xC0000000;H_ADDR := NIL;IPPORT_ECHO := 0x7; + IPPORT_DISCARD := 0x9;IPPORT_SYSTAT := 0xB;IPPORT_DAYTIME := 0xD; + IPPORT_NETSTAT := 0xF;IPPORT_FTP := 0x15;IPPORT_TELNET := 0x17; + IPPORT_SMTP := 0x19;IPPORT_TIMESERVER := 0x25;IPPORT_NAMESERVER := 0x2A; + IPPORT_WHOIS := 0x2B;IPPORT_MTP := 0x39;IPPORT_TFTP := 0x45; + IPPORT_RJE := 0x4D;IPPORT_FINGER := 0x4F;IPPORT_TTYLINK := 0x57; + IPPORT_SUPDUP := 0x5F;IPPORT_EXECSERVER := 0x200;IPPORT_LOGINSERVER := 0x201; + IPPORT_CMDSERVER := 0x202;IPPORT_EFSSERVER := 0x208;IPPORT_BIFFUDP := 0x200; + IPPORT_WHOSERVER := 0x201;IPPORT_ROUTESERVER := 0x208;IPPORT_RESERVED := 0x400; + IMPLINK_IP := 0x9B;IMPLINK_LOWEXPER := 0x9C;IMPLINK_HIGHEXPER := 0x9E; + ADDR_ANY := 0x0;WSADESCRIPTION_LEN := 0x100;WSASYS_STATUS_LEN := 0x80; + INVALID_SOCKET := 0xFFFFFFFF;SOCKET_ERROR := 0xFFFFFFFF;FROM_PROTOCOL_INFO := 0xFFFFFFFF; + SOCK_STREAM := 0x1;SOCK_DGRAM := 0x2;SOCK_RAW := 0x3; + SOCK_RDM := 0x4;SOCK_SEQPACKET := 0x5;SO_DEBUG := 0x1; + SO_ACCEPTCONN := 0x2;SO_REUSEADDR := 0x4;SO_KEEPALIVE := 0x8; + SO_DONTROUTE := 0x10;SO_BROADCAST := 0x20;SO_USELOOPBACK := 0x40; + SO_LINGER := 0x80;SO_OOBINLINE := 0x100;SO_DONTLINGER := 0xFFFFFF7F; + SO_EXCLUSIVEADDRUSE := 0xFFFFFFFB;SO_SNDBUF := 0x1001;SO_RCVBUF := 0x1002; + SO_SNDLOWAT := 0x1003;SO_RCVLOWAT := 0x1004;SO_SNDTIMEO := 0x1005; + SO_RCVTIMEO := 0x1006;SO_ERROR := 0x1007;SO_TYPE := 0x1008; + SO_GROUP_ID := 0x2001;SO_GROUP_PRIORITY := 0x2002;SO_MAX_MSG_SIZE := 0x2003; + SO_PROTOCOL_INFOA := 0x2004;SO_PROTOCOL_INFOW := 0x2005;PVD_CONFIG := 0x3001; + SO_CONDITIONAL_ACCEPT := 0x3002;PF_UNSPEC := 0x0;PF_UNIX := 0x1; + PF_INET := 0x2;PF_IMPLINK := 0x3;PF_PUP := 0x4; + PF_CHAOS := 0x5;PF_NS := 0x6;PF_IPX := 0x6; + PF_ISO := 0x7;PF_OSI := 0x7;PF_ECMA := 0x8; + PF_DATAKIT := 0x9;PF_CCITT := 0xA;PF_SNA := 0xB; + PF_DECNET := 0xC;PF_DLI := 0xD;PF_LAT := 0xE; + PF_HYLINK := 0xF;PF_APPLETALK := 0x10;PF_VOICEVIEW := 0x12; + PF_FIREFOX := 0x13;PF_UNKNOWN1 := 0x14;PF_BAN := 0x15; + PF_ATM := 0x16;PF_INET6 := 0x17;PF_BTH := 0x20; + PF_MAX := 0x22;SOL_SOCKET := 0xFFFF;SOMAXCONN := 0x7FFFFFFF; + MSG_OOB := 0x1;MSG_PEEK := 0x2;MSG_DONTROUTE := 0x4; + MSG_WAITALL := 0x8;MSG_PUSH_IMMEDIATE := 0x20;MSG_PARTIAL := 0x8000; + MSG_INTERRUPT := 0x10;MSG_MAXIOVLEN := 0x10;MAXGETHOSTSTRUCT := 0x400; + FIONBIO := 0x8004667E;FIONREAD := 0x4004667F;FIOASYNC := 0x8004667D; + FD_READ_BIT := 0x0;FD_READ := 0x1;FD_WRITE_BIT := 0x1; + FD_WRITE := 0x2;FD_OOB_BIT := 0x2;FD_OOB := 0x4; + FD_ACCEPT_BIT := 0x3;FD_ACCEPT := 0x8;FD_CONNECT_BIT := 0x4; + FD_CONNECT := 0x10;FD_CLOSE_BIT := 0x5;FD_CLOSE := 0x20; + FD_QOS_BIT := 0x6;FD_QOS := 0x40;FD_GROUP_QOS_BIT := 0x7; + FD_GROUP_QOS := 0x80;FD_ROUTING_INTERFACE_CHANGE_BIT := 0x8;FD_ROUTING_INTERFACE_CHANGE := 0x100; + FD_ADDRESS_LIST_CHANGE_BIT := 0x9;FD_ADDRESS_LIST_CHANGE := 0x200;FD_MAX_EVENTS := 0xA; + FD_ALL_EVENTS := 0x3FF;WSABASEERR := 0x2710;WSAEINTR := 0x2714; + WSAEBADF := 0x2719;WSAEACCES := 0x271D;WSAEFAULT := 0x271E; + WSAEINVAL := 0x2726;WSAEMFILE := 0x2728;WSAEWOULDBLOCK := 0x2733; + WSAEINPROGRESS := 0x2734;WSAEALREADY := 0x2735;WSAENOTSOCK := 0x2736; + WSAEDESTADDRREQ := 0x2737;WSAEMSGSIZE := 0x2738;WSAEPROTOTYPE := 0x2739; + WSAENOPROTOOPT := 0x273A;WSAEPROTONOSUPPORT := 0x273B;WSAESOCKTNOSUPPORT := 0x273C; + WSAEOPNOTSUPP := 0x273D;WSAEPFNOSUPPORT := 0x273E;WSAEAFNOSUPPORT := 0x273F; + WSAEADDRINUSE := 0x2740;WSAEADDRNOTAVAIL := 0x2741;WSAENETDOWN := 0x2742; + WSAENETUNREACH := 0x2743;WSAENETRESET := 0x2744;WSAECONNABORTED := 0x2745; + WSAECONNRESET := 0x2746;WSAENOBUFS := 0x2747;WSAEISCONN := 0x2748; + WSAENOTCONN := 0x2749;WSAESHUTDOWN := 0x274A;WSAETOOMANYREFS := 0x274B; + WSAETIMEDOUT := 0x274C;WSAECONNREFUSED := 0x274D;WSAELOOP := 0x274E; + WSAENAMETOOLONG := 0x274F;WSAEHOSTDOWN := 0x2750;WSAEHOSTUNREACH := 0x2751; + WSAENOTEMPTY := 0x2752;WSAEPROCLIM := 0x2753;WSAEUSERS := 0x2754; + WSAEDQUOT := 0x2755;WSAESTALE := 0x2756;WSAEREMOTE := 0x2757; + WSASYSNOTREADY := 0x276B;WSAVERNOTSUPPORTED := 0x276C;WSANOTINITIALISED := 0x276D; + WSAEDISCON := 0x2775;WSAENOMORE := 0x2776;WSAECANCELLED := 0x2777; + WSAEINVALIDPROCTABLE := 0x2778;WSAEINVALIDPROVIDER := 0x2779;WSAEPROVIDERFAILEDINIT := 0x277A; + WSASYSCALLFAILURE := 0x277B;WSASERVICE_NOT_FOUND := 0x277C;WSATYPE_NOT_FOUND := 0x277D; + WSA_E_NO_MORE := 0x277E;WSA_E_CANCELLED := 0x277F;WSAEREFUSED := 0x2780; + WSAHOST_NOT_FOUND := 0x2AF9;WSATRY_AGAIN := 0x2AFA;WSANO_RECOVERY := 0x2AFB; + WSANO_DATA := 0x2AFC;WSA_QOS_RECEIVERS := 0x2AFD;WSA_QOS_SENDERS := 0x2AFE; + WSA_QOS_NO_SENDERS := 0x2AFF;WSA_QOS_NO_RECEIVERS := 0x2B00;WSA_QOS_REQUEST_CONFIRMED := 0x2B01; + WSA_QOS_ADMISSION_FAILURE := 0x2B02;WSA_QOS_POLICY_FAILURE := 0x2B03;WSA_QOS_BAD_STYLE := 0x2B04; + WSA_QOS_BAD_OBJECT := 0x2B05;WSA_QOS_TRAFFIC_CTRL_ERROR := 0x2B06;WSA_QOS_GENERIC_ERROR := 0x2B07; + WSA_QOS_ESERVICETYPE := 0x2B08;WSA_QOS_EFLOWSPEC := 0x2B09;WSA_QOS_EPROVSPECBUF := 0x2B0A; + WSA_QOS_EFILTERSTYLE := 0x2B0B;WSA_QOS_EFILTERTYPE := 0x2B0C;WSA_QOS_EFILTERCOUNT := 0x2B0D; + WSA_QOS_EOBJLENGTH := 0x2B0E;WSA_QOS_EFLOWCOUNT := 0x2B0F;WSA_QOS_EUNKOWNPSOBJ := 0x2B10; + WSA_QOS_EPOLICYOBJ := 0x2B11;WSA_QOS_EFLOWDESC := 0x2B12;WSA_QOS_EPSFLOWSPEC := 0x2B13; + WSA_QOS_EPSFILTERSPEC := 0x2B14;WSA_QOS_ESDMODEOBJ := 0x2B15;WSA_QOS_ESHAPERATEOBJ := 0x2B16; + WSA_QOS_RESERVED_PETYPE := 0x2B17;HOST_NOT_FOUND := 0x2AF9;TRY_AGAIN := 0x2AFA; + NO_RECOVERY := 0x2AFB;NO_DATA := 0x2AFC;WSANO_ADDRESS := 0x2AFC; + NO_ADDRESS := 0x2AFC;EWOULDBLOCK := 0x2733;EINPROGRESS := 0x2734; + EALREADY := 0x2735;ENOTSOCK := 0x2736;EDESTADDRREQ := 0x2737; + EMSGSIZE := 0x2738;EPROTOTYPE := 0x2739;ENOPROTOOPT := 0x273A; + EPROTONOSUPPORT := 0x273B;ESOCKTNOSUPPORT := 0x273C;EOPNOTSUPP := 0x273D; + EPFNOSUPPORT := 0x273E;EAFNOSUPPORT := 0x273F;EADDRINUSE := 0x2740; + EADDRNOTAVAIL := 0x2741;ENETDOWN := 0x2742;ENETUNREACH := 0x2743; + ENETRESET := 0x2744;ECONNABORTED := 0x2745;ECONNRESET := 0x2746; + ENOBUFS := 0x2747;EISCONN := 0x2748;ENOTCONN := 0x2749; + ESHUTDOWN := 0x274A;ETOOMANYREFS := 0x274B;ETIMEDOUT := 0x274C; + ECONNREFUSED := 0x274D;ELOOP := 0x274E;ENAMETOOLONG := 0x274F; + EHOSTDOWN := 0x2750;EHOSTUNREACH := 0x2751;ENOTEMPTY := 0x2752; + EPROCLIM := 0x2753;EUSERS := 0x2754;EDQUOT := 0x2755; + ESTALE := 0x2756;EREMOTE := 0x2757;WSAAPI := NIL; + WSAEVENT := 0x0;LPWSAEVENT := 0x0;WSAOVERLAPPED := 0x0; + WSA_IO_PENDING := 0x0;WSA_IO_INCOMPLETE := 0x0;WSA_INVALID_HANDLE := 0x0; + WSA_INVALID_PARAMETER := 0x0;WSA_NOT_ENOUGH_MEMORY := 0x0;WSA_OPERATION_ABORTED := 0x0; + WSA_INVALID_EVENT := 0x0;WSA_MAXIMUM_WAIT_EVENTS := 0x0;WSA_WAIT_FAILED := 0x0; + WSA_WAIT_EVENT_0 := 0x0;WSA_WAIT_IO_COMPLETION := 0x0;WSA_WAIT_TIMEOUT := 0x0; + WSA_INFINITE := 0x0;LPQOS := 0x0;CF_ACCEPT := 0x0; + CF_REJECT := 0x1;CF_DEFER := 0x2;SD_RECEIVE := 0x0; + SD_SEND := 0x1;SD_BOTH := 0x2;SG_UNCONSTRAINED_GROUP := 0x1; + SG_CONSTRAINED_GROUP := 0x2;MAX_PROTOCOL_CHAIN := 0x7;BASE_PROTOCOL := 0x1; + LAYERED_PROTOCOL := 0x0;WSAPROTOCOL_LEN := 0xFF;PFL_MULTIPLE_PROTO_ENTRIES := 0x1; + PFL_RECOMMENDED_PROTO_ENTRY := 0x2;PFL_HIDDEN := 0x4;PFL_MATCHES_PROTOCOL_ZERO := 0x8; + PFL_NETWORKDIRECT_PROVIDER := 0x10;XP1_CONNECTIONLESS := 0x1;XP1_GUARANTEED_DELIVERY := 0x2; + XP1_GUARANTEED_ORDER := 0x4;XP1_MESSAGE_ORIENTED := 0x8;XP1_PSEUDO_STREAM := 0x10; + XP1_GRACEFUL_CLOSE := 0x20;XP1_EXPEDITED_DATA := 0x40;XP1_CONNECT_DATA := 0x80; + XP1_DISCONNECT_DATA := 0x100;XP1_SUPPORT_BROADCAST := 0x200;XP1_SUPPORT_MULTIPOINT := 0x400; + XP1_MULTIPOINT_CONTROL_PLANE := 0x800;XP1_MULTIPOINT_DATA_PLANE := 0x1000;XP1_QOS_SUPPORTED := 0x2000; + XP1_INTERRUPT := 0x4000;XP1_UNI_SEND := 0x8000;XP1_UNI_RECV := 0x10000; + XP1_IFS_HANDLES := 0x20000;XP1_PARTIAL_MESSAGE := 0x40000;XP1_SAN_SUPPORT_SDP := 0x80000; + BIGENDIAN := 0x0;LITTLEENDIAN := 0x1;SECURITY_PROTOCOL_NONE := 0x0; + JL_SENDER_ONLY := 0x1;JL_RECEIVER_ONLY := 0x2;JL_BOTH := 0x4; + WSA_FLAG_OVERLAPPED := 0x1;WSA_FLAG_MULTIPOINT_C_ROOT := 0x2;WSA_FLAG_MULTIPOINT_C_LEAF := 0x4; + WSA_FLAG_MULTIPOINT_D_ROOT := 0x8;WSA_FLAG_MULTIPOINT_D_LEAF := 0x10;WSA_FLAG_ACCESS_SYSTEM_SECURITY := 0x40; + WSA_FLAG_NO_HANDLE_INHERIT := 0x80;WSA_FLAG_REGISTERED_IO := 0x100;TH_NETDEV := 0x1; + TH_TAPI := 0x2;SERVICE_MULTIPLE := 0x1;NS_ALL := 0x0; + NS_SAP := 0x1;NS_NDS := 0x2;NS_PEER_BROWSE := 0x3; + NS_SLP := 0x5;NS_DHCP := 0x6;NS_TCPIP_LOCAL := 0xA; + NS_WINS := 0xE;NS_BTH := 0x10;NS_NBP := 0x14; + NS_MS := 0x1E;NS_STDA := 0x1F;NS_NTDS := 0x20; + NS_EMAIL := 0x25;NS_X500 := 0x28;NS_NIS := 0x29; + NS_NISPLUS := 0x2A;NS_WRQ := 0x32;NS_NETDES := 0x3C; + NS_TCPIP_HOSTS := 0xB;NS_DNS := 0xC;NS_NETBT := 0xD; + NS_NLA := 0xF;NS_LOCALNAME := 0x13;NS_PNRPNAME := 0x26; + NS_PNRPCLOUD := 0x27;RES_UNUSED_1 := 0x1;RES_FLUSH_CACHE := 0x2; + RES_SERVICE := 0x4;SERVICE_TYPE_VALUE_IPXPORTA := "IpxSocket";SERVICE_TYPE_VALUE_IPXPORTW := L"IpxSocket"; + SERVICE_TYPE_VALUE_SAPIDA := "SapId";SERVICE_TYPE_VALUE_SAPIDW := L"SapId";SERVICE_TYPE_VALUE_TCPPORTA := "TcpPort"; + SERVICE_TYPE_VALUE_TCPPORTW := L"TcpPort";SERVICE_TYPE_VALUE_UDPPORTA := "UdpPort";SERVICE_TYPE_VALUE_UDPPORTW := L"UdpPort"; + SERVICE_TYPE_VALUE_OBJECTIDA := "ObjectId";SERVICE_TYPE_VALUE_OBJECTIDW := L"ObjectId";LUP_DEEP := 0x1; + LUP_CONTAINERS := 0x2;LUP_NOCONTAINERS := 0x4;LUP_NEAREST := 0x8; + LUP_RETURN_NAME := 0x10;LUP_RETURN_TYPE := 0x20;LUP_RETURN_VERSION := 0x40; + LUP_RETURN_COMMENT := 0x80;LUP_RETURN_ADDR := 0x100;LUP_RETURN_BLOB := 0x200; + LUP_RETURN_ALIASES := 0x400;LUP_RETURN_QUERY_STRING := 0x800;LUP_RETURN_ALL := 0xFF0; + LUP_RES_SERVICE := 0x8000;LUP_FLUSHCACHE := 0x1000;LUP_FLUSHPREVIOUS := 0x2000; + LUP_NON_AUTHORITATIVE := 0x4000;LUP_SECURE := 0x8000;LUP_RETURN_PREFERRED_NAMES := 0x10000; + LUP_ADDRCONFIG := 0x100000;LUP_DUAL_ADDR := 0x200000;LUP_FILESERVER := 0x400000; + LUP_DISABLE_IDN_ENCODING := 0x800000;LUP_API_ANSI := 0x1000000;RESULT_IS_ALIAS := 0x1; + RESULT_IS_ADDED := 0x10;RESULT_IS_CHANGED := 0x20;RESULT_IS_DELETED := 0x40; + POLLRDNORM := 0x100;POLLRDBAND := 0x200;POLLIN := 0x300; + POLLPRI := 0x400;POLLWRNORM := 0x10;POLLOUT := 0x10; + POLLWRBAND := 0x20;POLLERR := 0x1;POLLHUP := 0x2; + POLLNVAL := 0x4; + end +end + +type _gdi_h_=class() + static WINGDIAPI;static WINSPOOLAPI;static WINVER; + static R2_BLACK;static R2_NOTMERGEPEN;static R2_MASKNOTPEN; + static R2_NOTCOPYPEN;static R2_MASKPENNOT;static R2_NOT; + static R2_XORPEN;static R2_NOTMASKPEN;static R2_MASKPEN; + static R2_NOTXORPEN;static R2_NOP;static R2_MERGENOTPEN; + static R2_COPYPEN;static R2_MERGEPENNOT;static R2_MERGEPEN; + static R2_WHITE;static R2_LAST;static SRCCOPY; + static SRCPAINT;static SRCAND;static SRCINVERT; + static SRCERASE;static NOTSRCCOPY;static NOTSRCERASE; + static MERGECOPY;static MERGEPAINT;static PATCOPY; + static PATPAINT;static PATINVERT;static DSTINVERT; + static BLACKNESS;static WHITENESS;static NOMIRRORBITMAP; + static CAPTUREBLT;static GDI_ERROR;static HGDI_ERROR; + static ERROR;static NULLREGION;static SIMPLEREGION; + static COMPLEXREGION;static RGN_ERROR;static RGN_AND; + static RGN_OR;static RGN_XOR;static RGN_DIFF; + static RGN_COPY;static RGN_MIN;static RGN_MAX; + static BLACKONWHITE;static WHITEONBLACK;static COLORONCOLOR; + static HALFTONE;static MAXSTRETCHBLTMODE;static STRETCH_ANDSCANS; + static STRETCH_ORSCANS;static STRETCH_DELETESCANS;static STRETCH_HALFTONE; + static ALTERNATE;static WINDING;static POLYFILL_LAST; + static LAYOUT_RTL;static LAYOUT_BTT;static LAYOUT_VBH; + static LAYOUT_ORIENTATIONMASK;static LAYOUT_BITMAPORIENTATIONPRESERVED;static TA_NOUPDATECP; + static TA_UPDATECP;static TA_LEFT;static TA_RIGHT; + static TA_CENTER;static TA_TOP;static TA_BOTTOM; + static TA_BASELINE;static TA_RTLREADING;static TA_MASK; + static VTA_BASELINE;static VTA_LEFT;static VTA_RIGHT; + static VTA_CENTER;static VTA_BOTTOM;static VTA_TOP; + static ETO_OPAQUE;static ETO_CLIPPED;static ETO_GLYPH_INDEX; + static ETO_RTLREADING;static ETO_NUMERICSLOCAL;static ETO_NUMERICSLATIN; + static ETO_IGNORELANGUAGE;static ETO_PDY;static ETO_REVERSE_INDEX_MAP; + static ASPECT_FILTERING;static DCB_RESET;static DCB_ACCUMULATE; + static DCB_DIRTY;static DCB_SET;static DCB_ENABLE; + static DCB_DISABLE;static META_SETBKCOLOR;static META_SETBKMODE; + static META_SETMAPMODE;static META_SETROP2;static META_SETRELABS; + static META_SETPOLYFILLMODE;static META_SETSTRETCHBLTMODE;static META_SETTEXTCHAREXTRA; + static META_SETTEXTCOLOR;static META_SETTEXTJUSTIFICATION;static META_SETWINDOWORG; + static META_SETWINDOWEXT;static META_SETVIEWPORTORG;static META_SETVIEWPORTEXT; + static META_OFFSETWINDOWORG;static META_SCALEWINDOWEXT;static META_OFFSETVIEWPORTORG; + static META_SCALEVIEWPORTEXT;static META_LINETO;static META_MOVETO; + static META_EXCLUDECLIPRECT;static META_INTERSECTCLIPRECT;static META_ARC; + static META_ELLIPSE;static META_FLOODFILL;static META_PIE; + static META_RECTANGLE;static META_ROUNDRECT;static META_PATBLT; + static META_SAVEDC;static META_SETPIXEL;static META_OFFSETCLIPRGN; + static META_TEXTOUT;static META_BITBLT;static META_STRETCHBLT; + static META_POLYGON;static META_POLYLINE;static META_ESCAPE; + static META_RESTOREDC;static META_FILLREGION;static META_FRAMEREGION; + static META_INVERTREGION;static META_PAINTREGION;static META_SELECTCLIPREGION; + static META_SELECTOBJECT;static META_SETTEXTALIGN;static META_CHORD; + static META_SETMAPPERFLAGS;static META_EXTTEXTOUT;static META_SETDIBTODEV; + static META_SELECTPALETTE;static META_REALIZEPALETTE;static META_ANIMATEPALETTE; + static META_SETPALENTRIES;static META_POLYPOLYGON;static META_RESIZEPALETTE; + static META_DIBBITBLT;static META_DIBSTRETCHBLT;static META_DIBCREATEPATTERNBRUSH; + static META_STRETCHDIB;static META_EXTFLOODFILL;static META_SETLAYOUT; + static META_DELETEOBJECT;static META_CREATEPALETTE;static META_CREATEPATTERNBRUSH; + static META_CREATEPENINDIRECT;static META_CREATEFONTINDIRECT;static META_CREATEBRUSHINDIRECT; + static META_CREATEREGION;static NEWFRAME;static ABORTDOC; + static NEXTBAND;static SETCOLORTABLE;static GETCOLORTABLE; + static FLUSHOUTPUT;static DRAFTMODE;static QUERYESCSUPPORT; + static SETABORTPROC;static STARTDOC;static ENDDOC; + static GETPHYSPAGESIZE;static GETPRINTINGOFFSET;static GETSCALINGFACTOR; + static MFCOMMENT;static GETPENWIDTH;static SETCOPYCOUNT; + static SELECTPAPERSOURCE;static DEVICEDATA;static PASSTHROUGH; + static GETTECHNOLGY;static GETTECHNOLOGY;static SETLINECAP; + static SETLINEJOIN;static SETMITERLIMIT;static BANDINFO; + static DRAWPATTERNRECT;static GETVECTORPENSIZE;static GETVECTORBRUSHSIZE; + static ENABLEDUPLEX;static GETSETPAPERBINS;static GETSETPRINTORIENT; + static ENUMPAPERBINS;static SETDIBSCALING;static EPSPRINTING; + static ENUMPAPERMETRICS;static GETSETPAPERMETRICS;static POSTSCRIPT_DATA; + static POSTSCRIPT_IGNORE;static MOUSETRAILS;static GETDEVICEUNITS; + static GETEXTENDEDTEXTMETRICS;static GETEXTENTTABLE;static GETPAIRKERNTABLE; + static GETTRACKKERNTABLE;static EXTTEXTOUT;static GETFACENAME; + static DOWNLOADFACE;static ENABLERELATIVEWIDTHS;static ENABLEPAIRKERNING; + static SETKERNTRACK;static SETALLJUSTVALUES;static SETCHARSET; + static STRETCHBLT;static METAFILE_DRIVER;static GETSETSCREENPARAMS; + static QUERYDIBSUPPORT;static BEGIN_PATH;static CLIP_TO_PATH; + static END_PATH;static EXT_DEVICE_CAPS;static RESTORE_CTM; + static SAVE_CTM;static SET_ARC_DIRECTION;static SET_BACKGROUND_COLOR; + static SET_POLY_MODE;static SET_SCREEN_ANGLE;static SET_SPREAD; + static TRANSFORM_CTM;static SET_CLIP_BOX;static SET_BOUNDS; + static SET_MIRROR_MODE;static OPENCHANNEL;static DOWNLOADHEADER; + static CLOSECHANNEL;static POSTSCRIPT_PASSTHROUGH;static ENCAPSULATED_POSTSCRIPT; + static POSTSCRIPT_IDENTIFY;static POSTSCRIPT_INJECTION;static CHECKJPEGFORMAT; + static CHECKPNGFORMAT;static GET_PS_FEATURESETTING;static GDIPLUS_TS_QUERYVER; + static GDIPLUS_TS_RECORD;static MILCORE_TS_QUERYVER_RESULT_FALSE;static MILCORE_TS_QUERYVER_RESULT_TRUE; + static SPCLPASSTHROUGH2;static PSIDENT_GDICENTRIC;static PSIDENT_PSCENTRIC; + static PSINJECT_BEGINSTREAM;static PSINJECT_PSADOBE;static PSINJECT_PAGESATEND; + static PSINJECT_PAGES;static PSINJECT_DOCNEEDEDRES;static PSINJECT_DOCSUPPLIEDRES; + static PSINJECT_PAGEORDER;static PSINJECT_ORIENTATION;static PSINJECT_BOUNDINGBOX; + static PSINJECT_DOCUMENTPROCESSCOLORS;static PSINJECT_COMMENTS;static PSINJECT_BEGINDEFAULTS; + static PSINJECT_ENDDEFAULTS;static PSINJECT_BEGINPROLOG;static PSINJECT_ENDPROLOG; + static PSINJECT_BEGINSETUP;static PSINJECT_ENDSETUP;static PSINJECT_TRAILER; + static PSINJECT_EOF;static PSINJECT_ENDSTREAM;static PSINJECT_DOCUMENTPROCESSCOLORSATEND; + static PSINJECT_PAGENUMBER;static PSINJECT_BEGINPAGESETUP;static PSINJECT_ENDPAGESETUP; + static PSINJECT_PAGETRAILER;static PSINJECT_PLATECOLOR;static PSINJECT_SHOWPAGE; + static PSINJECT_PAGEBBOX;static PSINJECT_ENDPAGECOMMENTS;static PSINJECT_VMSAVE; + static PSINJECT_VMRESTORE;static PSINJECT_DLFONT;static FEATURESETTING_NUP; + static FEATURESETTING_OUTPUT;static FEATURESETTING_PSLEVEL;static FEATURESETTING_CUSTPAPER; + static FEATURESETTING_MIRROR;static FEATURESETTING_NEGATIVE;static FEATURESETTING_PROTOCOL; + static FEATURESETTING_PRIVATE_BEGIN;static FEATURESETTING_PRIVATE_END;static PSPROTOCOL_ASCII; + static PSPROTOCOL_BCP;static PSPROTOCOL_TBCP;static PSPROTOCOL_BINARY; + static QDI_SETDIBITS;static QDI_GETDIBITS;static QDI_DIBTOSCREEN; + static QDI_STRETCHDIB;static SP_NOTREPORTED;static SP_ERROR; + static SP_APPABORT;static SP_USERABORT;static SP_OUTOFDISK; + static SP_OUTOFMEMORY;static PR_JOBSTATUS;static OBJ_PEN; + static OBJ_BRUSH;static OBJ_DC;static OBJ_METADC; + static OBJ_PAL;static OBJ_FONT;static OBJ_BITMAP; + static OBJ_REGION;static OBJ_METAFILE;static OBJ_MEMDC; + static OBJ_EXTPEN;static OBJ_ENHMETADC;static OBJ_ENHMETAFILE; + static OBJ_COLORSPACE;static GDI_OBJ_LAST;static MWT_IDENTITY; + static MWT_LEFTMULTIPLY;static MWT_RIGHTMULTIPLY;static MWT_MIN; + static MWT_MAX;static CS_ENABLE;static CS_DISABLE; + static CS_DELETE_TRANSFORM;static LCS_SIGNATURE;static LCS_SRGB; + static LCS_WINDOWS_COLOR_SPACE;static LCS_CALIBRATED_RGB;static LCS_GM_BUSINESS; + static LCS_GM_GRAPHICS;static LCS_GM_IMAGES;static LCS_GM_ABS_COLORIMETRIC; + static CM_OUT_OF_GAMUT;static CM_IN_GAMUT;static ICM_ADDPROFILE; + static ICM_DELETEPROFILE;static ICM_QUERYPROFILE;static ICM_SETDEFAULTPROFILE; + static ICM_REGISTERICMATCHER;static ICM_UNREGISTERICMATCHER;static ICM_QUERYMATCH; + static PROFILE_LINKED;static PROFILE_EMBEDDED;static BI_RGB; + static BI_RLE8;static BI_RLE4;static BI_BITFIELDS; + static BI_JPEG;static BI_PNG;static TCI_SRCCHARSET; + static TCI_SRCCODEPAGE;static TCI_SRCFONTSIG;static TCI_SRCLOCALE; + static TMPF_FIXED_PITCH;static TMPF_VECTOR;static TMPF_DEVICE; + static TMPF_TRUETYPE;static NTM_REGULAR;static NTM_BOLD; + static NTM_ITALIC;static NTM_NONNEGATIVE_AC;static NTM_PS_OPENTYPE; + static NTM_TT_OPENTYPE;static NTM_MULTIPLEMASTER;static NTM_TYPE1; + static NTM_DSIG;static LF_FACESIZE;static LF_FULLFACESIZE; + static OUT_DEFAULT_PRECIS;static OUT_STRING_PRECIS;static OUT_CHARACTER_PRECIS; + static OUT_STROKE_PRECIS;static OUT_TT_PRECIS;static OUT_DEVICE_PRECIS; + static OUT_RASTER_PRECIS;static OUT_TT_ONLY_PRECIS;static OUT_OUTLINE_PRECIS; + static OUT_SCREEN_OUTLINE_PRECIS;static OUT_PS_ONLY_PRECIS;static CLIP_DEFAULT_PRECIS; + static CLIP_CHARACTER_PRECIS;static CLIP_STROKE_PRECIS;static CLIP_MASK; + static CLIP_LH_ANGLES;static CLIP_TT_ALWAYS;static CLIP_DFA_DISABLE; + static CLIP_EMBEDDED;static DEFAULT_QUALITY;static DRAFT_QUALITY; + static PROOF_QUALITY;static NONANTIALIASED_QUALITY;static ANTIALIASED_QUALITY; + static CLEARTYPE_QUALITY;static CLEARTYPE_NATURAL_QUALITY;static DEFAULT_PITCH; + static FIXED_PITCH;static VARIABLE_PITCH;static MONO_FONT; + static ANSI_CHARSET;static DEFAULT_CHARSET;static SYMBOL_CHARSET; + static SHIFTJIS_CHARSET;static HANGEUL_CHARSET;static HANGUL_CHARSET; + static GB2312_CHARSET;static CHINESEBIG5_CHARSET;static OEM_CHARSET; + static JOHAB_CHARSET;static HEBREW_CHARSET;static ARABIC_CHARSET; + static GREEK_CHARSET;static TURKISH_CHARSET;static VIETNAMESE_CHARSET; + static THAI_CHARSET;static EASTEUROPE_CHARSET;static RUSSIAN_CHARSET; + static MAC_CHARSET;static BALTIC_CHARSET;static FS_LATIN1; + static FS_LATIN2;static FS_CYRILLIC;static FS_GREEK; + static FS_TURKISH;static FS_HEBREW;static FS_ARABIC; + static FS_BALTIC;static FS_VIETNAMESE;static FS_THAI; + static FS_JISJAPAN;static FS_CHINESESIMP;static FS_WANSUNG; + static FS_CHINESETRAD;static FS_JOHAB;static FS_SYMBOL; + static FF_DONTCARE;static FF_ROMAN;static FF_SWISS; + static FF_MODERN;static FF_SCRIPT;static FF_DECORATIVE; + static FW_DONTCARE;static FW_THIN;static FW_EXTRALIGHT; + static FW_LIGHT;static FW_NORMAL;static FW_MEDIUM; + static FW_SEMIBOLD;static FW_BOLD;static FW_EXTRABOLD; + static FW_HEAVY;static FW_ULTRALIGHT;static FW_REGULAR; + static FW_DEMIBOLD;static FW_ULTRABOLD;static FW_BLACK; + static PANOSE_COUNT;static PAN_FAMILYTYPE_INDEX;static PAN_SERIFSTYLE_INDEX; + static PAN_WEIGHT_INDEX;static PAN_PROPORTION_INDEX;static PAN_CONTRAST_INDEX; + static PAN_STROKEVARIATION_INDEX;static PAN_ARMSTYLE_INDEX;static PAN_LETTERFORM_INDEX; + static PAN_MIDLINE_INDEX;static PAN_XHEIGHT_INDEX;static PAN_CULTURE_LATIN; + static PAN_ANY;static PAN_NO_FIT;static PAN_FAMILY_TEXT_DISPLAY; + static PAN_FAMILY_SCRIPT;static PAN_FAMILY_DECORATIVE;static PAN_FAMILY_PICTORIAL; + static PAN_SERIF_COVE;static PAN_SERIF_OBTUSE_COVE;static PAN_SERIF_SQUARE_COVE; + static PAN_SERIF_OBTUSE_SQUARE_COVE;static PAN_SERIF_SQUARE;static PAN_SERIF_THIN; + static PAN_SERIF_BONE;static PAN_SERIF_EXAGGERATED;static PAN_SERIF_TRIANGLE; + static PAN_SERIF_NORMAL_SANS;static PAN_SERIF_OBTUSE_SANS;static PAN_SERIF_PERP_SANS; + static PAN_SERIF_FLARED;static PAN_SERIF_ROUNDED;static PAN_WEIGHT_VERY_LIGHT; + static PAN_WEIGHT_LIGHT;static PAN_WEIGHT_THIN;static PAN_WEIGHT_BOOK; + static PAN_WEIGHT_MEDIUM;static PAN_WEIGHT_DEMI;static PAN_WEIGHT_BOLD; + static PAN_WEIGHT_HEAVY;static PAN_WEIGHT_BLACK;static PAN_WEIGHT_NORD; + static PAN_PROP_OLD_STYLE;static PAN_PROP_MODERN;static PAN_PROP_EVEN_WIDTH; + static PAN_PROP_EXPANDED;static PAN_PROP_CONDENSED;static PAN_PROP_VERY_EXPANDED; + static PAN_PROP_VERY_CONDENSED;static PAN_PROP_MONOSPACED;static PAN_CONTRAST_NONE; + static PAN_CONTRAST_VERY_LOW;static PAN_CONTRAST_LOW;static PAN_CONTRAST_MEDIUM_LOW; + static PAN_CONTRAST_MEDIUM;static PAN_CONTRAST_MEDIUM_HIGH;static PAN_CONTRAST_HIGH; + static PAN_CONTRAST_VERY_HIGH;static PAN_STROKE_GRADUAL_DIAG;static PAN_STROKE_GRADUAL_TRAN; + static PAN_STROKE_GRADUAL_VERT;static PAN_STROKE_GRADUAL_HORZ;static PAN_STROKE_RAPID_VERT; + static PAN_STROKE_RAPID_HORZ;static PAN_STROKE_INSTANT_VERT;static PAN_STRAIGHT_ARMS_HORZ; + static PAN_STRAIGHT_ARMS_WEDGE;static PAN_STRAIGHT_ARMS_VERT;static PAN_STRAIGHT_ARMS_SINGLE_SERIF; + static PAN_STRAIGHT_ARMS_DOUBLE_SERIF;static PAN_BENT_ARMS_HORZ;static PAN_BENT_ARMS_WEDGE; + static PAN_BENT_ARMS_VERT;static PAN_BENT_ARMS_SINGLE_SERIF;static PAN_BENT_ARMS_DOUBLE_SERIF; + static PAN_LETT_NORMAL_CONTACT;static PAN_LETT_NORMAL_WEIGHTED;static PAN_LETT_NORMAL_BOXED; + static PAN_LETT_NORMAL_FLATTENED;static PAN_LETT_NORMAL_ROUNDED;static PAN_LETT_NORMAL_OFF_CENTER; + static PAN_LETT_NORMAL_SQUARE;static PAN_LETT_OBLIQUE_CONTACT;static PAN_LETT_OBLIQUE_WEIGHTED; + static PAN_LETT_OBLIQUE_BOXED;static PAN_LETT_OBLIQUE_FLATTENED;static PAN_LETT_OBLIQUE_ROUNDED; + static PAN_LETT_OBLIQUE_OFF_CENTER;static PAN_LETT_OBLIQUE_SQUARE;static PAN_MIDLINE_STANDARD_TRIMMED; + static PAN_MIDLINE_STANDARD_POINTED;static PAN_MIDLINE_STANDARD_SERIFED;static PAN_MIDLINE_HIGH_TRIMMED; + static PAN_MIDLINE_HIGH_POINTED;static PAN_MIDLINE_HIGH_SERIFED;static PAN_MIDLINE_CONSTANT_TRIMMED; + static PAN_MIDLINE_CONSTANT_POINTED;static PAN_MIDLINE_CONSTANT_SERIFED;static PAN_MIDLINE_LOW_TRIMMED; + static PAN_MIDLINE_LOW_POINTED;static PAN_MIDLINE_LOW_SERIFED;static PAN_XHEIGHT_CONSTANT_SMALL; + static PAN_XHEIGHT_CONSTANT_STD;static PAN_XHEIGHT_CONSTANT_LARGE;static PAN_XHEIGHT_DUCKING_SMALL; + static PAN_XHEIGHT_DUCKING_STD;static PAN_XHEIGHT_DUCKING_LARGE;static ELF_VENDOR_SIZE; + static ELF_VERSION;static ELF_CULTURE_LATIN;static RASTER_FONTTYPE; + static DEVICE_FONTTYPE;static TRUETYPE_FONTTYPE;static PC_RESERVED; + static PC_EXPLICIT;static PC_NOCOLLAPSE;static TRANSPARENT; + static OPAQUE;static BKMODE_LAST;static GM_COMPATIBLE; + static GM_ADVANCED;static GM_LAST;static PT_CLOSEFIGURE; + static PT_LINETO;static PT_BEZIERTO;static PT_MOVETO; + static MM_TEXT;static MM_LOMETRIC;static MM_HIMETRIC; + static MM_LOENGLISH;static MM_HIENGLISH;static MM_TWIPS; + static MM_ISOTROPIC;static MM_ANISOTROPIC;static MM_MIN; + static MM_MAX;static MM_MAX_FIXEDSCALE;static ABSOLUTE; + static RELATIVE;static WHITE_BRUSH;static LTGRAY_BRUSH; + static GRAY_BRUSH;static DKGRAY_BRUSH;static BLACK_BRUSH; + static NULL_BRUSH;static HOLLOW_BRUSH;static WHITE_PEN; + static BLACK_PEN;static NULL_PEN;static OEM_FIXED_FONT; + static ANSI_FIXED_FONT;static ANSI_VAR_FONT;static SYSTEM_FONT; + static DEVICE_DEFAULT_FONT;static DEFAULT_PALETTE;static SYSTEM_FIXED_FONT; + static DEFAULT_GUI_FONT;static DC_BRUSH;static DC_PEN; + static STOCK_LAST;static CLR_INVALID;static BS_SOLID; + static BS_NULL;static BS_HOLLOW;static BS_HATCHED; + static BS_PATTERN;static BS_INDEXED;static BS_DIBPATTERN; + static BS_DIBPATTERNPT;static BS_PATTERN8X8;static BS_DIBPATTERN8X8; + static BS_MONOPATTERN;static HS_HORIZONTAL;static HS_VERTICAL; + static HS_FDIAGONAL;static HS_BDIAGONAL;static HS_CROSS; + static HS_DIAGCROSS;static HS_API_MAX;static PS_SOLID; + static PS_DASH;static PS_DOT;static PS_DASHDOT; + static PS_DASHDOTDOT;static PS_NULL;static PS_INSIDEFRAME; + static PS_USERSTYLE;static PS_ALTERNATE;static PS_STYLE_MASK; + static PS_ENDCAP_ROUND;static PS_ENDCAP_SQUARE;static PS_ENDCAP_FLAT; + static PS_ENDCAP_MASK;static PS_JOIN_ROUND;static PS_JOIN_BEVEL; + static PS_JOIN_MITER;static PS_JOIN_MASK;static PS_COSMETIC; + static PS_GEOMETRIC;static PS_TYPE_MASK;static AD_COUNTERCLOCKWISE; + static AD_CLOCKWISE;static DRIVERVERSION;static TECHNOLOGY; + static HORZSIZE;static VERTSIZE;static HORZRES; + static VERTRES;static BITSPIXEL;static PLANES; + static NUMBRUSHES;static NUMPENS;static NUMMARKERS; + static NUMFONTS;static NUMCOLORS;static PDEVICESIZE; + static CURVECAPS;static LINECAPS;static POLYGONALCAPS; + static TEXTCAPS;static CLIPCAPS;static RASTERCAPS; + static ASPECTX;static ASPECTY;static ASPECTXY; + static LOGPIXELSX;static LOGPIXELSY;static SIZEPALETTE; + static NUMRESERVED;static COLORRES;static PHYSICALWIDTH; + static PHYSICALHEIGHT;static PHYSICALOFFSETX;static PHYSICALOFFSETY; + static SCALINGFACTORX;static SCALINGFACTORY;static VREFRESH; + static DESKTOPVERTRES;static DESKTOPHORZRES;static BLTALIGNMENT; + static SHADEBLENDCAPS;static COLORMGMTCAPS;static DT_PLOTTER; + static DT_RASDISPLAY;static DT_RASPRINTER;static DT_RASCAMERA; + static DT_CHARSTREAM;static DT_METAFILE;static DT_DISPFILE; + static CC_NONE;static CC_CIRCLES;static CC_PIE; + static CC_CHORD;static CC_ELLIPSES;static CC_WIDE; + static CC_STYLED;static CC_WIDESTYLED;static CC_INTERIORS; + static CC_ROUNDRECT;static LC_NONE;static LC_POLYLINE; + static LC_MARKER;static LC_POLYMARKER;static LC_WIDE; + static LC_STYLED;static LC_WIDESTYLED;static LC_INTERIORS; + static PC_NONE;static PC_POLYGON;static PC_RECTANGLE; + static PC_WINDPOLYGON;static PC_TRAPEZOID;static PC_SCANLINE; + static PC_WIDE;static PC_STYLED;static PC_WIDESTYLED; + static PC_INTERIORS;static PC_POLYPOLYGON;static PC_PATHS; + static CP_NONE;static CP_RECTANGLE;static CP_REGION; + static TC_OP_CHARACTER;static TC_OP_STROKE;static TC_CP_STROKE; + static TC_CR_90;static TC_CR_ANY;static TC_SF_X_YINDEP; + static TC_SA_DOUBLE;static TC_SA_INTEGER;static TC_SA_CONTIN; + static TC_EA_DOUBLE;static TC_IA_ABLE;static TC_UA_ABLE; + static TC_SO_ABLE;static TC_RA_ABLE;static TC_VA_ABLE; + static TC_RESERVED;static TC_SCROLLBLT;static RC_BITBLT; + static RC_BANDING;static RC_SCALING;static RC_BITMAP64; + static RC_GDI20_OUTPUT;static RC_GDI20_STATE;static RC_SAVEBITMAP; + static RC_DI_BITMAP;static RC_PALETTE;static RC_DIBTODEV; + static RC_BIGFONT;static RC_STRETCHBLT;static RC_FLOODFILL; + static RC_STRETCHDIB;static RC_OP_DX_OUTPUT;static RC_DEVBITS; + static SB_NONE;static SB_CONST_ALPHA;static SB_PIXEL_ALPHA; + static SB_PREMULT_ALPHA;static SB_GRAD_RECT;static SB_GRAD_TRI; + static CM_NONE;static CM_DEVICE_ICM;static CM_GAMMA_RAMP; + static CM_CMYK_COLOR;static DIB_RGB_COLORS;static DIB_PAL_COLORS; + static SYSPAL_ERROR;static SYSPAL_STATIC;static SYSPAL_NOSTATIC; + static SYSPAL_NOSTATIC256;static CBM_INIT;static FLOODFILLBORDER; + static FLOODFILLSURFACE;static CCHDEVICENAME;static CCHFORMNAME; + static DM_SPECVERSION;static DM_ORIENTATION;static DM_PAPERSIZE; + static DM_PAPERLENGTH;static DM_PAPERWIDTH;static DM_SCALE; + static DM_POSITION;static DM_NUP;static DM_DISPLAYORIENTATION; + static DM_COPIES;static DM_DEFAULTSOURCE;static DM_PRINTQUALITY; + static DM_COLOR;static DM_DUPLEX;static DM_YRESOLUTION; + static DM_TTOPTION;static DM_COLLATE;static DM_FORMNAME; + static DM_LOGPIXELS;static DM_BITSPERPEL;static DM_PELSWIDTH; + static DM_PELSHEIGHT;static DM_DISPLAYFLAGS;static DM_DISPLAYFREQUENCY; + static DM_ICMMETHOD;static DM_ICMINTENT;static DM_MEDIATYPE; + static DM_DITHERTYPE;static DM_PANNINGWIDTH;static DM_PANNINGHEIGHT; + static DM_DISPLAYFIXEDOUTPUT;static DMORIENT_PORTRAIT;static DMORIENT_LANDSCAPE; + static DMPAPER_FIRST;static DMPAPER_LETTER;static DMPAPER_LETTERSMALL; + static DMPAPER_TABLOID;static DMPAPER_LEDGER;static DMPAPER_LEGAL; + static DMPAPER_STATEMENT;static DMPAPER_EXECUTIVE;static DMPAPER_A3; + static DMPAPER_A4;static DMPAPER_A4SMALL;static DMPAPER_A5; + static DMPAPER_B4;static DMPAPER_B5;static DMPAPER_FOLIO; + static DMPAPER_QUARTO;static DMPAPER_10X14;static DMPAPER_11X17; + static DMPAPER_NOTE;static DMPAPER_ENV_9;static DMPAPER_ENV_10; + static DMPAPER_ENV_11;static DMPAPER_ENV_12;static DMPAPER_ENV_14; + static DMPAPER_CSHEET;static DMPAPER_DSHEET;static DMPAPER_ESHEET; + static DMPAPER_ENV_DL;static DMPAPER_ENV_C5;static DMPAPER_ENV_C3; + static DMPAPER_ENV_C4;static DMPAPER_ENV_C6;static DMPAPER_ENV_C65; + static DMPAPER_ENV_B4;static DMPAPER_ENV_B5;static DMPAPER_ENV_B6; + static DMPAPER_ENV_ITALY;static DMPAPER_ENV_MONARCH;static DMPAPER_ENV_PERSONAL; + static DMPAPER_FANFOLD_US;static DMPAPER_FANFOLD_STD_GERMAN;static DMPAPER_FANFOLD_LGL_GERMAN; + static DMPAPER_ISO_B4;static DMPAPER_JAPANESE_POSTCARD;static DMPAPER_9X11; + static DMPAPER_10X11;static DMPAPER_15X11;static DMPAPER_ENV_INVITE; + static DMPAPER_RESERVED_48;static DMPAPER_RESERVED_49;static DMPAPER_LETTER_EXTRA; + static DMPAPER_LEGAL_EXTRA;static DMPAPER_TABLOID_EXTRA;static DMPAPER_A4_EXTRA; + static DMPAPER_LETTER_TRANSVERSE;static DMPAPER_A4_TRANSVERSE;static DMPAPER_LETTER_EXTRA_TRANSVERSE; + static DMPAPER_A_PLUS;static DMPAPER_B_PLUS;static DMPAPER_LETTER_PLUS; + static DMPAPER_A4_PLUS;static DMPAPER_A5_TRANSVERSE;static DMPAPER_B5_TRANSVERSE; + static DMPAPER_A3_EXTRA;static DMPAPER_A5_EXTRA;static DMPAPER_B5_EXTRA; + static DMPAPER_A2;static DMPAPER_A3_TRANSVERSE;static DMPAPER_A3_EXTRA_TRANSVERSE; + static DMPAPER_DBL_JAPANESE_POSTCARD;static DMPAPER_A6;static DMPAPER_JENV_KAKU2; + static DMPAPER_JENV_KAKU3;static DMPAPER_JENV_CHOU3;static DMPAPER_JENV_CHOU4; + static DMPAPER_LETTER_ROTATED;static DMPAPER_A3_ROTATED;static DMPAPER_A4_ROTATED; + static DMPAPER_A5_ROTATED;static DMPAPER_B4_JIS_ROTATED;static DMPAPER_B5_JIS_ROTATED; + static DMPAPER_JAPANESE_POSTCARD_ROTATED;static DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED;static DMPAPER_A6_ROTATED; + static DMPAPER_JENV_KAKU2_ROTATED;static DMPAPER_JENV_KAKU3_ROTATED;static DMPAPER_JENV_CHOU3_ROTATED; + static DMPAPER_JENV_CHOU4_ROTATED;static DMPAPER_B6_JIS;static DMPAPER_B6_JIS_ROTATED; + static DMPAPER_12X11;static DMPAPER_JENV_YOU4;static DMPAPER_JENV_YOU4_ROTATED; + static DMPAPER_P16K;static DMPAPER_P32K;static DMPAPER_P32KBIG; + static DMPAPER_PENV_1;static DMPAPER_PENV_2;static DMPAPER_PENV_3; + static DMPAPER_PENV_4;static DMPAPER_PENV_5;static DMPAPER_PENV_6; + static DMPAPER_PENV_7;static DMPAPER_PENV_8;static DMPAPER_PENV_9; + static DMPAPER_PENV_10;static DMPAPER_P16K_ROTATED;static DMPAPER_P32K_ROTATED; + static DMPAPER_P32KBIG_ROTATED;static DMPAPER_PENV_1_ROTATED;static DMPAPER_PENV_2_ROTATED; + static DMPAPER_PENV_3_ROTATED;static DMPAPER_PENV_4_ROTATED;static DMPAPER_PENV_5_ROTATED; + static DMPAPER_PENV_6_ROTATED;static DMPAPER_PENV_7_ROTATED;static DMPAPER_PENV_8_ROTATED; + static DMPAPER_PENV_9_ROTATED;static DMPAPER_PENV_10_ROTATED;static DMPAPER_LAST; + static DMPAPER_USER;static DMBIN_FIRST;static DMBIN_UPPER; + static DMBIN_ONLYONE;static DMBIN_LOWER;static DMBIN_MIDDLE; + static DMBIN_MANUAL;static DMBIN_ENVELOPE;static DMBIN_ENVMANUAL; + static DMBIN_AUTO;static DMBIN_TRACTOR;static DMBIN_SMALLFMT; + static DMBIN_LARGEFMT;static DMBIN_LARGECAPACITY;static DMBIN_CASSETTE; + static DMBIN_FORMSOURCE;static DMBIN_LAST;static DMBIN_USER; + static DMRES_DRAFT;static DMRES_LOW;static DMRES_MEDIUM; + static DMRES_HIGH;static DMCOLOR_MONOCHROME;static DMCOLOR_COLOR; + static DMDUP_SIMPLEX;static DMDUP_VERTICAL;static DMDUP_HORIZONTAL; + static DMTT_BITMAP;static DMTT_DOWNLOAD;static DMTT_SUBDEV; + static DMTT_DOWNLOAD_OUTLINE;static DMCOLLATE_FALSE;static DMCOLLATE_TRUE; + static DMDO_DEFAULT;static DMDO_90;static DMDO_180; + static DMDO_270;static DMDFO_DEFAULT;static DMDFO_STRETCH; + static DMDFO_CENTER;static DM_INTERLACED;static DMDISPLAYFLAGS_TEXTMODE; + static DMNUP_SYSTEM;static DMNUP_ONEUP;static DMICMMETHOD_NONE; + static DMICMMETHOD_SYSTEM;static DMICMMETHOD_DRIVER;static DMICMMETHOD_DEVICE; + static DMICMMETHOD_USER;static DMICM_SATURATE;static DMICM_CONTRAST; + static DMICM_COLORIMETRIC;static DMICM_ABS_COLORIMETRIC;static DMICM_USER; + static DMMEDIA_STANDARD;static DMMEDIA_TRANSPARENCY;static DMMEDIA_GLOSSY; + static DMMEDIA_USER;static DMDITHER_NONE;static DMDITHER_COARSE; + static DMDITHER_FINE;static DMDITHER_LINEART;static DMDITHER_ERRORDIFFUSION; + static DMDITHER_RESERVED6;static DMDITHER_RESERVED7;static DMDITHER_RESERVED8; + static DMDITHER_RESERVED9;static DMDITHER_GRAYSCALE;static DMDITHER_USER; + static DISPLAY_DEVICE_ATTACHED_TO_DESKTOP;static DISPLAY_DEVICE_MULTI_DRIVER;static DISPLAY_DEVICE_PRIMARY_DEVICE; + static DISPLAY_DEVICE_MIRRORING_DRIVER;static DISPLAY_DEVICE_VGA_COMPATIBLE;static DISPLAY_DEVICE_REMOVABLE; + static DISPLAY_DEVICE_ACC_DRIVER;static DISPLAY_DEVICE_MODESPRUNED;static DISPLAY_DEVICE_REMOTE; + static DISPLAY_DEVICE_DISCONNECT;static DISPLAY_DEVICE_TS_COMPATIBLE;static DISPLAY_DEVICE_UNSAFE_MODES_ON; + static DISPLAY_DEVICE_ACTIVE;static DISPLAY_DEVICE_ATTACHED;static DISPLAYCONFIG_MAXPATH; + static DISPLAYCONFIG_PATH_MODE_IDX_INVALID;static DISPLAYCONFIG_SOURCE_IN_USE;static DISPLAYCONFIG_TARGET_IN_USE; + static DISPLAYCONFIG_TARGET_FORCIBLE;static DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_BOOT;static DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_PATH; + static DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_SYSTEM;static DISPLAYCONFIG_PATH_ACTIVE;static QDC_ALL_PATHS; + static QDC_ONLY_ACTIVE_PATHS;static QDC_DATABASE_CURRENT;static SDC_TOPOLOGY_INTERNAL; + static SDC_TOPOLOGY_CLONE;static SDC_TOPOLOGY_EXTEND;static SDC_TOPOLOGY_EXTERNAL; + static SDC_TOPOLOGY_SUPPLIED;static SDC_USE_DATABASE_CURRENT;static SDC_USE_SUPPLIED_DISPLAY_CONFIG; + static SDC_VALIDATE;static SDC_APPLY;static SDC_NO_OPTIMIZATION; + static SDC_SAVE_TO_DATABASE;static SDC_ALLOW_CHANGES;static SDC_PATH_PERSIST_IF_REQUIRED; + static SDC_FORCE_MODE_ENUMERATION;static SDC_ALLOW_PATH_ORDER_CHANGES;static RDH_RECTANGLES; + static SYSRGN;static GGO_METRICS;static GGO_BITMAP; + static GGO_NATIVE;static GGO_BEZIER;static GGO_GRAY2_BITMAP; + static GGO_GRAY4_BITMAP;static GGO_GRAY8_BITMAP;static GGO_GLYPH_INDEX; + static GGO_UNHINTED;static TT_POLYGON_TYPE;static TT_PRIM_LINE; + static TT_PRIM_QSPLINE;static TT_PRIM_CSPLINE;static GCP_DBCS; + static GCP_REORDER;static GCP_USEKERNING;static GCP_GLYPHSHAPE; + static GCP_LIGATE;static GCP_DIACRITIC;static GCP_KASHIDA; + static GCP_ERROR;static FLI_MASK;static GCP_JUSTIFY; + static FLI_GLYPHS;static GCP_CLASSIN;static GCP_MAXEXTENT; + static GCP_JUSTIFYIN;static GCP_DISPLAYZWG;static GCP_SYMSWAPOFF; + static GCP_NUMERICOVERRIDE;static GCP_NEUTRALOVERRIDE;static GCP_NUMERICSLATIN; + static GCP_NUMERICSLOCAL;static GCPCLASS_LATIN;static GCPCLASS_HEBREW; + static GCPCLASS_ARABIC;static GCPCLASS_NEUTRAL;static GCPCLASS_LOCALNUMBER; + static GCPCLASS_LATINNUMBER;static GCPCLASS_LATINNUMERICTERMINATOR;static GCPCLASS_LATINNUMERICSEPARATOR; + static GCPCLASS_NUMERICSEPARATOR;static GCPCLASS_PREBOUNDLTR;static GCPCLASS_PREBOUNDRTL; + static GCPCLASS_POSTBOUNDLTR;static GCPCLASS_POSTBOUNDRTL;static GCPGLYPH_LINKBEFORE; + static GCPGLYPH_LINKAFTER;static TT_AVAILABLE;static TT_ENABLED; + static PFD_TYPE_RGBA;static PFD_TYPE_COLORINDEX;static PFD_MAIN_PLANE; + static PFD_OVERLAY_PLANE;static PFD_UNDERLAY_PLANE;static PFD_DOUBLEBUFFER; + static PFD_STEREO;static PFD_DRAW_TO_WINDOW;static PFD_DRAW_TO_BITMAP; + static PFD_SUPPORT_GDI;static PFD_SUPPORT_OPENGL;static PFD_GENERIC_FORMAT; + static PFD_NEED_PALETTE;static PFD_NEED_SYSTEM_PALETTE;static PFD_SWAP_EXCHANGE; + static PFD_SWAP_COPY;static PFD_SWAP_LAYER_BUFFERS;static PFD_GENERIC_ACCELERATED; + static PFD_SUPPORT_DIRECTDRAW;static PFD_DIRECT3D_ACCELERATED;static PFD_SUPPORT_COMPOSITION; + static PFD_DEPTH_DONTCARE;static PFD_DOUBLEBUFFER_DONTCARE;static PFD_STEREO_DONTCARE; + static DM_UPDATE;static DM_COPY;static DM_PROMPT; + static DM_MODIFY;static DM_IN_BUFFER;static DM_IN_PROMPT; + static DM_OUT_BUFFER;static DM_OUT_DEFAULT;static DC_FIELDS; + static DC_PAPERS;static DC_PAPERSIZE;static DC_MINEXTENT; + static DC_MAXEXTENT;static DC_BINS;static DC_DUPLEX; + static DC_SIZE;static DC_EXTRA;static DC_VERSION; + static DC_DRIVER;static DC_BINNAMES;static DC_ENUMRESOLUTIONS; + static DC_FILEDEPENDENCIES;static DC_TRUETYPE;static DC_PAPERNAMES; + static DC_ORIENTATION;static DC_COPIES;static DC_BINADJUST; + static DC_EMF_COMPLIANT;static DC_DATATYPE_PRODUCED;static DC_COLLATE; + static DC_MANUFACTURER;static DC_MODEL;static DC_PERSONALITY; + static DC_PRINTRATE;static DC_PRINTRATEUNIT;static PRINTRATEUNIT_PPM; + static PRINTRATEUNIT_CPS;static PRINTRATEUNIT_LPM;static PRINTRATEUNIT_IPM; + static DC_PRINTERMEM;static DC_MEDIAREADY;static DC_STAPLE; + static DC_PRINTRATEPPM;static DC_COLORDEVICE;static DC_NUP; + static DC_MEDIATYPENAMES;static DC_MEDIATYPES;static DCTT_BITMAP; + static DCTT_DOWNLOAD;static DCTT_SUBDEV;static DCTT_DOWNLOAD_OUTLINE; + static DCBA_FACEUPNONE;static DCBA_FACEUPCENTER;static DCBA_FACEUPLEFT; + static DCBA_FACEUPRIGHT;static DCBA_FACEDOWNNONE;static DCBA_FACEDOWNCENTER; + static DCBA_FACEDOWNLEFT;static DCBA_FACEDOWNRIGHT;static GETTEXTEXTENTPOINT32; + static GS_8BIT_INDICES;static GGI_MARK_NONEXISTING_GLYPHS;static STAMP_DESIGNVECTOR; + static STAMP_AXESLIST;static MM_MAX_NUMAXES;static FR_PRIVATE; + static FR_NOT_ENUM;static MM_MAX_AXES_NAMELEN;static GDIREGISTERDDRAWPACKETVERSION; + static AC_SRC_OVER;static AC_SRC_ALPHA;static GRADIENT_FILL_RECT_H; + static GRADIENT_FILL_RECT_V;static GRADIENT_FILL_TRIANGLE;static GRADIENT_FILL_OP_FLAG; + static CA_NEGATIVE;static CA_LOG_FILTER;static ILLUMINANT_DEVICE_DEFAULT; + static ILLUMINANT_A;static ILLUMINANT_B;static ILLUMINANT_C; + static ILLUMINANT_D50;static ILLUMINANT_D55;static ILLUMINANT_D65; + static ILLUMINANT_D75;static ILLUMINANT_F2;static ILLUMINANT_MAX_INDEX; + static ILLUMINANT_TUNGSTEN;static ILLUMINANT_DAYLIGHT;static ILLUMINANT_FLUORESCENT; + static ILLUMINANT_NTSC;static RGB_GAMMA_MIN;static RGB_GAMMA_MAX; + static REFERENCE_WHITE_MIN;static REFERENCE_WHITE_MAX;static REFERENCE_BLACK_MIN; + static REFERENCE_BLACK_MAX;static COLOR_ADJ_MIN;static COLOR_ADJ_MAX; + static DI_APPBANDING;static DI_ROPS_READ_DESTINATION;static FONTMAPPER_MAX; + static ICM_OFF;static ICM_ON;static ICM_QUERY; + static ICM_DONE_OUTSIDEDC;static ENHMETA_SIGNATURE;static ENHMETA_STOCK_OBJECT; + static EMR_HEADER;static EMR_POLYBEZIER;static EMR_POLYGON; + static EMR_POLYLINE;static EMR_POLYBEZIERTO;static EMR_POLYLINETO; + static EMR_POLYPOLYLINE;static EMR_POLYPOLYGON;static EMR_SETWINDOWEXTEX; + static EMR_SETWINDOWORGEX;static EMR_SETVIEWPORTEXTEX;static EMR_SETVIEWPORTORGEX; + static EMR_SETBRUSHORGEX;static EMR_EOF;static EMR_SETPIXELV; + static EMR_SETMAPPERFLAGS;static EMR_SETMAPMODE;static EMR_SETBKMODE; + static EMR_SETPOLYFILLMODE;static EMR_SETROP2;static EMR_SETSTRETCHBLTMODE; + static EMR_SETTEXTALIGN;static EMR_SETCOLORADJUSTMENT;static EMR_SETTEXTCOLOR; + static EMR_SETBKCOLOR;static EMR_OFFSETCLIPRGN;static EMR_MOVETOEX; + static EMR_SETMETARGN;static EMR_EXCLUDECLIPRECT;static EMR_INTERSECTCLIPRECT; + static EMR_SCALEVIEWPORTEXTEX;static EMR_SCALEWINDOWEXTEX;static EMR_SAVEDC; + static EMR_RESTOREDC;static EMR_SETWORLDTRANSFORM;static EMR_MODIFYWORLDTRANSFORM; + static EMR_SELECTOBJECT;static EMR_CREATEPEN;static EMR_CREATEBRUSHINDIRECT; + static EMR_DELETEOBJECT;static EMR_ANGLEARC;static EMR_ELLIPSE; + static EMR_RECTANGLE;static EMR_ROUNDRECT;static EMR_ARC; + static EMR_CHORD;static EMR_PIE;static EMR_SELECTPALETTE; + static EMR_CREATEPALETTE;static EMR_SETPALETTEENTRIES;static EMR_RESIZEPALETTE; + static EMR_REALIZEPALETTE;static EMR_EXTFLOODFILL;static EMR_LINETO; + static EMR_ARCTO;static EMR_POLYDRAW;static EMR_SETARCDIRECTION; + static EMR_SETMITERLIMIT;static EMR_BEGINPATH;static EMR_ENDPATH; + static EMR_CLOSEFIGURE;static EMR_FILLPATH;static EMR_STROKEANDFILLPATH; + static EMR_STROKEPATH;static EMR_FLATTENPATH;static EMR_WIDENPATH; + static EMR_SELECTCLIPPATH;static EMR_ABORTPATH;static EMR_GDICOMMENT; + static EMR_FILLRGN;static EMR_FRAMERGN;static EMR_INVERTRGN; + static EMR_PAINTRGN;static EMR_EXTSELECTCLIPRGN;static EMR_BITBLT; + static EMR_STRETCHBLT;static EMR_MASKBLT;static EMR_PLGBLT; + static EMR_SETDIBITSTODEVICE;static EMR_STRETCHDIBITS;static EMR_EXTCREATEFONTINDIRECTW; + static EMR_EXTTEXTOUTA;static EMR_EXTTEXTOUTW;static EMR_POLYBEZIER16; + static EMR_POLYGON16;static EMR_POLYLINE16;static EMR_POLYBEZIERTO16; + static EMR_POLYLINETO16;static EMR_POLYPOLYLINE16;static EMR_POLYPOLYGON16; + static EMR_POLYDRAW16;static EMR_CREATEMONOBRUSH;static EMR_CREATEDIBPATTERNBRUSHPT; + static EMR_EXTCREATEPEN;static EMR_POLYTEXTOUTA;static EMR_POLYTEXTOUTW; + static EMR_SETICMMODE;static EMR_CREATECOLORSPACE;static EMR_SETCOLORSPACE; + static EMR_DELETECOLORSPACE;static EMR_GLSRECORD;static EMR_GLSBOUNDEDRECORD; + static EMR_PIXELFORMAT;static EMR_RESERVED_105;static EMR_RESERVED_106; + static EMR_RESERVED_107;static EMR_RESERVED_108;static EMR_RESERVED_109; + static EMR_RESERVED_110;static EMR_COLORCORRECTPALETTE;static EMR_SETICMPROFILEA; + static EMR_SETICMPROFILEW;static EMR_ALPHABLEND;static EMR_SETLAYOUT; + static EMR_TRANSPARENTBLT;static EMR_RESERVED_117;static EMR_GRADIENTFILL; + static EMR_RESERVED_119;static EMR_RESERVED_120;static EMR_COLORMATCHTOTARGETW; + static EMR_CREATECOLORSPACEW;static EMR_MIN;static EMR_MAX; + static SETICMPROFILE_EMBEDED;static CREATECOLORSPACE_EMBEDED;static COLORMATCHTOTARGET_EMBEDED; + static GDICOMMENT_IDENTIFIER;static GDICOMMENT_WINDOWS_METAFILE;static GDICOMMENT_BEGINGROUP; + static GDICOMMENT_ENDGROUP;static GDICOMMENT_MULTIFORMATS;static EPS_SIGNATURE; + static GDICOMMENT_UNICODE_STRING;static GDICOMMENT_UNICODE_END;static WGL_FONT_LINES; + static WGL_FONT_POLYGONS;static LPD_DOUBLEBUFFER;static LPD_STEREO; + static LPD_SUPPORT_GDI;static LPD_SUPPORT_OPENGL;static LPD_SHARE_DEPTH; + static LPD_SHARE_STENCIL;static LPD_SHARE_ACCUM;static LPD_SWAP_EXCHANGE; + static LPD_SWAP_COPY;static LPD_TRANSPARENT;static LPD_TYPE_RGBA; + static LPD_TYPE_COLORINDEX;static WGL_SWAP_MAIN_PLANE;static WGL_SWAP_OVERLAY1; + static WGL_SWAP_OVERLAY2;static WGL_SWAP_OVERLAY3;static WGL_SWAP_OVERLAY4; + static WGL_SWAP_OVERLAY5;static WGL_SWAP_OVERLAY6;static WGL_SWAP_OVERLAY7; + static WGL_SWAP_OVERLAY8;static WGL_SWAP_OVERLAY9;static WGL_SWAP_OVERLAY10; + static WGL_SWAP_OVERLAY11;static WGL_SWAP_OVERLAY12;static WGL_SWAP_OVERLAY13; + static WGL_SWAP_OVERLAY14;static WGL_SWAP_OVERLAY15;static WGL_SWAP_UNDERLAY1; + static WGL_SWAP_UNDERLAY2;static WGL_SWAP_UNDERLAY3;static WGL_SWAP_UNDERLAY4; + static WGL_SWAP_UNDERLAY5;static WGL_SWAP_UNDERLAY6;static WGL_SWAP_UNDERLAY7; + static WGL_SWAP_UNDERLAY8;static WGL_SWAP_UNDERLAY9;static WGL_SWAP_UNDERLAY10; + static WGL_SWAP_UNDERLAY11;static WGL_SWAP_UNDERLAY12;static WGL_SWAP_UNDERLAY13; + static WGL_SWAP_UNDERLAY14;static WGL_SWAP_UNDERLAY15;static WGL_SWAPMULTIPLE_MAX; + + class function sinit(); + begin + WINGDIAPI := 0x0;WINSPOOLAPI := 0x0;WINVER := 0x500; + R2_BLACK := 0x1;R2_NOTMERGEPEN := 0x2;R2_MASKNOTPEN := 0x3; + R2_NOTCOPYPEN := 0x4;R2_MASKPENNOT := 0x5;R2_NOT := 0x6; + R2_XORPEN := 0x7;R2_NOTMASKPEN := 0x8;R2_MASKPEN := 0x9; + R2_NOTXORPEN := 0xA;R2_NOP := 0xB;R2_MERGENOTPEN := 0xC; + R2_COPYPEN := 0xD;R2_MERGEPENNOT := 0xE;R2_MERGEPEN := 0xF; + R2_WHITE := 0x10;R2_LAST := 0x10;SRCCOPY := 0xCC0020; + SRCPAINT := 0xEE0086;SRCAND := 0x8800C6;SRCINVERT := 0x660046; + SRCERASE := 0x440328;NOTSRCCOPY := 0x330008;NOTSRCERASE := 0x1100A6; + MERGECOPY := 0xC000CA;MERGEPAINT := 0xBB0226;PATCOPY := 0xF00021; + PATPAINT := 0xFB0A09;PATINVERT := 0x5A0049;DSTINVERT := 0x550009; + BLACKNESS := 0x42;WHITENESS := 0xFF0062;NOMIRRORBITMAP := 0x80000000; + CAPTUREBLT := 0x40000000;GDI_ERROR := 0xFFFFFFFF;HGDI_ERROR := 0xFFFFFFFF; + ERROR := 0x0;NULLREGION := 0x1;SIMPLEREGION := 0x2; + COMPLEXREGION := 0x3;RGN_ERROR := 0x0;RGN_AND := 0x1; + RGN_OR := 0x2;RGN_XOR := 0x3;RGN_DIFF := 0x4; + RGN_COPY := 0x5;RGN_MIN := 0x1;RGN_MAX := 0x5; + BLACKONWHITE := 0x1;WHITEONBLACK := 0x2;COLORONCOLOR := 0x3; + HALFTONE := 0x4;MAXSTRETCHBLTMODE := 0x4;STRETCH_ANDSCANS := 0x1; + STRETCH_ORSCANS := 0x2;STRETCH_DELETESCANS := 0x3;STRETCH_HALFTONE := 0x4; + ALTERNATE := 0x1;WINDING := 0x2;POLYFILL_LAST := 0x2; + LAYOUT_RTL := 0x1;LAYOUT_BTT := 0x2;LAYOUT_VBH := 0x4; + LAYOUT_ORIENTATIONMASK := 0x7;LAYOUT_BITMAPORIENTATIONPRESERVED := 0x8;TA_NOUPDATECP := 0x0; + TA_UPDATECP := 0x1;TA_LEFT := 0x0;TA_RIGHT := 0x2; + TA_CENTER := 0x6;TA_TOP := 0x0;TA_BOTTOM := 0x8; + TA_BASELINE := 0x18;TA_RTLREADING := 0x100;TA_MASK := 0x11F; + VTA_BASELINE := 0x18;VTA_LEFT := 0x8;VTA_RIGHT := 0x0; + VTA_CENTER := 0x6;VTA_BOTTOM := 0x2;VTA_TOP := 0x0; + ETO_OPAQUE := 0x2;ETO_CLIPPED := 0x4;ETO_GLYPH_INDEX := 0x10; + ETO_RTLREADING := 0x80;ETO_NUMERICSLOCAL := 0x400;ETO_NUMERICSLATIN := 0x800; + ETO_IGNORELANGUAGE := 0x1000;ETO_PDY := 0x2000;ETO_REVERSE_INDEX_MAP := 0x10000; + ASPECT_FILTERING := 0x1;DCB_RESET := 0x1;DCB_ACCUMULATE := 0x2; + DCB_DIRTY := 0x2;DCB_SET := 0x3;DCB_ENABLE := 0x4; + DCB_DISABLE := 0x8;META_SETBKCOLOR := 0x201;META_SETBKMODE := 0x102; + META_SETMAPMODE := 0x103;META_SETROP2 := 0x104;META_SETRELABS := 0x105; + META_SETPOLYFILLMODE := 0x106;META_SETSTRETCHBLTMODE := 0x107;META_SETTEXTCHAREXTRA := 0x108; + META_SETTEXTCOLOR := 0x209;META_SETTEXTJUSTIFICATION := 0x20A;META_SETWINDOWORG := 0x20B; + META_SETWINDOWEXT := 0x20C;META_SETVIEWPORTORG := 0x20D;META_SETVIEWPORTEXT := 0x20E; + META_OFFSETWINDOWORG := 0x20F;META_SCALEWINDOWEXT := 0x410;META_OFFSETVIEWPORTORG := 0x211; + META_SCALEVIEWPORTEXT := 0x412;META_LINETO := 0x213;META_MOVETO := 0x214; + META_EXCLUDECLIPRECT := 0x415;META_INTERSECTCLIPRECT := 0x416;META_ARC := 0x817; + META_ELLIPSE := 0x418;META_FLOODFILL := 0x419;META_PIE := 0x81A; + META_RECTANGLE := 0x41B;META_ROUNDRECT := 0x61C;META_PATBLT := 0x61D; + META_SAVEDC := 0x1E;META_SETPIXEL := 0x41F;META_OFFSETCLIPRGN := 0x220; + META_TEXTOUT := 0x521;META_BITBLT := 0x922;META_STRETCHBLT := 0xB23; + META_POLYGON := 0x324;META_POLYLINE := 0x325;META_ESCAPE := 0x626; + META_RESTOREDC := 0x127;META_FILLREGION := 0x228;META_FRAMEREGION := 0x429; + META_INVERTREGION := 0x12A;META_PAINTREGION := 0x12B;META_SELECTCLIPREGION := 0x12C; + META_SELECTOBJECT := 0x12D;META_SETTEXTALIGN := 0x12E;META_CHORD := 0x830; + META_SETMAPPERFLAGS := 0x231;META_EXTTEXTOUT := 0xA32;META_SETDIBTODEV := 0xD33; + META_SELECTPALETTE := 0x234;META_REALIZEPALETTE := 0x35;META_ANIMATEPALETTE := 0x436; + META_SETPALENTRIES := 0x37;META_POLYPOLYGON := 0x538;META_RESIZEPALETTE := 0x139; + META_DIBBITBLT := 0x940;META_DIBSTRETCHBLT := 0xB41;META_DIBCREATEPATTERNBRUSH := 0x142; + META_STRETCHDIB := 0xF43;META_EXTFLOODFILL := 0x548;META_SETLAYOUT := 0x149; + META_DELETEOBJECT := 0x1F0;META_CREATEPALETTE := 0xF7;META_CREATEPATTERNBRUSH := 0x1F9; + META_CREATEPENINDIRECT := 0x2FA;META_CREATEFONTINDIRECT := 0x2FB;META_CREATEBRUSHINDIRECT := 0x2FC; + META_CREATEREGION := 0x6FF;NEWFRAME := 0x1;ABORTDOC := 0x2; + NEXTBAND := 0x3;SETCOLORTABLE := 0x4;GETCOLORTABLE := 0x5; + FLUSHOUTPUT := 0x6;DRAFTMODE := 0x7;QUERYESCSUPPORT := 0x8; + SETABORTPROC := 0x9;STARTDOC := 0xA;ENDDOC := 0xB; + GETPHYSPAGESIZE := 0xC;GETPRINTINGOFFSET := 0xD;GETSCALINGFACTOR := 0xE; + MFCOMMENT := 0xF;GETPENWIDTH := 0x10;SETCOPYCOUNT := 0x11; + SELECTPAPERSOURCE := 0x12;DEVICEDATA := 0x13;PASSTHROUGH := 0x13; + GETTECHNOLGY := 0x14;GETTECHNOLOGY := 0x14;SETLINECAP := 0x15; + SETLINEJOIN := 0x16;SETMITERLIMIT := 0x17;BANDINFO := 0x18; + DRAWPATTERNRECT := 0x19;GETVECTORPENSIZE := 0x1A;GETVECTORBRUSHSIZE := 0x1B; + ENABLEDUPLEX := 0x1C;GETSETPAPERBINS := 0x1D;GETSETPRINTORIENT := 0x1E; + ENUMPAPERBINS := 0x1F;SETDIBSCALING := 0x20;EPSPRINTING := 0x21; + ENUMPAPERMETRICS := 0x22;GETSETPAPERMETRICS := 0x23;POSTSCRIPT_DATA := 0x25; + POSTSCRIPT_IGNORE := 0x26;MOUSETRAILS := 0x27;GETDEVICEUNITS := 0x2A; + GETEXTENDEDTEXTMETRICS := 0x100;GETEXTENTTABLE := 0x101;GETPAIRKERNTABLE := 0x102; + GETTRACKKERNTABLE := 0x103;EXTTEXTOUT := 0x200;GETFACENAME := 0x201; + DOWNLOADFACE := 0x202;ENABLERELATIVEWIDTHS := 0x300;ENABLEPAIRKERNING := 0x301; + SETKERNTRACK := 0x302;SETALLJUSTVALUES := 0x303;SETCHARSET := 0x304; + STRETCHBLT := 0x800;METAFILE_DRIVER := 0x801;GETSETSCREENPARAMS := 0xC00; + QUERYDIBSUPPORT := 0xC01;BEGIN_PATH := 0x1000;CLIP_TO_PATH := 0x1001; + END_PATH := 0x1002;EXT_DEVICE_CAPS := 0x1003;RESTORE_CTM := 0x1004; + SAVE_CTM := 0x1005;SET_ARC_DIRECTION := 0x1006;SET_BACKGROUND_COLOR := 0x1007; + SET_POLY_MODE := 0x1008;SET_SCREEN_ANGLE := 0x1009;SET_SPREAD := 0x100A; + TRANSFORM_CTM := 0x100B;SET_CLIP_BOX := 0x100C;SET_BOUNDS := 0x100D; + SET_MIRROR_MODE := 0x100E;OPENCHANNEL := 0x100E;DOWNLOADHEADER := 0x100F; + CLOSECHANNEL := 0x1010;POSTSCRIPT_PASSTHROUGH := 0x1013;ENCAPSULATED_POSTSCRIPT := 0x1014; + POSTSCRIPT_IDENTIFY := 0x1015;POSTSCRIPT_INJECTION := 0x1016;CHECKJPEGFORMAT := 0x1017; + CHECKPNGFORMAT := 0x1018;GET_PS_FEATURESETTING := 0x1019;GDIPLUS_TS_QUERYVER := 0x101A; + GDIPLUS_TS_RECORD := 0x101B;MILCORE_TS_QUERYVER_RESULT_FALSE := 0x0;MILCORE_TS_QUERYVER_RESULT_TRUE := 0x7FFFFFFF; + SPCLPASSTHROUGH2 := 0x11D8;PSIDENT_GDICENTRIC := 0x0;PSIDENT_PSCENTRIC := 0x1; + PSINJECT_BEGINSTREAM := 0x1;PSINJECT_PSADOBE := 0x2;PSINJECT_PAGESATEND := 0x3; + PSINJECT_PAGES := 0x4;PSINJECT_DOCNEEDEDRES := 0x5;PSINJECT_DOCSUPPLIEDRES := 0x6; + PSINJECT_PAGEORDER := 0x7;PSINJECT_ORIENTATION := 0x8;PSINJECT_BOUNDINGBOX := 0x9; + PSINJECT_DOCUMENTPROCESSCOLORS := 0xA;PSINJECT_COMMENTS := 0xB;PSINJECT_BEGINDEFAULTS := 0xC; + PSINJECT_ENDDEFAULTS := 0xD;PSINJECT_BEGINPROLOG := 0xE;PSINJECT_ENDPROLOG := 0xF; + PSINJECT_BEGINSETUP := 0x10;PSINJECT_ENDSETUP := 0x11;PSINJECT_TRAILER := 0x12; + PSINJECT_EOF := 0x13;PSINJECT_ENDSTREAM := 0x14;PSINJECT_DOCUMENTPROCESSCOLORSATEND := 0x15; + PSINJECT_PAGENUMBER := 0x64;PSINJECT_BEGINPAGESETUP := 0x65;PSINJECT_ENDPAGESETUP := 0x66; + PSINJECT_PAGETRAILER := 0x67;PSINJECT_PLATECOLOR := 0x68;PSINJECT_SHOWPAGE := 0x69; + PSINJECT_PAGEBBOX := 0x6A;PSINJECT_ENDPAGECOMMENTS := 0x6B;PSINJECT_VMSAVE := 0xC8; + PSINJECT_VMRESTORE := 0xC9;PSINJECT_DLFONT := 0xDDDDDDDD;FEATURESETTING_NUP := 0x0; + FEATURESETTING_OUTPUT := 0x1;FEATURESETTING_PSLEVEL := 0x2;FEATURESETTING_CUSTPAPER := 0x3; + FEATURESETTING_MIRROR := 0x4;FEATURESETTING_NEGATIVE := 0x5;FEATURESETTING_PROTOCOL := 0x6; + FEATURESETTING_PRIVATE_BEGIN := 0x1000;FEATURESETTING_PRIVATE_END := 0x1FFF;PSPROTOCOL_ASCII := 0x0; + PSPROTOCOL_BCP := 0x1;PSPROTOCOL_TBCP := 0x2;PSPROTOCOL_BINARY := 0x3; + QDI_SETDIBITS := 0x1;QDI_GETDIBITS := 0x2;QDI_DIBTOSCREEN := 0x4; + QDI_STRETCHDIB := 0x8;SP_NOTREPORTED := 0x4000;SP_ERROR := 0xFFFFFFFF; + SP_APPABORT := 0xFFFFFFFE;SP_USERABORT := 0xFFFFFFFD;SP_OUTOFDISK := 0xFFFFFFFC; + SP_OUTOFMEMORY := 0xFFFFFFFB;PR_JOBSTATUS := 0x0;OBJ_PEN := 0x1; + OBJ_BRUSH := 0x2;OBJ_DC := 0x3;OBJ_METADC := 0x4; + OBJ_PAL := 0x5;OBJ_FONT := 0x6;OBJ_BITMAP := 0x7; + OBJ_REGION := 0x8;OBJ_METAFILE := 0x9;OBJ_MEMDC := 0xA; + OBJ_EXTPEN := 0xB;OBJ_ENHMETADC := 0xC;OBJ_ENHMETAFILE := 0xD; + OBJ_COLORSPACE := 0xE;GDI_OBJ_LAST := 0xE;MWT_IDENTITY := 0x1; + MWT_LEFTMULTIPLY := 0x2;MWT_RIGHTMULTIPLY := 0x3;MWT_MIN := 0x1; + MWT_MAX := 0x3;CS_ENABLE := 0x1;CS_DISABLE := 0x2; + CS_DELETE_TRANSFORM := 0x3;LCS_SIGNATURE := "PSOC";LCS_SRGB := "sRGB"; + LCS_WINDOWS_COLOR_SPACE := "Win ";LCS_CALIBRATED_RGB := 0x0;LCS_GM_BUSINESS := 0x1; + LCS_GM_GRAPHICS := 0x2;LCS_GM_IMAGES := 0x4;LCS_GM_ABS_COLORIMETRIC := 0x8; + CM_OUT_OF_GAMUT := 0xFF;CM_IN_GAMUT := 0x0;ICM_ADDPROFILE := 0x1; + ICM_DELETEPROFILE := 0x2;ICM_QUERYPROFILE := 0x3;ICM_SETDEFAULTPROFILE := 0x4; + ICM_REGISTERICMATCHER := 0x5;ICM_UNREGISTERICMATCHER := 0x6;ICM_QUERYMATCH := 0x7; + PROFILE_LINKED := "LINK";PROFILE_EMBEDDED := "MBED";BI_RGB := 0x0; + BI_RLE8 := 0x1;BI_RLE4 := 0x2;BI_BITFIELDS := 0x3; + BI_JPEG := 0x4;BI_PNG := 0x5;TCI_SRCCHARSET := 0x1; + TCI_SRCCODEPAGE := 0x2;TCI_SRCFONTSIG := 0x3;TCI_SRCLOCALE := 0x1000; + TMPF_FIXED_PITCH := 0x1;TMPF_VECTOR := 0x2;TMPF_DEVICE := 0x8; + TMPF_TRUETYPE := 0x4;NTM_REGULAR := 0x40;NTM_BOLD := 0x20; + NTM_ITALIC := 0x1;NTM_NONNEGATIVE_AC := 0x10000;NTM_PS_OPENTYPE := 0x20000; + NTM_TT_OPENTYPE := 0x40000;NTM_MULTIPLEMASTER := 0x80000;NTM_TYPE1 := 0x100000; + NTM_DSIG := 0x200000;LF_FACESIZE := 0x20;LF_FULLFACESIZE := 0x40; + OUT_DEFAULT_PRECIS := 0x0;OUT_STRING_PRECIS := 0x1;OUT_CHARACTER_PRECIS := 0x2; + OUT_STROKE_PRECIS := 0x3;OUT_TT_PRECIS := 0x4;OUT_DEVICE_PRECIS := 0x5; + OUT_RASTER_PRECIS := 0x6;OUT_TT_ONLY_PRECIS := 0x7;OUT_OUTLINE_PRECIS := 0x8; + OUT_SCREEN_OUTLINE_PRECIS := 0x9;OUT_PS_ONLY_PRECIS := 0xA;CLIP_DEFAULT_PRECIS := 0x0; + CLIP_CHARACTER_PRECIS := 0x1;CLIP_STROKE_PRECIS := 0x2;CLIP_MASK := 0xF; + CLIP_LH_ANGLES := 0x10;CLIP_TT_ALWAYS := 0x20;CLIP_DFA_DISABLE := 0x40; + CLIP_EMBEDDED := 0x80;DEFAULT_QUALITY := 0x0;DRAFT_QUALITY := 0x1; + PROOF_QUALITY := 0x2;NONANTIALIASED_QUALITY := 0x3;ANTIALIASED_QUALITY := 0x4; + CLEARTYPE_QUALITY := 0x5;CLEARTYPE_NATURAL_QUALITY := 0x6;DEFAULT_PITCH := 0x0; + FIXED_PITCH := 0x1;VARIABLE_PITCH := 0x2;MONO_FONT := 0x8; + ANSI_CHARSET := 0x0;DEFAULT_CHARSET := 0x1;SYMBOL_CHARSET := 0x2; + SHIFTJIS_CHARSET := 0x80;HANGEUL_CHARSET := 0x81;HANGUL_CHARSET := 0x81; + GB2312_CHARSET := 0x86;CHINESEBIG5_CHARSET := 0x88;OEM_CHARSET := 0xFF; + JOHAB_CHARSET := 0x82;HEBREW_CHARSET := 0xB1;ARABIC_CHARSET := 0xB2; + GREEK_CHARSET := 0xA1;TURKISH_CHARSET := 0xA2;VIETNAMESE_CHARSET := 0xA3; + THAI_CHARSET := 0xDE;EASTEUROPE_CHARSET := 0xEE;RUSSIAN_CHARSET := 0xCC; + MAC_CHARSET := 0x4D;BALTIC_CHARSET := 0xBA;FS_LATIN1 := 0x1; + FS_LATIN2 := 0x2;FS_CYRILLIC := 0x4;FS_GREEK := 0x8; + FS_TURKISH := 0x10;FS_HEBREW := 0x20;FS_ARABIC := 0x40; + FS_BALTIC := 0x80;FS_VIETNAMESE := 0x100;FS_THAI := 0x10000; + FS_JISJAPAN := 0x20000;FS_CHINESESIMP := 0x40000;FS_WANSUNG := 0x80000; + FS_CHINESETRAD := 0x100000;FS_JOHAB := 0x200000;FS_SYMBOL := 0x80000000; + FF_DONTCARE := 0x0;FF_ROMAN := 0x10;FF_SWISS := 0x20; + FF_MODERN := 0x30;FF_SCRIPT := 0x40;FF_DECORATIVE := 0x50; + FW_DONTCARE := 0x0;FW_THIN := 0x64;FW_EXTRALIGHT := 0xC8; + FW_LIGHT := 0x12C;FW_NORMAL := 0x190;FW_MEDIUM := 0x1F4; + FW_SEMIBOLD := 0x258;FW_BOLD := 0x2BC;FW_EXTRABOLD := 0x320; + FW_HEAVY := 0x384;FW_ULTRALIGHT := 0xC8;FW_REGULAR := 0x190; + FW_DEMIBOLD := 0x258;FW_ULTRABOLD := 0x320;FW_BLACK := 0x384; + PANOSE_COUNT := 0xA;PAN_FAMILYTYPE_INDEX := 0x0;PAN_SERIFSTYLE_INDEX := 0x1; + PAN_WEIGHT_INDEX := 0x2;PAN_PROPORTION_INDEX := 0x3;PAN_CONTRAST_INDEX := 0x4; + PAN_STROKEVARIATION_INDEX := 0x5;PAN_ARMSTYLE_INDEX := 0x6;PAN_LETTERFORM_INDEX := 0x7; + PAN_MIDLINE_INDEX := 0x8;PAN_XHEIGHT_INDEX := 0x9;PAN_CULTURE_LATIN := 0x0; + PAN_ANY := 0x0;PAN_NO_FIT := 0x1;PAN_FAMILY_TEXT_DISPLAY := 0x2; + PAN_FAMILY_SCRIPT := 0x3;PAN_FAMILY_DECORATIVE := 0x4;PAN_FAMILY_PICTORIAL := 0x5; + PAN_SERIF_COVE := 0x2;PAN_SERIF_OBTUSE_COVE := 0x3;PAN_SERIF_SQUARE_COVE := 0x4; + PAN_SERIF_OBTUSE_SQUARE_COVE := 0x5;PAN_SERIF_SQUARE := 0x6;PAN_SERIF_THIN := 0x7; + PAN_SERIF_BONE := 0x8;PAN_SERIF_EXAGGERATED := 0x9;PAN_SERIF_TRIANGLE := 0xA; + PAN_SERIF_NORMAL_SANS := 0xB;PAN_SERIF_OBTUSE_SANS := 0xC;PAN_SERIF_PERP_SANS := 0xD; + PAN_SERIF_FLARED := 0xE;PAN_SERIF_ROUNDED := 0xF;PAN_WEIGHT_VERY_LIGHT := 0x2; + PAN_WEIGHT_LIGHT := 0x3;PAN_WEIGHT_THIN := 0x4;PAN_WEIGHT_BOOK := 0x5; + PAN_WEIGHT_MEDIUM := 0x6;PAN_WEIGHT_DEMI := 0x7;PAN_WEIGHT_BOLD := 0x8; + PAN_WEIGHT_HEAVY := 0x9;PAN_WEIGHT_BLACK := 0xA;PAN_WEIGHT_NORD := 0xB; + PAN_PROP_OLD_STYLE := 0x2;PAN_PROP_MODERN := 0x3;PAN_PROP_EVEN_WIDTH := 0x4; + PAN_PROP_EXPANDED := 0x5;PAN_PROP_CONDENSED := 0x6;PAN_PROP_VERY_EXPANDED := 0x7; + PAN_PROP_VERY_CONDENSED := 0x8;PAN_PROP_MONOSPACED := 0x9;PAN_CONTRAST_NONE := 0x2; + PAN_CONTRAST_VERY_LOW := 0x3;PAN_CONTRAST_LOW := 0x4;PAN_CONTRAST_MEDIUM_LOW := 0x5; + PAN_CONTRAST_MEDIUM := 0x6;PAN_CONTRAST_MEDIUM_HIGH := 0x7;PAN_CONTRAST_HIGH := 0x8; + PAN_CONTRAST_VERY_HIGH := 0x9;PAN_STROKE_GRADUAL_DIAG := 0x2;PAN_STROKE_GRADUAL_TRAN := 0x3; + PAN_STROKE_GRADUAL_VERT := 0x4;PAN_STROKE_GRADUAL_HORZ := 0x5;PAN_STROKE_RAPID_VERT := 0x6; + PAN_STROKE_RAPID_HORZ := 0x7;PAN_STROKE_INSTANT_VERT := 0x8;PAN_STRAIGHT_ARMS_HORZ := 0x2; + PAN_STRAIGHT_ARMS_WEDGE := 0x3;PAN_STRAIGHT_ARMS_VERT := 0x4;PAN_STRAIGHT_ARMS_SINGLE_SERIF := 0x5; + PAN_STRAIGHT_ARMS_DOUBLE_SERIF := 0x6;PAN_BENT_ARMS_HORZ := 0x7;PAN_BENT_ARMS_WEDGE := 0x8; + PAN_BENT_ARMS_VERT := 0x9;PAN_BENT_ARMS_SINGLE_SERIF := 0xA;PAN_BENT_ARMS_DOUBLE_SERIF := 0xB; + PAN_LETT_NORMAL_CONTACT := 0x2;PAN_LETT_NORMAL_WEIGHTED := 0x3;PAN_LETT_NORMAL_BOXED := 0x4; + PAN_LETT_NORMAL_FLATTENED := 0x5;PAN_LETT_NORMAL_ROUNDED := 0x6;PAN_LETT_NORMAL_OFF_CENTER := 0x7; + PAN_LETT_NORMAL_SQUARE := 0x8;PAN_LETT_OBLIQUE_CONTACT := 0x9;PAN_LETT_OBLIQUE_WEIGHTED := 0xA; + PAN_LETT_OBLIQUE_BOXED := 0xB;PAN_LETT_OBLIQUE_FLATTENED := 0xC;PAN_LETT_OBLIQUE_ROUNDED := 0xD; + PAN_LETT_OBLIQUE_OFF_CENTER := 0xE;PAN_LETT_OBLIQUE_SQUARE := 0xF;PAN_MIDLINE_STANDARD_TRIMMED := 0x2; + PAN_MIDLINE_STANDARD_POINTED := 0x3;PAN_MIDLINE_STANDARD_SERIFED := 0x4;PAN_MIDLINE_HIGH_TRIMMED := 0x5; + PAN_MIDLINE_HIGH_POINTED := 0x6;PAN_MIDLINE_HIGH_SERIFED := 0x7;PAN_MIDLINE_CONSTANT_TRIMMED := 0x8; + PAN_MIDLINE_CONSTANT_POINTED := 0x9;PAN_MIDLINE_CONSTANT_SERIFED := 0xA;PAN_MIDLINE_LOW_TRIMMED := 0xB; + PAN_MIDLINE_LOW_POINTED := 0xC;PAN_MIDLINE_LOW_SERIFED := 0xD;PAN_XHEIGHT_CONSTANT_SMALL := 0x2; + PAN_XHEIGHT_CONSTANT_STD := 0x3;PAN_XHEIGHT_CONSTANT_LARGE := 0x4;PAN_XHEIGHT_DUCKING_SMALL := 0x5; + PAN_XHEIGHT_DUCKING_STD := 0x6;PAN_XHEIGHT_DUCKING_LARGE := 0x7;ELF_VENDOR_SIZE := 0x4; + ELF_VERSION := 0x0;ELF_CULTURE_LATIN := 0x0;RASTER_FONTTYPE := 0x1; + DEVICE_FONTTYPE := 0x2;TRUETYPE_FONTTYPE := 0x4;PC_RESERVED := 0x1; + PC_EXPLICIT := 0x2;PC_NOCOLLAPSE := 0x4;TRANSPARENT := 0x1; + OPAQUE := 0x2;BKMODE_LAST := 0x2;GM_COMPATIBLE := 0x1; + GM_ADVANCED := 0x2;GM_LAST := 0x2;PT_CLOSEFIGURE := 0x1; + PT_LINETO := 0x2;PT_BEZIERTO := 0x4;PT_MOVETO := 0x6; + MM_TEXT := 0x1;MM_LOMETRIC := 0x2;MM_HIMETRIC := 0x3; + MM_LOENGLISH := 0x4;MM_HIENGLISH := 0x5;MM_TWIPS := 0x6; + MM_ISOTROPIC := 0x7;MM_ANISOTROPIC := 0x8;MM_MIN := 0x1; + MM_MAX := 0x8;MM_MAX_FIXEDSCALE := 0x6;ABSOLUTE := 0x1; + RELATIVE := 0x2;WHITE_BRUSH := 0x0;LTGRAY_BRUSH := 0x1; + GRAY_BRUSH := 0x2;DKGRAY_BRUSH := 0x3;BLACK_BRUSH := 0x4; + NULL_BRUSH := 0x5;HOLLOW_BRUSH := 0x5;WHITE_PEN := 0x6; + BLACK_PEN := 0x7;NULL_PEN := 0x8;OEM_FIXED_FONT := 0xA; + ANSI_FIXED_FONT := 0xB;ANSI_VAR_FONT := 0xC;SYSTEM_FONT := 0xD; + DEVICE_DEFAULT_FONT := 0xE;DEFAULT_PALETTE := 0xF;SYSTEM_FIXED_FONT := 0x10; + DEFAULT_GUI_FONT := 0x11;DC_BRUSH := 0x12;DC_PEN := 0x13; + STOCK_LAST := 0x13;CLR_INVALID := 0xFFFFFFFF;BS_SOLID := 0x0; + BS_NULL := 0x1;BS_HOLLOW := 0x1;BS_HATCHED := 0x2; + BS_PATTERN := 0x3;BS_INDEXED := 0x4;BS_DIBPATTERN := 0x5; + BS_DIBPATTERNPT := 0x6;BS_PATTERN8X8 := 0x7;BS_DIBPATTERN8X8 := 0x8; + BS_MONOPATTERN := 0x9;HS_HORIZONTAL := 0x0;HS_VERTICAL := 0x1; + HS_FDIAGONAL := 0x2;HS_BDIAGONAL := 0x3;HS_CROSS := 0x4; + HS_DIAGCROSS := 0x5;HS_API_MAX := 0xC;PS_SOLID := 0x0; + PS_DASH := 0x1;PS_DOT := 0x2;PS_DASHDOT := 0x3; + PS_DASHDOTDOT := 0x4;PS_NULL := 0x5;PS_INSIDEFRAME := 0x6; + PS_USERSTYLE := 0x7;PS_ALTERNATE := 0x8;PS_STYLE_MASK := 0xF; + PS_ENDCAP_ROUND := 0x0;PS_ENDCAP_SQUARE := 0x100;PS_ENDCAP_FLAT := 0x200; + PS_ENDCAP_MASK := 0xF00;PS_JOIN_ROUND := 0x0;PS_JOIN_BEVEL := 0x1000; + PS_JOIN_MITER := 0x2000;PS_JOIN_MASK := 0xF000;PS_COSMETIC := 0x0; + PS_GEOMETRIC := 0x10000;PS_TYPE_MASK := 0xF0000;AD_COUNTERCLOCKWISE := 0x1; + AD_CLOCKWISE := 0x2;DRIVERVERSION := 0x0;TECHNOLOGY := 0x2; + HORZSIZE := 0x4;VERTSIZE := 0x6;HORZRES := 0x8; + VERTRES := 0xA;BITSPIXEL := 0xC;PLANES := 0xE; + NUMBRUSHES := 0x10;NUMPENS := 0x12;NUMMARKERS := 0x14; + NUMFONTS := 0x16;NUMCOLORS := 0x18;PDEVICESIZE := 0x1A; + CURVECAPS := 0x1C;LINECAPS := 0x1E;POLYGONALCAPS := 0x20; + TEXTCAPS := 0x22;CLIPCAPS := 0x24;RASTERCAPS := 0x26; + ASPECTX := 0x28;ASPECTY := 0x2A;ASPECTXY := 0x2C; + LOGPIXELSX := 0x58;LOGPIXELSY := 0x5A;SIZEPALETTE := 0x68; + NUMRESERVED := 0x6A;COLORRES := 0x6C;PHYSICALWIDTH := 0x6E; + PHYSICALHEIGHT := 0x6F;PHYSICALOFFSETX := 0x70;PHYSICALOFFSETY := 0x71; + SCALINGFACTORX := 0x72;SCALINGFACTORY := 0x73;VREFRESH := 0x74; + DESKTOPVERTRES := 0x75;DESKTOPHORZRES := 0x76;BLTALIGNMENT := 0x77; + SHADEBLENDCAPS := 0x78;COLORMGMTCAPS := 0x79;DT_PLOTTER := 0x0; + DT_RASDISPLAY := 0x1;DT_RASPRINTER := 0x2;DT_RASCAMERA := 0x3; + DT_CHARSTREAM := 0x4;DT_METAFILE := 0x5;DT_DISPFILE := 0x6; + CC_NONE := 0x0;CC_CIRCLES := 0x1;CC_PIE := 0x2; + CC_CHORD := 0x4;CC_ELLIPSES := 0x8;CC_WIDE := 0x10; + CC_STYLED := 0x20;CC_WIDESTYLED := 0x40;CC_INTERIORS := 0x80; + CC_ROUNDRECT := 0x100;LC_NONE := 0x0;LC_POLYLINE := 0x2; + LC_MARKER := 0x4;LC_POLYMARKER := 0x8;LC_WIDE := 0x10; + LC_STYLED := 0x20;LC_WIDESTYLED := 0x40;LC_INTERIORS := 0x80; + PC_NONE := 0x0;PC_POLYGON := 0x1;PC_RECTANGLE := 0x2; + PC_WINDPOLYGON := 0x4;PC_TRAPEZOID := 0x4;PC_SCANLINE := 0x8; + PC_WIDE := 0x10;PC_STYLED := 0x20;PC_WIDESTYLED := 0x40; + PC_INTERIORS := 0x80;PC_POLYPOLYGON := 0x100;PC_PATHS := 0x200; + CP_NONE := 0x0;CP_RECTANGLE := 0x1;CP_REGION := 0x2; + TC_OP_CHARACTER := 0x1;TC_OP_STROKE := 0x2;TC_CP_STROKE := 0x4; + TC_CR_90 := 0x8;TC_CR_ANY := 0x10;TC_SF_X_YINDEP := 0x20; + TC_SA_DOUBLE := 0x40;TC_SA_INTEGER := 0x80;TC_SA_CONTIN := 0x100; + TC_EA_DOUBLE := 0x200;TC_IA_ABLE := 0x400;TC_UA_ABLE := 0x800; + TC_SO_ABLE := 0x1000;TC_RA_ABLE := 0x2000;TC_VA_ABLE := 0x4000; + TC_RESERVED := 0x8000;TC_SCROLLBLT := 0x10000;RC_BITBLT := 0x1; + RC_BANDING := 0x2;RC_SCALING := 0x4;RC_BITMAP64 := 0x8; + RC_GDI20_OUTPUT := 0x10;RC_GDI20_STATE := 0x20;RC_SAVEBITMAP := 0x40; + RC_DI_BITMAP := 0x80;RC_PALETTE := 0x100;RC_DIBTODEV := 0x200; + RC_BIGFONT := 0x400;RC_STRETCHBLT := 0x800;RC_FLOODFILL := 0x1000; + RC_STRETCHDIB := 0x2000;RC_OP_DX_OUTPUT := 0x4000;RC_DEVBITS := 0x8000; + SB_NONE := 0x0;SB_CONST_ALPHA := 0x1;SB_PIXEL_ALPHA := 0x2; + SB_PREMULT_ALPHA := 0x4;SB_GRAD_RECT := 0x10;SB_GRAD_TRI := 0x20; + CM_NONE := 0x0;CM_DEVICE_ICM := 0x1;CM_GAMMA_RAMP := 0x2; + CM_CMYK_COLOR := 0x4;DIB_RGB_COLORS := 0x0;DIB_PAL_COLORS := 0x1; + SYSPAL_ERROR := 0x0;SYSPAL_STATIC := 0x1;SYSPAL_NOSTATIC := 0x2; + SYSPAL_NOSTATIC256 := 0x3;CBM_INIT := 0x4;FLOODFILLBORDER := 0x0; + FLOODFILLSURFACE := 0x1;CCHDEVICENAME := 0x20;CCHFORMNAME := 0x20; + DM_SPECVERSION := 0x401;DM_ORIENTATION := 0x1;DM_PAPERSIZE := 0x2; + DM_PAPERLENGTH := 0x4;DM_PAPERWIDTH := 0x8;DM_SCALE := 0x10; + DM_POSITION := 0x20;DM_NUP := 0x40;DM_DISPLAYORIENTATION := 0x80; + DM_COPIES := 0x100;DM_DEFAULTSOURCE := 0x200;DM_PRINTQUALITY := 0x400; + DM_COLOR := 0x800;DM_DUPLEX := 0x1000;DM_YRESOLUTION := 0x2000; + DM_TTOPTION := 0x4000;DM_COLLATE := 0x8000;DM_FORMNAME := 0x10000; + DM_LOGPIXELS := 0x20000;DM_BITSPERPEL := 0x40000;DM_PELSWIDTH := 0x80000; + DM_PELSHEIGHT := 0x100000;DM_DISPLAYFLAGS := 0x200000;DM_DISPLAYFREQUENCY := 0x400000; + DM_ICMMETHOD := 0x800000;DM_ICMINTENT := 0x1000000;DM_MEDIATYPE := 0x2000000; + DM_DITHERTYPE := 0x4000000;DM_PANNINGWIDTH := 0x8000000;DM_PANNINGHEIGHT := 0x10000000; + DM_DISPLAYFIXEDOUTPUT := 0x20000000;DMORIENT_PORTRAIT := 0x1;DMORIENT_LANDSCAPE := 0x2; + DMPAPER_FIRST := NIL;DMPAPER_LETTER := 0x1;DMPAPER_LETTERSMALL := 0x2; + DMPAPER_TABLOID := 0x3;DMPAPER_LEDGER := 0x4;DMPAPER_LEGAL := 0x5; + DMPAPER_STATEMENT := 0x6;DMPAPER_EXECUTIVE := 0x7;DMPAPER_A3 := 0x8; + DMPAPER_A4 := 0x9;DMPAPER_A4SMALL := 0xA;DMPAPER_A5 := 0xB; + DMPAPER_B4 := 0xC;DMPAPER_B5 := 0xD;DMPAPER_FOLIO := 0xE; + DMPAPER_QUARTO := 0xF;DMPAPER_10X14 := 0x10;DMPAPER_11X17 := 0x11; + DMPAPER_NOTE := 0x12;DMPAPER_ENV_9 := 0x13;DMPAPER_ENV_10 := 0x14; + DMPAPER_ENV_11 := 0x15;DMPAPER_ENV_12 := 0x16;DMPAPER_ENV_14 := 0x17; + DMPAPER_CSHEET := 0x18;DMPAPER_DSHEET := 0x19;DMPAPER_ESHEET := 0x1A; + DMPAPER_ENV_DL := 0x1B;DMPAPER_ENV_C5 := 0x1C;DMPAPER_ENV_C3 := 0x1D; + DMPAPER_ENV_C4 := 0x1E;DMPAPER_ENV_C6 := 0x1F;DMPAPER_ENV_C65 := 0x20; + DMPAPER_ENV_B4 := 0x21;DMPAPER_ENV_B5 := 0x22;DMPAPER_ENV_B6 := 0x23; + DMPAPER_ENV_ITALY := 0x24;DMPAPER_ENV_MONARCH := 0x25;DMPAPER_ENV_PERSONAL := 0x26; + DMPAPER_FANFOLD_US := 0x27;DMPAPER_FANFOLD_STD_GERMAN := 0x28;DMPAPER_FANFOLD_LGL_GERMAN := 0x29; + DMPAPER_ISO_B4 := 0x2A;DMPAPER_JAPANESE_POSTCARD := 0x2B;DMPAPER_9X11 := 0x2C; + DMPAPER_10X11 := 0x2D;DMPAPER_15X11 := 0x2E;DMPAPER_ENV_INVITE := 0x2F; + DMPAPER_RESERVED_48 := 0x30;DMPAPER_RESERVED_49 := 0x31;DMPAPER_LETTER_EXTRA := 0x32; + DMPAPER_LEGAL_EXTRA := 0x33;DMPAPER_TABLOID_EXTRA := 0x34;DMPAPER_A4_EXTRA := 0x35; + DMPAPER_LETTER_TRANSVERSE := 0x36;DMPAPER_A4_TRANSVERSE := 0x37;DMPAPER_LETTER_EXTRA_TRANSVERSE := 0x38; + DMPAPER_A_PLUS := 0x39;DMPAPER_B_PLUS := 0x3A;DMPAPER_LETTER_PLUS := 0x3B; + DMPAPER_A4_PLUS := 0x3C;DMPAPER_A5_TRANSVERSE := 0x3D;DMPAPER_B5_TRANSVERSE := 0x3E; + DMPAPER_A3_EXTRA := 0x3F;DMPAPER_A5_EXTRA := 0x40;DMPAPER_B5_EXTRA := 0x41; + DMPAPER_A2 := 0x42;DMPAPER_A3_TRANSVERSE := 0x43;DMPAPER_A3_EXTRA_TRANSVERSE := 0x44; + DMPAPER_DBL_JAPANESE_POSTCARD := 0x45;DMPAPER_A6 := 0x46;DMPAPER_JENV_KAKU2 := 0x47; + DMPAPER_JENV_KAKU3 := 0x48;DMPAPER_JENV_CHOU3 := 0x49;DMPAPER_JENV_CHOU4 := 0x4A; + DMPAPER_LETTER_ROTATED := 0x4B;DMPAPER_A3_ROTATED := 0x4C;DMPAPER_A4_ROTATED := 0x4D; + DMPAPER_A5_ROTATED := 0x4E;DMPAPER_B4_JIS_ROTATED := 0x4F;DMPAPER_B5_JIS_ROTATED := 0x50; + DMPAPER_JAPANESE_POSTCARD_ROTATED := 0x51;DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED := 0x52;DMPAPER_A6_ROTATED := 0x53; + DMPAPER_JENV_KAKU2_ROTATED := 0x54;DMPAPER_JENV_KAKU3_ROTATED := 0x55;DMPAPER_JENV_CHOU3_ROTATED := 0x56; + DMPAPER_JENV_CHOU4_ROTATED := 0x57;DMPAPER_B6_JIS := 0x58;DMPAPER_B6_JIS_ROTATED := 0x59; + DMPAPER_12X11 := 0x5A;DMPAPER_JENV_YOU4 := 0x5B;DMPAPER_JENV_YOU4_ROTATED := 0x5C; + DMPAPER_P16K := 0x5D;DMPAPER_P32K := 0x5E;DMPAPER_P32KBIG := 0x5F; + DMPAPER_PENV_1 := 0x60;DMPAPER_PENV_2 := 0x61;DMPAPER_PENV_3 := 0x62; + DMPAPER_PENV_4 := 0x63;DMPAPER_PENV_5 := 0x64;DMPAPER_PENV_6 := 0x65; + DMPAPER_PENV_7 := 0x66;DMPAPER_PENV_8 := 0x67;DMPAPER_PENV_9 := 0x68; + DMPAPER_PENV_10 := 0x69;DMPAPER_P16K_ROTATED := 0x6A;DMPAPER_P32K_ROTATED := 0x6B; + DMPAPER_P32KBIG_ROTATED := 0x6C;DMPAPER_PENV_1_ROTATED := 0x6D;DMPAPER_PENV_2_ROTATED := 0x6E; + DMPAPER_PENV_3_ROTATED := 0x6F;DMPAPER_PENV_4_ROTATED := 0x70;DMPAPER_PENV_5_ROTATED := 0x71; + DMPAPER_PENV_6_ROTATED := 0x72;DMPAPER_PENV_7_ROTATED := 0x73;DMPAPER_PENV_8_ROTATED := 0x74; + DMPAPER_PENV_9_ROTATED := 0x75;DMPAPER_PENV_10_ROTATED := 0x76;DMPAPER_LAST := 0x76; + DMPAPER_USER := 0x100;DMBIN_FIRST := NIL;DMBIN_UPPER := 0x1; + DMBIN_ONLYONE := 0x1;DMBIN_LOWER := 0x2;DMBIN_MIDDLE := 0x3; + DMBIN_MANUAL := 0x4;DMBIN_ENVELOPE := 0x5;DMBIN_ENVMANUAL := 0x6; + DMBIN_AUTO := 0x7;DMBIN_TRACTOR := 0x8;DMBIN_SMALLFMT := 0x9; + DMBIN_LARGEFMT := 0xA;DMBIN_LARGECAPACITY := 0xB;DMBIN_CASSETTE := 0xE; + DMBIN_FORMSOURCE := 0xF;DMBIN_LAST := 0xF;DMBIN_USER := 0x100; + DMRES_DRAFT := 0xFFFFFFFF;DMRES_LOW := 0xFFFFFFFE;DMRES_MEDIUM := 0xFFFFFFFD; + DMRES_HIGH := 0xFFFFFFFC;DMCOLOR_MONOCHROME := 0x1;DMCOLOR_COLOR := 0x2; + DMDUP_SIMPLEX := 0x1;DMDUP_VERTICAL := 0x2;DMDUP_HORIZONTAL := 0x3; + DMTT_BITMAP := 0x1;DMTT_DOWNLOAD := 0x2;DMTT_SUBDEV := 0x3; + DMTT_DOWNLOAD_OUTLINE := 0x4;DMCOLLATE_FALSE := 0x0;DMCOLLATE_TRUE := 0x1; + DMDO_DEFAULT := 0x0;DMDO_90 := 0x1;DMDO_180 := 0x2; + DMDO_270 := 0x3;DMDFO_DEFAULT := 0x0;DMDFO_STRETCH := 0x1; + DMDFO_CENTER := 0x2;DM_INTERLACED := 0x2;DMDISPLAYFLAGS_TEXTMODE := 0x4; + DMNUP_SYSTEM := 0x1;DMNUP_ONEUP := 0x2;DMICMMETHOD_NONE := 0x1; + DMICMMETHOD_SYSTEM := 0x2;DMICMMETHOD_DRIVER := 0x3;DMICMMETHOD_DEVICE := 0x4; + DMICMMETHOD_USER := 0x100;DMICM_SATURATE := 0x1;DMICM_CONTRAST := 0x2; + DMICM_COLORIMETRIC := 0x3;DMICM_ABS_COLORIMETRIC := 0x4;DMICM_USER := 0x100; + DMMEDIA_STANDARD := 0x1;DMMEDIA_TRANSPARENCY := 0x2;DMMEDIA_GLOSSY := 0x3; + DMMEDIA_USER := 0x100;DMDITHER_NONE := 0x1;DMDITHER_COARSE := 0x2; + DMDITHER_FINE := 0x3;DMDITHER_LINEART := 0x4;DMDITHER_ERRORDIFFUSION := 0x5; + DMDITHER_RESERVED6 := 0x6;DMDITHER_RESERVED7 := 0x7;DMDITHER_RESERVED8 := 0x8; + DMDITHER_RESERVED9 := 0x9;DMDITHER_GRAYSCALE := 0xA;DMDITHER_USER := 0x100; + DISPLAY_DEVICE_ATTACHED_TO_DESKTOP := 0x1;DISPLAY_DEVICE_MULTI_DRIVER := 0x2;DISPLAY_DEVICE_PRIMARY_DEVICE := 0x4; + DISPLAY_DEVICE_MIRRORING_DRIVER := 0x8;DISPLAY_DEVICE_VGA_COMPATIBLE := 0x10;DISPLAY_DEVICE_REMOVABLE := 0x20; + DISPLAY_DEVICE_ACC_DRIVER := 0x40;DISPLAY_DEVICE_MODESPRUNED := 0x8000000;DISPLAY_DEVICE_REMOTE := 0x4000000; + DISPLAY_DEVICE_DISCONNECT := 0x2000000;DISPLAY_DEVICE_TS_COMPATIBLE := 0x200000;DISPLAY_DEVICE_UNSAFE_MODES_ON := 0x80000; + DISPLAY_DEVICE_ACTIVE := 0x1;DISPLAY_DEVICE_ATTACHED := 0x2;DISPLAYCONFIG_MAXPATH := 0x400; + DISPLAYCONFIG_PATH_MODE_IDX_INVALID := 0xFFFFFFFF;DISPLAYCONFIG_SOURCE_IN_USE := 0x1;DISPLAYCONFIG_TARGET_IN_USE := 0x1; + DISPLAYCONFIG_TARGET_FORCIBLE := 0x2;DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_BOOT := 0x4;DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_PATH := 0x8; + DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_SYSTEM := 0x10;DISPLAYCONFIG_PATH_ACTIVE := 0x1;QDC_ALL_PATHS := 0x1; + QDC_ONLY_ACTIVE_PATHS := 0x2;QDC_DATABASE_CURRENT := 0x4;SDC_TOPOLOGY_INTERNAL := 0x1; + SDC_TOPOLOGY_CLONE := 0x2;SDC_TOPOLOGY_EXTEND := 0x4;SDC_TOPOLOGY_EXTERNAL := 0x8; + SDC_TOPOLOGY_SUPPLIED := 0x10;SDC_USE_DATABASE_CURRENT := 0xF;SDC_USE_SUPPLIED_DISPLAY_CONFIG := 0x20; + SDC_VALIDATE := 0x40;SDC_APPLY := 0x80;SDC_NO_OPTIMIZATION := 0x100; + SDC_SAVE_TO_DATABASE := 0x200;SDC_ALLOW_CHANGES := 0x400;SDC_PATH_PERSIST_IF_REQUIRED := 0x800; + SDC_FORCE_MODE_ENUMERATION := 0x1000;SDC_ALLOW_PATH_ORDER_CHANGES := 0x2000;RDH_RECTANGLES := 0x1; + SYSRGN := 0x4;GGO_METRICS := 0x0;GGO_BITMAP := 0x1; + GGO_NATIVE := 0x2;GGO_BEZIER := 0x3;GGO_GRAY2_BITMAP := 0x4; + GGO_GRAY4_BITMAP := 0x5;GGO_GRAY8_BITMAP := 0x6;GGO_GLYPH_INDEX := 0x80; + GGO_UNHINTED := 0x100;TT_POLYGON_TYPE := 0x18;TT_PRIM_LINE := 0x1; + TT_PRIM_QSPLINE := 0x2;TT_PRIM_CSPLINE := 0x3;GCP_DBCS := 0x1; + GCP_REORDER := 0x2;GCP_USEKERNING := 0x8;GCP_GLYPHSHAPE := 0x10; + GCP_LIGATE := 0x20;GCP_DIACRITIC := 0x100;GCP_KASHIDA := 0x400; + GCP_ERROR := 0x8000;FLI_MASK := 0x103B;GCP_JUSTIFY := 0x10000; + FLI_GLYPHS := 0x40000;GCP_CLASSIN := 0x80000;GCP_MAXEXTENT := 0x100000; + GCP_JUSTIFYIN := 0x200000;GCP_DISPLAYZWG := 0x400000;GCP_SYMSWAPOFF := 0x800000; + GCP_NUMERICOVERRIDE := 0x1000000;GCP_NEUTRALOVERRIDE := 0x2000000;GCP_NUMERICSLATIN := 0x4000000; + GCP_NUMERICSLOCAL := 0x8000000;GCPCLASS_LATIN := 0x1;GCPCLASS_HEBREW := 0x2; + GCPCLASS_ARABIC := 0x2;GCPCLASS_NEUTRAL := 0x3;GCPCLASS_LOCALNUMBER := 0x4; + GCPCLASS_LATINNUMBER := 0x5;GCPCLASS_LATINNUMERICTERMINATOR := 0x6;GCPCLASS_LATINNUMERICSEPARATOR := 0x7; + GCPCLASS_NUMERICSEPARATOR := 0x8;GCPCLASS_PREBOUNDLTR := 0x80;GCPCLASS_PREBOUNDRTL := 0x40; + GCPCLASS_POSTBOUNDLTR := 0x20;GCPCLASS_POSTBOUNDRTL := 0x10;GCPGLYPH_LINKBEFORE := 0x8000; + GCPGLYPH_LINKAFTER := 0x4000;TT_AVAILABLE := 0x1;TT_ENABLED := 0x2; + PFD_TYPE_RGBA := 0x0;PFD_TYPE_COLORINDEX := 0x1;PFD_MAIN_PLANE := 0x0; + PFD_OVERLAY_PLANE := 0x1;PFD_UNDERLAY_PLANE := 0xFFFFFFFF;PFD_DOUBLEBUFFER := 0x1; + PFD_STEREO := 0x2;PFD_DRAW_TO_WINDOW := 0x4;PFD_DRAW_TO_BITMAP := 0x8; + PFD_SUPPORT_GDI := 0x10;PFD_SUPPORT_OPENGL := 0x20;PFD_GENERIC_FORMAT := 0x40; + PFD_NEED_PALETTE := 0x80;PFD_NEED_SYSTEM_PALETTE := 0x100;PFD_SWAP_EXCHANGE := 0x200; + PFD_SWAP_COPY := 0x400;PFD_SWAP_LAYER_BUFFERS := 0x800;PFD_GENERIC_ACCELERATED := 0x1000; + PFD_SUPPORT_DIRECTDRAW := 0x2000;PFD_DIRECT3D_ACCELERATED := 0x4000;PFD_SUPPORT_COMPOSITION := 0x8000; + PFD_DEPTH_DONTCARE := 0x20000000;PFD_DOUBLEBUFFER_DONTCARE := 0x40000000;PFD_STEREO_DONTCARE := 0x80000000; + DM_UPDATE := 0x1;DM_COPY := 0x2;DM_PROMPT := 0x4; + DM_MODIFY := 0x8;DM_IN_BUFFER := 0x8;DM_IN_PROMPT := 0x4; + DM_OUT_BUFFER := 0x2;DM_OUT_DEFAULT := 0x1;DC_FIELDS := 0x1; + DC_PAPERS := 0x2;DC_PAPERSIZE := 0x3;DC_MINEXTENT := 0x4; + DC_MAXEXTENT := 0x5;DC_BINS := 0x6;DC_DUPLEX := 0x7; + DC_SIZE := 0x8;DC_EXTRA := 0x9;DC_VERSION := 0xA; + DC_DRIVER := 0xB;DC_BINNAMES := 0xC;DC_ENUMRESOLUTIONS := 0xD; + DC_FILEDEPENDENCIES := 0xE;DC_TRUETYPE := 0xF;DC_PAPERNAMES := 0x10; + DC_ORIENTATION := 0x11;DC_COPIES := 0x12;DC_BINADJUST := 0x13; + DC_EMF_COMPLIANT := 0x14;DC_DATATYPE_PRODUCED := 0x15;DC_COLLATE := 0x16; + DC_MANUFACTURER := 0x17;DC_MODEL := 0x18;DC_PERSONALITY := 0x19; + DC_PRINTRATE := 0x1A;DC_PRINTRATEUNIT := 0x1B;PRINTRATEUNIT_PPM := 0x1; + PRINTRATEUNIT_CPS := 0x2;PRINTRATEUNIT_LPM := 0x3;PRINTRATEUNIT_IPM := 0x4; + DC_PRINTERMEM := 0x1C;DC_MEDIAREADY := 0x1D;DC_STAPLE := 0x1E; + DC_PRINTRATEPPM := 0x1F;DC_COLORDEVICE := 0x20;DC_NUP := 0x21; + DC_MEDIATYPENAMES := 0x22;DC_MEDIATYPES := 0x23;DCTT_BITMAP := 0x1; + DCTT_DOWNLOAD := 0x2;DCTT_SUBDEV := 0x4;DCTT_DOWNLOAD_OUTLINE := 0x8; + DCBA_FACEUPNONE := 0x0;DCBA_FACEUPCENTER := 0x1;DCBA_FACEUPLEFT := 0x2; + DCBA_FACEUPRIGHT := 0x3;DCBA_FACEDOWNNONE := 0x100;DCBA_FACEDOWNCENTER := 0x101; + DCBA_FACEDOWNLEFT := 0x102;DCBA_FACEDOWNRIGHT := 0x103;GETTEXTEXTENTPOINT32 := 0x0; + GS_8BIT_INDICES := 0x1;GGI_MARK_NONEXISTING_GLYPHS := 0x1;STAMP_DESIGNVECTOR := 0x8007664; + STAMP_AXESLIST := 0x8006C61;MM_MAX_NUMAXES := 0x10;FR_PRIVATE := 0x10; + FR_NOT_ENUM := 0x20;MM_MAX_AXES_NAMELEN := 0x10;GDIREGISTERDDRAWPACKETVERSION := 0x1; + AC_SRC_OVER := 0x0;AC_SRC_ALPHA := 0x1;GRADIENT_FILL_RECT_H := 0x0; + GRADIENT_FILL_RECT_V := 0x1;GRADIENT_FILL_TRIANGLE := 0x2;GRADIENT_FILL_OP_FLAG := 0xFF; + CA_NEGATIVE := 0x1;CA_LOG_FILTER := 0x2;ILLUMINANT_DEVICE_DEFAULT := 0x0; + ILLUMINANT_A := 0x1;ILLUMINANT_B := 0x2;ILLUMINANT_C := 0x3; + ILLUMINANT_D50 := 0x4;ILLUMINANT_D55 := 0x5;ILLUMINANT_D65 := 0x6; + ILLUMINANT_D75 := 0x7;ILLUMINANT_F2 := 0x8;ILLUMINANT_MAX_INDEX := 0x8; + ILLUMINANT_TUNGSTEN := 0x1;ILLUMINANT_DAYLIGHT := 0x3;ILLUMINANT_FLUORESCENT := 0x8; + ILLUMINANT_NTSC := 0x3;RGB_GAMMA_MIN := 0x9C4;RGB_GAMMA_MAX := 0xFDE8; + REFERENCE_WHITE_MIN := 0x1770;REFERENCE_WHITE_MAX := 0x2710;REFERENCE_BLACK_MIN := 0x0; + REFERENCE_BLACK_MAX := 0xFA0;COLOR_ADJ_MIN := 0xFFFFFF9C;COLOR_ADJ_MAX := 0x64; + DI_APPBANDING := 0x1;DI_ROPS_READ_DESTINATION := 0x2;FONTMAPPER_MAX := 0xA; + ICM_OFF := 0x1;ICM_ON := 0x2;ICM_QUERY := 0x3; + ICM_DONE_OUTSIDEDC := 0x4;ENHMETA_SIGNATURE := 0x464D4520;ENHMETA_STOCK_OBJECT := 0x80000000; + EMR_HEADER := 0x1;EMR_POLYBEZIER := 0x2;EMR_POLYGON := 0x3; + EMR_POLYLINE := 0x4;EMR_POLYBEZIERTO := 0x5;EMR_POLYLINETO := 0x6; + EMR_POLYPOLYLINE := 0x7;EMR_POLYPOLYGON := 0x8;EMR_SETWINDOWEXTEX := 0x9; + EMR_SETWINDOWORGEX := 0xA;EMR_SETVIEWPORTEXTEX := 0xB;EMR_SETVIEWPORTORGEX := 0xC; + EMR_SETBRUSHORGEX := 0xD;EMR_EOF := 0xE;EMR_SETPIXELV := 0xF; + EMR_SETMAPPERFLAGS := 0x10;EMR_SETMAPMODE := 0x11;EMR_SETBKMODE := 0x12; + EMR_SETPOLYFILLMODE := 0x13;EMR_SETROP2 := 0x14;EMR_SETSTRETCHBLTMODE := 0x15; + EMR_SETTEXTALIGN := 0x16;EMR_SETCOLORADJUSTMENT := 0x17;EMR_SETTEXTCOLOR := 0x18; + EMR_SETBKCOLOR := 0x19;EMR_OFFSETCLIPRGN := 0x1A;EMR_MOVETOEX := 0x1B; + EMR_SETMETARGN := 0x1C;EMR_EXCLUDECLIPRECT := 0x1D;EMR_INTERSECTCLIPRECT := 0x1E; + EMR_SCALEVIEWPORTEXTEX := 0x1F;EMR_SCALEWINDOWEXTEX := 0x20;EMR_SAVEDC := 0x21; + EMR_RESTOREDC := 0x22;EMR_SETWORLDTRANSFORM := 0x23;EMR_MODIFYWORLDTRANSFORM := 0x24; + EMR_SELECTOBJECT := 0x25;EMR_CREATEPEN := 0x26;EMR_CREATEBRUSHINDIRECT := 0x27; + EMR_DELETEOBJECT := 0x28;EMR_ANGLEARC := 0x29;EMR_ELLIPSE := 0x2A; + EMR_RECTANGLE := 0x2B;EMR_ROUNDRECT := 0x2C;EMR_ARC := 0x2D; + EMR_CHORD := 0x2E;EMR_PIE := 0x2F;EMR_SELECTPALETTE := 0x30; + EMR_CREATEPALETTE := 0x31;EMR_SETPALETTEENTRIES := 0x32;EMR_RESIZEPALETTE := 0x33; + EMR_REALIZEPALETTE := 0x34;EMR_EXTFLOODFILL := 0x35;EMR_LINETO := 0x36; + EMR_ARCTO := 0x37;EMR_POLYDRAW := 0x38;EMR_SETARCDIRECTION := 0x39; + EMR_SETMITERLIMIT := 0x3A;EMR_BEGINPATH := 0x3B;EMR_ENDPATH := 0x3C; + EMR_CLOSEFIGURE := 0x3D;EMR_FILLPATH := 0x3E;EMR_STROKEANDFILLPATH := 0x3F; + EMR_STROKEPATH := 0x40;EMR_FLATTENPATH := 0x41;EMR_WIDENPATH := 0x42; + EMR_SELECTCLIPPATH := 0x43;EMR_ABORTPATH := 0x44;EMR_GDICOMMENT := 0x46; + EMR_FILLRGN := 0x47;EMR_FRAMERGN := 0x48;EMR_INVERTRGN := 0x49; + EMR_PAINTRGN := 0x4A;EMR_EXTSELECTCLIPRGN := 0x4B;EMR_BITBLT := 0x4C; + EMR_STRETCHBLT := 0x4D;EMR_MASKBLT := 0x4E;EMR_PLGBLT := 0x4F; + EMR_SETDIBITSTODEVICE := 0x50;EMR_STRETCHDIBITS := 0x51;EMR_EXTCREATEFONTINDIRECTW := 0x52; + EMR_EXTTEXTOUTA := 0x53;EMR_EXTTEXTOUTW := 0x54;EMR_POLYBEZIER16 := 0x55; + EMR_POLYGON16 := 0x56;EMR_POLYLINE16 := 0x57;EMR_POLYBEZIERTO16 := 0x58; + EMR_POLYLINETO16 := 0x59;EMR_POLYPOLYLINE16 := 0x5A;EMR_POLYPOLYGON16 := 0x5B; + EMR_POLYDRAW16 := 0x5C;EMR_CREATEMONOBRUSH := 0x5D;EMR_CREATEDIBPATTERNBRUSHPT := 0x5E; + EMR_EXTCREATEPEN := 0x5F;EMR_POLYTEXTOUTA := 0x60;EMR_POLYTEXTOUTW := 0x61; + EMR_SETICMMODE := 0x62;EMR_CREATECOLORSPACE := 0x63;EMR_SETCOLORSPACE := 0x64; + EMR_DELETECOLORSPACE := 0x65;EMR_GLSRECORD := 0x66;EMR_GLSBOUNDEDRECORD := 0x67; + EMR_PIXELFORMAT := 0x68;EMR_RESERVED_105 := 0x69;EMR_RESERVED_106 := 0x6A; + EMR_RESERVED_107 := 0x6B;EMR_RESERVED_108 := 0x6C;EMR_RESERVED_109 := 0x6D; + EMR_RESERVED_110 := 0x6E;EMR_COLORCORRECTPALETTE := 0x6F;EMR_SETICMPROFILEA := 0x70; + EMR_SETICMPROFILEW := 0x71;EMR_ALPHABLEND := 0x72;EMR_SETLAYOUT := 0x73; + EMR_TRANSPARENTBLT := 0x74;EMR_RESERVED_117 := 0x75;EMR_GRADIENTFILL := 0x76; + EMR_RESERVED_119 := 0x77;EMR_RESERVED_120 := 0x78;EMR_COLORMATCHTOTARGETW := 0x79; + EMR_CREATECOLORSPACEW := 0x7A;EMR_MIN := 0x1;EMR_MAX := 0x7A; + SETICMPROFILE_EMBEDED := 0x1;CREATECOLORSPACE_EMBEDED := 0x1;COLORMATCHTOTARGET_EMBEDED := 0x1; + GDICOMMENT_IDENTIFIER := 0x43494447;GDICOMMENT_WINDOWS_METAFILE := 0x80000001;GDICOMMENT_BEGINGROUP := 0x2; + GDICOMMENT_ENDGROUP := 0x3;GDICOMMENT_MULTIFORMATS := 0x40000004;EPS_SIGNATURE := 0x46535045; + GDICOMMENT_UNICODE_STRING := 0x40;GDICOMMENT_UNICODE_END := 0x80;WGL_FONT_LINES := 0x0; + WGL_FONT_POLYGONS := 0x1;LPD_DOUBLEBUFFER := 0x1;LPD_STEREO := 0x2; + LPD_SUPPORT_GDI := 0x10;LPD_SUPPORT_OPENGL := 0x20;LPD_SHARE_DEPTH := 0x40; + LPD_SHARE_STENCIL := 0x80;LPD_SHARE_ACCUM := 0x100;LPD_SWAP_EXCHANGE := 0x200; + LPD_SWAP_COPY := 0x400;LPD_TRANSPARENT := 0x1000;LPD_TYPE_RGBA := 0x0; + LPD_TYPE_COLORINDEX := 0x1;WGL_SWAP_MAIN_PLANE := 0x1;WGL_SWAP_OVERLAY1 := 0x2; + WGL_SWAP_OVERLAY2 := 0x4;WGL_SWAP_OVERLAY3 := 0x8;WGL_SWAP_OVERLAY4 := 0x10; + WGL_SWAP_OVERLAY5 := 0x20;WGL_SWAP_OVERLAY6 := 0x40;WGL_SWAP_OVERLAY7 := 0x80; + WGL_SWAP_OVERLAY8 := 0x100;WGL_SWAP_OVERLAY9 := 0x200;WGL_SWAP_OVERLAY10 := 0x400; + WGL_SWAP_OVERLAY11 := 0x800;WGL_SWAP_OVERLAY12 := 0x1000;WGL_SWAP_OVERLAY13 := 0x2000; + WGL_SWAP_OVERLAY14 := 0x4000;WGL_SWAP_OVERLAY15 := 0x8000;WGL_SWAP_UNDERLAY1 := 0x10000; + WGL_SWAP_UNDERLAY2 := 0x20000;WGL_SWAP_UNDERLAY3 := 0x40000;WGL_SWAP_UNDERLAY4 := 0x80000; + WGL_SWAP_UNDERLAY5 := 0x100000;WGL_SWAP_UNDERLAY6 := 0x200000;WGL_SWAP_UNDERLAY7 := 0x400000; + WGL_SWAP_UNDERLAY8 := 0x800000;WGL_SWAP_UNDERLAY9 := 0x1000000;WGL_SWAP_UNDERLAY10 := 0x2000000; + WGL_SWAP_UNDERLAY11 := 0x4000000;WGL_SWAP_UNDERLAY12 := 0x8000000;WGL_SWAP_UNDERLAY13 := 0x10000000; + WGL_SWAP_UNDERLAY14 := 0x20000000;WGL_SWAP_UNDERLAY15 := 0x40000000;WGL_SWAPMULTIPLE_MAX := 0x10; + end +end + +type _winuserdef_=class() + static WINUSERAPI;static WINABLEAPI;static WINVER; + static MAKEINTRESOURCE;static DIFFERENCE;static RT_MANIFEST; + static CREATEPROCESS_MANIFEST_RESOURCE_ID;static ISOLATIONAWARE_MANIFEST_RESOURCE_ID;static ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID; + static MINIMUM_RESERVED_MANIFEST_RESOURCE_ID;static MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID;static WVSPRINTF; + static WSPRINTF;static SETWALLPAPER_DEFAULT;static SB_HORZ; + static SB_VERT;static SB_CTL;static SB_BOTH; + static SB_LINEUP;static SB_LINELEFT;static SB_LINEDOWN; + static SB_LINERIGHT;static SB_PAGEUP;static SB_PAGELEFT; + static SB_PAGEDOWN;static SB_PAGERIGHT;static SB_THUMBPOSITION; + static SB_THUMBTRACK;static SB_TOP;static SB_LEFT; + static SB_BOTTOM;static SB_RIGHT;static SB_ENDSCROLL; + static SW_HIDE;static SW_SHOWNORMAL;static SW_NORMAL; + static SW_SHOWMINIMIZED;static SW_SHOWMAXIMIZED;static SW_MAXIMIZE; + static SW_SHOWNOACTIVATE;static SW_SHOW;static SW_MINIMIZE; + static SW_SHOWMINNOACTIVE;static SW_SHOWNA;static SW_RESTORE; + static SW_SHOWDEFAULT;static SW_FORCEMINIMIZE;static SW_MAX; + static HIDE_WINDOW;static SHOW_OPENWINDOW;static SHOW_ICONWINDOW; + static SHOW_FULLSCREEN;static SHOW_OPENNOACTIVATE;static SW_PARENTCLOSING; + static SW_OTHERZOOM;static SW_PARENTOPENING;static SW_OTHERUNZOOM; + static AW_HOR_POSITIVE;static AW_HOR_NEGATIVE;static AW_VER_POSITIVE; + static AW_VER_NEGATIVE;static AW_CENTER;static AW_HIDE; + static AW_ACTIVATE;static AW_SLIDE;static AW_BLEND; + static KF_EXTENDED;static KF_DLGMODE;static KF_MENUMODE; + static KF_ALTDOWN;static KF_REPEAT;static KF_UP; + static VK_LBUTTON;static VK_RBUTTON;static VK_CANCEL; + static VK_MBUTTON;static VK_XBUTTON1;static VK_XBUTTON2; + static VK_BACK;static VK_TAB;static VK_CLEAR; + static VK_RETURN;static VK_SHIFT;static VK_CONTROL; + static VK_MENU;static VK_PAUSE;static VK_CAPITAL; + static VK_KANA;static VK_HANGEUL;static VK_HANGUL; + static VK_JUNJA;static VK_FINAL;static VK_HANJA; + static VK_KANJI;static VK_ESCAPE;static VK_CONVERT; + static VK_NONCONVERT;static VK_ACCEPT;static VK_MODECHANGE; + static VK_SPACE;static VK_PRIOR;static VK_NEXT; + static VK_END;static VK_HOME;static VK_LEFT; + static VK_UP;static VK_RIGHT;static VK_DOWN; + static VK_SELECT;static VK_PRINT;static VK_EXECUTE; + static VK_SNAPSHOT;static VK_INSERT;static VK_DELETE; + static VK_HELP;static VK_LWIN;static VK_RWIN; + static VK_APPS;static VK_SLEEP;static VK_NUMPAD0; + static VK_NUMPAD1;static VK_NUMPAD2;static VK_NUMPAD3; + static VK_NUMPAD4;static VK_NUMPAD5;static VK_NUMPAD6; + static VK_NUMPAD7;static VK_NUMPAD8;static VK_NUMPAD9; + static VK_MULTIPLY;static VK_ADD;static VK_SEPARATOR; + static VK_SUBTRACT;static VK_DECIMAL;static VK_DIVIDE; + static VK_F1;static VK_F2;static VK_F3; + static VK_F4;static VK_F5;static VK_F6; + static VK_F7;static VK_F8;static VK_F9; + static VK_F10;static VK_F11;static VK_F12; + static VK_F13;static VK_F14;static VK_F15; + static VK_F16;static VK_F17;static VK_F18; + static VK_F19;static VK_F20;static VK_F21; + static VK_F22;static VK_F23;static VK_F24; + static VK_NUMLOCK;static VK_SCROLL;static VK_OEM_NEC_EQUAL; + static VK_OEM_FJ_JISHO;static VK_OEM_FJ_MASSHOU;static VK_OEM_FJ_TOUROKU; + static VK_OEM_FJ_LOYA;static VK_OEM_FJ_ROYA;static VK_LSHIFT; + static VK_RSHIFT;static VK_LCONTROL;static VK_RCONTROL; + static VK_LMENU;static VK_RMENU;static VK_BROWSER_BACK; + static VK_BROWSER_FORWARD;static VK_BROWSER_REFRESH;static VK_BROWSER_STOP; + static VK_BROWSER_SEARCH;static VK_BROWSER_FAVORITES;static VK_BROWSER_HOME; + static VK_VOLUME_MUTE;static VK_VOLUME_DOWN;static VK_VOLUME_UP; + static VK_MEDIA_NEXT_TRACK;static VK_MEDIA_PREV_TRACK;static VK_MEDIA_STOP; + static VK_MEDIA_PLAY_PAUSE;static VK_LAUNCH_MAIL;static VK_LAUNCH_MEDIA_SELECT; + static VK_LAUNCH_APP1;static VK_LAUNCH_APP2;static VK_OEM_1; + static VK_OEM_PLUS;static VK_OEM_COMMA;static VK_OEM_MINUS; + static VK_OEM_PERIOD;static VK_OEM_2;static VK_OEM_3; + static VK_OEM_4;static VK_OEM_5;static VK_OEM_6; + static VK_OEM_7;static VK_OEM_8;static VK_OEM_AX; + static VK_OEM_102;static VK_ICO_HELP;static VK_ICO_00; + static VK_PROCESSKEY;static VK_ICO_CLEAR;static VK_PACKET; + static VK_OEM_RESET;static VK_OEM_JUMP;static VK_OEM_PA1; + static VK_OEM_PA2;static VK_OEM_PA3;static VK_OEM_WSCTRL; + static VK_OEM_CUSEL;static VK_OEM_ATTN;static VK_OEM_FINISH; + static VK_OEM_COPY;static VK_OEM_AUTO;static VK_OEM_ENLW; + static VK_OEM_BACKTAB;static VK_ATTN;static VK_CRSEL; + static VK_EXSEL;static VK_EREOF;static VK_PLAY; + static VK_ZOOM;static VK_NONAME;static VK_PA1; + static VK_OEM_CLEAR;static WH_MIN;static WH_MSGFILTER; + static WH_JOURNALRECORD;static WH_JOURNALPLAYBACK;static WH_KEYBOARD; + static WH_GETMESSAGE;static WH_CALLWNDPROC;static WH_CBT; + static WH_SYSMSGFILTER;static WH_MOUSE;static WH_HARDWARE; + static WH_DEBUG;static WH_SHELL;static WH_FOREGROUNDIDLE; + static WH_CALLWNDPROCRET;static WH_KEYBOARD_LL;static WH_MOUSE_LL; + static WH_MAX;static WH_MINHOOK;static WH_MAXHOOK; + static HC_ACTION;static HC_GETNEXT;static HC_SKIP; + static HC_NOREMOVE;static HC_NOREM;static HC_SYSMODALON; + static HC_SYSMODALOFF;static HCBT_MOVESIZE;static HCBT_MINMAX; + static HCBT_QS;static HCBT_CREATEWND;static HCBT_DESTROYWND; + static HCBT_ACTIVATE;static HCBT_CLICKSKIPPED;static HCBT_KEYSKIPPED; + static HCBT_SYSCOMMAND;static HCBT_SETFOCUS;static WTS_CONSOLE_CONNECT; + static WTS_CONSOLE_DISCONNECT;static WTS_REMOTE_CONNECT;static WTS_REMOTE_DISCONNECT; + static WTS_SESSION_LOGON;static WTS_SESSION_LOGOFF;static WTS_SESSION_LOCK; + static WTS_SESSION_UNLOCK;static WTS_SESSION_REMOTE_CONTROL;static WTS_SESSION_CREATE; + static WTS_SESSION_TERMINATE;static MSGF_DIALOGBOX;static MSGF_MESSAGEBOX; + static MSGF_MENU;static MSGF_SCROLLBAR;static MSGF_NEXTWINDOW; + static MSGF_MAX;static MSGF_USER;static HSHELL_WINDOWCREATED; + static HSHELL_WINDOWDESTROYED;static HSHELL_ACTIVATESHELLWINDOW;static HSHELL_WINDOWACTIVATED; + static HSHELL_GETMINRECT;static HSHELL_REDRAW;static HSHELL_TASKMAN; + static HSHELL_LANGUAGE;static HSHELL_SYSMENU;static HSHELL_ENDTASK; + static HSHELL_ACCESSIBILITYSTATE;static HSHELL_APPCOMMAND;static HSHELL_WINDOWREPLACED; + static HSHELL_WINDOWREPLACING;static HSHELL_MONITORCHANGED;static HSHELL_HIGHBIT; + static HSHELL_FLASH;static HSHELL_RUDEAPPACTIVATED;static APPCOMMAND_BROWSER_BACKWARD; + static APPCOMMAND_BROWSER_FORWARD;static APPCOMMAND_BROWSER_REFRESH;static APPCOMMAND_BROWSER_STOP; + static APPCOMMAND_BROWSER_SEARCH;static APPCOMMAND_BROWSER_FAVORITES;static APPCOMMAND_BROWSER_HOME; + static APPCOMMAND_VOLUME_MUTE;static APPCOMMAND_VOLUME_DOWN;static APPCOMMAND_VOLUME_UP; + static APPCOMMAND_MEDIA_NEXTTRACK;static APPCOMMAND_MEDIA_PREVIOUSTRACK;static APPCOMMAND_MEDIA_STOP; + static APPCOMMAND_MEDIA_PLAY_PAUSE;static APPCOMMAND_LAUNCH_MAIL;static APPCOMMAND_LAUNCH_MEDIA_SELECT; + static APPCOMMAND_LAUNCH_APP1;static APPCOMMAND_LAUNCH_APP2;static APPCOMMAND_BASS_DOWN; + static APPCOMMAND_BASS_BOOST;static APPCOMMAND_BASS_UP;static APPCOMMAND_TREBLE_DOWN; + static APPCOMMAND_TREBLE_UP;static APPCOMMAND_MICROPHONE_VOLUME_MUTE;static APPCOMMAND_MICROPHONE_VOLUME_DOWN; + static APPCOMMAND_MICROPHONE_VOLUME_UP;static APPCOMMAND_HELP;static APPCOMMAND_FIND; + static APPCOMMAND_NEW;static APPCOMMAND_OPEN;static APPCOMMAND_CLOSE; + static APPCOMMAND_SAVE;static APPCOMMAND_PRINT;static APPCOMMAND_UNDO; + static APPCOMMAND_REDO;static APPCOMMAND_COPY;static APPCOMMAND_CUT; + static APPCOMMAND_PASTE;static APPCOMMAND_REPLY_TO_MAIL;static APPCOMMAND_FORWARD_MAIL; + static APPCOMMAND_SEND_MAIL;static APPCOMMAND_SPELL_CHECK;static APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE; + static APPCOMMAND_MIC_ON_OFF_TOGGLE;static APPCOMMAND_CORRECTION_LIST;static APPCOMMAND_MEDIA_PLAY; + static APPCOMMAND_MEDIA_PAUSE;static APPCOMMAND_MEDIA_RECORD;static APPCOMMAND_MEDIA_FAST_FORWARD; + static APPCOMMAND_MEDIA_REWIND;static APPCOMMAND_MEDIA_CHANNEL_UP;static APPCOMMAND_MEDIA_CHANNEL_DOWN; + static APPCOMMAND_DELETE;static APPCOMMAND_DWM_FLIP3D;static FAPPCOMMAND_MOUSE; + static FAPPCOMMAND_KEY;static FAPPCOMMAND_OEM;static FAPPCOMMAND_MASK; + static GET_MOUSEORKEY_LPARAM;static LLKHF_EXTENDED;static LLKHF_INJECTED; + static LLKHF_ALTDOWN;static LLKHF_UP;static LLKHF_LOWER_IL_INJECTED; + static LLMHF_INJECTED;static LLMHF_LOWER_IL_INJECTED;static HKL_PREV; + static HKL_NEXT;static KLF_ACTIVATE;static KLF_SUBSTITUTE_OK; + static KLF_REORDER;static KLF_REPLACELANG;static KLF_NOTELLSHELL; + static KLF_SETFORPROCESS;static KLF_SHIFTLOCK;static KLF_RESET; + static INPUTLANGCHANGE_SYSCHARSET;static INPUTLANGCHANGE_FORWARD;static INPUTLANGCHANGE_BACKWARD; + static KL_NAMELENGTH;static LOADKEYBOARDLAYOUT;static GETKEYBOARDLAYOUTNAME; + static GMMP_USE_DISPLAY_POINTS;static GMMP_USE_HIGH_RESOLUTION_POINTS;static DESKTOP_READOBJECTS; + static DESKTOP_CREATEWINDOW;static DESKTOP_CREATEMENU;static DESKTOP_HOOKCONTROL; + static DESKTOP_JOURNALRECORD;static DESKTOP_JOURNALPLAYBACK;static DESKTOP_ENUMERATE; + static DESKTOP_WRITEOBJECTS;static DESKTOP_SWITCHDESKTOP;static DF_ALLOWOTHERACCOUNTHOOK; + static CREATEDESKTOP;static CREATEDESKTOPEX;static OPENDESKTOP; + static ENUMDESKTOPS;static WINSTA_ENUMDESKTOPS;static WINSTA_READATTRIBUTES; + static WINSTA_ACCESSCLIPBOARD;static WINSTA_CREATEDESKTOP;static WINSTA_WRITEATTRIBUTES; + static WINSTA_ACCESSGLOBALATOMS;static WINSTA_EXITWINDOWS;static WINSTA_ENUMERATE; + static WINSTA_READSCREEN;static WINSTA_ALL_ACCESS;static CWF_CREATE_ONLY; + static WSF_VISIBLE;static CREATEWINDOWSTATION;static OPENWINDOWSTATION; + static ENUMWINDOWSTATIONS;static UOI_FLAGS;static UOI_NAME; + static UOI_TYPE;static UOI_USER_SID;static UOI_HEAPSIZE; + static UOI_IO;static GETUSEROBJECTINFORMATION;static SETUSEROBJECTINFORMATION; + static GWL_WNDPROC;static GWL_HINSTANCE;static GWL_HWNDPARENT; + static GWL_STYLE;static GWL_EXSTYLE;static GWL_USERDATA; + static GWL_ID;static GWLP_WNDPROC;static GWLP_HINSTANCE; + static GWLP_HWNDPARENT;static GWLP_USERDATA;static GWLP_ID; + static GCL_MENUNAME;static GCL_HBRBACKGROUND;static GCL_HCURSOR; + static GCL_HICON;static GCL_HMODULE;static GCL_CBWNDEXTRA; + static GCL_CBCLSEXTRA;static GCL_WNDPROC;static GCL_STYLE; + static GCW_ATOM;static GCL_HICONSM;static GCLP_MENUNAME; + static GCLP_HBRBACKGROUND;static GCLP_HCURSOR;static GCLP_HICON; + static GCLP_HMODULE;static GCLP_WNDPROC;static GCLP_HICONSM; + static WM_NULL;static WM_CREATE;static WM_DESTROY; + static WM_MOVE;static WM_SIZE;static WM_ACTIVATE; + static WA_INACTIVE;static WA_ACTIVE;static WA_CLICKACTIVE; + static WM_SETFOCUS;static WM_KILLFOCUS;static WM_ENABLE; + static WM_SETREDRAW;static WM_SETTEXT;static WM_GETTEXT; + static WM_GETTEXTLENGTH;static WM_PAINT;static WM_CLOSE; + static WM_QUERYENDSESSION;static WM_QUERYOPEN;static WM_ENDSESSION; + static WM_QUIT;static WM_ERASEBKGND;static WM_SYSCOLORCHANGE; + static WM_SHOWWINDOW;static WM_WININICHANGE;static WM_SETTINGCHANGE; + static WM_DEVMODECHANGE;static WM_ACTIVATEAPP;static WM_FONTCHANGE; + static WM_TIMECHANGE;static WM_CANCELMODE;static WM_SETCURSOR; + static WM_MOUSEACTIVATE;static WM_CHILDACTIVATE;static WM_QUEUESYNC; + static WM_GETMINMAXINFO;static WM_PAINTICON;static WM_ICONERASEBKGND; + static WM_NEXTDLGCTL;static WM_SPOOLERSTATUS;static WM_DRAWITEM; + static WM_MEASUREITEM;static WM_DELETEITEM;static WM_VKEYTOITEM; + static WM_CHARTOITEM;static WM_SETFONT;static WM_GETFONT; + static WM_SETHOTKEY;static WM_GETHOTKEY;static WM_QUERYDRAGICON; + static WM_COMPAREITEM;static WM_GETOBJECT;static WM_COMPACTING; + static WM_COMMNOTIFY;static WM_WINDOWPOSCHANGING;static WM_WINDOWPOSCHANGED; + static WM_POWER;static PWR_OK;static PWR_FAIL; + static PWR_SUSPENDREQUEST;static PWR_SUSPENDRESUME;static PWR_CRITICALRESUME; + static WM_COPYDATA;static WM_CANCELJOURNAL;static WM_NOTIFY; + static WM_INPUTLANGCHANGEREQUEST;static WM_INPUTLANGCHANGE;static WM_TCARD; + static WM_HELP;static WM_USERCHANGED;static WM_NOTIFYFORMAT; + static NFR_ANSI;static NFR_UNICODE;static NF_QUERY; + static NF_REQUERY;static WM_CONTEXTMENU;static WM_STYLECHANGING; + static WM_STYLECHANGED;static WM_DISPLAYCHANGE;static WM_GETICON; + static WM_SETICON;static WM_NCCREATE;static WM_NCDESTROY; + static WM_NCCALCSIZE;static WM_NCHITTEST;static WM_NCPAINT; + static WM_NCACTIVATE;static WM_GETDLGCODE;static WM_SYNCPAINT; + static WM_NCMOUSEMOVE;static WM_NCLBUTTONDOWN;static WM_NCLBUTTONUP; + static WM_NCLBUTTONDBLCLK;static WM_NCRBUTTONDOWN;static WM_NCRBUTTONUP; + static WM_NCRBUTTONDBLCLK;static WM_NCMBUTTONDOWN;static WM_NCMBUTTONUP; + static WM_NCMBUTTONDBLCLK;static WM_NCXBUTTONDOWN;static WM_NCXBUTTONUP; + static WM_NCXBUTTONDBLCLK;static WM_INPUT_DEVICE_CHANGE;static WM_INPUT; + static WM_KEYFIRST;static WM_KEYDOWN;static WM_KEYUP; + static WM_CHAR;static WM_DEADCHAR;static WM_SYSKEYDOWN; + static WM_SYSKEYUP;static WM_SYSCHAR;static WM_SYSDEADCHAR; + static WM_UNICHAR;static WM_KEYLAST;static UNICODE_NOCHAR; + static WM_IME_STARTCOMPOSITION;static WM_IME_ENDCOMPOSITION;static WM_IME_COMPOSITION; + static WM_IME_KEYLAST;static WM_INITDIALOG;static WM_COMMAND; + static WM_SYSCOMMAND;static WM_TIMER;static WM_HSCROLL; + static WM_VSCROLL;static WM_INITMENU;static WM_INITMENUPOPUP; + static WM_GESTURE;static WM_GESTURENOTIFY;static WM_MENUSELECT; + static WM_MENUCHAR;static WM_ENTERIDLE;static WM_MENURBUTTONUP; + static WM_MENUDRAG;static WM_MENUGETOBJECT;static WM_UNINITMENUPOPUP; + static WM_MENUCOMMAND;static WM_CHANGEUISTATE;static WM_UPDATEUISTATE; + static WM_QUERYUISTATE;static UIS_SET;static UIS_CLEAR; + static UIS_INITIALIZE;static UISF_HIDEFOCUS;static UISF_HIDEACCEL; + static UISF_ACTIVE;static WM_CTLCOLORMSGBOX;static WM_CTLCOLOREDIT; + static WM_CTLCOLORLISTBOX;static WM_CTLCOLORBTN;static WM_CTLCOLORDLG; + static WM_CTLCOLORSCROLLBAR;static WM_CTLCOLORSTATIC;static MN_GETHMENU; + static WM_MOUSEFIRST;static WM_MOUSEMOVE;static WM_LBUTTONDOWN; + static WM_LBUTTONUP;static WM_LBUTTONDBLCLK;static WM_RBUTTONDOWN; + static WM_RBUTTONUP;static WM_RBUTTONDBLCLK;static WM_MBUTTONDOWN; + static WM_MBUTTONUP;static WM_MBUTTONDBLCLK;static WM_MOUSEWHEEL; + static WM_XBUTTONDOWN;static WM_XBUTTONUP;static WM_XBUTTONDBLCLK; + static WM_MOUSEHWHEEL;static WM_MOUSELAST;static WHEEL_DELTA; + static WHEEL_PAGESCROLL;static XBUTTON1;static XBUTTON2; + static WM_PARENTNOTIFY;static WM_ENTERMENULOOP;static WM_EXITMENULOOP; + static WM_NEXTMENU;static WM_SIZING;static WM_CAPTURECHANGED; + static WM_MOVING;static WM_POWERBROADCAST;static PBT_APMQUERYSUSPEND; + static PBT_APMQUERYSTANDBY;static PBT_APMQUERYSUSPENDFAILED;static PBT_APMQUERYSTANDBYFAILED; + static PBT_APMSUSPEND;static PBT_APMSTANDBY;static PBT_APMRESUMECRITICAL; + static PBT_APMRESUMESUSPEND;static PBT_APMRESUMESTANDBY;static PBTF_APMRESUMEFROMFAILURE; + static PBT_APMBATTERYLOW;static PBT_APMPOWERSTATUSCHANGE;static PBT_APMOEMEVENT; + static PBT_APMRESUMEAUTOMATIC;static PBT_POWERSETTINGCHANGE;static WM_DEVICECHANGE; + static WM_MDICREATE;static WM_MDIDESTROY;static WM_MDIACTIVATE; + static WM_MDIRESTORE;static WM_MDINEXT;static WM_MDIMAXIMIZE; + static WM_MDITILE;static WM_MDICASCADE;static WM_MDIICONARRANGE; + static WM_MDIGETACTIVE;static WM_MDISETMENU;static WM_ENTERSIZEMOVE; + static WM_EXITSIZEMOVE;static WM_DROPFILES;static WM_MDIREFRESHMENU; + static WM_POINTERDEVICECHANGE;static WM_POINTERDEVICEINRANGE;static WM_POINTERDEVICEOUTOFRANGE; + static WM_TOUCH;static WM_NCPOINTERUPDATE;static WM_NCPOINTERDOWN; + static WM_NCPOINTERUP;static WM_POINTERUPDATE;static WM_POINTERDOWN; + static WM_POINTERUP;static WM_POINTERENTER;static WM_POINTERLEAVE; + static WM_POINTERACTIVATE;static WM_POINTERCAPTURECHANGED;static WM_TOUCHHITTESTING; + static WM_POINTERWHEEL;static WM_POINTERHWHEEL;static DM_POINTERHITTEST; + static WM_IME_SETCONTEXT;static WM_IME_NOTIFY;static WM_IME_CONTROL; + static WM_IME_COMPOSITIONFULL;static WM_IME_SELECT;static WM_IME_CHAR; + static WM_IME_REQUEST;static WM_IME_KEYDOWN;static WM_IME_KEYUP; + static WM_MOUSEHOVER;static WM_MOUSELEAVE;static WM_NCMOUSEHOVER; + static WM_NCMOUSELEAVE;static WM_WTSSESSION_CHANGE;static WM_TABLET_FIRST; + static WM_TABLET_LAST;static WM_DPICHANGED;static WM_CUT; + static WM_COPY;static WM_PASTE;static WM_CLEAR; + static WM_UNDO;static WM_RENDERFORMAT;static WM_RENDERALLFORMATS; + static WM_DESTROYCLIPBOARD;static WM_DRAWCLIPBOARD;static WM_PAINTCLIPBOARD; + static WM_VSCROLLCLIPBOARD;static WM_SIZECLIPBOARD;static WM_ASKCBFORMATNAME; + static WM_CHANGECBCHAIN;static WM_HSCROLLCLIPBOARD;static WM_QUERYNEWPALETTE; + static WM_PALETTEISCHANGING;static WM_PALETTECHANGED;static WM_HOTKEY; + static WM_PRINT;static WM_PRINTCLIENT;static WM_APPCOMMAND; + static WM_THEMECHANGED;static WM_CLIPBOARDUPDATE;static WM_DWMCOMPOSITIONCHANGED; + static WM_DWMNCRENDERINGCHANGED;static WM_DWMCOLORIZATIONCOLORCHANGED;static WM_DWMWINDOWMAXIMIZEDCHANGE; + static WM_DWMSENDICONICTHUMBNAIL;static WM_DWMSENDICONICLIVEPREVIEWBITMAP;static WM_GETTITLEBARINFOEX; + static WM_HANDHELDFIRST;static WM_HANDHELDLAST;static WM_AFXFIRST; + static WM_AFXLAST;static WM_PENWINFIRST;static WM_PENWINLAST; + static WM_APP;static WM_USER;static WM_USERFIST; + static WM_NOTTOSELF;static WM_QUOTATIONS;static WMSZ_LEFT; + static WMSZ_RIGHT;static WMSZ_TOP;static WMSZ_TOPLEFT; + static WMSZ_TOPRIGHT;static WMSZ_BOTTOM;static WMSZ_BOTTOMLEFT; + static WMSZ_BOTTOMRIGHT;static HTERROR;static HTTRANSPARENT; + static HTNOWHERE;static HTCLIENT;static HTCAPTION; + static HTSYSMENU;static HTGROWBOX;static HTSIZE; + static HTMENU;static HTHSCROLL;static HTVSCROLL; + static HTMINBUTTON;static HTMAXBUTTON;static HTLEFT; + static HTRIGHT;static HTTOP;static HTTOPLEFT; + static HTTOPRIGHT;static HTBOTTOM;static HTBOTTOMLEFT; + static HTBOTTOMRIGHT;static HTBORDER;static HTREDUCE; + static HTZOOM;static HTSIZEFIRST;static HTSIZELAST; + static HTOBJECT;static HTCLOSE;static HTHELP; + static SMTO_NORMAL;static SMTO_BLOCK;static SMTO_ABORTIFHUNG; + static SMTO_NOTIMEOUTIFNOTHUNG;static SMTO_ERRORONEXIT;static MA_ACTIVATE; + static MA_ACTIVATEANDEAT;static MA_NOACTIVATE;static MA_NOACTIVATEANDEAT; + static ICON_SMALL;static ICON_BIG;static ICON_SMALL2; + static REGISTERWINDOWMESSAGE;static SIZE_RESTORED;static SIZE_MINIMIZED; + static SIZE_MAXIMIZED;static SIZE_MAXSHOW;static SIZE_MAXHIDE; + static SIZENORMAL;static SIZEICONIC;static SIZEFULLSCREEN; + static SIZEZOOMSHOW;static SIZEZOOMHIDE;static WVR_ALIGNTOP; + static WVR_ALIGNLEFT;static WVR_ALIGNBOTTOM;static WVR_ALIGNRIGHT; + static WVR_HREDRAW;static WVR_VREDRAW;static WVR_REDRAW; + static WVR_VALIDRECTS;static MK_LBUTTON;static MK_RBUTTON; + static MK_SHIFT;static MK_CONTROL;static MK_MBUTTON; + static MK_XBUTTON1;static MK_XBUTTON2;static TME_HOVER; + static TME_LEAVE;static TME_NONCLIENT;static TME_QUERY; + static TME_CANCEL;static HOVER_DEFAULT;static WS_OVERLAPPED; + static WS_POPUP;static WS_CHILD;static WS_MINIMIZE; + static WS_VISIBLE;static WS_DISABLED;static WS_CLIPSIBLINGS; + static WS_CLIPCHILDREN;static WS_MAXIMIZE;static WS_CAPTION; + static WS_BORDER;static WS_DLGFRAME;static WS_VSCROLL; + static WS_HSCROLL;static WS_SYSMENU;static WS_THICKFRAME; + static WS_GROUP;static WS_TABSTOP;static WS_MINIMIZEBOX; + static WS_MAXIMIZEBOX;static WS_TILED;static WS_ICONIC; + static WS_SIZEBOX;static WS_TILEDWINDOW;static WS_OVERLAPPEDWINDOW; + static WS_POPUPWINDOW;static WS_CHILDWINDOW;static WS_EX_DLGMODALFRAME; + static WS_EX_NOPARENTNOTIFY;static WS_EX_TOPMOST;static WS_EX_ACCEPTFILES; + static WS_EX_TRANSPARENT;static WS_EX_MDICHILD;static WS_EX_TOOLWINDOW; + static WS_EX_WINDOWEDGE;static WS_EX_CLIENTEDGE;static WS_EX_CONTEXTHELP; + static WS_EX_RIGHT;static WS_EX_LEFT;static WS_EX_RTLREADING; + static WS_EX_LTRREADING;static WS_EX_LEFTSCROLLBAR;static WS_EX_RIGHTSCROLLBAR; + static WS_EX_CONTROLPARENT;static WS_EX_STATICEDGE;static WS_EX_APPWINDOW; + static WS_EX_OVERLAPPEDWINDOW;static WS_EX_PALETTEWINDOW;static WS_EX_LAYERED; + static WS_EX_NOINHERITLAYOUT;static WS_EX_NOREDIRECTIONBITMAP;static WS_EX_LAYOUTRTL; + static WS_EX_COMPOSITED;static WS_EX_NOACTIVATE;static CS_VREDRAW; + static CS_HREDRAW;static CS_DBLCLKS;static CS_OWNDC; + static CS_CLASSDC;static CS_PARENTDC;static CS_NOCLOSE; + static CS_SAVEBITS;static CS_BYTEALIGNCLIENT;static CS_BYTEALIGNWINDOW; + static CS_GLOBALCLASS;static CS_IME;static CS_DROPSHADOW; + static PRF_CHECKVISIBLE;static PRF_NONCLIENT;static PRF_CLIENT; + static PRF_ERASEBKGND;static PRF_CHILDREN;static PRF_OWNED; + static BDR_RAISEDOUTER;static BDR_SUNKENOUTER;static BDR_RAISEDINNER; + static BDR_SUNKENINNER;static BDR_OUTER;static BDR_INNER; + static BDR_RAISED;static BDR_SUNKEN;static EDGE_RAISED; + static EDGE_SUNKEN;static EDGE_ETCHED;static EDGE_BUMP; + static BF_LEFT;static BF_TOP;static BF_RIGHT; + static BF_BOTTOM;static BF_TOPLEFT;static BF_TOPRIGHT; + static BF_BOTTOMLEFT;static BF_BOTTOMRIGHT;static BF_RECT; + static BF_DIAGONAL;static BF_DIAGONAL_ENDTOPRIGHT;static BF_DIAGONAL_ENDTOPLEFT; + static BF_DIAGONAL_ENDBOTTOMLEFT;static BF_DIAGONAL_ENDBOTTOMRIGHT;static BF_MIDDLE; + static BF_SOFT;static BF_ADJUST;static BF_FLAT; + static BF_MONO;static DFC_CAPTION;static DFC_MENU; + static DFC_SCROLL;static DFC_BUTTON;static DFC_POPUPMENU; + static DFCS_CAPTIONCLOSE;static DFCS_CAPTIONMIN;static DFCS_CAPTIONMAX; + static DFCS_CAPTIONRESTORE;static DFCS_CAPTIONHELP;static DFCS_MENUARROW; + static DFCS_MENUCHECK;static DFCS_MENUBULLET;static DFCS_MENUARROWRIGHT; + static DFCS_SCROLLUP;static DFCS_SCROLLDOWN;static DFCS_SCROLLLEFT; + static DFCS_SCROLLRIGHT;static DFCS_SCROLLCOMBOBOX;static DFCS_SCROLLSIZEGRIP; + static DFCS_SCROLLSIZEGRIPRIGHT;static DFCS_BUTTONCHECK;static DFCS_BUTTONRADIOIMAGE; + static DFCS_BUTTONRADIOMASK;static DFCS_BUTTONRADIO;static DFCS_BUTTON3STATE; + static DFCS_BUTTONPUSH;static DFCS_INACTIVE;static DFCS_PUSHED; + static DFCS_CHECKED;static DFCS_TRANSPARENT;static DFCS_HOT; + static DFCS_ADJUSTRECT;static DFCS_FLAT;static DFCS_MONO; + static DC_ACTIVE;static DC_SMALLCAP;static DC_ICON; + static DC_TEXT;static DC_INBUTTON;static DC_GRADIENT; + static DC_BUTTONS;static IDANI_OPEN;static IDANI_CAPTION; + static CF_TEXT;static CF_BITMAP;static CF_METAFILEPICT; + static CF_SYLK;static CF_DIF;static CF_TIFF; + static CF_OEMTEXT;static CF_DIB;static CF_PALETTE; + static CF_PENDATA;static CF_RIFF;static CF_WAVE; + static CF_UNICODETEXT;static CF_ENHMETAFILE;static CF_HDROP; + static CF_LOCALE;static CF_DIBV5;static CF_MAX; + static CF_OWNERDISPLAY;static CF_DSPTEXT;static CF_DSPBITMAP; + static CF_DSPMETAFILEPICT;static CF_DSPENHMETAFILE;static CF_PRIVATEFIRST; + static CF_PRIVATELAST;static CF_GDIOBJFIRST;static CF_GDIOBJLAST; + static FVIRTKEY;static FNOINVERT;static FSHIFT; + static FCONTROL;static FALT;static WPF_SETMINPOSITION; + static WPF_RESTORETOMAXIMIZED;static WPF_ASYNCWINDOWPLACEMENT;static ODT_MENU; + static ODT_LISTBOX;static ODT_COMBOBOX;static ODT_BUTTON; + static ODT_STATIC;static ODA_DRAWENTIRE;static ODA_SELECT; + static ODA_FOCUS;static ODS_SELECTED;static ODS_GRAYED; + static ODS_DISABLED;static ODS_CHECKED;static ODS_FOCUS; + static ODS_DEFAULT;static ODS_COMBOBOXEDIT;static ODS_HOTLIGHT; + static ODS_INACTIVE;static ODS_NOACCEL;static ODS_NOFOCUSRECT; + static DISPATCHMESSAGE;static PEEKMESSAGE;static PM_NOREMOVE; + static PM_REMOVE;static PM_NOYIELD;static PM_QS_INPUT; + static PM_QS_POSTMESSAGE;static PM_QS_PAINT;static PM_QS_SENDMESSAGE; + static MOD_ALT;static MOD_CONTROL;static MOD_SHIFT; + static MOD_WIN;static MOD_NOREPEAT;static IDHOT_SNAPWINDOW; + static IDHOT_SNAPDESKTOP;static ENDSESSION_CLOSEAPP;static ENDSESSION_CRITICAL; + static ENDSESSION_LOGOFF;static EWX_LOGOFF;static EWX_SHUTDOWN; + static EWX_REBOOT;static EWX_FORCE;static EWX_POWEROFF; + static EWX_FORCEIFHUNG;static EWX_QUICKRESOLVE;static EWX_RESTARTAPPS; + static EWX_HYBRID_SHUTDOWN;static EWX_BOOTOPTIONS;static SENDMESSAGE; + static SENDMESSAGETIMEOUT;static SENDNOTIFYMESSAGE;static SENDMESSAGECALLBACK; + static BROADCASTSYSTEMMESSAGEEX;static BROADCASTSYSTEMMESSAGE;static BSM_ALLCOMPONENTS; + static BSM_VXDS;static BSM_NETDRIVER;static BSM_INSTALLABLEDRIVERS; + static BSM_APPLICATIONS;static BSM_ALLDESKTOPS;static BSF_QUERY; + static BSF_IGNORECURRENTTASK;static BSF_FLUSHDISK;static BSF_NOHANG; + static BSF_POSTMESSAGE;static BSF_FORCEIFHUNG;static BSF_NOTIMEOUTIFNOTHUNG; + static BSF_ALLOWSFW;static BSF_SENDNOTIFYMESSAGE;static BSF_RETURNHDESK; + static BSF_LUID;static BROADCAST_QUERY_DENY;static DEVICE_NOTIFY_WINDOW_HANDLE; + static DEVICE_NOTIFY_SERVICE_HANDLE;static DEVICE_NOTIFY_ALL_INTERFACE_CLASSES;static REGISTERDEVICENOTIFICATION; + static POSTMESSAGE;static POSTTHREADMESSAGE;static POSTAPPMESSAGE; + static HWND_BROADCAST;static HWND_MESSAGE;static DEFWINDOWPROC; + static ISMEX_NOSEND;static ISMEX_SEND;static ISMEX_NOTIFY; + static ISMEX_CALLBACK;static ISMEX_REPLIED;static REGISTERCLASS; + static UNREGISTERCLASS;static GETCLASSINFO;static REGISTERCLASSEX; + static GETCLASSINFOEX;static CW_USEDEFAULT;static HWND_DESKTOP; + static CREATEWINDOWEX;static CREATEWINDOW;static PW_CLIENTONLY; + static PW_RENDERFULLCONTENT;static LWA_COLORKEY;static LWA_ALPHA; + static ULW_COLORKEY;static ULW_ALPHA;static ULW_OPAQUE; + static ULW_EX_NORESIZE;static FLASHW_STOP;static FLASHW_CAPTION; + static FLASHW_TRAY;static FLASHW_ALL;static FLASHW_TIMER; + static FLASHW_TIMERNOFG;static WDA_NONE;static WDA_MONITOR; + static SWP_NOSIZE;static SWP_NOMOVE;static SWP_NOZORDER; + static SWP_NOREDRAW;static SWP_NOACTIVATE;static SWP_FRAMECHANGED; + static SWP_SHOWWINDOW;static SWP_HIDEWINDOW;static SWP_NOCOPYBITS; + static SWP_NOOWNERZORDER;static SWP_NOSENDCHANGING;static SWP_DRAWFRAME; + static SWP_NOREPOSITION;static SWP_DEFERERASE;static SWP_ASYNCWINDOWPOS; + static HWND_TOP;static HWND_BOTTOM;static HWND_TOPMOST; + static HWND_NOTOPMOST;static CREATEDIALOGPARAM;static CREATEDIALOGINDIRECTPARAM; + static CREATEDIALOG;static CREATEDIALOGINDIRECT;static DIALOGBOXPARAM; + static DIALOGBOXINDIRECTPARAM;static DIALOGBOX;static DIALOGBOXINDIRECT; + static SETDLGITEMTEXT;static GETDLGITEMTEXT;static SENDDLGITEMMESSAGE; + static DEFDLGPROC;static DLGWINDOWEXTRA;static CALLMSGFILTER; + static REGISTERCLIPBOARDFORMAT;static GETCLIPBOARDFORMATNAME;static CHARTOOEM; + static OEMTOCHAR;static CHARTOOEMBUFF;static OEMTOCHARBUFF; + static CHARUPPER;static CHARUPPERBUFF;static CHARLOWER; + static CHARLOWERBUFF;static CHARNEXT;static CHARPREV; + static ANSITOOEM;static OEMTOANSI;static ANSITOOEMBUFF; + static OEMTOANSIBUFF;static ANSIUPPER;static ANSIUPPERBUFF; + static ANSILOWER;static ANSILOWERBUFF;static ANSINEXT; + static ANSIPREV;static ISCHARALPHA;static ISCHARALPHANUMERIC; + static ISCHARUPPER;static ISCHARLOWER;static GETKEYNAMETEXT; + static VKKEYSCAN;static VKKEYSCANEX;static KEYEVENTF_EXTENDEDKEY; + static KEYEVENTF_KEYUP;static KEYEVENTF_UNICODE;static KEYEVENTF_SCANCODE; + static MOUSEEVENTF_MOVE;static MOUSEEVENTF_LEFTDOWN;static MOUSEEVENTF_LEFTUP; + static MOUSEEVENTF_RIGHTDOWN;static MOUSEEVENTF_RIGHTUP;static MOUSEEVENTF_MIDDLEDOWN; + static MOUSEEVENTF_MIDDLEUP;static MOUSEEVENTF_XDOWN;static MOUSEEVENTF_XUP; + static MOUSEEVENTF_WHEEL;static MOUSEEVENTF_HWHEEL;static MOUSEEVENTF_MOVE_NOCOALESCE; + static MOUSEEVENTF_VIRTUALDESK;static MOUSEEVENTF_ABSOLUTE;static INPUT_MOUSE; + static INPUT_KEYBOARD;static INPUT_HARDWARE;static TOUCHEVENTF_MOVE; + static TOUCHEVENTF_DOWN;static TOUCHEVENTF_UP;static TOUCHEVENTF_INRANGE; + static TOUCHEVENTF_PRIMARY;static TOUCHEVENTF_NOCOALESCE;static TOUCHEVENTF_PEN; + static TOUCHEVENTF_PALM;static TOUCHINPUTMASKF_TIMEFROMSYSTEM;static TOUCHINPUTMASKF_EXTRAINFO; + static TOUCHINPUTMASKF_CONTACTAREA;static TWF_FINETOUCH;static TWF_WANTPALM; + static POINTER_FLAG_NONE;static POINTER_FLAG_NEW;static POINTER_FLAG_INRANGE; + static POINTER_FLAG_INCONTACT;static POINTER_FLAG_FIRSTBUTTON;static POINTER_FLAG_SECONDBUTTON; + static POINTER_FLAG_THIRDBUTTON;static POINTER_FLAG_FOURTHBUTTON;static POINTER_FLAG_FIFTHBUTTON; + static POINTER_FLAG_PRIMARY;static POINTER_FLAG_CONFIDENCE;static POINTER_FLAG_CANCELED; + static POINTER_FLAG_DOWN;static POINTER_FLAG_UPDATE;static POINTER_FLAG_UP; + static POINTER_FLAG_WHEEL;static POINTER_FLAG_HWHEEL;static POINTER_FLAG_CAPTURECHANGED; + static POINTER_FLAG_HASTRANSFORM;static POINTER_MOD_SHIFT;static POINTER_MOD_CTRL; + static TOUCH_FLAG_NONE;static TOUCH_MASK_NONE;static TOUCH_MASK_CONTACTAREA; + static TOUCH_MASK_ORIENTATION;static TOUCH_MASK_PRESSURE;static PEN_FLAG_NONE; + static PEN_FLAG_BARREL;static PEN_FLAG_INVERTED;static PEN_FLAG_ERASER; + static PEN_MASK_NONE;static PEN_MASK_PRESSURE;static PEN_MASK_ROTATION; + static PEN_MASK_TILT_X;static PEN_MASK_TILT_Y;static POINTER_MESSAGE_FLAG_NEW; + static POINTER_MESSAGE_FLAG_INRANGE;static POINTER_MESSAGE_FLAG_INCONTACT;static POINTER_MESSAGE_FLAG_FIRSTBUTTON; + static POINTER_MESSAGE_FLAG_SECONDBUTTON;static POINTER_MESSAGE_FLAG_THIRDBUTTON;static POINTER_MESSAGE_FLAG_FOURTHBUTTON; + static POINTER_MESSAGE_FLAG_FIFTHBUTTON;static POINTER_MESSAGE_FLAG_PRIMARY;static POINTER_MESSAGE_FLAG_CONFIDENCE; + static POINTER_MESSAGE_FLAG_CANCELED;static PA_ACTIVATE;static PA_NOACTIVATE; + static MAX_TOUCH_COUNT;static TOUCH_FEEDBACK_DEFAULT;static TOUCH_FEEDBACK_INDIRECT; + static TOUCH_FEEDBACK_NONE;static TOUCH_HIT_TESTING_DEFAULT;static TOUCH_HIT_TESTING_CLIENT; + static TOUCH_HIT_TESTING_NONE;static TOUCH_HIT_TESTING_PROXIMITY_CLOSEST;static TOUCH_HIT_TESTING_PROXIMITY_FARTHEST; + static GWFS_INCLUDE_ANCESTORS;static MAPVIRTUALKEY;static MAPVIRTUALKEYEX; + static MAPVK_VK_TO_VSC;static MAPVK_VSC_TO_VK;static MAPVK_VK_TO_CHAR; + static MAPVK_VSC_TO_VK_EX;static MAPVK_VK_TO_VSC_EX;static MWMO_WAITALL; + static MWMO_ALERTABLE;static MWMO_INPUTAVAILABLE;static QS_KEY; + static QS_MOUSEMOVE;static QS_MOUSEBUTTON;static QS_POSTMESSAGE; + static QS_TIMER;static QS_PAINT;static QS_SENDMESSAGE; + static QS_HOTKEY;static QS_ALLPOSTMESSAGE;static QS_RAWINPUT; + static QS_TOUCH;static QS_POINTER;static QS_MOUSE; + static QS_INPUT;static QS_ALLEVENTS;static QS_ALLINPUT; + static USER_TIMER_MAXIMUM;static USER_TIMER_MINIMUM;static TIMERV_DEFAULT_COALESCING; + static TIMERV_NO_COALESCING;static TIMERV_COALESCING_MIN;static TIMERV_COALESCING_MAX; + static LOADACCELERATORS;static CREATEACCELERATORTABLE;static COPYACCELERATORTABLE; + static TRANSLATEACCELERATOR;static SM_CXSCREEN;static SM_CYSCREEN; + static SM_CXVSCROLL;static SM_CYHSCROLL;static SM_CYCAPTION; + static SM_CXBORDER;static SM_CYBORDER;static SM_CXDLGFRAME; + static SM_CYDLGFRAME;static SM_CYVTHUMB;static SM_CXHTHUMB; + static SM_CXICON;static SM_CYICON;static SM_CXCURSOR; + static SM_CYCURSOR;static SM_CYMENU;static SM_CXFULLSCREEN; + static SM_CYFULLSCREEN;static SM_CYKANJIWINDOW;static SM_MOUSEPRESENT; + static SM_CYVSCROLL;static SM_CXHSCROLL;static SM_DEBUG; + static SM_SWAPBUTTON;static SM_RESERVED1;static SM_RESERVED2; + static SM_RESERVED3;static SM_RESERVED4;static SM_CXMIN; + static SM_CYMIN;static SM_CXSIZE;static SM_CYSIZE; + static SM_CXFRAME;static SM_CYFRAME;static SM_CXMINTRACK; + static SM_CYMINTRACK;static SM_CXDOUBLECLK;static SM_CYDOUBLECLK; + static SM_CXICONSPACING;static SM_CYICONSPACING;static SM_MENUDROPALIGNMENT; + static SM_PENWINDOWS;static SM_DBCSENABLED;static SM_CMOUSEBUTTONS; + static SM_CXFIXEDFRAME;static SM_CYFIXEDFRAME;static SM_CXSIZEFRAME; + static SM_CYSIZEFRAME;static SM_SECURE;static SM_CXEDGE; + static SM_CYEDGE;static SM_CXMINSPACING;static SM_CYMINSPACING; + static SM_CXSMICON;static SM_CYSMICON;static SM_CYSMCAPTION; + static SM_CXSMSIZE;static SM_CYSMSIZE;static SM_CXMENUSIZE; + static SM_CYMENUSIZE;static SM_ARRANGE;static SM_CXMINIMIZED; + static SM_CYMINIMIZED;static SM_CXMAXTRACK;static SM_CYMAXTRACK; + static SM_CXMAXIMIZED;static SM_CYMAXIMIZED;static SM_NETWORK; + static SM_CLEANBOOT;static SM_CXDRAG;static SM_CYDRAG; + static SM_SHOWSOUNDS;static SM_CXMENUCHECK;static SM_CYMENUCHECK; + static SM_SLOWMACHINE;static SM_MIDEASTENABLED;static SM_MOUSEWHEELPRESENT; + static SM_XVIRTUALSCREEN;static SM_YVIRTUALSCREEN;static SM_CXVIRTUALSCREEN; + static SM_CYVIRTUALSCREEN;static SM_CMONITORS;static SM_SAMEDISPLAYFORMAT; + static SM_IMMENABLED;static SM_CXFOCUSBORDER;static SM_CYFOCUSBORDER; + static SM_TABLETPC;static SM_MEDIACENTER;static SM_STARTER; + static SM_SERVERR2;static SM_MOUSEHORIZONTALWHEELPRESENT;static SM_CXPADDEDBORDER; + static SM_DIGITIZER;static SM_MAXIMUMTOUCHES;static SM_CMETRICS; + static SM_REMOTESESSION;static SM_SHUTTINGDOWN;static SM_REMOTECONTROL; + static SM_CARETBLINKINGENABLED;static SM_CONVERTIBLESLATEMODE;static SM_SYSTEMDOCKED; + static LOADMENU;static LOADMENUINDIRECT;static CHANGEMENU; + static GETMENUSTRING;static PMB_ACTIVE;static INSERTMENU; + static APPENDMENU;static MODIFYMENU;static MNC_IGNORE; + static MNC_CLOSE;static MNC_EXECUTE;static MNC_SELECT; + static MNS_NOCHECK;static MNS_MODELESS;static MNS_DRAGDROP; + static MNS_AUTODISMISS;static MNS_NOTIFYBYPOS;static MNS_CHECKORBMP; + static MIM_MAXHEIGHT;static MIM_BACKGROUND;static MIM_HELPID; + static MIM_MENUDATA;static MIM_STYLE;static MIM_APPLYTOSUBMENUS; + static MND_CONTINUE;static MND_ENDMENU;static MNGOF_TOPGAP; + static MNGOF_BOTTOMGAP;static MNGO_NOINTERFACE;static MNGO_NOERROR; + static MIIM_STATE;static MIIM_ID;static MIIM_SUBMENU; + static MIIM_CHECKMARKS;static MIIM_TYPE;static MIIM_DATA; + static MIIM_STRING;static MIIM_BITMAP;static MIIM_FTYPE; + static HBMMENU_CALLBACK;static HBMMENU_SYSTEM;static HBMMENU_MBAR_RESTORE; + static HBMMENU_MBAR_MINIMIZE;static HBMMENU_MBAR_CLOSE;static HBMMENU_MBAR_CLOSE_D; + static HBMMENU_MBAR_MINIMIZE_D;static HBMMENU_POPUP_CLOSE;static HBMMENU_POPUP_RESTORE; + static HBMMENU_POPUP_MAXIMIZE;static HBMMENU_POPUP_MINIMIZE;static INSERTMENUITEM; + static GETMENUITEMINFO;static SETMENUITEMINFO;static GMDI_USEDISABLED; + static GMDI_GOINTOPOPUPS;static TPM_LEFTBUTTON;static TPM_RIGHTBUTTON; + static TPM_LEFTALIGN;static TPM_CENTERALIGN;static TPM_RIGHTALIGN; + static TPM_TOPALIGN;static TPM_VCENTERALIGN;static TPM_BOTTOMALIGN; + static TPM_HORIZONTAL;static TPM_VERTICAL;static TPM_NONOTIFY; + static TPM_RETURNCMD;static TPM_RECURSE;static TPM_HORPOSANIMATION; + static TPM_HORNEGANIMATION;static TPM_VERPOSANIMATION;static TPM_VERNEGANIMATION; + static TPM_NOANIMATION;static TPM_LAYOUTRTL;static TPM_WORKAREA; + static DOF_EXECUTABLE;static DOF_DOCUMENT;static DOF_DIRECTORY; + static DOF_MULTIPLE;static DOF_PROGMAN;static DOF_SHELLDATA; + static DO_DROPFILE;static DO_PRINTFILE;static DT_TOP; + static DT_LEFT;static DT_CENTER;static DT_RIGHT; + static DT_VCENTER;static DT_BOTTOM;static DT_WORDBREAK; + static DT_SINGLELINE;static DT_EXPANDTABS;static DT_TABSTOP; + static DT_NOCLIP;static DT_EXTERNALLEADING;static DT_CALCRECT; + static DT_NOPREFIX;static DT_INTERNAL;static DT_EDITCONTROL; + static DT_PATH_ELLIPSIS;static DT_END_ELLIPSIS;static DT_MODIFYSTRING; + static DT_RTLREADING;static DT_WORD_ELLIPSIS;static DT_NOFULLWIDTHCHARBREAK; + static DT_HIDEPREFIX;static DT_PREFIXONLY;static DRAWTEXT; + static DRAWTEXTEX;static GRAYSTRING;static DST_COMPLEX; + static DST_TEXT;static DST_PREFIXTEXT;static DST_ICON; + static DST_BITMAP;static DSS_NORMAL;static DSS_UNION; + static DSS_DISABLED;static DSS_MONO;static DSS_HIDEPREFIX; + static DSS_PREFIXONLY;static DSS_RIGHT;static DRAWSTATE; + static TABBEDTEXTOUT;static GETTABBEDTEXTEXTENT;static ASFW_ANY; + static LSFW_LOCK;static LSFW_UNLOCK;static DCX_WINDOW; + static DCX_CACHE;static DCX_NORESETATTRS;static DCX_CLIPCHILDREN; + static DCX_CLIPSIBLINGS;static DCX_PARENTCLIP;static DCX_EXCLUDERGN; + static DCX_INTERSECTRGN;static DCX_EXCLUDEUPDATE;static DCX_INTERSECTUPDATE; + static DCX_LOCKWINDOWUPDATE;static DCX_VALIDATE;static RDW_INVALIDATE; + static RDW_INTERNALPAINT;static RDW_ERASE;static RDW_VALIDATE; + static RDW_NOINTERNALPAINT;static RDW_NOERASE;static RDW_NOCHILDREN; + static RDW_ALLCHILDREN;static RDW_UPDATENOW;static RDW_ERASENOW; + static RDW_FRAME;static RDW_NOFRAME;static SW_SCROLLCHILDREN; + static SW_INVALIDATE;static SW_ERASE;static SW_SMOOTHSCROLL; + static ESB_ENABLE_BOTH;static ESB_DISABLE_BOTH;static ESB_DISABLE_LEFT; + static ESB_DISABLE_RIGHT;static ESB_DISABLE_UP;static ESB_DISABLE_DOWN; + static ESB_DISABLE_LTUP;static ESB_DISABLE_RTDN;static SETPROP; + static GETPROP;static REMOVEPROP;static ENUMPROPSEX; + static ENUMPROPS;static SETWINDOWTEXT;static GETWINDOWTEXT; + static GETWINDOWTEXTLENGTH;static HELPINFO_WINDOW;static HELPINFO_MENUITEM; + static MB_OK;static MB_OKCANCEL;static MB_ABORTRETRYIGNORE; + static MB_YESNOCANCEL;static MB_YESNO;static MB_RETRYCANCEL; + static MB_CANCELTRYCONTINUE;static MB_ICONHAND;static MB_ICONQUESTION; + static MB_ICONEXCLAMATION;static MB_ICONASTERISK;static MB_USERICON; + static MB_ICONWARNING;static MB_ICONERROR;static MB_ICONINFORMATION; + static MB_ICONSTOP;static MB_DEFBUTTON1;static MB_DEFBUTTON2; + static MB_DEFBUTTON3;static MB_DEFBUTTON4;static MB_APPLMODAL; + static MB_SYSTEMMODAL;static MB_TASKMODAL;static MB_HELP; + static MB_NOFOCUS;static MB_SETFOREGROUND;static MB_DEFAULT_DESKTOP_ONLY; + static MB_TOPMOST;static MB_RIGHT;static MB_RTLREADING; + static MB_SERVICE_NOTIFICATION;static MB_SERVICE_NOTIFICATION_NT3X;static MB_TYPEMASK; + static MB_ICONMASK;static MB_DEFMASK;static MB_MODEMASK; + static MB_MISCMASK;static MESSAGEBOX;static MESSAGEBOXEX; + static MESSAGEBOXINDIRECT;static CWP_ALL;static CWP_SKIPINVISIBLE; + static CWP_SKIPDISABLED;static CWP_SKIPTRANSPARENT;static CTLCOLOR_MSGBOX; + static CTLCOLOR_EDIT;static CTLCOLOR_LISTBOX;static CTLCOLOR_BTN; + static CTLCOLOR_DLG;static CTLCOLOR_SCROLLBAR;static CTLCOLOR_STATIC; + static CTLCOLOR_MAX;static COLOR_SCROLLBAR;static COLOR_BACKGROUND; + static COLOR_ACTIVECAPTION;static COLOR_INACTIVECAPTION;static COLOR_MENU; + static COLOR_WINDOW;static COLOR_WINDOWFRAME;static COLOR_MENUTEXT; + static COLOR_WINDOWTEXT;static COLOR_CAPTIONTEXT;static COLOR_ACTIVEBORDER; + static COLOR_INACTIVEBORDER;static COLOR_APPWORKSPACE;static COLOR_HIGHLIGHT; + static COLOR_HIGHLIGHTTEXT;static COLOR_BTNFACE;static COLOR_BTNSHADOW; + static COLOR_GRAYTEXT;static COLOR_BTNTEXT;static COLOR_INACTIVECAPTIONTEXT; + static COLOR_BTNHIGHLIGHT;static COLOR_3DDKSHADOW;static COLOR_3DLIGHT; + static COLOR_INFOTEXT;static COLOR_INFOBK;static COLOR_HOTLIGHT; + static COLOR_GRADIENTACTIVECAPTION;static COLOR_GRADIENTINACTIVECAPTION;static COLOR_MENUHILIGHT; + static COLOR_MENUBAR;static COLOR_DESKTOP;static COLOR_3DFACE; + static COLOR_3DSHADOW;static COLOR_3DHIGHLIGHT;static COLOR_3DHILIGHT; + static COLOR_BTNHILIGHT;static GETWINDOWLONG;static SETWINDOWLONG; + static GETWINDOWLONGPTR;static SETWINDOWLONGPTR;static GETCLASSLONG; + static SETCLASSLONG;static GETCLASSLONGPTR;static SETCLASSLONGPTR; + static FINDWINDOW;static FINDWINDOWEX;static GETCLASSNAME; + static GW_HWNDFIRST;static GW_HWNDLAST;static GW_HWNDNEXT; + static GW_HWNDPREV;static GW_OWNER;static GW_CHILD; + static GW_ENABLEDPOPUP;static GW_MAX;static SETWINDOWSHOOKEX; + static MF_INSERT;static MF_CHANGE;static MF_APPEND; + static MF_DELETE;static MF_REMOVE;static MF_BYCOMMAND; + static MF_BYPOSITION;static MF_SEPARATOR;static MF_ENABLED; + static MF_GRAYED;static MF_DISABLED;static MF_UNCHECKED; + static MF_CHECKED;static MF_USECHECKBITMAPS;static MF_STRING; + static MF_BITMAP;static MF_OWNERDRAW;static MF_POPUP; + static MF_MENUBARBREAK;static MF_MENUBREAK;static MF_UNHILITE; + static MF_HILITE;static MF_DEFAULT;static MF_SYSMENU; + static MF_HELP;static MF_RIGHTJUSTIFY;static MF_MOUSESELECT; + static MF_END;static MFT_STRING;static MFT_BITMAP; + static MFT_MENUBARBREAK;static MFT_MENUBREAK;static MFT_OWNERDRAW; + static MFT_RADIOCHECK;static MFT_SEPARATOR;static MFT_RIGHTORDER; + static MFT_RIGHTJUSTIFY;static MFS_GRAYED;static MFS_DISABLED; + static MFS_CHECKED;static MFS_HILITE;static MFS_ENABLED; + static MFS_UNCHECKED;static MFS_UNHILITE;static MFS_DEFAULT; + static SC_SIZE;static SC_MOVE;static SC_MINIMIZE; + static SC_MAXIMIZE;static SC_NEXTWINDOW;static SC_PREVWINDOW; + static SC_CLOSE;static SC_VSCROLL;static SC_HSCROLL; + static SC_MOUSEMENU;static SC_KEYMENU;static SC_ARRANGE; + static SC_RESTORE;static SC_TASKLIST;static SC_SCREENSAVE; + static SC_HOTKEY;static SC_DEFAULT;static SC_MONITORPOWER; + static SC_CONTEXTHELP;static SC_SEPARATOR;static SCF_ISSECURE; + static SC_ICON;static SC_ZOOM;static LOADBITMAP; + static LOADCURSOR;static LOADCURSORFROMFILE;static LOADICON; + static PRIVATEEXTRACTICONS;static IMAGE_BITMAP;static IMAGE_ICON; + static IMAGE_CURSOR;static IMAGE_ENHMETAFILE;static LR_DEFAULTCOLOR; + static LR_MONOCHROME;static LR_COLOR;static LR_COPYRETURNORG; + static LR_COPYDELETEORG;static LR_LOADFROMFILE;static LR_LOADTRANSPARENT; + static LR_DEFAULTSIZE;static LR_VGACOLOR;static LR_LOADMAP3DCOLORS; + static LR_CREATEDIBSECTION;static LR_COPYFROMRESOURCE;static LR_SHARED; + static LOADIMAGE;static DI_MASK;static DI_IMAGE; + static DI_NORMAL;static DI_COMPAT;static DI_DEFAULTSIZE; + static DI_NOMIRROR;static GETICONINFOEX;static RES_ICON; + static RES_CURSOR;static OBM_CLOSE;static OBM_UPARROW; + static OBM_DNARROW;static OBM_RGARROW;static OBM_LFARROW; + static OBM_REDUCE;static OBM_ZOOM;static OBM_RESTORE; + static OBM_REDUCED;static OBM_ZOOMD;static OBM_RESTORED; + static OBM_UPARROWD;static OBM_DNARROWD;static OBM_RGARROWD; + static OBM_LFARROWD;static OBM_MNARROW;static OBM_COMBO; + static OBM_UPARROWI;static OBM_DNARROWI;static OBM_RGARROWI; + static OBM_LFARROWI;static OBM_OLD_CLOSE;static OBM_SIZE; + static OBM_OLD_UPARROW;static OBM_OLD_DNARROW;static OBM_OLD_RGARROW; + static OBM_OLD_LFARROW;static OBM_BTSIZE;static OBM_CHECK; + static OBM_CHECKBOXES;static OBM_BTNCORNERS;static OBM_OLD_REDUCE; + static OBM_OLD_ZOOM;static OBM_OLD_RESTORE;static OCR_NORMAL; + static OCR_IBEAM;static OCR_WAIT;static OCR_CROSS; + static OCR_UP;static OCR_SIZE;static OCR_ICON; + static OCR_SIZENWSE;static OCR_SIZENESW;static OCR_SIZEWE; + static OCR_SIZENS;static OCR_SIZEALL;static OCR_ICOCUR; + static OCR_NO;static OCR_HAND;static OCR_APPSTARTING; + static OIC_SAMPLE;static OIC_HAND;static OIC_QUES; + static OIC_BANG;static OIC_NOTE;static OIC_WINLOGO; + static OIC_WARNING;static OIC_ERROR;static OIC_INFORMATION; + static OIC_SHIELD;static ORD_LANGDRIVER;static IDI_APPLICATION; + static IDI_HAND;static IDI_QUESTION;static IDI_EXCLAMATION; + static IDI_ASTERISK;static IDI_WINLOGO;static IDI_SHIELD; + static IDI_WARNING;static IDI_ERROR;static IDI_INFORMATION; + static IDOK;static IDCANCEL;static IDABORT; + static IDRETRY;static IDIGNORE;static IDYES; + static IDNO;static IDCLOSE;static IDHELP; + static IDTRYAGAIN;static IDCONTINUE;static IDTIMEOUT; + static ES_LEFT;static ES_CENTER;static ES_RIGHT; + static ES_MULTILINE;static ES_UPPERCASE;static ES_LOWERCASE; + static ES_PASSWORD;static ES_AUTOVSCROLL;static ES_AUTOHSCROLL; + static ES_NOHIDESEL;static ES_OEMCONVERT;static ES_READONLY; + static ES_WANTRETURN;static ES_NUMBER;static EN_SETFOCUS; + static EN_KILLFOCUS;static EN_CHANGE;static EN_UPDATE; + static EN_ERRSPACE;static EN_MAXTEXT;static EN_HSCROLL; + static EN_VSCROLL;static EN_ALIGN_LTR_EC;static EN_ALIGN_RTL_EC; + static EC_LEFTMARGIN;static EC_RIGHTMARGIN;static EC_USEFONTINFO; + static EMSIS_COMPOSITIONSTRING;static EIMES_GETCOMPSTRATONCE;static EIMES_CANCELCOMPSTRINFOCUS; + static EIMES_COMPLETECOMPSTRKILLFOCUS;static EM_GETSEL;static EM_SETSEL; + static EM_GETRECT;static EM_SETRECT;static EM_SETRECTNP; + static EM_SCROLL;static EM_LINESCROLL;static EM_SCROLLCARET; + static EM_GETMODIFY;static EM_SETMODIFY;static EM_GETLINECOUNT; + static EM_LINEINDEX;static EM_SETHANDLE;static EM_GETHANDLE; + static EM_GETTHUMB;static EM_LINELENGTH;static EM_REPLACESEL; + static EM_GETLINE;static EM_LIMITTEXT;static EM_CANUNDO; + static EM_UNDO;static EM_FMTLINES;static EM_LINEFROMCHAR; + static EM_SETTABSTOPS;static EM_SETPASSWORDCHAR;static EM_EMPTYUNDOBUFFER; + static EM_GETFIRSTVISIBLELINE;static EM_SETREADONLY;static EM_SETWORDBREAKPROC; + static EM_GETWORDBREAKPROC;static EM_GETPASSWORDCHAR;static EM_SETMARGINS; + static EM_GETMARGINS;static EM_SETLIMITTEXT;static EM_GETLIMITTEXT; + static EM_POSFROMCHAR;static EM_CHARFROMPOS;static EM_SETIMESTATUS; + static EM_GETIMESTATUS;static WB_LEFT;static WB_RIGHT; + static WB_ISDELIMITER;static BS_PUSHBUTTON;static BS_DEFPUSHBUTTON; + static BS_CHECKBOX;static BS_AUTOCHECKBOX;static BS_RADIOBUTTON; + static BS_3STATE;static BS_AUTO3STATE;static BS_GROUPBOX; + static BS_USERBUTTON;static BS_AUTORADIOBUTTON;static BS_PUSHBOX; + static BS_OWNERDRAW;static BS_TYPEMASK;static BS_LEFTTEXT; + static BS_TEXT;static BS_ICON;static BS_BITMAP; + static BS_LEFT;static BS_RIGHT;static BS_CENTER; + static BS_TOP;static BS_BOTTOM;static BS_VCENTER; + static BS_PUSHLIKE;static BS_MULTILINE;static BS_NOTIFY; + static BS_FLAT;static BS_RIGHTBUTTON;static BN_CLICKED; + static BN_PAINT;static BN_HILITE;static BN_UNHILITE; + static BN_DISABLE;static BN_DOUBLECLICKED;static BN_PUSHED; + static BN_UNPUSHED;static BN_DBLCLK;static BN_SETFOCUS; + static BN_KILLFOCUS;static BM_GETCHECK;static BM_SETCHECK; + static BM_GETSTATE;static BM_SETSTATE;static BM_SETSTYLE; + static BM_CLICK;static BM_GETIMAGE;static BM_SETIMAGE; + static BM_SETDONTCLICK;static BST_UNCHECKED;static BST_CHECKED; + static BST_INDETERMINATE;static BST_PUSHED;static BST_FOCUS; + static SS_LEFT;static SS_CENTER;static SS_RIGHT; + static SS_ICON;static SS_BLACKRECT;static SS_GRAYRECT; + static SS_WHITERECT;static SS_BLACKFRAME;static SS_GRAYFRAME; + static SS_WHITEFRAME;static SS_USERITEM;static SS_SIMPLE; + static SS_LEFTNOWORDWRAP;static SS_OWNERDRAW;static SS_BITMAP; + static SS_ENHMETAFILE;static SS_ETCHEDHORZ;static SS_ETCHEDVERT; + static SS_ETCHEDFRAME;static SS_TYPEMASK;static SS_REALSIZECONTROL; + static SS_NOPREFIX;static SS_NOTIFY;static SS_CENTERIMAGE; + static SS_RIGHTJUST;static SS_REALSIZEIMAGE;static SS_SUNKEN; + static SS_EDITCONTROL;static SS_ENDELLIPSIS;static SS_PATHELLIPSIS; + static SS_WORDELLIPSIS;static SS_ELLIPSISMASK;static STM_SETICON; + static STM_GETICON;static STM_SETIMAGE;static STM_GETIMAGE; + static STN_CLICKED;static STN_DBLCLK;static STN_ENABLE; + static STN_DISABLE;static STM_MSGMAX;static DWL_MSGRESULT; + static DWL_DLGPROC;static DWL_USER;static DWLP_MSGRESULT; + static ISDIALOGMESSAGE;static DLGDIRLIST;static DDL_READWRITE; + static DDL_READONLY;static DDL_HIDDEN;static DDL_SYSTEM; + static DDL_DIRECTORY;static DDL_ARCHIVE;static DDL_POSTMSGS; + static DDL_DRIVES;static DDL_EXCLUSIVE;static DLGDIRSELECTEX; + static DLGDIRLISTCOMBOBOX;static DLGDIRSELECTCOMBOBOXEX;static DS_ABSALIGN; + static DS_SYSMODAL;static DS_LOCALEDIT;static DS_SETFONT; + static DS_MODALFRAME;static DS_NOIDLEMSG;static DS_SETFOREGROUND; + static DS_3DLOOK;static DS_FIXEDSYS;static DS_NOFAILCREATE; + static DS_CONTROL;static DS_CENTER;static DS_CENTERMOUSE; + static DS_CONTEXTHELP;static DS_SHELLFONT;static DS_USEPIXELS; + static DM_GETDEFID;static DM_SETDEFID;static DM_REPOSITION; + static DC_HASDEFID;static DLGC_WANTARROWS;static DLGC_WANTTAB; + static DLGC_WANTALLKEYS;static DLGC_WANTMESSAGE;static DLGC_HASSETSEL; + static DLGC_DEFPUSHBUTTON;static DLGC_UNDEFPUSHBUTTON;static DLGC_RADIOBUTTON; + static DLGC_WANTCHARS;static DLGC_STATIC;static DLGC_BUTTON; + static LB_CTLCODE;static LB_OKAY;static LB_ERR; + static LB_ERRSPACE;static LBN_ERRSPACE;static LBN_SELCHANGE; + static LBN_DBLCLK;static LBN_SELCANCEL;static LBN_SETFOCUS; + static LBN_KILLFOCUS;static LB_ADDSTRING;static LB_INSERTSTRING; + static LB_DELETESTRING;static LB_SELITEMRANGEEX;static LB_RESETCONTENT; + static LB_SETSEL;static LB_SETCURSEL;static LB_GETSEL; + static LB_GETCURSEL;static LB_GETTEXT;static LB_GETTEXTLEN; + static LB_GETCOUNT;static LB_SELECTSTRING;static LB_DIR; + static LB_GETTOPINDEX;static LB_FINDSTRING;static LB_GETSELCOUNT; + static LB_GETSELITEMS;static LB_SETTABSTOPS;static LB_GETHORIZONTALEXTENT; + static LB_SETHORIZONTALEXTENT;static LB_SETCOLUMNWIDTH;static LB_ADDFILE; + static LB_SETTOPINDEX;static LB_GETITEMRECT;static LB_GETITEMDATA; + static LB_SETITEMDATA;static LB_SELITEMRANGE;static LB_SETANCHORINDEX; + static LB_GETANCHORINDEX;static LB_SETCARETINDEX;static LB_GETCARETINDEX; + static LB_SETITEMHEIGHT;static LB_GETITEMHEIGHT;static LB_FINDSTRINGEXACT; + static LB_SETLOCALE;static LB_GETLOCALE;static LB_SETCOUNT; + static LB_INITSTORAGE;static LB_ITEMFROMPOINT;static LB_MULTIPLEADDSTRING; + static LB_GETLISTBOXINFO;static LB_MSGMAX;static LBS_NOTIFY; + static LBS_SORT;static LBS_NOREDRAW;static LBS_MULTIPLESEL; + static LBS_OWNERDRAWFIXED;static LBS_OWNERDRAWVARIABLE;static LBS_HASSTRINGS; + static LBS_USETABSTOPS;static LBS_NOINTEGRALHEIGHT;static LBS_MULTICOLUMN; + static LBS_WANTKEYBOARDINPUT;static LBS_EXTENDEDSEL;static LBS_DISABLENOSCROLL; + static LBS_NODATA;static LBS_NOSEL;static LBS_COMBOBOX; + static LBS_STANDARD;static CB_OKAY;static CB_ERR; + static CB_ERRSPACE;static CBN_ERRSPACE;static CBN_SELCHANGE; + static CBN_DBLCLK;static CBN_SETFOCUS;static CBN_KILLFOCUS; + static CBN_EDITCHANGE;static CBN_EDITUPDATE;static CBN_DROPDOWN; + static CBN_CLOSEUP;static CBN_SELENDOK;static CBN_SELENDCANCEL; + static CBS_SIMPLE;static CBS_DROPDOWN;static CBS_DROPDOWNLIST; + static CBS_OWNERDRAWFIXED;static CBS_OWNERDRAWVARIABLE;static CBS_AUTOHSCROLL; + static CBS_OEMCONVERT;static CBS_SORT;static CBS_HASSTRINGS; + static CBS_NOINTEGRALHEIGHT;static CBS_DISABLENOSCROLL;static CBS_UPPERCASE; + static CBS_LOWERCASE;static CB_GETEDITSEL;static CB_LIMITTEXT; + static CB_SETEDITSEL;static CB_ADDSTRING;static CB_DELETESTRING; + static CB_DIR;static CB_GETCOUNT;static CB_GETCURSEL; + static CB_GETLBTEXT;static CB_GETLBTEXTLEN;static CB_INSERTSTRING; + static CB_RESETCONTENT;static CB_FINDSTRING;static CB_SELECTSTRING; + static CB_SETCURSEL;static CB_SHOWDROPDOWN;static CB_GETITEMDATA; + static CB_SETITEMDATA;static CB_GETDROPPEDCONTROLRECT;static CB_SETITEMHEIGHT; + static CB_GETITEMHEIGHT;static CB_SETEXTENDEDUI;static CB_GETEXTENDEDUI; + static CB_GETDROPPEDSTATE;static CB_FINDSTRINGEXACT;static CB_SETLOCALE; + static CB_GETLOCALE;static CB_GETTOPINDEX;static CB_SETTOPINDEX; + static CB_GETHORIZONTALEXTENT;static CB_SETHORIZONTALEXTENT;static CB_GETDROPPEDWIDTH; + static CB_SETDROPPEDWIDTH;static CB_INITSTORAGE;static CB_MULTIPLEADDSTRING; + static CB_GETCOMBOBOXINFO;static CB_MSGMAX;static SBS_HORZ; + static SBS_VERT;static SBS_TOPALIGN;static SBS_LEFTALIGN; + static SBS_BOTTOMALIGN;static SBS_RIGHTALIGN;static SBS_SIZEBOXTOPLEFTALIGN; + static SBS_SIZEBOXBOTTOMRIGHTALIGN;static SBS_SIZEBOX;static SBS_SIZEGRIP; + static SBM_SETPOS;static SBM_GETPOS;static SBM_SETRANGE; + static SBM_SETRANGEREDRAW;static SBM_GETRANGE;static SBM_ENABLE_ARROWS; + static SBM_SETSCROLLINFO;static SBM_GETSCROLLINFO;static SBM_GETSCROLLBARINFO; + static SIF_RANGE;static SIF_PAGE;static SIF_POS; + static SIF_DISABLENOSCROLL;static SIF_TRACKPOS;static SIF_ALL; + static MDIS_ALLCHILDSTYLES;static MDITILE_VERTICAL;static MDITILE_HORIZONTAL; + static MDITILE_SKIPDISABLED;static MDITILE_ZORDER;static DEFFRAMEPROC; + static DEFMDICHILDPROC;static CREATEMDIWINDOW;static HELP_CONTEXT; + static HELP_QUIT;static HELP_INDEX;static HELP_CONTENTS; + static HELP_HELPONHELP;static HELP_SETINDEX;static HELP_SETCONTENTS; + static HELP_CONTEXTPOPUP;static HELP_FORCEFILE;static HELP_KEY; + static HELP_COMMAND;static HELP_PARTIALKEY;static HELP_MULTIKEY; + static HELP_SETWINPOS;static HELP_CONTEXTMENU;static HELP_FINDER; + static HELP_WM_HELP;static HELP_SETPOPUP_POS;static HELP_TCARD; + static HELP_TCARD_DATA;static HELP_TCARD_OTHER_CALLER;static IDH_NO_HELP; + static IDH_MISSING_CONTEXT;static IDH_GENERIC_HELP_BUTTON;static IDH_OK; + static IDH_CANCEL;static IDH_HELP;static WINHELP; + static GR_GDIOBJECTS;static GR_USEROBJECTS;static GR_GDIOBJECTS_PEAK; + static GR_USEROBJECTS_PEAK;static GR_GLOBAL;static SPI_GETBEEP; + static SPI_SETBEEP;static SPI_GETMOUSE;static SPI_SETMOUSE; + static SPI_GETBORDER;static SPI_SETBORDER;static SPI_GETKEYBOARDSPEED; + static SPI_SETKEYBOARDSPEED;static SPI_LANGDRIVER;static SPI_ICONHORIZONTALSPACING; + static SPI_GETSCREENSAVETIMEOUT;static SPI_SETSCREENSAVETIMEOUT;static SPI_GETSCREENSAVEACTIVE; + static SPI_SETSCREENSAVEACTIVE;static SPI_GETGRIDGRANULARITY;static SPI_SETGRIDGRANULARITY; + static SPI_SETDESKWALLPAPER;static SPI_SETDESKPATTERN;static SPI_GETKEYBOARDDELAY; + static SPI_SETKEYBOARDDELAY;static SPI_ICONVERTICALSPACING;static SPI_GETICONTITLEWRAP; + static SPI_SETICONTITLEWRAP;static SPI_GETMENUDROPALIGNMENT;static SPI_SETMENUDROPALIGNMENT; + static SPI_SETDOUBLECLKWIDTH;static SPI_SETDOUBLECLKHEIGHT;static SPI_GETICONTITLELOGFONT; + static SPI_SETDOUBLECLICKTIME;static SPI_SETMOUSEBUTTONSWAP;static SPI_SETICONTITLELOGFONT; + static SPI_GETFASTTASKSWITCH;static SPI_SETFASTTASKSWITCH;static SPI_SETDRAGFULLWINDOWS; + static SPI_GETDRAGFULLWINDOWS;static SPI_GETNONCLIENTMETRICS;static SPI_SETNONCLIENTMETRICS; + static SPI_GETMINIMIZEDMETRICS;static SPI_SETMINIMIZEDMETRICS;static SPI_GETICONMETRICS; + static SPI_SETICONMETRICS;static SPI_SETWORKAREA;static SPI_GETWORKAREA; + static SPI_SETPENWINDOWS;static SPI_GETHIGHCONTRAST;static SPI_SETHIGHCONTRAST; + static SPI_GETKEYBOARDPREF;static SPI_SETKEYBOARDPREF;static SPI_GETSCREENREADER; + static SPI_SETSCREENREADER;static SPI_GETANIMATION;static SPI_SETANIMATION; + static SPI_GETFONTSMOOTHING;static SPI_SETFONTSMOOTHING;static SPI_SETDRAGWIDTH; + static SPI_SETDRAGHEIGHT;static SPI_SETHANDHELD;static SPI_GETLOWPOWERTIMEOUT; + static SPI_GETPOWEROFFTIMEOUT;static SPI_SETLOWPOWERTIMEOUT;static SPI_SETPOWEROFFTIMEOUT; + static SPI_GETLOWPOWERACTIVE;static SPI_GETPOWEROFFACTIVE;static SPI_SETLOWPOWERACTIVE; + static SPI_SETPOWEROFFACTIVE;static SPI_SETCURSORS;static SPI_SETICONS; + static SPI_GETDEFAULTINPUTLANG;static SPI_SETDEFAULTINPUTLANG;static SPI_SETLANGTOGGLE; + static SPI_GETWINDOWSEXTENSION;static SPI_SETMOUSETRAILS;static SPI_GETMOUSETRAILS; + static SPI_SETSCREENSAVERRUNNING;static SPI_SCREENSAVERRUNNING;static SPI_GETFILTERKEYS; + static SPI_SETFILTERKEYS;static SPI_GETTOGGLEKEYS;static SPI_SETTOGGLEKEYS; + static SPI_GETMOUSEKEYS;static SPI_SETMOUSEKEYS;static SPI_GETSHOWSOUNDS; + static SPI_SETSHOWSOUNDS;static SPI_GETSTICKYKEYS;static SPI_SETSTICKYKEYS; + static SPI_GETACCESSTIMEOUT;static SPI_SETACCESSTIMEOUT;static SPI_GETSERIALKEYS; + static SPI_SETSERIALKEYS;static SPI_GETSOUNDSENTRY;static SPI_SETSOUNDSENTRY; + static SPI_GETSNAPTODEFBUTTON;static SPI_SETSNAPTODEFBUTTON;static SPI_GETMOUSEHOVERWIDTH; + static SPI_SETMOUSEHOVERWIDTH;static SPI_GETMOUSEHOVERHEIGHT;static SPI_SETMOUSEHOVERHEIGHT; + static SPI_GETMOUSEHOVERTIME;static SPI_SETMOUSEHOVERTIME;static SPI_GETWHEELSCROLLLINES; + static SPI_SETWHEELSCROLLLINES;static SPI_GETMENUSHOWDELAY;static SPI_SETMENUSHOWDELAY; + static SPI_GETWHEELSCROLLCHARS;static SPI_SETWHEELSCROLLCHARS;static SPI_GETSHOWIMEUI; + static SPI_SETSHOWIMEUI;static SPI_GETMOUSESPEED;static SPI_SETMOUSESPEED; + static SPI_GETSCREENSAVERRUNNING;static SPI_GETDESKWALLPAPER;static SPI_GETAUDIODESCRIPTION; + static SPI_SETAUDIODESCRIPTION;static SPI_GETSCREENSAVESECURE;static SPI_SETSCREENSAVESECURE; + static SPI_GETHUNGAPPTIMEOUT;static SPI_SETHUNGAPPTIMEOUT;static SPI_GETWAITTOKILLTIMEOUT; + static SPI_SETWAITTOKILLTIMEOUT;static SPI_GETWAITTOKILLSERVICETIMEOUT;static SPI_SETWAITTOKILLSERVICETIMEOUT; + static SPI_GETMOUSEDOCKTHRESHOLD;static SPI_SETMOUSEDOCKTHRESHOLD;static SPI_GETPENDOCKTHRESHOLD; + static SPI_SETPENDOCKTHRESHOLD;static SPI_GETWINARRANGING;static SPI_SETWINARRANGING; + static SPI_GETMOUSEDRAGOUTTHRESHOLD;static SPI_SETMOUSEDRAGOUTTHRESHOLD;static SPI_GETPENDRAGOUTTHRESHOLD; + static SPI_SETPENDRAGOUTTHRESHOLD;static SPI_GETMOUSESIDEMOVETHRESHOLD;static SPI_SETMOUSESIDEMOVETHRESHOLD; + static SPI_GETPENSIDEMOVETHRESHOLD;static SPI_SETPENSIDEMOVETHRESHOLD;static SPI_GETDRAGFROMMAXIMIZE; + static SPI_SETDRAGFROMMAXIMIZE;static SPI_GETSNAPSIZING;static SPI_SETSNAPSIZING; + static SPI_GETDOCKMOVING;static SPI_SETDOCKMOVING;static MAX_TOUCH_PREDICTION_FILTER_TAPS; + static TOUCHPREDICTIONPARAMETERS_DEFAULT_LATENCY;static TOUCHPREDICTIONPARAMETERS_DEFAULT_SAMPLETIME;static TOUCHPREDICTIONPARAMETERS_DEFAULT_USE_HW_TIMESTAMP; + static TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_DELTA;static TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_MIN;static TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_MAX; + static TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_LEARNING_RATE;static TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_EXPO_SMOOTH_ALPHA;static SPI_GETTOUCHPREDICTIONPARAMETERS; + static SPI_SETTOUCHPREDICTIONPARAMETERS;static MAX_LOGICALDPIOVERRIDE;static MIN_LOGICALDPIOVERRIDE; + static SPI_GETLOGICALDPIOVERRIDE;static SPI_SETLOGICALDPIOVERRIDE;static SPI_GETMOUSECORNERCLIPLENGTH; + static SPI_SETMOUSECORNERCLIPLENGTH;static SPI_GETMENURECT;static SPI_SETMENURECT; + static SPI_GETACTIVEWINDOWTRACKING;static SPI_SETACTIVEWINDOWTRACKING;static SPI_GETMENUANIMATION; + static SPI_SETMENUANIMATION;static SPI_GETCOMBOBOXANIMATION;static SPI_SETCOMBOBOXANIMATION; + static SPI_GETLISTBOXSMOOTHSCROLLING;static SPI_SETLISTBOXSMOOTHSCROLLING;static SPI_GETGRADIENTCAPTIONS; + static SPI_SETGRADIENTCAPTIONS;static SPI_GETKEYBOARDCUES;static SPI_SETKEYBOARDCUES; + static SPI_GETMENUUNDERLINES;static SPI_SETMENUUNDERLINES;static SPI_GETACTIVEWNDTRKZORDER; + static SPI_SETACTIVEWNDTRKZORDER;static SPI_GETHOTTRACKING;static SPI_SETHOTTRACKING; + static SPI_GETMENUFADE;static SPI_SETMENUFADE;static SPI_GETSELECTIONFADE; + static SPI_SETSELECTIONFADE;static SPI_GETTOOLTIPANIMATION;static SPI_SETTOOLTIPANIMATION; + static SPI_GETTOOLTIPFADE;static SPI_SETTOOLTIPFADE;static SPI_GETCURSORSHADOW; + static SPI_SETCURSORSHADOW;static SPI_GETMOUSESONAR;static SPI_SETMOUSESONAR; + static SPI_GETMOUSECLICKLOCK;static SPI_SETMOUSECLICKLOCK;static SPI_GETMOUSEVANISH; + static SPI_SETMOUSEVANISH;static SPI_GETFLATMENU;static SPI_SETFLATMENU; + static SPI_GETDROPSHADOW;static SPI_SETDROPSHADOW;static SPI_GETBLOCKSENDINPUTRESETS; + static SPI_SETBLOCKSENDINPUTRESETS;static SPI_GETUIEFFECTS;static SPI_SETUIEFFECTS; + static SPI_GETDISABLEOVERLAPPEDCONTENT;static SPI_SETDISABLEOVERLAPPEDCONTENT;static SPI_GETCLIENTAREAANIMATION; + static SPI_SETCLIENTAREAANIMATION;static SPI_GETCLEARTYPE;static SPI_SETCLEARTYPE; + static SPI_GETSPEECHRECOGNITION;static SPI_SETSPEECHRECOGNITION;static SPI_GETCARETBROWSING; + static SPI_SETCARETBROWSING;static SPI_GETTHREADLOCALINPUTSETTINGS;static SPI_SETTHREADLOCALINPUTSETTINGS; + static SPI_GETSYSTEMLANGUAGEBAR;static SPI_SETSYSTEMLANGUAGEBAR;static SPI_GETFOREGROUNDLOCKTIMEOUT; + static SPI_SETFOREGROUNDLOCKTIMEOUT;static SPI_GETACTIVEWNDTRKTIMEOUT;static SPI_SETACTIVEWNDTRKTIMEOUT; + static SPI_GETFOREGROUNDFLASHCOUNT;static SPI_SETFOREGROUNDFLASHCOUNT;static SPI_GETCARETWIDTH; + static SPI_SETCARETWIDTH;static SPI_GETMOUSECLICKLOCKTIME;static SPI_SETMOUSECLICKLOCKTIME; + static SPI_GETFONTSMOOTHINGTYPE;static SPI_SETFONTSMOOTHINGTYPE;static FE_FONTSMOOTHINGSTANDARD; + static FE_FONTSMOOTHINGCLEARTYPE;static SPI_GETFONTSMOOTHINGCONTRAST;static SPI_SETFONTSMOOTHINGCONTRAST; + static SPI_GETFOCUSBORDERWIDTH;static SPI_SETFOCUSBORDERWIDTH;static SPI_GETFOCUSBORDERHEIGHT; + static SPI_SETFOCUSBORDERHEIGHT;static SPI_GETFONTSMOOTHINGORIENTATION;static SPI_SETFONTSMOOTHINGORIENTATION; + static FE_FONTSMOOTHINGORIENTATIONBGR;static FE_FONTSMOOTHINGORIENTATIONRGB;static SPI_GETMINIMUMHITRADIUS; + static SPI_SETMINIMUMHITRADIUS;static SPI_GETMESSAGEDURATION;static SPI_SETMESSAGEDURATION; + static SPI_GETCONTACTVISUALIZATION;static SPI_SETCONTACTVISUALIZATION;static CONTACTVISUALIZATION_OFF; + static CONTACTVISUALIZATION_ON;static CONTACTVISUALIZATION_PRESENTATIONMODE;static SPI_GETGESTUREVISUALIZATION; + static SPI_SETGESTUREVISUALIZATION;static GESTUREVISUALIZATION_OFF;static GESTUREVISUALIZATION_ON; + static GESTUREVISUALIZATION_TAP;static GESTUREVISUALIZATION_DOUBLETAP;static GESTUREVISUALIZATION_PRESSANDTAP; + static GESTUREVISUALIZATION_PRESSANDHOLD;static GESTUREVISUALIZATION_RIGHTTAP;static SPI_GETMOUSEWHEELROUTING; + static SPI_SETMOUSEWHEELROUTING;static MOUSEWHEEL_ROUTING_FOCUS;static MOUSEWHEEL_ROUTING_HYBRID; + static SPIF_UPDATEINIFILE;static SPIF_SENDWININICHANGE;static SPIF_SENDCHANGE; + static METRICS_USEDEFAULT;static ARW_BOTTOMLEFT;static ARW_BOTTOMRIGHT; + static ARW_TOPLEFT;static ARW_TOPRIGHT;static ARW_STARTMASK; + static ARW_STARTRIGHT;static ARW_STARTTOP;static ARW_LEFT; + static ARW_RIGHT;static ARW_UP;static ARW_DOWN; + static ARW_HIDE;static SERKF_SERIALKEYSON;static SERKF_AVAILABLE; + static SERKF_INDICATOR;static HCF_HIGHCONTRASTON;static HCF_AVAILABLE; + static HCF_HOTKEYACTIVE;static HCF_CONFIRMHOTKEY;static HCF_HOTKEYSOUND; + static HCF_INDICATOR;static HCF_HOTKEYAVAILABLE;static HCF_LOGONDESKTOP; + static HCF_DEFAULTDESKTOP;static CDS_UPDATEREGISTRY;static CDS_TEST; + static CDS_FULLSCREEN;static CDS_GLOBAL;static CDS_SET_PRIMARY; + static CDS_VIDEOPARAMETERS;static CDS_ENABLE_UNSAFE_MODES;static CDS_DISABLE_UNSAFE_MODES; + static CDS_RESET;static CDS_RESET_EX;static CDS_NORESET; + static DISP_CHANGE_SUCCESSFUL;static DISP_CHANGE_RESTART;static DISP_CHANGE_FAILED; + static DISP_CHANGE_BADMODE;static DISP_CHANGE_NOTUPDATED;static DISP_CHANGE_BADFLAGS; + static DISP_CHANGE_BADPARAM;static DISP_CHANGE_BADDUALVIEW;static CHANGEDISPLAYSETTINGS; + static CHANGEDISPLAYSETTINGSEX;static ENUM_CURRENT_SETTINGS;static ENUM_REGISTRY_SETTINGS; + static ENUMDISPLAYSETTINGS;static ENUMDISPLAYSETTINGSEX;static EDS_RAWMODE; + static EDS_ROTATEDMODE;static ENUMDISPLAYDEVICES;static EDD_GET_DEVICE_INTERFACE_NAME; + static SYSTEMPARAMETERSINFO;static FKF_FILTERKEYSON;static FKF_AVAILABLE; + static FKF_HOTKEYACTIVE;static FKF_CONFIRMHOTKEY;static FKF_HOTKEYSOUND; + static FKF_INDICATOR;static FKF_CLICKON;static SKF_STICKYKEYSON; + static SKF_AVAILABLE;static SKF_HOTKEYACTIVE;static SKF_CONFIRMHOTKEY; + static SKF_HOTKEYSOUND;static SKF_INDICATOR;static SKF_AUDIBLEFEEDBACK; + static SKF_TRISTATE;static SKF_TWOKEYSOFF;static SKF_LALTLATCHED; + static SKF_LCTLLATCHED;static SKF_LSHIFTLATCHED;static SKF_RALTLATCHED; + static SKF_RCTLLATCHED;static SKF_RSHIFTLATCHED;static SKF_LWINLATCHED; + static SKF_RWINLATCHED;static SKF_LALTLOCKED;static SKF_LCTLLOCKED; + static SKF_LSHIFTLOCKED;static SKF_RALTLOCKED;static SKF_RCTLLOCKED; + static SKF_RSHIFTLOCKED;static SKF_LWINLOCKED;static SKF_RWINLOCKED; + static MKF_MOUSEKEYSON;static MKF_AVAILABLE;static MKF_HOTKEYACTIVE; + static MKF_CONFIRMHOTKEY;static MKF_HOTKEYSOUND;static MKF_INDICATOR; + static MKF_MODIFIERS;static MKF_REPLACENUMBERS;static MKF_LEFTBUTTONSEL; + static MKF_RIGHTBUTTONSEL;static MKF_LEFTBUTTONDOWN;static MKF_RIGHTBUTTONDOWN; + static MKF_MOUSEMODE;static ATF_TIMEOUTON;static ATF_ONOFFFEEDBACK; + static SSGF_NONE;static SSGF_DISPLAY;static SSTF_NONE; + static SSTF_CHARS;static SSTF_BORDER;static SSTF_DISPLAY; + static SSWF_NONE;static SSWF_TITLE;static SSWF_WINDOW; + static SSWF_DISPLAY;static SSWF_CUSTOM;static SSF_SOUNDSENTRYON; + static SSF_AVAILABLE;static SSF_INDICATOR;static TKF_TOGGLEKEYSON; + static TKF_AVAILABLE;static TKF_HOTKEYACTIVE;static TKF_CONFIRMHOTKEY; + static TKF_HOTKEYSOUND;static TKF_INDICATOR;static SLE_ERROR; + static SLE_MINORERROR;static SLE_WARNING;static MONITOR_DEFAULTTONULL; + static MONITOR_DEFAULTTOPRIMARY;static MONITOR_DEFAULTTONEAREST;static MONITORINFOF_PRIMARY; + static CCHDEVICENAME;static GETMONITORINFO;static WINEVENT_OUTOFCONTEXT; + static WINEVENT_SKIPOWNTHREAD;static WINEVENT_SKIPOWNPROCESS;static WINEVENT_INCONTEXT; + static CHILDID_SELF;static INDEXID_OBJECT;static INDEXID_CONTAINER; + static OBJID_WINDOW;static OBJID_SYSMENU;static OBJID_TITLEBAR; + static OBJID_MENU;static OBJID_CLIENT;static OBJID_VSCROLL; + static OBJID_HSCROLL;static OBJID_SIZEGRIP;static OBJID_CARET; + static OBJID_CURSOR;static OBJID_ALERT;static OBJID_SOUND; + static OBJID_QUERYCLASSNAMEIDX;static OBJID_NATIVEOM;static EVENT_MIN; + static EVENT_MAX;static EVENT_SYSTEM_SOUND;static EVENT_SYSTEM_ALERT; + static EVENT_SYSTEM_FOREGROUND;static EVENT_SYSTEM_MENUSTART;static EVENT_SYSTEM_MENUEND; + static EVENT_SYSTEM_MENUPOPUPSTART;static EVENT_SYSTEM_MENUPOPUPEND;static EVENT_SYSTEM_CAPTURESTART; + static EVENT_SYSTEM_CAPTUREEND;static EVENT_SYSTEM_MOVESIZESTART;static EVENT_SYSTEM_MOVESIZEEND; + static EVENT_SYSTEM_CONTEXTHELPSTART;static EVENT_SYSTEM_CONTEXTHELPEND;static EVENT_SYSTEM_DRAGDROPSTART; + static EVENT_SYSTEM_DRAGDROPEND;static EVENT_SYSTEM_DIALOGSTART;static EVENT_SYSTEM_DIALOGEND; + static EVENT_SYSTEM_SCROLLINGSTART;static EVENT_SYSTEM_SCROLLINGEND;static EVENT_SYSTEM_SWITCHSTART; + static EVENT_SYSTEM_SWITCHEND;static EVENT_SYSTEM_MINIMIZESTART;static EVENT_SYSTEM_MINIMIZEEND; + static EVENT_SYSTEM_DESKTOPSWITCH;static EVENT_SYSTEM_SWITCHER_APPGRABBED;static EVENT_SYSTEM_SWITCHER_APPOVERTARGET; + static EVENT_SYSTEM_SWITCHER_APPDROPPED;static EVENT_SYSTEM_SWITCHER_CANCELLED;static EVENT_SYSTEM_IME_KEY_NOTIFICATION; + static EVENT_SYSTEM_END;static EVENT_OEM_DEFINED_START;static EVENT_OEM_DEFINED_END; + static EVENT_UIA_EVENTID_START;static EVENT_UIA_EVENTID_END;static EVENT_UIA_PROPID_START; + static EVENT_UIA_PROPID_END;static EVENT_CONSOLE_CARET;static EVENT_CONSOLE_UPDATE_REGION; + static EVENT_CONSOLE_UPDATE_SIMPLE;static EVENT_CONSOLE_UPDATE_SCROLL;static EVENT_CONSOLE_LAYOUT; + static EVENT_CONSOLE_START_APPLICATION;static EVENT_CONSOLE_END_APPLICATION;static CONSOLE_APPLICATION_16BIT; + static CONSOLE_CARET_SELECTION;static CONSOLE_CARET_VISIBLE;static EVENT_CONSOLE_END; + static EVENT_OBJECT_CREATE;static EVENT_OBJECT_DESTROY;static EVENT_OBJECT_SHOW; + static EVENT_OBJECT_HIDE;static EVENT_OBJECT_REORDER;static EVENT_OBJECT_FOCUS; + static EVENT_OBJECT_SELECTION;static EVENT_OBJECT_SELECTIONADD;static EVENT_OBJECT_SELECTIONREMOVE; + static EVENT_OBJECT_SELECTIONWITHIN;static EVENT_OBJECT_STATECHANGE;static EVENT_OBJECT_LOCATIONCHANGE; + static EVENT_OBJECT_NAMECHANGE;static EVENT_OBJECT_DESCRIPTIONCHANGE;static EVENT_OBJECT_VALUECHANGE; + static EVENT_OBJECT_PARENTCHANGE;static EVENT_OBJECT_HELPCHANGE;static EVENT_OBJECT_DEFACTIONCHANGE; + static EVENT_OBJECT_ACCELERATORCHANGE;static EVENT_OBJECT_INVOKED;static EVENT_OBJECT_TEXTSELECTIONCHANGED; + static EVENT_OBJECT_CONTENTSCROLLED;static EVENT_SYSTEM_ARRANGMENTPREVIEW;static EVENT_OBJECT_CLOAKED; + static EVENT_OBJECT_UNCLOAKED;static EVENT_OBJECT_LIVEREGIONCHANGED;static EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED; + static EVENT_OBJECT_DRAGSTART;static EVENT_OBJECT_DRAGCANCEL;static EVENT_OBJECT_DRAGCOMPLETE; + static EVENT_OBJECT_DRAGENTER;static EVENT_OBJECT_DRAGLEAVE;static EVENT_OBJECT_DRAGDROPPED; + static EVENT_OBJECT_IME_SHOW;static EVENT_OBJECT_IME_HIDE;static EVENT_OBJECT_IME_CHANGE; + static EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED;static EVENT_OBJECT_END;static EVENT_AIA_START; + static EVENT_AIA_END;static SOUND_SYSTEM_STARTUP;static SOUND_SYSTEM_SHUTDOWN; + static SOUND_SYSTEM_BEEP;static SOUND_SYSTEM_ERROR;static SOUND_SYSTEM_QUESTION; + static SOUND_SYSTEM_WARNING;static SOUND_SYSTEM_INFORMATION;static SOUND_SYSTEM_MAXIMIZE; + static SOUND_SYSTEM_MINIMIZE;static SOUND_SYSTEM_RESTOREUP;static SOUND_SYSTEM_RESTOREDOWN; + static SOUND_SYSTEM_APPSTART;static SOUND_SYSTEM_FAULT;static SOUND_SYSTEM_APPEND; + static SOUND_SYSTEM_MENUCOMMAND;static SOUND_SYSTEM_MENUPOPUP;static CSOUND_SYSTEM; + static ALERT_SYSTEM_INFORMATIONAL;static ALERT_SYSTEM_WARNING;static ALERT_SYSTEM_ERROR; + static ALERT_SYSTEM_QUERY;static ALERT_SYSTEM_CRITICAL;static CALERT_SYSTEM; + static GUI_CARETBLINKING;static GUI_INMOVESIZE;static GUI_INMENUMODE; + static GUI_SYSTEMMENUMODE;static GUI_POPUPMENUMODE;static GUI_16BITTASK; + static USER_DEFAULT_SCREEN_DPI;static GETWINDOWMODULEFILENAME;static STATE_SYSTEM_UNAVAILABLE; + static STATE_SYSTEM_SELECTED;static STATE_SYSTEM_FOCUSED;static STATE_SYSTEM_PRESSED; + static STATE_SYSTEM_CHECKED;static STATE_SYSTEM_MIXED;static STATE_SYSTEM_INDETERMINATE; + static STATE_SYSTEM_READONLY;static STATE_SYSTEM_HOTTRACKED;static STATE_SYSTEM_DEFAULT; + static STATE_SYSTEM_EXPANDED;static STATE_SYSTEM_COLLAPSED;static STATE_SYSTEM_BUSY; + static STATE_SYSTEM_FLOATING;static STATE_SYSTEM_MARQUEED;static STATE_SYSTEM_ANIMATED; + static STATE_SYSTEM_INVISIBLE;static STATE_SYSTEM_OFFSCREEN;static STATE_SYSTEM_SIZEABLE; + static STATE_SYSTEM_MOVEABLE;static STATE_SYSTEM_SELFVOICING;static STATE_SYSTEM_FOCUSABLE; + static STATE_SYSTEM_SELECTABLE;static STATE_SYSTEM_LINKED;static STATE_SYSTEM_TRAVERSED; + static STATE_SYSTEM_MULTISELECTABLE;static STATE_SYSTEM_EXTSELECTABLE;static STATE_SYSTEM_ALERT_LOW; + static STATE_SYSTEM_ALERT_MEDIUM;static STATE_SYSTEM_ALERT_HIGH;static STATE_SYSTEM_PROTECTED; + static STATE_SYSTEM_VALID;static CCHILDREN_TITLEBAR;static CCHILDREN_SCROLLBAR; + static CURSOR_SHOWING;static CURSOR_SUPPRESSED;static WS_ACTIVECAPTION; + static GA_PARENT;static GA_ROOT;static GA_ROOTOWNER; + static REALGETWINDOWCLASS;static GETALTTABINFO;static RIM_INPUT; + static RIM_INPUTSINK;static RIM_TYPEMOUSE;static RIM_TYPEKEYBOARD; + static RIM_TYPEHID;static RI_MOUSE_LEFT_BUTTON_DOWN;static RI_MOUSE_LEFT_BUTTON_UP; + static RI_MOUSE_RIGHT_BUTTON_DOWN;static RI_MOUSE_RIGHT_BUTTON_UP;static RI_MOUSE_MIDDLE_BUTTON_DOWN; + static RI_MOUSE_MIDDLE_BUTTON_UP;static RI_MOUSE_BUTTON_1_DOWN;static RI_MOUSE_BUTTON_1_UP; + static RI_MOUSE_BUTTON_2_DOWN;static RI_MOUSE_BUTTON_2_UP;static RI_MOUSE_BUTTON_3_DOWN; + static RI_MOUSE_BUTTON_3_UP;static RI_MOUSE_BUTTON_4_DOWN;static RI_MOUSE_BUTTON_4_UP; + static RI_MOUSE_BUTTON_5_DOWN;static RI_MOUSE_BUTTON_5_UP;static RI_MOUSE_WHEEL; + static MOUSE_MOVE_RELATIVE;static MOUSE_MOVE_ABSOLUTE;static MOUSE_VIRTUAL_DESKTOP; + static MOUSE_ATTRIBUTES_CHANGED;static MOUSE_MOVE_NOCOALESCE;static KEYBOARD_OVERRUN_MAKE_CODE; + static RI_KEY_MAKE;static RI_KEY_BREAK;static RI_KEY_E0; + static RI_KEY_E1;static RI_KEY_TERMSRV_SET_LED;static RI_KEY_TERMSRV_SHADOW; + static RID_INPUT;static RID_HEADER;static RIDI_PREPARSEDDATA; + static RIDI_DEVICENAME;static RIDI_DEVICEINFO;static GETRAWINPUTDEVICEINFO; + static RIDEV_REMOVE;static RIDEV_EXCLUDE;static RIDEV_PAGEONLY; + static RIDEV_NOLEGACY;static RIDEV_INPUTSINK;static RIDEV_CAPTUREMOUSE; + static RIDEV_NOHOTKEYS;static RIDEV_APPKEYS;static RIDEV_EXINPUTSINK; + static RIDEV_DEVNOTIFY;static RIDEV_EXMODEMASK;static GIDC_ARRIVAL; + static GIDC_REMOVAL;static POINTER_DEVICE_PRODUCT_STRING_MAX;static PDC_ARRIVAL; + static PDC_REMOVAL;static PDC_ORIENTATION_0;static PDC_ORIENTATION_90; + static PDC_ORIENTATION_180;static PDC_ORIENTATION_270;static PDC_MODE_DEFAULT; + static PDC_MODE_CENTERED;static PDC_MAPPING_CHANGE;static PDC_RESOLUTION; + static PDC_ORIGIN;static PDC_MODE_ASPECTRATIOPRESERVED;static MSGFLT_ADD; + static MSGFLT_REMOVE;static MSGFLTINFO_NONE;static MSGFLTINFO_ALREADYALLOWED_FORWND; + static MSGFLTINFO_ALREADYDISALLOWED_FORWND;static MSGFLTINFO_ALLOWED_HIGHER;static MSGFLT_RESET; + static MSGFLT_ALLOW;static MSGFLT_DISALLOW;static GF_BEGIN; + static GF_INERTIA;static GF_END;static GID_BEGIN; + static GID_END;static GID_ZOOM;static GID_PAN; + static GID_ROTATE;static GID_TWOFINGERTAP;static GID_PRESSANDTAP; + static GID_ROLLOVER;static GC_ALLGESTURES;static GC_ZOOM; + static GC_PAN;static GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;static GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY; + static GC_PAN_WITH_GUTTER;static GC_PAN_WITH_INERTIA;static GC_ROTATE; + static GC_TWOFINGERTAP;static GC_PRESSANDTAP;static GC_ROLLOVER; + static GESTURECONFIGMAXCOUNT;static GCF_INCLUDE_ANCESTORS;static NID_INTEGRATED_TOUCH; + static NID_EXTERNAL_TOUCH;static NID_INTEGRATED_PEN;static NID_EXTERNAL_PEN; + static NID_MULTI_INPUT;static NID_READY;static MAX_STR_BLOCKREASON; + class function sinit(); + begin + + WINUSERAPI := 0x0;WINABLEAPI := 0x0;WINVER := 0x500; + MAKEINTRESOURCE := 0x0;DIFFERENCE := 0xB;RT_MANIFEST := 0x18; + CREATEPROCESS_MANIFEST_RESOURCE_ID := 0x1;ISOLATIONAWARE_MANIFEST_RESOURCE_ID := 0x2;ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID := 0x3; + MINIMUM_RESERVED_MANIFEST_RESOURCE_ID := 0x1;MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID := 0x10;WVSPRINTF := 0x0; + WSPRINTF := 0x0;SETWALLPAPER_DEFAULT := 0xFFFFFFFF;SB_HORZ := 0x0; + SB_VERT := 0x1;SB_CTL := 0x2;SB_BOTH := 0x3; + SB_LINEUP := 0x0;SB_LINELEFT := 0x0;SB_LINEDOWN := 0x1; + SB_LINERIGHT := 0x1;SB_PAGEUP := 0x2;SB_PAGELEFT := 0x2; + SB_PAGEDOWN := 0x3;SB_PAGERIGHT := 0x3;SB_THUMBPOSITION := 0x4; + SB_THUMBTRACK := 0x5;SB_TOP := 0x6;SB_LEFT := 0x6; + SB_BOTTOM := 0x7;SB_RIGHT := 0x7;SB_ENDSCROLL := 0x8; + SW_HIDE := 0x0;SW_SHOWNORMAL := 0x1;SW_NORMAL := 0x1; + SW_SHOWMINIMIZED := 0x2;SW_SHOWMAXIMIZED := 0x3;SW_MAXIMIZE := 0x3; + SW_SHOWNOACTIVATE := 0x4;SW_SHOW := 0x5;SW_MINIMIZE := 0x6; + SW_SHOWMINNOACTIVE := 0x7;SW_SHOWNA := 0x8;SW_RESTORE := 0x9; + SW_SHOWDEFAULT := 0xA;SW_FORCEMINIMIZE := 0xB;SW_MAX := 0xB; + HIDE_WINDOW := 0x0;SHOW_OPENWINDOW := 0x1;SHOW_ICONWINDOW := 0x2; + SHOW_FULLSCREEN := 0x3;SHOW_OPENNOACTIVATE := 0x4;SW_PARENTCLOSING := 0x1; + SW_OTHERZOOM := 0x2;SW_PARENTOPENING := 0x3;SW_OTHERUNZOOM := 0x4; + AW_HOR_POSITIVE := 0x1;AW_HOR_NEGATIVE := 0x2;AW_VER_POSITIVE := 0x4; + AW_VER_NEGATIVE := 0x8;AW_CENTER := 0x10;AW_HIDE := 0x10000; + AW_ACTIVATE := 0x20000;AW_SLIDE := 0x40000;AW_BLEND := 0x80000; + KF_EXTENDED := 0x100;KF_DLGMODE := 0x800;KF_MENUMODE := 0x1000; + KF_ALTDOWN := 0x2000;KF_REPEAT := 0x4000;KF_UP := 0x8000; + VK_LBUTTON := 0x1;VK_RBUTTON := 0x2;VK_CANCEL := 0x3; + VK_MBUTTON := 0x4;VK_XBUTTON1 := 0x5;VK_XBUTTON2 := 0x6; + VK_BACK := 0x8;VK_TAB := 0x9;VK_CLEAR := 0xC; + VK_RETURN := 0xD;VK_SHIFT := 0x10;VK_CONTROL := 0x11; + VK_MENU := 0x12;VK_PAUSE := 0x13;VK_CAPITAL := 0x14; + VK_KANA := 0x15;VK_HANGEUL := 0x15;VK_HANGUL := 0x15; + VK_JUNJA := 0x17;VK_FINAL := 0x18;VK_HANJA := 0x19; + VK_KANJI := 0x19;VK_ESCAPE := 0x1B;VK_CONVERT := 0x1C; + VK_NONCONVERT := 0x1D;VK_ACCEPT := 0x1E;VK_MODECHANGE := 0x1F; + VK_SPACE := 0x20;VK_PRIOR := 0x21;VK_NEXT := 0x22; + VK_END := 0x23;VK_HOME := 0x24;VK_LEFT := 0x25; + VK_UP := 0x26;VK_RIGHT := 0x27;VK_DOWN := 0x28; + VK_SELECT := 0x29;VK_PRINT := 0x2A;VK_EXECUTE := 0x2B; + VK_SNAPSHOT := 0x2C;VK_INSERT := 0x2D;VK_DELETE := 0x2E; + VK_HELP := 0x2F;VK_LWIN := 0x5B;VK_RWIN := 0x5C; + VK_APPS := 0x5D;VK_SLEEP := 0x5F;VK_NUMPAD0 := 0x60; + VK_NUMPAD1 := 0x61;VK_NUMPAD2 := 0x62;VK_NUMPAD3 := 0x63; + VK_NUMPAD4 := 0x64;VK_NUMPAD5 := 0x65;VK_NUMPAD6 := 0x66; + VK_NUMPAD7 := 0x67;VK_NUMPAD8 := 0x68;VK_NUMPAD9 := 0x69; + VK_MULTIPLY := 0x6A;VK_ADD := 0x6B;VK_SEPARATOR := 0x6C; + VK_SUBTRACT := 0x6D;VK_DECIMAL := 0x6E;VK_DIVIDE := 0x6F; + VK_F1 := 0x70;VK_F2 := 0x71;VK_F3 := 0x72; + VK_F4 := 0x73;VK_F5 := 0x74;VK_F6 := 0x75; + VK_F7 := 0x76;VK_F8 := 0x77;VK_F9 := 0x78; + VK_F10 := 0x79;VK_F11 := 0x7A;VK_F12 := 0x7B; + VK_F13 := 0x7C;VK_F14 := 0x7D;VK_F15 := 0x7E; + VK_F16 := 0x7F;VK_F17 := 0x80;VK_F18 := 0x81; + VK_F19 := 0x82;VK_F20 := 0x83;VK_F21 := 0x84; + VK_F22 := 0x85;VK_F23 := 0x86;VK_F24 := 0x87; + VK_NUMLOCK := 0x90;VK_SCROLL := 0x91;VK_OEM_NEC_EQUAL := 0x92; + VK_OEM_FJ_JISHO := 0x92;VK_OEM_FJ_MASSHOU := 0x93;VK_OEM_FJ_TOUROKU := 0x94; + VK_OEM_FJ_LOYA := 0x95;VK_OEM_FJ_ROYA := 0x96;VK_LSHIFT := 0xA0; + VK_RSHIFT := 0xA1;VK_LCONTROL := 0xA2;VK_RCONTROL := 0xA3; + VK_LMENU := 0xA4;VK_RMENU := 0xA5;VK_BROWSER_BACK := 0xA6; + VK_BROWSER_FORWARD := 0xA7;VK_BROWSER_REFRESH := 0xA8;VK_BROWSER_STOP := 0xA9; + VK_BROWSER_SEARCH := 0xAA;VK_BROWSER_FAVORITES := 0xAB;VK_BROWSER_HOME := 0xAC; + VK_VOLUME_MUTE := 0xAD;VK_VOLUME_DOWN := 0xAE;VK_VOLUME_UP := 0xAF; + VK_MEDIA_NEXT_TRACK := 0xB0;VK_MEDIA_PREV_TRACK := 0xB1;VK_MEDIA_STOP := 0xB2; + VK_MEDIA_PLAY_PAUSE := 0xB3;VK_LAUNCH_MAIL := 0xB4;VK_LAUNCH_MEDIA_SELECT := 0xB5; + VK_LAUNCH_APP1 := 0xB6;VK_LAUNCH_APP2 := 0xB7;VK_OEM_1 := 0xBA; + VK_OEM_PLUS := 0xBB;VK_OEM_COMMA := 0xBC;VK_OEM_MINUS := 0xBD; + VK_OEM_PERIOD := 0xBE;VK_OEM_2 := 0xBF;VK_OEM_3 := 0xC0; + VK_OEM_4 := 0xDB;VK_OEM_5 := 0xDC;VK_OEM_6 := 0xDD; + VK_OEM_7 := 0xDE;VK_OEM_8 := 0xDF;VK_OEM_AX := 0xE1; + VK_OEM_102 := 0xE2;VK_ICO_HELP := 0xE3;VK_ICO_00 := 0xE4; + VK_PROCESSKEY := 0xE5;VK_ICO_CLEAR := 0xE6;VK_PACKET := 0xE7; + VK_OEM_RESET := 0xE9;VK_OEM_JUMP := 0xEA;VK_OEM_PA1 := 0xEB; + VK_OEM_PA2 := 0xEC;VK_OEM_PA3 := 0xED;VK_OEM_WSCTRL := 0xEE; + VK_OEM_CUSEL := 0xEF;VK_OEM_ATTN := 0xF0;VK_OEM_FINISH := 0xF1; + VK_OEM_COPY := 0xF2;VK_OEM_AUTO := 0xF3;VK_OEM_ENLW := 0xF4; + VK_OEM_BACKTAB := 0xF5;VK_ATTN := 0xF6;VK_CRSEL := 0xF7; + VK_EXSEL := 0xF8;VK_EREOF := 0xF9;VK_PLAY := 0xFA; + VK_ZOOM := 0xFB;VK_NONAME := 0xFC;VK_PA1 := 0xFD; + VK_OEM_CLEAR := 0xFE;WH_MIN := 0xFFFFFFFF;WH_MSGFILTER := 0xFFFFFFFF; + WH_JOURNALRECORD := 0x0;WH_JOURNALPLAYBACK := 0x1;WH_KEYBOARD := 0x2; + WH_GETMESSAGE := 0x3;WH_CALLWNDPROC := 0x4;WH_CBT := 0x5; + WH_SYSMSGFILTER := 0x6;WH_MOUSE := 0x7;WH_HARDWARE := 0x8; + WH_DEBUG := 0x9;WH_SHELL := 0xA;WH_FOREGROUNDIDLE := 0xB; + WH_CALLWNDPROCRET := 0xC;WH_KEYBOARD_LL := 0xD;WH_MOUSE_LL := 0xE; + WH_MAX := 0xE;WH_MINHOOK := 0xFFFFFFFF;WH_MAXHOOK := 0xE; + HC_ACTION := 0x0;HC_GETNEXT := 0x1;HC_SKIP := 0x2; + HC_NOREMOVE := 0x3;HC_NOREM := 0x3;HC_SYSMODALON := 0x4; + HC_SYSMODALOFF := 0x5;HCBT_MOVESIZE := 0x0;HCBT_MINMAX := 0x1; + HCBT_QS := 0x2;HCBT_CREATEWND := 0x3;HCBT_DESTROYWND := 0x4; + HCBT_ACTIVATE := 0x5;HCBT_CLICKSKIPPED := 0x6;HCBT_KEYSKIPPED := 0x7; + HCBT_SYSCOMMAND := 0x8;HCBT_SETFOCUS := 0x9;WTS_CONSOLE_CONNECT := 0x1; + WTS_CONSOLE_DISCONNECT := 0x2;WTS_REMOTE_CONNECT := 0x3;WTS_REMOTE_DISCONNECT := 0x4; + WTS_SESSION_LOGON := 0x5;WTS_SESSION_LOGOFF := 0x6;WTS_SESSION_LOCK := 0x7; + WTS_SESSION_UNLOCK := 0x8;WTS_SESSION_REMOTE_CONTROL := 0x9;WTS_SESSION_CREATE := 0xA; + WTS_SESSION_TERMINATE := 0xB;MSGF_DIALOGBOX := 0x0;MSGF_MESSAGEBOX := 0x1; + MSGF_MENU := 0x2;MSGF_SCROLLBAR := 0x5;MSGF_NEXTWINDOW := 0x6; + MSGF_MAX := 0x8;MSGF_USER := 0x1000;HSHELL_WINDOWCREATED := 0x1; + HSHELL_WINDOWDESTROYED := 0x2;HSHELL_ACTIVATESHELLWINDOW := 0x3;HSHELL_WINDOWACTIVATED := 0x4; + HSHELL_GETMINRECT := 0x5;HSHELL_REDRAW := 0x6;HSHELL_TASKMAN := 0x7; + HSHELL_LANGUAGE := 0x8;HSHELL_SYSMENU := 0x9;HSHELL_ENDTASK := 0xA; + HSHELL_ACCESSIBILITYSTATE := 0xB;HSHELL_APPCOMMAND := 0xC;HSHELL_WINDOWREPLACED := 0xD; + HSHELL_WINDOWREPLACING := 0xE;HSHELL_MONITORCHANGED := 0x10;HSHELL_HIGHBIT := 0x8000; + HSHELL_FLASH := 0x8006;HSHELL_RUDEAPPACTIVATED := 0x8004;APPCOMMAND_BROWSER_BACKWARD := 0x1; + APPCOMMAND_BROWSER_FORWARD := 0x2;APPCOMMAND_BROWSER_REFRESH := 0x3;APPCOMMAND_BROWSER_STOP := 0x4; + APPCOMMAND_BROWSER_SEARCH := 0x5;APPCOMMAND_BROWSER_FAVORITES := 0x6;APPCOMMAND_BROWSER_HOME := 0x7; + APPCOMMAND_VOLUME_MUTE := 0x8;APPCOMMAND_VOLUME_DOWN := 0x9;APPCOMMAND_VOLUME_UP := 0xA; + APPCOMMAND_MEDIA_NEXTTRACK := 0xB;APPCOMMAND_MEDIA_PREVIOUSTRACK := 0xC;APPCOMMAND_MEDIA_STOP := 0xD; + APPCOMMAND_MEDIA_PLAY_PAUSE := 0xE;APPCOMMAND_LAUNCH_MAIL := 0xF;APPCOMMAND_LAUNCH_MEDIA_SELECT := 0x10; + APPCOMMAND_LAUNCH_APP1 := 0x11;APPCOMMAND_LAUNCH_APP2 := 0x12;APPCOMMAND_BASS_DOWN := 0x13; + APPCOMMAND_BASS_BOOST := 0x14;APPCOMMAND_BASS_UP := 0x15;APPCOMMAND_TREBLE_DOWN := 0x16; + APPCOMMAND_TREBLE_UP := 0x17;APPCOMMAND_MICROPHONE_VOLUME_MUTE := 0x18;APPCOMMAND_MICROPHONE_VOLUME_DOWN := 0x19; + APPCOMMAND_MICROPHONE_VOLUME_UP := 0x1A;APPCOMMAND_HELP := 0x1B;APPCOMMAND_FIND := 0x1C; + APPCOMMAND_NEW := 0x1D;APPCOMMAND_OPEN := 0x1E;APPCOMMAND_CLOSE := 0x1F; + APPCOMMAND_SAVE := 0x20;APPCOMMAND_PRINT := 0x21;APPCOMMAND_UNDO := 0x22; + APPCOMMAND_REDO := 0x23;APPCOMMAND_COPY := 0x24;APPCOMMAND_CUT := 0x25; + APPCOMMAND_PASTE := 0x26;APPCOMMAND_REPLY_TO_MAIL := 0x27;APPCOMMAND_FORWARD_MAIL := 0x28; + APPCOMMAND_SEND_MAIL := 0x29;APPCOMMAND_SPELL_CHECK := 0x2A;APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE := 0x2B; + APPCOMMAND_MIC_ON_OFF_TOGGLE := 0x2C;APPCOMMAND_CORRECTION_LIST := 0x2D;APPCOMMAND_MEDIA_PLAY := 0x2E; + APPCOMMAND_MEDIA_PAUSE := 0x2F;APPCOMMAND_MEDIA_RECORD := 0x30;APPCOMMAND_MEDIA_FAST_FORWARD := 0x31; + APPCOMMAND_MEDIA_REWIND := 0x32;APPCOMMAND_MEDIA_CHANNEL_UP := 0x33;APPCOMMAND_MEDIA_CHANNEL_DOWN := 0x34; + APPCOMMAND_DELETE := 0x35;APPCOMMAND_DWM_FLIP3D := 0x36;FAPPCOMMAND_MOUSE := 0x8000; + FAPPCOMMAND_KEY := 0x0;FAPPCOMMAND_OEM := 0x1000;FAPPCOMMAND_MASK := 0xF000; + GET_MOUSEORKEY_LPARAM := 0x0;LLKHF_EXTENDED := 0x1;LLKHF_INJECTED := 0x10; + LLKHF_ALTDOWN := 0x20;LLKHF_UP := 0x80;LLKHF_LOWER_IL_INJECTED := 0x2; + LLMHF_INJECTED := 0x1;LLMHF_LOWER_IL_INJECTED := 0x2;HKL_PREV := 0x0; + HKL_NEXT := 0x1;KLF_ACTIVATE := 0x1;KLF_SUBSTITUTE_OK := 0x2; + KLF_REORDER := 0x8;KLF_REPLACELANG := 0x10;KLF_NOTELLSHELL := 0x80; + KLF_SETFORPROCESS := 0x100;KLF_SHIFTLOCK := 0x10000;KLF_RESET := 0x40000000; + INPUTLANGCHANGE_SYSCHARSET := 0x1;INPUTLANGCHANGE_FORWARD := 0x2;INPUTLANGCHANGE_BACKWARD := 0x4; + KL_NAMELENGTH := 0x9;LOADKEYBOARDLAYOUT := 0x0;GETKEYBOARDLAYOUTNAME := 0x0; + GMMP_USE_DISPLAY_POINTS := 0x1;GMMP_USE_HIGH_RESOLUTION_POINTS := 0x2;DESKTOP_READOBJECTS := 0x1; + DESKTOP_CREATEWINDOW := 0x2;DESKTOP_CREATEMENU := 0x4;DESKTOP_HOOKCONTROL := 0x8; + DESKTOP_JOURNALRECORD := 0x10;DESKTOP_JOURNALPLAYBACK := 0x20;DESKTOP_ENUMERATE := 0x40; + DESKTOP_WRITEOBJECTS := 0x80;DESKTOP_SWITCHDESKTOP := 0x100;DF_ALLOWOTHERACCOUNTHOOK := 0x1; + CREATEDESKTOP := 0x0;CREATEDESKTOPEX := 0x0;OPENDESKTOP := 0x0; + ENUMDESKTOPS := 0x0;WINSTA_ENUMDESKTOPS := 0x1;WINSTA_READATTRIBUTES := 0x2; + WINSTA_ACCESSCLIPBOARD := 0x4;WINSTA_CREATEDESKTOP := 0x8;WINSTA_WRITEATTRIBUTES := 0x10; + WINSTA_ACCESSGLOBALATOMS := 0x20;WINSTA_EXITWINDOWS := 0x40;WINSTA_ENUMERATE := 0x100; + WINSTA_READSCREEN := 0x200;WINSTA_ALL_ACCESS := 0x37F;CWF_CREATE_ONLY := 0x1; + WSF_VISIBLE := 0x1;CREATEWINDOWSTATION := 0x0;OPENWINDOWSTATION := 0x0; + ENUMWINDOWSTATIONS := 0x0;UOI_FLAGS := 0x1;UOI_NAME := 0x2; + UOI_TYPE := 0x3;UOI_USER_SID := 0x4;UOI_HEAPSIZE := 0x5; + UOI_IO := 0x6;GETUSEROBJECTINFORMATION := 0x0;SETUSEROBJECTINFORMATION := 0x0; + GWL_WNDPROC := 0xFFFFFFFC;GWL_HINSTANCE := 0xFFFFFFFA;GWL_HWNDPARENT := 0xFFFFFFF8; + GWL_STYLE := 0xFFFFFFF0;GWL_EXSTYLE := 0xFFFFFFEC;GWL_USERDATA := 0xFFFFFFEB; + GWL_ID := 0xFFFFFFF4;GWLP_WNDPROC := 0xFFFFFFFC;GWLP_HINSTANCE := 0xFFFFFFFA; + GWLP_HWNDPARENT := 0xFFFFFFF8;GWLP_USERDATA := 0xFFFFFFEB;GWLP_ID := 0xFFFFFFF4; + GCL_MENUNAME := 0xFFFFFFF8;GCL_HBRBACKGROUND := 0xFFFFFFF6;GCL_HCURSOR := 0xFFFFFFF4; + GCL_HICON := 0xFFFFFFF2;GCL_HMODULE := 0xFFFFFFF0;GCL_CBWNDEXTRA := 0xFFFFFFEE; + GCL_CBCLSEXTRA := 0xFFFFFFEC;GCL_WNDPROC := 0xFFFFFFE8;GCL_STYLE := 0xFFFFFFE6; + GCW_ATOM := 0xFFFFFFE0;GCL_HICONSM := 0xFFFFFFDE;GCLP_MENUNAME := 0xFFFFFFF8; + GCLP_HBRBACKGROUND := 0xFFFFFFF6;GCLP_HCURSOR := 0xFFFFFFF4;GCLP_HICON := 0xFFFFFFF2; + GCLP_HMODULE := 0xFFFFFFF0;GCLP_WNDPROC := 0xFFFFFFE8;GCLP_HICONSM := 0xFFFFFFDE; + WM_NULL := 0x0;WM_CREATE := 0x1;WM_DESTROY := 0x2; + WM_MOVE := 0x3;WM_SIZE := 0x5;WM_ACTIVATE := 0x6; + WA_INACTIVE := 0x0;WA_ACTIVE := 0x1;WA_CLICKACTIVE := 0x2; + WM_SETFOCUS := 0x7;WM_KILLFOCUS := 0x8;WM_ENABLE := 0xA; + WM_SETREDRAW := 0xB;WM_SETTEXT := 0xC;WM_GETTEXT := 0xD; + WM_GETTEXTLENGTH := 0xE;WM_PAINT := 0xF;WM_CLOSE := 0x10; + WM_QUERYENDSESSION := 0x11;WM_QUERYOPEN := 0x13;WM_ENDSESSION := 0x16; + WM_QUIT := 0x12;WM_ERASEBKGND := 0x14;WM_SYSCOLORCHANGE := 0x15; + WM_SHOWWINDOW := 0x18;WM_WININICHANGE := 0x1A;WM_SETTINGCHANGE := 0x1A; + WM_DEVMODECHANGE := 0x1B;WM_ACTIVATEAPP := 0x1C;WM_FONTCHANGE := 0x1D; + WM_TIMECHANGE := 0x1E;WM_CANCELMODE := 0x1F;WM_SETCURSOR := 0x20; + WM_MOUSEACTIVATE := 0x21;WM_CHILDACTIVATE := 0x22;WM_QUEUESYNC := 0x23; + WM_GETMINMAXINFO := 0x24;WM_PAINTICON := 0x26;WM_ICONERASEBKGND := 0x27; + WM_NEXTDLGCTL := 0x28;WM_SPOOLERSTATUS := 0x2A;WM_DRAWITEM := 0x2B; + WM_MEASUREITEM := 0x2C;WM_DELETEITEM := 0x2D;WM_VKEYTOITEM := 0x2E; + WM_CHARTOITEM := 0x2F;WM_SETFONT := 0x30;WM_GETFONT := 0x31; + WM_SETHOTKEY := 0x32;WM_GETHOTKEY := 0x33;WM_QUERYDRAGICON := 0x37; + WM_COMPAREITEM := 0x39;WM_GETOBJECT := 0x3D;WM_COMPACTING := 0x41; + WM_COMMNOTIFY := 0x44;WM_WINDOWPOSCHANGING := 0x46;WM_WINDOWPOSCHANGED := 0x47; + WM_POWER := 0x48;PWR_OK := 0x1;PWR_FAIL := 0xFFFFFFFF; + PWR_SUSPENDREQUEST := 0x1;PWR_SUSPENDRESUME := 0x2;PWR_CRITICALRESUME := 0x3; + WM_COPYDATA := 0x4A;WM_CANCELJOURNAL := 0x4B;WM_NOTIFY := 0x4E; + WM_INPUTLANGCHANGEREQUEST := 0x50;WM_INPUTLANGCHANGE := 0x51;WM_TCARD := 0x52; + WM_HELP := 0x53;WM_USERCHANGED := 0x54;WM_NOTIFYFORMAT := 0x55; + NFR_ANSI := 0x1;NFR_UNICODE := 0x2;NF_QUERY := 0x3; + NF_REQUERY := 0x4;WM_CONTEXTMENU := 0x7B;WM_STYLECHANGING := 0x7C; + WM_STYLECHANGED := 0x7D;WM_DISPLAYCHANGE := 0x7E;WM_GETICON := 0x7F; + WM_SETICON := 0x80;WM_NCCREATE := 0x81;WM_NCDESTROY := 0x82; + WM_NCCALCSIZE := 0x83;WM_NCHITTEST := 0x84;WM_NCPAINT := 0x85; + WM_NCACTIVATE := 0x86;WM_GETDLGCODE := 0x87;WM_SYNCPAINT := 0x88; + WM_NCMOUSEMOVE := 0xA0;WM_NCLBUTTONDOWN := 0xA1;WM_NCLBUTTONUP := 0xA2; + WM_NCLBUTTONDBLCLK := 0xA3;WM_NCRBUTTONDOWN := 0xA4;WM_NCRBUTTONUP := 0xA5; + WM_NCRBUTTONDBLCLK := 0xA6;WM_NCMBUTTONDOWN := 0xA7;WM_NCMBUTTONUP := 0xA8; + WM_NCMBUTTONDBLCLK := 0xA9;WM_NCXBUTTONDOWN := 0xAB;WM_NCXBUTTONUP := 0xAC; + WM_NCXBUTTONDBLCLK := 0xAD;WM_INPUT_DEVICE_CHANGE := 0xFE;WM_INPUT := 0xFF; + WM_KEYFIRST := 0x100;WM_KEYDOWN := 0x100;WM_KEYUP := 0x101; + WM_CHAR := 0x102;WM_DEADCHAR := 0x103;WM_SYSKEYDOWN := 0x104; + WM_SYSKEYUP := 0x105;WM_SYSCHAR := 0x106;WM_SYSDEADCHAR := 0x107; + WM_UNICHAR := 0x109;WM_KEYLAST := 0x109;UNICODE_NOCHAR := 0xFFFF; + WM_IME_STARTCOMPOSITION := 0x10D;WM_IME_ENDCOMPOSITION := 0x10E;WM_IME_COMPOSITION := 0x10F; + WM_IME_KEYLAST := 0x10F;WM_INITDIALOG := 0x110;WM_COMMAND := 0x111; + WM_SYSCOMMAND := 0x112;WM_TIMER := 0x113;WM_HSCROLL := 0x114; + WM_VSCROLL := 0x115;WM_INITMENU := 0x116;WM_INITMENUPOPUP := 0x117; + WM_GESTURE := 0x119;WM_GESTURENOTIFY := 0x11A;WM_MENUSELECT := 0x11F; + WM_MENUCHAR := 0x120;WM_ENTERIDLE := 0x121;WM_MENURBUTTONUP := 0x122; + WM_MENUDRAG := 0x123;WM_MENUGETOBJECT := 0x124;WM_UNINITMENUPOPUP := 0x125; + WM_MENUCOMMAND := 0x126;WM_CHANGEUISTATE := 0x127;WM_UPDATEUISTATE := 0x128; + WM_QUERYUISTATE := 0x129;UIS_SET := 0x1;UIS_CLEAR := 0x2; + UIS_INITIALIZE := 0x3;UISF_HIDEFOCUS := 0x1;UISF_HIDEACCEL := 0x2; + UISF_ACTIVE := 0x4;WM_CTLCOLORMSGBOX := 0x132;WM_CTLCOLOREDIT := 0x133; + WM_CTLCOLORLISTBOX := 0x134;WM_CTLCOLORBTN := 0x135;WM_CTLCOLORDLG := 0x136; + WM_CTLCOLORSCROLLBAR := 0x137;WM_CTLCOLORSTATIC := 0x138;MN_GETHMENU := 0x1E1; + WM_MOUSEFIRST := 0x200;WM_MOUSEMOVE := 0x200;WM_LBUTTONDOWN := 0x201; + WM_LBUTTONUP := 0x202;WM_LBUTTONDBLCLK := 0x203;WM_RBUTTONDOWN := 0x204; + WM_RBUTTONUP := 0x205;WM_RBUTTONDBLCLK := 0x206;WM_MBUTTONDOWN := 0x207; + WM_MBUTTONUP := 0x208;WM_MBUTTONDBLCLK := 0x209;WM_MOUSEWHEEL := 0x20A; + WM_XBUTTONDOWN := 0x20B;WM_XBUTTONUP := 0x20C;WM_XBUTTONDBLCLK := 0x20D; + WM_MOUSEHWHEEL := 0x20E;WM_MOUSELAST := 0x20E;WHEEL_DELTA := 0x78; + WHEEL_PAGESCROLL := 0x0;XBUTTON1 := 0x1;XBUTTON2 := 0x2; + WM_PARENTNOTIFY := 0x210;WM_ENTERMENULOOP := 0x211;WM_EXITMENULOOP := 0x212; + WM_NEXTMENU := 0x213;WM_SIZING := 0x214;WM_CAPTURECHANGED := 0x215; + WM_MOVING := 0x216;WM_POWERBROADCAST := 0x218;PBT_APMQUERYSUSPEND := 0x0; + PBT_APMQUERYSTANDBY := 0x1;PBT_APMQUERYSUSPENDFAILED := 0x2;PBT_APMQUERYSTANDBYFAILED := 0x3; + PBT_APMSUSPEND := 0x4;PBT_APMSTANDBY := 0x5;PBT_APMRESUMECRITICAL := 0x6; + PBT_APMRESUMESUSPEND := 0x7;PBT_APMRESUMESTANDBY := 0x8;PBTF_APMRESUMEFROMFAILURE := 0x1; + PBT_APMBATTERYLOW := 0x9;PBT_APMPOWERSTATUSCHANGE := 0xA;PBT_APMOEMEVENT := 0xB; + PBT_APMRESUMEAUTOMATIC := 0x12;PBT_POWERSETTINGCHANGE := 0x8013;WM_DEVICECHANGE := 0x219; + WM_MDICREATE := 0x220;WM_MDIDESTROY := 0x221;WM_MDIACTIVATE := 0x222; + WM_MDIRESTORE := 0x223;WM_MDINEXT := 0x224;WM_MDIMAXIMIZE := 0x225; + WM_MDITILE := 0x226;WM_MDICASCADE := 0x227;WM_MDIICONARRANGE := 0x228; + WM_MDIGETACTIVE := 0x229;WM_MDISETMENU := 0x230;WM_ENTERSIZEMOVE := 0x231; + WM_EXITSIZEMOVE := 0x232;WM_DROPFILES := 0x233;WM_MDIREFRESHMENU := 0x234; + WM_POINTERDEVICECHANGE := 0x238;WM_POINTERDEVICEINRANGE := 0x239;WM_POINTERDEVICEOUTOFRANGE := 0x23A; + WM_TOUCH := 0x240;WM_NCPOINTERUPDATE := 0x241;WM_NCPOINTERDOWN := 0x242; + WM_NCPOINTERUP := 0x243;WM_POINTERUPDATE := 0x245;WM_POINTERDOWN := 0x246; + WM_POINTERUP := 0x247;WM_POINTERENTER := 0x249;WM_POINTERLEAVE := 0x24A; + WM_POINTERACTIVATE := 0x24B;WM_POINTERCAPTURECHANGED := 0x24C;WM_TOUCHHITTESTING := 0x24D; + WM_POINTERWHEEL := 0x24E;WM_POINTERHWHEEL := 0x24F;DM_POINTERHITTEST := 0x250; + WM_IME_SETCONTEXT := 0x281;WM_IME_NOTIFY := 0x282;WM_IME_CONTROL := 0x283; + WM_IME_COMPOSITIONFULL := 0x284;WM_IME_SELECT := 0x285;WM_IME_CHAR := 0x286; + WM_IME_REQUEST := 0x288;WM_IME_KEYDOWN := 0x290;WM_IME_KEYUP := 0x291; + WM_MOUSEHOVER := 0x2A1;WM_MOUSELEAVE := 0x2A3;WM_NCMOUSEHOVER := 0x2A0; + WM_NCMOUSELEAVE := 0x2A2;WM_WTSSESSION_CHANGE := 0x2B1;WM_TABLET_FIRST := 0x2C0; + WM_TABLET_LAST := 0x2DF;WM_DPICHANGED := 0x2E0;WM_CUT := 0x300; + WM_COPY := 0x301;WM_PASTE := 0x302;WM_CLEAR := 0x303; + WM_UNDO := 0x304;WM_RENDERFORMAT := 0x305;WM_RENDERALLFORMATS := 0x306; + WM_DESTROYCLIPBOARD := 0x307;WM_DRAWCLIPBOARD := 0x308;WM_PAINTCLIPBOARD := 0x309; + WM_VSCROLLCLIPBOARD := 0x30A;WM_SIZECLIPBOARD := 0x30B;WM_ASKCBFORMATNAME := 0x30C; + WM_CHANGECBCHAIN := 0x30D;WM_HSCROLLCLIPBOARD := 0x30E;WM_QUERYNEWPALETTE := 0x30F; + WM_PALETTEISCHANGING := 0x310;WM_PALETTECHANGED := 0x311;WM_HOTKEY := 0x312; + WM_PRINT := 0x317;WM_PRINTCLIENT := 0x318;WM_APPCOMMAND := 0x319; + WM_THEMECHANGED := 0x31A;WM_CLIPBOARDUPDATE := 0x31D;WM_DWMCOMPOSITIONCHANGED := 0x31E; + WM_DWMNCRENDERINGCHANGED := 0x31F;WM_DWMCOLORIZATIONCOLORCHANGED := 0x320;WM_DWMWINDOWMAXIMIZEDCHANGE := 0x321; + WM_DWMSENDICONICTHUMBNAIL := 0x323;WM_DWMSENDICONICLIVEPREVIEWBITMAP := 0x326;WM_GETTITLEBARINFOEX := 0x33F; + WM_HANDHELDFIRST := 0x358;WM_HANDHELDLAST := 0x35F;WM_AFXFIRST := 0x360; + WM_AFXLAST := 0x37F;WM_PENWINFIRST := 0x380;WM_PENWINLAST := 0x38F; + WM_APP := 0x8000;WM_USER := 0x400;WM_USERFIST := 0x2400; + WM_NOTTOSELF := 0x3400;WM_QUOTATIONS := 0x4400;WMSZ_LEFT := 0x1; + WMSZ_RIGHT := 0x2;WMSZ_TOP := 0x3;WMSZ_TOPLEFT := 0x4; + WMSZ_TOPRIGHT := 0x5;WMSZ_BOTTOM := 0x6;WMSZ_BOTTOMLEFT := 0x7; + WMSZ_BOTTOMRIGHT := 0x8;HTERROR := 0xFFFFFFFE;HTTRANSPARENT := 0xFFFFFFFF; + HTNOWHERE := 0x0;HTCLIENT := 0x1;HTCAPTION := 0x2; + HTSYSMENU := 0x3;HTGROWBOX := 0x4;HTSIZE := 0x4; + HTMENU := 0x5;HTHSCROLL := 0x6;HTVSCROLL := 0x7; + HTMINBUTTON := 0x8;HTMAXBUTTON := 0x9;HTLEFT := 0xA; + HTRIGHT := 0xB;HTTOP := 0xC;HTTOPLEFT := 0xD; + HTTOPRIGHT := 0xE;HTBOTTOM := 0xF;HTBOTTOMLEFT := 0x10; + HTBOTTOMRIGHT := 0x11;HTBORDER := 0x12;HTREDUCE := 0x8; + HTZOOM := 0x9;HTSIZEFIRST := 0xA;HTSIZELAST := 0x11; + HTOBJECT := 0x13;HTCLOSE := 0x14;HTHELP := 0x15; + SMTO_NORMAL := 0x0;SMTO_BLOCK := 0x1;SMTO_ABORTIFHUNG := 0x2; + SMTO_NOTIMEOUTIFNOTHUNG := 0x8;SMTO_ERRORONEXIT := 0x20;MA_ACTIVATE := 0x1; + MA_ACTIVATEANDEAT := 0x2;MA_NOACTIVATE := 0x3;MA_NOACTIVATEANDEAT := 0x4; + ICON_SMALL := 0x0;ICON_BIG := 0x1;ICON_SMALL2 := 0x2; + REGISTERWINDOWMESSAGE := 0x0;SIZE_RESTORED := 0x0;SIZE_MINIMIZED := 0x1; + SIZE_MAXIMIZED := 0x2;SIZE_MAXSHOW := 0x3;SIZE_MAXHIDE := 0x4; + SIZENORMAL := 0x0;SIZEICONIC := 0x1;SIZEFULLSCREEN := 0x2; + SIZEZOOMSHOW := 0x3;SIZEZOOMHIDE := 0x4;WVR_ALIGNTOP := 0x10; + WVR_ALIGNLEFT := 0x20;WVR_ALIGNBOTTOM := 0x40;WVR_ALIGNRIGHT := 0x80; + WVR_HREDRAW := 0x100;WVR_VREDRAW := 0x200;WVR_REDRAW := 0x300; + WVR_VALIDRECTS := 0x400;MK_LBUTTON := 0x1;MK_RBUTTON := 0x2; + MK_SHIFT := 0x4;MK_CONTROL := 0x8;MK_MBUTTON := 0x10; + MK_XBUTTON1 := 0x20;MK_XBUTTON2 := 0x40;TME_HOVER := 0x1; + TME_LEAVE := 0x2;TME_NONCLIENT := 0x10;TME_QUERY := 0x40000000; + TME_CANCEL := 0x80000000;HOVER_DEFAULT := 0xFFFFFFFF;WS_OVERLAPPED := 0x0; + WS_POPUP := 0x80000000;WS_CHILD := 0x40000000;WS_MINIMIZE := 0x20000000; + WS_VISIBLE := 0x10000000;WS_DISABLED := 0x8000000;WS_CLIPSIBLINGS := 0x4000000; + WS_CLIPCHILDREN := 0x2000000;WS_MAXIMIZE := 0x1000000;WS_CAPTION := 0xC00000; + WS_BORDER := 0x800000;WS_DLGFRAME := 0x400000;WS_VSCROLL := 0x200000; + WS_HSCROLL := 0x100000;WS_SYSMENU := 0x80000;WS_THICKFRAME := 0x40000; + WS_GROUP := 0x20000;WS_TABSTOP := 0x10000;WS_MINIMIZEBOX := 0x20000; + WS_MAXIMIZEBOX := 0x10000;WS_TILED := 0x0;WS_ICONIC := 0x20000000; + WS_SIZEBOX := 0x40000;WS_TILEDWINDOW := 0xCF0000;WS_OVERLAPPEDWINDOW := 0xCF0000; + WS_POPUPWINDOW := 0x80880000;WS_CHILDWINDOW := 0x40000000;WS_EX_DLGMODALFRAME := 0x1; + WS_EX_NOPARENTNOTIFY := 0x4;WS_EX_TOPMOST := 0x8;WS_EX_ACCEPTFILES := 0x10; + WS_EX_TRANSPARENT := 0x20;WS_EX_MDICHILD := 0x40;WS_EX_TOOLWINDOW := 0x80; + WS_EX_WINDOWEDGE := 0x100;WS_EX_CLIENTEDGE := 0x200;WS_EX_CONTEXTHELP := 0x400; + WS_EX_RIGHT := 0x1000;WS_EX_LEFT := 0x0;WS_EX_RTLREADING := 0x2000; + WS_EX_LTRREADING := 0x0;WS_EX_LEFTSCROLLBAR := 0x4000;WS_EX_RIGHTSCROLLBAR := 0x0; + WS_EX_CONTROLPARENT := 0x10000;WS_EX_STATICEDGE := 0x20000;WS_EX_APPWINDOW := 0x40000; + WS_EX_OVERLAPPEDWINDOW := 0x300;WS_EX_PALETTEWINDOW := 0x188;WS_EX_LAYERED := 0x80000; + WS_EX_NOINHERITLAYOUT := 0x100000;WS_EX_NOREDIRECTIONBITMAP := 0x200000;WS_EX_LAYOUTRTL := 0x400000; + WS_EX_COMPOSITED := 0x2000000;WS_EX_NOACTIVATE := 0x8000000;CS_VREDRAW := 0x1; + CS_HREDRAW := 0x2;CS_DBLCLKS := 0x8;CS_OWNDC := 0x20; + CS_CLASSDC := 0x40;CS_PARENTDC := 0x80;CS_NOCLOSE := 0x200; + CS_SAVEBITS := 0x800;CS_BYTEALIGNCLIENT := 0x1000;CS_BYTEALIGNWINDOW := 0x2000; + CS_GLOBALCLASS := 0x4000;CS_IME := 0x10000;CS_DROPSHADOW := 0x20000; + PRF_CHECKVISIBLE := 0x1;PRF_NONCLIENT := 0x2;PRF_CLIENT := 0x4; + PRF_ERASEBKGND := 0x8;PRF_CHILDREN := 0x10;PRF_OWNED := 0x20; + BDR_RAISEDOUTER := 0x1;BDR_SUNKENOUTER := 0x2;BDR_RAISEDINNER := 0x4; + BDR_SUNKENINNER := 0x8;BDR_OUTER := 0x3;BDR_INNER := 0xC; + BDR_RAISED := 0x5;BDR_SUNKEN := 0xA;EDGE_RAISED := 0x5; + EDGE_SUNKEN := 0xA;EDGE_ETCHED := 0x6;EDGE_BUMP := 0x9; + BF_LEFT := 0x1;BF_TOP := 0x2;BF_RIGHT := 0x4; + BF_BOTTOM := 0x8;BF_TOPLEFT := 0x3;BF_TOPRIGHT := 0x6; + BF_BOTTOMLEFT := 0x9;BF_BOTTOMRIGHT := 0xC;BF_RECT := 0xF; + BF_DIAGONAL := 0x10;BF_DIAGONAL_ENDTOPRIGHT := 0x16;BF_DIAGONAL_ENDTOPLEFT := 0x13; + BF_DIAGONAL_ENDBOTTOMLEFT := 0x19;BF_DIAGONAL_ENDBOTTOMRIGHT := 0x1C;BF_MIDDLE := 0x800; + BF_SOFT := 0x1000;BF_ADJUST := 0x2000;BF_FLAT := 0x4000; + BF_MONO := 0x8000;DFC_CAPTION := 0x1;DFC_MENU := 0x2; + DFC_SCROLL := 0x3;DFC_BUTTON := 0x4;DFC_POPUPMENU := 0x5; + DFCS_CAPTIONCLOSE := 0x0;DFCS_CAPTIONMIN := 0x1;DFCS_CAPTIONMAX := 0x2; + DFCS_CAPTIONRESTORE := 0x3;DFCS_CAPTIONHELP := 0x4;DFCS_MENUARROW := 0x0; + DFCS_MENUCHECK := 0x1;DFCS_MENUBULLET := 0x2;DFCS_MENUARROWRIGHT := 0x4; + DFCS_SCROLLUP := 0x0;DFCS_SCROLLDOWN := 0x1;DFCS_SCROLLLEFT := 0x2; + DFCS_SCROLLRIGHT := 0x3;DFCS_SCROLLCOMBOBOX := 0x5;DFCS_SCROLLSIZEGRIP := 0x8; + DFCS_SCROLLSIZEGRIPRIGHT := 0x10;DFCS_BUTTONCHECK := 0x0;DFCS_BUTTONRADIOIMAGE := 0x1; + DFCS_BUTTONRADIOMASK := 0x2;DFCS_BUTTONRADIO := 0x4;DFCS_BUTTON3STATE := 0x8; + DFCS_BUTTONPUSH := 0x10;DFCS_INACTIVE := 0x100;DFCS_PUSHED := 0x200; + DFCS_CHECKED := 0x400;DFCS_TRANSPARENT := 0x800;DFCS_HOT := 0x1000; + DFCS_ADJUSTRECT := 0x2000;DFCS_FLAT := 0x4000;DFCS_MONO := 0x8000; + DC_ACTIVE := 0x1;DC_SMALLCAP := 0x2;DC_ICON := 0x4; + DC_TEXT := 0x8;DC_INBUTTON := 0x10;DC_GRADIENT := 0x20; + DC_BUTTONS := 0x1000;IDANI_OPEN := 0x1;IDANI_CAPTION := 0x3; + CF_TEXT := 0x1;CF_BITMAP := 0x2;CF_METAFILEPICT := 0x3; + CF_SYLK := 0x4;CF_DIF := 0x5;CF_TIFF := 0x6; + CF_OEMTEXT := 0x7;CF_DIB := 0x8;CF_PALETTE := 0x9; + CF_PENDATA := 0xA;CF_RIFF := 0xB;CF_WAVE := 0xC; + CF_UNICODETEXT := 0xD;CF_ENHMETAFILE := 0xE;CF_HDROP := 0xF; + CF_LOCALE := 0x10;CF_DIBV5 := 0x11;CF_MAX := 0x12; + CF_OWNERDISPLAY := 0x80;CF_DSPTEXT := 0x81;CF_DSPBITMAP := 0x82; + CF_DSPMETAFILEPICT := 0x83;CF_DSPENHMETAFILE := 0x8E;CF_PRIVATEFIRST := 0x200; + CF_PRIVATELAST := 0x2FF;CF_GDIOBJFIRST := 0x300;CF_GDIOBJLAST := 0x3FF; + FVIRTKEY := 0x1;FNOINVERT := 0x2;FSHIFT := 0x4; + FCONTROL := 0x8;FALT := 0x10;WPF_SETMINPOSITION := 0x1; + WPF_RESTORETOMAXIMIZED := 0x2;WPF_ASYNCWINDOWPLACEMENT := 0x4;ODT_MENU := 0x1; + ODT_LISTBOX := 0x2;ODT_COMBOBOX := 0x3;ODT_BUTTON := 0x4; + ODT_STATIC := 0x5;ODA_DRAWENTIRE := 0x1;ODA_SELECT := 0x2; + ODA_FOCUS := 0x4;ODS_SELECTED := 0x1;ODS_GRAYED := 0x2; + ODS_DISABLED := 0x4;ODS_CHECKED := 0x8;ODS_FOCUS := 0x10; + ODS_DEFAULT := 0x20;ODS_COMBOBOXEDIT := 0x1000;ODS_HOTLIGHT := 0x40; + ODS_INACTIVE := 0x80;ODS_NOACCEL := 0x100;ODS_NOFOCUSRECT := 0x200; + DISPATCHMESSAGE := NIL;PEEKMESSAGE := 0x0;PM_NOREMOVE := 0x0; + PM_REMOVE := 0x1;PM_NOYIELD := 0x2;PM_QS_INPUT := 0x1C070000; + PM_QS_POSTMESSAGE := 0x980000;PM_QS_PAINT := 0x200000;PM_QS_SENDMESSAGE := 0x400000; + MOD_ALT := 0x1;MOD_CONTROL := 0x2;MOD_SHIFT := 0x4; + MOD_WIN := 0x8;MOD_NOREPEAT := 0x4000;IDHOT_SNAPWINDOW := 0xFFFFFFFF; + IDHOT_SNAPDESKTOP := 0xFFFFFFFE;ENDSESSION_CLOSEAPP := 0x1;ENDSESSION_CRITICAL := 0x40000000; + ENDSESSION_LOGOFF := 0x80000000;EWX_LOGOFF := 0x0;EWX_SHUTDOWN := 0x1; + EWX_REBOOT := 0x2;EWX_FORCE := 0x4;EWX_POWEROFF := 0x8; + EWX_FORCEIFHUNG := 0x10;EWX_QUICKRESOLVE := 0x20;EWX_RESTARTAPPS := 0x40; + EWX_HYBRID_SHUTDOWN := 0x400000;EWX_BOOTOPTIONS := 0x1000000;SENDMESSAGE := 0x0; + SENDMESSAGETIMEOUT := 0x0;SENDNOTIFYMESSAGE := 0x0;SENDMESSAGECALLBACK := 0x0; + BROADCASTSYSTEMMESSAGEEX := 0x0;BROADCASTSYSTEMMESSAGE := 0x0;BSM_ALLCOMPONENTS := 0x0; + BSM_VXDS := 0x1;BSM_NETDRIVER := 0x2;BSM_INSTALLABLEDRIVERS := 0x4; + BSM_APPLICATIONS := 0x8;BSM_ALLDESKTOPS := 0x10;BSF_QUERY := 0x1; + BSF_IGNORECURRENTTASK := 0x2;BSF_FLUSHDISK := 0x4;BSF_NOHANG := 0x8; + BSF_POSTMESSAGE := 0x10;BSF_FORCEIFHUNG := 0x20;BSF_NOTIMEOUTIFNOTHUNG := 0x40; + BSF_ALLOWSFW := 0x80;BSF_SENDNOTIFYMESSAGE := 0x100;BSF_RETURNHDESK := 0x200; + BSF_LUID := 0x400;BROADCAST_QUERY_DENY := 0x424D5144;DEVICE_NOTIFY_WINDOW_HANDLE := 0x0; + DEVICE_NOTIFY_SERVICE_HANDLE := 0x1;DEVICE_NOTIFY_ALL_INTERFACE_CLASSES := 0x4;REGISTERDEVICENOTIFICATION := 0x0; + POSTMESSAGE := 0x0;POSTTHREADMESSAGE := 0x0;POSTAPPMESSAGE := 0x0; + HWND_BROADCAST := 0xFFFF;HWND_MESSAGE := 0xFFFFFFFD;DEFWINDOWPROC := 0x0; + ISMEX_NOSEND := 0x0;ISMEX_SEND := 0x1;ISMEX_NOTIFY := 0x2; + ISMEX_CALLBACK := 0x4;ISMEX_REPLIED := 0x8;REGISTERCLASS := 0x0; + UNREGISTERCLASS := 0x0;GETCLASSINFO := 0x0;REGISTERCLASSEX := 0x0; + GETCLASSINFOEX := 0x0;CW_USEDEFAULT := 0x80000000;HWND_DESKTOP := 0x0; + CREATEWINDOWEX := 0x0;CREATEWINDOW := 0x0;PW_CLIENTONLY := 0x1; + PW_RENDERFULLCONTENT := 0x2;LWA_COLORKEY := 0x1;LWA_ALPHA := 0x2; + ULW_COLORKEY := 0x1;ULW_ALPHA := 0x2;ULW_OPAQUE := 0x4; + ULW_EX_NORESIZE := 0x8;FLASHW_STOP := 0x0;FLASHW_CAPTION := 0x1; + FLASHW_TRAY := 0x2;FLASHW_ALL := 0x3;FLASHW_TIMER := 0x4; + FLASHW_TIMERNOFG := 0xC;WDA_NONE := 0x0;WDA_MONITOR := 0x1; + SWP_NOSIZE := 0x1;SWP_NOMOVE := 0x2;SWP_NOZORDER := 0x4; + SWP_NOREDRAW := 0x8;SWP_NOACTIVATE := 0x10;SWP_FRAMECHANGED := 0x20; + SWP_SHOWWINDOW := 0x40;SWP_HIDEWINDOW := 0x80;SWP_NOCOPYBITS := 0x100; + SWP_NOOWNERZORDER := 0x200;SWP_NOSENDCHANGING := 0x400;SWP_DRAWFRAME := 0x20; + SWP_NOREPOSITION := 0x200;SWP_DEFERERASE := 0x2000;SWP_ASYNCWINDOWPOS := 0x4000; + HWND_TOP := 0x0;HWND_BOTTOM := 0x1;HWND_TOPMOST := 0xFFFFFFFF; + HWND_NOTOPMOST := 0xFFFFFFFE;CREATEDIALOGPARAM := 0x0;CREATEDIALOGINDIRECTPARAM := 0x0; + CREATEDIALOG := 0x0;CREATEDIALOGINDIRECT := 0x0;DIALOGBOXPARAM := 0x0; + DIALOGBOXINDIRECTPARAM := 0x0;DIALOGBOX := 0x0;DIALOGBOXINDIRECT := 0x0; + SETDLGITEMTEXT := 0x0;GETDLGITEMTEXT := 0x0;SENDDLGITEMMESSAGE := 0x0; + DEFDLGPROC := 0x0;DLGWINDOWEXTRA := 0x1E;CALLMSGFILTER := 0x0; + REGISTERCLIPBOARDFORMAT := 0x0;GETCLIPBOARDFORMATNAME := 0x0;CHARTOOEM := 0x0; + OEMTOCHAR := 0x0;CHARTOOEMBUFF := 0x0;OEMTOCHARBUFF := 0x0; + CHARUPPER := 0x0;CHARUPPERBUFF := 0x0;CHARLOWER := 0x0; + CHARLOWERBUFF := 0x0;CHARNEXT := 0x0;CHARPREV := 0x0; + ANSITOOEM := 0x0;OEMTOANSI := 0x0;ANSITOOEMBUFF := 0x0; + OEMTOANSIBUFF := 0x0;ANSIUPPER := 0x0;ANSIUPPERBUFF := 0x0; + ANSILOWER := 0x0;ANSILOWERBUFF := 0x0;ANSINEXT := 0x0; + ANSIPREV := 0x0;ISCHARALPHA := 0x0;ISCHARALPHANUMERIC := 0x0; + ISCHARUPPER := 0x0;ISCHARLOWER := 0x0;GETKEYNAMETEXT := 0x0; + VKKEYSCAN := 0x0;VKKEYSCANEX := 0x0;KEYEVENTF_EXTENDEDKEY := 0x1; + KEYEVENTF_KEYUP := 0x2;KEYEVENTF_UNICODE := 0x4;KEYEVENTF_SCANCODE := 0x8; + MOUSEEVENTF_MOVE := 0x1;MOUSEEVENTF_LEFTDOWN := 0x2;MOUSEEVENTF_LEFTUP := 0x4; + MOUSEEVENTF_RIGHTDOWN := 0x8;MOUSEEVENTF_RIGHTUP := 0x10;MOUSEEVENTF_MIDDLEDOWN := 0x20; + MOUSEEVENTF_MIDDLEUP := 0x40;MOUSEEVENTF_XDOWN := 0x80;MOUSEEVENTF_XUP := 0x100; + MOUSEEVENTF_WHEEL := 0x800;MOUSEEVENTF_HWHEEL := 0x1000;MOUSEEVENTF_MOVE_NOCOALESCE := 0x2000; + MOUSEEVENTF_VIRTUALDESK := 0x4000;MOUSEEVENTF_ABSOLUTE := 0x8000;INPUT_MOUSE := 0x0; + INPUT_KEYBOARD := 0x1;INPUT_HARDWARE := 0x2;TOUCHEVENTF_MOVE := 0x1; + TOUCHEVENTF_DOWN := 0x2;TOUCHEVENTF_UP := 0x4;TOUCHEVENTF_INRANGE := 0x8; + TOUCHEVENTF_PRIMARY := 0x10;TOUCHEVENTF_NOCOALESCE := 0x20;TOUCHEVENTF_PEN := 0x40; + TOUCHEVENTF_PALM := 0x80;TOUCHINPUTMASKF_TIMEFROMSYSTEM := 0x1;TOUCHINPUTMASKF_EXTRAINFO := 0x2; + TOUCHINPUTMASKF_CONTACTAREA := 0x4;TWF_FINETOUCH := 0x1;TWF_WANTPALM := 0x2; + POINTER_FLAG_NONE := 0x0;POINTER_FLAG_NEW := 0x1;POINTER_FLAG_INRANGE := 0x2; + POINTER_FLAG_INCONTACT := 0x4;POINTER_FLAG_FIRSTBUTTON := 0x10;POINTER_FLAG_SECONDBUTTON := 0x20; + POINTER_FLAG_THIRDBUTTON := 0x40;POINTER_FLAG_FOURTHBUTTON := 0x80;POINTER_FLAG_FIFTHBUTTON := 0x100; + POINTER_FLAG_PRIMARY := 0x2000;POINTER_FLAG_CONFIDENCE := 0x4000;POINTER_FLAG_CANCELED := 0x8000; + POINTER_FLAG_DOWN := 0x10000;POINTER_FLAG_UPDATE := 0x20000;POINTER_FLAG_UP := 0x40000; + POINTER_FLAG_WHEEL := 0x80000;POINTER_FLAG_HWHEEL := 0x100000;POINTER_FLAG_CAPTURECHANGED := 0x200000; + POINTER_FLAG_HASTRANSFORM := 0x400000;POINTER_MOD_SHIFT := 0x4;POINTER_MOD_CTRL := 0x8; + TOUCH_FLAG_NONE := 0x0;TOUCH_MASK_NONE := 0x0;TOUCH_MASK_CONTACTAREA := 0x1; + TOUCH_MASK_ORIENTATION := 0x2;TOUCH_MASK_PRESSURE := 0x4;PEN_FLAG_NONE := 0x0; + PEN_FLAG_BARREL := 0x1;PEN_FLAG_INVERTED := 0x2;PEN_FLAG_ERASER := 0x4; + PEN_MASK_NONE := 0x0;PEN_MASK_PRESSURE := 0x1;PEN_MASK_ROTATION := 0x2; + PEN_MASK_TILT_X := 0x4;PEN_MASK_TILT_Y := 0x8;POINTER_MESSAGE_FLAG_NEW := 0x1; + POINTER_MESSAGE_FLAG_INRANGE := 0x2;POINTER_MESSAGE_FLAG_INCONTACT := 0x4;POINTER_MESSAGE_FLAG_FIRSTBUTTON := 0x10; + POINTER_MESSAGE_FLAG_SECONDBUTTON := 0x20;POINTER_MESSAGE_FLAG_THIRDBUTTON := 0x40;POINTER_MESSAGE_FLAG_FOURTHBUTTON := 0x80; + POINTER_MESSAGE_FLAG_FIFTHBUTTON := 0x100;POINTER_MESSAGE_FLAG_PRIMARY := 0x2000;POINTER_MESSAGE_FLAG_CONFIDENCE := 0x4000; + POINTER_MESSAGE_FLAG_CANCELED := 0x8000;PA_ACTIVATE := 0x1;PA_NOACTIVATE := 0x3; + MAX_TOUCH_COUNT := 0x100;TOUCH_FEEDBACK_DEFAULT := 0x1;TOUCH_FEEDBACK_INDIRECT := 0x2; + TOUCH_FEEDBACK_NONE := 0x3;TOUCH_HIT_TESTING_DEFAULT := 0x0;TOUCH_HIT_TESTING_CLIENT := 0x1; + TOUCH_HIT_TESTING_NONE := 0x2;TOUCH_HIT_TESTING_PROXIMITY_CLOSEST := 0x0;TOUCH_HIT_TESTING_PROXIMITY_FARTHEST := 0xFFF; + GWFS_INCLUDE_ANCESTORS := 0x1;MAPVIRTUALKEY := 0x0;MAPVIRTUALKEYEX := 0x0; + MAPVK_VK_TO_VSC := 0x0;MAPVK_VSC_TO_VK := 0x1;MAPVK_VK_TO_CHAR := 0x2; + MAPVK_VSC_TO_VK_EX := 0x3;MAPVK_VK_TO_VSC_EX := 0x4;MWMO_WAITALL := 0x1; + MWMO_ALERTABLE := 0x2;MWMO_INPUTAVAILABLE := 0x4;QS_KEY := 0x1; + QS_MOUSEMOVE := 0x2;QS_MOUSEBUTTON := 0x4;QS_POSTMESSAGE := 0x8; + QS_TIMER := 0x10;QS_PAINT := 0x20;QS_SENDMESSAGE := 0x40; + QS_HOTKEY := 0x80;QS_ALLPOSTMESSAGE := 0x100;QS_RAWINPUT := 0x400; + QS_TOUCH := 0x800;QS_POINTER := 0x1000;QS_MOUSE := 0x6; + QS_INPUT := 0x1C07;QS_ALLEVENTS := 0x1CBF;QS_ALLINPUT := 0x1CFF; + USER_TIMER_MAXIMUM := 0x7FFFFFFF;USER_TIMER_MINIMUM := 0xA;TIMERV_DEFAULT_COALESCING := 0x0; + TIMERV_NO_COALESCING := 0xFFFFFFFF;TIMERV_COALESCING_MIN := 0x1;TIMERV_COALESCING_MAX := 0x7FFFFFF5; + LOADACCELERATORS := 0x0;CREATEACCELERATORTABLE := 0x0;COPYACCELERATORTABLE := 0x0; + TRANSLATEACCELERATOR := 0x0;SM_CXSCREEN := 0x0;SM_CYSCREEN := 0x1; + SM_CXVSCROLL := 0x2;SM_CYHSCROLL := 0x3;SM_CYCAPTION := 0x4; + SM_CXBORDER := 0x5;SM_CYBORDER := 0x6;SM_CXDLGFRAME := 0x7; + SM_CYDLGFRAME := 0x8;SM_CYVTHUMB := 0x9;SM_CXHTHUMB := 0xA; + SM_CXICON := 0xB;SM_CYICON := 0xC;SM_CXCURSOR := 0xD; + SM_CYCURSOR := 0xE;SM_CYMENU := 0xF;SM_CXFULLSCREEN := 0x10; + SM_CYFULLSCREEN := 0x11;SM_CYKANJIWINDOW := 0x12;SM_MOUSEPRESENT := 0x13; + SM_CYVSCROLL := 0x14;SM_CXHSCROLL := 0x15;SM_DEBUG := 0x16; + SM_SWAPBUTTON := 0x17;SM_RESERVED1 := 0x18;SM_RESERVED2 := 0x19; + SM_RESERVED3 := 0x1A;SM_RESERVED4 := 0x1B;SM_CXMIN := 0x1C; + SM_CYMIN := 0x1D;SM_CXSIZE := 0x1E;SM_CYSIZE := 0x1F; + SM_CXFRAME := 0x20;SM_CYFRAME := 0x21;SM_CXMINTRACK := 0x22; + SM_CYMINTRACK := 0x23;SM_CXDOUBLECLK := 0x24;SM_CYDOUBLECLK := 0x25; + SM_CXICONSPACING := 0x26;SM_CYICONSPACING := 0x27;SM_MENUDROPALIGNMENT := 0x28; + SM_PENWINDOWS := 0x29;SM_DBCSENABLED := 0x2A;SM_CMOUSEBUTTONS := 0x2B; + SM_CXFIXEDFRAME := 0x7;SM_CYFIXEDFRAME := 0x8;SM_CXSIZEFRAME := 0x20; + SM_CYSIZEFRAME := 0x21;SM_SECURE := 0x2C;SM_CXEDGE := 0x2D; + SM_CYEDGE := 0x2E;SM_CXMINSPACING := 0x2F;SM_CYMINSPACING := 0x30; + SM_CXSMICON := 0x31;SM_CYSMICON := 0x32;SM_CYSMCAPTION := 0x33; + SM_CXSMSIZE := 0x34;SM_CYSMSIZE := 0x35;SM_CXMENUSIZE := 0x36; + SM_CYMENUSIZE := 0x37;SM_ARRANGE := 0x38;SM_CXMINIMIZED := 0x39; + SM_CYMINIMIZED := 0x3A;SM_CXMAXTRACK := 0x3B;SM_CYMAXTRACK := 0x3C; + SM_CXMAXIMIZED := 0x3D;SM_CYMAXIMIZED := 0x3E;SM_NETWORK := 0x3F; + SM_CLEANBOOT := 0x43;SM_CXDRAG := 0x44;SM_CYDRAG := 0x45; + SM_SHOWSOUNDS := 0x46;SM_CXMENUCHECK := 0x47;SM_CYMENUCHECK := 0x48; + SM_SLOWMACHINE := 0x49;SM_MIDEASTENABLED := 0x4A;SM_MOUSEWHEELPRESENT := 0x4B; + SM_XVIRTUALSCREEN := 0x4C;SM_YVIRTUALSCREEN := 0x4D;SM_CXVIRTUALSCREEN := 0x4E; + SM_CYVIRTUALSCREEN := 0x4F;SM_CMONITORS := 0x50;SM_SAMEDISPLAYFORMAT := 0x51; + SM_IMMENABLED := 0x52;SM_CXFOCUSBORDER := 0x53;SM_CYFOCUSBORDER := 0x54; + SM_TABLETPC := 0x56;SM_MEDIACENTER := 0x57;SM_STARTER := 0x58; + SM_SERVERR2 := 0x59;SM_MOUSEHORIZONTALWHEELPRESENT := 0x5B;SM_CXPADDEDBORDER := 0x5C; + SM_DIGITIZER := 0x5E;SM_MAXIMUMTOUCHES := 0x5F;SM_CMETRICS := 0x4C; + SM_REMOTESESSION := 0x1000;SM_SHUTTINGDOWN := 0x2000;SM_REMOTECONTROL := 0x2001; + SM_CARETBLINKINGENABLED := 0x2002;SM_CONVERTIBLESLATEMODE := 0x2003;SM_SYSTEMDOCKED := 0x2004; + LOADMENU := 0x0;LOADMENUINDIRECT := 0x0;CHANGEMENU := 0x0; + GETMENUSTRING := 0x0;PMB_ACTIVE := 0x1;INSERTMENU := 0x0; + APPENDMENU := 0x0;MODIFYMENU := 0x0;MNC_IGNORE := 0x0; + MNC_CLOSE := 0x1;MNC_EXECUTE := 0x2;MNC_SELECT := 0x3; + MNS_NOCHECK := 0x80000000;MNS_MODELESS := 0x40000000;MNS_DRAGDROP := 0x20000000; + MNS_AUTODISMISS := 0x10000000;MNS_NOTIFYBYPOS := 0x8000000;MNS_CHECKORBMP := 0x4000000; + MIM_MAXHEIGHT := 0x1;MIM_BACKGROUND := 0x2;MIM_HELPID := 0x4; + MIM_MENUDATA := 0x8;MIM_STYLE := 0x10;MIM_APPLYTOSUBMENUS := 0x80000000; + MND_CONTINUE := 0x0;MND_ENDMENU := 0x1;MNGOF_TOPGAP := 0x1; + MNGOF_BOTTOMGAP := 0x2;MNGO_NOINTERFACE := 0x0;MNGO_NOERROR := 0x1; + MIIM_STATE := 0x1;MIIM_ID := 0x2;MIIM_SUBMENU := 0x4; + MIIM_CHECKMARKS := 0x8;MIIM_TYPE := 0x10;MIIM_DATA := 0x20; + MIIM_STRING := 0x40;MIIM_BITMAP := 0x80;MIIM_FTYPE := 0x100; + HBMMENU_CALLBACK := 0xFFFFFFFF;HBMMENU_SYSTEM := 0x1;HBMMENU_MBAR_RESTORE := 0x2; + HBMMENU_MBAR_MINIMIZE := 0x3;HBMMENU_MBAR_CLOSE := 0x5;HBMMENU_MBAR_CLOSE_D := 0x6; + HBMMENU_MBAR_MINIMIZE_D := 0x7;HBMMENU_POPUP_CLOSE := 0x8;HBMMENU_POPUP_RESTORE := 0x9; + HBMMENU_POPUP_MAXIMIZE := 0xA;HBMMENU_POPUP_MINIMIZE := 0xB;INSERTMENUITEM := 0x0; + GETMENUITEMINFO := 0x0;SETMENUITEMINFO := 0x0;GMDI_USEDISABLED := 0x1; + GMDI_GOINTOPOPUPS := 0x2;TPM_LEFTBUTTON := 0x0;TPM_RIGHTBUTTON := 0x2; + TPM_LEFTALIGN := 0x0;TPM_CENTERALIGN := 0x4;TPM_RIGHTALIGN := 0x8; + TPM_TOPALIGN := 0x0;TPM_VCENTERALIGN := 0x10;TPM_BOTTOMALIGN := 0x20; + TPM_HORIZONTAL := 0x0;TPM_VERTICAL := 0x40;TPM_NONOTIFY := 0x80; + TPM_RETURNCMD := 0x100;TPM_RECURSE := 0x1;TPM_HORPOSANIMATION := 0x400; + TPM_HORNEGANIMATION := 0x800;TPM_VERPOSANIMATION := 0x1000;TPM_VERNEGANIMATION := 0x2000; + TPM_NOANIMATION := 0x4000;TPM_LAYOUTRTL := 0x8000;TPM_WORKAREA := 0x10000; + DOF_EXECUTABLE := 0x8001;DOF_DOCUMENT := 0x8002;DOF_DIRECTORY := 0x8003; + DOF_MULTIPLE := 0x8004;DOF_PROGMAN := 0x1;DOF_SHELLDATA := 0x2; + DO_DROPFILE := 0x454C4946;DO_PRINTFILE := 0x544E5250;DT_TOP := 0x0; + DT_LEFT := 0x0;DT_CENTER := 0x1;DT_RIGHT := 0x2; + DT_VCENTER := 0x4;DT_BOTTOM := 0x8;DT_WORDBREAK := 0x10; + DT_SINGLELINE := 0x20;DT_EXPANDTABS := 0x40;DT_TABSTOP := 0x80; + DT_NOCLIP := 0x100;DT_EXTERNALLEADING := 0x200;DT_CALCRECT := 0x400; + DT_NOPREFIX := 0x800;DT_INTERNAL := 0x1000;DT_EDITCONTROL := 0x2000; + DT_PATH_ELLIPSIS := 0x4000;DT_END_ELLIPSIS := 0x8000;DT_MODIFYSTRING := 0x10000; + DT_RTLREADING := 0x20000;DT_WORD_ELLIPSIS := 0x40000;DT_NOFULLWIDTHCHARBREAK := 0x80000; + DT_HIDEPREFIX := 0x100000;DT_PREFIXONLY := 0x200000;DRAWTEXT := 0x0; + DRAWTEXTEX := 0x0;GRAYSTRING := 0x0;DST_COMPLEX := 0x0; + DST_TEXT := 0x1;DST_PREFIXTEXT := 0x2;DST_ICON := 0x3; + DST_BITMAP := 0x4;DSS_NORMAL := 0x0;DSS_UNION := 0x10; + DSS_DISABLED := 0x20;DSS_MONO := 0x80;DSS_HIDEPREFIX := 0x200; + DSS_PREFIXONLY := 0x400;DSS_RIGHT := 0x8000;DRAWSTATE := 0x0; + TABBEDTEXTOUT := 0x0;GETTABBEDTEXTEXTENT := 0x0;ASFW_ANY := 0xFFFFFFFF; + LSFW_LOCK := 0x1;LSFW_UNLOCK := 0x2;DCX_WINDOW := 0x1; + DCX_CACHE := 0x2;DCX_NORESETATTRS := 0x4;DCX_CLIPCHILDREN := 0x8; + DCX_CLIPSIBLINGS := 0x10;DCX_PARENTCLIP := 0x20;DCX_EXCLUDERGN := 0x40; + DCX_INTERSECTRGN := 0x80;DCX_EXCLUDEUPDATE := 0x100;DCX_INTERSECTUPDATE := 0x200; + DCX_LOCKWINDOWUPDATE := 0x400;DCX_VALIDATE := 0x200000;RDW_INVALIDATE := 0x1; + RDW_INTERNALPAINT := 0x2;RDW_ERASE := 0x4;RDW_VALIDATE := 0x8; + RDW_NOINTERNALPAINT := 0x10;RDW_NOERASE := 0x20;RDW_NOCHILDREN := 0x40; + RDW_ALLCHILDREN := 0x80;RDW_UPDATENOW := 0x100;RDW_ERASENOW := 0x200; + RDW_FRAME := 0x400;RDW_NOFRAME := 0x800;SW_SCROLLCHILDREN := 0x1; + SW_INVALIDATE := 0x2;SW_ERASE := 0x4;SW_SMOOTHSCROLL := 0x10; + ESB_ENABLE_BOTH := 0x0;ESB_DISABLE_BOTH := 0x3;ESB_DISABLE_LEFT := 0x1; + ESB_DISABLE_RIGHT := 0x2;ESB_DISABLE_UP := 0x1;ESB_DISABLE_DOWN := 0x2; + ESB_DISABLE_LTUP := 0x1;ESB_DISABLE_RTDN := 0x2;SETPROP := 0x0; + GETPROP := 0x0;REMOVEPROP := 0x0;ENUMPROPSEX := 0x0; + ENUMPROPS := 0x0;SETWINDOWTEXT := 0x0;GETWINDOWTEXT := 0x0; + GETWINDOWTEXTLENGTH := 0x0;HELPINFO_WINDOW := 0x1;HELPINFO_MENUITEM := 0x2; + MB_OK := 0x0;MB_OKCANCEL := 0x1;MB_ABORTRETRYIGNORE := 0x2; + MB_YESNOCANCEL := 0x3;MB_YESNO := 0x4;MB_RETRYCANCEL := 0x5; + MB_CANCELTRYCONTINUE := 0x6;MB_ICONHAND := 0x10;MB_ICONQUESTION := 0x20; + MB_ICONEXCLAMATION := 0x30;MB_ICONASTERISK := 0x40;MB_USERICON := 0x80; + MB_ICONWARNING := 0x30;MB_ICONERROR := 0x10;MB_ICONINFORMATION := 0x40; + MB_ICONSTOP := 0x10;MB_DEFBUTTON1 := 0x0;MB_DEFBUTTON2 := 0x100; + MB_DEFBUTTON3 := 0x200;MB_DEFBUTTON4 := 0x300;MB_APPLMODAL := 0x0; + MB_SYSTEMMODAL := 0x1000;MB_TASKMODAL := 0x2000;MB_HELP := 0x4000; + MB_NOFOCUS := 0x8000;MB_SETFOREGROUND := 0x10000;MB_DEFAULT_DESKTOP_ONLY := 0x20000; + MB_TOPMOST := 0x40000;MB_RIGHT := 0x80000;MB_RTLREADING := 0x100000; + MB_SERVICE_NOTIFICATION := 0x200000;MB_SERVICE_NOTIFICATION_NT3X := 0x40000;MB_TYPEMASK := 0xF; + MB_ICONMASK := 0xF0;MB_DEFMASK := 0xF00;MB_MODEMASK := 0x3000; + MB_MISCMASK := 0xC000;MESSAGEBOX := 0x0;MESSAGEBOXEX := 0x0; + MESSAGEBOXINDIRECT := 0x0;CWP_ALL := 0x0;CWP_SKIPINVISIBLE := 0x1; + CWP_SKIPDISABLED := 0x2;CWP_SKIPTRANSPARENT := 0x4;CTLCOLOR_MSGBOX := 0x0; + CTLCOLOR_EDIT := 0x1;CTLCOLOR_LISTBOX := 0x2;CTLCOLOR_BTN := 0x3; + CTLCOLOR_DLG := 0x4;CTLCOLOR_SCROLLBAR := 0x5;CTLCOLOR_STATIC := 0x6; + CTLCOLOR_MAX := 0x7;COLOR_SCROLLBAR := 0x0;COLOR_BACKGROUND := 0x1; + COLOR_ACTIVECAPTION := 0x2;COLOR_INACTIVECAPTION := 0x3;COLOR_MENU := 0x4; + COLOR_WINDOW := 0x5;COLOR_WINDOWFRAME := 0x6;COLOR_MENUTEXT := 0x7; + COLOR_WINDOWTEXT := 0x8;COLOR_CAPTIONTEXT := 0x9;COLOR_ACTIVEBORDER := 0xA; + COLOR_INACTIVEBORDER := 0xB;COLOR_APPWORKSPACE := 0xC;COLOR_HIGHLIGHT := 0xD; + COLOR_HIGHLIGHTTEXT := 0xE;COLOR_BTNFACE := 0xF;COLOR_BTNSHADOW := 0x10; + COLOR_GRAYTEXT := 0x11;COLOR_BTNTEXT := 0x12;COLOR_INACTIVECAPTIONTEXT := 0x13; + COLOR_BTNHIGHLIGHT := 0x14;COLOR_3DDKSHADOW := 0x15;COLOR_3DLIGHT := 0x16; + COLOR_INFOTEXT := 0x17;COLOR_INFOBK := 0x18;COLOR_HOTLIGHT := 0x1A; + COLOR_GRADIENTACTIVECAPTION := 0x1B;COLOR_GRADIENTINACTIVECAPTION := 0x1C;COLOR_MENUHILIGHT := 0x1D; + COLOR_MENUBAR := 0x1E;COLOR_DESKTOP := 0x1;COLOR_3DFACE := 0xF; + COLOR_3DSHADOW := 0x10;COLOR_3DHIGHLIGHT := 0x14;COLOR_3DHILIGHT := 0x14; + COLOR_BTNHILIGHT := 0x14;GETWINDOWLONG := 0x0;SETWINDOWLONG := 0x0; + GETWINDOWLONGPTR := 0x0;SETWINDOWLONGPTR := 0x0;GETCLASSLONG := 0x0; + SETCLASSLONG := 0x0;GETCLASSLONGPTR := 0x0;SETCLASSLONGPTR := 0x0; + FINDWINDOW := 0x0;FINDWINDOWEX := 0x0;GETCLASSNAME := 0x0; + GW_HWNDFIRST := 0x0;GW_HWNDLAST := 0x1;GW_HWNDNEXT := 0x2; + GW_HWNDPREV := 0x3;GW_OWNER := 0x4;GW_CHILD := 0x5; + GW_ENABLEDPOPUP := 0x6;GW_MAX := 0x6;SETWINDOWSHOOKEX := 0x0; + MF_INSERT := 0x0;MF_CHANGE := 0x80;MF_APPEND := 0x100; + MF_DELETE := 0x200;MF_REMOVE := 0x1000;MF_BYCOMMAND := 0x0; + MF_BYPOSITION := 0x400;MF_SEPARATOR := 0x800;MF_ENABLED := 0x0; + MF_GRAYED := 0x1;MF_DISABLED := 0x2;MF_UNCHECKED := 0x0; + MF_CHECKED := 0x8;MF_USECHECKBITMAPS := 0x200;MF_STRING := 0x0; + MF_BITMAP := 0x4;MF_OWNERDRAW := 0x100;MF_POPUP := 0x10; + MF_MENUBARBREAK := 0x20;MF_MENUBREAK := 0x40;MF_UNHILITE := 0x0; + MF_HILITE := 0x80;MF_DEFAULT := 0x1000;MF_SYSMENU := 0x2000; + MF_HELP := 0x4000;MF_RIGHTJUSTIFY := 0x4000;MF_MOUSESELECT := 0x8000; + MF_END := 0x80;MFT_STRING := 0x0;MFT_BITMAP := 0x4; + MFT_MENUBARBREAK := 0x20;MFT_MENUBREAK := 0x40;MFT_OWNERDRAW := 0x100; + MFT_RADIOCHECK := 0x200;MFT_SEPARATOR := 0x800;MFT_RIGHTORDER := 0x2000; + MFT_RIGHTJUSTIFY := 0x4000;MFS_GRAYED := 0x3;MFS_DISABLED := 0x3; + MFS_CHECKED := 0x8;MFS_HILITE := 0x80;MFS_ENABLED := 0x0; + MFS_UNCHECKED := 0x0;MFS_UNHILITE := 0x0;MFS_DEFAULT := 0x1000; + SC_SIZE := 0xF000;SC_MOVE := 0xF010;SC_MINIMIZE := 0xF020; + SC_MAXIMIZE := 0xF030;SC_NEXTWINDOW := 0xF040;SC_PREVWINDOW := 0xF050; + SC_CLOSE := 0xF060;SC_VSCROLL := 0xF070;SC_HSCROLL := 0xF080; + SC_MOUSEMENU := 0xF090;SC_KEYMENU := 0xF100;SC_ARRANGE := 0xF110; + SC_RESTORE := 0xF120;SC_TASKLIST := 0xF130;SC_SCREENSAVE := 0xF140; + SC_HOTKEY := 0xF150;SC_DEFAULT := 0xF160;SC_MONITORPOWER := 0xF170; + SC_CONTEXTHELP := 0xF180;SC_SEPARATOR := 0xF00F;SCF_ISSECURE := 0x1; + SC_ICON := 0xF020;SC_ZOOM := 0xF030;LOADBITMAP := 0x0; + LOADCURSOR := 0x0;LOADCURSORFROMFILE := 0x0;LOADICON := 0x0; + PRIVATEEXTRACTICONS := 0x0;IMAGE_BITMAP := 0x0;IMAGE_ICON := 0x1; + IMAGE_CURSOR := 0x2;IMAGE_ENHMETAFILE := 0x3;LR_DEFAULTCOLOR := 0x0; + LR_MONOCHROME := 0x1;LR_COLOR := 0x2;LR_COPYRETURNORG := 0x4; + LR_COPYDELETEORG := 0x8;LR_LOADFROMFILE := 0x10;LR_LOADTRANSPARENT := 0x20; + LR_DEFAULTSIZE := 0x40;LR_VGACOLOR := 0x80;LR_LOADMAP3DCOLORS := 0x1000; + LR_CREATEDIBSECTION := 0x2000;LR_COPYFROMRESOURCE := 0x4000;LR_SHARED := 0x8000; + LOADIMAGE := 0x0;DI_MASK := 0x1;DI_IMAGE := 0x2; + DI_NORMAL := 0x3;DI_COMPAT := 0x4;DI_DEFAULTSIZE := 0x8; + DI_NOMIRROR := 0x10;GETICONINFOEX := 0x0;RES_ICON := 0x1; + RES_CURSOR := 0x2;OBM_CLOSE := 0x7FF2;OBM_UPARROW := 0x7FF1; + OBM_DNARROW := 0x7FF0;OBM_RGARROW := 0x7FEF;OBM_LFARROW := 0x7FEE; + OBM_REDUCE := 0x7FED;OBM_ZOOM := 0x7FEC;OBM_RESTORE := 0x7FEB; + OBM_REDUCED := 0x7FEA;OBM_ZOOMD := 0x7FE9;OBM_RESTORED := 0x7FE8; + OBM_UPARROWD := 0x7FE7;OBM_DNARROWD := 0x7FE6;OBM_RGARROWD := 0x7FE5; + OBM_LFARROWD := 0x7FE4;OBM_MNARROW := 0x7FE3;OBM_COMBO := 0x7FE2; + OBM_UPARROWI := 0x7FE1;OBM_DNARROWI := 0x7FE0;OBM_RGARROWI := 0x7FDF; + OBM_LFARROWI := 0x7FDE;OBM_OLD_CLOSE := 0x7FFF;OBM_SIZE := 0x7FFE; + OBM_OLD_UPARROW := 0x7FFD;OBM_OLD_DNARROW := 0x7FFC;OBM_OLD_RGARROW := 0x7FFB; + OBM_OLD_LFARROW := 0x7FFA;OBM_BTSIZE := 0x7FF9;OBM_CHECK := 0x7FF8; + OBM_CHECKBOXES := 0x7FF7;OBM_BTNCORNERS := 0x7FF6;OBM_OLD_REDUCE := 0x7FF5; + OBM_OLD_ZOOM := 0x7FF4;OBM_OLD_RESTORE := 0x7FF3;OCR_NORMAL := 0x7F00; + OCR_IBEAM := 0x7F01;OCR_WAIT := 0x7F02;OCR_CROSS := 0x7F03; + OCR_UP := 0x7F04;OCR_SIZE := 0x7F80;OCR_ICON := 0x7F81; + OCR_SIZENWSE := 0x7F82;OCR_SIZENESW := 0x7F83;OCR_SIZEWE := 0x7F84; + OCR_SIZENS := 0x7F85;OCR_SIZEALL := 0x7F86;OCR_ICOCUR := 0x7F87; + OCR_NO := 0x7F88;OCR_HAND := 0x7F89;OCR_APPSTARTING := 0x7F8A; + OIC_SAMPLE := 0x7F00;OIC_HAND := 0x7F01;OIC_QUES := 0x7F02; + OIC_BANG := 0x7F03;OIC_NOTE := 0x7F04;OIC_WINLOGO := 0x7F05; + OIC_WARNING := 0x7F03;OIC_ERROR := 0x7F01;OIC_INFORMATION := 0x7F04; + OIC_SHIELD := 0x7F06;ORD_LANGDRIVER := 0x1;IDI_APPLICATION := 0x7F00; + IDI_HAND := 0x7F01;IDI_QUESTION := 0x7F02;IDI_EXCLAMATION := 0x7F03; + IDI_ASTERISK := 0x7F04;IDI_WINLOGO := 0x7F05;IDI_SHIELD := 0x7F06; + IDI_WARNING := 0x7F03;IDI_ERROR := 0x7F01;IDI_INFORMATION := 0x7F04; + IDOK := 0x1;IDCANCEL := 0x2;IDABORT := 0x3; + IDRETRY := 0x4;IDIGNORE := 0x5;IDYES := 0x6; + IDNO := 0x7;IDCLOSE := 0x8;IDHELP := 0x9; + IDTRYAGAIN := 0xA;IDCONTINUE := 0xB;IDTIMEOUT := 0x7D00; + ES_LEFT := 0x0;ES_CENTER := 0x1;ES_RIGHT := 0x2; + ES_MULTILINE := 0x4;ES_UPPERCASE := 0x8;ES_LOWERCASE := 0x10; + ES_PASSWORD := 0x20;ES_AUTOVSCROLL := 0x40;ES_AUTOHSCROLL := 0x80; + ES_NOHIDESEL := 0x100;ES_OEMCONVERT := 0x400;ES_READONLY := 0x800; + ES_WANTRETURN := 0x1000;ES_NUMBER := 0x2000;EN_SETFOCUS := 0x100; + EN_KILLFOCUS := 0x200;EN_CHANGE := 0x300;EN_UPDATE := 0x400; + EN_ERRSPACE := 0x500;EN_MAXTEXT := 0x501;EN_HSCROLL := 0x601; + EN_VSCROLL := 0x602;EN_ALIGN_LTR_EC := 0x700;EN_ALIGN_RTL_EC := 0x701; + EC_LEFTMARGIN := 0x1;EC_RIGHTMARGIN := 0x2;EC_USEFONTINFO := 0xFFFF; + EMSIS_COMPOSITIONSTRING := 0x1;EIMES_GETCOMPSTRATONCE := 0x1;EIMES_CANCELCOMPSTRINFOCUS := 0x2; + EIMES_COMPLETECOMPSTRKILLFOCUS := 0x4;EM_GETSEL := 0xB0;EM_SETSEL := 0xB1; + EM_GETRECT := 0xB2;EM_SETRECT := 0xB3;EM_SETRECTNP := 0xB4; + EM_SCROLL := 0xB5;EM_LINESCROLL := 0xB6;EM_SCROLLCARET := 0xB7; + EM_GETMODIFY := 0xB8;EM_SETMODIFY := 0xB9;EM_GETLINECOUNT := 0xBA; + EM_LINEINDEX := 0xBB;EM_SETHANDLE := 0xBC;EM_GETHANDLE := 0xBD; + EM_GETTHUMB := 0xBE;EM_LINELENGTH := 0xC1;EM_REPLACESEL := 0xC2; + EM_GETLINE := 0xC4;EM_LIMITTEXT := 0xC5;EM_CANUNDO := 0xC6; + EM_UNDO := 0xC7;EM_FMTLINES := 0xC8;EM_LINEFROMCHAR := 0xC9; + EM_SETTABSTOPS := 0xCB;EM_SETPASSWORDCHAR := 0xCC;EM_EMPTYUNDOBUFFER := 0xCD; + EM_GETFIRSTVISIBLELINE := 0xCE;EM_SETREADONLY := 0xCF;EM_SETWORDBREAKPROC := 0xD0; + EM_GETWORDBREAKPROC := 0xD1;EM_GETPASSWORDCHAR := 0xD2;EM_SETMARGINS := 0xD3; + EM_GETMARGINS := 0xD4;EM_SETLIMITTEXT := 0xC5;EM_GETLIMITTEXT := 0xD5; + EM_POSFROMCHAR := 0xD6;EM_CHARFROMPOS := 0xD7;EM_SETIMESTATUS := 0xD8; + EM_GETIMESTATUS := 0xD9;WB_LEFT := 0x0;WB_RIGHT := 0x1; + WB_ISDELIMITER := 0x2;BS_PUSHBUTTON := 0x0;BS_DEFPUSHBUTTON := 0x1; + BS_CHECKBOX := 0x2;BS_AUTOCHECKBOX := 0x3;BS_RADIOBUTTON := 0x4; + BS_3STATE := 0x5;BS_AUTO3STATE := 0x6;BS_GROUPBOX := 0x7; + BS_USERBUTTON := 0x8;BS_AUTORADIOBUTTON := 0x9;BS_PUSHBOX := 0xA; + BS_OWNERDRAW := 0xB;BS_TYPEMASK := 0xF;BS_LEFTTEXT := 0x20; + BS_TEXT := 0x0;BS_ICON := 0x40;BS_BITMAP := 0x80; + BS_LEFT := 0x100;BS_RIGHT := 0x200;BS_CENTER := 0x300; + BS_TOP := 0x400;BS_BOTTOM := 0x800;BS_VCENTER := 0xC00; + BS_PUSHLIKE := 0x1000;BS_MULTILINE := 0x2000;BS_NOTIFY := 0x4000; + BS_FLAT := 0x8000;BS_RIGHTBUTTON := 0x20;BN_CLICKED := 0x0; + BN_PAINT := 0x1;BN_HILITE := 0x2;BN_UNHILITE := 0x3; + BN_DISABLE := 0x4;BN_DOUBLECLICKED := 0x5;BN_PUSHED := 0x2; + BN_UNPUSHED := 0x3;BN_DBLCLK := 0x5;BN_SETFOCUS := 0x6; + BN_KILLFOCUS := 0x7;BM_GETCHECK := 0xF0;BM_SETCHECK := 0xF1; + BM_GETSTATE := 0xF2;BM_SETSTATE := 0xF3;BM_SETSTYLE := 0xF4; + BM_CLICK := 0xF5;BM_GETIMAGE := 0xF6;BM_SETIMAGE := 0xF7; + BM_SETDONTCLICK := 0xF8;BST_UNCHECKED := 0x0;BST_CHECKED := 0x1; + BST_INDETERMINATE := 0x2;BST_PUSHED := 0x4;BST_FOCUS := 0x8; + SS_LEFT := 0x0;SS_CENTER := 0x1;SS_RIGHT := 0x2; + SS_ICON := 0x3;SS_BLACKRECT := 0x4;SS_GRAYRECT := 0x5; + SS_WHITERECT := 0x6;SS_BLACKFRAME := 0x7;SS_GRAYFRAME := 0x8; + SS_WHITEFRAME := 0x9;SS_USERITEM := 0xA;SS_SIMPLE := 0xB; + SS_LEFTNOWORDWRAP := 0xC;SS_OWNERDRAW := 0xD;SS_BITMAP := 0xE; + SS_ENHMETAFILE := 0xF;SS_ETCHEDHORZ := 0x10;SS_ETCHEDVERT := 0x11; + SS_ETCHEDFRAME := 0x12;SS_TYPEMASK := 0x1F;SS_REALSIZECONTROL := 0x40; + SS_NOPREFIX := 0x80;SS_NOTIFY := 0x100;SS_CENTERIMAGE := 0x200; + SS_RIGHTJUST := 0x400;SS_REALSIZEIMAGE := 0x800;SS_SUNKEN := 0x1000; + SS_EDITCONTROL := 0x2000;SS_ENDELLIPSIS := 0x4000;SS_PATHELLIPSIS := 0x8000; + SS_WORDELLIPSIS := 0xC000;SS_ELLIPSISMASK := 0xC000;STM_SETICON := 0x170; + STM_GETICON := 0x171;STM_SETIMAGE := 0x172;STM_GETIMAGE := 0x173; + STN_CLICKED := 0x0;STN_DBLCLK := 0x1;STN_ENABLE := 0x2; + STN_DISABLE := 0x3;STM_MSGMAX := 0x174;DWL_MSGRESULT := 0x0; + DWL_DLGPROC := 0x4;DWL_USER := 0x8;DWLP_MSGRESULT := 0x0; + ISDIALOGMESSAGE := 0x0;DLGDIRLIST := 0x0;DDL_READWRITE := 0x0; + DDL_READONLY := 0x1;DDL_HIDDEN := 0x2;DDL_SYSTEM := 0x4; + DDL_DIRECTORY := 0x10;DDL_ARCHIVE := 0x20;DDL_POSTMSGS := 0x2000; + DDL_DRIVES := 0x4000;DDL_EXCLUSIVE := 0x8000;DLGDIRSELECTEX := 0x0; + DLGDIRLISTCOMBOBOX := 0x0;DLGDIRSELECTCOMBOBOXEX := 0x0;DS_ABSALIGN := 0x1; + DS_SYSMODAL := 0x2;DS_LOCALEDIT := 0x20;DS_SETFONT := 0x40; + DS_MODALFRAME := 0x80;DS_NOIDLEMSG := 0x100;DS_SETFOREGROUND := 0x200; + DS_3DLOOK := 0x4;DS_FIXEDSYS := 0x8;DS_NOFAILCREATE := 0x10; + DS_CONTROL := 0x400;DS_CENTER := 0x800;DS_CENTERMOUSE := 0x1000; + DS_CONTEXTHELP := 0x2000;DS_SHELLFONT := 0x48;DS_USEPIXELS := 0x8000; + DM_GETDEFID := 0x400;DM_SETDEFID := 0x401;DM_REPOSITION := 0x402; + DC_HASDEFID := 0x534B;DLGC_WANTARROWS := 0x1;DLGC_WANTTAB := 0x2; + DLGC_WANTALLKEYS := 0x4;DLGC_WANTMESSAGE := 0x4;DLGC_HASSETSEL := 0x8; + DLGC_DEFPUSHBUTTON := 0x10;DLGC_UNDEFPUSHBUTTON := 0x20;DLGC_RADIOBUTTON := 0x40; + DLGC_WANTCHARS := 0x80;DLGC_STATIC := 0x100;DLGC_BUTTON := 0x2000; + LB_CTLCODE := 0x0;LB_OKAY := 0x0;LB_ERR := 0xFFFFFFFF; + LB_ERRSPACE := 0xFFFFFFFE;LBN_ERRSPACE := 0xFFFFFFFE;LBN_SELCHANGE := 0x1; + LBN_DBLCLK := 0x2;LBN_SELCANCEL := 0x3;LBN_SETFOCUS := 0x4; + LBN_KILLFOCUS := 0x5;LB_ADDSTRING := 0x180;LB_INSERTSTRING := 0x181; + LB_DELETESTRING := 0x182;LB_SELITEMRANGEEX := 0x183;LB_RESETCONTENT := 0x184; + LB_SETSEL := 0x185;LB_SETCURSEL := 0x186;LB_GETSEL := 0x187; + LB_GETCURSEL := 0x188;LB_GETTEXT := 0x189;LB_GETTEXTLEN := 0x18A; + LB_GETCOUNT := 0x18B;LB_SELECTSTRING := 0x18C;LB_DIR := 0x18D; + LB_GETTOPINDEX := 0x18E;LB_FINDSTRING := 0x18F;LB_GETSELCOUNT := 0x190; + LB_GETSELITEMS := 0x191;LB_SETTABSTOPS := 0x192;LB_GETHORIZONTALEXTENT := 0x193; + LB_SETHORIZONTALEXTENT := 0x194;LB_SETCOLUMNWIDTH := 0x195;LB_ADDFILE := 0x196; + LB_SETTOPINDEX := 0x197;LB_GETITEMRECT := 0x198;LB_GETITEMDATA := 0x199; + LB_SETITEMDATA := 0x19A;LB_SELITEMRANGE := 0x19B;LB_SETANCHORINDEX := 0x19C; + LB_GETANCHORINDEX := 0x19D;LB_SETCARETINDEX := 0x19E;LB_GETCARETINDEX := 0x19F; + LB_SETITEMHEIGHT := 0x1A0;LB_GETITEMHEIGHT := 0x1A1;LB_FINDSTRINGEXACT := 0x1A2; + LB_SETLOCALE := 0x1A5;LB_GETLOCALE := 0x1A6;LB_SETCOUNT := 0x1A7; + LB_INITSTORAGE := 0x1A8;LB_ITEMFROMPOINT := 0x1A9;LB_MULTIPLEADDSTRING := 0x1B1; + LB_GETLISTBOXINFO := 0x1B2;LB_MSGMAX := 0x1B3;LBS_NOTIFY := 0x1; + LBS_SORT := 0x2;LBS_NOREDRAW := 0x4;LBS_MULTIPLESEL := 0x8; + LBS_OWNERDRAWFIXED := 0x10;LBS_OWNERDRAWVARIABLE := 0x20;LBS_HASSTRINGS := 0x40; + LBS_USETABSTOPS := 0x80;LBS_NOINTEGRALHEIGHT := 0x100;LBS_MULTICOLUMN := 0x200; + LBS_WANTKEYBOARDINPUT := 0x400;LBS_EXTENDEDSEL := 0x800;LBS_DISABLENOSCROLL := 0x1000; + LBS_NODATA := 0x2000;LBS_NOSEL := 0x4000;LBS_COMBOBOX := 0x8000; + LBS_STANDARD := 0xA00003;CB_OKAY := 0x0;CB_ERR := 0xFFFFFFFF; + CB_ERRSPACE := 0xFFFFFFFE;CBN_ERRSPACE := 0xFFFFFFFF;CBN_SELCHANGE := 0x1; + CBN_DBLCLK := 0x2;CBN_SETFOCUS := 0x3;CBN_KILLFOCUS := 0x4; + CBN_EDITCHANGE := 0x5;CBN_EDITUPDATE := 0x6;CBN_DROPDOWN := 0x7; + CBN_CLOSEUP := 0x8;CBN_SELENDOK := 0x9;CBN_SELENDCANCEL := 0xA; + CBS_SIMPLE := 0x1;CBS_DROPDOWN := 0x2;CBS_DROPDOWNLIST := 0x3; + CBS_OWNERDRAWFIXED := 0x10;CBS_OWNERDRAWVARIABLE := 0x20;CBS_AUTOHSCROLL := 0x40; + CBS_OEMCONVERT := 0x80;CBS_SORT := 0x100;CBS_HASSTRINGS := 0x200; + CBS_NOINTEGRALHEIGHT := 0x400;CBS_DISABLENOSCROLL := 0x800;CBS_UPPERCASE := 0x2000; + CBS_LOWERCASE := 0x4000;CB_GETEDITSEL := 0x140;CB_LIMITTEXT := 0x141; + CB_SETEDITSEL := 0x142;CB_ADDSTRING := 0x143;CB_DELETESTRING := 0x144; + CB_DIR := 0x145;CB_GETCOUNT := 0x146;CB_GETCURSEL := 0x147; + CB_GETLBTEXT := 0x148;CB_GETLBTEXTLEN := 0x149;CB_INSERTSTRING := 0x14A; + CB_RESETCONTENT := 0x14B;CB_FINDSTRING := 0x14C;CB_SELECTSTRING := 0x14D; + CB_SETCURSEL := 0x14E;CB_SHOWDROPDOWN := 0x14F;CB_GETITEMDATA := 0x150; + CB_SETITEMDATA := 0x151;CB_GETDROPPEDCONTROLRECT := 0x152;CB_SETITEMHEIGHT := 0x153; + CB_GETITEMHEIGHT := 0x154;CB_SETEXTENDEDUI := 0x155;CB_GETEXTENDEDUI := 0x156; + CB_GETDROPPEDSTATE := 0x157;CB_FINDSTRINGEXACT := 0x158;CB_SETLOCALE := 0x159; + CB_GETLOCALE := 0x15A;CB_GETTOPINDEX := 0x15B;CB_SETTOPINDEX := 0x15C; + CB_GETHORIZONTALEXTENT := 0x15D;CB_SETHORIZONTALEXTENT := 0x15E;CB_GETDROPPEDWIDTH := 0x15F; + CB_SETDROPPEDWIDTH := 0x160;CB_INITSTORAGE := 0x161;CB_MULTIPLEADDSTRING := 0x163; + CB_GETCOMBOBOXINFO := 0x164;CB_MSGMAX := 0x165;SBS_HORZ := 0x0; + SBS_VERT := 0x1;SBS_TOPALIGN := 0x2;SBS_LEFTALIGN := 0x2; + SBS_BOTTOMALIGN := 0x4;SBS_RIGHTALIGN := 0x4;SBS_SIZEBOXTOPLEFTALIGN := 0x2; + SBS_SIZEBOXBOTTOMRIGHTALIGN := 0x4;SBS_SIZEBOX := 0x8;SBS_SIZEGRIP := 0x10; + SBM_SETPOS := 0xE0;SBM_GETPOS := 0xE1;SBM_SETRANGE := 0xE2; + SBM_SETRANGEREDRAW := 0xE6;SBM_GETRANGE := 0xE3;SBM_ENABLE_ARROWS := 0xE4; + SBM_SETSCROLLINFO := 0xE9;SBM_GETSCROLLINFO := 0xEA;SBM_GETSCROLLBARINFO := 0xEB; + SIF_RANGE := 0x1;SIF_PAGE := 0x2;SIF_POS := 0x4; + SIF_DISABLENOSCROLL := 0x8;SIF_TRACKPOS := 0x10;SIF_ALL := 0x17; + MDIS_ALLCHILDSTYLES := 0x1;MDITILE_VERTICAL := 0x0;MDITILE_HORIZONTAL := 0x1; + MDITILE_SKIPDISABLED := 0x2;MDITILE_ZORDER := 0x4;DEFFRAMEPROC := 0x0; + DEFMDICHILDPROC := 0x0;CREATEMDIWINDOW := 0x0;HELP_CONTEXT := 0x1; + HELP_QUIT := 0x2;HELP_INDEX := 0x3;HELP_CONTENTS := 0x3; + HELP_HELPONHELP := 0x4;HELP_SETINDEX := 0x5;HELP_SETCONTENTS := 0x5; + HELP_CONTEXTPOPUP := 0x8;HELP_FORCEFILE := 0x9;HELP_KEY := 0x101; + HELP_COMMAND := 0x102;HELP_PARTIALKEY := 0x105;HELP_MULTIKEY := 0x201; + HELP_SETWINPOS := 0x203;HELP_CONTEXTMENU := 0xA;HELP_FINDER := 0xB; + HELP_WM_HELP := 0xC;HELP_SETPOPUP_POS := 0xD;HELP_TCARD := 0x8000; + HELP_TCARD_DATA := 0x10;HELP_TCARD_OTHER_CALLER := 0x11;IDH_NO_HELP := 0x6F18; + IDH_MISSING_CONTEXT := 0x6F19;IDH_GENERIC_HELP_BUTTON := 0x6F1A;IDH_OK := 0x6F1B; + IDH_CANCEL := 0x6F1C;IDH_HELP := 0x6F1D;WINHELP := 0x0; + GR_GDIOBJECTS := 0x0;GR_USEROBJECTS := 0x1;GR_GDIOBJECTS_PEAK := 0x2; + GR_USEROBJECTS_PEAK := 0x4;GR_GLOBAL := 0xFFFFFFFE;SPI_GETBEEP := 0x1; + SPI_SETBEEP := 0x2;SPI_GETMOUSE := 0x3;SPI_SETMOUSE := 0x4; + SPI_GETBORDER := 0x5;SPI_SETBORDER := 0x6;SPI_GETKEYBOARDSPEED := 0xA; + SPI_SETKEYBOARDSPEED := 0xB;SPI_LANGDRIVER := 0xC;SPI_ICONHORIZONTALSPACING := 0xD; + SPI_GETSCREENSAVETIMEOUT := 0xE;SPI_SETSCREENSAVETIMEOUT := 0xF;SPI_GETSCREENSAVEACTIVE := 0x10; + SPI_SETSCREENSAVEACTIVE := 0x11;SPI_GETGRIDGRANULARITY := 0x12;SPI_SETGRIDGRANULARITY := 0x13; + SPI_SETDESKWALLPAPER := 0x14;SPI_SETDESKPATTERN := 0x15;SPI_GETKEYBOARDDELAY := 0x16; + SPI_SETKEYBOARDDELAY := 0x17;SPI_ICONVERTICALSPACING := 0x18;SPI_GETICONTITLEWRAP := 0x19; + SPI_SETICONTITLEWRAP := 0x1A;SPI_GETMENUDROPALIGNMENT := 0x1B;SPI_SETMENUDROPALIGNMENT := 0x1C; + SPI_SETDOUBLECLKWIDTH := 0x1D;SPI_SETDOUBLECLKHEIGHT := 0x1E;SPI_GETICONTITLELOGFONT := 0x1F; + SPI_SETDOUBLECLICKTIME := 0x20;SPI_SETMOUSEBUTTONSWAP := 0x21;SPI_SETICONTITLELOGFONT := 0x22; + SPI_GETFASTTASKSWITCH := 0x23;SPI_SETFASTTASKSWITCH := 0x24;SPI_SETDRAGFULLWINDOWS := 0x25; + SPI_GETDRAGFULLWINDOWS := 0x26;SPI_GETNONCLIENTMETRICS := 0x29;SPI_SETNONCLIENTMETRICS := 0x2A; + SPI_GETMINIMIZEDMETRICS := 0x2B;SPI_SETMINIMIZEDMETRICS := 0x2C;SPI_GETICONMETRICS := 0x2D; + SPI_SETICONMETRICS := 0x2E;SPI_SETWORKAREA := 0x2F;SPI_GETWORKAREA := 0x30; + SPI_SETPENWINDOWS := 0x31;SPI_GETHIGHCONTRAST := 0x42;SPI_SETHIGHCONTRAST := 0x43; + SPI_GETKEYBOARDPREF := 0x44;SPI_SETKEYBOARDPREF := 0x45;SPI_GETSCREENREADER := 0x46; + SPI_SETSCREENREADER := 0x47;SPI_GETANIMATION := 0x48;SPI_SETANIMATION := 0x49; + SPI_GETFONTSMOOTHING := 0x4A;SPI_SETFONTSMOOTHING := 0x4B;SPI_SETDRAGWIDTH := 0x4C; + SPI_SETDRAGHEIGHT := 0x4D;SPI_SETHANDHELD := 0x4E;SPI_GETLOWPOWERTIMEOUT := 0x4F; + SPI_GETPOWEROFFTIMEOUT := 0x50;SPI_SETLOWPOWERTIMEOUT := 0x51;SPI_SETPOWEROFFTIMEOUT := 0x52; + SPI_GETLOWPOWERACTIVE := 0x53;SPI_GETPOWEROFFACTIVE := 0x54;SPI_SETLOWPOWERACTIVE := 0x55; + SPI_SETPOWEROFFACTIVE := 0x56;SPI_SETCURSORS := 0x57;SPI_SETICONS := 0x58; + SPI_GETDEFAULTINPUTLANG := 0x59;SPI_SETDEFAULTINPUTLANG := 0x5A;SPI_SETLANGTOGGLE := 0x5B; + SPI_GETWINDOWSEXTENSION := 0x5C;SPI_SETMOUSETRAILS := 0x5D;SPI_GETMOUSETRAILS := 0x5E; + SPI_SETSCREENSAVERRUNNING := 0x61;SPI_SCREENSAVERRUNNING := 0x61;SPI_GETFILTERKEYS := 0x32; + SPI_SETFILTERKEYS := 0x33;SPI_GETTOGGLEKEYS := 0x34;SPI_SETTOGGLEKEYS := 0x35; + SPI_GETMOUSEKEYS := 0x36;SPI_SETMOUSEKEYS := 0x37;SPI_GETSHOWSOUNDS := 0x38; + SPI_SETSHOWSOUNDS := 0x39;SPI_GETSTICKYKEYS := 0x3A;SPI_SETSTICKYKEYS := 0x3B; + SPI_GETACCESSTIMEOUT := 0x3C;SPI_SETACCESSTIMEOUT := 0x3D;SPI_GETSERIALKEYS := 0x3E; + SPI_SETSERIALKEYS := 0x3F;SPI_GETSOUNDSENTRY := 0x40;SPI_SETSOUNDSENTRY := 0x41; + SPI_GETSNAPTODEFBUTTON := 0x5F;SPI_SETSNAPTODEFBUTTON := 0x60;SPI_GETMOUSEHOVERWIDTH := 0x62; + SPI_SETMOUSEHOVERWIDTH := 0x63;SPI_GETMOUSEHOVERHEIGHT := 0x64;SPI_SETMOUSEHOVERHEIGHT := 0x65; + SPI_GETMOUSEHOVERTIME := 0x66;SPI_SETMOUSEHOVERTIME := 0x67;SPI_GETWHEELSCROLLLINES := 0x68; + SPI_SETWHEELSCROLLLINES := 0x69;SPI_GETMENUSHOWDELAY := 0x6A;SPI_SETMENUSHOWDELAY := 0x6B; + SPI_GETWHEELSCROLLCHARS := 0x6C;SPI_SETWHEELSCROLLCHARS := 0x6D;SPI_GETSHOWIMEUI := 0x6E; + SPI_SETSHOWIMEUI := 0x6F;SPI_GETMOUSESPEED := 0x70;SPI_SETMOUSESPEED := 0x71; + SPI_GETSCREENSAVERRUNNING := 0x72;SPI_GETDESKWALLPAPER := 0x73;SPI_GETAUDIODESCRIPTION := 0x74; + SPI_SETAUDIODESCRIPTION := 0x75;SPI_GETSCREENSAVESECURE := 0x76;SPI_SETSCREENSAVESECURE := 0x77; + SPI_GETHUNGAPPTIMEOUT := 0x78;SPI_SETHUNGAPPTIMEOUT := 0x79;SPI_GETWAITTOKILLTIMEOUT := 0x7A; + SPI_SETWAITTOKILLTIMEOUT := 0x7B;SPI_GETWAITTOKILLSERVICETIMEOUT := 0x7C;SPI_SETWAITTOKILLSERVICETIMEOUT := 0x7D; + SPI_GETMOUSEDOCKTHRESHOLD := 0x7E;SPI_SETMOUSEDOCKTHRESHOLD := 0x7F;SPI_GETPENDOCKTHRESHOLD := 0x80; + SPI_SETPENDOCKTHRESHOLD := 0x81;SPI_GETWINARRANGING := 0x82;SPI_SETWINARRANGING := 0x83; + SPI_GETMOUSEDRAGOUTTHRESHOLD := 0x84;SPI_SETMOUSEDRAGOUTTHRESHOLD := 0x85;SPI_GETPENDRAGOUTTHRESHOLD := 0x86; + SPI_SETPENDRAGOUTTHRESHOLD := 0x87;SPI_GETMOUSESIDEMOVETHRESHOLD := 0x88;SPI_SETMOUSESIDEMOVETHRESHOLD := 0x89; + SPI_GETPENSIDEMOVETHRESHOLD := 0x8A;SPI_SETPENSIDEMOVETHRESHOLD := 0x8B;SPI_GETDRAGFROMMAXIMIZE := 0x8C; + SPI_SETDRAGFROMMAXIMIZE := 0x8D;SPI_GETSNAPSIZING := 0x8E;SPI_SETSNAPSIZING := 0x8F; + SPI_GETDOCKMOVING := 0x90;SPI_SETDOCKMOVING := 0x91;MAX_TOUCH_PREDICTION_FILTER_TAPS := 0x3; + TOUCHPREDICTIONPARAMETERS_DEFAULT_LATENCY := 0x8;TOUCHPREDICTIONPARAMETERS_DEFAULT_SAMPLETIME := 0x8;TOUCHPREDICTIONPARAMETERS_DEFAULT_USE_HW_TIMESTAMP := 0x1; + TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_DELTA := 0x0;TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_MIN := 0x0;TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_MAX := 0x0; + TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_LAMBDA_LEARNING_RATE := 0x0;TOUCHPREDICTIONPARAMETERS_DEFAULT_RLS_EXPO_SMOOTH_ALPHA := 0x0;SPI_GETTOUCHPREDICTIONPARAMETERS := 0x9C; + SPI_SETTOUCHPREDICTIONPARAMETERS := 0x9D;MAX_LOGICALDPIOVERRIDE := 0x2;MIN_LOGICALDPIOVERRIDE := 0xFFFFFFFE; + SPI_GETLOGICALDPIOVERRIDE := 0x9E;SPI_SETLOGICALDPIOVERRIDE := 0x9F;SPI_GETMOUSECORNERCLIPLENGTH := 0xA0; + SPI_SETMOUSECORNERCLIPLENGTH := 0xA1;SPI_GETMENURECT := 0xA2;SPI_SETMENURECT := 0xA3; + SPI_GETACTIVEWINDOWTRACKING := 0x1000;SPI_SETACTIVEWINDOWTRACKING := 0x1001;SPI_GETMENUANIMATION := 0x1002; + SPI_SETMENUANIMATION := 0x1003;SPI_GETCOMBOBOXANIMATION := 0x1004;SPI_SETCOMBOBOXANIMATION := 0x1005; + SPI_GETLISTBOXSMOOTHSCROLLING := 0x1006;SPI_SETLISTBOXSMOOTHSCROLLING := 0x1007;SPI_GETGRADIENTCAPTIONS := 0x1008; + SPI_SETGRADIENTCAPTIONS := 0x1009;SPI_GETKEYBOARDCUES := 0x100A;SPI_SETKEYBOARDCUES := 0x100B; + SPI_GETMENUUNDERLINES := 0x100A;SPI_SETMENUUNDERLINES := 0x100B;SPI_GETACTIVEWNDTRKZORDER := 0x100C; + SPI_SETACTIVEWNDTRKZORDER := 0x100D;SPI_GETHOTTRACKING := 0x100E;SPI_SETHOTTRACKING := 0x100F; + SPI_GETMENUFADE := 0x1012;SPI_SETMENUFADE := 0x1013;SPI_GETSELECTIONFADE := 0x1014; + SPI_SETSELECTIONFADE := 0x1015;SPI_GETTOOLTIPANIMATION := 0x1016;SPI_SETTOOLTIPANIMATION := 0x1017; + SPI_GETTOOLTIPFADE := 0x1018;SPI_SETTOOLTIPFADE := 0x1019;SPI_GETCURSORSHADOW := 0x101A; + SPI_SETCURSORSHADOW := 0x101B;SPI_GETMOUSESONAR := 0x101C;SPI_SETMOUSESONAR := 0x101D; + SPI_GETMOUSECLICKLOCK := 0x101E;SPI_SETMOUSECLICKLOCK := 0x101F;SPI_GETMOUSEVANISH := 0x1020; + SPI_SETMOUSEVANISH := 0x1021;SPI_GETFLATMENU := 0x1022;SPI_SETFLATMENU := 0x1023; + SPI_GETDROPSHADOW := 0x1024;SPI_SETDROPSHADOW := 0x1025;SPI_GETBLOCKSENDINPUTRESETS := 0x1026; + SPI_SETBLOCKSENDINPUTRESETS := 0x1027;SPI_GETUIEFFECTS := 0x103E;SPI_SETUIEFFECTS := 0x103F; + SPI_GETDISABLEOVERLAPPEDCONTENT := 0x1040;SPI_SETDISABLEOVERLAPPEDCONTENT := 0x1041;SPI_GETCLIENTAREAANIMATION := 0x1042; + SPI_SETCLIENTAREAANIMATION := 0x1043;SPI_GETCLEARTYPE := 0x1048;SPI_SETCLEARTYPE := 0x1049; + SPI_GETSPEECHRECOGNITION := 0x104A;SPI_SETSPEECHRECOGNITION := 0x104B;SPI_GETCARETBROWSING := 0x104C; + SPI_SETCARETBROWSING := 0x104D;SPI_GETTHREADLOCALINPUTSETTINGS := 0x104E;SPI_SETTHREADLOCALINPUTSETTINGS := 0x104F; + SPI_GETSYSTEMLANGUAGEBAR := 0x1050;SPI_SETSYSTEMLANGUAGEBAR := 0x1051;SPI_GETFOREGROUNDLOCKTIMEOUT := 0x2000; + SPI_SETFOREGROUNDLOCKTIMEOUT := 0x2001;SPI_GETACTIVEWNDTRKTIMEOUT := 0x2002;SPI_SETACTIVEWNDTRKTIMEOUT := 0x2003; + SPI_GETFOREGROUNDFLASHCOUNT := 0x2004;SPI_SETFOREGROUNDFLASHCOUNT := 0x2005;SPI_GETCARETWIDTH := 0x2006; + SPI_SETCARETWIDTH := 0x2007;SPI_GETMOUSECLICKLOCKTIME := 0x2008;SPI_SETMOUSECLICKLOCKTIME := 0x2009; + SPI_GETFONTSMOOTHINGTYPE := 0x200A;SPI_SETFONTSMOOTHINGTYPE := 0x200B;FE_FONTSMOOTHINGSTANDARD := 0x1; + FE_FONTSMOOTHINGCLEARTYPE := 0x2;SPI_GETFONTSMOOTHINGCONTRAST := 0x200C;SPI_SETFONTSMOOTHINGCONTRAST := 0x200D; + SPI_GETFOCUSBORDERWIDTH := 0x200E;SPI_SETFOCUSBORDERWIDTH := 0x200F;SPI_GETFOCUSBORDERHEIGHT := 0x2010; + SPI_SETFOCUSBORDERHEIGHT := 0x2011;SPI_GETFONTSMOOTHINGORIENTATION := 0x2012;SPI_SETFONTSMOOTHINGORIENTATION := 0x2013; + FE_FONTSMOOTHINGORIENTATIONBGR := 0x0;FE_FONTSMOOTHINGORIENTATIONRGB := 0x1;SPI_GETMINIMUMHITRADIUS := 0x2014; + SPI_SETMINIMUMHITRADIUS := 0x2015;SPI_GETMESSAGEDURATION := 0x2016;SPI_SETMESSAGEDURATION := 0x2017; + SPI_GETCONTACTVISUALIZATION := 0x2018;SPI_SETCONTACTVISUALIZATION := 0x2019;CONTACTVISUALIZATION_OFF := 0x0; + CONTACTVISUALIZATION_ON := 0x1;CONTACTVISUALIZATION_PRESENTATIONMODE := 0x2;SPI_GETGESTUREVISUALIZATION := 0x201A; + SPI_SETGESTUREVISUALIZATION := 0x201B;GESTUREVISUALIZATION_OFF := 0x0;GESTUREVISUALIZATION_ON := 0x1F; + GESTUREVISUALIZATION_TAP := 0x1;GESTUREVISUALIZATION_DOUBLETAP := 0x2;GESTUREVISUALIZATION_PRESSANDTAP := 0x4; + GESTUREVISUALIZATION_PRESSANDHOLD := 0x8;GESTUREVISUALIZATION_RIGHTTAP := 0x10;SPI_GETMOUSEWHEELROUTING := 0x201C; + SPI_SETMOUSEWHEELROUTING := 0x201D;MOUSEWHEEL_ROUTING_FOCUS := 0x0;MOUSEWHEEL_ROUTING_HYBRID := 0x1; + SPIF_UPDATEINIFILE := 0x1;SPIF_SENDWININICHANGE := 0x2;SPIF_SENDCHANGE := 0x2; + METRICS_USEDEFAULT := 0xFFFFFFFF;ARW_BOTTOMLEFT := 0x0;ARW_BOTTOMRIGHT := 0x1; + ARW_TOPLEFT := 0x2;ARW_TOPRIGHT := 0x3;ARW_STARTMASK := 0x3; + ARW_STARTRIGHT := 0x1;ARW_STARTTOP := 0x2;ARW_LEFT := 0x0; + ARW_RIGHT := 0x0;ARW_UP := 0x4;ARW_DOWN := 0x4; + ARW_HIDE := 0x8;SERKF_SERIALKEYSON := 0x1;SERKF_AVAILABLE := 0x2; + SERKF_INDICATOR := 0x4;HCF_HIGHCONTRASTON := 0x1;HCF_AVAILABLE := 0x2; + HCF_HOTKEYACTIVE := 0x4;HCF_CONFIRMHOTKEY := 0x8;HCF_HOTKEYSOUND := 0x10; + HCF_INDICATOR := 0x20;HCF_HOTKEYAVAILABLE := 0x40;HCF_LOGONDESKTOP := 0x100; + HCF_DEFAULTDESKTOP := 0x200;CDS_UPDATEREGISTRY := 0x1;CDS_TEST := 0x2; + CDS_FULLSCREEN := 0x4;CDS_GLOBAL := 0x8;CDS_SET_PRIMARY := 0x10; + CDS_VIDEOPARAMETERS := 0x20;CDS_ENABLE_UNSAFE_MODES := 0x100;CDS_DISABLE_UNSAFE_MODES := 0x200; + CDS_RESET := 0x40000000;CDS_RESET_EX := 0x20000000;CDS_NORESET := 0x10000000; + DISP_CHANGE_SUCCESSFUL := 0x0;DISP_CHANGE_RESTART := 0x1;DISP_CHANGE_FAILED := 0xFFFFFFFF; + DISP_CHANGE_BADMODE := 0xFFFFFFFE;DISP_CHANGE_NOTUPDATED := 0xFFFFFFFD;DISP_CHANGE_BADFLAGS := 0xFFFFFFFC; + DISP_CHANGE_BADPARAM := 0xFFFFFFFB;DISP_CHANGE_BADDUALVIEW := 0xFFFFFFFA;CHANGEDISPLAYSETTINGS := 0x0; + CHANGEDISPLAYSETTINGSEX := 0x0;ENUM_CURRENT_SETTINGS := 0xFFFFFFFF;ENUM_REGISTRY_SETTINGS := 0xFFFFFFFE; + ENUMDISPLAYSETTINGS := 0x0;ENUMDISPLAYSETTINGSEX := 0x0;EDS_RAWMODE := 0x2; + EDS_ROTATEDMODE := 0x4;ENUMDISPLAYDEVICES := 0x0;EDD_GET_DEVICE_INTERFACE_NAME := 0x1; + SYSTEMPARAMETERSINFO := 0x0;FKF_FILTERKEYSON := 0x1;FKF_AVAILABLE := 0x2; + FKF_HOTKEYACTIVE := 0x4;FKF_CONFIRMHOTKEY := 0x8;FKF_HOTKEYSOUND := 0x10; + FKF_INDICATOR := 0x20;FKF_CLICKON := 0x40;SKF_STICKYKEYSON := 0x1; + SKF_AVAILABLE := 0x2;SKF_HOTKEYACTIVE := 0x4;SKF_CONFIRMHOTKEY := 0x8; + SKF_HOTKEYSOUND := 0x10;SKF_INDICATOR := 0x20;SKF_AUDIBLEFEEDBACK := 0x40; + SKF_TRISTATE := 0x80;SKF_TWOKEYSOFF := 0x100;SKF_LALTLATCHED := 0x10000000; + SKF_LCTLLATCHED := 0x4000000;SKF_LSHIFTLATCHED := 0x1000000;SKF_RALTLATCHED := 0x20000000; + SKF_RCTLLATCHED := 0x8000000;SKF_RSHIFTLATCHED := 0x2000000;SKF_LWINLATCHED := 0x40000000; + SKF_RWINLATCHED := 0x80000000;SKF_LALTLOCKED := 0x100000;SKF_LCTLLOCKED := 0x40000; + SKF_LSHIFTLOCKED := 0x10000;SKF_RALTLOCKED := 0x200000;SKF_RCTLLOCKED := 0x80000; + SKF_RSHIFTLOCKED := 0x20000;SKF_LWINLOCKED := 0x400000;SKF_RWINLOCKED := 0x800000; + MKF_MOUSEKEYSON := 0x1;MKF_AVAILABLE := 0x2;MKF_HOTKEYACTIVE := 0x4; + MKF_CONFIRMHOTKEY := 0x8;MKF_HOTKEYSOUND := 0x10;MKF_INDICATOR := 0x20; + MKF_MODIFIERS := 0x40;MKF_REPLACENUMBERS := 0x80;MKF_LEFTBUTTONSEL := 0x10000000; + MKF_RIGHTBUTTONSEL := 0x20000000;MKF_LEFTBUTTONDOWN := 0x1000000;MKF_RIGHTBUTTONDOWN := 0x2000000; + MKF_MOUSEMODE := 0x80000000;ATF_TIMEOUTON := 0x1;ATF_ONOFFFEEDBACK := 0x2; + SSGF_NONE := 0x0;SSGF_DISPLAY := 0x3;SSTF_NONE := 0x0; + SSTF_CHARS := 0x1;SSTF_BORDER := 0x2;SSTF_DISPLAY := 0x3; + SSWF_NONE := 0x0;SSWF_TITLE := 0x1;SSWF_WINDOW := 0x2; + SSWF_DISPLAY := 0x3;SSWF_CUSTOM := 0x4;SSF_SOUNDSENTRYON := 0x1; + SSF_AVAILABLE := 0x2;SSF_INDICATOR := 0x4;TKF_TOGGLEKEYSON := 0x1; + TKF_AVAILABLE := 0x2;TKF_HOTKEYACTIVE := 0x4;TKF_CONFIRMHOTKEY := 0x8; + TKF_HOTKEYSOUND := 0x10;TKF_INDICATOR := 0x20;SLE_ERROR := 0x1; + SLE_MINORERROR := 0x2;SLE_WARNING := 0x3;MONITOR_DEFAULTTONULL := 0x0; + MONITOR_DEFAULTTOPRIMARY := 0x1;MONITOR_DEFAULTTONEAREST := 0x2;MONITORINFOF_PRIMARY := 0x1; + CCHDEVICENAME := 0x20;GETMONITORINFO := 0x0;WINEVENT_OUTOFCONTEXT := 0x0; + WINEVENT_SKIPOWNTHREAD := 0x1;WINEVENT_SKIPOWNPROCESS := 0x2;WINEVENT_INCONTEXT := 0x4; + CHILDID_SELF := 0x0;INDEXID_OBJECT := 0x0;INDEXID_CONTAINER := 0x0; + OBJID_WINDOW := 0x0;OBJID_SYSMENU := 0xFFFFFFFF;OBJID_TITLEBAR := 0xFFFFFFFE; + OBJID_MENU := 0xFFFFFFFD;OBJID_CLIENT := 0xFFFFFFFC;OBJID_VSCROLL := 0xFFFFFFFB; + OBJID_HSCROLL := 0xFFFFFFFA;OBJID_SIZEGRIP := 0xFFFFFFF9;OBJID_CARET := 0xFFFFFFF8; + OBJID_CURSOR := 0xFFFFFFF7;OBJID_ALERT := 0xFFFFFFF6;OBJID_SOUND := 0xFFFFFFF5; + OBJID_QUERYCLASSNAMEIDX := 0xFFFFFFF4;OBJID_NATIVEOM := 0xFFFFFFF0;EVENT_MIN := 0x1; + EVENT_MAX := 0x7FFFFFFF;EVENT_SYSTEM_SOUND := 0x1;EVENT_SYSTEM_ALERT := 0x2; + EVENT_SYSTEM_FOREGROUND := 0x3;EVENT_SYSTEM_MENUSTART := 0x4;EVENT_SYSTEM_MENUEND := 0x5; + EVENT_SYSTEM_MENUPOPUPSTART := 0x6;EVENT_SYSTEM_MENUPOPUPEND := 0x7;EVENT_SYSTEM_CAPTURESTART := 0x8; + EVENT_SYSTEM_CAPTUREEND := 0x9;EVENT_SYSTEM_MOVESIZESTART := 0xA;EVENT_SYSTEM_MOVESIZEEND := 0xB; + EVENT_SYSTEM_CONTEXTHELPSTART := 0xC;EVENT_SYSTEM_CONTEXTHELPEND := 0xD;EVENT_SYSTEM_DRAGDROPSTART := 0xE; + EVENT_SYSTEM_DRAGDROPEND := 0xF;EVENT_SYSTEM_DIALOGSTART := 0x10;EVENT_SYSTEM_DIALOGEND := 0x11; + EVENT_SYSTEM_SCROLLINGSTART := 0x12;EVENT_SYSTEM_SCROLLINGEND := 0x13;EVENT_SYSTEM_SWITCHSTART := 0x14; + EVENT_SYSTEM_SWITCHEND := 0x15;EVENT_SYSTEM_MINIMIZESTART := 0x16;EVENT_SYSTEM_MINIMIZEEND := 0x17; + EVENT_SYSTEM_DESKTOPSWITCH := 0x20;EVENT_SYSTEM_SWITCHER_APPGRABBED := 0x24;EVENT_SYSTEM_SWITCHER_APPOVERTARGET := 0x25; + EVENT_SYSTEM_SWITCHER_APPDROPPED := 0x26;EVENT_SYSTEM_SWITCHER_CANCELLED := 0x27;EVENT_SYSTEM_IME_KEY_NOTIFICATION := 0x29; + EVENT_SYSTEM_END := 0xFF;EVENT_OEM_DEFINED_START := 0x101;EVENT_OEM_DEFINED_END := 0x1FF; + EVENT_UIA_EVENTID_START := 0x4E00;EVENT_UIA_EVENTID_END := 0x4EFF;EVENT_UIA_PROPID_START := 0x7500; + EVENT_UIA_PROPID_END := 0x75FF;EVENT_CONSOLE_CARET := 0x4001;EVENT_CONSOLE_UPDATE_REGION := 0x4002; + EVENT_CONSOLE_UPDATE_SIMPLE := 0x4003;EVENT_CONSOLE_UPDATE_SCROLL := 0x4004;EVENT_CONSOLE_LAYOUT := 0x4005; + EVENT_CONSOLE_START_APPLICATION := 0x4006;EVENT_CONSOLE_END_APPLICATION := 0x4007;CONSOLE_APPLICATION_16BIT := 0x0; + CONSOLE_CARET_SELECTION := 0x1;CONSOLE_CARET_VISIBLE := 0x2;EVENT_CONSOLE_END := 0x40FF; + EVENT_OBJECT_CREATE := 0x8000;EVENT_OBJECT_DESTROY := 0x8001;EVENT_OBJECT_SHOW := 0x8002; + EVENT_OBJECT_HIDE := 0x8003;EVENT_OBJECT_REORDER := 0x8004;EVENT_OBJECT_FOCUS := 0x8005; + EVENT_OBJECT_SELECTION := 0x8006;EVENT_OBJECT_SELECTIONADD := 0x8007;EVENT_OBJECT_SELECTIONREMOVE := 0x8008; + EVENT_OBJECT_SELECTIONWITHIN := 0x8009;EVENT_OBJECT_STATECHANGE := 0x800A;EVENT_OBJECT_LOCATIONCHANGE := 0x800B; + EVENT_OBJECT_NAMECHANGE := 0x800C;EVENT_OBJECT_DESCRIPTIONCHANGE := 0x800D;EVENT_OBJECT_VALUECHANGE := 0x800E; + EVENT_OBJECT_PARENTCHANGE := 0x800F;EVENT_OBJECT_HELPCHANGE := 0x8010;EVENT_OBJECT_DEFACTIONCHANGE := 0x8011; + EVENT_OBJECT_ACCELERATORCHANGE := 0x8012;EVENT_OBJECT_INVOKED := 0x8013;EVENT_OBJECT_TEXTSELECTIONCHANGED := 0x8014; + EVENT_OBJECT_CONTENTSCROLLED := 0x8015;EVENT_SYSTEM_ARRANGMENTPREVIEW := 0x8016;EVENT_OBJECT_CLOAKED := 0x8017; + EVENT_OBJECT_UNCLOAKED := 0x8018;EVENT_OBJECT_LIVEREGIONCHANGED := 0x8019;EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED := 0x8020; + EVENT_OBJECT_DRAGSTART := 0x8021;EVENT_OBJECT_DRAGCANCEL := 0x8022;EVENT_OBJECT_DRAGCOMPLETE := 0x8023; + EVENT_OBJECT_DRAGENTER := 0x8024;EVENT_OBJECT_DRAGLEAVE := 0x8025;EVENT_OBJECT_DRAGDROPPED := 0x8026; + EVENT_OBJECT_IME_SHOW := 0x8027;EVENT_OBJECT_IME_HIDE := 0x8028;EVENT_OBJECT_IME_CHANGE := 0x8029; + EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED := 0x8030;EVENT_OBJECT_END := 0x80FF;EVENT_AIA_START := 0xA000; + EVENT_AIA_END := 0xAFFF;SOUND_SYSTEM_STARTUP := 0x1;SOUND_SYSTEM_SHUTDOWN := 0x2; + SOUND_SYSTEM_BEEP := 0x3;SOUND_SYSTEM_ERROR := 0x4;SOUND_SYSTEM_QUESTION := 0x5; + SOUND_SYSTEM_WARNING := 0x6;SOUND_SYSTEM_INFORMATION := 0x7;SOUND_SYSTEM_MAXIMIZE := 0x8; + SOUND_SYSTEM_MINIMIZE := 0x9;SOUND_SYSTEM_RESTOREUP := 0xA;SOUND_SYSTEM_RESTOREDOWN := 0xB; + SOUND_SYSTEM_APPSTART := 0xC;SOUND_SYSTEM_FAULT := 0xD;SOUND_SYSTEM_APPEND := 0xE; + SOUND_SYSTEM_MENUCOMMAND := 0xF;SOUND_SYSTEM_MENUPOPUP := 0x10;CSOUND_SYSTEM := 0x10; + ALERT_SYSTEM_INFORMATIONAL := 0x1;ALERT_SYSTEM_WARNING := 0x2;ALERT_SYSTEM_ERROR := 0x3; + ALERT_SYSTEM_QUERY := 0x4;ALERT_SYSTEM_CRITICAL := 0x5;CALERT_SYSTEM := 0x6; + GUI_CARETBLINKING := 0x1;GUI_INMOVESIZE := 0x2;GUI_INMENUMODE := 0x4; + GUI_SYSTEMMENUMODE := 0x8;GUI_POPUPMENUMODE := 0x10;GUI_16BITTASK := 0x0; + USER_DEFAULT_SCREEN_DPI := 0x60;GETWINDOWMODULEFILENAME := 0x0;STATE_SYSTEM_UNAVAILABLE := 0x1; + STATE_SYSTEM_SELECTED := 0x2;STATE_SYSTEM_FOCUSED := 0x4;STATE_SYSTEM_PRESSED := 0x8; + STATE_SYSTEM_CHECKED := 0x10;STATE_SYSTEM_MIXED := 0x20;STATE_SYSTEM_INDETERMINATE := 0x20; + STATE_SYSTEM_READONLY := 0x40;STATE_SYSTEM_HOTTRACKED := 0x80;STATE_SYSTEM_DEFAULT := 0x100; + STATE_SYSTEM_EXPANDED := 0x200;STATE_SYSTEM_COLLAPSED := 0x400;STATE_SYSTEM_BUSY := 0x800; + STATE_SYSTEM_FLOATING := 0x1000;STATE_SYSTEM_MARQUEED := 0x2000;STATE_SYSTEM_ANIMATED := 0x4000; + STATE_SYSTEM_INVISIBLE := 0x8000;STATE_SYSTEM_OFFSCREEN := 0x10000;STATE_SYSTEM_SIZEABLE := 0x20000; + STATE_SYSTEM_MOVEABLE := 0x40000;STATE_SYSTEM_SELFVOICING := 0x80000;STATE_SYSTEM_FOCUSABLE := 0x100000; + STATE_SYSTEM_SELECTABLE := 0x200000;STATE_SYSTEM_LINKED := 0x400000;STATE_SYSTEM_TRAVERSED := 0x800000; + STATE_SYSTEM_MULTISELECTABLE := 0x1000000;STATE_SYSTEM_EXTSELECTABLE := 0x2000000;STATE_SYSTEM_ALERT_LOW := 0x4000000; + STATE_SYSTEM_ALERT_MEDIUM := 0x8000000;STATE_SYSTEM_ALERT_HIGH := 0x10000000;STATE_SYSTEM_PROTECTED := 0x20000000; + STATE_SYSTEM_VALID := 0x3FFFFFFF;CCHILDREN_TITLEBAR := 0x5;CCHILDREN_SCROLLBAR := 0x5; + CURSOR_SHOWING := 0x1;CURSOR_SUPPRESSED := 0x2;WS_ACTIVECAPTION := 0x1; + GA_PARENT := 0x1;GA_ROOT := 0x2;GA_ROOTOWNER := 0x3; + REALGETWINDOWCLASS := 0x0;GETALTTABINFO := 0x0;RIM_INPUT := 0x0; + RIM_INPUTSINK := 0x1;RIM_TYPEMOUSE := 0x0;RIM_TYPEKEYBOARD := 0x1; + RIM_TYPEHID := 0x2;RI_MOUSE_LEFT_BUTTON_DOWN := 0x1;RI_MOUSE_LEFT_BUTTON_UP := 0x2; + RI_MOUSE_RIGHT_BUTTON_DOWN := 0x4;RI_MOUSE_RIGHT_BUTTON_UP := 0x8;RI_MOUSE_MIDDLE_BUTTON_DOWN := 0x10; + RI_MOUSE_MIDDLE_BUTTON_UP := 0x20;RI_MOUSE_BUTTON_1_DOWN := 0x1;RI_MOUSE_BUTTON_1_UP := 0x2; + RI_MOUSE_BUTTON_2_DOWN := 0x4;RI_MOUSE_BUTTON_2_UP := 0x8;RI_MOUSE_BUTTON_3_DOWN := 0x10; + RI_MOUSE_BUTTON_3_UP := 0x20;RI_MOUSE_BUTTON_4_DOWN := 0x40;RI_MOUSE_BUTTON_4_UP := 0x80; + RI_MOUSE_BUTTON_5_DOWN := 0x100;RI_MOUSE_BUTTON_5_UP := 0x200;RI_MOUSE_WHEEL := 0x400; + MOUSE_MOVE_RELATIVE := 0x0;MOUSE_MOVE_ABSOLUTE := 0x1;MOUSE_VIRTUAL_DESKTOP := 0x2; + MOUSE_ATTRIBUTES_CHANGED := 0x4;MOUSE_MOVE_NOCOALESCE := 0x8;KEYBOARD_OVERRUN_MAKE_CODE := 0xFF; + RI_KEY_MAKE := 0x0;RI_KEY_BREAK := 0x1;RI_KEY_E0 := 0x2; + RI_KEY_E1 := 0x4;RI_KEY_TERMSRV_SET_LED := 0x8;RI_KEY_TERMSRV_SHADOW := 0x10; + RID_INPUT := 0x10000003;RID_HEADER := 0x10000005;RIDI_PREPARSEDDATA := 0x20000005; + RIDI_DEVICENAME := 0x20000007;RIDI_DEVICEINFO := 0x2000000B;GETRAWINPUTDEVICEINFO := 0x0; + RIDEV_REMOVE := 0x1;RIDEV_EXCLUDE := 0x10;RIDEV_PAGEONLY := 0x20; + RIDEV_NOLEGACY := 0x30;RIDEV_INPUTSINK := 0x100;RIDEV_CAPTUREMOUSE := 0x200; + RIDEV_NOHOTKEYS := 0x200;RIDEV_APPKEYS := 0x400;RIDEV_EXINPUTSINK := 0x1000; + RIDEV_DEVNOTIFY := 0x2000;RIDEV_EXMODEMASK := 0xF0;GIDC_ARRIVAL := 0x1; + GIDC_REMOVAL := 0x2;POINTER_DEVICE_PRODUCT_STRING_MAX := 0x208;PDC_ARRIVAL := 0x1; + PDC_REMOVAL := 0x2;PDC_ORIENTATION_0 := 0x4;PDC_ORIENTATION_90 := 0x8; + PDC_ORIENTATION_180 := 0x10;PDC_ORIENTATION_270 := 0x20;PDC_MODE_DEFAULT := 0x40; + PDC_MODE_CENTERED := 0x80;PDC_MAPPING_CHANGE := 0x100;PDC_RESOLUTION := 0x200; + PDC_ORIGIN := 0x400;PDC_MODE_ASPECTRATIOPRESERVED := 0x800;MSGFLT_ADD := 0x1; + MSGFLT_REMOVE := 0x2;MSGFLTINFO_NONE := 0x0;MSGFLTINFO_ALREADYALLOWED_FORWND := 0x1; + MSGFLTINFO_ALREADYDISALLOWED_FORWND := 0x2;MSGFLTINFO_ALLOWED_HIGHER := 0x3;MSGFLT_RESET := 0x0; + MSGFLT_ALLOW := 0x1;MSGFLT_DISALLOW := 0x2;GF_BEGIN := 0x1; + GF_INERTIA := 0x2;GF_END := 0x4;GID_BEGIN := 0x1; + GID_END := 0x2;GID_ZOOM := 0x3;GID_PAN := 0x4; + GID_ROTATE := 0x5;GID_TWOFINGERTAP := 0x6;GID_PRESSANDTAP := 0x7; + GID_ROLLOVER := 0x7;GC_ALLGESTURES := 0x1;GC_ZOOM := 0x1; + GC_PAN := 0x1;GC_PAN_WITH_SINGLE_FINGER_VERTICALLY := 0x2;GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY := 0x4; + GC_PAN_WITH_GUTTER := 0x8;GC_PAN_WITH_INERTIA := 0x10;GC_ROTATE := 0x1; + GC_TWOFINGERTAP := 0x1;GC_PRESSANDTAP := 0x1;GC_ROLLOVER := 0x1; + GESTURECONFIGMAXCOUNT := 0x100;GCF_INCLUDE_ANCESTORS := 0x1;NID_INTEGRATED_TOUCH := 0x1; + NID_EXTERNAL_TOUCH := 0x2;NID_INTEGRATED_PEN := 0x4;NID_EXTERNAL_PEN := 0x8; + NID_MULTI_INPUT := 0x40;NID_READY := 0x80;MAX_STR_BLOCKREASON := 0x100; + end +end + +type _commdlg_=class(_winuserdef_ ) + static WINCOMMDLGAPI;static DUMMYUNIONNAME;static OFN_READONLY; + static OFN_OVERWRITEPROMPT;static OFN_HIDEREADONLY;static OFN_NOCHANGEDIR; + static OFN_SHOWHELP;static OFN_ENABLEHOOK;static OFN_ENABLETEMPLATE; + static OFN_ENABLETEMPLATEHANDLE;static OFN_NOVALIDATE;static OFN_ALLOWMULTISELECT; + static OFN_EXTENSIONDIFFERENT;static OFN_PATHMUSTEXIST;static OFN_FILEMUSTEXIST; + static OFN_CREATEPROMPT;static OFN_SHAREAWARE;static OFN_NOREADONLYRETURN; + static OFN_NOTESTFILECREATE;static OFN_NONETWORKBUTTON;static OFN_NOLONGNAMES; + static OFN_EXPLORER;static OFN_NODEREFERENCELINKS;static OFN_LONGNAMES; + static OFN_ENABLEINCLUDENOTIFY;static OFN_ENABLESIZING;static OFN_DONTADDTORECENT; + static OFN_FORCESHOWHIDDEN;static OFN_EX_NOPLACESBAR;static OFN_SHAREFALLTHROUGH; + static OFN_SHARENOWARN;static OFN_SHAREWARN;static CDN_FIRST; + static CDN_LAST;static CDN_INITDONE;static CDN_SELCHANGE; + static CDN_FOLDERCHANGE;static CDN_SHAREVIOLATION;static CDN_HELP; + static CDN_FILEOK;static CDN_TYPECHANGE;static CDN_INCLUDEITEM; + static CDM_FIRST;static CDM_LAST;static CDM_GETSPEC; + static CDM_GETFILEPATH;static CDM_GETFOLDERPATH;static CDM_GETFOLDERIDLIST; + static CDM_SETCONTROLTEXT;static CDM_HIDECONTROL;static CDM_SETDEFEXT; + static CC_RGBINIT;static CC_FULLOPEN;static CC_PREVENTFULLOPEN; + static CC_SHOWHELP;static CC_ENABLEHOOK;static CC_ENABLETEMPLATE; + static CC_ENABLETEMPLATEHANDLE;static CC_SOLIDCOLOR;static CC_ANYCOLOR; + static FR_DOWN;static FR_WHOLEWORD;static FR_MATCHCASE; + static FR_FINDNEXT;static FR_REPLACE;static FR_REPLACEALL; + static FR_DIALOGTERM;static FR_SHOWHELP;static FR_ENABLEHOOK; + static FR_ENABLETEMPLATE;static FR_NOUPDOWN;static FR_NOMATCHCASE; + static FR_NOWHOLEWORD;static FR_ENABLETEMPLATEHANDLE;static FR_HIDEUPDOWN; + static FR_HIDEMATCHCASE;static FR_HIDEWHOLEWORD;static FR_RAW; + static FR_MATCHDIAC;static FR_MATCHKASHIDA;static FR_MATCHALEFHAMZA; + static CF_SCREENFONTS;static CF_PRINTERFONTS;static CF_BOTH; + static CF_SHOWHELP;static CF_ENABLEHOOK;static CF_ENABLETEMPLATE; + static CF_ENABLETEMPLATEHANDLE;static CF_INITTOLOGFONTSTRUCT;static CF_USESTYLE; + static CF_EFFECTS;static CF_APPLY;static CF_ANSIONLY; + static CF_SCRIPTSONLY;static CF_NOVECTORFONTS;static CF_NOOEMFONTS; + static CF_NOSIMULATIONS;static CF_LIMITSIZE;static CF_FIXEDPITCHONLY; + static CF_WYSIWYG;static CF_FORCEFONTEXIST;static CF_SCALABLEONLY; + static CF_TTONLY;static CF_NOFACESEL;static CF_NOSTYLESEL; + static CF_NOSIZESEL;static CF_SELECTSCRIPT;static CF_NOSCRIPTSEL; + static CF_NOVERTFONTS;static CF_INACTIVEFONTS;static SIMULATED_FONTTYPE; + static PRINTER_FONTTYPE;static SCREEN_FONTTYPE;static BOLD_FONTTYPE; + static ITALIC_FONTTYPE;static REGULAR_FONTTYPE;static PS_OPENTYPE_FONTTYPE; + static TT_OPENTYPE_FONTTYPE;static TYPE1_FONTTYPE;static SYMBOL_FONTTYPE; + static WM_CHOOSEFONT_GETLOGFONT;static WM_CHOOSEFONT_SETLOGFONT;static WM_CHOOSEFONT_SETFLAGS; + static LBSELCHSTRINGA;static SHAREVISTRINGA;static FILEOKSTRINGA; + static COLOROKSTRINGA;static SETRGBSTRINGA;static HELPMSGSTRINGA; + static FINDMSGSTRINGA;static LBSELCHSTRINGW;static SHAREVISTRINGW; + static FILEOKSTRINGW;static COLOROKSTRINGW;static SETRGBSTRINGW; + static HELPMSGSTRINGW;static FINDMSGSTRINGW;static LBSELCHSTRING; + static SHAREVISTRING;static FILEOKSTRING;static COLOROKSTRING; + static SETRGBSTRING;static HELPMSGSTRING;static FINDMSGSTRING; + static CD_LBSELNOITEMS;static CD_LBSELCHANGE;static CD_LBSELSUB; + static CD_LBSELADD;static PD_ALLPAGES;static PD_SELECTION; + static PD_PAGENUMS;static PD_NOSELECTION;static PD_NOPAGENUMS; + static PD_COLLATE;static PD_PRINTTOFILE;static PD_PRINTSETUP; + static PD_NOWARNING;static PD_RETURNDC;static PD_RETURNIC; + static PD_RETURNDEFAULT;static PD_SHOWHELP;static PD_ENABLEPRINTHOOK; + static PD_ENABLESETUPHOOK;static PD_ENABLEPRINTTEMPLATE;static PD_ENABLESETUPTEMPLATE; + static PD_ENABLEPRINTTEMPLATEHANDLE;static PD_ENABLESETUPTEMPLATEHANDLE;static PD_USEDEVMODECOPIES; + static PD_USEDEVMODECOPIESANDCOLLATE;static PD_DISABLEPRINTTOFILE;static PD_HIDEPRINTTOFILE; + static PD_NONETWORKBUTTON;static PD_CURRENTPAGE;static PD_NOCURRENTPAGE; + static PD_EXCLUSIONFLAGS;static PD_USELARGETEMPLATE;static PD_EXCL_COPIESANDCOLLATE; + static START_PAGE_GENERAL;static PD_RESULT_CANCEL;static PD_RESULT_PRINT; + static PD_RESULT_APPLY;static DN_DEFAULTPRN;static WM_PSD_PAGESETUPDLG; + static WM_PSD_FULLPAGERECT;static WM_PSD_MINMARGINRECT;static WM_PSD_MARGINRECT; + static WM_PSD_GREEKTEXTRECT;static WM_PSD_ENVSTAMPRECT;static WM_PSD_YAFULLPAGERECT; + static PSD_DEFAULTMINMARGINS;static PSD_INWININIINTLMEASURE;static PSD_MINMARGINS; + static PSD_MARGINS;static PSD_INTHOUSANDTHSOFINCHES;static PSD_INHUNDREDTHSOFMILLIMETERS; + static PSD_DISABLEMARGINS;static PSD_DISABLEPRINTER;static PSD_NOWARNING; + static PSD_DISABLEORIENTATION;static PSD_RETURNDEFAULT;static PSD_DISABLEPAPER; + static PSD_SHOWHELP;static PSD_ENABLEPAGESETUPHOOK;static PSD_ENABLEPAGESETUPTEMPLATE; + static PSD_ENABLEPAGESETUPTEMPLATEHANDLE;static PSD_ENABLEPAGEPAINTHOOK;static PSD_DISABLEPAGEPAINTING; + static PSD_NONETWORKBUTTON; + class function sinit(); + begin + class(_winuserdef_).sinit(); + WINCOMMDLGAPI := 0x0;DUMMYUNIONNAME := 0x0;OFN_READONLY := 0x1; + OFN_OVERWRITEPROMPT := 0x2;OFN_HIDEREADONLY := 0x4;OFN_NOCHANGEDIR := 0x8; + OFN_SHOWHELP := 0x10;OFN_ENABLEHOOK := 0x20;OFN_ENABLETEMPLATE := 0x40; + OFN_ENABLETEMPLATEHANDLE := 0x80;OFN_NOVALIDATE := 0x100;OFN_ALLOWMULTISELECT := 0x200; + OFN_EXTENSIONDIFFERENT := 0x400;OFN_PATHMUSTEXIST := 0x800;OFN_FILEMUSTEXIST := 0x1000; + OFN_CREATEPROMPT := 0x2000;OFN_SHAREAWARE := 0x4000;OFN_NOREADONLYRETURN := 0x8000; + OFN_NOTESTFILECREATE := 0x10000;OFN_NONETWORKBUTTON := 0x20000;OFN_NOLONGNAMES := 0x40000; + OFN_EXPLORER := 0x80000;OFN_NODEREFERENCELINKS := 0x100000;OFN_LONGNAMES := 0x200000; + OFN_ENABLEINCLUDENOTIFY := 0x400000;OFN_ENABLESIZING := 0x800000;OFN_DONTADDTORECENT := 0x2000000; + OFN_FORCESHOWHIDDEN := 0x10000000;OFN_EX_NOPLACESBAR := 0x1;OFN_SHAREFALLTHROUGH := 0x2; + OFN_SHARENOWARN := 0x1;OFN_SHAREWARN := 0x0;CDN_FIRST := 0xFFFFFDA7; + CDN_LAST := 0xFFFFFD45;CDN_INITDONE := 0xFFFFFDA7;CDN_SELCHANGE := 0xFFFFFDA6; + CDN_FOLDERCHANGE := 0xFFFFFDA5;CDN_SHAREVIOLATION := 0xFFFFFDA4;CDN_HELP := 0xFFFFFDA3; + CDN_FILEOK := 0xFFFFFDA2;CDN_TYPECHANGE := 0xFFFFFDA1;CDN_INCLUDEITEM := 0xFFFFFDA0; + CDM_FIRST := 0x464;CDM_LAST := 0x4C8;CDM_GETSPEC := 0x464; + CDM_GETFILEPATH := 0x465;CDM_GETFOLDERPATH := 0x466;CDM_GETFOLDERIDLIST := 0x467; + CDM_SETCONTROLTEXT := 0x468;CDM_HIDECONTROL := 0x469;CDM_SETDEFEXT := 0x46A; + CC_RGBINIT := 0x1;CC_FULLOPEN := 0x2;CC_PREVENTFULLOPEN := 0x4; + CC_SHOWHELP := 0x8;CC_ENABLEHOOK := 0x10;CC_ENABLETEMPLATE := 0x20; + CC_ENABLETEMPLATEHANDLE := 0x40;CC_SOLIDCOLOR := 0x80;CC_ANYCOLOR := 0x100; + FR_DOWN := 0x1;FR_WHOLEWORD := 0x2;FR_MATCHCASE := 0x4; + FR_FINDNEXT := 0x8;FR_REPLACE := 0x10;FR_REPLACEALL := 0x20; + FR_DIALOGTERM := 0x40;FR_SHOWHELP := 0x80;FR_ENABLEHOOK := 0x100; + FR_ENABLETEMPLATE := 0x200;FR_NOUPDOWN := 0x400;FR_NOMATCHCASE := 0x800; + FR_NOWHOLEWORD := 0x1000;FR_ENABLETEMPLATEHANDLE := 0x2000;FR_HIDEUPDOWN := 0x4000; + FR_HIDEMATCHCASE := 0x8000;FR_HIDEWHOLEWORD := 0x10000;FR_RAW := 0x20000; + FR_MATCHDIAC := 0x20000000;FR_MATCHKASHIDA := 0x40000000;FR_MATCHALEFHAMZA := 0x80000000; + CF_SCREENFONTS := 0x1;CF_PRINTERFONTS := 0x2;CF_BOTH := 0x3; + CF_SHOWHELP := 0x4;CF_ENABLEHOOK := 0x8;CF_ENABLETEMPLATE := 0x10; + CF_ENABLETEMPLATEHANDLE := 0x20;CF_INITTOLOGFONTSTRUCT := 0x40;CF_USESTYLE := 0x80; + CF_EFFECTS := 0x100;CF_APPLY := 0x200;CF_ANSIONLY := 0x400; + CF_SCRIPTSONLY := 0x400;CF_NOVECTORFONTS := 0x800;CF_NOOEMFONTS := 0x800; + CF_NOSIMULATIONS := 0x1000;CF_LIMITSIZE := 0x2000;CF_FIXEDPITCHONLY := 0x4000; + CF_WYSIWYG := 0x8000;CF_FORCEFONTEXIST := 0x10000;CF_SCALABLEONLY := 0x20000; + CF_TTONLY := 0x40000;CF_NOFACESEL := 0x80000;CF_NOSTYLESEL := 0x100000; + CF_NOSIZESEL := 0x200000;CF_SELECTSCRIPT := 0x400000;CF_NOSCRIPTSEL := 0x800000; + CF_NOVERTFONTS := 0x1000000;CF_INACTIVEFONTS := 0x2000000;SIMULATED_FONTTYPE := 0x8000; + PRINTER_FONTTYPE := 0x4000;SCREEN_FONTTYPE := 0x2000;BOLD_FONTTYPE := 0x100; + ITALIC_FONTTYPE := 0x200;REGULAR_FONTTYPE := 0x400;PS_OPENTYPE_FONTTYPE := 0x10000; + TT_OPENTYPE_FONTTYPE := 0x20000;TYPE1_FONTTYPE := 0x40000;SYMBOL_FONTTYPE := 0x80000; + WM_CHOOSEFONT_GETLOGFONT := 0x401;WM_CHOOSEFONT_SETLOGFONT := 0x465;WM_CHOOSEFONT_SETFLAGS := 0x466; + LBSELCHSTRINGA := "commdlg_LBSelChangedNotify";SHAREVISTRINGA := "commdlg_ShareViolation";FILEOKSTRINGA := "commdlg_FileNameOK"; + COLOROKSTRINGA := "commdlg_ColorOK";SETRGBSTRINGA := "commdlg_SetRGBColor";HELPMSGSTRINGA := "commdlg_help"; + FINDMSGSTRINGA := "commdlg_FindReplace";LBSELCHSTRINGW := NIL;SHAREVISTRINGW := NIL; + FILEOKSTRINGW := NIL;COLOROKSTRINGW := NIL;SETRGBSTRINGW := NIL; + HELPMSGSTRINGW := NIL;FINDMSGSTRINGW := NIL;LBSELCHSTRING := "commdlg_LBSelChangedNotify"; + SHAREVISTRING := "commdlg_ShareViolation";FILEOKSTRING := "commdlg_FileNameOK";COLOROKSTRING := "commdlg_ColorOK"; + SETRGBSTRING := "commdlg_SetRGBColor";HELPMSGSTRING := "commdlg_help";FINDMSGSTRING := "commdlg_FindReplace"; + CD_LBSELNOITEMS := 0xFFFFFFFF;CD_LBSELCHANGE := 0x0;CD_LBSELSUB := 0x1; + CD_LBSELADD := 0x2;PD_ALLPAGES := 0x0;PD_SELECTION := 0x1; + PD_PAGENUMS := 0x2;PD_NOSELECTION := 0x4;PD_NOPAGENUMS := 0x8; + PD_COLLATE := 0x10;PD_PRINTTOFILE := 0x20;PD_PRINTSETUP := 0x40; + PD_NOWARNING := 0x80;PD_RETURNDC := 0x100;PD_RETURNIC := 0x200; + PD_RETURNDEFAULT := 0x400;PD_SHOWHELP := 0x800;PD_ENABLEPRINTHOOK := 0x1000; + PD_ENABLESETUPHOOK := 0x2000;PD_ENABLEPRINTTEMPLATE := 0x4000;PD_ENABLESETUPTEMPLATE := 0x8000; + PD_ENABLEPRINTTEMPLATEHANDLE := 0x10000;PD_ENABLESETUPTEMPLATEHANDLE := 0x20000;PD_USEDEVMODECOPIES := 0x40000; + PD_USEDEVMODECOPIESANDCOLLATE := 0x40000;PD_DISABLEPRINTTOFILE := 0x80000;PD_HIDEPRINTTOFILE := 0x100000; + PD_NONETWORKBUTTON := 0x200000;PD_CURRENTPAGE := 0x400000;PD_NOCURRENTPAGE := 0x800000; + PD_EXCLUSIONFLAGS := 0x1000000;PD_USELARGETEMPLATE := 0x10000000;PD_EXCL_COPIESANDCOLLATE := 0x0; + START_PAGE_GENERAL := 0xFFFFFFFF;PD_RESULT_CANCEL := 0x0;PD_RESULT_PRINT := 0x1; + PD_RESULT_APPLY := 0x2;DN_DEFAULTPRN := 0x1;WM_PSD_PAGESETUPDLG := 0x400; + WM_PSD_FULLPAGERECT := 0x401;WM_PSD_MINMARGINRECT := 0x402;WM_PSD_MARGINRECT := 0x403; + WM_PSD_GREEKTEXTRECT := 0x404;WM_PSD_ENVSTAMPRECT := 0x405;WM_PSD_YAFULLPAGERECT := 0x406; + PSD_DEFAULTMINMARGINS := 0x0;PSD_INWININIINTLMEASURE := 0x0;PSD_MINMARGINS := 0x1; + PSD_MARGINS := 0x2;PSD_INTHOUSANDTHSOFINCHES := 0x4;PSD_INHUNDREDTHSOFMILLIMETERS := 0x8; + PSD_DISABLEMARGINS := 0x10;PSD_DISABLEPRINTER := 0x20;PSD_NOWARNING := 0x80; + PSD_DISABLEORIENTATION := 0x100;PSD_RETURNDEFAULT := 0x400;PSD_DISABLEPAPER := 0x200; + PSD_SHOWHELP := 0x800;PSD_ENABLEPAGESETUPHOOK := 0x2000;PSD_ENABLEPAGESETUPTEMPLATE := 0x8000; + PSD_ENABLEPAGESETUPTEMPLATEHANDLE := 0x20000;PSD_ENABLEPAGEPAINTHOOK := 0x40000;PSD_DISABLEPAGEPAINTING := 0x80000; + PSD_NONETWORKBUTTON := 0x200000; + end +end + +type _commctrldef_=class(_socketdef_,_gdi_h_,_commdlg_) + static WINCOMMCTRLAPI;static DUMMYUNIONNAME;static DUMMYUNIONNAME2; + static DUMMYUNIONNAME3;static DUMMYUNIONNAME4;static DUMMYUNIONNAME5; + static ICC_LISTVIEW_CLASSES;static ICC_TREEVIEW_CLASSES;static ICC_BAR_CLASSES; + static ICC_TAB_CLASSES;static ICC_UPDOWN_CLASS;static ICC_PROGRESS_CLASS; + static ICC_HOTKEY_CLASS;static ICC_ANIMATE_CLASS;static ICC_WIN95_CLASSES; + static ICC_DATE_CLASSES;static ICC_USEREX_CLASSES;static ICC_COOL_CLASSES; + static ICC_INTERNET_CLASSES;static ICC_PAGESCROLLER_CLASS;static ICC_NATIVEFNTCTL_CLASS; + static ICC_STANDARD_CLASSES;static ICC_LINK_CLASS;static ODT_HEADER; + static ODT_TAB;static ODT_LISTVIEW;static LVM_FIRST; + static TV_FIRST;static HDM_FIRST;static TCM_FIRST; + static PGM_FIRST;static ECM_FIRST;static BCM_FIRST; + static CBM_FIRST;static CCM_FIRST;static CCM_LAST; + static CCM_SETBKCOLOR;static CCM_SETCOLORSCHEME;static CCM_GETCOLORSCHEME; + static CCM_GETDROPTARGET;static CCM_SETUNICODEFORMAT;static CCM_GETUNICODEFORMAT; + static COMCTL32_VERSION;static CCM_SETVERSION;static CCM_GETVERSION; + static CCM_SETNOTIFYWINDOW;static CCM_SETWINDOWTHEME;static CCM_DPISCALE; + static INFOTIPSIZE;static NM_OUTOFMEMORY;static NM_CLICK; + static NM_DBLCLK;static NM_RETURN;static NM_RCLICK; + static NM_RDBLCLK;static NM_SETFOCUS;static NM_KILLFOCUS; + static NM_CUSTOMDRAW;static NM_HOVER;static NM_NCHITTEST; + static NM_KEYDOWN;static NM_RELEASEDCAPTURE;static NM_SETCURSOR; + static NM_CHAR;static NM_TOOLTIPSCREATED;static NM_LDOWN; + static NM_RDOWN;static NM_THEMECHANGED;static NM_FONTCHANGED; + static NM_CUSTOMTEXT;static NM_TVSTATEIMAGECHANGING;static NM_FIRST; + static NM_LAST;static LVN_FIRST;static LVN_LAST; + static HDN_FIRST;static HDN_LAST;static TVN_FIRST; + static TVN_LAST;static TTN_FIRST;static TTN_LAST; + static TCN_FIRST;static TCN_LAST;static CDN_FIRST; + static CDN_LAST;static TBN_FIRST;static TBN_LAST; + static UDN_FIRST;static UDN_LAST;static DTN_FIRST; + static DTN_LAST;static MCN_FIRST;static MCN_LAST; + static DTN_FIRST2;static DTN_LAST2;static CBEN_FIRST; + static CBEN_LAST;static RBN_FIRST;static RBN_LAST; + static IPN_FIRST;static IPN_LAST;static SBN_FIRST; + static SBN_LAST;static PGN_FIRST;static PGN_LAST; + static WMN_FIRST;static WMN_LAST;static BCN_FIRST; + static BCN_LAST;static TRBN_FIRST;static TRBN_LAST; + static MSGF_COMMCTRL_BEGINDRAG;static MSGF_COMMCTRL_SIZEHEADER;static MSGF_COMMCTRL_DRAGSELECT; + static MSGF_COMMCTRL_TOOLBARCUST;static CDRF_DODEFAULT;static CDRF_NEWFONT; + static CDRF_SKIPDEFAULT;static CDRF_DOERASE;static CDRF_SKIPPOSTPAINT; + static CDRF_NOTIFYPOSTPAINT;static CDRF_NOTIFYITEMDRAW;static CDRF_NOTIFYSUBITEMDRAW; + static CDRF_NOTIFYPOSTERASE;static CDDS_PREPAINT;static CDDS_POSTPAINT; + static CDDS_PREERASE;static CDDS_POSTERASE;static CDDS_ITEM; + static CDDS_ITEMPREPAINT;static CDDS_ITEMPOSTPAINT;static CDDS_ITEMPREERASE; + static CDDS_ITEMPOSTERASE;static CDDS_SUBITEM;static CDIS_SELECTED; + static CDIS_GRAYED;static CDIS_DISABLED;static CDIS_CHECKED; + static CDIS_FOCUS;static CDIS_DEFAULT;static CDIS_HOT; + static CDIS_MARKED;static CDIS_INDETERMINATE;static CDIS_SHOWKEYBOARDCUES; + static CDIS_NEARHOT;static CDIS_OTHERSIDEHOT;static CDIS_DROPHILITED; + static NM_GETCUSTOMSPLITRECT;static CLR_NONE;static CLR_DEFAULT; + static ILC_MASK;static ILC_COLOR;static ILC_COLORDDB; + static ILC_COLOR4;static ILC_COLOR8;static ILC_COLOR16; + static ILC_COLOR24;static ILC_COLOR32;static ILC_PALETTE; + static ILC_MIRROR;static ILC_PERITEMMIRROR;static ILC_ORIGINALSIZE; + static ILC_HIGHQUALITYSCALE;static ILD_NORMAL;static ILD_TRANSPARENT; + static ILD_MASK;static ILD_IMAGE;static ILD_ROP; + static ILD_BLEND25;static ILD_BLEND50;static ILD_OVERLAYMASK; + static ILD_PRESERVEALPHA;static ILD_SCALE;static ILD_DPISCALE; + static ILD_ASYNC;static ILD_SELECTED;static ILD_FOCUS; + static ILD_BLEND;static CLR_HILIGHT;static ILS_NORMAL; + static ILS_GLOW;static ILS_SHADOW;static ILS_SATURATE; + static ILS_ALPHA;static ILGT_NORMAL;static ILGT_ASYNC; + static HBITMAP_CALLBACK;static IMAGELIST_LOADIMAGE;static ILCF_MOVE; + static ILCF_SWAP;static ILP_NORMAL;static ILP_DOWNLEVEL; + static WC_HEADERA;static WC_HEADERW;static WC_HEADER; + static HDS_HORZ;static HDS_BUTTONS;static HDS_HOTTRACK; + static HDS_HIDDEN;static HDS_DRAGDROP;static HDS_FULLDRAG; + static HDS_FILTERBAR;static HDS_FLAT;static HDS_CHECKBOXES; + static HDS_NOSIZING;static HDS_OVERFLOW;static HDFT_ISSTRING; + static HDFT_ISNUMBER;static HDFT_ISDATE;static HDFT_HASNOVALUE; + static HD_TEXTFILTER;static HDTEXTFILTER;static LPHD_TEXTFILTER; + static LPHDTEXTFILTER;static HD_ITEMA;static HD_ITEMW; + static HD_ITEM;static HDITEM;static LPHDITEM; + static HDITEM_V1_SIZE;static HDI_WIDTH;static HDI_HEIGHT; + static HDI_TEXT;static HDI_FORMAT;static HDI_LPARAM; + static HDI_BITMAP;static HDI_IMAGE;static HDI_DI_SETITEM; + static HDI_ORDER;static HDI_FILTER;static HDI_STATE; + static HDF_LEFT;static HDF_RIGHT;static HDF_CENTER; + static HDF_JUSTIFYMASK;static HDF_RTLREADING;static HDF_BITMAP; + static HDF_STRING;static HDF_OWNERDRAW;static HDF_IMAGE; + static HDF_BITMAP_ON_RIGHT;static HDF_SORTUP;static HDF_SORTDOWN; + static HDF_CHECKBOX;static HDF_CHECKED;static HDF_FIXEDWIDTH; + static HDF_SPLITBUTTON;static HDIS_FOCUSED;static HDM_GETITEMCOUNT; + static HDM_INSERTITEMA;static HDM_INSERTITEMW;static HDM_INSERTITEM; + static HDM_DELETEITEM;static HDM_GETITEMA;static HDM_GETITEMW; + static HDM_GETITEM;static HDM_SETITEMA;static HDM_SETITEMW; + static HDM_SETITEM;static HD_LAYOUT;static HDM_LAYOUT; + static HHT_NOWHERE;static HHT_ONHEADER;static HHT_ONDIVIDER; + static HHT_ONDIVOPEN;static HHT_ONFILTER;static HHT_ONFILTERBUTTON; + static HHT_ABOVE;static HHT_BELOW;static HHT_TORIGHT; + static HHT_TOLEFT;static HHT_ONITEMSTATEICON;static HHT_ONDROPDOWN; + static HHT_ONOVERFLOW;static HD_HITTESTINFO;static HDSIL_NORMAL; + static HDSIL_STATE;static HDM_HITTEST;static HDM_GETITEMRECT; + static HDM_SETIMAGELIST;static HDM_GETIMAGELIST;static HDM_ORDERTOINDEX; + static HDM_CREATEDRAGIMAGE;static HDM_GETORDERARRAY;static HDM_SETORDERARRAY; + static HDM_SETHOTDIVIDER;static HDM_SETBITMAPMARGIN;static HDM_GETBITMAPMARGIN; + static HDM_SETUNICODEFORMAT;static HDM_GETUNICODEFORMAT;static HDM_SETFILTERCHANGETIMEOUT; + static HDM_EDITFILTER;static HDM_CLEARFILTER;static HDM_TRANSLATEACCELERATOR; + static HDM_GETITEMDROPDOWNRECT;static HDM_GETOVERFLOWRECT;static HDM_GETFOCUSEDITEM; + static HDM_SETFOCUSEDITEM;static HDN_ITEMCHANGINGA;static HDN_ITEMCHANGINGW; + static HDN_ITEMCHANGEDA;static HDN_ITEMCHANGEDW;static HDN_ITEMCLICKA; + static HDN_ITEMCLICKW;static HDN_ITEMDBLCLICKA;static HDN_ITEMDBLCLICKW; + static HDN_DIVIDERDBLCLICKA;static HDN_DIVIDERDBLCLICKW;static HDN_BEGINTRACKA; + static HDN_BEGINTRACKW;static HDN_ENDTRACKA;static HDN_ENDTRACKW; + static HDN_TRACKA;static HDN_TRACKW;static HDN_GETDISPINFOA; + static HDN_GETDISPINFOW;static HDN_BEGINDRAG;static HDN_ENDDRAG; + static HDN_FILTERCHANGE;static HDN_FILTERBTNCLICK;static HDN_BEGINFILTEREDIT; + static HDN_ENDFILTEREDIT;static HDN_ITEMSTATEICONCLICK;static HDN_ITEMKEYDOWN; + static HDN_DROPDOWN;static HDN_OVERFLOWCLICK;static HDN_ITEMCHANGING; + static HDN_ITEMCHANGED;static HDN_ITEMCLICK;static HDN_ITEMDBLCLICK; + static HDN_DIVIDERDBLCLICK;static HDN_BEGINTRACK;static HDN_ENDTRACK; + static HDN_TRACK;static HDN_GETDISPINFO;static HD_NOTIFYA; + static HD_NOTIFYW;static HD_NOTIFY;static NMHEADER; + static LPNMHEADER;static NMHDDISPINFO;static LPNMHDDISPINFO; + static TOOLBARCLASSNAMEW;static TOOLBARCLASSNAMEA;static TOOLBARCLASSNAME; + static CMB_MASKED;static TBSTATE_CHECKED;static TBSTATE_PRESSED; + static TBSTATE_ENABLED;static TBSTATE_HIDDEN;static TBSTATE_INDETERMINATE; + static TBSTATE_WRAP;static TBSTATE_ELLIPSES;static TBSTATE_MARKED; + static TBSTYLE_BUTTON;static TBSTYLE_SEP;static TBSTYLE_CHECK; + static TBSTYLE_GROUP;static TBSTYLE_CHECKGROUP;static TBSTYLE_DROPDOWN; + static TBSTYLE_AUTOSIZE;static TBSTYLE_NOPREFIX;static TBSTYLE_TOOLTIPS; + static TBSTYLE_WRAPABLE;static TBSTYLE_ALTDRAG;static TBSTYLE_FLAT; + static TBSTYLE_LIST;static TBSTYLE_CUSTOMERASE;static TBSTYLE_REGISTERDROP; + static TBSTYLE_TRANSPARENT;static TBSTYLE_EX_DRAWDDARROWS;static BTNS_BUTTON; + static BTNS_SEP;static BTNS_CHECK;static BTNS_GROUP; + static BTNS_CHECKGROUP;static BTNS_DROPDOWN;static BTNS_AUTOSIZE; + static BTNS_NOPREFIX;static BTNS_SHOWTEXT;static BTNS_WHOLEDROPDOWN; + static TBSTYLE_EX_MIXEDBUTTONS;static TBSTYLE_EX_HIDECLIPPEDBUTTONS;static TBSTYLE_EX_MULTICOLUMN; + static TBSTYLE_EX_VERTICAL;static TBSTYLE_EX_DOUBLEBUFFER;static TBCDRF_NOEDGES; + static TBCDRF_HILITEHOTTRACK;static TBCDRF_NOOFFSET;static TBCDRF_NOMARK; + static TBCDRF_NOETCHEDEFFECT;static TBCDRF_BLENDICON;static TBCDRF_NOBACKGROUND; + static TBCDRF_USECDCOLORS;static TB_ENABLEBUTTON;static TB_CHECKBUTTON; + static TB_PRESSBUTTON;static TB_HIDEBUTTON;static TB_INDETERMINATE; + static TB_MARKBUTTON;static TB_ISBUTTONENABLED;static TB_ISBUTTONCHECKED; + static TB_ISBUTTONPRESSED;static TB_ISBUTTONHIDDEN;static TB_ISBUTTONINDETERMINATE; + static TB_ISBUTTONHIGHLIGHTED;static TB_SETSTATE;static TB_GETSTATE; + static TB_ADDBITMAP;static HINST_COMMCTRL;static IDB_STD_SMALL_COLOR; + static IDB_STD_LARGE_COLOR;static IDB_VIEW_SMALL_COLOR;static IDB_VIEW_LARGE_COLOR; + static IDB_HIST_SMALL_COLOR;static IDB_HIST_LARGE_COLOR;static IDB_HIST_NORMAL; + static IDB_HIST_HOT;static IDB_HIST_DISABLED;static IDB_HIST_PRESSED; + static STD_CUT;static STD_COPY;static STD_PASTE; + static STD_UNDO;static STD_REDOW;static STD_DELETE; + static STD_FILENEW;static STD_FILEOPEN;static STD_FILESAVE; + static STD_PRINTPRE;static STD_PROPERTIES;static STD_HELP; + static STD_FIND;static STD_REPLACE;static STD_PRINT; + static VIEW_LARGEICONS;static VIEW_SMALLICONS;static VIEW_LIST; + static VIEW_DETAILS;static VIEW_SORTNAME;static VIEW_SORTSIZE; + static VIEW_SORTDATE;static VIEW_SORTTYPE;static VIEW_PARENTFOLDER; + static VIEW_NETCONNECT;static VIEW_NETDISCONNECT;static VIEW_NEWFOLDER; + static VIEW_VIEWMENU;static HIST_BACK;static HIST_FORWARD; + static HIST_FAVORITES;static HIST_ADDTOFAVORITES;static HIST_VIEWTREE; + static TB_ADDBUTTONSA;static TB_INSERTBUTTONA;static TB_DELETEBUTTON; + static TB_GETBUTTON;static TB_BUTTONCOUNT;static TB_COMMANDTOINDEX; + static TBSAVEPARAMS;static LPTBSAVEPARAMS;static TB_SAVERESTOREA; + static TB_SAVERESTOREW;static TB_CUSTOMIZE;static TB_ADDSTRINGA; + static TB_ADDSTRINGW;static TB_GETITEMRECT;static TB_BUTTONSTRUCTSIZE; + static TB_SETBUTTONSIZE;static TB_SETBITMAPSIZE;static TB_AUTOSIZE; + static TB_GETTOOLTIPS;static TB_SETTOOLTIPS;static TB_SETPARENT; + static TB_SETROWS;static TB_GETROWS;static TB_SETCMDID; + static TB_CHANGEBITMAP;static TB_GETBITMAP;static TB_GETBUTTONTEXTA; + static TB_GETBUTTONTEXTW;static TB_REPLACEBITMAP;static TB_SETINDENT; + static TB_SETIMAGELIST;static TB_GETIMAGELIST;static TB_LOADIMAGES; + static TB_GETRECT;static TB_SETHOTIMAGELIST;static TB_GETHOTIMAGELIST; + static TB_SETDISABLEDIMAGELIST;static TB_GETDISABLEDIMAGELIST;static TB_SETSTYLE; + static TB_GETSTYLE;static TB_GETBUTTONSIZE;static TB_SETBUTTONWIDTH; + static TB_SETMAXTEXTROWS;static TB_GETTEXTROWS;static TB_GETBUTTONTEXT; + static TB_SAVERESTORE;static TB_ADDSTRING;static TB_GETOBJECT; + static TB_GETHOTITEM;static TB_SETHOTITEM;static TB_SETANCHORHIGHLIGHT; + static TB_GETANCHORHIGHLIGHT;static TB_MAPACCELERATORA;static TBIMHT_AFTER; + static TBIMHT_BACKGROUND;static TB_GETINSERTMARK;static TB_SETINSERTMARK; + static TB_INSERTMARKHITTEST;static TB_MOVEBUTTON;static TB_GETMAXSIZE; + static TB_SETEXTENDEDSTYLE;static TB_GETEXTENDEDSTYLE;static TB_GETPADDING; + static TB_SETPADDING;static TB_SETINSERTMARKCOLOR;static TB_GETINSERTMARKCOLOR; + static TB_SETCOLORSCHEME;static TB_GETCOLORSCHEME;static TB_SETUNICODEFORMAT; + static TB_GETUNICODEFORMAT;static TB_MAPACCELERATORW;static TB_MAPACCELERATOR; + static TBBF_LARGE;static TB_GETBITMAPFLAGS;static TBIF_IMAGE; + static TBIF_TEXT;static TBIF_STATE;static TBIF_STYLE; + static TBIF_LPARAM;static TBIF_COMMAND;static TBIF_SIZE; + static TBIF_BYINDEX;static TBBUTTONINFO;static LPTBBUTTONINFO; + static TB_GETBUTTONINFOW;static TB_SETBUTTONINFOW;static TB_GETBUTTONINFOA; + static TB_SETBUTTONINFOA;static TB_GETBUTTONINFO;static TB_SETBUTTONINFO; + static TB_INSERTBUTTONW;static TB_ADDBUTTONSW;static TB_HITTEST; + static TB_INSERTBUTTON;static TB_ADDBUTTONS;static TB_SETDRAWTEXTFLAGS; + static TB_GETSTRINGW;static TB_GETSTRINGA;static TB_GETSTRING; + static TB_SETBOUNDINGSIZE;static TB_SETHOTITEM2;static TB_HASACCELERATOR; + static TB_SETLISTGAP;static TB_GETIMAGELISTCOUNT;static TB_GETIDEALSIZE; + static TB_TRANSLATEACCELERATOR;static TBMF_PAD;static TBMF_BARPAD; + static TBMF_BUTTONSPACING;static TB_GETMETRICS;static TB_SETMETRICS; + static TB_GETITEMDROPDOWNRECT;static TB_SETPRESSEDIMAGELIST;static TB_GETPRESSEDIMAGELIST; + static TB_SETWINDOWTHEME;static TBN_GETBUTTONINFOA;static TBN_BEGINDRAG; + static TBN_ENDDRAG;static TBN_BEGINADJUST;static TBN_ENDADJUST; + static TBN_RESET;static TBN_QUERYINSERT;static TBN_QUERYDELETE; + static TBN_TOOLBARCHANGE;static TBN_CUSTHELP;static TBN_DROPDOWN; + static TBN_GETOBJECT;static HICF_OTHER;static HICF_MOUSE; + static HICF_ARROWKEYS;static HICF_ACCELERATOR;static HICF_DUPACCEL; + static HICF_ENTERING;static HICF_LEAVING;static HICF_RESELECT; + static HICF_LMOUSE;static HICF_TOGGLEDROPDOWN;static TBN_HOTITEMCHANGE; + static TBN_DRAGOUT;static TBN_DELETINGBUTTON;static TBN_GETDISPINFOA; + static TBN_GETDISPINFOW;static TBN_GETINFOTIPA;static TBN_GETINFOTIPW; + static TBN_GETBUTTONINFOW;static TBN_RESTORE;static TBN_SAVE; + static TBN_INITCUSTOMIZE;static TBNRF_HIDEHELP;static TBNRF_ENDCUSTOMIZE; + static TBN_WRAPHOTITEM;static TBN_DUPACCELERATOR;static TBN_WRAPACCELERATOR; + static TBN_DRAGOVER;static TBN_MAPACCELERATOR;static TBN_GETINFOTIP; + static NMTBGETINFOTIP;static LPNMTBGETINFOTIP;static TBNF_IMAGE; + static TBNF_TEXT;static TBNF_DI_SETITEM;static TBN_GETDISPINFO; + static NMTBDISPINFO;static LPNMTBDISPINFO;static TBDDRET_DEFAULT; + static TBDDRET_NODEFAULT;static TBDDRET_TREATPRESSED;static TBN_GETBUTTONINFO; + static TBNOTIFYA;static TBNOTIFYW;static LPTBNOTIFYA; + static LPTBNOTIFYW;static TBNOTIFY;static LPTBNOTIFY; + static NMTOOLBAR;static LPNMTOOLBAR;static REBARCLASSNAMEW; + static REBARCLASSNAMEA;static REBARCLASSNAME;static RBIM_IMAGELIST; + static RBS_TOOLTIPS;static RBS_VARHEIGHT;static RBS_BANDBORDERS; + static RBS_FIXEDORDER;static RBS_REGISTERDROP;static RBS_AUTOSIZE; + static RBS_VERTICALGRIPPER;static RBS_DBLCLKTOGGLE;static RBBS_BREAK; + static RBBS_FIXEDSIZE;static RBBS_CHILDEDGE;static RBBS_HIDDEN; + static RBBS_NOVERT;static RBBS_FIXEDBMP;static RBBS_VARIABLEHEIGHT; + static RBBS_GRIPPERALWAYS;static RBBS_NOGRIPPER;static RBBS_USECHEVRON; + static RBBS_HIDETITLE;static RBBS_TOPALIGN;static RBBIM_STYLE; + static RBBIM_COLORS;static RBBIM_TEXT;static RBBIM_IMAGE; + static RBBIM_CHILD;static RBBIM_CHILDSIZE;static RBBIM_SIZE; + static RBBIM_BACKGROUND;static RBBIM_ID;static RBBIM_IDEALSIZE; + static RBBIM_LPARAM;static RBBIM_HEADERSIZE;static RBBIM_CHEVRONLOCATION; + static RBBIM_CHEVRONSTATE;static REBARBANDINFO;static LPREBARBANDINFO; + static LPCREBARBANDINFO;static REBARBANDINFO_V3_SIZE;static REBARBANDINFO_V6_SIZE; + static RB_INSERTBANDA;static RB_DELETEBAND;static RB_GETBARINFO; + static RB_SETBARINFO;static RB_SETBANDINFOA;static RB_SETPARENT; + static RB_HITTEST;static RB_GETRECT;static RB_INSERTBANDW; + static RB_SETBANDINFOW;static RB_GETBANDCOUNT;static RB_GETROWCOUNT; + static RB_GETROWHEIGHT;static RB_IDTOINDEX;static RB_GETTOOLTIPS; + static RB_SETTOOLTIPS;static RB_SETBKCOLOR;static RB_GETBKCOLOR; + static RB_SETTEXTCOLOR;static RB_GETTEXTCOLOR;static RBSTR_CHANGERECT; + static RB_SIZETORECT;static RB_SETCOLORSCHEME;static RB_GETCOLORSCHEME; + static RB_INSERTBAND;static RB_SETBANDINFO;static RB_BEGINDRAG; + static RB_ENDDRAG;static RB_DRAGMOVE;static RB_GETBARHEIGHT; + static RB_GETBANDINFOW;static RB_GETBANDINFOA;static RB_GETBANDINFO; + static RB_MINIMIZEBAND;static RB_MAXIMIZEBAND;static RB_GETDROPTARGET; + static RB_GETBANDBORDERS;static RB_SHOWBAND;static RB_SETPALETTE; + static RB_GETPALETTE;static RB_MOVEBAND;static RB_SETUNICODEFORMAT; + static RB_GETUNICODEFORMAT;static RB_GETBANDMARGINS;static RB_SETWINDOWTHEME; + static RB_SETEXTENDEDSTYLE;static RB_GETEXTENDEDSTYLE;static RB_PUSHCHEVRON; + static RB_SETBANDWIDTH;static RBN_HEIGHTCHANGE;static RBN_GETOBJECT; + static RBN_LAYOUTCHANGED;static RBN_AUTOSIZE;static RBN_BEGINDRAG; + static RBN_ENDDRAG;static RBN_DELETINGBAND;static RBN_DELETEDBAND; + static RBN_CHILDSIZE;static RBN_CHEVRONPUSHED;static RBN_SPLITTERDRAG; + static RBN_MINMAX;static RBN_AUTOBREAK;static RBNM_ID; + static RBNM_STYLE;static RBNM_LPARAM;static RBAB_AUTOSIZE; + static RBAB_ADDBAND;static RBHT_NOWHERE;static RBHT_CAPTION; + static RBHT_CLIENT;static RBHT_GRABBER;static RBHT_CHEVRON; + static RBHT_SPLITTER;static TOOLTIPS_CLASSW;static TOOLTIPS_CLASSA; + static TOOLTIPS_CLASS;static LPTOOLINFOA;static LPTOOLINFOW; + static TOOLINFOA;static TOOLINFOW;static LPTOOLINFO; + static TOOLINFO;static PTOOLINFO;static TTTOOLINFO; + static LPTTTOOLINFO;static TTTOOLINFO_V1_SIZE;static TTS_ALWAYSTIP; + static TTS_NOPREFIX;static TTS_NOANIMATE;static TTS_NOFADE; + static TTS_BALLOON;static TTS_CLOSE;static TTS_USEVISUALSTYLE; + static TTF_IDISHWND;static TTF_CENTERTIP;static TTF_RTLREADING; + static TTF_SUBCLASS;static TTF_TRACK;static TTF_ABSOLUTE; + static TTF_TRANSPARENT;static TTF_PARSELINKS;static TTF_DI_SETITEM; + static TTDT_AUTOMATIC;static TTDT_RESHOW;static TTDT_AUTOPOP; + static TTDT_INITIAL;static TTI_NONE;static TTI_INFO; + static TTI_WARNING;static TTI_ERROR;static TTI_INFO_LARGE; + static TTI_WARNING_LARGE;static TTI_ERROR_LARGE;static TTM_ACTIVATE; + static TTM_SETDELAYTIME;static TTM_ADDTOOLA;static TTM_ADDTOOLW; + static TTM_DELTOOLA;static TTM_DELTOOLW;static TTM_NEWTOOLRECTA; + static TTM_NEWTOOLRECTW;static TTM_RELAYEVENT;static TTM_GETTOOLINFOA; + static TTM_GETTOOLINFOW;static TTM_SETTOOLINFOA;static TTM_SETTOOLINFOW; + static TTM_HITTESTA;static TTM_HITTESTW;static TTM_GETTEXTA; + static TTM_GETTEXTW;static TTM_UPDATETIPTEXTA;static TTM_UPDATETIPTEXTW; + static TTM_GETTOOLCOUNT;static TTM_ENUMTOOLSA;static TTM_ENUMTOOLSW; + static TTM_GETCURRENTTOOLA;static TTM_GETCURRENTTOOLW;static TTM_WINDOWFROMPOINT; + static TTM_TRACKACTIVATE;static TTM_TRACKPOSITION;static TTM_SETTIPBKCOLOR; + static TTM_SETTIPTEXTCOLOR;static TTM_GETDELAYTIME;static TTM_GETTIPBKCOLOR; + static TTM_GETTIPTEXTCOLOR;static TTM_SETMAXTIPWIDTH;static TTM_GETMAXTIPWIDTH; + static TTM_SETMARGIN;static TTM_GETMARGIN;static TTM_POP; + static TTM_UPDATE;static TTM_GETBUBBLESIZE;static TTM_ADJUSTRECT; + static TTM_SETTITLEA;static TTM_SETTITLEW;static TTM_POPUP; + static TTM_GETTITLE;static TTM_ADDTOOL;static TTM_DELTOOL; + static TTM_NEWTOOLRECT;static TTM_GETTOOLINFO;static TTM_SETTOOLINFO; + static TTM_HITTEST;static TTM_GETTEXT;static TTM_UPDATETIPTEXT; + static TTM_ENUMTOOLS;static TTM_GETCURRENTTOOL;static TTM_SETTITLE; + static TTM_SETWINDOWTHEME;static LPHITTESTINFOW;static LPHITTESTINFOA; + static LPHITTESTINFO;static TTHITTESTINFO;static LPTTHITTESTINFO; + static TTN_GETDISPINFOA;static TTN_GETDISPINFOW;static TTN_SHOW; + static TTN_POP;static TTN_LINKCLICK;static TTN_GETDISPINFO; + static TTN_NEEDTEXT;static TTN_NEEDTEXTA;static TTN_NEEDTEXTW; + static TOOLTIPTEXTW;static TOOLTIPTEXTA;static LPTOOLTIPTEXTA; + static LPTOOLTIPTEXTW;static TOOLTIPTEXT;static LPTOOLTIPTEXT; + static NMTTDISPINFO;static LPNMTTDISPINFO;static NMTTDISPINFO_V1_SIZE; + static SBARS_SIZEGRIP;static SBARS_TOOLTIPS;static SBT_TOOLTIPS; + static CREATESTATUSWINDOW;static DRAWSTATUSTEXT;static STATUSCLASSNAMEW; + static STATUSCLASSNAMEA;static STATUSCLASSNAME;static SB_SETTEXTA; + static SB_SETTEXTW;static SB_GETTEXTA;static SB_GETTEXTW; + static SB_GETTEXTLENGTHA;static SB_GETTEXTLENGTHW;static SB_GETTEXT; + static SB_SETTEXT;static SB_GETTEXTLENGTH;static SB_SETTIPTEXT; + static SB_GETTIPTEXT;static SB_SETPARTS;static SB_GETPARTS; + static SB_GETBORDERS;static SB_SETMINHEIGHT;static SB_SIMPLE; + static SB_GETRECT;static SB_ISSIMPLE;static SB_SETICON; + static SB_SETTIPTEXTA;static SB_SETTIPTEXTW;static SB_GETTIPTEXTA; + static SB_GETTIPTEXTW;static SB_GETICON;static SB_SETUNICODEFORMAT; + static SB_GETUNICODEFORMAT;static SBT_OWNERDRAW;static SBT_NOBORDERS; + static SBT_POPOUT;static SBT_RTLREADING;static SBT_NOTABPARSING; + static SB_SETBKCOLOR;static SBN_SIMPLEMODECHANGE;static SB_SIMPLEID; + static MINSYSCOMMAND;static TRACKBAR_CLASSA;static TRACKBAR_CLASSW; + static TRACKBAR_CLASS;static TBS_AUTOTICKS;static TBS_VERT; + static TBS_HORZ;static TBS_TOP;static TBS_BOTTOM; + static TBS_LEFT;static TBS_RIGHT;static TBS_BOTH; + static TBS_NOTICKS;static TBS_ENABLESELRANGE;static TBS_FIXEDLENGTH; + static TBS_NOTHUMB;static TBS_TOOLTIPS;static TBS_REVERSED; + static TBS_DOWNISLEFT;static TBS_NOTIFYBEFOREMOVE;static TBS_TRANSPARENTBKGND; + static TBM_GETPOS;static TBM_GETRANGEMIN;static TBM_GETRANGEMAX; + static TBM_GETTIC;static TBM_SETTIC;static TBM_SETPOS; + static TBM_SETRANGE;static TBM_SETRANGEMIN;static TBM_SETRANGEMAX; + static TBM_CLEARTICS;static TBM_SETSEL;static TBM_SETSELSTART; + static TBM_SETSELEND;static TBM_GETPTICS;static TBM_GETTICPOS; + static TBM_GETNUMTICS;static TBM_GETSELSTART;static TBM_GETSELEND; + static TBM_CLEARSEL;static TBM_SETTICFREQ;static TBM_SETPAGESIZE; + static TBM_GETPAGESIZE;static TBM_SETLINESIZE;static TBM_GETLINESIZE; + static TBM_GETTHUMBRECT;static TBM_GETCHANNELRECT;static TBM_SETTHUMBLENGTH; + static TBM_GETTHUMBLENGTH;static TBM_SETTOOLTIPS;static TBM_GETTOOLTIPS; + static TBM_SETTIPSIDE;static TBTS_TOP;static TBTS_LEFT; + static TBTS_BOTTOM;static TBTS_RIGHT;static TBM_SETBUDDY; + static TBM_GETBUDDY;static TBM_SETPOSNOTIFY;static TBM_SETUNICODEFORMAT; + static TBM_GETUNICODEFORMAT;static TB_LINEUP;static TB_LINEDOWN; + static TB_PAGEUP;static TB_PAGEDOWN;static TB_THUMBPOSITION; + static TB_THUMBTRACK;static TB_TOP;static TB_BOTTOM; + static TB_ENDTRACK;static TBCD_TICS;static TBCD_THUMB; + static TBCD_CHANNEL;static TRBN_THUMBPOSCHANGING;static DL_BEGINDRAG; + static DL_DRAGGING;static DL_DROPPED;static DL_CANCELDRAG; + static DL_CURSORSET;static DL_STOPCURSOR;static DL_COPYCURSOR; + static DL_MOVECURSOR;static UPDOWN_CLASSA;static UPDOWN_CLASSW; + static UPDOWN_CLASS;static UD_MAXVAL;static UD_MINVAL; + static UDS_WRAP;static UDS_SETBUDDYINT;static UDS_ALIGNRIGHT; + static UDS_ALIGNLEFT;static UDS_AUTOBUDDY;static UDS_ARROWKEYS; + static UDS_HORZ;static UDS_NOTHOUSANDS;static UDS_HOTTRACK; + static UDM_SETRANGE;static UDM_GETRANGE;static UDM_SETPOS; + static UDM_GETPOS;static UDM_SETBUDDY;static UDM_GETBUDDY; + static UDM_SETACCEL;static UDM_GETACCEL;static UDM_SETBASE; + static UDM_GETBASE;static UDM_SETRANGE32;static UDM_GETRANGE32; + static UDM_SETUNICODEFORMAT;static UDM_GETUNICODEFORMAT;static UDM_SETPOS32; + static UDM_GETPOS32;static NM_UPDOWN;static LPNM_UPDOWN; + static UDN_DELTAPOS;static PROGRESS_CLASSA;static PROGRESS_CLASSW; + static PROGRESS_CLASS;static PBS_SMOOTH;static PBS_VERTICAL; + static PBM_SETRANGE;static PBM_SETPOS;static PBM_DELTAPOS; + static PBM_SETSTEP;static PBM_STEPIT;static PBM_SETRANGE32; + static PBM_GETRANGE;static PBM_GETPOS;static PBM_SETBARCOLOR; + static PBM_SETBKCOLOR;static PBS_MARQUEE;static PBM_SETMARQUEE; + static PBS_SMOOTHREVERSE;static PBM_GETSTEP;static PBM_GETBKCOLOR; + static PBM_GETBARCOLOR;static PBM_SETSTATE;static PBM_GETSTATE; + static PBST_NORMAL;static PBST_ERROR;static PBST_PAUSED; + static HOTKEYF_SHIFT;static HOTKEYF_CONTROL;static HOTKEYF_ALT; + static HOTKEYF_EXT;static HKCOMB_NONE;static HKCOMB_S; + static HKCOMB_C;static HKCOMB_A;static HKCOMB_SC; + static HKCOMB_SA;static HKCOMB_CA;static HKCOMB_SCA; + static HKM_SETHOTKEY;static HKM_GETHOTKEY;static HKM_SETRULES; + static HOTKEY_CLASSA;static HOTKEY_CLASSW;static HOTKEY_CLASS; + static CCS_TOP;static CCS_NOMOVEY;static CCS_BOTTOM; + static CCS_NORESIZE;static CCS_NOPARENTALIGN;static CCS_ADJUSTABLE; + static CCS_NODIVIDER;static CCS_VERT;static CCS_LEFT; + static CCS_RIGHT;static CCS_NOMOVEX;static INVALID_LINK_INDEX; + static MAX_LINKID_TEXT;static WC_LINK;static LWS_TRANSPARENT; + static LWS_IGNORERETURN;static LWS_NOPREFIX;static LWS_USEVISUALSTYLE; + static LWS_USECUSTOMTEXT;static LWS_RIGHT;static LIF_ITEMINDEX; + static LIF_STATE;static LIF_ITEMID;static LIF_URL; + static LIS_FOCUSED;static LIS_ENABLED;static LIS_VISITED; + static LIS_HOTTRACK;static LIS_DEFAULTCOLORS;static LM_HITTEST; + static LM_GETIDEALHEIGHT;static LM_SETITEM;static LM_GETITEM; + static LM_GETIDEALSIZE;static WC_LISTVIEWA;static WC_LISTVIEWW; + static WC_LISTVIEW;static LVS_ICON;static LVS_REPORT; + static WM_SOCKET;static LVS_SMALLICON;static LVS_LIST; + static LVS_TYPEMASK;static LVS_SINGLESEL;static LVS_SHOWSELALWAYS; + static LVS_SORTASCENDING;static LVS_SORTDESCENDING;static LVS_SHAREIMAGELISTS; + static LVS_NOLABELWRAP;static LVS_AUTOARRANGE;static LVS_EDITLABELS; + static LVS_OWNERDATA;static LVS_NOSCROLL;static LVS_TYPESTYLEMASK; + static LVS_ALIGNTOP;static LVS_ALIGNLEFT;static LVS_ALIGNMASK; + static LVS_OWNERDRAWFIXED;static LVS_NOCOLUMNHEADER;static LVS_NOSORTHEADER; + static LVM_SETUNICODEFORMAT;static LVM_GETUNICODEFORMAT;static LVM_GETBKCOLOR; + static LVM_SETBKCOLOR;static LVM_GETIMAGELIST;static LVSIL_NORMAL; + static LVSIL_SMALL;static LVSIL_STATE;static LVSIL_GROUPHEADER; + static LVM_SETIMAGELIST;static LVM_GETITEMCOUNT;static LVIF_TEXT; + static LVIF_IMAGE;static LVIF_PARAM;static LVIF_STATE; + static LVIF_INDENT;static LVIF_NORECOMPUTE;static LVIF_GROUPID; + static LVIF_COLUMNS;static LVIF_COLFMT;static LVIS_FOCUSED; + static LVIS_SELECTED;static LVIS_CUT;static LVIS_DROPHILITED; + static LVIS_GLOW;static LVIS_ACTIVATING;static LVIS_OVERLAYMASK; + static LVIS_STATEIMAGEMASK;static I_INDENTCALLBACK;static LV_ITEMA; + static LV_ITEMW;static I_GROUPIDCALLBACK;static I_GROUPIDNONE; + static LV_ITEM;static LVITEM_V5_SIZE;static LVITEM; + static LPLVITEM;static LVITEM_V1_SIZE;static LPSTR_TEXTCALLBACKW; + static LPSTR_TEXTCALLBACKA;static LPSTR_TEXTCALLBACK;static I_IMAGECALLBACK; + static I_IMAGENONE;static I_COLUMNSCALLBACK;static LVM_GETITEMA; + static LVM_GETITEMW;static LVM_GETITEM;static LVM_SETITEMA; + static LVM_SETITEMW;static LVM_SETITEM;static LVM_INSERTITEMA; + static LVM_INSERTITEMW;static LVM_INSERTITEM;static LVM_DELETEITEM; + static LVM_DELETEALLITEMS;static LVM_GETCALLBACKMASK;static LVM_SETCALLBACKMASK; + static LVNI_ALL;static LVNI_FOCUSED;static LVNI_SELECTED; + static LVNI_CUT;static LVNI_DROPHILITED;static LVNI_STATEMASK; + static LVNI_VISIBLEORDER;static LVNI_PREVIOUS;static LVNI_VISIBLEONLY; + static LVNI_SAMEGROUPONLY;static LVNI_ABOVE;static LVNI_BELOW; + static LVNI_TOLEFT;static LVNI_TORIGHT;static LVNI_DIRECTIONMASK; + static LVM_GETNEXTITEM;static LVFI_PARAM;static LVFI_STRING; + static LVFI_SUBSTRING;static LVFI_PARTIAL;static LVFI_WRAP; + static LVFI_NEARESTXY;static LV_FINDINFOA;static LV_FINDINFOW; + static LV_FINDINFO;static LVFINDINFO;static LVM_FINDITEMA; + static LVM_FINDITEMW;static LVM_FINDITEM;static LVIR_BOUNDS; + static LVIR_ICON;static LVIR_LABEL;static LVIR_SELECTBOUNDS; + static LVM_GETITEMRECT;static LVM_SETITEMPOSITION;static LVM_GETITEMPOSITION; + static LVM_GETSTRINGWIDTHA;static LVM_GETSTRINGWIDTHW;static LVM_GETSTRINGWIDTH; + static LVHT_NOWHERE;static LVHT_ONITEMICON;static LVHT_ONITEMLABEL; + static LVHT_ONITEMSTATEICON;static LVHT_ONITEM;static LVHT_ABOVE; + static LVHT_BELOW;static LVHT_TORIGHT;static LVHT_TOLEFT; + static LVHT_EX_GROUP_HEADER;static LVHT_EX_GROUP_FOOTER;static LVHT_EX_GROUP_COLLAPSE; + static LVHT_EX_GROUP_BACKGROUND;static LVHT_EX_GROUP_STATEICON;static LVHT_EX_GROUP_SUBSETLINK; + static LVHT_EX_GROUP;static LVHT_EX_ONCONTENTS;static LVHT_EX_FOOTER; + static LV_HITTESTINFO;static LVM_HITTEST;static LVM_ENSUREVISIBLE; + static LVM_SCROLL;static LVM_REDRAWITEMS;static LVA_DEFAULT; + static LVA_ALIGNLEFT;static LVA_ALIGNTOP;static LVA_SNAPTOGRID; + static LVM_ARRANGE;static LVM_EDITLABELA;static LVM_EDITLABELW; + static LVM_EDITLABEL;static LVM_GETEDITCONTROL;static LV_COLUMNA; + static LV_COLUMNW;static LV_COLUMN;static LVCOLUMN; + static LPLVCOLUMN;static LVCOLUMN_V1_SIZE;static LVCF_FMT; + static LVCF_WIDTH;static LVCF_TEXT;static LVCF_SUBITEM; + static LVCF_IMAGE;static LVCF_ORDER;static LVCF_MINWIDTH; + static LVCF_DEFAULTWIDTH;static LVCF_IDEALWIDTH;static LVCFMT_LEFT; + static LVCFMT_RIGHT;static LVCFMT_CENTER;static LVCFMT_JUSTIFYMASK; + static LVCFMT_IMAGE;static LVCFMT_BITMAP_ON_RIGHT;static LVCFMT_COL_HAS_IMAGES; + static LVCFMT_FIXED_WIDTH;static LVCFMT_NO_DPI_SCALE;static LVCFMT_FIXED_RATIO; + static LVCFMT_LINE_BREAK;static LVCFMT_FILL;static LVCFMT_WRAP; + static LVCFMT_NO_TITLE;static LVCFMT_TILE_PLACEMENTMASK;static LVCFMT_SPLITBUTTON; + static LVM_GETCOLUMNA;static LVM_GETCOLUMNW;static LVM_GETCOLUMN; + static LVM_SETCOLUMNA;static LVM_SETCOLUMNW;static LVM_SETCOLUMN; + static LVM_INSERTCOLUMNA;static LVM_INSERTCOLUMNW;static LVM_DELETECOLUMN; + static LVM_GETCOLUMNWIDTH;static LVSCW_AUTOSIZE;static LVSCW_AUTOSIZE_USEHEADER; + static LVM_SETCOLUMNWIDTH;static LVM_GETHEADER;static LVM_CREATEDRAGIMAGE; + static LVM_GETVIEWRECT;static LVM_GETTEXTCOLOR;static LVM_SETTEXTCOLOR; + static LVM_GETTEXTBKCOLOR;static LVM_SETTEXTBKCOLOR;static LVM_GETTOPINDEX; + static LVM_GETCOUNTPERPAGE;static LVM_GETORIGIN;static LVM_UPDATE; + static LVM_SETITEMSTATE;static LVM_GETITEMSTATE;static LVM_GETITEMTEXTA; + static LVM_GETITEMTEXTW;static LVM_GETITEMTEXT;static LVM_SETITEMTEXTA; + static LVM_SETITEMTEXTW;static LVM_SETITEMTEXT;static LVSICF_NOINVALIDATEALL; + static LVSICF_NOSCROLL;static LVM_SETITEMCOUNT;static LVM_SORTITEMS; + static LVM_SETITEMPOSITION32;static LVM_GETSELECTEDCOUNT;static LVM_GETITEMSPACING; + static LVM_GETISEARCHSTRINGA;static LVM_GETISEARCHSTRINGW;static LVM_GETISEARCHSTRING; + static LVM_SETICONSPACING;static LVM_SETEXTENDEDLISTVIEWSTYLE;static LVM_GETEXTENDEDLISTVIEWSTYLE; + static LVS_EX_GRIDLINES;static LVS_EX_SUBITEMIMAGES;static LVS_EX_CHECKBOXES; + static LVS_EX_TRACKSELECT;static LVS_EX_HEADERDRAGDROP;static LVS_EX_FULLROWSELECT; + static LVS_EX_ONECLICKACTIVATE;static LVS_EX_TWOCLICKACTIVATE;static LVS_EX_FLATSB; + static LVS_EX_REGIONAL;static LVS_EX_INFOTIP;static LVS_EX_UNDERLINEHOT; + static LVS_EX_UNDERLINECOLD;static LVS_EX_MULTIWORKAREAS;static LVS_EX_LABELTIP; + static LVS_EX_BORDERSELECT;static LVS_EX_DOUBLEBUFFER;static LVS_EX_HIDELABELS; + static LVS_EX_SINGLEROW;static LVS_EX_SNAPTOGRID;static LVS_EX_SIMPLESELECT; + static LVS_EX_JUSTIFYCOLUMNS;static LVS_EX_TRANSPARENTBKGND;static LVS_EX_TRANSPARENTSHADOWTEXT; + static LVS_EX_AUTOAUTOARRANGE;static LVS_EX_HEADERINALLVIEWS;static LVS_EX_AUTOCHECKSELECT; + static LVS_EX_AUTOSIZECOLUMNS;static LVS_EX_COLUMNSNAPPOINTS;static LVS_EX_COLUMNOVERFLOW; + static LVM_GETSUBITEMRECT;static LVM_SUBITEMHITTEST;static LVM_SETCOLUMNORDERARRAY; + static LVM_GETCOLUMNORDERARRAY;static LVM_SETHOTITEM;static LVM_GETHOTITEM; + static LVM_SETHOTCURSOR;static LVM_GETHOTCURSOR;static LVM_APPROXIMATEVIEWRECT; + static LV_MAX_WORKAREAS;static LVM_SETWORKAREAS;static LVM_GETWORKAREAS; + static LVM_GETNUMBEROFWORKAREAS;static LVM_GETSELECTIONMARK;static LVM_SETSELECTIONMARK; + static LVM_SETHOVERTIME;static LVM_GETHOVERTIME;static LVM_SETTOOLTIPS; + static LVM_GETTOOLTIPS;static LVM_SORTITEMSEX;static LVBKIF_SOURCE_NONE; + static LVBKIF_SOURCE_HBITMAP;static LVBKIF_SOURCE_URL;static LVBKIF_SOURCE_MASK; + static LVBKIF_STYLE_NORMAL;static LVBKIF_STYLE_TILE;static LVBKIF_STYLE_MASK; + static LVBKIF_FLAG_TILEOFFSET;static LVBKIF_TYPE_WATERMARK;static LVBKIF_FLAG_ALPHABLEND; + static LVM_SETBKIMAGEA;static LVM_SETBKIMAGEW;static LVM_GETBKIMAGEA; + static LVM_GETBKIMAGEW;static LVM_SETSELECTEDCOLUMN;static LV_VIEW_ICON; + static LV_VIEW_DETAILS;static LV_VIEW_SMALLICON;static LV_VIEW_LIST; + static LV_VIEW_TILE;static LV_VIEW_MAX;static LVM_SETVIEW; + static LVM_GETVIEW;static LVGF_NONE;static LVGF_HEADER; + static LVGF_FOOTER;static LVGF_STATE;static LVGF_ALIGN; + static LVGF_GROUPID;static LVGF_SUBTITLE;static LVGF_TASK; + static LVGF_DESCRIPTIONTOP;static LVGF_DESCRIPTIONBOTTOM;static LVGF_TITLEIMAGE; + static LVGF_EXTENDEDIMAGE;static LVGF_ITEMS;static LVGF_SUBSET; + static LVGF_SUBSETITEMS;static LVGS_NORMAL;static LVGS_COLLAPSED; + static LVGS_HIDDEN;static LVGS_NOHEADER;static LVGS_COLLAPSIBLE; + static LVGS_FOCUSED;static LVGS_SELECTED;static LVGS_SUBSETED; + static LVGS_SUBSETLINKFOCUSED;static LVGA_HEADER_LEFT;static LVGA_HEADER_CENTER; + static LVGA_HEADER_RIGHT;static LVGA_FOOTER_LEFT;static LVGA_FOOTER_CENTER; + static LVGA_FOOTER_RIGHT;static LVM_INSERTGROUP;static LVM_SETGROUPINFO; + static LVM_GETGROUPINFO;static LVM_REMOVEGROUP;static LVM_MOVEGROUP; + static LVM_GETGROUPCOUNT;static LVM_GETGROUPINFOBYINDEX;static LVM_MOVEITEMTOGROUP; + static LVGGR_GROUP;static LVGGR_HEADER;static LVGGR_LABEL; + static LVGGR_SUBSETLINK;static LVM_GETGROUPRECT;static LVGMF_NONE; + static LVGMF_BORDERSIZE;static LVGMF_BORDERCOLOR;static LVGMF_TEXTCOLOR; + static LVM_SETGROUPMETRICS;static LVM_GETGROUPMETRICS;static LVM_ENABLEGROUPVIEW; + static LVM_SORTGROUPS;static LVM_INSERTGROUPSORTED;static LVM_REMOVEALLGROUPS; + static LVM_HASGROUP;static LVM_GETGROUPSTATE;static LVM_GETFOCUSEDGROUP; + static LVTVIF_AUTOSIZE;static LVTVIF_FIXEDWIDTH;static LVTVIF_FIXEDHEIGHT; + static LVTVIF_FIXEDSIZE;static LVTVIF_EXTENDED;static LVTVIM_TILESIZE; + static LVTVIM_COLUMNS;static LVTVIM_LABELMARGIN;static LVM_SETTILEVIEWINFO; + static LVM_GETTILEVIEWINFO;static LVM_SETTILEINFO;static LVM_GETTILEINFO; + static LVIM_AFTER;static LVM_SETINSERTMARK;static LVM_GETINSERTMARK; + static LVM_INSERTMARKHITTEST;static LVM_GETINSERTMARKRECT;static LVM_SETINSERTMARKCOLOR; + static LVM_GETINSERTMARKCOLOR;static LVM_SETINFOTIP;static LVM_GETSELECTEDCOLUMN; + static LVM_ISGROUPVIEWENABLED;static LVM_GETOUTLINECOLOR;static LVM_SETOUTLINECOLOR; + static LVM_CANCELEDITLABEL;static LVM_MAPINDEXTOID;static LVM_MAPIDTOINDEX; + static LVM_ISITEMVISIBLE;static LVM_GETEMPTYTEXT;static LVM_GETFOOTERRECT; + static LVFF_ITEMCOUNT;static LVM_GETFOOTERINFO;static LVM_GETFOOTERITEMRECT; + static LVFIF_TEXT;static LVFIF_STATE;static LVFIS_FOCUSED; + static LVM_GETFOOTERITEM;static LVM_GETITEMINDEXRECT;static LVM_SETITEMINDEXSTATE; + static LVM_GETNEXTITEMINDEX;static LVBKIMAGE;static LPLVBKIMAGE; + static LVM_SETBKIMAGE;static LVM_GETBKIMAGE;static LPNM_LISTVIEW; + static NM_LISTVIEW;static LVKF_ALT;static LVKF_CONTROL; + static LVKF_SHIFT;static LVCDI_ITEM;static LVCDI_GROUP; + static LVCDI_ITEMSLIST;static LVCDRF_NOSELECT;static LVCDRF_NOGROUPFRAME; + static LPNM_CACHEHINT;static PNM_CACHEHINT;static NM_CACHEHINT; + static PNM_FINDITEMA;static LPNM_FINDITEMA;static NM_FINDITEMA; + static PNM_FINDITEMW;static LPNM_FINDITEMW;static NM_FINDITEMW; + static PNM_FINDITEM;static LPNM_FINDITEM;static NM_FINDITEM; + static NMLVFINDITEM;static LPNMLVFINDITEM;static PNM_ODSTATECHANGE; + static LPNM_ODSTATECHANGE;static NM_ODSTATECHANGE;static LVN_ITEMCHANGING; + static LVN_ITEMCHANGED;static LVN_INSERTITEM;static LVN_DELETEITEM; + static LVN_DELETEALLITEMS;static LVN_BEGINLABELEDITA;static LVN_BEGINLABELEDITW; + static LVN_ENDLABELEDITA;static LVN_ENDLABELEDITW;static LVN_COLUMNCLICK; + static LVN_BEGINDRAG;static LVN_BEGINRDRAG;static LVN_ODCACHEHINT; + static LVN_ODFINDITEMA;static LVN_ODFINDITEMW;static LVN_ITEMACTIVATE; + static LVN_ODSTATECHANGED;static LVN_ODFINDITEM;static LVN_HOTTRACK; + static LVN_GETDISPINFOA;static LVN_GETDISPINFOW;static LVN_SETDISPINFOA; + static LVN_SETDISPINFOW;static LVN_BEGINLABELEDIT;static LVN_ENDLABELEDIT; + static LVN_GETDISPINFO;static LVN_SETDISPINFO;static LVIF_DI_SETITEM; + static LV_DISPINFOA;static LV_DISPINFOW;static LV_DISPINFO; + static NMLVDISPINFO;static LVN_KEYDOWN;static LV_KEYDOWN; + static LVN_MARQUEEBEGIN;static LVGIT_UNFOLDED;static LVN_GETINFOTIPA; + static LVN_GETINFOTIPW;static LVN_GETINFOTIP;static NMLVGETINFOTIP; + static LPNMLVGETINFOTIP;static LVNSCH_DEFAULT;static LVNSCH_ERROR; + static LVNSCH_IGNORE;static LVN_INCREMENTALSEARCHA;static LVN_INCREMENTALSEARCHW; + static LVN_INCREMENTALSEARCH;static LVN_COLUMNDROPDOWN;static LVN_COLUMNOVERFLOWCLICK; + static LVN_BEGINSCROLL;static LVN_ENDSCROLL;static LVN_LINKCLICK; + static EMF_CENTERED;static LVN_GETEMPTYMARKUP;static WC_TREEVIEWA; + static WC_TREEVIEWW;static WC_TREEVIEW;static TVS_HASBUTTONS; + static TVS_HASLINES;static TVS_LINESATROOT;static TVS_EDITLABELS; + static TVS_DISABLEDRAGDROP;static TVS_SHOWSELALWAYS;static TVS_RTLREADING; + static TVS_NOTOOLTIPS;static TVS_CHECKBOXES;static TVS_TRACKSELECT; + static TVS_SINGLEEXPAND;static TVS_INFOTIP;static TVS_FULLROWSELECT; + static TVS_NOSCROLL;static TVS_NONEVENHEIGHT;static TVS_NOHSCROLL; + static TVS_EX_NOSINGLECOLLAPSE;static TVS_EX_MULTISELECT;static TVS_EX_DOUBLEBUFFER; + static TVS_EX_NOINDENTSTATE;static TVS_EX_RICHTOOLTIP;static TVS_EX_AUTOHSCROLL; + static TVS_EX_FADEINOUTEXPANDOS;static TVS_EX_PARTIALCHECKBOXES;static TVS_EX_EXCLUSIONCHECKBOXES; + static TVS_EX_DIMMEDCHECKBOXES;static TVS_EX_DRAWIMAGEASYNC;static TVIF_TEXT; + static TVIF_IMAGE;static TVIF_PARAM;static TVIF_STATE; + static TVIF_HANDLE;static TVIF_SELECTEDIMAGE;static TVIF_CHILDREN; + static TVIF_INTEGRAL;static TVIF_STATEEX;static TVIF_EXPANDEDIMAGE; + static TVIS_SELECTED;static TVIS_CUT;static TVIS_DROPHILITED; + static TVIS_BOLD;static TVIS_EXPANDED;static TVIS_EXPANDEDONCE; + static TVIS_EXPANDPARTIAL;static TVIS_OVERLAYMASK;static TVIS_STATEIMAGEMASK; + static TVIS_USERMASK;static TVIS_EX_FLAT;static TVIS_EX_DISABLED; + static TVIS_EX_ALL;static I_CHILDRENCALLBACK;static I_CHILDRENAUTO; + static LPTV_ITEMW;static LPTV_ITEMA;static TV_ITEMW; + static TV_ITEMA;static LPTV_ITEM;static TV_ITEM; + static TVITEM;static LPTVITEM;static TVI_ROOT; + static TVI_FIRST;static TVI_LAST;static TVI_SORT; + static LPTV_INSERTSTRUCTA;static LPTV_INSERTSTRUCTW;static TV_INSERTSTRUCTA; + static TV_INSERTSTRUCTW;static TV_INSERTSTRUCT;static LPTV_INSERTSTRUCT; + static TVINSERTSTRUCT;static LPTVINSERTSTRUCT;static TVINSERTSTRUCT_V1_SIZE; + static TVM_INSERTITEMA;static TVM_INSERTITEMW;static TVM_INSERTITEM; + static TVM_DELETEITEM;static TVM_EXPAND;static TVE_COLLAPSE; + static TVE_EXPAND;static TVE_TOGGLE;static TVE_EXPANDPARTIAL; + static TVE_COLLAPSERESET;static TVM_GETITEMRECT;static TVM_GETCOUNT; + static TVM_GETINDENT;static TVM_SETINDENT;static TVM_GETIMAGELIST; + static TVSIL_NORMAL;static TVSIL_STATE;static TVM_SETIMAGELIST; + static TVM_GETNEXTITEM;static TVGN_ROOT;static TVGN_NEXT; + static TVGN_PREVIOUS;static TVGN_PARENT;static TVGN_CHILD; + static TVGN_FIRSTVISIBLE;static TVGN_NEXTVISIBLE;static TVGN_PREVIOUSVISIBLE; + static TVGN_DROPHILITE;static TVGN_CARET;static TVGN_LASTVISIBLE; + static TVGN_NEXTSELECTED;static TVSI_NOSINGLEEXPAND;static TVM_SELECTITEM; + static TVM_GETITEMA;static TVM_GETITEMW;static TVM_GETITEM; + static TVM_SETITEMA;static TVM_SETITEMW;static TVM_SETITEM; + static TVM_EDITLABELA;static TVM_EDITLABELW;static TVM_EDITLABEL; + static TVM_GETEDITCONTROL;static TVM_GETVISIBLECOUNT;static TVM_HITTEST; + static LPTV_HITTESTINFO;static TV_HITTESTINFO;static TVHT_NOWHERE; + static TVHT_ONITEMICON;static TVHT_ONITEMLABEL;static TVHT_ONITEM; + static TVHT_ONITEMINDENT;static TVHT_ONITEMBUTTON;static TVHT_ONITEMRIGHT; + static TVHT_ONITEMSTATEICON;static TVHT_ABOVE;static TVHT_BELOW; + static TVHT_TORIGHT;static TVHT_TOLEFT;static TVM_CREATEDRAGIMAGE; + static TVM_SORTCHILDREN;static TVM_ENSUREVISIBLE;static TVM_SORTCHILDRENCB; + static TVM_ENDEDITLABELNOW;static TVM_GETISEARCHSTRINGA;static TVM_GETISEARCHSTRINGW; + static TVM_GETISEARCHSTRING;static TVM_SETTOOLTIPS;static TVM_GETTOOLTIPS; + static TVM_SETINSERTMARK;static TVM_SETUNICODEFORMAT;static TVM_GETUNICODEFORMAT; + static TVM_SETITEMHEIGHT;static TVM_GETITEMHEIGHT;static TVM_SETBKCOLOR; + static TVM_SETTEXTCOLOR;static TVM_GETBKCOLOR;static TVM_GETTEXTCOLOR; + static TVM_SETSCROLLTIME;static TVM_GETSCROLLTIME;static TVM_SETINSERTMARKCOLOR; + static TVM_GETINSERTMARKCOLOR;static TVM_SETBORDER;static TVSBF_XBORDER; + static TVSBF_YBORDER;static TVM_GETITEMSTATE;static TVM_SETLINECOLOR; + static TVM_GETLINECOLOR;static TVM_MAPACCIDTOHTREEITEM;static TVM_MAPHTREEITEMTOACCID; + static TVM_SETEXTENDEDSTYLE;static TVM_GETEXTENDEDSTYLE;static TVM_SETAUTOSCROLLINFO; + static TVM_SETHOT;static TVM_GETSELECTEDCOUNT;static TVM_SHOWINFOTIP; + static TVM_GETITEMPARTRECT;static LPTV_SORTCB;static TV_SORTCB; + static LPNM_TREEVIEWA;static LPNM_TREEVIEWW;static NM_TREEVIEWW; + static NM_TREEVIEWA;static LPNM_TREEVIEW;static NM_TREEVIEW; + static NMTREEVIEW;static LPNMTREEVIEW;static TVN_SELCHANGINGA; + static TVN_SELCHANGINGW;static TVN_SELCHANGEDA;static TVN_SELCHANGEDW; + static TVC_UNKNOWN;static TVC_BYMOUSE;static TVC_BYKEYBOARD; + static TVN_GETDISPINFOA;static TVN_GETDISPINFOW;static TVN_SETDISPINFOA; + static TVN_SETDISPINFOW;static TVIF_DI_SETITEM;static TV_DISPINFOA; + static TV_DISPINFOW;static TV_DISPINFO;static NMTVDISPINFO; + static LPNMTVDISPINFO;static NMTVDISPINFOEX;static LPNMTVDISPINFOEX; + static TV_DISPINFOEXA;static TV_DISPINFOEX;static TVN_ITEMEXPANDINGA; + static TVN_ITEMEXPANDINGW;static TVN_ITEMEXPANDEDA;static TVN_ITEMEXPANDEDW; + static TVN_BEGINDRAGA;static TVN_BEGINDRAGW;static TVN_BEGINRDRAGA; + static TVN_BEGINRDRAGW;static TVN_DELETEITEMA;static TVN_DELETEITEMW; + static TVN_BEGINLABELEDITA;static TVN_BEGINLABELEDITW;static TVN_ENDLABELEDITA; + static TVN_ENDLABELEDITW;static TVN_KEYDOWN;static TVN_GETINFOTIPA; + static TVN_GETINFOTIPW;static TVN_SINGLEEXPAND;static TVNRET_DEFAULT; + static TVNRET_SKIPOLD;static TVNRET_SKIPNEW;static TVN_ITEMCHANGINGA; + static TVN_ITEMCHANGINGW;static TVN_ITEMCHANGEDA;static TVN_ITEMCHANGEDW; + static TVN_ASYNCDRAW;static TV_KEYDOWN;static TVN_SELCHANGING; + static TVN_SELCHANGED;static TVN_GETDISPINFO;static TVN_SETDISPINFO; + static TVN_ITEMEXPANDING;static TVN_ITEMEXPANDED;static TVN_BEGINDRAG; + static TVN_BEGINRDRAG;static TVN_DELETEITEM;static TVN_BEGINLABELEDIT; + static TVN_ENDLABELEDIT;static TVN_GETINFOTIP;static NMTVGETINFOTIP; + static LPNMTVGETINFOTIP;static TVCDRF_NOIMAGES;static TVN_ITEMCHANGING; + static TVN_ITEMCHANGED;static WC_COMBOBOXEXW;static WC_COMBOBOXEXA; + static WC_COMBOBOXEX;static CBEIF_TEXT;static CBEIF_IMAGE; + static CBEIF_SELECTEDIMAGE;static CBEIF_OVERLAY;static CBEIF_INDENT; + static CBEIF_LPARAM;static CBEIF_DI_SETITEM;static COMBOBOXEXITEM; + static PCOMBOBOXEXITEM;static PCCOMBOBOXEXITEM;static CBEM_INSERTITEMA; + static CBEM_SETIMAGELIST;static CBEM_GETIMAGELIST;static CBEM_GETITEMA; + static CBEM_SETITEMA;static CBEM_DELETEITEM;static CBEM_GETCOMBOCONTROL; + static CBEM_GETEDITCONTROL;static CBEM_SETEXSTYLE;static CBEM_SETEXTENDEDSTYLE; + static CBEM_GETEXSTYLE;static CBEM_GETEXTENDEDSTYLE;static CBEM_SETUNICODEFORMAT; + static CBEM_GETUNICODEFORMAT;static CBEM_HASEDITCHANGED;static CBEM_INSERTITEMW; + static CBEM_SETITEMW;static CBEM_GETITEMW;static CBEM_INSERTITEM; + static CBEM_SETITEM;static CBEM_GETITEM;static CBEM_SETWINDOWTHEME; + static CBES_EX_NOEDITIMAGE;static CBES_EX_NOEDITIMAGEINDENT;static CBES_EX_PATHWORDBREAKPROC; + static CBES_EX_NOSIZELIMIT;static CBES_EX_CASESENSITIVE;static CBES_EX_TEXTENDELLIPSIS; + static NMCOMBOBOXEX;static PNMCOMBOBOXEX;static CBEN_GETDISPINFO; + static CBEN_GETDISPINFOA;static CBEN_INSERTITEM;static CBEN_DELETEITEM; + static CBEN_BEGINEDIT;static CBEN_ENDEDITA;static CBEN_ENDEDITW; + static CBEN_GETDISPINFOW;static CBEN_DRAGBEGINA;static CBEN_DRAGBEGINW; + static CBEN_DRAGBEGIN;static CBEN_ENDEDIT;static CBENF_KILLFOCUS; + static CBENF_RETURN;static CBENF_ESCAPE;static CBENF_DROPDOWN; + static CBEMAXSTRLEN;static NMCBEDRAGBEGIN;static LPNMCBEDRAGBEGIN; + static PNMCBEDRAGBEGIN;static NMCBEENDEDIT;static LPNMCBEENDEDIT; + static PNMCBEENDEDIT;static WC_TABCONTROLA;static WC_TABCONTROLW; + static WC_TABCONTROL;static TCS_SCROLLOPPOSITE;static TCS_BOTTOM; + static TCS_RIGHT;static TCS_MULTISELECT;static TCS_FLATBUTTONS; + static TCS_FORCEICONLEFT;static TCS_FORCELABELLEFT;static TCS_HOTTRACK; + static TCS_VERTICAL;static TCS_TABS;static TCS_BUTTONS; + static TCS_SINGLELINE;static TCS_MULTILINE;static TCS_RIGHTJUSTIFY; + static TCS_FIXEDWIDTH;static TCS_RAGGEDRIGHT;static TCS_FOCUSONBUTTONDOWN; + static TCS_OWNERDRAWFIXED;static TCS_TOOLTIPS;static TCS_FOCUSNEVER; + static TCS_EX_FLATSEPARATORS;static TCS_EX_REGISTERDROP;static TCM_GETIMAGELIST; + static TCM_SETIMAGELIST;static TCM_GETITEMCOUNT;static TCIF_TEXT; + static TCIF_IMAGE;static TCIF_RTLREADING;static TCIF_PARAM; + static TCIF_STATE;static TCIS_BUTTONPRESSED;static TCIS_HIGHLIGHTED; + static TC_ITEMHEADERA;static TC_ITEMHEADERW;static TC_ITEMHEADER; + static TCITEMHEADER;static LPTCITEMHEADER;static TC_ITEMA; + static TC_ITEMW;static TC_ITEM;static TCITEM; + static LPTCITEM;static TCM_GETITEMA;static TCM_GETITEMW; + static TCM_GETITEM;static TCM_SETITEMA;static TCM_SETITEMW; + static TCM_SETITEM;static TCM_INSERTITEMA;static TCM_INSERTITEMW; + static TCM_INSERTITEM;static TCM_DELETEITEM;static TCM_DELETEALLITEMS; + static TCM_GETITEMRECT;static TCM_GETCURSEL;static TCM_SETCURSEL; + static TCHT_NOWHERE;static TCHT_ONITEMICON;static TCHT_ONITEMLABEL; + static TCHT_ONITEM;static LPTC_HITTESTINFO;static TC_HITTESTINFO; + static TCM_HITTEST;static TCM_SETITEMEXTRA;static TCM_ADJUSTRECT; + static TCM_SETITEMSIZE;static TCM_REMOVEIMAGE;static TCM_SETPADDING; + static TCM_GETROWCOUNT;static TCM_GETTOOLTIPS;static TCM_SETTOOLTIPS; + static TCM_GETCURFOCUS;static TCM_SETCURFOCUS;static TCM_SETMINTABWIDTH; + static TCM_DESELECTALL;static TCM_HIGHLIGHTITEM;static TCM_SETEXTENDEDSTYLE; + static TCM_GETEXTENDEDSTYLE;static TCM_SETUNICODEFORMAT;static TCM_GETUNICODEFORMAT; + static TCN_KEYDOWN;static TC_KEYDOWN;static TCN_SELCHANGE; + static TCN_SELCHANGING;static TCN_GETOBJECT;static TCN_FOCUSCHANGE; + static ANIMATE_CLASSW;static ANIMATE_CLASSA;static ANIMATE_CLASS; + static ACS_CENTER;static ACS_TRANSPARENT;static ACS_AUTOPLAY; + static ACS_TIMER;static ACM_OPENA;static ACM_OPENW; + static ACM_OPEN;static ACM_PLAY;static ACM_STOP; + static ACM_ISPLAYING;static ACN_START;static ACN_STOP; + static MONTHCAL_CLASSW;static MONTHCAL_CLASSA;static MONTHCAL_CLASS; + static MCM_FIRST;static MCM_GETCURSEL;static MCM_SETCURSEL; + static MCM_GETMAXSELCOUNT;static MCM_SETMAXSELCOUNT;static MCM_GETSELRANGE; + static MCM_SETSELRANGE;static MCM_GETMONTHRANGE;static MCM_SETDAYSTATE; + static MCM_GETMINREQRECT;static MCM_SETCOLOR;static MCM_GETCOLOR; + static MCSC_BACKGROUND;static MCSC_TEXT;static MCSC_TITLEBK; + static MCSC_TITLETEXT;static MCSC_MONTHBK;static MCSC_TRAILINGTEXT; + static MCM_SETTODAY;static MCM_GETTODAY;static MCM_HITTEST; + static MCHT_TITLE;static MCHT_CALENDAR;static MCHT_TODAYLINK; + static MCHT_CALENDARCONTROL;static MCHT_NEXT;static MCHT_PREV; + static MCHT_NOWHERE;static MCHT_TITLEBK;static MCHT_TITLEMONTH; + static MCHT_TITLEYEAR;static MCHT_TITLEBTNNEXT;static MCHT_TITLEBTNPREV; + static MCHT_CALENDARBK;static MCHT_CALENDARDATE;static MCHT_CALENDARDATENEXT; + static MCHT_CALENDARDATEPREV;static MCHT_CALENDARDAY;static MCHT_CALENDARWEEKNUM; + static MCHT_CALENDARDATEMIN;static MCHT_CALENDARDATEMAX;static MCM_SETFIRSTDAYOFWEEK; + static MCM_GETFIRSTDAYOFWEEK;static MCM_GETRANGE;static MCM_SETRANGE; + static MCM_GETMONTHDELTA;static MCM_SETMONTHDELTA;static MCM_GETMAXTODAYWIDTH; + static MCM_SETUNICODEFORMAT;static MCM_GETUNICODEFORMAT;static MCMV_MONTH; + static MCMV_YEAR;static MCMV_DECADE;static MCMV_CENTURY; + static MCMV_MAX;static MCM_GETCURRENTVIEW;static MCM_GETCALENDARCOUNT; + static MCGIP_CALENDARCONTROL;static MCGIP_NEXT;static MCGIP_PREV; + static MCGIP_FOOTER;static MCGIP_CALENDAR;static MCGIP_CALENDARHEADER; + static MCGIP_CALENDARBODY;static MCGIP_CALENDARROW;static MCGIP_CALENDARCELL; + static MCGIF_DATE;static MCGIF_RECT;static MCGIF_NAME; + static MCM_GETCALENDARGRIDINFO;static MCM_GETCALID;static MCM_SETCALID; + static MCM_SIZERECTTOMIN;static MCM_SETCALENDARBORDER;static MCM_GETCALENDARBORDER; + static MCM_SETCURRENTVIEW;static MCN_SELCHANGE;static MCN_GETDAYSTATE; + static MCN_SELECT;static MCN_VIEWCHANGE;static MCS_DAYSTATE; + static MCS_MULTISELECT;static MCS_WEEKNUMBERS;static MCS_NOTODAYCIRCLE; + static MCS_NOTODAY;static MCS_NOTRAILINGDATES;static MCS_SHORTDAYSOFWEEK; + static MCS_NOSELCHANGEONNAV;static GMR_VISIBLE;static GMR_DAYSTATE; + static DATETIMEPICK_CLASSW;static DATETIMEPICK_CLASSA;static DATETIMEPICK_CLASS; + static DTM_FIRST;static DTM_GETSYSTEMTIME;static DTM_SETSYSTEMTIME; + static DTM_GETRANGE;static DTM_SETRANGE;static DTM_SETFORMATA; + static DTM_SETFORMATW;static DTM_SETFORMAT;static DTM_SETMCCOLOR; + static DTM_GETMCCOLOR;static DTM_GETMONTHCAL;static DTM_SETMCFONT; + static DTM_GETMCFONT;static DTM_SETMCSTYLE;static DTM_GETMCSTYLE; + static DTM_CLOSEMONTHCAL;static DTM_GETDATETIMEPICKERINFO;static DTM_GETIDEALSIZE; + static DTS_UPDOWN;static DTS_SHOWNONE;static DTS_SHORTDATEFORMAT; + static DTS_LONGDATEFORMAT;static DTS_SHORTDATECENTURYFORMAT;static DTS_TIMEFORMAT; + static DTS_APPCANPARSE;static DTS_RIGHTALIGN;static DTN_DATETIMECHANGE; + static DTN_USERSTRINGA;static DTN_USERSTRINGW;static DTN_USERSTRING; + static NMDATETIMESTRING;static LPNMDATETIMESTRING;static DTN_WMKEYDOWNA; + static DTN_WMKEYDOWNW;static DTN_WMKEYDOWN;static NMDATETIMEWMKEYDOWN; + static LPNMDATETIMEWMKEYDOWN;static DTN_FORMATA;static DTN_FORMATW; + static DTN_FORMAT;static NMDATETIMEFORMAT;static LPNMDATETIMEFORMAT; + static DTN_FORMATQUERYA;static DTN_FORMATQUERYW;static DTN_FORMATQUERY; + static NMDATETIMEFORMATQUERY;static LPNMDATETIMEFORMATQUERY;static DTN_DROPDOWN; + static DTN_CLOSEUP;static GDTR_MIN;static GDTR_MAX; + static GDT_ERROR;static GDT_VALID;static GDT_NONE; + static IPM_CLEARADDRESS;static IPM_SETADDRESS;static IPM_GETADDRESS; + static IPM_SETRANGE;static IPM_SETFOCUS;static IPM_ISBLANK; + static WC_IPADDRESSW;static WC_IPADDRESSA;static WC_IPADDRESS; + static IPN_FIELDCHANGED;static WC_PAGESCROLLERW;static WC_PAGESCROLLERA; + static WC_PAGESCROLLER;static PGS_VERT;static PGS_HORZ; + static PGS_AUTOSCROLL;static PGS_DRAGNDROP;static PGF_INVISIBLE; + static PGF_NORMAL;static PGF_GRAYED;static PGF_DEPRESSED; + static PGF_HOT;static PGB_TOPORLEFT;static PGB_BOTTOMORRIGHT; + static PGM_SETCHILD;static PGM_RECALCSIZE;static PGM_FORWARDMOUSE; + static PGM_SETBKCOLOR;static PGM_GETBKCOLOR;static PGM_SETBORDER; + static PGM_GETBORDER;static PGM_SETPOS;static PGM_GETPOS; + static PGM_SETBUTTONSIZE;static PGM_GETBUTTONSIZE;static PGM_GETBUTTONSTATE; + static PGM_GETDROPTARGET;static PGM_SETSCROLLINFO;static PGN_SCROLL; + static PGF_SCROLLUP;static PGF_SCROLLDOWN;static PGF_SCROLLLEFT; + static PGF_SCROLLRIGHT;static PGK_SHIFT;static PGK_CONTROL; + static PGK_MENU;static PGN_CALCSIZE;static PGF_CALCWIDTH; + static PGF_CALCHEIGHT;static PGN_HOTITEMCHANGE;static WC_NATIVEFONTCTLW; + static WC_NATIVEFONTCTLA;static WC_NATIVEFONTCTL;static NFS_EDIT; + static NFS_STATIC;static NFS_LISTCOMBO;static NFS_BUTTON; + static NFS_ALL;static NFS_USEFONTASSOC;static WC_BUTTONA; + static WC_BUTTONW;static WC_BUTTON;static BUTTON_IMAGELIST_ALIGN_LEFT; + static BUTTON_IMAGELIST_ALIGN_RIGHT;static BUTTON_IMAGELIST_ALIGN_TOP;static BUTTON_IMAGELIST_ALIGN_BOTTOM; + static BUTTON_IMAGELIST_ALIGN_CENTER;static BCM_GETIDEALSIZE;static BCM_SETIMAGELIST; + static BCM_GETIMAGELIST;static BCM_SETTEXTMARGIN;static BCM_GETTEXTMARGIN; + static BCN_HOTITEMCHANGE;static BST_HOT;static BST_DROPDOWNPUSHED; + static BS_SPLITBUTTON;static BS_DEFSPLITBUTTON;static BS_COMMANDLINK; + static BS_DEFCOMMANDLINK;static BCSIF_GLYPH;static BCSIF_IMAGE; + static BCSIF_STYLE;static BCSIF_SIZE;static BCSS_NOSPLIT; + static BCSS_STRETCH;static BCSS_ALIGNLEFT;static BCSS_IMAGE; + static BCM_SETDROPDOWNSTATE;static BCM_SETSPLITINFO;static BCM_GETSPLITINFO; + static BCM_SETNOTE;static BCM_GETNOTE;static BCM_GETNOTELENGTH; + static BCM_SETSHIELD;static BCCL_NOGLYPH;static BCN_DROPDOWN; + static WC_STATICA;static WC_STATICW;static WC_STATIC; + static WC_EDITA;static WC_EDITW;static WC_EDIT; + static EM_SETCUEBANNER;static EM_GETCUEBANNER;static EM_SHOWBALLOONTIP; + static EM_HIDEBALLOONTIP;static EM_SETHILITE;static EM_GETHILITE; + static EM_NOSETFOCUS;static EM_TAKEFOCUS;static WC_LISTBOXA; + static WC_LISTBOXW;static WC_LISTBOX;static WC_COMBOBOXA; + static WC_COMBOBOXW;static WC_COMBOBOX;static CB_SETMINVISIBLE; + static CB_GETMINVISIBLE;static CB_SETCUEBANNER;static CB_GETCUEBANNER; + static WC_SCROLLBARA;static WC_SCROLLBARW;static WC_SCROLLBAR; + static DA_LAST;static DA_ERR;static DSA_APPEND; + static DSA_ERR;static PFNDSAENUMCALLBACK;static PFNDSAENUMCALLBACKCONST; + static PFNDSACOMPARE;static PFNDSACOMPARECONST;static DPAM_SORTED; + static DPAM_NORMAL;static DPAM_UNION;static DPAM_INTERSECT; + static DPAMM_MERGE;static DPAMM_DELETE;static DPAMM_INSERT; + static DPAS_SORTED;static DPAS_INSERTBEFORE;static DPAS_INSERTAFTER; + static DPA_APPEND;static DPA_ERR;static PFNDPAENUMCALLBACK; + static PFNDPAENUMCALLBACKCONST;static PFNDPACOMPARE;static PFNDPACOMPARECONST; + static WM_MOUSEHOVER;static WM_MOUSELEAVE;static TME_HOVER; + static TME_LEAVE;static TME_NONCLIENT;static TME_QUERY; + static TME_CANCEL;static HOVER_DEFAULT;static WSB_PROP_CYVSCROLL; + static WSB_PROP_CXHSCROLL;static WSB_PROP_CYHSCROLL;static WSB_PROP_CXVSCROLL; + static WSB_PROP_CXHTHUMB;static WSB_PROP_CYVTHUMB;static WSB_PROP_VBKGCOLOR; + static WSB_PROP_HBKGCOLOR;static WSB_PROP_VSTYLE;static WSB_PROP_HSTYLE; + static WSB_PROP_WINSTYLE;static WSB_PROP_PALETTE;static WSB_PROP_MASK; + static FSB_FLAT_MODE;static FSB_ENCARTA_MODE;static FSB_REGULAR_MODE; + static FLATSB_GETSCROLLPROPPTR;static FLATSB_SETSCROLLPROPPTR; + class function sinit(); + begin + class(_socketdef_).sinit();class(_gdi_h_).sinit();class(_commdlg_).sinit(); + WINCOMMCTRLAPI := 0x0;DUMMYUNIONNAME := 0x0;DUMMYUNIONNAME2 := 0x0; + DUMMYUNIONNAME3 := 0x0;DUMMYUNIONNAME4 := 0x0;DUMMYUNIONNAME5 := 0x0; + ICC_LISTVIEW_CLASSES := 0x1;ICC_TREEVIEW_CLASSES := 0x2;ICC_BAR_CLASSES := 0x4; + ICC_TAB_CLASSES := 0x8;ICC_UPDOWN_CLASS := 0x10;ICC_PROGRESS_CLASS := 0x20; + ICC_HOTKEY_CLASS := 0x40;ICC_ANIMATE_CLASS := 0x80;ICC_WIN95_CLASSES := 0xFF; + ICC_DATE_CLASSES := 0x100;ICC_USEREX_CLASSES := 0x200;ICC_COOL_CLASSES := 0x400; + ICC_INTERNET_CLASSES := 0x800;ICC_PAGESCROLLER_CLASS := 0x1000;ICC_NATIVEFNTCTL_CLASS := 0x2000; + ICC_STANDARD_CLASSES := 0x4000;ICC_LINK_CLASS := 0x8000;ODT_HEADER := 0x64; + ODT_TAB := 0x65;ODT_LISTVIEW := 0x66;LVM_FIRST := 0x1000; + TV_FIRST := 0x1100;HDM_FIRST := 0x1200;TCM_FIRST := 0x1300; + PGM_FIRST := 0x1400;ECM_FIRST := 0x1500;BCM_FIRST := 0x1600; + CBM_FIRST := 0x1700;CCM_FIRST := 0x2000;CCM_LAST := 0x2200; + CCM_SETBKCOLOR := 0x2001;CCM_SETCOLORSCHEME := 0x2002;CCM_GETCOLORSCHEME := 0x2003; + CCM_GETDROPTARGET := 0x2004;CCM_SETUNICODEFORMAT := 0x2005;CCM_GETUNICODEFORMAT := 0x2006; + COMCTL32_VERSION := 0x6;CCM_SETVERSION := 0x2007;CCM_GETVERSION := 0x2008; + CCM_SETNOTIFYWINDOW := 0x2009;CCM_SETWINDOWTHEME := 0x200B;CCM_DPISCALE := 0x200C; + INFOTIPSIZE := 0x400;NM_OUTOFMEMORY := 0xFFFFFFFF;NM_CLICK := 0xFFFFFFFE; + NM_DBLCLK := 0xFFFFFFFD;NM_RETURN := 0xFFFFFFFC;NM_RCLICK := 0xFFFFFFFB; + NM_RDBLCLK := 0xFFFFFFFA;NM_SETFOCUS := 0xFFFFFFF9;NM_KILLFOCUS := 0xFFFFFFF8; + NM_CUSTOMDRAW := 0xFFFFFFF4;NM_HOVER := 0xFFFFFFF3;NM_NCHITTEST := 0xFFFFFFF2; + NM_KEYDOWN := 0xFFFFFFF1;NM_RELEASEDCAPTURE := 0xFFFFFFF0;NM_SETCURSOR := 0xFFFFFFEF; + NM_CHAR := 0xFFFFFFEE;NM_TOOLTIPSCREATED := 0xFFFFFFED;NM_LDOWN := 0xFFFFFFEC; + NM_RDOWN := 0xFFFFFFEB;NM_THEMECHANGED := 0xFFFFFFEA;NM_FONTCHANGED := 0xFFFFFFE9; + NM_CUSTOMTEXT := 0xFFFFFFE8;NM_TVSTATEIMAGECHANGING := 0xFFFFFFE8;NM_FIRST := 0x0; + NM_LAST := 0xFFFFFF9D;LVN_FIRST := 0xFFFFFF9C;LVN_LAST := 0xFFFFFF39; + HDN_FIRST := 0xFFFFFED4;HDN_LAST := 0xFFFFFE71;TVN_FIRST := 0xFFFFFE70; + TVN_LAST := 0xFFFFFE0D;TTN_FIRST := 0xFFFFFDF8;TTN_LAST := 0xFFFFFDDB; + TCN_FIRST := 0xFFFFFDDA;TCN_LAST := 0xFFFFFDBC;CDN_FIRST := 0xFFFFFDA7; + CDN_LAST := 0xFFFFFD45;TBN_FIRST := 0xFFFFFD44;TBN_LAST := 0xFFFFFD30; + UDN_FIRST := 0xFFFFFD2F;UDN_LAST := 0xFFFFFD27;DTN_FIRST := 0xFFFFFD1C; + DTN_LAST := 0xFFFFFD17;MCN_FIRST := 0xFFFFFD16;MCN_LAST := 0xFFFFFD10; + DTN_FIRST2 := 0xFFFFFD0F;DTN_LAST2 := 0xFFFFFCE1;CBEN_FIRST := 0xFFFFFCE0; + CBEN_LAST := 0xFFFFFCC2;RBN_FIRST := 0xFFFFFCC1;RBN_LAST := 0xFFFFFCA5; + IPN_FIRST := 0xFFFFFCA4;IPN_LAST := 0xFFFFFC91;SBN_FIRST := 0xFFFFFC90; + SBN_LAST := 0xFFFFFC7D;PGN_FIRST := 0xFFFFFC7C;PGN_LAST := 0xFFFFFC4A; + WMN_FIRST := 0xFFFFFC18;WMN_LAST := 0xFFFFFB50;BCN_FIRST := 0xFFFFFB1E; + BCN_LAST := 0xFFFFFABA;TRBN_FIRST := 0xFFFFFA23;TRBN_LAST := 0xFFFFFA11; + MSGF_COMMCTRL_BEGINDRAG := 0x4200;MSGF_COMMCTRL_SIZEHEADER := 0x4201;MSGF_COMMCTRL_DRAGSELECT := 0x4202; + MSGF_COMMCTRL_TOOLBARCUST := 0x4203;CDRF_DODEFAULT := 0x0;CDRF_NEWFONT := 0x2; + CDRF_SKIPDEFAULT := 0x4;CDRF_DOERASE := 0x8;CDRF_SKIPPOSTPAINT := 0x100; + CDRF_NOTIFYPOSTPAINT := 0x10;CDRF_NOTIFYITEMDRAW := 0x20;CDRF_NOTIFYSUBITEMDRAW := 0x20; + CDRF_NOTIFYPOSTERASE := 0x40;CDDS_PREPAINT := 0x1;CDDS_POSTPAINT := 0x2; + CDDS_PREERASE := 0x3;CDDS_POSTERASE := 0x4;CDDS_ITEM := 0x10000; + CDDS_ITEMPREPAINT := 0x10001;CDDS_ITEMPOSTPAINT := 0x10002;CDDS_ITEMPREERASE := 0x10003; + CDDS_ITEMPOSTERASE := 0x10004;CDDS_SUBITEM := 0x20000;CDIS_SELECTED := 0x1; + CDIS_GRAYED := 0x2;CDIS_DISABLED := 0x4;CDIS_CHECKED := 0x8; + CDIS_FOCUS := 0x10;CDIS_DEFAULT := 0x20;CDIS_HOT := 0x40; + CDIS_MARKED := 0x80;CDIS_INDETERMINATE := 0x100;CDIS_SHOWKEYBOARDCUES := 0x200; + CDIS_NEARHOT := 0x400;CDIS_OTHERSIDEHOT := 0x800;CDIS_DROPHILITED := 0x1000; + NM_GETCUSTOMSPLITRECT := 0xFFFFFB21;CLR_NONE := 0xFFFFFFFF;CLR_DEFAULT := 0xFF000000; + ILC_MASK := 0x1;ILC_COLOR := 0x0;ILC_COLORDDB := 0xFE; + ILC_COLOR4 := 0x4;ILC_COLOR8 := 0x8;ILC_COLOR16 := 0x10; + ILC_COLOR24 := 0x18;ILC_COLOR32 := 0x20;ILC_PALETTE := 0x800; + ILC_MIRROR := 0x2000;ILC_PERITEMMIRROR := 0x8000;ILC_ORIGINALSIZE := 0x10000; + ILC_HIGHQUALITYSCALE := 0x20000;ILD_NORMAL := 0x0;ILD_TRANSPARENT := 0x1; + ILD_MASK := 0x10;ILD_IMAGE := 0x20;ILD_ROP := 0x40; + ILD_BLEND25 := 0x2;ILD_BLEND50 := 0x4;ILD_OVERLAYMASK := 0xF00; + ILD_PRESERVEALPHA := 0x1000;ILD_SCALE := 0x2000;ILD_DPISCALE := 0x4000; + ILD_ASYNC := 0x8000;ILD_SELECTED := 0x4;ILD_FOCUS := 0x2; + ILD_BLEND := 0x4;CLR_HILIGHT := 0xFF000000;ILS_NORMAL := 0x0; + ILS_GLOW := 0x1;ILS_SHADOW := 0x2;ILS_SATURATE := 0x4; + ILS_ALPHA := 0x8;ILGT_NORMAL := 0x0;ILGT_ASYNC := 0x1; + HBITMAP_CALLBACK := 0xFFFFFFFF;IMAGELIST_LOADIMAGE := 0x0;ILCF_MOVE := 0x0; + ILCF_SWAP := 0x1;ILP_NORMAL := 0x0;ILP_DOWNLEVEL := 0x1; + WC_HEADERA := "SysHeader32";WC_HEADERW := "SysHeader32";WC_HEADER := "SysHeader32"; + HDS_HORZ := 0x0;HDS_BUTTONS := 0x2;HDS_HOTTRACK := 0x4; + HDS_HIDDEN := 0x8;HDS_DRAGDROP := 0x40;HDS_FULLDRAG := 0x80; + HDS_FILTERBAR := 0x100;HDS_FLAT := 0x200;HDS_CHECKBOXES := 0x400; + HDS_NOSIZING := 0x800;HDS_OVERFLOW := 0x1000;HDFT_ISSTRING := 0x0; + HDFT_ISNUMBER := 0x1;HDFT_ISDATE := 0x2;HDFT_HASNOVALUE := 0x8000; + HD_TEXTFILTER := 0x0;HDTEXTFILTER := 0x0;LPHD_TEXTFILTER := 0x0; + LPHDTEXTFILTER := 0x0;HD_ITEMA := 0x0;HD_ITEMW := 0x0; + HD_ITEM := NIL;HDITEM := 0x0;LPHDITEM := 0x0; + HDITEM_V1_SIZE := 0x0;HDI_WIDTH := 0x1;HDI_HEIGHT := 0x1; + HDI_TEXT := 0x2;HDI_FORMAT := 0x4;HDI_LPARAM := 0x8; + HDI_BITMAP := 0x10;HDI_IMAGE := 0x20;HDI_DI_SETITEM := 0x40; + HDI_ORDER := 0x80;HDI_FILTER := 0x100;HDI_STATE := 0x200; + HDF_LEFT := 0x0;HDF_RIGHT := 0x1;HDF_CENTER := 0x2; + HDF_JUSTIFYMASK := 0x3;HDF_RTLREADING := 0x4;HDF_BITMAP := 0x2000; + HDF_STRING := 0x4000;HDF_OWNERDRAW := 0x8000;HDF_IMAGE := 0x800; + HDF_BITMAP_ON_RIGHT := 0x1000;HDF_SORTUP := 0x400;HDF_SORTDOWN := 0x200; + HDF_CHECKBOX := 0x40;HDF_CHECKED := 0x80;HDF_FIXEDWIDTH := 0x100; + HDF_SPLITBUTTON := 0x1000000;HDIS_FOCUSED := 0x1;HDM_GETITEMCOUNT := 0x1200; + HDM_INSERTITEMA := 0x1201;HDM_INSERTITEMW := 0x120A;HDM_INSERTITEM := 0x1201; + HDM_DELETEITEM := 0x1202;HDM_GETITEMA := 0x1203;HDM_GETITEMW := 0x120B; + HDM_GETITEM := 0x1203;HDM_SETITEMA := 0x1204;HDM_SETITEMW := 0x120C; + HDM_SETITEM := 0x1204;HD_LAYOUT := 0x0;HDM_LAYOUT := 0x1205; + HHT_NOWHERE := 0x1;HHT_ONHEADER := 0x2;HHT_ONDIVIDER := 0x4; + HHT_ONDIVOPEN := 0x8;HHT_ONFILTER := 0x10;HHT_ONFILTERBUTTON := 0x20; + HHT_ABOVE := 0x100;HHT_BELOW := 0x200;HHT_TORIGHT := 0x400; + HHT_TOLEFT := 0x800;HHT_ONITEMSTATEICON := 0x1000;HHT_ONDROPDOWN := 0x2000; + HHT_ONOVERFLOW := 0x4000;HD_HITTESTINFO := 0x0;HDSIL_NORMAL := 0x0; + HDSIL_STATE := 0x1;HDM_HITTEST := 0x1206;HDM_GETITEMRECT := 0x1207; + HDM_SETIMAGELIST := 0x1208;HDM_GETIMAGELIST := 0x1209;HDM_ORDERTOINDEX := 0x120F; + HDM_CREATEDRAGIMAGE := 0x1210;HDM_GETORDERARRAY := 0x1211;HDM_SETORDERARRAY := 0x1212; + HDM_SETHOTDIVIDER := 0x1213;HDM_SETBITMAPMARGIN := 0x1214;HDM_GETBITMAPMARGIN := 0x1215; + HDM_SETUNICODEFORMAT := 0x2005;HDM_GETUNICODEFORMAT := 0x2006;HDM_SETFILTERCHANGETIMEOUT := 0x1216; + HDM_EDITFILTER := 0x1217;HDM_CLEARFILTER := 0x1218;HDM_TRANSLATEACCELERATOR := 0x0; + HDM_GETITEMDROPDOWNRECT := 0x1219;HDM_GETOVERFLOWRECT := 0x121A;HDM_GETFOCUSEDITEM := 0x121B; + HDM_SETFOCUSEDITEM := 0x121C;HDN_ITEMCHANGINGA := 0xFFFFFED4;HDN_ITEMCHANGINGW := 0xFFFFFEC0; + HDN_ITEMCHANGEDA := 0xFFFFFED3;HDN_ITEMCHANGEDW := 0xFFFFFEBF;HDN_ITEMCLICKA := 0xFFFFFED2; + HDN_ITEMCLICKW := 0xFFFFFEBE;HDN_ITEMDBLCLICKA := 0xFFFFFED1;HDN_ITEMDBLCLICKW := 0xFFFFFEBD; + HDN_DIVIDERDBLCLICKA := 0xFFFFFECF;HDN_DIVIDERDBLCLICKW := 0xFFFFFEBB;HDN_BEGINTRACKA := 0xFFFFFECE; + HDN_BEGINTRACKW := 0xFFFFFEBA;HDN_ENDTRACKA := 0xFFFFFECD;HDN_ENDTRACKW := 0xFFFFFEB9; + HDN_TRACKA := 0xFFFFFECC;HDN_TRACKW := 0xFFFFFEB8;HDN_GETDISPINFOA := 0xFFFFFECB; + HDN_GETDISPINFOW := 0xFFFFFEB7;HDN_BEGINDRAG := 0xFFFFFECA;HDN_ENDDRAG := 0xFFFFFEC9; + HDN_FILTERCHANGE := 0xFFFFFEC8;HDN_FILTERBTNCLICK := 0xFFFFFEC7;HDN_BEGINFILTEREDIT := 0xFFFFFEC6; + HDN_ENDFILTEREDIT := 0xFFFFFEC5;HDN_ITEMSTATEICONCLICK := 0xFFFFFEC4;HDN_ITEMKEYDOWN := 0xFFFFFEC3; + HDN_DROPDOWN := 0xFFFFFEC2;HDN_OVERFLOWCLICK := 0xFFFFFEC1;HDN_ITEMCHANGING := 0xFFFFFED4; + HDN_ITEMCHANGED := 0xFFFFFED3;HDN_ITEMCLICK := 0xFFFFFED2;HDN_ITEMDBLCLICK := 0xFFFFFED1; + HDN_DIVIDERDBLCLICK := 0xFFFFFECF;HDN_BEGINTRACK := 0xFFFFFECE;HDN_ENDTRACK := 0xFFFFFECD; + HDN_TRACK := 0xFFFFFECC;HDN_GETDISPINFO := 0xFFFFFECB;HD_NOTIFYA := 0x0; + HD_NOTIFYW := 0x0;HD_NOTIFY := NIL;NMHEADER := 0x0; + LPNMHEADER := 0x0;NMHDDISPINFO := 0x0;LPNMHDDISPINFO := 0x0; + TOOLBARCLASSNAMEW := "ToolbarWindow32";TOOLBARCLASSNAMEA := "ToolbarWindow32";TOOLBARCLASSNAME := "ToolbarWindow32"; + CMB_MASKED := 0x2;TBSTATE_CHECKED := 0x1;TBSTATE_PRESSED := 0x2; + TBSTATE_ENABLED := 0x4;TBSTATE_HIDDEN := 0x8;TBSTATE_INDETERMINATE := 0x10; + TBSTATE_WRAP := 0x20;TBSTATE_ELLIPSES := 0x40;TBSTATE_MARKED := 0x80; + TBSTYLE_BUTTON := 0x0;TBSTYLE_SEP := 0x1;TBSTYLE_CHECK := 0x2; + TBSTYLE_GROUP := 0x4;TBSTYLE_CHECKGROUP := 0x6;TBSTYLE_DROPDOWN := 0x8; + TBSTYLE_AUTOSIZE := 0x10;TBSTYLE_NOPREFIX := 0x20;TBSTYLE_TOOLTIPS := 0x100; + TBSTYLE_WRAPABLE := 0x200;TBSTYLE_ALTDRAG := 0x400;TBSTYLE_FLAT := 0x800; + TBSTYLE_LIST := 0x1000;TBSTYLE_CUSTOMERASE := 0x2000;TBSTYLE_REGISTERDROP := 0x4000; + TBSTYLE_TRANSPARENT := 0x8000;TBSTYLE_EX_DRAWDDARROWS := 0x1;BTNS_BUTTON := 0x0; + BTNS_SEP := 0x1;BTNS_CHECK := 0x2;BTNS_GROUP := 0x4; + BTNS_CHECKGROUP := 0x6;BTNS_DROPDOWN := 0x8;BTNS_AUTOSIZE := 0x10; + BTNS_NOPREFIX := 0x20;BTNS_SHOWTEXT := 0x40;BTNS_WHOLEDROPDOWN := 0x80; + TBSTYLE_EX_MIXEDBUTTONS := 0x8;TBSTYLE_EX_HIDECLIPPEDBUTTONS := 0x10;TBSTYLE_EX_MULTICOLUMN := 0x2; + TBSTYLE_EX_VERTICAL := 0x4;TBSTYLE_EX_DOUBLEBUFFER := 0x80;TBCDRF_NOEDGES := 0x10000; + TBCDRF_HILITEHOTTRACK := 0x20000;TBCDRF_NOOFFSET := 0x40000;TBCDRF_NOMARK := 0x80000; + TBCDRF_NOETCHEDEFFECT := 0x100000;TBCDRF_BLENDICON := 0x200000;TBCDRF_NOBACKGROUND := 0x400000; + TBCDRF_USECDCOLORS := 0x800000;TB_ENABLEBUTTON := 0x401;TB_CHECKBUTTON := 0x402; + TB_PRESSBUTTON := 0x403;TB_HIDEBUTTON := 0x404;TB_INDETERMINATE := 0x405; + TB_MARKBUTTON := 0x406;TB_ISBUTTONENABLED := 0x409;TB_ISBUTTONCHECKED := 0x40A; + TB_ISBUTTONPRESSED := 0x40B;TB_ISBUTTONHIDDEN := 0x40C;TB_ISBUTTONINDETERMINATE := 0x40D; + TB_ISBUTTONHIGHLIGHTED := 0x40E;TB_SETSTATE := 0x411;TB_GETSTATE := 0x412; + TB_ADDBITMAP := 0x413;HINST_COMMCTRL := 0xFFFFFFFF;IDB_STD_SMALL_COLOR := 0x0; + IDB_STD_LARGE_COLOR := 0x1;IDB_VIEW_SMALL_COLOR := 0x4;IDB_VIEW_LARGE_COLOR := 0x5; + IDB_HIST_SMALL_COLOR := 0x8;IDB_HIST_LARGE_COLOR := 0x9;IDB_HIST_NORMAL := 0xC; + IDB_HIST_HOT := 0xD;IDB_HIST_DISABLED := 0xE;IDB_HIST_PRESSED := 0xF; + STD_CUT := 0x0;STD_COPY := 0x1;STD_PASTE := 0x2; + STD_UNDO := 0x3;STD_REDOW := 0x4;STD_DELETE := 0x5; + STD_FILENEW := 0x6;STD_FILEOPEN := 0x7;STD_FILESAVE := 0x8; + STD_PRINTPRE := 0x9;STD_PROPERTIES := 0xA;STD_HELP := 0xB; + STD_FIND := 0xC;STD_REPLACE := 0xD;STD_PRINT := 0xE; + VIEW_LARGEICONS := 0x0;VIEW_SMALLICONS := 0x1;VIEW_LIST := 0x2; + VIEW_DETAILS := 0x3;VIEW_SORTNAME := 0x4;VIEW_SORTSIZE := 0x5; + VIEW_SORTDATE := 0x6;VIEW_SORTTYPE := 0x7;VIEW_PARENTFOLDER := 0x8; + VIEW_NETCONNECT := 0x9;VIEW_NETDISCONNECT := 0xA;VIEW_NEWFOLDER := 0xB; + VIEW_VIEWMENU := 0xC;HIST_BACK := 0x0;HIST_FORWARD := 0x1; + HIST_FAVORITES := 0x2;HIST_ADDTOFAVORITES := 0x3;HIST_VIEWTREE := 0x4; + TB_ADDBUTTONSA := 0x414;TB_INSERTBUTTONA := 0x415;TB_DELETEBUTTON := 0x416; + TB_GETBUTTON := 0x417;TB_BUTTONCOUNT := 0x418;TB_COMMANDTOINDEX := 0x419; + TBSAVEPARAMS := 0x0;LPTBSAVEPARAMS := 0x0;TB_SAVERESTOREA := 0x41A; + TB_SAVERESTOREW := 0x44C;TB_CUSTOMIZE := 0x41B;TB_ADDSTRINGA := 0x41C; + TB_ADDSTRINGW := 0x44D;TB_GETITEMRECT := 0x41D;TB_BUTTONSTRUCTSIZE := 0x41E; + TB_SETBUTTONSIZE := 0x41F;TB_SETBITMAPSIZE := 0x420;TB_AUTOSIZE := 0x421; + TB_GETTOOLTIPS := 0x423;TB_SETTOOLTIPS := 0x424;TB_SETPARENT := 0x425; + TB_SETROWS := 0x427;TB_GETROWS := 0x428;TB_SETCMDID := 0x42A; + TB_CHANGEBITMAP := 0x42B;TB_GETBITMAP := 0x42C;TB_GETBUTTONTEXTA := 0x42D; + TB_GETBUTTONTEXTW := 0x44B;TB_REPLACEBITMAP := 0x42E;TB_SETINDENT := 0x42F; + TB_SETIMAGELIST := 0x430;TB_GETIMAGELIST := 0x431;TB_LOADIMAGES := 0x432; + TB_GETRECT := 0x433;TB_SETHOTIMAGELIST := 0x434;TB_GETHOTIMAGELIST := 0x435; + TB_SETDISABLEDIMAGELIST := 0x436;TB_GETDISABLEDIMAGELIST := 0x437;TB_SETSTYLE := 0x438; + TB_GETSTYLE := 0x439;TB_GETBUTTONSIZE := 0x43A;TB_SETBUTTONWIDTH := 0x43B; + TB_SETMAXTEXTROWS := 0x43C;TB_GETTEXTROWS := 0x43D;TB_GETBUTTONTEXT := 0x42D; + TB_SAVERESTORE := 0x41A;TB_ADDSTRING := 0x41C;TB_GETOBJECT := 0x43E; + TB_GETHOTITEM := 0x447;TB_SETHOTITEM := 0x448;TB_SETANCHORHIGHLIGHT := 0x449; + TB_GETANCHORHIGHLIGHT := 0x44A;TB_MAPACCELERATORA := 0x44E;TBIMHT_AFTER := 0x1; + TBIMHT_BACKGROUND := 0x2;TB_GETINSERTMARK := 0x44F;TB_SETINSERTMARK := 0x450; + TB_INSERTMARKHITTEST := 0x451;TB_MOVEBUTTON := 0x452;TB_GETMAXSIZE := 0x453; + TB_SETEXTENDEDSTYLE := 0x454;TB_GETEXTENDEDSTYLE := 0x455;TB_GETPADDING := 0x456; + TB_SETPADDING := 0x457;TB_SETINSERTMARKCOLOR := 0x458;TB_GETINSERTMARKCOLOR := 0x459; + TB_SETCOLORSCHEME := 0x2002;TB_GETCOLORSCHEME := 0x2003;TB_SETUNICODEFORMAT := 0x2005; + TB_GETUNICODEFORMAT := 0x2006;TB_MAPACCELERATORW := 0x45A;TB_MAPACCELERATOR := 0x44E; + TBBF_LARGE := 0x1;TB_GETBITMAPFLAGS := 0x429;TBIF_IMAGE := 0x1; + TBIF_TEXT := 0x2;TBIF_STATE := 0x4;TBIF_STYLE := 0x8; + TBIF_LPARAM := 0x10;TBIF_COMMAND := 0x20;TBIF_SIZE := 0x40; + TBIF_BYINDEX := 0x80000000;TBBUTTONINFO := 0x0;LPTBBUTTONINFO := 0x0; + TB_GETBUTTONINFOW := 0x43F;TB_SETBUTTONINFOW := 0x440;TB_GETBUTTONINFOA := 0x441; + TB_SETBUTTONINFOA := 0x442;TB_GETBUTTONINFO := 0x441;TB_SETBUTTONINFO := 0x442; + TB_INSERTBUTTONW := 0x443;TB_ADDBUTTONSW := 0x444;TB_HITTEST := 0x445; + TB_INSERTBUTTON := 0x415;TB_ADDBUTTONS := 0x414;TB_SETDRAWTEXTFLAGS := 0x446; + TB_GETSTRINGW := 0x45B;TB_GETSTRINGA := 0x45C;TB_GETSTRING := 0x45C; + TB_SETBOUNDINGSIZE := 0x45D;TB_SETHOTITEM2 := 0x45E;TB_HASACCELERATOR := 0x45F; + TB_SETLISTGAP := 0x460;TB_GETIMAGELISTCOUNT := 0x462;TB_GETIDEALSIZE := 0x463; + TB_TRANSLATEACCELERATOR := 0x0;TBMF_PAD := 0x1;TBMF_BARPAD := 0x2; + TBMF_BUTTONSPACING := 0x4;TB_GETMETRICS := 0x465;TB_SETMETRICS := 0x466; + TB_GETITEMDROPDOWNRECT := 0x467;TB_SETPRESSEDIMAGELIST := 0x468;TB_GETPRESSEDIMAGELIST := 0x469; + TB_SETWINDOWTHEME := 0x200B;TBN_GETBUTTONINFOA := 0xFFFFFD44;TBN_BEGINDRAG := 0xFFFFFD43; + TBN_ENDDRAG := 0xFFFFFD42;TBN_BEGINADJUST := 0xFFFFFD41;TBN_ENDADJUST := 0xFFFFFD40; + TBN_RESET := 0xFFFFFD3F;TBN_QUERYINSERT := 0xFFFFFD3E;TBN_QUERYDELETE := 0xFFFFFD3D; + TBN_TOOLBARCHANGE := 0xFFFFFD3C;TBN_CUSTHELP := 0xFFFFFD3B;TBN_DROPDOWN := 0xFFFFFD3A; + TBN_GETOBJECT := 0xFFFFFD38;HICF_OTHER := 0x0;HICF_MOUSE := 0x1; + HICF_ARROWKEYS := 0x2;HICF_ACCELERATOR := 0x4;HICF_DUPACCEL := 0x8; + HICF_ENTERING := 0x10;HICF_LEAVING := 0x20;HICF_RESELECT := 0x40; + HICF_LMOUSE := 0x80;HICF_TOGGLEDROPDOWN := 0x100;TBN_HOTITEMCHANGE := 0xFFFFFD37; + TBN_DRAGOUT := 0xFFFFFD36;TBN_DELETINGBUTTON := 0xFFFFFD35;TBN_GETDISPINFOA := 0xFFFFFD34; + TBN_GETDISPINFOW := 0xFFFFFD33;TBN_GETINFOTIPA := 0xFFFFFD32;TBN_GETINFOTIPW := 0xFFFFFD31; + TBN_GETBUTTONINFOW := 0xFFFFFD30;TBN_RESTORE := 0xFFFFFD2F;TBN_SAVE := 0xFFFFFD2E; + TBN_INITCUSTOMIZE := 0xFFFFFD2D;TBNRF_HIDEHELP := 0x1;TBNRF_ENDCUSTOMIZE := 0x2; + TBN_WRAPHOTITEM := 0xFFFFFD2C;TBN_DUPACCELERATOR := 0xFFFFFD2B;TBN_WRAPACCELERATOR := 0xFFFFFD2A; + TBN_DRAGOVER := 0xFFFFFD29;TBN_MAPACCELERATOR := 0xFFFFFD28;TBN_GETINFOTIP := 0xFFFFFD32; + NMTBGETINFOTIP := 0x0;LPNMTBGETINFOTIP := 0x0;TBNF_IMAGE := 0x1; + TBNF_TEXT := 0x2;TBNF_DI_SETITEM := 0x10000000;TBN_GETDISPINFO := 0xFFFFFD34; + NMTBDISPINFO := 0x0;LPNMTBDISPINFO := 0x0;TBDDRET_DEFAULT := 0x0; + TBDDRET_NODEFAULT := 0x1;TBDDRET_TREATPRESSED := 0x2;TBN_GETBUTTONINFO := 0xFFFFFD44; + TBNOTIFYA := 0x0;TBNOTIFYW := 0x0;LPTBNOTIFYA := 0x0; + LPTBNOTIFYW := 0x0;TBNOTIFY := NIL;LPTBNOTIFY := NIL; + NMTOOLBAR := 0x0;LPNMTOOLBAR := 0x0;REBARCLASSNAMEW := "ReBarWindow32"; + REBARCLASSNAMEA := "ReBarWindow32";REBARCLASSNAME := "ReBarWindow";RBIM_IMAGELIST := 0x1; + RBS_TOOLTIPS := 0x100;RBS_VARHEIGHT := 0x200;RBS_BANDBORDERS := 0x400; + RBS_FIXEDORDER := 0x800;RBS_REGISTERDROP := 0x1000;RBS_AUTOSIZE := 0x2000; + RBS_VERTICALGRIPPER := 0x4000;RBS_DBLCLKTOGGLE := 0x8000;RBBS_BREAK := 0x1; + RBBS_FIXEDSIZE := 0x2;RBBS_CHILDEDGE := 0x4;RBBS_HIDDEN := 0x8; + RBBS_NOVERT := 0x10;RBBS_FIXEDBMP := 0x20;RBBS_VARIABLEHEIGHT := 0x40; + RBBS_GRIPPERALWAYS := 0x80;RBBS_NOGRIPPER := 0x100;RBBS_USECHEVRON := 0x200; + RBBS_HIDETITLE := 0x400;RBBS_TOPALIGN := 0x800;RBBIM_STYLE := 0x1; + RBBIM_COLORS := 0x2;RBBIM_TEXT := 0x4;RBBIM_IMAGE := 0x8; + RBBIM_CHILD := 0x10;RBBIM_CHILDSIZE := 0x20;RBBIM_SIZE := 0x40; + RBBIM_BACKGROUND := 0x80;RBBIM_ID := 0x100;RBBIM_IDEALSIZE := 0x200; + RBBIM_LPARAM := 0x400;RBBIM_HEADERSIZE := 0x800;RBBIM_CHEVRONLOCATION := 0x1000; + RBBIM_CHEVRONSTATE := 0x2000;REBARBANDINFO := 0x0;LPREBARBANDINFO := 0x0; + LPCREBARBANDINFO := 0x0;REBARBANDINFO_V3_SIZE := 0x0;REBARBANDINFO_V6_SIZE := 0x0; + RB_INSERTBANDA := 0x401;RB_DELETEBAND := 0x402;RB_GETBARINFO := 0x403; + RB_SETBARINFO := 0x404;RB_SETBANDINFOA := 0x406;RB_SETPARENT := 0x407; + RB_HITTEST := 0x408;RB_GETRECT := 0x409;RB_INSERTBANDW := 0x40A; + RB_SETBANDINFOW := 0x40B;RB_GETBANDCOUNT := 0x40C;RB_GETROWCOUNT := 0x40D; + RB_GETROWHEIGHT := 0x40E;RB_IDTOINDEX := 0x410;RB_GETTOOLTIPS := 0x411; + RB_SETTOOLTIPS := 0x412;RB_SETBKCOLOR := 0x413;RB_GETBKCOLOR := 0x414; + RB_SETTEXTCOLOR := 0x415;RB_GETTEXTCOLOR := 0x416;RBSTR_CHANGERECT := 0x1; + RB_SIZETORECT := 0x417;RB_SETCOLORSCHEME := 0x2002;RB_GETCOLORSCHEME := 0x2003; + RB_INSERTBAND := 0x401;RB_SETBANDINFO := 0x406;RB_BEGINDRAG := 0x418; + RB_ENDDRAG := 0x419;RB_DRAGMOVE := 0x41A;RB_GETBARHEIGHT := 0x41B; + RB_GETBANDINFOW := 0x41C;RB_GETBANDINFOA := 0x41D;RB_GETBANDINFO := 0x41D; + RB_MINIMIZEBAND := 0x41E;RB_MAXIMIZEBAND := 0x41F;RB_GETDROPTARGET := 0x2004; + RB_GETBANDBORDERS := 0x422;RB_SHOWBAND := 0x423;RB_SETPALETTE := 0x425; + RB_GETPALETTE := 0x426;RB_MOVEBAND := 0x427;RB_SETUNICODEFORMAT := 0x2005; + RB_GETUNICODEFORMAT := 0x2006;RB_GETBANDMARGINS := 0x428;RB_SETWINDOWTHEME := 0x200B; + RB_SETEXTENDEDSTYLE := 0x429;RB_GETEXTENDEDSTYLE := 0x42A;RB_PUSHCHEVRON := 0x42B; + RB_SETBANDWIDTH := 0x42C;RBN_HEIGHTCHANGE := 0xFFFFFCC1;RBN_GETOBJECT := 0xFFFFFCC0; + RBN_LAYOUTCHANGED := 0xFFFFFCBF;RBN_AUTOSIZE := 0xFFFFFCBE;RBN_BEGINDRAG := 0xFFFFFCBD; + RBN_ENDDRAG := 0xFFFFFCBC;RBN_DELETINGBAND := 0xFFFFFCBB;RBN_DELETEDBAND := 0xFFFFFCBA; + RBN_CHILDSIZE := 0xFFFFFCB9;RBN_CHEVRONPUSHED := 0xFFFFFCB7;RBN_SPLITTERDRAG := 0xFFFFFCB6; + RBN_MINMAX := 0xFFFFFCAC;RBN_AUTOBREAK := 0xFFFFFCAB;RBNM_ID := 0x1; + RBNM_STYLE := 0x2;RBNM_LPARAM := 0x4;RBAB_AUTOSIZE := 0x1; + RBAB_ADDBAND := 0x2;RBHT_NOWHERE := 0x1;RBHT_CAPTION := 0x2; + RBHT_CLIENT := 0x3;RBHT_GRABBER := 0x4;RBHT_CHEVRON := 0x8; + RBHT_SPLITTER := 0x10;TOOLTIPS_CLASSW := "tooltips_class32";TOOLTIPS_CLASSA := "tooltips_class32"; + TOOLTIPS_CLASS := "tooltips_class32";LPTOOLINFOA := 0x0;LPTOOLINFOW := 0x0; + TOOLINFOA := 0x0;TOOLINFOW := 0x0;LPTOOLINFO := NIL; + TOOLINFO := NIL;PTOOLINFO := 0x0;TTTOOLINFO := 0x0; + LPTTTOOLINFO := 0x0;TTTOOLINFO_V1_SIZE := 0x0;TTS_ALWAYSTIP := 0x1; + TTS_NOPREFIX := 0x2;TTS_NOANIMATE := 0x10;TTS_NOFADE := 0x20; + TTS_BALLOON := 0x40;TTS_CLOSE := 0x80;TTS_USEVISUALSTYLE := 0x100; + TTF_IDISHWND := 0x1;TTF_CENTERTIP := 0x2;TTF_RTLREADING := 0x4; + TTF_SUBCLASS := 0x10;TTF_TRACK := 0x20;TTF_ABSOLUTE := 0x80; + TTF_TRANSPARENT := 0x100;TTF_PARSELINKS := 0x1000;TTF_DI_SETITEM := 0x8000; + TTDT_AUTOMATIC := 0x0;TTDT_RESHOW := 0x1;TTDT_AUTOPOP := 0x2; + TTDT_INITIAL := 0x3;TTI_NONE := 0x0;TTI_INFO := 0x1; + TTI_WARNING := 0x2;TTI_ERROR := 0x3;TTI_INFO_LARGE := 0x4; + TTI_WARNING_LARGE := 0x5;TTI_ERROR_LARGE := 0x6;TTM_ACTIVATE := 0x401; + TTM_SETDELAYTIME := 0x403;TTM_ADDTOOLA := 0x404;TTM_ADDTOOLW := 0x432; + TTM_DELTOOLA := 0x405;TTM_DELTOOLW := 0x433;TTM_NEWTOOLRECTA := 0x406; + TTM_NEWTOOLRECTW := 0x434;TTM_RELAYEVENT := 0x407;TTM_GETTOOLINFOA := 0x408; + TTM_GETTOOLINFOW := 0x435;TTM_SETTOOLINFOA := 0x409;TTM_SETTOOLINFOW := 0x436; + TTM_HITTESTA := 0x40A;TTM_HITTESTW := 0x437;TTM_GETTEXTA := 0x40B; + TTM_GETTEXTW := 0x438;TTM_UPDATETIPTEXTA := 0x40C;TTM_UPDATETIPTEXTW := 0x439; + TTM_GETTOOLCOUNT := 0x40D;TTM_ENUMTOOLSA := 0x40E;TTM_ENUMTOOLSW := 0x43A; + TTM_GETCURRENTTOOLA := 0x40F;TTM_GETCURRENTTOOLW := 0x43B;TTM_WINDOWFROMPOINT := 0x410; + TTM_TRACKACTIVATE := 0x411;TTM_TRACKPOSITION := 0x412;TTM_SETTIPBKCOLOR := 0x413; + TTM_SETTIPTEXTCOLOR := 0x414;TTM_GETDELAYTIME := 0x415;TTM_GETTIPBKCOLOR := 0x416; + TTM_GETTIPTEXTCOLOR := 0x417;TTM_SETMAXTIPWIDTH := 0x418;TTM_GETMAXTIPWIDTH := 0x419; + TTM_SETMARGIN := 0x41A;TTM_GETMARGIN := 0x41B;TTM_POP := 0x41C; + TTM_UPDATE := 0x41D;TTM_GETBUBBLESIZE := 0x41E;TTM_ADJUSTRECT := 0x41F; + TTM_SETTITLEA := 0x420;TTM_SETTITLEW := 0x421;TTM_POPUP := 0x422; + TTM_GETTITLE := 0x423;TTM_ADDTOOL := 0x404;TTM_DELTOOL := 0x405; + TTM_NEWTOOLRECT := 0x406;TTM_GETTOOLINFO := 0x408;TTM_SETTOOLINFO := 0x409; + TTM_HITTEST := 0x40A;TTM_GETTEXT := 0x40B;TTM_UPDATETIPTEXT := 0x40C; + TTM_ENUMTOOLS := 0x40E;TTM_GETCURRENTTOOL := 0x40F;TTM_SETTITLE := 0x420; + TTM_SETWINDOWTHEME := 0x200B;LPHITTESTINFOW := 0x0;LPHITTESTINFOA := 0x0; + LPHITTESTINFO := NIL;TTHITTESTINFO := 0x0;LPTTHITTESTINFO := 0x0; + TTN_GETDISPINFOA := 0xFFFFFDF8;TTN_GETDISPINFOW := 0xFFFFFDEE;TTN_SHOW := 0xFFFFFDF7; + TTN_POP := 0xFFFFFDF6;TTN_LINKCLICK := 0xFFFFFDF5;TTN_GETDISPINFO := 0xFFFFFDF8; + TTN_NEEDTEXT := 0xFFFFFDF8;TTN_NEEDTEXTA := 0xFFFFFDF8;TTN_NEEDTEXTW := 0xFFFFFDEE; + TOOLTIPTEXTW := 0x0;TOOLTIPTEXTA := 0x0;LPTOOLTIPTEXTA := 0x0; + LPTOOLTIPTEXTW := 0x0;TOOLTIPTEXT := NIL;LPTOOLTIPTEXT := NIL; + NMTTDISPINFO := 0x0;LPNMTTDISPINFO := 0x0;NMTTDISPINFO_V1_SIZE := 0x0; + SBARS_SIZEGRIP := 0x100;SBARS_TOOLTIPS := 0x800;SBT_TOOLTIPS := 0x800; + CREATESTATUSWINDOW := 0x0;DRAWSTATUSTEXT := 0x0;STATUSCLASSNAMEW := "msctls_statusbar32"; + STATUSCLASSNAMEA := "msctls_statusbar32";STATUSCLASSNAME := "msctls_statusbar32";SB_SETTEXTA := 0x401; + SB_SETTEXTW := 0x40B;SB_GETTEXTA := 0x402;SB_GETTEXTW := 0x40D; + SB_GETTEXTLENGTHA := 0x403;SB_GETTEXTLENGTHW := 0x40C;SB_GETTEXT := 0x402; + SB_SETTEXT := 0x401;SB_GETTEXTLENGTH := 0x403;SB_SETTIPTEXT := NIL; + SB_GETTIPTEXT := NIL;SB_SETPARTS := 0x404;SB_GETPARTS := 0x406; + SB_GETBORDERS := 0x407;SB_SETMINHEIGHT := 0x408;SB_SIMPLE := 0x409; + SB_GETRECT := 0x40A;SB_ISSIMPLE := 0x40E;SB_SETICON := 0x40F; + SB_SETTIPTEXTA := 0x410;SB_SETTIPTEXTW := 0x411;SB_GETTIPTEXTA := 0x412; + SB_GETTIPTEXTW := 0x413;SB_GETICON := 0x414;SB_SETUNICODEFORMAT := 0x2005; + SB_GETUNICODEFORMAT := 0x2006;SBT_OWNERDRAW := 0x1000;SBT_NOBORDERS := 0x100; + SBT_POPOUT := 0x200;SBT_RTLREADING := 0x400;SBT_NOTABPARSING := 0x800; + SB_SETBKCOLOR := 0x2001;SBN_SIMPLEMODECHANGE := 0xFFFFFC90;SB_SIMPLEID := 0xFF; + MINSYSCOMMAND := 0xF000;TRACKBAR_CLASSA := "msctls_trackbar32";TRACKBAR_CLASSW := "msctls_trackbar32"; + TRACKBAR_CLASS := "msctls_trackbar32";TBS_AUTOTICKS := 0x1;TBS_VERT := 0x2; + TBS_HORZ := 0x0;TBS_TOP := 0x4;TBS_BOTTOM := 0x0; + TBS_LEFT := 0x4;TBS_RIGHT := 0x0;TBS_BOTH := 0x8; + TBS_NOTICKS := 0x10;TBS_ENABLESELRANGE := 0x20;TBS_FIXEDLENGTH := 0x40; + TBS_NOTHUMB := 0x80;TBS_TOOLTIPS := 0x100;TBS_REVERSED := 0x200; + TBS_DOWNISLEFT := 0x400;TBS_NOTIFYBEFOREMOVE := 0x800;TBS_TRANSPARENTBKGND := 0x1000; + TBM_GETPOS := 0x400;TBM_GETRANGEMIN := 0x401;TBM_GETRANGEMAX := 0x402; + TBM_GETTIC := 0x403;TBM_SETTIC := 0x404;TBM_SETPOS := 0x405; + TBM_SETRANGE := 0x406;TBM_SETRANGEMIN := 0x407;TBM_SETRANGEMAX := 0x408; + TBM_CLEARTICS := 0x409;TBM_SETSEL := 0x40A;TBM_SETSELSTART := 0x40B; + TBM_SETSELEND := 0x40C;TBM_GETPTICS := 0x40E;TBM_GETTICPOS := 0x40F; + TBM_GETNUMTICS := 0x410;TBM_GETSELSTART := 0x411;TBM_GETSELEND := 0x412; + TBM_CLEARSEL := 0x413;TBM_SETTICFREQ := 0x414;TBM_SETPAGESIZE := 0x415; + TBM_GETPAGESIZE := 0x416;TBM_SETLINESIZE := 0x417;TBM_GETLINESIZE := 0x418; + TBM_GETTHUMBRECT := 0x419;TBM_GETCHANNELRECT := 0x41A;TBM_SETTHUMBLENGTH := 0x41B; + TBM_GETTHUMBLENGTH := 0x41C;TBM_SETTOOLTIPS := 0x41D;TBM_GETTOOLTIPS := 0x41E; + TBM_SETTIPSIDE := 0x41F;TBTS_TOP := 0x0;TBTS_LEFT := 0x1; + TBTS_BOTTOM := 0x2;TBTS_RIGHT := 0x3;TBM_SETBUDDY := 0x420; + TBM_GETBUDDY := 0x421;TBM_SETPOSNOTIFY := 0x422;TBM_SETUNICODEFORMAT := 0x2005; + TBM_GETUNICODEFORMAT := 0x2006;TB_LINEUP := 0x0;TB_LINEDOWN := 0x1; + TB_PAGEUP := 0x2;TB_PAGEDOWN := 0x3;TB_THUMBPOSITION := 0x4; + TB_THUMBTRACK := 0x5;TB_TOP := 0x6;TB_BOTTOM := 0x7; + TB_ENDTRACK := 0x8;TBCD_TICS := 0x1;TBCD_THUMB := 0x2; + TBCD_CHANNEL := 0x3;TRBN_THUMBPOSCHANGING := 0xFFFFFA22;DL_BEGINDRAG := 0x485; + DL_DRAGGING := 0x486;DL_DROPPED := 0x487;DL_CANCELDRAG := 0x488; + DL_CURSORSET := 0x0;DL_STOPCURSOR := 0x1;DL_COPYCURSOR := 0x2; + DL_MOVECURSOR := 0x3;UPDOWN_CLASSA := "msctls_updown32";UPDOWN_CLASSW := "msctls_updown32"; + UPDOWN_CLASS := "msctls_updown32";UD_MAXVAL := 0x7FFF;UD_MINVAL := 0xFFFF8001; + UDS_WRAP := 0x1;UDS_SETBUDDYINT := 0x2;UDS_ALIGNRIGHT := 0x4; + UDS_ALIGNLEFT := 0x8;UDS_AUTOBUDDY := 0x10;UDS_ARROWKEYS := 0x20; + UDS_HORZ := 0x40;UDS_NOTHOUSANDS := 0x80;UDS_HOTTRACK := 0x100; + UDM_SETRANGE := 0x465;UDM_GETRANGE := 0x466;UDM_SETPOS := 0x467; + UDM_GETPOS := 0x468;UDM_SETBUDDY := 0x469;UDM_GETBUDDY := 0x46A; + UDM_SETACCEL := 0x46B;UDM_GETACCEL := 0x46C;UDM_SETBASE := 0x46D; + UDM_GETBASE := 0x46E;UDM_SETRANGE32 := 0x46F;UDM_GETRANGE32 := 0x470; + UDM_SETUNICODEFORMAT := 0x2005;UDM_GETUNICODEFORMAT := 0x2006;UDM_SETPOS32 := 0x471; + UDM_GETPOS32 := 0x472;NM_UPDOWN := 0x0;LPNM_UPDOWN := 0x0; + UDN_DELTAPOS := 0xFFFFFD2E;PROGRESS_CLASSA := "msctls_progress32";PROGRESS_CLASSW := "msctls_progress32"; + PROGRESS_CLASS := "msctls_progress32";PBS_SMOOTH := 0x1;PBS_VERTICAL := 0x4; + PBM_SETRANGE := 0x401;PBM_SETPOS := 0x402;PBM_DELTAPOS := 0x403; + PBM_SETSTEP := 0x404;PBM_STEPIT := 0x405;PBM_SETRANGE32 := 0x406; + PBM_GETRANGE := 0x407;PBM_GETPOS := 0x408;PBM_SETBARCOLOR := 0x409; + PBM_SETBKCOLOR := 0x2001;PBS_MARQUEE := 0x8;PBM_SETMARQUEE := 0x40A; + PBS_SMOOTHREVERSE := 0x10;PBM_GETSTEP := 0x40D;PBM_GETBKCOLOR := 0x40E; + PBM_GETBARCOLOR := 0x40F;PBM_SETSTATE := 0x410;PBM_GETSTATE := 0x411; + PBST_NORMAL := 0x1;PBST_ERROR := 0x2;PBST_PAUSED := 0x3; + HOTKEYF_SHIFT := 0x1;HOTKEYF_CONTROL := 0x2;HOTKEYF_ALT := 0x4; + HOTKEYF_EXT := 0x8;HKCOMB_NONE := 0x1;HKCOMB_S := 0x2; + HKCOMB_C := 0x4;HKCOMB_A := 0x8;HKCOMB_SC := 0x10; + HKCOMB_SA := 0x20;HKCOMB_CA := 0x40;HKCOMB_SCA := 0x80; + HKM_SETHOTKEY := 0x401;HKM_GETHOTKEY := 0x402;HKM_SETRULES := 0x403; + HOTKEY_CLASSA := "msctls_hotkey32";HOTKEY_CLASSW := "msctls_hotkey32";HOTKEY_CLASS := "msctls_hotkey32"; + CCS_TOP := 0x1;CCS_NOMOVEY := 0x2;CCS_BOTTOM := 0x3; + CCS_NORESIZE := 0x4;CCS_NOPARENTALIGN := 0x8;CCS_ADJUSTABLE := 0x20; + CCS_NODIVIDER := 0x40;CCS_VERT := 0x80;CCS_LEFT := 0x81; + CCS_RIGHT := 0x83;CCS_NOMOVEX := 0x82;INVALID_LINK_INDEX := 0xFFFFFFFF; + MAX_LINKID_TEXT := 0x30;WC_LINK := "SysLink";LWS_TRANSPARENT := 0x1; + LWS_IGNORERETURN := 0x2;LWS_NOPREFIX := 0x4;LWS_USEVISUALSTYLE := 0x8; + LWS_USECUSTOMTEXT := 0x10;LWS_RIGHT := 0x20;LIF_ITEMINDEX := 0x1; + LIF_STATE := 0x2;LIF_ITEMID := 0x4;LIF_URL := 0x8; + LIS_FOCUSED := 0x1;LIS_ENABLED := 0x2;LIS_VISITED := 0x4; + LIS_HOTTRACK := 0x8;LIS_DEFAULTCOLORS := 0x10;LM_HITTEST := 0x700; + LM_GETIDEALHEIGHT := 0x701;LM_SETITEM := 0x702;LM_GETITEM := 0x703; + LM_GETIDEALSIZE := 0x701;WC_LISTVIEWA := "SysListView32";WC_LISTVIEWW := "SysListView32"; + WC_LISTVIEW := "SysListView32";LVS_ICON := 0x0;LVS_REPORT := 0x1; + WM_SOCKET := 0x401;LVS_SMALLICON := 0x2;LVS_LIST := 0x3; + LVS_TYPEMASK := 0x3;LVS_SINGLESEL := 0x4;LVS_SHOWSELALWAYS := 0x8; + LVS_SORTASCENDING := 0x10;LVS_SORTDESCENDING := 0x20;LVS_SHAREIMAGELISTS := 0x40; + LVS_NOLABELWRAP := 0x80;LVS_AUTOARRANGE := 0x100;LVS_EDITLABELS := 0x200; + LVS_OWNERDATA := 0x1000;LVS_NOSCROLL := 0x2000;LVS_TYPESTYLEMASK := 0xFC00; + LVS_ALIGNTOP := 0x0;LVS_ALIGNLEFT := 0x800;LVS_ALIGNMASK := 0xC00; + LVS_OWNERDRAWFIXED := 0x400;LVS_NOCOLUMNHEADER := 0x4000;LVS_NOSORTHEADER := 0x8000; + LVM_SETUNICODEFORMAT := 0x2005;LVM_GETUNICODEFORMAT := 0x2006;LVM_GETBKCOLOR := 0x1000; + LVM_SETBKCOLOR := 0x1001;LVM_GETIMAGELIST := 0x1002;LVSIL_NORMAL := 0x0; + LVSIL_SMALL := 0x1;LVSIL_STATE := 0x2;LVSIL_GROUPHEADER := 0x3; + LVM_SETIMAGELIST := 0x1003;LVM_GETITEMCOUNT := 0x1004;LVIF_TEXT := 0x1; + LVIF_IMAGE := 0x2;LVIF_PARAM := 0x4;LVIF_STATE := 0x8; + LVIF_INDENT := 0x10;LVIF_NORECOMPUTE := 0x800;LVIF_GROUPID := 0x100; + LVIF_COLUMNS := 0x200;LVIF_COLFMT := 0x10000;LVIS_FOCUSED := 0x1; + LVIS_SELECTED := 0x2;LVIS_CUT := 0x4;LVIS_DROPHILITED := 0x8; + LVIS_GLOW := 0x10;LVIS_ACTIVATING := 0x20;LVIS_OVERLAYMASK := 0xF00; + LVIS_STATEIMAGEMASK := 0xF000;I_INDENTCALLBACK := 0xFFFFFFFF;LV_ITEMA := 0x0; + LV_ITEMW := 0x0;I_GROUPIDCALLBACK := 0xFFFFFFFF;I_GROUPIDNONE := 0xFFFFFFFE; + LV_ITEM := NIL;LVITEM_V5_SIZE := 0x0;LVITEM := 0x0; + LPLVITEM := 0x0;LVITEM_V1_SIZE := 0x0;LPSTR_TEXTCALLBACKW := 0xFFFFFFFFFFFFFFFF; + LPSTR_TEXTCALLBACKA := 0xFFFFFFFFFFFFFFFF;LPSTR_TEXTCALLBACK := 0xFFFFFFFFFFFFFFFF;I_IMAGECALLBACK := 0xFFFFFFFF; + I_IMAGENONE := 0xFFFFFFFE;I_COLUMNSCALLBACK := 0xFFFFFFFF;LVM_GETITEMA := 0x1005; + LVM_GETITEMW := 0x104B;LVM_GETITEM := 0x1005;LVM_SETITEMA := 0x1006; + LVM_SETITEMW := 0x104C;LVM_SETITEM := 0x1006;LVM_INSERTITEMA := 0x1007; + LVM_INSERTITEMW := 0x104D;LVM_INSERTITEM := 0x1007;LVM_DELETEITEM := 0x1008; + LVM_DELETEALLITEMS := 0x1009;LVM_GETCALLBACKMASK := 0x100A;LVM_SETCALLBACKMASK := 0x100B; + LVNI_ALL := 0x0;LVNI_FOCUSED := 0x1;LVNI_SELECTED := 0x2; + LVNI_CUT := 0x4;LVNI_DROPHILITED := 0x8;LVNI_STATEMASK := 0xF; + LVNI_VISIBLEORDER := 0x10;LVNI_PREVIOUS := 0x20;LVNI_VISIBLEONLY := 0x40; + LVNI_SAMEGROUPONLY := 0x80;LVNI_ABOVE := 0x100;LVNI_BELOW := 0x200; + LVNI_TOLEFT := 0x400;LVNI_TORIGHT := 0x800;LVNI_DIRECTIONMASK := 0xF00; + LVM_GETNEXTITEM := 0x100C;LVFI_PARAM := 0x1;LVFI_STRING := 0x2; + LVFI_SUBSTRING := 0x4;LVFI_PARTIAL := 0x8;LVFI_WRAP := 0x20; + LVFI_NEARESTXY := 0x40;LV_FINDINFOA := 0x0;LV_FINDINFOW := 0x0; + LV_FINDINFO := NIL;LVFINDINFO := 0x0;LVM_FINDITEMA := 0x100D; + LVM_FINDITEMW := 0x1053;LVM_FINDITEM := 0x100D;LVIR_BOUNDS := 0x0; + LVIR_ICON := 0x1;LVIR_LABEL := 0x2;LVIR_SELECTBOUNDS := 0x3; + LVM_GETITEMRECT := 0x100E;LVM_SETITEMPOSITION := 0x100F;LVM_GETITEMPOSITION := 0x1010; + LVM_GETSTRINGWIDTHA := 0x1011;LVM_GETSTRINGWIDTHW := 0x1057;LVM_GETSTRINGWIDTH := 0x1011; + LVHT_NOWHERE := 0x1;LVHT_ONITEMICON := 0x2;LVHT_ONITEMLABEL := 0x4; + LVHT_ONITEMSTATEICON := 0x8;LVHT_ONITEM := 0xE;LVHT_ABOVE := 0x8; + LVHT_BELOW := 0x10;LVHT_TORIGHT := 0x20;LVHT_TOLEFT := 0x40; + LVHT_EX_GROUP_HEADER := 0x10000000;LVHT_EX_GROUP_FOOTER := 0x20000000;LVHT_EX_GROUP_COLLAPSE := 0x40000000; + LVHT_EX_GROUP_BACKGROUND := 0x80000000;LVHT_EX_GROUP_STATEICON := 0x1000000;LVHT_EX_GROUP_SUBSETLINK := 0x2000000; + LVHT_EX_GROUP := 0xF3000000;LVHT_EX_ONCONTENTS := 0x4000000;LVHT_EX_FOOTER := 0x8000000; + LV_HITTESTINFO := 0x0;LVM_HITTEST := 0x1012;LVM_ENSUREVISIBLE := 0x1013; + LVM_SCROLL := 0x1014;LVM_REDRAWITEMS := 0x1015;LVA_DEFAULT := 0x0; + LVA_ALIGNLEFT := 0x1;LVA_ALIGNTOP := 0x2;LVA_SNAPTOGRID := 0x5; + LVM_ARRANGE := 0x1016;LVM_EDITLABELA := 0x1017;LVM_EDITLABELW := 0x1076; + LVM_EDITLABEL := 0x1017;LVM_GETEDITCONTROL := 0x1018;LV_COLUMNA := 0x0; + LV_COLUMNW := 0x0;LV_COLUMN := NIL;LVCOLUMN := 0x0; + LPLVCOLUMN := 0x0;LVCOLUMN_V1_SIZE := 0x0;LVCF_FMT := 0x1; + LVCF_WIDTH := 0x2;LVCF_TEXT := 0x4;LVCF_SUBITEM := 0x8; + LVCF_IMAGE := 0x10;LVCF_ORDER := 0x20;LVCF_MINWIDTH := 0x40; + LVCF_DEFAULTWIDTH := 0x80;LVCF_IDEALWIDTH := 0x100;LVCFMT_LEFT := 0x0; + LVCFMT_RIGHT := 0x1;LVCFMT_CENTER := 0x2;LVCFMT_JUSTIFYMASK := 0x3; + LVCFMT_IMAGE := 0x800;LVCFMT_BITMAP_ON_RIGHT := 0x1000;LVCFMT_COL_HAS_IMAGES := 0x8000; + LVCFMT_FIXED_WIDTH := 0x100;LVCFMT_NO_DPI_SCALE := 0x40000;LVCFMT_FIXED_RATIO := 0x80000; + LVCFMT_LINE_BREAK := 0x100000;LVCFMT_FILL := 0x200000;LVCFMT_WRAP := 0x400000; + LVCFMT_NO_TITLE := 0x800000;LVCFMT_TILE_PLACEMENTMASK := 0x300000;LVCFMT_SPLITBUTTON := 0x1000000; + LVM_GETCOLUMNA := 0x1019;LVM_GETCOLUMNW := 0x105F;LVM_GETCOLUMN := 0x1019; + LVM_SETCOLUMNA := 0x101A;LVM_SETCOLUMNW := 0x1060;LVM_SETCOLUMN := 0x101A; + LVM_INSERTCOLUMNA := 0x101B;LVM_INSERTCOLUMNW := 0x1061;LVM_DELETECOLUMN := 0x101C; + LVM_GETCOLUMNWIDTH := 0x101D;LVSCW_AUTOSIZE := 0xFFFFFFFF;LVSCW_AUTOSIZE_USEHEADER := 0xFFFFFFFE; + LVM_SETCOLUMNWIDTH := 0x101E;LVM_GETHEADER := 0x101F;LVM_CREATEDRAGIMAGE := 0x1021; + LVM_GETVIEWRECT := 0x1022;LVM_GETTEXTCOLOR := 0x1023;LVM_SETTEXTCOLOR := 0x1024; + LVM_GETTEXTBKCOLOR := 0x1025;LVM_SETTEXTBKCOLOR := 0x1026;LVM_GETTOPINDEX := 0x1027; + LVM_GETCOUNTPERPAGE := 0x1028;LVM_GETORIGIN := 0x1029;LVM_UPDATE := 0x102A; + LVM_SETITEMSTATE := 0x102B;LVM_GETITEMSTATE := 0x102C;LVM_GETITEMTEXTA := 0x102D; + LVM_GETITEMTEXTW := 0x1073;LVM_GETITEMTEXT := 0x102D;LVM_SETITEMTEXTA := 0x102E; + LVM_SETITEMTEXTW := 0x1074;LVM_SETITEMTEXT := 0x102E;LVSICF_NOINVALIDATEALL := 0x1; + LVSICF_NOSCROLL := 0x2;LVM_SETITEMCOUNT := 0x102F;LVM_SORTITEMS := 0x1030; + LVM_SETITEMPOSITION32 := 0x1031;LVM_GETSELECTEDCOUNT := 0x1032;LVM_GETITEMSPACING := 0x1033; + LVM_GETISEARCHSTRINGA := 0x1034;LVM_GETISEARCHSTRINGW := 0x1075;LVM_GETISEARCHSTRING := 0x1034; + LVM_SETICONSPACING := 0x1035;LVM_SETEXTENDEDLISTVIEWSTYLE := 0x1036;LVM_GETEXTENDEDLISTVIEWSTYLE := 0x1037; + LVS_EX_GRIDLINES := 0x1;LVS_EX_SUBITEMIMAGES := 0x2;LVS_EX_CHECKBOXES := 0x4; + LVS_EX_TRACKSELECT := 0x8;LVS_EX_HEADERDRAGDROP := 0x10;LVS_EX_FULLROWSELECT := 0x20; + LVS_EX_ONECLICKACTIVATE := 0x40;LVS_EX_TWOCLICKACTIVATE := 0x80;LVS_EX_FLATSB := 0x100; + LVS_EX_REGIONAL := 0x200;LVS_EX_INFOTIP := 0x400;LVS_EX_UNDERLINEHOT := 0x800; + LVS_EX_UNDERLINECOLD := 0x1000;LVS_EX_MULTIWORKAREAS := 0x2000;LVS_EX_LABELTIP := 0x4000; + LVS_EX_BORDERSELECT := 0x8000;LVS_EX_DOUBLEBUFFER := 0x10000;LVS_EX_HIDELABELS := 0x20000; + LVS_EX_SINGLEROW := 0x40000;LVS_EX_SNAPTOGRID := 0x80000;LVS_EX_SIMPLESELECT := 0x100000; + LVS_EX_JUSTIFYCOLUMNS := 0x200000;LVS_EX_TRANSPARENTBKGND := 0x400000;LVS_EX_TRANSPARENTSHADOWTEXT := 0x800000; + LVS_EX_AUTOAUTOARRANGE := 0x1000000;LVS_EX_HEADERINALLVIEWS := 0x2000000;LVS_EX_AUTOCHECKSELECT := 0x8000000; + LVS_EX_AUTOSIZECOLUMNS := 0x10000000;LVS_EX_COLUMNSNAPPOINTS := 0x40000000;LVS_EX_COLUMNOVERFLOW := 0x80000000; + LVM_GETSUBITEMRECT := 0x1038;LVM_SUBITEMHITTEST := 0x1039;LVM_SETCOLUMNORDERARRAY := 0x103A; + LVM_GETCOLUMNORDERARRAY := 0x103B;LVM_SETHOTITEM := 0x103C;LVM_GETHOTITEM := 0x103D; + LVM_SETHOTCURSOR := 0x103E;LVM_GETHOTCURSOR := 0x103F;LVM_APPROXIMATEVIEWRECT := 0x1040; + LV_MAX_WORKAREAS := 0x10;LVM_SETWORKAREAS := 0x1041;LVM_GETWORKAREAS := 0x1046; + LVM_GETNUMBEROFWORKAREAS := 0x1049;LVM_GETSELECTIONMARK := 0x1042;LVM_SETSELECTIONMARK := 0x1043; + LVM_SETHOVERTIME := 0x1047;LVM_GETHOVERTIME := 0x1048;LVM_SETTOOLTIPS := 0x104A; + LVM_GETTOOLTIPS := 0x104E;LVM_SORTITEMSEX := 0x1051;LVBKIF_SOURCE_NONE := 0x0; + LVBKIF_SOURCE_HBITMAP := 0x1;LVBKIF_SOURCE_URL := 0x2;LVBKIF_SOURCE_MASK := 0x3; + LVBKIF_STYLE_NORMAL := 0x0;LVBKIF_STYLE_TILE := 0x10;LVBKIF_STYLE_MASK := 0x10; + LVBKIF_FLAG_TILEOFFSET := 0x100;LVBKIF_TYPE_WATERMARK := 0x10000000;LVBKIF_FLAG_ALPHABLEND := 0x20000000; + LVM_SETBKIMAGEA := 0x1044;LVM_SETBKIMAGEW := 0x108A;LVM_GETBKIMAGEA := 0x1045; + LVM_GETBKIMAGEW := 0x108B;LVM_SETSELECTEDCOLUMN := 0x108C;LV_VIEW_ICON := 0x0; + LV_VIEW_DETAILS := 0x1;LV_VIEW_SMALLICON := 0x2;LV_VIEW_LIST := 0x3; + LV_VIEW_TILE := 0x4;LV_VIEW_MAX := 0x4;LVM_SETVIEW := 0x108E; + LVM_GETVIEW := 0x108F;LVGF_NONE := 0x0;LVGF_HEADER := 0x1; + LVGF_FOOTER := 0x2;LVGF_STATE := 0x4;LVGF_ALIGN := 0x8; + LVGF_GROUPID := 0x10;LVGF_SUBTITLE := 0x100;LVGF_TASK := 0x200; + LVGF_DESCRIPTIONTOP := 0x400;LVGF_DESCRIPTIONBOTTOM := 0x800;LVGF_TITLEIMAGE := 0x1000; + LVGF_EXTENDEDIMAGE := 0x2000;LVGF_ITEMS := 0x4000;LVGF_SUBSET := 0x8000; + LVGF_SUBSETITEMS := 0x10000;LVGS_NORMAL := 0x0;LVGS_COLLAPSED := 0x1; + LVGS_HIDDEN := 0x2;LVGS_NOHEADER := 0x4;LVGS_COLLAPSIBLE := 0x8; + LVGS_FOCUSED := 0x10;LVGS_SELECTED := 0x20;LVGS_SUBSETED := 0x40; + LVGS_SUBSETLINKFOCUSED := 0x80;LVGA_HEADER_LEFT := 0x1;LVGA_HEADER_CENTER := 0x2; + LVGA_HEADER_RIGHT := 0x4;LVGA_FOOTER_LEFT := 0x8;LVGA_FOOTER_CENTER := 0x10; + LVGA_FOOTER_RIGHT := 0x20;LVM_INSERTGROUP := 0x1091;LVM_SETGROUPINFO := 0x1093; + LVM_GETGROUPINFO := 0x1095;LVM_REMOVEGROUP := 0x1096;LVM_MOVEGROUP := 0x1097; + LVM_GETGROUPCOUNT := 0x1098;LVM_GETGROUPINFOBYINDEX := 0x1099;LVM_MOVEITEMTOGROUP := 0x109A; + LVGGR_GROUP := 0x0;LVGGR_HEADER := 0x1;LVGGR_LABEL := 0x2; + LVGGR_SUBSETLINK := 0x3;LVM_GETGROUPRECT := 0x1062;LVGMF_NONE := 0x0; + LVGMF_BORDERSIZE := 0x1;LVGMF_BORDERCOLOR := 0x2;LVGMF_TEXTCOLOR := 0x4; + LVM_SETGROUPMETRICS := 0x109B;LVM_GETGROUPMETRICS := 0x109C;LVM_ENABLEGROUPVIEW := 0x109D; + LVM_SORTGROUPS := 0x109E;LVM_INSERTGROUPSORTED := 0x109F;LVM_REMOVEALLGROUPS := 0x10A0; + LVM_HASGROUP := 0x10A1;LVM_GETGROUPSTATE := 0x105C;LVM_GETFOCUSEDGROUP := 0x105D; + LVTVIF_AUTOSIZE := 0x0;LVTVIF_FIXEDWIDTH := 0x1;LVTVIF_FIXEDHEIGHT := 0x2; + LVTVIF_FIXEDSIZE := 0x3;LVTVIF_EXTENDED := 0x4;LVTVIM_TILESIZE := 0x1; + LVTVIM_COLUMNS := 0x2;LVTVIM_LABELMARGIN := 0x4;LVM_SETTILEVIEWINFO := 0x10A2; + LVM_GETTILEVIEWINFO := 0x10A3;LVM_SETTILEINFO := 0x10A4;LVM_GETTILEINFO := 0x10A5; + LVIM_AFTER := 0x1;LVM_SETINSERTMARK := 0x10A6;LVM_GETINSERTMARK := 0x10A7; + LVM_INSERTMARKHITTEST := 0x10A8;LVM_GETINSERTMARKRECT := 0x10A9;LVM_SETINSERTMARKCOLOR := 0x10AA; + LVM_GETINSERTMARKCOLOR := 0x10AB;LVM_SETINFOTIP := 0x10AD;LVM_GETSELECTEDCOLUMN := 0x10AE; + LVM_ISGROUPVIEWENABLED := 0x10AF;LVM_GETOUTLINECOLOR := 0x10B0;LVM_SETOUTLINECOLOR := 0x10B1; + LVM_CANCELEDITLABEL := 0x10B3;LVM_MAPINDEXTOID := 0x10B4;LVM_MAPIDTOINDEX := 0x10B5; + LVM_ISITEMVISIBLE := 0x10B6;LVM_GETEMPTYTEXT := 0x10CC;LVM_GETFOOTERRECT := 0x10CD; + LVFF_ITEMCOUNT := 0x1;LVM_GETFOOTERINFO := 0x10CE;LVM_GETFOOTERITEMRECT := 0x10CF; + LVFIF_TEXT := 0x1;LVFIF_STATE := 0x2;LVFIS_FOCUSED := 0x1; + LVM_GETFOOTERITEM := 0x10D0;LVM_GETITEMINDEXRECT := 0x10D1;LVM_SETITEMINDEXSTATE := 0x10D2; + LVM_GETNEXTITEMINDEX := 0x10D3;LVBKIMAGE := 0x0;LPLVBKIMAGE := 0x0; + LVM_SETBKIMAGE := 0x1044;LVM_GETBKIMAGE := 0x1045;LPNM_LISTVIEW := 0x0; + NM_LISTVIEW := 0x0;LVKF_ALT := 0x1;LVKF_CONTROL := 0x2; + LVKF_SHIFT := 0x4;LVCDI_ITEM := 0x0;LVCDI_GROUP := 0x1; + LVCDI_ITEMSLIST := 0x2;LVCDRF_NOSELECT := 0x10000;LVCDRF_NOGROUPFRAME := 0x20000; + LPNM_CACHEHINT := 0x0;PNM_CACHEHINT := 0x0;NM_CACHEHINT := 0x0; + PNM_FINDITEMA := 0x0;LPNM_FINDITEMA := 0x0;NM_FINDITEMA := 0x0; + PNM_FINDITEMW := 0x0;LPNM_FINDITEMW := 0x0;NM_FINDITEMW := 0x0; + PNM_FINDITEM := 0x0;LPNM_FINDITEM := 0x0;NM_FINDITEM := 0x0; + NMLVFINDITEM := 0x0;LPNMLVFINDITEM := 0x0;PNM_ODSTATECHANGE := 0x0; + LPNM_ODSTATECHANGE := 0x0;NM_ODSTATECHANGE := 0x0;LVN_ITEMCHANGING := 0xFFFFFF9C; + LVN_ITEMCHANGED := 0xFFFFFF9B;LVN_INSERTITEM := 0xFFFFFF9A;LVN_DELETEITEM := 0xFFFFFF99; + LVN_DELETEALLITEMS := 0xFFFFFF98;LVN_BEGINLABELEDITA := 0xFFFFFF97;LVN_BEGINLABELEDITW := 0xFFFFFF51; + LVN_ENDLABELEDITA := 0xFFFFFF96;LVN_ENDLABELEDITW := 0xFFFFFF50;LVN_COLUMNCLICK := 0xFFFFFF94; + LVN_BEGINDRAG := 0xFFFFFF93;LVN_BEGINRDRAG := 0xFFFFFF91;LVN_ODCACHEHINT := 0xFFFFFF8F; + LVN_ODFINDITEMA := 0xFFFFFF68;LVN_ODFINDITEMW := 0xFFFFFF4D;LVN_ITEMACTIVATE := 0xFFFFFF8E; + LVN_ODSTATECHANGED := 0xFFFFFF8D;LVN_ODFINDITEM := 0xFFFFFF68;LVN_HOTTRACK := 0xFFFFFF87; + LVN_GETDISPINFOA := 0xFFFFFF6A;LVN_GETDISPINFOW := 0xFFFFFF4F;LVN_SETDISPINFOA := 0xFFFFFF69; + LVN_SETDISPINFOW := 0xFFFFFF4E;LVN_BEGINLABELEDIT := 0xFFFFFF97;LVN_ENDLABELEDIT := 0xFFFFFF96; + LVN_GETDISPINFO := 0xFFFFFF6A;LVN_SETDISPINFO := 0xFFFFFF69;LVIF_DI_SETITEM := 0x1000; + LV_DISPINFOA := 0x0;LV_DISPINFOW := 0x0;LV_DISPINFO := NIL; + NMLVDISPINFO := 0x0;LVN_KEYDOWN := 0xFFFFFF65;LV_KEYDOWN := 0x0; + LVN_MARQUEEBEGIN := 0xFFFFFF64;LVGIT_UNFOLDED := 0x1;LVN_GETINFOTIPA := 0xFFFFFF63; + LVN_GETINFOTIPW := 0xFFFFFF62;LVN_GETINFOTIP := 0xFFFFFF63;NMLVGETINFOTIP := 0x0; + LPNMLVGETINFOTIP := 0x0;LVNSCH_DEFAULT := 0xFFFFFFFF;LVNSCH_ERROR := 0xFFFFFFFE; + LVNSCH_IGNORE := 0xFFFFFFFD;LVN_INCREMENTALSEARCHA := 0xFFFFFF5E;LVN_INCREMENTALSEARCHW := 0xFFFFFF5D; + LVN_INCREMENTALSEARCH := 0xFFFFFF5E;LVN_COLUMNDROPDOWN := 0xFFFFFF5C;LVN_COLUMNOVERFLOWCLICK := 0xFFFFFF5A; + LVN_BEGINSCROLL := 0xFFFFFF4C;LVN_ENDSCROLL := 0xFFFFFF4B;LVN_LINKCLICK := 0xFFFFFF48; + EMF_CENTERED := 0x1;LVN_GETEMPTYMARKUP := 0xFFFFFF45;WC_TREEVIEWA := "SysTreeView32"; + WC_TREEVIEWW := "SysTreeView32";WC_TREEVIEW := "SysTreeView32";TVS_HASBUTTONS := 0x1; + TVS_HASLINES := 0x2;TVS_LINESATROOT := 0x4;TVS_EDITLABELS := 0x8; + TVS_DISABLEDRAGDROP := 0x10;TVS_SHOWSELALWAYS := 0x20;TVS_RTLREADING := 0x40; + TVS_NOTOOLTIPS := 0x80;TVS_CHECKBOXES := 0x100;TVS_TRACKSELECT := 0x200; + TVS_SINGLEEXPAND := 0x400;TVS_INFOTIP := 0x800;TVS_FULLROWSELECT := 0x1000; + TVS_NOSCROLL := 0x2000;TVS_NONEVENHEIGHT := 0x4000;TVS_NOHSCROLL := 0x8000; + TVS_EX_NOSINGLECOLLAPSE := 0x1;TVS_EX_MULTISELECT := 0x2;TVS_EX_DOUBLEBUFFER := 0x4; + TVS_EX_NOINDENTSTATE := 0x8;TVS_EX_RICHTOOLTIP := 0x10;TVS_EX_AUTOHSCROLL := 0x20; + TVS_EX_FADEINOUTEXPANDOS := 0x40;TVS_EX_PARTIALCHECKBOXES := 0x80;TVS_EX_EXCLUSIONCHECKBOXES := 0x100; + TVS_EX_DIMMEDCHECKBOXES := 0x200;TVS_EX_DRAWIMAGEASYNC := 0x400;TVIF_TEXT := 0x1; + TVIF_IMAGE := 0x2;TVIF_PARAM := 0x4;TVIF_STATE := 0x8; + TVIF_HANDLE := 0x10;TVIF_SELECTEDIMAGE := 0x20;TVIF_CHILDREN := 0x40; + TVIF_INTEGRAL := 0x80;TVIF_STATEEX := 0x100;TVIF_EXPANDEDIMAGE := 0x200; + TVIS_SELECTED := 0x2;TVIS_CUT := 0x4;TVIS_DROPHILITED := 0x8; + TVIS_BOLD := 0x10;TVIS_EXPANDED := 0x20;TVIS_EXPANDEDONCE := 0x40; + TVIS_EXPANDPARTIAL := 0x80;TVIS_OVERLAYMASK := 0xF00;TVIS_STATEIMAGEMASK := 0xF000; + TVIS_USERMASK := 0xF000;TVIS_EX_FLAT := 0x1;TVIS_EX_DISABLED := 0x2; + TVIS_EX_ALL := 0x2;I_CHILDRENCALLBACK := 0xFFFFFFFF;I_CHILDRENAUTO := 0xFFFFFFFE; + LPTV_ITEMW := 0x0;LPTV_ITEMA := 0x0;TV_ITEMW := 0x0; + TV_ITEMA := 0x0;LPTV_ITEM := NIL;TV_ITEM := NIL; + TVITEM := 0x0;LPTVITEM := 0x0;TVI_ROOT := 0xFFFF0000; + TVI_FIRST := 0xFFFF0001;TVI_LAST := 0xFFFF0002;TVI_SORT := 0xFFFF0003; + LPTV_INSERTSTRUCTA := 0x0;LPTV_INSERTSTRUCTW := 0x0;TV_INSERTSTRUCTA := 0x0; + TV_INSERTSTRUCTW := 0x0;TV_INSERTSTRUCT := NIL;LPTV_INSERTSTRUCT := NIL; + TVINSERTSTRUCT := 0x0;LPTVINSERTSTRUCT := 0x0;TVINSERTSTRUCT_V1_SIZE := 0x0; + TVM_INSERTITEMA := 0x1100;TVM_INSERTITEMW := 0x1132;TVM_INSERTITEM := 0x1100; + TVM_DELETEITEM := 0x1101;TVM_EXPAND := 0x1102;TVE_COLLAPSE := 0x1; + TVE_EXPAND := 0x2;TVE_TOGGLE := 0x3;TVE_EXPANDPARTIAL := 0x4000; + TVE_COLLAPSERESET := 0x8000;TVM_GETITEMRECT := 0x1104;TVM_GETCOUNT := 0x1105; + TVM_GETINDENT := 0x1106;TVM_SETINDENT := 0x1107;TVM_GETIMAGELIST := 0x1108; + TVSIL_NORMAL := 0x0;TVSIL_STATE := 0x2;TVM_SETIMAGELIST := 0x1109; + TVM_GETNEXTITEM := 0x110A;TVGN_ROOT := 0x0;TVGN_NEXT := 0x1; + TVGN_PREVIOUS := 0x2;TVGN_PARENT := 0x3;TVGN_CHILD := 0x4; + TVGN_FIRSTVISIBLE := 0x5;TVGN_NEXTVISIBLE := 0x6;TVGN_PREVIOUSVISIBLE := 0x7; + TVGN_DROPHILITE := 0x8;TVGN_CARET := 0x9;TVGN_LASTVISIBLE := 0xA; + TVGN_NEXTSELECTED := 0xB;TVSI_NOSINGLEEXPAND := 0x8000;TVM_SELECTITEM := 0x110B; + TVM_GETITEMA := 0x110C;TVM_GETITEMW := 0x113E;TVM_GETITEM := 0x110C; + TVM_SETITEMA := 0x110D;TVM_SETITEMW := 0x113F;TVM_SETITEM := 0x110D; + TVM_EDITLABELA := 0x110E;TVM_EDITLABELW := 0x1141;TVM_EDITLABEL := 0x110E; + TVM_GETEDITCONTROL := 0x110F;TVM_GETVISIBLECOUNT := 0x1110;TVM_HITTEST := 0x1111; + LPTV_HITTESTINFO := 0x0;TV_HITTESTINFO := 0x0;TVHT_NOWHERE := 0x1; + TVHT_ONITEMICON := 0x2;TVHT_ONITEMLABEL := 0x4;TVHT_ONITEM := 0x46; + TVHT_ONITEMINDENT := 0x8;TVHT_ONITEMBUTTON := 0x10;TVHT_ONITEMRIGHT := 0x20; + TVHT_ONITEMSTATEICON := 0x40;TVHT_ABOVE := 0x100;TVHT_BELOW := 0x200; + TVHT_TORIGHT := 0x400;TVHT_TOLEFT := 0x800;TVM_CREATEDRAGIMAGE := 0x1112; + TVM_SORTCHILDREN := 0x1113;TVM_ENSUREVISIBLE := 0x1114;TVM_SORTCHILDRENCB := 0x1115; + TVM_ENDEDITLABELNOW := 0x1116;TVM_GETISEARCHSTRINGA := 0x1117;TVM_GETISEARCHSTRINGW := 0x1140; + TVM_GETISEARCHSTRING := 0x1117;TVM_SETTOOLTIPS := 0x1118;TVM_GETTOOLTIPS := 0x1119; + TVM_SETINSERTMARK := 0x111A;TVM_SETUNICODEFORMAT := 0x2005;TVM_GETUNICODEFORMAT := 0x2006; + TVM_SETITEMHEIGHT := 0x111B;TVM_GETITEMHEIGHT := 0x111C;TVM_SETBKCOLOR := 0x111D; + TVM_SETTEXTCOLOR := 0x111E;TVM_GETBKCOLOR := 0x111F;TVM_GETTEXTCOLOR := 0x1120; + TVM_SETSCROLLTIME := 0x1121;TVM_GETSCROLLTIME := 0x1122;TVM_SETINSERTMARKCOLOR := 0x1125; + TVM_GETINSERTMARKCOLOR := 0x1126;TVM_SETBORDER := 0x1123;TVSBF_XBORDER := 0x1; + TVSBF_YBORDER := 0x2;TVM_GETITEMSTATE := 0x1127;TVM_SETLINECOLOR := 0x1128; + TVM_GETLINECOLOR := 0x1129;TVM_MAPACCIDTOHTREEITEM := 0x112A;TVM_MAPHTREEITEMTOACCID := 0x112B; + TVM_SETEXTENDEDSTYLE := 0x112C;TVM_GETEXTENDEDSTYLE := 0x112D;TVM_SETAUTOSCROLLINFO := 0x113B; + TVM_SETHOT := 0x113A;TVM_GETSELECTEDCOUNT := 0x1146;TVM_SHOWINFOTIP := 0x1147; + TVM_GETITEMPARTRECT := 0x1148;LPTV_SORTCB := 0x0;TV_SORTCB := 0x0; + LPNM_TREEVIEWA := 0x0;LPNM_TREEVIEWW := 0x0;NM_TREEVIEWW := 0x0; + NM_TREEVIEWA := 0x0;LPNM_TREEVIEW := NIL;NM_TREEVIEW := NIL; + NMTREEVIEW := 0x0;LPNMTREEVIEW := 0x0;TVN_SELCHANGINGA := 0xFFFFFE6F; + TVN_SELCHANGINGW := 0xFFFFFE3E;TVN_SELCHANGEDA := 0xFFFFFE6E;TVN_SELCHANGEDW := 0xFFFFFE3D; + TVC_UNKNOWN := 0x0;TVC_BYMOUSE := 0x1;TVC_BYKEYBOARD := 0x2; + TVN_GETDISPINFOA := 0xFFFFFE6D;TVN_GETDISPINFOW := 0xFFFFFE3C;TVN_SETDISPINFOA := 0xFFFFFE6C; + TVN_SETDISPINFOW := 0xFFFFFE3B;TVIF_DI_SETITEM := 0x1000;TV_DISPINFOA := 0x0; + TV_DISPINFOW := 0x0;TV_DISPINFO := NIL;NMTVDISPINFO := 0x0; + LPNMTVDISPINFO := 0x0;NMTVDISPINFOEX := 0x0;LPNMTVDISPINFOEX := 0x0; + TV_DISPINFOEXA := 0x0;TV_DISPINFOEX := 0x0;TVN_ITEMEXPANDINGA := 0xFFFFFE6B; + TVN_ITEMEXPANDINGW := 0xFFFFFE3A;TVN_ITEMEXPANDEDA := 0xFFFFFE6A;TVN_ITEMEXPANDEDW := 0xFFFFFE39; + TVN_BEGINDRAGA := 0xFFFFFE69;TVN_BEGINDRAGW := 0xFFFFFE38;TVN_BEGINRDRAGA := 0xFFFFFE68; + TVN_BEGINRDRAGW := 0xFFFFFE37;TVN_DELETEITEMA := 0xFFFFFE67;TVN_DELETEITEMW := 0xFFFFFE36; + TVN_BEGINLABELEDITA := 0xFFFFFE66;TVN_BEGINLABELEDITW := 0xFFFFFE35;TVN_ENDLABELEDITA := 0xFFFFFE65; + TVN_ENDLABELEDITW := 0xFFFFFE34;TVN_KEYDOWN := 0xFFFFFE64;TVN_GETINFOTIPA := 0xFFFFFE63; + TVN_GETINFOTIPW := 0xFFFFFE62;TVN_SINGLEEXPAND := 0xFFFFFE61;TVNRET_DEFAULT := 0x0; + TVNRET_SKIPOLD := 0x1;TVNRET_SKIPNEW := 0x2;TVN_ITEMCHANGINGA := 0xFFFFFE60; + TVN_ITEMCHANGINGW := 0xFFFFFE5F;TVN_ITEMCHANGEDA := 0xFFFFFE5E;TVN_ITEMCHANGEDW := 0xFFFFFE5D; + TVN_ASYNCDRAW := 0xFFFFFE5C;TV_KEYDOWN := 0x0;TVN_SELCHANGING := 0xFFFFFE6F; + TVN_SELCHANGED := 0xFFFFFE6E;TVN_GETDISPINFO := 0xFFFFFE6D;TVN_SETDISPINFO := 0xFFFFFE6C; + TVN_ITEMEXPANDING := 0xFFFFFE6B;TVN_ITEMEXPANDED := 0xFFFFFE6A;TVN_BEGINDRAG := 0xFFFFFE69; + TVN_BEGINRDRAG := 0xFFFFFE68;TVN_DELETEITEM := 0xFFFFFE67;TVN_BEGINLABELEDIT := 0xFFFFFE66; + TVN_ENDLABELEDIT := 0xFFFFFE65;TVN_GETINFOTIP := 0xFFFFFE63;NMTVGETINFOTIP := 0x0; + LPNMTVGETINFOTIP := 0x0;TVCDRF_NOIMAGES := 0x10000;TVN_ITEMCHANGING := 0xFFFFFE60; + TVN_ITEMCHANGED := 0xFFFFFE5E;WC_COMBOBOXEXW := "ComboBoxEx32";WC_COMBOBOXEXA := "ComboBoxEx32"; + WC_COMBOBOXEX := "ComboBoxEx32";CBEIF_TEXT := 0x1;CBEIF_IMAGE := 0x2; + CBEIF_SELECTEDIMAGE := 0x4;CBEIF_OVERLAY := 0x8;CBEIF_INDENT := 0x10; + CBEIF_LPARAM := 0x20;CBEIF_DI_SETITEM := 0x10000000;COMBOBOXEXITEM := 0x0; + PCOMBOBOXEXITEM := 0x0;PCCOMBOBOXEXITEM := 0x0;CBEM_INSERTITEMA := 0x401; + CBEM_SETIMAGELIST := 0x402;CBEM_GETIMAGELIST := 0x403;CBEM_GETITEMA := 0x404; + CBEM_SETITEMA := 0x405;CBEM_DELETEITEM := 0x144;CBEM_GETCOMBOCONTROL := 0x406; + CBEM_GETEDITCONTROL := 0x407;CBEM_SETEXSTYLE := 0x408;CBEM_SETEXTENDEDSTYLE := 0x40E; + CBEM_GETEXSTYLE := 0x409;CBEM_GETEXTENDEDSTYLE := 0x409;CBEM_SETUNICODEFORMAT := 0x2005; + CBEM_GETUNICODEFORMAT := 0x2006;CBEM_HASEDITCHANGED := 0x40A;CBEM_INSERTITEMW := 0x40B; + CBEM_SETITEMW := 0x40C;CBEM_GETITEMW := 0x40D;CBEM_INSERTITEM := 0x401; + CBEM_SETITEM := 0x405;CBEM_GETITEM := 0x404;CBEM_SETWINDOWTHEME := 0x200B; + CBES_EX_NOEDITIMAGE := 0x1;CBES_EX_NOEDITIMAGEINDENT := 0x2;CBES_EX_PATHWORDBREAKPROC := 0x4; + CBES_EX_NOSIZELIMIT := 0x8;CBES_EX_CASESENSITIVE := 0x10;CBES_EX_TEXTENDELLIPSIS := 0x20; + NMCOMBOBOXEX := 0x0;PNMCOMBOBOXEX := 0x0;CBEN_GETDISPINFO := NIL; + CBEN_GETDISPINFOA := 0xFFFFFCE0;CBEN_INSERTITEM := 0xFFFFFCDF;CBEN_DELETEITEM := 0xFFFFFCDE; + CBEN_BEGINEDIT := 0xFFFFFCDC;CBEN_ENDEDITA := 0xFFFFFCDB;CBEN_ENDEDITW := 0xFFFFFCDA; + CBEN_GETDISPINFOW := 0xFFFFFCD9;CBEN_DRAGBEGINA := 0xFFFFFCD8;CBEN_DRAGBEGINW := 0xFFFFFCD7; + CBEN_DRAGBEGIN := 0xFFFFFCD8;CBEN_ENDEDIT := 0xFFFFFCDB;CBENF_KILLFOCUS := 0x1; + CBENF_RETURN := 0x2;CBENF_ESCAPE := 0x3;CBENF_DROPDOWN := 0x4; + CBEMAXSTRLEN := 0x104;NMCBEDRAGBEGIN := 0x0;LPNMCBEDRAGBEGIN := 0x0; + PNMCBEDRAGBEGIN := 0x0;NMCBEENDEDIT := 0x0;LPNMCBEENDEDIT := 0x0; + PNMCBEENDEDIT := 0x0;WC_TABCONTROLA := "SysTabControl32";WC_TABCONTROLW := "SysTabControl32"; + WC_TABCONTROL := "SysTabControl32";TCS_SCROLLOPPOSITE := 0x1;TCS_BOTTOM := 0x2; + TCS_RIGHT := 0x2;TCS_MULTISELECT := 0x4;TCS_FLATBUTTONS := 0x8; + TCS_FORCEICONLEFT := 0x10;TCS_FORCELABELLEFT := 0x20;TCS_HOTTRACK := 0x40; + TCS_VERTICAL := 0x80;TCS_TABS := 0x0;TCS_BUTTONS := 0x100; + TCS_SINGLELINE := 0x0;TCS_MULTILINE := 0x200;TCS_RIGHTJUSTIFY := 0x0; + TCS_FIXEDWIDTH := 0x400;TCS_RAGGEDRIGHT := 0x800;TCS_FOCUSONBUTTONDOWN := 0x1000; + TCS_OWNERDRAWFIXED := 0x2000;TCS_TOOLTIPS := 0x4000;TCS_FOCUSNEVER := 0x8000; + TCS_EX_FLATSEPARATORS := 0x1;TCS_EX_REGISTERDROP := 0x2;TCM_GETIMAGELIST := 0x1302; + TCM_SETIMAGELIST := 0x1303;TCM_GETITEMCOUNT := 0x1304;TCIF_TEXT := 0x1; + TCIF_IMAGE := 0x2;TCIF_RTLREADING := 0x4;TCIF_PARAM := 0x8; + TCIF_STATE := 0x10;TCIS_BUTTONPRESSED := 0x1;TCIS_HIGHLIGHTED := 0x2; + TC_ITEMHEADERA := 0x0;TC_ITEMHEADERW := 0x0;TC_ITEMHEADER := NIL; + TCITEMHEADER := 0x0;LPTCITEMHEADER := 0x0;TC_ITEMA := 0x0; + TC_ITEMW := 0x0;TC_ITEM := NIL;TCITEM := 0x0; + LPTCITEM := 0x0;TCM_GETITEMA := 0x1305;TCM_GETITEMW := 0x133C; + TCM_GETITEM := 0x1305;TCM_SETITEMA := 0x1306;TCM_SETITEMW := 0x133D; + TCM_SETITEM := 0x1306;TCM_INSERTITEMA := 0x1307;TCM_INSERTITEMW := 0x133E; + TCM_INSERTITEM := 0x1307;TCM_DELETEITEM := 0x1308;TCM_DELETEALLITEMS := 0x1309; + TCM_GETITEMRECT := 0x130A;TCM_GETCURSEL := 0x130B;TCM_SETCURSEL := 0x130C; + TCHT_NOWHERE := 0x1;TCHT_ONITEMICON := 0x2;TCHT_ONITEMLABEL := 0x4; + TCHT_ONITEM := 0x6;LPTC_HITTESTINFO := 0x0;TC_HITTESTINFO := 0x0; + TCM_HITTEST := 0x130D;TCM_SETITEMEXTRA := 0x130E;TCM_ADJUSTRECT := 0x1328; + TCM_SETITEMSIZE := 0x1329;TCM_REMOVEIMAGE := 0x132A;TCM_SETPADDING := 0x132B; + TCM_GETROWCOUNT := 0x132C;TCM_GETTOOLTIPS := 0x132D;TCM_SETTOOLTIPS := 0x132E; + TCM_GETCURFOCUS := 0x132F;TCM_SETCURFOCUS := 0x1330;TCM_SETMINTABWIDTH := 0x1331; + TCM_DESELECTALL := 0x1332;TCM_HIGHLIGHTITEM := 0x1333;TCM_SETEXTENDEDSTYLE := 0x1334; + TCM_GETEXTENDEDSTYLE := 0x1335;TCM_SETUNICODEFORMAT := 0x2005;TCM_GETUNICODEFORMAT := 0x2006; + TCN_KEYDOWN := 0xFFFFFDDA;TC_KEYDOWN := 0x0;TCN_SELCHANGE := 0xFFFFFDD9; + TCN_SELCHANGING := 0xFFFFFDD8;TCN_GETOBJECT := 0xFFFFFDD7;TCN_FOCUSCHANGE := 0xFFFFFDD6; + ANIMATE_CLASSW := "SysAnimate32";ANIMATE_CLASSA := "SysAnimate32";ANIMATE_CLASS := "SysAnimate32"; + ACS_CENTER := 0x1;ACS_TRANSPARENT := 0x2;ACS_AUTOPLAY := 0x4; + ACS_TIMER := 0x8;ACM_OPENA := 0x464;ACM_OPENW := 0x467; + ACM_OPEN := 0x464;ACM_PLAY := 0x465;ACM_STOP := 0x466; + ACM_ISPLAYING := 0x468;ACN_START := 0x1;ACN_STOP := 0x2; + MONTHCAL_CLASSW := "SysMonthCal32";MONTHCAL_CLASSA := "SysMonthCal32";MONTHCAL_CLASS := "SysMonthCal32"; + MCM_FIRST := 0x1000;MCM_GETCURSEL := 0x1001;MCM_SETCURSEL := 0x1002; + MCM_GETMAXSELCOUNT := 0x1003;MCM_SETMAXSELCOUNT := 0x1004;MCM_GETSELRANGE := 0x1005; + MCM_SETSELRANGE := 0x1006;MCM_GETMONTHRANGE := 0x1007;MCM_SETDAYSTATE := 0x1008; + MCM_GETMINREQRECT := 0x1009;MCM_SETCOLOR := 0x100A;MCM_GETCOLOR := 0x100B; + MCSC_BACKGROUND := 0x0;MCSC_TEXT := 0x1;MCSC_TITLEBK := 0x2; + MCSC_TITLETEXT := 0x3;MCSC_MONTHBK := 0x4;MCSC_TRAILINGTEXT := 0x5; + MCM_SETTODAY := 0x100C;MCM_GETTODAY := 0x100D;MCM_HITTEST := 0x100E; + MCHT_TITLE := 0x10000;MCHT_CALENDAR := 0x20000;MCHT_TODAYLINK := 0x30000; + MCHT_CALENDARCONTROL := 0x100000;MCHT_NEXT := 0x1000000;MCHT_PREV := 0x2000000; + MCHT_NOWHERE := 0x0;MCHT_TITLEBK := 0x10000;MCHT_TITLEMONTH := 0x10001; + MCHT_TITLEYEAR := 0x10002;MCHT_TITLEBTNNEXT := 0x1010003;MCHT_TITLEBTNPREV := 0x2010003; + MCHT_CALENDARBK := 0x20000;MCHT_CALENDARDATE := 0x20001;MCHT_CALENDARDATENEXT := 0x1020001; + MCHT_CALENDARDATEPREV := 0x2020001;MCHT_CALENDARDAY := 0x20002;MCHT_CALENDARWEEKNUM := 0x20003; + MCHT_CALENDARDATEMIN := 0x20004;MCHT_CALENDARDATEMAX := 0x20005;MCM_SETFIRSTDAYOFWEEK := 0x100F; + MCM_GETFIRSTDAYOFWEEK := 0x1010;MCM_GETRANGE := 0x1011;MCM_SETRANGE := 0x1012; + MCM_GETMONTHDELTA := 0x1013;MCM_SETMONTHDELTA := 0x1014;MCM_GETMAXTODAYWIDTH := 0x1015; + MCM_SETUNICODEFORMAT := 0x2005;MCM_GETUNICODEFORMAT := 0x2006;MCMV_MONTH := 0x0; + MCMV_YEAR := 0x1;MCMV_DECADE := 0x2;MCMV_CENTURY := 0x3; + MCMV_MAX := 0x3;MCM_GETCURRENTVIEW := 0x1016;MCM_GETCALENDARCOUNT := 0x1017; + MCGIP_CALENDARCONTROL := 0x0;MCGIP_NEXT := 0x1;MCGIP_PREV := 0x2; + MCGIP_FOOTER := 0x3;MCGIP_CALENDAR := 0x4;MCGIP_CALENDARHEADER := 0x5; + MCGIP_CALENDARBODY := 0x6;MCGIP_CALENDARROW := 0x7;MCGIP_CALENDARCELL := 0x8; + MCGIF_DATE := 0x1;MCGIF_RECT := 0x2;MCGIF_NAME := 0x4; + MCM_GETCALENDARGRIDINFO := 0x1018;MCM_GETCALID := 0x101B;MCM_SETCALID := 0x101C; + MCM_SIZERECTTOMIN := 0x101D;MCM_SETCALENDARBORDER := 0x101E;MCM_GETCALENDARBORDER := 0x101F; + MCM_SETCURRENTVIEW := 0x1020;MCN_SELCHANGE := 0xFFFFFD13;MCN_GETDAYSTATE := 0xFFFFFD15; + MCN_SELECT := 0xFFFFFD16;MCN_VIEWCHANGE := 0xFFFFFD12;MCS_DAYSTATE := 0x1; + MCS_MULTISELECT := 0x2;MCS_WEEKNUMBERS := 0x4;MCS_NOTODAYCIRCLE := 0x8; + MCS_NOTODAY := 0x10;MCS_NOTRAILINGDATES := 0x40;MCS_SHORTDAYSOFWEEK := 0x80; + MCS_NOSELCHANGEONNAV := 0x100;GMR_VISIBLE := 0x0;GMR_DAYSTATE := 0x1; + DATETIMEPICK_CLASSW := "SysDateTimePick32";DATETIMEPICK_CLASSA := "SysDateTimePick32";DATETIMEPICK_CLASS := "SysDateTimePick32"; + DTM_FIRST := 0x1000;DTM_GETSYSTEMTIME := 0x1001;DTM_SETSYSTEMTIME := 0x1002; + DTM_GETRANGE := 0x1003;DTM_SETRANGE := 0x1004;DTM_SETFORMATA := 0x1005; + DTM_SETFORMATW := 0x1032;DTM_SETFORMAT := 0x1005;DTM_SETMCCOLOR := 0x1006; + DTM_GETMCCOLOR := 0x1007;DTM_GETMONTHCAL := 0x1008;DTM_SETMCFONT := 0x1009; + DTM_GETMCFONT := 0x100A;DTM_SETMCSTYLE := 0x100B;DTM_GETMCSTYLE := 0x100C; + DTM_CLOSEMONTHCAL := 0x100D;DTM_GETDATETIMEPICKERINFO := 0x100E;DTM_GETIDEALSIZE := 0x100F; + DTS_UPDOWN := 0x1;DTS_SHOWNONE := 0x2;DTS_SHORTDATEFORMAT := 0x0; + DTS_LONGDATEFORMAT := 0x4;DTS_SHORTDATECENTURYFORMAT := 0xC;DTS_TIMEFORMAT := 0x9; + DTS_APPCANPARSE := 0x10;DTS_RIGHTALIGN := 0x20;DTN_DATETIMECHANGE := 0xFFFFFD09; + DTN_USERSTRINGA := 0xFFFFFD0A;DTN_USERSTRINGW := 0xFFFFFD17;DTN_USERSTRING := 0xFFFFFD0A; + NMDATETIMESTRING := 0x0;LPNMDATETIMESTRING := 0x0;DTN_WMKEYDOWNA := 0xFFFFFD0B; + DTN_WMKEYDOWNW := 0xFFFFFD18;DTN_WMKEYDOWN := 0xFFFFFD0B;NMDATETIMEWMKEYDOWN := 0x0; + LPNMDATETIMEWMKEYDOWN := 0x0;DTN_FORMATA := 0xFFFFFD0C;DTN_FORMATW := 0xFFFFFD19; + DTN_FORMAT := 0xFFFFFD0C;NMDATETIMEFORMAT := 0x0;LPNMDATETIMEFORMAT := 0x0; + DTN_FORMATQUERYA := 0xFFFFFD0D;DTN_FORMATQUERYW := 0xFFFFFD1A;DTN_FORMATQUERY := 0xFFFFFD0D; + NMDATETIMEFORMATQUERY := 0x0;LPNMDATETIMEFORMATQUERY := 0x0;DTN_DROPDOWN := 0xFFFFFD0E; + DTN_CLOSEUP := 0xFFFFFD0F;GDTR_MIN := 0x1;GDTR_MAX := 0x2; + GDT_ERROR := 0xFFFFFFFF;GDT_VALID := 0x0;GDT_NONE := 0x1; + IPM_CLEARADDRESS := 0x464;IPM_SETADDRESS := 0x465;IPM_GETADDRESS := 0x466; + IPM_SETRANGE := 0x467;IPM_SETFOCUS := 0x468;IPM_ISBLANK := 0x469; + WC_IPADDRESSW := "SysIPAddress32";WC_IPADDRESSA := "SysIPAddress32";WC_IPADDRESS := "SysIPAddress32"; + IPN_FIELDCHANGED := 0xFFFFFCA4;WC_PAGESCROLLERW := "SysPager";WC_PAGESCROLLERA := "SysPager"; + WC_PAGESCROLLER := "SysPager";PGS_VERT := 0x0;PGS_HORZ := 0x1; + PGS_AUTOSCROLL := 0x2;PGS_DRAGNDROP := 0x4;PGF_INVISIBLE := 0x0; + PGF_NORMAL := 0x1;PGF_GRAYED := 0x2;PGF_DEPRESSED := 0x4; + PGF_HOT := 0x8;PGB_TOPORLEFT := 0x0;PGB_BOTTOMORRIGHT := 0x1; + PGM_SETCHILD := 0x1401;PGM_RECALCSIZE := 0x1402;PGM_FORWARDMOUSE := 0x1403; + PGM_SETBKCOLOR := 0x1404;PGM_GETBKCOLOR := 0x1405;PGM_SETBORDER := 0x1406; + PGM_GETBORDER := 0x1407;PGM_SETPOS := 0x1408;PGM_GETPOS := 0x1409; + PGM_SETBUTTONSIZE := 0x140A;PGM_GETBUTTONSIZE := 0x140B;PGM_GETBUTTONSTATE := 0x140C; + PGM_GETDROPTARGET := 0x2004;PGM_SETSCROLLINFO := 0x140D;PGN_SCROLL := 0xFFFFFC7B; + PGF_SCROLLUP := 0x1;PGF_SCROLLDOWN := 0x2;PGF_SCROLLLEFT := 0x4; + PGF_SCROLLRIGHT := 0x8;PGK_SHIFT := 0x1;PGK_CONTROL := 0x2; + PGK_MENU := 0x4;PGN_CALCSIZE := 0xFFFFFC7A;PGF_CALCWIDTH := 0x1; + PGF_CALCHEIGHT := 0x2;PGN_HOTITEMCHANGE := 0xFFFFFC79;WC_NATIVEFONTCTLW := "NativeFontCt"; + WC_NATIVEFONTCTLA := "NativeFontCt";WC_NATIVEFONTCTL := "NativeFontCt";NFS_EDIT := 0x1; + NFS_STATIC := 0x2;NFS_LISTCOMBO := 0x4;NFS_BUTTON := 0x8; + NFS_ALL := 0x10;NFS_USEFONTASSOC := 0x20;WC_BUTTONA := "Button"; + WC_BUTTONW := "Button";WC_BUTTON := "Button";BUTTON_IMAGELIST_ALIGN_LEFT := 0x0; + BUTTON_IMAGELIST_ALIGN_RIGHT := 0x1;BUTTON_IMAGELIST_ALIGN_TOP := 0x2;BUTTON_IMAGELIST_ALIGN_BOTTOM := 0x3; + BUTTON_IMAGELIST_ALIGN_CENTER := 0x4;BCM_GETIDEALSIZE := 0x1601;BCM_SETIMAGELIST := 0x1602; + BCM_GETIMAGELIST := 0x1603;BCM_SETTEXTMARGIN := 0x1604;BCM_GETTEXTMARGIN := 0x1605; + BCN_HOTITEMCHANGE := 0xFFFFFB1F;BST_HOT := 0x200;BST_DROPDOWNPUSHED := 0x400; + BS_SPLITBUTTON := 0xC;BS_DEFSPLITBUTTON := 0xD;BS_COMMANDLINK := 0xE; + BS_DEFCOMMANDLINK := 0xF;BCSIF_GLYPH := 0x1;BCSIF_IMAGE := 0x2; + BCSIF_STYLE := 0x4;BCSIF_SIZE := 0x8;BCSS_NOSPLIT := 0x1; + BCSS_STRETCH := 0x2;BCSS_ALIGNLEFT := 0x4;BCSS_IMAGE := 0x8; + BCM_SETDROPDOWNSTATE := 0x1606;BCM_SETSPLITINFO := 0x1607;BCM_GETSPLITINFO := 0x1608; + BCM_SETNOTE := 0x1609;BCM_GETNOTE := 0x160A;BCM_GETNOTELENGTH := 0x160B; + BCM_SETSHIELD := 0x160C;BCCL_NOGLYPH := 0xFFFFFFFF;BCN_DROPDOWN := 0xFFFFFB20; + WC_STATICA := "Static";WC_STATICW := "Static";WC_STATIC := "Static"; + WC_EDITA := "Edit";WC_EDITW := "Edit";WC_EDIT := "Edit"; + EM_SETCUEBANNER := 0x1501;EM_GETCUEBANNER := 0x1502;EM_SHOWBALLOONTIP := 0x1503; + EM_HIDEBALLOONTIP := 0x1504;EM_SETHILITE := 0x1505;EM_GETHILITE := 0x1506; + EM_NOSETFOCUS := 0x1507;EM_TAKEFOCUS := 0x1508;WC_LISTBOXA := "ListBox"; + WC_LISTBOXW := "ListBox";WC_LISTBOX := "ListBox";WC_COMBOBOXA := "ComboBox"; + WC_COMBOBOXW := "ComboBox";WC_COMBOBOX := "ComboBox";CB_SETMINVISIBLE := 0x1701; + CB_GETMINVISIBLE := 0x1702;CB_SETCUEBANNER := 0x1703;CB_GETCUEBANNER := 0x1704; + WC_SCROLLBARA := "ScrollBar";WC_SCROLLBARW := "ScrollBar";WC_SCROLLBAR := "ScrollBar"; + DA_LAST := 0x7FFFFFFF;DA_ERR := 0xFFFFFFFF;DSA_APPEND := 0x7FFFFFFF; + DSA_ERR := 0xFFFFFFFF;PFNDSAENUMCALLBACK := 0x0;PFNDSAENUMCALLBACKCONST := 0x0; + PFNDSACOMPARE := 0x0;PFNDSACOMPARECONST := 0x0;DPAM_SORTED := 0x1; + DPAM_NORMAL := 0x2;DPAM_UNION := 0x4;DPAM_INTERSECT := 0x8; + DPAMM_MERGE := 0x1;DPAMM_DELETE := 0x2;DPAMM_INSERT := 0x3; + DPAS_SORTED := 0x1;DPAS_INSERTBEFORE := 0x2;DPAS_INSERTAFTER := 0x4; + DPA_APPEND := 0x7FFFFFFF;DPA_ERR := 0xFFFFFFFF;PFNDPAENUMCALLBACK := 0x0; + PFNDPAENUMCALLBACKCONST := 0x0;PFNDPACOMPARE := 0x0;PFNDPACOMPARECONST := 0x0; + WM_MOUSEHOVER := 0x2A1;WM_MOUSELEAVE := 0x2A3;TME_HOVER := 0x1; + TME_LEAVE := 0x2;TME_NONCLIENT := 0x10;TME_QUERY := 0x40000000; + TME_CANCEL := 0x80000000;HOVER_DEFAULT := 0xFFFFFFFF;WSB_PROP_CYVSCROLL := 0x1; + WSB_PROP_CXHSCROLL := 0x2;WSB_PROP_CYHSCROLL := 0x4;WSB_PROP_CXVSCROLL := 0x8; + WSB_PROP_CXHTHUMB := 0x10;WSB_PROP_CYVTHUMB := 0x20;WSB_PROP_VBKGCOLOR := 0x40; + WSB_PROP_HBKGCOLOR := 0x80;WSB_PROP_VSTYLE := 0x100;WSB_PROP_HSTYLE := 0x200; + WSB_PROP_WINSTYLE := 0x400;WSB_PROP_PALETTE := 0x800;WSB_PROP_MASK := 0xFFF; + FSB_FLAT_MODE := 0x2;FSB_ENCARTA_MODE := 0x1;FSB_REGULAR_MODE := 0x0; + FLATSB_GETSCROLLPROPPTR := 0x0;FLATSB_SETSCROLLPROPPTR := 0x0; + end +end +type _tvclmsageid_ = class() + static LM_USER;static WM_USER;static LM_LCL; + static LM_ACTIVATEITEM;static LM_CHANGED;static LM_FOCUS; + static LM_CLICKED;static LM_RELEASED;static LM_ENTER; + static LM_LEAVE;static LM_CHECKRESIZE;static LM_SETEDITABLE; + static LM_MOVEWORD;static LM_MOVEPAGE;static LM_MOVETOROW; + static LM_MOVETOCOLUMN;static LM_KILLCHAR;static LM_KILLWORD; + static LM_KILLLINE;static LM_CONFIGUREEVENT;static LM_EXIT; + static LM_CLOSEQUERY;static LM_DRAGSTART;static LM_QUIT; + static LM_MONTHCHANGED;static LM_YEARCHANGED;static LM_DAYCHANGED; + static LM_MOUSEFIRST2;static LM_LBUTTONTRIPLECLK;static LM_LBUTTONQUADCLK; + static LM_MBUTTONTRIPLECLK;static LM_MBUTTONQUADCLK;static LM_RBUTTONTRIPLECLK; + static LM_RBUTTONQUADCLK;static LM_MOUSEENTER;static LM_MOUSELEAVE; + static LM_XBUTTONTRIPLECLK;static LM_XBUTTONQUADCLK;static LM_MOUSELAST2; + static LM_GRABFOCUS;static LM_DRAWLISTITEM;static LM_INTERFACEFIRST; + static LM_INTERFACELAST;static LM_UNKNOWN;static SC_SIZE; + static SC_MOVE;static SC_MINIMIZE;static SC_MAXIMIZE; + static SC_NEXTWINDOW;static SC_PREVWINDOW;static SC_CLOSE; + static SC_VSCROLL;static SC_HSCROLL;static SC_MOUSEMENU; + static SC_KEYMENU;static SC_ARRANGE;static SC_RESTORE; + static SC_TASKLIST;static SC_SCREENSAVE;static SC_HOTKEY; + static SC_DEFAULT;static SC_MONITORPOWER;static SC_CONTEXTHELP; + static SC_SEPARATOR;static LM_NULL;static LM_CREATE; + static LM_DESTROY;static LM_MOVE;static LM_SIZE; + static LM_ACTIVATE;static LM_SETFOCUS;static LM_KILLFOCUS; + static LM_ENABLE;static LM_GETTEXTLENGTH;static LM_PAINT; + static LM_ERASEBKGND;static LM_SHOWWINDOW;static LM_CANCELMODE; + static LM_SETCURSOR;static LM_DRAWITEM;static LM_MEASUREITEM; + static LM_DELETEITEM;static LM_VKEYTOITEM;static LM_CHARTOITEM; + static LM_SETFONT;static LM_COMPAREITEM;static LM_WINDOWPOSCHANGING; + static LM_WINDOWPOSCHANGED;static LM_NOTIFY;static LM_HELP; + static LM_NOTIFYFORMAT;static LM_CONTEXTMENU;static LM_NCCALCSIZE; + static LM_NCHITTEST;static LM_NCPAINT;static LM_NCACTIVATE; + static LM_GETDLGCODE;static LM_NCMOUSEMOVE;static LM_NCLBUTTONDOWN; + static LM_NCLBUTTONUP;static LM_NCLBUTTONDBLCLK;static LM_KEYFIRST; + static LM_KEYDOWN;static LM_KEYUP;static LM_CHAR; + static LM_SYSKEYDOWN;static LM_SYSKEYUP;static LM_SYSCHAR; + static LM_KEYLAST;static LM_COMMAND;static LM_SYSCOMMAND; + static LM_TIMER;static LM_HSCROLL;static LM_VSCROLL; + static LM_CTLCOLORMSGBOX;static LM_CTLCOLOREDIT;static LM_CTLCOLORLISTBOX; + static LM_CTLCOLORBTN;static LM_CTLCOLORDLG;static LM_CTLCOLORSCROLLBAR; + static LM_CTLCOLORSTATIC;static LM_MOUSEFIRST;static LM_MOUSEMOVE; + static LM_LBUTTONDOWN;static LM_LBUTTONUP;static LM_LBUTTONDBLCLK; + static LM_RBUTTONDOWN;static LM_RBUTTONUP;static LM_RBUTTONDBLCLK; + static LM_MBUTTONDOWN;static LM_MBUTTONUP;static LM_MBUTTONDBLCLK; + static LM_MOUSEWHEEL;static LM_XBUTTONDOWN;static LM_XBUTTONUP; + static LM_XBUTTONDBLCLK;static LM_MOUSELAST;static LM_PARENTNOTIFY; + static LM_CAPTURECHANGED;static LM_DROPFILES;static LM_SELCHANGE; + static LM_DPICHANGED;static LM_CUT;static LM_COPY; + static LM_PASTE;static LM_CLEAR;static CM_BASE; + static CM_LCLOFFSET;static CM_ACTIVATE;static CM_DEACTIVATE; + static CM_GOTFOCUS;static CM_LOSTFOCUS;static CM_CANCELMODE; + static CM_DIALOGKEY;static CM_DIALOGCHAR;static CM_FOCUSCHANGED; + static CM_PARENTFONTCHANGED;static CM_PARENTCOLORCHANGED;static CM_HITTEST; + static CM_VISIBLECHANGED;static CM_ENABLEDCHANGED;static CM_COLORCHANGED; + static CM_FONTCHANGED;static CM_CURSORCHANGED;static CM_CTL3DCHANGED; + static CM_PARENTCTL3DCHANGED;static CM_TEXTCHANGED;static CM_MOUSEENTER; + static CM_MOUSELEAVE;static CM_MENUCHANGED;static CM_APPKEYDOWN; + static CM_APPSYSCOMMAND;static CM_BUTTONPRESSED;static CM_SHOWINGCHANGED; + static CM_ENTER;static CM_EXIT;static CM_DESIGNHITTEST; + static CM_ICONCHANGED;static CM_WANTSPECIALKEY;static CM_INVOKEHELP; + static CM_WINDOWHOOK;static CM_RELEASE;static CM_SHOWHINTCHANGED; + static CM_PARENTSHOWHINTCHANGED;static CM_SYSCOLORCHANGE;static CM_WININICHANGE; + static CM_FONTCHANGE;static CM_TIMECHANGE;static CM_TABSTOPCHANGED; + static CM_UIACTIVATE;static CM_UIDEACTIVATE;static CM_DOCWINDOWACTIVATE; + static CM_CONTROLLISTCHANGE;static CM_GETDATALINK;static CM_CHILDKEY; + static CM_DRAG;static CM_HINTSHOW;static CM_DIALOGHANDLE; + static CM_ISTOOLCONTROL;static CM_RECREATEWND;static CM_INVALIDATE; + static CM_SYSFONTCHANGED;static CM_CONTROLCHANGE;static CM_CHANGED; + static CM_DOCKCLIENT;static CM_UNDOCKCLIENT;static CM_FLOAT; + static CM_BORDERCHANGED;static CM_BIDIMODECHANGED;static CM_PARENTBIDIMODECHANGED; + static CM_ALLCHILDRENFLIPPED;static CM_ACTIONUPDATE;static CM_ACTIONEXECUTE; + static CM_HINTSHOWPAUSE;static CM_DOCKNOTIFICATION;static CM_MOUSEWHEEL; + static CM_ISSHORTCUT;static CM_UPDATEACTIONS;static CM_INVALIDATEDOCKHOST; + static CM_SETACTIVECONTROL;static CM_POPUPHWNDDESTROY;static CM_CREATEPOPUP; + static CM_DESTROYHANDLE;static CM_MOUSEACTIVATE;static CM_CONTROLLISTCHANGING; + static CM_BUFFEREDPRINTCLIENT;static CM_UNTHEMECONTROL;static CM_DOUBLEBUFFEREDCHANGED; + static CM_PARENTDOUBLEBUFFEREDCHANGED;static CM_THEMECHANGED;static CM_GESTURE; + static CM_CUSTOMGESTURESCHANGED;static CM_GESTUREMANAGERCHANGED;static CM_STANDARDGESTURESCHANGED; + static CM_INPUTLANGCHANGE;static CM_TABLETOPTIONSCHANGED;static CM_PARENTTABLETOPTIONSCHANGED; + static CM_APPSHOWBTNGLYPHCHANGED;static CM_APPSHOWMENUGLYPHCHANGED;static CN_BASE; + static CN_CHARTOITEM;static CN_COMMAND;static CN_COMPAREITEM; + static CN_CTLCOLORBTN;static CN_CTLCOLORDLG;static CN_CTLCOLOREDIT; + static CN_CTLCOLORLISTBOX;static CN_CTLCOLORMSGBOX;static CN_CTLCOLORSCROLLBAR; + static CN_CTLCOLORSTATIC;static CN_DELETEITEM;static CN_DRAWITEM; + static CN_HSCROLL;static CN_MEASUREITEM;static CN_PARENTNOTIFY; + static CN_VKEYTOITEM;static CN_VSCROLL;static CN_KEYDOWN; + static CN_KEYUP;static CN_CHAR;static CN_SYSKEYUP; + static CN_SYSKEYDOWN;static CN_SYSCHAR;static CN_NOTIFY; + static CN_ALIGN;static CN_ANCHOR; + // + static csNone;static csButton;static csComboBox; + static csCheckbox;static csEdit;static csForm; + static csStaticText;static csScrollBar;static csListView; + static csMemo;static csMainMenu;static csMenuBar; + static csMenuItem;static csNotebook;static csFileDialog; + static csRadioButton;static csScrolledWindow;static csSpinedit; + static csStatusBar;static csToggleBox;static csGroupBox; + static csPage;static csColorDialog;static csListBox; + static csFontDialog;static csProgressBar;static csTrackBar; + static csWinControl;static csFixed;static csBitBtn; + static csCListBox;static csPopupMenu;static csHintWindow; + static csCalendar;static csArrow;static csPanel; + static csScrollBox;static csCheckListBox;static csPairSplitter; + static csPairSplitterSide;static csOpenFileDialog;static csSaveFileDialog; + static csSelectDirectoryDialog;static csPreviewFileControl;static csPreviewFileDialog; + static csNonLCL; + class function sinit(); + begin + LM_USER := 0x400;WM_USER := LM_USER;LM_LCL := LM_USER + 0x10000; + LM_ACTIVATEITEM := LM_LCL + 04;LM_CHANGED := LM_LCL + 05;LM_FOCUS := LM_LCL + 06; + LM_CLICKED := LM_LCL + 07;LM_RELEASED := LM_LCL + 09;LM_ENTER := LM_LCL + 11; + LM_LEAVE := LM_LCL + 12;LM_CHECKRESIZE := LM_LCL + 14;LM_SETEDITABLE := LM_LCL + 18; + LM_MOVEWORD := LM_LCL + 19;LM_MOVEPAGE := LM_LCL + 20;LM_MOVETOROW := LM_LCL + 21; + LM_MOVETOCOLUMN := LM_LCL + 22;LM_KILLCHAR := LM_LCL + 23;LM_KILLWORD := LM_LCL + 24; + LM_KILLLINE := LM_LCL + 25;LM_CONFIGUREEVENT := LM_LCL + 31;LM_EXIT := LM_LCL + 60; + LM_CLOSEQUERY := LM_LCL + 62;LM_DRAGSTART := LM_LCL + 63;LM_QUIT := LM_LCL + 65; + LM_MONTHCHANGED := LM_LCL + 66;LM_YEARCHANGED := LM_LCL + 67;LM_DAYCHANGED := LM_LCL + 68; + LM_MOUSEFIRST2 := LM_LCL + 70;LM_LBUTTONTRIPLECLK := LM_MOUSEFIRST2 + 0;LM_LBUTTONQUADCLK := LM_MOUSEFIRST2 + 1; + LM_MBUTTONTRIPLECLK := LM_MOUSEFIRST2 + 2;LM_MBUTTONQUADCLK := LM_MOUSEFIRST2 + 3;LM_RBUTTONTRIPLECLK := LM_MOUSEFIRST2 + 4; + LM_RBUTTONQUADCLK := LM_MOUSEFIRST2 + 5;LM_MOUSEENTER := LM_MOUSEFIRST2 + 6;LM_MOUSELEAVE := LM_MOUSEFIRST2 + 7; + LM_XBUTTONTRIPLECLK := LM_MOUSEFIRST2 + 8;LM_XBUTTONQUADCLK := LM_MOUSEFIRST2 + 9;LM_MOUSELAST2 := LM_XBUTTONQUADCLK; + LM_GRABFOCUS := LM_LCL + 80;LM_DRAWLISTITEM := LM_LCL + 81;LM_INTERFACEFIRST := LM_LCL + 99; + LM_INTERFACELAST := LM_LCL + 199;LM_UNKNOWN := LM_INTERFACELAST + 1;SC_SIZE := 61440; + SC_MOVE := 61456;SC_MINIMIZE := 61472;SC_MAXIMIZE := 61488; + SC_NEXTWINDOW := 61504;SC_PREVWINDOW := 61520;SC_CLOSE := 61536; + SC_VSCROLL := 61552;SC_HSCROLL := 61568;SC_MOUSEMENU := 61584; + SC_KEYMENU := 61696;SC_ARRANGE := 61712;SC_RESTORE := 61728; + SC_TASKLIST := 61744;SC_SCREENSAVE := 61760;SC_HOTKEY := 61776; + SC_DEFAULT := 61792;SC_MONITORPOWER := 61808;SC_CONTEXTHELP := 61824; + SC_SEPARATOR := 61455;LM_NULL := 0x0000;LM_CREATE := 0x0001; + LM_DESTROY := 0x0002;LM_MOVE := 0x0003;LM_SIZE := 0x0005; + LM_ACTIVATE := 0x0006;LM_SETFOCUS := 0x0007;LM_KILLFOCUS := 0x0008; + LM_ENABLE := 0x000A;LM_GETTEXTLENGTH := 0x000E;LM_PAINT := 0x000F; + LM_ERASEBKGND := 0x0014;LM_SHOWWINDOW := 0x0018;LM_CANCELMODE := 0x001F; + LM_SETCURSOR := 0x0020;LM_DRAWITEM := 0x002B;LM_MEASUREITEM := 0x002C; + LM_DELETEITEM := 0x002D;LM_VKEYTOITEM := 0x002E;LM_CHARTOITEM := 0x002F; + LM_SETFONT := 0x0030;LM_COMPAREITEM := 0x0039;LM_WINDOWPOSCHANGING := 0x0046; + LM_WINDOWPOSCHANGED := 0x0047;LM_NOTIFY := 0x004E;LM_HELP := 0x0053; + LM_NOTIFYFORMAT := 0x0055;LM_CONTEXTMENU := 0x007B;LM_NCCALCSIZE := 0x0083; + LM_NCHITTEST := 0x0084;LM_NCPAINT := 0x0085;LM_NCACTIVATE := 0x0086; + LM_GETDLGCODE := 0x0087;LM_NCMOUSEMOVE := 0x00A0;LM_NCLBUTTONDOWN := 0x00A1; + LM_NCLBUTTONUP := 0x00A2;LM_NCLBUTTONDBLCLK := 0x00A3;LM_KEYFIRST := 0x0100; + LM_KEYDOWN := 0x0100;LM_KEYUP := 0x0101;LM_CHAR := 0x0102; + LM_SYSKEYDOWN := 0x0104;LM_SYSKEYUP := 0x0105;LM_SYSCHAR := 0x0106; + LM_KEYLAST := 0x0108;LM_COMMAND := 0x0111;LM_SYSCOMMAND := 0x0112; + LM_TIMER := 0x0113;LM_HSCROLL := 0x0114;LM_VSCROLL := 0x0115; + LM_CTLCOLORMSGBOX := 0x0132;LM_CTLCOLOREDIT := 0x0133;LM_CTLCOLORLISTBOX := 0x0134; + LM_CTLCOLORBTN := 0x0135;LM_CTLCOLORDLG := 0x0136;LM_CTLCOLORSCROLLBAR := 0x0137; + LM_CTLCOLORSTATIC := 0x0138;LM_MOUSEFIRST := 0x0200;LM_MOUSEMOVE := 0x0200; + LM_LBUTTONDOWN := 0x0201;LM_LBUTTONUP := 0x0202;LM_LBUTTONDBLCLK := 0x0203; + LM_RBUTTONDOWN := 0x0204;LM_RBUTTONUP := 0x0205;LM_RBUTTONDBLCLK := 0x0206; + LM_MBUTTONDOWN := 0x0207;LM_MBUTTONUP := 0x0208;LM_MBUTTONDBLCLK := 0x0209; + LM_MOUSEWHEEL := 0x020A;LM_XBUTTONDOWN := 0x020B;LM_XBUTTONUP := 0x020C; + LM_XBUTTONDBLCLK := 0x020D;LM_MOUSELAST := 0x020D;LM_PARENTNOTIFY := 0x0210; + LM_CAPTURECHANGED := 0x0215;LM_DROPFILES := 0x0233;LM_SELCHANGE := 0x0234; + LM_DPICHANGED := 0x02E0;LM_CUT := 0x0300;LM_COPY := 0x0301; + LM_PASTE := 0x0302;LM_CLEAR := 0x0303;CM_BASE := 0xB000; + CM_LCLOFFSET := 0x100;CM_ACTIVATE := CM_BASE + 0;CM_DEACTIVATE := CM_BASE + 1; + CM_GOTFOCUS := CM_BASE + 2;CM_LOSTFOCUS := CM_BASE + 3;CM_CANCELMODE := CM_BASE + 4; + CM_DIALOGKEY := CM_BASE + 5;CM_DIALOGCHAR := CM_BASE + 6;CM_FOCUSCHANGED := CM_BASE + 7; + CM_PARENTFONTCHANGED := CM_BASE + 8;CM_PARENTCOLORCHANGED := CM_BASE + 9;CM_HITTEST := CM_BASE + 10; + CM_VISIBLECHANGED := CM_BASE + 11;CM_ENABLEDCHANGED := CM_BASE + 12;CM_COLORCHANGED := CM_BASE + 13; + CM_FONTCHANGED := CM_BASE + 14;CM_CURSORCHANGED := CM_BASE + 15;CM_CTL3DCHANGED := CM_BASE + 16; + CM_PARENTCTL3DCHANGED := CM_BASE + 17;CM_TEXTCHANGED := CM_BASE + 18;CM_MOUSEENTER := CM_BASE + 19; + CM_MOUSELEAVE := CM_BASE + 20;CM_MENUCHANGED := CM_BASE + 21;CM_APPKEYDOWN := CM_BASE + 22; + CM_APPSYSCOMMAND := CM_BASE + 23;CM_BUTTONPRESSED := CM_BASE + 24;CM_SHOWINGCHANGED := CM_BASE + 25; + CM_ENTER := CM_BASE + 26;CM_EXIT := CM_BASE + 27;CM_DESIGNHITTEST := CM_BASE + 28; + CM_ICONCHANGED := CM_BASE + 29;CM_WANTSPECIALKEY := CM_BASE + 30;CM_INVOKEHELP := CM_BASE + 31; + CM_WINDOWHOOK := CM_BASE + 32;CM_RELEASE := CM_BASE + 33;CM_SHOWHINTCHANGED := CM_BASE + 34; + CM_PARENTSHOWHINTCHANGED := CM_BASE + 35;CM_SYSCOLORCHANGE := CM_BASE + 36;CM_WININICHANGE := CM_BASE + 37; + CM_FONTCHANGE := CM_BASE + 38;CM_TIMECHANGE := CM_BASE + 39;CM_TABSTOPCHANGED := CM_BASE + 40; + CM_UIACTIVATE := CM_BASE + 41;CM_UIDEACTIVATE := CM_BASE + 42;CM_DOCWINDOWACTIVATE := CM_BASE + 43; + CM_CONTROLLISTCHANGE := CM_BASE + 44;CM_GETDATALINK := CM_BASE + 45;CM_CHILDKEY := CM_BASE + 46; + CM_DRAG := CM_BASE + 47;CM_HINTSHOW := CM_BASE + 48;CM_DIALOGHANDLE := CM_BASE + 49; + CM_ISTOOLCONTROL := CM_BASE + 50;CM_RECREATEWND := CM_BASE + 51;CM_INVALIDATE := CM_BASE + 52; + CM_SYSFONTCHANGED := CM_BASE + 53;CM_CONTROLCHANGE := CM_BASE + 54;CM_CHANGED := CM_BASE + 55; + CM_DOCKCLIENT := CM_BASE + 56;CM_UNDOCKCLIENT := CM_BASE + 57;CM_FLOAT := CM_BASE + 58; + CM_BORDERCHANGED := CM_BASE + 59;CM_BIDIMODECHANGED := CM_BASE + 60;CM_PARENTBIDIMODECHANGED := CM_BASE + 61; + CM_ALLCHILDRENFLIPPED := CM_BASE + 62;CM_ACTIONUPDATE := CM_BASE + 63;CM_ACTIONEXECUTE := CM_BASE + 64; + CM_HINTSHOWPAUSE := CM_BASE + 65;CM_DOCKNOTIFICATION := CM_BASE + 66;CM_MOUSEWHEEL := CM_BASE + 67; + CM_ISSHORTCUT := CM_BASE + 68;CM_UPDATEACTIONS := CM_BASE + 69;CM_INVALIDATEDOCKHOST := CM_BASE + 70; + CM_SETACTIVECONTROL := CM_BASE + 71;CM_POPUPHWNDDESTROY := CM_BASE + 72;CM_CREATEPOPUP := CM_BASE + 73; + CM_DESTROYHANDLE := CM_BASE + 74;CM_MOUSEACTIVATE := CM_BASE + 75;CM_CONTROLLISTCHANGING := CM_BASE + 76; + CM_BUFFEREDPRINTCLIENT := CM_BASE + 77;CM_UNTHEMECONTROL := CM_BASE + 78;CM_DOUBLEBUFFEREDCHANGED := CM_BASE + 79; + CM_PARENTDOUBLEBUFFEREDCHANGED := CM_BASE + 80;CM_THEMECHANGED := CM_BASE + 81;CM_GESTURE := CM_BASE + 82; + CM_CUSTOMGESTURESCHANGED := CM_BASE + 83;CM_GESTUREMANAGERCHANGED := CM_BASE + 84;CM_STANDARDGESTURESCHANGED := CM_BASE + 85; + CM_INPUTLANGCHANGE := CM_BASE + 86;CM_TABLETOPTIONSCHANGED := CM_BASE + 87;CM_PARENTTABLETOPTIONSCHANGED := CM_BASE + 88; + CM_APPSHOWBTNGLYPHCHANGED := CM_BASE + CM_LCLOFFSET + 68;CM_APPSHOWMENUGLYPHCHANGED := CM_BASE + CM_LCLOFFSET + 69;CN_BASE := 0xBC00; + CN_CHARTOITEM := CN_BASE + LM_CHARTOITEM;CN_COMMAND := CN_BASE + LM_COMMAND;CN_COMPAREITEM := CN_BASE + LM_COMPAREITEM; + CN_CTLCOLORBTN := CN_BASE + LM_CTLCOLORBTN;CN_CTLCOLORDLG := CN_BASE + LM_CTLCOLORDLG;CN_CTLCOLOREDIT := CN_BASE + LM_CTLCOLOREDIT; + CN_CTLCOLORLISTBOX := CN_BASE + LM_CTLCOLORLISTBOX;CN_CTLCOLORMSGBOX := CN_BASE + LM_CTLCOLORMSGBOX;CN_CTLCOLORSCROLLBAR := CN_BASE + LM_CTLCOLORSCROLLBAR; + CN_CTLCOLORSTATIC := CN_BASE + LM_CTLCOLORSTATIC;CN_DELETEITEM := CN_BASE + LM_DELETEITEM;CN_DRAWITEM := CN_BASE + LM_DRAWITEM; + CN_HSCROLL := CN_BASE + LM_HSCROLL;CN_MEASUREITEM := CN_BASE + LM_MEASUREITEM;CN_PARENTNOTIFY := CN_BASE + LM_PARENTNOTIFY; + CN_VKEYTOITEM := CN_BASE + LM_VKEYTOITEM;CN_VSCROLL := CN_BASE + LM_VSCROLL;CN_KEYDOWN := CN_BASE + LM_KEYDOWN; + CN_KEYUP := CN_BASE + LM_KEYUP;CN_CHAR := CN_BASE + LM_CHAR;CN_SYSKEYUP := CN_BASE + LM_SYSKEYUP; + CN_SYSKEYDOWN := CN_BASE + LM_SYSKEYDOWN;CN_SYSCHAR := CN_BASE + LM_SYSCHAR;CN_NOTIFY := CN_BASE + LM_NOTIFY; + CN_ALIGN := CN_BASE+100;CN_ANCHOR := CN_BASE+101; + //20181218 + csNone := 0;csButton := 3;csComboBox := 4; + csCheckbox := 5;csEdit := 6;csForm := 7; + csStaticText := 8;csScrollBar := 10;csListView := 11; + csMemo := 13;csMainMenu := 14;csMenuBar := 15; + csMenuItem := 16;csNotebook := 17;csFileDialog := 18; + csRadioButton := 19;csScrolledWindow := 20;csSpinedit := 21; + csStatusBar := 22;csToggleBox := 24;csGroupBox := 29; + csPage := 34;csColorDialog := 35;csListBox := 36; + csFontDialog := 37;csProgressBar := 38;csTrackBar := 39; + csWinControl := 40;csFixed := csWinControl;csBitBtn := 44; + csCListBox := 45;csPopupMenu := 47;csHintWindow := 48; + csCalendar := 49;csArrow := 50;csPanel := 51; + csScrollBox := 52;csCheckListBox := 53;csPairSplitter := 54; + csPairSplitterSide := 55;csOpenFileDialog := 56;csSaveFileDialog := 57; + csSelectDirectoryDialog := 58;csPreviewFileControl := 59;csPreviewFileDialog := 60; + csNonLCL := 61; + end +end +type TPAINTCOUNT=class + {** + @explan(˵) Ƽ %% + **} + function create(v); + begin + if v is class(TControl)then + begin + FPainter := v; + v.BeginUpDate(); + end + end + function Destroy(); + begin + if FPainter then FPainter.EndUpDate(); + FPainter := nil; + end + FPainter; +end +type tmacroconst=class(_commctrldef_,_tvclmsageid_,_shellapi_) + class function sinit();virtual; + begin + class(_commctrldef_).sinit(); + class(_tvclmsageid_).sinit(); + class(_shellapi_).sinit(); + end +end +type TSLUICONST=class(tmacroconst,tconstant) + {** + @explan(˵) ⳣ %% + **} + static WM_TRAY; + class function sinit();override; + begin + class(tmacroconst).sinit(); + WM_TRAY := WM_USER+100; + end +end + + + //*********ַض************************************** +function FormatTslData(d,sj,tn); +begin + {** + @explan(˵) ʽtsl %% + @param(d)(any) tsl %% + @param(sj)(string) ո %% + @param(tn)(nil) ղ %% + @return(string) ʽַ %% + **} + r := ""; + if not(sj and ifstring(sj))then sj := " "; + if ifarray(d)then + begin + r := "(\r\n"; + if ifnil(tn)then + begin + tn := 0; + r := "array(\r\n"; + end + di := 0; + len := length(d); + for i,v in d do + begin + bt := sj; + if di <> i then + begin + bt += tostn(i)+":"; + end + di++; + vr := FormatTslData(v,sj,1); + if len>di then vr += ","; + r += bt; + if ifarray(v)then + begin + vrs := str2array(vr,"\r\n"); + dii := 0; + for j,vj in vrs do + begin + if dii<1 then r += vj; + else r += sj+vj; + r += "\r\n"; + dii++; + end + end else + r += vr+"\r\n"; + end + r += ")"; + return r; + end else + return tostn(d); +end + +function calldatafunction(); +begin + {** + @explan(˵)ִк,ĬϵһΪ,IJΪþIJ %% + **} + pc := paramcount; + if pc<1 then return nil; + f := params[1]; + if datatype(f)<> 7 then return nil; + case pc of + 1:return call(f); + 2:return call(f,params[2]); + 3:return call(f,params[2],params[3]); + 4:return call(f,params[2],params[3],params[4]); + end; + return nil; + ps := params; + f := ps[0]; + pms := ps[1:]; + if datatype(f)<> 7 or not(ifarray(pms))then exit; + info := f.functioninfo(); + pt := info["parameter"]; + lpt := length(pt); + if(lpt=0)or length(pms)<= lpt then + begin + return callinarray(f,pms); + end else + return callinarray(f,pms[0:lpt-1]); +end +function dataisfunction(f); +begin + {** + @explan(˵) жǷΪָ%% + @return(bool) + **} + return datatype(f)=7; +end +function NotifyComponent(Acomponent,Act,AOwner); +begin + {** + @explan(˵) ֪ͨڵAOwnerнڵAcomponent ˸ı,֪ͨΪact %% + @param(Acomponent)(tcomponent) ıĽڵ %% + @param(Act)(member of TOperation) ֪ͨ %% + @param(AOwner)(tcomponent|nil) ֪ͨĽڵ,Ĭϲapplication %% + **} + if not(Acomponent is class(tcomponent))then exit; + owner := AOwner; + if not(owner is class(tcomponent))then + begin + owner := getapplication(); + end + owner.Notification(Acomponent,Act); +end +function _timeproc_(hwnd,message,wparam,lparam); //Ϣַ +begin + {** + @explan(˵) ϢַԤײ %% + @param(hwnd)(integer) ھ %% + @param(message)(integer) Ϣid %% + @param(lparam)(integer) Ϣ2 %% + @param(wparam)(integer) Ϣ1 %% + + **} + return class(ttimer)._timeproc_(hwnd,message,wparam,lparam); +end +type tglobalabc=class + function create(); + begin + global xxxx; + xxxx++; + echo "\r\nin:",xxxx; + end + function destroy(); + begin + global xxxx; + xxxx--; + echo "\r\nout:",xxxx; + end +end +function controlisCustomPaint(id); +begin + wd := class(UIglobalData).uigetdata("TGlobalValues").getvalue(id); + if wd then return wd.isCustomPaint(); + return false; +end +function _twinproc_(hwnd,message,wparam,lparam); //Ϣַ +begin + {** + @explan(˵) ϢַԤײ %% + @param(hwnd)(integer) ھ %% + @param(message)(integer) Ϣid %% + @param(lparam)(integer) Ϣ2 %% + @param(wparam)(integer) Ϣ1 %% + + **} + //return gettswin32api().DefWindowProcA(hwnd,message,wparam,lparam); + //echo format("\r\n%x\t%x\t%x\t%x",hwnd,message,wparam,lparam); + //wdobj := class(TGlobalComponentcache).getwndbyhwnd(hwnd); + //wdobj := uigetdata("TGlobalComponentcache").getwndbyhwnd(hwnd); + wdobj := class(TGlobalComponentcache).getwndbyhwnd(hwnd); + if ifnil(wdobj)then //ûע + begin + if message=0x81 then //Ϊ WM_CREATE WM_NCCREATE ע + begin + cpm := new tslcstructureobj(MemoryAlignmentCalculate(array( + ("lpcreateparams","intptr",0))),lparam); + cid := cpm._getvalue_("lpcreateparams"); + wdobj := class(UIglobalData).uigetdata("TGlobalValues").getvalue(cid); + //wdobj := class(TGlobalValues).getvalue(cid); + {if wdobj is class(TWincontrol) then + begin + //return wdobj.MainWndProc(hwnd,message,wparam,lparam); + //class(TGlobalComponentcache).registerhandle(hwnd,wdobj); + end } + end + end + r := 0; + if wdobj then + begin + r := wdobj.MainWndProc(hwnd,message,wparam,lparam); + end else + begin + //echo format("\r\n%x,%d,%x,%x",hwnd,message,wparam,lparam); + end + if message=0x82 then + begin + class(TGlobalComponentcache).unregisterhandle(hwnd); + end + return r; + if message in array(1,0x81)then + begin + obj := new tslcstructureobj(MemoryAlignmentCalculate(array( + ("lpcreateparams","intptr",0), + ("hinstance","intptr",0), + ("hmenu","intptr",0), + ("hwndparent","intptr",0), + ("cy","int",0), + ("cx","int",0), + ("y","int",0), + ("x","int",0), + ("style","int",0), + ("lpszname","intptr",0), + ("lpszclass","intptr",0), + ("dwexstyle","int",0))),lparam); + echo tostn(obj._getdata_); + end +end +function _MessgeHook_a(hwnd,message,wparam,lparam); +begin + {** + @ignore() + @explan(˵) ļжԻص,ϵͳ%% + **} + { + // messages to browser + 0x0400 + #define BFFM_SETSTATUSTEXTA (WM_USER + 100) + #define BFFM_ENABLEOK (WM_USER + 101) + #define BFFM_SETSELECTIONA (WM_USER + 102) + #define BFFM_SETSELECTIONW (WM_USER + 103) + #define BFFM_SETSTATUSTEXTW (WM_USER + 104) + #define BFFM_SETOKTEXT (WM_USER + 105) // Unicode only + #define BFFM_SETEXPANDED (WM_USER + 106) // Unicode only + + #define BFFM_INITIALIZED 1 + #define BFFM_SELCHANGED 2 + #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog) + #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog) + #define BFFM_IUNKNOWN 5 // provides IUnknown to client. lParam: IUnknown* + } + //echo "\r\nhook",tostn(array(format("0x%x",hwnd),format("0x%x",message),format("0x%x",wparam),format("0x%x",lparam))); + if message=1 then + begin + gettswin32api().SendMessageA(hwnd,0x0400+102,TRUE,lparam); + end + return 0; + if message=0x110 then //Ϊ WM_CREATE WM_NCCREATE ע + begin + s := array(format("0x%x",hwnd),format("0x%x",message),format("0x%x",wparam),format("0x%x",lparam)); + d := new TtagOFNA(lparam); + end +end +function sinitgidplus(); +begin + FGDI := new TGdiplusflat(); + vot := array( + ("gdiplusversion","int",1), + ("debugeventcallback","int",0), + ("suppressbackgroundthread","int",0), + ("suppressexternalcodecs","int",0)); + og := new ctslctrans(tslarraytocstructcalc(vot)); + ftoken :=-1; + ig :=-1; + FGDI.GdiplusStartup(ftoken,og._getptr_,ig); +end + +type TGlobalValues=class + private + static FValues; + FId; + class function sinit(); + begin + if not ifarray(FValues)then FValues := array(); + end + public + class function getvalue(id); + begin + sinit(); + r := FValues[inttostr(id)]; + //if r then reindex(FValues,id); + return r; + end + function Create(id,value); + begin + sinit(); + tid := inttostr(id); + FOld := FValues[tid]; + if not ifnil(FOld)then raise "ȫֱͻ!"; + FId := tid; + FValues[tid]:= value; + end + function destroy(); + begin + reindex(FValues,array(FId:nil)); + end +end + +type UIglobalData=class + static UIData; + class Function uisetdata(n,d); + begin + InitUiData(); + UIData[n]:= d; + end + class function uigetdata(n); + begin + InitUiData(); + //UIData[n] := d; + return UIData[n]; + end + private + class function InitUiData(); + begin + if not ifarray(UIData)then UIData := array(); + end +end + +function initallib(); +begin + //ClearScriptCache(); + //global tuiapplication; + //tuiapplication := getapplication(); + setcallbackunitname("tslvcl"); + class(TSLUICONST).sinit(); + class(tenumeration).initenumeration(new tconstant()); + class(UIglobalData).uisetdata("TGlobalComponentcache",class(TGlobalComponentcache)); + class(UIglobalData).uisetdata("TGlobalValues",class(TGlobalValues)); + sinitgidplus(); + class(timage).sinit(); + class(TRegKey).sinit(); //ʼregע +end + +function WriteExLog(n); +begin + sz := filesize("",%% C:\Program Files\Tinysoft\Analyse.NETplug\log\nn.log%%); + writefile(rwraw(),"",%% C:\Program Files\Tinysoft\Analyse.NETplug\log\nn.log%%,sz,length(n)+2,n+"\r\n"); +end + +Function getmsgd_Crc32(s); +Begin + {** + @explan(˵) ַϢָ%% + @param(s)(string) ַ %% + @return(string) 8λȵϢָ%% + **} + {$ifdef linux} + G_CRC32TABLE:=array( + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D); + result :=0xFFFFFFFF; + bs := binary(s); + for i:=0 to length(bs)-1 do + begin + ebx:=G_CRC32TABLE[(result .& 0xff) .^ord(bs[i]) ]; + result shr=8; + result .^= ebx; + end; + result:=_not(result); + return inttohex(result,8); + {$endif} + return GetMsgDigest(s,0); +End; +function getresourcebyid(id,options); +begin + {** + @explan(˵)resourceϢ%% + @param(id)(obj) id %% + @param(options)(array) %% + **} + w32 := gettswin32api(); + if not ifarray(options)then return 0; + h := 0; + if options["type"]="bmp" then + begin + if ifnumber(id)then h := w32.LoadBitmapA2(nil,id); + else if ifstring(id)then + begin + //h := w32.LoadImageA(0,id,0,100,100,0x10 .| 0x40);// + h := w32.LoadImageA(0,id,0,0,0,0x10 .| 0x40); // + //h := w32.LoadBitmapA(nil,id); + end + end else + if options["type"]="ico" then + begin + if ifnumber(id)then h := w32.LoadIconA2(nil,id); + else if ifstring(id)then h := w32.LoadImageA(0,id,0x1,0,0,0x10); + end + return h; +end + +function CheckArrayIsNumbers(Value,n); +begin + if not(ifnumber(n)and n >= 1)then n := 4; + if ifarray(Value)then + begin + for i := 0 to n-1 do + begin + if not(ifnumber(Value[i]))then return 1; + end + return 0; + end + return 1; +end +function CheckArrayIsControlRect(Value); +begin + {** + @explan(˵) ǷΪcontrolrect %%; + **} + if not(CheckArrayIsNumbers(Value,4))then + begin + return Value[3]>0 and Value[2]>0; + end +end +function CheckArrayIsControlBounds(Value); +begin + {** + @explan(˵) ǷΪcontrol bounds + **} + if not(CheckArrayIsNumbers(Value,4))then + begin + return(Value[3]>Value[1])and(Value[2]>Value[0]); + end +end + +function intersectrect(rec1,rec2,irec); +begin + {** + @explan(˵) εĽ %% + @param(rec1)(array of integer) %% + @param(rec2)(array of integer) %% + @param(irec)(var array of integer) ص %% + @return(bool) + **} + if lineintersect(array(rec1[0],rec1[2]),array(rec2[0],rec2[2]),d1)and lineintersect(array(rec1[1],rec1[3]),array(rec2[1],rec2[3]),d2)then + begin + irec := array(d1[0],d2[0],d1[1],d2[1]); + return true; + end + return 0; +end + +function pointtovector(pts); //תΪ +begin + {** + @explan(˵) еĶάתΪһά %% + @param(pts)(array) һά%% + @return(array) %% + **} + {** + @example(תΪһά) + // array((x1,y1),(x2,y2),(x3,y3)...) => array(x1,y1,x2,y2,x3,y3,...) + a := array((1,2),(3,4)); + return pointtovector(a);//array(1,2,3,4); + **} + t := array(); + lt := 0; + if not ifarray(pts)then return array(); + for i,v in pts do + begin + if ifarray(v)and ifnumber(v[0])and ifnumber(v[1])then + begin + t[lt++]:= v[0]; + t[lt++]:= v[1]; + end + end + return t; +end +function pointinrect(p,rec); +begin + {** + @explan(˵) жϵǷھ %% + @param(rec)(array of integer) %% + @param(p)(array of integer) array(x,y) %% + @return(bool) + + **} + x := p[0]; + y := p[1]; + return x>rec[0]and y>rec[1]and xxx2[0]and xx1[0]>xx2[1])or(xx2[0]>xx1[1]and xx2[1]>xx1[0])then return 0; + xx := array(max(xx1[0],xx2[0]),min(xx1[1],xx2[1])); + return 1; +end +function CompareRect(orect,nrect); +begin + return orect=nrect; +end + +function ParserCommandLine(s); //в +begin + r := array(); + if not ifstring(s) then return r; + len := length(s); + p := ""; + while idx4))then exit; + info := FileList("",fname); + if info then exit; + len := length(fname); + iofp := ioFileseparator(); + for i := len downto 1 do + begin + vi := fname[i]; + if vi=iofp then + begin + ffname := fname[1:i]; + break; + end + end + if not ffname then exit; + nct := 4; + {$ifdef linux} + nct := 1; + {$endif} + ph := ffname[1:nct]; + for i := nct+1 to length(ffname) do + begin + vi := ffname[i]; + if vi=iofp then + begin + if not FileList("",ph)then + begin + CreateDir("",ph); + end + end + ph += vi; + end +end + +function DeleteAllFiles(path); +begin + {** + @explan(˵) ɾָ·ļļ %% + **} + if not ifstring(path)then return 0; + if not path then return 0; + iofp := ioFileseparator(); + if path[length(path)]=iofp then return call(thisfunction,path[1:(length(path)-1)]); + info := FileList("",path); //"A" + if info then + begin + if pos("D",info[0]["Attr"])then + begin + fs := FileList("",path+iofp+"*"); + for i,v in fs do + begin + n := v["FileName"]; + if n in array(".","..")then continue; + call(thisfunction,path+iofp+n); + end + return RemoveDir("",path); + end else + begin + return FileDelete("",path); + end + return 0; + end +end + +function LoginTslServer(usr,pwd,addr,port); +begin + {** + @explan(˵) ½ %% + @param(usr)(string) û %% + @param(pwd)(string) %% + @return(int) 1 ɹ 0 ʧ %% + **} + if not(port>0)then port := 443; + if not(ifstring(addr))then addr := "tsl.tinysoft.com.cn"; + if(CheckConnected()or(ConnectServer(addr,port)=0))then + begin + msg := ""; + setlength(msg,200); + if(CheckLogined()or LoginServer(usr,pwd,msg)=0)then + begin + //messagebox("","½ɹ",1); + return 1; + end; + messageboxA(msg,"½ʧ",1); + return 0; + end else + begin + messageboxA("ӷʧ","ʾ",1); + return 0; + end + return 0; +end +function gettemppath(); +begin + {** + @explan(˵)ȡwindowsʱĿ¼ %% + @return(string) Ŀ¼; + **} + {$ifdef linux} + return "/var/tmp/"; + {$endif} + s := ""; + n := 1024; + setlength(s,n); + s1 := s; + GetTempPathA(n,s); + GetLongPathNameA(s,s1,n); + r := ""; + for i := 1 to n do + begin + vi := s1[i]; + if vi="\0" then + begin + return s1[1:(i-1)]; + end + end + return ""; +end +function GetCheckStruct(); +begin + return new TCHECK_RESULT(); +end +function CheckTslCode(code,err); +begin + {** + @explan(˵) tsl﷨ %% + @param(code)(string) tsl %% + @param(err)(string) Ϣ %% + @return(bool)ɹtrue %% + **} + if not ifstring(code)then + begin + err := "ַ"; + return false; + end + CheckInfo := static GetCheckStruct(); + if TSL_Check(code,length(code),CheckInfo._getptr_)<> 1 then + begin + err := CheckInfo.errmsg; + return false; + end + return true; +end +function tslScriptGo(script); +begin + {** + @explan(˵)ִtslű %% + @param(script)(string) tsl %% + @return(bool) 1ʾɹ; 1 ʧ %% + @example(scriptgo-) + script := " + a := testabc(); + echo a; + function testabc(); + begin + return 10; + end + "; + return tslScriptGo(script); + **} + ph := gettemppath(); + name := ph+"tslpengt.tsl"; + if ifstring(script)and script then + begin + tsexe := SysExecName(); + FileDelete("",name); + writefile(rwraw(),"",name,0,length(script),script); + r := SysExec(tsexe,format('"%s" "%s"',tsexe,name),nil,0,r,nil); + end + return r; + lwrap := TSL_InterpNewLWrap(); + L := TSL_InterpGetLFromWrap(lwrap); + //L := TS_GetGlobalL(); + if ifstring(script)then + begin + v := TSL_NewObject(); + ret := TSL_ScriptGo(L,script,v); + TSL_FreeObj(L,v); + end + //TSL_InterpFreeLWrap(lwrap); + return ret; +end +function version(); +begin + {** + @explan(˵) ذ汾 %% + @return(string) "汾.ΰ汾.޶.ڰ汾 " + **} + //return "1.1.0.20190929_beta"; + //return "1.1.1.20200731_beta"; + //return "1.1.2.20210915_beta"; + //return "1.1.3.20220210_beta"; + return "1.1.4.20220310_beta"; +end +function ioFileseparator(); +begin + {** + @explan(˵) ļϵͳĿ¼ָ %% + @return(string) linux / windows\ + **} + {$ifdef linux} + return '/'; + {$endif} + return '\\'; +end +function ExitMessageLoop(); +begin + {** + @expaln(˵)˳Ϣѭ %% + **} + WPI := gettswin32api(); + return WPI.PostQuitMessage(0); +end + +function SysExecWait(handle,exe,cmd,dir,fwait); +begin + {** + @explan(˵) н %% + @param(handle)(pointer) ؽ̾,Ϊֵ %% + @param(exe)(string) ִг %% + @param(cmd)(string) в %% + @param(dir)(string) Ŀ¼ %% + @param(fwait)(bool) Ƿǿеȴ,ĬΪfalse %% + **} + if fwait then + begin + handle := SysExec(exe,cmd,dir,1,r); + return r; + end + handle := SysExec(exe,cmd,dir,0,r); + FMSG := new TTagMSG(); + msg := FMSG._getptr_; + WPI := gettswin32api(); + while(handle) do + begin + {if (not WPI.GetMessageA(msg, 0, 0, 0)) then break; + WPI.TranslateMessage(msg); + WPI.DispatchMessageA(msg);} + ////////////////////////////////////////////////////// + if(WPI.PeekMessageA(msg,0,0,0,0x1))then + begin + if FMSG.message=0x12 then + begin + break; + end else + begin + WPI.TranslateMessage(msg); + WPI.DispatchMessageA(msg); + end + end else + begin + tslprocessmessages(false); + RunWorkerThreadLoop(); + end + //////////////////////////////////////////////// + if not handle then break; + if not SysWaitForSingleObject(handle,5)then + begin + handle := 0; + return r; + end + end + return r; +end + + +function MessageBoxA(txt,title,flag,wnd); +begin + {** + @explan(˵) ʾԻ %% + @param(txt)(string) ı %% + @param(title)(string) %% + @param(flag)(integer) ť %% + @param(wnd)(twinControl) %% + @return(integer) ֵ %% + **} + hd := 0; + if(wnd is class(TWincontrol))and wnd.HandleAllocated()then hd := wnd.Handle; + else if ifnumber(wnd)then hd := wnd; + return gettswin32api().MessageBoxA(hd,ifstring(txt)?txt:"",ifstring(title)?title:"",flag >= 0?flag:0); +end +function CallMessgeFunction(f,o,e); +begin + {** + @ignore() + **} + if datatype(f)=7 then return call(f,o,e); +end +function GetTextWidthAndHeightWidthFont(s,f,mul); +begin + {** + @explan(˵) ıڸfµĻƿ %% + @param(s)(string) ı %% + @param(f)(tfont) %% + @param(mul)(bool) Ƿı %% + **} + if ifstring(s)and s then + begin + cv := static GetOneCanvas(); + if f is class(tfont)then cv.font := f; + if ifarray(f)and f then cv.font.SetValues(f); + return cv.GetTextExtent(s,mul); + end + return array(0,0); +end +function GetOneCanvas(); +begin + cv := new TCanvas(getapplication()); + cv.handle := cv._wapi.CreateCompatibleDC(0); + return cv; +end + +function GetCurrentTslDir(); //tslĿ¼\β +begin + p := pluginpath();iofp := ioFileseparator(); + for i:= length(p)-1 downto 1 do + begin + if p[i]=iofp then + begin + return p[1:i]; + end + end +end +function CopyUsedTslDllToNewDir(npre); +begin +{** + @explan(˵) ǰtslĿ¼ʹõdllָĿ¼%% + @param(npre)(string) µָĿ¼ %% +**} + if not ifstring(npre) then return false; + if not (length(npre)>2) then return false; + bpre := npre; + if npre[length(npre)]=ioFileseparator() then + begin + npre := npre[1:length(npre)-1]; + end + pre1 := pre := GetCurrentTslDir(); + lpre := length(pre); + app :=initializeapplication(); + d := app._wapi.Toolhelp32Snapshotmodule(); + pre := pre1; + for i,v in d do + begin + vi := v["szexepath"]; + if pos(pre,vi) then + begin + fn := npre+vi[lpre:]; + CreateDirWithFileName(fn); + FileCopy("",vi,"",fn,0); + end + end + npre := bpre; + return true; +end + +Initialization + initlib(); +Finalization +end. +//////////////////////ʱûõ/////////////////////////////////////// +(* + +type TFileLocker=class() + {** + @ignore() %% + @explan(˵) ļ %% + **} + private + FHandle; + FLocked; + FApi; + function GetFileOpen(); + begin + return FHandle <> 0; + end + function GetFileLocked(); + begin + return FLocked <> 0; + end + public + function Create(F); + begin + {** + @explan(˵)ļ,̶ֹд %% + @param(f)(string) ļ %% + **} + FHandle := 0; + FLocked := 0; + if not FileExists("",f)then exit; + FApi := gettswin32api(); + FHandle := FApi.CreateFileA(F,0x40000000L,0,0,3,0x00000080,0); + if not FHandle then exit; + FLocked := FApi.LockFile(FHandle,0,0,0,0); + end + function Destroy(); + begin + if FLocked then + begin + FApi.UnlockFile(FHandle,0,0,0,0); + end + if FHandle then + begin + FApi.CloseHandle(FHandle); + end + end + property FileOpend read GetFileOpen; + property FileLocked read GetFileLocked; + {** + @param(FileOpend)(bool) ǷЧ%% + @param(FileLocked)(bool) ǷѾ%% + **} +end + + +type Ttagaccel=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("fvirt","byte",0), + ("key","short",0), + ("cmd","short",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property fvirt index "fvirt" read _getvalue_ write _setvalue_; + property key index "key" read _getvalue_ write _setvalue_; + property cmd index "cmd" read _getvalue_ write _setvalue_; +end +type TBITMAPINFOHEADER=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("bisize","int",40), + ("biwidth","int",0), + ("biheight","int",0), + ("biplanes","short",0), + ("bibitcount","short",0), + ("bicompression","int",0), + ("bisizeimage","int",0), + ("bixpelspermeter","int",0), + ("biypelspermeter","int",0), + ("biclrused","int",0), + ("biclrimportant","int",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + bisize := _size_(); + end + property bisize index "bisize" read _getvalue_ write _setvalue_; + property biwidth index "biwidth" read _getvalue_ write _setvalue_; + property biheight index "biheight" read _getvalue_ write _setvalue_; + property biplanes index "biplanes" read _getvalue_ write _setvalue_; + property bibitcount index "bibitcount" read _getvalue_ write _setvalue_; + property bicompression index "bicompression" read _getvalue_ write _setvalue_; + property bisizeimage index "bisizeimage" read _getvalue_ write _setvalue_; + property bixpelspermeter index "bixpelspermeter" read _getvalue_ write _setvalue_; + property biypelspermeter index "biypelspermeter" read _getvalue_ write _setvalue_; + property biclrused index "biclrused" read _getvalue_ write _setvalue_; + property biclrimportant index "biclrimportant" read _getvalue_ write _setvalue_; +end +type TTBBUTTONINFOA=class(tcstructwithcharptr) + {** + @explan(˵) ڴ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := array( + ("cbsize","int",0), + ("dwmask","int",0), + ("idcommand","int",0), + ("iimage","int",0), + ("fsstate","byte",0), + ("fsstyle","byte",0), + ("cx","short",0), + ("lparam","intptr",0), + ("psztext","char*",0), + ("cchtext","int",100)); + return SSTRUCT; + end + public + function create();override; + begin + inherited create(getstruct(),array("psztext":"cchtext"),nil); + cbsize := _size_(); + end + property cbsize index "cbsize" read _getvalue_ write _setvalue_; + property dwmask index "dwmask" read _getvalue_ write _setvalue_; + property idcommand index "idcommand" read _getvalue_ write _setvalue_; + property iimage index "iimage" read _getvalue_ write _setvalue_; + property fsstate index "fsstate" read _getvalue_ write _setvalue_; + property fsstyle index "fsstyle" read _getvalue_ write _setvalue_; + property cx index "cx" read _getvalue_ write _setvalue_; + property lparam index "lparam" read _getvalue_ write _setvalue_; + property psztext index "psztext" read _getvalue_ write _setvalue_; + property cchtext index "cchtext" read _getvalue_ write _setvalue_; +end + +type TTBBUTTON=class(tslcstructureobj) + {** + @explan(˵) ťڴ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ibitmap","int",0), + ("idcommand","int",0), + ("fsstate","byte",0), + ("fsstyle","byte",0), + ("dwdata","intptr",0), + ("istring","char*",128))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + function _setvalue_(id,v); + begin + if id="istring" then + begin + if ifstring(v)and length(v)<127 then + begin + return inherited; + end + return; + end + return inherited; + end + property ibitmap index "ibitmap" read _getvalue_ write _setvalue_; + property idcommand index "idcommand" read _getvalue_ write _setvalue_; + property fsstate index "fsstate" read _getvalue_ write _setvalue_; + property fsstyle index "fsstyle" read _getvalue_ write _setvalue_; + property dwdata index "dwdata" read _getvalue_ write _setvalue_; + property istring index "istring" read _getvalue_ write _setvalue_; +end +type TScrollBarKind=class(tenumeration) + static sbHorizontal; + static sbVertical; +end + +type TToolTipsFlags=class + {** + @ignore() %% + @explan() tooltips flags %% + **} + static TTF_IDISHWND; + static TTF_CENTERTIP; + static TTF_RTLREADING; + static TTF_SUBCLASS; + static TTF_TRACK; + static TTF_ABSOLUTE; + static TTF_TRANSPARENT; + static TTF_PARSELINKS; + static TTF_DI_SETITEM; +end + + type TIMAGEINFO = class(tslcstructureobj) + {** + @ignore %% + @explan(˵) imgelistimageϢ %% + **} + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("hbmimage","intptr",0), + ("hbmmask","intptr",0), + ("unused1","int",0), + ("unused2","int",0), + ("rcimage","int[4]", + (0,0,0,0)))); + return SSTRUCT; + end + function getbmp(v); + begin + {** + @explan(˵)tbitmap %% + **} + hm := _getvalue_(v); + if hm then + begin + r := new tbitmap(); + r.handle := hm; + r.AutoDestroy := false; + return r; + end + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property bmimage:tbitmap index "hbmimage" read getbmp write getbmp; + property bmmask:tbitmap index "hbmmask" read getbmp write getbmp; + property hbmimage index "hbmimage" read _getvalue_ write _setvalue_; + property hbmmask index "hbmmask" read _getvalue_ write _setvalue_; + property unused1 index "unused1" read _getvalue_ write _setvalue_; + property unused2 index "unused2" read _getvalue_ write _setvalue_; + property rcimage index "rcimage" read _getvalue_ write _setvalue_; + {** + @param(bmimage)(tbitmap) λͼ %% + @param(bmmask)(tbitmap) mask %% + @param(rcimage)(array) %% + **} + end + +*) + + +//////////////twincontrol Ƴĺ +(* + function CreateDrawItemEvent();virtual; + begin + {** + @explan(˵) drawitemϢ,дϢDoDrawItemʹ,DestroyDrawItemEventɶԳ %% + @return(TMDRAWITEM|nil) itemƶ %% + **} + e := nil; + if HandleAllocated() then + begin + hd := self.Handle; + itptr := FTtageDrawItem._getptr_; + e := new TMDRAWITEM(WM_DRAWITEM,0,itptr,hd); + e.canvas := canvas; + canvas.handle := _wapi.GetDC(self.Handle); + end + return e; + end + function DestroyDrawItemEvent(e);virtual; + begin + {** + @explan(˵) CreateDrawItemEventʹ %% + @param(e)(TMDRAWITEM) CreateDrawItemEvent Ϣ %% + **} + if HandleAllocated() and ( e is class(TMDRAWITEM)) and (e.lparam = FTtageDrawItem._getptr_()) then + begin + dc := canvas.Handle; + if dc then + begin + canvas.handle := 0; + return _wapi.ReleaseDC(self.Handle,dc); + end + end + end +*) + +(* + //tcontrol Ƴ + function GetDeviceContext(var WindowHandle:HWND);virtual; //type_tcontrol + begin + {** + @explan(˵) ȡ豸hdc %% + @param(WindowHandle)(pointer) ھ %% + @return(pointer) dc %% + **} + if Parent is class(TWinControl)then + begin + Result := Parent.GetDeviceContext(WindowHandle); + MoveWindowOrgEx(Result,Left,Top); + IntersectClipRect(Result,0,0,Width,Height); + end else + raise ""; + return Result; + end; + + function IntersectClipRect(hdc, x0, y0, x1, y1);virtual; //type_tcontrol + begin + _wapi.IntersectClipRect(hdc, x0, y0, x1, y1); + end + function MoveWindowOrgEx(hdc;x:integer;y:integer);virtual; //type_tcontrol + begin + {** + @explan(˵) ƶdcԭ %% + @param(hdc)(pointer) dc %% + **} + return _wapi.SetViewportOrgEx(hdc,x,y,nil); + end + + function WMXButtonDown(o,e): LM_XBUTTONDOWN;virtual; + begin + end + function WMMButtonDBLCLK(o,e): LM_MBUTTONDBLCLK;virtual; + begin + + end + function WMXButtonDBLCLK(o,e): LM_XBUTTONDBLCLK;virtual; + begin + + end + function WMLButtonTripleCLK(o,e): LM_LBUTTONTRIPLECLK;virtual; + begin + + end + function WMRButtonTripleCLK(o,e): LM_RBUTTONTRIPLECLK;virtual; + begin + + end + function WMMButtonTripleCLK(o,e): LM_MBUTTONTRIPLECLK;virtual; + begin + + end + function WMXButtonTripleCLK(o,e): LM_XBUTTONTRIPLECLK;virtual; + begin + + end + function WMXButtonUp(o,e): LM_XBUTTONUP;virtual; + begin + + end + function WMLButtonQuadCLK(): LM_LBUTTONQUADCLK;virtual; + function WMRButtonQuadCLK(): LM_RBUTTONQUADCLK;virtual; + function WMMButtonQuadCLK(): LM_MBUTTONQUADCLK;virtual; + function WMXButtonQuadCLK(): LM_XBUTTONQUADCLK;virtual; +*) +(* + + function SetMainMenubk(mu); + begin + if csDesigning in ComponentState then + begin + if FMainMenu and mu then //Ѿ %% + begin + return ; + end + if (not FMainMenu) and mu then + begin + mu := new TMainmenu(self); //һٵIJ˵ + tm := new TMenu(mu); + tm.caption := "menu"; + tm.parent := mu; + end + end + if FMainMenu<>mu then + begin + OM := FMainMenu; + if OM is class(tmainmenu) then + begin + OM.DestroyHandle(); //ɾ %% + OM.Hwnd := 0; + //if HandleAllocated() then _wapi.SetMenu(self.Handle,0); //ɾIJ˵ + end + if (mu is class(tmainmenu)) then + begin + if HandleAllocated() then + begin + mu.Hwnd := handle; + //_wapi.SetMenu(self.Handle,mu.handle); + end + end + FMainMenu := mu; + end + end + + type TTempFile = class + function Create(dt); + begin + if not ifarray(FFiles) then FFiles := array(); + bp :=gettemppath()+"tinysoft"+ioFileseparator()+"tslvcl"+ioFileseparator(); + {if not fileexists("",bp) then + begin + for i:=2 to length(bp) do + begin + if bp[i]=ioFileseparator() then + begin + if fileexists("",bp[1:i-1]) then + begin + createdir("",bp[1:i-1]) + end + end + end + end } + for i,v in mrows( FFiles,1) do + begin + if not(FFiles[v]) then + begin + FFiles[v] := true; + FPath := v; + break; + end + end + while not FPath do + begin + i := 0; + while true do + begin + subdir := tostn( rand(3)[1]); + p := bp+subdir[3]+ioFileseparator()+subdir[4]+".png"; + echo p,"\r\n"; + if not(FFiles[p]) then + begin + FFiles[p] := true; + FPath := p; + //writefile(rwraw(),"",FPath,0,1,"0") ; + break; + end + end + end + if ifstring(dt) then + begin + //if FileExists("",FPath) then filedelete("",FPath); + writefile(rwraw(),"",FPath,0,length(dt),dt) ; + end + end + function GetData(buf);// + begin + if FPath then + begin + sz := filesize("",FPath); + return readfile(rwraw(),"",FPath,0,sz,buf); + end + end + function Destroy(); + begin + //FFiles[FPath] := false; + if FileExists("",FPath) then echo "\r\ndeletefile:",filedelete("",FPath); + FPath := ""; + end + property path read FPath ; + private + FPath; + static FFiles; +end + +*) +//ʱõĺ +{function chartoint(c); +begin + v := ord(c); + case v of + 48 to 57:vk := v-48; + 65 to 70:vk := v-65+10; + 97 to 102:vk := v-97+10; + else raise "16ַ"; + end + return vk; +end} \ No newline at end of file diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf new file mode 100644 index 0000000..08ca25b --- /dev/null +++ b/funcext/tvclib/ugtkinterface.tsf @@ -0,0 +1,4397 @@ +unit ugtkinterface; +interface +{ +20220128-0900 ȶӿ +20210902-0308 ΢ +} +uses cstructurelib; +function _gtkeventcall_();//gtkϢַ +function _gtkidledo_(); //gtk idleϢַ +function _gtk_add_time_msg_(h,m,w,l); +function GetGtkEventNameOrId(n); //gtk ¼ +function AddMessageToGtkMessageQueue(FHandle,msg,wparam,lparam,d);//¼ +function FeachMessageFromGtkMessageQueue();//ȡ¼ +function clearMessageFromGtkMessageQueue(h,m);//Ϣ +function hasMessageFromGtkMessageQueue(h,m);//ǷϢ +type TGtkList = class( _gslist) //gtk + function create(ptr); + begin + inherited; + end +end +type tgtkeventobject =class(tgtk_ctl_object) //gtkϢ() + function create(h); + begin + inherited; + end +end +type tmenuitemobject = class(tgtk_ctl_object) //gtk˵ + function create(h); + begin + inherited; + Connect("activate",thisfunction(mactivate)); + Connect("destroy",thisfunction(mdestroy)); + end + lpmii; + function mactivate(); + begin + h := handle; + mid := _wapi.g_object_get_data(h,"menuid"); + if mid then + begin + while h do + begin + hwd := _Wapi.g_object_get_data(h,"popmenubarwindow"); + if hwd then + begin + + r := _wapi.gtk_postmessagea(hwd,_const.WM_COMMAND,makelong(mid,0),0,0); + _wapi.g_object_set_data(h,"popmenubarwindow",0); + return r; + end + hwd := _wapi.g_object_get_data(h,"menubarwindow"); + if hwd then //˵ + begin + //echo "\r\n============hwd is find\r\n"; + r := _wapi.gtk_postmessagea(hwd,_const.WM_COMMAND,makelong(mid,0),0,0); + //echo "send main menu command:"; + return r; + end + h := _wapi.g_object_get_data(h,"pmenu"); + end + end + end + function mdestroy(); + begin + //echo "\r\nmenu destroyed"; + end +end +type tgtkapis = class() //gtkapiӿ + function gtk_rgb_color_rgb(c,r,g,b); + begin + if not ifnumber(c) then return 0; + r := getrvalue(c)/0xff; + g := getgvalue(c)/0xff; + b := getbvalue(c)/0xff ; + return true; + end + class function gtk_object_set_data(h,n,v); // + begin + if not(h>0 or h<0) then return 0; + global gtk_object_data_values_global; + if not ifarray(gtk_object_data_values_global) then gtk_object_data_values_global := array(); + if ifnil(n) then reindex(gtk_object_data_values_global,array(inttostr(h):nil)); + else + if ifarray(n) then + begin + gtk_object_data_values_global[inttostr(h)] := n; + end else + gtk_object_data_values_global[inttostr(h),n] := v; + //echo tostn(gtk_object_data_values_global); + end + class function gtk_object_get_data(h,n); // + begin + if not(h>0 or h<0) then return 0; + global gtk_object_data_values_global; + if not ifarray(gtk_object_data_values_global) then return 0; + if ifnil(n) then + begin + r := gtk_object_data_values_global[inttostr(h)]; + if not ifarray(r) then r := array(); + return r; + end + r := gtk_object_data_values_global[inttostr(h),n]; + if ifnil(r) then return 0; + return r; + end + function gtk_SetMenuItemInfoA(hMenu,uitem,fbyposition,lpmii); //˵ + begin + //return ; + _const := GetWin32Const(); + it := gtk_menu_shell_get_by_positon(hMenu,uitem); + if not it then return 0; + lpm := new tmenuStruct(lpmii); + msk := lpm.fmask; + st := lpm.fstate; + ss := " "; + needset := false; + if (msk .& _const.MIIM_STRING)=_const.MIIM_STRING then + begin + c := lpm.getdwtypedata(); + gtk_object_set_data(it,"caption",c); + needset := true; + end + if _const.MIIM_STATE =(msk .& _const.MIIM_STATE) then + begin + if (_const.MF_DISABLED = (st .& _const.MF_DISABLED)) then + begin + gtk_widget_set_sensitive(it,false); + end else + + if (_const.MF_ENABLED = (st .& _const.MF_ENABLED)) then //ǷЧ + begin + gtk_widget_set_sensitive(it,true); + end + if ((st .& _const.MF_CHECKED)= _const.MF_CHECKED) then //Ƿcheck + begin + gtk_object_set_data(it,"checked",1); + needset := true; + end else + if ((st .& _const.MF_UNCHECKED)= _const.MF_UNCHECKED) then //Ƿcheck + begin + gtk_object_set_data(it,"checked",0); + needset := true; + end + end + if needset then + begin + c := gtk_object_get_data(it,"caption"); + if gtk_object_get_data(it,"checked") then + begin + gtk_menu_item_set_label(it,TslStringToGtk("[]"+c)); + end else + gtk_menu_item_set_label(it,TslStringToGtk(ss+c)); + end + if (msk .& _const.MIIM_SUBMENU)=_const.MIIM_SUBMENU then //һ˵ + begin + gtk_menu_item_set_submenu(it,lpm.hsubmenu); + g_object_set_data(it,"menuid",0); + end {else + begin + echo "\r\n seet sub menuid: ",lpm.wid; + echo " odid:",g_object_get_data(it,"menuid"),"***"; + //g_object_set_data(it,"menuid",lpm.wid); + end} + + return 1; + end + function gtk_insertmenuitema(hMenu,uitem,fbyposition,lpmii);//˵ + begin + _const := GetWin32Const(); + lpm := new tmenuStruct(lpmii); + msk := lpm.fmask; + ft := lpm.ftype; + st := lpm.fstate; + ss := " "; + c := lpm.getdwtypedata()?:""; + if ft = _const.MFT_SEPARATOR then //ָ + begin + it := gtk_separator_menu_item_new(); + end else + begin //ı + //it := gtk_check_menu_item_new_with_label(c);//2 + if ((st .& _const.MFS_CHECKED)= _const.MFS_CHECKED) then + begin + it := gtk_menu_item_new_with_label(TslStringToGtk("[]"+c)); + gtk_object_set_data(it,"checked",1); + end + else + begin + gtk_object_set_data(it,"checked",0); + it := gtk_menu_item_new_with_label(TslStringToGtk(ss+c)); + end + end + gtk_object_set_data(it,"caption",c); + gtk_widget_show(it); + new tmenuitemobject(it); + g_object_set_data(it,"pmenu",hMenu); + gtk_menu_shell_insert(hMenu,it,uitem); + + if st .& _const.MFS_DISABLED then //ǷЧ + begin + gtk_widget_set_sensitive(it,false); + end else gtk_widget_set_sensitive(it,true); + cid := lpm.wid; + if msk .& _const.MIIM_SUBMENU then //һ˵ + begin + gtk_menu_item_set_submenu(it,lpm.hsubmenu); + g_object_set_data(lpm.hsubmenu,"pmenu",hMenu); + g_object_set_data(it,"menuid",0); + end else + begin + g_object_set_data(it,"menuid",cid); + end + end + function gtk_widgetsizechanged(hwnd,h,w); //Сı + begin + return class(tgtk_ctl_object).widgetsizechangeda(hwnd,h,w) ; + end + function gtk_GetScrollInfo(hwnd,nBar,lpsi); //Ϣ + begin + //scroll + return class(tgtk_ctl_object).getscrollinfoa(hwnd,nBar,lpsi) ; + end + function gtk_SetScrollInfo(hwnd, nBar, lpsi,redraw);//ù + begin + //scroll + return class(tgtk_ctl_object).SetScrollInfoa(hwnd, nBar, lpsi,redraw) ; + end + function gtk_postmessagea(h,msg,w,l,d); //postģ + begin + AddMessageToGtkMessageQueue(h,msg,w,l,d); + end + function gtk_sendmessagea(h,msg,w,l); //send ģ + begin + return class(tgtk_ctl_object).CallGtkWinProc(h,msg,w,l); + end + function gtk_SetWindowLongPtrA(h,n,v); //setlong + begin + return class(tgtk_ctl_object).SetWindowLongPtrA(h,n,v); + end + function gtk_GetWindowLongPtrA(h,idx); //getlong + begin + return class(tgtk_ctl_object).GetWindowLongPtrA(h,idx); + end + function gtk_executeMessageA(h,msg,w,l); //ִϢ + begin + return class(tgtk_ctl_object).executeMessageA(h,msg,w,l); + end + function gtk_GetKeyState(key); //״̬ + begin + global g_gtk_keytable; + if g_gtk_keytable then + begin + if key in array(0x10,0x11,0x12) then + begin + r := g_gtk_keytable[key]; + if r>=0 then return r; + end + end ; + end + function gtk_GetAsyncKeyState(key);//갴״̬ + begin + global g_gtk_buttontable; + if g_gtk_buttontable then + begin + // + case key of + 1: + begin + if g_gtk_buttontable[0] then return _shl(1,15); + end + 2: + begin + if g_gtk_buttontable[1] then return _shl(1,15); + end + + end ; + + end + + end + function TslStringToGtk(s); //asciiתutf8 + begin + return ansitoutf8(s); + end + function TslStringToGtk2(s); //asciiתutf8 + begin + global g_ansi_unit_cache ; + if not ifarray(g_ansi_unit_cache) then g_ansi_unit_cache := array(); + r := g_ansi_unit_cache[s]; + if ifnil(r) then + begin + r := ansitoutf8(s); + g_ansi_unit_cache[s] := r;; + end + return r; + end + function GtkStringToTsl(s); //asciiתutf8 + begin + return utf8toansi(s); + end + function gtk_MessageBoxA(hd,txt,title,flag); //messageboxģ + begin + flag := flag .& 7; + if flag = 0 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"ȷ",1,"b",0,"c",0); + if r=1 then return 1; + return 0; + end else + if flag = 1 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"ȷ",1,U"ȡ",1,"c",0); + if r=1 then return 1; + else return 2; + end else + if flag = 2 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"ֹ",1,U"",1,U"",1); + case r of + 1: return 3; + 2: return 4; + 0,3:return 5; + end + end else + if flag = 3 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"",1,U"",1,U"ȡ",1); + case r of + 1: return 6; + 2: return 7; + 0,3:return 2; + end + end else + if flag =4 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"",1,U"",1,"c",0); + case r of + 1: return 6; + 2: return 7; + else + return 0; + end + end else + if flag = 5 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"",1,U"ȡ",1,U"ȡ",0); + case r of + 1: return 4; + else return 2; + end + end else + if flag = 6 then + begin + r := tsl_gtk_messagebox_(TslStringToGtk(txt),TslStringToGtk(title),hd,U"ȡ",1,U"",1,U"",1); + case r of + 1: return 2; + 2: return 4; + 3: return 11; + else return 2; + end + end + end + function gtk_createwindowexa(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam); //ڹ + begin + //array("tsui_application","tsui_window","tsluidesigner_a_a_1","tsui_form","tui_button","tui_edit","tui_tablecontrol32","tui_PageSheet","tui_monthcalendar","tui_datetimepicker") + d := new tslcstructureobj(MemoryAlignmentCalculate( array( + ("lpcreateparams","intptr",lpParam))),nil); + _const := GetWin32Const(); + if (dwStyle .& _const.WS_POPUP)=_const.WS_POPUP then + begin + cls := new tgtk_ctl_window_PoPup(); + end + else + begin + cls := new tgtk_ctl_window(); + end + if cls then + begin + r := cls.CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,d._getptr_()); + + end + return r; + end + function gtk_GetClassInfoExtA(h,cl,lpwcx); //Ϣ + begin + lcl := lowercase(cl); + cs := GetGtkwindowclass(lcl); + d := new taggtkWNDCLASSA(lpwcx); + if cs then + begin + for i,v in cs do + begin + d._setvalue_(i,v); + end + return true; + end + return false; + end + function gtk_RegisterClassExA(lpwcx);//עϢ + begin + d := new taggtkWNDCLASSA(lpwcx); + reggtkwindowclass(d._getdata_()); + return true; + end + + function gtk_color_selection_dialog_new(t:string):pointer;cdecl;external 'libgtk-3.so'; + function Gtk_event_get_name_by_id(id); //gdkϢ--idӦ + begin + d := array(0:"GDK_DELETE",1:"GDK_DESTROY",2:"GDK_EXPOSE",3:"GDK_MOTION_NOTIFY",4:"GDK_BUTTON_PRESS", + 5:"GDK_2BUTTON_PRESS",6:"GDK_3BUTTON_PRESS",7:"GDK_BUTTON_RELEASE",8:"GDK_KEY_PRESS",9:"GDK_KEY_RELEASE", + 10:"GDK_ENTER_NOTIFY",11:"GDK_LEAVE_NOTIFY",12:"GDK_FOCUS_CHANGE",13:"GDK_CONFIGURE",14:"GDK_MAP",15:"GDK_UNMAP", + 16:"GDK_PROPERTY_NOTIFY",17:"GDK_SELECTION_CLEAR",18:"GDK_SELECTION_REQUEST",19:"GDK_SELECTION_NOTIFY",20:"GDK_PROXIMITY_IN", + 21:"GDK_PROXIMITY_OUT",22:"GDK_DRAG_ENTER",23:"GDK_DRAG_LEAVE",24:"GDK_DRAG_MOTION",25:"GDK_DRAG_STATUS", + 26:"GDK_DROP_START",27:"GDK_DROP_FINISHED",28:"GDK_CLIENT_EVENT",29:"GDK_VISIBILITY_NOTIFY",30:"GDK_NO_EXPOSE", + 31:"GDK_SCROLL",32:"GDK_WINDOW_STATE",33:"GDK_SETTING",34:"GDK_OWNER_CHANGE",35:"GDK_GRAB_BROKEN",36:"GDK_DAMAGE",-1:"GDK_NOTHING") + ; + return d[id]; + end + function Gtk_dlg_get_response_name_by_id(id); //Իid--ƶӦ + begin + d := array(-11:"GTK_RESPONSE_HELP",-10:"GTK_RESPONSE_APPLY",-9:"GTK_RESPONSE_NO",-8:"GTK_RESPONSE_YES", + -7:"GTK_RESPONSE_CLOSE",-6:"GTK_RESPONSE_CANCEL",-5:"GTK_RESPONSE_OK",-4:"GTK_RESPONSE_DELETE_EVENT", + -3:"GTK_RESPONSE_ACCEPT",-2:"GTK_RESPONSE_REJECT",-1:"GTK_RESPONSE_NONE"); + return d[id]; + + + end + function execsystem(s:string):integer;cdecl;external './plugin/libTSLUIL.so'; + function openresourcemanager(p); //Դ + begin + if ifstring(p) then + return execsystem(format('nautilus "%s" &',p)); + end + /////////////////////////////pipe process///////////ִг///////////////////////////// + function tsl_gtk_closehandle(p:pointer):integer;cdecl;external "plugin/libTSLUIL.so"; + function tsl_gtk_pipread(p:pointer;var msg:string;ct:integer):integer;cdecl;external "plugin/libTSLUIL.so"; + function tsl_gtk_kill(p:pointer;sig:integer):integer;cdecl;external "plugin/libTSLUIL.so"; + function tsl_gtk_createprocessa(exe:string; cmd : array of string; ev : array of string;var pw:pointer):pointer;cdecl;external "plugin/libTSLUIL.so"; + + /////////////////////////////////timer/////////////////////////////// + class function g_timeout_add(interval:integer; _function:pointer; d:pointer):integer; cdecl; external 'libgtk-3.so'; // //libglib-2.0.so gtk_timeout_remove libgtk-x11-2.0.so + class procedure g_source_remove(timeout_handler_id:integer); cdecl; external 'libgtk-3.so';//"libgtk-x11-2.0.so"; //Ƴ + + //////////////////////////clipboard///////////////////// + procedure gtk_clipboard_set_text(c:pointer;s:string;len:integer);cdecl;external 'libgtk-3.so'; + function gtk_clipboard_get(atm:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_clipboard_wait_for_text(clipboard:pointer):string;cdecl;external 'libgtk-3.so'; + + //////////////////////// + function gtk_events_pending():integer;cdecl;external 'libgtk-3.so'; + function gtk_main_iteration_do(f:integer):integer;cdecl;external 'libgtk-3.so'; + function gtk_main_iteration():integer ;cdecl;external 'libgtk-3.so'; + /////////////////////////////////////////////////////// + function tsl_gtk_idle_interface(p:pointer):integer;cdecl;external "./plugin/libTSLUIL.so"; + function g_idle_remove_by_data(p:pointer):integer;cdecl;external 'libgtk-3.so'; + + //////////////// + function g_slist_alloc():pointer;cdecl;external 'libgtk-3.so'; + function g_slist_append(list:pointer;d:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure g_slist_free(list:pointer);cdecl;external 'libgtk-3.so'; + function g_slist_find(gl:pointer;d:pointer):pointer;cdecl;external 'libgtk-3.so'; + function g_slist_length(gl:pointer):integer;cdecl;external 'libgtk-3.so'; + function g_slist_delete_link(gl:pointer;gl2:pointer):pointer;cdecl;external 'libgtk-3.so'; + function g_slist_remove(gl:pointer;gl2:pointer):pointer;cdecl;external 'libgtk-3.so'; + ////////////////not classfiy////////////////////////////////// + function gtk_widget_is_visible(w:pointer):integer;cdecl;external 'libgtk-3.so'; + function gtk_widget_has_focus(w:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_can_focus(w:pointer;cf:integer);cdecl;external 'libgtk-3.so'; + function gtk_window_get_focus(w:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_widget_grab_focus(w:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_focus(window:pointer; focus:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_type_hint(window:pointer; tp:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_has_window(widget:pointer;has_window:integer);cdecl;external 'libgtk-3.so'; + function gtk_widget_get_parent(w:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_widget_get_allocated_width(w:pointer):integer;cdecl;external 'libgtk-3.so'; + function gtk_widget_get_allocated_height(w:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_sensitive(w:pointer;s:integer);cdecl;external 'libgtk-3.so'; + function gtk_widget_get_sensitive(w:pointer):integer;cdecl;external 'libgtk-3.so'; + + function gtk_widget_is_toplevel(w:pointer):integer;cdecl;external 'libgtk-3.so'; + function gtk_window_get_title(w:pointer):string;cdecl;external 'libgtk-3.so'; + ////////////////////////////////im///////////////////////// + function gtk_im_multicontext_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_im_multicontext_get_context_id(im:pointer):string;cdecl;external 'libgtk-3.so'; + function gtk_im_multicontext_get_type():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_set_client_window(im:pointer;w:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_set_use_preedit (im:pointer;s:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_focus_in(im:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_focus_out (im:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_reset(im:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_get_preedit_string(im:pointer;var str:string;var attrs:pointer;cp:array of integer);cdecl;external 'libgtk-3.so'; + function gtk_im_context_filter_keypress(im:pointer;e:pointer):integer;cdecl;external 'libgtk-3.so'; + function gtk_im_context_delete_surrounding(im:pointer;offset:integer;nchars:integer):integer;cdecl;external 'libgtk-3.so'; + function gtk_im_context_get_surrounding(im:pointer;var txt:string;var cursor_index:integer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_im_context_set_cursor_location(im:pointer;var area:array of integer);cdecl;external 'libgtk-3.so'; + + //////////////////////////////////gobject////// + function g_type_check_instance_is_a(instance:pointer;iface_type:pointer):integer;cdecl;external 'libgtk-3.so'; + {procedure g_object_set_data(object:pointer;key:string;data:pointer);cdecl;external 'libgtk-3.so'; + function g_object_get_data(object:pointer;key:string):pointer;cdecl;external 'libgtk-3.so'; + + procedure g_object_set_data_base(object:pointer;key:string;data:pointer);cdecl;external 'libgtk-3.so' name "g_object_set_data"; + function g_object_get_data_base(object:pointer;key:string):pointer;cdecl;external 'libgtk-3.so' name 'g_object_get_data'; + } + function g_object_get_data(object:pointer;key:string); + begin + return gtk_object_get_data(object,key); + //r := g_object_get_data_base(object,key); + return r; + end + function g_object_set_data(object:pointer;key:string;data:pointer); + begin + return gtk_object_set_data(object,key,data); + end + function g_object_ref(g:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure g_object_unref(g:pointer);cdecl;external 'libgtk-3.so'; + ////////////////////////scroll////////////////////////// + function gtk_scrolled_window_new(hadjustment:pointer; vadjustment:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_scrolled_window_add_with_viewport(s:pointer;c:pointer);cdecl;external 'libgtk-3.so'; + function gtk_scrolled_window_get_hscrollbar(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_scrolled_window_get_vscrollbar(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_scrolled_window_get_hadjustment(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_scrolled_window_get_vadjustment(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_scrolled_window_set_max_content_height(s:pointer;h:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_scrolled_window_set_min_content_height(s:pointer;h:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_scrolled_window_set_max_content_width(s:pointer;h:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_scrolled_window_set_policy(s:pointer;p:integer);cdecl;external 'libgtk-3.so'; + + /////////////////////scrollable//////////////////////////// + procedure gtk_scrollable_set_vscroll_policy(s:pointer;p:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_scrollable_set_hscroll_policy(s:pointer;p:integer);cdecl;external 'libgtk-3.so'; + function gtk_scrollable_get_hadjustment(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_scrollable_get_vadjustment(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + //////////////gdk window /////// + procedure gdk_window_show_unraised(w:pointer);cdecl;external 'libgtk-3.so'; + ///////////////////////////device////////////////////////// + //gdk_display_get_pointer(gdk_display_get_default(), nil, x, y, nil); //λ + procedure gdk_display_get_pointer(d:pointer; screen:string;var x :integer;var Y:integer;msk:string); cdecl;external 'libgtk-3.so'; + function gdk_display_get_default():pointer;cdecl;external 'libgtk-3.so'; + function gdk_screen_get_default():pointer;cdecl;external 'libgtk-3.so'; + function gdk_display_get_default_seat(d:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gdk_seat_get_pointer(dm:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gdk_device_get_position(d:pointer;t:pointer;var x :integer;var y:integer);cdecl;external 'libgtk-3.so'; + function gdk_event_get_scroll_deltas(d:pointer;var x :double;var y:double):integer;cdecl;external 'libgtk-3.so'; + procedure gdk_window_get_position(w:pointer;var x:integer;var y:integer);cdecl;external 'libgtk-3.so'; + function gdk_screen_height():integer;cdecl;external 'libgtk-3.so'; + function gdk_screen_width():integer;cdecl;external 'libgtk-3.so'; + function gdk_event_get_event_type(e:pointer):integer;cdecl;external 'libgtk-3.so'; + + ////////////////////////// start //////////////////////////////////////// + procedure gtk_init(argc:string;argcv:string);cdecl;external 'libgtk-3.so'; + procedure gtk_main ();cdecl;external 'libgtk-3.so'; + procedure gtk_main_quit();cdecl;external 'libgtk-3.so'; + + + //////////////////////context/////////////////////////////// + function gtk_widget_get_style_context(w:pointer):pointer;cdecl;external 'libgtk-3.so'; + + /////////////////////////////////////////////////////////////// + + /////////////////////////////////widget//////////////////////////////////// + function gtk_widget_get_realized(w:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_events(w:pointer;f:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_get_allocation(w:pointer;var rec:array of integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_allocation(w:pointer; rec: array of integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_size_allocate(w:pointer; rec: array of integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_modify_text(w:pointer;t:integer;c:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_tooltip_text(w:pointer;tip:string);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_size_request(wd:pointer;h:integer;w:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_get_size_request(wd:pointer;var h:integer;var w:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_set_app_paintable(w:pointer;f:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_realize(w:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_queue_draw(w:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_queue_draw_area(w:pointer;x:integer;y:integer;wd:integer;ht:integer);cdecl;external 'libgtk-3.so'; + + function gtk_widget_get_margin_top(w:pointer):integer;cdecl;external 'libgtk-3.so'; + /////////////////////edit entry////////////////////////////////////////////////////// + function gtk_entry_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_entry_get_text(w:pointer):string;cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_text(e:pointer;c:string);cdecl;external 'libgtk-3.so'; + function gtk_entry_get_text_length(e:pointer):short;cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_visibility(e:pointer;v:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_width_chars(e:pointer;v:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_invisible_char(e:pointer;c:integer);cdecl;external 'libgtk-3.so'; + //procedure gtk_entry_set_editable(e:pointer;ed:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_editable_set_editable(e:pointer;ed:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_has_frame(e:pointer;s:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_entry_set_max_length(e:pointer;len:integer);cdecl;external 'libgtk-3.so'; + + /////////////////////text view memo ////////////////////////////////////////////////////// + function gtk_text_view_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_text_view_set_wrap_mode(t:pointer;md:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_view_set_buffer(t:pointer;bf:pointer);cdecl;external 'libgtk-3.so'; + function gtk_text_buffer_new(tagtable:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_text_buffer_get_iter_at_offset(bf:pointer;iter:pointer;offset:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_buffer_insert(bf:pointer;iter:pointer;txt:string;len:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_view_set_editable(t:pointer;e:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_set_word_wrap(t:pointer;e:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_buffer_get_end_iter(b:pointer;iter:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_text_buffer_get_start_iter(b:pointer;iter:pointer);cdecl;external 'libgtk-3.so'; + function gtk_text_buffer_get_char_count(b:pointer):integer;cdecl;external 'libgtk-3.so'; + function gtk_text_buffer_get_line_count(b:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_text_buffer_delete(b:pointer;start:pointer;ed:pointer);cdecl;external 'libgtk-3.so'; + function gtk_text_buffer_get_text(b:pointer;start:pointer;ed:pointer;ic:integer):string;cdecl;external 'libgtk-3.so'; + function gtk_text_buffer_get_selection_bounds(b:pointer;st:pointer;ed:pointer):integer;cdecl;external 'libgtk-3.so'; + + + + //////////////////////////////pango//////////////////////////////////////////// + function pango_font_description_from_string(ns:string):pointer; cdecl;external 'libgtk-3.so'; + procedure pango_font_description_free(pg:pointer);cdecl;external 'libgtk-3.so'; + procedure pango_font_description_set_size(pg:pointer;sz:integer);cdecl;external 'libgtk-3.so'; + function pango_cairo_create_layout(c:pointer):pointer;cdecl;external 'libgtk-3.so'; + function pango_cairo_create_context(c:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure pango_layout_set_width(p:pointer;w:integer);cdecl;external 'libgtk-3.so'; + function pango_layout_get_width(p:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure pango_layout_set_wrap(p:pointer;wp:integer);cdecl;external 'libgtk-3.so'; + procedure pango_layout_set_font_description(p:pointer;f:pointer);cdecl;external 'libgtk-3.so'; + procedure pango_layout_set_text(pl:pointer;s:string;len:integer);cdecl;external 'libgtk-3.so'; + procedure pango_cairo_show_layout(cr:pointer;pl:pointer);cdecl;external 'libgtk-3.so'; + function pango_cairo_font_map_get_default():pointer;cdecl;external 'libgtk-3.so'; + procedure pango_font_map_list_families(fm:pointer;var fls:pointer;var n:integer);cdecl;external 'libgtk-3.so'; + function pango_font_family_get_name(n:pointer):string;cdecl;external 'libgtk-3.so'; + function pango_font_family_get_names(); // + begin + fm := pango_cairo_font_map_get_default(); + pango_font_map_list_families(fm,ls,lsn); + mt := new aefclassobj_(); + r := array(); + psize := static getctypesize()["intptr"]; + for i:= 0 to lsn -1 do + begin + pi := mt.readptr(ls+psize*i); + r[i] := GtkStringToTsl( pango_font_family_get_name(pi)); + end + return r; + end + + ///////////////////////////cairo//////////////////////////////// + function cairo_create(s:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure cairo_save(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_restore(c:pointer);cdecl;external 'libgtk-3.so'; + function gdk_cairo_create(w:pointer):pointer;cdecl;external 'libgtk-3.so'; + function cairo_move_to(cr:pointer;x:double;y:double);cdecl;external 'libgtk-3.so'; + function cairo_line_to(cr:pointer;x:double;y:double);cdecl;external 'libgtk-3.so'; + procedure cairo_set_source(cr:pointer;s:pointer);cdecl;external 'libgtk-3.so'; + function cairo_get_source(cr:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure cairo_curve_to(cr:pointer;x1:double;y1:double;x2:double;y2:double;x3:double;y3:double);cdecl;external 'libgtk-3.so'; + procedure cairo_rectangle(c:pointer;x:double;y:double;w:double;h:double);cdecl;external 'libgtk-3.so'; + procedure cairo_set_source_rgba(c:pointer;red:double;green:double;blue:double;alpha:double);cdecl;external 'libgtk-3.so'; + procedure cairo_set_source_rgb(c:pointer;r:double;g:double;b:double);cdecl;external 'libgtk-3.so'; + procedure cairo_set_line_width(c:pointer;w:double);cdecl;external 'libgtk-3.so'; + function cairo_get_line_width(c:pointer):double;cdecl;external 'libgtk-3.so'; + procedure cairo_set_line_cap(c:pointer;cp:integer);cdecl;external 'libgtk-3.so'; + function cairo_get_line_cap(c:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure cairo_set_line_join(c:pointer;t:integer);cdecl;external 'libgtk-3.so'; + function cairo_get_line_join(c:pointer):integer;cdecl;external 'libgtk-3.so'; + //procedure draw_round_rectangle(c:pointer;x:double;y:double;w:double;h:double;r:double);cdecl;external 'libgtk-3.so'; + procedure cairo_arc (cr:pointer; xc:double;yc:double;radius:double;angle1:double;angle2:double);cdecl;external 'libgtk-3.so'; + procedure cairo_translate(cr:pointer;tx:double;ty:double);cdecl;external 'libgtk-3.so'; + procedure cairo_rotate(cr:pointer;angle:double);cdecl;external 'libgtk-3.so'; + procedure cairo_scale(cr:pointer;sx:double;sy:double);cdecl;external 'libgtk-3.so'; + procedure cairo_set_operator(c:pointer;op:integer);cdecl;external 'libgtk-3.so'; + function cairo_get_operator(c:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure cairo_set_tolerance(c:pointer;tol:double);cdecl;external 'libgtk-3.so'; + function cairo_get_tolerance(c:pointer):double;cdecl;external 'libgtk-3.so'; + procedure cairo_destroy(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_close_path(c:pointer);cdecl;external 'libgtk-3.so'; + + procedure cairo_set_fill_rule(c:pointer;rul:integer);cdecl;external 'libgtk-3.so'; + procedure cairo_clip(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_clip_preserve(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_clip_extents(c:pointer;x1:double;y1:double;x2:double;y2:double);cdecl;external 'libgtk-3.so'; + function cairo_in_clip(c:pointer;x:double;y:double);cdecl;external 'libgtk-3.so'; + procedure cairo_reset_clip(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_stroke(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_stroke_preserve(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_set_dash(c:pointer;dash:array of double;num_dash:integer;offset:double);cdecl;external 'libgtk-3.so'; + procedure cairo_fill(c:pointer);cdecl;external 'libgtk-3.so'; + + procedure cairo_fill_preserve(c:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_fill_extents(c:pointer;x1:double;y1:double;x2:double;y2:double);cdecl;external 'libgtk-3.so'; + procedure cairo_paint_with_alpha(c:pointer;alpah:double);cdecl;external 'libgtk-3.so'; + + procedure cairo_paint(c:pointer);cdecl;external 'libgtk-3.so'; + function cairo_applay_pen_style(dc); + begin + pt := gtk_object_get_data(dc,"pen.style"); + if pt=0x2 then + begin + cairo_set_dash(dc,array(4.0,1.0),2,0); + end + else cairo_set_dash(dc,array(4.0,0.0),2,0); + end + function cairo_draw_round_rectangle(cr,x,y,w,h,r); + begin + cairo_move_to (cr, x + r, y); + cairo_line_to (cr, x + w - r, y); + cairo_move_to (cr, x + w, y + r); + cairo_line_to (cr, x + w, y + h - r); + cairo_move_to (cr, x + w - r, y + h); + cairo_line_to (cr, x + r, y + h); + cairo_move_to (cr, x, y + h - r); + cairo_line_to (cr, x, y + r); + cairo_arc (cr, x + r, y + r, r, 3.14, 3 * 3.14 / 2.0); + cairo_arc (cr, x + w - r, y + r, r, 3 * 3.14 / 2, 2 * 3.14); + cairo_arc (cr, x + w - r, y + h - r, r, 0, 3.14 / 2); + cairo_arc (cr, x + r, y + h - r, r, 3.14 / 2, 3.14); + end + //////////////////////text//////// https://developer.gnome.org/cairo/stable/cairo-cairo-font-options-t.html#cairo-font-options-get-hint-metrics + procedure cairo_show_text(c:pointer;t:string);cdecl;external 'libgtk-3.so'; + procedure cairo_select_font_face(cr:pointer;n:string;slat:integer;weight:integer);cdecl;external 'libgtk-3.so'; + procedure cairo_set_font_size(cr:pointer;sz:double);cdecl;external 'libgtk-3.so'; + procedure cairo_text_extents(cr:pointer;s:string;ext:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_font_extents(cr:pointer;ext:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_get_font_options(cr:pointer;ft:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_set_font_options(cr:pointer;ft:pointer);cdecl;external 'libgtk-3.so'; + function cairo_font_options_create():pointer;cdecl;external 'libgtk-3.so'; + procedure cairo_font_options_destroy(op:pointer);cdecl;external 'libgtk-3.so'; + + ////////cairo surface//////2 + { + CAIRO_FORMAT_INVALID = -1, + CAIRO_FORMAT_ARGB32 = 0, + CAIRO_FORMAT_RGB24 = 1, + CAIRO_FORMAT_A8 = 2, + CAIRO_FORMAT_A1 = 3, + CAIRO_FORMAT_RGB16_565 = 4, + CAIRO_FORMAT_RGB30 = 5 + } + function cairo_image_surface_create(t:integer;w:integer;h:integer):pointer;cdecl;external 'libgtk-3.so'; + function cairo_image_surface_create_from_png(f:string):pointer;cdecl;external 'libgtk-3.so'; + function cairo_image_surface_get_width(sf:pointer):integer;cdecl;external 'libgtk-3.so'; + function cairo_image_surface_get_height(sf:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure cairo_surface_destroy(sf:pointer);cdecl;external 'libgtk-3.so'; + procedure cairo_set_source_surface(cr:pointer;sf:pointer;x:double;y:double);cdecl;external 'libgtk-3.so'; + + procedure cairo_pattern_set_extend(c:pointer;pe:integer);cdecl;external 'libgtk-3.so'; + function cairo_pattern_create_linear(x0:double;y0:double;x1:double;y1:double):pointer;cdecl;external 'libgtk-3.so'; + procedure cairo_pattern_add_color_stop_rgb(c:pointer;offset:double;r:double;g:double;b:double;a:double);cdecl;external 'libgetk-3.so'; + + + /////////////////////////window////////// + procedure gdk_window_move_resize(w:pointer;x:integer;y:integer;wd:integer;h:integer);cdecl;external 'libgtk-3.so'; + procedure gdk_window_resize(w:pointer;wd:integer;h:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_begin_move_drag(w:pointer;btn:integer;x:integer;y:integer;t:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_begin_resize_drag(w:pointer;e:integer;btn:integer;x:integer;y:integer;t:integer);cdecl;external 'libgtk-3.so'; + function gtk_widget_get_toplevel(w:pointer):pointer;cdecl;external 'libgtk-3.so'; + /////////// modal //////////////////////////////// + procedure gtk_window_set_modal(w:pointer;f:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_transient_for(w:pointer;p:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_get_size(wd:pointer;var h:integer;var w:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_icon(w:pointer;ico:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_resizable(p:pointer;f:integer);cdecl;external 'libgtk-3.so'; + function gtk_window_get_resizable(p:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_decorated(w:pointer;f:integer);cdecl;external 'libgtk-3.so'; + function gtk_window_get_decorated(w:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_title(w:pointer;t:string);cdecl;external 'libgtk-3.so'; + procedure gtk_window_set_geometry_hints (window:pointer; + eometry_widget:pointer; + geometry:pointer; + geom_mask:integer);cdecl;external 'libgtk-3.so'; + + procedure gtk_window_resize(w:pointer;wd:integer;ht:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_resize_to_geometry(w:pointer;wd:integer;ht:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_window_move(w:pointer;x:integer;y:integer);cdecl;external 'libgtk-3.so'; + + ////////////////////// container layout fixed ////////////////////// + procedure gtk_container_add(c1:pointer;c2:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_container_remove(c:pointer;w:pointer); cdecl;external 'libgtk-3.so'; + procedure gtk_container_set_border_width (container:pointer;border_width:integer);cdecl;external 'libgtk-3.so'; + function gtk_fixed_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_layout_new(h:pointer;v:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_layout_get_size(layout:pointer;var width:integer;var height:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_layout_set_size(layout:pointer; width:integer; height:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_fixed_put(fixed:pointer;widget:pointer;x:integer;y:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_layout_put(fixed:pointer;widget:pointer;x:integer;y:integer);cdecl;external 'libgtk-3.so'; + function gtk_layout_get_bin_window(l:pointer):pointer;cdecl;external 'libgtk-3.so'; + + //////////////////////////// box ///////////////////////// + function gtk_vbox_new(homogeneous:integer;spacing:integer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_hbox_new(homogeneous:integer;spacing:integer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_box_pack_end(box:pointer;w:pointer;expand:integer;f:integer;pad:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_box_pack_start(box:pointer;w:pointer;expand:integer;f:integer;pad:integer);cdecl;external 'libgtk-3.so'; + + //////////////////////////menu////////////////////////////////////////////////// + function gtk_menu_shell_get_by_positon(h:pointer;pi:integer); + begin + gist := gtk_container_get_children(h); + ridx := 0; + while gist do + begin + og := new _gslist(gist); + if ridx=pi then + begin + return og.data; + end + ridx++; + gist := og.next; + //echo "\r\n+++",gist,"+++\r\n"; + end + return 0; + end + function gtk_container_get_children(m:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_menu_bar_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_menu_shell_append(mb:pointer;mi:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_shell_prepend(mb:pointer;mi:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_shell_insert(mb:pointer;mi:pointer;idx:integer);cdecl;external 'libgtk-3.so'; + + function gtk_menu_item_new_with_label(s:string):pointer;cdecl;external 'libgtk-3.so'; + function gtk_menu_item_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_menu_item_set_submenu(mb:pointer;mi:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_item_set_use_underline(mi:pointer;l:integer);cdecl;external 'libgtk-3.so'; + function gtk_separator_menu_item_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_menu_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_menu_item_select(mi:pointer);cdecl;external 'libgtk-3.so'; + function gtk_check_menu_item_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_check_menu_item_new_with_label(s:string):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_check_menu_item_set_active(cmi:pointer;ck:integer);cdecl;external 'libgtk-3.so'; + function gtk_check_menu_item_get_active(cmi:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_check_menu_item_toggled(cmi:pointer);cdecl;external 'libgtk-3.so'; + function gtk_menu_item_get_label(mi:pointer):string;cdecl;external 'libgtk-3.so'; + procedure gtk_menu_item_set_label(mi:pointer;l:string);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_set_title(mi:pointer;l:string);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_reorder_child(mb:pointer;mi:pointer;id:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_popup (menu:pointer; + parent_menu_shell:pointer; + parent_menu_item:pointer; + func:pointer; + data:pointer; + button:integer; + activate_time:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_menu_item_activate(mi:pointer);cdecl;external 'libgtk-3.so'; + + + /////////////////////////// adjust scroll ///////////////////////////////// + function gtk_adjustment_get_type():pointer; cdecl;external 'libgtk-3.so'; + function GTK_ADJUSTMENT(w); + begin + return g_type_check_instance_cast(w,gtk_adjustment_get_type()); + end + function gtk_adjustment_new(v:double; + lower:double; + upper:double; + step_increment:double; + page_increment:double; + page_size:double):pointer; cdecl;external 'libgtk-3.so'; + function gtk_adjustment_get_value(adj:pointer):double; cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_set_value(adj:pointer;v:double); cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_set_page_size(adj:pointer;v:double); cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_changed(adj:pointer); cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_value_changed(adj:pointer); cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_set_lower(adj:pointer;v:double);cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_set_upper(adj:pointer;v:double);cdecl;external 'libgtk-3.so'; + function gtk_adjustment_get_upper(adj:pointer):double;cdecl;external 'libgtk-3.so'; + function gtk_adjustment_get_lower(adj:pointer):double;cdecl;external 'libgtk-3.so'; + + function gtk_hscrollbar_new(adj:pointer):pointer; cdecl;external 'libgtk-3.so'; + function gtk_vscrollbar_new(adj:pointer):pointer; cdecl;external 'libgtk-3.so'; + procedure gtk_adjustment_configure(adj:pointer; + v:double; + lower:double; + upper:double; + step_increment:double; + page_increment:double; + page_size:double);cdecl;external 'libgtk-3.so'; + + //////////////////////////////////////////////////// + function gtk_frame_new(lbl:string):pointer;cdecl;external 'libgtk-3.so'; + ///////////////////////////////////// + function gtk_calendar_new():pointer;cdecl;external 'libgtk-3.so'; + + ///////////////////////////////// + function gtk_spinner_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_spinner_start(spn:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_spinner_stop(spn:pointer);cdecl;external 'libgtk-3.so'; + + /////////////////////////////// + function gtk_progress_bar_new():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_progress_bar_set_text(pb:pointer;t:string);cdecl;external 'libgtk-3.so'; + procedure gtk_progress_bar_set_show_text(pb:pointer;s:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_progress_bar_set_fraction(pb:pointer;p:double);cdecl;external 'libgtk-3.so'; + procedure gtk_progress_bar_set_pulse_step(pb:pointer;p:double);cdecl;external 'libgtk-3.so'; + function gtk_progress_bar_get_fraction(pb:pointer):double;cdecl;external 'libgtk-3.so'; + function gtk_progress_bar_set_inverted(pb:pointer;v:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_progress_bar_pulse(pb:pointer);cdecl;external 'libgtk-3.so'; + //procedure gtk_progress_configure(pb:pointer;v:double;min:double;max:double);cdecl;external 'libgtk-3.so'; + + //////////////////////////////label///////////////////////////////////// + function gtk_label_new(t:string):pointer;cdecl;external 'libgtk-3.so'; + function gtk_label_get_text(w:pointer):string;cdecl;external 'libgtk-3.so'; + procedure gtk_label_set_text(l:pointer;t:string);cdecl;external 'libgtk-3.so'; + procedure gtk_label_set_selectable(l:pointer;s:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_label_set_markup(l:pointer;t:string);cdecl;external 'libgtk-3.so'; + //////////////// button btn ///////////////// + function gtk_button_get_label(b:pointer):string;cdecl;external 'libgtk-3.so'; + function gtk_button_get_event_window(b:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_button_new_with_label(c:string):pointer;cdecl;external 'libgtk-3.so'; + function gtk_button_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_check_button_new():pointer;cdecl;external 'libgtk-3.so'; + function gtk_check_button_new_with_label(l:string):pointer;cdecl;external 'libgtk-3.so'; + function gtk_radio_button_new(g:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_radio_button_new_from_widget(g:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_toggle_button_set_active(tg:pointer;ac:integer);cdecl;external 'libgtk-3.so'; + function gtk_toggle_button_get_active(tg:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_button_clicked(b:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_radio_button_set_group(rbtn:pointer;lst:pointer);cdecl;external 'libgtk-3.so'; + + + + ////////////////////////// dialog /////////////////////////////////////////////////////////// + function gtk_dialog_run(d:pointer):integer; cdecl;external 'libgtk-3.so'; + procedure gtk_dialog_response(w:pointer;id:integer); cdecl;external 'libgtk-3.so'; + function gtk_file_chooser_dialog_new(t:string;p:pointer;act:integer;bstring1:string;bvalue1:integer;bstring2:string;bvalue2:integer;pend:pointer):pointer ; cdecl;external 'libgtk-3.so'; + function gtk_file_chooser_get_filename(p:pointer):string;cdecl;external 'libgtk-3.so'; + function gtk_file_chooser_set_filename(p:pointer;n:string):integer;cdecl;external 'libgtk-3.so'; + procedure gtk_file_chooser_set_select_multiple(p:pointer;m:integer);cdecl;external 'libgtk-3.so'; + function gtk_file_chooser_get_filenames(p:pointer):pointer ;cdecl;external 'libgtk-3.so'; + function gtk_font_chooser_dialog_new(t:string;p:pointer):pointer;cdecl;external 'libgtk-3.so'; + function gtk_font_selection_dialog_new(t:string):pointer;cdecl;external 'libgtk-3.so'; + function gtk_font_selection_dialog_get_font_name(d:pointer):string;cdecl;external 'libgtk-3.so'; + function gtk_font_selection_dialog_get_preview_text(p:pointer):string;cdecl;external 'libgtk-3.so'; + procedure gtk_font_selection_dialog_set_preview_text(p:pointer;t:string); cdecl;external 'libgtk-3.so'; + function gtk_font_selection_dialog_set_font_name(p:pointer;f:string):integer; cdecl;external 'libgtk-3.so'; + procedure gtk_widget_modify_font(w:pointer;p:pointer); cdecl;external 'libgtk-3.so'; + function gtk_color_selection_dialog_get_type():pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_color_selection_set_current_color(w:pointer;c:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_color_selection_get_current_color(w:pointer;c:pointer);cdecl;external 'libgtk-3.so'; + + function gdk_color_parse(cs:string;c:pointer):integer;cdecl;external 'libgtk-3.so'; + + ////////////////// evntbox //////////////////////////// + function gtk_event_box_new():pointer;cdecl;external 'libgtk-3.so'; + //image + function GTK_WIDGET(w); //gtkwidget + begin + wt := static gtk_widget_get_type(); + return g_type_check_instance_cast(w,wt); + return w; + end + function GTK_CONTAINER(w);//gtk + begin + wt := static gtk_container_get_type(); + return g_type_check_instance_cast(w,wt); + end + function GTK_WINDOW(w);//gtkwindow + begin + wt := static gtk_window_get_type(); + return g_type_check_instance_cast(w,wt); + + return w; + end + function GDK_WINDOW(w); //gdkwindow + begin + wt := static gdk_window_get_type(); + return g_type_check_instance_cast(w,wt); + return w; + end + + function GTK_COLOR_SELECTION_DIALOG(W); + begin + return g_type_check_instance_cast(w,gtk_color_selection_dialog_get_type()); + end + procedure gtk_widget_set_parent_window(w:pointer;p:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_get_parent_window(w:pointer;p:pointer);cdecl;external 'libgtk-3.so'; + function gtk_widget_get_type():pointer;cdecl;external 'libgtk-3.so'; + + procedure gtk_widget_modify_bg(w:pointer;tyle:integer;c:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_layout_move(l:pointer;w:pointer;x:integer;y:integer);cdecl;external 'libgtk-3.so'; + procedure gtk_grab_add(w:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_destroy(w:pointer);cdecl;external 'libgtk-3.so'; + function g_thread_self():pointer;cdecl;external 'libgtk-3.so'; + function gtk_get_major_version ():integer;cdecl;external 'libgtk-3.so'; + function gtk_get_micro_version ():integer;cdecl;external 'libgtk-3.so'; + function gtk_get_binary_age ():integer;cdecl;external 'libgtk-3.so'; + function g_main_context_default():pointer;cdecl;external 'libgtk-3.so'; + function g_main_context_get_poll_func(d:pointer):pointer;cdecl;external 'libgtk-3.so'; + + function gtk_main_level():integer;external 'libgtk-3.so'; + function g_signal_connect_data(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):integer;cdecl;external 'libgtk-3.so'; + function g_signal_new(signal_name:string; + itype:pointer; + signal_flags:integer; + class_offset:integer; + accumulator:pointer; + accu_data:pointer; + c_marshaller:pointer; + return_type:pointer; + n_params:integer; + p1:pointer; + p2:pointer):integer;cdecl;external 'libgtk-3.so'; + procedure g_signal_emit_by_name(w:pointer;n:string;p1:pointer;p2:pointer);cdecl;external 'libgtk-3.so'; + function gtk_container_get_type():pointer;cdecl;external 'libgtk-3.so'; + function gtk_window_get_type():pointer;cdecl;external 'libgtk-3.so'; + function gdk_window_get_type():pointer;cdecl;external 'libgtk-3.so'; + function g_type_check_instance_cast(instance:pointer;ty:pointer):pointer;cdecl;external 'libgtk-3.so'; + + function gtk_window_new(lev:integer):pointer; cdecl;external 'libgtk-3.so'; + procedure gdk_window_set_back_pixmap(window:pointer;pixmap:pointer;parent_relative:integer);cdecl;external 'libgtk-x11-2.0.so'; + procedure gdk_pixbuf_ref(pixbuf:pointer);cdecl;external 'libgtk-3.so'; + procedure gdk_pixbuf_unref(pixbuf:pointer);cdecl;external 'libgtk-3.so'; + + function gdk_cursor_new(c:integer):pointer;cdecl;external 'libgtk-3.so'; + procedure gdk_window_set_cursor(w:pointer;c:pointer);cdecl;external 'libgtk-3.so'; + function gtk_widget_get_window(g:pointer):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_window_get_position(g:pointer;var x:integer;var y:integer);cdecl;external 'libgtk-3.so'; + function gtk_image_new_from_file(f:string):pointer;cdecl;external 'libgtk-3.so'; + procedure gtk_widget_show_all (window:pointer);cdecl;external 'libgtk-3.so';//'libgtk-x11-2.0.so'; + procedure gtk_widget_show(window:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_show_now(window:pointer);cdecl;external 'libgtk-3.so'; + procedure gtk_widget_hide(window:pointer);cdecl;external 'libgtk-3.so'; + //-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 + //-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype + procedure gdk_pixbuf_render_pixmap_and_mask(pixbuf:pointer; + var pixmap_return:int64; + var mask_return:int64; + alpha_threshold:integer); cdecl; + external 'libgtk-x11-2.0.so'; + //function gtk_image_get_pixbuf (image:pointer):pointer; cdecl;external 'libgtk-x11-2.0.so'; + //function gdk_pixbuf_copy(image:pointer):pointer; cdecl;external 'libgtk-x11-2.0.so'; + + procedure gtk_image_set_from_file (img:pointer;filename:string);cdecl;external 'libgtk-3.so'; + function gtk_image_new_from_pixbuf(image:pointer):pointer; cdecl;external 'libgtk-3.so'; + function gtk_image_new():pointer; cdecl;external 'libgtk-3.so'; + function gdk_pixbuf_get_width(src_pixbuf:pointer):integer;cdecl;external 'libgtk-3.so'; + function gdk_pixbuf_get_height(src_pixbuf:pointer):integer;cdecl;external 'libgtk-3.so'; + +end + +type _cairo_matrix_t = class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("xx","double",0), + ("yx","double",0), + ("xy","double",0), + ("yy","double",0), + ("x0","double",0), + ("y0","double",0) + ),nil,nil,4); + + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property xx index "xx" read _getvalue_ write _setvalue_; + property yx index "yx" read _getvalue_ write _setvalue_; + property xy index "xy" read _getvalue_ write _setvalue_; + property yy index "yy" read _getvalue_ write _setvalue_; + property x0 index "x0" read _getvalue_ write _setvalue_; + property y0 index "y0" read _getvalue_ write _setvalue_; + end +type _cairo_text_extents_t = class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("x_bearing","double",0), + ("y_bearing","double",0), + ("width","double",0), + ("height","double",0), + ("x_advance","double",0), + ("y_advance","double",0) + ),nil,nil,4); + + return SSTRUCT; + end + + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property x_bearing index "x_bearing" read _getvalue_ write _setvalue_; + property y_bearing index "y_bearing" read _getvalue_ write _setvalue_; + property width index "width" read _getvalue_ write _setvalue_; + property height index "height" read _getvalue_ write _setvalue_; + property x_advance index "x_advance" read _getvalue_ write _setvalue_; + property y_advance index "y_advance" read _getvalue_ write _setvalue_; +end +type _cairo_font_extents_t = class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("ascent","double",0), + ("descent","double",0), + ("height","double",0), + ("max_x_advance","double",0), + ("max_y_advance","double",0) + ),nil,nil,4); + return SSTRUCT; + end + + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ascent index "ascent" read _getvalue_ write _setvalue_; + property descent index "descent" read _getvalue_ write _setvalue_; + property height index "height" read _getvalue_ write _setvalue_; + property max_x_advance index "max_x_advance" read _getvalue_ write _setvalue_; + property max_y_advance index "max_y_advance" read _getvalue_ write _setvalue_; + end +type _dlgwidgets = class(tslcstructureobj) + + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + (0,"intptr",0), + (1,"intptr",0), + (2,"intptr",0), + (3,"intptr",0) + ),nil,nil,4); + + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end +end + +type _GdkEventButton=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("time","int",0), + ("x","double",0), + ("y","double",0), + ("axes","intptr",0), + ("state","int",0), + ("button","int",0), + ("device","intptr",0), + ("x_root","double",0), + ("y_root","double",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property time index "time" read _getvalue_ write _setvalue_; + property x index "x" read _getvalue_ write _setvalue_; + property y index "y" read _getvalue_ write _setvalue_; + property axes index "axes" read _getvalue_ write _setvalue_; + property state index "state" read _getvalue_ write _setvalue_; + property button index "button" read _getvalue_ write _setvalue_; + property device index "device" read _getvalue_ write _setvalue_; + property x_root index "x_root" read _getvalue_ write _setvalue_; + property y_root index "y_root" read _getvalue_ write _setvalue_; +end + +type _GdkEventKey=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("time","int",0), + ("state","int",0), + ("keyval","int",0), + ("length","int",0), + ("str","intptr",0), + ("hardware_keycode","short",0), + ("group","byte",0), + ("is_modifier","int",1) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property time index "time" read _getvalue_ write _setvalue_; + property state index "state" read _getvalue_ write _setvalue_; + property keyval index "keyval" read _getvalue_ write _setvalue_; + property length index "length" read _getvalue_ write _setvalue_; + property hardware_keycode index "hardware_keycode" read _getvalue_ write _setvalue_; + property group index "group" read _getvalue_ write _setvalue_; + property is_modifier index "is_modifier" read _getvalue_ write _setvalue_; +end +type _GdkEventConfigure=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("x","int",0), + ("y","int",0), + ("width","int",0), + ("height","int",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property x index "x" read _getvalue_ write _setvalue_; + property y index "y" read _getvalue_ write _setvalue_; + property width index "width" read _getvalue_ write _setvalue_; + property height index "height" read _getvalue_ write _setvalue_; +end + +type _GdkEventMotion=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("time","int",0), + ("x","double",0), + ("y","double",0), + ("axes","intptr",0), + ("state","int",0), + ("is_hint","short",0), + ("device","intptr",0), + ("x_root","double",0), + ("y_root","double",0)),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property time index "time" read _getvalue_ write _setvalue_; + property x index "x" read _getvalue_ write _setvalue_; + property y index "y" read _getvalue_ write _setvalue_; + property axes index "axes" read _getvalue_ write _setvalue_; + property state index "state" read _getvalue_ write _setvalue_; + property is_hint index "is_hint" read _getvalue_ write _setvalue_; + property device index "device" read _getvalue_ write _setvalue_; + property x_root index "x_root" read _getvalue_ write _setvalue_; + property y_root index "y_root" read _getvalue_ write _setvalue_; +end + +type _GdkEventScroll=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("time","int",0), + ("x","double",0), + ("y","double",0), + ("state","int",0), + ("direction","int",0), + ("device","intptr",0), + ("x_root","double",0), + ("y_root","double",0)),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property time index "time" read _getvalue_ write _setvalue_; + property x index "x" read _getvalue_ write _setvalue_; + property y index "y" read _getvalue_ write _setvalue_; + property axes index "axes" read _getvalue_ write _setvalue_; + property state index "state" read _getvalue_ write _setvalue_; + property is_hint index "is_hint" read _getvalue_ write _setvalue_; + property device index "device" read _getvalue_ write _setvalue_; + property x_root index "x_root" read _getvalue_ write _setvalue_; + property y_root index "y_root" read _getvalue_ write _setvalue_; + property direction index "direction" read _getvalue_ write _setvalue_; +end +type _GdkEventAny=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; +end +type _GdkEventFocus=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("iin","short",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property iin index "iin" read _getvalue_ write _setvalue_; +end +type _GdkEventExpose=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("area","int[4]",0), + ("region","intptr",0), + ("count","int",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property area index "area" read _getvalue_ write _setvalue_; +end +type _GdkEventNoExpose=class(_GdkEventAny) + function Create(ptr); + begin + inherited; + end +end +type _GdkEventVisibility=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("state","int",0) + ),nil,nil,4); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property state index "state" read _getvalue_ write _setvalue_; +end +type _GdkEventCrossing=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("subwindow","intptr",0), + ("time","int",0), + ("x","double",0), + ("y","double",0), + ("x_root","double",0), + ("y_root","double",0), + ("mode","intptr",0), + ("detail","intptr",0), + ("focus","int",0), + ("state","int",0) + ),nil,nil,4); + {GDK_WINDOW_STATE_WITHDRAWN = 1 << 0, + GDK_WINDOW_STATE_ICONIFIED = 1 << 1, + GDK_WINDOW_STATE_MAXIMIZED = 1 << 2, + GDK_WINDOW_STATE_STICKY = 1 << 3, + GDK_WINDOW_STATE_FULLSCREEN = 1 << 4, + GDK_WINDOW_STATE_ABOVE = 1 << 5, + GDK_WINDOW_STATE_BELOW = 1 << 6} + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; +end +type _GdkEventWindowState=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("ttype","intptr",0), + ("window","intptr",0), + ("send_event","byte",0), + ("changed_mask","int",0), + ("new_window_state","int",0) + ),nil,nil,4); + {GDK_WINDOW_STATE_WITHDRAWN = 1 << 0, + GDK_WINDOW_STATE_ICONIFIED = 1 << 1, + GDK_WINDOW_STATE_MAXIMIZED = 1 << 2, + GDK_WINDOW_STATE_STICKY = 1 << 3, + GDK_WINDOW_STATE_FULLSCREEN = 1 << 4, + GDK_WINDOW_STATE_ABOVE = 1 << 5, + GDK_WINDOW_STATE_BELOW = 1 << 6} + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property ttype index "ttype" read _getvalue_ write _setvalue_; + property window index "window" read _getvalue_ write _setvalue_; + property send_event index "send_event" read _getvalue_ write _setvalue_; + property changed_mask index "changed_mask" read _getvalue_ write _setvalue_; + property new_window_state index "new_window_state" read _getvalue_ write _setvalue_; +end +type _GtkTextIter=class(tslcstructureobj) + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate(array( + ("dummy1","intptr",0), + ("dummy2","intptr",0), + ("dummy3","int",0), + ("dummy4","int",0), + ("dummy5","int",0), + ("dummy6","int",0), + ("dummy7","int",0), + ("dummy8","int",0), + ("dummy9","intptr",0), + ("dummy10","intptr",0), + ("dummy11","int",0), + ("dummy12","int",0), + ("dummy13","int",0), + ("dummy14","intptr",0), + ("dummy15","intptr",0) + ),nil,nil,4); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + end +end + +type _GdkColor=class(tslcstructureobj) + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate(array( + ("p","int",0), + ("r","short",0), + ("g","short",0), + ("b","short",0))); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + end + function SetRgb(red,green,blue); + begin + r := red; + g := green; + b := blue; + end + property p index "p" read _getvalue_ write _setvalue_; + property r index "r" read _getvalue_ write _setvalue_; + property g index "g" read _getvalue_ write _setvalue_; + property b index "b" read _getvalue_ write _setvalue_; +end +type ttgtk_pen=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("lopenstyle","int",0), + ("lopnwidth","int",1), + ("lopnwidth2","int",0), + ("lopncolor","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + _wapi := unit(tslvcl).gettswin32api(); + end + function destroy();override; + begin + ht := _getptr_(); + inherited; + _wapi.gtk_object_set_data(ht); + end + property style index "lopenstyle" read _getvalue_ write _setvalue_; + property width index "lopnwidth" read _getvalue_ write _setvalue_; + property color index "lopncolor" read _getvalue_ write _setvalue_; + private + _wapi; +end +/////////////////gdi/////////////////////////////////////////// +type ttgtk_brush=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("lbstyle","int",0), + ("lbcolor","int",crColor), + ("lbhatch","intptr",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + _wapi := unit(tslvcl).gettswin32api(); + end + function destroy();override; + begin + ht := _getptr_(); + inherited; + _wapi.gtk_object_set_data(ht); + end + property style index "lbstyle" read _getvalue_ write _setvalue_; + property hatch index "lbhatch" read _getvalue_ write _setvalue_; + property color index "lbcolor" read _getvalue_ write _setvalue_; + private + _wapi; +end +type ttgtk_font=class(tslcstructureobj) + private + static SSTRUCT; + class function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array( + ("height","int",15), + ("width","int",0), + ("escapement","int",0), + ("orientation","int",0), + ("weight","int",400), + ("italic","byte",0), + ("underline","byte",0), + ("strikeout","byte",0), + ("charset","byte",134), + ("outprecision","byte",3), + ("clipprecision","byte",2), + ("quality","byte",1), + ("pitchandfamily","byte",0), + ("facename","char[32]",""))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + _wapi := unit(tslvcl).gettswin32api(); + end + function destroy();override; + begin + ht := _getptr_(); + inherited; + _wapi.gtk_object_set_data(ht); + end + property height index "height" read _getvalue_ write _setvalue_; + property width index "width" read _getvalue_ write _setvalue_; + property escapement index "escapement" read _getvalue_ write _setvalue_; + property orientation index "orientation" read _getvalue_ write _setvalue_; + property weight index "weight" read _getvalue_ write _setvalue_; + property italic index "italic" read _getvalue_ write _setvalue_; + property underline index "underline" read _getvalue_ write _setvalue_; + property strikeout index "strikeout" read _getvalue_ write _setvalue_; + property charset index "charset" read _getvalue_ write _setvalue_; + property outprecision index "outprecision" read _getvalue_ write _setvalue_; + property clipprecision index "clipprecision" read _getvalue_ write _setvalue_; + property quality index "quality" read _getvalue_ write _setvalue_; + property pitchandfamily index "pitchandfamily" read _getvalue_ write _setvalue_; + property facename index "facename" read _getvalue_ write _setvalue_; + private + _wapi; +end + +implementation +/////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////ⶨĽṹ ΪӦwindows api/////////////////////////////////////////// + + +type TSystemTime = class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("wYear","short",0), + ("wMonth","short",0), + ("wDayOfWeek","short",0), + ("wDay","short",0), + ("wHour","short",0), + ("wMinute","short",0), + ("wSecond","short",0), + ("wMilliseconds","short",0) + )); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property wYear index "wYear" read _getvalue_ write _setvalue_ ; + property wMonth index "wMonth" read _getvalue_ write _setvalue_ ; + property wDay index "wDay" read _getvalue_ write _setvalue_ ; +end +type tagNMSELCHANGE=class(tslcstructureobj) + private + static SSTRUCT; + structdata; + pstruct; + function getstruct(); + begin + if not SSTRUCT then + begin + ar1:=array( + ("wYear","short",0), + ("wMonth","short",0), + ("wDayOfWeek","short",0), + ("wDay","short",0), + ("wHour","short",0), + ("wMinute","short",0), + ("wSecond","short",0), + ("wMilliseconds","short",0) + ); + ar3:=array( + ("nmhdr","user",(("hwndfrom","intptr",0),("idfrom","intptr",0),("code","int",0))), + ("stselstart","user",ar1), + ("stselend","user",ar1)); + SSTRUCT:=MemoryAlignmentCalculate(ar3); + end + return SSTRUCT; + end + public + function create(p); + begin + inherited create(getstruct(),p); + end + function SetDataa(y,m,d); + begin + v := _getvalue_("stselstart"); + if ifobj(v) then + begin + v._setvalue_("wYear",y); + v._setvalue_("wMonth",m+1); + v._setvalue_("wDay",d); + end + end +end + +type TSTYLESTRUCT = class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("styleold","int",0), + ("stylenew","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property styleold index "styleold" read _getvalue_ write _setvalue_ ; + property stylenew index "stylenew" read _getvalue_ write _setvalue_ ; +end +type TCREATESTRUCT = class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate( + array( + ("lpcreateparams","intptr",0), + ("hinstance","intptr",0), + ("hmenu","intptr",0), + ("hwndparent","intptr",0), + ("cy","int",0), + ("cx","int",0), + ("y","int",0), + ("x","int",0), + ("style","int",0), + ("lpszname","intptr",0), + ("lpszclass","intptr",0), + ("dwexstyle","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + end + property style index "style" read _getvalue_ write _setvalue_; + property dwexstyle index "dwexstyle" read _getvalue_ write _setvalue_; +end +type TScrollinfo = class(tslcstructureobj) + private + static SSTRUCT; + function getstruct() + begin + if not SSTRUCT then SSTRUCT := + MemoryAlignmentCalculate( + array( + ("cbsize","int",0), + ("fmask","int",0), + ("nmin","int",0), + ("nmax","int",0), + ("npage","int",0), + ("npos","int",0), + ("ntrackpos","int",0))); + return SSTRUCT; + end + public + function create(ptr) + begin + inherited create(getstruct(),ptr); + cbsize := _size_(); + end + property cbsize:integer index "cbsize" read _getvalue_ write _setvalue_; + property fmask:integer index "fmask" read _getvalue_ write _setvalue_; + property nmin:integer index "nmin" read _getvalue_ write _setvalue_; + property nmax:integer index "nmax" read _getvalue_ write _setvalue_; + property npage:integer index "npage" read _getvalue_ write _setvalue_; + property npos:integer index "npos" read _getvalue_ write _setvalue_; + property ntrackpos:integer index "ntrackpos" read _getvalue_ write _setvalue_; +end + /////////////////////////////////ⶨĽṹ ΪӦwindows api/////////////////////////////////////////// +type _gslist =class(tslcstructureobj) + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate( array( + ("data","intptr",0), + ("next","intptr",0)),nil,nil,4); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + end + property data index "data" read _getvalue_ write _setvalue_ ; + property next index "next" read _getvalue_ write _setvalue_ ; +end +type tenterouterlist = class + function push(d); + begin + FIndex++; + FList[FIndex] := d; + end + function lock(); + begin + FLock := true; + end + function unlock(); + begin + FLock := false; + end + function MouseIsMoved(); + begin + if FLock then return ; + + id := FList[FIndex]; + if not id then return ; + ps := array(0,0); + _wapi.GetCursorPos(ps); + if FCpos = ps then return ; + FCpos := ps; + if Mousehittest then call(Mousehittest,self,id); + if Mousemovecall then call(Mousemovecall,self,id); + end + function feach(); + begin + return FList[FIndex]; + end + function inner(h); + begin + for i,v in FList do + begin + if v=h then return true; + end + return false; + end + function pop(d); + begin + for i := 0 to length(FList)-1 do + begin + if d=FList[i] then + begin + deleteindex(FList,i,true); + FIndex--; + end + end + end + function create(api); + begin + _wapi := api; + FCpos := array(0,0); + _wapi.GetCursorPos(FCpos); + FList := array(); + FIndex := -1; + FTimer := new unit(tslvcl).TTimer(); + FTimer.interval := 30; //30 + FTimer.Ontimer := thisfunction(MouseIsMoved); + FTimer.start(); + end + function destroy(); + begin + FIndex := -1; + FList := array(); + FTimer.stop(); + FTimer := nil; + end + Mousemovecall; + Mousehittest; + _wapi; + FCpos; + private + FLock; + FIndex ; + FList; +end +type tgtk_ctl_object = class(_gtkeventtype) + private + + FHitwidgetposition; + static FsysCursors; + Fsyscommand0x12; + Fsyscommand0x12info; + protected + //////////////////////ʽ//////// + Fdwstyle; + FExdwstyle; + /////////////////////////////////// + function CanignoreBtnpress();virtual; + begin + return true; + end + public + function Create(h); // + begin + sinit(); + if not _wapi then + begin + _const := getwin32const(); + _wapi := unit(tslvcl).gettswin32api(); + FMousemoveernotify := new tenterouterlist(_wapi); + FMousemoveernotify.Mousemovecall := thisfunction(widgetmousemovecall); + FMousemoveernotify.Mousehittest := thisfunction(widgetmousehit); + FsysCursors := array(); + FsysCursors[0] := _wapi.gdk_cursor_new(2); + FsysCursors[1] := _wapi.gdk_cursor_new(70); + FsysCursors[2] := _wapi.gdk_cursor_new(16); + end + SetHandle(h); + FHitwidgetposition := 0; + end + static FLastPosition; + class function widgetmousehit(nfer,id); + begin + _wapi.GetCursorPos(p); + return executeMessageA(id,_const.WM_NCHITTEST,0,makelong(p[0],p[1])); + end + class function widgetmousemovecall(nfer,id); + begin + if hasMessageFromGtkMessageQueue(id,_const.WM_MOUSEMOVE) then return ; + _wapi.GetCursorPos(p); + if FLastPosition=p then return ; + FLastPosition := p; + // + //r := CallGtkWinProc(id,_const.WM_NCHITTEST,0,makelong(p[0],p[1])); + _wapi.ScreenToClient(id,p); + mp := makelong(p[0],p[1]); + //CallTslVclProc(id,_const.WM_NCHITTEST,0,makelong(p[0],p[1])); + AddMessageToGtkMessageQueue(id,_const.WM_MOUSEMOVE,0,mp,0); + end + function DefaultMessageDo(msg,w,l);virtual; + begin + //if (FHitwidgetposition <> 0) or (FHitwidgetposition <> 1) then return 0; + if (msg = _const.WM_SYSCOMMAND and w = 0xF012) or (msg = _const.WM_NCLBUTTONDOWN and w= _const.HTCAPTION) then //WM_NCLBUTTONDOWN + begin + Fsyscommand0x12 := true; + FMousemoveernotify.lock(); + h := handle; + x := _wapi.g_object_get_data(h,"gtk_layout_x"); + y := _wapi.g_object_get_data(h,"gtk_layout_y"); + cx := _wapi.g_object_get_data(h,"gtk_layout_width"); + cy := _wapi.g_object_get_data(h,"gtk_layout_height"); + xy := array(0,0); + _wapi.GetCursorPos(xy); + Fsyscommand0x12info:= array( + xy,(x,y,cx,cy) + ); + end + return 0; + end + function CallTslVclProc(msg,w,l,P);virtual; //õwinϢ + begin + CM_CURSORCHANGED := _const.CM_CURSORCHANGED; + if p then + begin + return AddMessageToGtkMessageQueue(FHandle,msg,w,l,p); + end else + begin + r := unit(tslvcl)._twinproc_(FHandle,msg,w,l); + if msg = CM_CURSORCHANGED then + begin + if l<>0 and w<>0 then + begin + return _wapi.gdk_window_set_cursor(w,l); + end + end else + if (msg = _const.WM_NCHITTEST) then + begin + global g_show_cursor_window; + wd := _Wapi.gtk_widget_get_window(FHandle); + g_show_cursor_window := wd; + FHitwidgetposition := r; + clearMessageFromGtkMessageQueue(FHandle,CM_CURSORCHANGED); + case r of + 10,11:begin + //_wapi.gdk_window_set_cursor(wd,FsysCursors[1]) ; + g_show_cursor_window := 0; + AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[1]); + end + 12,15:begin + //_wapi.gdk_window_set_cursor(wd,FsysCursors[2]) ; + g_show_cursor_window := 0; + AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[2]); + + end + 1:begin + //_wapi.gdk_window_set_cursor(wd,FsysCursors[0]) ; + AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,0,0); + end + else + begin + if _wapi.gtk_object_get_data(FHandle,"gtk_decorated") then return ; + rsz := _wapi.gtk_object_get_data(FHandle,"gtk_widget_resizeable"); + if rsz then + begin + unit(tslvcl).lowuperdword(l,lo,hi); + ht := _wapi.hittestwidget(FHandle,lo,hi); + FHitwidgetposition := ht; + if ht=10 or ht=11 then + begin + //return _wapi.gdk_window_set_cursor(wd,FsysCursors[1]) ; + g_show_cursor_window := 0; + AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[1]); + + end else + if ht=12 or ht=15 then + begin + g_show_cursor_window := 0; + //return _wapi.gdk_window_set_cursor(wd,FsysCursors[2]) ; + AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[2]); + end + end + //_wapi.gdk_window_set_cursor(wd,FsysCursors[0]) ; + return AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,0,0); + end + end ; + end else + if not r then + begin + DefaultMessageDo(msg,w,l); + end + return r; + end + end + function executeMessage(msg,w,l);virtual; //ִϢ + begin + return CallTslVclProc(msg,w,l); + return 0; + end + function GetScrollInfo(nBar,si);virtual; + begin + + end + function setScrollInfo(nBar,si,redraw);virtual; + begin + + end + function GetWidnowLong(idx);virtual; //ʽ + begin + case idx of + _const.GWL_EXSTYLE : + begin + return FExdwstyle; + end + _const.GWL_STYLE : + begin + return Fdwstyle; + end + end ; + end + function SetWidnowLong(idx,v);virtual; //ʽ + begin + stl := new TSTYLESTRUCT(nil); + stl.styleold := 0; + case idx of + _const.GWL_EXSTYLE : + begin + if FExdwstyle<>v then + begin + FExdwstyle := V; + stl.stylenew := dwExStyle; + CallTslVclProc(_const.WM_STYLECHANGED,_const.GWL_EXSTYLE,stl._getptr_()); + end + end + _const.GWL_STYLE : + begin + if Fdwstyle <> V then + begin + Fdwstyle := V; + stl.stylenew := v; + CallTslVclProc(_const.WM_STYLECHANGED,_const.GWL_STYLE,stl._getptr_()); + end + end + end ; + end + function widgetsizechanged(h,w);virtual; //Сı + begin + CallTslVclProc(_const.WM_SIZE,0,makelong(w,h)); + end + fimhandle; + function gdk_window_get_state(w:pointer):integegr;cdecl;external 'libgtk-3.so'; + function GtkEventDispatchA(a,b,c,d);//gtkϢַ + begin + global g_gtk_scroll_lock; + if g_gtk_scroll_lock then + begin + return true; + end + if FHitwidgetposition in array(110,111,112,115) then + begin + mn := GetGtkEventNameOrId(b); + if mn="event" then + begin + e := new _GdkEventAny(c); + if 3=e.ttype then + begin + ogps := Fsyscommand0x12info[0]; + xy := Fsyscommand0x12info[1]; + cxy := array(0,0); + _wapi.GetCursorPos(cxy); + dx := cxy[0]-ogps[0]; + dy := cxy[1]-ogps[1]; + case FHitwidgetposition of + 110: + begin + if dx<>0 then _wapi.SetWindowPos(a.handle,0,xy[0]+dx,xy[1],xy[2]-dx,xy[3],0); + end + 111: + begin + if dx<>0 then _wapi.SetWindowPos(a.handle,0,xy[0],xy[1],xy[2]+dx,xy[3],0); + end + 112: + begin + if dy<>0 then _wapi.SetWindowPos(a.handle,0,xy[0],xy[1]+dy,xy[2],xy[3]-dy,0); + end + 115: + begin + if dy<>0 then _wapi.SetWindowPos(a.handle,0,xy[0],xy[1],xy[2],xy[3]+dy,0); + end + + + end; + return 1; + end else + if 7 = e.ttype then + begin + FHitwidgetposition := 0; + Fsyscommand0x12info := nil; + FMousemoveernotify.unlock(); + //return ; + end + end + end else + if Fsyscommand0x12 and ifarray(Fsyscommand0x12info) then + begin + mn := GetGtkEventNameOrId(b); + if mn="event" then + begin + e := new _GdkEventAny(c); + if 3=e.ttype then + begin + ogps := Fsyscommand0x12info[0]; + xy := Fsyscommand0x12info[1]; + cxy := array(0,0); + _wapi.GetCursorPos(cxy); + dx := cxy[0]-ogps[0]; + dy := cxy[1]-ogps[1]; + if dx>3 or dx<-3 or dy<-3 or dy>3 then + begin + _wapi.SetWindowPos(a.handle,0,xy[0]+dx,xy[1]+dy,-1,-1,0); + end + return 1; + end else + if 7 = e.ttype then + begin + Fsyscommand0x12 := false; + Fsyscommand0x12info := nil; + FMousemoveernotify.unlock(); + //return ; + end + end + end + return GtkEventDispatchb(a,b,c,d); + end + function GtkEventDispatchb(a,b,c,d); //gtkϢַ + begin + mn := GetGtkEventNameOrId(b); // _send_ + global g_current_get_focus_widget,g_current_loss_focus_widget,g_gtk_buttontable,G_GTK_WINDOW_ACTIVATE, g_gtk_keytable; + if not ifarray(g_gtk_buttontable) then g_gtk_buttontable := array(0,0); + if not ifarray(g_gtk_keytable) then g_gtk_keytable := array(0x10:0,0x11:0,0x12:0); + if mn = "event" then + begin + e := new _GdkEventAny(c); + case e.ttype of + GDK_WINDOW_STATE: + begin + {st := gdk_window_get_state(e.window);//.& 0xffff; + if (st .& 32) = 32 then + begin + echo "\r\n above"; + end else + if (st .& 64) = 64 then + begin + echo "\r\n blowe"; + end } + end + GDK_BUTTON_PRESS: + begin + + e := new _GdkEventButton(c); + psi := makelong(integer(e.x),integer(e.y)); + //r := array(); + //_wapi.GetTopWidgetList(a.handle,e.x_root,e.y_root,r); + //rl := length(r)-1; + //if r[rl,0]<>a.handle then return false;; + wp := 0; + if ifarray(g_gtk_keytable) then + begin + if g_gtk_keytable[0x10] then wp .|= 0x0004; + if g_gtk_keytable[0x11] then wp .|= 0x0008; + end + case e.button of + 1: + begin + + g_gtk_buttontable[0] := _const.MK_LButton; + if FHitwidgetposition in array(10,11,12,15) then + begin + FHitwidgetposition += 100; + FMousemoveernotify.lock(); + h := handle; + xy := array(0,0); + _wapi.GetCursorPos(xy); + Fsyscommand0x12info:= array( + xy, + (_wapi.g_object_get_data(h,"gtk_layout_x"), + _wapi.g_object_get_data(h,"gtk_layout_y"), + _wapi.g_object_get_data(h,"gtk_layout_width"), + _wapi.g_object_get_data(h,"gtk_layout_height")) + ); + CallTslVclProc(_const.WM_NCLBUTTONDOWN ,wp,psi); + + end else + begin + CallTslVclProc(_const.WM_LBUTTONDOWN ,wp,psi); + end + end + 3: + begin + g_gtk_buttontable[1] := _const.MK_RButton; + + CallTslVclProc(_const.WM_RBUTTONDOWN ,wp,psi); + end + end ; + + hwd := handle; + hwd := _wapi.gtk_widget_is_toplevel(hwd)?hwd:_wapi.gtk_widget_get_toplevel(hwd); + if G_GTK_WINDOW_ACTIVATE<>hwd then + begin + if G_GTK_WINDOW_ACTIVATE then + AddMessageToGtkMessageQueue(G_GTK_WINDOW_ACTIVATE,0x6,0,0,0); + G_GTK_WINDOW_ACTIVATE := hwd; + AddMessageToGtkMessageQueue(hwd,0x6,1,0,0); + end + return CanignoreBtnpress(); + end + GDK_BUTTON_RELEASE: + begin + //t := 1+"1234"; + e := new _GdkEventButton(c); + + psi := makelong(integer(e.x),integer(e.y)); + wp := 0; + if ifarray(g_gtk_keytable) then + begin + if g_gtk_keytable[0x10] then wp .|= 0x0004; + if g_gtk_keytable[0x11] then wp .|= 0x0008; + end + case e.button of + 1: + begin + g_gtk_buttontable[0] := 0; + CallTslVclProc(_const.WM_LBUTTONUP ,wp,psi); + end + 3:begin + g_gtk_buttontable[1] := 0; + CallTslVclProc(_const.WM_RBUTTONUP ,wp,psi); + //if not hasMessageFromGtkMessageQueue(a.handle,_const.LM_CONTEXTMENU ) then + CallTslVclProc(_const.LM_CONTEXTMENU ,a.handle,makelong(integer(e.x_root),integer(e.y_root)),true); + end + end ; + return CanignoreBtnpress(); + end + GDK_2BUTTON_PRESS: + begin + ne := new _GdkEventButton(c); + psi := makelong(integer(ne.x),integer(ne.y)); + wp := 0; + if ifarray(g_gtk_keytable) then + begin + if g_gtk_keytable[0x10] then wp .|= 0x0004; + if g_gtk_keytable[0x11] then wp .|= 0x0008; + end + case ne.button of + 1: + begin + CallTslVclProc(_const.WM_LBUTTONDBLCLK ,wp,psi); + + end + 3:begin + CallTslVclProc(_const.WM_RBUTTONDBLCLK ,wp,psi); + end + end ; + return CanignoreBtnpress(); + end + 32: + begin + //echo tostn(new _GdkEventWindowState(c)._getdata_()); + end + 8,9: //key + begin + kud := e.ttype; + ///////////////////////////////////Ƽ + + + e := new _GdkEventKey(c); + kv := e.keyval; + acskey := array( + 65505: 0x10, //shift + 65506: 0x10, + 65507: 0x11, //control + 65508: 0x11, + 65513: 0x12, //alt + 65514: 0x12 + ); + if acskey[kv] then + begin + if 8=kud then + begin + g_gtk_keytable[acskey[kv]] := _shl( 1,15); + end else + begin + g_gtk_keytable[acskey[kv]] := 0; + end + end + ///////////////˵ + if kv = 65513 or kv = 65514 then + begin + if kud=8 then + begin + CallTslVclProc(_const.WM_SYSKEYDOWN ,0x12,0); + end + else + begin + CallTslVclProc(_const.WM_SYSKEYUP ,0x12,0); + end + return true; + end + notctrlpress := not(kud=8 and (g_gtk_keytable[0x11] or g_gtk_keytable[0x12]) ); +// kn := array( +// 65288 : _const.VK_BACK, +// 65289 : _const.VK_TAB, +// 65293 : 13 , //enter +// 65307 : _const.VK_ESCAPE, +// 65505 : _const.VK_SHIFT, +// 65506 : _const.VK_SHIFT, +// 65507 : _const.VK_CONTROL, +// 65508 : _const.VK_CONTROL, +// 65509 : _const.VK_CAPITAL, +// 65513 : _const.VK_MENU, +// 65514 : _const.VK_MENU, +// 65535 : _const.VK_DELETE, +// 65379 : _const.VK_INSERT, +// 65360 : _const.VK_HOME, +// 65361 : _const.VK_LEFT, +// 65362 : _const.VK_UP, +// 65363 : _const.VK_RIGHT, +// 65364 : _const.VK_DOWN, +// 65365 : 33, //pageup +// 65366 : 34, //pagedown +// 65367 : _const.VK_END +// //VK_SPACE +// ); + //r := CallTslVclProc(_const.WM_KEYDOWN ,kv,0); + //r := CallTslVclProc(_const.WM_CHAR ,kv,0); + + //echo "\r\n===handle:",a.handle; + ah := a.handle; + if not _wapi.gtk_widget_is_toplevel(ah) then return true ; + fcsctl := _wapi.gtk_window_get_focus(ah); + if not fcsctl then return true; + fcsctl := TGtkObjects[inttostr(fcsctl)] ; + if not fcsctl then return true; + + if (kud = 8) and (kv<>65505 or kv<>65506) then + begin + + if getfimobj().presskey(c) then + begin + //echo "\r\n inputx:" , getfimobj().FCommit; + //return true; + end else + begin + //echo "\r\n not char input"; + notachar := true; + //echo "\r\nkkkkvvv:",kv; + end + end + //echo "\r\nkey fillter ed:",kud,"====",kv; + //return 1; + case kv of + //65513,65514,65506 + 65288: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_BACK,0); + if notctrlpress then r := fcsctl.CallTslVclProc(_const.WM_CHAR ,_const.VK_BACK,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_BACK,0); + end + end + 65289,{---} 65056: //VK_TAB char + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_TAB,0); + if not(g_gtk_keytable[0x11]) then r := fcsctl.CallTslVclProc(_const.WM_CHAR ,_const.VK_TAB,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_TAB,0); + + end + end + 65293: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,13,0); + if notctrlpress then + r := fcsctl.CallTslVclProc(_const.WM_CHAR ,13,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,13,0); + end + end + 65307: // _const.VK_ESCAPE, + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_ESCAPE,0); + if notctrlpress then + r := fcsctl.CallTslVclProc(_const.WM_CHAR ,_const.VK_ESCAPE,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_ESCAPE,0); + end + + end + 65360: //65360 : _const.VK_HOME, + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_HOME,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_HOME,0); + end + end + 65361: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_LEFT,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_LEFT,0); + end + end + 65362: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_UP,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_UP,0); + end + end + 65363: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_RIGHT,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_RIGHT,0); + end + end + 65364: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_DOWN,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_DOWN,0); + end + end + + 65365: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,33,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,33,0); + end + end + 65366: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,34,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,34,0); + end + end + 65367: + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_END,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_END,0); + end + end + 65379: // _const.VK_INSERT, + begin + + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_INSERT,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_INSERT,0); + end + end + 65505,65506: //_const.VK_SHIFT, + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_SHIFT,0); + + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_SHIFT,0); + end + end + 65507,65508: //, //_const.VK_CONTROL + begin + + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_CONTROL,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_CONTROL,0); + end + end + 65509: // _const.VK_CAPITAL, + begin + + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_CAPITAL,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_CAPITAL,0); + end + end + 65513,65514: //WM_SYSKEYUP ,WM_SYSKEYDOWN + begin + + //_const.VK_MENU, + + end + 65535: //_const.VK_DELETE, + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,_const.VK_DELETE,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,_const.VK_DELETE,0); + end + end + + 65470 to ( 65470+24): + begin + if kud=8 then + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,kv-65470+0x70,0); + end else + begin + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,kv-65470+0x70,0); + end + end + else + begin + keymapb := array( + 96:192, + 45:189, + 61:187, + 91:219, + 93:221, + 92:220, + 59:186, + 39:222, + 44:188, + 46:190, + 47:191, + 40:57, + 33:49, + 64:50, + 35:51, + 36:52, + 37:53, + 94:54, + 38:55, + 42:56, + 41:48, + 126:192 + ); + if {notachar and} kud=8 then //ȥnotkey + begin + if kv>=97 and kv<=122 then kv := kv-32; + else + begin + kv2 := keymapb[kv]; + if kv2 then kv := kv2; + end + r := fcsctl.CallTslVclProc(_const.WM_KEYDOWN ,{_xor(32,kv)}kv,0); + //if notctrlpress then r := CallTslVclProc(_const.WM_CHAR , kv,0); + end else + if kud=9 then + begin + if kv>=97 and kv<=122 then kv := kv-32; + else + begin + kv2 := keymapb[kv]; + if kv2 then kv := kv2; + end + r := fcsctl.CallTslVclProc(_const.WM_KEYUP ,{_xor(32,kv)}kv,0); + end + end + end ; + return true; + + end + 10: //mouse in + begin + //e := new _GdkEventCrossing(c); + //echo tostn(e._getdata_()); + //echo "===enter\r\n"; + FMousemoveernotify.push(a.handle); + //_wapi.GetCursorPos(ps); + //e := new _GdkEventMotion(c); + //echo "\r\n enter:",a.handle,tostn(ps),tostn(e._getdata_()); + end + + 11: //mouse out + begin + FMousemoveernotify.pop(a.handle); + //echo "\r\nleave:",a.handle; + end + 3: + begin +// echo "\r\n move",datetimetostr(now()),"====",a.handle,"****",FMousemoveernotify.feach(); +// if not(FMousemoveernotify.inner(a.handle)) then +// begin +// echo "====move====="; +// e := new _GdkEventMotion(c); +// CallTslVclProc(_const.WM_MOUSEMOVE ,0,makelong(integer(e.x),integer(e.y))); +// end + + end + 12: //focus + begin + h := a.handle; + //getfimobj().setclientwindow(e.window); + getfimobj().setclientwindow(e.window); + getfimobj().setfocusctl(self); + if (new _GdkEventFocus(c).iin)=1 then + begin + g_current_get_focus_widget := h; + //echo "\r\nsetfocus==>",h; + ch := _wapi.g_object_get_data(h,"gtk_client_parent"); + if ch then + begin + //AddMessageToGtkMessageQueue(ch,_const.WM_SETFOCUS,0,0,0); + CallGtkWinProc(ch,_const.WM_SETFOCUS,0,0); + end else + begin + CallTslVclProc(_const.WM_SETFOCUS,0,0,0); + end + //WM_SETFOCUS + getfimobj().focusin(); + + end else + begin + g_current_loss_focus_widget := h; + g_current_get_focus_widget := 0; + ch := _wapi.g_object_get_data(a.handle,"gtk_client_parent"); + //killfocus ޸Ϊִ + if ch then + begin + //AddMessageToGtkMessageQueue(ch,_const.WM_KILLFOCUS,0,0,0); + CallGtkWinProc(ch,_const.WM_KILLFOCUS,0,0); + end else + begin + //echo "\r\nkill focus:",h; + CallTslVclProc(_const.WM_KILLFOCUS,0,0,0); + end + getfimobj().focusout(); + end + end + end ; + end + + if mn="activate" then + begin + //echo "\r\nacive","==",b,"==",c,"d"; + end + // + r := GtkEventDispatch(a,mn,c,d); + return r; + end + function GtkEventDispatch(a,mn,c,d);virtual; //ƴgtkϢ + begin + //Ϣַ + global g_current_get_focus_widget; + case mn of + "destroy" : + begin + FMousemoveernotify.unlock(); + Fsyscommand0x12 := 0; + Fsyscommand0x12info := nil; + FHitwidgetposition := 0; + r := CallTslVclProc(_const.WM_NCDESTROY ,0,0); + //echo "\r\ncall destroy===",r,">>>",a.handle; + end + { + "map": + begin + end + "wm-user": + begin + r := CallTslVclProc(_const.WM_USER ,c,d); + end + "button-press-event": + begin + //return true; + end + "button-release-event": + begin + + end + "motion-notify-event": + begin + //e := new _GdkEventMotion(c); + //CallTslVclProc(_const.WM_MOUSEMOVE ,0,makelong(integer(e.x),integer(e.y))); + //return true; + end + "set-focus-child": + begin + //echo "\r\nsignal name id:",GetGtkEventNameOrId("set-focus-child"); + //echo "\r\nset focus child:",a.handle,"*****",c,"============",d; + end + "key-press-event": + begin + //echo "\r\n==key :=",1,"***" , a.handle,"====",_wapi.gtk_widget_is_toplevel(a.handle),"==========",datetimetostr(now()); + end + } + end ; + return r; + end + function GtkBaseEventName();virtual; //󶨵Ϣ + begin + return array("destroy","map","button-press-event","motion-notify-event","button-release-event","key-press-event","key-release-event","event"); //,"set-focus-child" + end + function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);virtual; //촰 + begin + CallTslVclProc(_const.WM_NCCREATE,0,lpParam); + ///////////////////// + stl := new TSTYLESTRUCT(nil); + stl.styleold := 0; + stl.stylenew := dwStyle; + CallTslVclProc(_const.WM_STYLECHANGED,_const.GWL_STYLE,stl._getptr_()); + stl.styleold := 0; + stl.stylenew := dwExStyle; + CallTslVclProc(_const.WM_STYLECHANGED,_const.GWL_EXSTYLE,stl._getptr_()); + /////////////////////////////////////////////////////////////////////////////////// + f := thisfunction(GtkEventDispatchA); + for i,v in GtkBaseEventName() do + begin + Connect(v,f); + end + ////////////////////////////////////////////////////////////// + Fdwstyle := dwStyle; + FExdwstyle := dwExStyle; + if (_const.WS_DISABLED .& dwStyle)=_const.WS_DISABLED then //enabled + begin + _wapi.EnableWindow(FHandle,false); + end + widgetsizechanged(nheight,nwidth); + _wapi.g_object_set_data(FHandle,"gtk_widget_resizeable",(_const.WS_SIZEBOX .& dwStyle)=_const.WS_SIZEBOX); + return FHandle; + end + function InitWidgetSize(h,x,y,nwidth,nheight); //ôλϢ + begin + _wapi.g_object_set_data(h,"gtk_layout_x",x); + _wapi.g_object_set_data(h,"gtk_layout_y",y); + _wapi.g_object_set_data(h,"gtk_layout_width",nwidth); + _wapi.g_object_set_data(h,"gtk_layout_height",nheight); + + end + function InitContainerList(h); //radiobtn + begin + return ; + rlist := _wapi.g_slist_alloc(); + gl := new _gslist(rlist); + rbtn := _wapi.gtk_radio_button_new(0); + gl.data := rbtn; + //_wapi.g_object_set_data(h,"gtk_layout_radiolist",rlist); + end + function DisconnectAll(); //ϿϢ + begin + if FHandle=0 then return 0; + for i,lnid in FConnectNameIds do + begin + g_signal_handler_disconnect(FHandle,lnid); + end + FConnectNameIds := array(); + FConnectHandlers := array(); + end + function getsingalmap();virtual; + begin + return array( + "wm-user":'tsl_gtk_wmuser_event', //û + "destroy":"tsl_gtk_destroy_event", // + "activate":"tsl_gtk_activate_event", // + "clicked":"tsl_gtk_clicked_event", // + "value-changed":"tsl_gtk_adj_value_changed_event", //ֵı + "delete-event":"tsl_gtk_delete_event", //ɾ + //"day-selected":"tsl_gtk_day_select_event", //ѡ + "changed" :"tsl_gtk_changed_event", //ı + "preedit-changed":"tsl_gtk_preedit_changed_event" , + ); + end + function Connect(n,f); //Ϣ + begin + //ɾconnect + //connect + //connect id + if FHandle=0 then return 0; + if not ifstring(n) then return 0; + ln := FormularSingalName(lowercase(n)); + lnid := FConnectNameIds[ln]; + if lnid then + begin + //echo "\r\n========================remove connect:",n; + reindex(FConnectNameIds,array(ln:nil)); + g_signal_handler_disconnect(FHandle,lnid); + end + //echo "\r\nconnect ===========================",FHandle,"=====",n; + eid := GetGtkEventNameOrId(ln); + fn := (getsingalmap())[ln]; + if not(fn and ifstring(fn)) then fn := "tsl_gtk_normal_event_cb"; + lnid := g_signal_connect_data(FHandle, ln, gettslvcleventhandler(fn), eid,nil,0); + FConnectNameIds[ln] := lnid; + FConnectHandlers[inttostr(eid)] := f; + return lnid; + end + function DefaultDestroyHandler(); + begin + destroy(); + return true; + end + class function SetWindowLongPtrA(h,idx,v); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.SetWidnowLong(idx,v) ; + end + end + class function widgetsizechangeda(h,aheight,awidth) ; + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.widgetsizechanged(aheight,awidth) ; + end + end + class function SetScrollInfoa(h, nBar,lpsi,redraw); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.SetScrollInfo(nBar,lpsi,redraw) ; + end + + end + class function GetScrollInfoa(h, nBar,lpsi); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.GetScrollInfo(nBar,lpsi) ; + end + + end + class function executeMessageA(h,msg,w,l); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.executeMessage(msg,w,l) ; + end + end + class function GetWindowLongPtrA(H,idx); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.GetWidnowLong(idx,v) ; + end + end + class function CallGtkWinProc(h,msg,w,l); + begin + if TGtkObjects then + begin + o := TGtkObjects[inttostr(h)]; + if o then return o.CallTslVclProc(msg,w,l) ; + end + end + + class function DispatchGtkEventCall(pms); //ص + begin + if not pms then return 0; + o := TGtkObjects[inttostr(pms[0])]; + if o then + return o.CallGtkEvent(pms); + return 0; + end + function CallGtkEvent(pms); // + begin + xxid := pms[1]; + c := FConnectHandlers[inttostr(xxid)]; + if datatype(c)=7 then + begin + pms2 := pms; + pms2[0] := self; + r := callinarray(c,pms2); + if needdestroy() then + begin + if r = 0 and FDestroysignalId=xxid then + begin + DefaultDestroyHandler(pms); + //callinarray(thisfunction(DefaultDestroyHandler),pms); + end + end + return r; + end else + begin + if FDestroysignalId=xxid and needdestroy() then + begin + DefaultDestroyHandler(pms); + //callinarray(thisfunction(DefaultDestroyHandler),pms); + end + end + return true; + end + function destroy();virtual; // + begin + if FHandle<>0 then + begin + reindex(TGtkObjects,array(inttostr(FHandle):nil)); + //_wapi.g_object_unref(FHandle); + end + FRegisterWMUSER := 0; + //tsl_gtk_remove_widget_thread(FHandle); + FHandle := 0; + FConnectHandlers := array(); + FConnectNameIds := array(); + FValues := array(); + end + function SetValue(n,v); + begin + FValues[n] := v; + end + function GetValue(n); + begin + return FValues[n]; + end + property handle read FHandle write SetHandle; + static _wapi; + static _const; + private + FHandle; + class function gtk_widget_get_type():pointer;cdecl;external 'libgtk-3.so'; + class function gettslvcleventhandler(n:string):pointer;cdecl;external "./plugin/libTSLUIL.so" name "gettslvcleventhandler"; + class procedure g_signal_handler_disconnect(instance:pointer;id:integer);cdecl;external 'libgtk-3.so'; + class function g_signal_connect_data(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):pointer;cdecl;external 'libgtk-3.so'; + class function g_signal_new(signal_name:string; + itype:pointer; + signal_flags:integer; + class_offset:integer; + accumulator:pointer; + accu_data:pointer; + c_marshaller:pointer; + return_type:pointer; + n_params:integer; + p1:pointer; + p2:pointer):integer;cdecl;external 'libgtk-3.so'; + FConnectNameIds; + FConnectHandlers; + FValues; + FDestroysignalId; + static TGtkObjects; + Static FinitNewSignaled; + function SetHandle(h); + begin + if FHandle then return 0; + initNewSingal(); + FConnectNameIds := array(); + FConnectHandlers := array(); + FValues := array(); + FHandle := 0; + if h then + begin + FHandle := h; + _wapi.g_object_ref(h); + if not ifarray(TGtkObjects) then TGtkObjects := array(); + TGtkObjects[inttostr(h)] := self(true); + FDestroysignalId := GetGtkEventNameOrId("destroy"); + if needdestroy() then + Connect("destroy",thisfunction(DefaultDestroyHandler)); + return true; + end + end + class function initNewSingal(); + begin + return ; + //wm-user + if FinitNewSignaled then return ; + FinitNewSignaled := true; + for i,v in array(gtk_widget_get_type()) do + begin + g_signal_new("wm-user", + v, + 2, + 0, + nil, + nil, + 0, + 4, + 2, + 17*4,68); + end + + end + function FormularSingalName(n); + begin + r := ""; + for i := 1 to length(n) do + begin + vi := n[i]; + if vi="_" then r+="-"; + else r+=vi; + end + return r; + end + function needdestroy();virtual; + begin + return true; + end + static FMousemoveernotify; + class function getfimobj(); + begin + if not FImobj then FImobj := new tgtk_im_object(nil); + return FImobj; + end + static FImobj; +end + +type tscrollobject = class + fbar; + fadj; + fpgcount; + fsi; + function create(bar,adj,si); + begin + fbar :=bar; + fadj := adj; + fsi := si; + end +end +type tgtk_im_object = class(tgtk_ctl_object) + function Create(h);override; + begin + h := _wapi.gtk_im_multicontext_new(); + inherited; + f := thisfunction(GtkEventDispatchA); + //_Wapi.gtk_widget_set_events(h,16777214); + for i,v in GtkBaseEventName() do + begin + //echo "\r\n connect",v,"***", + Connect(v,f); + end + end + function getsingalmap();override; + begin + return array( + "preedit-start":"dodeleteevents" , + "preedit-changed":"dodeleteevents" , + "preedit-surrounding":"dodeleteevents" , + "preedit-end":"dodeleteevents" , + "commit":"tsl_gtk_normal_event_cb" + ); + end + function GtkEventDispatch(a,mn,c,d);override; //ƴgtkϢ + begin + case mn of + "commit": + begin + FCommit := ReadStringFromPtr(c); + //echo FCommit,FCtl,"**\r\n"; + if FCtl then + begin + s := utf8toansi(FCommit); + for i:= 1 to length(s) do + begin + //echo "***\r\n",ord(s[i]),">>",FCtl._const.WM_CHAR,"<<<"; + FCtl.CallTslVclProc(_const.WM_CHAR,ord(s[i]),0); + end + end + //echo "cmt=====",tostn(FCommit); + end + end; + end + function GtkBaseEventName();override; //󶨵Ϣ + begin + //"commit","delete-surrounding", + return array("commit");//,"preedit-changed","preedit-end","preedit-start","retrieve-surrounding"); + end + function focusin();//focus in + begin + h := handle; + _wapi.gtk_im_context_focus_in(h); + end + function set_location(); + begin + h := handle; + _wapi.gtk_im_context_set_cursor_location(h,array(50,100,300,300)); + end + function presskey(c); //focus out + begin + h := handle; + //ps := array(0,0,100,100); + //_Wapi.GetCursorPos(ps); + //_wapi.gtk_im_context_set_cursor_location(h,ps); + return _wapi.gtk_im_context_filter_keypress(h,c); + end + function focusout(); + begin + h := handle; + _wapi.gtk_im_context_focus_out(h); + end + function get_preedit_string(); + begin + return; + h := handle; + pc := array(0,0,0,0,0); + str := ""; + setlength(str,100); + attr := 0; + _wapi.gtk_im_context_get_preedit_string(h,str,attr,pc); + end + function setfocusctl(ctl); + begin + if ctl <>FCtl then + begin + h := handle; + _wapi.gtk_im_context_reset(h); + FCtl := ctl; + end + end + function setclientwindow(w); + begin + if w and (w<>FWindow) then + begin + h := handle; + _wapi.gtk_im_context_set_client_window(h,w); + end + end + FCtlHandle; + FCommit; + function needdestroy();override; + begin + return false; + end + private + FWindow; + FCtl; +end +type tgtk_ctl_object_scroll = class(tgtk_ctl_object) + function Create(h);override; + begin + inherited; + //Connect("event",thisfunction(scrollevent)); + end + function GtkBaseEventName();override; + begin + return array("value-changed"); + end + function needdestroy();override; + begin + return false; + end + +end +type tgtk_ctl_object_scroll_Bar = class(tgtk_ctl_object) + function Create(h);override; + begin + inherited; + Connect("event",thisfunction(scrollevent)); + + end + function scrollevent(a,b,c,d); + begin + global g_gtk_scroll_lock; + if "event"=GetGtkEventNameOrId(b) then + begin + e := new _GdkEventAny(c); + case e.ttype of + GDK_ENTER_NOTIFY: + begin + // g_gtk_scroll_lock := true; + end + GDK_LEAVE_NOTIFY: + begin + //g_gtk_scroll_lock := false; + end + + end + end + end + +end +type tgtk_ctl_scroll_window = class(tgtk_ctl_object) + function Create(h);override; + begin + inherited; + fbarshow := 0; + end + function scrollwindowdraw(a,b,c,d); + begin + + hd := a.handle; + r := zeros(4); + + _wapi.gtk_widget_get_allocation(hd,r); + cr := _wapi.gdk_cairo_create(_wapi.gtk_widget_get_window(hd)); + hwd := handle; + _wapi.g_object_set_data(hwd,"paint_dc",cr); + _wapi.g_object_set_data(hwd,"paint_height",r[3]); + _wapi.g_object_set_data(hwd,"paint_width",r[2]); + //mtic; + CallTslVclProc(_const.WM_PAINT,0,0); // + + _wapi.cairo_set_dash(cr,array(4.0,0.0),2,0); + if not(self(true) is class(tgtk_ctl_window_PoPup)) then + begin + if (FExdwstyle .& _const.WS_EX_DLGMODALFRAME)= _const.WS_EX_DLGMODALFRAME then + begin + _wapi.cairo_set_source_rgb(cr, 225/255, 225/255, 225/255); + _wapi.cairo_set_line_width (cr, 2); + _wapi.cairo_rectangle(cr,0,0,r[2]-1,r[3]-1); + _wapi.cairo_stroke(cr); + end + if (Fdwstyle .& _const.WS_BORDER)= _const.WS_BORDER then + begin + _wapi.cairo_set_source_rgb(cr, 100/255, 100/255, 100/255); + _wapi.cairo_set_line_width(cr, 0.5); + _wapi.cairo_rectangle(cr,1,1,r[2]-1,r[3]-1); + _wapi.cairo_stroke(cr); + end + CallTslVclProc(_const.WM_NCPAINT,0,cr); // + end + _wapi.cairo_destroy(cr); + _wapi.gtk_object_set_data(cr); + //echo "\r\ntime:",datetimetostr(now()),"===timeuses:",mtoc,"===",hd; + end; + function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override; + begin + //echo "\r\nctl:",tostn(params),tostn(__stack_frame),datetimetostr(now()); + d := new tslcstructureobj(MemoryAlignmentCalculate( array(("lpcreateparams","intptr",0))),lpParam); + isp := unit(tslvcl).controlisCustomPaint(d._getvalue_("lpcreateparams")); + h := self.handle; + {if (_const.WS_BORDER .& dwStyle)=_const.WS_BORDER then + begin + _wapi.gtk_container_set_border_width(h,1); + end } + _wapi.gtk_widget_set_can_focus(h,true); + if isp and FClientWideget then //Ի + begin + FClientObject := new tgtk_ctl_object(FClientWideget); + _wapi.g_object_set_data(h,"gtk_clientwideget",FClientWideget); + FClientObject.Connect("draw",thisfunction(scrollwindowdraw)); + _wapi.gtk_widget_set_app_paintable(FClientWideget, TRUE); // + end + //ع + _wapi.gtk_widget_hide(FHscrollbar); + _wapi.gtk_widget_hide(Fvscrollbar); + _wapi.g_object_set_data(h,"gtk_window_vscroll_bar",Fvscrollbar); + _wapi.g_object_set_data(h,"gtk_window_hscroll_bar",Fhscrollbar); + FScroller := array(); + fvsi := new TScrollinfo(); + fhsi := new TScrollinfo(); + v1 := new tscrollobject(Fvscrollbar,Fvadjustment,fvsi); + v2 := new tscrollobject(FHscrollbar,Fhadjustment,fhsi); + FScroller[_const.SB_HORZ] := v2; + FScroller[_const.SB_VERT] := v1; + + return inherited; + end + function widgetsizechanged(h_,w_);override; //Сı + begin + h := h_; + w := w_; + hwd := self.handle; + mb := _wapi.g_object_get_data(hwd,"menubar"); + if mb and _wapi.gtk_widget_is_visible(mb) then + begin + rec := zeros(4); + _wapi.gtk_widget_get_allocation(mb,rec); + if rec[3]>1 then + begin + h-= rec[3];//max(rec[3],25); + end else + begin + gist := _wapi.gtk_container_get_children(mb); // + if gist then + begin + h-=25; + end + end + end + scrlsize := 12; + if (fbarshow .& 1)=1 then //v + begin + _wapi.gtk_widget_set_size_request(FHscrollbar,w-scrlsize,scrlsize); + end else _wapi.gtk_widget_set_size_request(FHscrollbar,w,scrlsize); + if (fbarshow .& 2)=2 then //h + begin + _wapi.gtk_widget_set_size_request(Fvscrollbar,scrlsize,h-scrlsize); + end else _wapi.gtk_widget_set_size_request(Fvscrollbar,scrlsize,h); + _wapi.gtk_layout_move( FLayouter,FHscrollbar,0,h-scrlsize); + _wapi.gtk_layout_move( FLayouter,Fvscrollbar,w-scrlsize,0); + if FClientWideget then + begin + if (fbarshow .& 2)=2 {_wapi.gtk_widget_is_visible(FHscrollbar)} then + begin + h-=11; + end + if (fbarshow .& 1)=1 {_wapi.gtk_widget_is_visible(Fvscrollbar)} then + begin + w-=11; + end + _wapi.gtk_widget_set_size_request(FClientWideget,w,h); + //inherited widgetsizechanged(h,w); + end //else inherited widgetsizechanged(h,w); + inherited widgetsizechanged(h,w); + end + function GetScrollInfo(nBar,si);override;//ùϢ + begin + osi := fvsi; + gsi := new TScrollinfo(si); + adj := Fvadjustment; + if nbar = _const.SB_HORZ then + begin + osi := fhsi; + adj := Fhadjustment; + end + msk := gsi.fmask; + if msk .& _const.SIF_RANGE then + begin + gsi.nmin := osi.nmin; + gsi.nmax := osi.nmax; + end + if msk .& _const.SIF_POS then + begin + gsi.npos := osi.npos; + end + if msk .& _const.SIF_PAGE then + begin + gsi.npage := osi.npage; + end + if msk .& _const.SIF_TRACKPOS then + begin + gsi.ntrackpos := osi.ntrackpos; + end + end + function SetScrollInfo(nBar,si,redraw);override; //ùϢ + begin + //echo "\r\n",datetimetostr(now()),"====showbar===",fbarshow; + bkshowbar := fbarshow; + osi := fvsi; + gsi := new TScrollinfo(si); + adj := Fvadjustment; + bar := Fvscrollbar; + cbs := 1; + if nbar = _const.SB_HORZ then + begin + osi := fhsi; + adj := Fhadjustment; + bar := FHscrollbar; + cbs := 2; + end else + begin + //echo "\r\n",datetimetostr(now()),tostn(gsi._getdata_()); + end + msk := gsi.fmask; + if msk .& _const.SIF_RANGE then + begin + if gsi.nmin <> osi.nmin then + begin + //osi.nmin := gsi.nmin; + _wapi.gtk_adjustment_set_lower(adj,gsi.nmin); + osi.nmin := _wapi.gtk_adjustment_get_lower(adj); // + end + if gsi.nmax <> osi.nmax then + begin + //osi.nmax := gsi.nmax; + _wapi.gtk_adjustment_set_upper(adj,gsi.nmax); + osi.nmax := _wapi.gtk_adjustment_get_upper(adj); // + rgchanged := true; + end + end + if msk .& _const.SIF_POS then + begin + gp := gsi.npos; + if gp <> osi.npos then + begin + + //if gp>gsi.nmax then return ; + //if gp>(gsi.nmax-gsi.npage+1) then return ; //˴ + gmx := osi.nmax; + gnx := osi.nmin; + if (gmx-osi.npage)<0 or gp<(gmx-osi.npage+3) then + begin + gp := min(gmx,max(gp,gnx)); + //osi.npos := gp; + _wapi.gtk_adjustment_set_value(adj,gp); + osi.npos := _wapi.gtk_adjustment_get_value(adj); + end else + if gp>=(gmx-osi.npage+3) then //ֵĴ + begin + gp := min(gmx,max(gp,gnx)); + _wapi.gtk_adjustment_set_value(adj,gp); + osi.npos := _wapi.gtk_adjustment_get_value(adj); + end + end + end + if msk .& _const.SIF_PAGE then + begin + if gsi.npage <> osi.npage then + begin + osi.npage := gsi.npage; + _wapi.gtk_adjustment_set_page_size(adj, gsi.npage-1); //abs(gsi.npage-gsi.nmax) + pgchanged := true; + end + + end + dosetchange := false; + ////ƶ ֮ǰ page change + if (rgchanged or pgchanged) and ((gsi.nmax-gsi.npage)<=0) {and osi.npos>0} then //ԭ + begin + w := makelong(_const.SB_TOP,0); + //osi.ntrackpos := 0; + if nbar = _const.SB_HORZ then + begin + //clearMessageFromGtkMessageQueue(self.handle,_const.WM_HSCROLL); + CallTslVclProc(_const.WM_HSCROLL,w,0,1); + end else + begin + //clearMessageFromGtkMessageQueue(self.handle,_const.WM_vSCROLL); + CallTslVclProc(_const.WM_VSCROLL,w,0,1); + end + //dosetchange := true; + end + + if msk .& _const.SIF_TRACKPOS then + begin + if gsi.ntrackpos <> osi.ntrackpos then + begin + osi.ntrackpos := gsi.ntrackpos; + end + end + if gsi.npage>=(gsi.nmax-gsi.nmin) then + begin + _wapi.gtk_widget_hide(bar); + fbarshow .&=(3 .& _not(cbs)); + end else + begin + _wapi.gtk_widget_show(bar); + fbarshow .|=cbs; + end + //echo "\r\n",datetimetostr(now()),"====showbar end===",fbarshow; + if bkshowbar<>fbarshow then + begin + + h := handle; + w0 := _wapi.g_object_get_data(h,"gtk_layout_width"); + h0 := _wapi.g_object_get_data(h,"gtk_layout_height"); + //eturn ; + //echo "\r\n===in put client size:",h0,"===",w0; + widgetsizechanged(h0,w0); + end + end + function hadjustmentmousedown(a,b,c,d);virtual; + begin + FHBardown := true; + end + function vadjustmentmousedown(a,b,c,d);virtual; + begin + FVBardown := true; + end + function hadjustmentmouseup(a,b,c,d);virtual; + begin + FHBardown := false; + end + function vadjustmentmouseup(a,b,c,d);virtual; + begin + FVBardown := false; + end + function hadjustmentchanged(a,b,c,d);virtual; //ı + begin + if not FHBardown then + begin + return ; + end + v := _wapi.gtk_adjustment_get_value(a.handle); + fhsi.ntrackpos := v; + w := makelong(_const.SB_THUMBTRACK,0); + CallTslVclProc(_const.WM_HSCROLL,w,0,1); + end + function vadjustmentchanged(a,b,c,d);virtual;//ֱı + begin + if not FVBardown then + begin + return 0; + end + v := _wapi.gtk_adjustment_get_value(a.handle); + fvsi.ntrackpos := v; + w := makelong(_const.SB_THUMBTRACK,0); + CallTslVclProc(_const.WM_VSCROLL,w,0,1); + end + static fstaticchanged; + function GtkEventDispatch(a,mn,c,d);override; + begin + //Ϣַ + if mn="scroll-event" then + begin + h := a.handle; + + nt := now(); + if (nt-(1/24/3600/20))0 and dr<>1 then return ; + x := ed.x_root; + y := ed.y_root; + r := array(); + + _wapi.GetTopWidgetList(h,x,y,r); + lenr := length(r)-1; + for i := lenr downto 0 do + begin + ri := r[i][0]; + rxy := r[i][1]; + fv := _wapi.g_object_get_data(ri,"gtk_window_vscroll_bar"); + if fv and _wapi.gtk_widget_is_visible(fv) then + begin + ifdowheel := true; + break; + end + end + if not ifdowheel then + begin + ri := r[lenr][0]; + rxy := r[lenr][1]; + end + if ri and rxy then + begin + if hasMessageFromGtkMessageQueue(-1,_const.LM_MOUSEWHEEL) then return true; + if hasMessageFromGtkMessageQueue(-1,_const.WM_SIZE) then return true; + if hasMessageFromGtkMessageQueue(-1,_const.WM_MOUSEMOVE) then return true; + + FScrollT := now(); + dr := (dr=1)?-1:1; + + xy := makelong(rxy[0],rxy[1]); + ctl := 0; + global g_gtk_buttontable,g_gtk_keytable; + if ifarray(g_gtk_buttontable) then + begin + ctl .|= g_gtk_buttontable[0]; + ctl .|= g_gtk_buttontable[1]; + end + if ifarray(g_gtk_keytable) then + begin + if g_gtk_keytable[0x10] then ctl .|= _const.MK_Shift; + if g_gtk_keytable[0x11] then ctl .|= _const.MK_Control; + end + dr := makelong(ctl,dr); + //clearMessageFromGtkMessageQueue(ri,_const.LM_MOUSEWHEEL); + AddMessageToGtkMessageQueue(ri,_const.LM_MOUSEWHEEL,dr,xy,1); + return true; + end + + end + return inherited; + end + function Destroy();override; + begin + inherited; + FHadjustment := nil; + Fvadjustment := nil; + FHscrollbar := nil; + Fvscrollbar := nil; + FLayouter := nil; + Fvscrollbarobj := nil; + Fhscrollbarobj := nil; + FClientWideget := nil; + end + protected + function initadjustSingal(); + begin + FHadjustment := _wapi.gtk_adjustment_new(0.0,0.0,0.0,1.0,1.0,1.0); + FHscrollbar := _wapi.gtk_hscrollbar_new(FHadjustment); + //////////////////////////ֱ//////////////////////////////////// + FVadjustment := _wapi.gtk_adjustment_new(0.0,0.0,0.0,1.0,1.0,1.0); + Fvscrollbar := _wapi.gtk_vscrollbar_new(FVadjustment); + + _wapi.gtk_layout_put(FLayouter,Fvscrollbar,0,0); + _wapi.gtk_layout_put(FLayouter,FHscrollbar,0,0); + fhadjustobject := new tgtk_ctl_object_scroll(FHadjustment); + fvadjustobject := new tgtk_ctl_object_scroll(Fvadjustment); + fhadjustobject.Connect("value-changed",thisfunction(hadjustmentchanged)); + fvadjustobject.Connect("value-changed",thisfunction(vadjustmentchanged)); + Fvscrollbarobj := new tgtk_ctl_object_scroll_Bar(Fvscrollbar); + Fvscrollbarobj.Connect("button-press-event",thisfunction(vadjustmentmousedown)); + Fvscrollbarobj.Connect("button-release-event",thisfunction(vadjustmentmouseup)); + Fhscrollbarobj := new tgtk_ctl_object_scroll_Bar(Fhscrollbar); + Fhscrollbarobj.Connect("button-press-event",thisfunction(hadjustmentmousedown)); + Fhscrollbarobj.Connect("button-release-event",thisfunction(hadjustmentmouseup)); + + end + FLayouter; //layout + FHscrollbar; //ؼ + Fvscrollbar; + Fvscrollbarobj; // + Fhscrollbarobj; + FHadjustment; //adjustment + Fvadjustment; + fhadjustobject; + fvadjustobject; + FClientWideget; //ͻ + FClientObject; + private + FScrollT; + fvsi; //Ϣ + fhsi; + fbarshow; + FVBardown; // + FHBardown; + FScroller; + +end +type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window) + function Create(h);override; + begin + inherited; + end + function DefaultMessageDo(msg,w,l);override; + begin + if msg = _const.WM_SETICON then + begin + if l then + begin + h := handle; + _wapi.gtk_window_set_icon(h,l); + end + end + inherited; + end + function GtkEventDispatch(a,mn,c,d);override; + begin + //Ϣַ + //echo "eventtype:",_wapi.gdk_event_get_event_type(c),"\r\n"; + case mn of + "configure-event" : + begin + //return false; + h := a.handle; + x := _wapi.g_object_get_data(h,"gtk_layout_x"); + y := _wapi.g_object_get_data(h,"gtk_layout_y"); + cx := _wapi.g_object_get_data(h,"gtk_layout_width"); + cy := _wapi.g_object_get_data(h,"gtk_layout_height"); + cf := new _GdkEventConfigure(c); + ALeft := integer(cf.x); + ATop := integer(cf.y); + //echo "\r\n>>>",ALeft,"===",ATop; + AWidth := integer(cf.width); + AHeight := integer(cf.height); + SizeChanged :=(cx <> AWidth)or(cy <> AHeight); + PosChanged :=(x <> ALeft)or(y <> ATop); + if(not SizeChanged)and(not PosChanged)then + begin + Exit; + end + if (cx <> AWidth) then _wapi.g_object_set_data(h,"gtk_layout_width",AWidth); + if cy <> AHeight then _wapi.g_object_set_data(h,"gtk_layout_height",AHeight); + if x <> ALeft then + begin + _wapi.g_object_set_data(h,"gtk_layout_x",aleft); + end + if y <> ATop then + begin + _wapi.g_object_set_data(h,"gtk_layout_y",atop); + end + r := _wapi.Gtk_TrigMoveSizeEvent(h,const aleft,const atop,const AWidth,const AHeight,(SizeChanged?1:0).|(PosChanged?2:0)); + return r; + end + "delete-event": + begin + r := CallTslVclProc(_const.WM_CLOSE,0,0); + return r; + end + "activate-default": + begin + echo "activate-defalut\r\n"; + end + end; + return inherited; + + end + function GtkBaseEventName();override; + begin + return inherited union2 array("configure-event","delete-event","scroll-event","activate-default"); + end + function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override; + begin + //echo "\r\nctl===popup:",tostn(params),tostn(__stack_frame),datetimetostr(now()),">>>>"; + h := _wapi.gtk_window_new(0); //ؼ + srszie := (_const.WS_SIZEBOX .& dwStyle)=_const.WS_SIZEBOX; + _wapi.gtk_object_set_data(h,"gtk_decorated",1); + if not((_const.WS_CAPTION .& dwStyle)= _const.WS_CAPTION or (_const.WS_SYSMENU .& dwStyle)=_const.WS_SYSMENU) then + begin + + _wapi.gtk_window_set_decorated(h,false); + _wapi.gtk_object_set_data(h,"gtk_decorated",0); + //޲˵㴰 + end else + begin + _wapi.gtk_window_set_title(h,_wapi.TslStringToGtk(lpWindowName)); + //б в˵Ķ㴰 + end + if (_const.WS_BORDER .& dwStyle)=_const.WS_BORDER then //Border + begin + _wapi.gtk_container_set_border_width(h,1); + end + vbox := _wapi.gtk_vbox_new(0,0); //˵ֲ + _wapi.gtk_container_add(h,vbox); + _wapi.g_object_set_data(h,"gtk_vbox",vbox); //vbox + _wapi.gtk_window_set_resizable(h,srszie); + _wapi.g_object_set_data(h,"gtk_popwp",2+srszie); + { + vbox + //menubar + layout + hscroll + vscroll + clientwidget + } + ctllayout := _Wapi.gtk_layout_new(0,0); + _wapi.gtk_box_pack_end(vbox,ctllayout,1,1,0); + + FLayouter := ctllayout; + /////////////////////////ˮƽ//////////////////////////////////// + initadjustSingal(); + evtdrawbox := _wapi.gtk_event_box_new(); //lot һevent box ڻ + + _wapi.gtk_layout_put(ctllayout,evtdrawbox,0,0); + clientLayout := _Wapi.gtk_layout_new(0,0); + _wapi.gtk_container_add(evtdrawbox,clientLayout); + _wapi.gtk_widget_set_size_request(evtdrawbox,nwidth,nheight); + //_wapi.gtk_widget_set_size_request(evtdrawbox,2000,2000); + //_wapi.gtk_widget_set_events(eb,16777214); + _wapi.g_object_set_data(evtdrawbox,"gtk_client_parent",h); + FClientWideget := evtdrawbox; + //_wapi.gtk_widget_set_can_focus(eb,true); + _wapi.g_object_set_data(h,"gtk_layout",clientLayout); + _wapi.g_object_set_data(clientLayout,"gtk_layout_owner",h); + + InitWidgetSize(h,x,y,nwidth,nheight); + _wapi.gtk_window_move(h,x,y); + if nwidth>0 and nheight>0 then + begin + _wapi.gtk_window_resize(h,nwidth,nheight); + + end + _wapi.gtk_widget_show_all(vbox); + InitContainerList(h); //list + if (_const.WS_VISIBLE .& dwStyle)=_const.WS_VISIBLE then + begin + _wapi.ShowWindow(h); + end else + begin + _wapi.gtk_widget_hide(h); + end + _wapi.SetParent(h,hwndparent); + handle := h; + return inherited; + end + +end +type tgtk_ctl_window = class(tgtk_ctl_scroll_window) + function Create(h);override; + begin + inherited; + end + function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override; + begin + h := _wapi.gtk_event_box_new();//ؼ + ctllayout := _Wapi.gtk_layout_new(0,0);//ؼֲ + _wapi.gtk_container_add(h,ctllayout); + evtdrawbox := _wapi.gtk_event_box_new(); //ֻƲ + clientlayout := _wapi.gtk_layout_new(0,0); //ͻֲ + _wapi.gtk_container_add(evtdrawbox,clientlayout); + _wapi.gtk_layout_put(ctllayout,evtdrawbox,0,0); + _wapi.gtk_widget_set_size_request(evtdrawbox,nwidth,nheight); + //_wapi.gtk_widget_set_size_request(evtdrawbox,10000,10000); + _wapi.g_object_set_data(h,"gtk_layout",clientlayout); + _wapi.g_object_set_data(clientlayout,"gtk_layout_owner",h); + _wapi.g_object_set_data(evtdrawbox,"gtk_client_parent",h); + _wapi.gtk_widget_show_all(evtdrawbox); + FClientWideget := evtdrawbox; + InitWidgetSize(h,x,y,nwidth,nheight); + FLayouter := ctllayout; + _wapi.gtk_widget_set_size_request(h,nwidth,nheight); + _wapi.gtk_widget_show(ctllayout); + if (dwStyle .& _const.WS_VISIBLE)=_const.WS_VISIBLE then + begin + _wapi.gtk_widget_show(h); + end + ///////////////////////////////////////////////////////////// + initadjustSingal(); + ///////////////////////////ɫ///////////////////////////////////////// + {c := new _GdkColor(nil); + c.SetRgb(0,0xffff,0); + _wapi.gtk_widget_modify_bg(h,0,c._getptr_());} + ///////////////////////////////////////////////////////////////////// + InitContainerList(h); + _wapi.SetParent(h,hwndparent); + handle := h; + return inherited; + end +end + + + +function g_main_context_new():pointer;cdecl;external "libgtk-3.so"; +function g_main_context_ref(m:pointer):pointer;cdecl;external "libgtk-3.so"; +function g_main_context_acquire(m:pointer):integer;cdecl;external "libgtk-3.so"; +procedure g_main_context_release(m:pointer);cdecl;external "libgtk-3.so"; +type tGtkMessageQueue = class //Ϣ +{** + @ignore() + gtkϢ +**} + private + + public + function Create(); + begin + Clean(); + FMainContext := g_main_context_new(); + g_main_context_ref(FMainContext); + fLock := 0; + end + function Add(h,m,l,w,obj); + begin + lock(); + FLen++; + FData[FLen] := array(h,m,l,w,obj); + unlock(); + end + + function Feach(); + begin + lock(); + if FCurrent100 then + begin + FData := FData[FCurrent+1:];//min(FLen-1,FCurrent+100)]; + FCurrent := -1; + FLen := length(FData); + end + end + else + begin + Clean(); + end + unlock(); + return r; + end + function cleaneasyLostMessage(h,m); + begin + idx := FCurrent; + lock(); + while idx0) then + begin + fLock--; + if (fLock=0) then + begin + g_main_context_release(FMainContext); + end + end + end + end +function _gtkeventcall_();//Ϣص +begin + r := class(tgtk_ctl_object).DispatchGtkEventCall(params); + return r; +end +function _gtk_add_time_msg_(h,m,w,l); +begin + //ʱ + AddMessageToGtkMessageQueue(h,m,w,l,0x113); +end +function hasMessageFromGtkMessageQueue(h,m); +begin + GLobal G_GTK_MESSAGE_QUEUE_A; + if G_GTK_MESSAGE_QUEUE_A then G_GTK_MESSAGE_QUEUE_A.haseasyLostMessage(h,m); +end +function clearMessageFromGtkMessageQueue(h,m); +begin + GLobal G_GTK_MESSAGE_QUEUE_A; + if G_GTK_MESSAGE_QUEUE_A then G_GTK_MESSAGE_QUEUE_A.cleaneasyLostMessage(h,m); +end +function AddMessageToGtkMessageQueue(FHandle,msg,wparam,lparam,d); //Ϣ +begin + GLobal G_GTK_MESSAGE_QUEUE_A; + if not G_GTK_MESSAGE_QUEUE_A then + begin + G_GTK_MESSAGE_QUEUE_A := new tGtkMessageQueue(); + end + G_GTK_MESSAGE_QUEUE_A.add(FHandle,msg,wparam,lparam,d); +end +function FeachMessageFromGtkMessageQueue(); //ȡϢ +begin + GLobal G_GTK_MESSAGE_QUEUE_A; + if G_GTK_MESSAGE_QUEUE_A then + begin + d := G_GTK_MESSAGE_QUEUE_A.Feach(); + return d; + end + //return class(tgtk_ctl_object).Feach(params); +end +function GetGtkEventNameOrId(n); //event +begin + global G_E_ID_Name_1; + global G_E_ID_Name_2; + if not ifarray(G_E_ID_Name_1) then + begin + G_E_ID_Name_2 := array(); + G_E_ID_Name_1 := array( + "wm-user":10, + "destroy":11, + "activate":12, + "clicked":13, + "value-changed":14, + "delete-event":15, + "event":16 ); + for i,v in G_E_ID_Name_1 do + begin + G_E_ID_Name_2[v] := i; + end + end + if ifstring(n) then + begin + ln := lowercase(n); + r := G_E_ID_Name_1[ln]; + if not r then + begin + r := new tcstring(64); + r.setv(n); + r := r._getptr_(); + G_E_ID_Name_1[ln] := r; + G_E_ID_Name_2[r] := ln; + end + return r; + end else + if n>0 or n<0 then return G_E_ID_Name_2[n]; +end +function callpaintmessage(d); +begin + _wapi := unit(tslvcl).gettswin32api(); + _const := GetWin32Const(); + r := zeros(4); + hd := d[0]; + _wapi.gtk_widget_get_allocation(hd,r); + cr := _wapi.gdk_cairo_create(_wapi.gtk_widget_get_window(hd)); + hwd := hd; + _wapi.g_object_set_data(hwd,"paint_dc",cr); + _wapi.g_object_set_data(hwd,"paint_height",r[3]); + _wapi.g_object_set_data(hwd,"paint_width",r[2]); + + r := class(tgtk_ctl_object).CallGtkWinProc(d[0],d[1],d[2],d[3]); + + _wapi.cairo_set_dash(cr,array(4.0,0.0),2,0); + if (FExdwstyle .& _const.WS_EX_DLGMODALFRAME)= _const.WS_EX_DLGMODALFRAME then + begin + _wapi.cairo_set_source_rgb(cr, 225/255, 225/255, 225/255); + _wapi.cairo_set_line_width (cr, 3); + _wapi.cairo_rectangle(cr,0,0,r[2],r[3]); + _wapi.cairo_stroke(cr); + end + if (Fdwstyle .& _const.WS_BORDER)= _const.WS_BORDER then + begin + _wapi.cairo_set_source_rgb(cr, 0, 0, 0); + _wapi.cairo_set_line_width (cr, 1); + _wapi.cairo_rectangle(cr,0,0,r[2],r[3]); + _wapi.cairo_stroke(cr); + end + _wapi.cairo_destroy(cr); + _wapi.gtk_object_set_data(cr); +end +function _gtkidledo_(); //ص +begin + d := FeachMessageFromGtkMessageQueue(); + if ifarray(d) then + begin + //echo "\r\n>>",d[0],"==",d[1],"===",d[4],">>>",datetimetostr(now()); + if d[4]=0x113 and d[0]=0 then //ʱ + begin + unit(tslvcl)._timeproc_(d[0],d[1],d[2],d[3]); + end else + if d[0] then + begin + r := class(tgtk_ctl_object).CallGtkWinProc(d[0],d[1],d[2],d[3]); + return r; + end + else + begin + tslprocessmessages(false); + sleep(10); + end + end else + begin + tslprocessmessages(false); + sleep(10);//Ϣһ + end + unit(uvclthreadworker).RunThreadWorkerHost(); +end +procedure tslprocessmessages()begin end; +function InitGtkWindowClass(); //ʼ +begin + global G_GTK_WINDOW_CLASSINFO; + if not ifarray(G_GTK_WINDOW_CLASSINFO) then + begin + G_GTK_WINDOW_CLASSINFO := array(); + fp := getwinprocptr(); + cls := array(array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tsui_application","hiconsm":0L) + ,array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tsui_window","hiconsm":0L) + ,array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tui_panel","hiconsm":0L) + ,array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tsluidesigner_a_a_1","hiconsm":0L) + ,array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tsui_form","hiconsm":0L) + ,array("cbsize":80,"style":139,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65541L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tui_button","hiconsm":0L) + ,array("cbsize":80,"style":136,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65543L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tui_edit","hiconsm":0L) + ,array("cbsize":80,"style":16395,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65541L,"hbrbackground":16L,"lpszmenuname":0L,"lpszclassname":"tui_tablecontrol32","hiconsm":0L) + ,array("cbsize":80,"style":43,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":0,"hinstance":0,"hicon":0L,"hcursor":0L,"hbrbackground":0L,"lpszmenuname":0L,"lpszclassname":"tui_PageSheet","hiconsm":0L) + ,array("cbsize":80,"style":16384,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65541L,"hbrbackground":6L,"lpszmenuname":0L,"lpszclassname":"tui_monthcalendar","hiconsm":0L) + ,array("cbsize":80,"style":16384,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65541L,"hbrbackground":6L,"lpszmenuname":0L,"lpszclassname":"tui_prograssbar","hiconsm":0L) + ,array("cbsize":80,"style":16384,"lpfnwndproc":fp,"cbclsextra":0,"cbwndextra":8,"hinstance":0,"hicon":0L,"hcursor":65541L,"hbrbackground":6L,"lpszmenuname":0L,"lpszclassname":"tui_datetimepicker","hiconsm":0L) + ); + for i ,v in cls do + begin + G_GTK_WINDOW_CLASSINFO[v["lpszclassname"]] := v; + end + end + +end +type tmenuStruct = class(tslcstructureobj)// ˵ %% + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate( array( + ("cbsize","int",0), + ("fmask","int",0), + ("ftype","int",0), + ("fstate","int",0), + ("wid","int",0), + ("hsubmenu","intptr",0), + ("hbmpchecked","intptr",0), + ("hbmpunchecked","intptr",0), + ("dwitemdata","intptr",0), + ("dwtypedata","intptr",0), + ("cch","int",90), + ("hbmpitem","intptr",0))); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + _setvalue_("cbsize",_size_()); + end + function getdwtypedata(); // + begin + len := _getvalue_("cch"); + p := _getvalue_("dwtypedata"); + d := ReadBytesFromPtr(p,len); + r := ""; + setlength(r,len); + for i := 1 to len do + begin + r[i] := d[i-1]; + end + return r; + //ReadStringFromPtr(p); + end + property wid:integer index "wid" read _getvalue_ write _setvalue_; + property hsubmenu:integer index "hsubmenu" read _getvalue_ write _setvalue_; + property hbmpitem:integer index "hbmpitem" read _getvalue_ write _setvalue_; + property dwtypedata:integer index "dwtypedata" read _getvalue_ write _setvalue_; + property fmask:integer index "fmask" read _getvalue_ write _setvalue_; + property ftype:integer index "ftype" read _getvalue_ write _setvalue_; + property fstate:integer index "fstate" read _getvalue_ write _setvalue_; + end + type taggtkWNDCLASSA = class(tslcstructureobj)// %% + static classstruct; + class function getstruct(); + begin + if not classstruct then + begin + classstruct := MemoryAlignmentCalculate( array( + ("cbsize","int",0), + ("style","int",0), + ("lpfnwndproc","intptr",0), + ("cbclsextra","int",0), + ("cbwndextra","int",0), + ("hinstance","intptr",0), + ("hicon","intptr",0), + ("hcursor","intptr",0), + ("hbrbackground","intptr",0), + ("lpszmenuname","intptr",0),//("lpszmenuname","char*",100), + ("lpszclassname","char*",100), + ("hiconsm","intptr",0))); + end + return classstruct; + end + function create(ptr); + begin + class(tslcstructureobj).create(getstruct(),ptr); + _setvalue_("cbsize",_size_()); + end + end +function GetGtkwindowclass(n);//ô +begin + global G_GTK_WINDOW_CLASSINFO; + InitGtkWindowClass(); + return G_GTK_WINDOW_CLASSINFO[n]; + +end +function reggtkwindowclass(cs);//עᴰ +begin + global G_GTK_WINDOW_CLASSINFO; + InitGtkWindowClass(); + G_GTK_WINDOW_CLASSINFO[cs["lpszclassname"]] := cs; +end +function GetWin32Const(); //win32 +begin + return static new unit(tslvcl).TSLUIBASE(); +end +function makelong(l,h,p); +begin + return unit(tslvcl).makelong(l,h,p); +end +function tsl_gtk_get_thread(); +begin + return static systhreadid(); +end +type _gtkeventtype=class + static GTK_EVENT_ISNIT; + static GDK_DELETE; + static GDK_DESTROY; + static GDK_EXPOSE; + static GDK_MOTION_NOTIFY; + static GDK_BUTTON_PRESS; + static GDK_2BUTTON_PRESS; + static GDK_3BUTTON_PRESS; + static GDK_BUTTON_RELEASE; + static GDK_KEY_PRESS; + static GDK_KEY_RELEASE; + static GDK_ENTER_NOTIFY; + static GDK_LEAVE_NOTIFY; + static GDK_FOCUS_CHANGE; + static GDK_CONFIGURE; + static GDK_MAP; + static GDK_UNMAP; + static GDK_PROPERTY_NOTIFY; + static GDK_SELECTION_CLEAR; + static GDK_SELECTION_REQUEST; + static GDK_SELECTION_NOTIFY; + static GDK_PROXIMITY_IN; + static GDK_PROXIMITY_OUT; + static GDK_DRAG_ENTER; + static GDK_DRAG_LEAVE; + static GDK_DRAG_MOTION; + static GDK_DRAG_STATUS; + static GDK_DROP_START; + static GDK_DROP_FINISHED; + static GDK_CLIENT_EVENT; + static GDK_VISIBILITY_NOTIFY; + static GDK_NO_EXPOSE; + static GDK_SCROLL; + static GDK_WINDOW_STATE; + static GDK_SETTING; + static GDK_OWNER_CHANGE; + static GDK_GRAB_BROKEN; + static GDK_DAMAGE; + static GDK_NOTHING; + + static GTK_RESPONSE_HELP; + static GTK_RESPONSE_APPLY; + static GTK_RESPONSE_NO; + static GTK_RESPONSE_YES; + static GTK_RESPONSE_CLOSE; + static GTK_RESPONSE_CANCEL; + static GTK_RESPONSE_OK; + static GTK_RESPONSE_DELETE_EVENT; + static GTK_RESPONSE_ACCEPT; + static GTK_RESPONSE_REJECT; + static GTK_RESPONSE_NONE; + class function sinit(); + begin + if GTK_EVENT_ISNIT then return ; + GTK_EVENT_ISNIT := true; + GDK_DELETE := 0; + GDK_DESTROY := 1; + GDK_EXPOSE := 2; + GDK_MOTION_NOTIFY := 3; + GDK_BUTTON_PRESS := 4; + GDK_2BUTTON_PRESS := 5; + GDK_3BUTTON_PRESS := 6; + GDK_BUTTON_RELEASE := 7; + GDK_KEY_PRESS := 8; + GDK_KEY_RELEASE := 9; + GDK_ENTER_NOTIFY := 10; + GDK_LEAVE_NOTIFY := 11; + GDK_FOCUS_CHANGE := 12; + GDK_CONFIGURE := 13; + GDK_MAP := 14; + GDK_UNMAP := 15; + GDK_PROPERTY_NOTIFY := 16; + GDK_SELECTION_CLEAR := 17; + GDK_SELECTION_REQUEST := 18; + GDK_SELECTION_NOTIFY := 19; + GDK_PROXIMITY_IN := 20; + GDK_PROXIMITY_OUT := 21; + GDK_DRAG_ENTER := 22; + GDK_DRAG_LEAVE := 23; + GDK_DRAG_MOTION := 24; + GDK_DRAG_STATUS := 25; + GDK_DROP_START := 26; + GDK_DROP_FINISHED := 27; + GDK_CLIENT_EVENT := 28; + GDK_VISIBILITY_NOTIFY := 29; + GDK_NO_EXPOSE := 30; + GDK_SCROLL := 31; + GDK_WINDOW_STATE := 32; + GDK_SETTING := 33; + GDK_OWNER_CHANGE := 34; + GDK_GRAB_BROKEN := 35; + GDK_DAMAGE := 36; + GDK_NOTHING := -1; + + GTK_RESPONSE_HELP := -11; + GTK_RESPONSE_APPLY := -10; + GTK_RESPONSE_NO := -9; + GTK_RESPONSE_YES := -8; + GTK_RESPONSE_CLOSE := -7; + GTK_RESPONSE_CANCEL := -6; + GTK_RESPONSE_OK := -5; + GTK_RESPONSE_DELETE_EVENT := -4; + GTK_RESPONSE_ACCEPT := -3; + GTK_RESPONSE_REJECT := -2; + GTK_RESPONSE_NONE := -1; + end +end + +initialization +end. \ No newline at end of file diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf new file mode 100644 index 0000000..6932f58 --- /dev/null +++ b/funcext/tvclib/utslmemo.tsf @@ -0,0 +1,3461 @@ +unit UTslMemo; +{** + @explan(˵) ıؼ %% +**} +interface +uses TslVcl; +type TMemoLineItem=class + function Create(s); + begin + if ifstring(s)then FStr := s; + else FStr := ""; + end + function StrLength(); + begin + return length(FStr); + end + FMarked; + FStr; +end + +TYPE TMemoLineList=class(TMyArrayB) + function Create(Aedit);override; + begin + FEdit := Aedit; + class(TMyArrayB).create(); + FRowMaxLength := 1; + Flock := true; + end + function Clear(); + begin + splices(nil,nil,array(new TMemoLineItem(""))); + FRowMaxLength := 1; + end + function SetStringByIndex(idx,v);virtual; + begin + if not ifstring(v)then return; + o := GetValueByIndex(idx); + if o then + begin + o.FStr := v; + UpDateMaxStringLength(length(v)); + if Flock then + begin + FEdit.InvalidateLines(idx+1,idx+1); + end + end + end + function SetLineNumByIndex(idx,v);virtual; + begin + end + function GetLineNumByIndex(idx,v);virtual; + begin + end + function SetValueByIndex(idx,v);override; + begin + if ifstring(v)then return SetStringByIndex(idx,v); + //inherited; + //if Flock then FEdit.InvalidateLines(idx+1,idx+1); + end + function GetStringByIndex(idx);virtual; + begin + o := GetValueByIndex(idx); + if o then return o.FStr; + end + function LengthChanged(n);override; + begin + if(Flock)then + begin + //echo "+++\r\n"; + FEdit.UpDateScroll(); + end + end + function ModifyMaxRowLength(); // + begin + fRowMaxLength := 1; + for i := 0 to self.Length()-1 do + begin + vi := GetStringByIndex(i); + fRowMaxLength := max(fRowMaxLength,length(vi)); + end + end + function UpDateMaxStringLength(L); + begin + if FRowMaxLength len then r += "\r\n"; + end + return r; + end +end + +type TMemoGutter=class + function Create(AEdit); + begin + FWidth := 60; + FEdit := AEdit; + end + function PaintLiens(rc,FirstLine,LastLine); + begin + end + property Width read FWidth write FWidth; + private + function GetWidth(); + begin + return 20+FEdit.Font.width * 5; + end + FWidth; + FEdit; +end +type TTslMemoUndoItem=class + FReason; + FSelMode; + FStartPos; + FEndPos; + FStr; + FLinkItem; //Ŀ + function Create(AReason:TSynChangeReason;AStart,AEnd:TPoint;ChangeText:string;SelMode:TSynSelectionMode); + begin + FReason := AReason; + FSelMode := SelMode; + FStartPos := AStart; + FEndPos := AEnd; + FStr := ChangeText; + end + function Clone(); + begin + return new TTslMemoUndoItem(FReason,FStartPos,FEndPos,FStr,FSelMode); + end +end +type TTslMenoUndoList=class() //undolist + private //sbs 2000-11-19 + fBlockCount:integer; //sbs 2000-11-19 + fFullUndoImposible:boolean; //mh 2000-10-03 + fItems:TList; + fLockCount:integer; + fMaxUndoActions; + function GetCanUndo: + boolean; + begin + return fItems.length()>0; + end + procedure EnsureMaxEntries(); + begin + if fItems.length()>fMaxUndoActions then + begin //mh 2000-10-03 + fFullUndoImposible := TRUE; //mh 2000-10-03 + while fItems.length()>fMaxUndoActions do + begin + fItems.Unshift(); + end; + end; + end + function GetItemCount: + integer; + begin + return fItems.length(); + end + procedure SetMaxUndoActions(Value:integer); + begin + if not(Value>0)then Value := 0; + if Value <> fMaxUndoActions then + begin + fMaxUndoActions := Value; + EnsureMaxEntries(); + end; + end + public + function Create(); + begin + fLockCount := 0; + fItems := new TMyArrayB(); + fMaxUndoActions := 1024; + fBlockChangeNumber := 0; + fNextChangeNumber := 1; + end + function Destroy(); + begin + Clear(); + end + procedure AddChange(AReason:TSynChangeReason;AStart,AEnd:TPoint;ChangeText:string;SelMode:TSynSelectionMode); + begin + if fLockCount=0 then + begin + if ifobj(AReason)then + begin + PushItem(AReason.Clone()); + end else + PushItem(CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode)); + end; + end + procedure Clear; + begin + fItems.splices(nil,nil,array()); + fFullUndoImposible := FALSE; + end + procedure Lock; + begin + fLockCount++; + end + procedure Unlock; + begin + if fLockCount>0 then fLockCount--; + return fLockCount; + end + function PeekItem: + TSynEditUndoItem; + begin + iLast := fItems.length()-1; + if iLast >= 0 then return fItems[iLast]; + return nil; + end + function PopItem: + TSynEditUndoItem; + begin + if fLockCount>0 then return nil; + if fItems.length()then return fItems.Pop(); + return nil; + end + procedure PushItem(Item); + begin + if fLockCount>0 then return nil; + fItems.push(Item); + if datatype(fOnAdded)=7 then call(fOnAdded,Self(true)); + end + public + function MergeReplaceItem(); // + begin + if fItems.Length()>= 2 then + begin + it := PopItem(); + pit := PeekItem(); + pitl := pit.FLinkItem; + while pitl do + begin + pit := pitl; + pitl := pit.FLinkItem; + end + pit.FLinkItem := it; + end + end + property CanUndo:boolean read GetCanUndo; + property ItemCount:integer read GetItemCount; + property MaxUndoActions:integer read fMaxUndoActions write SetMaxUndoActions; + // property OnAddedUndo: TNotifyEvent read fOnAdded write fOnAdded; +end; +type TCustomMemoCmd=class() + {** + @explan(˵)༭ؼ%% + **} + public + {** + @ignoremembers( + ecNone , + ecViewCommandFirs , + ecViewCommandLast , + ecEditCommandFirs , + ecEditCommandLast , + ecPageLeft , + ecPageRight , + ecPageTop , + ecPageBottom , + ecEditorBottom , + ecSelPageUp , + ecSelPageDown , + ecSelPageLeft , + ecSelPageRight , + ecSelPageBottom , + ecScrollUp , + ecScrollDown , + ecScrollLeft , + ecScrollRight , + ecInsertMode , + ecOverwriteMode , + ecToggleMode , + ecNormalSelect , + ecColumnSelect , + ecLineSelect , + ecMatchBracket , + ecGotoMarker0 , + ecGotoMarker1 , + ecGotoMarker2 , + ecGotoMarker3 , + ecGotoMarker4 , + ecGotoMarker5 , + ecGotoMarker6 , + ecGotoMarker7 , + ecGotoMarker8 , + ecGotoMarker9 , + ecSetMarker0 , + ecSetMarker1 , + ecSetMarker2 , + ecSetMarker3 , + ecSetMarker4 , + ecSetMarker5 , + ecSetMarker6 , + ecSetMarker7 , + ecSetMarker8 , + ecSetMarker9 , + ecDeleteLastChar , + ecDeleteChar , + ecDeleteWord , + ecDeleteLastWord , + ecDeleteBOL , + ecDeleteEOL , + ecLineBreak , + ecInsertLine , + ecChar , + ecImeStr , + ecBlockIndent , + ecBlockUnindent , + ecTab , + ecShiftTab , + ecAutoCompletion , + ecComment , + ecUnComment , + ecNextBlock , + ecPrevBlock , + ecNextJumpOut , + ecPrevJumpOut , + ecUserFirst , + ecFind , + ecReplace , + ecSearchAgain , + ecFindAll , + ecSearchUpAgain , + + ) + **} + static ecNone; + static ecViewCommandFirs; + static ecViewCommandLast; + static ecEditCommandFirs; + static ecEditCommandLast; + static ecLeft; + static ecRight; + static ecUp; + static ecDown; + static ecWordLeft; + static ecWordRight; + static ecLineStart; + static ecLineEnd; + static ecPageUp; + static ecPageDown; + static ecPageLeft; + static ecPageRight; + static ecPageTop; + static ecPageBottom; + static ecEditorTop; + static ecEditorBottom; + static ecGotoXY; + {** + @param(ecGotoXY)() ת굽ָλ,ӦΪ array(y,x) %% + @param(ecSelGotoXY)() ѡıָλ,ӦΪ array(y,x) %% + @param(ecCopy)() ѡıа,޶Ӧ %% + @param(ecPaste)() ճаı,޶Ӧ %% + @param(ecString)() ַ,ӦΪ ַ %% + **} + static ecSelection; + static ecSelLeft; + static ecSelRight; + static ecSelUp; + static ecSelDown; + static ecSelWordLeft; + static ecSelWordRight; + static ecSelLineStart; + static ecSelLineEnd; + static ecSelPageUp; + static ecSelPageDown; + static ecSelPageLeft; + static ecSelPageRight; + static ecSelPageTop; + static ecSelPageBottom; + static ecSelEditorTop; + static ecSelEditorBottom; + static ecSelGotoXY; + static ecSelectAll; + static ecCopy; + static ecScrollUp; + static ecScrollDown; + static ecScrollLeft; + static ecScrollRight; + static ecInsertMode; + static ecOverwriteMode; + static ecToggleMode; + static ecNormalSelect; + static ecColumnSelect; + static ecLineSelect; + static ecMatchBracket; + static ecGotoMarker0; + static ecGotoMarker1; + static ecGotoMarker2; + static ecGotoMarker3; + static ecGotoMarker4; + static ecGotoMarker5; + static ecGotoMarker6; + static ecGotoMarker7; + static ecGotoMarker8; + static ecGotoMarker9; + static ecSetMarker0; + static ecSetMarker1; + static ecSetMarker2; + static ecSetMarker3; + static ecSetMarker4; + static ecSetMarker5; + static ecSetMarker6; + static ecSetMarker7; + static ecSetMarker8; + static ecSetMarker9; + static ecDeleteLastChar; + static ecDeleteChar; + static ecDeleteWord; + static ecDeleteLastWord; + static ecDeleteBOL; + static ecDeleteEOL; + static ecDeleteLine; + static ecClearAll; + static ecLineBreak; + static ecInsertLine; + static ecChar; + static ecImeStr; + static ecUndo; + static ecRedo; + static ecCut; + static ecPaste; + static ecBlockIndent; + static ecBlockUnindent; + static ecTab; + static ecShiftTab; + static ecAutoCompletion; + static ecComment; + static ecUnComment; + static ecNextBlock; + static ecPrevBlock; + static ecNextJumpOut; + static ecPrevJumpOut; + static ecUserFirst; + static ecFind; + static ecReplace; + static ecSearchAgain; + static ecFindAll; + static ecString; + static ecSearchUpAgain; + protected + class function InitCommandConst(); + begin + ecNone := 0; // Nothing. Useful for user event to handle command + ecViewCommandFirst := 0; + ecViewCommandLast := 500; + ecEditCommandFirst := 501; + ecEditCommandLast := 1000; + ecLeft := 1; // Move cursor left one char + ecRight := 2; // Move cursor right one char + ecUp := 3; // Move cursor up one line + ecDown := 4; // Move cursor down one line + ecWordLeft := 5; // Move cursor left one word + ecWordRight := 6; // Move cursor right one word + ecLineStart := 7; // Move cursor to beginning of line + ecLineEnd := 8; // Move cursor to end of line + ecPageUp := 9; // Move cursor up one page + ecPageDown := 10; // Move cursor down one page + ecPageLeft := 11; // Move cursor right one page + ecPageRight := 12; // Move cursor left one page + ecPageTop := 13; // Move cursor to top of page + ecPageBottom := 14; // Move cursor to bottom of page + ecEditorTop := 15; // Move cursor to absolute beginning + ecEditorBottom := 16; // Move cursor to absolute end + ecGotoXY := 17; // Move cursor to specific coordinates, Data := PPoint + //****************************************************************************** + // Maybe the command processor should just take a boolean that signifies if + // selection is affected or not? + //****************************************************************************** + ecSelection := 100; // Add this to ecXXX command to get equivalent + // command, but with selection enabled. This is not + // a command itself. + // Same as commands above, except they affect selection, too + ecSelLeft := ecLeft+ecSelection; + ecSelRight := ecRight+ecSelection; + ecSelUp := ecUp+ecSelection; + ecSelDown := ecDown+ecSelection; + ecSelWordLeft := ecWordLeft+ecSelection; + ecSelWordRight := ecWordRight+ecSelection; + ecSelLineStart := ecLineStart+ecSelection; + ecSelLineEnd := ecLineEnd+ecSelection; + ecSelPageUp := ecPageUp+ecSelection; + ecSelPageDown := ecPageDown+ecSelection; + ecSelPageLeft := ecPageLeft+ecSelection; + ecSelPageRight := ecPageRight+ecSelection; + ecSelPageTop := ecPageTop+ecSelection; + ecSelPageBottom := ecPageBottom+ecSelection; + ecSelEditorTop := ecEditorTop+ecSelection; + ecSelEditorBottom := ecEditorBottom+ecSelection; + ecSelGotoXY := ecGotoXY+ecSelection; // Data := PPoint + ecSelectAll := 199; // Select entire contents of editor, cursor to end + ecCopy := 201; // Copy selection to clipboard + ecScrollUp := 211; // Scroll up one line leaving cursor position unchanged. + ecScrollDown := 212; // Scroll down one line leaving cursor position unchanged. + ecScrollLeft := 213; // Scroll left one char leaving cursor position unchanged. + ecScrollRight := 214; // Scroll right one char leaving cursor position unchanged. + ecInsertMode := 221; // Set insert mode + ecOverwriteMode := 222; // Set overwrite mode + ecToggleMode := 223; // Toggle ins/ovr mode + ecNormalSelect := 231; // Normal selection mode + ecColumnSelect := 232; // Column selection mode + ecLineSelect := 233; // Line selection mode + ecMatchBracket := 250; // Go to matching bracket + ecGotoMarker0 := 301; // Goto marker + ecGotoMarker1 := 302; // Goto marker + ecGotoMarker2 := 303; // Goto marker + ecGotoMarker3 := 304; // Goto marker + ecGotoMarker4 := 305; // Goto marker + ecGotoMarker5 := 306; // Goto marker + ecGotoMarker6 := 307; // Goto marker + ecGotoMarker7 := 308; // Goto marker + ecGotoMarker8 := 309; // Goto marker + ecGotoMarker9 := 310; // Goto marker + ecSetMarker0 := 351; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker1 := 352; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker2 := 353; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker3 := 354; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker4 := 355; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker5 := 356; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker6 := 357; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker7 := 358; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker8 := 359; // Set marker, Data := PPoint - X, Y Pos + ecSetMarker9 := 360; // Set marker, Data := PPoint - X, Y Pos + ecDeleteLastChar := 501; // Delete last char (i.e. backspace key) + ecDeleteChar := 502; // Delete char at cursor (i.e. delete key) + ecDeleteWord := 503; // Delete from cursor to end of word + ecDeleteLastWord := 504; // Delete from cursor to start of word + ecDeleteBOL := 505; // Delete from cursor to beginning of line + ecDeleteEOL := 506; // Delete from cursor to end of line + ecDeleteLine := 507; // Delete current line + ecClearAll := 508; // Delete everything + ecLineBreak := 509; // Break line at current position, move caret to new line + ecInsertLine := 510; // Break line at current position, leave caret + ecChar := 511; // Insert a character at current position + ecImeStr := 550; // Insert character(s) from IME + ecUndo := 601; // Perform undo if available + ecRedo := 602; // Perform redo if available + ecCut := 603; // Cut selection to clipboard + ecPaste := 604; // Paste clipboard to current position + ecBlockIndent := 610; // Indent selection + ecBlockUnindent := 611; // Unindent selection + ecTab := 612; // Tab key + ecShiftTab := 613; // Shift+Tab key + ecAutoCompletion := 650; + ecComment := 651; + ecUnComment := 652; + ecNextBlock := 701; + ecPrevBlock := 702; + ecNextJumpOut := 703; + ecPrevJumpOut := 704; + ecUserFirst := 1001; // Start of user-defined commands + ecFind := ecUserFirst+1; + ecReplace := ecUserFirst+2; + ecSearchAgain := ecUserFirst+3; + ecFindAll := ecUserFirst+4; + ecString := ecUserFirst+5; + ecSearchUpAgain := ecUserFirst+6; + end +end + +type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) + {** + @explan(˵) ı༭ؼ %% + **} + private + Fecruningto; //е + FLineInterval; + FSetPostioned; + FIsCaretShow; + FCaretCareted; + fForceCaret; + FCharsInWindow; // + fTextHeight; + fLinesInWindow; // + fMaxCharsInRow; + FRowHeight; // + FCharHeight; + FCharWidth; + FLeftChar; + FTopLine; // + FScroolChanged; + FGutterCharCount; + FGutter; + FMarginTop; + FLines; + fLastCaretY; + fCaretLineNeedPaint; + fCaretX; + fCaretY; + fBlockBegin:TPoint; + fBlockEnd:TPoint; + FScrollTimer; + FMouseIsDown; + FInPutCache; + FSelectionMode; + FCopyer; + FReadOnly; + fUndoList; // + fRedoList; // + //************** + static crInsert; + static crPaste; + static crDragDropInsert; + static crDeleteAfterCursor; + static crDelete; + static crLineBreak; + static crIndent; + static crUnindent; + static crSilentDelete; + static crSilentDeleteAfterCursor; + static crNothing; + static smNormal,smLine,smColumn; + //**************** + protected + function SetControlFont(v);override; + begin + inherited; + FCharWidth := Font.width; + FGutter.Width := 1+FGutterCharCount * FCharWidth; + FCharHeight := Font.Height; + fTextHeight := FCharHeight+FLineInterval; + UpDateScroll(); + end + function GetClientXCapacity();override; // + begin + return integer(ClientRect[2]/GetXScrollDelta()); + end + function GetClientYCapacity();override; //߶ + begin + return integer(ClientRect[3]/GetYScrollDelta()); + end + function GetClientXCount();override; //ȼ + begin + return integer((GetMaxCharsInRow()* FCharWidth+FGutter.Width)/GetXScrollDelta()); + end + function GetYScrollDelta();virtual; + begin + return fTextHeight; + end + function GetXScrollDelta();virtual; //ˮƽ + begin + return FCharWidth; + end + function GetClientYCount();virtual; //߶ + begin + h := fTextHeight * fLines.Length; + return integer(h/GetYScrollDelta()); + end + function DoEndUpDate();override; + begin + if not(IsUpDating())then + begin + if FScroolChanged then + begin + FScroolChanged := false; + UpDateScroll(); + end + if fForceCaret then + begin + fForceCaret := false; + UpDateCaret(); + end + end + inherited; + end + function Paint();override; + begin + xpos := GetXpos(); + ypos := GetYPos(); + // Ҫػ + ps := PAINTSTRUCT().rcPaint; + tp := ps[1]; + bo := ps[3]; + FirstLine := integer(max(0,yPos+(tp-FMarginTop)/GetYScrollDelta())); + LastLine := integer(min(FLines.Length()-1,yPos+(bo-FMarginTop)/GetYScrollDelta())); + if FGutterCharCount>0 and(ps[0]FGutter.Width then + begin + FirstCol := integer(max(0,xPos+(ps[0]-FGutter.Width)/GetXScrollDelta())); + LastCol := integer(min(GetMaxCharsInRow()-1,xPos+(ps[2]-FGutter.Width)/GetXScrollDelta())); + rc := ps; + rc[0]:= Max(rc[0],FGutter.Width); + //echo tostn(array(FirstLine, LastLine, FirstCol, LastCol)); + cvs := Canvas; + bcvs := new TCanvsRgnClipAutoSave(cvs,rc); + PaintTextLines(RC,FirstLine,LastLine,FirstCol,LastCol); + end + PluginsAfterPaint(self.Canvas,ps,FirstLine,LastLine); + end + function PaintGutter(rcDraw,nL1,nL2); + begin + dc := Canvas; + dc.brush.Color := rgb(228,228,228); + rc := rcDraw; + rc[2]-= 6; + dc.FillRect(rc); + cvs := Canvas; + iy := 0; + cvs.Font := font; + cvs.Font.Color := 1; + for i := nL1 to nL2 do + begin + r := rcDraw; + r[1]:= rcDraw[1]+fTextHeight * iy; + r[2]-= 10; + r[3]:= r[1]+fTextHeight; + it := flines[i]; + if it and it.FMarked then + begin + dc.brush.Color := 0xFF00FF; + tr := r; + tr[0]+= 1; + tr[1]+= 1; + tr[3]-= 1; + dc.FillRect(tr); + end + if i=Fecruningto then + begin + dc.brush.Color := 0x00ff00; + tr := r; + tr[2]+= 2; + tr[0]:= tr[2]-(tr[3]-tr[1]); + tr[1]+= 2; + tr[3]-= 2; + dc.draw("ellipse",array(tr[0:1],tr[2:3])) + end + cvs.DrawText(inttostr(i+1),r,DT_RIGHT); + iy++; + end + end + function PluginsAfterPaint(cvs,rcDraw,FirstLine,LastLine); + begin + end + function PaintTextLines(RC,FirstLine,LastLine,FirstCol,LastCol);virtual; + begin + cvs := Canvas; + iy := 0; + cvs.TextTabLength := 1; + if fBlockBegin <> fBlockEnd and fBlockBegin and fBlockEnd then + begin + bb := GetBlockBegin(); + ee := GetBlockEnd(); + end + //rcs := rc; + //rcs := FGutter.width-(FLeftChar-1)*FCharWidth; + for i := FirstLine to LastLine do + begin + r := RC; + r[0]:= FGutter.width-(FLeftChar-1)* FCharWidth; + r[1]:= RC[1]+fTextHeight * iy; + iy++; + r[3]:= r[1]+fTextHeight; + if i+1=fCaretY then + begin + cvs.Brush.Color := rgb(232,232,255); + cvs.FillRect(r); + end + if bb then + begin + if i >= bb[0]-1 and i <= ee[0]-1 then + begin + cvs.Brush.Color := rgb(192,192,192); + src := r; + if FSelectionMode=smLine then + begin + end else + begin + if bb[0]=ee[0]then //ͬһ + begin + src[0]+= fCharWidth *(bb[1]-1); + src[2]:= src[0]+fCharWidth *(ee[1]-bb[1]); + end else + begin + if bb[0]-1=i then + begin + src[0]+= fCharWidth *(bb[1]-1); + end + if ee[0]-1=i then + begin + src[2]:= src[0]+fCharWidth *(ee[1]-1); + end + end + end + cvs.FillRect(src); + end + end + end + PaintLiensText(RC,FirstLine,LastLine,FirstCol,LastCol); + end + function DrawLongString(cvs,dtx,tl,r,rnzf); + begin + bn := 100000; + ft := cvs.Font; + if rnzf>tl then + begin + for i := 1 to tl step 2 do + begin + if bytetype(dtx,i)<> 0 then + begin + bn := ft.charset; + ft.charset := 134; + break; + end + end + cvs.DrawText(dtx,r,DT_NOPREFIX); + end else + begin + qmzfs := max(1,integer((0-r[0])/FCharWidth)); + if qmzfs>3 and qmzfs 0 then + begin + bn := ft.charset; + ft.charset := 134; + break; + end + end + dtx2 := copy(dtx,qmzfs,ct); + r[0]+=(qmzfs-1)* FCharWidth; + r[2]:= r[0]+ct * FCharWidth; + cvs.DrawText(dtx2,r,DT_NOPREFIX); + end + if bn <> 100000 then + begin + ft.charset := bn; + end + end + function PaintLiensText(RC,FirstLine,LastLine,FirstCol,LastCol);virtual; + begin + cvs := canvas; + cvs.font := font; + crect := ClientRect; + rnzf := integer(crect[2]/FCharWidth)+10; + for i := FirstLine to LastLine do + begin + r := RC; + r[0]:= FGutter.width-(FLeftChar-1)* FCharWidth; + r[1]:= RC[1]+fTextHeight * iy; + iy++; + r[3]:= r[1]+fTextHeight; + dtx := fLines.GetStringByIndex(i); + tl := length(dtx); + DrawLongString(cvs,dtx,tl,r,rnzf); + end + end + function PositionChanged();virtual; + begin + tp := GetYpos(); + flg := false; + if FTopLine <> tp+1 then + begin + FTopLine := tp+1; + flg .|= 1; + end + tp := GetXpos(); + if tp+1 <> FLeftChar then + begin + FLeftChar := tp+1; + flg .|= 2; + end + if flg or FSetPostioned then + begin + //echo "\r\nupdate:",flg," ",datetimetostr(now()); + UpdateCaret(); + end + FSetPostioned := 0; + InvalidateRect(nil,false); + end + function sinit();override; + begin + crInsert := 1; + crPaste := 2; + crDragDropInsert := 3; + crDeleteAfterCursor := 4; + crDelete := 5; + crLineBreak := 6; + crIndent := 6; + crUnindent := 7; + crSilentDelete := 8; + crSilentDeleteAfterCursor := 9; + crNothing := 10; + smNormal := 0; + smLine := 1; + smColumn := 2; + InitCommandConst(); + inherited; + end + public + function IncPaintLock(); + begin + BeginUpdate(); + end + function DecPaintLock(); + begin + EndUpdate(); + end + function UpDateScroll(); + begin + DoControlAlign(); + end + Function DoControlAlign();override; + begin + if(IsUpDating())then + begin + FScroolChanged := true; + end else + begin + rc := ClientRect; + fCharsInWindow := integer((rc[2]-rc[0]-FGutter.width)/FCharWidth); + fLinesInWindow := integer((rc[3]-rc[1])/fTextHeight); + InitialScroll(); + CaretXY := CaretXY; + UpdateCaret(); + end + end + function Create(AOwner);override; + begin + inherited; + FReadOnly := false; + FLineInterval := 4; + FGutterCharCount := 7; + FSelectionMode := smNormal; + FGutter := new TMemoGutter(self); + FGutter.Width := 1+Font.Width * FGutterCharCount; + fLines := new TMemoLineList(self(true)); + FInPutCache := 0; + fLines.Text := ""; + AutoScroll := 3; + ThumbTrack := TRUE; + fMaxCharsInRow := 64; //128; //ĬϿ + FCharHeight := Font.Height; + FCharWidth := Font.Width; + fTextHeight := FCharHeight+6; + rc := ClientRect; + fCharsInWindow := integer((rc[2]-rc[0])/FCharWidth); + fLinesInWindow := integer((rc[3]-rc[1])/fTextHeight); + FTopLine := 1; + FLeftChar := 1; + FMarginTop := 0; + fCaretX := 1; + fCaretY := 1; + FSetPostioned := 0; + fBlockBegin := array(1,1); + fBlockEnd := array(1,1); + //********************************* + fUndoList := new TTslMenoUndoList(); + fRedoList := new TTslMenoUndoList(); + end + + function ClipCursor(); + begin + FMouseIsDown := true; + crect := ClientRect; + ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3])); + _wapi.clipcursor(ps); + end + function UnClipCursor(); + begin + if FMouseIsDown then + begin + FMouseIsDown := false; + _wapi.ClipCursor(0); + end + end + function ComputeAndSelToCaret(y,x); + begin + xy := PixelsToRowColumn(x,y); + ExecuteCommand(ecSelGotoXY,xy); + end + function ClearSelBlock(); + begin + fBlockBegin := array(FCaretY,FCaretX); + fBlockEnd := array(FCaretY,FCaretX); + end + function TrySetFoucs(); + begin + if not FHasFocus then SetFocus(); + end + function MouseMoveSel(x,y); + begin + if FMouseIsDown then + begin + rc := ClientRect; + //x := e.xpos; + if x>rc[2]-5 then + begin + x +=FCharWidth+5; + end else + if x<5 then + begin + x-=FCharWidth-5; + end + //y := e.ypos; + if y>rc[3]-5 then + begin + y +=FCharWidth+5; + end else + if y<5 then + begin + y-=fTextHeight; + end + MoveCaretAndSelection(fBlockBegin,PixelsToRowColumn(x,y),true); + return ; + end + end + function MouseDown(o,e);override; + begin + inherited; + if e.skip then return ; + if e.Button() = mbLeft then + begin + if ssShift in e.Shiftstate() then + begin + ComputeAndSelToCaret(e.ypos,e.xpos); + end else + begin + ComputeCaret(e.xpos,e.ypos); + ClearSelBlock(); + ClipCursor(); + + end + TrySetFoucs(); + UpDateCaret(); + + end else + if e.Button()=mbRight then + begin + ComputeCaret(e.xpos,e.ypos); + end + + end + function MouseMove(o,e);override; + begin + return MouseMOVESel(e.xpos,e.ypos); + end + function WMIMECHAR(o,e):WM_IME_CHAR; + begin + return; + r := " "; + w := e.wparam; + msk :=(_shl(1,8)-1); + r[2]:= chr(w .& msk); + r[1]:= chr(_shr(w,8).& msk); + //echo r,"\r\n"; + //ExecuteCommand(ecString,r); + //echo "\r\nime:",e.wparam; + end + function MouseUp(o,e);override; + begin + inherited; + if e.skip then return; + UnClipCursor(); + end + function dosetfocus(o,e);override; //ý + begin + FHasFocus := true; + CreateCaret(); + UpDateCaret(); + end + function dokillfocus(o,e);override; //ʧȴ + begin + FHasFocus := false; + DestroyCaret(); + end + function ReCreateCaret(); + begin + if FHasFocus then + begin + DestroyCaret(); + CreateCaret(); + UpDateCaret(); + end + end + function keypress(o,e);override; + begin + if e.skip then return; + c := e.wparam; + if ReadOnly then return; + if c=13 then return CharInput("\r\n"); + if c<32 and not(c in array(9))then return; + cc := e.char; + //if e.CharCode=VK_TAB then return inherited; + if(c .& 0x80)<> 0 then + begin + if FInPutCache then + begin + cc := FInPutCache+cc; + FInPutCache := 0; + CharInput(cc); + end else + begin + FInPutCache := cc; + return; + end + end else + begin + FInPutCache := 0; //char ¿ܳ + CharInput(cc); + end + inherited; + end + function InsertChars(s);virtual; + begin + if not(ifstring(s) {and s})then return; + if SelAvail then + begin + SelText := s; + return; + end + if not s then return; + bb := array(fCaretY,fCaretX); + r := buffer_InsertChars(bb,s); + fUndoList.AddChange(crInsert,bb,r,s,0); + SetCaretXY(r); + UpdateCaret(); + DoTextChanged(bb); + end + function DoTextChanged(p);virtual; + begin + //ı + end + function DoCaretPosChanged();virtual; + begin + end + function ClearUndo(); + begin + fUndoList.Clear(); + fRedoList.Clear(); + end + function ClearAll(); + begin + fLines.text := ""; + FCaretX := FCaretY := 1; + FSelBegin := array(1,1); + FSelEnd := array(1,1); + ClearUndo(); + DoTextChanged(array(1,1)); + end + function Undo(); + begin + if fUndoList.CanUndo then + begin + UndoItem(); + end + end + function Redo(); + begin + if fRedoList.CanUndo then RedoItem(); + end + function CharInput(c);virtual; + begin + if not ReadOnly then return InsertChars(c); + end + function ExecuteCommand(cmd,data);virtual; + begin + {** + @explan(˵) ִв %% + @param(cmd)(TCustomMemoCmd) %% + @param(data)(any) Ӧ %% + **} + IncPaintLock(); + try + case cmd of + "ecruningto": + begin + if Fecruningto <> data then + begin + Fecruningto := data; + InvalidateRect(nil,false); + end + end + ecTab: + begin + if ifstring(data)and data then + begin + b1 := BlockBegin; + b2 := BlockEnd; + endb := 1; + if ifarray(b1)and ifarray(b2)and b2[0]>b1[0]then + begin + odm := FSelectionMode; + FSelectionMode := smLine; + s := SelText; + ss := str2array(s,"\r\n"); + ins := ""; + len := length(ss)-1; + for i,v in ss do + begin + ins += data+v; + if ib1[0]then + begin + odm := FSelectionMode; + FSelectionMode := smLine; + s := SelText; + ss := str2array(s,"\r\n"); + ins := ""; + len := length(ss)-1; + endb := 1; + for i,v in ss do + begin + lv := length(v); + indata := false; + for idata,vdata in data do + begin + if pos(vdata,v)=1 then + begin + ldata := length(vdata); + if ldata=lv then + begin + end else + begin + ins += v[ldata+1:]; + end + endb := lv-ldata+1; + indata := true; + break; + end + end + if not indata then + begin + ins += v; + endb := lv+1; + end + if i1 then + begin + if fCaretY= 1 and p2[1]>= 1)then return; + SetCaretXY(p2); + IncPaintLock(); + if Sel then + begin + if not SelAvail then fBlockBegin := p1; + fBlockEnd := CaretXY; + InvalidateRect(nil,false); + end else + begin + if SelAvail then + begin + bg := GetBlockBegin()[0]; + ed := GetBlockEnd()[0]; + InvalidateLines(bg,ed); + end + fBlockBegin := CaretXY; + fBlockEnd := CaretXY; + end + UpDateCaret(); + DecPaintLock(); + end + published + property ReadOnly:bool read FReadOnly write setreadolny; + property SelAvail read GetSelAvail; + property Text:text read GetMemoText write SetMemoText; + property TopLine read FTopLine write SetTopLine; + property LeftChar read FLeftChar write SetLeftChar; + property CharsInWindow:Integer read fCharsInWindow; + property LinesInWindow:Integer read fLinesInWindow; + property LineHeight read fTextHeight; + property BlockBegin:TPoint read GetBlockBegin write SetBlockBegin; + property BlockEnd:TPoint read GetBlockEnd write SetBlockEnd; + property CaretX:Integer read fCaretX write SetCaretX; + property CaretY:Integer read fCaretY write SetCaretY; + property CaretXY:TPoint read GetCaretXY write SetCaretXY; + property SelText read GetSelText write SetSelTextExternal; + property LineText:AnsiString read GetLineText write SetLineText; + property Lines read fLines; + property SelectionMode read FSelectionMode write SetSelectionMode; + property GutterWidth read GetGutterWidth; + property LineInterval read FLineInterval write SetLineInterval; + property GutterCharCnt:integer read FGutterCharCount write SetGutterCharCnt; + {** + @param(ReadOnly)(bool) Ƿֻ%% + @param(Text)(string) ı%% + @param(CaretX)(integer) x%% + @param(CaretY)(integer) y%% + @param(SelText)(string) ѡеַ%% + @param(LineText)(string) ǰַ%% + @param(GutterCharCnt)(integer) кŵĿ%% + **} + public + function UpDateCaret(); + begin + if IsUpDating()then return fForceCaret := true; + fForceCaret := false; + if not FCaretCareted then return; + if HandleAllocated()then + begin + if fCaretX >= fLeftChar and(fCaretXr[3]then return; + r[0]:= FGutter.Width; + r[1]:= max(0,fy); + r[3]:= min(r[3],ly); + InvalidateRect(r,false); + end + function DestroyHandle();override; + begin + DestroyCaret(); + FHasFocus := false; + inherited; + end + function MergeLastUndo(); //ϲβ + begin + fUndoList.MergeReplaceItem(); // + end + protected + function PrevWordPos(); //ѡض + begin + cy := FCaretY; + cx := FCaretX; + bx := cx; + if cy<1 then cy := 1; + if cy>fLines.Length()then cy := fLines.Length(); + s := fLines[cy-1].FStr; + ls := length(s); + cx := min(ls+1,cx); + ci := 0; + while cx>1 do + begin + cx--; + vi := s[cx]; + ivi := ord(vi); + {if (ivi<=0x2f) or (ivi>122 and ivi<=127) then + begin + ci++; + break; + end } + if(ivi<48)or(ivi>57 and ivi<65)or(ivi>90 and ivi<95)or(ivi>95 and ivi<97)or(ivi>122 and ivi <= 127)then + begin + ci++; + break; + end + end + rcx := cx+(ci?1:0); + if rcx=bx and rcx>1 then rcx--; + return array(cy,rcx); + end + function NextWordPos(); //ѡض + begin + cy := FCaretY; + cx := FCaretX; + if cy<1 then cy := 1; + if cy>fLines.Length()then cy := fLines.Length(); + s := fLines[cy-1].FStr; + ls := length(s); + cx := min(ls+1,cx); + ci := 0; + while cx <= ls do + begin + vi := s[cx]; + ivi := ord(vi); + //if (ivi<=0x2f) or (ivi>122 and ivi<=127) then break; + if(ivi<48)or(ivi>57 and ivi<65)or(ivi>90 and ivi<95)or(ivi>95 and ivi<97)or(ivi>122 and ivi <= 127)then break; + ci++; + cx++; + end + return array(cy,cx+(ci?(0):1)); + end + private + function setreadolny(n); + begin + nv := n?true:false; + if nv<>FReadOnly then + begin + FReadOnly := nv; + if FHasFocus then + begin + if FReadOnly then + begin + DestroyCaret(); + end else + begin + CreateCaret(); + UpDateCaret(); + end + end + end + end + function SetLineInterval(n); + begin + if not(n>=0) then return n; + nn := integer(n); + if nn<>FLineinterval then + begin + FLineinterval := nn; + fTextHeight := FCharHeight+FLineInterval; + IncPAintLock(); + UpDateScroll(); + DecPaintLock(); + end + end + function SetGutterCharCnt(n); + begin + if not(n>=0 ) then return ; + nn := integer(n); + if nn<>FGutterCharCount then + begin + FGutterCharCount := nn; + FGutter.Width := 1+FGutterCharCount*FCharWidth; + InValidateRect(nil,false); + end + end + function formatShiftTab(d); + begin + if ifarray(d)and d then + begin + for i,v in d do + begin + if not ifstring(v)then return 0; + if not v then return 0; + end + return true; + end + return 0; + end + function SelectAll(); //ȫѡ + begin + fBlockBegin := array(1,1); + fBlockEnd := fBlockBegin; + len := fLines.Length(); + if len>0 then + begin + fBlockEnd := array(len,1+fLines[len-1].StrLength()); + InvalidateRect(nil,false); + end else + end + function CopyToClipboard(); //ѡ + begin + r := GetSelText(); + if r then + begin + if not FCopyer then + begin + FCopyer := new TClipBoard(self); + end + FCopyer.text := r; + return true; + end + end + function PasteFromClipboard(); + begin + //if ReadOnly then return ; + if not FCopyer then + begin + FCopyer := new TClipBoard(self); + end + //s := FCopyer.Text; + //echo length(s),"\r\n"; + if SelAvail then SelText := FCopyer.Text; + else InsertChars(FCopyer.Text); + end + function CutToClipboard(); + begin + if SelAvail then + begin + s := SelText; + CopyToClipboard(); + SelText := ""; + // + end + end + function SetSelectionMode(v); + begin + if(v <> FSelectionMode)and(v in array(smNormal,smLine))then FSelectionMode := v; + end + function MoveCaretHorz(stp,sel); + begin + if stp<0 and fCaretX <= 1 then return; + s := fLines[fCaretY-1].FStr; + if not ifstring(s)then return; + ls := length(s); + if stp>0 and fCaretX >= ls+1 then return; + nx := stp+fCaretX; + if stp>0 then + begin + if nx>ls then nx := ls+1; + else if bytetype(s,nx)=2 then nx := nx+1; + end else + begin + if nx <= 1 then nx := 1; + if bytetype(s,nx)=2 then nx -= 1; + end + MoveCaretAndSelection(array(fCaretY,fCaretX),array(fCaretY,nx),sel); + //UpdateCaret(); + end + function MoveCaretVert(stp,sel); + begin + return MoveCaretAndSelection(array(fCaretY,fCaretX),array(max(1,fCaretY+stp),fCaretX),sel); + if SelAvail then + begin + bg := GetBlockBegin(); + ed := GetBlockEnd(); + fBlockBegin := CaretXY; + fBlockEnd := CaretXY; + InvalidateLines(bg[0],ed[0]); + end + //SetCaretXY(array(fCaretY+stp,fCaretX)); + //UpdateCaret(); + end + function GetGutterWidth(); + begin + return FGutter.Width; + end + function UndoItem(); + begin + item := fUndoList.PopItem(); + if not item then return; + IncPaintLock(); + tarr := array(); + idx := 0; + while item do + begin + tarr[idx]:= item; + item := item.FLinkItem; + idx++; + end + for i := length(tarr)-1 downto 0 do + begin + fRedoList.AddChange(tarr[i]); + if i0 and fCaretY <= fLines.Length()then return fLines.GetStringByIndex(fCaretY-1); + return ""; + end + function SetLineText(s); + begin + if ifstring(s)and fCaretY>0 and fCaretY <= fLines.Length()then + begin + fLines.SetValueByIndex(fCaretY-1,s); + //InvalidateLines(fCaretY-1,fCaretY-1); + end + end + function EnsureCursorPosVisible(); + begin + IncPaintLock(); + try + lct := max(1,LinesInWindow); + if FCaretXCharsInWindow+LeftChar-1 then + begin + LeftChar := FCaretX-CharsInWindow+1; + end + {if FCaretY < TopLine then + begin + TopLine := max(1,FCaretY-1); // -1 + end + else if FCaretY > TopLine + Max(1, LinesInWindow) - 1 then + begin + TopLine := max(1,FCaretY - (LinesInWindow - 1)+1); //+1 + end else + else + begin + //if fCaretLineNeedPaint then InvalidateLines(FCaretY,FCaretY); + fCaretLineNeedPaint := false; + end } + tl := TopLine; + vl := tl+lct; + if fCaretY >= tl and fCaretY <= vl then + begin + fCaretLineNeedPaint := false; + end else + begin + TopLine := fCaretY; + end + finally + DecPaintLock(); + end; + end + function GetCaretXY(); + begin + return array(fCaretY,fCaretX); + end + function SetCaretXY(cxy); + begin + if not(ifarray(cxy)and cxy[0]>0 and cxy[1]>0)then return; + if cxy[0]>fLines.length()then cxy[0]:= fLines.Length(); + cxy[1]:= Column2StrPos(cxy[0],cxy[1]); + docc := 0; + if cxy[1]<> fCaretX or cxy[0]<> fCaretY then + begin + IncPaintLock(); + try + if fCaretX <> cxy[1]then + begin + docc := 1; + fCaretX := cxy[1]; + end + if fCaretY <> cxy[0]then + begin + docc := 2; + fCaretY := cxy[0]; + if fLastCaretY <> fCaretY then + begin + if fLastCaretY then InvalidateLines(fLastCaretY,fLastCaretY); + InvalidateLines(fCaretY,fCaretY); + end + fLastCaretY := fCaretY; + end + EnsureCursorPosVisible(); + finally + DecPaintLock(); + end; + if docc then DoCaretPosChanged(); + end + end + function SetBlockBegin(p); + begin + if not(ifarray(p)and p[0]>0 and p[1]>0)then return; + np := p[0:1]; + if np=fBlockBegin then return; + y := min(fLines.length(),p[0]); + x := Column2StrPos(y,p[1]); + fBlockBegin := array(y,x); + if fBlockBegin <> fBlockEnd then InvalidateRect(nil,false); + end + function SetBlockEnd(p); + begin + if not(ifarray(p)and p[0]>0 and p[1]>0)then return; + np := p[0:1]; + if np=fBlockEnd then return; + y := min(fLines.length(),p[0]); + x := Column2StrPos(y,p[1]); + fBlockEnd := array(y,x); + if fBlockBegin <> fBlockEnd then InvalidateRect(nil,false); + end + function ComputeCaret(X,Y:Integer); + begin + xy := PixelsToRowColumn(x,y); + SetCaretXY(xy); + end + function PixelsToRowColumn(x,y); + begin + r := max(1,min(fLines.Length(),FTopLine+Integer(y/fTextHeight))); + if xbb[1]and ee[1]>1 then r := s[bb[1]:ee[1]-1]; //ܳ + end else + begin + //һ + s := fLines[bb[0]-1].FStr; + if bb[1]<= length(s)then r += s[bb[1]:]; + r += "\r\n"; + //м + for i := bb[0]to ee[0]-2 do + begin + r += fLines[i].FStr; + r += "\r\n"; + end + //һ + s := fLines[ee[0]-1].FStr; + if s and ee[1]>1 then r += s[1:ee[1]-1]; + end + end + return r; + end + function SetCaretX(cx); + begin + x := integer(cx); + if x<1 then return; + if x <> FCaretX then SetCaretXY(array(FCaretY,x)); + end + function SetCaretY(cy); + begin + y := Integer(cy); + if y<1 then return; + if y <> FCaretY then SetCaretXY(array(y,FCaretX)); + end + function SetLeftChar(v); + begin + if v <> FLeftChar and v>0 then + begin + FLeftChar := v; + FSetPostioned .|= 2; + SetXPos(FLeftChar-1); + end + end + function SetTopLine(TL); + begin + if TL <> FTopLine and TL>0 then + begin + FTopLine := TL; + FSetPostioned .|= 1; + SetYPos(FTopLine-1); + end + end + function GetSelAvail(); + begin + return fBlockBegin <> fBlockEnd and fBlockBegin and fBlockEnd; + end + function SelectNextChar(); //ѡȡһַ + begin + s := fLines.GetStringByIndex(fCaretY-1); + ls := length(s); + fBlockBegin := array(fCaretY,fCaretX); + fBlockEnd := array(fCaretY,fCaretX); + if fCaretX <= ls then + begin + bc := 1; + if bytetype(s,fCaretX)=1 then + begin + bc := 2; + end + fBlockEnd := array(fCaretY,fCaretX+bc); + end else + if fCaretY1 then + begin + s := fLines.GetStringByIndex(fCaretY-1); + bc := 1; + if bytetype(s,fCaretX-1)=2 then + begin + bc := 2; + end + fBlockEnd := array(fCaretY,fCaretX-bc); + //fBlockBegin := array(fCaretY, fCaretX-bc); + end else + if fCaretY>1 then + begin + s := fLines.GetStringByIndex(fCaretY-2); + fBlockEnd := array(CaretY-1,length(s)+1); + end + end + function SetSelTextExternal(v); + begin + if ifstring(v)and SelAvail then + begin + if SelText=v then return; + IncPaintLock(); + ee := GetBlockEnd(); + bb := DeleteSel(); + up := false; + if bb[0]=ee[0]then + begin + //InvalidateLines(bb[0],bb[0]); + end else + begin + up := true; + end + if v then + begin + bb2 := buffer_InsertChars(bb,v); + fUndoList.AddChange(crInsert,bb,bb2,v,0); + fUndoList.MergeReplaceItem(); + fBlockEnd := bb2; + if bb2[0]<> bb[0]then up := true; + end else + bb2 := bb; + ExecuteCommand(ecGotoXY,bb2); + //SetCaretXY(bb2); + //if up then UpDateScroll(); + //UpDateCaret(); + DecPaintLock(); + DoTextChanged(bb); + end + end + function DeleteSel(); //ɾѡ + begin + //if ReadOnly then return 0; + if not GetSelAvail()then return 0; + bb := GetBlockBegin(); + ee := GetBlockEnd(); + if FSelectionMode=smLine then + begin + bb[1]:= 1; + ee[1]:= fLines[ee[0]-1].StrLength()+1; + end + fUndoList.AddChange(crDelete,bb,ee,GetSelText(),0); + buffer_DeleteChars(bb,ee); + fBlockBegin := fBlockEnd := bb; + return bb; + end + function GetBlockBegin(); + begin + if GetSelAvail()then + begin + if fBlockEnd[0]10 then n := fMaxCharsInRow; + else n := 10; + return((FLines.RowMaxLength/n)+0.5)* n; + end + function CreateCaret(); // + begin + if FReadOnly then return; + if FCaretCareted then return; + h := Font.Height; + hd := Handle; + _wapi.CreateCaret(hd,nil,1,h); + _wapi.ShowCaret(hd); + FCaretCareted := true; + end + function DestroyCaret(); //ٹ + begin + if FCaretCareted then + begin + _wapi.HideCaret(self.Handle); + _wapi.DestroyCaret(); + end + FCaretCareted := false; + FIsCaretShow := false; + end + FHasFocus; + //buffer + function buffer_DeleteChars(bb,ee); //ɾѡ + begin + if bb=ee then return; + if bb[0]=ee[0]then //ɾһе + begin + str := fLines.GetStringByIndex(bb[0]-1); + str[bb[1]:ee[1]-1]:= ""; + fLines.SetValueByIndex(bb[0]-1,str); + end else // + begin + //ɾ + str := fLines.GetStringByIndex(bb[0]-1); + if str and length(str)>= bb[1]then str[bb[1]:]:= ""; + //ɾǰ + str2 := fLines.GetStringByIndex(ee[0]-1); + if ee[1]>1 and str2 then str2[1:ee[1]-1]:= ""; + fLines.SetValueByIndex(bb[0]-1,str+str2); + //ɾм + fLines.splices(bb[0],ee[0]-bb[0],array()); + end + end + function buffer_InsertChars(cxy,str); // + begin + if not(ifstring(str)and str)then return; + ss := str2array(str,"\n"); + hs := array(); + for i := 0 to length(ss)-1 do + begin + v := ss[i]; + lv := length(v); + if v and v[lv]="\r" then v[lv:lv]:= ""; + hs[i]:= v; + fLines.UpDateMaxStringLength(length(v)); + end + cx := cxy[1]; + cy := cxy[0]; + lenss := length(ss)-1; + ncx := cx; + ncy := cy; + // + si := fLines.GetStringByIndex(cy-1); + lsi := length(si); + if ncx>1 then + begin + si1 := si[1:ncx-1]; + if lsi >= ncx then si2 := si[ncx:]; + else si2 := ""; + end else + begin + si1 := ""; + si2 := si; + end + if length(hs)=1 then + begin + fLines.SetStringByIndex(cy-1,si1+hs[0]+si2); + ncx := cx+length(hs[0]); + end else + begin + hs[0]:= si1+hs[0]; + ncx := 1+length(hs[length(hs)-1]); + if si2 then hs[length(hs)-1]+= si2; + //ncx := 1;//length(hs[length(hs)-1]); + ncy += length(hs)-1; + hs1 := array(); + for i,v in hs do hs1[i]:= new TMemoLineItem(v); + fLines.splices(cy-1,1,hs1); + end + return array(ncy,ncx); + end +end +type TSynCompletionList = class(TListBox) //չʾlist + function Create(AOwner);override; + begin + inherited; + end + function CheckListItem(s);override; + begin + return true; + end + function GetItemText(i);override; + begin + r := GetItem(i); + if ifarray(r) then + begin + r := r["caption"]; + if ifstring(r) then return r; + end + return r; + end + function ItemIndexInc(); // + begin + ItemIndex+=1; + idx := ItemIndex; + InsureItemVisible(idx); + end + function ItemIndexDec(); // + begin + ItemIndex-=1; + idx := ItemIndex; + InsureItemVisible(idx); + end + property ItemIndex read getCurrentSelection write SetCurrentSelection; //ǰ + private + function InsureItemVisible(idx); //ƶǰĸ + begin + rc := GetIdxRect(idx); + c := ClientRect; + if rc[1]c[3] then + begin + SetYpos( 1+GetYPos()+(rc[3]-c[3]+1)/GetYScrollDelta()); + end + end +end +type TSynCompletion = class(TSynCompletionList) +{** + @explan(˵) ﷨ʾԶ %% +**} + type TJumpPanel = class(TSynCompletionList) //תб + function Create(AOwner);override; + begin + inherited; + FFilter := ""; + color := rgb(230,230,220); + FIgnoreCase := true; + visible := false; + FJumpData := array(); + end + function SetJumpData(s); + begin + FJumpData := s; + end + function Recycling();override; + begin + FJumpData := array(); + OnJumpChoosed := nil; + inherited; + end + OnJumpChoosed; + function CanJump(); //Ƿһת,תתַ + begin + p := parent; + if not p then return ; + s := p.CaretWords(); + SetFilter(s); + if ItemCount>0 then return s; + return ; + end + function TryJump(s);//Ԥת + begin + p := parent; + if not p then return ; + if not ifstring(s) then + begin + s := p.CaretWords(); + end + if not s then return ; + SetFilter(s); + ct := ItemCount; + if ct<1 then return ; + if ct = 1 then + begin + CallJump(); + return; + end + mh := p.height; + w :=3+FCurrentWidth*GetXscrollDelta(); + dh := GetYscrollDelta(); + h := 3+dh*min(self.ItemCount,4); + p.GetCaretPos(x,y); + if y+h>mh then + begin + SetBoundsRect(array(x,y-h,x+w,y)) ; + end else + SetBoundsRect(array(x,y-dh,x+w,y+h-dh)) ; + Show(); + end + function CallJump(); + begin + visible := false; + it := GetItem(GetCurrentSelection()); + if it then + begin + callDatafunction(OnJumpChoosed,self.Owner,it); + end + end + function CancelJump(); //ȡѡ + begin + if Visible then Visible := false; + end + function MouseUp(o,e);override; + begin + inherited; + calljump(); + end + function SetFilter(s); + begin + if not FJumpData then return ; + if not(ifstring(s) and s) then return ; + if FFilter= s then return ; + ls := lowercase(s); + lsl := length(ls); + if FIgnoreCase then + begin + cs := ls; + cindex := "lvalue"; + if (lowercase(FFilter) = ls) then return ; + end else + begin + cs := s; + cindex := "value"; + end + FFilter := s; + d := array(); + ld :=0; + FCurrentWidth := 10; + for i,v in FJumpData do + begin + vi := v[cindex]; + if vi= cs then + begin + d[ld++] := v; + FCurrentWidth := max(FCurrentWidth,v["clen"]); + end + end + SetData(d); + if d then + SetCurrentSelection(0); + else visible := false; + end + property IgnoreCase read FIgnoreCase Write SetIgnoreCase; + private + FCurrentWidth; + FIgnoreCase; + FJumpData; + FFilter; + function SetIgnoreCase(v); + begin + nv := v?true:false; + if nv<>FIgnoreCase then + begin + FIgnoreCase := nv; + end + end + end + function Create(AOwner);override; + begin + inherited; + WsPopUp := true; + FFilter := ""; + FIgnoreCase := true; + visible := false; + FJump := new TJumpPanel(self); + end + + function Mouseup(o,e);override; + begin + inherited; + FinishCompletion(); + end + + function PrepareCompletion(c);virtual; // + begin + //ͨSetCompData + if Not FMemo then return ; + s := FMemo.Text; + parseregexpr("[A-Zaz0-9_]+",s,"mi",mched,mchpos,mathlen); + r := array(); + for ri,v in mched do + begin + v0 := v[0]; + lv := lowercase(v0); + if r[lv] then continue; + r[lv] := v0; + end + d := array(); + i := 0; + for lv,v in r do + begin + d[i,"caption"] := v; + d[i,"value"] := v; + d[i,"lvalue"] := lv; + cl := length(v); + d[i,"clen"] := cl; + d[i,"vlen"] := cl; + i++; + end + SetCompData(d); + end + function SetCompData(d);virtual; + begin + if FCompData = d then return ; + FCompData := array(); + try + { for i := 0 to length(d)-1 do + begin + viv := d[i,"value"]; + vic := d[i,"caption"]; + d["lvalue"] := lowercase(vic); + d["vlen"] := length(viv); + d["clen"] := length(vic); + end } + FCompData := select * from d order by ["vlen"],["order"] end; + JD := select * from d where ["jump"] end; + FJump.SetJumpData(JD); + except + FCompData := array(); + end; + FFilter := ""; + end + function TryCompletion(); // + begin + //ַ + //ھʾ + //s := PrevWordPos + //SetFilter(); + s := Memo.PrevWord(); + + if visible then + begin + if s then + begin + SetFilter(s); + end + else Visible := false; + end else + begin + if s then + begin + SetFilter(s); + if ItemCount>0 then + begin + mh := Memo.height; + w :=3+FCurrentWidth*GetXscrollDelta(); + dh := GetYscrollDelta(); + h := 3+dh*min(self.ItemCount,8); + Memo.GetCaretPos(x,y); + xy := Memo.ClientToscreen(x,y); + if y+h>mh then + begin + begin + x := xy[0]; y := xy[1]; + SetBoundsRect(array(x,y-dh-h-5,x+w,y-dh-5)) ; + end + end else + begin + x := xy[0]; y := xy[1]; + SetBoundsRect(array(x,y,x+w,y+h)) ; + end + Show(SW_SHOWNOACTIVATE); + //Visible := true; + //Memo.SetFocus(); + end + end + end + end + function CancelCompletion(); + begin + FJump.Visible := false; + visible := false; + end + function FinishCompletion();// + begin + if Visible then + begin + it := GetItem(self.ItemIndex); + if not it then return false ; + s := it["value"]; + fl := length(FFilter); + ls := length(s); + if it["prefix"] then + begin + + end else + begin + if completedCase() then + begin + if s<>FFiltero and s and ls and fl then + begin + cxy := Memo.CaretXY; + cxy[1]-=fl; + Memo.ExecuteCommand(Memo.ecSelGotoXY,cxy); + Memo.ExecuteCommand(Memo.ecString,s); + end + end else + begin + if flFIgnoreCase then + begin + FIgnoreCase := nv; + FJump.IgnoreCase := nv; + end + end + function SetMemo(M); + begin + if M<>FMemo then + begin + FMemo := M; + IF M IS CLASS(TSynCustomMemo) then + begin + M.Completion:= self(true); + end else FMemo:= nil; + parent := FMemo; + FJump.Parent := FMemo; + //if FJump.Parent<>FMemo then FJump.Parent := FMemo; + end + end +end +type TSynHighLighter = class(TComponent) //﷨ + Type TToken = class + FValue; //ֵ + FPos; //λ + FLen; // + FFColor; //ɫ + FBKColor; //ɫ + FMate; //,Ը + FFfacename; + FFCharset; + {static FTokenCount; + function Create(); + begin + FTokenCount++; + end + function Destroy(); + begin + FTokenCount--; + end } + end + function CreateAToken();virtual; + begin + return New TTOken(); + end + function Create(AOwner); + begin + FCacheTokens := array(); + inherited; + end + function SetInValidateIndex(idx); virtual; //ǰı + begin + if idx<=1 then + begin + return FCacheTokens := array(); + end + ValidIndexs := array(); + for i,v in FCacheTokens do + begin + if i>=idx-1 then + begin + ValidIndexs[i] := nil; + end + + end + reindex(FCacheTokens,ValidIndexs); + end + function InsureTokenParserd(LastLine); virtual; //ȷ + begin + + end + function GetLineTokens(ridx);virtual; + begin + if not Flines then return nil; + r := FCacheTokens[ridx]; + if r then return r; + s := Flines.GetSTringByIndex(ridx); + if not ifstring(s) then return; + idx := 1; + len := length(s); + tks := array(); + ctk :=""; + while idx<= len do + begin + vi := s[idx]; + if CharInSyn(vi)>0 then + begin + SetTToken(tks,ctk,idx-1); + SetTToken(tks,vi,idx); + end else + if pos(vi," \t")>0 then + begin + SetTToken(tks,ctk,idx-1); + end + else + begin + ctk+=vi; + end + idx++; + end + SetTToken(tks,ctk,idx-1); + FCacheTokens[ridx] := tks; + return tks; + end + function CharInSyn(v);virtual; + begin + if not(FSyns) then FSyns := "'~`!@#$%^&*()-+=[]{}|\\?/':;,.><"+'"'; + return pos(v,FSyns); + end + function Clean();virtual; + begin + FCacheTokens := array(); + end + + function Recycling();virtual; + begin + SetMemo(nil); + inherited; + FCacheTokens := array(); + end + property Memo read FMemo write SetMemo; + property lines read FLines; + protected + function SetTToken(tokens,ttk,idx,ext);virtual; //token + begin + if not ttk then return ; + lttk := length(ttk); + d := CreateAToken(); + + D.FValue := ttk; + d.FLen := lttk; + d.FPos := idx-lttk+1; + { + d.FFCharset := 0; + for i:= 2 to ttk step 2 do + begin + if bytetype(ttk,i)<>0 then + begin + d.FFCharset := 134; + break; + end + end } + tokens[length(tokens)] := d; + ttk := ""; + return d; + end + private + FCacheTokens; + FSyns; // + function SetMemo(M); + begin + if Memo<>M then + begin + tfm := FMemo; + FMemo := M; + if M is Class(TSynCustomMemo) then + begin + FMemo.Highlighter := self(true); + Flines := FMemo.Lines; + end else + begin + FMemo := nil; + Flines := nil; + end + if tfm is Class(TSynCustomMemo) then tfm.Highlighter := nil; + SetInValidateIndex(1); + end + end + Flines; + FMemo; + +end +type TSynCustomMemo = class(TCustomMemo) +{** + @explan(˵) ﷨༭ %% +**} + function DoTextChanged(p);override;//ıı + begin + if Highlighter then + Highlighter.SetInValidateIndex(p[0]); + end + function MouseUp(o,e);override; + begin + inherited; + if e.Button() = mbRight then + begin + calldatafunction(OnRClick,o,e); + end + end + function ExecuteCommand(cmd,data);override; + begin + case cmd of + ecLeft: + begin + if data=1 then + begin + xy := CaretXY; + y := xy[0]; + x := xy[1]; + if x=1 and y>1 then + begin + s := Lines.GetStringByIndex(y-2); + if ifstring(s) then + return ExecuteCommand(ecGotoXY,array(y-1,length(s)+1)); + end + end + + end + ecRight: + begin + if data=1 then + begin + xy := CaretXY; + y := xy[0]; + if yltc then + begin + s := LineText; + if tc = s[x-ltc:x-1] then + begin + ExecuteCommand(ecSelGotoXY,array(CaretY,x-ltc)); + SelText:=""; + return ; + end + end + end + return inherited ExecuteCommand(ecDeleteLastChar); + end + end + return inherited; + end + function PrepareCompletion(c);//׼ + begin + if Completion then return Completion.PrepareCompletion(c); + end + function TryCompletion();//ʾ + begin + if Completion then return Completion.TryCompletion(); + end + function TryJump(s); //ת + begin + if Completion then return CompLEtion.TryJump(s); + end + function Canjump(); //Ƿתǰַ + begin + if Completion then return Completion.Canjump(); + end + function FinishCompletion(); // + begin + if Completion and Completion.Visible then return Completion.FinishCompletion(); + end + function CancelCompletion(); //ȡ + begin + if Completion then return Completion.CancelCompletion(); + end + function CharInput(c);override; //ַ + begin + if ReadOnly then return ; + if c="\r\n" then + begin + if FinishCompletion() then //ȷ + begin + return ; + end else + begin + return inherited; + end + end else + if c="\t" then + begin + b1 := BlockBegin; + b2 := BlockEnd; + if ifarray(b1) and ifarray(b2) and b2[0]>b1[0] then return ExecuteCommand(ectab,FTabChar); + else return inherited CharInput(FTabChar); + end + inherited; + if Completion then + begin + Completion.TryCompletion(); + end + end + function Completioning(); //׼ + begin + return Completion and Completion.Visible; + end + function PrevWord(); //ǰһ + begin + p := PrevWordPos(); + ls := Lines; + s := ls.GetStringByIndex(p[0]-1); + sl := length(s); + cx := CaretX; + cw := ""; + if p[1]<=sl and cx>p[1] then + begin + cw := s[p[1]:cx-1]; + cw := trim(cw); + end; + return cw; + end + function CaretWords(); //ڴ + begin + e := NextWordPos(); + b := PrevWordPos(); + ls := Lines; + s := Lines[b[0]-1]; + r := ""; + if s then + begin + try + s := s.FStr; + for i:= b[1] to e[1]-1 do + begin + ivi := ord(s[i]); + if(ivi<48) or (ivi>57 and ivi<65) or (ivi>90 and ivi<95) or(ivi>95 and ivi<97) or(ivi>122 and ivi<=127) then continue; + r+=s[i]; + end + except + r := ""; + end; + end + return r; + end + function Create(AOwner);// + begin + inherited; + FTabChar := " "; + end + function Recycling();override; // + begin + if FHighlighter then + begin + FHighlighter.Clean(); + SetHighlighter(nil); + end + if FCompletion then + begin + SetCompletion(nil); + end + inherited; + end + function PaintLiensText(RC, FirstLine, LastLine, FirstCol, LastCol); override; + begin + if not Highlighter then return inherited; + cvs := canvas; + bfontname := cvs.font.facename; + Highlighter.InsureTokenParserd(LastLine); + cw := GetXScrollDelta(); + + //**********************************************************8 + bb := BlockBegin; + ee := BlockEnd; + if ifarray(bb) and ifarray(ee) and bb[0]=ee[0] and bb[1]crect[2] then + begin + break; + end + c := V.FFColor; + fn := v.FFfacename; + //bfontname := cvs.font.facename; + cvs.Font.bkmode := TRANSPARENT; + if fn then + begin + cvs.Font.Facename := fn; + end else + begin + cvs.font.facename := bfontname; + end + if (c>0) then + begin + cvs.Font.Color := c; + end + else cvs.Font.Color := 0; + + if (selt and selt = lowercase(val))or(seltcj and seltcj=v.FMate) then + begin + cvs.Font.bkColor := 0xFFE2B0; + cvs.Font.bkmode := OPAQUE; + end + DrawLongString(cvs,val,vallength,r,rnzf); + //cvs.DrawText(val,r,DT_NOPREFIX); + end + end + cvs.font.facename := bfontname; + cvs.Font.Color := 0; + cvs.Font.bkmode := TRANSPARENT; + end + function GetCaretPos(x,y);//ùλ + begin + y := (CaretY-GetYpos())*GetYScrollDelta(); + x := (CaretX-GetXpos())*GetXScrollDelta(); + end + property Highlighter read FHighlighter write SetHighlighter; //﷨ + property Completion read FCompletion write SetCompletion; //Զ + property TabChar read FTabChar write SetTabChar; + private + FHighlighter; + FCompletion; + FTabChar; + function SetTabChar(s); + begin + if FTabChar<>s and s and ifstring(s) then + begin + FTabChar := s; + end + end + function SetHighlighter(v); + begin + if FHighlighter <>v then + begin + tv := FHighlighter; + FHighlighter := nil; + if tv is class(TSynHighLighter) then + begin + tv.Memo := nil; + end + FHighlighter := v; + if v is Class(TSynHighLighter) THEN + begin + v.Memo := self(true); + end else FHighlighter := nil; + InvalidateRect(nil,false); + end + end + function SetCompletion(v); + begin + if FCompletion<>v then + begin + tv := FCompletion ; + FCompletion := nil; + if tv is class(TSynCompletion) then + begin + tv.Memo := nil; + end + FCompletion := v; + if v is class(TSynCompletion) then + begin + v.Memo := self(true); + end else FCompletion := nil; + end + end +end +type TSynMemoNorm = class(TsynCustomMemo) //˳ÿݼı༭ + function Create(AOwner);override; + begin + inherited; + end + function keypress(o,e);override; + begin + if e.CharCode =VK_TAB then + begin + if FSheetTabFlage then return ; + end + inherited; + end + function KeyDown(o,e);override; // + begin + inherited; + if e.skip then return ; + FSheetTabFlage := false; + if ssCtrl in e.shiftstate then + begin + CancelCompletion(); + case e.charcode of + ord("A") : + begin + ExecuteCommand( ecSelectAll); + end + ord("C"): + begin + ExecuteCommand(ecCopy); + end + ord("V"): + begin + if ReadOnly then return ; + ExecuteCommand(ecPaste); + end + ord("X"): + begin + //if (ssAlt in e.shiftstate) then return ExecuteCommand(ecRedo); + if ReadOnly then return ; + ExecuteCommand(ecCut); + end + ord("Y"),ord("L"): + begin + if ReadOnly then return ; + return ExecuteCommand(ecDeleteLine); + end + ord("Z"): + begin + if ReadOnly then return ; + return ExecuteCommand(ecUndo); + end + ord("U"): + begin + if ReadOnly then return ; + return ExecuteCommand(ecRedo); + end + VK_LEFT: + begin + if ssShift in e.shiftstate then return ExecuteCommand(ecSelWordLeft); + return ExecuteCommand(ecWordLeft); + end + VK_RIGHT: + begin + if ssShift in e.shiftstate then return ExecuteCommand(ecSelWordRight); + return ExecuteCommand(ecWordRight); + end + VK_END: + begin + if ssShift in e.shiftstate then return ExecuteCommand(ecSelEditorBottom); + return ExecuteCommand(ecEditorBottom); + end + VK_HOME: + begin + if ssShift in e.shiftstate then return ExecuteCommand(ecSelEditorTop); + return ExecuteCommand(ecEditorTop); + end + end ; + return ; + end + if ssShift in e.shiftstate then + begin + CancelCompletion(); + case e.CharCode of + + VK_TAB: + begin + if ReadOnly then return ; + FSheetTabFlage := true; + return ExecuteCommand(ecShifttab,array(TabChar,"\t"," ")); + end + VK_DOWN: + begin + return ExecuteCommand(ecSelDown); + end + VK_END : + begin + + return ExecuteCommand(ecSelLineEnd); + end + VK_HOME : + Begin + return ExecuteCommand(ecSelLIneStart); + end + VK_UP: + begin + return ExecuteCommand(ecSelUp); + end + VK_LEFT: ExecuteCommand(ecSelLeft); + VK_RIGHT: ExecuteCommand(ecSelRight); + end; + return ; + end + case e.CharCode of + 34: + begin + return ExecuteCommand(ecPageDown,nil); + end + 33: + begin + return ExecuteCommand(ecPageUp,nil); + end + VK_HOME: + begin + ExecuteCommand(ecLineStart); + return CancelCompletion(); + end + VK_END: + begin + ExecuteCommand(ecLineEnd); + return CancelCompletion(); + end + VK_LEFT: + begin + ExecuteCommand(ecLeft,1); + return CancelCompletion(); + end + VK_RIGHT: + begin + ExecuteCommand(ecRight,1); + return CancelCompletion(); + end + VK_UP: + begin + if Completioning() then return Completion.ItemIndexdec(); + ExecuteCommand(ecUp); + end + VK_DOWN: + begin + if Completioning() then return Completion.ItemIndexinc(); + return ExecuteCommand(ecDown); + end + VK_DELETE: + begin + if ReadOnly then return ; + ExecuteCommand(ecDeleteChar); + return CancelCompletion(); + end + VK_BACK : + begin + if ReadOnly then return ; + ExecuteCommand(ecDeleteLastChar,1); + return CancelCompletion(); + end + end; + end + function MouseDown(o,e);override; + begin + if e.button=mbLeft and e.shiftdouble then + begin + ExecuteCommand(ecWordLeft); + ExecuteCommand(ecSelWordRight); + end else + inherited; + CancelCompletion(); + end + function DoMouseWheel(o,e);override; + begin + IF ssCtrl in e.shiftstate then + begin + fw := font.Width; + if e.delta<0 then + begin + if fw>8 then + begin + font := array("width":fw-2,"height":font.height-4); + end + end else + begin + if fw<18 then + begin + font := array("width":fw+2,"height":font.height+4); + end + end + ReCreateCaret(); + return; + end + inherited; + end + private + FSheetTabFlage; +end +Implementation +function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); +begin + return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); +end +InitialIzation +end. + diff --git a/funcext/tvclib/uvclthreadworker.tsf b/funcext/tvclib/uvclthreadworker.tsf new file mode 100644 index 0000000..c5f869c --- /dev/null +++ b/funcext/tvclib/uvclthreadworker.tsf @@ -0,0 +1,367 @@ +unit uvclthreadworker; +{** + @explan(˵)ֹ֧߳ + ע:߳н֧,ִ֧ڵIJ, +**} +//20210902 δʼ֮ǰpostmessageĻ +interface +uses cstructurelib; +function RunThreadWorkerClient(this); // +function RunThreadWorkerHost(); //ַworkerϢ +type tworkerclient = class(TArray) +{** + @explan(˵) ߳ %% +**} + function Create(ph); + begin + inherited create(); + FConnectHandle := ph; + uisetthreadworkerdata(ph,0x30,self.handle); // + end + function close(); //ر 0x10 + begin + uisetthreadworkerdata(FConnectHandle,0x10,0); + end + function PostMessage(d); + begin + uisetthreadworkerdata(FConnectHandle,0x20,d); + end + function DoOnMessage(d); //ִonmessage + begin + if datatype(FOnMessage)=7 then + begin + try + return call(FOnMessage,self,d); + except + uisetthreadworkerdata(FConnectHandle,0x40,exceptobject.ErrInfo); + end; + end + end + property ConnectHandle read FConnectHandle; + property OnMessage read FOnMessage write FOnMessage; + {** + @param(OnMessage)(function[tworkerclient,data]) Ϣص %% + **} + function destroy();override; + begin + FOnMessage := nil; + inherited; + end + private + FOnMessage; //onpost message + FConnectHandle; // +end +type TCustomThreadworker = class() +{** + @explan(˵) ߳ %% +**} + function Create(s,lib,declaration); + begin + if not ifarray(FThreaders) then FThreaders := array(); + FThreader := new tworkerHost(); + FThreaders[inttostr(FThreader.handle)] := FThreader; + if not (checkok(s,libs,declaration)) then raise "̹߳ʧ!"; + uibeginthreadworker(FScript); + end + function Operator [](idx); + begin + {** + @explan(˵) get %% + **} + return FThreader[idx]; + end + function Operator [1](idx,v); + begin + {** + @explan(˵) set %% + **} + FThreader[idx] := v; + end + function Close(); //ر + begin + destroy(); + end + function terminate(); + begin + Close(); + end + function PostMessage(d); + begin + {** + @expaln(˵) ݸ߳ %% + @param(d)(any) ,,ܴͶ %% + **} + FThreader.PostMessage(d); + end + class function dispatch(); + begin + if not FThreaders then return ; + for idx,i in mrows( FThreaders,1) do + begin + o := FThreaders[i]; + if uifeachthreadworkerdata(o.handle,msg,data) then + begin + case msg of + 0x30: //ɳɹ + begin + o.ClientReady(data); + end + 0x10: //ر + begin + o.close(); + end + 0x12: //ɹر + begin + uideleteworkerdata(o.handle); //ɾ + o.ClientReady(0); + DeleteWorker(i); + o.destroy(); + end + 0x40: // + begin + o.DoOnError(data); + end + 0x20 : // + begin + o.DoOnMessage(data); + end + end ; + break; + end + end + end + function destroy();override; + begin + if FThreader then + begin + FThreader.close(); + end + inherited; + end + property OnMessage read GetOnMessage write SetOnMessage; + property OnError read GetOnError write SetOnError; + property OnStart read GetOnStart Write SetOnStart; + {** + @param(OnMessage)(function[TThreadWorker,data]) Ϣص %% + @param(OnStart)(function[TThreadWorker]) ߳ %% + @param(OnError)(function[TThreadWorker,d]) ߳ %% + **} + protected + function Check_TslCode(FScript,err);virtual; + begin + return true; + end + private + class function DeleteWorker(h); + begin + if h then + reindex( FThreaders,array(h:nil)); + end + function checkok(s,libs,declaration); + begin + if ifstring(s) then + begin + lib := ""; + if ifarray(libs) and libs then + begin + lib := ","+array2str(libs,","); + end + dc := ""; + if ifstring(declaration) then + begin + dc := declaration; + end + FScript := format( %% + uses uvclthreadworker%s; + this := new unit(uvclthreadworker).tworkerclient(%s); + %s; + unit(uvclthreadworker).RunThreadWorkerClient(this); + %s; + + %%,lib,inttostr(FThreader.handle),s,dc); + r := Check_TslCode(FScript,err); + if not r then FScript := ""; + end + return r; + end + function GetOnMessage(); + begin + return FThreader.OnMessage; + end + function SetOnMessage(m); + begin + FThreader.OnMessage := m; + end + function GetOnError()begin + return FThreader.OnError ; + end + function SetOnError(e)begin + FThreader.OnError := e ; + end + function GetOnStart()begin + return FThreader.OnStart ; + end + function SetOnStart(e)begin + FThreader.OnStart := e ; + end + static FThreaders; + FScript; //ű + FThreader;//host +end +implementation +function RunThreadWorkerHost(); +begin + class(TCustomThreadworker).dispatch(); +end +function RunThreadWorkerClient(this); +begin +{** + @explan(˵) ߳ѭ %% +**} + h := this.handle; + ph := this.ConnectHandle; + while true do + begin + if uifeachthreadworkerdata(h,msg,d) then + begin + case msg of + 0x11 : //ر + begin + uisetthreadworkerdata(ph,0x12,0); //ر + uideleteworkerdata(h); //ɾϢ + return; + end + 0x20 : //post + begin + this.DoOnMessage(d); + end + end + end else + begin + sleep(20); + end + end +end +type TArray = class + function create(); + begin + FData := array(); + fobj := new tcbytearray(4); + FHandle := fobj._getptr_() ; + end + function Operator [](idx); + begin + return FData[idx]; + end + function Operator [1](idx,v); + begin + FData[idx] := v; + end + function destroy();virtual; + begin + FData := array(); + fobj := nil; + end + property handle read FHandle ; + private + FData; + FHandle; + fobj; +end + +type tworkerHost = class(TArray) + function Create(); + begin + inherited; + FConnectHandle := 0; + FCatcheData := array(); + end + property OnMessage read FOnMessage write FOnMessage; + property OnStart read FOnStart write FOnStart; + property OnError read FOnError write FOnError; + function close(); //ر 0x10 + begin + if FConnectHandle then + begin + uisetthreadworkerdata(FConnectHandle,0x11,0); + end + end + function ClientReady(h); //ı + begin + FConnectHandle := h; + if h then + begin + if datatype(FOnStart)=7 then + begin + try + call(FOnStart,self); + + except + + end; + end + if FCatcheData then + begin + for i,v in FCatcheData do + begin + uisetthreadworkerdata(FConnectHandle,0x20,v); + end + FCatcheData := array(); + end + end + end + function PostMessage(d); // + begin + if FConnectHandle then + begin + if FCatcheData then + begin + for i,v in FCatcheData do + begin + uisetthreadworkerdata(FConnectHandle,0x20,v); + end + FCatcheData := array(); + end + uisetthreadworkerdata(FConnectHandle,0x20,d); + end else + begin + FCatcheData[length(FCatcheData)] := d; + end + end + function DoOnError(d);// + begin + if datatype(FOnError)=7 then + begin + try + return call(FOnError,self,d); + except + end; + end + end + function DoOnMessage(d); // + begin + if datatype(FOnMessage)=7 then + begin + try + return call(FOnMessage,self,d); + except + end; + end + end + function destroy();override; + begin + FOnMessage := nil; + FOnError := nil; + OnStart := nil; + FCatcheData := array(); + inherited; + end + private + FCatcheData; // + FOnMessage; //onpost message + FOnError; + FOnStart; + FConnectHandle; // +end +initialization +end. \ No newline at end of file diff --git a/funcext/tvclib/uvcpropertytypespersistence.tsf b/funcext/tvclib/uvcpropertytypespersistence.tsf new file mode 100644 index 0000000..4a5e221 --- /dev/null +++ b/funcext/tvclib/uvcpropertytypespersistence.tsf @@ -0,0 +1,2063 @@ +Unit UVCPropertyTypesPersistence; +interface +uses tslvcl; +{** + @explan(˵) ӿؼԴ %% +**} +////////////tmfļ////////////////////////////////////////////// + /////////////tmfַ/////////////////////// +function RegComponentPropertyType(vc); +function GetComponentPropertyType(n); +type TTmfParserbase = class + {** + @explan(˵) ,ṩ,ṩͳ + Ŀǰʹõij TT_NUM,TT_BIN,TT_STR,TT_SYM%% + **} + Static Fsok; + static TT_NUM;// + static TT_LLB;// + static TT_RLB;// + static TT_LSB; //( + static TT_RSB; //) + static TT_STR;//ַ + static TT_SYM;// + static TT_POI;// . + static TT_SIG;// : + - :< > = + static TT_BNK;//հ \r \n \t + static TT_ITEM; + static TT_RMB; + static TT_LMB; + static TT_SET; + static TT_COLL; + static TT_LIST; + static TT_BIN; + static TT_BOOL; + static TT_IDENT; + static TT_HEX; + static TT_COMP; + public + class function sinit();virtual; + begin + if not Fsok then + begin + TT_NUM := 1; // + TT_LLB := 2; // + TT_RLB := 3; // + TT_LSB := 4; //( + TT_RSB := 5; //) + TT_STR := 6; //ַ + TT_SYM := 7; // + TT_POI := 8; // . + TT_SIG := 9; // : + - :< > = + TT_BNK := 10; //հ \r \n \t + TT_ITEM := 11; + TT_LMB := 12; + TT_RMB := 13; + TT_SET := 14; + TT_HASH := 15; + TT_COLL := 0x10; + TT_BIN := 0x11; + TT_BOOL := 0x12; + TT_LIST := 0x13; + TT_IDENT := 0x14; + TT_HEX := 0x15; + TT_COMP := 0x16; + Fsok := true; + end + end + class function PError(msg,lev); + begin + //messagebox(msg,"",1); + end + function create();virtual; + begin + sinit(); + end + +end +type TTmfParserToken = class(TTmfParserbase) + {** + @explan(˵) tmf ļtoken %% + **} + private + FScript; + FScriptLen; + FCurrent; + FNumbers; + Ffloat; + FTokens; + FSplitter; //ָ + FSyms; // + FNumberChar; + FHexChar; + Function SetScript(S); + begin + IF FScript <> S then + begin + FScriptLen := 0; + FScript := s; + FCurrent := 1; + FTokens := array(); + if ifstring(s)then + begin + FScriptLen := length(s)+1; + end + end + end + public + class function sinit();override; + begin + inherited; + end + function cchar(); + begin + {** + @explan(˵) õǰַ,λƶ %% + **} + r := FScript[FCurrent]; + FCurrent++; + return r; + end + Function cback(N); + begin + {** + @explan(˵) λ %% + **} + if not(n>0)then n := 1; + FCurrent -= n; + end + Function whileok(); + begin + return FCurrent","[","]")then + begin + delct(r,ct,len,TT_SYM); + delct(r,c,len,TT_SIG); + end else + {if c ="." then + begin + delct(r,ct,len,TT_SYM); + delct(r,c,len,TT_POI); + end else } + if c="-" then + begin + delct(r,ct,len,TT_SYM); + delct(r,c+Pnumber(),len,TT_NUM); + end else + if(c in FNumbers)and pnumber and(not(ct)) {(not(ct)) and (r[len][0]="=")}then + begin + delct(r,ct,len,TT_SYM); + v := c+Pnumber(); + delct(r,v,len,TT_NUM); + end else + begin + ct += c; + end + end + FTokens := r; + return r; + end + function Pstring(ltk); //ַ + begin + {** + @explan(˵) ַ %% + **} + rtk := ltk; + r := ""; + while FCurrent <= FScriptLen do + begin + c := cchar(); + if c="\\" then + begin + c := cchar(); + case c of + "r":r += "\r"; + "n":r += "\n"; + "t":r += "\t"; + "b":r += "\b"; + else r += c; + end; + continue; + end + if c=ltk then break; + r += c; + end + return r; + end + function PHexNumber(); + begin + {** + @explan(˵)16 + **} + c := cchar(); + c := lowercase(c); + its := inttostr(0 -> 9)union array("a","b","c","d","e","f"); + r := ""; + if c="x" then + begin + while whileok() do + begin + c := lowercase(cchar()); + if not(c in its)then + begin + cback(); + break; + end + r += c; + end + return eval(&("0x"+r)); + end else + begin + cback(); + return "d"; + end + end + function Pnumber(); // + begin + {** + @explan(˵) %% + **} + r := ""; + its := inttostr(0 -> 9); + its[length(its)]:= "."; + while whileok() do + begin + c := cchar(); + if(c in array(" ","\t","\r","\n"))then break; + if c="l" or c="L" then + begin + cchar(); + break; + end + if not(c in its)then break; + r += c; + end + cback(); + return r; + end + function create();override; + begin + inherited; + FNumbers := inttostr(0 -> 9); + Ffloat := FNumbers union array("."); + FSplitter := array(' ','\t',"\r","\n",";",","); + FSyms := array("=",":","(",")","<",">","[","]"); + FNumberChar := inttostr(0 -> 9); + FHexChar := FNumberChar union array("a","b","c","d","e","f", + "A","B","C","D","E","F"); + end + property Script read FScript write SetScript; + {** + @param(script)(string) Ľű %% + **} +end +type TTmfParser = class(TTmfParserbase) + {** + @explan(˵)tmfļ %% + **} + private + FCurrent; + FTokens; + FTokenlen; + FParsers; + FTree; + FS; + function SetScriptPath(fn); + begin + if ifstring(fn)then + begin + size := filesize("",fn); //ȡļС + if readFile(rwraw(),"",fn,0,size,data)then + begin + Script := data; + end + end + end + function SetScript(s); + begin + if fs <> s then + begin + FParsers.Script := s; + FTokens := FParsers.gettokens(); + FTokenlen := length(FTokens); + FCurrent := 0; + FTree := nil; + end + end + public + function create();override; + begin + inherited; + FCurrent := 0; + FTokens := array(); + FParsers := new TTmfParserToken(); + end + function whileok(); + begin + return FCurrent0)then n := 1; + FCurrent -= n; + end + function samplevalue(v);virtual; + begin + {** + @expaln(˵) 򻯽%% + @param(v)(array) ͵ %% + **} + r := nil; + if ifarray(v)and v then + begin + case v["type"]of + TT_STR,TT_NUM,TT_SYM,TT_BIN,TT_HEX: + begin + r := v["value"]; + end + TT_SET,TT_LIST: + begin + r := array(); + for ii,vv in v["value"] do + begin + r[ii]:= call(thisfunction,vv); + end + end + TT_COLL: + begin + r := array(); + for ii,vv in v["value"] do + begin + ri := array(); + for iii,vvv in vv do + begin + ri[vvv["name"]]:= call(thisfunction,vvv); + end + r[ii]:= ri; + end + end + TT_ITEM: + begin + r := array(); + for ii,vv in v["value"] do + begin + r[vv["name"]]:= call(thisfunction,vv); + end + end + end; + end + return r; + end + private + function tablelines(str,n); + begin + lines := str2array(str,"\r\n"); + r := ""; + for i,v in lines do + begin + if not v then continue; + r += n; + r += v; + r += "\r\n"; + end + return r; + end + function totfmstr(v); + begin + if ifnil(v)then return tostn(""); + if ifstring(v)and(not v)then return tostn(""); + if ifstring(v)then + begin + if v in array("item","end","object")then return tostn(v); + if new TCharDiscrimi().IsVariableName(v)then + begin + return v; + end else + return tostn(v); + {sa := ord("a"); + sz := ord("z"); + s0 := ord("0"); + s9 := ord("9"); + IsVariableName + for i := 1 to length(v) do + begin + vi := v[i]; + ov := ord(vi); + if not((ov>=sa and ov<=sz)or( ov>=s0 and ov<=s9)or(vi="_") ) then + begin + return tostn(v); + end + end + return v;} + end else + return tostn(v); + end + public + function GetAllSubObjects(obj,r); + begin + if not obj then obj := gettree(); + if not ifarray(r)then r := array(); + for i,v in obj["object"] do + begin + r[length(r)]:= v["name"]; + call(thisfunction,v,r); + end + end + function gettree(); + begin + {** + @explan(˵) ﷨%% + **} + if FTree then return FTree; + IF FTokens then return FTree := createobj(); + return array(); + //return echo tostn(CreateObj()); + end + function TSLasItem(d); + begin + if not ifarray(d)then return totfmstr(d); + rows := mrows(d,1); + ifobj := false; + for i,v in rows do + begin + if i <> v then + begin + ifobj := true; + break; + end + end + if ifobj then + begin + r := "<\r\n"; + for i,v in d do + begin + if ifstring(i)then si := i; + else si := tostn(i); + r += tablelines(si+"="+call(thisfunction,v)," "); + //r+="\r\n"; + end + r += " >\r\n"; + end else + begin + r := "["; + its := ""; + itsl := 0; + for i,v in d do + begin + its := call(thisfunction,v); + itsl += length(its); + r += its; + if itsl>50 then + begin + itsl := 0; + r += "\r\n"; + end else + r += " "; + end + r += "]\r\n"; + end + return r; + end + function GetItem(); + begin + while whileok() do + begin + ctoken(tv,tt); + if tv="item" and(tt <> TT_STR)then return samplevalue(array("value":getabitem(tv),"type":TT_ITEM)); + else if tv="<" and(tt <> TT_STR)then + begin + v := getabitem(tv,fff); + lx := ffff?TT_COLL:TT_ITEM; + return samplevalue(array("value":v,"type":lx)); + end + end + end + function createobj(); + begin + {** + @explan(˵) ȡ %% + **} + while whileok() do + begin + ctoken(tv,tt); + if tv="object" and(tt <> TT_STR)then return getobject(); + end + end + function getobject(); + begin + {** + @explan(˵) ö %% + **} + r := array(); + ctoken(tv,tt); + r["name"]:= tv; + r["type"]:= TT_COMP; + ctoken(tv,tt); + if tv <> ":" then PError("û:",1); + ctoken(tv,tt); + r["class"]:= tv; + rt := getmembers(); + r["property"]:= rt["property"]; + r["object"]:= rt["object"]; + return r; + end + function GetSampleValue(); + begin + {** + @explan(˵) üԼʽtfm%% + @return(any) %% + **} + getpvalue(val,lx); + return SampleValue(array("value":val,"type":lx)); + end + function getpvalue(val,lx); + begin + ctoken(tv,tt); + lx := tt; + if tv="item" and(tt <> TT_STR)then + begin + lx := TT_ITEM; + val := getabitem(); + end else + if tv="[" and(tt <> TT_STR)then + begin + lx := TT_SET; + val := getset(); + end else + if tv="<" and(tt <> TT_STR)then + begin + val := getabitem(tv,fff); // getab(); + if fff then lx := TT_COLL; + else lx := TT_ITEM; //TT_COLL; + end else + if tv="(" and(tt <> TT_STR)then + begin + val := getsb(); + lx := TT_LIST; + end else + if tv="{" and(tt <> TT_STR)then + begin + val := getlb(); + lx := TT_BIN; + end else + if tv="true" and(tt <> TT_STR)then + begin + val := true; + lx := TT_NUM; + end else + if tv="false" and(tt <> TT_STR)then + begin + val := false; + lx := TT_NUM; + end else + val := tv; + end + function getmembers(); + begin + {** + @explan(˵) óԱ %% + @return(array) object property ± %% + **} + r := array(); + objlen := 0; + prolen := 0; + rl := 0; + pp := 0; + while whileok() do + begin + ctoken(tv,tt); + if tv="object" and tt <> TT_STR then + begin + ro := getobject(); + r["object"][objlen++]:= ro; + end else + if tv="end" and tt <> TT_STR then + begin + return r; + end else + if tv="=" and tt <> TT_STR then + begin + if pp then // + begin + getpvalue(val,lx); + r["property"][prolen++]:= array("name":pp,"value":val,"type":lx); + pp := 0; + end else + begin + PError("=ǰûз",1); + end + end else + if tt=TT_SYM then + begin + if pp then + begin + //PError("OBject",1); + end + pp := tv; + end else + PError("",1); + end + return r; + end + function getset(); + begin + r := array(); + rl := 0; + while whileok() do + begin + ctoken(tv,tt); + if tv="]" and tt <> TT_STR then return r; + if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM); + else if tv="<" and tt <> TT_STR then + begin + v := getabitem(tv,fff); + lx := fff?TT_COLL:TT_ITEM; + r[rl++]:= array("value":v,"type":lx); + end else + if tv="[" and tt <> TT_STR then r[rl++]:= array("value":getset(),"type":TT_SET); + else r[rl++]:= array("value":tv,"type":tt); + end + end + function getabitem(tp,ifitem); + begin + if not ifstring(tp)then endtp := "end"; + else if tp="item" then endtp := "end"; + else if tp="<" then endtp := ">"; + else PError("dict",1); + r := array(); + rl := 0; + ifitem := false; + while whileok() do + begin + ctoken(tv,tt); + if tv=endtp {"end"}and tt <> TT_STR then return r; + p := tv; + ptt := tt; + ctoken(tv,tt); + if tv="=" then + begin + getpvalue(val,lx); + if ifnil(val)or ifnil(lx)then PError("itemֵ",1); + r[rl++]:= array("name":p,"value":val,"type":lx); + end else + if p="item" and ptt <> TT_STR and(length(r)<1)then + begin + ifitem := true; + btoken(2); + return getab(); + end else + PError("itemû=",1); + end + end + function getab(); + begin + {** + @explan(˵) ü %% + **} + r := array(); + rl := 0; + while whileok() do + begin + ctoken(tv,tt); + if tv=">" then + begin + return r; + end else + if tv="item" and tt <> TT_STR then + begin + r[rl++]:= getabitem(); + end else + begin + return PError("<>ݴ",1); + end + end + return r; + end + function getsb(); + begin + {** + @explan(˵) С %% + **} + r := array(); + rl := 0; + while whileok() do + begin + ctoken(tv,tt); + if(tv="(")and(tt <> TT_STR)then + begin + r[rl++]:= getsb(); + end else + if(tv=")")and(tt <> TT_STR)then + begin + return r; + end else + if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM); + else if tv="<" and tt <> TT_STR then + begin + v := getabitem(tv,fff); + lx := fff?TT_COLL:TT_ITEM; + r[rl++]:= array("value":v,"type":lx); + end else + begin + r[rl++]:= array("value":tv,"type":tt); + end + end + end + function getlb(); + begin + {** + @explan(˵) ô %% + **} + r := ""; + while whileok() do + begin + ctoken(tv,tt); + if tv="}" then + begin + return r; + end + r += tv; + end + return r; + end + property Script write SetScript; + property ScriptPath write SetScriptPath; + {** + @param(Script)(string) ýűļ %% + @param(ScriptPath)(string) ű· %% + **} +end + + ////////////tmfļ////////////////////////////////////////////// +type TPropertyType=class + private + FTmfParser; + function Gettfmparser(); + begin + if not FTmfParser then FTmfParser := new TTmfParser(); + return FTmfParser; + end + public + function EditType();virtual; + begin + {** + @explan(˵) %% + @return(string) ַ %% + **} + return nil; + end + function FormatEdit(d,modify);virtual; + begin + {** + @explan(˵)ؼתΪ޸ıչʾ %% + @param(d)(any) %% + @param(modify)(bool) Ƿ޸ %% + **} + return array("type":"object","class":EditType(),"value":d,"edit":modify); + end + function UnformatEdit(d);virtual; + begin + {** + @explan(˵)޸ıתΪؼ %% + **} + return d; + end + function FormatTMF(d);virtual; + begin + {** + @explan(˵)޸ıתΪtfmļ %% + **} + return d; + end + function TmfToNode(d);virtual; + begin + {** + @explan(˵) ȡtfmݵؼ %% + **} + return d; + end + function ReadTMF(d,o);virtual; + begin + {** + @explan(˵) ȡtfm ʵʴ + **} + return d; + end + function LazyProperty();virtual; + begin + {** + @explan(˵) ǷΪӳ%% + @return(bool) + **} + return false; + end + function IfComponent();virtual; + begin + {** + @explan(˵) ǷΪؼ%% + **} + return false; + end + property TmfParser:TTmfParser read Gettfmparser; +end +type TPropertyNatural=class(TPropertyType) //Ȼ + function EditType();override; + begin + return "natural"; + end + function FormatTMF(d);virtual; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + return tostn(d); + end +end +type TPropertyInteger=class(TPropertyNatural) // + function EditType();override; + begin + return "integer"; + end +end +type TPropertyString=class(TPropertyNatural) //ַ + function EditType();override; + begin + return "string"; + end +end +type TPropertyColor=class(TPropertyType) //ɫ + function EditType();override; + begin + return "color"; + end + function FormatTMF(d);virtual; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + if ifnumber(d)then return format("0x%x",d); + end +end +type TPropertyDirectory=class(TPropertyType) //Ŀ¼ + function EditType();override; + begin + return "directory"; + end + function FormatTMF(d);virtual; + begin + return tostn(d); + end +end +type TPropertyFileName=class(TPropertyDirectory) //ļ + function EditType();override; + begin + return "filename"; + end +end +type TPropertyFont=class(TPropertyType) // + function EditType();override; + begin + return "font"; + end + function FormatEdit(d,modify);override; + begin + r := inherited; + if ifobj(d)then + begin + try + r["value"]:= d.fontinfo; + except + end; + end + return r; + end + function TmfToNode(d);override; + begin + //echo tostn(d); + return d; + end + function LazyProperty();override; + begin + return true; + end + function FormatTMF(d);virtual; + begin + return TmfParser.tslasItem(d); + end +end +type TPropertyHotkey=class(TPropertyType) //ȼ + function EditType();override; + begin + return "thotkey"; + end + function FormatTMF(d);virtual; + begin + return tostn(d); + end +end +type TPropertyBool=class(TPropertyType) //bool + function EditType();override; + begin + return "bool"; + end + function FormatEdit(d,modify);override; + begin + {** + @explan(˵)ؼתΪ޸ı %% + **} + r := inherited; + if not ifnil(d)then + begin + r["value"]:= d?true:false; + end + return r; + end + function FormatTMF(d);override; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + return d?"true":"false"; + end +end +type TPropertyTypeEvent=class(TPropertyType) //¼ + function EditType();override; + begin + return "eventhandler"; + end + function ReadTMF(d,o);override; + begin + try + r := FindFunction(d,o); + return r; + except + return 0; + end; + end +end +type TPropertyTypeSysCursor=class(UniObjectMember) + function Create(); + begin + inherited; + end + function CreateInfoOBJ();override; + begin + return new tsyscursor(); + end + function EditType();override; + begin + return "syscursor"; + end + private + type tsyscursor=class + OCR_WAIT; + OCR_CROSS; + OCR_UP; + OCR_SIZE; + OCR_SIZENWSE; + OCR_SIZENESW; + OCR_SIZEWE; + OCR_SIZENS; + OCR_SIZEALL; + OCR_ICOCUR; + OCR_NO; + OCR_HAND; + OCR_APPSTARTING; + OCR_IBEAM; + function Create(); + begin + OCR_WAIT := 32514; + OCR_CROSS := 32515; + OCR_UP := 32516; + OCR_SIZE := 32640; + OCR_SIZENWSE := 32642; + OCR_SIZENESW := 32643; + OCR_SIZEWE := 32644; + OCR_SIZENS := 32645; + OCR_SIZEALL := 32646; + OCR_ICOCUR := 32647; + OCR_NO := 32648; + OCR_HAND := 32649; + OCR_APPSTARTING := 32650; + OCR_IBEAM := 32513; + end + end +end +type TPropertyVarible=class(TPropertyType) // + Function EditType();override; + begin + return "variable"; + end + function LazyProperty();override; + begin + return true; + end + function ReadTMF(d,o);override; + begin + if not ifobj(o)then return 0; + try + //echo d,"===",(o.classinfo)["classname"],"****\r\n"; + r := invoke(o,d); + return r; + except + if d like(o.classinfo)["classname"]then return o; + end; + return 0; + end + function FormatTMF(d);override; + begin + if not ifobj(d)then return d; + try + r := invoke(d,"name"); + if ifstring(r)then return r; + except + return nil; + end + return nil; + end +end +type TPropertyaction=class(TPropertyVarible) //action + Function EditType();override; + begin + return "taction"; + end + function IfComponent();virtual; + begin + {** + @explan(˵) ǷΪؼ%% + **} + return true; + end +end +type TPropertyTray=class(TPropertyaction) //action + Function EditType();override; + begin + return "ttray"; + end +end +type TPropertyPopupMenu=class(TPropertyaction) //action + Function EditType();override; + begin + return "tpopupmenu"; + end +end +type TPropertyMainMenu=class(TPropertyaction) //action + Function EditType();override; + begin + return "tmainmenu"; + end + function FormatTMF(d);override; + begin + try + return d.Name; + except + end + return false; + end +end +type TPropertyImagelist=class(TPropertyaction) //action + Function EditType();override; + begin + return "tcontrolimagelist"; + end +end +type TPropertyImagesData=class(TPropertyType) + Function EditType();override; + begin + return "imagesdata"; + end + function TmfToNode(d);override; + begin + if ifstring(d)then + begin + r := HexFormatStrToTsl(d); + if ifarray(r)and r["type"]="bmps" then + begin + ret := array(); + for i,v in r["items"] do + begin + bmp := new tbitmap(); + bmp.Readvcon(v); + ret[i]:= bmp; + end + return array("type":"bmps","items":ret); + return ret; + end + end + end + function LazyProperty();override; + begin + return true; + end + function FormatTMF(d);override; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + r := array("type":"bmps"); + its := array(); + if ifarray(d)and d["type"]="bmps" then + begin + for i,v in d["items"] do + begin + dv := v.tovcon(); + its[length(its)]:= dv; + end + end + {for i,v in d do + begin + if v is class(TBitmap) then + begin + dv := v.tovcon(); + its[length(its)] := dv; + end + end } + r["items"]:= its; + reti := TSlToHexFormatStr(r); + ret := "{ "; + ret += reti; + ret += " }"; + return ret; + end + function ReadTMF(d,o);override; + begin + if ifstring(d)then + begin + r := HexFormatStrToTsl(d); + if ifarray(r)and r["type"]="bmps" then + begin + ret := array("type":"bmps"); + for i,v in r["items"] do + begin + bmp := new tbitmap(); + bmp.Readvcon(v); + ret["items"][i]:= bmp; + end + return ret; + end + end + end +end +type TPropertyBitmap=class(TPropertyType) + function EditType();override; + begin + return "tbitmap"; + end + function TmfToNode(d);override; + begin + if ifstring(d)and d then + begin + tar := HexFormatStrToTsl(d); + bmp := new tbitmap(); + bmp.Readvcon(tar); + return bmp; + end + return nil; + end + function FormatTMF(d);override; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + reti := ""; + if d is class(tbitmap)then + begin + reti := TSlToHexFormatStr(d.tovcon); + end + ret := "{ "; + ret += reti; + ret += " }"; + return ret; + end + function ReadTMF(d,o);override; + begin + return TmfToNode(d); + end +end +type TPropertyIcon=class(TPropertyType) + function EditType();override; + begin + return "ticon"; + end + function TmfToNode(d);override; + begin + if ifstring(d)and d then + begin + dd := HexFormatStrToTsl(d); + if ifarray(dd)then + begin + r := new Ticon(); + r.Readvcon(dd); + return r; + end + end + end + function FormatTMF(d);override; + begin + {** + @explan(˵)޸ıתΪtmfļ %% + **} + reti := ""; + if d is class(ticon)then + begin + reti := TSlToHexFormatStr(d.tovcon()); + end + ret := "{ "; + ret += reti; + ret += " }"; + return ret; + end + function ReadTMF(d,o);override; + begin + return TmfToNode(d); + end +end +type TPropertyStatusItems=class(TPropertyType) + function EditType();override; + begin + return "statusitems"; + end + function FormatTMF(d);override; + begin + r := "["; + for i,v in d do + begin + r += "< \r\n"; + if v["width"]>0 and ifstring(v["text"])then + begin + r += "width="+inttostr(v["width"])+"\r\n"; + r += "text="+tostn(v["text"])+"\r\n"; + end + r += ">\r\n"; + end + r += "]"; + return tablelines(r," "); + return r; + end +end +type TPropertyFileFilter=class(TPropertyType) + function EditType();override; + begin + return "filefilter"; + end + function ReadTMF(d,o);override; + begin + return TmfToNode(d); + end + function FormatTMF(d);override; + begin + r := "{ "+TslToHexFormatStr(d)+" }"; + return r; + end + function TmfToNode(d);override; + begin + return HexFormatStrToTSL(d); + end +end +type TPropertyLazyInteger=class(TPropertyInteger) + function EditType();override; + begin + return "lazyinteger"; + end + function LazyProperty();override; + begin + return true; + end +end +type UniSelProperty=class(TPropertyType) + function Create(); + begin + FSelRange := CreateSelValues(); + end + Property SelRange read FSelRange; + protected + function UnifRagge(d); + begin + r := array(); + for i,v in d do + begin + r[i]:= array(v,v); + end + return r; + end + private + function CreateSelValues();virtual; + begin + //UnifRagge(array("alleft","alright","albottom","altop","alnone","alclient")); + end + FSelRange; +end +type UniObjectMember=class(UniSelProperty) + function Create(); + begin + inherited; + end + function FormatTMF(d);override; + begin + if FValueMap then + begin + if fMultisel and ifarray(d)then + begin + r := "["; + ld := length(d)-1; + for i,v in d do + begin + r += FValueMap[v]; + if i0SQL䲻Ҫִжεʱ򣬼SQL뿪Чʡ + 30λΪ1ʾԪݣFlags .& 0x40000000 <>0̲жԪݣԪбøѡSQLôܶʱЧʡ + 29λõ28λʱЧΪ1ʾֶתΪСFlags .& 0x20000000 <>00ʾתΪСд + 28λΪ1ʱֶСдתЧFlags .& 0x10000000 <>0 + λֵ + ȥλԺֵFlags .& 3 ֵ0ResultصǽΪ1ֶνṹϢΪ2ʱResult[0]ؽResult[1]ֶνṹϢ + + ҪؽֶתΪд + ExecSQL(0x10000000+0x20000000,....) + +־--------2020-04-20 + ޶༭ȫֲһᵼ½ + ԪԼ෽õЧʡ + +־--------2020-04-14 + ޶༭ȫֲҵδʱٴβҿܻᵼindex out of bounds + TSLִں˴־˵ʱʱϵͳϢĴ + +־--------2020-04-13 + ޶һCALLڴŻϢʱ⡣ + ޶ȥûݴҪʾɵôͼꡣ + +־--------2020-04-10 + ޶312汾ʼиʱе롣 + +־--------2020-04-9 + ޶ʹImportfilexlsļᵼڴй¶ + +־--------2020-04-2 + FileToPDFWordSaveAsʹAcrobat Distiller + ΪLinux汾ں˵ + չLinux汾txlsreadwriteɲԣLinux¶Excelļɶд + +־--------2020-03-31 + ʹtxlsreadwriteExcelдᶪʧ⣬Ĭɫʹǰһµ⡣ + "µдCHARTϢXLSX XMLļΪδ"б뵼µľ档 + +־--------2020-03-30 + ɾûݺͬ쳣⡣ + +־--------2020-03-27 + ȱʡʼMBCS312İ汾ȱʡΪ8bitʼָ룩 + ڶͻͬһĿ¼Уļͻ쳣Թд쳣־һҪͬһĿ¼ʹõĴΪ + +־--------2020-03-26 + ͻ쳣ûѡǷ˳֮ǰΪǼ¼־Ӱʹá + +־--------2020-03-25 + ޶ʱɴʱʼʱԼʱϵͳ + ޶ɾеȲܵ´Ĺ쳣 + +־--------2020-03-24 + ȥɴķDZҪϵͳ + ڰشндʱɴȫѡΪɴӵǰΧɸѡ + ƶ༭λǰƵһ׵⡣ + +־--------2020-03-23 + ɴϵͳ + д˲鿴дĹܡ + ༭һ飬һ飬ǰԼǰĹܡ + ĬȼΪAlt+Up DownԼCtrl+Alt+Up Down + +־--------2020-03-20 + Ż + Repeat Until۵Until + Ϊ˸õִ֧ͼPrivate,Protected,Public,Published۵ + Ϊ˶ԵԪõֵ֧ԪͼInterface,Implementation,Initialization,Finialization۵ + Ϊ˶쳣õ֧֣Excecpt,Finally۵ + +־--------2020-03-19 + ޶±༭쳣⡣ + £ѡtryʧtryڵݡ + £ٴνˢ¡ + ʱCommonDlg64λִܳ⡣ + ޶Ժļ + +־--------2020-03-18 + =================================================================== + £¹ܳʣһ۵һ£ΪӦñ۵Ч + ڴ˫ת + ԶʹΪֹƥ + ѡԶ´ҲԽֶˢ´ + ҲԾʾڴ + ϲµĵӣԹر֮ + =================================================================== + +־--------2020-03-12 + ûԶ༭ﵽʧЧ⡣ + + ޶ָͼɺwg_drawgraphĬΪı⡣ + ޶gethttphttpú֧ѡȥWININET֧֣һΪѡΪʱúģʽӣ + 0ʾʹ΢Ŀ⣨һɿԷգԸߣ1ʹTCPֱģʽ: + gethttp(1,"https://www.baidu.com",6000,Value,Code); + ޶32λTCPֱGETHTTPҳѹᵼ³⡣ + ޶ۻں⡣ + =================================================================== + =====LINUX汾ƽ̨ԼͻDZͻˣ֧֣Э飬APIѾڲ==== + =================================================================== + +־--------2019-09-26 + һ΢СڴʹĴ + +־--------2019-09-16 + ºôİָ + ָ޴ָʼЧ⡣ + +־--------2019-09-15 + chmʹðļ󲿷ִӰ֧֡ + ָ޴ʹָ͵IJ⡣ + +־--------2019-08-23 + GetMsgDigestļ޷ʱԻ⡣ + +־--------2019-08-22 + UACãexcelܻ޷ȡȷû¼Ϣݡ + +־--------2019-08-16 + Եʱؽ뺯дϢҳ + +־--------2019-08-09 + ************************************************************************************ + ͻֶ֧ڵЭ飬人Ŧڵ㡣 + дϢ֧ں༭екű༭ + ************************************************************************************ + +־--------2019-08-02 + ArrayDMLдNilʹõһҲΪյ⡣ + +־--------2019-08-01 + binaryexecsql ARRAYDML⡣ + +־--------2019-07-31 + ޶any,allже⡣ + binaryexecsql ARRAYDML⡣ + ASCIIΪ1-31TOSTNתΪ\x01 \x1f + +־--------2019-07-30 + ޶ڴòBLOBͿܻתµݴ⡣ + +־--------2019-07-19 + ֧UTF8ַʽU""UTF8ַǣµķתҲ֧֣U%% %% + .PYļڿͻ˱༭ԶUTF8ʽǺĿǰPYTHONĬϱΪUTF8ʽ + PyError()PyRunʧܵݡdo pythonԶԶPYTHONĶջ + +־--------2019-07-15 + RSAԿʽԣԼWEBñencodeuricomponentdecodeuricomponentencodeuridecodeuri + +־--------2019-07-02 + MATLAB 2018B,2019A֧֡ + +־--------2019-06-28 + DeleteIndex,DeleteFieldַ±߷Ǻϲ±Чʵ + ༭ڿոسĴ + +־--------2019-06-25 + Rִֶ֧С + ::ûнβĴʾҪƽ̨޶ֹ֧֣Լbegin end + +־--------2019-06-24 + ༭%%﷨֧֡ + +־--------2019-06-21 + TSLPy35.pydpython37.dll + 32-bitformatfloatformatڸϴں64-bitһµ⡣ + +־--------2019-06-10 + תַ%%֧֡ + : + %%[ʶ]<س|س|tab|ո>ַԭʼ%%[ʶ] + %% \r\nABC%%ַ\r\nABC + %%JJC %%JJJ%%JJCַ%%JJJJJCDZʶ + %% + abcd%%ַabcd + %%__ + printf("%%smc")%%__ַprintf("%%smc"),__Ϊʶ + Ϣclassinfoclassinfo(1)õһ͡ + ⲿԵĵãinʾֻ룬outʾֻͳvarʾͳ + ʹñĬϽͬ뵹ⲿУTSLıСд޹أĶСдĿԴСдأnameؼ + a:=3; + c:=2; + do python in a name "A",out b,var c + %% + c=A*c + b=c*c + %%; + cΪ6,bΪ36 + ڲͬԶԣеԴڷֵе޷ֵġأPYTHONûзֵrзֵ + ִֻд룬ȶʡԡ + ijЩԣܻõģͨby﷨롣 + do extlanguage [paramlist] [by config] + ĿǰextlanguageѾ֧python,r,matlabܸԻᱻչ֧֣ײûҲͨӿڹ淶չ֧ԡ + µ%%תַ﷨ڵԻ㡣 + CTP + £ͻInternetIP,InternetPort,LoginTimeϢ + set + getnoneԻnoneͰintֵ + ifnone(v,i)жǷnoneλi + ±setʱnone͵ֵΪsetļҲǴ0,1,2,3....һsetĹִ̳setأֵΪ-1none,ݿʵ֡ + PythonTSLдݵ֧֡PythonĶTSLֱTSLһø÷ʱ֧[] + ݿteradatamongodbapiֱ֧֡ + ͻЭֽ֧֣֧Ϣƽ̨,CTPزϢ + ˶.py/.m/.r֧֡Ҫ֧š + SetSysParam,GetSysParamȺṩ˿ͻͷͬʵ߼R/PYTHONڷṩֱӵTSL֧֡ + ޶ֹnew ͬʱ⡣ + ޶case of⡣ + TSL.EXE -libpath + ֧֣tsl.confSystemLibpath趨ӵ··֧{$P}滻Ϊǰ·ʹҪTSL.EXE.tslдӦõĺ⡣ + tsl.conf + [system] + libpath={$P}funcext\ + ʹ.tslڵ·µfuncextΪȵfuncext· + +־--------2019-04-28 + ݣ20191¿ʼ޶˿Էʵ˽еproperty⣬еϳԡ + TSL.INI֧֣һ趨ѡΪ1κpropertyɱʣpublicprotected,privateĬΥDzġ + [Compatible] + PrivatePropertyAccess=1 + +־--------2019-04-25 + £SysBugCheck.exe /oдļβ⡣ + +־--------2019-04-24 + MagicSetArrayMagicGetArrayṩ֧֣ + MagicSetArray(A,1,2,3,4,99)ͬڶAA[1][2][3][4]:=99 + MagicSetArrayһдΪ + MagicSetArray(A,array(1,2,3,4),99)ҲͬģҲ˵ڶһ飬Ϊڵݾ±ꡣ + MagicGetArray(A,1,2,3,4)ͬڶA[1][2][3][4]Ļò + MagicGetArrayһдΪ + MagicGetArray(A,array(1,2,3,4))ҲͬģҲ˵ڶһ飬Ϊڵݾ±ꡣ + ޶MDIJһMDһڵMDݣݽΪnil֮ǰΪDzȷģܻ᷵زض֡ + ޶AnsiPosλǽֵһַ20188µ2019-04-18İ汾УAnsiPosĺPosͬȱ壬޶ԭĺ塣 + TS_ModuleInfoĺ֧TS_ModuleInfo()УԼTSLInterp.dllʱԼСϢ + ϵͳȨϢTS_ModuleInfo(1)ģļʱ䡣 + importjsonstringĺзбܵ޷⡣ + Debugreturn޷ݡ + Reindexܴڵں˴⡣ + #with"@AppServerId@"±ָҪķǷȺҲÿִ̨е֣ip:·ģʽҲExec64.exe.name趨֡ + ֳ20ַʱǰʮַЧ + ʹApiָҲʹ趨ִָ + ͻڷѡнгִҲ˽ض20ַ + ûҪ־⡣ + tsappservernameƽ̨õ֣ûãĬip:·ԭtsappserverʱֲ䣬ToDo:δܺTsAppServerNameĺ屣һ¡ + +־--------2019-4-1 + ֧COMʵout,in/out0ֵ⡣ + +־--------2019-3-27 + ֧COMʵout,in/out + +־--------2019-3-25 + ޶TSL.EXEʱ޷˳ + +־--------2019-3-18 + ޶importjsonstringexportjsonstring֧naninf,ӦĸתΪNaN,Infinity,-Infinityע⣺json淶֧naninf,ֻΪʹϵıݣתֺpythonļ,޷пȷתjson + ֧BinarytslexecsqlIJС + Integer,Int64͵תԻõַΪΨһֵ + SelectʱDataNextPrevһǷбڵIJ + +־--------2019-1-30 + ޶PropertyPrivateõ⡣ + ޶InheritdPrivateõ⡣ + Matlab 2018b֧֡ + +־--------2019-1-18 + ޶תΪû޷༭BUG + ޶ֻ³ԶɴڵBUG + +־--------2019-1-9 + ޶ִģԶģͺCTRL+Zͷᵼ±İťΪɫжڱΪɫ + +־--------2019-1-8 + ޶CTRL+Zͷᵼ±İťΪɫжڱΪɫ + ޶SQL﷨TSLֵ֧һС⡣ + +־--------2019-1-3 + ޶XLSXZIPʱ򣬿ܻᵼѭ޷⣬ӰimportfileԼxlsxдࡣ + ޶XLSXĶдChartͼ֧֡ + +־--------2018-12-17 + 汾Ӹưť + *****************************************************ݷ*********************************************************************** + ݵķϵͳѡpn_EmptyMode()趨¼ڵʱreportbaseȱʡΪ(˹Ҫƽ̨) + ϵͳȡֵΪ֣ + 0ȱʡֵΪ0 + 1ΪNil + 2ֶε趨,Ϊ0.0 + 3Ϊ̸ַ + 4ΪN/Aַ + 5ΪNAN + 6趨,ΪNAN + +־--------2018-12-14 + JDBCȱJAVAࡣ + +־--------2018-12-11 + ݿNUMERICͳ㾫ȵֻᵼ³⡣ + +־--------2018-12-6 + ޶32λ¸64λΪ$ĵһ⡣ + ޶ݿУһԶرӵ⡣ + +־--------2018-12-5 + ֧InheritedʹΪøͬͬʹinherited func(a,b,c)ģʽø෽֧֡ + ޶޸ĺƵ޷⡣ + +־--------2018-11-26 + TSJDBC.ZIPjdbc־ܡ + ޶tslogin.dll⡣ + ޶endexecute⡣ + +־--------2018-11-23 + ڳԱУֱpropertyҪself.Ҫƽ̨֧֡ + ֧selectopt(16384)ѡӰSQLREFOFԼƶۼORDER BYʱ(ҷgroup by)бREFOFƶۼΪΪ׼ԭʼ(Ҫƽ̨֧֡) + Adoģʽ޷⡣Ҫƽ̨֧֡ + ViewPointĩĴBUGҪƽ̨֧֡ + ϸڼϾʱεĴ⡣Ҫƽ̨֧֡ + ༭˫tabԹرյǰ + ༭ѡкҲٽ뵽ңѡеǶС + Shift+F3ǰҡ + 뵼ԻӺIJҹܣ֧ʽ + *******************************tsfTSL༭Ĺܳ***************************************************** + ӱtsftsl༭Ĺܡ + ************************************************************************************************************************** + +־--------2018-11-6 + 򿪱༭ʷĶʱٴ򿪡 + 򿪵ĺܶʱٹرա + +־--------2018-11-5 + £µXPݡ + +־--------2018-11-1 + ༭ӹر + ʱ֧Ҽĺ + +־--------2018-10-30 + £༭ĵ͵Լ뵼Ĭ·óһ£ұ沢仯 + +־--------2018-10-17 + £SQLԶIJѯɾµȲ + SQLԶIJѯɾµȲ֧֡ + +־--------2018-10-16 + *****************************·ƽ̨ڲ¹ܽе޶׼**************************** + cov,commaexprѡжǷ֧˫оۼʱкԼǷֶ֧űʽ + C++Ķűʽ֧֡(a:=1,b:=2,a+b)ĽΪ3 + []ʱ༶ֵΪ + ifnoneжǷΪNONEͣNONE͵ݱ[1]أsetterм伶 + objectstateж״̬ + TStringList[]֧±ַ±ꡣ + £TSL.EXE 64λΪ64MĬ϶ջ + +־--------2018-9-28 + sp_slopandinterceptδȷ⡣ + +־--------2018-9-21 + £༭趨ǷԶϴα༭ĺ + ༭½޷´򿪵бС + £******************************************************ͳ֧ǿ*********************************************************************************************** + ǿݲֿʱеͳƺ + ͳƹؼ֣sp_large,sp_small,sp_percentile,sp_percentrank,sp_quartile,sp_rank,sp_trimmean,sp_frequency,sp_geomean,sp_harmean,sp_median,sp_mode, + sp_product,sp_totalvariance,sp_norm,sp_skewness,sp_kurtosis,sp_skewness2,sp_kurtosis2 + ˫ͳƹؼ֣sp_cov,sp_correl,sp_slope,sp_intercept,sp_rsq,sp_steyx,sp_slopeandintercept + + TS-SQL˫ͳƾۼ + correlof,covof,slopeof,interceptof,rsqof,steyxof,slopeandinterceptof + + ײ˫ͳƺ + cov,correl,slope,intercept,rsq,steyx,slopeandintercept + *********************************************************************************************************************************************************************** + +־--------2018-9-19 + £༭İ汾DIFFӺ + ftxlsII.xls⡣ + +־--------2018-9-7 + ޶shl,shr,rol,rorú_shl,_shr,_rol,_rorһ߼޷λ㣬ֹ1L shl 63 shr 63޷Ϊ1Ľ + +־--------2018-9-6 + ޶л½ƽ̨ƽ̨IDΪһ¿ܻΪչϢı䶯¿ͻ쳣⡣ + ޶ͻĬϷѡʾϢܱڵ⡣ + ޶ļᵼ˳ʱ򱨴⡣ + +־--------2018-9-3 + ޶64λ¿ͻ˰汾DIFFڵ⡣ + +־--------2018-9-2 + ޶µEXCEL޷ִйƱеĺ + +־--------2018-8-31 + ޶ļ򱾵ļ𻵶ȱʧ⡣ + ӣTSLSQLInINͬеģʽжǷС + ӣΪʹõıԺͼԣͻ˱༭֧ʹCtrlֵڱ༭СԭеCtrl+ֽлҳIJ޶ΪALT+֡ + ӣеCtrl+ֵڱС + ޶FindClass޷Ҷĸ࣬౾ȫߵǰࡣ + +־--------2018-8-29 + ޶nil-ֵIJܲҪĽԤڵ⡣ + +־--------2018-8-26 + ޶TSJDBC.ZIPJDBC޷ض̹߳⡣ + +־--------2018-8-24 + ޶classinfo±⡣ + £ࡣ + +־--------2018-8-22 + ޶InternetrequestԼgethttpʹHTTPSʱ޷֤URL + +־--------2018-8-20 + ޶̾һĸ⡣ + +־--------2018-8-17 + ޶һЩͻĿͻ˻ֵĿһҳ޷ȷʾ + õļ̾飬ʧȥʱԶرգֹӰʹá + +־--------2018-8-16 + ޶޶ͻ⣬޶8-14⣺sorttablebyfieldغ⡣ + +־--------2018-8-15 + ޶޷IMPORT/EXPORTΪDBF͵⡣ + +־--------2018-8-14 + ͻͳһίִкִеѹʱıģʽ + ͻ֧widestring͵ʾ༭ȡ + ͻԻΪݽ˴ + TSL.EXE˳óһᵼTSL.EXEƽ̨ʧܵ⡣ + ˵SQLSERVER⣺ + װ汾ΪODBC DRIVER 17 FOR SQL SERVERܻTSL.EXE޷˳⣬°汾ָ֧ѽ汾ȼΪ͡ + ijЩϵͳ汾£ͻ˲RDO2ʽSQLSERVERܻᵼ޷ʵ + 飬Ϊϵͳļɵ⣬һ⣬볢ԸĿͻ˰װ·гԡ + ****************************************Ŀǰ󲿷UNICODE˽ڲ԰ƽ̨֧,Ժʽ沿********************************************************************** + Unicodeʵ + һļʣļ޷תΪMultiByteַֻUnicodeļſԷʡ + ʼ֮ģһЩַΪUTF8ͣ޷תMultiByteҪUnicode֧֡ + ݿֶΣһUnicode룬Ҳ޷뵽MultiByteʽҪUnicode֧֡ + ǶDLLⲿã֧UnicodeԸõؽӳ䡣 + Unicode֧֣ExecSQLΪWideStringʱĬʹWideStringSQLSelect֧SelectOpt8192ѡʹ÷ַΪUnicode + Com,OleĶһWideString֮÷صַʹWideString + Unicode֧֣ײַػ֧Unicode,ĿǰݲֿϵͳȲ֧֧֡Unicodeģʽһ෽ַҲΪַģһͣ󲿷ַַ෽WβķWideString + Unicode֧֣º + booltostrֿ֧ѡ"True" "False"Ŀǰĵв죬booltostr2 + booltostrw,booltostrw2 + ifwstringinttostrwinttohexwutf8tounicode,unicodetoutf8,multibytetounicodew,floattostrw,currtostrw,datetostrw,timetostrw,datetimetostrw,strw + encoderadixwstr,,decoderadixwstr,ununicodeescw,ununicodeesc2,ununicodeesc2w,IniReadsectionsW + ʽ֧UNICODEַ͡ + ʽƴְַ֧ģʽ + a: REG_DOTALL; + n: REG_NOSUB; + 8: REG_UTF8; + E: REG_NOTEMPTY; + u: REG_UNGREEDY; + U: REG_UCP + ͨlikeflag޸likeΪ + REG_DOTALL 0x0010 /* NOT defined by POSIX; maps to PCRE_DOTALL */ + REG_NOSUB 0x0020 /* Maps to PCRE_NO_AUTO_CAPTURE */ + REG_UTF8 0x0040 /* NOT defined by POSIX; maps to PCRE_UTF8 */ + REG_NOTEMPTY 0x0100 /* NOT defined by POSIX; maps to PCRE_NOTEMPTY */ + REG_UNGREEDY 0x0200 /* NOT defined by POSIX; maps to PCRE_UNGREEDY */10 + REG_UCP 0x0400 /* NOT defined by POSIX; maps to PCRE_UCP */ + ˵pcre + ********************************************************************************************************************************************************************************** +־--------2018-07-18 + ReadExcelSheetsxlsxļһַ + +־--------2018-07-12 + __line__ؼ֣õǰк + ͻ˵ĺ༭֧趨ȼûҲͨԻøֱ༭ȼܡ + Python 3.7ֿ֧⡣ + Ĭϵ뺯ĬΪȫ֧ͣ˵Ĺú޷û⡣ + ParseRegexpr֧滻ѡмrַɣ$1$2Ϊֵ֧꣬$99$` $'ƥߺұߵַ,$&$0Ϊƥ + source:="ddd2011a uuuu 2012b zzzz 2013c xxx"; + ParseRegExpr("(\\d+)(\\w+)",source,"r","$2$1",s ); + return s; //Ϊddda2011 uuuu b2012 zzzz c2013 xxx + һģʽΪصģʽ,صIJΪһ飬0Ϊƥ䴮֮ΪֵĴ + source:="ParseRegExpr 2011 ShenZhenTinysoft (TSL)"; + + ParseRegExpr("(\\d+).*(Tinysoft)",source,"r",function (a)begin return a[1]+a[0] + a[2]; end,s ); + return s; //ΪParseRegExpr 20112011 ShenZhenTinysoftTinysoft (TSL) + + Operator֧[],[][0]getter,[1]setter + ֧++,--أûأû++,--,+=,-= + ÷ + a:=new aa(); + echo a[1]; //ʾ2 + a[33]:=999;//ʾset->33->999 + return; + + type aa=class + public + function operator[](index); + begin + return array(1,2,3)[index]; + end; + function operator[1](index,v); + begin + echo "set->",index,"->",v,"\r\n"; + end; + end; + º + datetimetointernetstrw + datetimegmttohttpstrw + datetimegmttocookiestrw + concat֧unicode + ׼ںԼĸUNICODE֧;С + + +־--------2018-6-12 + TSL.EXE˳ǰͷԴֹijЩ޷˳ + ༭ѡԽ࣬ЧԽ͡ + +־--------2018-6-3 + ֧ļѡ֧.funļʽ + ༭CTRL+/жעͣCTRL+SHIFT+/ȡע͡ + +־--------2018-5-31 + ¼ϢʾΪѶϿ⡣ + ʱSQLSERVERļԡ + ֧Array DML֧ExecSQLIJΪ飬֧Oracle,SQLServer,MySQLݿ⡣ + ΪʵָЧOracleӣ + s:="insert into testtable values(:p1, to_date(:p2,'yyyy-mm-dd'), :p3)"; //ٶtesttableУһΪַڶΪڣΪ֣insertʹòp1,p2,p3 + //paramнp1,p2,p3ֵ鴫 + param:=array("p1":array("Direction":1, "Value":array("11","22","33","44","55")), + "p2":array("Direction":1, "Value":datetostr(array(today(),today()-1,today()-2,today()-3,today()-4))), + "p3":array("Direction":1, "Value":array(1,2,3,4,5))); + ret:=ExecSQL(param, OraDBAlias, s, result); + +־--------2018-5-23 + ͻ˰ȫ + ͻ˳ʱܡ + Echo #127;ͻECHOеݡ + +־--------2018-5-14 + Evalµһ⡣ + +־--------2018-5-11 + Insert intoһ÷BUG + +־--------2018-5-3 + APIģʽ£ExecSQL KeepNullʧЧ⡣ + +־--------2018-4-29 + ûͬʱ༭ͬһʱ򣬽ڰ汾ʾ(Ҫƽ̨֧) + ЧʵõlengthԼѭ&=Чʡ + ֤֧(ƽ̨򿪹)ͻȫ + +־--------2018-4-12 + InternetRequestÿֵܳڴй¶⡣ + +־--------2018-4-3 + ֧R2018aMATLAB + +־--------2018-3-29 + JDBC + +־--------2018-3-15 + ¼ʱϢ쳣ᵼ³ʼ޷ɡ + ׼ͬһûͬʱ޸ͬһ֧·ϣ˲ɣ + +־--------2018-2-6 + 1°汾JDBCӲϿ⡣ + +־--------2018-2-5 + SortArray,SortTableByFieldַ֧±(ƽ̨֧Ҫ) + +־--------2018-2-1 + ODBCԷȫ֧֡ + +־--------2018-1-12 + ODBC֧Rá + JDBCinvokeportַ֧ǽ޶õ⡣ + ݣJDBC֧1.6汾JAVAл + ¹ܲԷ֧֣ɺʽ汾и£ + Begin EndεĶϵ + ȫ⡣ + Ҳ˵֧array("A":1)+array("A":2,"B":3)õΪarray("A":3,"B":3) + ע⣺Ķnilн֧ţ1+nilֲǰļ + ʽڿ纯дòͱ + +־--------2017-11-28 + Matlabְ֧MATLAB淵ַ޷ȷ⣬2012A-2017Bְ֧汾ļ32λ֧2015BԺİ汾 + ODBC֧Python°汾ODBC + +־--------2017-11-17 + ReplaceText,ReplaceStrغܵڶΪմʱΪմ + +־--------2017-11-13 + ָͼ޷ʾλС⡣ + +־--------2017-11-3 + ༭Զʱֹתλô⡣ + +־--------2017-10-30 + ODBCڶ̵߳ijʼʱ쳣 + +־--------2017-10-25 + ӺԼԪıЧԼ󽵵ڴռ + նTSLűͿ֧֣Ҫƽ̨֧֣ + ֧ ::ǰ׺ھֲȫֺ/Ԫͻʱõȫֺ/Ԫ(ƽ̨) + +־--------2017-10-18 + £jsonԴ޷תINT64 + ֧refmaxof,refminofۼλСļ¼(ƽ̨֧) + ʹ÷ + a:=array((1,2),(4,3),(2,5)); + return select maxof([0]),refmaxof([1]) from a end; //ֵе[1]ֵ + //ؽΪarray(("Expr1":4.0,"Expr2":3)) + 64λ汾Matlab 2017b֧֣Ҫû뽫matlab.dll.2017bΪmatlab.dll + +־--------2017-10-11 + £ּ֧ܺĺͷ޸Ϊơ + +־--------2017-9-29 + £Evalreturn + +־--------2017-9-28 + £TSJDBC.zipںJava߰ʹ˵ + +־--------2017-9-22 + mt_decompose_qr⡣ + +־--------2017-9-12 + ==========================JAVA=========================== + TSLֶ֧Javaֱӵá + =========ãPlugin\Filemgr.ini======= + [Java Config] + Enabled=1 + Version=65544 + option1=-Djava.class.path=C:\temp\ + option2=-Djava.home=C:\Program Files\Java\jdk1.8.0_45 + =================˵================ + Enabled=1JAVA + VersionJavaͰ汾0x10008ʾ1.810Ϊ65544Ϊ1.4Ϊ65540 + JavaʱһЩһЩҪIJУJava·Լjavahome + Щoption1..n + JavaԷƽ̨֧֣аȫɳ䣬ȫɻ߶ָû + ȫɷʽ£ + [Java Config] + EnginePermit=1 + ûɷʽ£User1,User2ʹJava棺 + [Java Config] + EnginePermitUser=User1;User2 + ============Javaĵ˵================ + tjobjectJava,tjclassJavaࣩ,tjdescriptor(Java),һtjdescriptorҪʹ + + ==========tjclassʹ÷============= + systemClass:=new TJClass("java/lang/System"); + properties:=systemClass.getProperties(); + systemClass.out.println(properties.getProperty("java.class.path")); + + ==========tjobjectʹ÷============== + //StringBuffer + sbObj:=new TJObject("java/lang/StringBuffer", "hello world"); + //öinsert + ret:=sbObj.insert(6, ""); + //toString + str:=sbObj.toString(); + //ʾhello world + echo str, "\r\n"; + ============ת˵================== + ͣTSLJava֮ʽתTSL֧ʽת + JavaEncodeԼJavaDecodeʵֵ + ==============JavaEncode JavaDecode================== + //char[]죬UnicodeַJavaEncodeUnicodechar + charArr:=JavaEncode("chararray", "Tinysoft"); + strObj:=new TJObject("java/lang/String", charArr); + SystemClass.out.println(strObj.toString()); + + //ַ + strObj:=new TJObject("java/lang/String", "Ƽ"); + //õbyte飬ϵͳĬַ + byteArray:=strObj.getBytes(); + //byteתΪַ + str:=JavaDecode("String", byteArray); + echo str,"\r\n"; + ======================================================== + JavaEncodeֵ֧ʽתУ + "CharArray", "ByteArray", "CurrentClass" + JavaDecodeֵ֧ʽ + "String","WString" + ھѾʽתԶ֧֣array(1.0,2.0)ӳ䵽float[] + Ҫʽתͽ󽫻ݾ + ========================================================= + +־--------2017-9-4 + ݿֶbyte͵ӳ⡣ + +־--------2017-9-3 + ֶ֧ķָ롣 + WEBIJ⡣ + SQLCloseConn([DBAlias:String]):Integer;ڹرݿӡ + +־--------2017-8-18 + ORACLEBCDOVERFLOW⡣ + +־--------2017-7-27 + £txlsreadwriteԼtxlssheetࡣ + Ϊ֧ɫתrgbbgrRGBBGRɫ淶ת + +־--------2017-7-26 + £еͼεʱ³Ӧ⣨ͼƣϵͳ޸ġ + £ں˸¡ + £txlsreadwriteԼtxlssheetࡣ + +־--------2017-7-20 + £༭ϵͳ֧Զɡ + £༭ֱӴϵͳԱȷ֪ + +־--------2017-7-19 + £༭֧propertyת + £Ϊ˸õʵֱ༭Զ֧{$dependency class1,class2}﷨ʹÿԶصԶɡ + £Ϊ˸õʵֱ༭Զ֧property aaaaa(a,b)Ķ巽ʹôڶϸɶԶɸݡ + £ͻڲݵʱ򣬽ĬϲEXCELֹEXCELɿɵ⡣ + £༭ֶ֧ҺתֻҪĶʵֶԭ͡ + EXCELĶд࣬txlsreadwriteԼtxlssheetֱ࣬ñ༭鿴ԭ͵õ + +־--------2017-7-13 + £64λMatlab 2017aֿ֧⡣ + £Ϊ˷ֹʾЧʵͣȡʾݵǷԱжϣĬΪ飬޺ʵĹƱID + £ΪĴ룬ʾбЧʴ + ڵĺα༭ʱʱԶΪĶԻ⡣ + +־--------2017-6-14 + £ͻ˱溯⡣ + ======================иҪЧ=================================== + GBKַĵת⡣ + صֵĸ¡ + : ->,for step㾫ȵ⣬RoundTo,SimpleRoundTo,SetPrecisionľ⣬SetPrecision֧顣 + +־--------2017-6-12 + £༭ѡдͬɫѡд𣬲ҿں༭˵رյܼ־֢ѡ + ǿ֧֡ΪWINDOWS濪Ŀṩõ֧֡ + SHL,SHR,ROL,RORĸλӦΪƣƣѭλƣѭλơ + +־--------2017-5-19 + ½ʽܵ±⡣ + £ײ뽵Դռá + +־--------2017-5-16 + £COMͨѶʱERRORݴݵ + COMģʽ£ֱӵEXCELܲXLSļERRORݣԭеTSLûӳ䣬£ + ERRORCOMתΪTSLͣתΪNANſʹcverrgetNANãcverrgetĽӦʹõ32λҲҪ .& 0xFFFFFFFFΪֵ޷ȷġ + TSLתΪCOMͣṩcverrתΪŵNANݣ磬cverr(0x800A07D7)ӦEXCELijcverr(0x800A07FA)ӦNA + cverr(0x800A07ED)ӦNAME,cverr(0x800A07D0)Ӧգcverr(0x800A07F4)Ӧݣcverr(0x800A07E7)Ӧãcverr(0x800A07DF)Ӧֵ + ЩEXCELġ + ʹEXCELSETCELLEXCELSETCELLSʱϵͳԶתNANINFӦĴNANCVERRתɵӳERRORݡ + function cverr(v:int64):double; //صֵΪNANں + function cverrget(v:double):int64; + + +־--------2017-5-15 + ͷͨѶܵ¾ӵ⡣ + +־--------2017-5-10 + ܺBUG󽫳ļܺ±༭档 + +־--------2017-5-9 + £༭ѡִͬᱻʾ˹һʾͬı + £caseʽ֧֣ + a:=3; + b:=case a of + 1,2:"1/2"; + 3,4:"3/4"; + else + "OTHER"; + end; + echo b; + ע⣺ԭCASE﷨վֻ֧֣Ҫʽãֻʹµ﷨CASEΡ + +־--------2017-4-26 + £ȫЩ޷ƴҵ⡣ + +־--------2017-4-18 + Python3.6֧֡ + +־--------2017-4-12 + ʹAPIģʽݿʱֶβΪգĬִֵ⡣ + ҪʹAPIģʽҪĬֵֶΪա + +־--------2017-4-11 + ½߹̵ʱ+s1+⡣ + +־--------2017-4-10 + ݿAPIģʽ̲ģʽַʹڲƥĴ + еƳ֤ȯƳ⡣ + +־--------2017-4-5 + £ͻ˴ԶɵʱPageup/PageDown/Home/Endʱ򣬽ֱڱ༭⣬Զ״̬޷༭Ҳһ + +־--------2017-3-31 + ͻ˴TSLԶɵʱ򣬵һЩϷַܻᵼڴ治⡣ + +־--------2017-3-25 + £APIģʽݿģ + +־--------2017-3-24 + £Һʾû + £ImportFileEXCELļԶʶ.xls.xlsxļʽļչж°汾ϰ汾ʽ + ijʹõ¿ܻշ⡣ + +־--------2017-3-22 + ijշBUG + +־--------2017-3-21 + ༭ʱδຯ޷ʾ⡣ + £µ԰ļJAVA߼/JDBCʹ˵Լ֤ɼܱԼѹѹȺ + +־--------2017-3-20 + COMעᰴťʧЧ⡣ + +־--------2017-3-17 + £XP֧֡ + +־--------2017-3-16 + £ȫЩ޷ƴҵ⡣ + £ٶȣֹ֤ȯʱЧʺ⡣ծȯԭĿǰгʮ֤ȯ룩 + £ĹĺЧʣЧʴԼһ + +־--------2017-3-15 + Ӻ༭ƵijЩ༭г⡣ + SMTP,POP3LastCmdResultԲȷ⡣ + : VC߼20102015ͻ԰װVC2015аͻԶ¶̬⡣ + ֱⲿDLL64λµijЩܻϵBug + ⲿDLL֧byte,short͡ + һЩܴڵں⡣ + =========================================༭ش=================================================== + £༭ԶʾĹܣԶʾõԪࡢıʶԶʾ + £Ҽ֧Ӻתֵ֧Ԫ෽ת + ========================================================================================================== + =========================================APIش====================================================== + £ODBCøö̵߳ܡ + : JDBC֧WindowsLinuxµJavaƽ̨ĵãͨJDBC-ODBCŽӡ + JDBCԼĵTSJDBC.ZIP + ========================================================================================================== + =========================ش=======ȴTSDNذĵ========================== + ṩ֤ɱ׼ + ṩܽܣѹѹ⡣ + ========================================================================================================== + =========================================ģͼҪ================================================= + °汾ķ£°汾ͻ֧ģ͵Ŀټܡ + ڿټģʽ£Чʱģʽ켸 + ԭģʽ֧֣ûѡģʽܣ¼ģʽֻ°汾֧֡ + ܵǿԭģʽһ£ģʽRSAΪRSA/AESģʽ˽ԿԿģʽ + ñܵ256λAESԿɣ˼ܵԼԣͬʱõͬļǿȡ + ========================================================================================================== +־--------2016-12-23 + £Żͻ˱ʾϷš + +־--------2016-12-19 + ͻ뺯ӶûڿͻUserFunc4.0.Funcļĵ֧֡ + ͻĬϻڵ¼˳ʱ򱣴һΪǰ׺UserFunc4.0.Func汾ļΪͻռ⣬ûϵͳ˵йرոùܡ + +־--------2016-12-16 + InputDialog޷ʹõ⡣ + ijЩϵͳ£Excel봰ڻ޷ʹõ⡣ + £°ĵ + TSExpert_ClientConfigİڿͻ˴Զģͣͻ˵CHARTͼɫеȵȵķ + صȰ + +־--------2016-12-13 + ǿODBCԡ + +־--------2016-12-8 + 64λMATLAB R2016Bֿ֧⡣ + +־--------2016-11-23 + DLL;̬ݵַռ䳬4GReplaceText쳣BUG + +־--------2016-11-18 + ʱоۼSelectOpt(64)µһBUG + £תָ֧ڷΧ + +־--------2016-11-17 + FilterIn/FilterNotInһ쳣BUG + +־--------2016-10-24 + £༭Զ͵ĴڹС⡣ + £ں֧CreateObjectĵһΪ֧ͣnew classname(ParamList...)Ĵ࣬Աڱ༭пǿԶɵ֧֧֡֡ƽ̨ + ޶ں˵ص⡣ƽ̨ + +־--------2016-10-14 + £༭˫Ὣ.ȷڵһѡе⡣ + £APIݿִде&Żᶪʧ⡣ + +־--------2016-10-12 + £TS-SQL insertoracleµnumber͵ľȶʧ⡣ + +־--------2016-9-25 + £ܵ¼ȺͿͻ˶̵߳¼һ⣬ʱÿͻ˶̵߳¼ͻӷʱڰȴ + +־--------2016-9-20 + и֧֡ + £֧a:=function(i1,i2)begin return i1+i2;end;;֧##a(1,2)call(a,1,2)ĺָõд + £֧أΪOperator <(b[,isLeft]) д,ֻһֻ֧ ʵ<1ģʽҲǶӦߣ ˫IsLeft֧ 1<ʵisLeftΪֵ㣬Ϊֵ㡣 + £ͻ֧ǰѵȹܣ֧޷½ + +־--------2016-8-8 + £ڿͻ˿ʵĸʱ䡣(ùҪ汾֧) + £ֹΪͬжɵijЩݲͬ⡣ϵİԼˢΪʵʱ䡣 + +־--------2016-8-4 + :ǿODBCԣǿEXCELODBCԡ + +־--------2016-8-3 + :ǿODBCԡ + :TSSVRAPI֧TSL_DoScriptFromFile,TSL_SetEchoProc,TSL_SetDisableCacheº֧WebSocketServerWeb׼ + +־--------2016-7-29 + :ǿODBCԣ֧°汾MATLABODBCֱģʽ + +־--------2016-7-28 + :ansiformatformatΪռλ2λãformatռһλá + +־--------2016-7-27 + :ODBC DriverRֵ֧ļ⡣ + +־--------2016-7-22 + :ODBC DriverSASֵ֧ļ⡣ + :MRowsܣif a[field] Чʡ + +־--------2016-7-8 + :Release汾ODBC Driver⡣ + +־--------2016-7-7 + :HttpGetQueryValueByNameEx(Name:String):Array; + ҳļһϴܻöͬݵضάṹУ0Ϊ1ΪHttpGetQueryValueByNameAdditionalInfo + +־--------2016-6-29 + תΪCOM͵ʱԤ֪⡣ + :TSSVRAPIûغTSL_GetCurrentUser,TSL_CheckSysRight,TSL_FileSandBox + +־--------2016-6-23 + :ͻ˵¼ӵʱٶʹòӰ졣Ӳϵ°Ӧ + :ȡ溯ʱµĹܣҪֶˢ¡ + :importjsonstringԼexportjsonstringʵִjsonתΪTSLڲݽṹԼTSLṹתΪjsonĹܡ + function importjsonstring(json:String):anytype; //jsonתΪTSLݽṹ + function exportjsonstring(data:anytype):String; //json + ע:Ҫڷƽ̨ƽ̨º֧֡ + +־--------2016-6-12 + :ƽ̨odbc,RTDڿͻ˵İװ/ע֧֡ͻ˵ϵͳá + :all,anyall(a)all(a,0)жеԪΪ,all(a,1)ΪжееԪΪ,all(a,2)жееԪΪ档anyΪΪ + :uc,sucsuc #Reserved NʱN + :MD֧ʱֶΪ(ֲֳָ֧֡ɷֵ) + +־--------2016-6-7 + :ƽ̨odbc + :ƽ̨rtdServer for excel֧֡ + :tssvrapi.dll汾 + :ն˱ͬһ·жεBUG + :TSL.EXE֧ tsl -eval "echo 100"ģʽֱӵTSL䡣 + + +־--------2016-5-17 + :ijЩᵼڴBUG + +־--------2016-5-9 + :XML֧źµĴ + +־--------2016-4-23 + :SQL[@Field]Իֶε͡ + :Ʊʱʾܡ + +־--------2016-4-20 + :Execsqlֶֻ֧Ϣ + ExecSQL([Flags:Integer;][Params:Array;]DataBaseName,SQL:String;Var Result[;UserName,Password:String][;DataKeepNull:Boolean]):Integer; + һΪֵʱ򣬱FlagsĬΪ0ResultصǽΪ1ֶνṹϢΪ2Result[0]ؽResult[1]ֶνṹϢ + + +־--------2016-4-18 + £ʹTSSVRAPIδsetserviceʱܻδָ¶̵߳޷ִе + :function encoderadixstr(s:string;presuff:string;radix:integer):string; + function decoderadixstr(s:string;presufflen:integer;radix:integer):string; + ˵ + s:ַ + presuff:ǰ׺ߺ׺ + presufflen:ǰ׺ߺ׺ȡ + radix:λ(31λ)Ϊ1ʱ򣬱Ϊ׺ʽΪǰ׺ģʽ30λΪ1Сдĸ + 6λΪƣ֧36ơ + encoderadixstr("123","0x",16)Ϊ"0x310x320x33" ǰ׺ + encoderadixstr("123","h",0x80000000+16)Ϊ"31h32h33h" ׺ + decoderadixstr("0x310x320x33",2,16)ĽΪ123 + encoderadixstr("123","h",0x80000000+16)Ϊ"31h32h33h" + decoderadixstr("31h32h33h",1,0x80000000+16)Ϊ"123" + encoderadixstr("","0x",16)Ϊ"0xCC0xEC0xC80xED" Ĭϴд + encoderadixstr("","0x",0x40000000+16)Ϊ"0xcc0xec0xc80xed" Сдĸ + £SQLErrorMsgÿε֮ǰԭдϢ(ԭģʽΪϢ)ÿε֮ǷΪַжǷSQLʧܡ + עSelect from SQLTable᷵ݣ;ݿⷢᵼ²ݵķء + ⣬TS-SQLUpdate DeleteݿɾпֳܷɹʹSQLErrorMsgжǷ;ʧܵ⡣ + Ϊ˷ֹIJֳɹ⣬ҪSQLBeginTransܡ + +־--------2016-4-12 + £µĺ⡣ + +־--------2016-3-30 + matlab R2016a64λ֧֡ + +־--------2016-3-17 + ԰ļ + +־--------2016-3-15 + 0ڲ޸ĺĽΪNAN + +־--------2016-3-2 + £鶩ĵĸ¡ + +־--------2016-2-24 + ޶ͻ޷SendRunningDataĴݡ + ޶ܴڿͻ˵ijʼѡڵBUG + +־--------2016-2-5 + ޶SQLƶһΪʹõ±BUG + ޶һڴʹü64λµļΪµBUGʾڴʹó + £ȵжжڵֵ00.0ȡFilterInʱ򸡵int޷ȵ⡣ + £APITSL_AnyAddRefǶ׶ʹá + £ExcelSetCellĸ⡣ + ***************************************************************************** + ֧鶩ģͨTSLԼAPIеá˵ĵ׼С + ***************************************************************************** + ףû´֣ڽ߷ṩӰӵܶڲзһߵͬ¾ + +־--------2016-1-22 + £ǿ˶Apache2.4İ汾(Apache2.4ĵаδѭĵBUG) + £Ϊ˷ֹõļ⣬pcre.dllΪtslpcre.dll + +־--------2016-1-19 + £APITS_GetLoginedUser,TS_GetRemoteAddress,TS_GetRemotePort + +־--------2016-1-14 + £EXECSQLַ֧SQL͵ADOODBCӿڵֹSQLı׼ΪǷַ磬֧TSLԼODBC() + 첽õC++ API޷SendRunningDataݡ + +־--------2016-1-11 + + ͻ֧(ʹloginServerDefautConnectAndLogin¼ɵõϢ) + function logineduser():String; //õ¼û + function remoteaddress():String; //õ¼Զ̵ַ + function remoteport():Integer; //õ¼Զ̶˿ + + Python֧֣ + LoginedUser + RemoteAddress + RemotePort + + R֧ + tslLoginedUser + tslRemoteAddress + tslRemotePort + + £TSL/API֧֡ҪC++гԱ롣 + TSLݽṹñTSL룬ԶTSL룬첽ԶTSL룬ùC++չTSLƺC++չTSL + + +־--------2016-1-8 + £matlab 2015b 32/64λֿ֧⡣ + +־--------2016-1-3 + £API + +־--------2015-12-22 + ֹصһת쳣 + ֶַ֧IP¼ͻܴڻ + +־--------2015-12-17 + 32λ־¼ڴ + +־--------2015-12-15 + ෽޲paramsֿܲ⡣ + int64λԼ$֧⡣ + ǿTSSVRAPIǿ + ǿfilterinfilternotinֶ֧βΪ飬ضĶֶΪ˲ѯ + a:=array(); + for i:=0 to 15 do begin a[i]["a"]:=i; a[i]["b"]:=i div 2; a[i]["c"]:=i*2; end; + return echo tostn(filterin(a,array(("a":2,"b":1),("a":3,"b":1)),array("a","b"))); + aԼb, aֵΪ2bֵΪ1ԼaֵΪ3bֵΪ1С + +־--------2015-12-11 + ǿͻ˵ĵ¼Զѯֵ֧IPͶ˿ڡֹijӪ·Ϳͻ֮ӷϡ + FileSize޷ֻļ⡣ + ӣ˶API֧ţΪBLPCallҪװAPI + plugin\FileMgr.ini + [BLP Config] + Enabled=1 + ˵ + function blpcall(SessionOptions:array;ServiceUrl:String;Request:String;RequestData:Array[;CallBackFuncName:String])[:Array]; + ˵ + SessionOptions:ַ±飬±ֵ£ + "maxEvent":¼п¼ԶսᣬҪ¼Ľǵȴһ¼ + "serverHost":ַ + "serverPort":˿ + "connectTimeout":ӳʱĺ + ±Ϊ + defaultServices,defaultSubscriptionService,defaultTopicPrefix,allowMultipleCorrelatorsPerMsg,clientMode + maxPendingRequests",autoRestartOnDisconnection,authenticationOptions,numStartAttempts,maxEventQueueSize,slowConsumerWarningHiWaterMark + slowConsumerWarningLoWaterMark,defaultKeepAliveInactivityTime,defaultKeepAliveResponseTimeout,keepAliveEnabled,recordSubscriptionDataReceiveTimes + ѡľ庬BLPֲĵ + ServiceUrl:URL,һ//blp/ͷ庬BLPֲĵ + Request:֣"subscription"ָģ뿴ִ֧requestࡣ + RequestData:ݲ + ڶΪһάлеַ飬 + УһΪsubscriptionĴ,ڶΪfieldsֶδ,Ϊoptionsѡʡԡ庬BLP˵ + ͣӦΪһάе飬һΪַ뵽requestelementڶΪͣ뵽elementֵ + CallBackFuncName:ѡΪַָĻصĿǰ֧ͬģʽҲ˵BLPCallִйнлص + صһΪBLPEventEventѾתΪTSLṹ + صԼȴһ¼ + ֵлص޷ֵ򷵻һյEvent顣 + + + Է + //ָ֧¼۸ + a:=array(); + a[0]:=array("FSSTI Index", "LAST_PRICE"); + a[1]:=array("DAX Index", "LAST_PRICE"); + blpcall(array("maxEvent":300),"//blp/mktdata","subscription",a,"hello"); + + function hello(b); + begin + echo "-----------------------------------\r\n"; + if b["type"]=8 and b["msgs"][0,"id"]="FSSTI Index" then + c[0,1]:=b["msgs"][0,"value"]["LAST_PRICE"]; + else if b["type"]=8 and b["msgs"][0,"id"]="DAX Index" then + c[1,1]:=b["msgs"][0,"value"]["LAST_PRICE"]; + echo tostn(c),"\r\n"; + return 1; //return false˳,һֱ棬͵ȵյϵͳ¼¼ﵽmaxEventĹ涨 + end; + + ԣµں˴ʹתٶȱԭһͻ˲С + Ԥ棺׼TSLӵAPIᷢС + +־--------2015-10-2 + ޶ؽ(web)һ⡣ + +־--------2015-9-29 + ޶reindex²ɿ⡣ + +־--------2015-9-28 + format%d %u %x ֧ʹø%g %e %f %n %m֧ʹͲƥ׵´ + ͻ˵¼󽫻 û\UserFunc4.0.funcƵһĿ¼ֶ֧R,PythonAPITSLû + ޶޶ʼļĸļ⡣ + +־--------2015-9-24 + Import csvļʱ򣬲һֶεijֵ޷תΪֵֶ֮Ϊַ⣬ԶʶǸ㣬ȫĬΪ㡣 + ⣬"12345"ֵCSVн㶨ʶΪַ + #DIV/0!ԼNANʶΪNAN,INF,-INFʶΪINFԼ-INF,NILʶΪNILҪر𲻱ʶҪ""ʶΪַ + ***************************************************************************************************************** + ڴ˴ıԭCSVΪԭпҪǷ˴ڳͻԡ + ***************************************************************************************************************** + +־--------2015-9-21 + Python3.5֧֡ʹPython3.5뽫TSLPy35.pydƳΪTSLPy3.pydTSLPy34.pydΪTSLPy3.pydʹ3.4汾 + +־--------2015-9-18 + PythonPythonֹRֱֹ֧⡣ + £ԶRĶ̵֧֣߳PythonREnsureԼRRelease + RRelease():Boolean; + R̵ֵֻ֧߳ãRĵTSLԶϣֶͷҪRRelease̲߳ſԻRԴ + ûһֱRRelease,ڸģȫִϺԶͷš + REnsure():Boolean; + úRԴREvalRPutVar,RGetVarûһ˵Ҫøú + ˸¶RڱطеĿͻЧûҪµִз򣬷ûֶRRelease + +־--------2015-9-17 + £ӵPythonº֧֣RGetVar,RPutVar,MGetVar,MPutVar + PyPutVar(VarName:String;VarValue:Any):Integer; + PyGetVar(VarName:String):Any; + + a:=rand(10,10); + pyputvar("a",a); + pyrun("print(a)"); + return echo tostn(pygetvar("a")-a); + +־--------2015-9-15 + £ԶTSLPY3.PYDTSLPy3.pyd,TSLPY2.PYDTSLPy2.pyd + +־--------2015-9-14 + £PythonԶ̬ĴСдУֶTSLPY3.PYDTSLPY2.PYDΪTSLPy3.pydԼTSLPy2.pyd + +־--------2015-9-13 + ************************************************************************************************* + ǹPythonTSL໥õش£ϸĵ׼УעTSDNĸ¡ + ǿ=======================================PythonCallTSL======================================= + Pythonģ飬һTSLPy3.pyd֧python3.4,һTSLPy2.pyd֧python 2.7 + ע64λ32λ汾Ҫpythonİ汾Ӧ + £ + Զ̵֧ + RemoteExecute(ExecString:String;SysParam:dict):Tuple(ErrNo,Result,ErrMsg) + RemoteCallFunc(Func:String;Args:list|tuple;SysParam:dict):Tuple(ErrNo,Result,ErrMsg) + ص֧ + LocalExecute(ExecString:String):tuple(ErrNo,Result,ErrMsg,ErrLineNo) + LocalCallFunc(Func:String;Args:list|tuple):Tuple(ErrNo,Result,ErrMsg,ErrLineNo) + SetSysParam(Name:String;Value:Any) + GetSysParam(Name:String):Any + ֤Լ¼ + ConnectServer(Addr:String;port:Integer[;list|tuple(proxyaddr,proxyport[,proxyuser,proxypass])]) Ϊ0ʾӳɹ + LoginServer(User:String;Pass:String):Tuple(ErrNo,ErrMsg) + Disconnect():NONE + Logined():Boolean; + SetService(Service:String) + SetComputeBitsOption(Option:Integer) + GetComputeBitsOption():Integer + GetService():String + DefaultConnectAndLogin(Alias:String):tuple(ErrNo,ErrMsg) //οTSLеDefaultConnectAndLoginԽûԼplugin/tslclient.ini + ת + EncodeDate(Y,M,D):double + EncodeTime(h,m,s,ss):double + EncodeDateTime(Y,M,D,h,m,s,ss):double + DecodeDate(date):Tuple(Y,M,D) + DecodeTime(time):Tuple(h,m,s,ss) + DecodeDateTime(datetime):Tuple(Y,M,D,h,m,s,ss) + =======================================PythonCallTSL======================================= + =======================================TSLCallPython======================================= + ã + Plugin\FileMgr.iniͻ˻TSL.EXEݣעPython\dllsӦϵͳ·С + [Python Config] + Enabled=1 + version=3 + 汾Ϊ2.7version=2 + + Ҫ֧Python,[Python Config]ʹô£ + EnginePermit=1 ûȨ޵Python + EnginePermitUser=User1;User2 User1User2ûȨ޵Python + + + ֧֣ + PyRun(PythonCode:String[;flag:Integer]):Integer; + PythonĴ룬flagĬϲָúPyCompileFlagsָϵ״̬UTF-8Դ⡣οPythonֲᡣ + + PyCall([callFlag:Integer;]ModuleName:String;FuncName:String;Param1..ParamN):Any; + callFlagһλ״̬ + 1:ֱӷؽҲModuleNameFuncName״̬1򷵻ֵΪһ,0ĿΪbooleanͱǷóɹ1Ϊַ + 2:Ƿһһ롣״̬2IJԲķʽһ롣 + callFlagĬֵΪ1Ĭֱӷؽһ롣 + ӣ + PyRun("import TSLPy3"); + + PyCall("TSLPy3","LocalCallFunc","IntToStr",array(1111)) + ans= + array(0,"1111","",0) + + PyCall(0,"TSLPy3","LocalCallFunc","IntToStr",array(1111)) + ans= + array(1, + (0,"1111","",0)) + + PyCall(3,"TSLPy3","LocalCallFunc",array("IntToStr",array(1111))) + ans= + array(0,"1111","",0) + + PyCall(2,"TSLPy3","LocalCallFunc",array("IntToStr",array(1111))) + ans= + array(1, + (0,"1111","",0)) + TSLеPythonķTSLPy3.LocalCallFuncֵTSLIntToStrӻ߼IntToStrIJΪʲô鴫ԼؽһǰߵPythonTSL˵ҵ + + PyRelease():Boolean; + Pythonֻ֧α̵߳ãˣʹPyRunPyCallPythonʱ򣬻ԶPythonԴϣֶͷҪPyRelease̲߳ſԻPythonԴ + ûһֱPyRelease,ڸģȫִϺԶͷš + PyEnsure():Boolean; + úPythonԴPyRunPyCallûһ˵Ҫøú + =======================================TSLCallPython======================================= + ******************************************************************************************* + ǿR֧RļڴTSLʱͣ + tslEncodeDate(Y,M,D):double + tslEncodeTime(h,m,s,ss):double + tslEncodeDateTime(Y,M,D,h,m,s,ss):double + tslDecodeDate(date):list(Y,M,D) + tslDecodeTime(time):list(h,m,s,ss) + tslDecodeDateTime(datetime):list(Y,M,D,h,m,s,ss) + + +־--------2015-9-10 + TSLR֧еСȱݡ + ûΪ޷ѡȷĿ¼ + бʱᶪʧһЩͻ˴ȱĴ롣 + Ԥ棺Pythonֽ֧սPythonпRһֱӵTSL룬TSLҲֱӵPython + +־--------2015-9-1 + ǿƽ̨ǿȵ֧֣ΪǿҪûṩ̨ĸӶĸСдֵȵȣ + ǿ԰(cy_halfs())ṩ֧֣Ҫתַformatdatetimedatetimetostrdatetimetostr롣ͻѾ֧ʱתֺ֧룬עⷵؾȡ + ӣMatlab 2014b,2015aֿ֧⡣ + +־--------2015-8-20 + ޶ַʱַг|ᵼ쳣 + +־--------2015-8-14 + ޶select * from thisgroup⡣زЧ + +־--------2015-8-11 + ޶tslȫֶõ±⣬ݽȫֶ + +־--------2015-8-10 + ǿDeleteOptؼ֣֧鴦㴦鵱HASHԼ㴦ϡ + + a:=array((1),(0.1),(0.2),(0.6),(0.2)); + delete deleteopt(1) from a where [0]>0.5; + Ϊarray(1:(0.1),2:(0.2),4:(0.2)); + deleteoptĽΪarray((0.1),(0.2),(0.2))ԭ±д + ע⣺deletedeleteopt(1)ܵľ⿼ǣ±ϡĴһϵõϣĽ + ϡɾ±ܻᵼ⡣ + +־--------2015-7-28 + ʼᵼʼȷ⡣ + +־--------2015-7-3 + ǿնCOMI64Transԡ + 0 תΪ64λĬֵ + 1 תΪ32λܻ + 2 תΪ˫ȸܻᶪʧȡ + ǿΪĿǰѾתΪ64λijЩCOMǰ˲֧64λMatlab2009ȡûøתΪ + +־--------2015-7-2 + ޶ʽѾֵBUG + ǿͻˡ->ڡѾڹп˻Ϣ + +־--------2015-6-30 + ޶select 1 from array() end᷵һ¼⡣ + ǿͻӶԼڵϢʾ汾ֲ֧ã + ǿͻڵʾ汾ֲ֧ã + +־--------2015-6-18 + ޶ʼ󸽼ļʱļмһĿո⡣ + +־--------2015-6-15 + ǿCOMתINT64֧⡣ + +־--------2015-2-12 + ǿںṩȨؿٵļ㷽 + +־--------2015-2-2 + ǿAPIӷʽORACLEеַGBKصij⡣ + +־--------2015-2-2 + ǿAPIӷʽ֧oracle̵sys_refcursorΪء + ٶoracle£ + create or replace procedure testproc(b out sys_refcursor,c out sys_refcursor) is + begin + open b for + select * from TESTTABLE; + open c for + select * from TESTTABLE; + end testproc; + ʹ´ + a:=array( + "b":("Direction":2,"Type":22), + "c":("Direction":2,"Type":22) + ); + execsql(a,"ora2","TESTPROC",r); + + עADOģʽ޷ִ֧ͷز + + +־--------2015-1-29 + ǿinttostrȻЧʣӽһ֧Чʵ⡣ + +־--------2015-1-20 + ؽһںȱݣBUGҪӰwebñ뻺ڲʱ׳ֹϡ + +־--------2015-1-19 + ԼSaveAsʱ򣬶༶Ŀ¼ĬĿ¼ȷ⡣ + +־--------2015-1-8 + ǿpop3,smtp,ftp֧ssl + +־--------2015-1-7 + ǿTSL UIںǿ + +־--------2014-12-24 + DIV0ֺ֧excelڿյԪʱ⡣ + һSQL﷨зʹõ±⡣(ڷdzĴʹ²Ż) + ǿmultibytetounicodeԼunicodetomultibyteLCMapStringGB<->BIG5ת⡣ + ǿ첽Զ̺֧Լں֧׼ + + +־--------2014-12-9 + ںBINARYµBUG + +־--------2014-11-18 + £ļRֲ֧֡ + +־--------2014-11-14 + ǿֽ֧INFԼNAN뵼EXCELINFӦΪEXCELDIV0NANӦΪNA + ǿԹĽķزȷĴʾ + +־--------2014-11-13 + ΪʹñԣRTSLĺ + tslLocalCallFuncԼtslLocalExecuteķؽtslRemoteCallFunctslRemoteExecuteĽеĴϢλþΪҵһ0Ϊȷ + +־--------2014-11-12 + ǿTSLRĵ֧֡ + ʹò裺1ȷRװĿ¼R.dllڵ·ϵͳ·Уûӵϵͳ·С + plugin\FileMgr.iniм + [R Config] + Enabled=1 + *****޸ĺ󣬿ͻҪ + 2TSLĺ֧ + RPutVar("AAA",99); + Ret:=REval("AAA=AAA+1",Code); //Code=0ȷ + VarValue:=RGetVar("AAA"); + ڰȫԭRַ֧ȨܱãRDO2 + Rdo2 RPutVar("AAA",99); + Ret:=Rdo2 REval("AAA=AAA+1",Code); //Code=0ȷ + VarValue:=Rdo2 RGetVar("AAA"); + ΪЧʣʵʹУRDO2ãRĵ÷װ: + Function TestRPlus(V); + begin + RPutVar("AAA",V); + return REval("AAA+1"); + end; + õʱ Rdo2 TestRPlus(99); + +־--------2014-11-11 + ǿRTSLĵ֧֡ + ʹò裺1·Ϊϵͳ· + ٶ·ΪC:/program files/Tinysoft/Analyse.NET + 2أ + Rʹdyn.load("C:/program files/Tinysoft/Analyse.NET/tslr.dll") Rİ汾32λҪ32λĿͻˣ64λRҪ64λͻ + 3Rеĵã + Զ̵֧ + .External("tslRemoteExecute","return rand(10,10);",NULL) + .External("tslRemoteExecute","return close();",list(StockID="SH000300")) + .External("tslRemoteCallFunc","inttostr",list(99),NULL) + .External("tslRemoteCallFunc","close",NULL,list(StockID="SZ000002")) + ص֧ + .External("tslLocalExecute","return rand(10,10);") + .External("tslLocalCallFunc","inttostr",list(99)) + .External("tslSetSysParam","AAA",1111) + .External("tslGetSysParam","AAA") + 4ͻʹ÷ + .External("tslConnectServer","tsl.tinysoft.com.cn",443,NULL) Ϊ0ʾӳɹ + .External("tslLoginServer","username","password") + .External("tslDisconnect") + .External("tslLogined") + .External("tslSetService","ʽ") + .External("tslSetComputeBitsOption",0) + .External("tslGetComputeBitsOption") + .External("tslGetService") + .External("tslDefaultConnectAndLogin","test") //οTSLеDefaultConnectAndLoginԽûԼplugin/tslclient.ini + ϸʹðTSDNԼļи + +־--------2014-10-27 + ǿglobalȫֱ++,--޷ִе⡣ + +־--------2014-10-7 + ǿСģڴй¶⡣ + ǿݿӴģʽ⡣ + ǿifnumberINT64жϣifint64жǷINT64 + +־--------2014-9-23 + ǿconnectman.exe֧µݿӷʽ + ǿµݿӷʽ޷֧OracleCLOB͵⡣ + +־--------2014-9-22 + ǿַ֧ADOݿģʽ + ֵݿķADOӴ + Oracle + ConnectStr=DriverID=Ora;Database=ServerName:Port/ServiceName;CharacterSet=ZHS16GBK;User_Name=username;Password=password + SqlServer: + ConnectStr=DriverID=MSSQL;Server=ServerName;Database=DataBaseName;User_Name=username;Password=password + + +־--------2014-9-12 + ǿֿ֧ƱʾͼεߵĴϸ + ǿTSL.EXEʱֱ֧TSLС + +־--------2014-9-5 + Ͳ޷޸ΪַԼȲ͡ + +־--------2014-8-28 + ûݵ޷˫򿪵⡣ + ѡƱԻ¼ѡƱس롣 + +־--------2014-8-27 + û¿ͻ쳣⡣ + ûԶ༭ɺδѡĬֵᵼ¶ʧ⡣ + +־--------2014-8-23 + ͻͨѶ޷֧RDO2⡣ + THISROW,THISROWINDEXLEFT JOIN,RIGHT JOIN,FULL JOINʱ⡣ + ExcelSetRangeProp޷ֱ÷ݵһBUG + +־--------2014-8-21 + £ƱѡԼѡĽУĬϵĴڴС԰ԼƱбʾṩ˴Сƶѡ֧ڲƷʾ + £°װ32λն˽ĬλԶѡ̨ǰָ32λ񡣣նû뾡ʹ64λ񣬷ֹ㱻ڴƣ + +־--------2014-8-14 + ʱʾСλֵBUG + +־--------2014-8-9 + £global֧Ϊrdo2ıΡ + £ͻʾرЧʡ + +־--------2014-8-7 + Ը£globalؼ֧֣֧ȫֱʹ÷£ + ںڻfunctionbegin֮ʹ global x,y; + ڸúʹõx,yȫֱ + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +־--------2014-7-23 + £SQLĵʱоۼ + ¿ͻר޷޸ѡеݵλõBUG + +־--------2014-7-20 + £Ե·ʽߣԷ񽫳µIJԹܡ + £ԼĹڵ֧֣ + Ϊ"130s"Ϊ130룬"13d"Ϊ13졣Ҳcy_trailingseconds(130)cy_trailingdays(13) + £ϵͳϿͻ˶Թڵѡṩ֧֡ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +־--------2014-7-15 + £ע/עTSOLE.DLL̬ʧܵ޷⡣ڼļ֣ϵͳOFFICEװȵйء + һע/עʧܣһϵͳѯǷע/עʹøòԱѡ + +־--------2014-7-14 + ϢԼûݵΪĵģڶε¼ʾ⡣Ѿɾͻ˴·dataԼͻûĿ¼ + ͻ˵ϵͳпԴ򿪴Ŀ¼ + +־--------2014-7-11 + £ȡ˸Դڿͻ˵ĴСƣеĹƱûݱĸȵȣһЩԴŻ١ + ͻ˱༭ڴ򿪰ʱСڿܻᵼ¹궪ʧBUG + MFINDַ±һBUG + MODEOFԼMODEļBUG + EmaOfԼSmaOfSQLۼSMAOFԣLARGEOFSMA(CLOSE(),5,3)дΪSmaOf(["close"],3,true,5) + Ema(close(),3)ӦΪEmaOf(["close"],true,3)ָԣSMAOFEMAOF֧ûƶNı﷽ʽ + ֧64λ壬ĸL1234567890L + Ը£SQLľۼԭвһƶNʱб𵽵ױʾNڷNΪʾNڷģ + ûʹa:=rand(1000,1);return select MaxOf([0],[0]>0.5,10,true),MaxOf([0],[0]>0.5,10,false) from a end;ͬʱʹģʽǰͨselectoptsqlı֡ + һΪ־EMA,SMAȼָĻ־ +SQLûȫʹSQLʵԭҪNDAYԼMA/EMA/SMAȵʵֵļָ꣬磺 + EmaOf(AvgOf(["close"],true,30),true,30) //൱ema(ma(close(),30),30) + SQLľۼƶܵõ˿ǰߣЧԭNDAYеЧʻһ£ijЩЧڸߡ + + +־--------2014-5-16 + Ը£CallInArrayؼ֣֧CallInArray("StrToIntDef",Array("12345",0))ģʽCALL£Dzֱ֧ηء + £TSL.EXETSLInterp.DLLȽԼWEBģ + £ʽParseRegExprֽ֧һϵĽ + £Ӳ¹ܵİݡExecSQLڴ̵õİʽParseRegExprİ + + +־--------2014-5-11 + Ը£Է֧֣ʹ÷һ + SetSysParam("FreeCycle",1); + SetSysParam(pn_Cycle(),cy_1m()); + SetSysParam(pn_Date(),Day+StrToTime("13:30:15")); + FREECYCLEصʱԼڽΪڣҲ˵õʱΪ׼йĬϵĹ̶ֹڡ + ʹ÷ + SetSysParam(pn_Cycle(),100); + SetSysParam(pn_Date(),Day+StrToTime("13:30:15")); + ڱΪʱ򣬻ὫΪڣӵ100ڣĿǰ֧4Сʱڵڡ + ʱУڵDzԽյģղȻգҹ̶ԣϺ賿ľһڣҲ˵ڿԽյʱʣµʱ䲻һڣʣʱΪһڣһڴһտʼ + TechCacheDoĶ֤ȯüָܵ´BUG + £ͻ˰бЧʡ + +־--------2014-4-28 + £Matlab 2014a汾֧֡ + +־--------2014-4-24 + Ը£mt_decompose_ldl,mt_decompose_cholֽ⺯ + Ը£SELF޷ʵص鷽 + Ը£ؼlikeepsԼlikeepsrateԻúʵlikeʱľȼ㡣 + Likeļ㷽£ + IJľֵĹܡ + A:=array(0,1,array("A","B","C","D","E","F"))->5;һ"A""F"Ϊ±0->5 + array("A":0,"B":1,"C":2,"D":3,"E":4,"F":5) + + ǿRand,Nils,Ones,Zeros֧άijʼ + Nils(3,4,5)һ3*4*5άNIL + RandĵΪѡҪάҪã + Rand(3,4,nil,5)Ҫֲ̬3*4*5Сάrand(3,4,array("normal",0,1),5) + + ǿӹؼmIndex,mIndexCountʵֶάı + mIndexȡ±꣬mIndexCount±ĸ + ά: + a:=rand(3,4,nil,5); + a[:,:,:]::begin + echo mIndex(0),"->",mIndex(1),"->",mIndex(2),"->",mCell,"\r\n"; + end; + +־--------2013-7-19 + ǿmFind + ֧滻: + mFind(a,mcell>1,nil,1),ΪNILʾнһ1ʾ滻Ϊ1 + ֱ֧ӷֵ± + mFind(a)÷ķؽһ죬aһά飬򷵻һά + ; + ٶbb:=rand(1000,10); + selectĴ + c:=select * from b where [0]>0.5 end; + Ժܱݵʹþģʽ + c:=b[mFind(b[:,0].>0.5)]; + ǿImportFileExportFileʱ򣬾ֱӵ뵼DBFļftDBF()ͺ + ReshapeA:=Rand(3,6);֧Reshape(A)һά飬֧Reshape(A,2,9)2*9ľ֧Reshape(A,6,Array("A","B","C"))ָ±6*3󣬵ȻҲ֧Reshape(A,array("A","B","C","D","E","F"),array("F1","F2","F3"))ķʽ + Ftp֧࣬FTPļ䣬ĵĵ + ǿ: ַຯຯֲֲຯȵ֧־Ϊֹٸ֧˾ + ǿSELECTۼֵ֧ĹܣϿҵӦֱܵӺ֮Ȼμĵ + ľʽֵ֧ĺڲͷرΪͬ¿ܳ⡣ + trystrtoint(a,a)ܻᵼ½Ԥ֪ + : 󻯴ڵʱ򣬿ͻСᵼ޷ԭť⡣ + +־--------2013-7-8 + һЩڶʱʾδڵǰĻе⡣ + +־--------2013-7-5 + ********************************************************** + ************֧־********************** + 磺abs(X)ֶ֧һNάд + Meanֶ֧ά + ˾֧ + ½Ըĺ + ************ԺTSDNϵĸĵ******************** + +־--------2013-7-4 + ǿͻڶʾϵļԡ + +־--------2013-7-3 + ͻڶʾʾ⡣ + +־--------2013-7-2 + Randϸ汾µ⡣ + +־--------2013-6-27 + ThisOrderпֲܻɿBUG + £NANСֵ + 64λ¿ͻ˵ͼεʱݰNANпܻ⡣ + +־--------2013-6-22 + **********************رʾ*************************** + Ѿȫ鴦ںˣϼݾе﷨ + һӾ﷨ݣرҪע⣺ + ԭӾʱ + ȡӾ + a:=b[:,1];//ȡbб1ȡΪ1ά飬¾﷨ͬ + Ӿ: + b[:,1]:=a;//ԭ﷨ֱ֧ӶбӾãb[:,1]:=aĺͬb[:,1:1]Ҳ˵aӦһά + ֮﷨b[:,1]b[:,1:1]ļд + ﷨Уb[:,1]:=aǶ±1һиֵaֵӦΪһά飬Ͳ˺ԭݵĵط + ﷨Уb[:,"aa"]:=a;﷨﷨Уд + ﷨֧֣ĿǰԶάIJõǿ磺 + b:=a[:,0,:]ǶһάƬһά顣 + ͬa[:,0,:]:=bӾ + ϵͳӾ֧16ά + ⣬Ӿ󣬳֧±1:3ģʽĿǰѾ֧Ϊ±Ӿ + a[array(1,2,3),array(2,3,4)]:=1; a[array(1,2,3),array(2,3,4)]:=rand(3,3);DZֵ֧ġ + a[array(1,2,3),array(2,3,4)]:=array(1,2,3);ʹӦеָоΪ1,2,3 + 1,2,3еĺʾ±Ϊ1,2,3ˣ + array[:,array("aa","bb")]֧ͬ֡ + + Ӿ֧ A[:,"A"]+=2"="Ӿͬ + + ӾĸµTSDNĸ£רĵ + **********************رʾ*************************** + ǿ++,-- + A++ԷAԭʼֵ++AԷؼ֮Aֵ + A--ԷAԭʼֵ--AԷؼ֮Aֵ + A[0,0]++;A[0,0]ԭʼֵ,++A[0,0]A[0,0]1ֵ֮ + ϲAıһ󣬾ѭԭû಻Ҫڲ践ֵʱǷӦò++A㣬ΪϵͳѾԴ˽Ż + + ҪעǣӾ++,--A[:,:]++Լ++A[:,:]ȷ㣬ڷֵ + + ǿߺͷ֮ͨѶЧʣͨѶʱӡ + ǿEXCELʱXLSXѡ + +־--------2013-6-19 + ǿΪں˽ǰ׼ + + +־--------2013-6-18 + ͻר޷뵼顣 + +־--------2013-4-20 + ǿtostn֧Сλʹ÷Ϊtostn(a,2)ΪλС + һЩEXCELĴEXCEL̲˳BUG + ȥtsole.dlltslkrnl.dll32λ64λEXCEL + ǿڱ༭˵Smart TabѡTABΪѡ + with **ܵ±BUG + ڴ治޷лʾΪڴ治Լںǿ + +־--------2013-4-5 + £Matlab 2013a汾֧֡ + £qrֽ֧־ôС + +־--------2013-3-7 + £MSelectһBUG(ѡӦΪ0ʱ򣬷Ϊ1пֵ¿ܻ) + +־--------2013-3-5 + £ǿ32λ±ؽ׽ӿڷ + +־--------2013-3-4 + ļĶԻʧʾֶΡϢ + +־--------2013-2-28 + ʾ⡣ + 32λCTPײ汾ƥ⡣64λͻʱδṩCTPײ + +־--------2013-2-28 + £ֶ֧رԶܡ + £ܣҪȨޣ֧㲥Ϣ + ǿ뵼CSVʽ֧""ͨCSVʽһ¡ + ںǿ + +־--------2013-1-17 + ǿExportFile֧Matrix͡ + +־--------2013-1-11 + outersect=ֵ֧⡣ + +־--------2012-12-19 + £ϵͳעCOMSERVERʹעɾCOMSERVERĹܡ + ijЩûڰȫԵʵCOMSERVERע᲻ɹʹEXCEL,Matlab޷õʹעCOMSERVERİť + MATHKRNLһ汾µijЩò⡣ + ʼĴԡ + +־--------2012-11-19 + £ܣѡַưpasswordݣÿοͻΪա + ֲ֧׼¡ + +־--------2012-11-18 + £64λͻ˰汾ʽ32λ汾64λ汾°װأ + http://www.tinysoft.com.cn/download/setup.exe + http://www.tinysoft.com.cn/download/setup64.exe + £ںǿķϵЧʵȡ + ûݵʱʾͼ̾ͻܵ½޷ʹá + +־--------2012-11-14 + £64λ汾Ųԡ + ûڿͻ˵½ʱѡʹúְ汾ļм㡣 + 64λ汾ĿͻཫŲԣ֧64λMATLABл + £ + شͻˣΪͻ˽׼ + £ + ͻص֧֣ + + ٶa:=array(pn_stock():"SZ000002",pn_cycle():cy_1m()); + with *,a do c:=close();ĺڵǰĻ£aָĻָϵͳ + with **,a do c:=close();ĺлΪaԭеĻʧЧָԭееĻ + c:=specall(close(),a);ĺwith *,a c:=close();ƣwith֧Σspecdallֱֻ֧ʽ + £ + ӶMatlab 2012B֧֡ + ں˼ǿ + £ + WEBְ֧Լűְ֧½ͻˡ + + +־--------2012-10-31 + °汾б༭Ժ󣬻ǰӢĸա + ƴļ¡ + ںǿ + +־--------2012-10-11 + °汾б༭һһеǰģCTRL+CTRL޷Զɴڡ + +־--------2012-9-28 + °汾йĿ¼⡣ + +־--------2012-9-24 + ༭ȴڵȼڼʱЧ⡣ + ༭кʾȫ⡣ + ༭滻ȫťʧЧ⡣ + +־--------2012-9-20 + °汾COMSERVERʧLogined,NilTrans,KeepRawDataԡ + °汾ڼûݳԶ˳⡣ + +־--------2012-9-19 + °汾ڿͻ˶ջ⡣ + °汾ڱ༭COPY⡣ + EXPORTFILE,IMPORTFILEеXLSXļ⡣ + +־--------2012-9-19 + ΪһЩشȫ׼κ뼰ʱͷԱͨ + ʧ޷е΢VCаhttp://www.tinysoft.com.cn/download/vcredist_x86.exeаװ⡣ + +־--------2012-8-27 + 1Randֲָ֧ + Ӧ÷ + a:=rand(100,100,array("normal")); //ֲ̬ + Ҳдrand(100,100,array("normal",0,1)); + ֧(Сд޹) + "normal","poisson","Gamma","Uniform","Binomial","Geometric","Exp","Beta","Lognormal","Weibull","Cauchy","Laplace","Hypergeometric","IntUniform","Rayleigh" + +־--------2012-7-24 + 1ijЩ뷨״̬ں༭޷(⡣ + +־--------2012-7-16 + 1ЧЧʵõҪǿΪ(α),˷SVDֽȡ + 2mt_decompose_svdֿ֧ѡ + 3mt_decompose_eigfunction mt_decompose_eig(a:matrix;var wr,wi:array of double;[var vr,[vl :matrix]]):integer; + wr,wiֱֵʵ鲿vr,vlΪ + 4externalⲿDLLãĿɱΪάʱ򣬵ϵͳ + 磺 + pr:=rand(10,10); + a(pr,m,n);//ᵼ±ϰ汾⣬Ҫpr:=rand(100);һάάṹ + function a(var p1:array of double;m,n:integer):double; cdecl; external "C:\\test.dll" name "a"; + ĿǰBUGϴʹá + +־--------2012-7-10 + 1汾ںڱ༭ʱDIFF޷ӳǰ༭ĸĶ + 2¼лʱһ̨ᵼлҪ⡣ + 3ǿͻ˵İԼٴʮƷֵİ顣 + 4٣鱣(savebk)savetableЧʣGETBKҲ + 5ںǿ + +־--------2012-7-8 + 1*****************************汾֧֧******************************* + ں༭ѡVERťʹܡ鿴ں༭еļ˵еѡ + նų̂ѾԶ˼µİ汾ϢѡɾȻҲʷ汾 + Դɰٱ + ********************************************************************************** + 2֧룬{$DEFINE}{$IFDEF}{$ELSE}{$ENDIF}Ŀǰ֧{$INCLUDE}ƻн֧֡ + 3ϵͳֹ֧úأһЩĺ޷壬Ҳ޷ڹԱá + 4֧Զն˵ICONڷͻ + 5ͻ˲⽫طԷͻ + 6TSLCOMתЧ + 7նΪCOMʱ򣬻΢й¶⡣ + 8clSkyBlueȷ⡣ + 9֧֣༭ԶɲԲʾ壬ӺֻʶĸIJ + 10ٵƽ̨Ӧٶȡ + 11׳ںˡ + 12*********************һشǰδеĹѾ׼**************************** + ȴ + *********************************************************************************** + +־--------2012-6-25 + 1matlab 2012aֿ֧⡣ + +־--------2012-5-21 + 1ijЩͻ˵CPUߵ⡣ + +־--------2012-5-18 + 1ͨѶǿCommkrnl.dllʮϡ + 2ںǿ + +־--------2012-4-28 + 1select full joinʱ߾Ϊ־м쳣⡣ + +־--------2012-4-26 + 1޶һΪ//עͿܻᵼ±⡣ + 2ʹͨѶ÷ڶ߳¿ֲܻɿ(ʹWEBԼAPIӷĿͻcommkrnl.dll) + + +־--------2012-4-21 + 1޶importfileΪftStreamʱڴ΢й¶(ӦĿ⣺pubkrnl.dll) + +־--------2012-4-17 + 1ں˴ڵµڴй¶(ӦĿ⣺tslkrnl.dll pubkrnl.dll) + +־--------2012-4-12 + 1RDO2PAUSEֵ⡣ + 2նֲ֧ģʽϵͳ"ReportMode"ϵͳ + 3㷽ǿ + +־--------2012-3-9 + 1֧Selectнм㲢أ + select a:=["aaa"]/["bbb"] as nil,a*10 from r end; + ڵһмaǸвأʹas nil + 2IN֧Ӽ㣬array(1,2,3) in array(1,2,3,4)ĽΪ + 3FilterIn/FilterNotInеĵΪ±꣩ΪNILΪλˡ + Ӧã֧һάĹˣ + FilterNotIn(array(1,2,3,4,5,5,6,7),array(1,2,3,4),nil) + ⣬Ϊйˣ + a:=array(); + a[0]["A"]:=1;a[0]["B"]:=2;a[0]["C"]:=3; + a[1]["A"]:=2;a[1]["B"]:=3;a[1]["C"]:=4; + a[2]["A"]:=1;a[2]["B"]:=2;a[2]["C"]:=3; + a[3]["A"]:=4;a[3]["B"]:=5;a[3]["C"]:=6; + + b:=array(); + b[0]["A"]:=1;b[0]["B"]:=2;b[0]["C"]:=3; + b[1]["A"]:=2;b[1]["B"]:=3;b[1]["C"]:=4; + filterin(a,b,nil); + 4ӵļᵼԭʼ޸ĵBUG + 5ں + +־--------2012-1-29 + 1ͻ˵ߵģ˳ʱΪʾȻ + +־--------2012-1-17 + 1˵XLSXļĻᵼ޷ʹõ⡣ + 2:|:|=㷨|Լ|=IJΪ:|ԶУ|Ϊÿһ£ + Ϊľʱ򣬺ͬġ + 3ڽEXCELťļչxls/xlsx仯⡣ + +־--------2012-1-4 + ***************************2012½µı仯********************************** + TSDN־Ƴר¹ + 1*******************СģҪϸ***************************** + ȱʡIJȶIJٵ£ߵIJֵȱʡΪNIL + ؼRealParamCountԷʵIJ + ******************************************************************************** + + 2󼯺ؼ֣ + Union2,unionͬunion2ȥظ + Intersect + IJOutersect + Minus + еȥظĿ + union2൱oracleSQLunion,union൱oracleSQLunion all + Intersect൱oracleSQLintersect + Minus൱oracleSQLMinus + 尸 + array(1,2,3) union2 array(3,4)ĽΪarray(1,2,3,4) + array(1,2,3) intersect array(3,4)ĽΪarray(3) + array(1,2,3) outersect array(3,4)ĽΪarray(1,2,4) + array(1,2,3) minus array(3,4)ĽΪarray(1,2) + ֧һά⣬ϼֶ֧άԼά㡣 + ڲΪ=磺a union2= b,൱a:=a union2 b; + + 3SelectOptѡۼƶͳƶͳơ + select avgof(["a"],["a"]>0.5,10) from data end;ĺƶ10>0.5ƽֵ + select selectOpt(64) avgof(["a"],["a"]>0.5,10) from data end;ĺƶ10е>0.5ƽֵ + + 4µľۼProductOf۳ + + 5֧,FilterInȡڵӼFilterNotInȡڵӼ + a:=array(); + for i:=0 to 9 do + begin + a[i]["i"]:=i; + a[i]["idiv2"]:=i div 2; + end; + b:=array(3,5,7); + c:=FilterIn(a,b,"i"); //˽ + //CĽΪ + //array( + //("i":3,"idiv2":1), + //("i":5,"idiv2":2), + //("i":7,"idiv2":3)) + c:=FilterIn(a,b,"i",false); //˽± + //CĽΪarray(3,5,7) + + c:=FilterNotIn(a,b,"i"); //˽ + //CĽΪ + //array( + //("i":0,"idiv2":0), + //("i":1,"idiv2":0), + //("i":2,"idiv2":1), + //("i":4,"idiv2":2), + //("i":6,"idiv2":3), + //("i":8,"idiv2":4), + //("i":9,"idiv2":4)) + c:=FilterNotIn(a,b,"i",false); //˽± + //CĽΪarray(0,1,2,4,6,8,9) + + 6qrֽ⺯³ɵΪrֵ + 7conv + +־--------2011-12-16 + 1꾡ݿļʴ־¼ + 2ڴ治ʱ־ + +־--------2011-12-15 + ********************************************************************************************** + ϸĶݣѾĴ޷УDZ¶صIJ淶Ĵ + ********************************************************************************************** + 1TSL¶ĴصIJɿ + 1ֵij֧߱ + ԭԶд abcd;Ĵ벻end֮ǰд abcd endĴҲ + ޲ĺδд()ҲᱨʲôҲִУΪ˽⣬д + Ӱ죺TSL֧ԺΪһĬ֧֣ûʹ뷨ʱ + ȫĸ뺺ֵĿհ׷ֵֺĿհ׻ᱻDZֱEND֮ǰ + DZģҲ˵Ŀǰᱻ¶Ҫûɾֿհ׷ȫ滻 + հ׵ȫǿո滻Ϊǿո + 2a=1;a+b; ȵȲٱ֧֡ + ԭûд:=ʱдa=1DZδܼΪa=1һϷıʽaijʼֵΪ01 + Ӱ죺ִʱԼ롣 + 2ݿ֧¡ + Function SQLBeginTrans(DBAlias:String):Integer;//-1:falure,򷵻شڵڼ + Function SQLCommnit(DBAlias:String):Integer;//-1:failure,1 ʾ(༶),0 + Function SQLRollback(DBAlias:String):Integer;//-1:failure,1 ʾ(༶),0 + Function SQLInTrans(DBAlias:String):Integer;//-1:falure,򷵻صڼ + 3ں˸£ڴʹø׳˴λ׼ȷ⡣ + + +־--------2011-11-13 + 1Matlab 2011bֿ֧ + +־--------2011-9-22 + 1UI֧֡ + 2SendRunningData֧ʱ͡ + 3MTIC,MTOC֧ + 4SetProfiler,GetProfilerInfoõеϸϢ + 5->㷨֧֣1->5ʾarray(1,2,3,4,5),array(1,2)->5ʾ1,3,5 + + +־--------2011-9-21 + ................................................................................. + + +־--------2011-9-5 + 1EXCEL 4.0汾EXCELļĵ뺺⣨ijЩϵͳļʽΪøʽ + 2ͼθWORD±ߺұߵıԵߵ⡣ + +־--------2011-8-29 + 1ʵ֧1E-5дҪ1.0E-5 + 2like㷨һ֧㣬NANlikeΪtrue⡣ + 3COMSERVERLoginedڵCOMʱ򣬿LoginedжǷ¼ɹ + 4gotolabelźҪ䡣磺 + for i:=0 to 999 do + begin + if i>99 then goto endlabel; + j++; + label endlabel; + end; + 5ַشڣڳڷΧڣᱻԶΪַûġ + + +־--------2011-8-18 + 12011-8-17Matlabģ͵TSLģʹRDO2ʾϢϵͳDispatch⡣ + +־--------2011-8-17 + 1ֺ֧Ĺûһʹã + 2ǿmatlabȵƽ̨ģͣģʹRDO2ᵯͻʾаȫ飬δΪʱĬϾܾá + 3¹ؼ֣syssafeeval(WEBûʹ) + +־--------2011-8-15 + 1֧classuses + 2ȥdupestring100ظơ + +־--------2011-8-8 + 1֧goto,label + Example: + i:=0; + label a; + i++; + if i<100 then goto a; + label֮һҪкϷ䡣 + + 2װĿ¼µĶ汾ͻ˵û¼Ϣļ + +־--------2011-8-4 + 1ͻִ֧Ԫ + 2֧RDO2ͨunit(UnitName).FunctionName()ģʽõԪ + 3RDO2֧Զ֧ģUsesĵԪ + 4RDO2ִ֧кӺ֮ǰ汾RDO2֧ȫֺ + +־--------2011-8-3 + ͨCOMRemoteCallFuncöά鵥лߵбתΪһά˵Լ + ˵ⲢBUGˣΪûʹEXCELMATLABܶ࣬EXCELMATLABCOMݸʱһ + MATLABûһά飬EXCELıҲǶάģڴ˴ĬϽ˵лߵеĶάһάת + + һԣKeepRawDataΪͣĬΪ0ʾǰݣСоתΪһά顣 + ts.KeepRawDataΪ1ʱеתԭʼݵ + ts.KeepRawDataΪ2ʱ򣬽תеΪһά顣 + ts.KeepRawDataΪ3ʱ򣬽תеΪһά顣 + ˵ + Ҳʹts.SetSysParam('KeepRawData',Value)ģʽ + +־--------2011-8-3 + 1ṩMatlab R2011aֿ֧⣬ļΪmatlab.dll.2011a + 2༭߱ԶϵĺɾеʱϵλԶӦ + 3UNIT,INTERFACE,IMPLEMENTATION,INITIALIZATION,FINALIZATION,USESʺӺԼֺ֧ģʽ + 4ݿֶ֧BCDλСģʽΪṩϰ汾ǰݣͨûᣩѡΪĬϹرգͨExecSql.iniEnableBCDֶνô򿪡 + +־--------2011-7-20 + 1QRֽվֽΪվ + +־--------2011-7-18 + 1ǿQRֽ⣬֧mt_decompose_qr(a,q,r,e)ķֽģʽ + 2ǿ㣬֧.> .< .= .<> .>= .<=ЩԺܱݵؽоıȽ㡣 + +־--------2011-7-14 + 1kurtosisofskewof⣬˴ݼȷԣ˺ΪExcelļ㹫ʽ + 2kurtosis2ofskew2of˺ΪMatlabļ㹫ʽ + 3ǿ˾㣬֧1*1ľо˷㡣 + 4ǿ˾㣬ֿ֧վ˷Ⱦ㷵ؿվ + 5!ԱΪ + 6֧־ + .! ȡ + .!!߼ + .& + .| + .&&߼ + .||߼ + .||=߼ڣa.||=b൱a:=a.||b; + .&&=߼ڣa.&&=b൱a:=a.&&b; + .&= ڣa.&=b൱a:=a.&b; + .|= ڣa.|=b൱a:=a.|b; + 7ǿȡӾΪ±ȡӾ󡣵Ŀǰ֧ʹ±Ӿ + +־--------2011-7-8 + 1ǿSELECTԷĴthisgroupؼ֣refsofؼ֣ϼSELECTTHISORDERؼ֣Եõorder by׼ȷţͬݵͬ + йµĹܽоĵʹð + +־--------2011-6-20 + 1¼ϢļӰװĿ¼תusers/user/Tinysoft/Analyse.NET/£ֶ֧ûڷͬһʹõ⡣ + +־--------2011-6-14 + 1޶˸ת⡣ + +־--------2011-6-10 + 1޶˶ⲿDLLÿܵ±BUG + +־--------2011-6-9 + 1޶˺SysExec¾йBUG + +־--------2011-6-3 + 1޶˵xlsļexcel 2010޷򿪵⡣ + 2matlab 7.0ֿ֧⣬ļΪmatlab.dll.7.0 + +־--------2011-5-17 + 1ֹExcelļʱѯԼ˳ʾ档 + 2ӰģʽֹRDO2ʾϵͳӦã + 3ںǿ + +־--------2011-3-20 + 1SaveBK,DeleteBK + 磬һĿ¼"ҵһ\\ҵĶ"Ϊ"ҵİ"İ + SaveBk("ҵİ","ҵһ\\ҵĶ",Array("SZ000001","SZ000002")); + ע⣺עDzظģҲ˵ͬĿ¼µͬвͨ + ɾð飺 + DeleteBk("ҵİ") + 2ListTable,DeleteTableݱ + ListTable()Էûݱб + DeleteTable("ҵıĿ¼\\ҵı")ɾûݱ,ûݱ鲻ֺͬĿ¼һ + 3likeԸ֧ + ڸԣжϸǷǰȽѣڿ + if 1 like 1.00001 thenlikeԸ֧֡ + ǰ a=b ָжϿԸΪ a like b +־--------2011-3-4 + 1ӣMATLAB7.1R2010Bֿ֧⡣ֱΪmatlab.dll.7.1matlab.dll.2010b + 2ǿֵ⡣ + 3ʽ⡣ + +־--------2011-1-20 + 1ӣ + 2ģͷࡣ + +־--------2010-12-3 + 1ǿα㡣 + +־--------2010-12-1 + 1ǿ֧棬Լں˸¡ + 2ʼһЩϹ淶ʼͻ˵ʼ˼ԡ + 3keepresidentؼ֣֧ⲿ̬뺯פ + +־--------2010-11-23 + 1ͻˣ****ݿԸƵ*** + +־--------2010-11-17 + 1ǿTSLԽ١ + 2TSLʽ֧Namespace + 3ͻˣCHARTͼĬɫ + 4ͻˣӲúģʽĬϵĿͻã纯ԼʾãCHARTɫɫãҪûȴʽĵ + +־--------2010-10-28 + 1TStreamRead,Write⡣ + +־--------2010-10-25 + 1EXCEL 2007ʽʱдڿֵʱȷ⡣ + 2ǿһںAPIԶ̵֧߳֡ + +־--------2010-10-11 + 1֧ʱԼʱ͡ + 2ִ֧ܣ֧֤顣 + 3TSLԼWEB֧RDO + +־--------2010-09-24 + 1Excelļʱ򣬵<ʱг + +־--------2010-09-03 + 1sf_gammaļ㾫⡣ + +־--------2010-09-02 + 1full join Ϊյ + 2ǿij˷Чʡ + 3qrֽ⺯µ⡣ + 4żȻ֡δ⡣ + +־--------2010-08-06 + RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR + R TSLԶRԵ֧ĵˡ R + R http://www.tinysoft.com.cn/download/devDocs/RͨRComƽ̨.doc R + R ͨأѯ֧Ա R + RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR + 1matlab 2007a֧ļmatlab.dll.2007aʹøð汾ûøļmatlab.dll + 2insertֶҲʧܵʱsqlerrormsgԷسԭ + 3Ӿ::ѭ֧ˡ + 4ֲsf_normalinv,sf_normalinv2,sf_betainv,sf_gammainv,sf_tinv,sf_finv,sf_x2inv + עbeta,gammaӦķֲΪsf_incompletebeta,sf_incompletegamma⣬ûעIJ + mt_decompose_lu(luֽ),mt_decompose_qr(qrֽ),mt_decompose_CholeskyȾֽ⺯ + 5棺˼аϢ֧֡ + docproc.dllǰ·£½docproc.iniݡ + [WordTemplate] + SingleProc=1 + Timeout=300000 + ͬһʱֻһģɣȴʱΪ5ӣ300000룬޵ȴΪ-1 + 6*************************Ҫ޸***************************** + 6.1һԪ+-ŵȼȼ޸ΪͶԪ+,-ļͬ + Ӱ췶Χ-2^2ĽΪ-44Բʹ^,:^ûӰ + 6.2^,:^,~ȼ˷ !,`һԪȼ֮䡣 + Ӱ췶Χʹ^,:^,~û(~Ϊ) + ************************************************************* + + ע⣺ϸڰļԼԭʱδ£ûֱʹá + + +־--------2010-07-26 + 1matlab 2010a֧ļmatlab.dll.2010aʹøð汾ûøļmatlab.dll + 2ʾ2009bû޷óɹûҪ·мӦĿ¼bin\win32Ŀ¼(ð汾װδ·) + +־--------2010-07-22 + 1˻ֺ + 2MatrixToArray + + +־--------2010-07-16 + 1matlab 2007b֧ļmatlab.dll.2007bʹøð汾ûøļmatlab.dll + +־--------2010-07-02 + 1˶һάģʽa[n:m]:=Ӿֵ֧(ͬʱ) + 2Ϊ֧ȫг˹Ʊܳһƣ˰ĹƱֳ֧ǧơ + +־--------2010-06-17 + 1mgetvarڻ߱ͷǿתʱ⡣ + 2˺matlabǰ˽ؾ͵ȶ⡣ + +־--------2010-06-9 + 1matlab 2009b֧ļmatlab.dll.2009bʹøð汾ûøļmatlab.dll + +־--------2010-06-7 + 1֧var a:=1;дԳʼıдbegin endڣʼbeginǰ + 2ǰ˴ѾΪ + 3쳣ڣ糬ڣ缸ʮԺڣ쳣⡣ + 4SAVETABLEıͷַ쳣⡣ + +־--------2010-06-6 + 1=========***********ӱѡ***********=========== + £ + ˱ѡ֧֣Ŀǰ֧ѡһExplicitһVarByRef + + ԽԽĿԱTSLģͣ࿪ԱƵ⣺ + 1.1TSLĬ޸ĵIJֵʱõĺֵ޸Ķڲ⡣ + 1.2TSLĬϱҪ¿ʱײдڲı + + ʹ£ + 1.3ڳУ{$Explicit}{$Explicit+}Դ򿪱ıѡϵͳĬDzģһ˱ѡֲʹǰã + Varʹ÷ + {$Explicit} + Var a; + a:=1; + ˱ıѡûıᱨ + ֻǶһСγ򿪱ѡôʹ{$Explicit-}رѡ + 1.4ڳУ{$VarByRef-}Թرֵ޸ĵıѡϵͳĬ޸ĵģһر˱ѡ޷޸ĴIJ + Ҫ´򿪸ѡ{$VarByRef}{$VarByRef+}ɡ + Ĭ޸IJģвҪʱָ޸ģʹconstǰ׺ɡ + 磺 + n:=100; m:=10; + l:=abcd(const n,m); + return echo "n=",n," m=",m," l=",l; + function abcd(a,b); + begin + a:=a+1;b:=b+1; + return a*b; + end; + ϴûconstnֵΪ101constnֵͲˣDZ100,mֵ11 + + {$VarByRef-} + n:=100; m:=10; + l:=abcd(var n,m); + return echo "n=",n," m=",m," l=",l; + function abcd(a,b); + begin + a:=a+1; b:=b+1; + return a*b; + end; + ϴʹ{$VarByRef-}أر޸ģĬ£n,mֵᱻ޸ģҪʱ޸ģʹvarǰ׺ + ϴִnֵ101mֵ䣬10 + Ҫע⣺ + 1.5ѡӰı룬Сһд򿪻߹ر˿أõһʱ򣬸ÿDzЧġÿһﶼҪʹÿء + 1.6ѡӰıDZѡijı룬һںֲѡҲӰ쵽±ߵľֲ + ======================================================================================== + +־--------2010-06-3 + 1ƽ̨echo TSLWEB֧֣õƽ̨ģECHǪˡɸtslclient.dllӦ· + +־--------2010-05-17 + 1˶bit͵SQLֶε֧֡ + +־--------2010-05-17 + 1˶bit͵SQLֶε֧֡ + +־--------2010-05-12 + 1ǿRDo2Աεķص֧֡ + 2صϢݵİť + 3κĹܡ + 4԰ + +־--------2010-05-11 +£1=֧Ƿȵжϡ + 2rdo2رΣrdo2ñصĺϿԺƽ̨ϵͬ + 3Nilsʼ顣 + 4ǿģĬϽֹãðȫģʽ + 5MatrixToArray֧matrixתΪarray͡ + 6EXCELĵ⡣ + 7++--ںߺǰߵ⡣1һҪ++arrҪarr++arr++Чʺܵ͡Ϊarr++صĽΪarrԭʼֵԻıݡ + 8Encodegraphͼֿ֧鲻ߵ⡣ + 9RenameFileΪ + 10Arrayʼжλ⡣ + 11matlab溯С + +־--------2010-04-18 +£1ԵEXCELļʧܵʱʹEXCEL + 2֧AvgOf( * )Լ AvgOf( 0 to 5 )Ⱦۼдһɶۼ + + +־--------2010-04-16 +£1ִ֧ӡϢͻˣԣ볢echo,write,writeln + 2ֳ֧йֱͻˣûɣ********** + 3ֳ֧йзʿͻԴʱEXCELļñMATLABȣûɣ************ + ʹsendtoclient,rdo,rdo2 + 4WordжOFFICE 2007֧֡ͻֳ֧65500еEXCEL2007ʽ + 5selectlargeof,smallof,percentileof,percentrankof,quartileof,rankof,trimmeanof,frequencyofۼ֧ + 6еijԱ֧staticǰ׺Ϊ̬ + 7mfind,msize,mrows,mcols,mcell,mcol,mrow,zeros,ones,eye,rand,nan,inf,aggvalue,rdo,rdo2ؼ + 8:*=,:\=,:/=,:^=,::=::,:*,:\,:/,:^,+=,-=,*=,/=,\=,%=,^=,|=,&=,~=div=|,union,`,\,^,~! + а㹦 + 9ǿ˶EXCELдֺ֧EXCELķЧʣӵftxls3()ͣreadXlsSheetsSetCells,GetCellsȺ + 10EXECSQL˴ݲ̵֧֡ + 11һmevalmsetvisiblemgetvisiblemclosemputvar,mgetvar,mgetbuf֧MatlabãɲҪֱӵ + ֱӵãϷ˷ʿͻ˵TSLñMATLABķͳ + 12INSERTʱڿлռ¼⡣ + 13ʽλ÷⡣ + 14˿ͻֹϵͳ⡣ + 15SELECTݿ޷һһСBUG + 16˶ⲿDLLʱԶάֵ֧СBUG + 17û޸ΪյBUG + 18sqlerrormsgSQLִдϢinsert޷شϢΪ + 19isBackgroundжǷίִ״̬ + 20setechostringunsetechostring,isEchoRedirect֧ECHOеĹܣWEBƽ̨WEBģ͵һԺã + 21˱ģ͵֧֡ + 22sp_g,sp_sͬgetsysparamsetsysparam + 23select *صĴ޷ϵˡҲһҪע⣬ѭȺ򣬵ǰԭԵij򲻵ò޸ġ + 24ȡƤãСĵ + 25ѧоĿ͡ + +־--------2009-11-22 +£1Ĺ캯µ⡣ + 2thisrowindex,thisrowԶ֧֡ + 3˶SQLSERVERbinary͵֧֡ + 4ExecSqlKeepNullѡݷΪNIL + 5*******ɢͼͼ͵֧******* + 6*******˶趨İťԺܷ˫ͼ****** + 7*******ͼͶڶֶʾȷ******** + +־--------2009-10-23 +£1Ӱ쵽ߵķֵ⡣ + 2CHECKSUMOFУ麯⡣ + +־--------2009-10-22 +£1˶ԿݵתMATLABԼNIL⡣ + Excel,Matlab,S-PLUSȶͳԿ͵ֲ֧ͬ³ּ⣬ + ޷ͳһתͨһCOMNilTrans⣬ûѡתķ + £ + ٶCOMʵΪts + ts.NilTrans Ϊ ֵĬΪ0 + 0: תΪUnassigned + 1: תΪEmpty + 2: תΪNULL + 3: תΪNaN + 4: תΪ0 + 5: תΪ0 + 6: תΪַ + 7: תΪ'NIL'ַ + 8: תΪ'NULL'ַ + 9: תΪ'-'ַ + 10: תΪ'/'ַ + ֵ: תΪUnassigned + + ûҲʹts.SetSysParam('NilTrans',N)ͬЧNֵ + + BTW: + ûıӦⲿCOM򽻵EXCELôûTSLʹ + SetSysParam('NilTrans',N);//NΪ0-10ֵ + ķʽNILCOMתΪ + + +־--------2009-10-21 +£1˶ԿݵתMATLABļ⡣ + +־--------2009-9-18 +£1ں˸£indexַ֧š + 2ں˶Ըʽתӵ֧֡ + 3ǿ˶iis֧֡ + 4ǿWEBܣ֧ͬʱPOSTGET + 5ݿDECͽ֧λС⡣ + 6ǿ˶ORACLEļԣEXECSQLֶ֧ء + 7HTTPʵTIMEOUTʧЧ⡣ + 8ǿʼı⡣ + 9˿ݷʽִк⣬ݷʽ + 10˵װISAٶر⡣ + 11ں˸¡ + 12EXCEL¡ + 13԰¡ + +־--------2008-12-4 +£1ں˸¡ + 2ڴ¡ + 3˳ࡣ + 4ǿ˶WEB֧֡ + 5԰ļ + +־--------2008-10-22 +£1ں˸£select ֶ֧ѯ֧JOIN,LEFT JOIN,RIGHT JOIN,FULL JOIN,CROSS JOIN﷨ + +־--------2008-9-22 +£1Cookieԡ + 2ں˸¡ + +־--------2008-8-19 +£1ں˸¡ + 2MATLABṩֱ֧֡ + 3ṩWORDдоԶɹݵĹܡ + 4ں˸¡ + +־--------2008-7-12 +£1ں˸¡ + +־--------2008-6-22 +£1ں˸¡ + 2DZͱ޷Ҽӵ⡣ + +־--------2008-6-16 +£1ں˸¡ + 2TStringList,TIniFile,TFileStreamö + +־--------2008-6-6 +£1ں󿪷¡ + 2ǿԡ + 3ںFastCGIָ֧¡ + +־--------2008-5-22 +£1֧෽ʽ + 2¼ݾɺͷ;ģʽ + +־--------2008-5-19 +£1EXCELģ庯¡ + 3˫µʾ⡣ + 4ں˸¡ + 5******************ں˵Object TSLģ֧****************** + +־--------2008-3-14 +£1*************ṩݹάԼʵ֧*************** + 2EXCELģ庯¡ + 3ǿ˶VistaļԣȻҪEXCELԹԱв + 4ں˸¡ + 5԰¡ + +־--------2007-12-24 +£1Ӳ淶EXCELļеݿܻܶõĿݵ⡣ + 2EXCELģ庯¡ + 3򵼽СĸĶΪһ汾֧֡ + 4ں˸¡ + 5԰¡ + +־--------2007-10-9 +£1רͳƺͳƷָꡣ + +־--------2007-7-7 +£1ں˸¡ + 2ΪWORDִйģǿ֧֡ + +־--------2007-7-5 +£1ںTSLOLEò + 2ں˸ + +־--------2007-6-29 +£1ǿSQL֧֣insert,update,delete﷨֧֡ + 2UIǿ + 3ںǿ + 4EXCELģ庯ºϡ + 5༭Զܡ + 6EXCELԼWORDģ½ģ壩 + 7˺ֲᵽ¡ + +־--------2007-6-15 +£1excelΪ˵ʽ + 2WORDӲ˵ƳֱWORDýڷ.NETܸõرдĵ + 3ںǿ + +־--------2007-4-26 +£1excelָ + 2ģݵǿ + 3еľ͵ʾ + 4ںǿ + +־--------2007-3-21 +£1Լ뵼ָijЩԶĵ + +־--------2007-1-20 +£1ںǿ + 2֧CASE + 3֧NANINF + 4EXCELָ + +־--------2006-11-03 +£1ǿselect﷨ֱӷSQLԴ + 2SELECT˴ȵȾۼͳƺ䣬֧ͳƺƶͳơ + 3ٹEXCELEXCELļļС⣬ָԭеĵģʽ + 4ǿmatrix ͵֧֡ + 5ϸݵķṩ˺ܶµݺͷʷ + +־--------2006-08-17 +£1ɹ϶SQLSERVERselect﷨ļݡ + 2֧SELECT﷨ۼ䡣 + 3EXCELֱEXCELĵ˼١ + +־--------2006-08-07 +£1Ժ֧select﷨ֶ֧Ի棬飬ϸݣԼڴвѯͳơ + +־--------2006-07-06 +1ڰרĬʾİָﲢǰָ꣬ʾ + 2º༭˳޷ٴ򿪵BUG +£1ָЧʡ + 2EXCELֱӶģԼָ֧֡ + 3Excelģ庯¡ + +־--------2006-06-14 +£1ں˸ in/like/repeat until/try finally֧֡ + 2Ϊselectȱؼ + 3*****ֶ֧̬顣*****֧ + 4µͳƹܣרпʹ֤ԡͳеָԺͳơ + +־--------2006-05-31 +£1˲ǹɸĶԼ۵ıȨ + +־--------2006-05-30 +£1޶ֶʱʾٶ⡣ + 2ں + +־--------2006-05-15 +£1ں˸£ֱ֧дǿģ͡ + +־--------2006-03-15 +£1ں˸£COM֧֣֧''''PASCAL﷨ģʽ˶ַµı/дĶλ׼ȷ⡣ + 2޶ExcelԶԼֶ״̬ʱʾ⡣ + 3԰¡ + 4ǿCHARTͼѡʽ + 5WORDģ䡣 + +־--------2006-03-02 +£1ں˸¡ + 2ǿWordģ幦ܡ + 3԰¡ + +־--------2006-02-22 +£1޶ExcelԶԼֶ״̬ʱʾ⡣ + 2Excel¼㡣 + 3Excelʱ¼㡣 + 4ǿWordģ幦ܡ + 5԰2004µ2006档 + 6ָ֧Ԥᡣ + 7ǿ˼ģ顣 + +־--------2005-11-26 +£֧Excelָ봰ڵҼ˵û缾ȣȵĻݣԼչͳݡ + +־--------2005-11-16 +£Excelĺµ¡ + ǿںˡ + ********֧ԼдָԼǹָEXCELеĵá******* + +־--------2005-11-10 +ǿ1ڡרҡ-->չָ˰: + (1)Ҫֵָ꣨ 磺20057-9 + (2)ֵָ꣨ 磺20057-9 + (3)ӯֵ 磺20057-9 + (4)Ȼ һȵıȽ 磺20057-9 20044-6) + (5)ͬ ȥͬһȵıȽϣ磺20057-9 20047-9) + 2ڡ֤ȯרҡ-->ָˣ + 1Ȼ һȵıȽ 磺20057-9 20044-6) + 2ͬ ȥͬһȵıȽϣ磺20057-9 20047-9) + 3ڡ֤ȯרҡ-->չָ-->ӯ.о.. + (1)ξֵ(PRBR) + 4ڡרҡ-->չָ-->ӯ.о.. + (1)ξֵ(PRBR) + 5ڡ֤ȯרҡ-->-->ӯ + 1Ӫ˱(%) + 2ʱ(%) + 6ڡרҡ-->չָ-->ָ-->ӯ + 1Ӫ˱(%) + 2ʱ(%) + +־--------2005-10-31 +ǿǿExcelܡ +£µָ굽EXCELVBAģ顣 + +־--------2005-9-13 +WORDģͼεʾʽwordwritegraph ֿ֧Ϊ߿ͼ +ǿںǿ + +־--------2005-9-7 +ͳͼͼdzʱɫ쳣BUG + +־--------2005-9-5 +ǿǿŻͼ/ͼεܣ޸˰ٷֱʾ +ԭʾBUG + +־--------2005-8-7 +ǿǿ˺ͼѡܡ + +־--------2005-7-30 +ǿǿݵʱͼܣб֧֣ԼУȹܡ +£µEXCEL֧꣬ӵָĵá + +־--------2005-6-23 +ӣExcelԼָ棬ʹø㡣 + +־--------2005-6-12 +޶ExcelСڴй¶⣬ᵼռڴBUG +޶¶ݰװExcelڶ·ʹExcelʹ⡣ + +־--------2005-6-8 +Excel֧֡dzõĹܣ鿴 +޶еСBUG +ǿںǿ +ǿǿݱļԡ + +־--------2005-5-20 +޸ģʵǧֺűʾʹҶ룬ɺɫʾ + +־--------2005-5-19 +޸ģͲʹѡǰ +޸ģָĵ뵼ļģʽΪ֤ȯרҵ뵼ݡ + +־--------2005-5-13 +ֶ֧༶ͷEXCELܣԭĵֶ֧ܲ༶ͷ +ֵָ֧뵼ļ + +־--------2005-5-11 +ƱԼھԵѡɵõƱбʹø㡣 +˸ʽת˵øʽת㡣 +ºͲ˵ȼͬļ̾⡣ + +־--------2005-4-27 +ں֧չݡ +˲޷ȷն˵BUG + +־--------2005-4-25 +Ҫ֤ȯרһ߰רУڻԼչָϣҼзdzͳƹEnjoy it! +ĶĹ̶ܣʶв̶ +רз˵ָλƶBUG + +־--------2005-4-21 +ĶͼʾõĿŻʾõ +гѡС覴á +ӣںͳƵ֧֡ + +־--------2005-4-18 +Ķеģ÷صСδ +ijЩ¸ıִлԭIJ +еķ鿴˺ + +־--------2005-4-17 +򿪺ͱ/ʱĿ¼ԼɾͰ飬ֶ֧༶Ŀ¼ +ǿͼʾ +ںΪרͳƹܣ֧רָбҼͳƲ + +־--------2005-4-3 +ǿ˼̾飬ûҪ꼤½Ϳʹü̾ +缫˲ʱܳ˳ +ͼʾһ +˺༭ĹʹƤʱ쳣 + +־--------2005-3-28 +޶Win98/Win2000ģ͵ʾٶر⡣ +˹ƱԸϵͳ˸õ֧֡ + +־--------2005-3-23 +ӹܣز鿴͵ͼε--ͼΡ˵򹤾ϵġͼݡͼꡣ + л˹رݴڵĹ +޶ͳͼʱѡǵͼͼĬϲٷҳûʹá +BUGijӴڣл˵ضµԶλ + +־--------2005-3-22 +޶ƤͳͼWINDOWS2000/2003µIJ + +־--------2005-3-21 +޶Ĺܣ +Ƥ +һЩ޶ + +־--------2005-3-9 +޶Ĺܣ +˼ߣߣߵ +޶һЩ + +־--------2005-3-4 +޶Ĺܣ +1Ͽ¼ظ +2ѡûʱ˷ʾ +3޶޸ϵͳֵܳ +4޶лBUG +5ֱӹرհť +6˲鹦 +7ǿ + +־--------2005-1-24 +ҪûģͰĬϲִ +˼̾飨Ͻǣ +һͬʾ +ƱΪʹõĴ + +־--------2005-1-8 +CPUռ +޶Windows 2000Windows 9x/MeµIJ˵µģ/ָʾ +ǿרҵרҵĵ뵼ܣ +һ汾޷򿪵 +޶һ汾޷򿪰ʱרҵ +˺/ҵ֧֣֧ź/ҵݵķͻ + +־--------2005-1-7 +ǰCPUռʸߵ +ղִеб + +־--------2005-1-7 +ʾϢ޷Ĵ +µĽչ +޷ϴ˳ʱݵĴ +ģ͵ķ +¶ȱڣӵк/ҵݵķͻ¶ȱڷʸݣ +Դڵ֪⣺һϵͳ˵ܻʾڶͿ + +־--------2004-12-23 +ֶ֧༶ͷ +µĽչַʽ +ǿ + +־--------2004-12-2 +һЩ½СBUG򵼴󻯺ʹгָΪ֤A +һЩǿ + +־--------2004-11-25 +24һЩСBUG + +־--------2004-11-24 +1ҵ޶֧֤༶ҵࡣĿǰ//һ/ܺõ֧ +2ǿ + +־--------2004-11-11 +1޶˽ϵһЩС +2Ż˺ģʹڴԸ +3޶˹ƱгܴڶĴ +4ǿ˶ݵ֧š +5޶ȵطִֹкϵͳڱصĽǵ⡣ +6ծȯתծصBUG + +־--------2004-10-21 +1½ĹʹõBUG +2޶ijЩ״̬˳ʱᱨBUG +3޶˵ûIEİȫΪҪȷϵʱû޷ʹȫϵͳеĹƱѯBUG + +־--------2004-10-19 +1ָ޷ʹõBUG +2޶˻ԭԼرհť + + +־--------2004-10-15 +1޷س +2޶󻯺ĴڹرҪʹлĿҼ +3ں˸ + +־--------2004-9-8 +˼ϵͳ֧źԼַĶֽֽ֧޶ûWEBԻ + +־--------2004-7-22 +ڰװTemplatesĿ¼˲Լ˾оģ壬ûۺӦģɱ档 + +־--------2004-7-3 +µ԰Ҫ£CGIExcelWordTSLExcelGUIȡ + +־--------2004-6-30 +ֱWORDģɱ(ģֻʱԴ) +ʾϢԻַʾļ򿪶ԻȵȺWORDģнн +˴EXCEL︴ݵWORDеĹܣֱ֧ӸԼƳΪͼƬĹܣWORDģֱӴEXCELݡ + +־--------2004-6-28 +޶һ޶汾޷չ +ǿһЩϵͳŻ + +־--------2004-6-25 +Сҵ֧ +ϵͳһЩŻ޶˼СBUG +˶CGI֧ + +־--------2004-6-17 +԰ +Wordģ崦ֱϵͳֵ֧мͼΣKߣɽMACDȵȡϵͳΪWordWriteGraphװĹúΪWordWriteSysGraph,SetResultGraph,GetSysStoreGraphȡ + ǿWordWriteֱͼΡ޶WordWriteChartһЩWORD + WordWritePicFromFileWORDģڴӲͼļ + +־--------2004-6-11 +԰ʹCHM汾 +ʹý档 + +־--------2004-6-7 +԰ļ + +־--------2004-6-4 +ǿDOCģ崦ܣǿ˴⡣޶ChartͼĴСһ⡣ + +־--------2004-6-3 +չ˰˺ϳɰ֧֡磺ĿǰڲҪ½κΰĻ ֤A ֤A ϳΪ ֤A#֤A °顣 + +־--------2004-5-31 +ģ+WORDģֱɱ棨WORDĵĹܣ߱ݵûȨʹñܡ +ʽ֧ +HTTPHTML֧ +ǿԵһЩ +޶ijЩصļ⣨new dot net 622 + +־--------2004-3-24 +˸۹ɵĽݣüָ鿴ȡȡ佻ݡ +ЩС͵Ĺܽ½ӵС + +־--------2004-3-2 +ǿ˴ļԣ˶UNIX֧֣˴Ӵ־ +޶˴޷BUG +޶˵ʼг޷ֱ˳BUG + +־--------2004-2-13 +XMLֵ֧֣֧XML͡ҿԴӵXMLʽݡ + +־--------2004-1-17 +1һdzú(DeleteIndex)BUG + +־--------2004-1-5 +1˱༭޷Ҽ򿪹BUG + +־--------2003-12-21 +1ڴʼʾ⡣ +2ǿ˰鵼ĸʽֱ֧000001λʽĵ룬֧1ʾ0000012ʾ000002Ĵʽ +3ˡ롱İťĵֱڰڽˡ + +־--------2003-12-20 +1˽pascal﷨MOD,DIV֧֡ + +־--------2003-12-17 +1޶һȨ޴BUG +2ǰ֧µ + +־--------2003-11-27 +1ͬһ򵼲Ľٴ򿪶ڡ +2ڰ˵м˳õʹðӡ + +־--------2003-11-24 +1ǿ˰汾ƹ,˰汾У鹦 +2ǿͳͼιܡ +BUG +1޶Զ򿪵򵼵ггΪյBUG + +־--------2003-11-5 +1˲о + +־--------2003-10-17 +ǿ +1ǿ˶ԷԵ֧֡ + +־--------2003-10-16 +BUG +1δΪԶصʱ󻯵ĴвֱڸǵBUG +־--------2003-10-10 +С +1ijЩ800*600ģʽ¹⡣ +2ָӻʱIJԶ޸Ļص⡣ + +־--------2003-9-29 +BUG +1ڲ޸ЧBUGdzصBUG£ + +־--------2003-9-27 +BUG +1ijЩ½ϵͳú޷ԶBUGdz΢BUG + +־--------2003-9-26 +BUG +1ִָкѡ˳ȨȻʾɲȨBUG +2ִָʱüָ޲öͼʽȻʾûBUG +3Win95,Win98²BUG +־--------2003-9-25 +3.0 +BUG +1չݲҪûݣֱӵ +2һijЩؽ޷ֵBUG +3֤ȯڲе֤ȯBUG +ǿܣ +1 ר ҹ +2 רпֱ ָꡱд򣬿ԷؽеָµʱָΪ߷ +3Ϊ˷ֹûڲ֪ʱδ еݣʹʹ򵼲ȷ´ν򵼵ʱ ʹñ +4Ϊ˷ֹûʹ򵼵ʱ򣬶ԷΧ ͬʱСг顱ԼƱбϵݲ⣬޸Ϊ ֻѡһ +5 ļ ĹܣԲҪûݵĹܣֱӴеļݡ +6򵼵 УֱӷȱֶݣʮɶĹɶƣû зҪűƱ.ʮɶ +7˵ϵͳãԶϵͳ෽жơ +8򵼵Ĺܼ˺༭Լʽ༭С +9ʼֶ֧ +10ԶĹܣ˳ʱ򿪵´νʱ´򿪡 +11ǿ˶ͳͼָ֧֣֧ӵͳͼΡ +12ǿij +================================================================================================================ +־--------2003-8-3 +BUG +1ͲרеBUG + BUGרУѡеָͲһ޸ĵڲЧȻ޸ǰIJֵ + BUGԣdzء +2еĹתΪûBUG + BUGרе鵼뵼У޷ʹõ˵תΪû顣ǸûѾڡ + BUGԣһ㡣 +ǿĹܣ + רеУǿ˶޸ûиµĹܡ + ʹ÷޸ĺûõ˵¡ + +־--------2003-7-31 +BUG +ָķص˺IJǵ޸IJֶʾ + +־--------2003-7-30 +BUG +޶˷ߵʱ޷д޸ĵ⡣ +ǿܣ +ָķص˺IJʹò@1,@2ֱ档 +ûڽýģͶԽٴǽǿЩܣû̳Ϊṩ顣 + +־--------2003-7-24 +BUG£ +ڲΪߵʱʾʱѡ +չܵڴй¶ +ǿܣ +չĹ˲֧֣ѡԵΪչĿհ״ + + +־--------2003-7-23 +BUG£ +ϵͳ;ϿϵͳдԼ1%ĸʲãҪٴζϿϵͳ⡣ +ǿܣ +1ڹIJαݣȯֹ̳ɽ򵼷кбݵ緵طֺȣԶչƽ + ʹõķΪΪݣڱĹϣһչݵİťչɴһչ´ڡ + ע⣺չıݷdz࣬ҪȽϳʱ䣬缸 +2ڱеNILݣĬʾΪգ""ڱĹϣṩһNILťѡϿʾΪ"" +3һгࣺгммծȯңʽֹУͣ + +־--------2003-7-18 +BUG£ +ϵͳװExcelOffice XPµİ汾޷ȷص.XLSļ⡣ + +־--------2003-7-16 +BUG£ +СʾBUG +ǿܣ +˶ԿʽмծȯҶһʡʵȵ֧ + +־--------2003-6-23 +BUG£ +1ûĸҪſʹõ⡣ +2ؼ +3ͼʽֱKߵ +4־µ¼޷ +5ûȡƵ޷ʹõ +6Сն˺󣬵ʱʾȻС +ǿܣ +1רҴѾѡõԼأõ˵ɾƶλ +2רзصĻڵȱʾ +־--------2003-6-10 +ڽҼ쿴ָĹƱ߰/гָꡣӦĶںԶ +ǿ˰顢ƱĽ +ڹȡ˰鲿֣Ӧ˵ġϵͳ->ҵ +ڹȡûݲ֣Ӧ˵ ݡҵ +лȡ˴ڲ˵ûлдڵл +ĹƱָѡȡܡùܣΪ߼湦ܣ + +־--------2003-5-31 +ĿǰѾ֧Windows 95ˡҪWindows 95ʹãذװװ +Windows 95 & Windows 98ϣ޷ʹñƷļȱһЩϵͳԵʡ + +http://download.microsoft.com/download/vc60pro/Update/1/W9XNT4/EN-US/VC6RedistSetup_enu.exe +VCRedist.exeͷŵһĿ¼VCRedistаװ +־--------2003-5-29 +µ֧Win98İװ汾ѾWEBϸˣҪװWIN98ϣذװ +־--------2003-5-29 +BUG: +1޶һ汾WIN98쳣 +޸Ĺܣ +1ȥ˺ȼ +־--------2003-5-24 +BUG: +1޷ִй +2޶ijЩԻʾ +3޶˲ʾʱĬϲд +4޶˵ʾһЩͼģָͣϣʱȻʾƱԼڡȨBUG +5޶ִкĴijЩʱ򲻿Ԥ֪˳BUG +6޶ڰ༭в½BUG +7޶һЩԻаESCBUG¼Ի +ӹܣ +1ѡɡרģ飻ûģѡԼȡԼúչָ +2˺ķ࣬ͣȼĶ +3˽ΪĹ +4ȥӦò˵˰ӦõIJ˵ +־--------2003-4-3 +2.0汾 +ӹܣ +1ڵIJ˵ִ +2ڵIJ˵ṩҼûʹ +3ڵλáС״̬Ա¼ +4ÿݴڶԽΪûݣûݱʹá +5ȡ˶ĵģʽ +6޶ͼܱеBUG +7ʼ˱ػĹ \ No newline at end of file diff --git a/widevinecdmadapter.dll b/widevinecdmadapter.dll new file mode 100644 index 0000000..a8e18bd Binary files /dev/null and b/widevinecdmadapter.dll differ