public static void DrawEnabledButton <T>(ICEDataObject _object, EditorHeaderType _type, List <T> _list) where T : new() { if (_object == null || _list == null) { return; } if (IsEnabledType(_type)) { bool _enabled = ICEEditorLayout.EnableButton(_object.Enabled); // if enabled was canged to true we will prepare some thinks to optimize the handling for the user if (_enabled && _enabled != _object.Enabled) { // if the list is empty we will insert a first item if (_list.Count == 0) { _list.Add(ICEObjectFactory.Create <T>()); } // we foldout the parent object _object.Foldout = true; } // update the enabled status of the parent object _object.Enabled = _enabled; } }
/// <summary> /// Begins the object content or return. /// </summary> /// <returns><c>true</c>, if object content or return was begun, <c>false</c> otherwise.</returns> /// <param name="_type">Type.</param> /// <param name="_object">Object.</param> public static bool BeginObjectContentOrReturn(EditorHeaderType _type, ICEDataObject _object) { if (_object == null) { return(true); } return(BeginObjectContentOrReturn(_type, _object.Enabled, _object.Foldout)); }
/// <summary> /// Draws the object header line. /// </summary> /// <param name="_object">Object.</param> /// <param name="_type">Type.</param> /// <param name="_bold">If set to <c>true</c> bold.</param> /// <param name="_title">Title.</param> /// <param name="_hint">Hint.</param> /// <param name="_help">Help.</param> public static void DrawObjectHeaderLine(ICEDataObject _object, EditorHeaderType _type, string _title, string _hint, string _help = "") { if (_object == null) { return; } DrawObjectHeaderLine(ref _object.Enabled, ref _object.Foldout, _type, _title, _hint, _help); }
public static void DrawEnabledButton(ICEDataObject _object, EditorHeaderType _type) { if (IsEnabledType(_type)) { bool _enabled = ICEEditorLayout.EnableButton(_object.Enabled); if (_enabled && _enabled != _object.Enabled) { _object.Foldout = true; } _object.Enabled = _enabled; } }
public static bool DrawClearButton(ICEDataObject _object, List <ICEObject> _list) { if (_object == null || _list == null) { return(false); } if (ICEEditorLayout.ClearButtonSmall("")) { _list.Clear(); _object.Enabled = false; _object.Foldout = false; return(true); } return(false); }
/// <summary> /// Draws the object header. /// </summary> /// <param name="_object">Object.</param> /// <param name="_type">Type.</param> /// <param name="_bold">If set to <c>true</c> bold.</param> /// <param name="_title">Title.</param> /// <param name="_hint">Hint.</param> /// <param name="_help">Help.</param> public static void DrawObjectHeader(ICEDataObject _object, EditorHeaderType _type, string _title, string _hint = "", string _help = "") { if (_object == null || IsHeaderRequired(_type) == false) { return; } if (!IsEnabledType(_type)) { _object.Enabled = true; } ICEEditorLayout.BeginHorizontal(); DrawObjectHeaderLine(_object, _type, _title, _hint); ICEEditorLayout.EndHorizontal(_help); }
public static bool DrawAddButton <T>(ICEDataObject _object, EditorHeaderType _type, List <T> _list) where T : new() { if (_object == null || _list == null) { return(false); } if (ICEEditorLayout.AddButtonSmall("")) { _list.Add(ICEObjectFactory.Create <T>()); _object.Enabled = true; _object.Foldout = true; return(true); } return(false); }