mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Fixed TextCtrl to work for keyword properties;
Added wrapping of <> around parameters to TextElement; Added colors for keyword parameters; Added menu & toolbar for keyword panel; Fixed bug in package, save/save-as was the wrong way around; Added third quality setting to RotatedDC: using SetUserScale, this gets you more precise positioning. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@250 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+15
-2
@@ -86,6 +86,7 @@ IMPLEMENT_REFLECTION(TextStyle) {
|
||||
REFLECT(line_height_hard);
|
||||
REFLECT(line_height_line);
|
||||
REFLECT_N("mask", mask_filename);
|
||||
REFLECT(direction);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : TextValue
|
||||
@@ -108,15 +109,27 @@ IMPLEMENT_REFLECTION_NAMELESS(TextValue) {
|
||||
|
||||
// ----------------------------------------------------------------------------- : FakeTextValue
|
||||
|
||||
FakeTextValue::FakeTextValue(const TextFieldP& field, String* underlying, bool untagged)
|
||||
: TextValue(field), underlying(underlying)
|
||||
, untagged(untagged)
|
||||
{
|
||||
if (underlying) {
|
||||
value.assign(untagged ? escape(*underlying) : *underlying);
|
||||
}
|
||||
}
|
||||
|
||||
void FakeTextValue::onAction(Action& a, bool undone) {
|
||||
*underlying = value;
|
||||
if (underlying) {
|
||||
*underlying = untagged ? untag(value) : value;
|
||||
}
|
||||
}
|
||||
|
||||
bool FakeTextValue::equals(const Value* that) {
|
||||
if (this == that) return true;
|
||||
if (!underlying) return false;
|
||||
const FakeTextValue* thatT = dynamic_cast<const FakeTextValue*>(that);
|
||||
if (!thatT || underlying != thatT->underlying) return false;
|
||||
// update the value
|
||||
value = *underlying;
|
||||
value.assign(untagged ? escape(*underlying) : *underlying);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user