From: boca4711 <boc...@us...> - 2005-10-16 12:18:09
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21866 Modified Files: FontPref.cpp FontPref.h Log Message: - Added case in keywords Index: FontPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FontPref.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FontPref.h 12 Oct 2005 18:55:57 -0000 1.8 --- FontPref.h 16 Oct 2005 12:17:57 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- // CFontPref dialog #include "SAPrefsSubDlg.h" + #include "MyComboBox.h" class CFontPref : public CSAPrefsSubDlg *************** *** 46,49 **** --- 47,51 ---- //{{AFX_DATA(CFontPref) enum { IDD = IDD_PREF_FONT }; + CMyComboBox m_ComboCase; CButton m_Underline; CButton m_Italic; *************** *** 65,68 **** --- 67,71 ---- CMap<int,int,BOOL,BOOL> mapItalic; CMap<int,int,BOOL,BOOL> mapUnderline; + CMap<int,int,int,int> mapCase; protected: *************** *** 99,102 **** --- 102,106 ---- afx_msg void OnCheckUnderline(); afx_msg void OnButtonToAllStyles(); + afx_msg void OnSelchangeComboCase(); //}}AFX_MSG DECLARE_MESSAGE_MAP() Index: FontPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FontPref.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FontPref.cpp 25 Sep 2004 13:10:08 -0000 1.11 --- FontPref.cpp 16 Oct 2005 12:17:57 -0000 1.12 *************** *** 52,55 **** --- 52,56 ---- CSAPrefsSubDlg::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFontPref) + DDX_Control(pDX, IDC_COMBO_CASE, m_ComboCase); DDX_Control(pDX, IDC_CHECK_UNDERLINE, m_Underline); DDX_Control(pDX, IDC_CHECK_ITALIC, m_Italic); *************** *** 78,81 **** --- 79,83 ---- ON_BN_CLICKED(IDC_CHECK_UNDERLINE, OnCheckUnderline) ON_BN_CLICKED(IDC_BUTTON_TOALLSTYLES, OnButtonToAllStyles) + ON_CBN_SELCHANGE(IDC_COMBO_CASE, OnSelchangeComboCase) //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 158,161 **** --- 160,164 ---- mapItalic.SetAt( iCount, m_pSyntaxFile->GetStyleFontItalic( iCount ) ); mapUnderline.SetAt( iCount, m_pSyntaxFile->GetStyleFontUnderline( iCount ) ); + mapCase.SetAt( iCount, m_pSyntaxFile->GetStyleCase( iCount ) ); ++ iNrOfStyles; } *************** *** 197,200 **** --- 200,204 ---- CString szTemp; BOOL bCheck; + int iCase; // Set Font name and size *************** *** 214,217 **** --- 218,226 ---- mapUnderline.Lookup( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), bCheck ); m_Underline.SetCheck( bCheck ); + + mapCase.Lookup( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), iCase ); + m_ComboCase.SetCurSel(iCase); + + UpdateSampleText(); } *************** *** 389,392 **** --- 398,402 ---- int iCount; int iStyleNumber; + int iCase; BOOL bBold; BOOL bItalic; *************** *** 411,414 **** --- 421,425 ---- mapItalic.Lookup( iStyleNumber, bItalic ); mapUnderline.Lookup( iStyleNumber, bUnderline ); + mapCase.Lookup( iStyleNumber, iCase ); // Change the values in the SyntaxFile object *************** *** 418,421 **** --- 429,433 ---- m_pSyntaxFile->SetStyleFontItalic( iStyleNumber, bItalic ? true : false ); m_pSyntaxFile->SetStyleFontUnderline( iStyleNumber, bUnderline ? true : false ); + m_pSyntaxFile->SetStyleCase( iStyleNumber, iCase ); } return bChanged; *************** *** 426,429 **** --- 438,442 ---- CString szListFontName; CString szListFontSize; + CString szSampleText = _T("Sample Text"); // Get the fontname and fontsize from the listboxes *************** *** 440,442 **** --- 453,473 ---- // Change the font of the Sample Text m_SampleText.SetFont( &m_fontSampleText ); + + if (m_ComboCase.GetCurSel() == 1) + szSampleText.MakeUpper(); + if (m_ComboCase.GetCurSel() == 2) + szSampleText.MakeLower(); + m_SampleText.SetWindowText(szSampleText); + } + + void CFontPref::OnSelchangeComboCase() + { + int iCase = m_ComboCase.GetCurSel(); + mapCase.SetAt( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), iCase ); + + // Update Sample Text + UpdateSampleText(); + + // Tell the parent something changed, so the apply button can be activated + NotifyParentOfChange(); } |