From: Leon W. <moo...@us...> - 2005-01-27 13:46:24
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9689 Modified Files: AnyEdit.cpp AnyEditDoc.cpp AnyEditView.cpp WorkspaceTreeCtrl.cpp Log Message: Changed the File Dialog code to make use of the new Default File Filter functions in the FileTypeManager. Index: WorkspaceTreeCtrl.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceTreeCtrl.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** WorkspaceTreeCtrl.cpp 2 Dec 2004 18:36:45 -0000 1.15 --- WorkspaceTreeCtrl.cpp 27 Jan 2005 13:46:08 -0000 1.16 *************** *** 424,431 **** CString str; ! if (!theApp.DoPromptFileName(str, _T("Choose files to add"), OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetLanguageNrFromExtension(theApp.GetCurrentExt()))) return; --- 424,431 ---- CString str; ! if (!theApp.DoPromptFileName(str, _T("Choose files to add"), OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetFileDialogFilterDefault())) return; *************** *** 1106,1110 **** } ! BOOL CWorkspaceTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { if (CTreeCtrl::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) --- 1106,1110 ---- } ! BOOL CWorkspaceTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { if (CTreeCtrl::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** AnyEdit.cpp 4 Dec 2004 09:01:12 -0000 1.104 --- AnyEdit.cpp 27 Jan 2005 13:46:08 -0000 1.105 *************** *** 804,808 **** OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, GetFileTypeManager()->GetFileDialogFilter(), ! GetFileTypeManager()->GetLanguageNrFromExtension(GetCurrentExt()))) { CStringArray arrFiles; --- 804,808 ---- OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, GetFileTypeManager()->GetFileDialogFilter(), ! GetFileTypeManager()->GetFileDialogFilterDefault())) { CStringArray arrFiles; *************** *** 875,878 **** --- 875,883 ---- int nRet = pDlg->DoModal(); sTempFilename.ReleaseBuffer(); + + // Save the selected file filter + m_fileTypeManager.SetLastUsedFileFilter( pDlg->m_ofn.nFilterIndex ); + + // Check the return code. if (nRet != IDOK) { *************** *** 1323,1326 **** --- 1328,1332 ---- // Save the config file for the user. m_ConfigFile.SetFilename( szUserFileName ); + m_ConfigFile.SetModified( true ); if( !m_ConfigFile.Save() ) return FALSE; } Index: AnyEditDoc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** AnyEditDoc.cpp 8 Dec 2004 10:40:09 -0000 1.49 --- AnyEditDoc.cpp 27 Jan 2005 13:46:08 -0000 1.50 *************** *** 803,811 **** if (!theApp.DoPromptFileName( newName, ! "Save file", ! OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST, FALSE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetLanguageNrFromExtension(theApp.GetCurrentExt()), (theApp.GetWorkspace()->GetCurrentProject() == NULL) ? NULL : &bAddToProject ) --- 803,811 ---- if (!theApp.DoPromptFileName( newName, ! "Save file", ! OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST, FALSE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetFileDialogFilterCurrentFile(), (theApp.GetWorkspace()->GetCurrentProject() == NULL) ? NULL : &bAddToProject ) *************** *** 851,855 **** } ! void CAnyEditDoc::OnFileClosenosave() { if (IsModified()) --- 851,855 ---- } ! void CAnyEditDoc::OnFileClosenosave() { if (IsModified()) *************** *** 858,862 **** } ! void CAnyEditDoc::OnUpdateFileClosenosave(CCmdUI* pCmdUI) { pCmdUI->Enable(IsModified()); --- 858,862 ---- } ! void CAnyEditDoc::OnUpdateFileClosenosave(CCmdUI* pCmdUI) { pCmdUI->Enable(IsModified()); *************** *** 870,874 **** /// Save current document to another file and remove old file. ! void CAnyEditDoc::OnFileMove() { BOOL bAddToProject = FALSE; --- 870,874 ---- /// Save current document to another file and remove old file. ! void CAnyEditDoc::OnFileMove() { BOOL bAddToProject = FALSE; *************** *** 878,886 **** if (!theApp.DoPromptFileName( newName, ! "Move file", ! OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST, FALSE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetLanguageNrFromExtension(theApp.GetCurrentExt()), (theApp.GetWorkspace()->GetCurrentProject() == NULL) ? NULL : &bAddToProject ) --- 878,886 ---- if (!theApp.DoPromptFileName( newName, ! "Move file", ! OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST, FALSE, theApp.GetFileTypeManager()->GetFileDialogFilter(), ! theApp.GetFileTypeManager()->GetFileDialogFilterCurrentFile(), (theApp.GetWorkspace()->GetCurrentProject() == NULL) ? NULL : &bAddToProject ) *************** *** 910,914 **** /// Only existing files can moved. ! void CAnyEditDoc::OnUpdateFileMove(CCmdUI* pCmdUI) { pCmdUI->Enable(! GetPathName().IsEmpty()); --- 910,914 ---- /// Only existing files can moved. ! void CAnyEditDoc::OnUpdateFileMove(CCmdUI* pCmdUI) { pCmdUI->Enable(! GetPathName().IsEmpty()); *************** *** 916,920 **** /// Toggle read only of a document. ! void CAnyEditDoc::OnFileReadonly() { CAnyEditView* pView = GetFirstEditView(); --- 916,920 ---- /// Toggle read only of a document. ! void CAnyEditDoc::OnFileReadonly() { CAnyEditView* pView = GetFirstEditView(); *************** *** 951,959 **** * document is read only. */ ! void CAnyEditDoc::OnUpdateFileReadonly(CCmdUI* pCmdUI) { if (IsFileReadOnly()) pCmdUI->Enable(FALSE); ! else pCmdUI->Enable(TRUE); --- 951,959 ---- * document is read only. */ ! void CAnyEditDoc::OnUpdateFileReadonly(CCmdUI* pCmdUI) { if (IsFileReadOnly()) pCmdUI->Enable(FALSE); ! else pCmdUI->Enable(TRUE); *************** *** 969,973 **** /// Reload current open file ! void CAnyEditDoc::OnFileReload() { if (GetPathName().IsEmpty()) --- 969,973 ---- /// Reload current open file ! void CAnyEditDoc::OnFileReload() { if (GetPathName().IsEmpty()) *************** *** 979,983 **** /// Reload works only on existing files which are modified ! void CAnyEditDoc::OnUpdateFileReload(CCmdUI* pCmdUI) { pCmdUI->Enable(! GetPathName().IsEmpty() && IsModified()); --- 979,983 ---- /// Reload works only on existing files which are modified ! void CAnyEditDoc::OnUpdateFileReload(CCmdUI* pCmdUI) { pCmdUI->Enable(! GetPathName().IsEmpty() && IsModified()); Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** AnyEditView.cpp 4 Dec 2004 08:34:43 -0000 1.86 --- AnyEditView.cpp 27 Jan 2005 13:46:08 -0000 1.87 *************** *** 150,156 **** ON_COMMAND(ID_SEARCH_FINDPREVWORD, OnSearchFindprevword) ON_COMMAND(ID_EDIT_CLEAR, OnEditClear) ! ON_UPDATE_COMMAND_UI(ID_INDICATOR_LINECOL, OnUpdateLineCol) ! ON_UPDATE_COMMAND_UI(ID_INDICATOR_FTYPE, OnUpdateFType) ! ON_UPDATE_COMMAND_UI(ID_INDICATOR_EOLMODE, OnUpdateEOLMode) ON_UPDATE_COMMAND_UI(ID_INDICATOR_OVR, OnUpdateOverwrite) ON_UPDATE_COMMAND_UI(ID_INDICATOR_READ, OnUpdateReadOnly) --- 150,156 ---- ON_COMMAND(ID_SEARCH_FINDPREVWORD, OnSearchFindprevword) ON_COMMAND(ID_EDIT_CLEAR, OnEditClear) [...1324 lines suppressed...] pCmdUI->Enable(! m_Scintilla.GetReadOnly()); --- 2873,2877 ---- /// Insert text into lines is available only, when document is not read only. ! void CAnyEditView::OnUpdateEditAdvancedInsertTextIntoLines(CCmdUI* pCmdUI) { pCmdUI->Enable(! m_Scintilla.GetReadOnly()); *************** *** 2879,2883 **** /// Replace is available only, when document is not read only. ! void CAnyEditView::OnUpdateSearchFindreplace(CCmdUI* pCmdUI) { pCmdUI->Enable(! m_Scintilla.GetReadOnly()); --- 2879,2883 ---- /// Replace is available only, when document is not read only. ! void CAnyEditView::OnUpdateSearchFindreplace(CCmdUI* pCmdUI) { pCmdUI->Enable(! m_Scintilla.GetReadOnly()); |