Browse Source

Enhanced Attribute Inspector to display 'strike-out' visual cue in DropDownList editor having different values in multi-edit case.

Wei Tjong Yao 12 years ago
parent
commit
fd8b475a3e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Bin/Data/Scripts/Editor/AttributeEditor.as

+ 5 - 0
Bin/Data/Scripts/Editor/AttributeEditor.as

@@ -48,6 +48,7 @@ UIElement@ SetValue(CheckBox@ element, bool value, bool sameValue)
 UIElement@ SetValue(DropDownList@ element, int value, bool sameValue)
 UIElement@ SetValue(DropDownList@ element, int value, bool sameValue)
 {
 {
     element.selection = sameValue ? value : M_MAX_UNSIGNED;
     element.selection = sameValue ? value : M_MAX_UNSIGNED;
+    element.placeholder.children[0].visible = !sameValue;
     return element;
     return element;
 }
 }
 
 
@@ -194,6 +195,10 @@ UIElement@ CreateIntAttributeEditor(ListView@ list, Array<Serializable@>@ serial
         attrEdit.style = uiStyle;
         attrEdit.style = uiStyle;
         attrEdit.SetFixedHeight(ATTR_HEIGHT - 2);
         attrEdit.SetFixedHeight(ATTR_HEIGHT - 2);
         attrEdit.resizePopup = true;
         attrEdit.resizePopup = true;
+        Text@ placeHolderText = Text();
+        attrEdit.placeholder.AddChild(placeHolderText);
+        placeHolderText.style = uiStyle;
+        placeHolderText.text = STRIKED_OUT;
         attrEdit.vars["Index"] = index;
         attrEdit.vars["Index"] = index;
         attrEdit.vars["SubIndex"] = subIndex;
         attrEdit.vars["SubIndex"] = subIndex;
         attrEdit.SetLayout(LM_HORIZONTAL, 0, IntRect(4, 1, 4, 1));
         attrEdit.SetLayout(LM_HORIZONTAL, 0, IntRect(4, 1, 4, 1));