void Mint::DrawIndicator(MDrawContext* pDC, MRECT& r) { MFont* pFont = pDC->GetFont(); int nFontHeight = pFont->GetHeight(); // ÇØ´ç ¾ð¾î¿¡ µû¶ó Ç¥±â const char* szLanguageIndicator = GetLanguageIndicatorString(); int nIdicatorWidth = pFont->GetWidth(szLanguageIndicator); MCOLOR c = pDC->GetColor(); MRECT fr(r.x+r.w-nIdicatorWidth-4, r.y+2, nIdicatorWidth+3, r.h-4); if(IsNativeIME()==true){ pDC->SetColor(MCOLOR(130,130,130)); pDC->FillRectangle(fr); pDC->SetColor(MCOLOR(0, 0, 0)); pDC->Text(r.x+r.w-nIdicatorWidth-2, r.y + (r.h-nFontHeight)/2, szLanguageIndicator); } else{ // pDC->SetColor(MCOLOR(0, 0, 0)); // pDC->FillRectangle(fr); // pDC->SetColor(MCOLOR(DEFCOLOR_NORMAL)); } // pDC->Text(r.x+r.w-nIdicatorWidth-2, r.y + (r.h-nFontHeight)/2, szLanguageIndicator); pDC->SetColor(c); }
void ZToolTip::SetBounds(void) { MFont* pFont = GetFont(); char szName[MWIDGET_NAME_LENGTH]; RemoveAnd(szName, m_bUseParentName==true?GetParent()->m_szName:m_szName); int nWidth = pFont->GetWidthWithoutAmpersand(szName); int nHeight = pFont->GetHeight(); int x, y; GetPosAlignedWithParent(x, y, nWidth, nHeight); // 최소사이즈 16 size bitmap 일경우.. 32x32 규정? int w = max(nWidth+ZTOOLTIP_WIDTH_GAP*2,32); int h = max(nHeight+ZTOOLTIP_HEIGHT_GAP*2,32); if(w) { // int line = (w / (ZTOOLTIP_MAX_W-20))+1; int _max=0; int line = GetLineCount( szName , _max ); int _max_w = MAX_TOOLTIP_LINE_STRING*(pFont->GetWidth("b")); if(line) { w = _max_w; h = h + ((nHeight + ZTOOLTIP_LINE_GAP) * line); } // else w = min(w,_max_w); } MWidget::SetBounds(MRECT(x-ZTOOLTIP_WIDTH_GAP, y-ZTOOLTIP_HEIGHT_GAP,w,h)); }
// ¸ÖƼ¶óÀÎ Áö¿øÀ» À§ÇØ ±ÛÀÚ ´ÜÀ§ Ãâ·Â int Mint::DrawCompositionAttribute(MDrawContext* pDC, MPOINT& p, const char* szComposition, int i) { if(i>=(int)strlen(szComposition)) return 0; //if(pMint->GetPrimaryLanguageIdentifier()!=LANG_JAPANESE) return; const BYTE* pCompAttr = GetCompositionAttributes(); DWORD nCompAttrSize = GetCompositionAttributeSize(); if(i>=(int)nCompAttrSize) return 0; // Composition Attribute ¹üÀ§¸¦ ¹þ¾î³ª´Â °æ¿ì MFont* pFont = pDC->GetFont(); int nFontHeight = pFont->GetHeight(); MCOLOR c = pDC->GetColor(); int nCharSize = 1; bool bTwoByteChar = IsHangul(szComposition[i]); if(bTwoByteChar) nCharSize = 2; int nWidth = pFont->GetWidth(&(szComposition[i]), nCharSize); if(pCompAttr[i]==ATTR_TARGET_CONVERTED) // º¯È¯µÉ ³»¿ë pDC->SetColor(MCOLOR(255, 0, 0, 128)); else if(pCompAttr[i]==ATTR_TARGET_NOTCONVERTED) // º¯È¯µÇÁö ¾Ê´Â ³»¿ë pDC->SetColor(MCOLOR(0, 196, 0, 128)); else // º¯È¯ °¡´É Àý pDC->SetColor(MCOLOR(128, 128, 128, 128)); pDC->FillRectangle(p.x, p.y, nWidth, nFontHeight); pDC->SetColor(c); return nWidth; }
int MMenuItem::GetHeight() { MFont* pFont = GetFont(); return pFont->GetHeight() + MENUITEM_MARGIN_Y; return GetClientRect().h; }