Auto Scroll Topic is solved
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Auto Scroll
I have a VScrollWindow in which I add many panels, with dynamic sizes, which I don't know. I want the window to scroll automatically to adjust all the panels. Currently the bottom panels are not visible.
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
I'm not quite sure what you mean by "I want the window to scroll automatically to adjust all the panels. Currently the bottom panels are not visible." Could you expand on that?
If you mean that the wxVScrolledWindow isn't using the correct sizes, make sure your overload of OnGetLineHeight() returns the size of the window that represents that line.
If you mean that the wxVScrolledWindow isn't using the correct sizes, make sure your overload of OnGetLineHeight() returns the size of the window that represents that line.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
wxVScrolledWindow actually has problems with children layed out using a sizer. I've address these problems in a patch but it hasn't been applied yet.
You should be able to query the actual windows about their size. Something like parent_window->GetChildren(), parent_window->GetSizer->GetItem() (not sure how to get the maximum item index from a sizer though...), or just keeping your own list of the controls. After that, you can just call GetSize().GetHeight() on the correct window and return that in OnGetLineHeight().
You should be able to query the actual windows about their size. Something like parent_window->GetChildren(), parent_window->GetSizer->GetItem() (not sure how to get the maximum item index from a sizer though...), or just keeping your own list of the controls. After that, you can just call GetSize().GetHeight() on the correct window and return that in OnGetLineHeight().
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Code: Select all
wxCoord CVScrollWindow::OnGetLineHeight(size_t n) const
{
return GetSizer()->GetItem(n)->GetSize().GetHeight();
}