MadBeardMan
March 31st, 2018, 00:04
Greetings All,
Been busy working on the Traveller ruleset, now doing all the 'loose' ends kind of things.
One thing I'd like to be able to do is to 'lock' rulebook skills from being edited, ie turn that padlock red.
Can't seem to figure it out.
I've posted an example image on my Twitter feed (https://twitter.com/MadBeardMan/status/979855210918174720), very basically this is the code that sets up the 'skill' form.
<!-- Skill description sheet -->
<windowclass name="reference_skill">
<frame>recordsheet</frame>
<placement>
<size width="400" height="350" />
</placement>
<sizelimits>
<minimum width="300" height="300" />
<dynamic />
</sizelimits>
<minimize>minimized_reference</minimize>
<tooltip field="name" />
<nodelete />
<script>
function onLockChanged()
if content.subwindow then
content.subwindow.update();
end
end
</script>
<sheetdata>
<anchor_record_header_right name="rightanchor" />
<sub_record_header name="header">
<class>ref_skill_header</class>
</sub_record_header>
<frame_ref_content />
<sub_ref_content name="content">
<class>ref_skill_stats</class>
</sub_ref_content>
<scrollbar_ref_content />
<icon_record_locked>
<anchored>
<right offset="-28" />
<top offset="25" />
</anchored>
</icon_record_locked>
<button_record_locked>
<anchored>
<right offset="-28" />
<top offset="25" />
</anchored>
</button_record_locked>
<resize_recordsheet />
<close_recordsheet />
</sheetdata>
</windowclass>
I have a flag on the XML that tells me it's a 'rulebook skill', but I want to use code to change the padlock to readonly status.
Can anyone help?
Cheers
MBM
Been busy working on the Traveller ruleset, now doing all the 'loose' ends kind of things.
One thing I'd like to be able to do is to 'lock' rulebook skills from being edited, ie turn that padlock red.
Can't seem to figure it out.
I've posted an example image on my Twitter feed (https://twitter.com/MadBeardMan/status/979855210918174720), very basically this is the code that sets up the 'skill' form.
<!-- Skill description sheet -->
<windowclass name="reference_skill">
<frame>recordsheet</frame>
<placement>
<size width="400" height="350" />
</placement>
<sizelimits>
<minimum width="300" height="300" />
<dynamic />
</sizelimits>
<minimize>minimized_reference</minimize>
<tooltip field="name" />
<nodelete />
<script>
function onLockChanged()
if content.subwindow then
content.subwindow.update();
end
end
</script>
<sheetdata>
<anchor_record_header_right name="rightanchor" />
<sub_record_header name="header">
<class>ref_skill_header</class>
</sub_record_header>
<frame_ref_content />
<sub_ref_content name="content">
<class>ref_skill_stats</class>
</sub_ref_content>
<scrollbar_ref_content />
<icon_record_locked>
<anchored>
<right offset="-28" />
<top offset="25" />
</anchored>
</icon_record_locked>
<button_record_locked>
<anchored>
<right offset="-28" />
<top offset="25" />
</anchored>
</button_record_locked>
<resize_recordsheet />
<close_recordsheet />
</sheetdata>
</windowclass>
I have a flag on the XML that tells me it's a 'rulebook skill', but I want to use code to change the padlock to readonly status.
Can anyone help?
Cheers
MBM