PDA

View Full Version : Prepopulating a stringcontrol



Azrael Nightstar
August 20th, 2006, 19:10
Hey all, have a feeling the answer to this is somewhere but alas I can't find it.

What I want to do is set up a stringcontrol on a character sheet that comes filled in with a default value, so that rather than being blank when the character is created it is set to a certain value (say "This is a string" for example). I know how to do this with a numbercontrol but just can't figure it out with a string. Anyone clue me in?

Oberoten
August 20th, 2006, 21:18
<stringcontrol>
<bounds rect="150,74,10,10" />
<static value="value here" />
</stringcontrol>


Should do it. :) Best of luck

Ged
August 21st, 2006, 18:22
What I want to do is set up a stringcontrol on a character sheet that comes filled in with a default value, so that rather than being blank when the character is created it is set to a certain value (say "This is a string" for example). I know how to do this with a numbercontrol but just can't figure it out with a string. Anyone clue me in?

Assuming that you want to be able to change the string ;), what you are asking is not possible. Prefilling a string as <static value="text here" /> makes it static, i.e. unmodifiable.

Oberoten
August 21st, 2006, 21:57
Well that or take the value from a pre-defined data-set?

unimatrixzero
August 21st, 2006, 23:00
couldn't you just set up an empty value line?

e.g.

<stringcontrol name="name">
<bounds rect="45,10,-15,20" />
<empty value="&laquo; New Item &raquo;" />
</stringcontrol>

Regards
Uni

Azrael Nightstar
August 22nd, 2006, 03:20
That's perfect Unimatrix, thanks :) Take that Ged!:D

Oberoten
August 22nd, 2006, 07:20
This si the sign of GOOD software, not even the developers knows what it's true limits are anymore.

Shrp77
August 22nd, 2006, 11:59
It's also a sign that there's a lack of internal documentation...
:rolleyes:

JMOxx75
April 3rd, 2007, 23:16
This will sound silly but I can't figure out exactly what the stringcontrol does. For example this is the class that makes the list on the right side of the reference window.


<windowclass name="classsmall">
<datasource name="class" />
<defaultsize width="250" height="27" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="0,0,24,24" />
<class name="class" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="30,2,150,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>

This creates a list of buttons that open other windows. Is the word next to the button the string control and the button from the windowopencontrol? Also what does the underlineoffset do, place the line 2 pixels below the word?

If the stringcontrol is the control that makes the list then how do the windowopencontrol and the stringcontrol line up since they both are in a list?

DrDeth
April 4th, 2007, 17:42
The classsmall windowclass represents ONE line.

The <windowlist class="classsmall"> in the 'referenceroot' windowclass is the tag that turns it into a list.