本文整理汇总了C++中OnDraw函数的典型用法代码示例。如果您正苦于以下问题:C++ OnDraw函数的具体用法?C++ OnDraw怎么用?C++ OnDraw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnDraw函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dc
void CFHDragWnd::OnPaint()
{
CPaintDC dc(this);
if(m_pFlatHeaderCtrl->m_bDoubleBuffer)
{
CMemDC MemDC(&dc);
OnDraw(&MemDC);
}
else
OnDraw(&dc);
}
开发者ID:GFFavourite,项目名称:Script.NET,代码行数:12,代码来源:FlatHeaderCtrl.cpp
示例2: GetScreenRect
void CCWidget::Draw(CCDrawContext* pDC){
if(m_bVisible==false) return;
unsigned char nLastOpacity;
nLastOpacity = pDC->GetOpacity();
sRect sr = GetScreenRect();
pDC->SetOrigin(sPoint(sr.x, sr.y));
if(m_pFont!=NULL) pDC->SetFont(m_pFont);
else pDC->SetFont(CCFontManager::Get(NULL));
pDC->SetOpacity((unsigned char)(nLastOpacity * (float)(m_iOpacity / 255.0f)));
if(!IsEnable())
pDC->SetOpacity((unsigned char)(pDC->GetOpacity()*0.70));
bool bIntersect = true;
sRect rectScreen(0, 0, CCGetWorkspaceWidth()-1, CCGetWorkspaceHeight()-1);
sRect PrevClipRect;
if(GetParent()!=NULL) {
sRect parentClipRect = CCClientToScreen(GetParent(), GetParent()->GetClientRect());
bIntersect = rectScreen.Intersect(&PrevClipRect,parentClipRect);
}else
PrevClipRect = rectScreen;
sRect CurrClipRect = GetScreenRect();
sRect IntersectClipRect;
if(m_bClipByParent==true){
if(PrevClipRect.Intersect(&IntersectClipRect, CurrClipRect)==true){
sRect test = IntersectClipRect;
if(IntersectClipRect.w>0 && IntersectClipRect.h>0) {
pDC->SetClipRect(IntersectClipRect);
OnDraw(pDC);
}
}
}
else{
pDC->SetClipRect(CurrClipRect);
OnDraw(pDC);
}
for(int i=0; i<m_Children.GetCount(); i++){
CCWidget* pCurWnd = m_Children.Get(i);
if(pCurWnd==GetLatestExclusive()) continue;
if(pCurWnd != NULL ) pCurWnd->Draw(pDC);
}
if(GetLatestExclusive()!=NULL)
GetLatestExclusive()->Draw(pDC);
pDC->SetOpacity(nLastOpacity);
}
开发者ID:Kallontz,项目名称:gunz-the-tps-mmorpg,代码行数:52,代码来源:CCWidget.cpp
示例3: CheckCursorInfiniteMode
void EditorApplication::ProcessFrame()
{
if (!mReady)
return;
if (mCursorInfiniteModeEnabled)
CheckCursorInfiniteMode();
float maxFPS = 60.0f;
float maxFPSDeltaTime = 1.0f/maxFPS;
float realdDt = mTimer->GetDeltaTime();
if (realdDt < maxFPSDeltaTime)
{
Sleep((int)((maxFPSDeltaTime - realdDt)*1000.0f));
realdDt = maxFPSDeltaTime;
}
float dt = Math::Clamp(realdDt, 0.001f, 0.05f);
mInput->PreUpdate();
mTime->Update(realdDt);
o2Debug.Update(dt);
mTaskManager->Update(dt);
mEventSystem->Update(dt);
mRender->Begin();
OnDraw();
OnUpdate(dt);
mUIRoot->Update(dt);
mEventSystem->PostUpdate();
mScene->Update(dt);
OnDraw();
mUIRoot->Draw();
mUIManager->Draw();
o2Debug.Draw();
mRender->End();
mInput->Update(dt);
mDrawCalls = mRender->GetDrawCallsCount();
}
开发者ID:zenkovich,项目名称:o2,代码行数:48,代码来源:EditorApplication.cpp
示例4: dc
void CGreedySnakeView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CView::OnPaint()
OnDraw(&dc);
}
开发者ID:mlc123,项目名称:Console-snake,代码行数:7,代码来源:GreedySnakeView.cpp
示例5: OnDraw
void iWidget::Draw(float a_fTimeStep, cGuiClipRegion *a_pClipRegion)
{
if (m_bVisible==false) return;
OnDraw(a_fTimeStep, a_pClipRegion);
cGuiClipRegion *pChildRegion = a_pClipRegion;
if (m_bClipsGraphics)
{
pChildRegion = pChildRegion->CreateChild(GetGlobalPosition(), m_vSize);
m_pSet->SetCurrentClipRegion(pChildRegion);
}
OnDrawAfterClip(a_fTimeStep, a_pClipRegion);
cGuiMessageData data;
data.m_fVal = a_fTimeStep;
data.m_pData = a_pClipRegion;
ProcessMessage(eGuiMessage_OnDraw, data);
tWidgetListIt it = m_lstChildren.begin();
for (; it != m_lstChildren.end(); ++it)
{
iWidget *pChild = *it;
pChild->Draw(a_fTimeStep, a_pClipRegion);
}
if (m_bClipsGraphics) m_pSet->SetCurrentClipRegion(a_pClipRegion);
}
开发者ID:MIFOZ,项目名称:EFE-Engine,代码行数:30,代码来源:Widget.cpp
示例6: while
int CApp::OnExecute(int argc, char **argv) {
if(OnInit(argc, argv) == false) {
return -1;
}
SDL_Event Event;
bool calculatedFrame;
while(Running) {
//BulletManager::Step();
while(SDL_PollEvent(&Event))
{
OnEvent(&Event);
}
calculatedFrame= false;
while ((SDL_GetTicks() - GameBaseTime) > GameTickLength)
{
gameTime = SDL_GetTicks() / 1000.0f;
GameBaseTime += GameTickLength;
OnUpdate();
calculatedFrame = true;
}
BulletManager::Step();
OnDraw();
}
OnCleanup();
return 0;
}
开发者ID:ultradr3mer,项目名称:Flow,代码行数:33,代码来源:CApp.cpp
示例7: AfxGetApp
void CSceneRender::OnSceneLight()
{
m_Light = !m_Light;
AfxGetApp()->WriteProfileInt( "CSceneRender", "m_Light", m_Light );
OnDraw(NULL);
}
开发者ID:BlackYoup,项目名称:medusa,代码行数:7,代码来源:SceneRender.cpp
示例8: dlg
void ScheduleViewEx::OnPrintAll()
{
CPrintDialog dlg(FALSE);
if (IDOK == dlg.DoModal())
{
HDC dc = dlg.GetPrinterDC();
CDC DC;
DC.Attach(dc);
DEVMODE *myMode = dlg.GetDevMode();//fills myMode with printer defaults
myMode->dmOrientation = DMORIENT_LANDSCAPE;//change default to landscape
myMode->dmPrintQuality = DMRES_DRAFT;
myMode->dmColor = DMCOLOR_MONOCHROME;
DC.ResetDC(myMode);
DC.m_bPrinting = TRUE;
OnPrepareDC(&DC);
DC.StartDoc(_T("myDoc"));
int tmpOffset = m_offset;
for (int i = 0;
i< TotalPages();
i++)
{
m_offset = i;
DC.StartPage();
OnDraw(&DC);
DC.EndPage();
}
DC.EndDoc();
m_offset = tmpOffset;
}
}
开发者ID:johanericsson,项目名称:schedule,代码行数:34,代码来源:ScheduleViewEx.cpp
示例9: OnDraw
void CSceneRender::OnNodeResetposition()
{
BaseNodePort * pNode = ((ScenePort *)GetDocument())->m_pSelectedNode;
pNode->resetPosition( m_TargetPosition );
OnDraw( NULL );
}
开发者ID:BlackYoup,项目名称:medusa,代码行数:7,代码来源:SceneRender.cpp
示例10: ASSERT
void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr,
int32_t iLength,
const CFX_RectF& rect,
const CFX_RectF& rtClip) {
ASSERT(m_pFont && m_fFontSize >= 1.0f);
if (!pwsStr || iLength < 1)
return;
if (rect.width < m_fFontSize || rect.height < m_fFontSize) {
return;
}
FX_FLOAT fLineWidth = rect.width;
if (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) {
fLineWidth = rect.height;
}
m_pTxtBreak->SetLineWidth(fLineWidth);
m_ttoLines.RemoveAll(TRUE);
m_wsText.clear();
LoadText(pwsStr, iLength, rect);
if (m_dwStyles & FDE_TTOSTYLE_Ellipsis) {
ReplaceWidthEllipsis();
}
Reload(rect);
DoAlignment(rect);
OnDraw(rtClip);
}
开发者ID:gradescope,项目名称:pdfium,代码行数:26,代码来源:fde_textout.cpp
示例11: OnDraw
void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device,
FX_DWORD dwFlags) {
OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
}
开发者ID:azunite,项目名称:libpdfium,代码行数:7,代码来源:FFL_FormFiller.cpp
示例12: GetRectInHost
void WLTreeItemAL::_CustomInternalDraw(HDC hDC, RECT const &rcUpdate, RECT const &rcViewInThis)
{
CRect rcInHost ;
GetRectInHost(rcInHost) ;
RECT rcInsterset ;
if (!IsWndLessVisible() || !::IntersectRect(&rcInsterset, &rcInHost, &rcUpdate))
return ;
#ifdef _TRACEDRAW
TRACE(_T("--> %S::_InternalOnDraw [%p]\n"), typeid(*this).name(), this) ;
CString s ;
s.Format(_T("<-- %S::_InternalOnDraw [%p]"), typeid(*this).name(), this) ;
hdutils::CPUPerformance cp(s) ;
#endif
CRect rc ;
GetRectInParent(rc) ;
if (m_nItemHeight > rcViewInThis.top)
{
OnDraw(hDC, rcUpdate) ;
}
CustomOnDrawChild(hDC, rcUpdate, rcViewInThis) ;
}
开发者ID:baogechen,项目名称:foundit,代码行数:25,代码来源:WLTreeItemAL.cpp
示例13: dc
void CXTPReportHeaderDragWnd::OnPaint()
{
CPaintDC dc(this);
CXTPClientRect rc(this);
CXTPBufferDC memDC(dc, rc);
OnDraw(&memDC, rc);
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:7,代码来源:XTPReportDragDrop.cpp
示例14: dc
void CBCGPSpinButtonCtrl::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBCGPMemDC memDC (dc, this);
OnDraw (&memDC.GetDC ());
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:7,代码来源:BCGPSpinButtonCtrl.cpp
示例15: ASSERT_VALID
void CView::OnPrint(CDC* pDC, CPrintInfo*)
{
ASSERT_VALID(pDC);
// Override and set printing variables based on page number
OnDraw(pDC); // Call Draw
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:7,代码来源:viewcore.cpp
示例16: CopyRect
BOOL CMovableObj::Draw(HDC hDC, LPRECT pRect)
{_STT();
RECT rect, intersection;
CopyRect( &rect, &m_rect );
OffsetRect( &rect, -m_lXOff, -m_lYOff );
// Punt if off the canvas
if ( !IntersectRect( &intersection, pRect, &rect ) )
return FALSE;
// Draw the object
OnDraw( hDC, &rect );
if ( m_bSelected )
{
// Draw the rect frame
HBRUSH hBrush = CreateHatchBrush( HS_BDIAGONAL, RGB( 0, 0, 0 ) );
FrameRect( hDC, &rect, hBrush );
DeleteObject( hBrush );
// Draw a focus rect
DrawFocusRect( hDC, &rect );
} // end if
return TRUE;
}
开发者ID:aminsyed,项目名称:rulib,代码行数:27,代码来源:MovableObj.cpp
示例17: dc
void CView::OnPaint()
{
// standard paint routine
CPaintDC dc(this);
OnPrepareDC(&dc);
OnDraw(&dc);
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:7,代码来源:viewcore.cpp
示例18: updateCam
void CBoxProxyView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
if(MouseDown){
if (lastPoint!=CPoint(0,0))
{
angle1+=(point.x-lastPoint.x)*up;
angle2+=(point.y-lastPoint.y)*up;
if (angle2>90)
{
angle1+=180;
angle2=180-angle2;
up=-up;
}
if(angle2<-90)
{
angle1+=180;
angle2=-180-angle2;
up=-up;
}
updateCam();
CPaintDC dc(this);
OnDraw(&dc);
}
if(lastPoint!=point)
lastPoint=point;
}
CView::OnMouseMove(nFlags, point);
}
开发者ID:Khrylx,项目名称:BoxProxy,代码行数:30,代码来源:BoxProxyView.cpp
示例19: WXUNUSED
// This calls OnDraw, having adjusted the origin according to the current
// scroll position
void wxScrolledWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
PrepareDC(dc);
OnDraw(dc);
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:9,代码来源:scrolwin.cpp
示例20: glEnable
// CBoxProxyView 绘制
void CBoxProxyView::GetDepthMapFromView()
{
glEnable(GL_DEPTH_TEST);
//glDepthFunc(GL_LEQUAL);
gettingDepth=true;
sd.setShaders();
ColorPos=sd.getAttrLocation("vColor");
VertexPos=sd.getAttrLocation("vVertex");
KRpos=sd.getUniformLocation("m_KR");
KTpos=sd.getUniformLocation("m_KT");
Matrix3d m_KR=cam.getKR();
Vector3d m_KT=cam.getKT();
float kr[9];
double kt[3];
for (int i = 0; i < 9; i++)
{
kr[i]=m_KR(i);
}
for (int i = 0; i < 3; i++)
{
kt[i]=m_KT(i);
}
glUniformMatrix3fvARB(KRpos,1,GL_FALSE,&kr[0]);
glUniform3d(KTpos,kt[0],kt[1],kt[2]);
setUpDepthCam();
CPaintDC dc(this);
OnDraw(&dc);
}
开发者ID:Khrylx,项目名称:BoxProxy,代码行数:31,代码来源:BoxProxyView.cpp
注:本文中的OnDraw函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论