Mercurial > hg > svcore
comparison base/PropertyContainer.h @ 199:1d789d688f59
* When adding a layer, make it the selected layer on that pane
* More OSC support, including transforms
author | Chris Cannam |
---|---|
date | Fri, 10 Nov 2006 17:45:26 +0000 |
parents | 60ba218a54bb |
children | 91fdc752e540 |
comparison
equal
deleted
inserted
replaced
198:4c5c62784211 | 199:1d789d688f59 |
---|---|
115 * Set a property using a command, supporting undo and redo. | 115 * Set a property using a command, supporting undo and redo. |
116 * The default implementation should work for most subclasses. | 116 * The default implementation should work for most subclasses. |
117 */ | 117 */ |
118 virtual void setPropertyWithCommand(const PropertyName &, int value); | 118 virtual void setPropertyWithCommand(const PropertyName &, int value); |
119 | 119 |
120 /** | |
121 * Set a property using a fuzzy match. Compare nameString with | |
122 * the property labels and underlying names, and if it matches one | |
123 * (with preference given to labels), try to convert valueString | |
124 * appropriately and set it. The valueString should contain a | |
125 * value label for value properties, a mapped value for range | |
126 * properties, "on" or "off" for toggle properties, a colour or | |
127 * unit name, or the underlying integer value for the property. | |
128 * | |
129 * Note that as property and value labels may be translatable, the | |
130 * results of this function may vary by locale. It is intended | |
131 * for handling user-originated strings, _not_ persistent storage. | |
132 * | |
133 * The default implementation should work for most subclasses. | |
134 */ | |
135 virtual void setProperty(QString nameString, QString valueString); | |
136 | |
137 /** | |
138 * As above, but using a command. | |
139 */ | |
140 virtual void setPropertyWithCommand(QString nameString, QString valueString); | |
141 | |
120 protected: | 142 protected: |
121 | 143 |
122 class SetPropertyCommand : public Command | 144 class SetPropertyCommand : public Command |
123 { | 145 { |
124 public: | 146 public: |
133 PropertyContainer *m_pc; | 155 PropertyContainer *m_pc; |
134 PropertyName m_pn; | 156 PropertyName m_pn; |
135 int m_value; | 157 int m_value; |
136 int m_oldValue; | 158 int m_oldValue; |
137 }; | 159 }; |
160 | |
161 virtual bool convertPropertyStrings(QString nameString, QString valueString, | |
162 PropertyName &name, int &value); | |
138 }; | 163 }; |
139 | 164 |
140 #endif | 165 #endif |