Thread: Windowlist/class help.
-
July 12th, 2007, 23:50 #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>
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!
-
July 12th, 2007, 23:56 #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.
-
July 13th, 2007, 00:00 #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!
-
July 13th, 2007, 00:25 #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?
-
July 13th, 2007, 00:57 #5Originally Posted by joshuha
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>
Last edited by tdwyer11b; July 13th, 2007 at 01:03.
Alea Iacta Est
The Die is Cast!
-
July 13th, 2007, 03:43 #6Originally Posted by tdwyer11bWork Less, Game More!
-
July 13th, 2007, 03:46 #7Originally Posted by tdwyer11b
Originally Posted by tdwyer11b
-
July 13th, 2007, 04:21 #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!
-
July 13th, 2007, 06:34 #9
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>
Cheers
Stuart
(Foen)
-
July 13th, 2007, 07:54 #10
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>
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>
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>
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