Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Kairos
Senior Member
Volunteer Data File Author
 
Join Date: Feb 2009
Posts: 173

Old August 19th, 2016, 05:52 PM
Greetings!

So I have returned to a ruleset I had set aside, and have re-encountered a pernicious issue regarding gizmo forms. To wit, I have portals that, when they expand vertically, start scrolling. What I would like to have happen is for the form itself to resize vertically dynamically instead. Any advice on how to proceed would be greatly appreciated.


Authoring Kit Rule Sets (now with functioning links!):

Qin: The Warring States

Doctor Who: Adventures in Time and Space

MEGS/BoH/DC Heroes (work in progress)
Kairos is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 19th, 2016, 06:34 PM
Here's an example of a form in Shadowrun that's set up to get as tall as the screen will allow, and then add a scrollbar if that's still needed (for example, on a short-monitored laptop).

The form:
Code:
  <form
    id="poCustPoss"
    name="Possession Details"
    marginhorz="10"
    marginvert="5">
    <layoutref layout="poPossess"/>
    <position><![CDATA[
      layout[poPossess].width = 480
      perform layout[poPossess].render
      width = layout[poPossess].width
      height = layout[poPossess].height
      ]]></position>
    </form>
The position script on the layout:

Code:
    <position><![CDATA[
      autogap = 15

      ~since our table uses a needtag expression to determine what can be shown
      ~we'll fix the table if there are no powers available for selection
      if (container.tagis[OptPower.?] + container.tagis[Hero.AllySpirit] = 0) then
        portal[poPower].freeze = 1
        endif

      if (container.tagis[InnateAvl.?] + container.tagis[HasInnate.?] + container.tagis[Hero.SpirInnate] <> 0) then

        ~but if we're not allowed to choose more, freeze the table
        if (container.tagis[InnateAvl.?] + container.tagis[Hero.SpirInnate] = 0) then
          portal[poSpells].freeze = 1
          endif
      else
        portal[poSpells].visible = 0
        endif

      if (portal[poPower].itemcount = 0) then
        portal[poPower].visible = 0
        endif

      if (portal[poWeakness].itemcount = 0) then
        portal[poWeakness].visible = 0
        endif

      if (container.tagexpr[SpiSklCat.? | SpiSklAllw.?] = 0) then
        portal[poActSkill].visible = 0
        endif

      portal[poDefAttr].width = 250

      perform portal[poRace].centerhorz
      perform portal[poDefAttr].centerhorz

      if (container.tagis[TemplatCat.?] + portal[poTemplate].itemcount = 0) then
        portal[poTemplate].visible = 0
        perform portal[poDefAttr].alignrel[ttob,poRace,10]
      else
        portal[poTemplate].width = width
        perform portal[poTemplate].alignrel[ttob,poRace,10]
        perform portal[poDefAttr].alignrel[ttob,poTemplate,10]
        endif

      perform portal[poDefAttr].centerhorz

      autotop = portal[poDefAttr].bottom + 10

      ~since it's possible, even after using batchplace, for the form's
      ~height to exceed the available height, we want to record what the autotop
      ~was at this point, so we can re-use it later if we need to reset the
      ~arrangement
      var oldautotop as number
      oldautotop = autotop

      perform portal[poPower].batchadd
      perform portal[poActSkill].batchadd
      perform portal[poWeakness].batchadd
      perform portal[poSpells].batchadd

      perform batchplace

      ~if there wasn't actually enough space to show all those portals, then
      ~we reset our autotop, and then set the height to a really large number.
      ~then, re-do the batchplace with that new larger amount of space.  The
      ~result will be a scrollbar for the whole form, and no scrollbars on the
      ~individual tables
      if (autotop > autobottom) then
        autotop = oldautotop

        height = 10000
        autobottom = 10000

        perform portal[poPower].batchadd
        perform portal[poActSkill].batchadd
        perform portal[poWeakness].batchadd
        perform portal[poSpells].batchadd

        perform batchplace
        endif

      height = autotop

      ]]></position>
The batchadd/batchplace may be newer than your files - that's the newer, better way of placing lots of different tables on top of each other within the autotop/autobottom/autoright/autoleft space.

.itemcount is probably also new - that's the count of items currently in that table - this layout has several tables that may or may not be needed, and hides the ones that aren't in use.
Mathias is offline   #2 Reply With Quote
Kairos
Senior Member
Volunteer Data File Author
 
Join Date: Feb 2009
Posts: 173

Old August 20th, 2016, 03:48 AM
Brilliant! Thanks, M!

Authoring Kit Rule Sets (now with functioning links!):

Qin: The Warring States

Doctor Who: Adventures in Time and Space

MEGS/BoH/DC Heroes (work in progress)
Kairos is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:32 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.