////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFontBold // // Description: Sets Font Style // // INPUTS: TRUE of FALSE // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFontBold(BOOL bBold) { m_lf.lfWeight = bBold ? FW_BOLD : FW_NORMAL; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFont // // Description: Sets font with LOGFONT structure // // INPUTS: LOGFONT structure // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFont(LOGFONT lf) { CopyMemory(&m_lf, &lf, sizeof(m_lf)); ReconstructFont(); UpdateSurface(); return *this; }
void CLabel::SetFontRotation(int iAngle) { m_iAngle = iAngle; m_lf.lfEscapement = m_lf.lfOrientation = (m_iAngle * 10); ReconstructFont(); Redraw(); }
CLabel& CLabel::SetFontSize(int nSize) { m_lf.lfHeight = -MulDiv(nSize, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72); ReconstructFont(); RedrawWindow(); return *this; }
CLabel& CLabel::SetFontBold(BOOL bBold) { m_lf.lfWeight = bBold ? FW_BOLD : FW_NORMAL; ReconstructFont(); RedrawWindow(); return *this; }
CLabel& CLabel::SetFontName(const CString& strFont) { strcpy(m_lf.lfFaceName,strFont); ReconstructFont(); RedrawWindow(); return *this; }
CLabel& CLabel::SetFontUnderline(BOOL bSet) { m_lf.lfUnderline = bSet; ReconstructFont(); RedrawWindow(); return *this; }
CLabel& CLabel::SetFontItalic(BOOL bSet) { m_lf.lfItalic = bSet; ReconstructFont(); RedrawWindow(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFontUnderline // // Description: Sets font underline attribue // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFontUnderline(BOOL bSet) { m_lf.lfUnderline = bSet; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFontItalic // // Description: Sets font italic attribue // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFontItalic(BOOL bSet) { m_lf.lfItalic = bSet; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::SetFontUnderline // // Description: Sets font underline attribue // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 26/08/98 1.0 Origin // ////////////////////////////////////////////////////////////////////////// CLabel& CLabel::SetFontUnderline(BOOL bSet) { m_lf.lfUnderline = bSet; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabelStatic::SetFontBold // // Description: Sets the font ot bold // // INPUTS: True or false // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 22/10/98 1.0 Origin // ////////////////////////////////////////////////////////////////////////// CLabelStatic& CLabelStatic::SetFontBold(BOOL bBold) { m_lf.lfWeight = bBold ? FW_BOLD : FW_NORMAL; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabelStatic::SetFont // // Description: Sets font with LOGFONT structure // // INPUTS: // // RETURNS: // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 02072002 1.6 Origin ////////////////////////////////////////////////////////////////////////// CLabelStatic& CLabelStatic::SetFont(LOGFONT lf) { CopyMemory(&m_lf, &lf, sizeof(m_lf)); ReconstructFont(); UpdateSurface(); return *this; }
CLabel& CLabel::SetFontSize(int nSize) { nSize*=-1; m_lf.lfHeight = nSize; ReconstructFont(); RedrawWindow(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::SetFontItalic // // Description: Sets font italic attribute // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 26/08/98 1.0 Origin // ////////////////////////////////////////////////////////////////////////// CLabel& CLabel::SetFontItalic(BOOL bSet) { m_lf.lfItalic = bSet; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::PreSubclassWindow // // Description: Assigns default dialog font // // INPUTS: // // RETURNS: // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 15092000 1.5 Origin ////////////////////////////////////////////////////////////////////////// void CLabel::PreSubclassWindow() { CStatic::PreSubclassWindow(); GetFont()->GetObject(sizeof(m_lf),&m_lf); ReconstructFont(); }
////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFontName // // Description: Sets the fonts face name // // INPUTS: String containing font name // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFontName(const CString& strFont, BYTE byCharSet) { m_lf.lfCharSet = byCharSet; _tcscpy(m_lf.lfFaceName,strFont); ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::SetFontName // // Description: Sets the fonts face name // // INPUTS: String containing font name // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 26/08/98 1.0 Origin // NT ALMOND 15092000 1.5 Support internation windows ////////////////////////////////////////////////////////////////////////// CLabel& CLabel::SetFontName(const CString& strFont, BYTE byCharSet /* Default = ANSI_CHARSET */) { m_lf.lfCharSet = byCharSet; _tcscpy(m_lf.lfFaceName,strFont); ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CTCGroupBox::SetFontSize // // Description: Sets font size attribue // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // // Name Date Version Comments // Jack Jin 2003-12-03 1.0 Origin ////////////////////////////////////////////////////////////////////////// CTCGroupBox& CTCGroupBox::SetFontSize(int nSize) { CFont cf; LOGFONT lf; cf.CreatePointFont(nSize * 10, m_lf.lfFaceName); cf.GetLogFont(&lf); m_lf.lfHeight = lf.lfHeight; m_lf.lfWidth = lf.lfWidth; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::PreSubclassWindow // // Description: Assigns default dialog font // // INPUTS: // // RETURNS: // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 15092000 1.5 Origin // NT ALMOND 02072002 1.6 Fix crash when GetFont returns NULL ////////////////////////////////////////////////////////////////////////// void CLabel::PreSubclassWindow() { CStatic::PreSubclassWindow(); CFont* cf = GetFont(); if(cf !=NULL) { cf->GetObject(sizeof(m_lf),&m_lf); } else { GetObject(GetStockObject(SYSTEM_FONT),sizeof(m_lf),&m_lf); } ReconstructFont(); }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::SetFontSize // // Description: Sets the font size // // INPUTS: True of false // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 26/08/98 1.0 Origin // ////////////////////////////////////////////////////////////////////////// CLabel& CLabel::SetFontSize(int nSize) { CFont cf; LOGFONT lf; cf.CreatePointFont(nSize * 10, m_lf.lfFaceName); cf.GetLogFont(&lf); m_lf.lfHeight = lf.lfHeight; m_lf.lfWidth = lf.lfWidth; // nSize*=-1; // m_lf.lfHeight = nSize; ReconstructFont(); UpdateSurface(); return *this; }
////////////////////////////////////////////////////////////////////////// // // Function: CLabel::SetRotationAngle // // Description: Sets the rotation angle for the current font. // // INPUTS: Angle in Degress // // RETURNS: Reference to 'this' object // // NOTES: // // MODIFICATIONS: // // Name Date Version Comments // NT ALMOND 22/10/98 1.0 Origin // ////////////////////////////////////////////////////////////////////////// CLabel& CLabel::SetRotationAngle(UINT nAngle,BOOL bRotation) { // Arrrrh... // Your looking in here why the font is rotating, aren't you? // Well try setting the font name to 'Arial' or 'Times New Roman' // Make the Angle 180 and set bRotation to true. // // Font rotation _ONLY_ works with TrueType fonts... // // m_lf.lfEscapement = m_lf.lfOrientation = (nAngle * 10); m_bRotation = bRotation; ReconstructFont(); UpdateSurface(); return *this; }
void CTCGroupBox::PreSubclassWindow() { // TODO: Add your specialized code here and/or call the base class CButton::PreSubclassWindow(); //modified the style to avoid text overlap when press tab ModifyStyle(0, BS_ICON); // Get Defalut Font CFont* cf = GetFont(); if(cf !=NULL) { cf->GetObject(sizeof(m_lf),&m_lf); } else { GetObject(GetStockObject(SYSTEM_FONT),sizeof(m_lf),&m_lf); } ReconstructFont(); }
void CRoundSliderCtrl::SetFontItalic(const bool bSet) { m_lf.lfItalic = bSet; ReconstructFont(); }
void CLabel::SetFontUnderline(bool bSet) { m_lf.lfUnderline = bSet; ReconstructFont(); Redraw(); }
void CLabel::SetFontItalic(bool bSet) { m_lf.lfItalic = bSet; ReconstructFont(); Redraw(); }
void CRoundSliderCtrl::SetFontBold(const bool bSet) { m_lf.lfWeight = bSet; ReconstructFont(); }
void CRoundSliderCtrl::SetFontUnderline(const bool bSet) { m_lf.lfUnderline = bSet; ReconstructFont(); }
void CRoundSliderCtrl::SetFontName(const CString& strFont) { strcpy(m_lf.lfFaceName, strFont); ReconstructFont(); }
void CRoundSliderCtrl::SetFontSize(const int nSize) { m_lf.lfHeight = -nSize; ReconstructFont(); }