public UIPackage(Packge p) : base(512, 512) { mPkg = p; dragAble = true; paddingY = paddingX = 5; layout = ELayout.vertical; //expandAbleY = expandAbleX = true; //shrinkAble = true; var items = p.getItems(); foreach (var elem in items) { var ui = elem.funcGetUiWidget(); ui.paresent = this; } }
public UIPackageItem_package(Packge pkg) { mPkg = pkg; //shrinkAble = true; marginX = 5; marginY = 5; layout = ELayout.horizon; mTypeRect = appendFromXML(@" <rect padding='2' clip='true' shrink='true'> <lable size='12' text='dir' color='yellow'></lable> </rect>") as UIRect; mNameRect = appendFromXML(@" <rect padding='2' clip='true' shrink='true'></rect> ") as UIRect; mName = mNameRect.appendFromXML(@" <lable size='12' color='black'></lable>") as UILable; setName(pkg.cast<PackageItem>().name); }
public Packge addPackage(string pname) { var p = new Packge(); var it = p.cast<PackageItem>(); it.name = pname; if (addItem(it)) { return p; } else return null; }