View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old April 1st, 2013, 10:23 AM
Now, the visual elements - showing that gizmo to the end user.

Here's an example from the gear tab in Shadowrun - this is within a <template>, and that template is the picktemplate="" of a table_dynamic portal:

Code:
 
<portal
  id="edit"
  style="actEdit"
  tiptext="Edit this Gear">
  <action
    action="edit"
    buttontext="">
    </action>
  </portal>
That will give you a button - the actEdit style (which does exist in the skeleton files, too) looks like a hammer and wrench. Pressing that button will open a form.

Now, scroll back a little ways in this thread - find where the <entity> was defined. See how it has a form="" option? That's where you set which form gets opened when the user clicks that button.

Here's how to define a 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>
You'll see that this looks quite a lot like the <panel> elements you've seen at the bottom of every tab_XXXXX file - that's because it does the same thing, except that it's defining a form, and not a tab panel. You can put all the things on a form that you can put on a tab panel - tables, choosers, etc. But those tables and choosers will be showing what's in the gizmo, not what's in the hero, like tables and choosers on a panel would, and anything added to them will be added to the gizmo container, not the hero container.

700 (or smaller, if you don't need it very wide) is the widest I'd recommend making a form. There are some netbooks and old computers out there whose screens are only 800 pixels wide, and we want Hero Lab to be able to support those. Too much wider than 700, and some of your form can end up off-screen. If you need lots of space for your form, think downwards - make it taller, and use a scrollbar to let the user see everything.

Normally, forms go in files named form_XXXXX.dat
Mathias is offline   #3 Reply With Quote