//自绘界面 void CRadarMapCtrl::OnCustomDraw(CDC *pDC) { DrawBg(); DrawCoordinate(); if(m_map_bkgrdMap.bReady) { DrawMap(); } if(m_map_warningResult.objNum>0) { DrawWarningResult(); } if(m_map_warningObjects.size()>0 && (m_state==RDPlayBack)) { PlayBackWaringObject(); } if(m_zoomInBtn != NULL) m_zoomInBtn->Draw(&m_dcMemory); if(m_zoomOutBtn != NULL) m_zoomOutBtn->Draw(&m_dcMemory); DrawState(pDC); //最后统一拷贝到PDC中,双缓冲 CRect rect; GetClientRect(&rect); pDC->BitBlt(0,0,rect.Width(),rect.Height(),&m_dcMemory,0,0,SRCCOPY); }
void CSkinScrollBar::OnPaint(HDC hDC) { if (!IsVisible()) return; DrawBg(hDC); DrawLeftUpBtn(hDC); DrawRightDownBtn(hDC); DrawThumb(hDC); DrawRail(hDC); }
void EngineStatePoolChoosePlayer::Draw() { AmjuGL::PushMatrix(); DrawBg(); m_pCam->Update(); m_pCam->Draw(); m_lighting.DrawLight(); m_or.Draw(); ThePoolBg::Instance()->Draw(); AmjuGL::PopMatrix(); }
void EngineStatePlayerStats::Draw() { AmjuGL::PushMatrix(); // Paint background DrawBg(); // Do camera work m_pCam->Update(); m_pCam->Draw(); // Lighting m_lighting.DrawLight(); // Position the text m_or.Draw(); // Draw the text if (m_pComp.GetPtr()) { AmjuGL::PushMatrix(); // position AmjuGL::Translate(0, m_verticalPos, 0); static const float statTextY = GetEngine()->GetConfigFloat("stats_text_y"); static const float statTextZ = GetEngine()->GetConfigFloat("stats_text_z"); AmjuGL::PushMatrix(); AmjuGL::Translate(0, statTextY, statTextZ); m_pComp->Update(); m_pComp->Draw(); AmjuGL::PopMatrix(); // draw a character static const float x = Engine::Instance()->GetConfigFloat("title_character_x"); static const float y = Engine::Instance()->GetConfigFloat("title_character_y"); static const float z = Engine::Instance()->GetConfigFloat("title_character_z"); AmjuGL::PushMatrix(); AmjuGL::Translate(x - 1.5f, y, z); m_pChar->Recalculate(); m_pChar->Draw(); AmjuGL::PopMatrix(); AmjuGL::PopMatrix(); } AmjuGL::PopMatrix(); }
void EngineStatePoolGetPlayerName::Draw() { AmjuGL::PushMatrix(); DrawBg(); m_pCam->Update(); m_pCam->Draw(); m_lighting.DrawLight(); // AmjuGL::PushMatrix(); m_or.Draw(); ThePoolBg::Instance()->Draw(); // AmjuGL::PopMatrix(); // Box containing player name text // m_textboxTq.Draw(2.5, 2.0, 7.5, 24.0); // t, l, b, r // m_or.Draw(); static const float nameY = Engine::Instance()->GetConfigFloat("pool_name_y"); AmjuGL::Translate(0, nameY, 0); // above menu of old names static const float z = Engine::Instance()->GetConfigFloat("hi_score_text_z2"); AmjuGL::Translate(0, 0, z); //m_pGreetText->Draw(); AmjuGL::Translate(0, -3.0f, 0); AmjuGL::PushMatrix(); // Draw the text being edited: AmjuGL::Translate(-m_totalSize/2.0f, 0, -4.0f); // TODO TEMP TEST was -m_totalSize); // Draw the text to the left of the cursor m_pComp->Draw(); // Draw the text to the right of the cursor AmjuGL::Translate(m_leftSize + 0.5f, 0, 0); DrawCursor(); m_pComp2->Draw(); AmjuGL::PopMatrix(); AmjuGL::PopMatrix(); std::string s = "Player "; s += ToString(m_currentPlayer + 1); s += ", please type your name then hit return"; Engine::Instance()->GetTextWriter()->PrintCentre(3.0f, s.c_str()); Engine::Instance()->GetTextWriter()->PrintCentre(10.0f, m_errorText.c_str()); }
void EngineStatePoolGameSelect::Draw() { AmjuGL::PushMatrix(); // Paint background DrawBg(); // Do camera work m_pCam->Update(); m_pCam->Draw(); // Lighting m_lighting.DrawLight(); // Move text according to Function //m_pFunc->Recalc(&m_or); // Position the text m_or.Draw(); // m_pComp->Draw(); // draw "player select" text ThePoolBg::Instance()->Draw(); AmjuGL::PopMatrix(); }
void CDlg_Search::DrawItems(CDC *pDC) { CRect rectDlg; GetClientRect(&rectDlg); if(rectDlg.Width() == 0 || rectDlg.Height() == 0) return; if(!pDC) return; CDC memDC, bufferDC; CBitmap bmpBuffer; CBitmap* pOldBmp; bmpBuffer.CreateCompatibleBitmap(pDC, rectDlg.Width(), rectDlg.Height()); memDC.CreateCompatibleDC(pDC); bufferDC.CreateCompatibleDC(pDC); bufferDC.SetBkMode(TRANSPARENT); pOldBmp = (CBitmap*) bufferDC.SelectObject(&bmpBuffer); // copy back ground // bufferDC.BitBlt(0, 0, rectDlg.Width(), rectDlg.Height(), pDC, 0, 0, SRCCOPY); DrawBg(&bufferDC, &memDC); if( m_nCurrType == TYPE_SRCH_LOAD_DATA ) //로드수 DrawLoadNumData(&bufferDC); else if (m_nCurrType == TYPE_SRCH_RCMMWORD && m_bShowRecommend && m_nValidRecomm) //추천 검색어 DrawRcmmWordTitle(&bufferDC); pDC->BitBlt(0, 0, rectDlg.Width(), rectDlg.Height(), &bufferDC, 0, 0, SRCCOPY); bufferDC.SelectObject(pOldBmp); bmpBuffer.DeleteObject(); bufferDC.DeleteDC(); memDC.DeleteDC(); }
void CUIMenu::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) { LPDRAWITEMSTRUCT lpds; UI_MENU_ITEM_INFO * lpUIMenuItemInfo; HDC hDC; CRect rcItem; BOOL bGrayed, bDisabled, bSelected, bChecked; BOOL bIsSeparator; CImageEx * lpIconImgN, *lpIconImgH; HDC hMemDC; HBITMAP hMemBmp, hOldBmp; lpds = lpDrawItemStruct; if (NULL == lpds || lpds->CtlType != ODT_MENU) return; lpUIMenuItemInfo = (UI_MENU_ITEM_INFO *)lpds->itemData; if (NULL == lpUIMenuItemInfo || lpUIMenuItemInfo->nMagic != UI_MENU_MAGIC) return; hDC = lpds->hDC; rcItem = lpds->rcItem; bGrayed = lpds->itemState & ODS_GRAYED; bDisabled = lpds->itemState & ODS_DISABLED; bSelected = lpds->itemState & ODS_SELECTED; //bChecked = lpds->itemState & ODS_CHECKED; bChecked = lpUIMenuItemInfo->nState & ODS_CHECKED; bIsSeparator = lpUIMenuItemInfo->nType & MFT_SEPARATOR; lpIconImgN = lpUIMenuItemInfo->lpIconImgN; lpIconImgH = lpUIMenuItemInfo->lpIconImgH; rcItem.OffsetRect(-rcItem.left, -rcItem.top); hMemDC = ::CreateCompatibleDC(hDC); hMemBmp = ::CreateCompatibleBitmap(hDC, rcItem.Width(), rcItem.Height()); hOldBmp = (HBITMAP)::SelectObject(hMemDC, hMemBmp); DrawBg(hMemDC, rcItem); // 绘制背景 if (bIsSeparator) // 绘制分隔符 { DrawSepartor(hMemDC, rcItem); } else { if (bSelected && !bGrayed) DrawSelRect(hMemDC, rcItem); // 绘制选中区域 if (bChecked) // 绘制Check状态 { DrawCheckState(hMemDC, rcItem); } else { if (bSelected) DrawIcon(hMemDC, rcItem, lpIconImgH); // 绘制选中图标 else DrawIcon(hMemDC, rcItem, lpIconImgN); // 绘制非选中图标 } DrawText(hMemDC, rcItem, bGrayed, bSelected, (BOOL)lpUIMenuItemInfo->hSubMenu, lpUIMenuItemInfo->szText.c_str()); // 绘制菜单文本 if (lpUIMenuItemInfo->hSubMenu != NULL) // 绘制子菜单的右三角箭头 DrawArrow(hMemDC, rcItem); } rcItem = lpds->rcItem; ::BitBlt(hDC, rcItem.left, rcItem.top, rcItem.Width(), rcItem.Height(), hMemDC, 0, 0, SRCCOPY); if (lpUIMenuItemInfo->hSubMenu != NULL) // 不让系统绘制弹出式菜单箭头 ::ExcludeClipRect(hDC, rcItem.left, rcItem.top, rcItem.right, rcItem.bottom); ::SelectObject(hMemDC, hOldBmp); ::DeleteObject(hMemBmp); ::DeleteDC(hMemDC); }