[rkward-cvs] SF.net SVN: rkward: [1024] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Jan 1 20:15:35 UTC 2007
Revision: 1024
http://svn.sourceforge.net/rkward/?rev=1024&view=rev
Author: tfry
Date: 2007-01-01 12:15:34 -0800 (Mon, 01 Jan 2007)
Log Message:
-----------
Dimensionality and length checking for varslots
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/doc/en/writing_plugins_introduction.docbook
trunk/rkward/rkward/plugin/rkcomponentproperties.h
trunk/rkward/rkward/plugin/rkvarslot.cpp
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2007-01-01 19:55:06 UTC (rev 1023)
+++ trunk/rkward/ChangeLog 2007-01-01 20:15:34 UTC (rev 1024)
@@ -1,3 +1,4 @@
+- allow varslots to request objects of specified dimensionality and length
- fixed: integer spinboxes with starting values greater than 1 would get unreasonable change steps
- fix compilation with some versions of KDE / GCC
- small improvements to syntax highlighting definition
Modified: trunk/rkward/doc/en/writing_plugins_introduction.docbook
===================================================================
--- trunk/rkward/doc/en/writing_plugins_introduction.docbook 2007-01-01 19:55:06 UTC (rev 1023)
+++ trunk/rkward/doc/en/writing_plugins_introduction.docbook 2007-01-01 20:15:34 UTC (rev 1024)
@@ -915,6 +915,18 @@
<term><types></term>
<listitem>If you specify one or more variables types (separated by spaced (" ")), here, the varslot will only accept objects of those types. Valid types are "unknown", "number", "string", "factor", "invalid". (Optional, <emphasis>use with great care</emphasis>, the user should not be prevented from making valid choices, and rkward does not always know the type of a variable)</listitem>
</varlistentry>
+ <varlistentry>
+ <term><num_dimensions></term>
+ <listitem>The number of dimensions, an object needs to have. "0" (the default) means, any number of dimensions is acceptable. (optional, defaults to "0")</listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><min_length></term>
+ <listitem>The minimum length, an object needs to have in order to be acceptable. (optional, defaults to "0")</listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><max_length></term>
+ <listitem>The maximum length, an object needs to have in order to be acceptable. (optional, defaults to the largest integer number representable on the system)</listitem>
+ </varlistentry>
</variablelist></listitem>
</varlistentry>
<varlistentry>
Modified: trunk/rkward/rkward/plugin/rkcomponentproperties.h
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponentproperties.h 2007-01-01 19:55:06 UTC (rev 1023)
+++ trunk/rkward/rkward/plugin/rkcomponentproperties.h 2007-01-01 20:15:34 UTC (rev 1024)
@@ -232,8 +232,8 @@
void setTypeFilter (const QStringList &types);
/** Set property to only accept objects of certain dimensions. If you provide default parameters (0), all objects will be accepted
@param dimensionality Number of dimensions the object must have. 0 will accept objects of all dimensions
- at param min_length Minimum length of first dimension. 0 will accept objects of all lenghts
- at param max_length Maximum length of first dimension. 0 will accept objects of all lengths */
+ at param min_length Minimum length of first dimension. 0 will accept objects of all lengths
+ at param max_length Maximum length of first dimension. 0 (or INT_MAX) will accept objects of all lengths */
void setDimensionFilter (int dimensionality=0, int min_length=0, int max_length=0);
/** Directly set an RObject. Warning: This sets the list to contain only exactly this one item. Generally you do not want to use this, unless your list is in single mode. Use addObjectValue () instead, if the property can hold more than one object
@returns false if the object does not qualify as a valid selection according to current settings (class/type/dimensions), true otherwise */
Modified: trunk/rkward/rkward/plugin/rkvarslot.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkvarslot.cpp 2007-01-01 19:55:06 UTC (rev 1023)
+++ trunk/rkward/rkward/plugin/rkvarslot.cpp 2007-01-01 20:15:34 UTC (rev 1024)
@@ -84,6 +84,7 @@
available->setClassFilter (QStringList::split (" ", xml->getStringAttribute (element, "classes", QString::null, DL_INFO)));
setRequired (xml->getBoolAttribute (element, "required", false, DL_INFO));
available->setTypeFilter (QStringList::split (" ", xml->getStringAttribute (element, "types", QString::null, DL_INFO)));
+ available->setDimensionFilter (xml->getIntAttribute (element, "num_dimensions", 0, DL_INFO), xml->getIntAttribute (element, "min_length", 0, DL_INFO), xml->getIntAttribute (element, "max_length", INT_MAX, DL_INFO));
connect (available, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (availablePropertyChanged (RKComponentPropertyBase *)));
availablePropertyChanged (available); // initialize
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