GUI_APP_MAIN { TopWindow w; ArrayCtrl ac; w.AddChild(&ac); ac.HSizePosZ().VSizePosZ(); ac.AddColumn("1"); ac.AddColumn("2").Ctrls<Option>(); ac.Add("one",true); ac.Add("two",false); StringStream ss; ss.SetStoring(); ac.Serialize(ss); ac.Remove(0); // row count changed, // and count of child controls changed too ss.Seek(0); ss.SetLoading(); ss.LoadThrowing(); try { ac.Serialize(ss); } catch(LoadingError) { PromptOK("Exception caught!"); } }
void Ctrl::Serialize(Stream& s) { ... for(Ctrl *q = GetFirstChild(); q; q = q->GetNext()) q->Serialize(s); }