本文整理汇总了C++中DockableCtrl::Serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ DockableCtrl::Serialize方法的具体用法?C++ DockableCtrl::Serialize怎么用?C++ DockableCtrl::Serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DockableCtrl
的用法示例。
在下文中一共展示了DockableCtrl::Serialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeLayout
void DockBase::SerializeLayout(Stream& s, bool deflay)
{
CtrlRecord* record = NULL;
DockableCtrl* ctrl = NULL;
TreeCtrl& tree = grouptab.grouptree;
String name;
int panesize = 0;
int type = 0;
int alignment = 0;
int state = 0;
int position = 0;
int id = 0;
int childcount = 0;
Size childsize;
if(s.IsStoring())
{
// Remove unused TabWindows (BugFix).
RefreshTabWindowList();
// Write Tabbing mode.
s % tabsnested;
// Write Widgets.
// Write Docked (shown or hidden) and AutoHidden widgets.
childcount = GetDockedWindowCount();
s / childcount;
if(childcount)
for(int i = 0; i < childcount; i++)
{
ctrl = GetDockedWindowFromIndex(i);
ASSERT(ctrl);
ctrl->Serialize(s);
}
// Write PaneFrame sizes.
for(int i = 0; i < 4; i++)
{
panesize = GetPaneFrame(i).GetSize();
s / panesize;
}
childcount = 0;
int ctrlscount = ctrls.GetCount();
// Write Floating Dockwindows.
for(int i = 0; i < ctrlscount * 2; i++)
{
if(i < ctrlscount) childcount += GetCtrlRecordFromIndex(i)->ctrl->IsFloating() ? 1 : 0;
if(i >= ctrlscount)
{
if(i == ctrlscount) s / childcount;
ctrl = GetCtrlRecordFromIndex(i - ctrlscount)->ctrl;
ASSERT(ctrl);
if(ctrl->IsFloating()) ctrl->Serialize(s);
}
}
childcount = 0;
// Write Floating TabWindows.
int tabwindowcount = GetTabWindowCount();
if(tabwindowcount)
for(int i = 0; i < tabwindowcount * 2; i++)
{
if(i < tabwindowcount) childcount += GetTabWindowFromIndex(i)->IsFloating() ? 1 : 0;
if(i >= tabwindowcount)
{
if(i == tabwindowcount) s / childcount;
TabWindow* tabwindow = GetTabWindowFromIndex(i - tabwindowcount);
ASSERT(tabwindow);
if(tabwindow->IsFloating()) tabwindow->Serialize(s);
}
}
}
if(s.IsLoading())
{
childcount = 0;
// Close All widgets.
for(int i = 0; i < GetTabWindowCount(); i++) GetTabWindowFromIndex(i)->DetachAll();
for(int i = 0; i < ctrls.GetCount(); i++) GetCtrlRecordFromIndex(i)->ctrl->Shut();
// Remove unused TabWindows (BugFix).
RefreshTabWindowList();
// Read Tabbing Mode
s % tabsnested;
controlpanel.TabOptionNest <<= tabsnested;
// Read Docked (shown or hidden) and AutoHidden widgets.
s / childcount;
if(childcount)
for(int i = 0; i < childcount; i++)
{
s / type / id;
if(type == DockableCtrl::TYPE_DOCKWINDOW)
GetCtrlRecordFromId(id)->ctrl->Serialize(s);
if(type == DockableCtrl::TYPE_TABWINDOW)
GetPaneFrame(0).AddTabWindow()->Serialize(s);
}
// Read PaneFrame sizes.
for(int i = 0; i < 4; i++)
{
s / panesize;
GetPaneFrame(i).SetSize(panesize);
}
childcount = 0;
s / childcount;
if(childcount)
//.........这里部分代码省略.........