CnASPropEditors.pas 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {******************************************************************************}
  2. { CnPack For Delphi/C++Builder }
  3. { 中国人自己的开放源码第三方开发包 }
  4. { (C)Copyright 2001-2018 CnPack 开发组 }
  5. { ------------------------------------ }
  6. { }
  7. { 本开发包是开源的自由软件,您可以遵照 CnPack 的发布协议来修 }
  8. { 改和重新发布这一程序。 }
  9. { }
  10. { 发布这一开发包的目的是希望它有用,但没有任何担保。甚至没有 }
  11. { 适合特定目的而隐含的担保。更详细的情况请参阅 CnPack 发布协议。 }
  12. { }
  13. { 您应该已经和开发包一起收到一份 CnPack 发布协议的副本。如果 }
  14. { 还没有,可访问我们的网站: }
  15. { }
  16. { 网站地址:http://www.cnpack.org }
  17. { 电子邮件:master@cnpack.org }
  18. { }
  19. {******************************************************************************}
  20. unit CnASPropEditors;
  21. {* |<PRE>
  22. ================================================================================
  23. * 软件名称:不可视工具组件包
  24. * 单元名称:ActiveScript 脚本引擎属性编辑器单元
  25. * 单元作者:周劲羽 (zjy@cnpack.org)
  26. * 备 注:
  27. * 开发平台:PWin2K SP3 + Delphi 7
  28. * 兼容测试:PWin9X/2000/XP + Delphi 5/6/7 C++Builder 5/6
  29. * 本 地 化:该单元中的字符串均符合本地化处理方式
  30. * 单元标识:$Id$
  31. * 修改记录:2003.10.31
  32. * 增加组件版权信息属性编辑器TCnCopyrightProperty
  33. ================================================================================
  34. |</PRE>}
  35. interface
  36. {$I CnPack.inc}
  37. uses
  38. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  39. {$IFDEF COMPILER6_UP}
  40. DesignIntf, DesignEditors,
  41. {$ELSE}
  42. DsgnIntf,
  43. {$ENDIF}
  44. CnActiveScript, CnConsts;
  45. type
  46. { TCnScriptLangProperty }
  47. TCnScriptLangProperty = class(TStringProperty)
  48. public
  49. function GetAttributes: TPropertyAttributes; override;
  50. procedure GetValueList(List: TStrings);
  51. procedure GetValues(Proc: TGetStrProc); override;
  52. end;
  53. implementation
  54. { TCnScriptLangProperty }
  55. function TCnScriptLangProperty.GetAttributes: TPropertyAttributes;
  56. begin
  57. Result := [paValueList, paSortList, paMultiSelect];
  58. end;
  59. procedure TCnScriptLangProperty.GetValueList(List: TStrings);
  60. begin
  61. GetActiveScriptParse(List);
  62. end;
  63. procedure TCnScriptLangProperty.GetValues(Proc: TGetStrProc);
  64. var
  65. j: Integer;
  66. Values: TStringList;
  67. begin
  68. Values := TStringList.Create;
  69. try
  70. GetValueList(Values);
  71. for j := 0 to Values.Count - 1 do
  72. Proc(Values[j]);
  73. finally
  74. Values.Free;
  75. end;
  76. end;
  77. end.