public HmiPage AddPage() { HmiPage page = new HmiPage(this); string name = "page"; int idx = 0; for (; idx < 0xffff; idx++) if (!FindPageByName(name + idx.ToString())) break; page.Name = name + idx.ToString(); HmiPages.Add(page); RefreshPageId(); HmiObject hmiObject = new HmiObject(this, page); hmiObject.ObjName = page.Name; page.HmiObjects.Add(hmiObject); RefreshObjId(page); hmiObject.SetScreenXY(); return HmiPages[HmiPages.Count - 1]; }
public HmiPage InsertPage(int index) { HmiPage item = new HmiPage(this); string name = "newpage"; int idx = 0; while (idx < 0xffff) { if (!FindPageByName(name + idx.ToString())) break; ++idx; } item.Name = name + idx.ToString(); HmiPages.Insert(index, item); RefreshPageId(); HmiObject mobj = new HmiObject(this, item) { App = this, ObjName = item.Name }; item.HmiObjects.Add(mobj); mobj.SetScreenXY(); RefreshObjId(item); return item; }