Page 1 of 1

Okay, now I'm totally confused.

Posted: Sun Sep 04, 2005 05:18
by malachy1681
Okay, I've been having a problem with the last item in a 'ComboDropList' getting clipped and I used the two following snippets to try and determine why:

Code: Select all

if ( d_vertScrollbar->isVisible() )
{
  rectArea.d_right -= d_vertScrollbar->getAbsoluteWidth();
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_vertScrollbar is visible", Informative );
}
else
{
  rectArea.d_right -= m_flFrameRightSize;
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_vertScrollbar is NOT visible", Informative );
}

if ( d_horzScrollbar->isVisible() )
{
  rectArea.d_bottom -= d_horzScrollbar->getAbsoluteHeight();
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_horzScrollbar is visible", Informative );
}
else
{
  rectArea.d_bottom -= m_flFrameBottomSize;
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_horzScrollbar is NOT visible", Informative );
}


and this one:

Code: Select all

if ( true )
{
  rectArea.d_right -= d_vertScrollbar->getAbsoluteWidth();
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_vertScrollbar is visible", Informative );
}
else
{
  rectArea.d_right -= m_flFrameRightSize;
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_vertScrollbar is NOT visible", Informative );
}

if ( true )
{
  rectArea.d_bottom -= d_horzScrollbar->getAbsoluteHeight();
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_horzScrollbar is visible", Informative );
}
else
{
  rectArea.d_bottom -= m_flFrameBottomSize;
  Logger::getSingleton().logEvent ( "getListRenderArea() : d_horzScrollbar is NOT visible", Informative );
}


The thing is, 'CEGUI.log' reports exactly the same thing both times, but the item still gets clipped unless I use the second snippet. I am completely dumbfounded. Any help would be greatly appreciated.

P.S. - I hope you guys aren't getting annoyed by the plethora of topics I've been posting lately.

EDIT: Okay, now I noticed that with the first snippet, the scrollbars are initially returning that they are not visible, but later that they are. Wouldn't the later calls that report them as visible cause the render area to be altered to accommodate? It seems like it should anyways...

Also, in the 'performChildWindowLayout' method the srollbars report that they are not visible ( even though this method appears to be called after 'configureScrollbars' ) so they are not getting resized when both are present and overlap.

Re: Okay, now Im totally confused.

Posted: Sun Sep 04, 2005 13:21
by CrazyEddie
Since this is in CVS based code I'll have to test - it could be a bug.

Which 'look' module are you using?

Re: Okay, now Im totally confused.

Posted: Sun Sep 04, 2005 13:41
by malachy1681
Actually, I'm using my own custom look that I made originally in 2.1 and there were not bugs what-so-ever. All I did was make some minor modifications to work with 4.0 ( namely, I changed 'layoutComponentWidgets' to 'performChildWindowLayout' and 'renderListboxBaseImagery' to 'cacheListboxBaseImagery', as well as modifying the latter so that draw commands use 'renderCache' ).

Re: Okay, now Im totally confused.

Posted: Mon Sep 05, 2005 08:30
by CrazyEddie
I'll check a couple of this this morning and get back to you. As far as I am aware the TaharezLook and WindowsLook function ok, meaning it's possibly a issue in your new look, but I will double-check in case something has been broken.

Re: Okay, now Im totally confused.

Posted: Mon Sep 05, 2005 11:45
by CrazyEddie
I have looked into this and think I might know what you're seeing.

I think it's not being clipped to the scrollbar, but the botom edge image. So rather than using the bottom edge image to adjust the Rect that gets returned from getListRenderArea(), instead use some other value (like an absolutes value).

For the TaharezLook, the default looks like this when no scrollbar is visible:
Image

And when adjusted as described, it could look like this:
Image

HTH