public override void DrawSelf(XBaseWindow window) { window.DoButton(name, () => isShowAll = !isShowAll); if (isShowAll) { window.BeginHorizontal(); name = window.CreateStringField(name); window.EndHorizontal(); window.BeginHorizontal(); DrawType(window); window.DoButton("Add Parameter", () => parameters.Add(new XCodeParameter())); window.DoButton("Add Attribute", () => attributes.Add(new XCodeCustomAttribute())); window.DoButton("Add Comment", () => comments.Add("TODO LIST")); window.EndHorizontal(); } if (isShowAll) { DrawComments(window); DrawCustomeAttribute(window); DrawParameters(window); } }
public virtual void DrawCustomeAttribute(XBaseWindow window) { window.CreateLabel("CustomAttributes"); for (int pos = 0; pos < attributes.Count; pos++) { // TODO loop in comments.Count window.BeginHorizontal(); attributes[pos].name = window.CreateStringField(attributes[pos].name); window.DoButton <XCodeParameter>("Parameter", ParameterCreate, attributes[pos].parameter); window.DoButton("Delete", () => attributes.RemoveAt(pos)); window.EndHorizontal(); } }
public void DrawSelf(XBaseWindow window) { name = window.CreateStringField("ClassName", name); window.DoButton("Add New NameSpace", () => importNamespace.Add("UnityEngine")); for (int pos = 0; pos < importNamespace.Count; pos++) { // TODO loop in importNamespace.Count window.BeginHorizontal(); importNamespace[pos] = window.CreateStringField(importNamespace[pos]); window.DoButton("Delete", () => importNamespace.RemoveAt(pos)); window.EndHorizontal(); } window.DoButton("Add New BaseClass", () => baseClass.Add("Object")); for (int pos = 0; pos < baseClass.Count; pos++) { // TODO loop in importNamespace.Count window.BeginHorizontal(); baseClass[pos] = window.CreateStringField(baseClass[pos]); window.DoButton("Delete", () => baseClass.RemoveAt(pos)); window.EndHorizontal(); } window.BeginHorizontal(); window.DoButton("Add Method", () => methods.Add(new XCodeMethod())); window.DoButton("Add Field", () => fields.Add(new XCodeField())); window.DoButton("Add Property", () => properties.Add(new XCodeProperty())); window.EndHorizontal(); for (int pos = 0; pos < methods.Count; pos++) { // TODO loop in classChildren.Count methods[pos].DrawSelf(window); window.DoButton("Delete", () => methods.RemoveAt(pos)); } for (int pos = 0; pos < fields.Count; pos++) { // TODO loop in classChildren.Count fields[pos].DrawSelf(window); window.DoButton("Delete", () => fields.RemoveAt(pos)); } for (int pos = 0; pos < properties.Count; pos++) { // TODO loop in classChildren.Count properties[pos].DrawSelf(window); window.DoButton("Delete", () => properties.RemoveAt(pos)); } }
public virtual void DrawType(XBaseWindow window) { XBaseWindow.DoButton("Type", () => { XCodeTypeTemplate.SelectType(x => type = x); }); memberAttribute = (MemberAttributes)XBaseWindow.CreateEnumPopup(memberAttribute); }
public override void DrawSelf(XBaseWindow window) { window.BeginHorizontal(); window.DoButton(name, () => isShowAll = !isShowAll); if (isShowAll) { name = window.CreateStringField(name); // window.CreateEnumSelectable( codeType ); // TypeID = window.CreateSelectableString(TypeID, StrTypes ); DrawType(window); window.DoButton("Add Attribute", () => attributes.Add(new XCodeCustomAttribute())); window.DoButton("Add Comment", () => comments.Add("TODO LIST")); } window.EndHorizontal(); if (isShowAll) { DrawComments(window); } }
// public virtual void DrawMemberAttribute(XBaseWindow window) // { // memberAttribute = window.CreateEnumSelectable( memberAttribute ) as MemberAttributes; // } public virtual void DrawComments(XBaseWindow window) { XBaseWindow.CreateLabel("Comments"); for (int pos = 0; pos < comments.Count; pos++) { // TODO loop in comments.Count XBaseWindow.BeginHorizontal(); comments[pos] = XBaseWindow.CreateStringField(comments[pos]); XBaseWindow.DoButton("Delete", () => comments.RemoveAt(pos)); XBaseWindow.EndHorizontal(); } }
void DrawParameters(XBaseWindow window) { window.CreateLabel("Parameters"); for (int pos = 0; pos < parameters.Count; pos++) { // TODO loop in comments.Count window.BeginHorizontal(); // parameters[pos].type = window.CreateStringField( parameters[pos].type ); parameters[pos].Draw(window); window.DoButton("Delete", () => parameters.RemoveAt(pos)); window.EndHorizontal(); } }
public void Draw(XBaseWindow window) { window.DoButton("Type", () => { XCodeTypeTemplate.SelectType(x => type = x); }); }