miscellaneous wxFont enhancements (patch 1496606):

- made SetFaceName() bool and return false if the face name is not available
- corrected To/FromUserString() to complement each other


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-29 00:03:36 +00:00
parent 7aa7d2d407
commit 85ab460e7d
31 changed files with 378 additions and 104 deletions

View File

@@ -195,12 +195,13 @@ public:
m_nWeight = nWeight;
}
inline void SetFaceName(const wxString& sFaceName)
inline bool SetFaceName(const wxString& sFaceName)
{
if (m_bNativeFontInfoOk)
m_vNativeFontInfo.SetFaceName(sFaceName);
return m_vNativeFontInfo.SetFaceName(sFaceName);
else
m_sFaceName = sFaceName;
return true;
}
inline void SetUnderlined(bool bUnderlined)
@@ -689,11 +690,12 @@ void wxNativeFontInfo::SetUnderlined(
fa.fsSelection |= FATTR_SEL_UNDERSCORE;
} // end of wxNativeFontInfo::SetUnderlined
void wxNativeFontInfo::SetFaceName(
bool wxNativeFontInfo::SetFaceName(
const wxString& sFacename
)
{
wxStrncpy((wxChar*)fa.szFacename, sFacename, WXSIZEOF(fa.szFacename));
return true;
} // end of wxNativeFontInfo::SetFaceName
void wxNativeFontInfo::SetFamily(
@@ -1023,15 +1025,17 @@ void wxFont::SetWeight(
RealizeResource();
} // end of wxFont::SetWeight
void wxFont::SetFaceName(
bool wxFont::SetFaceName(
const wxString& rsFaceName
)
{
Unshare();
M_FONTDATA->SetFaceName(rsFaceName);
bool refdataok = M_FONTDATA->SetFaceName(rsFaceName);
RealizeResource();
return refdataok && wxFontBase::SetFaceName(rsFaceName);
} // end of wxFont::SetFaceName
void wxFont::SetUnderlined(