本文整理汇总了C++中wxFont::GetStrikethrough方法的典型用法代码示例。如果您正苦于以下问题:C++ wxFont::GetStrikethrough方法的具体用法?C++ wxFont::GetStrikethrough怎么用?C++ wxFont::GetStrikethrough使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxFont
的用法示例。
在下文中一共展示了wxFont::GetStrikethrough方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoChangeFont
void MyFrame::DoChangeFont(const wxFont& font, const wxColour& col)
{
m_canvas->SetTextFont(font);
if ( col.IsOk() )
m_canvas->SetColour(col);
m_canvas->Refresh();
m_textctrl->SetFont(font);
if ( col.IsOk() )
m_textctrl->SetForegroundColour(col);
m_textctrl->Refresh();
// update the state of the bold/italic/underlined menu items
wxMenuBar *mbar = GetMenuBar();
if ( mbar )
{
mbar->Check(Font_Light, font.GetWeight() == wxFONTWEIGHT_LIGHT);
mbar->Check(Font_Bold, font.GetWeight() == wxFONTWEIGHT_BOLD);
mbar->Check(Font_Italic, font.GetStyle() == wxFONTSTYLE_ITALIC);
#ifndef __WXMSW__
mbar->Check(Font_Slant, font.GetStyle() == wxFONTSTYLE_SLANT);
#endif
mbar->Check(Font_Underlined, font.GetUnderlined());
mbar->Check(Font_Strikethrough, font.GetStrikethrough());
}
}
示例2: IsSameAs
bool wxFontBase::operator==(const wxFont& font) const
{
// either it is the same font, i.e. they share the same common data or they
// have different ref datas but still describe the same font
return IsSameAs(font) ||
(
IsOk() == font.IsOk() &&
GetPointSize() == font.GetPointSize() &&
// in wxGTK1 GetPixelSize() calls GetInternalFont() which uses
// operator==() resulting in infinite recursion so we can't use it
// in that port
#if !defined(__WXGTK__) || defined(__WXGTK20__)
GetPixelSize() == font.GetPixelSize() &&
#endif
GetFamily() == font.GetFamily() &&
GetStyle() == font.GetStyle() &&
GetWeight() == font.GetWeight() &&
GetUnderlined() == font.GetUnderlined() &&
GetStrikethrough() == font.GetStrikethrough() &&
GetFaceName().IsSameAs(font.GetFaceName(), false) &&
GetEncoding() == font.GetEncoding()
);
}
示例3: GetFontAttributes
// Get attributes from font.
bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags)
{
if (!font.IsOk())
return false;
// If we pass both pixel and point size attributes, this is an indication
// to choose the most appropriate units.
if ((flags & wxTEXT_ATTR_FONT) == wxTEXT_ATTR_FONT)
{
if (font.IsUsingSizeInPixels())
{
m_fontSize = font.GetPixelSize().y;
flags &= ~wxTEXT_ATTR_FONT_POINT_SIZE;
}
else
{
m_fontSize = font.GetPointSize();
flags &= ~wxTEXT_ATTR_FONT_PIXEL_SIZE;
}
}
else if (flags & wxTEXT_ATTR_FONT_POINT_SIZE)
{
m_fontSize = font.GetPointSize();
flags &= ~wxTEXT_ATTR_FONT_PIXEL_SIZE;
}
else if (flags & wxTEXT_ATTR_FONT_PIXEL_SIZE)
{
m_fontSize = font.GetPixelSize().y;
}
if (flags & wxTEXT_ATTR_FONT_ITALIC)
m_fontStyle = font.GetStyle();
if (flags & wxTEXT_ATTR_FONT_WEIGHT)
m_fontWeight = font.GetWeight();
if (flags & wxTEXT_ATTR_FONT_UNDERLINE)
m_fontUnderlined = font.GetUnderlined();
if (flags & wxTEXT_ATTR_FONT_STRIKETHROUGH)
m_fontStrikethrough = font.GetStrikethrough();
if (flags & wxTEXT_ATTR_FONT_FACE)
m_fontFaceName = font.GetFaceName();
if (flags & wxTEXT_ATTR_FONT_ENCODING)
m_fontEncoding = font.GetEncoding();
if (flags & wxTEXT_ATTR_FONT_FAMILY)
{
// wxFont might not know its family, avoid setting m_fontFamily to an
// invalid value and rather pretend that we don't have any font family
// information at all in this case
const wxFontFamily fontFamily = font.GetFamily();
if ( fontFamily == wxFONTFAMILY_UNKNOWN )
flags &= ~wxTEXT_ATTR_FONT_FAMILY;
else
m_fontFamily = fontFamily;
}
m_flags |= flags;
return true;
}