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 » TopWindow&PopUp, TrayIcon » same layout with different dimensions
same layout with different dimensions [message #56922] Sat, 01 May 2021 05:54 Go to next message
BetoValle is currently offline  BetoValle
Messages: 158
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,

How can I use the same layout with different dimensions by loading with

CtrlLayout ( *this, "Window title" )

I designed an "A" layout and in certain situations I need to load this layout with half the size

if you use SetRect with the desired dimension, it will not respect it, carrying the original design.

like below
  CtrlLayout ( *this, "Window title" )
  if(x=='A') 
    SetRect(0,0,400,200);
  else
    SetRect(0,0,400,100); 


Thanks
Re: same layout with different dimensions [message #56923 is a reply to message #56922] Sat, 01 May 2021 09:50 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 675
Registered: November 2008
Location: France
Contributor
Hello BetoValle,

I don't understand what you are trying to do Question

The size of the layout depends on the size of the destination rect.
If you want the widgets to move/resize with the layout size : use the springs in the layout designer
If you need another layout then change the layout dynamically : take a look at the upp/reference/SetLayout example Wink
Re: same layout with different dimensions [message #56933 is a reply to message #56922] Sat, 01 May 2021 18:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13639
Registered: November 2005
Ultimate Member
CtrlLayout also does SetMinSize, which is probably blocking your SetRect. Try to setup new min size too...

Mirek

[Updated on: Sat, 01 May 2021 18:07]

Report message to a moderator

Re: same layout with different dimensions [message #56936 is a reply to message #56933] Sat, 01 May 2021 20:44 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 158
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Thanks Mirek!

Didier, I don't know if it was this shape below that I was guessing.
After a predefined screen .lay file, in the first runtime that changes dimension will only work if it calls "SetMinSize" and then, then, use, SetRect securing permission with true to Sizeable

this below work!


    CtrlLayout ( *this, "Window title" ) // original lay out size(800,600)
    Sizeable(true);
    [b]SetMinSize(80,20);[/b]
    SetRect(0,0,400,200);  //this dimension will be displayed 
    Sizeable(false)




this below not work!



    CtrlLayout ( *this, "Window title" ) // original lay out size(800,600)
    Sizeable(true);
    SetRect(0,0,400,200);
    Sizeable(false)


Previous Topic: TopWindow when Close override show exception unduly
Next Topic: Multi monitor support
Goto Forum:
  


Current Time: Wed Jun 29 05:53:07 CEST 2022

Total time taken to generate the page: 0.01473 seconds