Home Extend items from the "Buttons" collection in "TcxButtonEdit" in Delphi VCL
Reply: 0

Extend items from the "Buttons" collection in "TcxButtonEdit" in Delphi VCL

user1780
1#
user1780 Published in May 24, 2018, 3:59 pm

I'm trying to extend the collection "Buttons" of type "TcxEditButtons". The purpose is to add an "OnClick" event and a "Shortcut" property on all buttons of a legacy TcxButtonEdit component. I started by overwriting the "Properties" property with the code below:

type
  TMycxDBButtonEditProperties = class(TcxCustomButtonEditProperties)
  private
    FButtons: TMycxEditButtons;
    procedure SetButtons(const Value: TMycxEditButtons);
    function GetButtons: TMycxEditButtons;
    public
      constructor Create(AOwner: TPersistent); override;
      procedure AfterConstruction; override;
    published
      property Buttons: TMycxEditButtons read GetButtons write SetButtons;
  end;

... in my component i do this ...

    type
      TMycxDBButtonEdit = class(TcxCustomButtonEdit)
    FProperties: TMycxDBButtonEditProperties;
  published
    property Properties: TMycxDBButtonEditProperties read FProperties write SetProperties;

The problem is somewhat obvious: the collection is available for editing, but does not reflect the actual ancestral property "Buttons". The question is: How do I make my collection affect the buttons on the component?

I tried to understand and apply what is described in the links below the support of Dev Express, but without success (incompetence)

https://www.devexpress.com/Support/Center/Question/Details/Q136143/creating-custom-tcxbuttonedit

https://www.devexpress.com/Support/Center/Question/Details/Q35461/do-you-have-information-on-creating-own-tcxcustomedit-descendant

https://www.devexpress.com/Support/Center/Question/Details/A483/how-to-hide-default-button-s-in-a-dropdown-editor-or-add-extra-buttons

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310349 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO