-
October 25th, 2020, 00:42 #1
Can you increase all field widths when a window is made wider
Evening,
Been trying to work this one out.
I have a window list, it's got:
Name Protection KG Notes
____________ _________ ___ ________
Now what I want when the window is made wider is to increase the width of each based on the new width
Name Protection KG Notes
__________________ __________ ____ __________
And so on. So each field increases in proportion to each other.
I can only find a way to increase one field, the name as the others are inline with it
Cheers,
MBMRuleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
October 25th, 2020, 11:40 #2
- Join Date
- Sep 2018
- Posts
- 75
I guess you have to write a onSizeChanged function for the according windoinstances.
-
October 25th, 2020, 13:25 #3Ruleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
October 25th, 2020, 14:05 #4
I've got onSizeChanged being called. Is there a way to modify the size of a label at all?
Ruleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
October 25th, 2020, 15:03 #5
Use the various setAnchor API commands. For example, setAnchoredWidth: https://fantasygroundsunity.atlassia...tAnchoredWidth
Or do some calculations and use setStaticBounds. Here's an example I use in The Dark Eye extension to calculate the width based off a third of the width of the window:
Code:<script> function onInit() self.onSizeChanged = resizeFrames; end function resizeFrames(sourceWindow) local nWidth,_ = getSize(); cas2.setStaticBounds((nWidth/3), 215, (nWidth/3)-15, 250) end </script>
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
October 25th, 2020, 15:25 #6
Hi Chap,
It would be better to be able to say 'this label is 50% of the width, this label is 15%, this label is 20% and this label is 15%'
I tried the setStaticBounds and the label just vanishes.
Is there any example anywhere where a windowlist column is resized and the labels are fixed above?
Cheers,
MBMRuleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
October 25th, 2020, 16:08 #7
As column labels are essentially independent of the actual windowlist, the sizing/positioning of the labels has to be handled separately. You can use similar code to what I referred to above for each of the windowlist column labels and the fields within the windowlist, but you can't just say a label outside of a windowlist is positioned above a field within the windowlist.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks