kill stupid tab bug
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / ChoiceEditor.mxml
index df8ecbd9e9a63ba8f9790fe29986f0789c8b365b..deb1dedb8258947f7636cf4769b67819d3203e06 100644 (file)
@@ -2,17 +2,16 @@
 <edit:SingleTagEditor
        xmlns:mx="http://www.adobe.com/2006/mxml" 
        xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
-       verticalGap="0"
-       width="100%"
-       toolTip="{fieldDescription}">
+       toolTip="{fieldDescription}"
+    direction="{fieldDirection}" styleName="titledEditor">
 
   <mx:Label text="{fieldName}:"/>
   <edit:ChoiceComboBox id="inputBox" dataProvider="{choices}" selectedItem="{selectFromTag}"
-      width="100%" change="value = inputBox.selectedItem.value"
+      change="value = inputBox.selectedItem.value"
       open="inputBox.dropdown.variableRowHeight = true">
       <edit:itemRenderer>
         <mx:Component>
-        <mx:HBox toolTip="{data.description}">
+        <mx:HBox toolTip="{data.description}" horizontalScrollPolicy="off">
           <mx:Image source="{data.icon}"/>
           <mx:Label htmlText="{data.label}"/>
         </mx:HBox>
       private var _unknownChoice:Choice = null;
 
       [Bindable(event="factory_set")]
-      private function get choices():ArrayCollection {
+      protected function get choices():ArrayCollection {
           if ( _choices == null ) {
-              _choices = new ArrayCollection(ChoiceEditorFactory(_factory).choices);
+              _choices = new ArrayCollection();
+              for each ( var choice:Choice in ChoiceEditorFactory(_factory).choices )
+                  _choices.addItem(choice);
               _choices.addItem(createUnsetChoice());
           }
           return _choices;
       }
       
       [Bindable(event="tag_changed")]
-      private function get selectFromTag():Object {
+      protected function get selectFromTag():Object {
           var tagValue:String = value;
           for each(var choice:Choice in choices) {
               if ( choice.isTagMatch(tagValue) )
@@ -62,7 +63,7 @@
           var choice:Choice = new Choice();
           choice.icon = null;
           choice.description = "Field not set";
-          choice.label = "<i>Unset</i>";
+          choice.label = "<font color='#a0a0a0'><i>Unset</i></font>";
           choice.value = null;
           return choice;
       }