本文整理汇总了C++中OnDraw函数的典型用法代码示例。如果您正苦于以下问题:C++ OnDraw函数的具体用法?C++ OnDraw怎么用?C++ OnDraw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnDraw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dc
void CFHDragWnd::OnPaint()
{
CPaintDC dc(this);
if(m_pFlatHeaderCtrl->m_bDoubleBuffer)
{
CMemDC MemDC(&dc);
OnDraw(&MemDC);
}
else
OnDraw(&dc);
}
示例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);
}
示例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();
}
示例4: dc
void CGreedySnakeView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CView::OnPaint()
OnDraw(&dc);
}
示例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);
}
示例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;
}
示例7: AfxGetApp
void CSceneRender::OnSceneLight()
{
m_Light = !m_Light;
AfxGetApp()->WriteProfileInt( "CSceneRender", "m_Light", m_Light );
OnDraw(NULL);
}
示例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;
}
}
示例9: OnDraw
void CSceneRender::OnNodeResetposition()
{
BaseNodePort * pNode = ((ScenePort *)GetDocument())->m_pSelectedNode;
pNode->resetPosition( m_TargetPosition );
OnDraw( NULL );
}
示例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);
}
示例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);
}
示例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) ;
}
示例13: dc
void CXTPReportHeaderDragWnd::OnPaint()
{
CPaintDC dc(this);
CXTPClientRect rc(this);
CXTPBufferDC memDC(dc, rc);
OnDraw(&memDC, rc);
}
示例14: dc
void CBCGPSpinButtonCtrl::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBCGPMemDC memDC (dc, this);
OnDraw (&memDC.GetDC ());
}
示例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
}