当前位置: 首页>>代码示例>>C++>>正文


C++ DoodleSegment类代码示例

本文整理汇总了C++中DoodleSegment的典型用法代码示例。如果您正苦于以下问题:C++ DoodleSegment类的具体用法?C++ DoodleSegment怎么用?C++ DoodleSegment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DoodleSegment类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: stream

DocumentIstream& DrawingDocument::LoadObject(DocumentIstream& istream)
{
#if wxUSE_STD_IOSTREAM
    DocumentIstream& stream = istream;
#else
    wxTextInputStream stream(istream);
#endif

    wxDocument::LoadObject(istream);

    wxInt32 count = 0;
    stream >> count;
    if ( count < 0 )
    {
        wxLogWarning("Drawing document corrupted: invalid segments count.");
#if wxUSE_STD_IOSTREAM
        istream.clear(std::ios::badbit);
#else
        istream.Reset(wxSTREAM_READ_ERROR);
#endif
        return istream;
    }

    for ( int n = 0; n < count; n++ )
    {
        DoodleSegment segment;
        segment.LoadObject(istream);
        m_doodleSegments.push_back(segment);
    }

    return istream;
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:32,代码来源:doc.cpp

示例2: while

// Sneakily gets used for default print/preview
// as well as drawing on the screen.
void DrawingView::OnDraw(wxDC *dc)
{
  dc->SetFont(*wxNORMAL_FONT);
  dc->SetPen(*wxBLACK_PEN);

  wxList::compatibility_iterator node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
  while (node)
  {
    DoodleSegment *seg = (DoodleSegment *)node->GetData();
    seg->Draw(dc);
    node = node->GetNext();
  }
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:15,代码来源:view.cpp

示例3:

wxSTD istream& DrawingDocument::LoadObject(wxSTD istream& stream)
{
    wxDocument::LoadObject(stream);

    wxInt32 n = 0;
    stream >> n;

    for (int i = 0; i < n; i++)
    {
        DoodleSegment *segment = new DoodleSegment;
        segment->LoadObject(stream);
        doodleSegments.Append(segment);
    }

    return stream;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:16,代码来源:doc.cpp

示例4: _T

wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
{
    wxDocument::SaveObject(stream);

    wxInt32 n = doodleSegments.GetCount();
    stream << n << _T('\n');

    wxList::compatibility_iterator node = doodleSegments.GetFirst();
    while (node)
    {
        DoodleSegment *segment = (DoodleSegment *)node->GetData();
        segment->SaveObject(stream);
        stream << _T('\n');

        node = node->GetNext();
    }

    return stream;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:19,代码来源:doc.cpp

示例5: stream

DocumentIstream& DrawingDocument::LoadObject(DocumentIstream& istream)
{
#if wxUSE_STD_IOSTREAM
    DocumentIstream& stream = istream;
#else
    wxTextInputStream stream(istream);
#endif

    wxDocument::LoadObject(istream);

    wxInt32 count = 0;
    stream >> count;

    for ( int n = 0; n < count; n++ )
    {
        DoodleSegment segment;
        segment.LoadObject(istream);
        m_doodleSegments.push_back(segment);
    }

    return istream;
}
开发者ID:jgrynczewski,项目名称:wxPython-2.9.2.4,代码行数:22,代码来源:doc.cpp


注:本文中的DoodleSegment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。