Melchior: Make line wrapping in textboxes configurable, and enable it by default
This commit is contained in:
parent
3b5512f573
commit
cc3eacb88e
2 changed files with 15 additions and 5 deletions
|
@ -117,10 +117,10 @@ properties, though they will ignore any that are not relevant:
|
|||
the width of the parent container.
|
||||
|
||||
color - a subgroup to specify the dialogs color:
|
||||
red - specify the red color compnent of the color scheme.
|
||||
green - specify the green color compnent of the color scheme.
|
||||
blue - specify the blue color compnent of the color scheme.
|
||||
alpha - specify the alpha color compnent of the color scheme.
|
||||
red - specify the red color component of the color scheme.
|
||||
green - specify the green color component of the color scheme.
|
||||
blue - specify the blue color component of the color scheme.
|
||||
alpha - specify the alpha color component of the color scheme.
|
||||
|
||||
legend - the text legend to display in the object.
|
||||
|
||||
|
@ -231,6 +231,14 @@ Example:
|
|||
<label>Heading</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<x>10</x>
|
||||
<y>200</y>
|
||||
<label>-9.9999</label> <!-- placeholder for width -->
|
||||
<format>%-0.4f m</format>
|
||||
<property>/foo/altitude</property>
|
||||
</text>
|
||||
|
||||
|
||||
checkbox
|
||||
--------
|
||||
|
@ -382,6 +390,7 @@ property tree, like:
|
|||
<property>/gui/path-to-text-node/contents</property>
|
||||
|
||||
<slider>15</slider> <!--width for slider -->
|
||||
<wrap>false</wrap> <!-- don't wrap text; default: true -->
|
||||
|
||||
<editable>true</editable> <!-- whether the puLargeInput is supposed to be editable -->
|
||||
</textbox>
|
||||
|
|
|
@ -496,9 +496,10 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
|
|||
return dial;
|
||||
} else if (type == "textbox") {
|
||||
int slider_width = props->getIntValue("slider", parentHeight);
|
||||
int wrap = props->getBoolValue("wrap", true)==true;
|
||||
if (slider_width==0) slider_width=20;
|
||||
puLargeInput * puTextBox =
|
||||
new puLargeInput(x, y, x+width, x+height, 2, slider_width);
|
||||
new puLargeInput(x, y, x+width, x+height, 2, slider_width, wrap);
|
||||
if (props->hasValue("editable"))
|
||||
{
|
||||
if (props->getBoolValue("editable")==false)
|
||||
|
|
Loading…
Reference in a new issue