FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    Windowlist/class help.

    I'm trying to set my skill frame up so I can right click "add entry" for the skills. Anyone see where I'm goofing up?

    Here's a screenie testing it:



    I keep getting -

    Ruleset Warning: Anchored control static height ignored
    Ruleset Warning: Anchored control static width ignored.

    Here's the windowclass

    Code:
    <windowclass name="charsheet_skillentry">
    		<sizelimits>
    			<minimum>
    				<height>10</height>
    			</minimum>
    		</sizelimits>
    		<sheetdata>
    			<textlistitemvalue name="skill_name">
    				<anchored>
    					<left>
    						<anchor>left</anchor>
    						<offset>0</offset>
    					</left>
    					<right>
    						<anchor>left</anchor>
    						<offset>185</offset>
    					</right>
    					<top>
    						<anchor>top</anchor>
    					</top>
    				</anchored>
    				<tabtarget>
    					<next>location</next>
    					<prev>count</prev>
    				</tabtarget>
    				<script>
    					function onLoseFocus()
    						super.onLoseFocus();
    						window.windowlist.applySort();
    					end
    				</script>
    			</textlistitemvalue>
    			<numberfield name="skill_score">
    				<font>sheetnumbersmall</font>
    				<anchored>
    					<to>skill_name</to>
    	  				<position>right</position>
      					<offset>7,0</offset>
      					<size>
    						<width>20</width>
    						<height>15</height>
    					</size>
    					
    				</anchored>
    				<frame>
    					<name>textlinesmall</name>
    					<offset>0,-2,0,0</offset>
    				</frame>
    			</numberfield>
    			<checkbox name="exp1">
    				<anchored>
    					<to>skill_name</to>
    	  				<position>belowleft</position>
      					<offset>0,0</offset>
      					<size>
    						<width>15</width>
    						<height>15</height>
    					</size>
    				</anchored>
    			</checkbox>	
    		</sheetdata>
    	</windowclass>
    ...and the windowlist

    Code:
    <genericcontrol name="skillframe">
    				<bounds>15,180,245,305</bounds>
    				<frame>
    					<name>sheetgroup</name>
    				</frame>
    			</genericcontrol>
    			<stringcontrol name="skilllabel">
    				<anchored>
    					<to>skillframe</to>
    					<position>insidetop</position>
    					<size>
    						<width>45</width>
    						<height>27</height>
    					</size>
    					<offset>-15,9</offset>
    				</anchored>
    				<font>sheetlabel</font>
    				<static>SKILLS</static>
    			</stringcontrol>
    			<windowlist name="skilllist">
    				<class>charsheet_skillentry</class>
    				<anchored>
    					<to>skillframe</to>
    					<position>insidetop</position>
    					<offset>-15,22</offset>
    				</anchored>
    				<allowcreate />
    				<allowdelete />
    			</windowlist>
    			<scrollercontrol>
    				<anchored>
    					<to>skillframe</to>
    					<position>insidebottomright</position>
    					<size>
    						<width>45</width>
    						<height>27</height>
    					</size>
    				</anchored>
    				<target>skilllist</target>
    				<button>
    					<normal>button_scroller</normal>
    					<pressed>button_scroller_down</pressed>
    				</button>
    			</scrollercontrol>
    Last edited by tdwyer11b; July 12th, 2007 at 23:56.
    Alea Iacta Est
    The Die is Cast!

  2. #2
    Its just a warning and should still work ok. I believe when you using an <anchored> and the shorthand <to> tag it assumes the same size as the control its anchoring to. Thus it is ignoring your <size> tags and letting you know.

  3. #3
    WOW! That was quick! Your right it does work, but it slows down the sheet from loading up. So basically I only have to define the first set of controls and the ones after will assume the attributes they are anchored to?
    Alea Iacta Est
    The Die is Cast!

  4. #4
    Yes so make sure that anchoring control has something defined for size. In your example above the checkbox is seeing the numberfield has a width/heigth defined so it ignores its tag and is using the numberfield size.

    Even though the numberfield is anchored to the skill name since the name doesn't specify a size it doesn't complain there. Does that make more sense?

  5. #5
    Quote Originally Posted by joshuha
    In your example above the checkbox is seeing the numberfield has a width/heigth defined so it ignores its tag and is using the numberfield size.
    I'm not sure how the checkbox is seeing the numberfield when it's anchored to the textlistitemvalue. Or does it read the values of the item right before it?

    Code:
    <checkbox name="exp1">
    				<anchored>
    					<to>skill_name</to>
    	  				<position>belowleft</position>
      					<offset>0,0</offset>
      					<size>
    						<width>15</width>
    						<height>15</height>
    					</size>
    				</anchored>
    			</checkbox>
    Also, any idea why none of the information I enter saves? I've even tried using /save on the chat panel, doesn't work.
    Last edited by tdwyer11b; July 13th, 2007 at 01:03.
    Alea Iacta Est
    The Die is Cast!

  6. #6
    Quote Originally Posted by tdwyer11b
    Also, any idea why none of the information I enter saves? I've even tried using /save on the chat panel, doesn't work.
    Think you just need to specify a <datasource> tag in your charsheet_skillentry windowclass.
    Work Less, Game More!

  7. #7
    Quote Originally Posted by tdwyer11b
    I'm not sure how the checkbox is seeing the numberfield when it's anchored to the textlistitemvalue. Or does it read the values of the item right before it?
    Oops sorry I misread that. Hmm, lemme think more on the warnings then. If it was the case of the skill_name being the offending bounds you should be getting those errors for each control but I only see it once.

    Quote Originally Posted by tdwyer11b
    Also, any idea why none of the information I enter saves? I've even tried using /save on the chat panel, doesn't work.
    Toadwart has the correct answer. The datasource needs to be there for the windowlist.

  8. #8
    Hmmm, I added <datasource>.skillentry</datasource> to the windowlist and none of my entries show up now. Do I need to define this elsewhere as well?
    Alea Iacta Est
    The Die is Cast!

  9. #9
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    The skill_score numberfield is generating the height warning: when you anchor 'right' the child control takes the height of its anchor and you only need to specify the width. I'm not so sure about the width warning(s), is there only one or more than one of them?

    As regards linking the checkbox, it depends on the database structure. Typically the windowlist would be tied to 'skills' or something, then the windowclass controls would be tied to 'name', 'score' and 'exp'. The windowclass controls don't need explicit source attributes as the name of the control is the default name of the underlying db source.

    In this example, you would end up with a db along the lines of:

    Code:
    <skills>
      <id-00001>
        <name type='string'>My first skill</name>
        <score type='number'>25</score>
        <exp type='number'>1</exp>
      </id-00001>
      <id-00002>
        <name type='string'>My other skill</name>
        <score type='number'>10</score>
        <exp type='number'>0</exp>
      </id-00002>
    </skills>
    Have a look in your campaign db.xml to see what is/has been going on.

    Cheers

    Stuart
    (Foen)

  10. #10
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    Sorry tdwyer11b, here is a more complete (and correct answer).

    The insidetop anchor fixes the width of the control, so any width attribute of size causes a problem. I have re-worked your code, and here is an amended windowclass:

    Code:
      <windowclass name="charsheet_skillentry">
        <sizelimits>
          <minimum>
            <height>10</height>
          </minimum>
        </sizelimits>
        <sheetdata>
          <textlistitemvalue name="name">
            <anchored>
              <left>
                <anchor>left</anchor>
                <offset>0</offset>
              </left>
              <right>
                <anchor>left</anchor>
                <offset>185</offset>
              </right>
              <top>
                <anchor>top</anchor>
              </top>
              <size>
                <height>18</height>
              </size>
            </anchored>
            <script>
              function onLoseFocus()
                super.onLoseFocus();
                window.windowlist.applySort();
              end
            </script>
          </textlistitemvalue>
          <numberfield name="score">
            <font>sheetnumbersmall</font>
            <anchored>
              <to>name</to>
              <position>right</position>
              <offset>7</offset>
              <size>
                <width>20</width>
              </size>
            </anchored>
            <frame>
              <name>textlinesmall</name>
              <offset>0,-2,0,0</offset>
            </frame>
          </numberfield>
          <checkbox name="exp">
            <anchored>
              <to>name</to>
              <position>belowleft</position>
              <size>
                <width>15</width>
                <height>15</height>
              </size>
            </anchored>
          </checkbox>
        </sheetdata>
      </windowclass>
    The windowlist and other sheetdata now looks like this

    Code:
      <genericcontrol name="skillframe">
        <bounds>15,180,245,305</bounds>
        <frame>
          <name>sheetgroup</name>
        </frame>
      </genericcontrol>
      <stringcontrol name="skilllabel">
        <anchored>
          <to>skillframe</to>
          <position>insidetopleft</position>
          <size>
            <width>45</width>
            <height>27</height>
          </size>
          <offset>15,9</offset>
        </anchored>
        <font>sheetlabel</font>
        <static>SKILLS</static>
      </stringcontrol>
      <windowlist name="skilllist">
        <class>charsheet_skillentry</class>
        <datasource>.skills</datasource>
        <anchored>
          <to>skillframe</to>
          <position>over</position>
          <offset>-15,-22</offset>
        </anchored>
        <allowcreate />
        <allowdelete />
      </windowlist>
      <scrollercontrol>
        <anchored>
          <to>skillframe</to>
          <position>insidebottomright</position>
          <size>
            <width>45</width>
            <height>27</height>
          </size>
        </anchored>
        <target>skilllist</target>
        <button>
          <normal>button_scroller</normal>
          <pressed>button_scroller_down</pressed>
        </button>
      </scrollercontrol>
    The data it created in the campaign db.xml file was:

    Code:
      <skills>
        <id-00001>
          <exp type="number">1</exp>
          <name type="string">Skill one</name>
          <score type="number">34</score>
        </id-00001>
        <id-00002>
          <exp type="number">0</exp>
          <name type="string">Skill two</name>
          <score type="number">25</score>
        </id-00002>
      </skills>
    I've attached a thumbnail of the result.

    Hope that helps

    Stuart
    (Foen)

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