Personally I forsee many problems because of the different published properties.
Yes, uhh!
Now I looked properly the recent development of derit's ButtonEdit. It has gone bad.
The problems I mentioned are unavoidable, at least that's what I think.
Last time I looked was the initial version when he started this thread.
It is the 2. commit in the repository, titled: "New Repo", SHA1: e0f751a0f5eba00b65f
I'll have a look.
What pulled my attention was this in constructor:
with FEdit do
begin
...
OnChange := @DoEditTextChange;
OnClick := @DoEditClick;
...
and how the Do... methods and the events were done. (The Do... methods should not be virtual though).
I would have implemented a custom derived class for the edit control and then override all Doxxx methods to call the Onxxx events that belong to TButtonEdit.
type
TMyEdit = class(TCustomEdit)
...
procedure DoChange(Sender: TObject); override;
end;
...
procedure TMyEdit.DoChange(Sender: TObject);
begin
inherited DoChange;
if assigned TButtonEdit(Owner).OnChange then TButtonEdit(Owner).OnChange(Self);
end;
Even his initial naming "ButtonedEdit" was superior to our current EditButton. (I think we should use the better name and make EditButton a deprecated alias).
I don't mind the TButtonEdit name.
I think I under-estimated the difficulty of this task. Sorry everybody about that. Now I see 2 ways to go:
...
2. Bart has now a vision of this component and energy to implement it. I suggest Bart takes charge on the issue.
You can use the "New Repo" commit or any other code as a base.
Using IFDEFs is ok. Just don't make a completely separate component because we really need a replacement for the current buggy TEditButton.
I'll take a look at the version you mentioned.
Personally I feel more comfortable implementing it as a new component and then when time is ripe replacing the TEditButton's code with it (ifdef-ed or not).
This is mainly because I'm quite sure it'll f.u. the IDE when I try to work on it that way?
But this may just be my ignorance.
Main point of concern here is that I then need to rebuild the LCL with the new define, but I only know how to do that whilst rebuilding the entire IDE...
Bart