本文整理汇总了C++中CDrawingObject::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ CDrawingObject::Load方法的具体用法?C++ CDrawingObject::Load怎么用?C++ CDrawingObject::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDrawingObject
的用法示例。
在下文中一共展示了CDrawingObject::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadFile
//-- Load a design from a file, loaded design will be selected
BOOL CTinyCadDoc::ReadFile(CStream &theArchive, BOOL Details, drawingCollection &drawing)
{
try
{
// Save the old layer setting
CDrawingObject* obj = NULL;
BYTE tp = xNULL;
CHeaderStamp oHeader;
LONG pos = theArchive.GetPos();
oHeader.Read( theArchive );
if( ! oHeader.IsChecked(false) )
{
// Perhaps this is XML?
theArchive.Seek(pos);
CXMLReader xml( &theArchive );
return ReadFileXML( xml, Details, drawing, FALSE );
}
while (tp!=xEndFile) {
theArchive >> tp;
switch (tp) {
case xDesignInformation:
GetDetails().Read( theArchive );
break;
case xDesignInformation2:
GetDetails().ReadEx( theArchive );
m_snap.Load( theArchive, Details );
break;
case xOptions:
if( Details )
{
theOptions.ReadNative( theArchive );
}
else
{
COption().ReadNative( theArchive );
}
obj = NULL;
break;
case xFont:
theOptions.LoadFonts(theArchive);
obj = NULL;
break;
case xLineStyle:
theOptions.LoadStyles(theArchive);
obj = NULL;
break;
case xFillStyle:
theOptions.LoadFillStyles(theArchive);
obj = NULL;
break;
case xMetaFiles:
theOptions.LoadMetaFiles(theArchive);
obj = NULL;
break;
case xSymbols:
theOptions.LoadSymbols(theArchive);
obj = NULL;
break;
case xLayerTable:
{
// Read in the number of Layers in this list
CString theNewName;
WORD NumberOfResources;
theArchive >> NumberOfResources;
hRESOURCE OldResourceNumber = 0;
while (NumberOfResources > 0) {
theArchive >> OldResourceNumber;
theArchive >> theNewName;
NumberOfResources--;
}
obj = NULL;
}
break;
case xRuler:
obj = new CDrawRuler(this,FALSE);
break;
case xBus:
obj = new CDrawLine(this,xBus);
break;
case xWire:
obj = new CDrawLine(this,xWire);
break;
case xBusName:
obj = new CDrawText(this,xBusName);
break;
case xBusNameEx:
obj = new CDrawText(this,xBusNameEx);
break;
case xLabel:
obj = new CDrawLabel(this);
break;
case xLabelEx:
//.........这里部分代码省略.........