Override Text property of Edit. As?

0

I'm developing a component that is descending from a TEdit . When I invoke the Text property of this component, I do not want it to return what is actually appearing in the Text of the component, rather I want to set a new value of the Text property. Example: ShowMessage(Componente.Text) . In this case, even though the Text property of the component has the Hello world value, I want it to display, for example, the value of the Hint property of the component.

I'm doing this because I already have a system-wide search component, I use Text as a value for operations ( SQL'se etc. ) Now we're modernizing it, but how the whole system uses it, I need to keep the same way of accessing it, otherwise I will have a gigantic (almost impossible) job to modernize the component.

How to do this?

I hope I have been clear.

    
asked by anonymous 24.10.2016 / 13:03

1 answer

1

I managed to solve. I created a Text property with Read / Write GetText and SetText . In GetText I get Result to get the value I want, for example Hint , and if I want the default value, I Result := Inherited Text;
And in SetText , I do this: inherited Text := Value;

    
24.10.2016 / 18:40