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


C++ Surface::Init方法代码示例

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


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

示例1: paintEvent

// Draw the contents of the widget.
void ScintillaQt::paintEvent(QPaintEvent *e)
{
    Surface *sw = Surface::Allocate();

    if (!sw)
        return;

    paintState = painting;

    const QRect &qr = e->rect();

    rcPaint.left = qr.left();
    rcPaint.top = qr.top();
    rcPaint.right = qr.right() + 1;
    rcPaint.bottom = qr.bottom() + 1;

    PRectangle rcText = GetTextRectangle();
    paintingAllText = rcPaint.Contains(rcText);

    QPainter painter(qsb->viewport());

    sw->Init(&painter);
    sw->SetUnicodeMode(CodePage() == SC_CP_UTF8);
    Paint(sw, rcPaint);

    delete sw;

    // If the painting area was insufficient to cover the new style or brace
    // highlight positions then repaint the whole thing.
    if (paintState == paintAbandoned)
        qsb->viewport()->update();

    paintState = notPainting;
}
开发者ID:Open-Turing-Project,项目名称:turing-editor-qt,代码行数:35,代码来源:ScintillaQt.cpp

示例2: OnPaint

 void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
     wxBufferedPaintDC dc(this);
     Surface* surfaceWindow = Surface::Allocate();
     surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
     m_ct->PaintCT(surfaceWindow);
     surfaceWindow->Release();
     delete surfaceWindow;
 }
开发者ID:gitrider,项目名称:wxsj2,代码行数:8,代码来源:ScintillaWX.cpp

示例3: OnPaint

    void OnPaint(wxPaintEvent& WXUNUSED(evt))
    {
        wxAutoBufferedPaintDC dc(this);
/* C::B begin */
        Surface* surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
/* C::B end */
        surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
        m_ct->PaintCT(surfaceWindow);
        surfaceWindow->Release();
        delete surfaceWindow;
    }
开发者ID:stahta01,项目名称:codeblocks_backup,代码行数:11,代码来源:ScintillaWX.cpp

示例4: paintEvent

// Paint a call tip.
void SciCallTip::paintEvent(QPaintEvent *)
{
    Surface *surfaceWindow = Surface::Allocate();

    if (!surfaceWindow)
        return;

    QPainter p(this);

    surfaceWindow->Init(&p);
    sci->ct.PaintCT(surfaceWindow);

    delete surfaceWindow;
}
开发者ID:jzsun,项目名称:turing-editor-qt,代码行数:15,代码来源:SciClasses.cpp

示例5: AddSurface

bool Mesh::AddSurface(Surface::Vertices& vertices, Surface::Normals& normals, Surface::TexCoords& texCoords, Surface::Indices& indices, Shader* pShader, Texture* pTexture){
	Surface* pSurface = new Surface(pDevice, pContext);

	if (! pSurface->Init(vertices, normals, texCoords, indices)){
		delete pSurface;
		return false;
	}

	DrawElement element;
	element.pSurface = pSurface;
	element.pShader = pShader;
	element.pTexture = pTexture;

	surfaces.push_back(element);

	return true;
}
开发者ID:q4r,项目名称:QEngine,代码行数:17,代码来源:Mesh.cpp

示例6: CallTipStart

PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *defn,
                                 const char *faceName, int size,
                                 int codePage_, int characterSet,
								 int technology, Window &wParent) {
	clickPlace = 0;
	val = defn;
	codePage = codePage_;
	Surface *surfaceMeasure = Surface::Allocate(technology);
	if (!surfaceMeasure)
		return PRectangle();
	surfaceMeasure->Init(wParent.GetID());
	surfaceMeasure->SetUnicodeMode(SC_CP_UTF8 == codePage);
	surfaceMeasure->SetDBCSMode(codePage);
	startHighlight = 0;
	endHighlight = 0;
	inCallTipMode = true;
	posStartCallTip = pos;
	XYPOSITION deviceHeight = static_cast<XYPOSITION>(surfaceMeasure->DeviceHeightFont(size));
	FontParameters fp(faceName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, SC_WEIGHT_NORMAL, false, 0, technology, characterSet);
	font.Create(fp);
	// Look for multiple lines in the text
	// Only support \n here - simply means container must avoid \r!
	int numLines = 1;
	const char *newline;
	const char *look = val.c_str();
	rectUp = PRectangle(0,0,0,0);
	rectDown = PRectangle(0,0,0,0);
	offsetMain = insetX;            // changed to right edge of any arrows
	int width = PaintContents(surfaceMeasure, false) + insetX;
	while ((newline = strchr(look, '\n')) != NULL) {
		look = newline + 1;
		numLines++;
	}
	lineHeight = RoundXYPosition(surfaceMeasure->Height(font));

	// The returned
	// rectangle is aligned to the right edge of the last arrow encountered in
	// the tip text, else to the tip text left edge.
	int height = lineHeight * numLines - static_cast<int>(surfaceMeasure->InternalLeading(font)) + borderHeight * 2;
	delete surfaceMeasure;
	if (above) {
		return PRectangle(pt.x - offsetMain, pt.y - verticalOffset - height, pt.x + width - offsetMain, pt.y - verticalOffset);
	} else {
		return PRectangle(pt.x - offsetMain, pt.y + verticalOffset + textHeight, pt.x + width - offsetMain, pt.y + verticalOffset + textHeight + height);
	}
}
开发者ID:4sp1r3,项目名称:sqlitebrowser,代码行数:46,代码来源:CallTip.cpp


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