• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Gizmo Form coming up Maximized

firedrakemacfie

New member
I'm creating a set for BESM 2nd Ed, I'm trying add customizable options for Attributes (aka powers or abilities in other systems), and I'm looking into using Gizmos. I'm starting with the 'Gun Bunny' Attribute, which lets the character add a number of mini-abilities attached to the main Attribute.

It's a fairly simple form (which I'll be adding to later, but I wanted to get the basics working first), consisting of a dynamic table to add the abilities, but when I go to add the main Attribute, the form that pops up fills up the screen. I've tried changing the dimensions of the layout and form, but the form size won't change, and I get these errors when the form pops up:

2gv0eif.jpg


As shown in the screenshot, the layout is sizing correctly, but the form itself stays maximized. Here's the relevant code:

Portal:
Code:
  <portal
    id="gbGunBun"
    style="tblNormal">
    <table_dynamic
      component="GunBunPow"
      showtemplate="gbPick"
      choosetemplate="SimpleItem"
      headerpick="gbSimple"
      addpick="gbSimple">
      <list>!Hide.GunBunny</list>
      <titlebar><![CDATA[
        @text = "Add a Gun Bunny Ability"
        ]]></titlebar>
      <description/>
      <headertitle><![CDATA[
        @text = "Gun Bunny Abilities: " & hero.child[resGunBun].field[resSummary].text
        ]]></headertitle>
      <additem><![CDATA[
        @text = hero.child[resGunBun].field[resAddItem].text
        ]]></additem>
      </table_dynamic>
    </portal>

Layout:
Code:
  <layout
    id="gunbunpow">
    <portalref portal="gbGunBun" taborder="10"/>

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
      width = 300
      height = 300
      portal[gbGunBun].width = width
      portal[gbGunBun].height = height
      ]]></position>

    </layout>

Form:
Code:
  <form
    id="fmGunBun"
    name="Gun Bunny Options"
    entity="enGunBun"
    marginhorz="5"
    marginvert="5"
    defwidth="300"
    defheight="300"
    maxwidth="300"
    maxheight="300">

    <layoutref layout="gunbunpow"/>
    <position><![CDATA[
      ~render the layout to generate its dimensions
      perform layout[gunbunpow].render

      ~set the width and height of the form to the dimensions of the layout
      width = layout[gunbunpow].width
      height = layout[gunbunpow].height
      ]]></position>
    </form>

Entity:
Code:
  <entity
    id="enGunBun"
    form="fmGunBun"
    defaultthing="gbSimple">
    <bootstrap thing="gbSimple"/>
  </entity>

I can't find anything in the wiki or the forums that helps with this, and the form code has very little modified from the sample code in the wiki and skeleton files. So now I come to seek the great and powerful Wizard of HL to see if I can get some brains.
 
Try deleting the margin, def and max entries from the form. I think by setting a non-zero maxwidth, you're telling the program that the form should be user-sizable, but in your script, you're then enforcing a fixed width

Here's a form and layout I know works:
Code:
  <layout
    id="skSpecial">
    <portalref portal="skSpecial" taborder="10"/>
    <portalref portal="skKnowSpec" taborder="20"/>
    <templateref template="skFixedSp" dynamic="yes" ispick="yes"/>
    <position><![CDATA[
      width = 350
      autoright = width

      if (container.parent.tagis[component.SkillKnow] = 0) then
        perform portal[skSpecial].autoplace
        portal[skKnowSpec].visible = 0
      else
        perform portal[skKnowSpec].autoplace
        portal[skSpecial].visible = 0
        endif

      if (container.parent.field[sklFixedSp].isempty = 0) then
        template[skFixedSp].width = width
        perform template[skFixedSp].render
        template[skFixedSp].top = autotop + 10
        height = template[skFixedSp].bottom
      else
        template[skFixedSp].visible = 0
        height = autotop
        endif
      ]]></position>
    </layout>

  <form
    id="skSpecial"
    name="Skill Specialty">
    <layoutref layout="skSpecial"/>
    <position><![CDATA[
      perform layout[skSpecial].render
      width = layout[skSpecial].width
      height = layout[skSpecial].height
      ]]></position>
    </form>
 
Back
Top