Hi,
I am trying to inherit from TButton in order to provide some size aware capabilities, where the buttons are able to resize themselves and/or their font size (within certain constraints) to allow for changes in text
e.g.
| small |
or
| this is a really long |
| sentence on a button |
could happily be the same button on the same form, all I've done is reset the text and the button copes with the size change itself.
I've implemented all the text measuring functions, and the functionality works to a point.
what I have done is create new properties maxHeight, minHeight, defaultHeight and so forth for Width and Font.
When the user changes the default height, my design time component will change and reflect this new default height.
When the user uses the normal Height & Width properties however (or drags the corner) I don't know how to tie them to the default height and width.
I intercepted OnCanResize and created an event handler and tried to confirm that the new size is within the min max. If it's not, set to the min or max as required, but if within the boundaries then update. I am able to intercept runtime resize events, but not design time.
If it is possible to intercept the design time resizes, does anyone know how?
sorry if that's a bit long-winded, hope it makes sense!