public AdvPropGrid_ObjectPropertiesHelper(AdvPropertyGrid advPropGrid, ObjectComboList objComboList, BehaviorInfoList behaviors, string behaviorPropName, string bParamPropName)
        {
            CbEditorBParam1       = null;
            CbEditorBParam2       = null;
            CbEditorBParam3       = null;
            CbEditorBParam4       = null;
            CbEditorBehavAddr     = null;
            AdvPropertyGrid1      = advPropGrid;
            myObjectCombos        = objComboList;
            myBehaviors           = behaviors;
            this.behaviorPropName = behaviorPropName;
            this.bParamPropName   = bParamPropName;
            General.LoadBehaviorInfosIfEmpty();
            General.LoadObjectCombosIfEmpty();
            LoadComboBoxObjComboEntries(objComboList);

            // Add B. Param Editors to Property Grid
            var bpeditor = new ContentSelectorEditor();

            bpeditor.EditorCreated  += ContentSelectorEditor_EditorCreated;
            bpeditor.EditorCreating += ContentSelectorEditor_EditorCreating;
            var bp1PropSet = new PropertySettings(bParamPropName + Conversions.ToString(1));
            var bp2PropSet = new PropertySettings(bParamPropName + Conversions.ToString(2));
            var bp3PropSet = new PropertySettings(bParamPropName + Conversions.ToString(3));
            var bp4PropSet = new PropertySettings(bParamPropName + Conversions.ToString(4));

            bp1PropSet.ValueEditor = bpeditor;
            bp2PropSet.ValueEditor = bpeditor;
            bp3PropSet.ValueEditor = bpeditor;
            bp4PropSet.ValueEditor = bpeditor;
            AdvPropertyGrid1.PropertySettings.Add(bp1PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp2PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp3PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp4PropSet);

            // Add Behavior Address Editor to Property Grid
            var behavaddreditor = new ContentSelectorEditor();

            behavaddreditor.EditorCreating += ContentSelectorEditor_EditorCreating;
            behavaddreditor.EditorCreated  += ContentSelectorEditor_EditorCreated;
            var behavaddrPropSet = new PropertySettings(behaviorPropName);

            behavaddrPropSet.ValueEditor = behavaddreditor;
            AdvPropertyGrid1.PropertySettings.Add(behavaddrPropSet);

            // Add Position/Rotation Editors (NumberInputEditor for Increment/Decrement)
            foreach (string l in new[] { "X", "Y", "Z" })
            {
                foreach (string e in new[] { "Position", "Rotation" })
                {
                    var xyzeditor = new PropertyIntegerEditorX()
                    {
                        ShowUpDownButton = true, MinValue = short.MinValue, MaxValue = short.MaxValue
                    };
                    var xyzPropSet = new PropertySettings(e + l);
                    xyzPropSet.ValueEditor = xyzeditor;
                    AdvPropertyGrid1.PropertySettings.Add(xyzPropSet);
                }
            }
        }
Example #2
0
 public InformationListDialog(EditModes editMode, ObjectComboList avaiableCombos, BehaviorInfoList avaiableBehaviors)
 {
     this.avaiableCombos    = avaiableCombos;
     this.avaiableBehaviors = avaiableBehaviors;
     InitializeComponent();
     SetUpPropertyGrid();
     this.editMode = editMode;
     General.LoadObjectCombosIfEmpty();
     General.LoadBehaviorInfosIfEmpty();
     SetUI();
     TextBoxX_Search.Select();
     base.UpdateAmbientColors();
 }