Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Problem with ScrollContainer...
icon9.gif  Problem with ScrollContainer... [message #22428] Tue, 14 July 2009 17:29 Go to next message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

Sorry for my English, first.

I'm trying to create a some kind of layouts system, which supports minimal, maximal and optimal sizes of inner controls.

If I want to add a support of the minimal size of child-controls, I must add scrollbars to the parent.

I have just modified a ScrollContainer, but it works very strange. ScrollContainer must show only the area of green rectangle.

Please, fresh heads, help me.
Thanks.
Re: Problem with ScrollContainer... [message #22429 is a reply to message #22428] Tue, 14 July 2009 19:27 Go to previous messageGo to next message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

More success, but not complete... Still need help or advice.

Best regards,
Anton.
Re: Problem with ScrollContainer... [message #22435 is a reply to message #22429] Wed, 15 July 2009 14:05 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Try the attached package.

In this example I haven't set max size. For layouts as in the example you would proabbly just want SetMaxSize(GetMaxSize())

One mistake you'd made was doing layout in the Paint routine. This should generally be avoided.

Also when Painting all drawing coords are already take any frames into account, so you don't have to worry about the view yourself (I made the same mistake when I started). Just do:
Rect r = GetSize()
// Draw background
w.DrawRect(r);
// Draw Text in top-left corner
w.DrawText(0, 0, "TEXT");


Hope that helps.

[Updated on: Wed, 15 July 2009 14:10]

Report message to a moderator

Re: Problem with ScrollContainer... [message #22436 is a reply to message #22428] Wed, 15 July 2009 16:17 Go to previous message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

Very clear and professional decision, Smile. Thanks, James, example will really help.

Soon I'll try to do a flow-type container (may be not correct translating) using your example.

[Updated on: Wed, 15 July 2009 16:18]

Report message to a moderator

Previous Topic: how to simulate text links?
Next Topic: strange looking window
Goto Forum:
  


Current Time: Thu Mar 28 18:16:40 CET 2024

Total time taken to generate the page: 0.01354 seconds