Perhaps Incorrect getUnclippedInnerRect in ScrollablePane Wi

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
daesdemon
Quite a regular
Quite a regular
Posts: 60
Joined: Fri Mar 11, 2005 21:19
Contact:

Perhaps Incorrect getUnclippedInnerRect in ScrollablePane Wi

Postby daesdemon » Fri Apr 01, 2005 00:50

Hello,

My problem is that:
I use ScrollPane with scrollBar automaticaly hide if not required.
I would like to know if the scrollbar is visible or not at a time.
The reason is when i get the ScrollablePane InnerUnclippedRect , it seems not to take care of this data, so it always give to me the complete area with the scrollbar area included.
I have to reduce this workable area when the scrollbar is active but i don't know how to know that.

Do someone have a clue?
I see a protected function isVertScrollbarNeeded but as i use wrappers to derive from CEGUI Windows, i cannot access them :(

Guest

Re: is the Scrollbar enabled

Postby Guest » Fri Apr 01, 2005 09:04

To find your scrollbars, have a look at the children of your scrollable pane. The scrollbars should have the same name as your scrollable pane widget with extention "__auto_hscrollbar__" or "__auto_vscrollbar__" (respectivly horizontal & vertical scrollbar).

Once you have it, just call ->isVisible on it.

But i'm pretty sure the scrollbars' size should be included when calculating the size of the render area. If it's not, then it's probably a bug.

--
Chris

User avatar
daesdemon
Quite a regular
Quite a regular
Posts: 60
Joined: Fri Mar 11, 2005 21:19
Contact:

Re: is the Scrollbar enabled

Postby daesdemon » Fri Apr 01, 2005 12:26

Thx Chris,
i will test that soon.

I submited it in BugReports.

User avatar
daesdemon
Quite a regular
Quite a regular
Posts: 60
Joined: Fri Mar 11, 2005 21:19
Contact:

Re: is the ScrollablePane Scrollbar enabled

Postby daesdemon » Fri Apr 01, 2005 12:32

Work Great Chris Thx
[Edit]
Except when i call isVisible() the first time it always seems to answer yes even if it is not, but it can be a bug in my construction routine, i will check it later.

Code to return a correct Workable Rect for ScrollablePane Widget in Window Absolute Coordinate

Code: Select all

Rect getWorkableRect(ScrollablePane* mRoot)
{
Window* vsb = mRoot->getChild(mRoot->getName()+"__auto_vscrollbar__");
Rect r = mRoot->screenToWindow(mRoot->getUnclippedInnerRect());
if (vsb->isVisible()) r.setWidth(r.getWidth()-VSCROLLBAR_WIDTH);
return r;
}

VSCROLLBAR_WIDTH seems to be 15 in WindowsLook

I haven't check for the Horizontal ScrollBar but it is propably the same
[/Edit]


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests