Disabling/enabling texture name bug

thecaptain

28-08-2007 02:51:38

Hey KungFooMasta, there's an issue with the way that disabling and enabling widgets work.

When you disable a widget, its mFullTextureName is changed, which shouldn't happen, because you revert back to that upon enable. Disable calls setTexture, and thus _processFullTextureName with the new .disabled texture name.

void Widget::_processFullTextureName(const Ogre::String& texture)
{
mFullTextureName = texture;
...



Pretty easy to fix, but I wasn't sure how you wanted to structure it.

kungfoomasta

28-08-2007 07:15:02

Thanks for spotting that. I thought about it a little, and chose to make a private function _setTexture, which will set the texture of a RenderObject, and update the Image used for transparency picking if desired, but will not call _processTextureName, which means it does not alter mFullTextureName , mTextureName, or mTextureExtension. Sound good?

thecaptain

28-08-2007 18:55:00

Sounds great :)

thecaptain

28-08-2007 19:55:21

Actually, it seems that there still may be a problem. Try adding a button in the demo that disables some other widgets. When I try disabling a button, I get a Resource Does Not Exist exception looking for a file "qgui.disabled.png" which probably shouldn't be happening.

There seem to be a few things going on here, so I think if you just test it out, you'll see what I mean.

kungfoomasta

29-08-2007 04:45:32

Ok I fixed it again, and I tested it with a poorly made "qgui.button.disable.png" texture. The problem was that I setup the _setTexture function to handle a scheme for disable textures, but forgot to restore the function when the scheme was aborted in favor of the current implementation. Fixed in SVN now. Going to try and put some work into the ProgressBar.