int Mint::GetCandidateListWidth(void) { int w = 60; if(GetCandidateCount()>0){ const char* szCandidate = GetCandidate(0); w = max(w, MFontManager::Get( "Default")->GetWidth(szCandidate)+100); // ´Ù¸¥ ¹®ÀÚ¿ÀÇ ³Êºñ°¡ ´õ Ŭ ¼ö ÀÖÀ¸¹Ç·Î ¿©À¯°ªÀ» ÃæºÐÈ÷ ÁØ´Ù. } return w + 4; }
BOOL CCElection::DoTestAddDeposit( u_long idPlayer, __int64 iDeposit, time_t tCreate ) { // 군주 입찰 if( election::IsActivePlayer( idPlayer ) ) { CCandidate* pCandidate = GetCandidate( idPlayer ); __int64 iOld = ( pCandidate? pCandidate->GetDeposit(): 0 ); char szText[260] = { 0,}; if( iOld ) sprintf( szText, prj.GetText( TID_GAME_ELECTION_ADD_DEPOSIT_S001 ), iOld, iDeposit, iOld + iDeposit ); else sprintf( szText, prj.GetText( TID_GAME_ELECTION_ADD_DEPOSIT_S002 ), iDeposit ); g_WndMng.OpenMessageBoxUpper( szText ); g_WndMng.PutString( prj.GetText( TID_GAME_ELECTION_ADD_DEPOSIT_S003 ), NULL, prj.GetTextColor( TID_GAME_ELECTION_ADD_DEPOSIT_S003 ) ); } return TRUE; }
void Mint::DrawCandidateList(MDrawContext* pDC, MPOINT& p) { if(GetCandidateCount()>0){ MCOLOR c = pDC->GetColor(); MRECT r(p.x, p.y, GetCandidateListWidth(), GetCandidateListHeight()); // pDC->SetColor(MCOLOR(0x30000000)); // ±×¸²ÀÚ // pDC->FillRectangle( r.x+5, r.y+5, r.w, r.h); pDC->SetColor(MCOLOR(0xFF050505)); // ÇÁ·¹ÀÓ ¹ÙÅÁ pDC->FillRectangle(r); pDC->SetColor(MCOLOR(0xFF505050)); // ÇÁ·¹ÀÓ ¾îµÎ¿î ºÎºÐ pDC->Rectangle( r.x+1, r.y+1, r.w, r.h); pDC->SetColor(MCOLOR(0xFFB0B0B0)); // ÇÁ·¹ÀÓ ¹àÀº ºÎºÐ pDC->Rectangle(r); MFont* pFont = pDC->GetFont(); pDC->SetFont( MFontManager::Get( "Default")); // °Á¦·Î ÆùÆ®¸¦ µðÆúÆ®·Î °íÁ¤ÇÑ´Ù. int nStart = GetCandidatePageStart(); char temp[MIMECOMPOSITIONSTRING_LENGTH+4]; for(int i=nStart; i<(int)min(GetCandidateCount(), nStart+GetCandidatePageSize()); i++) { const char* szCandidate = GetCandidate(i); if(i==GetCandidateSelection()) pDC->SetColor(MCOLOR(DEFCOLOR_NORMAL)); else pDC->SetColor(MCOLOR(0xFF909090)); int nIndexInPage = i-nStart; sprintf(temp, "%d: %s", nIndexInPage+1, szCandidate); pDC->Text(p.x+4, p.y + nIndexInPage*pDC->GetFont()->GetHeight() + 4, temp); } // ÇöÀç ¼±Åà À妽º ¹× ÃÑ °³¼ö Ãâ·Â sprintf(temp, "(%d/%d)", GetCandidateSelection()+1, GetCandidateCount()); pDC->SetColor(MCOLOR(DEFCOLOR_NORMAL)); pDC->Text(p.x + 4, p.y + GetCandidatePageSize()*pDC->GetFont()->GetHeight() + 4, temp); pDC->SetColor(c); pDC->SetFont( MFontManager::Get( pFont->m_szName)); // ¿ø·¡ ÆùÆ®·Î º¹±¸ } }