InvalidateBestSize

7 views
Skip to first unread message

Manolo

unread,
Nov 15, 2012, 7:26:02 PM11/15/12
to wx-...@googlegroups.com
Hi
Working with GetSizeFromTextSize implementation on wxSpinCtrl
I arrive to the conclusion that InvalidateBestSize() (at include\wx\windows.h)
should be virtual.
This is so because for a composite control (i.e. wxSpinCtrlGenericBase)
must invalidate all of its children cached sizes, not just its own size.

I consider it a big change. That's why I'm asking here.

By the way, I'll joint in the same patch (part_4) not only the new feature,
but also some small fixes wxSpinCtrlGenericBase needs, like redirecting
SetFont() to its wxTextCtrl.

TIA
Manolo

Vadim Zeitlin

unread,
Nov 15, 2012, 8:42:55 PM11/15/12
to wx-...@googlegroups.com
On Fri, 16 Nov 2012 01:26:02 +0100 Manolo wrote:

M> Working with GetSizeFromTextSize implementation on wxSpinCtrl
M> I arrive to the conclusion that InvalidateBestSize() (at include\wx\windows.h)
M> should be virtual.
M> This is so because for a composite control (i.e. wxSpinCtrlGenericBase)
M> must invalidate all of its children cached sizes, not just its own size.

Generally, InvalidateBestSize() is called from the composite control code
itself so I think that it should just invalidate the best size of the child
whose best size really changed instead of invalidating its own best size.

M> I consider it a big change. That's why I'm asking here.

I'd prefer not to do it because it would make size handling even more
complex to understand and I think there is really no need for this.

M> By the way, I'll joint in the same patch (part_4) not only the new feature,
M> but also some small fixes wxSpinCtrlGenericBase needs, like redirecting
M> SetFont() to its wxTextCtrl.

I believe the correct fix for this would be to make wxSpinCtrlGenericBase
derive from wxComposeWindow<wxSpinCtrlBase>, this should take care of it
automatically.

Also, separating independent changes in separate patches is appreciated,
as usual.

TIA,
VZ
Reply all
Reply to author
Forward
0 new messages