View Full Version : ?? on row shading and highlighting
Christopher Matherne
June 18th, 2009, 03:17
how do I get an entire row in which text is listed to be shaded or highlighted:confused:
Christopher Matherne
June 18th, 2009, 15:39
I know this is only asthetics but please someone teach me this
joshuha
June 18th, 2009, 15:48
I think essentially you have to to script a special windowclass and have the list element have a special script for each control that detects if its an odd or even row and then manually shade the control.
Christopher Matherne
June 18th, 2009, 16:06
I think essentially you have to to script a special windowclass and have the list element have a special script for each control that detects if its an odd or even row and then manually shade the control.
cool I have seen an example of this windowclass scripting, i think i can manage that part, but do not know the command or font to use to tell it to use a specific color for a row, nor how to tell it to highlight a row and not just the text. I made a table in html and tried it that way but the color did not show up, the ruleset over rode the color inputs for the rows. I guess this tells me that I would neeed to assign the colors i want into the ruleset, but do not know how to do that either. If i knew where to look inside a ruleset, 4E_JPG, for example; to find an example of this I could get it done.
Lithl
June 18th, 2009, 17:35
You could try putting a frame behind the row (a grenericcontrol), then you could give the row a texture as well as color, if you wished.
Christopher Matherne
June 18th, 2009, 18:55
You could try putting a frame behind the row (a grenericcontrol), then you could give the row a texture as well as color, if you wished.
I saw an example as <frame>rowshade</frame> in the 4E_jpg rule set; but when I put it after table start or after tr start in the below example; it added the word rowshade to the line, instaed of shading the row. should it be before text open or before text closed maybe?
-<text type="formattedtext">
-<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
-<tr>
-<td align="center"></td>
-<td align="center" colspan="3">DC Value</td>
-<td align="center" colspan="3">Normal Damage Expressions</td>
-<td align="center" colspan="3">Limited Damage Expressions</td>
-</tr>
Christopher Matherne
June 18th, 2009, 19:00
<----NOOB tries to use the <Frame>shaderow</Frame> failed:mad:
Christopher Matherne
June 18th, 2009, 19:07
-<td align="center" colspan="3" bgcolor="#D9B7A6">DC Value</td>
FG does not allow this format it seems, well, the bgcolor part. And, if the <frame> does not work?
could you plz give me an example of of what would?
my preference would be to get the rowshade to work..
Christopher Matherne
June 18th, 2009, 19:19
Holy Sh..
looks like the way it can be done is to create a windowclass using the rowshade.png, lol, but then i would need to create each row of a table in a seperate window class grr. There must be and easier way:o
Tenian
June 18th, 2009, 19:40
In very simplistic terms:
In order to display something in FGII you need to build a windowclass. Windowclasses are defined within the ruleset. In 4E_JPG the windowclasses are broken into different files by function/subfunction.
For example there are various files in the rulesets\4E_JPG folder which are titled:
reference_npc.xml, reference_powers.xml, etc. These all contain the windows that layout the "stat blocks" for 4E powers/monsters/etc. The charsheet_*.xml files all relate to the character sheet and so on.
Within each xml file you'll find one or more <windowclass>...</windowclass> blocks of code. These define the elements of a window. Each window can contain a number of controls, some visible, some not visible.
The visible section of each control is defined in the <sheetdata>...</sheetdata> block. Under sheetdata there are various controls (numberfields, stringfields, windowrefences, genericcontrols, etc)
The individual controls on a sheet may support a <frame>...</frame> element. This allows you to specify a grapic frame that is rendered behind the control. The boxes you see around the numbers on a character sheet are an example of a frame.
So:
rulesets
4E_JPG
XML File
windowclass
sheetdata
control
frame
Modules contain data. Raw data. They don't include any sort of frames, shading, scripting, etc.
The <table><tr><td>.....</td></tr></table> is an example of data. It would go in a module and not in a ruleset. You can not add shading directly into a table like that.
Instead you would have to store the data in the module in a structure something like this:
<feat>
<feat01>
<name type="string">blahblah</name>
<description type="string">Something useless</description>
<dice type="string">6d6</dice>
</feat01>
<feat02>
<name type="string">gsdgsg</name>
<description type="string">even more useless</description>
<dice type="string">10d12</dice>
</feat02>
</feat>
Your ruleset would then need to contain 2 windowclasses:
The first is for the row the second is for the whole table.
<windowclass name="stupidrow">
<sheetdata>
<stringfield name="name">
<anchored>
<top>
<to>top</top>
</top>
<left>
<to>left</top>
</left>
<right>
<to>left</top>
<offset>50</offset>
</right>
<bottom>
<to>bottom</top>
</bottom>
</anchored>
</stringfield>
<stringfield name="description">
<anchored>
<top>
<to>top</top>
</top>
<left>
<parent>name</parent>
<to>right</top>
<offset>10</offset>
</left>
<right>
<parent>name</parent>
<to>right</top>
<offset>60</offset>
</right>
<bottom>
<to>bottom</top>
</bottom>
</anchored>
</stringfield>
<stringfield name="dice">
<anchored>
<top>
<to>top</top>
</top>
<left>
<parent>description</parent>
<to>right</top>
<offset>10</offset>
</left>
<right>
<parent>description</parent>
<to>right</top>
<offset>60</offset>
</right>
<bottom>
<to>bottom</top>
</bottom>
</anchored>
</stringfield>
</sheetdata>
</windowclass>
<windowclass name="stupidtable">
<sheetdata>
<windowlist name="feats">
<class>stupidrow</class>
<anchored>
<top>
<to>top</top>
</top>
<left>
<to>left</top>
</left>
<right>
<to>right</top>
</right>
<bottom>
<to>bottom</top>
</bottom>
</anchored>
</windowlist>
</sheetdata>
</windowclass>
And that isn't a particularly well built control. It's just an example of what you should be looking for.
Christopher Matherne
June 18th, 2009, 20:14
Then I would create:
-<windowclass name="stupidrow">
-<sheetdata>
-<windowcontrol>
-<frame>shaderow</frame>
-<stringfield name="name">
-<anchored>
-<top>
-<to>top</top>
-</top>
-<left>
-<to>left</top>
-</left>
-<right>
-<to>left</top>
-<offset>50</offset>
-</right>
-<bottom>
-<to>bottom</top>
-</bottom>
-</anchored>
-</stringfield>
-</windowcontrol>
for each row i wanted shaded?
and ty very much:D
Tenian
June 18th, 2009, 22:30
Actually if you are trying to do alternating row shading you'll probably want to use the onListRearranged event.
You should check out https://www.fantasygrounds.com/refdoc/windowlist.xcp
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.