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 » How do you make the widgets resizable?
How do you make the widgets resizable? [message #34402] Sun, 20 November 2011 17:25 Go to next message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
I know the window can be Sizeable() and Zoomable().

But how do you resize the widgets when the window gets resized?

Thanks

[Updated on: Mon, 21 November 2011 11:59]

Report message to a moderator

Re: How do you make the widgets resizable? [message #34413 is a reply to message #34402] Mon, 21 November 2011 09:18 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
Hello Lectus

U++ does it very simple:

- In the Layout Designer

index.php?t=getfile&id=3524&private=0

See the red thick lines and "spring" lines:
-- The thick lines means that that side of the control is attached to that side of the main frame
-- The "spring means that that side of the control is not attached.

Just open a example and play with it. It is very easy and useful.

- In the code
If you want to do it "the hard way" in the code, is very easy too as layout are translated into code with functions like LeftPosZ and so.

Anyway you can go to the GUI Tutorial section 16. Layouts where you can see examples and explanations.

There are more advanced features if you want fancier resizing but I think for now this enough Smile.
  • Attachment: img.PNG
    (Size: 9.50KB, Downloaded 579 times)


Best regards
Iñaki
Re: How do you make the widgets resizable? [message #34418 is a reply to message #34402] Mon, 21 November 2011 11:58 Go to previous messageGo to next message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
Thank you for your post! I now understand it!

U++ never fails to amaze me. It was actually pretty simple.
I just set Sizeable().Zoomable() and adjust the springs at the layout editor.
I just needed some explanation like yours to know where to look at. Smile

[Updated on: Mon, 21 November 2011 12:12]

Report message to a moderator

Re: How do you make the widgets resizable? [message #34419 is a reply to message #34418] Mon, 21 November 2011 12:22 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
lectus wrote on Mon, 21 November 2011 11:58

Thank you for your post! I now understand it!

U++ never fails to amaze me. It was actually pretty simple.
I just set Sizeable().Zoomable() and adjust the springs at the layout editor.
I just needed some explanation like yours to know where to look at. Smile

Hello Lectus

U++ Forum always love to help Smile.

Anyway if you need to start with the steepest learning curve you can try U++ Tutoring Plan.


Best regards
Iñaki
Re: How do you make the widgets resizable? [message #34426 is a reply to message #34419] Mon, 21 November 2011 20:04 Go to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Lectus,

You can also use the virtual method Layout() in TopWindow object.

Header file

class MyWin : public WithMyWinLayout<TopWindow> {
typedef MyWin CLASSNAME;

public:
MyWin();

private:
virtual void Layout();
};


cpp file

void MyWin::Layout()
{
Size sz = GetSize();

if(sz.cx== something)dosomething with SetRect(p1,p2,p3,p4)or the embedded widgets using layout functions (SizePos() etc..);

TopWindow::Layout(); //call the ancestor method
}


Hope this could be helpful

Regards
Biobytes
Previous Topic: EditField-Style - paper - just black!
Next Topic: Appearance problem with Docking framework
Goto Forum:
  


Current Time: Sun Jun 16 09:07:27 CEST 2024

Total time taken to generate the page: 0.01595 seconds