PDA

View Full Version : Windowclass - Reference Header Question



Zhern
December 23rd, 2016, 22:00
Okay, I feel a bit silly having to ask this, but for some reason I'm not able to find the exact control that determines the width of a column in a reference header. For example, in the Swords & Wizardry weapon list, one of the columns has a label for "Rate of Fire," but I can't seem to find the right spot to either make the width of the column dynamic, increase the width of the column, or increase the height of the header to allow the text to wrap, so I'm left with "Rate of." At first I was thinking, okay, I'll come back to this later, but it is bugging the crap out of me and I'm hoping someone can point me to the spot that I'm missing. I'm sure it is right before me, ready to bite me, but for the life of me I'm not able to see it.

Also, I'm having another brain fart and it isn't making sense to me why I'm getting an error about anchoring to an uncalculated control in this particular windowclass. I'm sure it is something silly that I'm doing and just not seeing it. Any insight is welcomed. I promise I'm not dense - this is one of those cases of when you stare at something too long it is usually right before your eyes and very, very obvious. Like when you keep searching for that missing semi-colon or brace or unclosed tag...

ref_equipment.xml



<windowclass name="ref_weapon_header">
<margins control="0,0,0,7" />
<sheetdata>
<link_record_header>
<class>referenceweapon</class>
</link_record_header>
<string_record_name name="name">
<anchored>
<top offset="25"/>
<left offset="40" />
<right offset="-25" />
</anchored>
<dynamic />
</string_record_name>
</sheetdata>
</windowclass>


<windowclass name="ref_weapon_stats">
<script>
function onInit()
type_label.setValue("[" .. type.getValue() .. "; " .. subtype.getValue() .. "]");
end
</script>
<sheetdata>
<anchor_column name="columnanchor" />

<hs name="type" />
<hs name="subtype" />

<label_column name="type_label">
<anchored>
<top relation="relative" offset="50" />
</anchored>
<font>reference-b-large</font>
</label_column>

<line_column />

<label_column>
<static textres="ref_label_damage" />
</label_column>
<string_column name="damage">
<readonly />
</string_column>

<label_column>
<static textres="ref_label_ratefire" />
</label_column>
<string_column name="ratefire">
<readonly />
</string_column>

<line_column />

<label_column name="range_label">
<static textres="ref_label_range" />
</label_column>
<number_column name="range">
<readonly />
</number_column>

<label_column_right>
<anchored to="cost" />
<static textres="ref_label_weight" />
</label_column_right>
<number_column_right name="weight">
<anchored to="cost" />
<readonly />
</number_column_right>

<label_column name="cost_label">
<static textres="ref_label_cost" />
</label_column>
<string_column_left name="cost">
<readonly />
</string_column_left>

<line_column name="line_desc"/>

<ft_columnh name="description">
<separator>line_desc</separator>
<readonly />
</ft_columnh>
</sheetdata>
</windowclass>

damned
December 23rd, 2016, 22:06
You will need to post screenshot and error message too...

Zhern
December 23rd, 2016, 22:16
You will need to post screenshot and error message too...

Oh, duh, right.

Screenshot for the header width question:

17029


Okay, so one other small clarification - the error occurs when I open the information/description window for any of the weapon (or armor entries).
Screenshot for Error:
Ruleset Error: window: Control () anchoring to uncalculated control (cost) in windowclass (ref_weapon_stats)
Ruleset Error: window: Control (weight) anchoring to uncalculated control (cost) in windowclass (ref_weapon_stats)

17030

vodokar
December 23rd, 2016, 22:34
No clue on your first question, but regarding the anchoriing to an uncalculated control, you are trying to anchor to something which you haven't yet defined yet i.e. anchor to "cost" and then define "cost". Put <string_column_left name="cost">
<readonly />
</string_column_left> before your statements trying to anchor to it and the error should go away.

Zhern
December 23rd, 2016, 22:51
Ah, that makes sense. Thank you!

