¾È³çÇϼ¼¿ä. Ÿ¶ôõ»ç ÀÔ´Ï´Ù.
Delphi7 ¿¡¼ ÀϺ»¾î¿Í Áß±¹¾î°¡ ±úÁ® ³ª¿ÀÁö¸¸, Internet Explorer ¿¡¼´Â ÀϺ»¾îÆÑ°ú Áß±¹¾îÆÑÀ» ¼³Ä¡ ÇÏÁö ¾Ê¾Æµµ ÀϺ»¾î¿Í Áß±¹¾î »çÀÌÆ®°¡ ³ª¿É´Ï´Ù.
ÅؽºÆ®¸¦ ¾µ¶§ Unicode·Î ¾²´Â ÇÔ¼ö DrawTextW() ·Î ¾²¸é ÀϺ»¾î¿Í Áß±¹¾î°¡ ±úÁöÁö ¾Ê°í ³ª¿É´Ï´Ù.
DrawTextW() ´Â DrawText() ¿Í »ç¿ë¹æ¹ýÀÌ µ¿ÀÏÇÕ´Ï´Ù.
Delphi7 ÀÇ ÄÄÆ÷³ÍÆ®´Â ÅؽºÆ® Ç¥½Ã ÇÒ ¶§ DrawText ¸¦ ¾²±â ¶§¹®¿¡ ±ÛÀÚ°¡ ±úÁý´Ï´Ù. ´ëÇ¥ÀûÀ¸·Î TLabel ÀÌ ÀÖ½À´Ï´Ù.
TLabel À» »ó¼Ó¹Þ¾Æ DrawText() È£Ãâ ÇÔ¼ö¸¸ DrawTextW() È£Ãâ·Î º¯°æ ÇϽõ簡, ´Ù½Ã ¸¸µå½Ãµç°¡ ÇÏ¸é µË´Ï´Ù.
Ç¥½Ã´Â À¯´ÏÄÚµå·Î ÇÏ¸é µÇÁö¸¸...
ÀÔ·Â ¹ÞÀ» ¶§´Â ´ç¿¬È÷ ¾ð¾î ÆÑÀÌ ÀÖ¾î¾ß ÇÕ´Ï´Ù. ¿¡µðÆ®¿¡ ÀϺ»¾î¸¦ ¾²·Á¸é ÀϺ»¾î ¾ð¾îÆÑÀÌ ¼³Ä¡ µÇ¾î¾ß ÇÕ´Ï´Ù.
¾Æ·¡´Â Á¦ TLabel ÄÄÆ÷¿¡¼ ¾²´Â ºÎºÐ
// Draw Caption Canvas.Brush.Style := bsClear; if FShowCaption then // ĸ¼ÇÀÌ ÀÖÀ¸¸é begin sText := xyReplaceW('#13#10', #13#10, FCaption); // ÅؽºÆ®ÀÇ "#13#10" À» #13#10 À¸·Î º¯È¯
Canvas.Font.Assign(Font); if not Enabled then Canvas.Font.Color := FColorDisable;
// ±âº» ÀÎÀÚ DrawStyle := DT_EXPANDTABS or DT_EDITCONTROL or WORD_WRAP_TEXT[FWordWrap] or ALIGNMENT_TEXT[FAlignment] or WORD_ELLIPSIS_TEXT[FWordEllipsis];
// ÀÇ¹Ì ¾ø´Ù. ¾ð¾î¸¦ ¿ÞÂʺÎÅÍ ¾µ±î, ¿À¸¥ÂÊ ºÎÅÍ ¾µ°¡ ¿©ºÎ´Ù. ¾Æ¶ø¿¡¼± ¿À¸¥ÂʺÎÅÍ ¾´´Ù. DrawStyle := DrawTextBiDiModeFlags(DrawStyle); CalcRect := MyRect;
// Á¿ì Á¤·ÄÀº °è»ê ÇÑ´Ù. if FAlignment = taLeftJustify then MyRect.Left := MyRect.Left + FSpaces[0] else if FAlignment = taRightJustify then MyRect.Right := MyRect.Right - FSpaces[0];
// À§ ¾Æ·¡ Á¤·ÄÀº ÀÎÀÚ·Î DT_CALCRECT ¸¦ ³Ö¾î ¾ò´Â´Ù. case FLayout of tlTop: MyRect.Top := MyRect.Top + FSpaces[1]; tlCenter: begin DrawTextW(Canvas.Handle, PWideChar(sText), Length(sText), CalcRect, DrawStyle or DT_CALCRECT); OffsetRect(MyRect, 0, ((SrcRect.Bottom - CalcRect.Bottom) div 2) + FSpaces[1]); end; tlBottom: begin DrawTextW(Canvas.Handle, PWideChar(sText), Length(sText), CalcRect, DrawStyle or DT_CALCRECT); OffsetRect(MyRect, 0, SrcRect.Bottom - CalcRect.Bottom - FSpaces[1]); end; end;
// Á¤ÇØÁø ¿µ¿ª¿¡ Unicode ¸¦ ±×¸°´Ù. DrawTextW(Canvas.Handle, PWideChar(sText), Length(sText), MyRect, DrawStyle); end;
|