Its manifest itself when you try to clone a spinner, the Editbox auto window loses some of its properties, the most noticable properties for me is the font & the validation string.
The cause of the problem is that then you clone the spinner - it first creates all its auto windows:
Code: Select all
Window* Window::clone(const String& newName, const bool deepCopy) const
{
Window* ret =
WindowManager::getSingleton().createWindow(getType(), newName);
But then all its properties all cloned, including its LookNFeel.
Code: Select all
// always copy properties
clonePropertiesTo(*ret);
And then the in the Window::setLookNFeel its recreating all its auto windows:
Code: Select all
// Work to initialise the look and feel...
const WidgetLookFeel& wlf = wlMgr.getWidgetLook(look);
// Get look and feel to initialise the widget as it needs.
wlf.initialiseWidget(*this); /// <<< this call recreates all the auto windows
// do the necessary binding to the stuff added by the look and feel
initialiseComponents();
in 'Spinner::initialiseComponents' its calling the function 'setTextInputMode':
Code: Select all
setTextInputMode(Integer);
but because its the second time this function is called, the first time was then the spinner was created, it fails the test:
Code: Select all
if (mode != d_inputMode)
{ // This code is not run
switch (mode)
{
case Integer:
getEditbox()->setValidationString(IntegerValidator);
break;
And as consequence the editbox looses its validation string. And in a similar way its looses its font.
A quick fix to the problem is to add the following line:
Code: Select all
void Window::setLookNFeel(const String& look)
{
if( d_lookName == look ) return;
I don't know if it causes any other bugs but its fixes my problem with cloning a Spinner.