Starfinder Playlist
  1. #1
    Brenn's Avatar
    Join Date
    Jun 2005
    Location
    Fort Smith, AR
    Posts
    196

    Question on dynamic resizing on the core CT

    I've been banging my head against this for about four hours now and I can't figure out how this is being pulled off. So I thought I'd ask.

    Ok, so in the core CT when you toggle the effects of a particular entry on/off or add/remove an effect the entry resizes and the list moves to accomodate. I want to add a feature like this on the character sheet I'm doing at the moment.
    I've poured over the code in core and the answer is eluding me.

    How in the heck is this happening?

    I don't need a long huge explanation, just to get pointed in the right direction or just a general overview.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    Look at the Notes tab on 5e Char Sheet?
    Or Actions when you click on a magnifying glass.

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    The controls use relative anchoring. See the "Anchoring" section here: https://www.fantasygrounds.com/modguide/windowing.xcp specifically the "relative" option. The controls that appear/disappear when the relevant buttons are pressed are all anchored on the same control: <string_ctname name="name"> with the top anchor of these controls all being "relative" to this "name" control. For example:

    Code:
    <anchored>
    	<top parent="name" anchor="bottom" relation="relative" offset="10" />
    The relative relation means that the control will be anchored on the last control anchored to the "name" control - this links all of the visible controls with a relative relation to the same parent control together. If you set a control to be invisible (visible = false) then it will be removed from the relative relation anchoring and the following controls will be anchored on the control before the one removed.

    It's a very powerful way of dynamically altering GUI layout as controls are added/removed (made visible/invisible).
    Last edited by Trenloe; June 6th, 2015 at 16:15.
    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!

  4. #4
    Brenn's Avatar
    Join Date
    Jun 2005
    Location
    Fort Smith, AR
    Posts
    196
    Wow. Ok, thanks! I think I understand. Sweet.

    -
    Edit:
    Yeah that did it. Wow that makes things easy.
    Last edited by Brenn; June 6th, 2015 at 16:22. Reason: Eureka!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in