damned
December 23rd, 2016, 22:53
Cant you just set a width statement? Look up the label_column in templates for the syntax to use.

vodokar
December 23rd, 2016, 23:02
Would it not be something like this:

<label>
<anchored to="grapple" position="lefthigh" offset="5,0" width="65" />
<static textres="grapple" />
</label>

damned
December 23rd, 2016, 23:06
I would initially try:

<label_column>
<static textres="ref_label_ratefire" />
<width="80" />
</label_column>

leozelig
December 24th, 2016, 02:34
label_column is defined in CoreRPG in the common/template_common.xml file on line 309. If you want a different width, I think you can just re-define it in that specific control - changing the template would change it for everything, which you probably already know.


<template name="label_column">
<label>
<anchored>
<top parent="columnanchor" anchor="bottom" relation="current" offset="7" />
<left />
</anchored>
</label>
</template>

I don't know if you can get text to wrap automatically, but you can use \n to insert a line break in the string definition for ref_label_ratefire.


<string name="ref_label_rateoffire">Rate of\nFire</string>

I think you need to flip-flop the code for cost and weight. Currently, weight is anchored to a control that hasn't been defined yet.


<label_column name="cost_label">
<static textres="ref_label_cost" />
</label_column>
<string_column_left name="cost">
<readonly />
</string_column_left>

<label_column_right>
<anchored to="cost" />
<static textres="ref_label_weight" />
</label_column_right>
<number_column_right name="weight">
<anchored to="cost" />
<readonly />
</number_column_right>

Zhern
December 24th, 2016, 02:43
Thanks for the help, vodokar, damned, and leozelig. I ended up figuring it out. As I figured, it was me being a putz and trying to focus on it to much.

So to modify the width of the column headers so that text didn't clip, I had to change the anchored width (in red) in ref_equipmentlist.xml. It didn't click to me until shortly after you all provided suggestions that ref_equipment.xml controls the link/description for the list entry. Once that clicked, I felt dumb, and then I figured out where I needed to change the width. Again, thanks for the help - you all eased my brain cramp.


<windowclass name="reference_weapontablelist">
<frame>referencelist</frame>
<placement>
<size width="750" height="650" />
</placement>
<sizelimits>
<minimum width="750" height="650" />
<dynamic />
</sizelimits>
<minimize>minimized_reference</minimize>
<tooltip field="description" />
<nodelete />
<sheetdata>
<windowtitlebar name="reftitle">
<field>description</field>
</windowtitlebar>
<anchor_reftitle name="contentanchor" />

<header_reftablegroup />
<label_reftable name="headername">
<anchored width="120" />
<static textres="ref_label_listname" />
</label_reftable>

<label_reftable name="headerdamage">
<static textres="ref_label_listdamage" />
<center />
</label_reftable>
<label_reftable name="headerratefire">
<anchored width="65" />
<static textres="ref_label_listratefire" />
<center />
</label_reftable>
<label_reftable name="headerrange">
<static textres="ref_label_listrange" />
<center />
</label_reftable>
<label_reftable name="headerweight">
<static textres="ref_label_listweight" />
<center />
</label_reftable>
<label_reftable name="headercost">
<static textres="ref_label_listcost" />
<center />
</label_reftable>
<!-- <label_reftable name="headerprops">
<static textres="ref_label_listproperties" />
</label_reftable>
<label_reftable name="headerdmgtype">
<anchored width="150" />
<static textres="ref_label_listtype" />
</label_reftable> -->

<list_reftablegroup name="grouplist">
<class>reference_weapontablegroup</class>
<datasource>.groups</datasource>
</list_reftablegroup>
<scrollbar_reftablegroup />

<filter_reftable name="filter" />
<button_reftable_expand />
<button_reftable_collapse />

<resize_referencelist />
<close_referencelist />
</sheetdata>
</windowclass>

leozelig
December 24th, 2016, 02:50
I was looking at the wrong code for your column question, but looks like you got it :)