IdDsnNETCompEditor.pas 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. unit IdDsnNETCompEditor;
  2. interface
  3. uses
  4. System.ComponentModel,
  5. System.ComponentModel.Design;
  6. type
  7. TIdNetComponentEditor = class(System.ComponentModel.Design.ComponentDesigner)
  8. protected
  9. procedure OnVerItemSelected(sender : System.Object; args : System.EventArgs);
  10. public
  11. function get_Verbs : DesignerVerbCollection; override;
  12. end;
  13. implementation
  14. uses
  15. IdAbout,
  16. IdGlobal,
  17. IdDsnCoreResourceStrings,
  18. IdSys;
  19. { TIdNetComponentEditor }
  20. function TIdNetComponentEditor.get_Verbs: DesignerVerbCollection;
  21. var LV : DesignerVerb;
  22. begin
  23. Result := inherited get_Verbs;
  24. if not Assigned(Result) then
  25. begin
  26. Result := DesignerVerbCollection.Create;
  27. end;
  28. LV := DesignerVerb.Create(Sys.Format(RSAAboutMenuItemName, [gsIdVersion]),OnVerItemSelected);
  29. LV.Enabled := True;
  30. LV.Visible := True;
  31. Result.Add(LV);
  32. end;
  33. procedure TIdNetComponentEditor.OnVerItemSelected(sender: TObject;
  34. args: System.EventArgs);
  35. begin
  36. ShowAboutBox(RSAAboutBoxCompName, gsIdVersion)
  37. end;
  38. end.