-
-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Could move the FWords: TWordsCollection; to be a protected member of TSkLabel?
Recently I would like to add the onMouseOver, onMouseLeave, onMouseEnter event to the TCustomWordsItem object, and I extend the TCustomWordsItem, And also create a TSkLabelEx class to extend the TSkLabel class.
Then override the function of the TSkLabel class in TSkLabelEx to support the worditem event the mouseOver, MouseEnter, MouseLeave. Now the only matter is the FWords: TWordsCollection which is a private member and can not accessed by my sub-class, So the first word item will not be changed to be my TCustomWordsItemEx object which can not handle the mouseEvent.
Thank you.
constructor TSkLabelEx.Create(AOwner: TComponent);
begin
inherited;
FWords.Free;
FWords := TWordsCollection.Create(Self, TCustomWordsItemEx);
// Words.set
FWords.OnChange := WordsChange;
end;
The FWords can not access, and if changed to Words.Free, Words := TWordsCollection.Create(Self, TCustomWordsItemEx); The FWords.Assign function will fail too as the FWords are already freed. If do not free the old FWords, the first WordItem will always be TCustomWordsItem instead of TCustomWordsItemEx .
I want to change the default FWords to be a TWordsCollection of my sub-class TCustomWordsItemEx which add the mouse Event support.
Thank you.
Metadata
Metadata
Assignees
Type
Projects
Status