{"id":5264,"date":"2024-09-22T16:01:01","date_gmt":"2024-09-22T08:01:01","guid":{"rendered":""},"modified":"2024-09-22T16:01:01","modified_gmt":"2024-09-22T08:01:01","slug":"delphi\u662f\u9762\u5411\u5bf9\u8c61\u7684\u53ef\u89c6\u5316\u7684\u5f00\u53d1\u73af\u5883_python\u9762\u5411\u5bf9\u8c61\u548c\u9762\u5411\u8fc7\u7a0b\u7684\u533a\u522b","status":"publish","type":"post","link":"https:\/\/mushiming.com\/5264.html","title":{"rendered":"delphi\u662f\u9762\u5411\u5bf9\u8c61\u7684\u53ef\u89c6\u5316\u7684\u5f00\u53d1\u73af\u5883_python\u9762\u5411\u5bf9\u8c61\u548c\u9762\u5411\u8fc7\u7a0b\u7684\u533a\u522b"},"content":{"rendered":"

  <\/p>\n

\n Delphi<\/span><\/strong>
\n \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u768420\u6761\u89c4\u5219<\/span><\/strong>\n<\/div>\n
\n  \n<\/div>\n
\n \u524d\u8a00<\/span><\/font><\/strong>\n<\/div>\n
\n
\n    
\n \u8bc4\u8ff0\uff1a<\/strong>\u57282006\u5e7410\u6708\u4efd\u6211\u7b2c\u4e00\u6b21\u770b\u5230\u8fd9\u7bc7\u6587\u7ae0\uff0c\u90a3\u65f6\u5019\u867d\u7136\u5df2\u7ecf\u7528Delphi\u5f00\u53d1\u7cfb\u7edf\u4e00\u5e74\u4e86\uff0c\u4f46\u8fd8\u662f\u7b2c\u4e00\u6b21\u63a5\u89e6\u9762\u5411\u5bf9\u8c61\uff08\u76f8\u4fe1\u56fd\u5185\u4e0d\u5c11\u7684\u9879\u76ee\u867d\u7136\u91c7\u7528Delphi\uff0c\u4f46\u662f\u5e76\u6ca1\u6709\u4f7f\u7528OO\u6280\u672f\uff0c\u53ef\u60b2\u554a\uff09\uff0c\u56e0\u6b64\u8fd8\u4e0d\u662f\u5f88\u7406\u89e3\u91cc\u9762\u8bf4\u4e86\u4ec0\u4e48\u3002\u540e\u6765\u5728\u505a\u89c6\u9891\u76d1\u63a7\u7cfb\u7edf\u65f6\u7b2c\u4e00\u6b21\u4f7f\u7528\u4e86Delphi OO\u6280\u672f\uff0c\u56e0\u6b64\u5bf9\u5176\u4e2d\u4e00\u4e9b\u539f\u5219\u6709\u4e86\u6df1\u5165\u4e86\u7406\u89e3\u3002\u53e6\u5916\uff0c\u7531\u4e8e\u7ffb\u8bd1\u7684\u539f\u56e0\uff0c\u5927\u5e08\u7684\u5f88\u591a\u8bdd\u4e0d\u662f\u592a\u901a\u4fd7\uff0c\u56e0\u6b64\u6211\u505a\u4e86\u4e00\u4e9b\u901a\u4fd7\u5316\u7684\u6ce8\u89e3\u3002\u540e\u9762\u7684\u539f\u5219\u6211\u8fd8\u6ca1\u6709\u8df5\u884c\u8fc7\uff0c\u7b49\u5230\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5b9e\u8df5\u8fc7\u624d\u77e5\u9053\u662f\u4e0d\u662f\u771f\u7684\u9700\u8981\u90a3\u6837\u505a\u3002\uff08\u5728DEMO\u4e2d\u5b9e\u73b0\u548c\u5728\u771f\u5b9e\u590d\u6742\u7684\u5b9e\u9645\u73af\u5883\u4e2d\u5b9e\u73b0\u6bd5\u7adf\u662f\u4e24\u7801\u4e8b\u3002\uff09\n <\/div>\n<\/div>\n
\n \u5927\u591a\u6570Delphi\u7a0b\u5e8f\u5458\u90fd\u50cf\u4f7f\u7528Visual Basic \u90a3\u6837\u4f7f\u7528\u4ed6\u4eec\u624b\u5934\u4e0a\u5f00\u53d1\u5de5\u5177\uff0c\u800c\u4e1d\u6beb\u6ca1\u6709\u610f\u8bc6\u5230Delphi\u7684\u5f3a\u5927\u529f\u80fd\uff0c\u66f4\u8c08\u4e0d\u4e0a\u4f7f\u7528\u8fd9\u4e9b\u529f\u80fd\u4e86\u3002(\u5199\u5230\u8fd9\u91cc\uff0c\u7f16\u8f91\u60f6\u6050\u7684\u4e3e\u8d77\u4e86\u624b\uff0c\u600e\u4e48\u53ef\u80fd\u5462\uff1f)Delphi\u548cVisual Basic\u4e0d\u540c\uff0cDelphi\u5b8c\u5168\u5efa\u7acb\u5728\u9762\u5411\u5bf9\u8c61\u7ed3\u6784\u4e0a,\u8fd9\u4e0d\u4ec5\u5f71\u54cd\u5230VCL\u7684\u7ed3\u6784\uff0c\u800c\u4e14\u5f71\u54cd\u5230\u4f7f\u7528Delphi\u5f00\u53d1\u7684\u6bcf\u4e00\u4e2a\u7a0b\u5e8f\u3002\n<\/div>\n
\n \u5728\u672c\u6587\u4e2d\uff0c\u6211\u4e0d\u60f3\u6d89\u53ca\u5230\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff08OOP\uff09\u7684\u6240\u6709\u7406\u8bba,\u53ea\u662f\u63d0\u51fa\u4e00\u4e9b\u7b80\u5355\u7684\u7ecf\u9a8c\u89c4\u5219\u3002\u5e0c\u671b\u8fd9\u4e9b\u89c4\u5219\u80fd\u591f\u5e2e\u52a9\u6539\u5584\u4f60\u7684\u7a0b\u5e8f\u7ed3\u6784\u3002\u65e0\u8bba\u4f60\u5f00\u53d1\u7684\u662f\u4f55\u79cd\u7c7b\u578b\u7684\u7a0b\u5e8f\uff0c\u8fd9\u4e9b\u7ecf\u9a8c\u89c4\u5219\u90fd\u662f\u9002\u7528\u7684\u3002\u4f60\u5e94\u5f53\u628a\u4ed6\u4eec\u5f53\u4f5c\u4e00\u4e9b\u5efa\u8bae\uff0c\u8bb0\u4f4f\u4ed6\u4eec\u5e76\u628a\u4ed6\u4eec\u5e94\u7528\u5230\u4f60\u5f00\u53d1\u7684\u7a0b\u5e8f\u4e2d\u53bb\u3002\n<\/div>\n
\n \u5173\u4e8e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff0c
\n \u6211\u60f3\u5f3a\u8c03\u7684\u4e00\u4e2a\u5173\u952e\u539f\u7406\u662f\u5c01\u88c5<\/strong> [U1] \u3002\u6211\u4eec\u90fd\u5e0c\u671b\u521b\u5efa\u4e00\u4e9b\u7075\u6d3b\u800c\u4e14\u5f3a\u5065\u7684\u7c7b\uff0c\u56e0\u4e3a\u8fd9\u6837\u7684\u7c7b\u5141\u8bb8\u6211\u4eec\u4ee5\u540e\u4fee\u6539\u4ed6\u4eec\u7684\u5b9e\u73b0\u65b9\u6cd5\u800c\u4e0d\u5f71\u54cd\u5230\u7a0b\u5e8f\u4e2d\u7684\u5176\u4ed6\u90e8\u5206\uff0c\u8fd9\u6b63\u662f\u5c01\u88c5\u7ed9\u6211\u4eec\u5e26\u6765\u7684\u597d\u5904\u3002\u867d\u7136\u5c01\u88c5\u4e0d\u662f\u521b\u5efa\u4e00\u4e2a\u597d\u7684\u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u7684\u552f\u4e00\u6807\u51c6\uff0c\u4f46\u662f\u5b83\u6784\u6210\u4e86\u9762\u76f8\u5bf9\u8c61\u7f16\u7a0b\u7684\u57fa\u7840\uff0c\u6240\u4ee5\u5728\u672c\u6587\u4e2d\u6211\u4e5f\u8bb8\u4f1a\u8fc7\u591a\u7684\u5f3a\u8c03\u5c01\u88c5\u6027\uff0c\u8bf7\u4e0d\u8981\u611f\u5230\u5947\u602a\uff0c\u6211\u6709\u8db3\u591f\u5145\u5206\u7684\u7406\u7531\u8fd9\u4e48\u505a\u3002\n<\/div>\n
\n \u6700\u540e\uff0c\u6211\u60f3\u8bf4\u660e\u8fd9\u6837\u4e00\u4e2a\u4e8b\u5b9e\uff1a\u672c\u6587\u5c06\u4e3b\u8981\u96c6\u4e2d\u8bf4\u660e\u7a97\u4f53\uff08Forms\uff09\u7684\u5f00\u53d1\uff08\u867d\u7136\u5176\u4e2d\u7684\u4e00\u4e9b\u89c4\u5219\u5bf9\u4e8e\u7ec4\u4ef6\u7684\u5f00\u53d1\u540c\u6837\u9002\u7528\uff09\uff0c\u56e0\u6b64\u8fd9\u4e9b\u89c4\u5219\u5bf9\u4e8e\u6240\u6709\u7684Delphi\u7a0b\u5e8f\u5458\u90fd\u662f\u9002\u7528\u7684\u3002\u90a3\u4e9b\u7f16\u5199\u7ec4\u4ef6\u7684\u7a0b\u5e8f\u5458\u5fc5\u987b\u628a\u9762\u76f8\u5bf9\u8c61\u7f16\u7a0b\u548c\u7c7b\uff08Class\uff09\u4f5c\u4e3a\u6838\u5fc3\u7684\u5143\u7d20\uff0c\u4f46\u662f\u5bf9\u4e8e\u90a3\u4e9b\u4f7f\u7528\u7ec4\u4ef6\u7f16\u7a0b\u7684\u7a0b\u5e8f\u5458\uff0c\u4ed6\u4eec\u65f6\u5e38\u4f1a\u5fd8\u8bb0\u9762\u5411\u5bf9\u8c61\u3002\u5bf9\u4e8e\u4ed6\u4eec\uff0c\u672c\u6587\u53ef\u4ee5\u5f53\u4f5c\u4e00\u4e2a\u63d0\u793a\uff0c\u63d0\u9192\u4ed6\u4eec\u59cb\u7ec8\u8bb0\u4f4f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\n<\/div>\n
\n  \n<\/div>\n
\n \u7b2c\u4e00\u90e8\u5206\uff1a\u7a97\u4f53\u662f\u7c7b\uff08A Form is A Class\uff09(rule 1-rule 15)\n<\/div>\n
\n \u7a0b\u5e8f\u5458\u5e38\u5e38\u5c06\u7a97\u4f53\u770b\u4f5c\u662f\u5bf9\u8c61\uff0c\u800c\u4e8b\u5b9e\u4e0a\u7a97\u4f53\u662f\u7c7b\u3002\u4e24\u8005\u7684\u5dee\u522b\u5728\u4e8e\u4f60\u521b\u5efa\u57fa\u4e8e\u76f8\u540c\u7684\u7a97\u4f53\u7c7b\u7684\u591a\u4e2a\u7a97\u4f53\u5bf9\u8c61\u3002\u4ee4\u4eba\u611f\u5230\u7591\u60d1\u7684\u662fDelphi\u4e3a\u4f60\u5b9a\u4e49\u7684\u6bcf\u4e00\u4e2a\u7a97\u4f53\u7c7b\u521b\u5efa\u4e86\u4e00\u4e2a\u9ed8\u8ba4\u7684\u5168\u5c40\u5bf9\u8c61\u3002\u8fd9\u5bf9\u4e8e\u65b0\u624b\u6765\u8bf4\u662f\u76f8\u5f53\u65b9\u4fbf\u7684\uff0c\u4f46\u662f\u8fd9\u540c\u6837\u4f1a\u4f7f\u4ed6\u4eec\u5f62\u6210\u574f\u4e60\u60ef\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u7b2c\u4e8c\u90e8\u5206\uff1a\u7ee7\u627f\uff08Inheritance\uff09(rule 15-rule 20)\n<\/div>\n
\n \u5728\u8bb2\u8ff0\u4e86\u4e00\u7cfb\u5217\u5173\u4e8e\u7c7b\u7279\u522b\u662f\u5173\u4e8e\u7a97\u4f53\u7c7b\u7684\u89c4\u5219\u540e\uff0c\u7b2c\u4e8c\u90e8\u5206\u5c06\u662f\u4e00\u4e9b\u5173\u4e8e\u7c7b\u7684\u7ee7\u627f\u6027\u4ee5\u53ca\u53ef\u89c6\u5316\u7a97\u4f53\u7ee7\u627f\u7684\u5efa\u8bae\u548c\u6280\u5de7\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u5173\u4e8e\u4ee3\u7801\n<\/div>\n
\n \u672c\u6587\u4e2d\u6240\u6709\u7684\u4ee3\u7801\u6bb5\u90fd\u53ef\u4ee5\u5728\u672c\u671f\u6742\u5fd7\uff08\u300aThe Delphi Magazine\u300b Issue 47\uff09\u9644\u5e26\u7684\u78c1\u76d8\u4e2d\u7684OopDemo\u5de5\u7a0b\u4e2d\u627e\u5230\u3002\u4f60\u7279\u522b\u5e94\u8be5\u67e5\u770b\u4f8b\u7a0b\u4e2d\u7684frm2 \u5355\u5143\uff08unit\uff09\u548cinher\u5355\u5143\u3002\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u8fd9\u4e9b\u4ee3\u7801\uff0c\u8bf7\u6ce8\u610f\u6784\u9020\u5668\u5fc5\u8981\u7684\u521d\u59cb\u5316\u8bbe\u7f6e\u4ee5\u53ca\u79c1\u6709\u7ec4\u4ef6\u53c2\u7167\uff0c\u540c\u65f6\u6709\u5fc5\u8981\u8bbe\u7f6e\u597d\u7a97\u4f53\u7684OldCreateOrder\u5c5e\u6027\u3002\u5426\u5219\uff0c\u5e26\u6709\u7ec4\u4ef6\u7684\u7a97\u4f53\u6784\u9020\u5668\u7684\u521d\u59cb\u5316\u4ee3\u7801\u5c06\u5728\u7a97\u4f53\u7684OnCreate\u4e8b\u4ef6\u4e4b\u524d\u5f97\u5230\u6267\u884c\u3002\n<\/div>\n
\n \u5728\u8fd9\u5f20\u78c1\u76d8\u4e0a\u4f60\u8fd8\u53ef\u4ee5\u627e\u5230OOP \u7a97\u4f53\u5411\u5bfc\u7684\u7b2c\u4e00\u7248\u7684\u7f16\u8bd1\u5305\uff0c\u4e0d\u8fc7\u6211\u66f4\u5e0c\u671b\u4f60\u8bbf\u95ee\u6211\u7684\u7f51\u7ad9\u83b7\u5f97\u8be5\u7a0b\u5e8f\u7684\u66f4\u5b8c\u6574\u7684\u7248\u672c\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219\u4e00\uff1a\u4e3a\u6bcf\u4e00\u4e2a\u7c7b\u521b\u5efa\u4e00\u4e2a\u5355\u5143\uff08<\/span>One Class,One Unit<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n    \u8bf7\u59cb\u7ec8\u7262\u8bb0\u8fd9\u4e00\u70b9\uff1a
\n \u7c7b\u7684\u79c1\u6709<\/strong>
\n (private)<\/strong>
\n \u548c\u4fdd\u62a4(protected)<\/strong>
\n \u7684\u90e8\u5206\u53ea\u5bf9\u4e8e\u5176\u4ed6\u5355\u5143\u4e2d\u7684\u7c7b\u548c\u8fc7\u7a0b\uff08procedure<\/strong>
\n \uff09\u624d\u662f\u9690\u85cf\u7684<\/strong>.\u56e0\u6b64\uff0c\u5982\u679c\u4f60\u60f3\u5f97\u5230\u6709\u6548\u7684\u5c01\u88c5\u6027\uff0c\u4f60\u5e94\u8be5\u4e3a\u6bcf\u4e00\u4e2a\u7c7b\u4f7f\u7528\u4e00\u4e2a\u4e0d\u540c\u7684\u5355\u5143\u3002\u5bf9\u4e8e\u4e00\u4e9b\u7b80\u5355\u7684\u7c7b\uff0c\u6bd4\u5982\u90a3\u4e9b\u7ee7\u627f\u5176\u4ed6\u7c7b\u7684\u7c7b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a
\n \u5171\u4eab\u7684\u5355\u5143\u3002<\/strong>\u4e0d\u8fc7\u5171\u4eab\u540c\u4e00\u4e2a\u5355\u5143\u7684\u7c7b\u7684\u6570\u76ee\u662f\u53d7\u5230\u9650\u5236\u7684\uff1a\u4e0d\u8981\u5728\u4e00\u4e2a\u7b80\u5355\u7684\u5355\u5143\u91cc\u653e\u7f6e\u8d85\u8fc720\u4e2a\u590d\u6742\u7684\u7c7b\uff0c\u867d\u7136Borland\u516c\u53f8\u7684VCL\u4ee3\u7801\u66fe\u7ecf\u8fd9\u6837\u505a\u8fc7\u3002\n<\/div>\n
\n
\n \u8bc4\u8ff0\uff1a<\/strong>\u90a3\u65f6\u8fd8\u6ca1\u8fdb\u884cDelphi\u9762\u5411\u5bf9\u8c61\u5b9e\u8df5\u4e4b\u524d\uff0c\u770b\u8fd9\u6bb5\u6587\u5b57\u8fd8\u771f\u662f\u770b\u4e0d\u61c2\uff0c\u56e0\u4e3a\u6700\u57fa\u672c\u7684\u6982\u5ff5\u90fd\u4e0d\u662f\u5f88\u660e\u767d\u3002Delphi\u8fd9\u91cc\u9762\u5b9a\u4e49\u7c7b\uff08class\uff09\u8ddfPHP\u5f88\u50cf\uff0c\u8ddfJava\u5219\u4e0d\u540c\u3002\u5728Java\u4e2d\uff0c\u6bcf\u4e2ajava\u6587\u4ef6\u4e2d\u5fc5\u987b\u6709\u4e00\u4e2a\u7c7b\u7684\u540d\u5b57\u548c\u6587\u4ef6\u540d\u76f8\u540c\uff1b\u800cDelphi\u548cPHP\u5219\u4e0d\u540c\uff0c\u53ea\u662f\u628a\u7c7b\u653e\u5728.pas\u6216.php\u6587\u4ef6\u4e2d\u800c\u5df2\uff0c\u7c7b\u540d\u548c\u6587\u4ef6\u540d\u6ca1\u4ec0\u4e48\u5173\u7cfb\u3002\u5982\u679c\u5728\u540c\u4e00\u4e2apas\u6587\u4ef6\u4e2d\uff0c\u4e5f\u5c31\u662f\u8bf4\u51e0\u4e2a\u7c7b\u5728\u540c\u4e00\u4e2aUnit\u4e2d\uff0c\u67d0\u4e2a\u7c7b\u7684\u79c1\u6709\u548c\u4fdd\u62a4\u7684\u90e8\u5206\u662f\u4e0d\u5bf9\u5176\u4ed6\u7c7b\u9690\u85cf\u7684\u3002\u5176\u5b9e\u8fd9\u5c31\u5bf9\u5e94\u50cfVB\u4e4b\u7c7b\u4e2d\u6240\u8bb2\u7684\u6a21\u5757\u7ea7\u7684\u5168\u5c40\u53d8\u91cf\u3002\u6240\u8c13\u7684\u201c\u5171\u4eab\u201d\u540c\u4e00\u4e2a\u5355\u5143\u7684\u7c7b\uff0c\u8bf4\u767d\u4e86\u5c31\u662f\u653e\u5728\u4e00\u4e2aUnit\u6587\u4ef6\u4e2d\u7684\u7c7b\u3002\n <\/div>\n<\/div>\n
\n     \u5982\u679c\u4f60\u4f7f\u7528\u7a97\u4f53\u7684\u65f6\u5019\uff0cDelphi\u4f1a\u9ed8\u8ba4\u7684\u9075\u5faa\u201c\u4e00\u4e2a\u7c7b\u4f7f\u7528\u4e00\u4e2a\u5355\u5143\u201d\u7684\u89c4\u5219\uff0c\u8fd9\u5bf9\u4e8e\u7a0b\u5e8f\u5458\u6765\u8bf4\u4e5f\u662f\u5341\u5206\u65b9\u4fbf\u7684\u3002\u5f53\u4f60\u5411\u4f60\u7684\u9879\u76ee\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u6ca1\u6709\u7a97\u4f53\u7684\u7c7b\u65f6\uff0cDelphi\u4e5f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u72ec\u7acb\u7684\u5355\u5143\u3002\n<\/div>\n
\n
\n unit UVideo;
\n {
\n <\/span>\u5728\u8fd9\u4e2a\u53eb\u505a<\/span><\/em><\/strong>UVideo<\/span><\/em><\/strong>\u7684<\/span>Unit<\/span><\/em><\/strong>\u91cc\u53ef\u4ee5\u5199\u597d\u591a\u7c7b\uff0c\u800c\u4e14\u7c7b\u540d\u6ca1\u6709\u5fc5\u8981\u53eb<\/span><\/em><\/strong>UVideo<\/span><\/em><\/strong>\uff0c\u6bd4\u8f83\u597d\u7684\u547d\u540d\u89c4\u8303\u662f\u7c7b\u540d\u4ee5<\/span>T<\/span><\/em><\/strong>\u5f00\u5934\uff0c\u7136\u540e\u8ddf\u6240\u5728\u7684<\/span><\/em><\/strong>Unit<\/span><\/em><\/strong>\u53eb\u4e00\u4e2a\u540d\u5b57\uff0c\u5e76\u4e14\u4e00\u4e2a<\/span>Unit<\/span><\/em><\/strong>\u4e2d\u53ea\u5b9a\u4e49\u4e00\u4e2a\u7c7b<\/span>}<\/span><\/em><\/strong><\/em><\/strong>\n <\/div>\n
\n  \n <\/div>\n
\n  \n <\/div>\n
\n interface\n <\/div>\n
\n  uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,\n <\/div>\n
\n   Dialogs,StdCtrls, Buttons,Uds40xxsdk, UPhoto,ExtCtrls;\n <\/div>\n
\n  \n <\/div>\n
\n  Type\n <\/div>\n
\n   
\n  TVideo=class   \/\/<\/span><\/strong>
\n \u58f0\u660e\u7c7b<\/span><\/strong>\n <\/div>\n
\n     
\n  private<\/strong>\n <\/div>\n
\n        
\n {Field}\/\/<\/span><\/strong>
\n \u5c5e\u6027<\/span><\/strong>\n <\/div>\n
\n          channel :integer; \/\/\u663e\u793a\u7b2c\u51e0\u9891\u9053\u7684\u89c6\u9891\n <\/div>\n
\n          photo   :TPhoto;   \/\/\u8fd9\u4e2a\u89c6\u9891\u5bf9\u5e94\u7684\u56fe\u7247\n <\/div>\n
\n          grect   :TRECT;   \/\/\u663e\u793a\u89c6\u9891\u7684\u533a\u57df\n <\/div>\n
\n          hwnGb   :HWND;    \/\/\u663e\u793a\u89c6\u9891\u7684\u533a\u57df\u7684\u53e5\u67c4\n <\/div>\n
\n          control :TControl; \/\/\u63a7\u4ef6\n <\/div>\n
\n          ctlPhoto:Tcontrol;\/\/\u63a7\u4ef6\n <\/div>\n
\n         
\n {Method}\/\/<\/span><\/strong>
\n \u65b9\u6cd5<\/span><\/strong>\n <\/div>\n
\n  \n <\/div>\n
\n      
\n public<\/strong>\n <\/div>\n
\n          \/\/<\/span><\/strong>
\n \u91cd\u65b0\u5b9a\u4e49\u6784\u9020\u5668<\/span><\/strong>\n <\/div>\n
\n         
\n constructor <\/strong>create(newChannel:string;newControl:TControl;newCtlPhoto:TControl);overload;\n <\/div>\n
\n         
\n procedure<\/strong> showVideo();\n <\/div>\n
\n          procedure capturePhoto();\n <\/div>\n
\n          procedure stopVideo();\n <\/div>\n
\n          procedure setControl(newControl:TControl);\n <\/div>\n
\n     
\n  published  \/\/<\/span><\/strong>
\n \u5c5e\u6027\uff0c\u907f\u514d\u4e86\u81ea\u5df1\u5199<\/span>setter<\/span><\/strong>
\n \u548c<\/span>getter<\/span><\/strong>\n <\/div>\n
\n         
\n property<\/strong> ctlVideo:TControl read control write setControl;\n <\/div>\n
\n          property photoInstance:TPhoto read photo write photo;\n <\/div>\n
\n     end;\n <\/div>\n
\n  \n <\/div>\n
\n     procedure Drawfun(nPort:integer;hDc:HDC;nUser:integer);stdcall;\n <\/div>\n
\n implementation<\/strong>\n <\/div>\n
\n  \n <\/div>\n
\n { Video }<\/em>\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219\u4e8c\uff1a\u4e3a\u7ec4\u4ef6\u547d\u540d\uff08<\/span>Name Components<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u4e3a\u6bcf\u4e00\u4e2a\u7a97\u4f53\u548c\u5355\u5143\u7ed9\u51fa\u4e00\u4e2a\u6709\u610f\u4e49\u7684\u540d\u5b57\u662f\u5341\u5206\u91cd\u8981\u7684\u3002\u7a97\u4f53\u548c\u5355\u5143\u7684\u540d\u5b57\u5fc5\u987b\u662f\u4e0d\u540c\u7684\uff0c\u4e0d\u8fc7\u6211\u8d8b\u5411\u4e8e\u4e3a\u4ed6\u4eec\u4e24\u8005\u4f7f\u7528\u76f8\u4f3c\u7684\u540d\u5b57\uff0c\u5982\u5bf9\u4e8e\u5173\u4e8e\u7a97\u4f53\u548c\u5355\u5143\u53ef\u4ee5\u4e3a\u4ed6\u4eec\u4f7f\u7528AboutForm \u548cAbout.pas.\n<\/div>\n
\n \u4e3a\u7ec4\u4ef6\u4f7f\u7528\u5e26\u6709\u63cf\u8ff0\u6027\u7684\u540d\u5b57\u540c\u6837\u5341\u5206\u91cd\u8981\u3002\u6700\u5e38\u89c1\u7684\u547d\u540d\u65b9\u5f0f\u662f\u4f7f\u7528\u7c7b\u7684\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\uff0c\u518d\u52a0\u4e0a\u7ec4\u4ef6\u7684\u529f\u80fd\uff0c\u5982BtnAdd \u6216\u8005editName\u3002\u91c7\u7528\u8fd9\u6837\u7684\u547d\u540d\u65b9\u5f0f\u4e3a\u7ec4\u4ef6\u547d\u540d\u53ef\u80fd\u4f1a\u6709\u5f88\u591a\u76f8\u4f3c\u7684\u540d\u5b57\uff0c\u800c\u4e14\u4e5f\u6ca1\u6709\u4e00\u4e2a\u6700\u597d\u7684\u540d\u5b57\uff0c\u5230\u5e95\u5e94\u8be5\u9009\u62e9\u90a3\u4e00\u4e2a\u5e94\u8be5\u4f9d\u636e\u4f60\u7684\u4e2a\u4eba\u7231\u597d\u800c\u5b9a\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219\u4e09\uff1a\u4e3a\u4e8b\u4ef6\u547d\u540d\uff08<\/span>Name Events<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5bf9\u4e8e\u4e8b\u4ef6\u5904\u7406\u65b9\u6cd5\u7ed9\u51fa\u5408\u9002\u7684\u540d\u5b57\u66f4\u52a0\u91cd\u8981\u3002\u5982\u679c\u4f60\u5bf9\u4e8e\u7ec4\u4ef6\u7ed9\u51fa\u4e86\u4e00\u4e2a\u5408\u9002\u7684\u540d\u5b57\uff0c\u90a3\u4e48\u7cfb\u7edf\u9ed8\u8ba4\u7684\u540d\u5b57ButtonClick\u5c06\u53d8\u6210BtnAddClick\u3002\u867d\u7136\u4ece\u8fd9\u4e2a\u540d\u5b57\u4e2d\u6211\u4eec\u53ef\u4ee5\u731c\u5230\u8fd9\u4e2a\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u7684\u529f\u80fd\uff0c\u4f46\u662f\u6211\u8ba4\u4e3a\u4f7f\u7528\u4e00\u4e2a\u80fd\u591f\u63cf\u8ff0\u8be5\u65b9\u6cd5\u7684\u4f5c\u7528\u7684\u540d\u5b57\uff0c\u800c\u4e0d\u662f\u91c7\u7528Delphi\u9644\u52a0\u7684\u540d\u5b57\u662f\u4e00\u79cd\u66f4\u597d\u7684\u65b9\u5f0f\u3002\u4f8b\u5982\uff0cBtnAdd\u6309\u94ae\u7684OnClick\u4e8b\u4ef6\u53ef\u4ee5\u547d\u540d\u6210AddToList\u3002\u8fd9\u4f1a\u4f7f\u5f97\u4f60\u7684\u7a0b\u5e8f\u53ef\u8bfb\u6027\u66f4\u5f3a\uff0c\u7279\u522b\u662f\u5f53\u4f60\u5728\u8fd9\u4e2a\u7c7b\u7684\u5176\u4ed6\u65b9\u6cd5\u4e2d\u8c03\u7528\u8fd9\u4e2a\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u65f6\uff0c\u800c\u4e14\u8fd9\u4f1a\u5e2e\u52a9\u7a0b\u5e8f\u5458\u4e3a\u7c7b\u4f3c\u7684\u4e8b\u4ef6\u6216\u662f\u4e0d\u540c\u7684\u7ec4\u4ef6\u9009\u7528\u76f8\u540c\u7684\u65b9\u6cd5\u3002\u4e0d\u8fc7\u6211\u5fc5\u987b\u58f0\u660e\uff0c\u4f7f\u7528\u52a8\u4f5c\uff08Actions\uff09\u662f\u76ee\u524d\u5f00\u53d1\u91cd\u8981\u7684\u7a0b\u5e8f\u65f6\u6211\u6700\u559c\u6b22\u7684\u65b9\u6cd5\u3002\n<\/div>\n
\n  \n<\/div>\n
\n
\n \u8bc4\u8ff0\uff1a<\/strong>\u89c4\u5219\u4e8c\u548c\u4e09\u662f\u4e24\u4e2a\u5f88\u597d\u7684\u4e60\u60ef\uff0c\u9762\u5411\u5bf9\u8c61\u7684\u4e00\u4e2a\u597d\u5904\u662f\u53ef\u4ee5\u81ea\u660e\u5176\u610f\u7684\uff0c\u6bd4\u5982\u4e00\u4e2a\u7c7b\u53eb\u505aPerson\uff0c\u90a3\u4e48\u5b83\u5c31\u5177\u6709\u4eba\u7684\u5c5e\u6027\uff0c\u53d1\u51fa\u4eba\u7684\u52a8\u4f5c\uff0c\u4e3a\u4e86\u4f7f\u7a0b\u5e8f\u597d\u7406\u89e3\uff0c\u8981\u6839\u636e\u9886\u57df\u6a21\u578b\u6765\u8bbe\u8ba1\u7c7b\uff0c\u5e76\u53d6\u4e00\u4e2a\u597d\u540d\u5b57\u3002\n <\/div>\n<\/div>\n
\n \u89c4\u5219\u56db\uff1a\u4f7f\u7528\u7a97\u4f53\u65b9\u6cd5\uff08<\/span>Use Form Methods<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u7a97\u4f53\u90fd\u662f\u4e00\u4e9b\u7c7b\uff0c\u56e0\u6b64\u7a97\u4f53\u7684\u4ee3\u7801\u662f\u4ee5\u65b9\u6cd5\u7ec4\u7ec7\u7684\u3002\u4f60\u53ef\u4ee5\u5411\u7a97\u4f53\u4e2d\u6dfb\u52a0
\n \u2460\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f<\/span>Public<\/strong>\uff09\u65b9\u6cd5\u4f9b\u5176\u4ed6\u7a97\u4f53\u8c03\u7528\u8981\u6bd4\u5176\u4ed6\u7a97\u4f53\u76f4\u63a5\u64cd\u4f5c\u4ed6\u7684\u7ec4\u4ef6\u8981\u597d\u3002<\/strong> <\/strong>\uff0c\u8fd9\u4e9b\u5904\u7406\u7a0b\u5e8f\u5b8c\u6210\u4e00\u4e9b\u7279\u522b\u7684\u529f\u80fd\uff0c\u800c\u4e14\u4ed6\u4eec\u80fd\u88ab\u5176\u4ed6\u65b9\u6cd5\u8c03\u7528\u3002\u9664\u4e86\u4e8b\u4ef6\u5904\u7406\u65b9\u6cd5\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5411\u7a97\u4f53\u6dfb\u52a0
\n \u2461<\/span>\u5b8c\u6210\u52a8\u4f5c\u7684\u7279\u522b\u5b9a\u4e49\u7684\u65b9\u6cd5\u4ee5\u53ca\u8bbf\u95ee\u7a97\u4f53\u72b6\u6001\u7684\u65b9\u6cd5<\/strong>\u3002
\n \u2462<\/span>\u5728\u7a97\u4f53\u4e2d\u6dfb\u52a0\u4e00\u4e9b\u516c\u5171\u7684\uff08<\/strong>\n<\/div>\n
\n
\n \u8bc4\u8ff0\uff1a\u2460<\/span><\/strong>\u6240\u8c13\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\uff0c\u5e94\u8be5\u6307\u7684\u662f\u70b9\u51fb\u4e00\u4e2a\u6309\u94ae\u89e6\u53d1\u7684\u4e8b\u4ef6\uff0c\u5c31\u662f\u5728procedure TfrmPD9LoadMeter.Button1Click(Sender: TObject);\u8fd9\u6837\u7684\u7ed3\u6784\u4e2d\u5199\u7684\u4ee3\u7801\u3002
\n \u2461<\/span>interface\u6bb5\u4e2d\u58f0\u660e\u7684\u65b9\u6cd5\uff1b\u2462<\/span> \u8fd9\u4e5f\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u5b9e\u8df5\uff0c\u56e0\u4e3aDelphi\u9ed8\u8ba4\u5c06\u7a97\u4f53\u4f5c\u4e3a\u4e00\u4e2a\u5168\u5c40\u5bf9\u8c61\uff0c\u800c\u90a3\u4e9b\u63a7\u4ef6\u7684\u52a8\u4f5c\u548c\u63a7\u4ef6\u7684\u58f0\u660e\u90fd\u662fpublic\u7684\uff0c\u56e0\u6b64\u7a97\u4f53\u95f4\u53ef\u4ee5\u4e92\u76f8\u8c03\u7528\u5bf9\u65b9\u7684\u63a7\u4ef6\u7684\u52a8\u4f5c\u548c\u63a7\u4ef6\uff0c\u8fd9\u4f1a\u9020\u6210\u5f88\u5927\u7684\u8026\u5408\u6027\uff0c\u6211\u8ba4\u4e3a\u6587\u4e2d\u5efa\u8bae\u7684\u65b9\u6cd5\u5f88\u4e0d\u9519\uff0c\u6211\u5c31\u662f\u8fd9\u6837\u505a\u7684\u3002<\/strong><\/strong>\u8fd9\u4e9b\u65b9\u6cd5\u5c31\u5e94\u8be5\u662f\u4f60\u81ea\u5df1\u5728\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>5<\/span>\uff1a\u6dfb\u52a0\u7a97\u4f53\u6784\u9020\u5668\uff08<\/span>Add Form Constructors<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5728\u8fd0\u884c\u65f6\u521b\u5efa\u7684\u7b2c\u4e8c\u4e2a\u7a97\u4f53\u9664\u4e86\u4e00\u4e2a\u9ed8\u8ba4\u7684\u6784\u9020\u5668\uff08\u4eceTcomponent \u7c7b\u7ee7\u627f\u800c\u6765\uff09\u5916\u8fd8\u4f1a\u63d0\u4f9b\u5176\u4ed6\u7279\u6b8a\u7684\u6784\u9020\u5668\u3002\u5982\u679c\u4f60\u4e0d\u9700\u8981\u8003\u8651\u548cDelphi4\u4ee5\u524d\u7684\u7248\u672c\u7684\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u6211\u5efa\u8bae\u4f60\u91cd\u8f7d\uff08Overload\uff09Create\u65b9\u6cd5\uff0c\u6dfb\u52a0\u5fc5\u8981\u7684\u521d\u59cb\u5316\u53c2\u6570\u3002\u5177\u4f53\u4ee3\u7801\u53ef\u53c2\u89c1\u4e0b\u9762\u7684\u4ee3\u7801:\n<\/div>\n
\n  \n<\/div>\n
\n
\n Public\n <\/div>\n
\n Constructor Create(Text:string): reintroduce ; overload;\n <\/div>\n
\n Constructor TformDialog.Create(Text:string);\n <\/div>\n
\n Begin\n <\/div>\n
\n Inherited Create(Application);\n <\/div>\n
\n Edit1.Text:=Text;\n <\/div>\n
\n End;\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n
\n \u8bc4\u8ff0\uff1a<\/strong>\u8fd9\u4ef6\u4e8b\u7684\u597d\u5904\u6211\u8fd8\u60f3\u4e0d\u5230\uff0c\u5f53\u7136\u5982\u679c\u50cf\u53e6\u4e00\u4e2a\u7a97\u4f53\u4f20\u9012\u67d0\u79cd\u72b6\u6001\uff0c\u5e94\u8be5\u662f\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002\u8fc7\u53bb\u5927\u591a\u6570\u4eba\u7684\u505a\u6cd5\u662f\u8fd9\u6837\u7684\uff1a\u5982\u679c\u5728A\u7a97\u4f53\u4e2d\u521b\u5efaB\u7a97\u4f53\uff0c\u5e76\u4f20\u7ed9B\u7a97\u4f53\u4e00\u4e9b\u53c2\u6570\uff0c\u90a3\u4e48\u5c31\u5728A\u4e2d\u8bbe\u4e00\u4e9bpublic\u53d8\u91cf\uff0c\u7136\u540eB\u521b\u5efa\u597d\u540e\uff0c\u5728B\u4e2d\u8bfb\u53d6A\u4e2d\u90a3\u4e9b\u53d8\u91cf\u7684\u503c\u3002\u901a\u8fc7\u91cd\u8f7d\u6784\u9020\u5668\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u521b\u5efaB\u65f6\u5c31\u628a\u8981\u4f20\u7684\u503c\u8d4b\u597d\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u51cf\u5c11\u7a97\u4f53\u95f4\u7684\u8026\u5408\u3002\n <\/div>\n<\/div>\n
\n \u89c4\u5219<\/span>6<\/span>\uff1a\u907f\u514d\u5168\u5c40\u53d8\u91cf\uff08<\/span>Avoid Global Variables<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5e94\u8be5\u907f\u514d\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\uff08\u5c31\u662f\u90a3\u4e9b\u5728\u5355\u5143\u7684interface \u90e8\u5206\u5b9a\u4e49\u7684\u53d8\u91cf\uff09\u3002\u4e0b\u9762\u5c06\u4f1a\u6709\u4e00\u4e9b\u5efa\u8bae\u5e2e\u52a9\u4f60\u5982\u4f55\u53bb\u505a\u3002\n<\/div>\n
\n \u5982\u679c\u4f60\u9700\u8981\u4e3a\u7a97\u4f53\u5b58\u50a8\u989d\u5916\u7684\u6570\u636e\uff0c\u4f60\u53ef\u4ee5
\n \u5411\u7a97\u4f53\u7c7b\u4e2d\u6dfb\u52a0\u4e00\u4e9b\u79c1\u6709\u6570\u636e<\/strong>\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e00\u4e2a\u7a97\u4f53\u5b9e\u4f8b\u90fd\u4f1a\u6709\u81ea\u5df1\u7684\u6570\u636e\u526f\u672c\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u5355\u5143\u53d8\u91cf\uff08\u5728\u5355\u5143\u7684implementation\u90e8\u5206\u5b9a\u4e49\u7684\u53d8\u91cf\uff09\u58f0\u660e\u90a3\u4e9b\u4f9b\u7a97\u4f53\u7c7b\u7684\u591a\u4e2a\u5b9e\u4f8b\u5171\u4eab\u7684\u6570\u636e\u3002\n<\/div>\n
\n \u5982\u679c\u4f60\u9700\u8981\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u7a97\u4f53\u4e4b\u95f4\u5171\u4eab\u6570\u636e\uff0c\u4f60\u53ef\u4ee5\u628a\u4ed6\u4eec\u5b9a\u4e49\u5728\u4e3b\u7a97\u4f53\u91cc\u6765\u5b9e\u73b0\u5171\u4eab\uff0c\u6216\u8005\u4f7f\u7528\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\uff0c\u4f7f\u7528\u65b9\u6cd5\u6216\u8005\u662f\u5c5e\u6027\u6765\u83b7\u5f97\u6570\u636e\u3002\n<\/div>\n
\n
\n \u8bc4\u8ff0\uff1a<\/strong>\u8fd9\u4f3c\u4e4e\u662f\u5b66\u4e60\u6240\u6709\u8bed\u8a00\u65f6\u90fd\u88ab\u5f3a\u8c03\u7684\u4e00\u70b9\uff0c\u6bd5\u7adf\u5168\u5c40\u53d8\u91cf\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u96be\u4ee5\u7406\u89e3\uff0c\u4e5f\u5bb9\u6613\u5bfc\u81f4\u7a0b\u5e8f\u5bb9\u6613\u51fa\u9519\u3002\u6587\u4e2d\u7ed9\u51fa\u7684\u51e0\u70b9\u5efa\u8bae\u90fd\u5f88\u597d\u3002\u4e0d\u8fc7\u5728\u8fd9\u91cc\u5fc5\u987b\u8981\u77e5\u9053\u5728\u4e00\u4e2a\u7a97\u4f53\u91cc\uff08\u5176\u5b9e\u662f\u8fd9\u4e2a\u7a97\u4f53\u5bf9\u5e94\u7684Unit\uff09\uff0c\u5728\u54ea\u51e0\u4e2a\u5730\u65b9\u53ef\u4ee5\u5b9a\u4e49\u53d8\u91cf\uff0c\u5e76\u4e14\u5b83\u4eec\u7684\u4f5c\u7528\u57df\u662f\u4ec0\u4e48\u3002\u8fd9\u6307\u7684\u662f\u5728Type \u7a97\u4f53\u540d end\u4e4b\u95f4\u5b9a\u4e49\u7684\u53d8\u91cf\uff0c\u5728interface\u5176\u4ed6\u90e8\u5206\u5b9a\u4e49\u7684\u53d8\u91cf\u624d\u662f\u672c\u6761\u539f\u5219\u6240\u8c13\u7684\u5168\u5c40\u53d8\u91cf\uff0c\u8fd9\u70b9\u4e00\u5b9a\u8981\u6e05\u695a\u3002\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>7<\/span>\uff1a\u6c38\u8fdc\u4e0d\u8981\u5728<\/span>Tform1<\/span>\u7c7b\u4e2d\u4f7f\u7528<\/span>Form1(Never Use Form1 in Tform1) <\/span><\/font><\/strong>\n<\/div>\n
\n \u4f60\u5e94\u8be5\u907f\u514d\u5728\u7c7b\u7684\u65b9\u6cd5\u4e2d\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684\u5bf9\u8c61\u540d\u79f0\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u4e0d\u5e94\u8be5\u5728TForm1\u7c7b\u7684\u65b9\u6cd5\u4e2d\u76f4\u63a5\u4f7f\u7528Form1.\u5982\u679c\u4f60\u786e\u5b9e\u9700\u8981\u4f7f\u7528\u5f53\u524d\u7684\u5bf9\u8c61\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Self\u5173\u952e\u5b57\u3002\u8bf7\u7262\u8bb0\uff1a\u5927\u591a\u6570\u65f6\u5019\u4f60\u90fd\u6ca1\u6709\u5fc5\u8981\u76f4\u63a5\u4f7f\u7528\u5f53\u524d\u5bf9\u8c61\u7684\u65b9\u6cd5\u548c\u6570\u636e\u3002\n<\/div>\n
\n \u5982\u679c\u4f60\u4e0d\u9075\u5faa\u8fd9\u6761\u89c4\u5219\uff0c\u5f53\u4f60\u4e3a\u4e00\u4e2a\u7a97\u4f53\u7c7b\u521b\u5efa\u591a\u4e2a\u5b9e\u4f8b\u7684\u65f6\u5019\uff0c\u4f60\u4f1a\u9677\u5165\u9ebb\u70e6\u5f53\u4e2d\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>8<\/span>\uff1a\u5c3d\u91cf\u907f\u514d\u5728\u5176\u4ed6\u7684\u7a97\u4f53\u4e2d\u4f7f\u7528<\/span>Form1(Seldom Use Form1 In Other Forms ) <\/span><\/font><\/strong>\n<\/div>\n
\n \u5373\u4f7f\u5728\u5176\u4ed6\u7a97\u4f53\u7684\u4ee3\u7801\u4e2d\uff0c\u4f60\u4e5f\u5e94\u8be5\u5c3d\u91cf\u907f\u514d\u76f4\u63a5\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\uff0c\u5982Form1.\u5b9a\u4e49\u4e00\u4e9b\u5c40\u90e8\u53d8\u91cf\u6216\u8005\u79c1\u6709\u57df\u4f9b\u5176\u4ed6\u7a97\u4f53\u4f7f\u7528\u4f1a\u6bd4\u76f4\u63a5\u8c03\u7528\u5168\u5c40\u53d8\u91cf\u8981\u597d\u3002\n<\/div>\n
\n \u4f8b\u5982\uff0c\u7a0b\u5e8f\u7684\u4e3b\u7a97\u4f53\u80fd\u591f\u4e3a\u5bf9\u8bdd\u6846\u5b9a\u4e49\u4e00\u4e2a\u79c1\u6709\u57df\u3002\u5f88\u663e\u7136\uff0c\u5982\u679c\u4f60\u8ba1\u5212\u4e3a\u4e00\u4e2a\u6d3e\u751f\u7a97\u4f53\u521b\u5efa\u591a\u4e2a\u5b9e\u4f8b\uff0c\u8fd9\u6761\u89c4\u5219\u5c06\u662f\u5341\u5206\u6709\u7528\u3002\u4f60\u53ef\u4ee5\u5728\u4e3b\u7a97\u4f53\u7684\u4ee3\u7801\u8303\u56f4\u5185\u4fdd\u6301\u4e00\u4efd\u6e05\u5355\uff0c\u4e5f\u53ef\u4ee5\u66f4\u7b80\u5355\u5730\u4f7f\u7528\u5168\u5c40Sreen\u5bf9\u8c61\u7684\u7a97\u4f53\u6570\u7ec4\u3002\n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>9<\/span>\uff1a\u79fb\u9664<\/span>Form1(Remove Form1) <\/span><\/font><\/strong>\n<\/div>\n
\n \u4e8b\u5b9e\u4e0a\uff0c\u6211\u7684\u5efa\u8bae\u662f\u5728\u4f60\u7684\u7a0b\u5e8f\u4e2d\u79fb\u9664Delphi\u81ea\u52a8\u521b\u5efa\u7684\u5168\u5c40\u7a97\u4f53\u5bf9\u8c61\u3002\u5373\u4f7f\u4f60\u7981\u6b62\u4e86\u7a97\u4f53\u7684\u81ea\u52a8\u6dfb\u52a0\u529f\u80fd\uff0c\u8fd9\u4e5f\u6709\u53ef\u80fd\u662f\u5fc5\u8981\u7684\uff0c\u56e0\u4e3a\u5728Delphi\u968f\u540e\u4ecd\u7136\u53ef\u80fd\u6dfb\u52a0\u8fd9\u6837\u7684\u7a97\u4f53\u3002\u6211\u7ed9\u4f60\u7684\u5efa\u8bae\u662f\u5e94\u8be5\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u5168\u5c40\u7a97\u4f53\u5bf9\u8c61\u3002\n<\/div>\n
\n \u6211\u8ba4\u4e3a\u5bf9\u4e8eDelphi\u65b0\u624b\u800c\u8a00\uff0c\u79fb\u9664\u5168\u5c40\u7a97\u4f53\u5bf9\u8c61\u662f\u5341\u5206\u6709\u7528\u7684\uff0c\u8fd9\u6837\u4ed6\u4eec\u4e0d\u81f3\u4e8e\u5bf9\u7c7b\u548c\u5168\u5c40\u5bf9\u8c61\u4e24\u8005\u7684\u5173\u7cfb\u611f\u5230\u7591\u60d1\u3002\u4e8b\u5b9e\u4e0a\uff0c\u5728\u5168\u5c40\u7a97\u4f53\u5bf9\u8c61\u88ab\u79fb\u9664\u540e\uff0c\u6240\u6709\u4e0e\u5b83\u6709\u5173\u7684\u4ee3\u7801\u90fd\u4f1a\u4ea7\u751f\u9519\u8bef\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>10<\/span>\uff1a\u6dfb\u52a0\u7a97\u4f53\u5c5e\u6027\uff08<\/span>Add Form Properties<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u6b63\u5982\u6211\u5df2\u7ecf\u63d0\u5230\u8fc7\u7684\uff0c\u5f53\u4f60\u9700\u8981\u4e3a\u4f60\u7684\u7a97\u4f53\u6dfb\u52a0\u6570\u636e\u65f6\uff0c\u8bf7\u6dfb\u52a0\u4e00\u4e2a\u79c1\u6709\u57df\u3002
\n \u5982\u679c\u4f60\u9700\u8981\u8bbf\u95ee\u5176\u4ed6\u7c7b\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u4e3a\u4f60\u7684\u7a97\u4f53\u6dfb\u52a0\u5c5e\u6027\u3002<\/strong>\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u4f60\u5c31\u80fd\u591f\u6539\u53d8\u5f53\u524d\u7a97\u4f53\u7684\u4ee3\u7801\u548c\u6570\u636e(\u5305\u542b\u5728\u5b83\u7684\u7528\u6237\u754c\u9762\u4e2d)\u800c\u4e0d\u5fc5\u6539\u53d8\u5176\u4ed6\u7a97\u4f53\u6216\u7c7b\u7684\u4ee3\u7801\u3002\n<\/div>\n
\n \u4f60\u8fd8\u5e94\u8be5\u4f7f\u7528\u5c5e\u6027\u6216\u662f\u65b9\u6cd5\u6765\u521d\u59cb\u5316\u6d3e\u751f\u7a97\u4f53\u6216\u662f\u5bf9\u8bdd\u6846\uff0c\u6216\u662f\u8bbf\u95ee\u4ed6\u4eec\u7684\u6700\u7ec8\u72b6\u6001\u3002\u6b63\u5982\u6211\u524d\u6587\u6240\u8bf4\u7684\uff0c\u4f60\u5e94\u8be5\u4f7f\u7528\u6784\u9020\u5668\u6765\u5b8c\u6210\u521d\u59cb\u5316\u5de5\u4f5c\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>11<\/span>\uff1a\u663e\u793a\u7ec4\u4ef6\u5c5e\u6027\uff08<\/span>Expose Components Properties<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5f53\u4f60\u9700\u8981\u8bbf\u95ee\u5176\u4ed6\u7a97\u4f53\u7684\u72b6\u6001\u65f6\uff0c\u4f60\u4e0d\u5e94\u8be5\u76f4\u63a5\u8bbf\u95ee\u5b83\u7684\u7ec4\u4ef6\u3002\u56e0\u4e3a\u8fd9\u6837\u4f1a\u5c06\u5176\u4ed6\u7a97\u4f53\u6216\u5176\u5b83\u7c7b\u7684\u4ee3\u7801\u548c\u7528\u6237\u754c\u9762\u7ed3\u5408\u5728\u4e00\u8d77\uff0c\u800c\u7528\u6237\u754c\u9762\u5f80\u5f80\u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6700\u5bb9\u6613\u53d1\u751f\u6539\u53d8\u7684\u90e8\u5206\u3002\u6700\u597d\u7684\u65b9\u6cd5\u662f\uff0c\u4e3a\u4f60\u9700\u8981\u8bbf\u95ee\u7684\u7ec4\u4ef6\u5c5e\u6027\u5b9a\u4e49\u4e00\u4e2a\u7a97\u4f53\u5c5e\u6027\u3002\u8981\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u53ef\u4ee5 \u901a\u8fc7\u8bfb\u53d6\u7ec4\u4ef6\u72b6\u6001\u7684Get\u65b9\u6cd5\u548c\u8bbe\u7f6e\u7ec4\u4ef6\u72b6\u6001\u7684Set\u65b9\u6cd5\u5b9e\u73b0\u3002\n<\/div>\n
\n \u5047\u5982\u4f60\u73b0\u5728\u9700\u8981\u6539\u53d8\u7528\u6237\u754c\u9762\uff0c\u7528\u53e6\u5916\u4e00\u4e2a\u7ec4\u4ef6\u66ff\u6362\u73b0\u6709\u7684\u7ec4\u4ef6\uff0c\u90a3\u4e48\u4f60\u53ea\u9700\u505a\u7684\u662f\u4fee\u6539\u4e0e\u8fd9\u4e2a\u7ec4\u4ef6\u5c5e\u6027\u76f8\u5173\u7684Get\u65b9\u6cd5\u548cSet\u65b9\u6cd5\uff0c\u800c\u4e0d\u5fc5\u67e5\u627e\uff0c\u4fee\u6539\u6240\u6709\u5f15\u7528\u8fd9\u4e2a\u7ec4\u4ef6\u7684\u7a97\u4f53\u548c\u7c7b\u7684\u6e90\u7801\u3002\u8be6\u7ec6\u5b9e\u73b0\u65b9\u6cd5\u8bf7\u53c2\u89c1\u4e0b\u9762\u7684\u4ee3\u7801\uff1a\n<\/div>\n
\n  \n<\/div>\n
\n
\n private <\/strong>\n <\/div>\n
\n function GetText:String;\n <\/div>\n
\n procedure SetText(const Value:String);\n <\/div>\n
\n public <\/strong>\n <\/div>\n
\n property Text:String; read GetText write SetText;\n <\/div>\n
\n function<\/strong> TformDialog.GetText:String;\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n Result:=Edit1.Text;\n <\/div>\n
\n end; <\/strong>\n <\/div>\n
\n procedure<\/strong> TformDialog.SetText(const Value:String);\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n Edit1.Text;=Value;\n <\/div>\n
\n end; <\/strong>\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>12<\/span>\uff1a\u5c5e\u6027\u6570\u7ec4\uff08<\/span>Array Properties<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5982\u679c\u4f60\u9700\u8981\u5904\u7406\u7a97\u4f53\u4e2d\u7684\u4e00\u7cfb\u5217\u53d8\u91cf\uff0c\u4f60\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u5c5e\u6027\u6570\u7ec4\u3002\u5982\u679c\u8fd9\u4e9b\u53d8\u91cf\u662f\u4e00\u4e9b\u5bf9\u4e8e\u7a97\u4f53\u5f88\u91cd\u8981\u7684\u4fe1\u606f\uff0c\u4f60\u8fd8\u53ef\u4ee5\u628a\u4ed6\u4eec\u5b9a\u4e49\u6210\u7a97\u4f53\u9ed8\u8ba4\u7684\u5c5e\u6027\u6570\u7ec4\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528SpecialForm[3]\u6765\u8bbf\u95ee\u4ed6\u4eec\u7684\u503c\u4e86\u3002\n<\/div>\n
\n \u4e0b\u9762\u7684\u4ee3\u7801\u663e\u793a\u4e86\u5982\u4f55\u5c06\u4e00\u4e2alistbox\u7ec4\u4ef6\u7684\u9879\u76ee\u5b9a\u4e49\u6210\u7a97\u4f53\u9ed8\u8ba4\u7684\u5c5e\u6027\u6570\u7ec4\u3002\n<\/div>\n
\n  \n<\/div>\n
\n
\n type <\/strong>\n <\/div>\n
\n TformDialog =
\n class<\/strong>(TForm)\n <\/div>\n
\n private <\/strong>\n <\/div>\n
\n listItems:TlistBox;\n <\/div>\n
\n function<\/strong> GetItems(Index:Integer):String;\n <\/div>\n
\n procedure<\/strong> SetItems(Index:Integer:const Value:String);\n <\/div>\n
\n public <\/strong>\n <\/div>\n
\n property<\/strong> Items[Index:Integer]:string;\n <\/div>\n
\n end; <\/strong>\n <\/div>\n
\n function<\/strong> TFormDialog.GetItems(Index:Integer):string;\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n if Index >=ListItems.Items.Count then\n <\/div>\n
\n raise<\/strong> Exception.Create(\u2018TformDialog:Out of Range\u2019);\n <\/div>\n
\n Result:=ListItems.Items[Index];\n <\/div>\n
\n end<\/strong>;\n <\/div>\n
\n procedure<\/strong> TformDialog.SetItems(Index:Integer;const alue:string);\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n if Index >=ListItems.Items.Count then\n <\/div>\n
\n raise<\/strong> Exception.Create(\u2018TformDialog:Out of Range\u2019);\n <\/div>\n
\n ListItems.Items[Index]:=Value;\n <\/div>\n
\n end<\/strong>;\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>13<\/span>\uff1a\u4f7f\u7528\u5c5e\u6027\u7684\u9644\u52a0\u4f5c\u7528\uff08<\/span>Use Side-Effects In Properties<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u8bf7\u8bb0\u4f4f\uff1a\u4f7f\u7528\u5c5e\u6027\u800c\u4e0d\u662f\u8bbf\u95ee\u5168\u5c40\u53d8\u91cf\uff08\u53c2\u89c1\u89c4\u521910\u300111\u300112\uff09\u7684\u597d\u5904\u4e4b\u4e00\u5c31\u662f\u5f53\u4f60\u8bbe\u7f6e\u6216\u8005\u8bfb\u53d6\u5c5e\u6027\u7684\u503c\u65f6\uff0c\u4f60\u8fd8\u53ef\u80fd\u6709\u610f\u60f3\u4e0d\u5230\u7684\u6536\u83b7\u3002\n<\/div>\n
\n \u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u7a97\u4f53\u754c\u9762\u4e0a\u62d6\u62c9\u7ec4\u4ef6\uff0c\u8bbe\u7f6e\u591a\u4e2a\u5c5e\u6027\u7684\u503c\uff0c\u8c03\u7528\u7279\u6b8a\u65b9\u6cd5\uff0c\u7acb\u5373\u6539\u53d8\u591a\u4e2a\u7ec4\u4ef6\u7684\u72b6\u6001\uff0c\u6216\u8005\u64a4\u9500\u4e00\u4e2a\u4e8b\u4ef6\uff08\u5982\u679c\u9700\u8981\u7684\u8bdd\uff09\u7b49\u7b49\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>14<\/span>\uff1a\u9690\u85cf\u7ec4\u4ef6\uff08<\/span>Hide Components<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u6211\u7ecf\u5e38\u542c\u89c1\u90a3\u4e9b\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u72c2\u70ed\u8ffd\u6c42\u8005\u62b1\u6028Delphi\u7a97\u4f53\u4e2d\u5305\u542b\u4e00\u4e9b\u5728published\u90e8\u5206\u58f0\u660e\u7684\u7ec4\u4ef6\uff0c\u8fd9\u662f\u548c\u9762\u5411\u5bf9\u8c61\u601d\u60f3\u7684\u5c01\u88c5\u6027\u539f\u7406\u4e0d\u76f8\u7b26\u5408\u7684\u3002\u4ed6\u4eec\u786e\u5b9e\u63d0\u51fa\u4e86\u4e00\u4e2a\u91cd\u8981\u7684\u8bae\u9898\uff0c\u4f46\u662f\u4ed6\u4eec\u4e2d\u7684\u5927\u591a\u6570\u4eba\u90fd\u6ca1\u6709\u610f\u8bc6\u5230\u89e3\u51b3\u65b9\u6cd5\u5176\u5b9e\u5c31\u5728\u4ed6\u4eec\u624b\u8fb9\uff0c\u5b8c\u5168\u4e0d\u7528\u91cd\u5199Delphi\u4ee3\u7801\uff0c\u4e5f\u4e0d\u7528\u8f6c\u5411\u5176\u4ed6\u8bed\u8a00\u3002\n<\/div>\n
\n Delphi\u5411\u7a97\u4f53\u4e2d\u6dfb\u52a0\u7684\u7ec4\u4ef6\u53c2\u7167\u53ef\u4ee5\u88ab\u79fb\u5230private\u90e8\u5206\uff0c\u4f7f\u5f97\u5176\u4ed6\u7a97\u4f53\u4e0d\u80fd\u8bbf\u95ee\u4ed6\u4eec\u3002\u5982\u679c\u4f60\u8fd9\u6837\u505a\uff0c\u4f60\u5c31\u6709\u5fc5\u8981\u8bbe\u7f6e\u4e00\u4e9b\u6307\u5411\u7ec4\u4ef6\u7684\u7a97\u4f53\u5c5e\u6027\uff08\u8bf7\u53c2\u89c1\u89c4\u521911\uff09\uff0c\u5e76\u4e14\u4f7f\u7528\u5b83\u4eec\u6765\u8bbf\u95ee\u7ec4\u4ef6\u7684\u72b6\u6001\u3002\n<\/div>\n
\n Delphi\u5c06\u6240\u6709\u7684\u8fd9\u4e9b\u7ec4\u4ef6\u90fd\u653e\u5728published\u90e8\u5206\uff0c\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u80fd\u591f\u4fdd\u8bc1\u8fd9\u4e9b\u57df\u4e00\u5b9a\u662f\u5728.DFM\u6587\u4ef6\u4e2d\u521b\u5efa\u7684\u7ec4\u4ef6\u3002\u5f53\u4f60\u6539\u53d8\u4e00\u4e2a\u7ec4\u4ef6\u7684\u540d\u79f0\u65f6\uff0cVCL\u80fd\u591f\u81ea\u52a8\u5730\u5c06\u8fd9\u4e2a\u7ec4\u4ef6\u5bf9\u8c61\u4e0e\u5b83\u5728\u7a97\u4f53\u4e2d\u7684\u53c2\u7167\u5173\u8054\u8d77\u6765\u3002\u56e0\u4e3adelphi\u4f7f\u7528RTTI\u548cTobject\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u79cd\u529f\u80fd\uff0c\u6240\u4ee5\u5982\u679c\u60f3\u8981\u4f7f\u7528\u8fd9\u79cd\u81ea\u52a8\u5b9e\u73b0\u529f\u80fd\uff0c\u5c31\u5fc5\u987b\u628a\u53c2\u7167\u653e\u7f6e\u5728published\u90e8\u5206\uff08\u8fd9\u4e5f\u6b63\u662f\u4e3a\u4ec0\u4e48delphi\u5c06\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u653e\u5728published\u90e8\u5206\u7684\u7f18\u6545\uff09\u3002\n<\/div>\n
\n \u5982\u679c\u4f60\u60f3\u77e5\u9053\u7684\u66f4\u8be6\u7ec6\u4e00\u70b9\uff0c\u53ef\u4ee5\u53c2\u770b\u4e0b\u9762\u7684\u4ee3\u7801\uff1a\n<\/div>\n
\n  \n<\/div>\n
\n
\n procedure<\/strong> Tcomponent.SetReference(Enable:Boolean);\n <\/div>\n
\n var <\/strong>\n <\/div>\n
\n Field:^Tcomponent;\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n If<\/strong> Fowner<> nil
\n then<\/strong>\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n Field:=Fowner.FieldAddress(Fname);\n <\/div>\n
\n If Field<>nil then\n <\/div>\n
\n Field^:=Self\n <\/div>\n
\n else <\/strong>\n <\/div>\n
\n Field^:=nil;\n <\/div>\n
\n end<\/strong>;\n <\/div>\n
\n end<\/strong>;\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u4e0a\u9762\u7684\u4ee3\u7801\u662fTcomponent\u7c7b\u7684SetReference\u65b9\u6cd5\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u88abInserComponent\uff0cRemoveComponent\u548cSetName\u7b49\u65b9\u6cd5\u8c03\u7528\u3002\n<\/div>\n
\n \u5f53\u4f60\u7406\u89e3\u4e86\u8fd9\u4e00\u70b9\u540e\uff0c\u4f60\u5e94\u8be5\u4e0d\u96be\u60f3\u5230\u5982\u679c\u4f60\u5c06\u7ec4\u4ef6\u53c2\u7167\u4ecepublished\u90e8\u5206\u79fb\u5230\u4e86private\u6bb5\uff0c\u4f60\u5c06\u5931\u53bbVCL\u7684\u81ea\u52a8\u5173\u8054\u529f\u80fd\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u7a97\u4f53\u7684OnCreate\u4e8b\u4ef6\u4e2d\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\u89e3\u51b3\uff1a\n<\/div>\n
\n Edit1:=FindComponent(\u2018Edit1\u2019) as Tedit;\n<\/div>\n
\n \u4f60\u63a5\u4e0b\u6765\u5e94\u8be5\u505a\u7684\u5c31\u662f\u5728\u7cfb\u7edf\u4e2d\u6ce8\u518c\u8fd9\u4e9b\u7ec4\u4ef6\u7c7b\uff0c\u5f53\u4f60\u4e3a\u4ed6\u4eec\u6ce8\u518c\u8fc7\u540e\u5c31\u80fd\u4f7fRTTI\u5305\u542b\u5728\u7f16\u8bd1\u7a0b\u5e8f\u4e2d\u5e76\u4e14\u80fd\u591f\u88ab\u7cfb\u7edf\u6240\u4f7f\u7528\u3002\u5f53\u4f60\u5c06\u8fd9\u4e9b\u7c7b\u578b\u7684\u7ec4\u4ef6\u53c2\u7167\u79fb\u5230private\u90e8\u5206\u65f6\uff0c\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u7ec4\u4ef6\u7c7b\uff0c\u4f60\u53ea\u9700\u4e3a\u4ed6\u4eec\u6ce8\u518c\u4e00\u6b21\u3002\u5373\u4f7f\u4e3a\u4ed6\u4eec\u6ce8\u518c\u4e0d\u662f\u4e00\u5b9a\u5fc5\u8981\u7684\u65f6\u5019\uff0c\u4f60\u4e5f\u53ef\u4ee5\u8fd9\u6837\u505a\uff0c\u56e0\u4e3a\u5bf9\u4e8eRegisterClasses\u7684\u989d\u5916\u8c03\u7528\u6709\u76ca\u65e0\u5bb3\u3002\u901a\u5e38\u4f60\u5e94\u8be5\u5728\u5355\u5143\u4e2d\u8d1f\u8d23\u751f\u6210\u7a97\u4f53\u7684\u521d\u59cb\u5316\u90e8\u5206\u6dfb\u52a0\u4ee5\u4e0b\u7684\u4ee3\u7801\uff1a\n<\/div>\n
\n RegisterClass\uff08[TEdit]\uff09;\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>15<\/span>\uff1a\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u7a97\u4f53\u5411\u5bfc\uff08<\/span>The OOP Form Wizard<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u4e3a\u6bcf\u4e00\u4e2a\u7a97\u4f53\u7684\u6bcf\u4e00\u4e2a\u7ec4\u4ef6\u91cd\u590d\u4e0a\u8ff0\u4e24\u4e2a\u64cd\u4f5c\u4e0d\u4ec5\u5341\u5206\u7684\u70e6\u4eba\uff0c\u800c\u4e14\u76f8\u5f53\u7684\u6d6a\u8d39\u65f6\u95f4\u3002\u4e3a\u4e86\u907f\u514d\u989d\u5916\u7684\u8d1f\u62c5\uff0c\u6211\u5df2\u7ecf\u4e3a\u6b64\u5199\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u5411\u5bfc\u7a0b\u5e8f\u3002\u8fd9\u4e2a\u7a0b\u5e8f\u5c06\u4f1a\u751f\u6210\u4e00\u4e9b\u53ef\u4ee5\u5b8c \u6210\u4ee5\u4e0a\u4e24\u6b65\u5de5\u4f5c\u7684\u4ee3\u7801\uff0c\u4f60\u9700\u8981\u505a\u7684\u4ec5\u4ec5\u662f\u505a\u51e0\u6b21\u590d\u5236\u548c\u7c98\u8d34\u5c31\u884c\u4e86\u3002\n<\/div>\n
\n \u9057\u61be\u7684\u662f\u8fd9\u4e2a\u5411\u5bfc\u7a0b\u5e8f\u4e0d\u80fd\u81ea\u52a8\u5c06\u4ee3\u7801\u653e\u7f6e\u5230\u5355\u5143\u4e2d\u5408\u9002\u7684\u5730\u65b9\uff0c\u6211\u76ee\u524d\u6b63\u5728\u4fee\u6539\u8fd9\u4e2a\u5411\u5bfc\u7a0b\u5e8f\uff0c\u5e0c\u671b\u80fd\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u5230\u6211\u7684\u7f51\u7ad9\uff08www.marcocantu.com\uff09\u67e5\u627e\u66f4\u52a0\u5b8c\u5584\u7684\u7a0b\u5e8f\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>16<\/span>\uff1a\u53ef\u89c6\u5316\u7a97\u4f53\u7ee7\u627f\uff08<\/span>Visual Form Inheritance<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5982\u679c\u5e94\u7528\u5f97\u5f53\uff0c\u8fd9\u5c06\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\u3002\u6839\u636e\u6211\u7684\u7ecf\u9a8c\uff0c\u4f60\u6240\u5f00\u53d1\u7684\u9879\u76ee\u8d8a\u5927\uff0c\u8d8a\u80fd\u4f53\u73b0\u5b83\u7684\u4ef7\u503c\u3002\u5728\u4e00\u4e2a\u590d\u6742\u7684\u7a0b\u5e8f\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u7a97\u4f53\u7684\u4e0d\u540c\u7b49\u7ea7\u5173\u7cfb\u6765\u5904\u7406\u4e00\u7ec4\u76f8\u5173\u7a97\u4f53\u7684\u591a\u6001\u6027\uff08polymorphism\uff09\u3002\n<\/div>\n
\n \u53ef\u89c6\u5316\u7a97\u4f53\u7ee7\u627f\u5141\u8bb8\u4f60\u5171\u4eab\u591a\u4e2a\u7a97\u4f53\u7684\u4e00\u4e9b\u516c\u5171\u7684\u52a8\u4f5c\uff1a\u4f60\u53ef\u4ee5\u4f7f\u7528\u5171\u4eab\u7684\u65b9\u6cd5\uff0c\u516c\u7528\u7684\u5c5e\u6027\uff0c\u751a\u81f3\u662f\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\uff0c\u7ec4\u4ef6\uff0c\u7ec4\u4ef6\u5c5e\u6027\uff0c\u7ec4\u4ef6\u4e8b\u4ef6\u5904\u7406\u65b9\u6cd5\u7b49\u7b49\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>17<\/span>\uff1a\u9650\u5236\u4fdd\u62a4\u57df\u6570\u636e\u7684\u4f7f\u7528\uff08<\/span>Limit Protected Data<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5f53\u521b\u5efa\u4e00\u4e9b\u5177\u6709\u4e0d\u540c\u5206\u7ea7\u4f53\u7cfb\u7684\u7c7b\u65f6\uff0c\u4e00\u4e9b\u7a0b\u5e8f\u5458\u8d8b\u5411\u4e8e\u4e3b\u8981\u4f7f\u7528\u4fdd\u62a4\u57df\uff0c\u56e0\u4e3a\u79c1\u6709\u6570\u636e\u4e0d\u80fd\u88ab\u5b50\u7c7b\u8bbf\u95ee\u3002\u6211\u4e0d\u80fd\u8bf4\u8fd9\u6ca1\u6709\u5176\u5408\u7406\u6027\uff0c\u4f46\u662f\u8fd9\u80af\u5b9a\u662f\u548c\u5c01\u88c5\u6027\u4e0d\u76f8\u5bb9\u548c\u7684\u3002\u4fdd\u62a4\u6570\u636e\u7684\u5b9e\u73b0\u80fd\u591f\u88ab\u6240\u6709\u7ee7\u627f\u7684\u7a97\u4f53\u6240\u5171\u4eab\uff0c\u800c\u4e14\u4e00\u65e6\u8fd9\u4e9b\u6570\u636e\u7684\u539f\u59cb\u5b9a\u4e49\u53d1\u751f\u6539\u53d8\uff0c\u4f60\u5fc5\u987b\u66f4\u6539\u6240\u6709\u7684\u76f8\u5173\u90e8\u5206\u3002\n<\/div>\n
\n \u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u4f60\u9075\u5faa\u9690\u85cf\u7ec4\u4ef6\u8fd9\u6837\u4e00\u6761\u89c4\u5219\uff08Rule 14\uff09\uff0c\u7ee7\u627f\u7a97\u4f53\u5c31\u4e0d\u53ef\u80fd\u8bbf\u95ee\u57fa\u7c7b\u7684\u79c1\u6709\u7ec4\u4ef6\u3002\u5728\u4e00\u4e2a\u7ee7\u627f\u7a97\u4f53\u4e2d\uff0c\u7c7b\u4f3cEdit1.Text\uff1a=\u2019\u2019\u7684\u4ee3\u7801\u5c31\u4e0d\u4f1a\u88ab\u7f16\u8bd1\u3002\u867d\u7136\u8fd9\u662f\u76f8\u5f53\u7684\u4e0d\u65b9\u4fbf\uff0c\u4f46\u662f\u81f3\u5c11\u5728\u7406\u8bba\u4e0a\u8fd9\u662f\u503c\u5f97\u80af\u5b9a\u7684\u4e8b\u60c5\uff0c\u800c\u4e0d\u662f\u5426\u5b9a\u7684\u3002\u5982\u679c\u4f60\u611f\u89c9\u5230\u5b9e\u73b0\u5c01\u88c5\u6027\u662f\u6700\u4e3b\u8981\uff0c\u6700\u9700\u8981\u7684\uff0c\u5c31\u8bf7\u5c06\u8fd9\u4e9b\u7ec4\u4ef6\u53c2\u7167\u653e\u5728\u57fa\u7c7b\u7684\u79c1\u6709\u6bb5\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>18<\/span>\uff1a\u4fdd\u62a4\u57df\u4e2d\u7684\u8bbf\u95ee\u65b9\u6cd5\uff08<\/span>Protected Access Methods<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5728\u57fa\u7c7b\u4e2d\u5c06\u7ec4\u4ef6\u53c2\u7167\u653e\u7f6e\u5728\u79c1\u6709\u57df\u4e2d\uff0c\u800c\u4e3a\u8fd9\u4e9b\u7ec4\u4ef6\u6dfb\u52a0\u4e00\u4e9b\u8bbf\u95ee\u51fd\u6570\u6765\u5f97\u5230\u4ed6\u4eec\u7684\u5c5e\u6027\uff0c\u8fd9\u5c06\u662f\u4e00\u79cd\u66f4\u597d\u7684\u65b9\u6cd5\u3002\u5982\u679c\u8fd9\u4e9b\u8bbf\u95ee\u51fd\u6570\u4ec5\u4ec5\u5728\u8fd9\u4e9b\u7c7b\u5185\u90e8\u4f7f\u7528\u800c\u4e14\u4e0d\u662f\u7c7b\u63a5\u53e3\u7684\u4e00\u90e8\u5206\uff0c\u4f60\u5e94\u8be5\u5728\u4fdd\u62a4\u57df\u58f0\u660e\u4ed6\u4eec\u3002\u4f8b\u5982Rule 11\u4e2d\u63cf\u8ff0\u8fc7\u7684GetText\u548cSetText\u65b9\u6cd5\u5c31\u53ef\u4ee5\u58f0\u660e\u6210protected\uff0c\u5e76\u4e14\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528SetText\uff08\u2019\u2019\uff09\u6765\u7f16\u8f91\u6587\u672c\u3002\n<\/div>\n
\n \u4e8b\u5b9e\u4e0a\uff0c\u5f53\u4e00\u4e2a\u65b9\u6cd5\u88ab\u955c\u50cf\u5230\u4e00\u4e2a\u5c5e\u6027\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u7b80\u5355\u5730\u91c7\u7528\u5982\u4e0b\u4ee3\u7801\u5c31\u53ef\u4ee5\u8fbe\u5230\u7f16\u8f91\u6587\u672c\u5730\u76ee\u7684\uff1aText:=\u2019\u2019;\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>19<\/span>\uff1a\u4fdd\u62a4\u57df\u4e2d\u7684\u865a\u62df\u65b9\u6cd5\uff08<\/span>Protected Virtual Methods<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5b9e\u73b0\u4e00\u4e2a\u7075\u6d3b\u7684\u5206\u7ea7\u5236\u5ea6\u7684\u53e6\u4e00\u4e2a\u5173\u952e\u70b9\u662f\u5b9a\u4e49\u4e00\u4e9b\u4f60\u53ef\u4ee5\u4ece\u5916\u90e8\u7c7b\u8c03\u7528\u7684\u865a\u62df\u65b9\u6cd5\u6765\u5f97\u5230\u591a\u6001\u6027\u3002\u5982\u679c\u8fd9\u4e2a\u65b9\u6cd5\u4f7f\u7528\u5f97\u5f53\uff0c\u5c06\u4f1a\u5f88\u5c11\u51fa\u73b0\u5176\u4ed6\u516c\u5171\u7684\u65b9\u6cd5\u8c03\u7528\u4fdd\u62a4\u57df\u4e2d\u7684\u865a\u62df\u65b9\u6cd5\u7684\u60c5\u51b5\u3002\u8fd9\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u6280\u5de7\uff0c\u56e0\u4e3a\u4f60\u53ef\u4ee5\u5b9a\u5236\u6d3e\u751f\u7c7b\u7684\u865a\u62df\u65b9\u6cd5\uff0c\u6765\u4fee\u6539\u5bf9\u8c61\u7684\u52a8\u4f5c\u3002\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u89c4\u5219<\/span>20<\/span>\uff1a\u7528\u4e8e\u5c5e\u6027\u7684\u865a\u62df\u65b9\u6cd5\uff08<\/span>Virtual Methods For Properties<\/span>\uff09<\/span><\/font><\/strong>\n<\/div>\n
\n \u5373\u4f7f\u662f\u8bbf\u95ee\u5c5e\u6027\u7684\u65b9\u6cd5\u4e5f\u80fd\u5b9a\u4e49\u6210virtual\uff0c\u8fd9\u6837\u6d3e\u751f\u7c7b\u5c31\u80fd\u6539\u53d8\u5c5e\u6027\u7684\u52a8\u4f5c\u800c\u4e0d\u5fc5\u91cd\u5b9a\u4e49\u4ed6\u4eec\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u5728VCL\u5f53\u4e2d\u5f88\u5c11\u4f7f\u7528\uff0c\u4f46\u662f\u5b83\u786e\u5b9e\u5341\u5206\u7075\u6d3b\u3001\u5f3a\u5927\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u4ec5\u4ec5\u9700\u8981\u5c06Rule 11\u5f53\u4e2d\u7684Get \u548cSet \u65b9\u6cd5\u5b9a\u4e49\u6210Virtual\u3002\u57fa\u7c7b\u7684\u4ee3\u7801\u5982\u4e0b\u6240\u793a\uff1a\n<\/div>\n
\n  \n<\/div>\n
\n
\n type <\/strong>\n <\/div>\n
\n TformDialog = class ( TForm)\n <\/div>\n
\n Procedure<\/strong> FormCreate(Sender:Tobject);\n <\/div>\n
\n Private <\/strong>\n <\/div>\n
\n Edit1:Tedit;\n <\/div>\n
\n Protected <\/strong>\n <\/div>\n
\n function<\/strong> GetText:String;virtual;\n <\/div>\n
\n procedure<\/strong> SetText(const Value:String);virtual;\n <\/div>\n
\n public <\/strong>\n <\/div>\n
\n constructor<\/strong> Create(Text :String):reintroduce;overload;\n <\/div>\n
\n property<\/strong> Text:String read GetText write SetText;\n <\/div>\n
\n end<\/strong>;\n <\/div>\n<\/div>\n
\n  \n<\/div>\n
\n  \n<\/div>\n
\n \u5728\u7ee7\u627f\u7a97\u4f53\u4e2d\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9b\u989d\u5916\u7684\u52a8\u4f5c\u6765\u91cd\u8f7d\u865a\u62df\u65b9\u6cd5SetText\uff1a\n<\/div>\n
\n
\n procedure<\/strong> TformInherit.SetText(const Value:String);\n <\/div>\n
\n begin <\/strong>\n <\/div>\n
\n inherited SetText(Value);\n <\/div>\n
<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"delphi\u662f\u9762\u5411\u5bf9\u8c61\u7684\u53ef\u89c6\u5316\u7684\u5f00\u53d1\u73af\u5883_python\u9762\u5411\u5bf9\u8c61\u548c\u9762\u5411\u8fc7\u7a0b\u7684\u533a\u522bDelphi\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u768420\u6761\u89c4\u5219\u524d\u8a00\u8bc4\u8ff0\uff1a\u57282006\u5e7410\u6708\u4efd...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/5264"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=5264"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/5264\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=5264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=5264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=5264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}