本文整理汇总了C++中TFont::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ TFont::GetHeight方法的具体用法?C++ TFont::GetHeight怎么用?C++ TFont::GetHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFont
的用法示例。
在下文中一共展示了TFont::GetHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOuterSizes
//
/// Respond to the virtual call to let this gadget's Window know how big this
/// text gadget wants to be based on the text size.
//
/// If shrink-wrapping is requested, GetDesiredSize returns the size needed to
/// accommodate the borders, margins, and text; otherwise, if shrink-wrapping is not
/// requested, it returns the gadget's current width and height.
//
void
TTextGadget::GetDesiredSize(TSize& size)
{
TGadget::GetDesiredSize(size);
TFont* font = Font;
if (font == 0)
font = &(GetGadgetWindow()->GetFont());
if (font == 0)
return;
if (ShrinkWrapWidth)
size.cx += font->GetTextExtent(Text).cx;
else {
int left, right, top, bottom;
GetOuterSizes(left, right, top, bottom);
int newW = font->GetMaxWidth() * NumChars;
size.cx += newW + left + right - Bounds.Width(); // Old bounds already considered
}
if (ShrinkWrapHeight)
size.cy += font->GetHeight() + 2;
}