[rkward-cvs] SF.net SVN: rkward:[4470] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu Nov 29 11:20:01 UTC 2012
Revision: 4470
http://rkward.svn.sourceforge.net/rkward/?rev=4470&view=rev
Author: tfry
Date: 2012-11-29 11:20:00 +0000 (Thu, 29 Nov 2012)
Log Message:
-----------
Rename <option> in optionssets to <optioncolumn> to avoid ambiguities
Modified Paths:
--------------
trunk/rkward/doc/rkwardplugins/index.docbook
trunk/rkward/rkward/plugin/rkoptionset.cpp
trunk/rkward/rkward/plugins/testing/optionset.xml
Modified: trunk/rkward/doc/rkwardplugins/index.docbook
===================================================================
--- trunk/rkward/doc/rkwardplugins/index.docbook 2012-11-29 11:00:48 UTC (rev 4469)
+++ trunk/rkward/doc/rkwardplugins/index.docbook 2012-11-29 11:20:00 UTC (rev 4470)
@@ -1502,16 +1502,16 @@
<input id="firstname" label="Given name(s)" size="small">
<input id="lastname" label="Family name" size="small">
<radio id="gender" label="Gender">
- <option label="Male" value="m"/>
- <option label="Female" value="f"/>
+ <optioncolumn label="Male" value="m"/>
+ <optioncolumn label="Female" value="f"/>
</radio>
</row>
</frame>
</content>
- <option id="firstnames" label="Given name(s)" connect="firstname.text">
- <option id="lastnames" label="Family name" connect="lastname.text">
- <option id="gender" connect="gender.string">
+ <optioncolumn id="firstnames" label="Given name(s)" connect="firstname.text">
+ <optioncolumn id="lastnames" label="Family name" connect="lastname.text">
+ <optioncolumn id="gender" connect="gender.string">
</optionset>
[...]
</dialog>
@@ -1523,14 +1523,14 @@
</para><para>
Next we specify the variables of interest that we will want to read from the option set in our JS file. As we will be dealing with
an arbitrary number of items, we cannot just read <function>getString ("firstname")</function> in JS. Rather, for each value of
- interest, we specify an <command><option></command>. For the first option in the example, <command><connect="firstname.text"></command> means that the content of the <command><input></command>
- element "firstname" is read for each item. <command><option></command>s for which a <parameter>label</parameter> is given,
+ interest, we specify an <command><optioncolumn></command>. For the first optioncolumn in the example, <command><connect="firstname.text"></command> means that the content of the <command><input></command>
+ element "firstname" is read for each item. <command><optioncolumn></command>s for which a <parameter>label</parameter> is given,
will be shown in the <command><optiondisplay></command>, in a column by that label. In JS, we can now fetch the first names for all authors using <function>getList("set.firstname")</function>, <function>getList("set.lastnames")</function> for the family
names, and <function>getList("set.gender")</function> for an array of "m"/"f" strings.
</para>
<para>
Note that there are no restrictions on what you can place inside an <command><optionset></command>. You can even use <link linkend="embedding">embedded</link> components. Just as with any other element, all you have to do is to collect the output
- variables of interest in an <command><option></command>-specification. In the case of embedded plugins, this is often a section of the "code" property. E.g.:
+ variables of interest in an <command><optioncolumn></command>-specification. In the case of embedded plugins, this is often a section of the "code" property. E.g.:
</para>
<programlisting>
<dialog [...]>
@@ -1542,7 +1542,7 @@
</content>
[...]
- <option id="color_params" connect="color.code.printout">
+ <optioncolumn id="color_params" connect="color.code.printout">
</optionset>
[...]
</dialog>
@@ -1591,18 +1591,18 @@
</content>
[...]
- <option id="vars" external="true">
- <option id="varnames" external="true" label="Variable">
- <option id="color_params" connect="color.code.printout">
+ <optioncolumn id="vars" external="true">
+ <optioncolumn id="varnames" external="true" label="Variable">
+ <optioncolumn id="color_params" connect="color.code.printout">
</optionset>
[...]
</dialog>
</programlisting>
<para>
- We'll start looking at the example at the bottom. You'll note that two <command><option></command> specifications have
- <parameter>external="true"</parameter>. This tells &rkward; that these are controlled from outside the <command><optionset></command>. Here, the sole purpose of the "varnames"-option is to provide easy-to-read labels in the
+ We'll start looking at the example at the bottom. You'll note that two <command><optioncolumn></command> specifications have
+ <parameter>external="true"</parameter>. This tells &rkward; that these are controlled from outside the <command><optionset></command>. Here, the sole purpose of the "varnames"-optioncolumn is to provide easy-to-read labels in the
<command><optiondisplay></command> (it is connected to the "shortname" modifier of the property holding the selected
- objects). The purpose of the "vars"-option is to serve as the "key" column, as specified by
+ objects). The purpose of the "vars"-optioncolumn is to serve as the "key" column, as specified by
<command><optionset keycolumn="vars"...></command>. This means that for each entry in this list, the set will offer
one set of options, and options are logically tied to these entries. This column is connected to the property holding the
selected objects in the <command><varslot></command>. I.e. for each object that is selected there, the <command><optionset></command> will allow to specify line color.
@@ -1610,9 +1610,9 @@
<note>
<para>
External column can also be <parameter>connect</parameter>ed to properties inside the
- <command><content></command> region. However, it is important to note that options declared
+ <command><content></command> region. However, it is important to note that optioncolumns declared
<parameter>external="true"</parameter> should never be modified from inside the <command><optionset></command>, and
- options declared <parameter>external="false"</parameter> (the default) should never be modified from outside the
+ optioncolumns declared <parameter>external="false"</parameter> (the default) should never be modified from outside the
<command><optionset></command>.
</para>
</note>
@@ -2687,18 +2687,18 @@
Child-elements:
<variablelist>
<varlistentry>
- <term><option></term>
- <listitem><para>Declares one option of the set. For each value that you want to fetch from the optionset, you must declare a separate <option>. Attributes:
+ <term><optioncolumn></term>
+ <listitem><para>Declares one optioncolumn of the set. For each value that you want to fetch from the optionset, you must declare a separate <optioncolumn>. Attributes:
<variablelist>
<varlistentry><term>id</term>
- <listitem><para>The id of the option (required, string).</para></listitem></varlistentry>
+ <listitem><para>The id of the optioncolumn (required, string).</para></listitem></varlistentry>
<varlistentry><term>external</term>
- <listitem><para>Set to true, if the option is controlled from outside the optionset (optional, boolean, defaults to false).</para></listitem></varlistentry>
+ <listitem><para>Set to true, if the optioncolumn is controlled from outside the optionset (optional, boolean, defaults to false).</para></listitem></varlistentry>
<varlistentry><term>label</term>
- <listitem><para>If given, the option will be displayed in the <optiondisplay> in a column by that label (optional, string, defaults to not displayed).</para></listitem></varlistentry>
+ <listitem><para>If given, the optioncolumn will be displayed in the <optiondisplay> in a column by that label (optional, string, defaults to not displayed).</para></listitem></varlistentry>
<varlistentry><term>connect</term>
- <listitem><para>The property to connect this option to, given as id inside the <content>-area. For external <option>s, the corresponding value will be set to the externally set value. For regular (non-external) <option>s,
- the corresponding row of the <option>-property, will be set when the property changes inside the content-area. (optional, string, defaults to not connected).</para></listitem></varlistentry>
+ <listitem><para>The property to connect this optioncolumn to, given as id inside the <content>-area. For external <optioncolumn>s, the corresponding value will be set to the externally set value. For regular (non-external) <optioncolumn>s,
+ the corresponding row of the <optioncolumn>-property, will be set when the property changes inside the content-area. (optional, string, defaults to not connected).</para></listitem></varlistentry>
<varlistentry><term>default</term>
<listitem><para>Only for external columns: The value to assume for this column, if no value is known for an entry. Rarely useful. (Optional, defaults to empty string)</para></listitem></varlistentry>
</variablelist>
@@ -2716,7 +2716,7 @@
</para></listitem></varlistentry>
<varlistentry><term><property></term>
<listitem><para>In the rare case that you want to connect two or more properties inside the contents region to an (external)
- <option>, you can create an auxiliary property using this element. Attributes:
+ <optioncolumn>, you can create an auxiliary property using this element. Attributes:
<variablelist>
<varlistentry><term><parameter>id</parameter></term>
<listitem><para>Id of the property (relative to "setid.contents") (required, string).</para></listitem></varlistentry>
@@ -3145,8 +3145,8 @@
<listitem><para>Currently active item in the optionset (integer). -1 for no active item. Read-write.</para></listitem>
</varlistentry>
<varlistentry>
- <term><emphasis>option_ids</emphasis></term>
- <listitem><para>For each <option> you define, a string list property will be created with the specified id.</para></listitem>
+ <term><emphasis>optioncolumn_ids</emphasis></term>
+ <listitem><para>For each <optioncolumn> you define, a string list property will be created with the specified id.</para></listitem>
</varlistentry>
</variablelist></para></listitem>
</varlistentry>
Modified: trunk/rkward/rkward/plugin/rkoptionset.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkoptionset.cpp 2012-11-29 11:00:48 UTC (rev 4469)
+++ trunk/rkward/rkward/plugin/rkoptionset.cpp 2012-11-29 11:20:00 UTC (rev 4470)
@@ -86,7 +86,7 @@
connect (standardComponent (), SIGNAL (standardInitializationComplete()), this, SLOT (fetchDefaults()));
// create columns
- XMLChildList options = xml->getChildElements (element, "option", DL_WARNING);
+ XMLChildList options = xml->getChildElements (element, "optioncolumn", DL_WARNING);
QStringList visible_column_labels ("#"); // Optionally hidden first row for index
for (int i = 0; i < options.size (); ++i) {
@@ -129,7 +129,7 @@
if (!keycol.isEmpty ()) {
keycolumn = static_cast<RKComponentPropertyStringList*> (child_map.value (keycol));
if (!column_map.contains (keycolumn)) {
- RK_DO (qDebug ("optionset does not contain a column named %s. Falling back to manual insertion mode", qPrintable (keycol)), PLUGIN, DL_ERROR);
+ RK_DO (qDebug ("optionset does not contain an optioncolumn named %s. Falling back to manual insertion mode", qPrintable (keycol)), PLUGIN, DL_ERROR);
keycolumn = 0;
} else if (!column_map[keycolumn].external) {
RK_DO (qDebug ("keycolumn (%s) is not marked as external. Falling back to manual insertion mode", qPrintable (keycol)), PLUGIN, DL_ERROR);
Modified: trunk/rkward/rkward/plugins/testing/optionset.xml
===================================================================
--- trunk/rkward/rkward/plugins/testing/optionset.xml 2012-11-29 11:00:48 UTC (rev 4469)
+++ trunk/rkward/rkward/plugins/testing/optionset.xml 2012-11-29 11:20:00 UTC (rev 4470)
@@ -33,9 +33,9 @@
</row>
</frame>
</content>
- <option id="object" connect="mx.available"/>
- <option id="objshort" label="Object" connect="mx.available.shortname"/>
- <option id="summary" label="Summary" connect="summary.text"/>
+ <optioncolumn id="object" connect="mx.available"/>
+ <optioncolumn id="objshort" label="Object" connect="mx.available.shortname"/>
+ <optioncolumn id="summary" label="Summary" connect="summary.text"/>
</optionset>
</tab>
<tab label="Connected driven set">
@@ -47,9 +47,9 @@
<input id="summary" label="Enter another summary" size="large"/>
</frame>
</content>
- <option id="object" external="true"/>
- <option id="objshort" label="Object" external="true"/>
- <option id="summary2" connect="summary.text"/>
+ <optioncolumn id="object" external="true"/>
+ <optioncolumn id="objshort" label="Object" external="true"/>
+ <optioncolumn id="summary2" connect="summary.text"/>
</optionset>
</tab>
<tab label="Driven set">
@@ -71,12 +71,12 @@
<embed id="test_embed" component="rkward::plot_options" as_button="true"/>
</frame>
</content>
- <option id="var" label="test" external="true" connect="test_embed.xvar"/>
- <option id="varname" label="Varname" external="true"/>
- <option id="ca" label="Comment A" connect="commenta.text"/>
- <option id="cb" connect="commentb.text"/>
- <option id="plotoption_printout" connect="test_embed.code.printout"/>
- <option id="plotoption_pre" connect="test_embed.code.preprocess"/>
+ <optioncolumn id="var" label="test" external="true" connect="test_embed.xvar"/>
+ <optioncolumn id="varname" label="Varname" external="true"/>
+ <optioncolumn id="ca" label="Comment A" connect="commenta.text"/>
+ <optioncolumn id="cb" connect="commentb.text"/>
+ <optioncolumn id="plotoption_printout" connect="test_embed.code.printout"/>
+ <optioncolumn id="plotoption_pre" connect="test_embed.code.preprocess"/>
</optionset>
</row>
</tab>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list