You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(30) |
Aug
(6) |
Sep
(3) |
Oct
(1) |
Nov
(13) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(17) |
Mar
(7) |
Apr
(10) |
May
(34) |
Jun
(17) |
Jul
(150) |
Aug
(59) |
Sep
(186) |
Oct
(57) |
Nov
(45) |
Dec
(22) |
2005 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(24) |
May
(10) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(35) |
Nov
(12) |
Dec
(1) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(1) |
Dec
|
From: <moo...@us...> - 2003-12-12 12:05:20
|
Update of /cvsroot/anyedit/AnyEditBin/Config/Default In directory sc8-pr-cvs1:/tmp/cvs-serv1019/Config/Default Added Files: AnyEdit.cfg Log Message: The new config and syntax files in XML format. The are needed for the sources with the new syntax handler. --- NEW FILE: AnyEdit.cfg --- <Config> <Languages>2</Languages> <Language number="0"> <Name>Default</Name> <SyntaxFile>default.syn</SyntaxFile> </Language> <Language number="1"> <Name>Cpp</Name> <SyntaxFile>cpp.syn</SyntaxFile> <AutoCompFile>cpp.acmp</AutoCompFile> <Extensions>c,C,cpp,h</Extensions> </Language> <Language number="2"> <Name>Java</Name> <SyntaxFile>java.syn</SyntaxFile> <AutoCompFile>java.acmp</AutoCompFile> <Extensions>java,jav</Extensions> </Language> </Config> |
From: <moo...@us...> - 2003-12-12 12:01:39
|
Update of /cvsroot/anyedit/AnyEditBin/Config/Default/Syntax In directory sc8-pr-cvs1:/tmp/cvs-serv597/Syntax Log Message: Directory /cvsroot/anyedit/AnyEditBin/Config/Default/Syntax added to the repository |
From: <moo...@us...> - 2003-12-12 12:00:28
|
Update of /cvsroot/anyedit/AnyEditBin/Config/Default In directory sc8-pr-cvs1:/tmp/cvs-serv403/Default Log Message: Directory /cvsroot/anyedit/AnyEditBin/Config/Default added to the repository |
From: <moo...@us...> - 2003-12-12 11:59:50
|
Update of /cvsroot/anyedit/AnyEditBin/Config In directory sc8-pr-cvs1:/tmp/cvs-serv32701/Config Log Message: Directory /cvsroot/anyedit/AnyEditBin/Config added to the repository |
From: <moo...@us...> - 2003-12-12 11:00:08
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv25750 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEdit.h AnyEditDoc.cpp AnyEditDoc.h AnyEditView.cpp AnyEditView.h Language.cpp Added Files: ConfigFile.cpp ConfigFile.h SyntaxFile.cpp SyntaxFile.h Log Message: - The new Syntax File handling implemented. - Syntax files now XML. - New handling of Scintilla settings - New handling of the Language type of a document - New Config file with AnyEdit settings in XML format, will replace Registry settings. - Some multi used constants converted to defines. - Changed menu handling for all 3 margins. - Changed menu handling for bookmarks. More additions needed, will be implemented in the future. Cleanup is also still needed. --- NEW FILE: ConfigFile.cpp --- // ConfigFile.cpp: implementation of the CConfigFile class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" //#include "anyedit.h" #include "ConfigFile.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CConfigFile::CConfigFile() { szFileName = ""; } CConfigFile::~CConfigFile() { } // Set the Filename of the config file to parse. void CConfigFile::SetFilename( CString lszFileName ) { szFileName = lszFileName; } // Parse the config file. BOOL CConfigFile::Parse() { if( szFileName.IsEmpty() ) return false; if( !xparser.parse_file( szFileName ) ) return false; return true; } // Save the config file, including changes. BOOL CConfigFile::Save() { return TRUE; } // Get the number of languages int CConfigFile::GetLanguageCount() { xml_node xnode; xnode = xparser.document(); if( xnode.empty() && !xnode.children() ) return -1; xnode = xnode.child(0); if( xnode.empty() && !xnode.children() ) return -1; xnode = xnode.first_element_by_name( TAG_LANGUAGES ); if( xnode.empty() && !xnode.children() ) return -1; return atoi( xnode.child(0).value() ); } // Get the name of the language with number iNumber. CString CConfigFile::GetLanguageName( int iNumber ) { char szNumber[4]; xml_node xnode; sprintf( szNumber, "%i", iNumber ); xnode = xparser.document().first_element_by_attribute( TAG_LANGUAGE, ATT_LANGUAGE_NUMBER, szNumber ); if( xnode.empty() && !xnode.children() ) return ""; xnode = xnode.first_element_by_name( TAG_LANGUAGE_NAME ); if( xnode.empty() && !xnode.children() ) return ""; return xnode.child(0).value(); } // Get the syntaxfile name of the language with number iNumber. CString CConfigFile::GetLanguageSyntaxFileName( int iNumber ) { char szNumber[4]; xml_node xnode; sprintf( szNumber, "%i", iNumber ); xnode = xparser.document().first_element_by_attribute( TAG_LANGUAGE, ATT_LANGUAGE_NUMBER, szNumber ); if( xnode.empty() && !xnode.children() ) return ""; xnode = xnode.first_element_by_name( TAG_LANGUAGE_SYNTAXFILE ); if( xnode.empty() && !xnode.children() ) return ""; return xnode.child(0).value(); } // Get the auto completion filename of the language with number iNumber. CString CConfigFile::GetLanguageAutoCompFileName( int iNumber ) { char szNumber[4]; xml_node xnode; sprintf( szNumber, "%i", iNumber ); xnode = xparser.document().first_element_by_attribute( TAG_LANGUAGE, ATT_LANGUAGE_NUMBER, szNumber ); if( xnode.empty() && !xnode.children() ) return ""; xnode = xnode.first_element_by_name( TAG_LANGUAGE_AUTOCOMPFILE ); if( xnode.empty() && !xnode.children() ) return ""; return xnode.child(0).value(); } // Get the extensions string of languge with number iNumber. CString CConfigFile::GetLanguageExtensions( int iNumber ) { char szNumber[4]; xml_node xnode; sprintf( szNumber, "%i", iNumber ); xnode = xparser.document().first_element_by_attribute( TAG_LANGUAGE, ATT_LANGUAGE_NUMBER, szNumber ); if( xnode.empty() && !xnode.children() ) return ""; xnode = xnode.first_element_by_name( TAG_LANGUAGE_EXTENSIONS ); if( xnode.empty() && !xnode.children() ) return ""; return xnode.child(0).value(); } --- NEW FILE: ConfigFile.h --- // ConfigFile.h: interface for the CConfigFile class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CONFIGFILE_H__F263D7F8_AAE8_424B_ACE1_05A20E187425__INCLUDED_) #define AFX_CONFIGFILE_H__F263D7F8_AAE8_424B_ACE1_05A20E187425__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "pugxml.h" using namespace std; using namespace pug; // Main config tag #define TAG_CONFIG "Config" // Config tags #define TAG_LANGUAGES "Languages" #define TAG_LANGUAGE "Language" // Language tags #define TAG_LANGUAGE_NAME "Name" #define TAG_LANGUAGE_SYNTAXFILE "SyntaxFile" #define TAG_LANGUAGE_AUTOCOMPFILE "AutoCompFile" #define TAG_LANGUAGE_EXTENSIONS "Extensions" // Language attributes #define ATT_LANGUAGE_NUMBER "number" // Defines for the Config paths and filename #define CONFIG_DIR "Config\\" #define DEFAULT_DIR "Default\\" #define SYNTAX_DIR "Syntax\\" // AnyEdit config file #define ANYEDIT_CONFIG_FILE "AnyEdit.cfg" class CConfigFile { protected: CString szFileName; xml_parser xparser; public: CConfigFile(); virtual ~CConfigFile(); // Set the Filename of the config file to parse. void SetFilename( CString lszFileName ); // Parse the config file. int Parse(); // Save the config file, including changes BOOL Save(); // Get the number of languages int GetLanguageCount(); // Get the name of the language with number iNumber. CString GetLanguageName( int iNumber ); // Get the syntaxfile name of the language with number iNumber. CString GetLanguageSyntaxFileName( int iNumber ); // Get the auto completion filename of the language with number iNumber. CString GetLanguageAutoCompFileName( int iNumber ); // Get the extensions string of languge with number iNumber. CString GetLanguageExtensions( int iNumber ); }; #endif // !defined(AFX_CONFIGFILE_H__F263D7F8_AAE8_424B_ACE1_05A20E187425__INCLUDED_) --- NEW FILE: SyntaxFile.cpp --- // SyntaxFile.cpp: implementation of the CSyntaxFile class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" //#include "anyedit.h" #include "SyntaxFile.h" #include <iostream> #include <fstream> #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif int CompareCString( CString s1, CString s2 ) { return s1.Compare( s2 ); } ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CSyntaxFile::CSyntaxFile() { int iCount; szFileName = ""; // Set the string compare functions for the CSortedArray's with keywords. for( iCount = 0; iCount < KEYWORDSET_MAX; ++ iCount ) { Keywords[iCount].SetCompareFunction( CompareCString ); } } CSyntaxFile::~CSyntaxFile() { } // Function to actually parse the synfile and the ability to check // if all goes well. BOOL CSyntaxFile::Parse() { int iCount; int iWordCount; char number[4]; xml_node tnode; if( szFileName.IsEmpty() ) return false; if( !xparser.parse_file( szFileName ) ) return false; // Read the keyword sets for( iCount = 0; iCount < KEYWORDSET_MAX; ++ iCount ) { sprintf( number, "%i", iCount ); tnode = xparser.document().first_element_by_attribute( TAG_KEYWORDS, ATT_KEYWORDS_SET, number );//(LPCTSTR)CString().Format( "%i", iCount ) ); if( tnode.empty() ) continue; for( iWordCount = 0; iWordCount < tnode.children(); ++ iWordCount ) { if( CString( tnode.child( iWordCount ).name() ) == TAG_KEYWORDS_WORD && tnode.child( iWordCount ).children() ) { Keywords[iCount].Add( CString( tnode.child( iWordCount ).child(0).value() ) ); } } } return true; } void CSyntaxFile::SetFilename( CString lszFileName ) { szFileName = lszFileName; } // Gets a String with all keywords out of iSet separated by cSep CString CSyntaxFile::GetDelimitedKeywordSet( int iSet, char cSep ) { int iCount; CString szDelimited; if( iSet < 0 || iSet >= KEYWORDSET_MAX ) return ""; if( 0 == Keywords[iSet].GetSize() ) return ""; for( iCount = 0; iCount < Keywords[iSet].GetSize(); ++ iCount ) { if( 0 != iCount ) { szDelimited += cSep; szDelimited += Keywords[iSet][iCount]; } else { szDelimited = Keywords[iSet][iCount]; } } return szDelimited; } // Gets a String with all keywords out of all sets separated by cSep CString CSyntaxFile::GetDelimitedKeywords( char cSep ) { int iCount; CString szDelimited; CSortedArray<CString, CString> AllKeywords; AllKeywords.SetCompareFunction( CompareCString ); for( iCount = 0; iCount < KEYWORDSET_MAX; ++ iCount ) { if( Keywords[iCount].GetSize() ) { AllKeywords.Append( Keywords[iCount] ); } } AllKeywords.Sort(); for( iCount = 0; iCount < AllKeywords.GetSize(); ++ iCount ) { if( 0 != iCount ) { szDelimited += cSep; szDelimited += AllKeywords[iCount]; } else { szDelimited = AllKeywords[iCount]; } } return szDelimited; } void CSyntaxFile::Save() { filebuf fb; xml_node xnode; fb.open( szFileName, ios::out ); ostream os(&fb); xnode = xparser.document(); if( xnode.empty() ) return; xnode.outer_xml( os ); fb.close(); } int CSyntaxFile::GetLexerNumber() { CString name; xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_LEXER ); if( xnode.empty() ) return -1; xnode = xnode.first_element_by_name( TAG_LEXER_NAME ); if( xnode.empty() && !xnode.children() ) return -1; name = xnode.child(0).value(); if( name == "SCLEX_CONTAINER" ) return SCLEX_CONTAINER; if( name == "SCLEX_NULL" ) return SCLEX_NULL; if( name == "SCLEX_PYTHON" ) return SCLEX_PYTHON; if( name == "SCLEX_CPP" ) return SCLEX_CPP; if( name == "SCLEX_HTML" ) return SCLEX_HTML; if( name == "SCLEX_XML" ) return SCLEX_XML; if( name == "SCLEX_PERL" ) return SCLEX_PERL; if( name == "SCLEX_SQL" ) return SCLEX_SQL; if( name == "SCLEX_VB" ) return SCLEX_VB; if( name == "SCLEX_PROPERTIES" ) return SCLEX_PROPERTIES; if( name == "SCLEX_ERRORLIST" ) return SCLEX_ERRORLIST; if( name == "SCLEX_MAKEFILE" ) return SCLEX_MAKEFILE; if( name == "SCLEX_XCODE" ) return SCLEX_XCODE; if( name == "SCLEX_LATEX" ) return SCLEX_LATEX; if( name == "SCLEX_LUA" ) return SCLEX_LUA; if( name == "SCLEX_DIFF" ) return SCLEX_DIFF; if( name == "SCLEX_CONF" ) return SCLEX_CONF; if( name == "SCLEX_PASCAL" ) return SCLEX_PASCAL; if( name == "SCLEX_AVE" ) return SCLEX_AVE; if( name == "SCLEX_ADA" ) return SCLEX_ADA; if( name == "SCLEX_LISP" ) return SCLEX_LISP; if( name == "SCLEX_RUBY" ) return SCLEX_RUBY; if( name == "SCLEX_EIFFEL" ) return SCLEX_EIFFEL; if( name == "SCLEX_EIFFELKW" ) return SCLEX_EIFFELKW; if( name == "SCLEX_TCL" ) return SCLEX_TCL; if( name == "SCLEX_NNCRONTAB" ) return SCLEX_NNCRONTAB; if( name == "SCLEX_BULLANT" ) return SCLEX_BULLANT; if( name == "SCLEX_VBSCRIPT" ) return SCLEX_VBSCRIPT; if( name == "SCLEX_ASP" ) return SCLEX_ASP; if( name == "SCLEX_PHP" ) return SCLEX_PHP; if( name == "SCLEX_BAAN" ) return SCLEX_BAAN; if( name == "SCLEX_MATLAB" ) return SCLEX_MATLAB; if( name == "SCLEX_SCRIPTOL" ) return SCLEX_SCRIPTOL; if( name == "SCLEX_ASM" ) return SCLEX_ASM; if( name == "SCLEX_CPPNOCASE" ) return SCLEX_CPPNOCASE; if( name == "SCLEX_FORTRAN" ) return SCLEX_FORTRAN; if( name == "SCLEX_F77" ) return SCLEX_F77; if( name == "SCLEX_CSS" ) return SCLEX_CSS; if( name == "SCLEX_POV" ) return SCLEX_POV; if( name == "SCLEX_LOUT" ) return SCLEX_LOUT; if( name == "SCLEX_ESCRIPT" ) return SCLEX_ESCRIPT; if( name == "SCLEX_PS" ) return SCLEX_PS; if( name == "SCLEX_NSIS" ) return SCLEX_NSIS; if( name == "SCLEX_MMIXAL" ) return SCLEX_MMIXAL; if( name == "SCLEX_CLW" ) return SCLEX_CLW; if( name == "SCLEX_CLWNOCASE" ) return SCLEX_CLWNOCASE; if( name == "SCLEX_LOT" ) return SCLEX_LOT; if( name == "SCLEX_YAML" ) return SCLEX_YAML; if( name == "SCLEX_TEX" ) return SCLEX_TEX; if( name == "SCLEX_METAPOST" ) return SCLEX_METAPOST; if( name == "SCLEX_POWERBASIC" ) return SCLEX_POWERBASIC; if( name == "SCLEX_FORTH" ) return SCLEX_FORTH; return -1; } int CSyntaxFile::GetLexerProperties( CMapStringToString& msts ) { int iCount; int iNrOfProperties; CString node_name; CString property_name; CString property_value; xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_LEXER ); if( xnode.empty() ) return 0; iNrOfProperties = 0; for( iCount = 0; iCount < xnode.children(); ++ iCount ) { node_name = xnode.child( iCount ).name(); if( node_name == TAG_LEXER_PROPERTY ) { if( xnode.child( iCount ).attributes() && xnode.child( iCount ).children() ) { xml_node::xml_attribute_iterator xattit( xnode.child( iCount ) ); property_name = xattit->value(); property_value = xnode.child( iCount ).child( 0 ).value(); msts.SetAt( property_name, property_value ); ++ iNrOfProperties; } } } return iNrOfProperties; } // Returns if SyntaxHighlighting is on. BOOL CSyntaxFile::GetSyntaxHighlighting() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_SYNTAXHIGHLIGHTING ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets the SyntaxHighlighting to true or false. BOOL CSyntaxFile::SetSyntaxHighlighting( BOOL bSyntaxHighlighting ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_SYNTAXHIGHLIGHTING ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bSyntaxHighlighting ? "1" : "0" ); } // Returns if WordWrap is on. BOOL CSyntaxFile::GetWordWrap() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_WORDWRAP ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets WordWrap to true or false. BOOL CSyntaxFile::SetWordWrap( BOOL bWordWrap ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_WORDWRAP ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bWordWrap ? "1" : "0" ); } // Get the tab/indentation width int CSyntaxFile::GetTabWidth() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_TABWIDTH ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ); } // Sets the tab/indentation width to iTabWidth. BOOL CSyntaxFile::SetTabWidth( int iTabWidth ) { xml_node xnode; char szTabWidth[5]; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_TABWIDTH ); if( xnode.empty() && !xnode.children() ) return false; sprintf( szTabWidth, "%i", iTabWidth ); return xnode.child(0).value( szTabWidth ); } // Returns if we want to use tabs or space (true is tabs!) BOOL CSyntaxFile::GetUseTabs() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_USETABS ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets the UseTabs(OrSpaces) to true or false. BOOL CSyntaxFile::SetUseTabs( BOOL bUseTabs ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_USETABS ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bUseTabs ? "1" : "0" ); } // Returns if the RightEdge is on. int CSyntaxFile::GetRightEdge() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_RIGHTEDGE ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ); } // Set the RightEdge to true or false. BOOL CSyntaxFile::SetRightEdge( BOOL bRightEdge ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_RIGHTEDGE ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bRightEdge ? "1" : "0" ); } // Gets the RightEdgeColumn int CSyntaxFile::GetRightEdgeColumn() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_RIGHTEDGECOLUMN ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ); } // Sets the RightEdgeColumn to iREColumn. BOOL CSyntaxFile::SetRightEdgeColumn( int iREColumn ) { xml_node xnode; char szREColumn[5]; xnode = xparser.document().first_element_by_name( TAG_VIEW ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_VIEW_RIGHTEDGECOLUMN ); if( xnode.empty() && !xnode.children() ) return false; sprintf( szREColumn, "%i", iREColumn ); return xnode.child(0).value( szREColumn ); } // Returns if the LineNumber margin is on. BOOL CSyntaxFile::GetMarginLineNumber() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_LINENUMBERS ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets the LineNumber margin to true or false. BOOL CSyntaxFile::SetMarginLineNumber( BOOL bLineNumbers ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_LINENUMBERS ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bLineNumbers ? "1" : "0" ); } // Returns if the Bookmark margin is on. BOOL CSyntaxFile::GetMarginBookmark() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_BOOKMARK ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets the Bookmark margin to true or false. BOOL CSyntaxFile::SetMarginBookmark( BOOL bBookmark ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_BOOKMARK ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bBookmark? "1" : "0" ); } // Returns if the Fold margin is on. BOOL CSyntaxFile::GetMarginFold() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_FOLD ); if( xnode.empty() && !xnode.children() ) return false; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } // Sets the Fold margin to true of false. BOOL CSyntaxFile::SetMarginFold( BOOL bFold ) { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_MARGINS ); if( xnode.empty() && !xnode.children() ) return false; xnode = xnode.first_element_by_name( TAG_MARGINS_FOLD ); if( xnode.empty() && !xnode.children() ) return false; return xnode.child(0).value( bFold ? "1" : "0" ); } int CSyntaxFile::GetStyleBits() { xml_node xnode; xnode = xparser.document().first_element_by_name( TAG_STYLEBITS ); if( xnode.empty() && !xnode.children() ) return -1; return atoi( xnode.child(0).value() ); } CString CSyntaxFile::GetStyleName( int iStyle ) { char number[4]; xml_node xnode; sprintf( number, "%i", iStyle ); xnode = xparser.document().first_element_by_attribute( TAG_STYLE, ATT_STYLE_NUMBER, number ); if( xnode.empty() ) return ""; xnode = xnode.first_element_by_name( TAG_STYLE_NAME ); if( xnode.empty() && !xnode.children() ) return ""; return xnode.child(0).value(); } xml_node CSyntaxFile::GetStyleFontNode( int iStyle ) { char number[4]; xml_node xnode; sprintf( number, "%i", iStyle ); xnode = xparser.document().first_element_by_attribute( TAG_STYLE, ATT_STYLE_NUMBER, number ); if( !xnode.empty() ) { xnode = xnode.first_element_by_name( TAG_STYLE_FONT ); } return xnode; } CString CSyntaxFile::GetStyleFontName( int iStyle ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return ""; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_NAME ); if( xnode.empty() ) return ""; if( !xnode.children() ) return ""; return xnode.child(0).value(); } BOOL CSyntaxFile::SetStyleFontName( int iStyle, TCHAR* FontName ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_NAME ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return xnode.child(0).value( FontName ); } int CSyntaxFile::GetStyleFontSize( int iStyle ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return -1; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_SIZE ); if( xnode.empty() ) return -1; if( !xnode.children() ) return -1; return atoi( xnode.child(0).value() ); } BOOL CSyntaxFile::SetStyleFontSize( int iStyle, int iValue ) { char szValue[4]; xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_SIZE ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; sprintf( szValue, "%i", iValue ); return xnode.child(0).value( szValue ); } BOOL CSyntaxFile::GetStyleFontBold( int iStyle ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_BOLD ); if( xnode.empty() && !xnode.children() ) return FALSE; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } BOOL CSyntaxFile::SetStyleFontBold( int iStyle, BOOL bValue ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_BOLD ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return xnode.child(0).value( bValue ? "1" : "0"); } BOOL CSyntaxFile::GetStyleFontItalic( int iStyle ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_ITALIC ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } BOOL CSyntaxFile::SetStyleFontItalic( int iStyle, BOOL bValue ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_ITALIC ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return xnode.child(0).value( bValue ? "1" : "0"); } BOOL CSyntaxFile::GetStyleFontUnderline( int iStyle ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_UNDERLINE ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return atoi( xnode.child(0).value() ) ? TRUE : FALSE; } BOOL CSyntaxFile::SetStyleFontUnderline( int iStyle, BOOL bValue ) { xml_node xnode; xnode = GetStyleFontNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_FONT_UNDERLINE ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; return xnode.child(0).value( bValue ? "1" : "0"); } int CSyntaxFile::RGBHexValueToColorInt( const TCHAR* value ) { int iResult; int iCount; iResult = 0; for( iCount = 5; iCount >= 0; -- iCount ) { iResult <<= 4; switch( value[iCount % 2 ? iCount - 1 : iCount + 1] ) { case 'a': case 'A': iResult += 10; break; case 'b': case 'B': iResult += 11; break; case 'c': case 'C': iResult += 12; break; case 'd': case 'D': iResult += 13; break; case 'e': case 'E': iResult += 14; break; case 'f': case 'F': iResult += 15; break; case '9': ++ iResult; case '8': ++ iResult; case '7': ++ iResult; case '6': ++ iResult; case '5': ++ iResult; case '4': ++ iResult; case '3': ++ iResult; case '2': ++ iResult; case '1': ++ iResult; } } return( iResult ); } void CSyntaxFile::ColorIntValueToRGBHex( int iValue, char *szValue ) { int iCount; szValue[6] = '\0'; for( iCount = 0; iCount < 6; ++ iCount ) { switch( iValue & 0xf ) { case 0: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '0'; break; case 1: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '1'; break; case 2: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '2'; break; case 3: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '3'; break; case 4: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '4'; break; case 5: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '5'; break; case 6: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '6'; break; case 7: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '7'; break; case 8: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '8'; break; case 9: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = '9'; break; case 10: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'A'; break; case 11: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'B'; break; case 12: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'C'; break; case 13: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'D'; break; case 14: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'E'; break; case 15: szValue[iCount % 2 ? iCount - 1 : iCount + 1] = 'F'; break; } iValue >>= 4; } } xml_node CSyntaxFile::GetStyleColorNode( int iStyle ) { char numBer[4]; xml_node xnode; sprintf( numBer, "%i", iStyle ); xnode = xparser.document().first_element_by_attribute( "Style", ATT_STYLE_NUMBER, numBer ); if( !xnode.empty() ) { xnode = xnode.first_element_by_name( TAG_STYLE_COLOR ); } return xnode; } int CSyntaxFile::GetStyleColorForeground( int iStyle ) { xml_node xnode; xnode = GetStyleColorNode( iStyle ); if( xnode.empty() ) return -1; xnode = xnode.first_element_by_name( TAG_STYLE_COLOR_FOREGROUND ); if( xnode.empty() ) return -1; if( !xnode.children() ) return -1; return RGBHexValueToColorInt( xnode.child(0).value() ); } int CSyntaxFile::SetStyleColorForeground( int iStyle, int iColor ) { char szColor[9]; xml_node xnode; xnode = GetStyleColorNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_COLOR_FOREGROUND ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; ColorIntValueToRGBHex( iColor, szColor ); szColor[8] = '\0'; return xnode.child(0).value( &szColor[2] ); } int CSyntaxFile::GetStyleColorBackground( int iStyle ) { xml_node xnode; xnode = GetStyleColorNode( iStyle ); if( xnode.empty() ) return -1; xnode = xnode.first_element_by_name( TAG_STYLE_COLOR_BACKGROUND ); if( xnode.empty() ) return -1; if( !xnode.children() ) return -1; return RGBHexValueToColorInt( xnode.child(0).value() ); } int CSyntaxFile::SetStyleColorBackground( int iStyle, int iColor ) { char szColor[9]; xml_node xnode; xnode = GetStyleColorNode( iStyle ); if( xnode.empty() ) return FALSE; xnode = xnode.first_element_by_name( TAG_STYLE_COLOR_BACKGROUND ); if( xnode.empty() ) return FALSE; if( !xnode.children() ) return FALSE; ColorIntValueToRGBHex( iColor, szColor ); szColor[8] = '\0'; return xnode.child(0).value( &szColor[2] ); } --- NEW FILE: SyntaxFile.h --- // SyntaxFile.h: interface for the CSyntaxFile class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_SYNTAXFILE_H__E5CB9170_6EA5_4355_98E6_A883A9E8D79D__INCLUDED_) #define AFX_SYNTAXFILE_H__E5CB9170_6EA5_4355_98E6_A883A9E8D79D__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // STYLE_MAX #include "Scintilla.h" #include "SciLexer.h" #include "SortedArray.h" #include "pugxml.h" using namespace std; using namespace pug; // Main syntax tag #define TAG_SYNTAX "Syntax" // Syntax sub tags #define TAG_LEXER "Lexer" #define TAG_KEYWORDS "Keywords" #define TAG_VIEW "View" #define TAG_MARGINS "Margins" #define TAG_STYLE "Style" #define TAG_STYLEBITS "StyleBits" // Lexer sub tags #define TAG_LEXER_NAME "Name" #define TAG_LEXER_PROPERTY "Property" // Lexer sub attributes #define ATT_LEXER_PROPERTY_NAME "name" // Keywords sub tags #define TAG_KEYWORDS_WORD "Word" // Keywords attributes #define ATT_KEYWORDS_SET "set" // View sub tags #define TAG_VIEW_SYNTAXHIGHLIGHTING "SyntaxHighlighting" #define TAG_VIEW_WORDWRAP "WordWrap" #define TAG_VIEW_TABWIDTH "TabWidth" #define TAG_VIEW_USETABS "UseTabs" #define TAG_VIEW_RIGHTEDGE "RightEdge" #define TAG_VIEW_RIGHTEDGECOLUMN "RightEdgeColumn" // Margin sub tags #define TAG_MARGINS_LINENUMBERS "LineNumbers" #define TAG_MARGINS_BOOKMARK "BookMark" #define TAG_MARGINS_FOLD "Fold" // Style sub tags #define TAG_STYLE_NAME "Name" #define TAG_STYLE_FONT "Font" #define TAG_STYLE_COLOR "Color" // Style attributes #define ATT_STYLE_NUMBER "number" // Style Font sub tags #define TAG_STYLE_FONT_NAME "Name" #define TAG_STYLE_FONT_SIZE "Size" #define TAG_STYLE_FONT_BOLD "Bold" #define TAG_STYLE_FONT_ITALIC "Italic" #define TAG_STYLE_FONT_UNDERLINE "Underline" // Style Color sub tags #define TAG_STYLE_COLOR_FOREGROUND "Foreground" #define TAG_STYLE_COLOR_BACKGROUND "Background" class CSyntaxFile { protected: CString szFileName; xml_parser xparser; CSortedArray<CString, CString> Keywords[KEYWORDSET_MAX]; // Converts a char array with hex chars to an int. int RGBHexValueToColorInt( const TCHAR* value ); // Converts an int into hex chars and puts them in szValue. Don't forget to reserve memory! void ColorIntValueToRGBHex( int iValue, char* szValue ); // Get the Font node of Style iStyle. Function is used by GetStyleFont* and SetStyleColor* xml_node GetStyleFontNode( int iStyle ); // Get the Color node of Style iStyle. Function is used by GetStyleColor* and SetStyleColor* xml_node GetStyleColorNode( int iStyle ); public: CSyntaxFile(); virtual ~CSyntaxFile(); // Set the filename of the syntax file to parse or save. void SetFilename( CString szFileName ); // Function to actually parse the synfile and the ability to check // if all goes well. BOOL Parse(); // Save the current values back in the synfile. void Save(); // Get the lexer number from, it changes the name in the syn-file to a number int GetLexerNumber(); // Get the properties to set on the lexer int GetLexerProperties( CMapStringToString& msts ); // Gets a String with all keywords out of iSet separated by cSep CString GetDelimitedKeywordSet( int iSet, char cSep = ' ' ); // Gets a String with all keywords out of all sets separated by cSep CString GetDelimitedKeywords( char cSep = ' ' ); // Returns if SyntaxHighlighting is on. BOOL GetSyntaxHighlighting(); // Sets the SyntaxHighlighting to true or false. BOOL SetSyntaxHighlighting( BOOL bSyntaxHighlighting ); // Returns if WordWrap is on. BOOL GetWordWrap(); // Sets WordWrap to true or false. BOOL SetWordWrap( BOOL bWordWrap ); // Get the tab/indentation width int GetTabWidth(); // Sets the tab/indentation width to iTabWidth. BOOL SetTabWidth( int iTabWidth ); // Returns if we want to use tabs or space (true is tabs!) BOOL GetUseTabs(); // Sets the UseTabs(OrSpaces) to true or false. BOOL SetUseTabs( BOOL bUseTabs ); // Get the RightEdge type. int GetRightEdge(); // Set the RightEdge to true or false. BOOL SetRightEdge( BOOL bRightEdge ); // Gets the RightEdgeColumn int GetRightEdgeColumn(); // Sets the RightEdgeColumn to iREColumn. BOOL SetRightEdgeColumn( int iREColumn ); // Returns if the LineNumber margin is on. BOOL GetMarginLineNumber(); // Sets the LineNumber margin to true or false. BOOL SetMarginLineNumber( BOOL bLineNumbers ); // Returns if the Bookmark margin is on. BOOL GetMarginBookmark(); // Sets the Bookmark margin to true or false. BOOL SetMarginBookmark( BOOL bBookmark ); // Returns if the Fold margin is on. BOOL GetMarginFold(); // Sets the Fold margin to true of false. BOOL SetMarginFold( BOOL bFold ); // Gets the Number of Stylebits int GetStyleBits(); // Gets the Name of iStyle. CString GetStyleName( int iStyle ); // Gets the FontName of iStyle. CString GetStyleFontName( int iStyle ); // Sets the FontName of iStyle. BOOL SetStyleFontName( int iStyle, TCHAR* FontName ); // Gets the FontSize of iStyle font. int GetStyleFontSize( int iStyle ); // Sets the FontSize of iStyle font. BOOL SetStyleFontSize( int iStyle, int iValue ); // Get the FontBold attribute of iStyle font. BOOL GetStyleFontBold( int iStyle ); // Set the FontBold attribute of iStyle font. BOOL SetStyleFontBold( int iStyle, BOOL bValue ); // Get the FontItalic attribute of iStyle font. BOOL GetStyleFontItalic( int iStyle ); // Set the FontItalic attribute of iStyle font. BOOL SetStyleFontItalic( int iStyle, BOOL bValue ); // Get the FontUnderline attribute of iStyle font. BOOL GetStyleFontUnderline( int iStyle ); // Set the FontUnderline attribute of iStyle font. BOOL SetStyleFontUnderline( int iStyle, BOOL bValue ); // Get the Foreground Color of iStyle. int GetStyleColorForeground( int iStyle ); // Set the Foreground Color of iStyle. BOOL SetStyleColorForeground( int iStyle, int iColor ); // Get the Background Color of iStyle. int GetStyleColorBackground( int iStyle ); // Set the Background Color of iStyle. BOOL SetStyleColorBackground( int iStyle, int iColor ); }; #endif // !defined(AFX_SYNTAXFILE_H__E5CB9170_6EA5_4355_98E6_A883A9E8D79D__INCLUDED_) Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AnyEdit.cpp 11 Dec 2003 04:15:21 -0000 1.38 --- AnyEdit.cpp 12 Dec 2003 11:00:04 -0000 1.39 *************** *** 1,23 **** /********************************************************************* Copyright (C) 2002 DeepSoft - M.Deepak ! This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. ! Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: [...1328 lines suppressed...] ! { ! // Save the default to the users syntax file. ! pSyntaxFile->SetFilename( szFileName ); ! pSyntaxFile->Save(); ! } ! ! } ! // Add the parsed object to the Syntax file map. ! mapSyntaxFiles.SetAt( iCount, pSyntaxFile ); ! } ! } ! ! ! // Find the SyntaxFile object by it's language number ! CSyntaxFile* CAnyEditApp::GetSyntaxFile( int iLanguage ) ! { ! CSyntaxFile* pSyntaxFile; ! mapSyntaxFiles.Lookup( iLanguage, pSyntaxFile ); ! return pSyntaxFile; } Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AnyEdit.dsp 7 Dec 2003 17:06:10 -0000 1.28 --- AnyEdit.dsp 12 Dec 2003 11:00:04 -0000 1.29 *************** *** 372,375 **** --- 372,379 ---- # Begin Source File + SOURCE=.\ConfigFile.cpp + # End Source File + # Begin Source File + SOURCE=.\DumpDialog.cpp # End Source File *************** *** 414,417 **** --- 418,425 ---- SOURCE=.\SeException.cpp # End Source File + # Begin Source File + + SOURCE=.\SyntaxFile.cpp + # End Source File # End Group # Begin Group "Header Files" *************** *** 1124,1127 **** --- 1132,1139 ---- # Begin Source File + SOURCE=.\ConfigFile.h + # End Source File + # Begin Source File + SOURCE=.\DumpDialog.h # End Source File *************** *** 1145,1148 **** --- 1157,1164 ---- SOURCE=.\SeException.h + # End Source File + # Begin Source File + + SOURCE=.\SyntaxFile.h # End Source File # End Group Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AnyEdit.h 11 Dec 2003 04:15:21 -0000 1.32 --- AnyEdit.h 12 Dec 2003 11:00:04 -0000 1.33 *************** *** 18,22 **** #include "resource.h" // main symbols ! #define REGISTRY_ROOT _T("SOFTWARE\\DeepSoft\\AnyEdit\\"); ///////////////////////////////////////////////////////////////////////////// --- 18,22 ---- #include "resource.h" // main symbols ! #define REGISTRY_ROOT _T("SOFTWARE\\DeepSoft\\AnyEdit\\"); ///////////////////////////////////////////////////////////////////////////// *************** *** 34,45 **** #include "AEPlugin.h" #include "Plugin.h" //Save final position struct DocumentPosition { ! CString file_path; ! long initial_pos; ! long final_pos; ! int visible_line; }; --- 34,47 ---- #include "AEPlugin.h" #include "Plugin.h" + #include "ConfigFile.h" + #include "SyntaxFile.h" //Save final position struct DocumentPosition { ! CString file_path; ! long initial_pos; ! long final_pos; ! int visible_line; }; *************** *** 65,73 **** CObject * LoadLanguage(LPCSTR langpos); CString SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); ! CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); ! void ApplyOtherDefaults(CScintilla * scintilla); void ResetAllProperties(); ! void SetDefaults(CScintilla * scintilla); CBCGToolbarComboBoxButton * GetFindCombo(); void ReturnItemsForCodeList(CStringArray &arr); --- 67,75 ---- CObject * LoadLanguage(LPCSTR langpos); CString SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); ! CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); ! // void ApplyOtherDefaults(CScintilla * scintilla); void ResetAllProperties(); ! // void SetDefaults(CScintilla * scintilla); CBCGToolbarComboBoxButton * GetFindCombo(); void ReturnItemsForCodeList(CStringArray &arr); *************** *** 83,87 **** void SetAppPath(LPCSTR appPath); LPCSTR GetAppPath(); ! BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); BOOL ShowPopupMenu (UINT uiMenuResId, const CPoint& point, CWnd* pWnd); --- 85,89 ---- void SetAppPath(LPCSTR appPath); LPCSTR GetAppPath(); ! BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); BOOL ShowPopupMenu (UINT uiMenuResId, const CPoint& point, CWnd* pWnd); *************** *** 106,118 **** BOOL LockTagList(); void UnlockTagList(); ! void LoadPlugins(); ! void UnloadPlugins(); ! void PluginMenuClicked(UINT id); ! BOOL GetDocumentPosition(LPCSTR filepath,long &startpos,long &endpos,int &visline); ! void SetDocumentPosition(LPCSTR filepath, long startpos, long endpos, int visline); ! void SetModification(BOOL modval) ! { ! check_modification = modval; ! } BOOL CheckModification() { --- 108,120 ---- BOOL LockTagList(); void UnlockTagList(); ! void LoadPlugins(); ! void UnloadPlugins(); ! void PluginMenuClicked(UINT id); ! BOOL GetDocumentPosition(LPCSTR filepath,long &startpos,long &endpos,int &visline); ! void SetDocumentPosition(LPCSTR filepath, long startpos, long endpos, int visline); ! void SetModification(BOOL modval) ! { ! check_modification = modval; ! } BOOL CheckModification() { *************** *** 154,165 **** public: ! void ReloadACMP(); ! void ClearClassView(); ! CComboBox * findbox; CComboBox * funcbox; ! //For macro support ! MacroHolder * macroholder; ! BOOL isRecordingMacro; protected: --- 156,167 ---- public: ! void ReloadACMP(); ! void ClearClassView(); ! CComboBox * findbox; CComboBox * funcbox; ! //For macro support ! MacroHolder * macroholder; ! BOOL isRecordingMacro; protected: *************** *** 180,192 **** int lastsearchflags; BOOL lastsearchdirection; ! AEPlugin * pluginHead; ! CArray<DocumentPosition,DocumentPosition> m_docPos; ! CPlugin plugin; protected: ! void LoadDocumentPosition(); ! void SaveDocumentPosition(); void LoadGlobalSettings(); // Overrides // ClassWizard generated virtual function overrides --- 182,223 ---- int lastsearchflags; BOOL lastsearchdirection; ! AEPlugin * pluginHead; ! CArray<DocumentPosition,DocumentPosition> m_docPos; ! CPlugin plugin; ! ! // The main user config file for AnyEdit. ! CConfigFile ConfigFile; ! // Map of language number pointing to a CSytnaxFile object. ! CMap<int, int, CSyntaxFile*, CSyntaxFile*> mapSyntaxFiles; ! // Map of Extension strings pointing to a language number. ! CMapStringToString mapExtensions; ! // String with the name of the current user ! CString szUserName; protected: ! void LoadDocumentPosition(); ! void SaveDocumentPosition(); void LoadGlobalSettings(); + // Configuration functions + + // Read configuration information + BOOL ReadConfigFile(); + + // Get a reference to the config file. Used in the Preferences dialogs + CConfigFile* GetConfigFile(); + + // Fill the map with extensions and language numbers + void FillExtensionMap(); + public: + // Load all the configured syntax files. + void LoadSyntaxFiles(); + + // Get the SyntaxFile object by it's language number. + CSyntaxFile* GetSyntaxFile( int iLanguage ); + + // Get the LanguageNr of ext. + int GetLanguageNrFromExtension( CString szExtension ); + // Overrides // ClassWizard generated virtual function overrides *************** *** 207,224 **** afx_msg void OnFileNew(); afx_msg void OnFileOpenstartuppage(); ! afx_msg void OnToolsSavemacro(); ! afx_msg void OnUpdateToolsSavemacro(CCmdUI* pCmdUI); ! afx_msg void OnToolsLoadmacro(); ! afx_msg void OnUpdateToolsLoadmacro(CCmdUI* pCmdUI); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() ! CBCGKeyboardManager m_KeyboardManager; ! CBCGMouseManager m_MouseManager; ! CBCGContextMenuManager m_ContextMenuManager; ! CScintillaDefaults m_sdefaults; ! ! //deepwashere ! } ; --- 238,252 ---- afx_msg void OnFileNew(); afx_msg void OnFileOpenstartuppage(); ! afx_msg void OnToolsSavemacro(); ! afx_msg void OnUpdateToolsSavemacro(CCmdUI* pCmdUI); ! afx_msg void OnToolsLoadmacro(); ! afx_msg void OnUpdateToolsLoadmacro(CCmdUI* pCmdUI); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() ! CBCGKeyboardManager m_KeyboardManager; ! CBCGMouseManager m_MouseManager; ! CBCGContextMenuManager m_ContextMenuManager; ! CScintillaDefaults m_sdefaults; } ; Index: AnyEditDoc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AnyEditDoc.cpp 25 Nov 2003 15:05:56 -0000 1.13 --- AnyEditDoc.cpp 12 Dec 2003 11:00:04 -0000 1.14 *************** *** 32,42 **** CAnyEditDoc::CAnyEditDoc() { ! // TODO: add one-time construction code here ! m_pDocLang = NULL; ! } CAnyEditDoc::~CAnyEditDoc() ! {} BOOL CAnyEditDoc::OnNewDocument() --- 32,45 ---- CAnyEditDoc::CAnyEditDoc() { ! m_pDocLang = NULL; ! iLanguage = 0; // Use default if unknown ! bFirstTimeProperties = TRUE; ! bSyntaxHighlighting = TRUE; ! m_pScintilla = NULL; } CAnyEditDoc::~CAnyEditDoc() ! { ! } BOOL CAnyEditDoc::OnNewDocument() *************** *** 86,89 **** --- 89,111 ---- // CAnyEditDoc commands + CString CAnyEditDoc::GetFileNameExtension( LPCTSTR lpszPathName ) + { + int iStart; + int iEnd; + CString szFileName; + + // Extract extension + szFileName = lpszPathName; + iStart = 0; + iEnd = 0; + while( -1 != iEnd ) + { + iEnd = szFileName.Find( '.', iStart ); + if( -1 != iEnd ) iStart = iEnd + 1; + } + if( 0 == iStart ) return ""; + else return szFileName.Mid( iStart, szFileName.GetLength() - iStart ); + } + BOOL CAnyEditDoc::OnOpenDocument(LPCTSTR lpszPathName) { *************** *** 91,94 **** --- 113,122 ---- return FALSE; + // Set the language number from the extension + iLanguage = theApp.GetLanguageNrFromExtension( GetFileNameExtension( lpszPathName ) ); + + // Set the Scintilla properties + SetScintillaProperties(); + // Use scintilla to open the file [12/27/2001 13:51] m_pScintilla->OpenFile(lpszPathName); *************** *** 99,103 **** BOOL CAnyEditDoc::OnSaveDocument(LPCTSTR lpszPathName) { ! if(!this->IsModified()) return TRUE; BOOL saved = m_pScintilla->SaveFile(lpszPathName); if(saved) --- 127,131 ---- BOOL CAnyEditDoc::OnSaveDocument(LPCTSTR lpszPathName) { ! if(!this->IsModified()) return TRUE; BOOL saved = m_pScintilla->SaveFile(lpszPathName); if(saved) *************** *** 167,179 **** void CAnyEditDoc::ReloadDefaults() { ! theApp.SetDefaults(m_pScintilla); ! if(m_pScintilla) ! { ! if(m_pDocLang) ! { ! m_pDocLang->FillUpScintilla(m_pScintilla); ! } ! } ! theApp.ApplyOtherDefaults(m_pScintilla); } --- 195,209 ---- void CAnyEditDoc::ReloadDefaults() { ! /* theApp.SetDefaults(m_pScintilla); ! if(m_pScintilla) ! { ! if(m_pDocLang) ! { ! m_pDocLang->FillUpScintilla(m_pScintilla); ! } ! } ! theApp.ApplyOtherDefaults(m_pScintilla);*/ ! SetScintillaProperties(); ! m_pScintilla->Colourise( 0, -1 ); } *************** *** 219,245 **** void CAnyEditDoc::SetDocScintilla(CScintilla * m_pscin) { ! m_pScintilla = m_pscin; } void CAnyEditDoc::SetDocLanguage(CLanguage * m_plang) { ! m_pDocLang = m_plang; } void CAnyEditDoc::GetListWords(CString &result) { ! if(m_pDocLang==NULL) return; ! m_pDocLang->GetListWords(result); } BOOL CAnyEditDoc::GetAcmpValueToArray(LPCSTR val, CStringArray &arr) { ! if(m_pDocLang==NULL) return FALSE; ! return m_pDocLang->GetValueToArray(val,arr); } BOOL CAnyEditDoc::GetAcmpWordList(CStringArray &arr) { ! if(m_pDocLang==NULL) return FALSE; ! return m_pDocLang->GetAcmpWordList(arr); } --- 249,406 ---- void CAnyEditDoc::SetDocScintilla(CScintilla * m_pscin) { ! m_pScintilla = m_pscin; } void CAnyEditDoc::SetDocLanguage(CLanguage * m_plang) { ! m_pDocLang = m_plang; } void CAnyEditDoc::GetListWords(CString &result) { ! if(m_pDocLang==NULL) return; ! m_pDocLang->GetListWords(result); } BOOL CAnyEditDoc::GetAcmpValueToArray(LPCSTR val, CStringArray &arr) { ! if(m_pDocLang==NULL) return FALSE; ! return m_pDocLang->GetValueToArray(val,arr); } BOOL CAnyEditDoc::GetAcmpWordList(CStringArray &arr) { ! if(m_pDocLang==NULL) return FALSE; ! return m_pDocLang->GetAcmpWordList(arr); ! } ! ! void CAnyEditDoc::SetLanguageNr( int iLanguageNr ) ! { ! iLanguage = iLanguageNr; ! } ! ! void CAnyEditDoc::SetScintillaProperties() ! { ! int iCount; ! CSyntaxFile* pSyntaxFile; ! CString szTemp; ! int iTemp; ! CMapStringToString mapLexerProps; ! POSITION pos; ! ! pSyntaxFile = theApp.GetSyntaxFile( iLanguage ); ! if( NULL == pSyntaxFile ) return; ! ! // Clear the Scintilla object ! m_pScintilla->StyleClearAll(); ! ! // Do some default AnyEdit settings ! m_pScintilla->StyleSetEOLFilled( STYLE_DEFAULT, true ); ! m_pScintilla->UsePopUp( false ); ! ! if( bFirstTimeProperties ) ! { ! // We only want to do these settings the first time, on a change ! // of Preferences, we don't want the mess up the users menu ! // overridden settings. ! ! bSyntaxHighlighting = pSyntaxFile->GetSyntaxHighlighting(); ! m_pScintilla->SetWrapMode( pSyntaxFile->GetWordWrap() ? 1 : 0 ); ! m_pScintilla->SetUseTabs( pSyntaxFile->GetUseTabs() ); ! m_pScintilla->SetEdgeMode( pSyntaxFile->GetRightEdge() ); ! m_pScintilla->SetEdgeColour( RGB( 255, 255, 255 ) ); ! ! // These may need to be settable ! m_pScintilla->SetSelFore( true, RGB( 255, 255, 255 ) ); ! m_pScintilla->SetSelBack( true, RGB( 115, 113, 189 ) ); ! m_pScintilla->SetCaretLineBack( RGB( 255, 255, 238 ) ); ! m_pScintilla->SetCaretWidth( 1 ); ! ! // Set margins. ! // LineNumbers ! m_pScintilla->SetMarginWidthN( LINENUMBER_MARGIN_ID, pSyntaxFile->GetMarginLineNumber() ? LINENUMBER_MARGIN_SIZE : 0 ); ! m_pScintilla->SetMarginTypeN( LINENUMBER_MARGIN_ID, SC_MARGIN_NUMBER ); ! // Bookmark ! m_pScintilla->SetMarginWidthN( BOOKMARK_MARGIN_ID, pSyntaxFile->GetMarginBookmark() ? BOOKMARK_MARGIN_SIZE : 0 ); ! m_pScintilla->SetMarginTypeN( BOOKMARK_MARGIN_ID, SC_MARGIN_SYMBOL ); ! m_pScintilla->SetMarginMaskN( BOOKMARK_MARGIN_ID, ~SC_MASK_FOLDERS ); ! // Fold ! m_pScintilla->SetMarginWidthN( FOLD_MARGIN_ID, pSyntaxFile->GetMarginFold() ? FOLD_MARGIN_SIZE : 0 ); ! m_pScintilla->SetMarginTypeN( FOLD_MARGIN_ID, SC_MARGIN_SYMBOL ); ! m_pScintilla->SetMarginMaskN( FOLD_MARGIN_ID, SC_MASK_FOLDERS ); ! m_pScintilla->SetMarginSensitiveN( FOLD_MARGIN_ID, TRUE ); ! m_pScintilla->SetFoldingMargins( efsVSNet ); ! ! // Taken from AnyEditView::Init, need to be worked out. ! m_pScintilla->SetIndentationGuides(TRUE); ! m_pScintilla->IndicSetStyle(0,INDIC_SQUIGGLE); ! m_pScintilla->IndicSetStyle(1,INDIC_TT); ! m_pScintilla->IndicSetStyle(2,INDIC_DIAGONAL); ! m_pScintilla->autoindent = TRUE; ! m_pScintilla->DefineMarker(SC_MARK_ARROW,SC_MARK_ARROW,RGB(0,0,255),RGB(231,231,255)); ! m_pScintilla->DefineMarker(SC_MARK_SHORTARROW,SC_MARK_SHORTARROW,RGB(107,27,18),RGB(251,252,226)); ! ! } ! m_pScintilla->SetTabWidth( pSyntaxFile->GetTabWidth() ); ! m_pScintilla->SetEdgeColumn( pSyntaxFile->GetRightEdgeColumn() ); ! ! // Set the number of Stylebits ! iTemp = pSyntaxFile->GetStyleBits(); ! if( -1 != iTemp ) m_pScintilla->SetStyleBits( iTemp ); ! ! if( bSyntaxHighlighting ) ! { ! // Set the lexer ! iTemp = pSyntaxFile->GetLexerNumber(); ! if( -1 != iTemp ) m_pScintilla->SetLexer( iTemp ); ! ! // Set the lexer properties ! if( 0 < pSyntaxFile->GetLexerProperties( mapLexerProps ) ) ! { ! CString szTemp2; ! pos = mapLexerProps.GetStartPosition(); ! while( NULL != pos ) ! { ! mapLexerProps.GetNextAssoc( pos, szTemp, szTemp2 ); ! m_pScintilla->SetProperty( szTemp, szTemp2 ); ! } ! } ! ! // Set properties of each style if it is defined in the syntax ! for( iCount = 0; iCount <= STYLE_MAX; ++ iCount ) ! { ! // Set the font properties of the style ! szTemp = pSyntaxFile->GetStyleFontName( iCount ); ! if( !szTemp.IsEmpty() ) m_pScintilla->StyleSetFont( iCount, szTemp ); ! iTemp = pSyntaxFile->GetStyleFontSize( iCount ); ! if( -1 != iTemp ) m_pScintilla->StyleSetSize( iCount, iTemp ); ! m_pScintilla->StyleSetBold( iCount, pSyntaxFile->GetStyleFontBold( iCount ) ); ! m_pScintilla->StyleSetItalic( iCount, pSyntaxFile->GetStyleFontItalic( iCount ) ); ! m_pScintilla->StyleSetUnderline( iCount, pSyntaxFile->GetStyleFontUnderline( iCount ) ); ! ! // Set the color of the style ! m_pScintilla->StyleSetFore( iCount, pSyntaxFile->GetStyleColorForeground( iCount ) ); ! m_pScintilla->StyleSetBack( iCount, pSyntaxFile->GetStyleColorBackground( iCount ) ); ! ! } ! ! // Set the keywords for the lexer ! for( iCount = 0; iCount <= KEYWORDSET_MAX; ++ iCount ) ! { ! szTemp = pSyntaxFile->GetDelimitedKeywordSet( iCount, ' ' ); ! if( !szTemp.IsEmpty() ) m_pScintilla->SetKeyWords( iCount, szTemp ); ! } ! } ! ! bFirstTimeProperties = FALSE; // Done first round and keep is false every other round. ! } ! ! BOOL CAnyEditDoc::GetSyntaxHighlighting() ! { ! return bSyntaxHighlighting; ! } ! ! void CAnyEditDoc::ToggleSyntaxHighlighting() ! { ! bSyntaxHighlighting = bSyntaxHighlighting ? 0 : 1; } Index: AnyEditDoc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AnyEditDoc.h 20 Nov 2003 15:47:49 -0000 1.7 --- AnyEditDoc.h 12 Dec 2003 11:00:04 -0000 1.8 *************** *** 11,14 **** --- 11,23 ---- #include "scintillaif.h" #include "Language.h" + #include "SyntaxFile.h" + + // Define the Margin ID's & Sizes + #define LINENUMBER_MARGIN_ID 0 + #define BOOKMARK_MARGIN_ID 1 + #define FOLD_MARGIN_ID 2 + #define LINENUMBER_MARGIN_SIZE 36 + #define BOOKMARK_MARGIN_SIZE 16 + #define FOLD_MARGIN_SIZE 14 class CAnyEditDoc : public CDocument *************** *** 20,23 **** --- 29,36 ---- // Attributes protected: + int iLanguage; // The Number of the Language + BOOL bFirstTimeProperties; // We want to know when we set the Scintilla properties for the first time. + BOOL bSyntaxHighlighting; // We want to keep track of the syntax highlighting setting. + CScintilla * m_pScintilla; CString doc_file_path; *************** *** 47,51 **** void SetDocScintilla(CScintilla * m_pscin); void SetDocLanguage(CLanguage * m_plang); ! virtual ~CAnyEditDoc(); #ifdef _DEBUG virtual void AssertValid() const; --- 60,70 ---- void SetDocScintilla(CScintilla * m_pscin); void SetDocLanguage(CLanguage * m_plang); ! ! void SetLanguageNr( int iLanguageNr ); ! void SetScintillaProperties(); ! BOOL GetSyntaxHighlighting(); ! void ToggleSyntaxHighlighting(); ! ! virtual ~CAnyEditDoc(); #ifdef _DEBUG virtual void AssertValid() const; *************** *** 54,59 **** protected: // Generated message map functions - protected: //{{AFX_MSG(CAnyEditDoc) // NOTE - the ClassWizard will add and remove member functions here. --- 73,79 ---- protected: + CString GetFileNameExtension( LPCTSTR lpszPathName ); + // Generated message map functions //{{AFX_MSG(CAnyEditDoc) // NOTE - the ClassWizard will add and remove member functions here. Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** AnyEditView.cpp 11 Dec 2003 04:15:21 -0000 1.40 --- AnyEditView.cpp 12 Dec 2003 11:00:04 -0000 1.41 *************** *** 12,15 **** --- 12,16 ---- #include "Goto.h" #include "Language.h" + #include "SyntaxFile.h" #ifdef _DEBUG *************** *** 19,25 **** #endif [...1190 lines suppressed...] ! pCmdUI->Enable(); ! return; ! } ! } ! pCmdUI->Enable(FALSE); } ! void CAnyEditView::OnUpdateToolsRepeatcommand(CCmdUI* pCmdUI) { ! if(theApp.macroholder) ! { ! if(!theApp.isRecordingMacro) ! { ! pCmdUI->Enable(); ! return; ! } ! } ! pCmdUI->Enable(FALSE); } + Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AnyEditView.h 11 Dec 2003 04:15:21 -0000 1.22 --- AnyEditView.h 12 Dec 2003 11:00:04 -0000 1.23 *************** *** 15,19 **** #include "TagList.h" ! #define PARSER_TIMER (WM_USER + 5000) class CAnyEditView : public CView --- 15,19 ---- #include "TagList.h" ! #define PARSER_TIMER (WM_USER + 5000) class CAnyEditView : public CView *************** *** 27,43 **** BOOL EnableParsing; int ParseTimeLimit; ! BOOL isHighlightingOn; CString DocExt; CString CurDocPath; BOOL outoffocus; CTime last_access_time; ! BOOL fileclosed; ! CToolBar m_wndTool; // Attributes public: CAnyEditDoc* GetDocument(); ! void Init(); protected: --- 27,43 ---- BOOL EnableParsing; int ParseTimeLimit; ! BOOL isHighlightingOn; CString DocExt; CString CurDocPath; BOOL outoffocus; CTime last_access_time; ! BOOL fileclosed; ! CToolBar m_wndTool; // Attributes public: CAnyEditDoc* GetDocument(); ! // void Init(); protected: *************** *** 51,60 **** // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAnyEditView) ! public: virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); virtual void OnInitialUpdate(); ! protected: virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); --- 51,60 ---- // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAnyEditView) ! public: virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); virtual void OnInitialUpdate(); ! protected: virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); *************** *** 62,67 **** virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); ! virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); ! //}}AFX_VIRTUAL // Implementation --- 62,67 ---- virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); ! virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); ! //}}AFX_VIRTUAL // Implementation *************** *** 75,79 **** void InsertStringArray(CStringArray &arr); void JustOpenedFile(); ! void ReloadDefaults(); void SetSelectedLine(int lineno); void OnModified(); --- 75,79 ---- void InsertStringArray(CStringArray &arr); void JustOpenedFile(); ! // void ReloadDefaults(); ... [truncated message content] |
From: <td...@us...> - 2003-12-11 05:18:35
|
Update of /cvsroot/anyedit/AnyEditBin/StartPage In directory sc8-pr-cvs1:/tmp/cvs-serv17068/StartPage Modified Files: right.htm Log Message: - New binaries Index: right.htm =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/StartPage/right.htm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** right.htm 30 Sep 2003 10:41:33 -0000 1.3 --- right.htm 11 Dec 2003 05:18:32 -0000 1.4 *************** *** 1 **** ! <HTML><HEAD><TITLE>Start Page</TITLE><LINK REL="STYLESHEET" TYPE="text/css" HREF="css.css"><BODY> <div id="FileDetails" style="LEFT: 42px; POSITION: absolute; TOP: 42px;"><table id=tabs style="display:block;width:100%" border=0 cellpadding=0 cellspacing=0> <tr><td onclick="ShowTab(0)" id=tab width=45% style="text-align:center;" class='button' style="position:absloute;text-align:center;left:100px;top:100px;height:18px;" > Recent Files</td><td onclick="ShowTab(1)" id=tab width=45% style="text-align:center;" class='selected' style="position:absloute;text-align:center;left:100px;top:100px;height:18px;" > Recent Workspaces</td></tr><tr><td colspan=6 width=5px height=4px bgcolor="#222244"></td></tr></table></div><div id="Pages" style="LEFT: 42px; POSITION: absolute; TOP: 75px;display:block;"> <TABLE width=100%><TR><TD class=control><table style="display:block;width:100%" border=0 cellpadding=1 cellspacing=1 background="#000000"><TBODY><TR class=item> <TH class=item noWrap align=left width="10%">Sl.No</TH><TH class=item noWrap align=left>File Names</TH></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>1</center></TD><TD><a href="aep://FileOpen|C:\OS\AnyEditBin\test.java">C:\OS\AnyEditBin\test.java</a></td></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>2</center></TD><TD><a href="aep://FileOpen|C:\Documents and Settings\Administrator\Desktop\kevlar\src\gpp\host\isd\common\isdweb\zend_wrapper.h">C:\Documents and Settings\Administrator\Desktop\kevlar\src\gpp\host\isd\common\isdweb\zend_wrapper.h</a></td></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>3</center></TD><TD><a href="aep://FileOpen|C:\OS\AnyEditv2\AnyEdit.cpp">C:\OS\AnyEditv2\AnyEdit.cpp</a></td></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>4</center></TD><TD><a href="aep://FileOpen|C:\OS\AnyEditBin\StartPage\home.htm">C:\OS\AnyEditBin\StartPage\home.htm</a></td></TR></TBODY></table></TD></TR></TABLE></div><div id="Pages" style="LEFT: 42px; POSITION: absolute; TOP: 75px;display:none;"> <TABLE width=100%><TR><TD class=control><table style="display:block;width:100%" border=0 cellpadding=1 cellspacing=1 background="#000000"> <TBODY><TR class=item><TH class=item noWrap align=left width="10%">Sl.No</TH><TH class=item noWrap align=left>File Names</TH></TR></TBODY></table></TD></TR></TABLE></div><div id="Buttons" style="LEFT: 42px; POSITION: absolute; TOP: 250px;display:block;"> <table width=100% align><tr><td width=10%><form method=GET action="aep://FileOpenExisting|dummy"><input type=submit class=button value='Open Existing File'></form></td> <td><form method=GET action="aep://FileNew|dummy"><input type=submit class=button value='Create New File'></form></td></tr></table></div></BODY> </HTML><script> function ShowTab(TabIndex) { for(i=0;i<Pages.length;i++) { tab(i).className="selected"; Pages(i).style.display="none"; } tab(parseInt(TabIndex)).className="button"; Pages(parseInt(TabIndex)).style.display="block"; } </script> \ No newline at end of file --- 1 ---- ! <HTML><HEAD><TITLE>Start Page</TITLE><LINK REL="STYLESHEET" TYPE="text/css" HREF="css.css"><BODY> <div id="FileDetails" style="LEFT: 42px; POSITION: absolute; TOP: 42px;"><table id=tabs style="display:block;width:100%" border=0 cellpadding=0 cellspacing=0> <tr><td onclick="ShowTab(0)" id=tab width=45% style="text-align:center;" class='button' style="position:absloute;text-align:center;left:100px;top:100px;height:18px;" > Recent Files</td><td onclick="ShowTab(1)" id=tab width=45% style="text-align:center;" class='selected' style="position:absloute;text-align:center;left:100px;top:100px;height:18px;" > Recent Workspaces</td></tr><tr><td colspan=6 width=5px height=4px bgcolor="#222244"></td></tr></table></div><div id="Pages" style="LEFT: 42px; POSITION: absolute; TOP: 75px;display:block;"> <TABLE width=100%><TR><TD class=control><table style="display:block;width:100%" border=0 cellpadding=1 cellspacing=1 background="#000000"><TBODY><TR class=item> <TH class=item noWrap align=left width="10%">Sl.No</TH><TH class=item noWrap align=left>File Names</TH></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>1</center></TD><TD><a href="aep://FileOpen|C:\Documents and Settings\Administrator\Desktop\tester\tester.java">C:\Documents and Settings\Administrator\Desktop\tester\tester.java</a></td></TR><TR class = text width=100% onmouseover="javascript:style.background='#e5e5e5'" onmouseout="javascript:style.background='white'"> <TD width="10%"><center>2</center></TD><TD><a href="aep://FileOpen|C:\OS\AnyEditv2\bin\StartPage\home.htm">C:\OS\AnyEditv2\bin\StartPage\home.htm</a></td></TR></TBODY></table></TD></TR></TABLE></div><div id="Pages" style="LEFT: 42px; POSITION: absolute; TOP: 75px;display:none;"> <TABLE width=100%><TR><TD class=control><table style="display:block;width:100%" border=0 cellpadding=1 cellspacing=1 background="#000000"> <TBODY><TR class=item><TH class=item noWrap align=left width="10%">Sl.No</TH><TH class=item noWrap align=left>File Names</TH></TR></TBODY></table></TD></TR></TABLE></div><div id="Buttons" style="LEFT: 42px; POSITION: absolute; TOP: 250px;display:block;"> <table width=100% align><tr><td width=10%><form method=GET action="aep://FileOpenExisting|dummy"><input type=submit class=button value='Open Existing File'></form></td> <td><form method=GET action="aep://FileNew|dummy"><input type=submit class=button value='Create New File'></form></td></tr></table></div></BODY> </HTML><script> function ShowTab(TabIndex) { for(i=0;i<Pages.length;i++) { tab(i).className="selected"; Pages(i).style.display="none"; } tab(parseInt(TabIndex)).className="button"; Pages(parseInt(TabIndex)).style.display="block"; } </script> \ No newline at end of file |
From: <td...@us...> - 2003-12-11 05:18:35
|
Update of /cvsroot/anyedit/AnyEditBin In directory sc8-pr-cvs1:/tmp/cvs-serv17068 Modified Files: AnyEdit.exe SciLexer.dll Log Message: - New binaries Index: AnyEdit.exe =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/AnyEdit.exe,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsZK5xIk and /tmp/cvsKrlIvE differ Index: SciLexer.dll =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/SciLexer.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs97jQlQ and /tmp/cvsyTOtHw differ |
From: <td...@us...> - 2003-12-11 04:15:24
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv9174 Modified Files: AnyEdit.cpp AnyEdit.h AnyEditView.cpp AnyEditView.h ReadMe.txt Log Message: - Fixed LPCSTR related issues Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** AnyEdit.cpp 7 Dec 2003 17:06:10 -0000 1.37 --- AnyEdit.cpp 11 Dec 2003 04:15:21 -0000 1.38 *************** *** 554,564 **** LPCSTR CAnyEditApp::GetAppPath() { ! /*TCHAR filName[_MAX_PATH]; ! GetModuleFileName(NULL,filName, _MAX_PATH); ! CString tempAppPath = msc.GetParentFolderForFile(filName); ! return tempAppPath;*/ ! CString retPath; ! retPath=m_appPath; ! return retPath; } --- 554,558 ---- LPCSTR CAnyEditApp::GetAppPath() { ! return m_appPath; } *************** *** 1106,1110 **** } ! LPCSTR CAnyEditApp::SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla) { --- 1100,1104 ---- } ! CString CAnyEditApp::SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla) { *************** *** 1252,1256 **** } ! LPCSTR CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; --- 1246,1250 ---- } ! CString CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** AnyEdit.h 7 Dec 2003 17:06:10 -0000 1.31 --- AnyEdit.h 11 Dec 2003 04:15:21 -0000 1.32 *************** *** 64,68 **** void OpenBrowserWindow(LPCSTR url); CObject * LoadLanguage(LPCSTR langpos); ! LPCSTR SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); --- 64,68 ---- void OpenBrowserWindow(LPCSTR url); CObject * LoadLanguage(LPCSTR langpos); ! CString SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); *************** *** 103,107 **** LPCSTR GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject=false); ! LPCSTR GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); --- 103,107 ---- LPCSTR GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject=false); ! CString GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** AnyEditView.cpp 7 Dec 2003 17:06:11 -0000 1.39 --- AnyEditView.cpp 11 Dec 2003 04:15:21 -0000 1.40 *************** *** 1099,1103 **** ! LPCSTR CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; --- 1099,1103 ---- ! CString CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** AnyEditView.h 7 Dec 2003 17:06:11 -0000 1.21 --- AnyEditView.h 11 Dec 2003 04:15:21 -0000 1.22 *************** *** 72,76 **** void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! LPCSTR GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); --- 72,76 ---- void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! CString GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); Index: ReadMe.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ReadMe.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReadMe.txt 22 Sep 2002 08:27:56 -0000 1.1 --- ReadMe.txt 11 Dec 2003 04:15:21 -0000 1.2 *************** *** 1,2 **** Look at the Readme folder for more information ! Developers have a look at devreadme.txt \ No newline at end of file --- 1,4 ---- Look at the Readme folder for more information ! Developers have a look at devreadme.txt ! ! GetPathName() seems to return wrong valu..! \ No newline at end of file |
From: <moo...@us...> - 2003-12-08 08:11:24
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv19301 Modified Files: ProjectTree.h StdAfx.h Log Message: Moved the Pug XML defines to StdAfx.h. This way it is only defined once for all the classes that use the Pug XML library. Index: ProjectTree.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ProjectTree.h 28 Nov 2003 13:20:37 -0000 1.6 --- ProjectTree.h 8 Dec 2003 08:11:20 -0000 1.7 *************** *** 7,13 **** // ProjectTree.h : header file // - #define PUGAPI_VARIANT 0x58475550 //The Pug XML library variant we are using in this implementation. - #define PUGAPI_VERSION_MAJOR 1 //The Pug XML library major version we are using in this implementation. - #define PUGAPI_VERSION_MINOR 2 //The Pug XML library minor version we are using in this implementation. #include "stdlib.h" --- 7,10 ---- *************** *** 25,48 **** enum project_item_types { ! ITEM_WORKSPACE, ! ITEM_PROJECT, ! ITEM_FOLDER, ! ITEM_FILE }; enum file_path_type { ! PATH_FULL, ! PATH_PARTIAL }; enum project_image_types { ! IMG_WORKSPACE, ! IMG_OFOLDER, ! IMG_FILE, ! IMG_PROJECT, ! IMG_FOLDER, ! IMG_INVALID }; --- 22,45 ---- enum project_item_types { ! ITEM_WORKSPACE, ! ITEM_PROJECT, ! ITEM_FOLDER, ! ITEM_FILE }; enum file_path_type { ! PATH_FULL, ! PATH_PARTIAL }; enum project_image_types { ! IMG_WORKSPACE, ! IMG_OFOLDER, ! IMG_FILE, ! IMG_PROJECT, ! IMG_FOLDER, ! IMG_INVALID }; *************** *** 50,73 **** { public: ! ProjectItem() ! { ! } ! ProjectItem(LPCSTR itemname, LPCSTR filepath,LPCSTR parentpath,int itype,int iimage ) ! { ! if(itemname) ItemName = itemname; ! if(filepath) FilePath = filepath; ! if(parentpath) parent_path = parentpath; ! type = itype; ! item_image = iimage; ! changed=FALSE; ! } ! ! int type; ! BOOL changed; ! CString ItemName; ! CString FilePath; ! int item_image; ! CString parent_path; }; --- 47,70 ---- { public: ! ProjectItem() ! { ! } ! ProjectItem(LPCSTR itemname, LPCSTR filepath,LPCSTR parentpath,int itype,int iimage ) ! { ! if(itemname) ItemName = itemname; ! if(filepath) FilePath = filepath; ! if(parentpath) parent_path = parentpath; ! type = itype; ! item_image = iimage; ! changed=FALSE; ! } ! ! int type; ! BOOL changed; ! CString ItemName; ! CString FilePath; ! int item_image; ! CString parent_path; }; *************** *** 89,94 **** BOOL m_bIsLoaded; stack<HTREEITEM> iStack; ! HTREEITEM m_ActiveProject; ! // Operations public: --- 86,91 ---- BOOL m_bIsLoaded; stack<HTREEITEM> iStack; ! HTREEITEM m_ActiveProject; ! // Operations public: *************** *** 116,145 **** HTREEITEM GetProjectItemForString(LPCSTR itemText); BOOL LoadProjectFile(LPCSTR filPath,BOOL path=FALSE); ! void AddFileUnderProject(LPCSTR projectname, LPCSTR filepath); protected: ! //New Implementation added functions ! BOOL DoesItemContainType(HTREEITEM hItem, int type, LPCSTR name,BOOL fname=FALSE); ! BOOL DoesProjectContainFile(HTREEITEM pitem, LPCSTR filename); ! void UpdateWorkspaceEntry(); ! BOOL AddProjectItemFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddProjectFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddFolderFromXmlNode(xml_node * node); ! BOOL AddFileFromXmlNode(xml_node * node); ! void SetActiveProject(CString &pfname,BOOL first=FALSE); void ShowOpenDialogForFiles(); ! void AddNewFolder(); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! HTREEITEM GetProjectItemForItem(HTREEITEM hItem); ! void SetDirty(HTREEITEM hItem); ! //to save a project file ! void SaveItemAsElement(HTREEITEM hItem,xml_node * node); BOOL SaveWSProjectToFile(HTREEITEM proItem,BOOL checkchange=FALSE); ! //Delete resources... ! void DeleteTreeResourcesFromItem(HTREEITEM hItem); ! //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); --- 113,142 ---- HTREEITEM GetProjectItemForString(LPCSTR itemText); BOOL LoadProjectFile(LPCSTR filPath,BOOL path=FALSE); ! void AddFileUnderProject(LPCSTR projectname, LPCSTR filepath); protected: ! //New Implementation added functions ! BOOL DoesItemContainType(HTREEITEM hItem, int type, LPCSTR name,BOOL fname=FALSE); ! BOOL DoesProjectContainFile(HTREEITEM pitem, LPCSTR filename); ! void UpdateWorkspaceEntry(); ! BOOL AddProjectItemFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddProjectFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddFolderFromXmlNode(xml_node * node); ! BOOL AddFileFromXmlNode(xml_node * node); ! void SetActiveProject(CString &pfname,BOOL first=FALSE); void ShowOpenDialogForFiles(); ! void AddNewFolder(); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! HTREEITEM GetProjectItemForItem(HTREEITEM hItem); ! void SetDirty(HTREEITEM hItem); ! //to save a project file ! void SaveItemAsElement(HTREEITEM hItem,xml_node * node); BOOL SaveWSProjectToFile(HTREEITEM proItem,BOOL checkchange=FALSE); ! //Delete resources... ! void DeleteTreeResourcesFromItem(HTREEITEM hItem); ! //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); Index: StdAfx.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/StdAfx.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StdAfx.h 8 May 2003 12:00:56 -0000 1.3 --- StdAfx.h 8 Dec 2003 08:11:20 -0000 1.4 *************** *** 13,29 **** #pragma warning( disable : 4100 ) ! #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxadv.h> ! #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT ! #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include "./includes/htmlhelp.h" //HTML help :) ! #include "./includes/bcgcb.h" // BCG Control Bar //{{AFX_INSERT_LOCATION}} --- 13,34 ---- #pragma warning( disable : 4100 ) ! #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxadv.h> ! #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT ! #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include "./includes/htmlhelp.h" //HTML help :) ! #include "./includes/bcgcb.h" // BCG Control Bar ! ! // The defines for the Pug XML Library ! #define PUGAPI_VARIANT 0x58475550 //The Pug XML library variant we are using in this implementation. ! #define PUGAPI_VERSION_MAJOR 1 //The Pug XML library major version we are using in this implementation. ! #define PUGAPI_VERSION_MINOR 2 //The Pug XML library minor version we are using in this implementation. //{{AFX_INSERT_LOCATION}} |
From: <moo...@us...> - 2003-12-08 08:01:09
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv17674 Modified Files: SortedArray.h Log Message: CSortedArray template caused Stack Overflows Changed the sorting algorithm to Heapsort. This doesn't use recursion at a small speed penalty, but doesn't cause stack overflows. Index: SortedArray.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/SortedArray.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SortedArray.h 8 May 2003 12:00:56 -0000 1.2 --- SortedArray.h 8 Dec 2003 08:01:04 -0000 1.3 *************** *** 8,11 **** --- 8,17 ---- PJN / 22-02-2000 Fixed a problem in CSortedArray::Find when there are no items in the array PJN / 29-02-2000 Fixed a problem in CSortedArray::Sort when there are no items in the array + + Leon Wennekers, 4 December 2003, Change for AnyEdit. + Because sorting an CString SortedArray with 7 CString caused a stack overflow, + I rewrote the Sort routine. It now uses the Heap Sort algorithm, which is a + little bit slower then the old routine, but if you'll notice sorting is slow, + it's time to use a database. Copyright (c) 1999 - 2000 by PJ Naughter. *************** *** 60,63 **** --- 66,70 ---- LPCOMPARE_FUNCTION m_lpfnCompareFunction; void swap(ARG_TYPE element1, ARG_TYPE element2); + void SortHelper(int root, int bottom); }; *************** *** 245,250 **** ! template <class TYPE, class ARG_TYPE> void CSortedArray<TYPE, ARG_TYPE>::Sort(int nLowIndex, int nHighIndex) --- 252,258 ---- + // (LW) If you like the old routine. Here it still is. ! /*template <class TYPE, class ARG_TYPE> void CSortedArray<TYPE, ARG_TYPE>::Sort(int nLowIndex, int nHighIndex) *************** *** 284,288 **** --- 292,377 ---- Sort(left, last-1); Sort(last+1, right); + }*/ + + // (LW) Here is the new Heap Sort routines. Split in two function. + // It's slower than merge or quick sort, but it doesn't use + // recursion. So less change we get a stack overflow. + + template + <class TYPE, class ARG_TYPE> + void CSortedArray<TYPE, ARG_TYPE>::SortHelper( int root, int bottom) + { + int done; + int maxChild; + TYPE temp; + + done = 0; + while( (root*2 <= bottom ) && (!done) ) + { + if( root*2 == bottom ) + maxChild = root * 2; + else if( m_lpfnCompareFunction(ElementAt(root*2), ElementAt(root*2+1)) == 1 ) + maxChild = root * 2; + else + maxChild = root * 2 + 1; + + if( m_lpfnCompareFunction(ElementAt(root), ElementAt(maxChild)) == -1 ) + { + temp = ElementAt(root); + SetAt( root, ElementAt(maxChild) ); + SetAt( maxChild, temp ); + root = maxChild; + } + else + done = 1; + } } + template + <class TYPE, class ARG_TYPE> + void CSortedArray<TYPE, ARG_TYPE>::Sort(int nLowIndex, int nHighIndex) + { + ASSERT(m_lpfnCompareFunction != NULL); //Did you forget to call SetCompareFunction prior to calling this function + + //If there are no items in the array, then return immediately + if (GetSize() == 0) + return; + + // int left = nLowIndex; + // int right = nHighIndex; + int index; + TYPE temp; + + if (nHighIndex == -1) + nHighIndex = GetUpperBound(); + + if (nHighIndex-nLowIndex <= 0) //Do nothing if fewer than 2 elements are to be sorted + return; + + // (not really needed, just to optimize) + if (nHighIndex-nLowIndex == 1) //Do a simple comparison if only 2 elements + { + if (m_lpfnCompareFunction(ElementAt(nHighIndex), ElementAt(nLowIndex)) == -1) + { + // swap(ElementAt(nLowIndex), ElementAt(nHighIndex)); + temp = ElementAt(nLowIndex); + SetAt( nLowIndex, ElementAt(nHighIndex) ); + SetAt( nHighIndex, temp ); + } + return; + } + + for( index = ( nHighIndex - nLowIndex ) / 2; index >= 0; -- index ) + { + SortHelper( index, nHighIndex - nLowIndex ); + } + + for( index = nHighIndex - nLowIndex; index >= 1; -- index ) + { + temp = ElementAt(0); + SetAt( 0, ElementAt(index) ); + SetAt( index, temp ); + SortHelper( 0, index - 1 ); + } + } #endif //__SORTEDARRAY_H__ |
From: <td...@us...> - 2003-12-07 17:06:15
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv4740 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEdit.h AnyEdit.rc AnyEditView.cpp AnyEditView.h ChangeLog.txt QuickJump.cpp RegProfile.h resource.h scintillaif.cpp scintillaif.h Log Message: - Added macro support - Added document position saving support Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AnyEdit.cpp 2 Dec 2003 12:03:34 -0000 1.36 --- AnyEdit.cpp 7 Dec 2003 17:06:10 -0000 1.37 *************** *** 64,68 **** ON_COMMAND(ID_FILE_NEW, OnFileNew) ON_COMMAND(ID_FILE_OPENSTARTUPPAGE, OnFileOpenstartuppage) ! //}}AFX_MSG_MAP // Standard file based document commands ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) --- 64,72 ---- ON_COMMAND(ID_FILE_NEW, OnFileNew) ON_COMMAND(ID_FILE_OPENSTARTUPPAGE, OnFileOpenstartuppage) ! ON_COMMAND(ID_TOOLS_SAVEMACRO, OnToolsSavemacro) ! ON_UPDATE_COMMAND_UI(ID_TOOLS_SAVEMACRO, OnUpdateToolsSavemacro) ! ON_COMMAND(ID_TOOLS_LOADMACRO, OnToolsLoadmacro) ! ON_UPDATE_COMMAND_UI(ID_TOOLS_LOADMACRO, OnUpdateToolsLoadmacro) ! //}}AFX_MSG_MAP // Standard file based document commands ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) *************** *** 84,91 **** --- 88,104 ---- m_bLastParsedFileInCurrentProject=false; pluginHead=NULL; + macroholder=NULL; + isRecordingMacro=FALSE; } CAnyEditApp::~CAnyEditApp() { + if(macroholder) + { + macroholder->DeleteNext(); + delete macroholder; + macroholder=NULL; + } + POSITION pos = langmap.GetStartPosition(); *************** *** 222,225 **** --- 235,240 ---- pMainFrame->ShowWindow(m_nCmdShow); pMainFrame->UpdateWindow(); + //Load document save positions + LoadDocumentPosition(); //check for leaks *************** *** 435,438 **** --- 450,456 ---- delete m_ClassViewParserThread; m_ClassViewParserThread=NULL; + + //Save doc positions + SaveDocumentPosition(); //Delete all the files in the temp folder *************** *** 1491,1493 **** --- 1509,1684 ---- if(lang)lang->LoadAcmpFile(); } + } + + void CAnyEditApp::OnToolsSavemacro() + { + // TODO: Add your command handler code here + + CString str; + if(theApp.DoPromptFileName(str,_T("Choose file to save macro"),OFN_HIDEREADONLY,FALSE)) + { + + CStringArray arr; + MacroHolder * mh = macroholder; + while(mh) + { + CString tstr; + mh->ToString(tstr); + arr.Add(tstr); + mh = mh->next; + } + + msc.WriteArrayToFile(arr,str); + } + + } + + void CAnyEditApp::OnUpdateToolsSavemacro(CCmdUI* pCmdUI) + { + if(macroholder) + { + if(!isRecordingMacro) + { + pCmdUI->Enable(); + return; + } + } + + pCmdUI->Enable(FALSE); + } + + void CAnyEditApp::OnToolsLoadmacro() + { + if(!isRecordingMacro) + { + CString str; + if(theApp.DoPromptFileName(str,_T("Open macro file"),OFN_HIDEREADONLY,TRUE)) + { + CStringArray arr; + msc.LoadFileToArray(str,arr); + if(macroholder) + { + macroholder->DeleteNext(); + delete macroholder; + macroholder=NULL; + } + + for(int i=0;i<arr.GetSize();i++) + { + CStringArray tarr; + CString macrostr = arr[i]; + msc.ReturnDelimitedArray(macrostr,"µ",tarr); + if(tarr.GetSize() >= 2) + { + MacroHolder * nm = new MacroHolder; + nm->message = msc.GetIntForString(tarr[0]); + nm->wParam = msc.GetIntForString(tarr[1]); + nm->lParam = msc.GetIntForString(tarr[2]); + if(nm->message == SCI_REPLACESEL) + { + if(tarr.GetSize() >= 3) + strcpy(nm->replacesel,tarr[3].GetBuffer(tarr[3].GetLength())); + } + + if(macroholder) + { + MacroHolder * tmacro = theApp.macroholder; + while(tmacro->next){tmacro=tmacro->next;} + tmacro->next = nm; + }else macroholder = nm; + + } + + } + + + } + + } + } + + void CAnyEditApp::OnUpdateToolsLoadmacro(CCmdUI* pCmdUI) + { + if(isRecordingMacro) pCmdUI->Enable(FALSE); + else pCmdUI->Enable(); + } + + void CAnyEditApp::SetDocumentPosition(LPCSTR filepath, long startpos, long endpos,int visline) + { + CString fpath = msc.ChangeFormatToFilePath(filepath); + for(int i=0;i<m_docPos.GetSize();i++) + { + if(m_docPos[i].file_path == fpath) + { + m_docPos[i].initial_pos = startpos; + m_docPos[i].final_pos = endpos; + m_docPos[i].visible_line = visline; + return; + } + } + + DocumentPosition dpos; + dpos.file_path = fpath; + dpos.initial_pos = startpos; + dpos.final_pos = endpos; + dpos.visible_line = visline; + + m_docPos.InsertAt(0,dpos); + } + + BOOL CAnyEditApp::GetDocumentPosition(LPCSTR filepath, long &startpos, long &endpos,int &visline) + { + CString fpath = msc.ChangeFormatToFilePath(filepath); + for(int i=0;i<m_docPos.GetSize();i++) + { + if(m_docPos[i].file_path == fpath) + { + startpos = m_docPos[i].initial_pos; + endpos = m_docPos[i].final_pos; + visline = m_docPos[i].visible_line; + return TRUE; + } + } + + return FALSE; + } + + void CAnyEditApp::SaveDocumentPosition() + { + int cnt = 25; + if(m_docPos.GetSize() < cnt) cnt = m_docPos.GetSize(); + + m_reg.WriteProfileInt(SEC_DOCPOS,_T("Count"),cnt); + for(int i=0;i<cnt;i++) + { + CString savepos = m_docPos[i].file_path; + savepos += "|"; + savepos += msc.GetStringForInt(m_docPos[i].initial_pos); + savepos += "|"; + savepos += msc.GetStringForInt(m_docPos[i].final_pos); + savepos += "|"; + savepos += msc.GetStringForInt(m_docPos[i].visible_line); + m_reg.WriteProfileString(SEC_DOCPOS, msc.GetStringForInt(i),savepos); + } + } + + void CAnyEditApp::LoadDocumentPosition() + { + TCHAR tempStr[1024]; + int cnt = m_reg.GetProfileInt(SEC_DOCPOS,_T("Count"),0); + for(int i=0;i<cnt;i++) + { + CString docpos = m_reg.GetProfileString(SEC_DOCPOS,msc.GetStringForInt(i),tempStr,""); + CStringArray arr; + msc.ReturnDelimitedArray(docpos,"|",arr); + if(arr.GetSize()== 4) + { + DocumentPosition dp; + dp.file_path = arr[0]; + dp.initial_pos = msc.GetIntForString(arr[1]); + dp.final_pos = msc.GetIntForString(arr[2]); + dp.visible_line = msc.GetIntForString(arr[3]); + m_docPos.Add(dp); + } + } } Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AnyEdit.dsp 28 Nov 2003 13:20:36 -0000 1.27 --- AnyEdit.dsp 7 Dec 2003 17:06:10 -0000 1.28 *************** *** 76,80 **** # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" ! # ADD RSC /l 0x409 /i "f:\WORKING\BGCONTROL\NBCGCONTROLBAR" /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo --- 76,80 ---- # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" ! # ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AnyEdit.h 2 Dec 2003 12:03:35 -0000 1.30 --- AnyEdit.h 7 Dec 2003 17:06:10 -0000 1.31 *************** *** 35,38 **** --- 35,47 ---- #include "Plugin.h" + //Save final position + struct DocumentPosition + { + CString file_path; + long initial_pos; + long final_pos; + int visible_line; + }; + class CAnyEditApp : public CDumpHandleApp { *************** *** 100,103 **** --- 109,114 ---- void UnloadPlugins(); void PluginMenuClicked(UINT id); + BOOL GetDocumentPosition(LPCSTR filepath,long &startpos,long &endpos,int &visline); + void SetDocumentPosition(LPCSTR filepath, long startpos, long endpos, int visline); void SetModification(BOOL modval) { *************** *** 148,151 **** --- 159,166 ---- CComboBox * funcbox; + //For macro support + MacroHolder * macroholder; + BOOL isRecordingMacro; + protected: CMultiDocTemplate* pDocTemplate; //was taken from .cpp after loadstdprofilesettings *************** *** 166,172 **** --- 181,190 ---- BOOL lastsearchdirection; AEPlugin * pluginHead; + CArray<DocumentPosition,DocumentPosition> m_docPos; CPlugin plugin; protected: + void LoadDocumentPosition(); + void SaveDocumentPosition(); void LoadGlobalSettings(); *************** *** 189,193 **** afx_msg void OnFileNew(); afx_msg void OnFileOpenstartuppage(); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() --- 207,215 ---- afx_msg void OnFileNew(); afx_msg void OnFileOpenstartuppage(); ! afx_msg void OnToolsSavemacro(); ! afx_msg void OnUpdateToolsSavemacro(CCmdUI* pCmdUI); ! afx_msg void OnToolsLoadmacro(); ! afx_msg void OnUpdateToolsLoadmacro(CCmdUI* pCmdUI); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AnyEdit.rc 25 Nov 2003 15:05:56 -0000 1.28 --- AnyEdit.rc 7 Dec 2003 17:06:10 -0000 1.29 *************** *** 394,424 **** MENUITEM SEPARATOR ! MENUITEM "Record Keystrokes", ID_TOOLS_RECORDMACRO ! MENUITEM "Stop Recording", ID_TOOLS_STOPRECORDING ! MENUITEM "Repeat Command", ID_TOOLS_REPEATCOMMAND MENUITEM SEPARATOR - POPUP "Play Keystrokes" - BEGIN - MENUITEM "Keystroke &1", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE1 - - MENUITEM "Keystroke &2", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE2 - - MENUITEM "Keystroke &3", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE3 - - MENUITEM "Keystroke &4", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE4 - - MENUITEM "Keystroke &5", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE5 - - MENUITEM "Keystroke &6", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE6 - - MENUITEM "Keystroke &7", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE7 - - MENUITEM "Keystroke &8", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE8 - - MENUITEM "Keystroke &9", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE9 - - MENUITEM "Keystroke 1&0", ID_TOOLS_PLAYKEYSTROKES_KEYSTROKE10 - - END POPUP "Current Doc Tools" BEGIN --- 394,404 ---- MENUITEM SEPARATOR ! MENUITEM "Record Macro\tCtrl+Shift+R", ID_TOOLS_RECORDMACRO ! MENUITEM "Play Recording\tCtrl+Shift+P", ID_TOOLS_PLAYRECORDING ! MENUITEM "Repeat Macro", ID_TOOLS_REPEATCOMMAND ! MENUITEM SEPARATOR ! MENUITEM "Save Macro", ID_TOOLS_SAVEMACRO ! MENUITEM "Load Macro", ID_TOOLS_LOADMACRO MENUITEM SEPARATOR POPUP "Current Doc Tools" BEGIN *************** *** 1216,1219 **** --- 1196,1203 ---- "H", ID_SEARCH_FINDREPLACE, VIRTKEY, CONTROL, NOINVERT "J", ID_SEARCH_QUICKJUMP, VIRTKEY, CONTROL, NOINVERT + "P", ID_TOOLS_PLAYRECORDING, VIRTKEY, SHIFT, CONTROL, + NOINVERT + "R", ID_TOOLS_RECORDMACRO, VIRTKEY, SHIFT, CONTROL, + NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_F2, ID_SEARCH_BOOKMARK_NEXTBOOKMARK, VIRTKEY, NOINVERT *************** *** 1628,1632 **** STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Clip Text Editor" ! FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,185,212,50,14 --- 1612,1616 ---- STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Clip Text Editor" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,185,212,50,14 Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AnyEditView.cpp 2 Dec 2003 12:03:35 -0000 1.38 --- AnyEditView.cpp 7 Dec 2003 17:06:11 -0000 1.39 *************** *** 94,98 **** ON_COMMAND(ID_SEARCH_GOTOLINE, OnSearchGotoline) ON_COMMAND(ID_TOOLS_RECORDMACRO, OnToolsRecordmacro) - ON_COMMAND(ID_TOOLS_STOPRECORDING, OnToolsStoprecording) ON_COMMAND(ID_TOOLS_HIGHLIGHTCURRENTLINE, OnToolsHighlightcurrentline) ON_UPDATE_COMMAND_UI(ID_TOOLS_HIGHLIGHTCURRENTLINE, OnUpdateToolsHighlightcurrentline) --- 94,97 ---- *************** *** 109,112 **** --- 108,116 ---- ON_WM_DESTROY() ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview) + ON_COMMAND(ID_TOOLS_REPEATCOMMAND, OnToolsRepeatcommand) + ON_COMMAND(ID_TOOLS_PLAYRECORDING, OnToolsPlayrecording) + ON_UPDATE_COMMAND_UI(ID_TOOLS_RECORDMACRO, OnUpdateToolsRecordmacro) + ON_UPDATE_COMMAND_UI(ID_TOOLS_PLAYRECORDING, OnUpdateToolsPlayrecording) + ON_UPDATE_COMMAND_UI(ID_TOOLS_REPEATCOMMAND, OnUpdateToolsRepeatcommand) //}}AFX_MSG_MAP ON_WM_CONTEXTMENU() *************** *** 350,358 **** break; case SCN_MACRORECORD: ! AfxMessageBox(msc.GetStringForInt(scn->message)); ! AfxMessageBox(msc.GetStringForInt(scn->wParam)); ! AfxMessageBox(msc.GetStringForInt(scn->lParam)); ! break; } --- 354,377 ---- break; case SCN_MACRORECORD: ! MacroHolder * newmacro = new MacroHolder; ! newmacro->message = scn->message; ! newmacro->lParam = scn->lParam; ! newmacro->wParam = scn->wParam; ! if(newmacro->message == SCI_REPLACESEL) ! { ! char * sel = (char *) newmacro->lParam; ! if(strlen(sel)==1) ! { ! strcpy(newmacro->replacesel,sel); ! } ! } ! if(theApp.macroholder) ! { ! MacroHolder * tmacro = theApp.macroholder; ! while(tmacro->next){tmacro=tmacro->next;} ! tmacro->next = newmacro; ! }else theApp.macroholder = newmacro; + break; } *************** *** 581,586 **** if(proarr.GetSize() == 0) { ! theApp.SetSelectedLine(((CTagEntry ! *)dwData)->lineno-1); } else --- 600,604 ---- if(proarr.GetSize() == 0) { ! theApp.SetSelectedLine(((CTagEntry *)dwData)->lineno-1); } else *************** *** 595,600 **** char file_ext[_MAX_EXT]; CString targetName,targetExt; ! _splitpath(((CTagEntry ! *)dwData)->filename,file_drive,file_path,file_name,file_ext); targetName=file_name; targetExt=file_ext; --- 613,617 ---- char file_ext[_MAX_EXT]; CString targetName,targetExt; ! _splitpath(((CTagEntry *)dwData)->filename,file_drive,file_path,file_name,file_ext); targetName=file_name; targetExt=file_ext; *************** *** 613,621 **** if(!realpath.IsEmpty()) ! theApp.GotoFileAndLine(((CTagEntry ! *)dwData)->lineno,realpath); else ! theApp.SetSelectedLine(((CTagEntry ! *)dwData)->lineno-1); } } --- 630,636 ---- if(!realpath.IsEmpty()) ! theApp.GotoFileAndLine(((CTagEntry *)dwData)->lineno,realpath); else ! theApp.SetSelectedLine(((CTagEntry *)dwData)->lineno-1); } } *************** *** 674,678 **** { - m_Scintilla.SetSel(0,0); CString docname = GetDocument()->GetPathName(); if(!docname.IsEmpty()) --- 689,692 ---- *************** *** 703,707 **** { CView::OnInitialUpdate(); ! JustOpenedFile(); } --- 717,733 ---- { CView::OnInitialUpdate(); ! JustOpenedFile(); ! ! //Check for previously saved document position and restore if any ! char tpath[500]; ! strcpy(tpath,CurDocPath.GetBuffer(CurDocPath.GetLength())); ! long startpos=0,endpos=0; ! int visline=0; ! if(theApp.GetDocumentPosition(tpath,startpos,endpos,visline)) ! { ! m_Scintilla.SetSel(startpos,endpos); ! int i = m_Scintilla.GetFirstVisibleLine(); ! m_Scintilla.LineScroll(0,visline-i); ! } } *************** *** 1906,1915 **** void CAnyEditView::OnToolsRecordmacro() { ! //m_Scintilla.StartRecord(); } ! void CAnyEditView::OnToolsStoprecording() { ! //m_Scintilla.StopRecord(); } --- 1932,1964 ---- void CAnyEditView::OnToolsRecordmacro() { ! if(theApp.isRecordingMacro) ! { ! m_Scintilla.StopRecord(); ! theApp.isRecordingMacro=FALSE; ! } ! else ! { ! if(theApp.macroholder) ! { ! theApp.macroholder->DeleteNext(); ! delete theApp.macroholder; ! theApp.macroholder=NULL; ! } ! m_Scintilla.StartRecord(); ! theApp.isRecordingMacro=TRUE; ! } } ! void CAnyEditView::OnToolsPlayrecording() { ! if(!theApp.isRecordingMacro) ! { ! if(theApp.macroholder) ! { ! m_Scintilla.BeginUndoAction(); ! m_Scintilla.PerformMacro(theApp.macroholder); ! m_Scintilla.EndUndoAction(); ! } ! } } *************** *** 2040,2043 **** --- 2089,2103 ---- { CView::OnDestroy(); + + //Set document save point + char tpath[500]; + strcpy(tpath,CurDocPath.GetBuffer(CurDocPath.GetLength())); + long startpos=0,endpos=0; + int visline=0; + startpos = m_Scintilla.GetSelectionStart(); + endpos = m_Scintilla.GetSelectionEnd(); + visline = m_Scintilla.GetFirstVisibleLine(); + theApp.SetDocumentPosition(tpath,startpos,endpos,visline); + CDocument* pDoc=GetDocument(); if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) *************** *** 2057,2060 **** --- 2117,2121 ---- }; + } *************** *** 2074,2076 **** --- 2135,2198 ---- // TODO: Add your command handler code here BCGPrintPreview(this); + } + + void CAnyEditView::OnToolsRepeatcommand() + { + //Right now a place holder to test macros.. :) + if(theApp.macroholder) + { + CInputBox inpBox(_T("Repeat Macro"),_T("Enter no of times"),_T("1")); + if(inpBox.DoModal()==IDOK) + { + CString tstr = inpBox.GetOutput(); + int num = msc.GetIntForString(tstr); + if(num > 0) + { + m_Scintilla.BeginUndoAction(); + for(int i=0;i<num;i++) + { + m_Scintilla.PerformMacro(theApp.macroholder); + } + m_Scintilla.EndUndoAction(); + } + } + } + } + + void CAnyEditView::OnUpdateToolsRecordmacro(CCmdUI* pCmdUI) + { + if(theApp.isRecordingMacro) + { + pCmdUI->SetText("Stop Record\tCtrl+Shift+R"); + } + else + { + pCmdUI->SetText("Record Macro\tCtrl+Shift+R"); + } + } + + void CAnyEditView::OnUpdateToolsPlayrecording(CCmdUI* pCmdUI) + { + if(theApp.macroholder) + { + if(!theApp.isRecordingMacro) + { + pCmdUI->Enable(); + return; + } + } + pCmdUI->Enable(FALSE); + } + + void CAnyEditView::OnUpdateToolsRepeatcommand(CCmdUI* pCmdUI) + { + if(theApp.macroholder) + { + if(!theApp.isRecordingMacro) + { + pCmdUI->Enable(); + return; + } + } + pCmdUI->Enable(FALSE); } Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AnyEditView.h 28 Nov 2003 13:20:37 -0000 1.20 --- AnyEditView.h 7 Dec 2003 17:06:11 -0000 1.21 *************** *** 159,163 **** afx_msg void OnSearchGotoline(); afx_msg void OnToolsRecordmacro(); - afx_msg void OnToolsStoprecording(); afx_msg void OnToolsHighlightcurrentline(); afx_msg void OnUpdateToolsHighlightcurrentline(CCmdUI* pCmdUI); --- 159,162 ---- *************** *** 174,177 **** --- 173,181 ---- afx_msg void OnDestroy(); afx_msg void OnFilePrintPreview(); + afx_msg void OnToolsRepeatcommand(); + afx_msg void OnToolsPlayrecording(); + afx_msg void OnUpdateToolsRecordmacro(CCmdUI* pCmdUI); + afx_msg void OnUpdateToolsPlayrecording(CCmdUI* pCmdUI); + afx_msg void OnUpdateToolsRepeatcommand(CCmdUI* pCmdUI); //}}AFX_MSG afx_msg void OnEditFind(); Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ChangeLog.txt 28 Nov 2003 13:20:37 -0000 1.33 --- ChangeLog.txt 7 Dec 2003 17:06:11 -0000 1.34 *************** *** 2,5 **** --- 2,11 ---- ============ + Beta 2.0 + -------- + 1) Added macro support + 2) Added document position saving support + + Beta 2.0 [Tester's Release 2] -------- *************** *** 95,118 **** - Alpha 9.0 - Give Me Beta ! - -------------------------- - - 1) Added Initial CTags Support - 2) Fixed up flicker in ClassView - 3) Fixed up tool execution bug wherein tools dont work when paths have spaces - 4) AE now adds on document words in autocompletion list ;) - 5) Multiline Clip Text insertion works now - 6) Startup page starting is configurable - I know some of you hate it :) - 7) Added many new options - Remaining --------- 1) Code completion - 2) Workspace loading bug - Will be finished only when rewriting the entire workspace handling ! - - Remaining later --- - --------------- - Rewrite entire workspace handling .... --- 101,108 ---- Index: QuickJump.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/QuickJump.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** QuickJump.cpp 2 Dec 2003 12:03:35 -0000 1.5 --- QuickJump.cpp 7 Dec 2003 17:06:11 -0000 1.6 *************** *** 197,236 **** void CQuickJump::FillTagList() { ! /* CTagList * taglist = theApp.GetCurrentTagList(); ! CObList * classlist = taglist->GetClassList(); POSITION pos = classlist->GetHeadPosition(); while(pos != NULL) { ! CTagEntry ! * ent = (CTagEntry ! *)classlist->GetNext(pos); InsertMember(ent->tagname,0,0,ent->lineno,(DWORD)ent); } ! CObList * functionlist = taglist->GetFunctionList(); pos = functionlist->GetHeadPosition(); while(pos != NULL) { ! CTagEntry ! * ent = (CTagEntry ! *)functionlist->GetNext(pos); ! int imtype=8; ! ! switch(ent->access) ! { ! case 1: ! imtype=1; ! break; ! case 2: ! imtype=4; ! break; ! case 3: ! imtype=3; ! } ! ! InsertMember(ent->tagname,imtype,1,ent->lineno,(DWORD)ent); ! }*/ } --- 197,218 ---- void CQuickJump::FillTagList() { ! CTagList * taglist = theApp.GetCurrentTagList(); ! CObList * classlist = taglist->GetParentList(); POSITION pos = classlist->GetHeadPosition(); while(pos != NULL) { ! CTagEntry * ent = (CTagEntry*)classlist->GetNext(pos); InsertMember(ent->tagname,0,0,ent->lineno,(DWORD)ent); } ! CObList * functionlist = taglist->GetChildList(); pos = functionlist->GetHeadPosition(); while(pos != NULL) { ! CTagEntry * ent = (CTagEntry*)functionlist->GetNext(pos); ! InsertMember(ent->tagname,ent->imagetype,1,ent->lineno,(DWORD)ent); ! } } *************** *** 240,246 **** NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; int cursel = pNMListView->iItem; ! CTagEntry ! * s = (CTagEntry ! *)m_qlist.GetItemData(cursel); if(s) theApp.GotoFileAndLine(s->lineno,s->filename); --- 222,226 ---- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; int cursel = pNMListView->iItem; ! CTagEntry * s = (CTagEntry*)m_qlist.GetItemData(cursel); if(s) theApp.GotoFileAndLine(s->lineno,s->filename); *************** *** 257,263 **** if(csel>=0) { ! CTagEntry ! * s = (CTagEntry ! *)m_qlist.GetItemData(csel); if(s!=NULL) { --- 237,241 ---- if(csel>=0) { ! CTagEntry * s = (CTagEntry *)m_qlist.GetItemData(csel); if(s!=NULL) { Index: RegProfile.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/RegProfile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RegProfile.h 25 Nov 2003 15:05:56 -0000 1.5 --- RegProfile.h 7 Dec 2003 17:06:11 -0000 1.6 *************** *** 38,41 **** --- 38,42 ---- #define SEC_PREF _T("Preferences") #define SEC_DEF _T("Preferences\\Defaults") + #define SEC_DOCPOS _T("Preferences\\DocPos") // Registry keys for default editor prefs Index: resource.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/resource.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** resource.h 31 Jul 2003 08:57:48 -0000 1.17 --- resource.h 7 Dec 2003 17:06:11 -0000 1.18 *************** *** 419,422 **** --- 419,423 ---- #define ID_SEARCH_QUICKJUMP 33028 #define ID_TOOLS_STOPRECORDING 33030 + #define ID_TOOLS_PLAYRECORDING 33030 #define ID_CONFIGURE_CURRENTDOCUMENT_WORDWRAP 33035 #define ID_CONFIGURE_CURRENTDOCUMENT_VIEWENDOFLINE 33036 *************** *** 453,456 **** --- 454,459 ---- #define ID_TOOLS_DINGDONG 33071 #define ID_NEWGUY_WLKJLJLJ 33072 + #define ID_TOOLS_SAVEMACRO 33073 + #define ID_TOOLS_LOADMACRO 33074 #define ID_OUTPUT_CLEAR 57632 #define ID_OUTPUT_COPY 57634 *************** *** 468,472 **** #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 252 ! #define _APS_NEXT_COMMAND_VALUE 33073 #define _APS_NEXT_CONTROL_VALUE 1088 #define _APS_NEXT_SYMED_VALUE 105 --- 471,475 ---- #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 252 ! #define _APS_NEXT_COMMAND_VALUE 33075 #define _APS_NEXT_CONTROL_VALUE 1088 #define _APS_NEXT_SYMED_VALUE 105 Index: scintillaif.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/scintillaif.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** scintillaif.cpp 21 Nov 2003 13:53:00 -0000 1.9 --- scintillaif.cpp 7 Dec 2003 17:06:11 -0000 1.10 *************** *** 125,128 **** --- 125,141 ---- } + void CScintilla::PerformMacro(MacroHolder * macro) + { + MacroHolder * mymacro = macro; + while(mymacro) + { + if(mymacro->message == SCI_REPLACESEL) + SPerform(mymacro->message,mymacro->wParam,(LPARAM)mymacro->replacesel); + else + SPerform(mymacro->message,mymacro->wParam,mymacro->lParam); + mymacro = mymacro->next; + } + } + void CScintilla::HandleNotify(LPARAM lParam) { Index: scintillaif.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/scintillaif.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** scintillaif.h 17 Jul 2003 11:32:16 -0000 1.7 --- scintillaif.h 7 Dec 2003 17:06:11 -0000 1.8 *************** *** 13,16 **** --- 13,67 ---- typedef enum {efsVSNet, efsVSNetR, efsPlus, efsArrow} EFoldStyle; + struct MacroHolder + { + int message; // SCN_MACRORECORD + uptr_t wParam; // SCN_MACRORECORD + sptr_t lParam; // SCN_MACRORECORD + MacroHolder * next; + char replacesel[2]; + + MacroHolder() + { + message=0; + wParam=0; + lParam=0; + next=NULL; + } + + void DeleteNext() + { + if(next) + { + next->DeleteNext(); + delete next; + next = NULL; + } + } + + void ToString(CString &str) + { + CString retstr; + char temp[10]; + strcpy(temp,""); + sprintf(temp,"%d",message); + retstr+= temp; + retstr+= "µ"; + strcpy(temp,""); + sprintf(temp,"%d",(int)wParam); + retstr+= temp; + retstr+= "µ"; + strcpy(temp,""); + sprintf(temp,"%d",(int)lParam); + retstr+= temp; + if(message == SCI_REPLACESEL) + { + retstr+= "µ"; + strcpy(temp,replacesel); + retstr+= temp; + } + str = retstr; + } + }; + /** * CScintilla is a non-MFC Scintilla wrapper for C++, it still requires *************** *** 1495,1498 **** --- 1546,1550 ---- CharacterRange GetSelection(); + void PerformMacro(MacroHolder * macro); //-- //@} |
From: <td...@us...> - 2003-12-02 12:03:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv32481 Modified Files: AnyEdit.cpp AnyEdit.h AnyEditView.cpp ClassView.cpp ClassView.h FindDialog.cpp Misc.cpp Misc.h ProjectTree.cpp QuickJump.cpp TagList.cpp TagList.h TagParser.cpp TagParser.h WorkspaceBar.cpp WorkspaceBar.h Log Message: - Class view rewritten - Class view uses hashing making it faster - Tag parser rewritten to easily support all language parsing supported by CTags - Cleanup is yet to be done ! Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** AnyEdit.cpp 28 Nov 2003 13:20:36 -0000 1.35 --- AnyEdit.cpp 2 Dec 2003 12:03:34 -0000 1.36 *************** *** 826,830 **** } ! void CAnyEditApp::ResetClassView(LPCSTR str,BOOL parseForProject=false) //if parseForProject str is only the path to temp dir, else it if a full path+tmpFileName { //before I start the thread I should determine if the file is in current project. --- 826,830 ---- } ! void CAnyEditApp::ResetClassView(LPCSTR str,BOOL parseForProject) //if parseForProject str is only the path to temp dir, else it if a full path+tmpFileName { //before I start the thread I should determine if the file is in current project. *************** *** 840,844 **** if (parseForProject) { ! if (m_bLastParsedFileInCurrentProject) { CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; --- 840,845 ---- if (parseForProject) { ! ! /* if (m_bLastParsedFileInCurrentProject) { CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; *************** *** 882,887 **** } else ! { ! GetCurrentProjectFiles(originalFiles); //here I take all files that belong to that project CString paramPath; --- 883,888 ---- } else ! {*/ ! TRACE("Parsing for project !!!"); GetCurrentProjectFiles(originalFiles); //here I take all files that belong to that project CString paramPath; *************** *** 903,914 **** tempDoc = (CAnyEditDoc *)doct; CString tempStr((LPCSTR)tempDoc->GetPathName()); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && (!tempStr.IsEmpty()) && ! (pFrame->IsFileInCurrentProject(tempStr)) ) { ! if (tempDoc->IsModified()) { ! CString originPath((LPCSTR)tempDoc->GetPathName()); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; --- 904,917 ---- tempDoc = (CAnyEditDoc *)doct; CString tempStr((LPCSTR)tempDoc->GetPathName()); + TRACE("PATH IS %s\n",tempStr); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && (!tempStr.IsEmpty()) && ! (pFrame->IsFileInCurrentProject((LPCSTR)tempStr.GetBuffer(tempStr.GetLength()))) ) { ! //if (tempDoc->IsModified()) { ! CString originPath((LPCSTR)tempDoc->GetPathName()); ! originPath = msc.ChangeFormatToFilePath((LPCSTR)originPath); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; *************** *** 920,945 **** tempDoc->SaveTempCopy(tmpCopyPath); tempCopiesFiles.Add(tmpCopyPath); ! int i=0,maxI=originalFiles.GetSize(); ! while(i<maxI) ! { ! if (originalFiles.GetAt(i)==originPath) { originalFiles.RemoveAt(i); ! maxI--; ! }; ! i++; ! }; } - ; } } } - ; //end of while loop ! } //should be at the end of this section - to point out whether the last file parsed beloned to current project ! m_bLastParsedFileInCurrentProject=true; } else --- 923,945 ---- tempDoc->SaveTempCopy(tmpCopyPath); tempCopiesFiles.Add(tmpCopyPath); ! ! for(int i=0;i<originalFiles.GetSize();i++) ! { ! if (originalFiles.GetAt(i)==originPath) { originalFiles.RemoveAt(i); ! break; ! } ! } } } } } ! //} //should be at the end of this section - to point out whether the last file parsed beloned to current project ! //m_bLastParsedFileInCurrentProject=true; } else Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** AnyEdit.h 28 Nov 2003 13:20:36 -0000 1.29 --- AnyEdit.h 2 Dec 2003 12:03:35 -0000 1.30 *************** *** 93,97 **** void SetCurDocPath(LPCSTR str); LPCSTR GetCurDocPath(); ! void ResetClassView(LPCSTR str,BOOL parseForProject); LPCSTR GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); --- 93,97 ---- void SetCurDocPath(LPCSTR str); LPCSTR GetCurDocPath(); ! void ResetClassView(LPCSTR str,BOOL parseForProject=false); LPCSTR GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** AnyEditView.cpp 28 Nov 2003 13:20:36 -0000 1.37 --- AnyEditView.cpp 2 Dec 2003 12:03:35 -0000 1.38 *************** *** 1274,1278 **** if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! CString tpath = CurDocPath; int rev = tpath.ReverseFind('\\'); if(rev==-1) --- 1274,1278 ---- if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! CString tpath(GetDocument()->GetPathName()); int rev = tpath.ReverseFind('\\'); if(rev==-1) Index: ClassView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ClassView.cpp 25 Nov 2003 15:05:56 -0000 1.23 --- ClassView.cpp 2 Dec 2003 12:03:35 -0000 1.24 *************** *** 69,73 **** : m_SingleLock(NULL) { - HasIncludes = FALSE; if (!m_SingleLock) m_SingleLock = new CSingleLock(&m_ViewCritical); --- 69,72 ---- *************** *** 166,425 **** } [...1128 lines suppressed...] - } - return GetRootItem(); - } - - HTREEITEM CClassView::GetParentJava(CTagEntry *ent) - { - HTREEITEM retitem; - switch(ent->type) - { - case 'f': - GETPARENTCATEGORY("Fields"); - case 'i': - GETPARENTCATEGORY("Interfaces"); - case 'p': - GETPARENTCATEGORY("Packages"); - break; - } - return GetRootItem(); } --- 753,755 ---- Index: ClassView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ClassView.h 19 Nov 2003 08:41:56 -0000 1.17 --- ClassView.h 2 Dec 2003 12:03:35 -0000 1.18 *************** *** 10,28 **** #include "TagList.h" ! #define IMG_CLASS 0 ! #define IMG_PUB_FUNC 1 ! #define IMG_PUB_VAR 2 ! #define IMG_PRO_FUNC 3 ! #define IMG_PRI_FUNC 4 ! #define IMG_PROJECT 5 ! #define IMG_IMPORT 6 ! #define IMG_IMPORT_ARR 7 ! #define IMG_FUNC 8 ! #define IMG_VAR 9 ! #define IMG_PRO_VAR 10 ! #define IMG_PRI_VAR 11 ! #define IMG_CATEGORY 12 ! #define IMG_GENERAL 13 --- 10,26 ---- #include "TagList.h" ! enum TAGSTATUSDURINGUPDATE {TAG_OK,TAG_CHANGED,TAG_DELETE}; + /* + Idea: + Initial Fillup: + + During this fillup first fillup all parent items.. During filling up parent items + prepare a hash of parent names and items.. + When filling up childs use hash to retrieve parent position and add to last.. :) + + Consecutive Fillup: + + */ *************** *** 30,33 **** --- 28,37 ---- // CClassView window + class TreeItemObj: public CObject + { + public: + HTREEITEM item; + }; + class CClassView : public CTreeCtrl { *************** *** 41,49 **** protected: CMisc msc; - BOOL HasIncludes; CString curFileName; CStringArray proarr; CCriticalSection m_ViewCritical; CSingleLock* m_SingleLock; // Operations --- 45,56 ---- protected: CMisc msc; CString curFileName; CStringArray proarr; CCriticalSection m_ViewCritical; CSingleLock* m_SingleLock; + //CMapStringToOb m_parentmap; + + //CMapStringToOb m_updateParent; + //CMapStringToOb m_updateChild; // Operations *************** *** 59,99 **** // Implementation public: ! //void AddTagList(CTagList* taglist); ! int GetFunctionBoxPosition(LPCSTR data); ! BOOL DeleteItem(HTREEITEM hItem); ! BOOL DeleteAllItems(); ! void InsertTagList(CTagList * taglist); ! void FillTagList(CTagList * taglist); BOOL LockTagList(); void UnlockTagList(); virtual ~CClassView(); // Generated message map functions protected: ! HTREEITEM GetParentJava(CTagEntry * ent); ! HTREEITEM GetParentC(CTagEntry * ent); ! HTREEITEM GetParentItemForEntry(CTagEntry * ent); ! int OnToolHitTest(CPoint point, TOOLINFO * pTI) const; BOOL OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); - BOOL IsItemClass(HTREEITEM hitem); - void WalkThroughAllItemsDataAndDeleteIt(HTREEITEM startFrom); - int GetImageForAccess(CTagEntry * acc); - void CheckMember(HTREEITEM hItem, CTagList * taglist); - void CheckClass(HTREEITEM hItem, CTagList * tagList); - void CheckThisItem(HTREEITEM hItem, CTagList * taglist); - void CheckTagList(HTREEITEM hItem,CTagList * taglist); - void InsertFunction(CTagEntry * ent); - CTagEntry* InsertFunctionByLine(HTREEITEM parItem, CTagEntry * ent); - CTagEntry* InsertFunctionByAlphabet(HTREEITEM parItem,CTagEntry* ent); - int GetImageFTC(CTagEntry * ent); - int GetImageFTJAVA(CTagEntry * ent); - int GetImageFTCSHARP(CTagEntry * ent); - int GetImageFTPYTHON(CTagEntry * ent); - int GetImageFTPHP(CTagEntry * ent); - HTREEITEM GetItemFromClassName(LPCSTR clName, HTREEITEM hItem); - HTREEITEM InsertCategory(const char * category); - void InsertClass(CTagEntry - * ent); //{{AFX_MSG(CClassView) afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); --- 66,100 ---- // Implementation public: ! void InsertTagList(CTagList * taglist); ! void FillTagList(CTagList * taglist,BOOL insert=FALSE); BOOL LockTagList(); void UnlockTagList(); virtual ~CClassView(); + //Overridden + virtual BOOL DeleteItem( HTREEITEM hItem ); + virtual BOOL DeleteAllItems(); + + protected: + void InsertParentItem(CMapStringToOb * parentmap, CTagEntry * ent); + void InsertChildItem(CMapStringToOb * parentmap,CTagEntry * ent,BOOL checkandinsert=FALSE); + HTREEITEM GetHashedParentItem(CMapStringToOb * parentmap,LPCSTR parentname); + + void PrepareUpdateHashList(CTagList * taglist,CMapStringToOb * m_updateParent,CMapStringToOb * m_updateChild); + void InsertInUpdateHashList(CTagEntry * ent,CMapStringToOb * m_updateHash); + void CheckTagList(HTREEITEM hitem,CMapStringToOb * m_updateParent,CMapStringToOb * m_updateChild); + void CleanUpNullItems(HTREEITEM hitem); + void CheckItem(HTREEITEM hItem,CMapStringToOb * m_updateParent,CMapStringToOb * m_updateChild); + int CheckEntryWithHashEntry(CTagEntry * ent, CTagEntry *hashent,CMapStringToOb * hashmap); + + void BuildParentHash(CMapStringToOb * hashmap,HTREEITEM hItem); + void ClearParentHash(CMapStringToOb * hashmap); + void WalkThroughAllItemsDataAndDeleteIt(HTREEITEM hItem); + // Generated message map functions protected: ! int OnToolHitTest(CPoint point, TOOLINFO * pTI) const; BOOL OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); //{{AFX_MSG(CClassView) afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); Index: FindDialog.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindDialog.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FindDialog.cpp 18 Nov 2003 04:09:50 -0000 1.11 --- FindDialog.cpp 2 Dec 2003 12:03:35 -0000 1.12 *************** *** 95,98 **** --- 95,99 ---- m_scintilla->SetSel(stpos,endpos); theApp.SetLastSearchText(strText); + SaveToRegistry(); CDialog::OnOK(); } Index: Misc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Misc.cpp 28 Nov 2003 13:20:37 -0000 1.5 --- Misc.cpp 2 Dec 2003 12:03:35 -0000 1.6 *************** *** 283,289 **** } - - - BOOL CMisc::IsFileReadOnly(LPCSTR filPath) { --- 283,286 ---- *************** *** 305,308 **** --- 302,318 ---- return filStr; + } + + CString CMisc::GetFileTitleWithoutPath(LPCSTR fname) + { + CString fpath = ChangeFormatToFilePath(fname); + int pos = fpath.ReverseFind('/'); + if(pos!=-1) + { + CString res = fpath.Right(fpath.GetLength() - pos -1); + return res; + } + + return ""; } Index: Misc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Misc.h 28 Nov 2003 13:20:37 -0000 1.3 --- Misc.h 2 Dec 2003 12:03:35 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- CString GetTitleOfFile(LPCSTR str); void CreateAllDirectories(CString strDir); + CString GetFileTitleWithoutPath(LPCSTR fname); protected: CRegProfile m_reg; Index: ProjectTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ProjectTree.cpp 28 Nov 2003 13:20:37 -0000 1.9 --- ProjectTree.cpp 2 Dec 2003 12:03:35 -0000 1.10 *************** *** 668,671 **** --- 668,672 ---- { pname = msc.GetFullPathBasedOnFile(parentpath,pname); + pname = msc.ChangeFormatToFilePath(pname); } *************** *** 751,755 **** --- 752,764 ---- xml->clear(); delete xml; + UpdateWorkspaceEntry(); + //There does not exist any valid active project.. lets take over that post + if(!m_ActiveProject) + { + CString dummy; + SetActiveProject(dummy,TRUE); + } + return retbool; } *************** *** 1221,1229 **** LPCSTR CProjectTree::GetCurrentProject() { ! /* HTREEITEM hItem= GetProjectItemFromNum(activeProInt); ! if (hItem!=NULL) ! return GetProjectFullPathFromItem(hItem); ! else ! return "";*/ return ""; } --- 1230,1242 ---- LPCSTR CProjectTree::GetCurrentProject() { ! if(!m_ActiveProject) ! return ""; ! ! ProjectItem * pi = (ProjectItem *) GetItemData(m_ActiveProject); ! if(pi) ! { ! return pi->FilePath; ! } ! return ""; } Index: QuickJump.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/QuickJump.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** QuickJump.cpp 8 May 2003 12:00:56 -0000 1.4 --- QuickJump.cpp 2 Dec 2003 12:03:35 -0000 1.5 *************** *** 197,200 **** --- 197,201 ---- void CQuickJump::FillTagList() { + /* CTagList * taglist = theApp.GetCurrentTagList(); CObList * classlist = taglist->GetClassList(); *************** *** 231,235 **** InsertMember(ent->tagname,imtype,1,ent->lineno,(DWORD)ent); ! } } --- 232,236 ---- InsertMember(ent->tagname,imtype,1,ent->lineno,(DWORD)ent); ! }*/ } Index: TagList.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagList.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TagList.cpp 19 Nov 2003 08:41:56 -0000 1.10 --- TagList.cpp 2 Dec 2003 12:03:35 -0000 1.11 *************** *** 26,265 **** } - void CTagList::SetFileName(LPCSTR name) - { - filename = name; - POSITION pos = classlist.GetHeadPosition(); - if(pos != NULL) - { - CTagEntry - * ent = (CTagEntry - *)classlist.GetNext(pos); - if(ent) - { - filename = ent->filename; - return; - } - } - - pos = functionlist.GetHeadPosition(); - if(pos != NULL) - { - CTagEntry - * ent = (CTagEntry - *)functionlist.GetNext(pos); - if(ent) - { - filename = ent->filename; - return; - } - } - - - } ! void CTagList::AddEntry(CTagEntry * ent) ! { ! switch (ent->type) ! { ! case 's': ! case 'c': ! classlist.AddTail(ent); ! break; ! case 'e': ! case 'f': ! case 'v': ! case 'g': ! case 'd': ! case 'm': ! case 't': ! case 'x': ! case 'u': ! case 'n': ! case 'i': ! case 'p': ! functionlist.AddTail(ent); ! break; ! default: ! delete ent; ! ent=NULL; ! } ! } ! ! CObList * CTagList::GetClassList() { ! return &classlist; } ! ! CObList * CTagList::GetFunctionList() { ! return &functionlist; } ! CObList * CTagList::GetOtherList() { ! return &otherlist; } ! LPCSTR CTagList::GetFileName() { ! return filename; } ! ! void CTagList::CheckForClass(LPCSTR clname,LPCSTR fname) { ! CString cname = clname; ! int poss = cname.ReverseFind('.'); ! if(poss!=-1) ! { ! cname = cname.Right(cname.GetLength()-poss-1); ! } ! ! POSITION pos = classlist.GetHeadPosition(); ! while(pos != NULL) ! { ! CTagEntry ! * ent = (CTagEntry ! *)classlist.GetNext(pos); ! if(ent) ! { ! if(ent->tagname==cname) ! { ! return; ! } ! } ! } ! ! CTagEntry ! * newent = new CTagEntry ! ; ! newent->tagname=cname; ! newent->filename = fname; ! classlist.AddTail(newent); ! } void CTagList::ClearAllContents() { ! POSITION pos = classlist.GetHeadPosition(); ! while(pos != NULL) ! { ! CTagEntry ! * ent = (CTagEntry ! *)classlist.GetNext(pos); ! delete ent; ! } ! ! pos = functionlist.GetHeadPosition(); ! while(pos != NULL) ! { ! CTagEntry ! * ent = (CTagEntry ! *)functionlist.GetNext(pos); ! delete ent; ! } ! ! pos = otherlist.GetHeadPosition(); ! while(pos != NULL) ! { ! CTagEntry ! * ent = (CTagEntry ! *)otherlist.GetNext(pos); ! delete ent; ! } ! filename=""; ! classlist.RemoveAll(); ! functionlist.RemoveAll(); ! otherlist.RemoveAll(); ! } ! ! void CTagList::ClearContentsForFile(LPCSTR filpath) ! { ! ! char doc_name[_MAX_FNAME]; ! char doc_ext[_MAX_EXT]; ! _splitpath(filpath,NULL,NULL,doc_name,doc_ext); ! CString str = doc_name; ! str+= "."; ! str+=doc_ext; ! ! POSITION pos = classlist.GetHeadPosition(); ! POSITION posold; while(pos != NULL) { ! posold = pos; ! CTagEntry ! * ent = (CTagEntry ! *)classlist.GetNext(pos); if(ent) ! { ! if(TagEntryFileMatches(ent,str)) ! { ! classlist.RemoveAt(posold); ! delete ent; ! ent=NULL; ! } ! } } ! pos = functionlist.GetHeadPosition(); while(pos != NULL) { ! posold = pos; ! CTagEntry ! * ent = (CTagEntry ! *)functionlist.GetNext(pos); if(ent) ! { ! if(TagEntryFileMatches(ent,str)) ! { ! functionlist.RemoveAt(posold); ! delete ent; ! ent = NULL; ! } ! } } ! pos = otherlist.GetHeadPosition(); ! while(pos != NULL) ! { ! posold = pos; ! CTagEntry ! * ent = (CTagEntry ! *)otherlist.GetNext(pos); ! if(ent) ! { ! if(TagEntryFileMatches(ent,str)) ! { ! otherlist.RemoveAt(posold); ! delete ent; ! ent=NULL; ! } ! } ! } } ! BOOL CTagList::TagEntryFileMatches(CTagEntry ! *ent, LPCSTR fpath) { ! if(ent->filename.IsEmpty()) ! return FALSE; ! char doc_name[_MAX_FNAME]; ! char doc_ext[_MAX_EXT]; ! _splitpath(ent->filename,NULL,NULL,doc_name,doc_ext); ! CString str = doc_name; ! str+= "."; ! str+=doc_ext; ! if(!str.CompareNoCase(fpath)) ! return TRUE; ! else ! return FALSE; } void CTagList::GetTagsNearest(LPCSTR word, CStringArray &arr) { ! CString sword = word; int wlen = sword.GetLength(); arr.RemoveAll(); --- 26,109 ---- } ! void CTagList::AddParentEntry(CTagEntry * ent) { ! ent->isParent=TRUE; ! ParentList.AddTail(ent); } ! void CTagList::RemoveParentEntry(CTagEntry * ent) { ! POSITION pos = ParentList.GetHeadPosition(); ! POSITION prevpos = NULL; ! while(pos) ! { ! prevpos = pos; ! CTagEntry * tent = (CTagEntry *) ParentList.GetNext(pos); ! if(tent == ent) ! { ! ParentList.RemoveAt(prevpos); ! break; ! } ! } } ! void CTagList::AddChildEntry(CTagEntry * ent) { ! ChildList.AddTail(ent); } ! CObList * CTagList::GetChildList() { ! return &ChildList; } ! CObList * CTagList::GetParentList() { ! return &ParentList; } void CTagList::ClearAllContents() { ! POSITION pos = ParentList.GetHeadPosition(); while(pos != NULL) { ! CTagEntry * ent = NULL; ! ent = (CTagEntry*)ParentList.GetNext(pos); if(ent) ! { ! delete ent; ! } ! ent=NULL; } ! pos = ChildList.GetHeadPosition(); while(pos != NULL) { ! CTagEntry* ent = (CTagEntry*)ChildList.GetNext(pos); if(ent) ! delete ent; ! ent=NULL; } ! ParentList.RemoveAll(); ! ChildList.RemoveAll(); ! } + void CTagList::SetParsedFileName(LPCSTR parsefname) + { + if(parsefname) + m_parsedFileName = parsefname; } ! LPCSTR CTagList::GetParsedFileName() { ! return m_parsedFileName; } + //Rewrite after a look at this.. :) void CTagList::GetTagsNearest(LPCSTR word, CStringArray &arr) { ! /* CString sword = word; int wlen = sword.GetLength(); arr.RemoveAll(); *************** *** 307,310 **** } } ! } --- 151,154 ---- } } ! */ } Index: TagList.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagList.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TagList.h 19 Nov 2003 08:41:56 -0000 1.8 --- TagList.h 2 Dec 2003 12:03:36 -0000 1.9 *************** *** 10,64 **** #endif // _MSC_VER > 1000 - #define FT_COMMON 0 - #define FT_JAVA 1 - #define FT_C 2 - #define FT_CSHARP 3 - #define FT_PYTHON 4 - #define FT_PHP 5 - #define FT_JS 6 ! #define ACCESS_PUBLIC 1 ! #define ACCESS_PRIVATE 2 ! #define ACCESS_PROTECTED 3 ! class CTagEntry ! : public CObject { public: ! CTagEntry() { lineno=0; access=0; ! deleted = FALSE; ! filetype=FT_COMMON; ! }; ! CTagEntry ! (CTagEntry ! * original) { if (original) { ! tagname=original->tagname; ! classname=original->classname; ! type=original->type; ! lineno=original->lineno; ! access=original->access; ! filename=original->filename; ! tagDefinition=original->tagDefinition; ! filetype=original->filetype; ! deleted=original->deleted; ! }; ! }; public: CString tagname; ! CString classname; ! char type; int lineno; int access; ! CString filename; ! CString tagDefinition; ! BOOL deleted; ! int filetype; }; --- 10,61 ---- #endif // _MSC_VER > 1000 ! enum CLASSVIEWIMAGES {IMG_CLASS,IMG_PUB_FUNC,IMG_PUB_VAR, ! IMG_PRO_FUNC,IMG_PRI_FUNC,IMG_PROJ, ! IMG_IMPORT,IMG_IMPORT_ARR,IMG_FUNC, ! IMG_VAR,IMG_PRO_VAR,IMG_PRI_VAR,IMG_CATEGORY,IMG_DEF}; + enum ACCESSTYPES {ACC_PUBLIC,ACC_PROTECTED,ACC_PRIVATE}; ! ! class CTagEntry: public CObject { public: ! CTagEntry() { lineno=0; access=0; ! imagetype=0; ! next=NULL; ! isParent=FALSE; ! } ! ! CTagEntry(CTagEntry* original) { if (original) { ! tagname=original->tagname; ! filename=original->filename; ! parentname=original->parentname; ! tagDefinition=original->tagDefinition; ! type=original->type; ! lineno=original->lineno; ! access=original->access; ! imagetype=original->imagetype; ! isParent=original->isParent; ! } ! } ! public: CString tagname; ! CString filename; ! CString parentname; ! CString tagDefinition; ! char type; //Denotes the tag type ! int isParent; int lineno; int access; ! int imagetype; ! CTagEntry * next; }; *************** *** 67,93 **** { public: void GetTagsNearest(LPCSTR word, CStringArray &arr); - void ClearContentsForFile(LPCSTR filpath); void ClearAllContents(); ! CObList * GetOtherList(); ! CObList * GetFunctionList(); ! CObList * GetClassList(); ! void AddEntry ! (CTagEntry ! * ent); ! void SetFileName(LPCSTR name); ! LPCSTR GetFileName(); ! void CheckForClass(LPCSTR clname,LPCSTR fname); ! CTagList(); ! virtual ~CTagList(); protected: ! BOOL TagEntryFileMatches(CTagEntry ! * ent,LPCSTR fpath); ! CString filename; ! CObList classlist; ! CObList functionlist; ! CObList otherlist; ! }; --- 64,83 ---- { public: + CTagList(); + virtual ~CTagList(); void GetTagsNearest(LPCSTR word, CStringArray &arr); void ClearAllContents(); ! CObList * GetParentList(); ! CObList * GetChildList(); ! void AddParentEntry(CTagEntry* ent); ! void RemoveParentEntry(CTagEntry * ent); ! void AddChildEntry(CTagEntry* ent); ! void SetParsedFileName(LPCSTR fname); ! LPCSTR GetParsedFileName(); protected: ! CObList ParentList; ! CObList ChildList; ! CString m_parsedFileName; }; Index: TagParser.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagParser.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TagParser.cpp 19 Nov 2003 08:41:56 -0000 1.11 --- TagParser.cpp 2 Dec 2003 12:03:36 -0000 1.12 *************** *** 13,89 **** #endif - ////////////////////////////////////////////////////////////////////// - // Construction/Destruction - ////////////////////////////////////////////////////////////////////// ! CTagParser::CTagParser() { } ! CTagParser::~CTagParser() { } ! CTagList * CTagParser::ParseFile(LPCSTR fileName) { ! CStringArray arr; ! msc.LoadFileToArray(fileName,arr); ! CTagList * retlist = new CTagList; ! int siz = arr.GetSize(); ! if(siz==0) ! return retlist; ! retlist->SetFileName(fileName); ! for(int i=0;i<siz;i++) { ! ParseLineDetails(retlist,arr.GetAt(i)); } ! return retlist; } ! int GetFileType(LPCSTR extension) { if(strcmp(extension,"C")==0) { ! return FT_C; ! }else if(strcmp(extension,"CPP")==0) ! { ! return FT_C; ! }else if(strcmp(extension,"H")==0) ! { ! return FT_C; ! }else if(strcmp(extension,"HPP")==0) ! { ! return FT_C; ! }else if(strcmp(extension,"CXX")==0) ! { ! return FT_C; ! }else if(strcmp(extension,"HXX")==0) ! { ! return FT_C; ! }else if(strcmp(extension,"JAVA")==0) ! { ! return FT_JAVA; ! }else if(strcmp(extension,"JAV")==0) ! { ! return FT_JAVA; ! }else if(strcmp(extension,"PHP")==0) ! { ! return FT_PHP; ! }else if(strcmp(extension,"PHP3")==0) ! { ! return FT_PHP; ! }else if(strcmp(extension,"CS")==0) ! { ! return FT_CSHARP; ! }else if(strcmp(extension,"PY")==0) ! { ! return FT_PYTHON; } ! return FT_COMMON; } --- 13,198 ---- #endif ! #define CHECKTYPE(a,b) }else if(strcmp(extension,a)==0) \ ! { \ ! return b; ! ! #define CHOOSEACCESS line = line.Right(line.GetLength()-7);\ ! int acc = 0;\ ! if(line=="default")\ ! {\ ! acc = 0;\ ! }\ ! else if(line == "public")\ ! {\ ! acc = ACC_PUBLIC;\ ! }\ ! else if(line == "private")\ ! {\ ! acc = ACC_PRIVATE;\ ! }\ ! else if(line == "protected")\ ! {\ ! acc = ACC_PROTECTED;\ ! }\ ! ent->access = acc; ! ! #define CASEFORFUNCTION switch(ent->access) {\ ! case ACC_PUBLIC:\ ! return IMG_PUB_FUNC;\ ! case ACC_PRIVATE:\ ! return IMG_PRI_FUNC;\ ! case ACC_PROTECTED:\ ! return IMG_PRO_FUNC;\ ! default:\ ! return IMG_FUNC;} ! ! #define CASEFORVARIABLE switch(ent->access){\ ! case ACC_PUBLIC:\ ! return IMG_PUB_VAR;\ ! case ACC_PRIVATE:\ ! return IMG_PRI_VAR;\ ! case ACC_PROTECTED:\ ! return IMG_PRO_VAR;\ ! default:\ ! return IMG_VAR;} ! ! #define MATCHTYPEPARENT(a,b) case a:\ ! ent->parentname = b;\ ! return; ! ! //Language parsers ! ! //Parser for C/C++ ! void CLangParser::GetParent(CTagEntry * ent) { + ent->parentname = "Tags"; + switch(ent->type) + { + MATCHTYPEPARENT('v',"Variables"); + MATCHTYPEPARENT('d',"Macros"); + MATCHTYPEPARENT('m',"Members"); + MATCHTYPEPARENT('s',"Structures"); + MATCHTYPEPARENT('t',"Typedefs"); + MATCHTYPEPARENT('u',"Unions"); + MATCHTYPEPARENT('n',"Namespaces"); + MATCHTYPEPARENT('p',"Prototypes"); + } } ! int CLangParser::GetTagImage(CTagEntry * ent) { + switch(ent->type) + { + case 'f': // If it is a function + { + CASEFORFUNCTION; + } + break; + case 'v': //Variable + { + CASEFORVARIABLE; + } + break; + case 'm': //Variable + { + CASEFORVARIABLE; + } + break; + case 'c': + return IMG_CLASS; + } + + return IMG_DEF; } + void CLangParser::ProcessLangDetails(CTagEntry * ent,LPCSTR linecontent) + { + CString line = linecontent; + if(line.Left(6)=="class:") + { + line = line.Right(line.GetLength()-6); + ent->parentname = line; + } + else if(line.Left(7)=="access:") + { + CHOOSEACCESS; + } + } ! ! ! //Language parser for default language settings ! void LangParser::GetParent(CTagEntry * ent) { ! ent->parentname = "Tags"; ! } ! int LangParser::GetTagImage(CTagEntry * ent) ! { ! switch(ent->type) ! { ! case 'f': // If it is a function ! { ! CASEFORFUNCTION; ! } ! break; ! ! case 'v': //Variable ! { ! CASEFORVARIABLE; ! } ! break; ! } ! ! return IMG_DEF; ! } ! ! void LangParser::ProcessLangDetails(CTagEntry * ent,LPCSTR linecontent) ! { ! CString line = linecontent; ! if(line.Left(6)=="class:") { ! line = line.Right(line.GetLength()-6); ! ent->parentname = line; ! } ! else if(line.Left(7)=="access:") ! { ! CHOOSEACCESS; } + } ! ////////////////////////////////////////////////////////////////////// ! // Construction/Destruction ! ////////////////////////////////////////////////////////////////////// + CTagParser::CTagParser() + { } ! CTagParser::~CTagParser() ! { ! Reset(); ! } ! ! LangParser * CTagParser::GetFileParser(LPCSTR extension) { if(strcmp(extension,"C")==0) { ! return &cparser; ! ! CHECKTYPE("CPP",&cparser); ! CHECKTYPE("H",&cparser); ! CHECKTYPE("CXX",&cparser); ! CHECKTYPE("HXX",&cparser); ! /*CHECKTYPE("JAVA",FT_JAVA); ! CHECKTYPE("JAV",FT_JAVA); ! CHECKTYPE("PHP",FT_PHP); ! CHECKTYPE("PHP3",FT_PHP); ! CHECKTYPE("CS",FT_CSHARP); ! CHECKTYPE("PY",FT_PYTHON);*/ } ! return &dparser; } *************** *** 118,131 **** CTagEntry * ent = new CTagEntry; ! ent->lineno = -1; ! ent->tagname=""; ! ent->classname=""; ! ent->type=-1; ! ent->access=-1; ent->tagname = arr.GetAt(0); ent->filename = arr.GetAt(1); ! ent->filetype = GetFileType(msc.GetFileExtension(ent->filename)); ! CString tagDef=arr.GetAt(2); tagDef.Replace("/^",""); tagDef.Replace("$/;\"",""); --- 227,258 ---- CTagEntry * ent = new CTagEntry; ! ent->type = arr.GetAt(3).GetAt(0); ! switch(ent->type) //If it is a unwanted tag just forget about it ! { ! case 'c': ! case 's': ! case 'e': ! case 'f': ! case 'v': ! case 'g': ! case 'd': ! case 'm': ! case 't': ! case 'x': ! case 'u': ! case 'n': ! case 'i': ! case 'p': ! break; ! default: ! delete ent; ! return; ! }; ! ent->tagname = arr.GetAt(0); ent->filename = arr.GetAt(1); ! ! CString tagDef=arr.GetAt(2); //Take tag definition alone. tagDef.Replace("/^",""); tagDef.Replace("$/;\"",""); *************** *** 141,205 **** line.TrimLeft(); line.TrimRight(); ! // line = line.Left(line.GetLength()-2); ent->lineno = msc.GetIntForString(line); - ent->type = arr.GetAt(3).GetAt(0); if(arrsize > 5) { - CString lin; for(int j=5;j<arrsize;j++) { ! lin = arr.GetAt(j); ! ProcessMoreDetails(list,ent,lin); } } ! list->AddEntry(ent); } ! void CTagParser::ProcessMoreDetails(CTagList * list,CTagEntry ! * ent,LPCSTR linecontent) { ! CString line = linecontent; ! if(line.Left(6)=="class:") ! { ! line = line.Right(line.GetLength()-6); ! ent->classname = line; ! list->CheckForClass(line,ent->filename); ! } ! else if(line.Left(7)=="struct:") ! { ! line = line.Right(line.GetLength()-7); ! ent->classname = line; ! list->CheckForClass(line,ent->filename); ! } ! else if(line.Left(7)=="access:") ! { ! line = line.Right(line.GetLength()-7); ! int acc = 0; ! if(line=="default") ! { ! acc = 0; ! } ! else if(line == "public") ! { ! acc = ACCESS_PUBLIC; ! } ! else if(line == "private") ! { ! acc = ACCESS_PRIVATE; ! } ! else if(line == "protected") ! { ! acc = ACCESS_PROTECTED; ! } ! ! ent->access = acc; ! } } BOOL CTagParser::ParseFile(LPCSTR fileName, CTagList &targetTagList) { ! CStringArray arr; msc.LoadFileToArray(fileName,arr); --- 268,360 ---- line.TrimLeft(); line.TrimRight(); ! ent->lineno = msc.GetIntForString(line); + //Use langparser to get language specific information + LangParser * lpar = GetFileParser(msc.GetFileExtension(ent->filename)); + if(arrsize > 5) { for(int j=5;j<arrsize;j++) { ! lpar->ProcessLangDetails(ent,arr.GetAt(j)); } } ! ! ent->imagetype = lpar->GetTagImage(ent); ! ! if(ent->parentname.IsEmpty()) ! { ! if(ent->imagetype==IMG_CLASS) ! { ! ent->parentname="ROOT"; ! } ! else ! { ! lpar->GetParent(ent); ! CheckAndAddParent(list,ent,TRUE); ! } ! } ! else CheckAndAddParent(list,ent); ! ! //Based on image add in either child or parent ! //When adding parent also check there already exists a DUMMY entry in the map.. ! if(ent->imagetype==IMG_CLASS) //Or Anything else which is a parent ! { ! CObject * obj=NULL; ! parentmap.Lookup(ent->tagname,obj); ! if(!obj) ! { ! parentmap[ent->tagname] = (CObject *)ent; ! } ! else ! { ! if(((CTagEntry *)obj)->parentname == "DUMMY") ! { ! parentmap[ent->tagname] = (CObject *)ent; ! list->RemoveParentEntry((CTagEntry *)obj); ! delete (CTagEntry *)obj; ! obj=NULL; ! } ! else if(((CTagEntry *)obj)->parentname==ent->parentname) ! { ! delete ent; ! ent=NULL; ! } ! } ! ! if(ent) ! list->AddParentEntry(ent); ! } ! else list->AddChildEntry(ent); } ! //If it is a parent entry it gets added here.. ! void CTagParser::CheckAndAddParent(CTagList * list,CTagEntry * ent,BOOL ownentry) { ! if(ent->parentname!="ROOT") ! { ! CObject * obj=NULL; ! parentmap.Lookup(ent->parentname,obj); ! if(!obj) ! { ! CTagEntry * myent = new CTagEntry; ! myent->parentname = "DUMMY"; ! myent->tagname = ent->parentname; ! myent->filename = ent->filename; ! if(ownentry) myent->imagetype = IMG_CATEGORY; //Its our own entry so it is a category ! else myent->imagetype = IMG_CLASS; //class, struct or interface.. ! list->AddParentEntry(myent); ! parentmap[ent->parentname] = (CObject *)myent; ! } ! } ! else return; } BOOL CTagParser::ParseFile(LPCSTR fileName, CTagList &targetTagList) { ! Reset(); ! CStringArray arr; msc.LoadFileToArray(fileName,arr); *************** *** 212,217 **** ParseLineDetails(&targetTagList,arr.GetAt(i)); } - targetTagList.SetFileName(fileName); return true; } --- 367,376 ---- ParseLineDetails(&targetTagList,arr.GetAt(i)); } return true; + } + + void CTagParser::Reset() + { + parentmap.RemoveAll(); } Index: TagParser.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagParser.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TagParser.h 8 May 2003 12:00:56 -0000 1.4 --- TagParser.h 2 Dec 2003 12:03:36 -0000 1.5 *************** *** 13,30 **** #include "TagList.h" class CTagParser { public: BOOL ParseFile(LPCSTR fileName,CTagList& targetTagList); - void ProcessMoreDetails(CTagList * list,CTagEntry - * ent,LPCSTR linecontent); void ParseLineDetails(CTagList * list,LPCSTR linecontent); ! CTagList * ParseFile(LPCSTR fileName); ! CTagParser(); virtual ~CTagParser(); protected: CMisc msc; }; --- 13,52 ---- #include "TagList.h" + #define LANGPARSERDEF public:\ + virtual int GetTagImage(CTagEntry * ent);\ + virtual void GetParent(CTagEntry * ent);\ + virtual void ProcessLangDetails(CTagEntry * ent,LPCSTR linecontent); + + class LangParser + { + LANGPARSERDEF; + }; + + class CLangParser:public LangParser + { + LANGPARSERDEF; + }; + + class CTagParser { public: BOOL ParseFile(LPCSTR fileName,CTagList& targetTagList); void ParseLineDetails(CTagList * list,LPCSTR linecontent); ! void Reset(); ! CTagParser(); virtual ~CTagParser(); protected: + void CheckAndAddParent(CTagList * list,CTagEntry * ent, BOOL ownentry=FALSE); + LangParser * GetFileParser(LPCSTR extension); + + protected: CMisc msc; + CMapStringToOb parentmap; + //Parser instances + LangParser dparser; + CLangParser cparser; }; Index: WorkspaceBar.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** WorkspaceBar.cpp 28 Nov 2003 13:20:38 -0000 1.23 --- WorkspaceBar.cpp 2 Dec 2003 12:03:36 -0000 1.24 *************** *** 45,48 **** --- 45,49 ---- CWorkspaceBar::CWorkspaceBar() { + m_parsefilechanged=TRUE; } *************** *** 337,354 **** //m_ParserThreadCmd+= "|--sort=no|--excmd=number|--fields=+a|"; m_ParserThreadCmd+= "|--sort=no|--fields=+an|"; if ((originalFiles.GetSize()==1) && (tempCopiesFiles.GetSize()==0)) { m_ParserThreadCmd+=originalFiles.GetAt(0); ! m_current_parsefile = originalFiles.GetAt(0); } else if ((originalFiles.GetSize()==0) && (tempCopiesFiles.GetSize()==1)) { ! m_ParserThreadCmd+=tempCopiesFiles.GetAt(0); ! m_current_parsefile = tempCopiesFiles.GetAt(0); } else { ! m_current_parsefile.Empty(); //write the damn list file. try --- 338,383 ---- //m_ParserThreadCmd+= "|--sort=no|--excmd=number|--fields=+a|"; m_ParserThreadCmd+= "|--sort=no|--fields=+an|"; + //Change this logic below... if ((originalFiles.GetSize()==1) && (tempCopiesFiles.GetSize()==0)) { m_ParserThreadCmd+=originalFiles.GetAt(0); ! if(m_current_parsefile != originalFiles.GetAt(0)) ! { ! m_parsefilechanged=TRUE; ! m_current_parsefile = originalFiles.GetAt(0); ! } ! else ! { ! m_parsefilechanged=FALSE; ! } ! } else if ((originalFiles.GetSize()==0) && (tempCopiesFiles.GetSize()==1)) { ! m_ParserThreadCmd+=tempCopiesFiles.GetAt(0); ! if(m_current_parsefile != tempCopiesFiles.GetAt(0)) ! { ! m_parsefilechanged=TRUE; ! m_current_parsefile = tempCopiesFiles.GetAt(0); ! } ! else ! { ! m_parsefilechanged=FALSE; ! } } else { ! //This is a project.. ! CString curproject = GetCurrentProject(); ! if(m_current_parsefile != curproject) ! { ! m_current_parsefile = curproject; ! m_parsefilechanged=TRUE; ! } ! else ! { ! m_parsefilechanged=FALSE; ! } //write the damn list file. try *************** *** 433,459 **** if(LockTagList()) { - if (!m_bOnlyAddTags) - m_sharedTagList.ClearAllContents(); - else - { - if(m_current_parsefile.IsEmpty()) - { - CString app_path=theApp.GetAppPath(); - app_path+= "tempList"; - CStringArray arr; - msc.LoadFileToArray(app_path,arr); - int j = arr.GetSize(); - for(int x=0;x<j;x++) - m_sharedTagList.ClearContentsForFile(arr.GetAt(x)); - } - else - m_sharedTagList.ClearContentsForFile(m_current_parsefile); - } - tparser.ParseFile(m_ParserOutputFile,m_sharedTagList); ! m_wndClassView.FillTagList(&m_sharedTagList); ! UnlockTagList(); } //clean up of temporary files --- 462,482 ---- if(LockTagList()) { + m_sharedTagList.ClearAllContents(); + m_sharedTagList.SetParsedFileName(m_current_parsefile); + CTime t2 = CTime::GetCurrentTime(); + TRACE("Beginning tag parse : %s\n",t2.Format("%H:%M:%S")); tparser.ParseFile(m_ParserOutputFile,m_sharedTagList); ! CTime t3 = CTime::GetCurrentTime(); ! TRACE("ending tag parser : %s\n",t3.Format("%H:%M:%S")); ! ! CTime t4 = CTime::GetCurrentTime(); ! TRACE("Beginning tag fill : %s\n",t4.Format("%H:%M:%S")); ! m_wndClassView.FillTagList(&m_sharedTagList,!m_parsefilechanged); ! CTime t5 = CTime::GetCurrentTime(); ! TRACE("ending tag fill : %s\n",t5.Format("%H:%M:%S")); ! ! UnlockTagList(); } //clean up of temporary files Index: WorkspaceBar.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** WorkspaceBar.h 28 Nov 2003 13:20:38 -0000 1.18 --- WorkspaceBar.h 2 Dec 2003 12:03:36 -0000 1.19 *************** *** 57,60 **** --- 57,61 ---- CTagList m_sharedTagList; BOOL m_bOnlyAddTags; + BOOL m_parsefilechanged; //class view parser in a separate thread vars end here! // Operations |
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv7638 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEdit.h AnyEditView.cpp AnyEditView.h ChangeLog.txt MainFrm.cpp MainFrm.h Misc.cpp Misc.h NewProject.cpp NewWorkspace.cpp ProjectTree.cpp ProjectTree.h ToolPref.cpp WorkspaceBar.cpp WorkspaceBar.h Added Files: pugxml.h Log Message: - Rewrote project view handling.. project file format has changed to a XML based format - Have integrated PugXML parser into AnyEdit for handling project files. In future may handle syntax files also - Cleaned up code involving CString [Returning and taking param] --- NEW FILE: pugxml.h --- //pugxml.h /////////////////////////////////////////////////////////////////////////////// // // Pug XML Parser - Version 1.0002 // -------------------------------------------------------- // Copyright (C) 2003, by Kristen Wegner (kr...@ti...) // Released into the Public Domain. Use at your own risk. // See pugxml.xml for further information, history, etc. // Contributions by Neville Franks (rea...@ge...). // /////////////////////////////////////////////////////////////////////////////// #if !defined(_PUGXML_) #define _PUGXML_ #pragma once //#define PUGOPT_MEMFIL //Uncomment to enable memory-mapped file parsing support. //#define PUGOPT_NONSEG //Uncomment to enable non-destructive (non-segmenting) parsing support. [...3878 lines suppressed...] # endif //!PUGAPI_VERSION_MAJOR # pragma message("pugxml.h(44) : Value of PUGAPI_INTERNAL_VERSION_MAJOR.") # else //defined(PUGAPI_VERSION_MAJOR) # if !defined(PUGAPI_VERSION_MINOR) || (PUGAPI_VERSION_MINOR != PUGAPI_INTERNAL_VERSION_MINOR) # pragma message("Note: The Pug XML library API minor version does not match your implementation.") # pragma message("Note: Your implementation may not run correctly with this minor version.") # pragma message("Note: Read pugxml.xml for transition instructions.") # ifndef PUGAPI_VERSION_MINOR # pragma message("Note: Add #define PUGAPI_VERSION_MINOR X in your implementation, where X is:") # else //PUGAPI_VERSION_MINOR # pragma message("Note: Update #define PUGAPI_VERSION_MINOR X in your implementation, where X is:") # endif //!PUGAPI_VERSION_MINOR # pragma message("pugxml.h(45) : Value of PUGAPI_INTERNAL_VERSION_MINOR.") # endif //!defined(PUGAPI_VERSION_MINOR) # endif //!defined(PUGAPI_VERSION_MAJOR) #endif //!defined(PUGAPI_VARIANT) #endif //!defined(_PUGXML_) Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AnyEdit.cpp 25 Nov 2003 15:05:55 -0000 1.34 --- AnyEdit.cpp 28 Nov 2003 13:20:36 -0000 1.35 *************** *** 224,228 **** //check for leaks ! //_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); --- 224,228 ---- //check for leaks ! _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); *************** *** 437,441 **** //Delete all the files in the temp folder ! CString pat = GetAppPath()+"temp\\"; CStringArray farr; msc.GetFilesInFolder(pat,"*.*",farr); --- 437,442 ---- //Delete all the files in the temp folder ! CString pat = GetAppPath(); ! pat+="temp\\"; CStringArray farr; msc.GetFilesInFolder(pat,"*.*",farr); *************** *** 533,537 **** } ! CString CAnyEditApp::GetAppPath() { /*TCHAR filName[_MAX_PATH]; --- 534,538 ---- } ! LPCSTR CAnyEditApp::GetAppPath() { /*TCHAR filName[_MAX_PATH]; *************** *** 793,801 **** CString strTitle; strTitle= titl; dlg.m_ofn.lpstrFilter = szFilter ; dlg.m_ofn.lpstrTitle = strTitle; ! dlg.m_ofn.lpstrFile = fileName.GetBuffer(_MAX_PATH); dlg.m_ofn.hwndOwner = AfxGetMainWnd()->m_hWnd; ! if (dlg.DoModal() == IDOK) { --- 794,804 ---- CString strTitle; strTitle= titl; + dlg.m_ofn.lpstrFilter = szFilter ; dlg.m_ofn.lpstrTitle = strTitle; ! dlg.m_ofn.lpstrFile = fileName.GetBuffer(3000); ! dlg.m_ofn.nMaxFile = 3000; dlg.m_ofn.hwndOwner = AfxGetMainWnd()->m_hWnd; ! if (dlg.DoModal() == IDOK) { *************** *** 880,883 **** --- 883,887 ---- else { + GetCurrentProjectFiles(originalFiles); //here I take all files that belong to that project CString paramPath; *************** *** 889,893 **** POSITION pos = pDocTemplate->GetFirstDocPosition(); ! CString originPath; while(pos!=NULL) { --- 893,897 ---- POSITION pos = pDocTemplate->GetFirstDocPosition(); ! while(pos!=NULL) { *************** *** 898,902 **** { tempDoc = (CAnyEditDoc *)doct; ! CString tempStr = tempDoc->GetPathName(); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && --- 902,906 ---- { tempDoc = (CAnyEditDoc *)doct; ! CString tempStr((LPCSTR)tempDoc->GetPathName()); CMainFrame* pFrame=(CMainFrame*)m_pMainWnd; if ( (pFrame!=NULL) && *************** *** 906,910 **** if (tempDoc->IsModified()) { ! originPath=tempDoc->GetPathName(); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; --- 910,914 ---- if (tempDoc->IsModified()) { ! CString originPath((LPCSTR)tempDoc->GetPathName()); tmpCopyPath=paramPath; char doc_path[_MAX_FNAME]; *************** *** 1020,1024 **** } ! CString CAnyEditApp::GetCurrentExt() { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; --- 1024,1028 ---- } ! LPCSTR CAnyEditApp::GetCurrentExt() { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; *************** *** 1067,1071 **** } ! CLanguage * CAnyEditApp::GetLanguage(CString ext) { --- 1071,1075 ---- } ! CLanguage * CAnyEditApp::GetLanguage(LPCSTR ext) { *************** *** 1084,1088 **** } ! CString CAnyEditApp::SetScintillaLanguage(CString ext, CScintilla *scintilla) { --- 1088,1092 ---- } ! LPCSTR CAnyEditApp::SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla) { *************** *** 1111,1115 **** ! CObject * CAnyEditApp::LoadLanguage(CString langpos) { --- 1115,1119 ---- ! CObject * CAnyEditApp::LoadLanguage(LPCSTR langpos) { *************** *** 1172,1176 **** } ! void CAnyEditApp::OpenBrowserWindow(CString url) { POSITION pos = CWinApp::GetFirstDocTemplatePosition(); --- 1176,1180 ---- } ! void CAnyEditApp::OpenBrowserWindow(LPCSTR url) { POSITION pos = CWinApp::GetFirstDocTemplatePosition(); *************** *** 1223,1227 **** } ! CString CAnyEditApp::GetCurDocPath() { //LPCSTR retS = curDocPath.GetBuffer(curDocPath.GetLength()); --- 1227,1231 ---- } ! LPCSTR CAnyEditApp::GetCurDocPath() { //LPCSTR retS = curDocPath.GetBuffer(curDocPath.GetLength()); *************** *** 1230,1234 **** } ! CString CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; --- 1234,1238 ---- } ! LPCSTR CAnyEditApp::GetCompFilePathFromLang(LPCSTR lang) { CHAR tempStr[1024]; *************** *** 1283,1292 **** ! CString CAnyEditApp::GetCurrentProject() { return ((CMainFrame*)m_pMainWnd)->GetCurrentProject(); } ! CString CAnyEditApp::GetCurrentWorkspace() { return ((CMainFrame*)m_pMainWnd)->GetCurrentWorkspace(); --- 1287,1296 ---- ! LPCSTR CAnyEditApp::GetCurrentProject() { return ((CMainFrame*)m_pMainWnd)->GetCurrentProject(); } ! LPCSTR CAnyEditApp::GetCurrentWorkspace() { return ((CMainFrame*)m_pMainWnd)->GetCurrentWorkspace(); *************** *** 1299,1306 **** } ! void CAnyEditApp::SaveModifiedFileOfAProject(CString filePath) { //if filePath is Empty this function will save all files belonging to current project that have been modified! //if filePath is not empty this function will save only the document that corresponds to that path! if (filePath.IsEmpty()) { --- 1303,1311 ---- } ! void CAnyEditApp::SaveModifiedFileOfAProject(LPCSTR filePat) { //if filePath is Empty this function will save all files belonging to current project that have been modified! //if filePath is not empty this function will save only the document that corresponds to that path! + CString filePath = filePat; if (filePath.IsEmpty()) { *************** *** 1371,1375 **** } ! BOOL CAnyEditApp::IsFileInCurrentProject(CString fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) --- 1376,1380 ---- } ! BOOL CAnyEditApp::IsFileInCurrentProject(LPCSTR fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AnyEdit.dsp 25 Nov 2003 15:05:56 -0000 1.26 --- AnyEdit.dsp 28 Nov 2003 13:20:36 -0000 1.27 *************** *** 1140,1143 **** --- 1140,1147 ---- # Begin Source File + SOURCE=.\pugxml.h + # End Source File + # Begin Source File + SOURCE=.\SeException.h # End Source File Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AnyEdit.h 25 Nov 2003 15:05:56 -0000 1.28 --- AnyEdit.h 28 Nov 2003 13:20:36 -0000 1.29 *************** *** 43,51 **** void TerminateClassViewThread(); void GotoFileAndLine(int lineNo,CString& fileName); ! BOOL IsFileInCurrentProject(CString fileName); ! void SaveModifiedFileOfAProject(CString filePath); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); BOOL CanStartParserThread(); void RefreshParserThread(CWinThread* pNewThread); --- 43,51 ---- void TerminateClassViewThread(); void GotoFileAndLine(int lineNo,CString& fileName); ! BOOL IsFileInCurrentProject(LPCSTR fileName); ! void SaveModifiedFileOfAProject(LPCSTR filePath); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); BOOL CanStartParserThread(); void RefreshParserThread(CWinThread* pNewThread); *************** *** 53,60 **** void OpenStartupPage(); void OpenPreferences(); ! void OpenBrowserWindow(CString url); ! CObject * LoadLanguage(CString langpos); ! CString SetScintillaLanguage(CString ext, CScintilla *scintilla); ! CLanguage * GetLanguage(CString ext); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); --- 53,60 ---- void OpenStartupPage(); void OpenPreferences(); ! void OpenBrowserWindow(LPCSTR url); ! CObject * LoadLanguage(LPCSTR langpos); ! LPCSTR SetScintillaLanguage(LPCSTR ext, CScintilla *scintilla); ! CLanguage * GetLanguage(LPCSTR ext); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); *************** *** 73,77 **** BOOL IsLangPresent(LPCSTR lang); void SetAppPath(LPCSTR appPath); ! CString GetAppPath(); BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); --- 73,77 ---- BOOL IsLangPresent(LPCSTR lang); void SetAppPath(LPCSTR appPath); ! LPCSTR GetAppPath(); BOOL m_bTabFlatBorders; BOOL OnViewDoubleClick (int iViewId); *************** *** 88,98 **** void AddOutputLine(LPCSTR str); void SetSelectedLine(int i); ! CString GetCurrentExt(); BOOL DoPromptFileName(CString &fileName, LPCSTR titl, DWORD lFlags,BOOL bOpen,LPCSTR fil=_T("")); void EscapeFromChildFrm(); void SetCurDocPath(LPCSTR str); ! CString GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject); ! CString GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); --- 88,98 ---- void AddOutputLine(LPCSTR str); void SetSelectedLine(int i); ! LPCSTR GetCurrentExt(); BOOL DoPromptFileName(CString &fileName, LPCSTR titl, DWORD lFlags,BOOL bOpen,LPCSTR fil=_T("")); void EscapeFromChildFrm(); void SetCurDocPath(LPCSTR str); ! LPCSTR GetCurDocPath(); void ResetClassView(LPCSTR str,BOOL parseForProject); ! LPCSTR GetCompFilePathFromLang(LPCSTR lang); BOOL LockTagList(); void UnlockTagList(); Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AnyEditView.cpp 25 Nov 2003 15:05:56 -0000 1.36 --- AnyEditView.cpp 28 Nov 2003 13:20:36 -0000 1.37 *************** *** 371,375 **** } ! CString CAnyEditView::GetCurrentExtension() { return DocExt; --- 371,375 ---- } ! LPCSTR CAnyEditView::GetCurrentExtension() { return DocExt; *************** *** 1073,1077 **** ! CString CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; --- 1073,1077 ---- ! LPCSTR CAnyEditView::GetInputValues(LPCSTR curLine) { CString inpLine = curLine; *************** *** 1098,1102 **** { ! if(theApp.GetCurDocPath() != CurDocPath) { KillTimer(PARSER_TIMER); --- 1098,1103 ---- { ! CString cpath = theApp.GetCurDocPath(); ! if(cpath.Compare(CurDocPath)!=0) { KillTimer(PARSER_TIMER); *************** *** 1104,1108 **** } - if((EnableParsing) && (theApp.CanStartParserThread())) { --- 1105,1108 ---- *************** *** 1136,1140 **** } ! theApp.SetCurDocPath(GetDocument()->GetPathName()); } --- 1136,1140 ---- } ! theApp.SetCurDocPath(CurDocPath.GetBuffer(CurDocPath.GetLength())); } *************** *** 1160,1164 **** void CAnyEditView::OnSetFocus(CWnd* pOldWnd) { ! CView::OnSetFocus(pOldWnd); m_Scintilla.SetFocus(); --- 1160,1164 ---- void CAnyEditView::OnSetFocus(CWnd* pOldWnd) { ! CView::OnSetFocus(pOldWnd); m_Scintilla.SetFocus(); *************** *** 1236,1242 **** } - CString prevpath = theApp.GetCurDocPath(); ! if(prevpath == CurDocPath) { if(EnableParsing) --- 1236,1241 ---- } CString prevpath = theApp.GetCurDocPath(); ! if(prevpath.Compare(CurDocPath)==0) { if(EnableParsing) *************** *** 1250,1254 **** else { ! theApp.SetCurDocPath(CurDocPath); if (EnableParsing) { --- 1249,1253 ---- else { ! theApp.SetCurDocPath(CurDocPath.GetBuffer(CurDocPath.GetLength())); if (EnableParsing) { *************** *** 1275,1279 **** if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! int rev = CurDocPath.ReverseFind('\\'); if(rev==-1) return; --- 1274,1279 ---- if ( (pDoc!=NULL) && (pDoc->IsKindOf(RUNTIME_CLASS(CAnyEditDoc))) ) { ! CString tpath = CurDocPath; ! int rev = tpath.ReverseFind('\\'); if(rev==-1) return; *************** *** 1281,1287 **** docpath += "temp\\"; CString filnam ;//= "temp\\"; ! filnam+= CurDocPath.Right(CurDocPath.GetLength()-rev-1); BOOL parseForProject=true; ! if (!theApp.IsFileInCurrentProject(CurDocPath)) { //I mean that if file is in current project, I will write its copy in theApp.ResetClassView docpath+= filnam; --- 1281,1288 ---- docpath += "temp\\"; CString filnam ;//= "temp\\"; ! filnam+= tpath.Right(tpath.GetLength()-rev-1); BOOL parseForProject=true; ! //The function is called below in that manner, else it wont work ! if (!theApp.IsFileInCurrentProject(tpath.GetBuffer(tpath.GetLength()))) { //I mean that if file is in current project, I will write its copy in theApp.ResetClassView docpath+= filnam; Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AnyEditView.h 25 Nov 2003 15:05:56 -0000 1.19 --- AnyEditView.h 28 Nov 2003 13:20:37 -0000 1.20 *************** *** 72,76 **** void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! CString GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); --- 72,76 ---- void SetLineStyle(int linenumber,int style=0,COLORREF color=RGB(0,0,0)); void ResetLineStyle(int linenumber=-1); ! LPCSTR GetInputValues(LPCSTR curline); void InsertStringArray(CStringArray &arr); void JustOpenedFile(); *************** *** 79,83 **** void OnModified(); void HandleNotification(LPARAM lParam); ! CString GetCurrentExtension(); void SetAccessTime(); virtual ~CAnyEditView(); --- 79,83 ---- void OnModified(); void HandleNotification(LPARAM lParam); ! LPCSTR GetCurrentExtension(); void SetAccessTime(); virtual ~CAnyEditView(); Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ChangeLog.txt 25 Nov 2003 15:05:56 -0000 1.32 --- ChangeLog.txt 28 Nov 2003 13:20:37 -0000 1.33 *************** *** 2,6 **** ============ ! Beta 2.0 -------- 1) Fixed setting focus problem on ctrl+tab [#765240] --- 2,6 ---- ============ ! Beta 2.0 [Tester's Release 2] -------- 1) Fixed setting focus problem on ctrl+tab [#765240] *************** *** 50,53 **** --- 50,54 ---- 43) File modification check now handles file deletion properly. [#799171] 44) Added global option in preferences to view whitespaces. + 45) Rewrote project-view, Project file format has changed to XML based format Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** MainFrm.cpp 25 Nov 2003 15:05:56 -0000 1.28 --- MainFrm.cpp 28 Nov 2003 13:20:37 -0000 1.29 *************** *** 1453,1462 **** } ! CString CMainFrame::GetCurrentProject() { return m_wndWorkSpace.GetCurrentProject(); } ! CString CMainFrame::GetCurrentWorkspace() { return m_wndWorkSpace.GetCurrentWorkspace(); --- 1453,1462 ---- } ! LPCSTR CMainFrame::GetCurrentProject() { return m_wndWorkSpace.GetCurrentProject(); } ! LPCSTR CMainFrame::GetCurrentWorkspace() { return m_wndWorkSpace.GetCurrentWorkspace(); *************** *** 1468,1472 **** } ! BOOL CMainFrame::IsFileInCurrentProject(CString fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) --- 1468,1472 ---- } ! BOOL CMainFrame::IsFileInCurrentProject(LPCSTR fileName) { //to use like that if ( IsFileInCurrentProject(theApp.GetCurDocPath()) ) Index: MainFrm.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MainFrm.h 11 Aug 2003 04:03:19 -0000 1.20 --- MainFrm.h 28 Nov 2003 13:20:37 -0000 1.21 *************** *** 64,71 **** CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word, CStringArray &arr); ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); void UpdateStatus(int lineno=-1,int colno=-1,int filetype=0,int overwrite=0,int readfile=0); void ShowPreferences(); --- 64,71 ---- CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word, CStringArray &arr); ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); void UpdateStatus(int lineno=-1,int colno=-1,int filetype=0,int overwrite=0,int readfile=0); void ShowPreferences(); Index: Misc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Misc.cpp 8 May 2003 12:00:56 -0000 1.4 --- Misc.cpp 28 Nov 2003 13:20:37 -0000 1.5 *************** *** 325,329 **** } ! void CMisc::WriteStringToFile(CString str, LPCSTR filPath) { TRY{ --- 325,329 ---- } ! BOOL CMisc::WriteStringToFile(CString str, LPCSTR filPath) { TRY{ *************** *** 335,339 **** --- 335,341 ---- }CATCH(CFileException, e) { + return FALSE; } END_CATCH + return TRUE; } Index: Misc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Misc.h 8 May 2003 12:00:56 -0000 1.2 --- Misc.h 28 Nov 2003 13:20:37 -0000 1.3 *************** *** 15,19 **** { public: ! void WriteStringToFile(CString str,LPCSTR filPath); BOOL IsFileReadOnly(LPCSTR filPath); CMisc(); --- 15,19 ---- { public: ! BOOL WriteStringToFile(CString str,LPCSTR filPath); BOOL IsFileReadOnly(LPCSTR filPath); CMisc(); Index: NewProject.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/NewProject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NewProject.cpp 8 May 2003 12:00:56 -0000 1.5 --- NewProject.cpp 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 149,162 **** int y=filArray.GetSize(); ! CString prefix = _T("FILE|./"); ! for(int i=0;i<y;i++) { tempStr = filArray.GetAt(i); tempStr = CreateProjectFile(tempStr); - tempStr += _T("|ROOT"); tempStr = prefix + tempStr; filArray.SetAt(i,tempStr); } ! if(!msc.WriteArrayToFile(filArray,proFile)) return FALSE; else --- 149,174 ---- int y=filArray.GetSize(); ! CString prefix = _T("./"); ! for(int i=0;i<y;i++) { tempStr = filArray.GetAt(i); tempStr = CreateProjectFile(tempStr); tempStr = prefix + tempStr; filArray.SetAt(i,tempStr); } ! ! m_filName.GetWindowText(tempStr); ! CString filetowrite = "<project pname=\""; ! filetowrite+= tempStr; ! filetowrite+= "\" >\n"; ! //<file fname="./AnyEdit.dsp" part="true"/> ! for(i=0;i<filArray.GetSize();i++) ! { ! filetowrite+="\t<file fname=\""; ! filetowrite+=filArray[i]+"\" part=\"true\" />\n"; ! } ! filetowrite+= "</project>\n"; ! ! if(!msc.WriteStringToFile(filetowrite,proFile)) return FALSE; else *************** *** 179,189 **** { CStringArray wArr; CString str = _T("./"); str+= proFileBaseName+_T(".aep"); ! wArr.Add(str); ! wArr.Add(_T("201")); ! str = msc.GetParentFolderForFile(proFile); str+= proFileBaseName + _T(".aew"); ! msc.WriteArrayToFile(wArr,str); theApp.LoadWorkspaceFile(str); } --- 191,203 ---- { CStringArray wArr; + CString wfile = "<workspace wname=\""; + wfile+=proFileBaseName + "\">\n"; CString str = _T("./"); str+= proFileBaseName+_T(".aep"); ! wfile+="\t<project pfile=\""; ! wfile+=str+"\" part=\"true\"/>\n</workspace>"; ! str = msc.GetParentFolderForFile(proFile); str+= proFileBaseName + _T(".aew"); ! msc.WriteStringToFile(wfile,str); theApp.LoadWorkspaceFile(str); } *************** *** 213,219 **** msc.WriteArrayToFile(filArr,finalPath); - theApp.OpenDocumentFile(finalPath); - theApp.SetCursorStartPoint(); - return newfileName; } --- 227,230 ---- Index: NewWorkspace.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/NewWorkspace.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewWorkspace.cpp 8 May 2003 12:00:56 -0000 1.4 --- NewWorkspace.cpp 28 Nov 2003 13:20:37 -0000 1.5 *************** *** 78,83 **** } ! CStringArray filArr; ! filArr.Add(_T("0")); CString broStr; CMisc msc; --- 78,83 ---- } ! CString wfile = "<workspace wname=\""; ! CString broStr; CMisc msc; *************** *** 88,92 **** broStr+= _T("\\"); broStr+= filName+ _T(".aew"); ! msc.WriteArrayToFile(filArr,broStr); theApp.LoadWorkspaceFile(broStr); --- 88,93 ---- broStr+= _T("\\"); broStr+= filName+ _T(".aew"); ! wfile+= filName + "\"/>"; ! msc.WriteStringToFile(wfile,broStr); theApp.LoadWorkspaceFile(broStr); Index: ProjectTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ProjectTree.cpp 21 Nov 2003 13:53:00 -0000 1.8 --- ProjectTree.cpp 28 Nov 2003 13:20:37 -0000 1.9 *************** *** 26,29 **** --- 26,33 ---- // ProjectTree.cpp : implementation file // + #include <iostream> + #include <strstream> + #include <STRSTREA.H> + #include "stdafx.h" *************** [...1747 lines suppressed...] ! else return FALSE; } ! void CProjectTree::AddFileUnderProject(LPCSTR proj,LPCSTR filename) { ! if(!m_bIsLoaded)return; ! HTREEITEM rootitem = GetRootItem(); ! HTREEITEM pitem = GetChildItem(rootitem); ! while(pitem) ! { ! if(GetItemText(pitem)==proj) ! { ! AddFile(filename,pitem); ! } ! ! pitem = GetNextItem(pitem,TVGN_NEXT); ! } } + Index: ProjectTree.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ProjectTree.h 8 May 2003 12:00:56 -0000 1.5 --- ProjectTree.h 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 7,14 **** --- 7,74 ---- // ProjectTree.h : header file // + #define PUGAPI_VARIANT 0x58475550 //The Pug XML library variant we are using in this implementation. + #define PUGAPI_VERSION_MAJOR 1 //The Pug XML library major version we are using in this implementation. + #define PUGAPI_VERSION_MINOR 2 //The Pug XML library minor version we are using in this implementation. + + #include "stdlib.h" + #include "pugxml.h" #include "Misc.h" + #include <stack> + #include <ostream> + #include <strstream> + + using namespace std; + using namespace pug; ///////////////////////////////////////////////////////////////////////////// // CProjectTree window + enum project_item_types + { + ITEM_WORKSPACE, + ITEM_PROJECT, + ITEM_FOLDER, + ITEM_FILE + }; + + enum file_path_type + { + PATH_FULL, + PATH_PARTIAL + }; + + enum project_image_types + { + IMG_WORKSPACE, + IMG_OFOLDER, + IMG_FILE, + IMG_PROJECT, + IMG_FOLDER, + IMG_INVALID + }; + + class ProjectItem + { + public: + ProjectItem() + { + } + + ProjectItem(LPCSTR itemname, LPCSTR filepath,LPCSTR parentpath,int itype,int iimage ) + { + if(itemname) ItemName = itemname; + if(filepath) FilePath = filepath; + if(parentpath) parent_path = parentpath; + type = itype; + item_image = iimage; + changed=FALSE; + } + + int type; + BOOL changed; + CString ItemName; + CString FilePath; + int item_image; + CString parent_path; + }; class CProjectTree : public CTreeCtrl *************** *** 26,36 **** protected: - int a[5]; - CMap<int,int,CString,CString> tmap; CMisc msc; - int activeProInt; - HTREEITEM wRoot; BOOL m_bIsLoaded; ! CString curWName; // Operations public: --- 86,94 ---- protected: CMisc msc; BOOL m_bIsLoaded; ! stack<HTREEITEM> iStack; ! HTREEITEM m_ActiveProject; ! // Operations public: *************** *** 43,55 **** // Implementation public: ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray &repository,HTREEITEM hItem=NULL); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); virtual ~CProjectTree(); void SetFolderImages(); int GetTreeItemType(HTREEITEM hItem); BOOL LoadWorkspaceFile(LPCSTR filPath); ! BOOL SaveCurrentWorkspace(); void CloseWorkspace(); BOOL IsWorkspaceLoaded(); --- 101,113 ---- // Implementation public: ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray &repository,HTREEITEM hItem=NULL); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); virtual ~CProjectTree(); void SetFolderImages(); int GetTreeItemType(HTREEITEM hItem); BOOL LoadWorkspaceFile(LPCSTR filPath); ! BOOL SaveCurrentWorkspace(BOOL cchange=FALSE); void CloseWorkspace(); BOOL IsWorkspaceLoaded(); *************** *** 57,93 **** BOOL AddFile(LPCSTR filpath,HTREEITEM hItem); HTREEITEM GetProjectItemForString(LPCSTR itemText); ! BOOL LoadProjectFile(LPCSTR filPath); protected: ! int GetFreeProject(); ! int GetNextProjectInt(int proNum); ! HTREEITEM AddProject(LPCSTR projName); ! BOOL ParseLineAndAddToProject(LPCSTR str,HTREEITEM projItem); ! HTREEITEM GetItemForFolderInProject(LPCSTR str,HTREEITEM hItem); ! BOOL IsStringInProject(LPCSTR str,int proNum); void ShowOpenDialogForFiles(); ! void AddNewFolder(); ! int GetProjectNumFromRange(int num); ! void SetActiveProject(int num); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! void DeleteItemsUnderProject(HTREEITEM hItem); ! HTREEITEM GetProjectItemFromNum(int num); ! CString GetProjectFullPathFromItem(HTREEITEM hItem); ! CString GetWorkspacePath(); ! void ResetProjectCount(); ! //to save a project file ! BOOL SaveWSProjectToFile(HTREEITEM proItem); ! void GetProjectStructIntoArray(HTREEITEM proItem,HTREEITEM elderItem,CStringArray &arr,int insAt,LPCSTR pStr); ! BOOL IsBrotherItem(HTREEITEM elder,HTREEITEM younger); ! CString GetProjectStringForItem(HTREEITEM hItem,LPCSTR pStr); //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop); BOOL CanBeDropped(HTREEITEM hdrag,HTREEITEM hdrop); - //others - CString GetMapValue(int mapKey); // Generated message map functions --- 115,149 ---- BOOL AddFile(LPCSTR filpath,HTREEITEM hItem); HTREEITEM GetProjectItemForString(LPCSTR itemText); ! BOOL LoadProjectFile(LPCSTR filPath,BOOL path=FALSE); ! void AddFileUnderProject(LPCSTR projectname, LPCSTR filepath); protected: ! //New Implementation added functions ! BOOL DoesItemContainType(HTREEITEM hItem, int type, LPCSTR name,BOOL fname=FALSE); ! BOOL DoesProjectContainFile(HTREEITEM pitem, LPCSTR filename); ! void UpdateWorkspaceEntry(); ! BOOL AddProjectItemFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddProjectFromXmlNode(xml_node * node,LPCSTR fname); ! BOOL AddFolderFromXmlNode(xml_node * node); ! BOOL AddFileFromXmlNode(xml_node * node); ! void SetActiveProject(CString &pfname,BOOL first=FALSE); void ShowOpenDialogForFiles(); ! void AddNewFolder(); int GetNumberOfProjects(); ! int GetNumberOfItemsUnderProject(int pfol,HTREEITEM hItem); ! HTREEITEM GetProjectItemForItem(HTREEITEM hItem); ! void SetDirty(HTREEITEM hItem); ! //to save a project file ! void SaveItemAsElement(HTREEITEM hItem,xml_node * node); ! BOOL SaveWSProjectToFile(HTREEITEM proItem,BOOL checkchange=FALSE); + //Delete resources... + void DeleteTreeResourcesFromItem(HTREEITEM hItem); + //dragdrop ops BOOL IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent); BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop); BOOL CanBeDropped(HTREEITEM hdrag,HTREEITEM hdrop); // Generated message map functions Index: ToolPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToolPref.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ToolPref.cpp 25 Nov 2003 15:05:56 -0000 1.5 --- ToolPref.cpp 28 Nov 2003 13:20:37 -0000 1.6 *************** *** 546,550 **** { m_ErrParserPredefinedList.ResetContent(); ! CFile cf(theApp.GetAppPath()+"ErrParsers\\manifest.ini",CFile::modeRead); CArchive arIn(&cf,CArchive::load); CString tmpFileLine; --- 546,551 ---- { m_ErrParserPredefinedList.ResetContent(); ! CString str = theApp.GetAppPath(); ! CFile cf(str+"ErrParsers\\manifest.ini",CFile::modeRead); CArchive arIn(&cf,CArchive::load); CString tmpFileLine; Index: WorkspaceBar.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** WorkspaceBar.cpp 21 Nov 2003 13:53:00 -0000 1.22 --- WorkspaceBar.cpp 28 Nov 2003 13:20:38 -0000 1.23 *************** *** 251,255 **** void CWorkspaceBar::FillProjectView() { ! m_wndProjectView.InsertItem(_T("No WorkSpace Loaded"),5,5); } --- 251,255 ---- void CWorkspaceBar::FillProjectView() { ! m_wndProjectView.InsertItem(_T("No WorkSpace Loaded"),5,5); } *************** *** 277,281 **** { m_wndProjectView.CloseWorkspace(); - FillProjectView(); } --- 277,280 ---- *************** *** 292,297 **** void CWorkspaceBar::AddFileUnderProject(LPCSTR proText,LPCSTR filPath) { ! HTREEITEM hItem = m_wndProjectView.GetProjectItemForString(proText); ! m_wndProjectView.AddFile(filPath,hItem); } --- 291,295 ---- void CWorkspaceBar::AddFileUnderProject(LPCSTR proText,LPCSTR filPath) { ! m_wndProjectView.AddFileUnderProject(proText,filPath); } *************** *** 422,427 **** xx[acnt-1] = NULL; //This is necessary according to standards maina(acnt-1,xx); //Call to the main function of ctags ... ! for(i=0;i<acnt-1;i++) { --- 420,428 ---- xx[acnt-1] = NULL; //This is necessary according to standards + CTime t = CTime::GetCurrentTime(); + TRACE("Beginning tag gen : %s\n",t.Format("%H:%M:%S")); maina(acnt-1,xx); //Call to the main function of ctags ... ! CTime t1 = CTime::GetCurrentTime(); ! TRACE("Ending tag gen : %s\n",t1.Format("%H:%M:%S")); for(i=0;i<acnt-1;i++) { *************** *** 473,482 **** } ! CString CWorkspaceBar::GetCurrentProject() { return m_wndProjectView.GetCurrentProject(); } ! CString CWorkspaceBar::GetCurrentWorkspace() { return m_wndProjectView.GetCurrentWorkspace(); --- 474,483 ---- } ! LPCSTR CWorkspaceBar::GetCurrentProject() { return m_wndProjectView.GetCurrentProject(); } ! LPCSTR CWorkspaceBar::GetCurrentWorkspace() { return m_wndProjectView.GetCurrentWorkspace(); *************** *** 488,492 **** } ! BOOL CWorkspaceBar::IsFileInCurrentProject(CString fileName) { return m_wndProjectView.IsFileInCurrentProject(fileName); --- 489,493 ---- } ! BOOL CWorkspaceBar::IsFileInCurrentProject(LPCSTR fileName) { return m_wndProjectView.IsFileInCurrentProject(fileName); Index: WorkspaceBar.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** WorkspaceBar.h 11 Aug 2003 04:03:19 -0000 1.17 --- WorkspaceBar.h 28 Nov 2003 13:20:38 -0000 1.18 *************** *** 84,91 **** CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word,CStringArray &arr); ! BOOL IsFileInCurrentProject(CString fileName); void GetCurrentProjectFiles(CStringArray& repository); ! CString GetCurrentWorkspace(); ! CString GetCurrentProject(); void ReturnItemsForCodeList(CStringArray &arr); virtual ~CWorkspaceBar(); --- 84,91 ---- CTagList * GetCurrentTagList(); void GetTagsNearest(LPCSTR word,CStringArray &arr); ! BOOL IsFileInCurrentProject(LPCSTR fileName); void GetCurrentProjectFiles(CStringArray& repository); ! LPCSTR GetCurrentWorkspace(); ! LPCSTR GetCurrentProject(); void ReturnItemsForCodeList(CStringArray &arr); virtual ~CWorkspaceBar(); |
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv10903 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEdit.h AnyEdit.rc AnyEditDoc.cpp AnyEditView.cpp AnyEditView.h AutoComp.cpp ChangeLog.txt ClassView.cpp ClipTextEditor.cpp ClipTextEditor.h ClipTree.cpp CodingPref.cpp CodingPref.h EditorPref.cpp EditorPref.h GeneralPref.cpp GeneralPref.h Language.cpp Language.h MainFrm.cpp RegProfile.h ScintillaDefaults.cpp ScintillaDefaults.h ToolPref.cpp ctagslib.lib Removed Files: ClipParser.cpp ClipParser.h Log Message: - Rewrote clip text editor. Removed CClipParser class. Enhanced editor window. - Prevented unwanted reloading of clip texts - Fixed bug which saved preferences change even during a cancel - Color settings and file syntax settings are set without reloading document or restarting AnyEdit - Removed many ctags related memory leaks - File modification check now handles file deletion properly. [#799171] - Added global option in preferences to view whitespaces. Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AnyEdit.cpp 22 Nov 2003 16:14:19 -0000 1.33 --- AnyEdit.cpp 25 Nov 2003 15:05:55 -0000 1.34 *************** *** 995,998 **** --- 995,1008 ---- { m_sdefaults.LoadDefaults(); + LoadLanguageExtensions(); + POSITION lpos = langmap.GetStartPosition(); + while(lpos!=NULL) + { + CString tstr; + CObject * tlang; + langmap.GetNextAssoc(lpos,tstr,tlang); + LoadLanguage(tstr); + } + POSITION pos = pDocTemplate->GetFirstDocPosition(); while(pos!=NULL) *************** *** 1032,1036 **** { int x = m_reg.GetProfileInt(SEC_LANG,_T("Count"),0); ! TCHAR tempStr[1024]; CString langstr; --- 1042,1047 ---- { int x = m_reg.GetProfileInt(SEC_LANG,_T("Count"),0); ! TCHAR tempStr[1024]; ! extmap.RemoveAll(); CString langstr; *************** *** 1124,1128 **** return NULL; ! CLanguage * lang = new CLanguage; CScript sc; int lp; --- 1135,1150 ---- return NULL; ! CLanguage * lang; ! CObject * tlang=NULL; ! langmap.Lookup(langpos,tlang); ! if(tlang==NULL) ! { ! lang = new CLanguage(); ! }else ! { ! lang = (CLanguage *)tlang; ! lang->ResetLanguage(); ! } ! CScript sc; int lp; *************** *** 1452,1454 **** --- 1474,1488 ---- { ((CMainFrame*)m_pMainWnd)->ClearClassView(); + } + + void CAnyEditApp::ReloadACMP() + { + POSITION pos = langmap.GetStartPosition(); + while(pos!=NULL) + { + CLanguage * lang; + CString str; + langmap.GetNextAssoc(pos,str,(CObject *&)lang); + if(lang)lang->LoadAcmpFile(); + } } Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AnyEdit.dsp 22 Nov 2003 16:14:19 -0000 1.25 --- AnyEdit.dsp 25 Nov 2003 15:05:56 -0000 1.26 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W4 /GX /Ox /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Ox /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 72,76 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 72,76 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 295,302 **** # Begin Source File - SOURCE=.\ClipParser.cpp - # End Source File - # Begin Source File - SOURCE=.\ClipTextEditor.cpp # End Source File --- 295,298 ---- *************** *** 621,628 **** # PROP Default_Filter "" - # Begin Source File - - SOURCE=.\ClipParser.h - # End Source File # Begin Source File --- 617,620 ---- Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AnyEdit.h 20 Nov 2003 15:47:49 -0000 1.27 --- AnyEdit.h 25 Nov 2003 15:05:56 -0000 1.28 *************** *** 143,146 **** --- 143,147 ---- public: + void ReloadACMP(); void ClearClassView(); CComboBox * findbox; Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AnyEdit.rc 18 Nov 2003 11:27:21 -0000 1.27 --- AnyEdit.rc 25 Nov 2003 15:05:56 -0000 1.28 *************** *** 1324,1330 **** CONTROL "Enable Word Wrap",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,7,139,15 ! CONTROL "Show Vertical Scroll Bar",IDC_CHECK8,"Button", ! BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,151,22,139, ! 15 CONTROL "Allow horizontal splitting",IDC_CHECK9,"Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,151,38,139, --- 1324,1329 ---- CONTROL "Enable Word Wrap",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,7,139,15 ! CONTROL "View Whitespaces",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,151,22,139,15 CONTROL "Allow horizontal splitting",IDC_CHECK9,"Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,151,38,139, *************** *** 1629,1633 **** STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Clip Text Editor" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,185,212,50,14 --- 1628,1632 ---- STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Clip Text Editor" ! FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,185,212,50,14 *************** *** 1636,1643 **** PUSHBUTTON "&Add Clip",IDC_BUTTON1,7,105,50,16 PUSHBUTTON "&Remove Clip",IDC_BUTTON2,105,105,59,16 - CONTROL "",IDC_RICHEDIT1,"RICHEDIT",ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | - ES_NUMBER | WS_VSCROLL | WS_TABSTOP,7,124,284,82, - WS_EX_STATICEDGE LTEXT "Edit Clip Text",IDC_STATIC,168,105,44,16,SS_CENTERIMAGE COMBOBOX IDC_COMBO1,212,107,79,41,CBS_DROPDOWNLIST | --- 1635,1638 ---- *************** *** 1645,1648 **** --- 1640,1647 ---- PUSHBUTTON "&SaveClip",IDC_BUTTON3,58,105,47,16 PUSHBUTTON "",IDC_BUTTON4,7,213,15,13 + EDITTEXT IDC_EDIT1,7,124,284,82,ES_MULTILINE | ES_AUTOVSCROLL | + ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP, + WS_EX_STATICEDGE END *************** *** 1822,1843 **** END - IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95 - STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "Dialog" - FONT 8, "MS Sans Serif" - BEGIN - DEFPUSHBUTTON "OK",IDOK,129,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 - END - - IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 186, 95 - STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "Dialog" - FONT 8, "MS Sans Serif" - BEGIN - DEFPUSHBUTTON "OK",IDOK,129,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 - END - #ifndef _MAC --- 1821,1824 ---- *************** *** 2114,2133 **** TOPMARGIN, 7 BOTTOMMARGIN, 182 - END - - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 - END - - IDD_DIALOG2, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 END END --- 2095,2098 ---- Index: AnyEditDoc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AnyEditDoc.cpp 21 Nov 2003 13:53:00 -0000 1.12 --- AnyEditDoc.cpp 25 Nov 2003 15:05:56 -0000 1.13 *************** *** 168,171 **** --- 168,179 ---- { theApp.SetDefaults(m_pScintilla); + if(m_pScintilla) + { + if(m_pDocLang) + { + m_pDocLang->FillUpScintilla(m_pScintilla); + } + } + theApp.ApplyOtherDefaults(m_pScintilla); } Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** AnyEditView.cpp 21 Nov 2003 13:53:00 -0000 1.35 --- AnyEditView.cpp 25 Nov 2003 15:05:56 -0000 1.36 *************** *** 149,153 **** outoffocus = FALSE; isHighlightingOn = TRUE; ! } --- 149,153 ---- outoffocus = FALSE; isHighlightingOn = TRUE; ! fileclosed=FALSE; } *************** *** 986,989 **** --- 986,992 ---- { + if(arr.GetSize()!=0) + if(arr.GetAt(arr.GetSize()-1).IsEmpty()) + arr.RemoveAt(arr.GetSize()-1); BOOL cuttext = FALSE; m_Scintilla.BeginUndoAction(); *************** *** 1010,1014 **** for(int j=0;j<y;j++) { - if(ntxt[j] != '\t') { --- 1013,1016 ---- *************** *** 1177,1193 **** if(!file.GetStatus(str,status)) { //Find out how to close a view from inside the view ! /* CString msg = "'"; msg+= str; msg+= "'\nFile has been deleted outside AnyEdit!\nDo you want to close the window ?"; theApp.SetModification(FALSE); if(AfxMessageBox(msg,MB_YESNO)==IDYES) { if(this) { last_access_time = NULL; - this->GetParentFrame()->PostMessage(WM_CLOSE); theApp.SetModification(TRUE); } } --- 1179,1200 ---- if(!file.GetStatus(str,status)) { + if(fileclosed) return; //Find out how to close a view from inside the view ! CString msg = "'"; msg+= str; msg+= "'\nFile has been deleted outside AnyEdit!\nDo you want to close the window ?"; theApp.SetModification(FALSE); + if(CurDocPath.IsEmpty()) return; if(AfxMessageBox(msg,MB_YESNO)==IDYES) { if(this) { + fileclosed=TRUE; last_access_time = NULL; theApp.SetModification(TRUE); + //delete this; + this->GetParentFrame()->PostMessage(WM_CLOSE); + return; } } *************** *** 1196,1200 **** last_access_time = NULL; theApp.SetModification(TRUE); ! }*/ } --- 1203,1207 ---- last_access_time = NULL; theApp.SetModification(TRUE); ! } } Index: AnyEditView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AnyEditView.h 27 Aug 2003 06:32:42 -0000 1.18 --- AnyEditView.h 25 Nov 2003 15:05:56 -0000 1.19 *************** *** 32,35 **** --- 32,36 ---- BOOL outoffocus; CTime last_access_time; + BOOL fileclosed; CToolBar m_wndTool; Index: AutoComp.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AutoComp.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AutoComp.cpp 8 May 2003 12:00:56 -0000 1.4 --- AutoComp.cpp 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 54,57 **** --- 54,58 ---- filStr = filPath; + clipArr.RemoveAll(); m_parse.LoadClipFileToArray(filPath,clipArr); } Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ChangeLog.txt 21 Nov 2003 13:53:00 -0000 1.31 --- ChangeLog.txt 25 Nov 2003 15:05:56 -0000 1.32 *************** *** 43,46 **** --- 43,53 ---- 36) Proper save of find and replace history done [#798521] 37) Standalone file leaves garbage in class view - Fixed [#730650] + 38) Rewrote clip text editor. Removed CClipParser class. Enhanced editor window. + 39) Prevented unwanted reloading of clip texts + 40) Fixed bug which saved preferences change even during a cancel + 41) Color settings and file syntax settings are set without reloading document or restarting AnyEdit + 42) Removed many ctags related memory leaks + 43) File modification check now handles file deletion properly. [#799171] + 44) Added global option in preferences to view whitespaces. Index: ClassView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ClassView.cpp 20 Nov 2003 15:47:49 -0000 1.22 --- ClassView.cpp 25 Nov 2003 15:05:56 -0000 1.23 *************** *** 513,517 **** HTREEITEM parItem = GetParentItem(hItem); ! CString par = GetItemText(parItem); BOOL iscategory=FALSE; DWORD dwda=GetItemData(parItem); --- 513,517 ---- HTREEITEM parItem = GetParentItem(hItem); ! CString par = GetItemText(parItem); BOOL iscategory=FALSE; DWORD dwda=GetItemData(parItem); *************** *** 888,892 **** } ! return parItem; } --- 888,892 ---- } ! return GetRootItem(); } Index: ClipTextEditor.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClipTextEditor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClipTextEditor.cpp 8 May 2003 12:00:56 -0000 1.4 --- ClipTextEditor.cpp 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 54,66 **** CString curString = GetItemText(GetSelItem()); m_pParent->curSelStr = curString; ! CStringArray arr; ! m_pParent->cParser.GetClipValueToArray(curString,arr); ! int y=arr.GetSize(); ! curString.Empty(); ! for(int i=0;i<y;i++) ! { ! curString+=arr.GetAt(i)+_T("\n"); ! } ! m_pParent->m_rich.SetWindowText(curString); } --- 54,59 ---- CString curString = GetItemText(GetSelItem()); m_pParent->curSelStr = curString; ! CString content = m_pParent->fccur->GetContent(curString); ! m_pParent->m_rich.SetWindowText(content); } *************** *** 68,78 **** { CString newStr = GetItemText(iItem); ! m_pParent->cParser.ChangeClipText(m_pParent->curSelStr,newStr); m_pParent->curSelStr = newStr; } BOOL CClipList::OnBeforeRemoveItem(int iItem) { ! m_pParent->cParser.RemoveClip(GetItemText(iItem)); return TRUE; } --- 61,83 ---- { CString newStr = GetItemText(iItem); ! m_pParent->fccur->ChangeClipHeading(m_pParent->curSelStr,newStr); m_pParent->curSelStr = newStr; } + void CClipList::OnAfterMoveItemUp(int iItem) + { + CString newStr = GetItemText(iItem); + m_pParent->fccur->MoveClipUp(newStr); + } + + void CClipList::OnAfterMoveItemDown(int iItem) + { + CString newStr = GetItemText(iItem); + m_pParent->fccur->MoveClipDown(newStr); + } + BOOL CClipList::OnBeforeRemoveItem(int iItem) { ! m_pParent->fccur->RemoveClip(GetItemText(iItem)); return TRUE; } *************** *** 82,87 **** { //{{AFX_DATA_INIT(CClipTextEditor) ! // NOTE: the ClassWizard will add member initialization here ! //}}AFX_DATA_INIT } --- 87,92 ---- { //{{AFX_DATA_INIT(CClipTextEditor) ! //}}AFX_DATA_INIT ! } *************** *** 91,96 **** CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CClipTextEditor) DDX_Control(pDX, IDC_BUTTON4, m_helpButton); - DDX_Control(pDX, IDC_RICHEDIT1, m_rich); DDX_Control(pDX, IDC_COMBO1, m_combo); DDX_Control(pDX, IDC_BUTTON3, m_removeClip); --- 96,101 ---- CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CClipTextEditor) + DDX_Control(pDX, IDC_EDIT1, m_rich); DDX_Control(pDX, IDC_BUTTON4, m_helpButton); DDX_Control(pDX, IDC_COMBO1, m_combo); DDX_Control(pDX, IDC_BUTTON3, m_removeClip); *************** *** 98,102 **** DDX_Control(pDX, IDC_BUTTON1, m_addClip); DDX_Control(pDX, IDC_CLIP_LIST, m_list); ! //}}AFX_DATA_MAP } --- 103,107 ---- DDX_Control(pDX, IDC_BUTTON1, m_addClip); DDX_Control(pDX, IDC_CLIP_LIST, m_list); ! //}}AFX_DATA_MAP } *************** *** 111,115 **** ON_WM_HELPINFO() ON_BN_CLICKED(IDC_BUTTON4, OnButton4) ! //}}AFX_MSG_MAP END_MESSAGE_MAP() --- 116,122 ---- ON_WM_HELPINFO() ON_BN_CLICKED(IDC_BUTTON4, OnButton4) ! ON_WM_CREATE() ! ON_EN_CHANGE(IDC_EDIT1, OnChangeEditBox) ! //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 121,124 **** --- 128,152 ---- CDialog::OnInitDialog(); + VERIFY(m_Font.CreateFont( + 10, // nHeight + 0, // nWidth + 0, // nEscapement + 0, // nOrientation + FW_NORMAL, // nWeight + FALSE, // bItalic + FALSE, // bUnderline + 0, // cStrikeOut + ANSI_CHARSET, // nCharSet + OUT_DEFAULT_PRECIS, // nOutPrecision + CLIP_DEFAULT_PRECIS, // nClipPrecision + DEFAULT_QUALITY, // nQuality + DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily + "Courier")); // lpszFacename + + m_rich.SetFont(&m_Font,TRUE); + m_rich.SetTabStops(24); + + fchead=NULL; + fccur=NULL; m_addClip.SetImage (IDB_CLIP_NEW,IDB_CLIP_NEW); m_saveClip.SetImage (IDB_CLIP_REMOVE,IDB_CLIP_REMOVE); *************** *** 163,186 **** m_list.SetStandardButtons(BGCEDITLISTBOX_BTN_DELETE | BGCEDITLISTBOX_BTN_UP | BGCEDITLISTBOX_BTN_DOWN); CString firstClip; ! m_combo.SetCurSel(0); ! m_combo.GetWindowText(firstClip); ! clipPath+=_T("/"); LoadClipFile(clipPath+firstClip); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CClipTextEditor::LoadClipFile(LPCSTR cPath) { ! m_list.ClearAll(); ! CStringArray arr; ! m_parse.LoadClipFileToArray(cPath,arr); ! int y=arr.GetSize()-1; ! for(int i=0;i<y;i++) ! { ! m_list.AddItem(arr.GetAt(i)); ! } ! cParser.SetParserFile(cPath); } --- 191,279 ---- m_list.SetStandardButtons(BGCEDITLISTBOX_BTN_DELETE | BGCEDITLISTBOX_BTN_UP | BGCEDITLISTBOX_BTN_DOWN); CString firstClip; ! ! if(initialclippath.IsEmpty()) ! { ! m_combo.SetCurSel(0); ! m_combo.GetWindowText(firstClip); ! }else ! { ! int fnd = m_combo.FindString(0,initialclippath); ! m_combo.SetCurSel(fnd); ! m_combo.GetWindowText(firstClip); ! } ! ! clipPath+=_T("\\"); LoadClipFile(clipPath+firstClip); + if(!initialcliptext.IsEmpty()) + { + int cnt = m_list.GetCount(); + for(int i=0;i<cnt;i++) + { + CString tstr = m_list.GetItemText(i); + if(tstr == initialcliptext) + { + m_list.SelectItem(i); + break; + } + } + } + return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } + CClipTextEditor::~CClipTextEditor() + { + FileClips * fc = fchead; + while(fc!=NULL) + { + FileClips * tfc = fc->next; + delete fc; + fc = tfc; + } + + } + void CClipTextEditor::LoadClipFile(LPCSTR cPath) { ! m_list.LockWindowUpdate(); ! m_list.ClearAll(); ! FileClips * fc = fchead; ! BOOL foundfc=FALSE; ! while(fc!=NULL) ! { ! if(fc->filename == cPath) ! { ! foundfc=TRUE; ! break; ! } ! fc = fc->next; ! } ! ! if(!foundfc) ! { ! ! //Create new fc.. ! fc = new FileClips(); ! fc->LoadClips(cPath); ! fc->next = fchead; ! fchead = fc; ! } ! ! if(!fc) return; ! fccur = fc; ! int size=fc->clipvec.size(); ! for(int i=0;i<size;i++) ! m_list.AddItem(fc->clipvec[i].heading); ! ! m_list.SelectItem(0); ! m_list.UnlockWindowUpdate(); ! if(fccur->clipvec.size() >0) ! { ! CString cont = fccur->GetContent(fccur->clipvec[0].heading); ! m_rich.SetWindowText(cont); ! } ! } *************** *** 198,203 **** CString newClip = inpBox.GetOutput(); m_list.AddItem(newClip); m_list.SelectItem(m_list.GetCount()-1); - cParser.InsertNewClip(newClip); } --- 291,296 ---- CString newClip = inpBox.GetOutput(); m_list.AddItem(newClip); + fccur->AddClip(newClip,""); m_list.SelectItem(m_list.GetCount()-1); } *************** *** 205,225 **** { CDialog::OnDestroy(); - cParser.SaveFileToArray(); } void CClipTextEditor::OnSaveCurrentClip() { ! CStringArray arr; ! CString curStr; ! m_rich.GetWindowText(curStr); ! CMisc msc; ! msc.ReturnDelimitedArray(curStr,_T("\n"),arr); ! curStr = curSelStr; ! cParser.ChangeClipValue(curStr,arr); } ! void CClipTextEditor::SetType(BOOL xx) { type = xx; } --- 298,324 ---- { CDialog::OnDestroy(); } void CClipTextEditor::OnSaveCurrentClip() { ! } ! void CClipTextEditor::SetType(BOOL xx,LPCSTR cpath,LPCSTR initext) { type = xx; + if(cpath) + { + initialclippath = cpath; + int revpos = initialclippath.ReverseFind('/'); + if(revpos!=-1) + initialclippath = initialclippath.Right(initialclippath.GetLength()-revpos-1); + else initialclippath.Empty(); + } + + if(initext) + { + initialcliptext=initext; + } } *************** *** 227,231 **** { int i = m_list.GetSelItem(); ! cParser.RemoveClip(m_list.GetItemText(i)); m_list.RemoveItem(i); } --- 326,330 ---- { int i = m_list.GetSelItem(); ! fccur->RemoveClip(m_list.GetItemText(i)); m_list.RemoveItem(i); } *************** *** 244,246 **** --- 343,603 ---- str+= _T("./AnyEdit.chm::/DialogClipEditor.htm"); HtmlHelp(NULL,str,HH_DISPLAY_TOPIC,NULL); + } + + int CClipTextEditor::OnCreate(LPCREATESTRUCT lpCreateStruct) + { + if (CDialog::OnCreate(lpCreateStruct) == -1) + return -1; + return 0; + } + + void CClipTextEditor::OnChangeEditBox() + { + // TODO: If this is a RICHEDIT control, the control will not + // send this notification unless you override the CDialog::OnInitDialog() + // function and call CRichEditCtrl().SetEventMask() + // with the ENM_CHANGE flag ORed into the mask. + + // TODO: Add your control notification handler code here + CString newcontent; + m_rich.GetWindowText(newcontent); + fccur->ChangeClipContent(curSelStr,newcontent); + + } + + void CClipTextEditor::OnOK() + { + + FileClips * fc = fchead; + while(fc!=NULL) + { + fc->SaveClips(); + fc = fc->next; + } + + CDialog::OnOK(); + } + + BOOL CClipTextEditor::PreTranslateMessage(MSG* pMsg) + { + + if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB)) + { + // get the char index of the caret position + int nPos = LOWORD(m_rich.CharFromPos(m_rich.GetCaretPos())); + + // select zero chars + m_rich.SetSel(nPos, nPos); + + // then replace that selection with a TAB + m_rich.ReplaceSel("\t", TRUE); + + // no need to do a msg translation, so quit. + // that way no further processing gets done + return TRUE; + } + + return CDialog::PreTranslateMessage(pMsg); + } + + // FileClips Implementation below + + FileClips::FileClips() + { + next=NULL; + } + + FileClips::~FileClips() + { + clipvec.clear(); + } + + BOOL FileClips::LoadClips(LPCSTR file) + { + filename = file; + + CStdioFile vFile; + CString sLine; + CString tLine; + + if(vFile.Open(filename, CFile::modeRead | CFile::shareDenyWrite)) + { + while(vFile.ReadString(sLine)) + { + loopbeg: + if(sLine.Left(8)==_T("#CAPTION")) + { + caption = RetPartialStringValue(sLine); + }else + + if(sLine.Left(2)==_T("#T")) + { + Clip tempclip; + tempclip.heading = RetPartialStringValue(sLine); + if(tempclip.heading.IsEmpty()) break; + while(vFile.ReadString(tLine)) + { + if(tLine.Left(2)==_T("#T")) + { + clipvec.push_back(tempclip); + sLine=tLine; + goto loopbeg; + } + if(!tLine.IsEmpty()) + { + tempclip.content += tLine; + tempclip.content += "\r\n"; + } + } + + } + + } + }else return FALSE; + + vFile.Close(); + return TRUE; + + } + + CString FileClips::RetPartialStringValue(LPCSTR lineStr) + { + CString retStr=_T(""); + + char *token; + token = strtok((char *)lineStr,_T("=")); + while(token != NULL) + { + retStr = token; + token=strtok(NULL,_T("=")); + } + return retStr; + } + + BOOL FileClips::SaveClips() + { + if(!filechanged) return FALSE; + CStringArray filcontent; + CString capstr = "#CAPTION="; + capstr+= caption; + filcontent.Add(capstr); + + int size=clipvec.size(); + for(int i=0;i<size;i++) + { + CString header="#T="; + header+= clipvec[i].heading; + filcontent.Add(header); + CString content = clipvec[i].content; + content.Replace("\r\n","\n"); + filcontent.Add(content); + } + + CString header="#T="; + filcontent.Add(header); + + CMisc msc; + msc.WriteArrayToFile(filcontent,filename); + return TRUE; + } + + BOOL FileClips::ChangeClipHeading(LPCSTR oldname, LPCSTR newname) + { + filechanged = TRUE; + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == oldname) + { + clipvec[i].heading = newname; + return TRUE; + } + } + return FALSE; + } + + BOOL FileClips::ChangeClipContent(LPCSTR clipheading,LPCSTR newcontent) + { + filechanged = TRUE; + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == clipheading) + { + clipvec[i].content = newcontent; + return TRUE; + } + } + return FALSE; + } + + BOOL FileClips::AddClip(LPCSTR head,LPCSTR cont) + { + Clip newclip; + newclip.heading = head; + newclip.content = cont; + clipvec.push_back(newclip); + return TRUE; + } + + BOOL FileClips::RemoveClip(LPCSTR head) + { + filechanged = TRUE; + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == head) + { + clipvec.erase(clipvec.begin()+i); + return TRUE; + } + } + return FALSE; + } + + void FileClips::MoveClipUp(LPCSTR head) + { + filechanged = TRUE; + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == head) + { + if(i!=0) + { + std::swap(clipvec[i-1],clipvec[i]); + } + break; + } + } + } + + void FileClips::MoveClipDown(LPCSTR head) + { + filechanged = TRUE; + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == head) + { + if(i!=size-1) + { + std::swap(clipvec[i+1],clipvec[i]); + } + break; + } + } + } + + LPCSTR FileClips::GetContent(LPCSTR head) + { + int size = clipvec.size(); + for(int i=0;i<size;i++) + { + if(clipvec[i].heading == head) + { + return clipvec[i].content; + } + } + return NULL; } Index: ClipTextEditor.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClipTextEditor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClipTextEditor.h 8 May 2003 12:00:56 -0000 1.2 --- ClipTextEditor.h 25 Nov 2003 15:05:56 -0000 1.3 *************** *** 9,13 **** #include "Misc.h" #include "Parser.h" ! #include "ClipParser.h" class CClipTextEditor; --- 9,15 ---- #include "Misc.h" #include "Parser.h" ! #include <vector> ! ! using namespace std; class CClipTextEditor; *************** *** 18,26 **** CClipList(CClipTextEditor* pParent) : m_pParent (pParent) ! {} virtual void OnSelectionChanged (); virtual BOOL OnBeforeRemoveItem (int iItem); virtual void OnAfterRenameItem(int iItem); void ClearAll(); --- 20,31 ---- CClipList(CClipTextEditor* pParent) : m_pParent (pParent) ! { ! } virtual void OnSelectionChanged (); virtual BOOL OnBeforeRemoveItem (int iItem); virtual void OnAfterRenameItem(int iItem); + virtual void OnAfterMoveItemUp(int iItem); + virtual void OnAfterMoveItemDown(int iItem); void ClearAll(); *************** *** 31,34 **** --- 36,70 ---- // CClipTextEditor dialog + struct Clip + { + CString heading; + CString content; + }; + + class FileClips + { + public: + FileClips(); + virtual ~FileClips(); + + CString filename; + CString caption; + + vector<Clip> clipvec; + BOOL filechanged; + FileClips * next; + + BOOL LoadClips(LPCSTR file); + BOOL SaveClips(); + BOOL ChangeClipHeading(LPCSTR oldname, LPCSTR newname); + BOOL ChangeClipContent(LPCSTR clipheading,LPCSTR newcontent); + BOOL AddClip(LPCSTR head,LPCSTR cont); + BOOL RemoveClip(LPCSTR head); + void MoveClipUp(LPCSTR head); + void MoveClipDown(LPCSTR head); + CString RetPartialStringValue(LPCSTR lineStr); + LPCSTR GetContent(LPCSTR head); + }; + class CClipTextEditor : public CDialog { *************** *** 36,45 **** public: CClipTextEditor(CWnd* pParent = NULL); // standard constructor ! void SetType(BOOL xx); // Dialog Data //{{AFX_DATA(CClipTextEditor) ! enum { IDD = IDD_CLIP_EDITOR }; CBCGButton m_helpButton; - CRichEditCtrl m_rich; CComboBox m_combo; CBCGButton m_removeClip; --- 72,81 ---- public: CClipTextEditor(CWnd* pParent = NULL); // standard constructor ! void SetType(BOOL xx,LPCSTR cpath=NULL,LPCSTR ctext=NULL); // Dialog Data //{{AFX_DATA(CClipTextEditor) ! enum { IDD = IDD_CLIP_EDITOR }; ! CEdit m_rich; CBCGButton m_helpButton; CComboBox m_combo; CBCGButton m_removeClip; *************** *** 47,68 **** CBCGButton m_addClip; CClipList m_list; ! //}}AFX_DATA public: void LoadClipFile(LPCSTR cPath); - CParser m_parse; CString clipPath; CString curSelStr; - CClipParser cParser; BOOL type; protected: CMisc msc; // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CClipTextEditor) ! protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support ! //}}AFX_VIRTUAL // Implementation --- 83,110 ---- CBCGButton m_addClip; CClipList m_list; ! //}}AFX_DATA public: + virtual ~CClipTextEditor(); void LoadClipFile(LPCSTR cPath); CString clipPath; + CString initialclippath; + CString initialcliptext; CString curSelStr; BOOL type; + FileClips * fchead; + FileClips * fccur; protected: CMisc msc; + CFont m_Font; // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CClipTextEditor) ! public: ! virtual BOOL PreTranslateMessage(MSG* pMsg); ! protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support ! //}}AFX_VIRTUAL // Implementation *************** *** 79,83 **** afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); afx_msg void OnButton4(); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; --- 121,128 ---- afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); afx_msg void OnButton4(); ! afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); ! afx_msg void OnChangeEditBox(); ! virtual void OnOK(); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; Index: ClipTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClipTree.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClipTree.cpp 8 May 2003 12:00:56 -0000 1.2 --- ClipTree.cpp 25 Nov 2003 15:05:56 -0000 1.3 *************** *** 198,206 **** void CClipTree::OnPopupclipCliptexteditor() { CClipTextEditor cTextEditor; ! cTextEditor.SetType(FALSE); ! cTextEditor.DoModal(); ! loadedList = FALSE; ! LoadClipFiles(); } --- 198,230 ---- void CClipTree::OnPopupclipCliptexteditor() { + + HTREEITEM selItem=GetSelectedItem(); + BOOL isparent=FALSE; + if(IsItemClipHolder(selItem)) + { + isparent=TRUE; + } + else + { + selItem= GetParentItem(selItem); + } + + CString initext; + if(!isparent) + { + initext = GetItemText(GetSelectedItem()); + } + + int parInt = GetItemData(selItem); + CString parPath; + tmap.Lookup(parInt,parPath); + CClipTextEditor cTextEditor; ! cTextEditor.SetType(FALSE,parPath,initext); ! if(cTextEditor.DoModal()==IDOK) ! { ! loadedList = FALSE; ! LoadClipFiles(); ! } } Index: CodingPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/CodingPref.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CodingPref.cpp 8 May 2003 12:00:56 -0000 1.4 --- CodingPref.cpp 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 121,124 **** --- 121,129 ---- { CSAPrefsSubDlg::OnDestroy(); + + } + + void CCodingPref::OnOK() + { int ackey=0; if(m_tabKey.GetCheck()==TRUE) *************** *** 135,139 **** --- 140,151 ---- m_reg.WriteProfileInt(_T("Preferences"),_T("EnableClassView"),m_enableClassView); m_reg.WriteProfileInt(_T("Preferences"),_T("EnableAlphabetic"),m_alphabetic); + CSAPrefsSubDlg::OnOK(); } + + void CCodingPref::OnCancel() + { + CSAPrefsSubDlg::OnCancel(); + } + int CCodingPref::OnCreate(LPCREATESTRUCT lpCreateStruct) Index: CodingPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/CodingPref.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CodingPref.h 8 May 2003 12:00:56 -0000 1.3 --- CodingPref.h 25 Nov 2003 15:05:56 -0000 1.4 *************** *** 19,23 **** --- 19,26 ---- public: CCodingPref(CWnd* pParent = NULL); // standard constructor + virtual void OnOK(); + virtual void OnCancel(); + protected: // Dialog Data //{{AFX_DATA(CCodingPref) Index: EditorPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/EditorPref.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EditorPref.cpp 8 May 2003 12:00:56 -0000 1.5 --- EditorPref.cpp 25 Nov 2003 15:05:56 -0000 1.6 *************** *** 56,60 **** m_check13 = FALSE; m_check7 = FALSE; ! //}}AFX_DATA_INIT } --- 56,61 ---- m_check13 = FALSE; m_check7 = FALSE; ! m_whitespace = FALSE; ! //}}AFX_DATA_INIT } *************** *** 77,81 **** DDX_Check(pDX, IDC_CHECK13, m_check13); DDX_Check(pDX, IDC_CHECK7, m_check7); ! //}}AFX_DATA_MAP } --- 78,83 ---- DDX_Check(pDX, IDC_CHECK13, m_check13); DDX_Check(pDX, IDC_CHECK7, m_check7); ! DDX_Check(pDX, IDC_CHECK8, m_whitespace); ! //}}AFX_DATA_MAP } *************** *** 98,101 **** --- 100,104 ---- m_check4 = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_FOLD, TRUE ); m_check5 = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_EOL, FALSE); + m_whitespace = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_WHITESPACE, FALSE); m_check6 = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_CURLINE, TRUE ); m_check11 = m_reg.GetProfileInt( SEC_DEF, DEF_TAB_SPACES, FALSE ); *************** *** 120,123 **** --- 123,127 ---- m_reg.WriteProfileInt( SEC_DEF, DEF_VIEW_EOL, m_check5); m_reg.WriteProfileInt( SEC_DEF, DEF_VIEW_CURLINE, m_check6); + m_reg.WriteProfileInt( SEC_DEF, DEF_VIEW_WHITESPACE, m_whitespace); m_reg.WriteProfileInt( SEC_DEF, DEF_TAB_SPACES, m_check11); m_reg.WriteProfileInt( SEC_DEF, KEY_TABSIZE , m_tabsize ); *************** *** 129,133 **** void EditorPref::OnDestroy() { - SaveData(); CSAPrefsSubDlg::OnDestroy(); } --- 133,147 ---- void EditorPref::OnDestroy() { CSAPrefsSubDlg::OnDestroy(); + } + + void EditorPref::OnOK() + { + SaveData(); + CSAPrefsSubDlg::OnOK(); + } + + void EditorPref::OnCancel() + { + CSAPrefsSubDlg::OnCancel(); } Index: EditorPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/EditorPref.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EditorPref.h 8 May 2003 12:00:56 -0000 1.4 --- EditorPref.h 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 21,27 **** public: void SaveData(); // Dialog Data //{{AFX_DATA(EditorPref) ! enum { IDD = IDD_PREF_EDITOR }; BOOL m_check1; BOOL m_check2; --- 21,29 ---- public: void SaveData(); + virtual void OnOK(); + virtual void OnCancel(); // Dialog Data //{{AFX_DATA(EditorPref) ! enum { IDD = IDD_PREF_EDITOR }; BOOL m_check1; BOOL m_check2; *************** *** 35,39 **** BOOL m_check13; BOOL m_check7; ! //}}AFX_DATA protected: --- 37,42 ---- BOOL m_check13; BOOL m_check7; ! BOOL m_whitespace; ! //}}AFX_DATA protected: Index: GeneralPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/GeneralPref.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GeneralPref.cpp 6 Jul 2003 18:49:47 -0000 1.7 --- GeneralPref.cpp 25 Nov 2003 15:05:56 -0000 1.8 *************** *** 86,87 **** --- 86,109 ---- ///////////////////////////////////////////////////////////////////////////// // CGeneralPref message handlers + + void CGeneralPref::OnOK() + { + //Saving general preferences + m_reg.WriteProfileInt(_T("Preferences"),_T("SaveDocs"),m_SaveDocs); + m_reg.WriteProfileInt(_T("Preferences"),_T("MaxMain"),m_MaxMain); + m_reg.WriteProfileInt(_T("Preferences"),_T("MaxChild"),m_MaxChild); + m_reg.WriteProfileInt(_T("Preferences"),_T("NewDoc"),m_NewDoc); + m_reg.WriteProfileInt(_T("Preferences"),_T("MultInstance"),m_MultInstance); + m_reg.WriteProfileInt(_T("Preferences"),_T("LastWS"),m_lastws); + m_reg.WriteProfileInt(_T("Preferences"),_T("TabTop"),m_tabtop); + m_reg.WriteProfileInt(_T("Preferences"),_T("StartPage"),m_startpage); + m_reg.WriteProfileInt(_T("Preferences"),_T("CheckModification"),m_checkmod); + m_reg.WriteProfileInt(_T("Preferences"),_T("MiniToolbar"),m_minitoolbar); + + CSAPrefsSubDlg::OnOK(); + } + + void CGeneralPref::OnCancel() + { + CSAPrefsSubDlg::OnCancel(); + } Index: GeneralPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/GeneralPref.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GeneralPref.h 6 Jul 2003 18:49:47 -0000 1.5 --- GeneralPref.h 25 Nov 2003 15:05:56 -0000 1.6 *************** *** 17,22 **** --- 17,27 ---- protected: CRegProfile m_reg; + public: CGeneralPref(CWnd* pParent = NULL); // standard constructor + virtual void OnOK(); + virtual void OnCancel(); + + protected: // Dialog Data //{{AFX_DATA(CGeneralPref) Index: Language.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Language.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Language.cpp 20 Nov 2003 15:47:49 -0000 1.10 --- Language.cpp 25 Nov 2003 15:05:56 -0000 1.11 *************** *** 31,34 **** --- 31,35 ---- CLanguage::~CLanguage() { + ResetLanguage(); } *************** *** 229,233 **** void CLanguage::LoadAcmpFile(LPCSTR fname) { ! autoComp.SetAcmpFile(fname); } --- 230,239 ---- void CLanguage::LoadAcmpFile(LPCSTR fname) { ! if(fname) ! { ! autoComp.SetAcmpFile(fname); ! acmpfilepath=fname; ! } ! else autoComp.SetAcmpFile(acmpfilepath); } *************** *** 241,243 **** --- 247,258 ---- { return autoComp.GetAcmpWordList(arr); + } + + void CLanguage::ResetLanguage() + { + forecolormap.RemoveAll(); + backcolormap.RemoveAll(); + fontstylemap.RemoveAll(); + fontmap.RemoveAll(); + fontsizemap.RemoveAll(); } Index: Language.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Language.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Language.h 8 May 2003 12:00:56 -0000 1.3 --- Language.h 25 Nov 2003 15:05:56 -0000 1.4 *************** *** 45,48 **** --- 45,49 ---- //CStringArray listwords; CString listwords; + CString acmpfilepath; public: *************** *** 69,75 **** //CStringArray * GetListWords(); void GetListWords(CString &lwords); ! void LoadAcmpFile(LPCSTR fname); ! BOOL GetValueToArray(LPCSTR val, CStringArray &arr); ! //plenty more to come :) --- 70,76 ---- //CStringArray * GetListWords(); void GetListWords(CString &lwords); ! void LoadAcmpFile(LPCSTR fname=NULL); ! BOOL GetValueToArray(LPCSTR val, CStringArray &arr); ! void ResetLanguage(); //plenty more to come :) Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MainFrm.cpp 11 Aug 2003 04:03:19 -0000 1.27 --- MainFrm.cpp 25 Nov 2003 15:05:56 -0000 1.28 *************** *** 177,181 **** //For 2000 look :) ! CList<UINT, UINT> lstBasicCoomads; lstBasicCoomads.AddTail (ID_FILE_NEW); --- 177,181 ---- //For 2000 look :) ! /*CList<UINT, UINT> lstBasicCoomads; lstBasicCoomads.AddTail (ID_FILE_NEW); *************** *** 198,202 **** lstBasicCoomads.AddTail (ID_VIEW_CUSTOMIZE); ! CBCGToolBar::SetBasicCommands (lstBasicCoomads); CBCGToolBar::AddToolBarForImageCollection (IDR_USERMENUS); CBCGToolBar::AddToolBarForImageCollection (IDR_USERMENUS2); --- 198,202 ---- lstBasicCoomads.AddTail (ID_VIEW_CUSTOMIZE); ! CBCGToolBar::SetBasicCommands (lstBasicCoomads);*/ CBCGToolBar::AddToolBarForImageCollection (IDR_USERMENUS); CBCGToolBar::AddToolBarForImageCollection (IDR_USERMENUS2); *************** *** 882,887 **** { //Set the caption look ! CBCGSizingControlBar::SetCaptionStyle ( (m_reg.GetProfileInt(_T("DockSettings"),_T("Caption"),0)) ,1); ! theApp.m_bTabFlatBorders = m_reg.GetProfileInt(_T("DockSettings"),_T("FlatTabs"),0); theApp.m_bTabFlatBorders = !theApp.m_bTabFlatBorders; OnViewLookTab(); --- 882,887 ---- { //Set the caption look ! CBCGSizingControlBar::SetCaptionStyle ( (m_reg.GetProfileInt(_T("DockSettings"),_T("Caption"),1)) ,1); ! theApp.m_bTabFlatBorders = m_reg.GetProfileInt(_T("DockSettings"),_T("FlatTabs"),1); theApp.m_bTabFlatBorders = !theApp.m_bTabFlatBorders; OnViewLookTab(); *************** *** 929,934 **** ! void CMainFrame::SaveSettingsToRegistry ! () { //saving window placement --- 929,933 ---- ! void CMainFrame::SaveSettingsToRegistry() { //saving window placement *************** *** 936,940 **** wp.length = sizeof( wp ); ::GetWindowPlacement( m_hWnd, &wp ); ! VERIFY( m_reg.WriteProfileBinary( CODE_SECTION, KEY_WINDOWPOS, ( LPBYTE ) &wp, sizeof( wp ) ) ); //FInd replace list --- 935,939 ---- wp.length = sizeof( wp ); ::GetWindowPlacement( m_hWnd, &wp ); ! m_reg.WriteProfileBinary( CODE_SECTION, KEY_WINDOWPOS, ( LPBYTE ) &wp, sizeof( wp ) ); //FInd replace list *************** *** 989,1004 **** if (dlg.DoModal()==IDOK) { - //Saving general preferences - m_reg.WriteProfileInt(_T("Preferences"),_T("SaveDocs"),dlgGeneral.m_SaveDocs); - m_reg.WriteProfileInt(_T("Preferences"),_T("MaxMain"),dlgGeneral.m_MaxMain); - m_reg.WriteProfileInt(_T("Preferences"),_T("MaxChild"),dlgGeneral.m_MaxChild); - m_reg.WriteProfileInt(_T("Preferences"),_T("NewDoc"),dlgGeneral.m_NewDoc); - m_reg.WriteProfileInt(_T("Preferences"),_T("MultInstance"),dlgGeneral.m_MultInstance); - m_reg.WriteProfileInt(_T("Preferences"),_T("LastWS"),dlgGeneral.m_lastws); - m_reg.WriteProfileInt(_T("Preferences"),_T("TabTop"),dlgGeneral.m_tabtop); - m_reg.WriteProfileInt(_T("Preferences"),_T("StartPage"),dlgGeneral.m_startpage); - m_reg.WriteProfileInt(_T("Preferences"),_T("CheckModification"),dlgGeneral.m_checkmod); - m_reg.WriteProfileInt(_T("Preferences"),_T("MiniToolbar"),dlgGeneral.m_minitoolbar); - theApp.ResetAllProperties(); } --- 988,991 ---- *************** *** 1316,1320 **** CClipTextEditor cedit; cedit.SetType(TRUE); ! cedit.DoModal(); } --- 1303,1307 ---- CClipTextEditor cedit; cedit.SetType(TRUE); ! if(cedit.DoModal()==IDOK)theApp.ReloadACMP(); } Index: RegProfile.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/RegProfile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RegProfile.h 22 Nov 2003 16:14:19 -0000 1.4 --- RegProfile.h 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 49,52 **** --- 49,53 ---- #define DEF_ENABLE_MARGIN _T("RightMargin") #define DEF_MARGINSIZE _T("RightMarginSize") + #define DEF_VIEW_WHITESPACE _T("WhiteSpace") #define KEY_COLS _T("Colors") Index: ScintillaDefaults.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaDefaults.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ScintillaDefaults.cpp 22 Jul 2003 04:46:13 -0000 1.12 --- ScintillaDefaults.cpp 25 Nov 2003 15:05:56 -0000 1.13 *************** *** 43,46 **** --- 43,47 ---- view_folding_margin = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_FOLD, TRUE ); view_eol = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_EOL, FALSE); + view_whitespace = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_WHITESPACE, FALSE); highlight_current_line = m_reg.GetProfileInt( SEC_DEF, DEF_VIEW_CURLINE, TRUE ); usetabs = m_reg.GetProfileInt( SEC_DEF, DEF_TAB_SPACES, FALSE ); *************** *** 89,93 **** void CScintillaDefaults::LoadInitialSettings() { ! m_reg.WriteProfileInt(SEC_LANG,_T("Count"),7); AddLanguageToRegistry(1,"Java","java.syn","java,jav","java.acmp"); AddLanguageToRegistry(2,"HTML","html.syn","html,htm,php,asp,php3,shtml,phtml","html.acmp"); --- 90,94 ---- void CScintillaDefaults::LoadInitialSettings() { ! m_reg.WriteProfileInt(SEC_LANG,_T("Count"),9); AddLanguageToRegistry(1,"Java","java.syn","java,jav","java.acmp"); AddLanguageToRegistry(2,"HTML","html.syn","html,htm,php,asp,php3,shtml,phtml","html.acmp"); *************** *** 97,100 **** --- 98,103 ---- AddLanguageToRegistry(6,"XML","xml.syn","xml,xsl,svg,xul,xsd,dtd,xslt"); AddLanguageToRegistry(7,"Perl","perl.syn","pl,pm,cgi,pod"); + AddLanguageToRegistry(8,"Python","python.syn","py"); + AddLanguageToRegistry(9,"ASM","masm.syn","asm"); m_reg.WriteProfileString(_T("Preferences"),_T("Extension"),_T("All Files (*.*)|*.*|CPP Files (*.cpp;*.c;*.h;*.cxx;*.hpp)|*.cpp;*.c;*.h;*.cxx;*.hpp|Java Files(*.java)|*.java|HTML Files(*.html;*.htm;*.css;*.js)|*.html;*.htm;*.css;*.js|")); } *************** *** 175,179 **** } ! m_Scintilla->SetViewWS( view_whitespace /*SCWS_INVISIBLE SCWS_VISIBLEAFTERINDENT SCWS_VISIBLEALWAYS*/); m_Scintilla->SetViewEOL(view_eol); --- 178,184 ---- } ! if(view_whitespace) ! m_Scintilla->SetViewWS(SCWS_VISIBLEALWAYS); /*SCWS_INVISIBLE SCWS_VISIBLEAFTERINDENT SCWS_VISIBLEALWAYS*/ ! else m_Scintilla->SetViewWS(SCWS_INVISIBLE); m_Scintilla->SetViewEOL(view_eol); *************** *** 188,192 **** m_Scintilla->SetEdgeMode(EDGE_BACKGROUND); m_Scintilla->SetEdgeColumn(right_margin_width); ! } m_Scintilla->SetWrapMode(m_reg.GetProfileInt(_T("Preferences"),_T("WordWrap"),0)); --- 193,200 ---- m_Scintilla->SetEdgeMode(EDGE_BACKGROUND); m_Scintilla->SetEdgeColumn(right_margin_width); ! }else ! { ! m_Scintilla->SetEdgeMode(EDGE_NONE); ! } m_Scintilla->SetWrapMode(m_reg.GetProfileInt(_T("Preferences"),_T("WordWrap"),0)); *************** *** 253,257 **** ! m_Scintilla->RegisterImage(-1,(const char *)docico); m_Scintilla->RegisterImage(0,(const char *)docico); --- 261,265 ---- ! m_Scintilla->ClearRegisteredImages(); m_Scintilla->RegisterImage(-1,(const char *)docico); m_Scintilla->RegisterImage(0,(const char *)docico); Index: ScintillaDefaults.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaDefaults.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScintillaDefaults.h 6 Jul 2003 18:49:47 -0000 1.4 --- ScintillaDefaults.h 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 40,44 **** BOOL view_bookmark_margin; BOOL view_folding_margin; ! int view_whitespace; BOOL view_eol; BOOL highlight_current_line; --- 40,44 ---- BOOL view_bookmark_margin; BOOL view_folding_margin; ! BOOL view_whitespace; BOOL view_eol; BOOL highlight_current_line; Index: ToolPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToolPref.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToolPref.cpp 8 May 2003 12:00:56 -0000 1.4 --- ToolPref.cpp 25 Nov 2003 15:05:56 -0000 1.5 *************** *** 697,701 **** n++; tmpStr.Format("%d",n); ! m_ParserLineGroup.SetWindowText(tmpStr); }; } --- 697,701 ---- n++; tmpStr.Format("%d",n); ! m_ParserMsgGroup.SetWindowText(tmpStr); }; } Index: ctagslib.lib =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ctagslib.lib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvspVjmMd and /tmp/cvswO9Yao differ --- ClipParser.cpp DELETED --- --- ClipParser.h DELETED --- |
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv12885 Modified Files: AnyEdit.cpp AnyEdit.dsp AssociationPref.cpp RegProfile.cpp RegProfile.h TemplatePref.cpp Removed Files: PRECOMP.H Log Message: Major cleanup of the AnyEdit registy interface. Rewrite of the CRegProfile class. Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AnyEdit.cpp 21 Nov 2003 13:53:00 -0000 1.32 --- AnyEdit.cpp 22 Nov 2003 16:14:19 -0000 1.33 *************** *** 1039,1043 **** { langstr = SEC_LANG; ! langstr += SEC_SEP; langstr += m_reg.GetProfileString(SEC_LANG,msc.GetStringForInt(i),tempStr,""); langstr = m_reg.GetProfileString(langstr,"Extension",tempStr,""); --- 1039,1043 ---- { langstr = SEC_LANG; ! langstr += REG_SEP; langstr += m_reg.GetProfileString(SEC_LANG,msc.GetStringForInt(i),tempStr,""); langstr = m_reg.GetProfileString(langstr,"Extension",tempStr,""); *************** *** 1109,1113 **** tempstr = m_reg.GetProfileString(langstr,langpos,tempStr,""); ! langstr += SEC_SEP; langstr += tempstr; acmpstr = langstr; --- 1109,1113 ---- tempstr = m_reg.GetProfileString(langstr,langpos,tempStr,""); ! langstr += REG_SEP; langstr += tempstr; acmpstr = langstr; Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** AnyEdit.dsp 21 Nov 2003 13:53:00 -0000 1.24 --- AnyEdit.dsp 22 Nov 2003 16:14:19 -0000 1.25 *************** *** 591,598 **** # Begin Source File - SOURCE=.\Precomp.h - # End Source File - # Begin Source File - SOURCE=.\RegProfile.h # End Source File --- 591,594 ---- Index: AssociationPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AssociationPref.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AssociationPref.cpp 8 May 2003 12:00:56 -0000 1.4 --- AssociationPref.cpp 22 Nov 2003 16:14:19 -0000 1.5 *************** *** 250,254 **** CString regRoot = SEC_ASSOC; m_reg.WriteProfileString(SEC_ASSOC,msc.GetStringForInt(extCnt),ext); ! regRoot+= SEC_SEP; regRoot+= ext; m_reg.WriteProfileString(regRoot,_T("Extension"),ext); --- 250,254 ---- CString regRoot = SEC_ASSOC; m_reg.WriteProfileString(SEC_ASSOC,msc.GetStringForInt(extCnt),ext); ! regRoot+= REG_SEP; regRoot+= ext; m_reg.WriteProfileString(regRoot,_T("Extension"),ext); *************** *** 263,267 **** int extCnt = m_reg.GetProfileInt(SEC_ASSOC,_T("Count"),0); CString regRoot = SEC_ASSOC; ! regRoot+= SEC_SEP; CString curRoot; TCHAR tempStr[1024]; --- 263,267 ---- int extCnt = m_reg.GetProfileInt(SEC_ASSOC,_T("Count"),0); CString regRoot = SEC_ASSOC; ! regRoot+= REG_SEP; CString curRoot; TCHAR tempStr[1024]; Index: RegProfile.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/RegProfile.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RegProfile.cpp 8 May 2003 12:00:56 -0000 1.3 --- RegProfile.cpp 22 Nov 2003 16:14:19 -0000 1.4 *************** *** 4,11 **** #include "stdafx.h" - #include "AnyEdit.h" #include "RegProfile.h" - #include "Precomp.h" - #include "Misc.h" #ifdef _DEBUG #undef THIS_FILE --- 4,8 ---- *************** *** 18,267 **** ////////////////////////////////////////////////////////////////////// ! CRegProfile::CRegProfile() ! { ! } ! CRegProfile::~CRegProfile() { } ! void CRegProfile::SaveProfile( HWND hWnd ) const ! { ! } ! ! void CRegProfile::LoadProfile( HWND hWnd ) { ! ! CMisc msc; ! TCHAR filName[_MAX_PATH]; ! GetModuleFileName(NULL,filName, _MAX_PATH); ! CString tempAppPath = msc.GetParentFolderForFile(filName); ! theApp.SetAppPath(tempAppPath); ! } ! //misc ! HKEY GetAppRegistryKey( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName ) { - ASSERT( pszRegistryKey != NULL ); - ASSERT( pszProfileName != NULL ); - - HKEY hAppKey = NULL; HKEY hSoftKey = NULL; HKEY hCompanyKey = NULL; ! if ( RegOpenKeyEx( HKEY_CURRENT_USER, _T( "Software" ), 0, KEY_WRITE|KEY_READ, ! &hSoftKey ) == ERROR_SUCCESS ) { DWORD dw; ! if ( RegCreateKeyEx( hSoftKey, pszRegistryKey, 0, REG_NONE, ! REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, ! &hCompanyKey, &dw ) == ERROR_SUCCESS ) { ! RegCreateKeyEx( hCompanyKey, pszProfileName, 0, REG_NONE, ! REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, ! &hAppKey, &dw ); } } ! if ( hSoftKey != NULL ) ! RegCloseKey( hSoftKey ); ! if ( hCompanyKey != NULL ) ! RegCloseKey( hCompanyKey ); return hAppKey; } ! // returns key for: ! // HKEY_CURRENT_USER\"Software"\RegistryKey\AppName\pszSection ! // creating it if it doesn't exist. ! // responsibility of the caller to call RegCloseKey() on the returned HKEY ! HKEY GetSectionKey( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection ) { ASSERT( pszSection != NULL ); HKEY hSectionKey = NULL; - HKEY hAppKey = GetAppRegistryKey( pszRegistryKey, pszProfileName ); - if ( hAppKey == NULL ) - return NULL; DWORD dw; ! RegCreateKeyEx( hAppKey, pszSection, 0, REG_NONE, ! REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, ! &hSectionKey, &dw ); ! RegCloseKey( hAppKey ); return hSectionKey; } ! UINT RegGetProfileInt( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , int nDefault ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry ! != NULL ); ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! { ! return nDefault; ! } ! else { ! DWORD dwValue; ! DWORD dwType; ! DWORD dwCount = sizeof( DWORD ); ! LONG lResult = RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry ! , NULL, &dwType, ! ( LPBYTE )&dwValue, &dwCount ); ! RegCloseKey( hSecKey ); ! if ( lResult == ERROR_SUCCESS ) { ASSERT( dwType == REG_DWORD ); ASSERT( dwCount == sizeof( dwValue ) ); ! return ( UINT )dwValue; } } return nDefault; } ! // buffer pointed to by pszText must be 1024 bytes long. ! LPCTSTR RegGetProfileString( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , LPTSTR pszValue, LPCTSTR pszDefault ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry ! != NULL ); ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return pszDefault; ! DWORD dwType, dwCount; ! LONG lResult = RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry ! , NULL, &dwType, ! NULL, &dwCount ); ! if ( lResult == ERROR_SUCCESS ) ! { ! ASSERT( dwType == REG_SZ ); ! LPTSTR pszOut = new TCHAR[ dwCount + 1 ]; ! lResult = RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry ! , NULL, &dwType, ! ( LPBYTE )pszOut, &dwCount ); ! _tcsncpy( pszValue, pszOut, min( 1024, dwCount ) ); ! pszValue[ min( 1024, dwCount ) ] = _T( '\0' ); ! delete pszOut; ! } ! RegCloseKey( hSecKey ); ! if ( lResult == ERROR_SUCCESS ) ! { ! ASSERT( dwType == REG_SZ ); ! return pszValue; } return pszDefault; } ! BOOL RegGetProfileBinary( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , BYTE** ppData, UINT* pBytes ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry ! != NULL ); ASSERT( ppData != NULL ); ASSERT( pBytes != NULL ); *ppData = NULL; *pBytes = 0; ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return FALSE; ! DWORD dwType, dwCount; ! LONG lResult = RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry ! , NULL, &dwType, ! NULL, &dwCount ); ! *pBytes = dwCount; ! if ( lResult == ERROR_SUCCESS ) ! { ! ASSERT( dwType == REG_BINARY ); ! *ppData = new BYTE[*pBytes]; ! lResult = RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry ! , NULL, &dwType, ! *ppData, &dwCount ); ! } ! RegCloseKey( hSecKey ); ! if ( lResult == ERROR_SUCCESS ) ! { ! ASSERT( dwType == REG_BINARY ); ! return TRUE; ! } ! else ! { ! delete [] *ppData; ! *ppData = NULL; ! } ! return FALSE; } ! BOOL RegWriteProfileInt( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , int nValue ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry ! != NULL ); ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return FALSE; ! LONG lResult = RegSetValueEx( hSecKey, pszEntry ! , NULL, REG_DWORD, ! ( LPBYTE )&nValue, sizeof( nValue ) ); ! RegCloseKey( hSecKey ); ! return lResult == ERROR_SUCCESS; } ! BOOL RegWriteProfileString( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , LPCTSTR pszValue ) { ASSERT( pszSection != NULL ); ! LONG lResult; ! if ( pszEntry ! == NULL ) //delete whole section ! { ! HKEY hAppKey = GetAppRegistryKey( pszRegistryKey, pszProfileName ); ! if ( hAppKey == NULL ) ! return FALSE; ! lResult = RegDeleteKey( hAppKey, pszSection ); ! RegCloseKey( hAppKey ); ! } ! else if ( pszValue == NULL ) ! { ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return FALSE; ! // necessary to cast away const below ! lResult = RegDeleteValue( hSecKey, ( LPTSTR )pszEntry ! ); RegCloseKey( hSecKey ); } ! else ! { ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return FALSE; ! lResult = RegSetValueEx( hSecKey, pszEntry ! , NULL, REG_SZ, ! ( LPBYTE )pszValue, ( lstrlen( pszValue )+1 )*sizeof( TCHAR ) ); RegCloseKey( hSecKey ); } ! return lResult == ERROR_SUCCESS; } ! BOOL RegWriteProfileBinary( LPCTSTR pszRegistryKey, LPCTSTR pszProfileName, LPCTSTR pszSection, LPCTSTR pszEntry ! , LPBYTE pData, UINT nBytes ) { ! ASSERT( pszSection != NULL ); ! LONG lResult; ! HKEY hSecKey = GetSectionKey( pszRegistryKey, pszProfileName, pszSection ); ! if ( hSecKey == NULL ) ! return FALSE; ! lResult = RegSetValueEx( hSecKey, pszEntry ! , NULL, REG_BINARY, ! pData, nBytes ); ! RegCloseKey( hSecKey ); ! return lResult == ERROR_SUCCESS; } --- 15,348 ---- ////////////////////////////////////////////////////////////////////// ! // In the constructer we open the Application registry key. We always ! // need this when we want to work with the registry. So we keep it open ! // the entire lifetime of the object. ! CRegProfile::CRegProfile() { + hAppKey = NULL; + // Open the the AnyEdit application key (HKEY_CURRENT_USER\Software\<COMPANY>\<APPNAME>) + hAppKey = GetAppRegistryKey(); } + // In the destructor we close the Application registry key. ! CRegProfile::~CRegProfile() { ! // If the hAppKey is opened, close it. ! if( NULL != hAppKey ) RegCloseKey( hAppKey ); } + // GetAppRegistryKey opens the main application registry key (HKEY_CURRENT_USER\Software\<COMPANY>\<APPNAME>) + // If the key is not available it will be created. ! HKEY CRegProfile::GetAppRegistryKey() { HKEY hSoftKey = NULL; HKEY hCompanyKey = NULL; ! if( RegOpenKeyEx( HKEY_CURRENT_USER, _T( "Software" ), 0, KEY_WRITE|KEY_READ, &hSoftKey ) == ERROR_SUCCESS ) { DWORD dw; ! if( RegCreateKeyEx( hSoftKey, COMPANY, 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, &hCompanyKey, &dw ) == ERROR_SUCCESS ) { ! if( RegCreateKeyEx( hCompanyKey, APPNAME, 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, &hAppKey, &dw ) != ERROR_SUCCESS ) ! { ! // Just to be sure the hAppKey is NULL when we can not create the key. ! hAppKey = NULL; ! } } } ! if ( hSoftKey != NULL ) RegCloseKey( hSoftKey ); ! if ( hCompanyKey != NULL ) RegCloseKey( hCompanyKey ); return hAppKey; } ! // GetSectionKey opens or creates the Section key under the application key ! // It returns the key for HKEY_CURRENT_USER\Software\<COMPANY>\<APPNAME>\<pszSection> ! // The caller is responsible for closing the returned HKEY. ! ! HKEY CRegProfile::GetSectionKey( LPCTSTR pszSection ) { ASSERT( pszSection != NULL ); HKEY hSectionKey = NULL; + // Check if we have the Application Registry key. + if( hAppKey == NULL ) GetAppRegistryKey(); + if( hAppKey == NULL ) return NULL; + + // Get or if non existent create the Section key. DWORD dw; ! if( ERROR_SUCCESS != RegCreateKeyEx( hAppKey, pszSection, 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, &hSectionKey, &dw ) ) ! { ! hSectionKey = NULL; ! } ! return hSectionKey; } ! // GetProfileInt gets the integer value pointed to by Entry under Section. If the ! // key isn't found it returns the default value. ! ! const UINT CRegProfile::GetProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry, int nDefault ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ! ! // First get the Section key. ! HKEY hSecKey = GetSectionKey( pszSection ); ! if( hSecKey != NULL ) { ! DWORD dwValue; ! DWORD dwType; ! DWORD dwCount = sizeof( DWORD ); ! ! // Let's get the value. ! if( ERROR_SUCCESS == RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry, NULL, &dwType, ( LPBYTE )&dwValue, &dwCount ) ) { ASSERT( dwType == REG_DWORD ); ASSERT( dwCount == sizeof( dwValue ) ); ! nDefault = (int)dwValue; } + + // Close the Section key we opened. + RegCloseKey( hSecKey ); } + return nDefault; } ! // GetProfileString copies the Entry under Section into Value. If the key doesn't ! // exist it returns the pointer to the default value. The Value buffer must be ! // at least 1024 bytes, can be longer, but the max number of characters returned ! // is 1024 including the terminating NULL character. ! ! LPCTSTR CRegProfile::GetProfileString( LPCTSTR pszSection, LPCTSTR pszEntry, LPTSTR pszValue, LPCTSTR pszDefault ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ! ASSERT( pszValue != NULL ); ! ! // First get the Section key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if ( hSecKey != NULL ) ! { ! DWORD dwType; ! DWORD dwCount; ! ! // Ley's get the size of the string to be able to allocate exactly enough memory ! if( ERROR_SUCCESS == RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry, NULL, &dwType, NULL, &dwCount ) ) ! { ! ASSERT( dwType == REG_SZ ); ! ! // Allocate a buffer from the returned size + 1 ! LPTSTR pszOut = new TCHAR[ dwCount + 1 ]; ! ! // Read the string from the Registry ! if( ERROR_SUCCESS == RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry, NULL, &dwType, ( LPBYTE )pszOut, &dwCount ) ) ! { ! ASSERT( dwType == REG_SZ ); ! ! // Copy the string to the callers buffer ! _tcsncpy( pszValue, pszOut, min( 1023, dwCount ) ); ! pszValue[ min( 1023, dwCount ) ] = _T( '\0' ); ! pszDefault = pszValue; ! } ! ! // Delete the temporarily allocated memory ! delete pszOut; ! } ! ! // Close the Section key we opened. ! RegCloseKey( hSecKey ); } + return pszDefault; } ! // GetProfileBinary returns a pointer to an array of bytes from Entry under Section. ! // It's the responsibility of the caller to delete the allocated byte array! ! ! const BOOL CRegProfile::GetProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry, BYTE** ppData, UINT* pBytes ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ASSERT( ppData != NULL ); ASSERT( pBytes != NULL ); + *ppData = NULL; *pBytes = 0; ! ! BOOL bRetVal = FALSE; ! // First get the Section key. ! HKEY hSecKey = GetSectionKey( pszSection ); ! if ( hSecKey != NULL ) ! { ! DWORD dwType; ! DWORD dwCount; ! ! // Let's get the number of binary values to be able to allocate exactly enough memory ! if( ERROR_SUCCESS == RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry, NULL, &dwType, NULL, &dwCount ) ) ! { ! ASSERT( dwType == REG_BINARY ); ! ! // Allocate the needed memory ! *pBytes = dwCount; ! *ppData = new BYTE[*pBytes]; ! ! // Read the binary values from the registry ! if( ERROR_SUCCESS == RegQueryValueEx( hSecKey, ( LPTSTR )pszEntry, NULL, &dwType, *ppData, &dwCount ) ) ! { ! ASSERT( dwType == REG_BINARY ); ! bRetVal = TRUE; ! } ! else ! { ! // Delete the allocated memory if the reading failed. ! delete [] *ppData; ! *ppData = NULL; ! } ! } ! ! // Close the Section key we opened. ! RegCloseKey( hSecKey ); ! } ! ! return bRetVal; } ! // WriteProfileInt sets to Entry under Section to Value in the registry. ! ! BOOL CRegProfile::WriteProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry, int nValue ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ! ! BOOL bRetVal = FALSE; ! ! // First get the Section Key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if( hSecKey != NULL ) ! { ! // Write the value in the registry ! if( ERROR_SUCCESS == RegSetValueEx( hSecKey, pszEntry, NULL, REG_DWORD, ( LPBYTE )&nValue, sizeof( nValue ) ) ) ! { ! bRetVal = TRUE; ! } ! ! // Close the Section key we opened. ! RegCloseKey( hSecKey ); ! } ! ! return bRetVal; } ! ! // WriteProfileString writes the string Value to Entry under Section in the registry. ! ! BOOL CRegProfile::WriteProfileString( LPCTSTR pszSection, LPCTSTR pszEntry, LPCTSTR pszValue ) { ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ! ASSERT( pszValue != NULL ); ! ! BOOL bRetVal = FALSE; ! ! // First get the Section Key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if( hSecKey != NULL ) ! { ! // Writing the string to the registry. ! if( ERROR_SUCCESS == RegSetValueEx( hSecKey, pszEntry, NULL, REG_SZ, ( LPBYTE )pszValue, ( lstrlen( pszValue )+1 )*sizeof( TCHAR ) ) ) ! { ! bRetVal = TRUE; ! } ! ! // Close the Section key we opened. RegCloseKey( hSecKey ); } ! ! return bRetVal; ! } ! ! // WriteProfileBinary writes an array of binary values to Entry under Section in the registry. ! BOOL CRegProfile::WriteProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry, LPBYTE pData, UINT nBytes ) ! { ! ASSERT( pszSection != NULL ); ! ASSERT( pszEntry != NULL ); ! ASSERT( pData != NULL ); ! ! BOOL bRetVal = FALSE; ! ! // First get the Section Key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if( hSecKey != NULL ) ! { ! // Write the byte data to the registry ! if( ERROR_SUCCESS != RegSetValueEx( hSecKey, pszEntry, NULL, REG_BINARY, pData, nBytes ) ) ! { ! bRetVal = TRUE; ! } ! ! // Close the Section key we openend. ! RegCloseKey( hSecKey ); ! } ! ! return bRetVal; ! } ! ! // DeleteProfileKey deletes key Entry under section in the registry. This function ! // fails if there are subkeys, so the key can only contain values. ! ! BOOL CRegProfile::DeleteProfileKey( LPCTSTR pszSection, LPCTSTR pszEntry ) ! { ! ASSERT( pszSection ); ! ASSERT( pszEntry ); ! ! BOOL bRetVal = FALSE; ! ! // First get the Section key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if ( hSecKey != NULL ) ! { ! // Delete the desired Entry. ! if( ERROR_SUCCESS == RegDeleteKey( hSecKey, ( LPTSTR )pszEntry ) ) ! { ! bRetVal = TRUE; ! } ! ! // Close the Section key we opened. RegCloseKey( hSecKey ); } ! ! return bRetVal; } ! // DeleteProfileValue deletes value Entry under Section in the registry. ! ! BOOL CRegProfile::DeleteProfileValue( LPCTSTR pszSection, LPCTSTR pszEntry ) { ! ASSERT( pszSection ); ! ASSERT( pszEntry ); ! ! BOOL bRetVal = FALSE; ! ! // First get the Section key ! HKEY hSecKey = GetSectionKey( pszSection ); ! if ( hSecKey != NULL ) ! { ! ! // Delete the desired Entry. ! if( ERROR_SUCCESS == RegDeleteValue( hSecKey, ( LPTSTR )pszEntry ) ) ! { ! bRetVal = TRUE; ! } ! ! // Close the Section key we opened. ! RegCloseKey( hSecKey ); ! } ! ! return bRetVal; } Index: RegProfile.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/RegProfile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RegProfile.h 8 May 2003 12:00:56 -0000 1.3 --- RegProfile.h 22 Nov 2003 16:14:19 -0000 1.4 *************** *** 3,11 **** ////////////////////////////////////////////////////////////////////// #if !defined(AFX_REGPROFILE_H__E90D4741_F35C_11D5_B413_8F804A43732E__INCLUDED_) #define AFX_REGPROFILE_H__E90D4741_F35C_11D5_B413_8F804A43732E__INCLUDED_ ! #define APPNAME _T("AnyEdit Editor") #define COMPANY _T("DeepSoft") #define CODE_SECTION _T("AECodeSection") #define SEC_ASSOC _T("Preferences\\Associations") --- 3,32 ---- ////////////////////////////////////////////////////////////////////// + /*-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + CRegProfile + + This class handles all access to the windows Registry. It provides eight + functions, three for reading from the Registry, three for writing to the + Registry and two functions for deleting keys and values. When keys don't + exist in the Registry when reading a value the key is created and set to + the default value, that is passed to the read function. It that case the + read function returnes the default value. + -=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + #if !defined(AFX_REGPROFILE_H__E90D4741_F35C_11D5_B413_8F804A43732E__INCLUDED_) #define AFX_REGPROFILE_H__E90D4741_F35C_11D5_B413_8F804A43732E__INCLUDED_ ! #if _MSC_VER > 1000 ! #pragma once ! #endif // _MSC_VER > 1000 ! ! // These two values define the starting point for all AnyEdit's Registry ! // settings (HKEY_CURRENT_USER\Software\<COMPANY>\<APPNAME>) #define COMPANY _T("DeepSoft") + #define APPNAME _T("AnyEdit Editor") + + // The seperator used in registry keys + #define REG_SEP _T("\\"); + #define CODE_SECTION _T("AECodeSection") #define SEC_ASSOC _T("Preferences\\Associations") *************** *** 16,25 **** #define SEC_GREP _T("Preferences\\Grep") #define SEC_PREF _T("Preferences") - #define SEC_SEP _T("\\"); #define SEC_DEF _T("Preferences\\Defaults") ! //Registry keys ! ! //default editor prefs #define DEF_SYNTAXHIGHLIGHT _T("Syntax") #define DEF_VIEW_LINENO _T("LineNo") --- 37,43 ---- #define SEC_GREP _T("Preferences\\Grep") #define SEC_PREF _T("Preferences") #define SEC_DEF _T("Preferences\\Defaults") ! // Registry keys for default editor prefs #define DEF_SYNTAXHIGHLIGHT _T("Syntax") #define DEF_VIEW_LINENO _T("LineNo") *************** *** 60,116 **** #define KEY_NORMALIZECASE _T("NORMALIZECASE") #define KEY_SELBOUNDS _T("SELBOUNDS") - #define SEP _T("\\"); - - #if _MSC_VER > 1000 - #pragma once - #endif // _MSC_VER > 1000 - #include "Precomp.h" class CRegProfile { public: CRegProfile(); virtual ~CRegProfile(); - UINT CRegProfile::GetProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry - , int nDefault ) const - { - return RegGetProfileInt( COMPANY, APPNAME, pszSection, pszEntry - , nDefault ); - } - LPCTSTR CRegProfile::GetProfileString( LPCTSTR pszSection, LPCTSTR pszEntry - , LPTSTR pszValue, LPCTSTR pszDefault ) const - { - return RegGetProfileString( COMPANY, APPNAME, pszSection, pszEntry - , pszValue, pszDefault ); - } - BOOL CRegProfile::GetProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry - , BYTE** ppData, UINT* pBytes ) const - { - return RegGetProfileBinary( COMPANY, APPNAME, pszSection, pszEntry - , ppData, pBytes ); - } - BOOL CRegProfile::WriteProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry - , int nValue ) const - { - return RegWriteProfileInt( COMPANY, APPNAME, pszSection, pszEntry - , nValue ); - } - BOOL CRegProfile::WriteProfileString( LPCTSTR pszSection, LPCTSTR pszEntry - , LPCTSTR pszValue ) const - { - return RegWriteProfileString( COMPANY, APPNAME, pszSection, pszEntry - , pszValue ); - } - BOOL CRegProfile::WriteProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry - , LPBYTE pData, UINT nBytes ) const - { - return RegWriteProfileBinary( COMPANY, APPNAME, pszSection, pszEntry - , pData, nBytes ); - } - HFONT m_hFont; - public: - void SaveProfile( HWND hWnd ) const; - void LoadProfile( HWND hWnd ); }; --- 78,126 ---- #define KEY_NORMALIZECASE _T("NORMALIZECASE") #define KEY_SELBOUNDS _T("SELBOUNDS") class CRegProfile { + private: + // Variable to safe a reference to the AnyEdit Application key. + HKEY hAppKey; + + // GetAppRegistryKey opens the main AnyEdit Registry key + HKEY GetAppRegistryKey( /*LPCTSTR pszRegistryKey, LPCTSTR pszProfileName */ ); + + // GetSectionKey opens a Section key under the main AppKey + HKEY GetSectionKey( /*LPCTSTR pszRegistryKey, LPCTSTR pszProfileName,*/ LPCTSTR pszSection ); + public: + // The constructor, it opens the main AppKey. CRegProfile(); + + // The destructor, it closes the main AppKey. virtual ~CRegProfile(); + // GetProfileInt reads an unsigned integer value from an Entry under Section. If the + // key doesn't exist it creates it and returns the given default value. + const UINT GetProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry, int nDefault ); + + // GetProfileString reads an LPCTSTR value from an Entry under Section. If + // the key doesn't exist it creates it and then returns the given default value. + LPCTSTR GetProfileString( LPCTSTR pszSection, LPCTSTR pszEntry, LPTSTR pszValue, LPCTSTR pszDefault ); + + // GetProfileBinary reads the number of Bytes in a byte Data Array from Entry under Section. + const BOOL GetProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry, BYTE** ppData, UINT* pBytes ); + + // WriteProfileInt writes the int Value into Entry under Section. + BOOL WriteProfileInt( LPCTSTR pszSection, LPCTSTR pszEntry, int nValue ); + + // WriteProfileString writes a LPCTSTR Value into Entry under Section. + BOOL WriteProfileString( LPCTSTR pszSection, LPCTSTR pszEntry, LPCTSTR pszValue ); + + // WriteProfileBinary writes a number of Bytes in an Entry under Section. + BOOL WriteProfileBinary( LPCTSTR pszSection, LPCTSTR pszEntry, LPBYTE pData, UINT nBytes ); + + // DeleteProfileKey delete a key Entry under Section and all it's values. + BOOL DeleteProfileKey( LPCTSTR pszSection, LPCTSTR pszEntry ); + + // DeleteProfileValue deletes the value Entry under Section and all it's values. + BOOL DeleteProfileValue( LPCTSTR pszSection, LPCTSTR pszEntry ); }; Index: TemplatePref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TemplatePref.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TemplatePref.cpp 8 May 2003 12:00:56 -0000 1.3 --- TemplatePref.cpp 22 Nov 2003 16:14:19 -0000 1.4 *************** *** 175,179 **** if(arr.GetSize()==0) { ! m_reg.WriteProfileString(regRoot,_T("Tools"),_T("")); return; } --- 175,179 ---- if(arr.GetSize()==0) { ! m_reg.DeleteProfileKey(regRoot,_T("Tools")); return; } --- PRECOMP.H DELETED --- |
From: <td...@us...> - 2003-11-21 13:53:03
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv28167 Modified Files: AnyEdit.cpp AnyEdit.dsp AnyEditDoc.cpp AnyEditView.cpp BugReport.cpp ChangeLog.txt FindReplace.cpp ProjectTree.cpp SciLexer.h Scintilla.h WorkspaceBar.cpp scintillaif.cpp Log Message: FindReplace positions cursor after replaced text [#817192] Diff plugin interface bug fixed [#817195] Crash on lines > 2510 chars fixed [#799649] Updated to scintilla 1.56 File copies in temp folder are now deleted [#798515] Proper save of find and replace history done [#798521] Standalone file leaves garbage in class view - Fixed [#730650] Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** AnyEdit.cpp 20 Nov 2003 15:47:49 -0000 1.31 --- AnyEdit.cpp 21 Nov 2003 13:53:00 -0000 1.32 *************** *** 431,437 **** --- 431,452 ---- (DWORD)dwHelpCookie) ; // Pass in cookie + if (m_ClassViewParserThread) delete m_ClassViewParserThread; m_ClassViewParserThread=NULL; + + //Delete all the files in the temp folder + CString pat = GetAppPath()+"temp\\"; + CStringArray farr; + msc.GetFilesInFolder(pat,"*.*",farr); + + for(int i=0;i<farr.GetSize();i++) + { + TRY{ + CString res = pat + farr[i]; + CFile::Remove(res); + }CATCH(CFileException, e){} + END_CATCH + } return CWinApp::ExitInstance(); Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AnyEdit.dsp 18 Nov 2003 11:27:21 -0000 1.23 --- AnyEdit.dsp 21 Nov 2003 13:53:00 -0000 1.24 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Ox /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W4 /GX /Ox /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 72,76 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 72,76 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "C:\Program Files\HTML Help Workshop\INCLUDE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 Index: AnyEditDoc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AnyEditDoc.cpp 20 Nov 2003 15:47:49 -0000 1.11 --- AnyEditDoc.cpp 21 Nov 2003 13:53:00 -0000 1.12 *************** *** 105,109 **** HasBeenModified(FALSE); POSITION pos = GetFirstViewPosition(); ! CAnyEditView* pView; if(pos != NULL) { --- 105,109 ---- HasBeenModified(FALSE); POSITION pos = GetFirstViewPosition(); ! CAnyEditView* pView=NULL; if(pos != NULL) { Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AnyEditView.cpp 20 Nov 2003 15:47:49 -0000 1.34 --- AnyEditView.cpp 21 Nov 2003 13:53:00 -0000 1.35 *************** *** 873,880 **** * Automatic commenting below */ ! char prevline[2500]; ! int dist = m_Scintilla.GetLine(m_Scintilla.GetCurLineNumber()-1,prevline); ! prevline[dist] = '\0'; ! CString str = prevline; str.TrimLeft(); str.TrimLeft('\t'); --- 873,886 ---- * Automatic commenting below */ ! CString str; ! char * prevline = (char *)malloc(m_Scintilla.LineLength(m_Scintilla.GetCurLineNumber()-1)); ! if(prevline!=NULL) ! { ! int dist = m_Scintilla.GetLine(m_Scintilla.GetCurLineNumber()-1,prevline); ! if(dist==0) dist++; ! prevline[dist-1] = '\0'; ! str = prevline; ! free(prevline); ! } str.TrimLeft(); str.TrimLeft('\t'); Index: BugReport.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/BugReport.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BugReport.cpp 27 Aug 2003 06:32:42 -0000 1.4 --- BugReport.cpp 21 Nov 2003 13:53:00 -0000 1.5 *************** *** 111,116 **** ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); ! ! if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ) { // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. --- 111,116 ---- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); ! bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi); ! if( !(bOsVersionInfoEx) ) { // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ChangeLog.txt 18 Nov 2003 11:27:22 -0000 1.30 --- ChangeLog.txt 21 Nov 2003 13:53:00 -0000 1.31 *************** *** 36,39 **** --- 36,49 ---- 29) Added option in replace to remove transform backslash expressions. 30) Class view display now shows more information [enums, macros, fields] etc., + 31) FindReplace positions cursor after replaced text [#817192] + 32) Diff plugin interface bug fixed [#817195] + 33) crash on lines > 2510 chars fixed [#799649] + 34) Updated to scintilla 1.56 + 35) File copies in temp folder are now deleted [#798515] + 36) Proper save of find and replace history done [#798521] + 37) Standalone file leaves garbage in class view - Fixed [#730650] + + + Thanks poto for your bug reports Beta 1.0 Index: FindReplace.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindReplace.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FindReplace.cpp 18 Nov 2003 04:09:50 -0000 1.7 --- FindReplace.cpp 21 Nov 2003 13:53:00 -0000 1.8 *************** *** 93,97 **** long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! } } --- 93,97 ---- long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! }else m_scintilla->SetSel(m_scintilla->GetTargetEnd(),m_scintilla->GetTargetEnd()); } *************** *** 126,130 **** comboStr = m_reg.GetProfileString(SEC_GREP,_T("LastFind"),tempStr,""); m_findcombo.SetWindowText(comboStr); ! m_check1.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck1"),0 )); m_check2.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck2"),0 )); --- 126,132 ---- comboStr = m_reg.GetProfileString(SEC_GREP,_T("LastFind"),tempStr,""); m_findcombo.SetWindowText(comboStr); ! comboStr = m_reg.GetProfileString(SEC_GREP,_T("LastReplace"),tempStr,""); ! m_replacecombo.SetWindowText(comboStr); ! m_check1.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck1"),0 )); m_check2.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck2"),0 )); *************** *** 223,226 **** --- 225,230 ---- m_replacecombo.AddString(str); + m_scintilla->SetCurrentPos(m_scintilla->GetCurrentPos()+str.GetLength()); + OnFindnext(); } *************** *** 315,318 **** --- 319,324 ---- m_findcombo.GetWindowText(tempStr); m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); + m_replacecombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastReplace"),tempStr); tempStr.Empty(); *************** *** 336,340 **** for(int ii=0;ii<y;ii++) { ! m_findcombo.GetLBText(ii,lbStr); tempStr+= lbStr+_T("|"); } --- 342,346 ---- for(int ii=0;ii<y;ii++) { ! m_replacecombo.GetLBText(ii,lbStr); tempStr+= lbStr+_T("|"); } *************** *** 349,351 **** --- 355,359 ---- m_findcombo.GetWindowText(tempStr); m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); + m_replacecombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastReplace"),tempStr); } Index: ProjectTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ProjectTree.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ProjectTree.cpp 8 May 2003 12:00:56 -0000 1.7 --- ProjectTree.cpp 21 Nov 2003 13:53:00 -0000 1.8 *************** *** 727,731 **** CString folName=strArr.GetAt(1); CString folPar = strArr.GetAt(2); ! HTREEITEM folItem; if(folPar==_T("ROOT")) --- 727,731 ---- CString folName=strArr.GetAt(1); CString folPar = strArr.GetAt(2); ! HTREEITEM folItem=NULL; if(folPar==_T("ROOT")) Index: SciLexer.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/SciLexer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SciLexer.h 17 Jul 2003 11:32:15 -0000 1.3 --- SciLexer.h 21 Nov 2003 13:53:00 -0000 1.4 *************** *** 57,60 **** --- 57,71 ---- #define SCLEX_LOUT 40 #define SCLEX_ESCRIPT 41 + #define SCLEX_PS 42 + #define SCLEX_NSIS 43 + #define SCLEX_MMIXAL 44 + #define SCLEX_CLW 45 + #define SCLEX_CLWNOCASE 46 + #define SCLEX_LOT 47 + #define SCLEX_YAML 48 + #define SCLEX_TEX 49 + #define SCLEX_METAPOST 50 + #define SCLEX_POWERBASIC 51 + #define SCLEX_FORTH 52 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 *************** *** 269,272 **** --- 280,285 ---- #define SCE_LUA_WORD5 16 #define SCE_LUA_WORD6 17 + #define SCE_LUA_WORD7 18 + #define SCE_LUA_WORD8 19 #define SCE_ERR_DEFAULT 0 #define SCE_ERR_PYTHON 1 *************** *** 384,387 **** --- 397,412 ---- #define SCE_NNCRONTAB_ENVIRONMENT 9 #define SCE_NNCRONTAB_IDENTIFIER 10 + #define SCE_FORTH_DEFAULT 0 + #define SCE_FORTH_COMMENT 1 + #define SCE_FORTH_COMMENT_ML 2 + #define SCE_FORTH_IDENTIFIER 3 + #define SCE_FORTH_CONTROL 4 + #define SCE_FORTH_KEYWORD 5 + #define SCE_FORTH_DEFWORD 6 + #define SCE_FORTH_PREWORD1 7 + #define SCE_FORTH_PREWORD2 8 + #define SCE_FORTH_NUMBER 9 + #define SCE_FORTH_STRING 10 + #define SCE_FORTH_LOCALE 11 #define SCE_MATLAB_DEFAULT 0 #define SCE_MATLAB_COMMENT 1 *************** *** 393,415 **** #define SCE_MATLAB_IDENTIFIER 7 #define SCE_SCRIPTOL_DEFAULT 0 ! #define SCE_SCRIPTOL_COMMENT 1 #define SCE_SCRIPTOL_COMMENTLINE 2 ! #define SCE_SCRIPTOL_COMMENTDOC 3 ! #define SCE_SCRIPTOL_NUMBER 4 ! #define SCE_SCRIPTOL_WORD 5 ! #define SCE_SCRIPTOL_STRING 6 ! #define SCE_SCRIPTOL_CHARACTER 7 ! #define SCE_SCRIPTOL_UUID 8 ! #define SCE_SCRIPTOL_PREPROCESSOR 9 ! #define SCE_SCRIPTOL_OPERATOR 10 ! #define SCE_SCRIPTOL_IDENTIFIER 11 ! #define SCE_SCRIPTOL_STRINGEOL 12 ! #define SCE_SCRIPTOL_VERBATIM 13 ! #define SCE_SCRIPTOL_REGEX 14 ! #define SCE_SCRIPTOL_COMMENTLINEDOC 15 ! #define SCE_SCRIPTOL_WORD2 16 ! #define SCE_SCRIPTOL_COMMENTDOCKEYWORD 17 ! #define SCE_SCRIPTOL_COMMENTDOCKEYWORDERROR 18 ! #define SCE_SCRIPTOL_COMMENTBASIC 19 #define SCE_ASM_DEFAULT 0 #define SCE_ASM_COMMENT 1 --- 418,436 ---- #define SCE_MATLAB_IDENTIFIER 7 #define SCE_SCRIPTOL_DEFAULT 0 ! #define SCE_SCRIPTOL_WHITE 1 #define SCE_SCRIPTOL_COMMENTLINE 2 ! #define SCE_SCRIPTOL_PERSISTENT 3 ! #define SCE_SCRIPTOL_CSTYLE 4 ! #define SCE_SCRIPTOL_COMMENTBLOCK 5 ! #define SCE_SCRIPTOL_NUMBER 6 ! #define SCE_SCRIPTOL_STRING 7 ! #define SCE_SCRIPTOL_CHARACTER 8 ! #define SCE_SCRIPTOL_STRINGEOL 9 ! #define SCE_SCRIPTOL_KEYWORD 10 ! #define SCE_SCRIPTOL_OPERATOR 11 ! #define SCE_SCRIPTOL_IDENTIFIER 12 ! #define SCE_SCRIPTOL_TRIPLE 13 ! #define SCE_SCRIPTOL_CLASSNAME 14 ! #define SCE_SCRIPTOL_PREPROCESSOR 15 #define SCE_ASM_DEFAULT 0 #define SCE_ASM_COMMENT 1 *************** *** 423,426 **** --- 444,451 ---- #define SCE_ASM_DIRECTIVE 9 #define SCE_ASM_DIRECTIVEOPERAND 10 + #define SCE_ASM_COMMENTBLOCK 11 + #define SCE_ASM_CHARACTER 12 + #define SCE_ASM_STRINGEOL 13 + #define SCE_ASM_EXTINSTRUCTION 14 #define SCE_F_DEFAULT 0 #define SCE_F_COMMENT 1 *************** *** 456,467 **** #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 ! #define SCE_POV_COMMENTDOC 3 ! #define SCE_POV_NUMBER 4 ! #define SCE_POV_WORD 5 #define SCE_POV_STRING 6 ! #define SCE_POV_OPERATOR 7 ! #define SCE_POV_IDENTIFIER 8 ! #define SCE_POV_BRACE 9 #define SCE_POV_WORD2 10 #define SCE_LOUT_DEFAULT 0 #define SCE_LOUT_COMMENT 1 --- 481,498 ---- #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 ! #define SCE_POV_NUMBER 3 ! #define SCE_POV_OPERATOR 4 ! #define SCE_POV_IDENTIFIER 5 #define SCE_POV_STRING 6 ! #define SCE_POV_STRINGEOL 7 ! #define SCE_POV_DIRECTIVE 8 ! #define SCE_POV_BADDIRECTIVE 9 #define SCE_POV_WORD2 10 + #define SCE_POV_WORD3 11 + #define SCE_POV_WORD4 12 + #define SCE_POV_WORD5 13 + #define SCE_POV_WORD6 14 + #define SCE_POV_WORD7 15 + #define SCE_POV_WORD8 16 #define SCE_LOUT_DEFAULT 0 #define SCE_LOUT_COMMENT 1 *************** *** 487,490 **** --- 518,613 ---- #define SCE_ESCRIPT_WORD2 10 #define SCE_ESCRIPT_WORD3 11 + #define SCE_PS_DEFAULT 0 + #define SCE_PS_COMMENT 1 + #define SCE_PS_DSC_COMMENT 2 + #define SCE_PS_DSC_VALUE 3 + #define SCE_PS_NUMBER 4 + #define SCE_PS_NAME 5 + #define SCE_PS_KEYWORD 6 + #define SCE_PS_LITERAL 7 + #define SCE_PS_IMMEVAL 8 + #define SCE_PS_PAREN_ARRAY 9 + #define SCE_PS_PAREN_DICT 10 + #define SCE_PS_PAREN_PROC 11 + #define SCE_PS_TEXT 12 + #define SCE_PS_HEXSTRING 13 + #define SCE_PS_BASE85STRING 14 + #define SCE_PS_BADSTRINGCHAR 15 + #define SCE_NSIS_DEFAULT 0 + #define SCE_NSIS_COMMENT 1 + #define SCE_NSIS_STRINGDQ 2 + #define SCE_NSIS_STRINGLQ 3 + #define SCE_NSIS_STRINGRQ 4 + #define SCE_NSIS_FUNCTION 5 + #define SCE_NSIS_VARIABLE 6 + #define SCE_NSIS_LABEL 7 + #define SCE_NSIS_USERDEFINED 8 + #define SCE_NSIS_SECTIONDEF 9 + #define SCE_NSIS_SUBSECTIONDEF 10 + #define SCE_NSIS_IFDEFINEDEF 11 + #define SCE_NSIS_MACRODEF 12 + #define SCE_NSIS_STRINGVAR 13 + #define SCE_MMIXAL_LEADWS 0 + #define SCE_MMIXAL_COMMENT 1 + #define SCE_MMIXAL_LABEL 2 + #define SCE_MMIXAL_OPCODE 3 + #define SCE_MMIXAL_OPCODE_PRE 4 + #define SCE_MMIXAL_OPCODE_VALID 5 + #define SCE_MMIXAL_OPCODE_UNKNOWN 6 + #define SCE_MMIXAL_OPCODE_POST 7 + #define SCE_MMIXAL_OPERANDS 8 + #define SCE_MMIXAL_NUMBER 9 + #define SCE_MMIXAL_REF 10 + #define SCE_MMIXAL_CHAR 11 + #define SCE_MMIXAL_STRING 12 + #define SCE_MMIXAL_REGISTER 13 + #define SCE_MMIXAL_HEX 14 + #define SCE_MMIXAL_OPERATOR 15 + #define SCE_MMIXAL_SYMBOL 16 + #define SCE_MMIXAL_INCLUDE 17 + #define SCE_CLW_DEFAULT 0 + #define SCE_CLW_LABEL 1 + #define SCE_CLW_COMMENT 2 + #define SCE_CLW_STRING 3 + #define SCE_CLW_USER_IDENTIFIER 4 + #define SCE_CLW_INTEGER_CONSTANT 5 + #define SCE_CLW_REAL_CONSTANT 6 + #define SCE_CLW_PICTURE_STRING 7 + #define SCE_CLW_KEYWORD 8 + #define SCE_CLW_COMPILER_DIRECTIVE 9 + #define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 10 + #define SCE_CLW_STRUCTURE_DATA_TYPE 11 + #define SCE_CLW_ATTRIBUTE 12 + #define SCE_CLW_STANDARD_EQUATE 13 + #define SCE_CLW_ERROR 14 + #define SCE_LOT_DEFAULT 0 + #define SCE_LOT_HEADER 1 + #define SCE_LOT_BREAK 2 + #define SCE_LOT_SET 3 + #define SCE_LOT_PASS 4 + #define SCE_LOT_FAIL 5 + #define SCE_LOT_ABORT 6 + #define SCE_YAML_DEFAULT 0 + #define SCE_YAML_COMMENT 1 + #define SCE_YAML_IDENTIFIER 2 + #define SCE_YAML_KEYWORD 3 + #define SCE_YAML_NUMBER 4 + #define SCE_YAML_REFERENCE 5 + #define SCE_YAML_DOCUMENT 6 + #define SCE_YAML_TEXT 7 + #define SCE_YAML_ERROR 8 + #define SCE_TEX_DEFAULT 0 + #define SCE_TEX_SPECIAL 1 + #define SCE_TEX_GROUP 2 + #define SCE_TEX_SYMBOL 3 + #define SCE_TEX_COMMAND 4 + #define SCE_TEX_TEXT 5 + #define SCE_METAPOST_DEFAULT 0 + #define SCE_METAPOST_SPECIAL 1 + #define SCE_METAPOST_GROUP 2 + #define SCE_METAPOST_SYMBOL 3 + #define SCE_METAPOST_COMMAND 4 + #define SCE_METAPOST_TEXT 5 + #define SCE_METAPOST_EXTRA 6 //--Autogenerated -- end of section automatically generated from Scintilla.iface Index: Scintilla.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Scintilla.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Scintilla.h 17 Jul 2003 11:32:15 -0000 1.6 --- Scintilla.h 21 Nov 2003 13:53:00 -0000 1.7 *************** *** 205,208 **** --- 205,210 ---- #define INDIC_DIAGONAL 3 #define INDIC_STRIKE 4 + #define INDIC_HIDDEN 5 + #define INDIC_BOX 6 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 *************** *** 533,536 **** --- 535,539 ---- #define SCI_SETHOTSPOTACTIVEBACK 2411 #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 + #define SCI_SETHOTSPOTSINGLELINE 2421 #define SCI_PARADOWN 2413 #define SCI_PARADOWNEXTEND 2414 *************** *** 541,544 **** --- 544,563 ---- #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 + #define SC_SEL_STREAM 0 + #define SC_SEL_RECTANGLE 1 + #define SC_SEL_LINES 2 + #define SCI_SETSELECTIONMODE 2422 + #define SCI_GETSELECTIONMODE 2423 + #define SCI_GETLINESELSTARTPOSITION 2424 + #define SCI_GETLINESELENDPOSITION 2425 + #define SCI_LINEDOWNRECTEXTEND 2426 + #define SCI_LINEUPRECTEXTEND 2427 + #define SCI_CHARLEFTRECTEXTEND 2428 + #define SCI_CHARRIGHTRECTEXTEND 2429 + #define SCI_HOMERECTEXTEND 2430 + #define SCI_VCHOMERECTEXTEND 2431 + #define SCI_LINEENDRECTEXTEND 2432 + #define SCI_PAGEUPRECTEXTEND 2433 + #define SCI_PAGEDOWNRECTEXTEND 2434 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 *************** *** 547,550 **** --- 566,570 ---- #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 + #define KEYWORDSET_MAX 8 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 Index: WorkspaceBar.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/WorkspaceBar.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** WorkspaceBar.cpp 11 Aug 2003 04:03:19 -0000 1.21 --- WorkspaceBar.cpp 21 Nov 2003 13:53:00 -0000 1.22 *************** *** 458,462 **** //clean up of temporary files for(i=0;i<m_ParserTemporaryFile.GetSize();i++) ! remove(m_ParserTemporaryFile.GetAt(i)); } --- 458,465 ---- //clean up of temporary files for(i=0;i<m_ParserTemporaryFile.GetSize();i++) ! { ! remove(m_ParserTemporaryFile.GetAt(i)); ! } ! } *************** *** 520,523 **** //clean up of temporary files for(int i=0;i<m_ParserTemporaryFile.GetSize();i++) ! remove(m_ParserTemporaryFile.GetAt(i)); } --- 523,528 ---- //clean up of temporary files for(int i=0;i<m_ParserTemporaryFile.GetSize();i++) ! { ! remove(m_ParserTemporaryFile.GetAt(i)); ! } } Index: scintillaif.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/scintillaif.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** scintillaif.cpp 17 Jul 2003 11:32:16 -0000 1.8 --- scintillaif.cpp 21 Nov 2003 13:53:00 -0000 1.9 *************** *** 441,445 **** long CScintilla::GetCurrentPos() { ! return SPerform(SCI_GETCURRENTPOS, 0, 0); } --- 441,445 ---- long CScintilla::GetCurrentPos() { ! return SPerform(SCI_GETCURRENTPOS, 0, 0); } |
From: <td...@us...> - 2003-11-21 13:53:03
|
Update of /cvsroot/anyedit/AnyEditv2/Plugins/Diff In directory sc8-pr-cvs1:/tmp/cvs-serv28167/Plugins/Diff Modified Files: Diff.plg DiffDlg.cpp DiffDlg.h Log Message: FindReplace positions cursor after replaced text [#817192] Diff plugin interface bug fixed [#817195] Crash on lines > 2510 chars fixed [#799649] Updated to scintilla 1.56 File copies in temp folder are now deleted [#798515] Proper save of find and replace history done [#798521] Standalone file leaves garbage in class view - Fixed [#730650] Index: Diff.plg =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Diff.plg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Diff.plg 23 Jul 2003 09:41:35 -0000 1.2 --- Diff.plg 21 Nov 2003 13:53:00 -0000 1.3 *************** *** 7,49 **** </h3> <h3>Command Lines</h3> - Creating command line "rc.exe /l 0x409 /fo"Release/Diff.res" /d "NDEBUG" /d "_AFXDLL" "C:\OS\AnyEditv2\Plugins\Diff\Diff.rc"" - Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EA.tmp" with contents - [ - /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT" /Fp"Release/Diff.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c - "C:\OS\AnyEditv2\Plugins\Diff\DiffEngine.cpp" - "C:\OS\AnyEditv2\Plugins\Diff\FilePartition.cpp" - "C:\OS\AnyEditv2\Plugins\Diff\Diff.cpp" - "C:\OS\AnyEditv2\Plugins\Diff\DiffDlg.cpp" - ] - Creating command line "cl.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EA.tmp" - Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EB.tmp" with contents - [ - /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT" /Fp"Release/Diff.pch" /Yc"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c - "C:\OS\AnyEditv2\Plugins\Diff\StdAfx.cpp" - ] - Creating command line "cl.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EB.tmp" - Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EC.tmp" with contents - [ - /nologo /subsystem:windows /dll /incremental:no /pdb:"Release/Diff.pdb" /machine:I386 /def:".\Diff.def" /out:"../../bin/Plugins/Diff.dll" /implib:"Release/Diff.lib" - .\Release\DiffEngine.obj - .\Release\FilePartition.obj - .\Release\Diff.obj - .\Release\DiffDlg.obj - .\Release\StdAfx.obj - .\Release\Diff.res - ] - Creating command line "link.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EC.tmp" - <h3>Output Window</h3> - Compiling resources... - Compiling... - StdAfx.cpp - Compiling... - DiffEngine.cpp - FilePartition.cpp - Diff.cpp - DiffDlg.cpp - Generating Code... - Linking... - Creating library Release/Diff.lib and object Release/Diff.exp --- 7,10 ---- Index: DiffDlg.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/DiffDlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DiffDlg.cpp 18 Jul 2003 19:05:36 -0000 1.1 --- DiffDlg.cpp 21 Nov 2003 13:53:00 -0000 1.2 *************** *** 47,51 **** //{{AFX_MSG_MAP(CDiffDlg) ON_BN_CLICKED(ID_BUTTON1, OnButton1) ! ON_BN_CLICKED(65535, On65535) //}}AFX_MSG_MAP END_MESSAGE_MAP() --- 47,51 ---- //{{AFX_MSG_MAP(CDiffDlg) ON_BN_CLICKED(ID_BUTTON1, OnButton1) ! ON_BN_CLICKED(ID_BUTTON2, OnButton2) //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 216,222 **** } ! void CDiffDlg::On65535() { ! UpdateData(TRUE); // update the DDX variables // show open file dialog, and let choose one or more files --- 216,245 ---- } ! void CDiffDlg::OnOK() { ! UpdateData(TRUE); // update the DDX variables ! ! CFileOptions o; ! if (!m_bCheckCase) o.SetOption( CString("case"), CString("no") ); ! if (!m_bCheckIndent) o.SetOption( CString("indent"), CString("no") ); ! ! CString app_path = parent_plugin->GetAppPath(); ! app_path+= "Temp\\Diff.html"; ! ! if(DoDiff(TRUE, m_szFile1, m_szFile2, app_path, o)) ! { ! parent_plugin->OpenUrl(app_path); ! CDialog::OnOK(); ! } ! } ! ! void CDiffDlg::SetPlugin(CPlugin *plugin) ! { ! parent_plugin = plugin; ! } ! ! void CDiffDlg::OnButton2() ! { ! UpdateData(TRUE); // update the DDX variables // show open file dialog, and let choose one or more files *************** *** 243,268 **** free( my_dialog.m_ofn.lpstrFile ); - } - - void CDiffDlg::OnOK() - { - UpdateData(TRUE); // update the DDX variables - - CFileOptions o; - if (!m_bCheckCase) o.SetOption( CString("case"), CString("no") ); - if (!m_bCheckIndent) o.SetOption( CString("indent"), CString("no") ); - - CString app_path = parent_plugin->GetAppPath(); - app_path+= "Temp\\Diff.html"; - - if(DoDiff(TRUE, m_szFile1, m_szFile2, app_path, o)) - { - parent_plugin->OpenUrl(app_path); - CDialog::OnOK(); - } - } - - void CDiffDlg::SetPlugin(CPlugin *plugin) - { - parent_plugin = plugin; } --- 266,268 ---- Index: DiffDlg.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/DiffDlg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DiffDlg.h 18 Jul 2003 19:05:36 -0000 1.1 --- DiffDlg.h 21 Nov 2003 13:53:00 -0000 1.2 *************** *** 42,47 **** //{{AFX_MSG(CDiffDlg) afx_msg void OnButton1(); - afx_msg void On65535(); virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() --- 42,47 ---- //{{AFX_MSG(CDiffDlg) afx_msg void OnButton1(); virtual void OnOK(); + afx_msg void OnButton2(); //}}AFX_MSG DECLARE_MESSAGE_MAP() |
From: <td...@us...> - 2003-11-21 09:42:58
|
Update of /cvsroot/anyedit/AnyEditBin In directory sc8-pr-cvs1:/tmp/cvs-serv20319 Modified Files: AnyEdit.exe BCGCB473.dll BCGCB473D.dll Log Message: New version of dll's and AnyEdit Index: AnyEdit.exe =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/AnyEdit.exe,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsH5wbJp and /tmp/cvsWHQRuL differ Index: BCGCB473.dll =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/BCGCB473.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsLEePyz and /tmp/cvsIeCTS2 differ Index: BCGCB473D.dll =================================================================== RCS file: /cvsroot/anyedit/AnyEditBin/BCGCB473D.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsA4wa5G and /tmp/cvsod5Bju differ |
From: <td...@us...> - 2003-11-21 09:42:58
|
Update of /cvsroot/anyedit/AnyEditBin/Syntax In directory sc8-pr-cvs1:/tmp/cvs-serv20319/Syntax Added Files: Masm.syn python.syn Log Message: New version of dll's and AnyEdit --- NEW FILE: Masm.syn --- # Script file for ASM # Cristophe Savary LanguageName "MASM" LanguageLexer SCLEX_ASM #default font DefaultFont "Verdana" DefaultFontSize 10 #colors # Assembler Styles StyleForeColor 32 808080 # Default #StyleForeColor 0 # Comment StyleForeColor 1 adadad # Number StyleForeColor 2 ff0000 # String StyleForeColor 3 Strings # Operator StyleForeColor 4 Operator # Identifier #StyleForeColor 5 # CPU instruction StyleForeColor 6 Keywords #fore:#0000ff # FPU instruction StyleForeColor 7 0000ff # Register StyleForeColor 8 46aa03 # assembler Directive StyleForeColor 9 0000ff # assembler Directive Operand StyleForeColor 10 0000ff FontStyle 8 BOLD FontStyle 6 BOLD FontStyle 4 BOLD StyleFont 32 "verdana" StyleSize 32 8 #keywords Keywords 1 "aaa aad aam aas adc add and arpl bound bsf bsr bswap bt btc btr bts call cbw cdq \ clc cld cli clts cmc cmp cmps cmpx chg cwd cwde daa das dec div enter esc hlt idiv \ imul in inc include includelib ins int into invd invlpg invoke iret iretd ja jae jb jbe jc jcxz je jecx jecxz jg \ jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo \ js lahf lar lds lea leave les lfs lgdt lidt lgs lldt lmsw lock lods loop loope loopz \ loopnz loopne lsl lss ltr mov movs movsb movsd movsw movsx movzx mul neg nop not or out outs pop popa popad \ popf popfd push pusha pushad pushf pushfd rcl rcr rep repe repz repne repnz ret retf rol \ ror sahf sal sar sbb scas setae setnb setb setnae setbe setna sete setz setne setnz setl \ setnge setge setnl setle setng setg setnle sets setns setc setnc seto setno setp setpe \ setnp setpo sgdt sidt shl shr shld shrd sldt smsw stc std sti stos str sub test verr verw \ wait fwait wbinvd xchg xlat xlatb xor" #FPU Instructions Keywords 2 "f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcom fcomp fcompp fdecstp \ fdisi fdiv fdivp fdivr fdivrp feni ffree fiadd ficom ficomp fidiv \ fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1 \ fldcw fldenv fldenvw fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul \ fmulp fnclex fndisi fneni fninit fnop fnsave fnsavew fnstcw fnstenv \ fnstenvw fnstsw fpatan fprem fptan frndint frstor frstorw fsave \ fsavew fscale fsqrt fst fstcw fstenv fstenvw fstp fstsw fsub fsubp \ fsubr fsubrp ftst fwait fxam fxch fxtract fyl2x fyl2xp1 \ fsetpm fcos fldenvd fnsaved fnstenvd fprem1 frstord fsaved fsin fsincos \ fstenvd fucom fucomp fucompp" #Register Keywords 3 "ah al ax bh bl bp bx ch cl cr0 cr2 cr3 cs \ cx dh di dl dr0 dr1 dr2 dr3 dr6 dr7 ds dx eax ebp ebx ecx edi edx \ es esi esp fs gs si sp ss st tr3 tr4 tr5 tr6 tr7" #Directive Keywords 4 ".186 .286 .286c .286p .287 .386 .386c .386p .387 .486 .486p \ .8086 .8087 .alpha .break .code .const .continue .cref .data .data? \ .dosseg .else .elseif .endif .endw .err .err1 .err2 .errb \ .errdef .errdif .errdifi .erre .erridn .erridni .errnb .errndef \ .errnz .exit .fardata .fardata? .if .lall .lfcond .list .listall \ .listif .listmacro .listmacroall .model .no87 .nocref .nolist \ .nolistif .nolistmacro .radix .repeat .sall .seq .sfcond .stack \ .startup .tfcond .type .until .untilcxz .while .xall .xcref \ .xlist alias align assume catstr comm comment db dd df dosseg dq \ dt dup dw echo else elseif elseif1 elseif2 elseifb elseifdef elseifdif \ elseifdifi elseife elseifidn elseifidni elseifnb elseifndef end \ endif endm endp ends eq equ even exitm extern externdef extrn for \ forc ge goto group gt high highword if if1 if2 ifb ifdef ifdif \ ifdifi ife ifidn ifidni ifnb ifndef include includelib instr invoke \ irp irpc label le length lengthof local low lowword lroffset \ lt macro mask mod .msfloat name ne offset opattr option org %out \ page popcontext proc proto ptr public purge pushcontext record \ repeat rept seg segment short size sizeof sizestr struc struct \ substr subtitle subttl textequ this title type typedef union while width" #Directive Operand Keywords 5 "$ ? @b @f addr basic byte c carry? dword \ far far16 fortran fword near near16 overflow? parity? pascal qword \ real4 real8 real10 sbyte sdword sign? stdcall sword syscall tbyte \ vararg word zero? flat near32 far32 \ abs all assumes at casemap common compact \ cpu dotname emulator epilogue error export expr16 expr32 farstack flat \ forceframe huge language large listing ljmp loadds m510 medium memory \ nearstack nodotname noemulator nokeyword noljmp nom510 none nonunique \ nooldmacros nooldstructs noreadonly noscoped nosignextend nothing \ notpublic oldmacros oldstructs os_dos para private prologue radix \ readonly req scoped setif2 smallstack tiny use16 use32 uses" listWords "aaa aad aam aas adc add and arpl bound bsf bsr bswap bt btc btr bts call cbw cdq \ clc cld cli clts cmc cmp cmps cmpx chg cwd cwde daa das dec div enter esc hlt idiv \ imul in inc include includelib ins int into invd invlpg invoke iret iretd ja jae jb jbe jc jcxz je jecx jecxz jg \ jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo \ js lahf lar lds lea leave les lfs lgdt lidt lgs lldt lmsw lock lods loop loope loopz \ loopnz loopne lsl lss ltr mov movs movsb movsd movsw movsx movzx mul neg nop not or out outs pop popa popad \ popf popfd push pusha pushad pushf pushfd rcl rcr rep repe repz repne repnz ret retf rol \ ror sahf sal sar sbb scas setae setnb setb setnae setbe setna sete setz setne setnz setl \ setnge setge setnl setle setng setg setnle sets setns setc setnc seto setno setp setpe \ setnp setpo sgdt sidt shl shr shld shrd sldt smsw stc std sti stos str sub test verr verw \ wait fwait wbinvd xchg xlat xlatb xor" #folds FoldComments 1 FoldPreprocessor 1 --- NEW FILE: python.syn --- # Try to create a python syntax and comments as much as possible # A string that is used distinguish lexer modules # (along with internal ID). Lexer module name is case sensitive and # can later be used in conjunction with SCI_SETLEXERLANGUAGE Scintilla message. LanguageName "PYTHON" # Language lexer module ID (internal repr. ID) from scintilla # # Theses are lexer available (Scintilla 1.53) : # SCLEX_ADA # SCLEX_ASP # SCLEX_AVE # SCLEX_BAAN # SCLEX_BATCH # SCLEX_BULLANT # SCLEX_CONF # SCLEX_CPP # SCLEX_DIFF # SCLEX_EIFFEL # SCLEX_EIFFELKW # SCLEX_ERRORLIST # SCLEX_HTML # SCLEX_LATEX # SCLEX_LISP # SCLEX_LUA # SCLEX_MAKEFILE # SCLEX_MATLAB # SCLEX_NNCRONTAB # SCLEX_PASCAL # SCLEX_PERL # SCLEX_PHP # SCLEX_PROPERTIES # SCLEX_PYTHON # SCLEX_RUBY # SCLEX_SCRIPTOL # SCLEX_SQL # SCLEX_TCL # SCLEX_VB # SCLEX_VBSCRIPT # SCLEX_XCODE # SCLEX_XML # SCLEX_ASM # SCLEX_CPPNOCASE # SCLEX_FORTRAN # SCLEX_F77 # SCLEX_CSS # SCLEX_POV # SCLEX_LOUT # SCLEX_ESCRIPT LanguageLexer SCLEX_PYTHON #default font DefaultFont "Courier" DefaultFontSize 10 #colors StyleForeColor 1 CommentBox StyleForeColor 2 CommentLine StyleForeColor 3 CommentDoc StyleForeColor 4 Numbers StyleForeColor 5 Keywords StyleForeColor 6 Strings StyleForeColor 7 Char StyleForeColor 8 804080 StyleForeColor 9 7F7F00 StyleForeColor 10 Operator StyleForeColor 11 000000 #Unclosed strings ... StyleForeColor 12 000000 StyleBackColor 12 E0C0E0 #verbatim strings for C# StyleForeColor 13 007F00 StyleBackColor 13 E0FFE0 #regular expressions for java script StyleForeColor 14 3F7F3F StyleBackColor 14 E0F0FF #doxygen comments StyleForeColor 15 3F703F #keywords 2 color StyleForeColor 16 B00040 #comment keyword StyleForeColor 17 3060A0 #comment keyword error StyleForeColor 18 804020 # StyleForeColor 21 000080 StyleBackColor 21 EFEFFF FontStyle 5 BOLD #FontStyle 5 ITALIC #FontStyle 5 UNDERLINE StyleFont 5 "verdana" StyleSize 5 10 # First group of keywords. # For python only one group of keyword exist in Scintilla # "Reserved words, or keywords of the language" keywords 1 "and assert break class continue def del elif else \ except exec finally for from global if import in is lambda \ not or pass print raise return self try while yield" ListWords "and assert break class continue def del elif else \ except exec finally for from global if import in is lambda \ not or pass print raise return self try while yield" # #folds FoldComments 1 FoldPreprocessor 1 |
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv1510 Modified Files: AnyEdit.cpp AnyEdit.h AnyEditDoc.cpp AnyEditDoc.h AnyEditView.cpp ClassView.cpp Language.cpp Log Message: Design fixes done as suggested by Leon Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AnyEdit.cpp 11 Aug 2003 17:21:49 -0000 1.30 --- AnyEdit.cpp 20 Nov 2003 15:47:49 -0000 1.31 *************** *** 1041,1044 **** --- 1041,1061 ---- } + CLanguage * CAnyEditApp::GetLanguage(CString ext) + { + + CString pos; + extmap.Lookup(ext,pos); + if(pos.IsEmpty()) + return NULL; + + CObject * lang=NULL; + langmap.Lookup(pos,lang); + if(lang==NULL) + lang = LoadLanguage(pos); + + return (CLanguage *)lang; + + } + CString CAnyEditApp::SetScintillaLanguage(CString ext, CScintilla *scintilla) { *************** *** 1056,1067 **** { ((CLanguage *)lang)->FillUpScintilla(scintilla); ! return pos; } if(lang==NULL) return pos; ! CLanguage * reallang = (CLanguage *)lang; ! reallang->FillUpScintilla(scintilla); ! return pos; } --- 1073,1083 ---- { ((CLanguage *)lang)->FillUpScintilla(scintilla); ! return pos; } if(lang==NULL) return pos; ! ! ((CLanguage *)lang)->FillUpScintilla(scintilla); return pos; } *************** *** 1112,1151 **** - void CAnyEditApp::GetListWords(CString ext, CString &result) - { - CString pos; - extmap.Lookup(ext,pos); - if(pos.IsEmpty()) - return; - - CObject * lang=NULL; - langmap.Lookup(pos,lang); - if(lang==NULL) - return; - else - { - ((CLanguage *)lang)->GetListWords(result); - } - - } - - BOOL CAnyEditApp::GetAcmpValueToArray(LPCSTR ext,LPCSTR val, CStringArray &arr) - { - - CString pos; - extmap.Lookup(ext,pos); - if(pos.IsEmpty()) - return FALSE; - - CObject * lang=NULL; - langmap.Lookup(pos,lang); - if(lang==NULL) - return FALSE; - else - { - return ((CLanguage *)lang)->GetValueToArray(val,arr); - } - } - void CAnyEditApp::OnFileNew() { --- 1128,1131 ---- *************** *** 1265,1284 **** } - BOOL CAnyEditApp::GetAcmpWordList(LPCSTR ext, CStringArray &arr) - { - CString pos; - extmap.Lookup(ext,pos); - if(pos.IsEmpty()) - return FALSE; - - CObject * lang=NULL; - langmap.Lookup(pos,lang); - if(lang==NULL) - return FALSE; - else - { - return ((CLanguage *)lang)->GetAcmpWordList(arr); - } - } CString CAnyEditApp::GetCurrentProject() --- 1245,1248 ---- Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AnyEdit.h 18 Nov 2003 11:27:21 -0000 1.26 --- AnyEdit.h 20 Nov 2003 15:47:49 -0000 1.27 *************** *** 48,52 **** CString GetCurrentWorkspace(); CString GetCurrentProject(); - BOOL GetAcmpWordList(LPCSTR ext,CStringArray &arr); BOOL CanStartParserThread(); void RefreshParserThread(CWinThread* pNewThread); --- 48,51 ---- *************** *** 55,61 **** void OpenPreferences(); void OpenBrowserWindow(CString url); - void GetListWords(CString ext,CString &result); CObject * LoadLanguage(CString langpos); ! CString SetScintillaLanguage(CString ext,CScintilla * scintilla); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); --- 54,60 ---- void OpenPreferences(); void OpenBrowserWindow(CString url); CObject * LoadLanguage(CString langpos); ! CString SetScintillaLanguage(CString ext, CScintilla *scintilla); ! CLanguage * GetLanguage(CString ext); void LoadLanguageExtensions(); void ApplyOtherDefaults(CScintilla * scintilla); *************** *** 96,100 **** void ResetClassView(LPCSTR str,BOOL parseForProject); CString GetCompFilePathFromLang(LPCSTR lang); - BOOL GetAcmpValueToArray(LPCSTR ext,LPCSTR val, CStringArray &arr); BOOL LockTagList(); void UnlockTagList(); --- 95,98 ---- Index: AnyEditDoc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AnyEditDoc.cpp 6 Jul 2003 18:49:47 -0000 1.10 --- AnyEditDoc.cpp 20 Nov 2003 15:47:49 -0000 1.11 *************** *** 33,36 **** --- 33,37 ---- { // TODO: add one-time construction code here + m_pDocLang = NULL; } *************** *** 206,208 **** --- 207,237 ---- ; //just in case return bResult; //if I return false then I should call disable parsing! + } + + void CAnyEditDoc::SetDocScintilla(CScintilla * m_pscin) + { + m_pScintilla = m_pscin; + } + + void CAnyEditDoc::SetDocLanguage(CLanguage * m_plang) + { + m_pDocLang = m_plang; + } + + void CAnyEditDoc::GetListWords(CString &result) + { + if(m_pDocLang==NULL) return; + m_pDocLang->GetListWords(result); + } + + BOOL CAnyEditDoc::GetAcmpValueToArray(LPCSTR val, CStringArray &arr) + { + if(m_pDocLang==NULL) return FALSE; + return m_pDocLang->GetValueToArray(val,arr); + } + + BOOL CAnyEditDoc::GetAcmpWordList(CStringArray &arr) + { + if(m_pDocLang==NULL) return FALSE; + return m_pDocLang->GetAcmpWordList(arr); } Index: AnyEditDoc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditDoc.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AnyEditDoc.h 8 May 2003 12:00:56 -0000 1.6 --- AnyEditDoc.h 20 Nov 2003 15:47:49 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- #endif // _MSC_VER > 1000 #include "scintillaif.h" + #include "Language.h" class CAnyEditDoc : public CDocument *************** *** 18,24 **** // Attributes ! public: CScintilla * m_pScintilla; CString doc_file_path; // Operations public: --- 19,26 ---- // Attributes ! protected: CScintilla * m_pScintilla; CString doc_file_path; + CLanguage * m_pDocLang; // Operations public: *************** *** 37,43 **** --- 39,50 ---- // Implementation public: + BOOL GetAcmpWordList(CStringArray &arr); + BOOL GetAcmpValueToArray(LPCSTR val, CStringArray &arr); + void GetListWords(CString &result); BOOL SaveTempCopy(CString tempPath); void ReloadDefaults(); void HasBeenModified(BOOL modified); + void SetDocScintilla(CScintilla * m_pscin); + void SetDocLanguage(CLanguage * m_plang); virtual ~CAnyEditDoc(); #ifdef _DEBUG Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AnyEditView.cpp 18 Nov 2003 11:27:22 -0000 1.33 --- AnyEditView.cpp 20 Nov 2003 15:47:49 -0000 1.34 *************** *** 11,15 **** #include "FindReplace.h" #include "Goto.h" ! #ifdef _DEBUG --- 11,15 ---- #include "FindReplace.h" #include "Goto.h" ! #include "Language.h" #ifdef _DEBUG *************** *** 246,250 **** CAnyEditDoc* pDoc = GetDocument(); ! pDoc->m_pScintilla=&m_Scintilla; #ifndef DEBUG --- 246,250 ---- CAnyEditDoc* pDoc = GetDocument(); ! pDoc->SetDocScintilla(&m_Scintilla); #ifndef DEBUG *************** *** 681,685 **** --- 681,691 ---- docname = msc.GetFileExtension(docname); DocExt = docname; + CLanguage * m_pLanguage = NULL; CString tst = theApp.SetScintillaLanguage(docname,&m_Scintilla); + m_pLanguage = theApp.GetLanguage(docname); + if(m_pLanguage!=NULL) + { + GetDocument()->SetDocLanguage(m_pLanguage); + } docname = theApp.GetCompFilePathFromLang(tst); SetAccessTime(); *************** *** 791,795 **** //Next Get Nearest words from word list for document type... CString lwords; ! theApp.GetListWords(DocExt,lwords); CStringArray extwords; --- 797,801 ---- //Next Get Nearest words from word list for document type... CString lwords; ! GetDocument()->GetListWords(lwords); CStringArray extwords; *************** *** 1639,1643 **** const char *root = linebuf + startword; CStringArray arr; ! if(theApp.GetAcmpValueToArray(DocExt,root,arr)) { int delen = strlen(root); --- 1645,1649 ---- const char *root = linebuf + startword; CStringArray arr; ! if(GetDocument()->GetAcmpValueToArray(root,arr)) { int delen = strlen(root); *************** *** 1654,1658 **** { CStringArray arr; ! BOOL b = theApp.GetAcmpWordList(DocExt,arr); if(b) { --- 1660,1664 ---- { CStringArray arr; ! BOOL b = GetDocument()->GetAcmpWordList(arr); if(b) { *************** *** 1672,1676 **** { CStringArray arr; ! if(theApp.GetAcmpValueToArray(DocExt,fup,arr)) { InsertStringArray(arr); --- 1678,1682 ---- { CStringArray arr; ! if(GetDocument()->GetAcmpValueToArray(fup,arr)) { InsertStringArray(arr); Index: ClassView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ClassView.cpp 19 Nov 2003 08:41:56 -0000 1.21 --- ClassView.cpp 20 Nov 2003 15:47:49 -0000 1.22 *************** *** 900,903 **** --- 900,905 ---- case 'g': GETPARENTCATEGORY("Enumerations"); + case 'e': + GETPARENTCATEGORY("Enumerations"); case 'd': GETPARENTCATEGORY("Macros"); Index: Language.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Language.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Language.cpp 27 Aug 2003 06:32:42 -0000 1.9 --- Language.cpp 20 Nov 2003 15:47:49 -0000 1.10 *************** *** 214,218 **** void CLanguage::GetListWords(CString &lwords) { ! lwords = listwords; } --- 214,220 ---- void CLanguage::GetListWords(CString &lwords) { ! //A problem exists with CString thus doing it this way instead of lwords = listwords! ! CString tempstr(listwords.GetBuffer(listwords.GetLength())); ! lwords = tempstr; } |
From: <td...@us...> - 2003-11-19 08:42:00
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv18739 Modified Files: ClassView.cpp ClassView.h TagList.cpp TagList.h TagParser.cpp ToDo.txt Log Message: - Fixed tag parsing memory leaks - Added support for java/python tags Index: ClassView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClassView.cpp 18 Nov 2003 11:27:22 -0000 1.20 --- ClassView.cpp 19 Nov 2003 08:41:56 -0000 1.21 *************** *** 43,46 **** --- 43,66 ---- return retitem; + #define CASEFORFUNCTION switch(acc->access) {\ + case ACCESS_PUBLIC:\ + return IMG_PUB_FUNC;\ + case ACCESS_PRIVATE:\ + return IMG_PRI_FUNC;\ + case ACCESS_PROTECTED:\ + return IMG_PRO_FUNC;\ + default:\ + return IMG_FUNC;} + + #define CASEFORVARIABLE switch(acc->access){\ + case ACCESS_PUBLIC:\ + return IMG_PUB_VAR;\ + case ACCESS_PRIVATE:\ + return IMG_PRI_VAR;\ + case ACCESS_PROTECTED:\ + return IMG_PRO_VAR;\ + default:\ + return IMG_VAR;} + ///////////////////////////////////////////////////////////////////////////// // CClassView *************** *** 253,257 **** } ! HTREEITEM hItem = InsertItem(ent->tagname,0,0,paritem,afterItem); //SetItemData(hItem,ent->lineno); SetItemData(hItem,(DWORD)new CTagEntry(ent)); --- 273,277 ---- } ! HTREEITEM hItem = InsertItem(ent->tagname,IMG_CLASS,IMG_CLASS,paritem,afterItem); //SetItemData(hItem,ent->lineno); SetItemData(hItem,(DWORD)new CTagEntry(ent)); *************** *** 424,430 **** int imgNo=0; GetItemImage(hItem,imgNo,imgNo); ! if((imgNo==6)||(imgNo==7)||(imgNo==12)) return; ! if(imgNo==0) { CheckClass(hItem,taglist); --- 444,450 ---- int imgNo=0; GetItemImage(hItem,imgNo,imgNo); ! if(imgNo==IMG_CATEGORY) return; ! if(imgNo==IMG_CLASS) { CheckClass(hItem,taglist); *************** *** 576,668 **** case 'f': // If it is a function { ! switch(acc->access) ! { ! case 1: ! return 1; ! break; ! case 2: ! return 4; ! break; ! case 3: ! return 3; ! break; ! default: ! return 8; ! } ! } break; ! case 'v': { ! switch(acc->access) ! { ! case 1: ! return 2; ! break; ! case 2: ! return 11; ! break; ! case 3: ! return 10; ! break; ! default: ! return 9; ! } } break; case 'm': ! return 13; break; } ! return 8; } int CClassView::GetImageFTJAVA(CTagEntry * acc) { ! switch(acc->type) { case 'm': // If it is a function { ! switch(acc->access) ! { ! case 1: ! return 1; ! break; ! case 2: ! return 4; ! break; ! case 3: ! return 3; ! break; ! default: ! return 8; ! } ! } break; ! case 'f': { ! switch(acc->access) ! { ! case 1: ! return 2; ! break; ! case 2: ! return 11; ! break; ! case 3: ! return 10; ! break; ! default: ! return 9; ! } } break; } ! return 8; } --- 596,634 ---- case 'f': // If it is a function { ! CASEFORFUNCTION; } break; ! case 'v': //Variable { ! CASEFORVARIABLE; } break; case 'm': ! return IMG_GENERAL; break; } ! return IMG_GENERAL; } int CClassView::GetImageFTJAVA(CTagEntry * acc) { ! switch(acc->type) { case 'm': // If it is a function { ! CASEFORFUNCTION; } break; ! case 'f': // Field == variable { ! CASEFORVARIABLE; } break; } ! return IMG_GENERAL; } *************** *** 674,678 **** int CClassView::GetImageFTPYTHON(CTagEntry * acc) { ! return 8; } --- 640,658 ---- int CClassView::GetImageFTPYTHON(CTagEntry * acc) { ! switch(acc->type) ! { ! case 'f': // If it is a function ! { ! CASEFORFUNCTION; ! } ! break; ! ! case 'm': // Field == variable ! { ! CASEFORVARIABLE; ! } ! break; ! } ! return IMG_GENERAL; } *************** *** 688,703 **** case FT_C: //In case of C,CPP files return GetImageFTC(acc); - break; case FT_JAVA: return GetImageFTJAVA(acc); break; } ! return 8; } BOOL CClassView::DeleteAllItems() { - TRACE("My delete items at class view!\n"); WalkThroughAllItemsDataAndDeleteIt(GetRootItem()); return CTreeCtrl::DeleteAllItems(); --- 668,683 ---- case FT_C: //In case of C,CPP files return GetImageFTC(acc); case FT_JAVA: return GetImageFTJAVA(acc); + case FT_PYTHON: + return GetImageFTPYTHON(acc); break; } ! return IMG_GENERAL; } BOOL CClassView::DeleteAllItems() { WalkThroughAllItemsDataAndDeleteIt(GetRootItem()); return CTreeCtrl::DeleteAllItems(); *************** *** 706,710 **** BOOL CClassView::DeleteItem(HTREEITEM hItem) { - TRACE("My delete single item at class view!\n"); DWORD dwData=GetItemData(hItem); if (dwData!=0) --- 686,689 ---- Index: ClassView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ClassView.h 18 Nov 2003 11:27:22 -0000 1.16 --- ClassView.h 19 Nov 2003 08:41:56 -0000 1.17 *************** *** 10,13 **** --- 10,30 ---- #include "TagList.h" + #define IMG_CLASS 0 + #define IMG_PUB_FUNC 1 + #define IMG_PUB_VAR 2 + #define IMG_PRO_FUNC 3 + #define IMG_PRI_FUNC 4 + #define IMG_PROJECT 5 + #define IMG_IMPORT 6 + #define IMG_IMPORT_ARR 7 + #define IMG_FUNC 8 + #define IMG_VAR 9 + #define IMG_PRO_VAR 10 + #define IMG_PRI_VAR 11 + #define IMG_CATEGORY 12 + #define IMG_GENERAL 13 + + + ///////////////////////////////////////////////////////////////////////////// // CClassView window Index: TagList.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagList.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TagList.cpp 18 Nov 2003 11:27:22 -0000 1.9 --- TagList.cpp 19 Nov 2003 08:41:56 -0000 1.10 *************** *** 23,27 **** CTagList::~CTagList() { - TRACE("CTagList destructor passed!\n"); ClearAllContents(); } --- 23,26 ---- *************** *** 59,65 **** } ! void CTagList::AddEntry ! (CTagEntry ! * ent) { switch (ent->type) --- 58,62 ---- } ! void CTagList::AddEntry(CTagEntry * ent) { switch (ent->type) *************** *** 70,74 **** break; case 'e': - break; case 'f': case 'v': --- 67,70 ---- *************** *** 85,89 **** break; default: ! otherlist.AddTail(ent); } } --- 81,86 ---- break; default: ! delete ent; ! ent=NULL; } } *************** *** 146,151 **** void CTagList::ClearAllContents() { ! ! POSITION pos = classlist.GetHeadPosition(); while(pos != NULL) { --- 143,147 ---- void CTagList::ClearAllContents() { ! POSITION pos = classlist.GetHeadPosition(); while(pos != NULL) { *************** *** 162,166 **** * ent = (CTagEntry *)functionlist.GetNext(pos); ! delete ent; } --- 158,162 ---- * ent = (CTagEntry *)functionlist.GetNext(pos); ! delete ent; } *************** *** 203,206 **** --- 199,203 ---- classlist.RemoveAt(posold); delete ent; + ent=NULL; } } *************** *** 220,223 **** --- 217,221 ---- functionlist.RemoveAt(posold); delete ent; + ent = NULL; } } *************** *** 237,240 **** --- 235,239 ---- otherlist.RemoveAt(posold); delete ent; + ent=NULL; } } Index: TagList.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagList.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TagList.h 12 Aug 2003 13:26:35 -0000 1.7 --- TagList.h 19 Nov 2003 08:41:56 -0000 1.8 *************** *** 18,21 **** --- 18,26 ---- #define FT_JS 6 + #define ACCESS_PUBLIC 1 + #define ACCESS_PRIVATE 2 + #define ACCESS_PROTECTED 3 + + class CTagEntry : public CObject Index: TagParser.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagParser.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TagParser.cpp 18 Nov 2003 11:27:22 -0000 1.10 --- TagParser.cpp 19 Nov 2003 08:41:56 -0000 1.11 *************** *** 93,110 **** msc.ReturnDelimitedArray(linecontent,"\t",arr); - CTagEntry - * ent = new CTagEntry - ; - - ent->lineno = -1; - ent->tagname=""; - ent->classname=""; - ent->type=-1; - ent->access=-1; - int arrsize = arr.GetSize(); if(arrsize < 5) { - delete ent; return; } --- 93,99 ---- *************** *** 127,130 **** --- 116,127 ---- } + CTagEntry * ent = new CTagEntry; + + ent->lineno = -1; + ent->tagname=""; + ent->classname=""; + ent->type=-1; + ent->access=-1; + ent->tagname = arr.GetAt(0); ent->filename = arr.GetAt(1); *************** *** 158,199 **** } ! list->AddEntry ! (ent); ! ! /* CStringArray arr; ! msc.ReturnDelimitedArray(linecontent,"\t",arr); ! ! CTagEntry * ent = new CTagEntry; ! ! ent->lineno = -1; ! ent->tagname=""; ! ent->classname=""; ! ent->type=-1; ! ent->access=-1; ! ! int arrsize = arr.GetSize(); ! if(arrsize < 4) ! { ! delete ent; ! return; ! } ! ent->tagname = arr.GetAt(0); ! ent->filename = arr.GetAt(1); ! CString line = arr.GetAt(2); ! line = line.Left(line.GetLength()-2); ! ent->lineno = msc.GetIntForString(line); ! ent->type = arr.GetAt(3).GetAt(0); ! ! if(arrsize > 4) ! { ! for(int j=4;j<arrsize;j++) ! { ! CString lin = arr.GetAt(j); ! ProcessMoreDetails(list,ent,lin); ! } ! } ! ! list->AddEntry(ent); ! */ } --- 155,159 ---- } ! list->AddEntry(ent); } *************** *** 224,236 **** else if(line == "public") { ! acc = 1; } else if(line == "private") { ! acc = 2; } else if(line == "protected") { ! acc = 3; } --- 184,196 ---- else if(line == "public") { ! acc = ACCESS_PUBLIC; } else if(line == "private") { ! acc = ACCESS_PRIVATE; } else if(line == "protected") { ! acc = ACCESS_PROTECTED; } Index: ToDo.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToDo.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ToDo.txt 18 Nov 2003 04:09:50 -0000 1.18 --- ToDo.txt 19 Nov 2003 08:41:56 -0000 1.19 *************** *** 12,16 **** ======================= 1) Rewrite entire workspace handling with support for project compilation and build ! 2) A Very good plugin architecture... possibly with events and configurable menu items 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error 4) Save find replace options and contents in registry. --- 12,16 ---- ======================= 1) Rewrite entire workspace handling with support for project compilation and build ! 2) A Very good plugin architecture... possibly with events and configurable menu items [Started] 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error 4) Save find replace options and contents in registry. |
From: <td...@us...> - 2003-11-18 11:27:26
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv19491 Modified Files: AnyEdit.dsp AnyEdit.dsw AnyEdit.h AnyEdit.rc AnyEditView.cpp BCGCB473.lib BCGCB473D.lib ChangeLog.txt ClassView.cpp ClassView.h TagList.cpp TagParser.cpp Log Message: - Changed BCG Libraries - Changed class view handling to display more information Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AnyEdit.dsp 12 Aug 2003 13:26:35 -0000 1.22 --- AnyEdit.dsp 18 Nov 2003 11:27:21 -0000 1.23 *************** *** 24,29 **** # Begin Project # PROP AllowPerConfigDependencies 0 ! # PROP Scc_ProjName "" ! # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe --- 24,29 ---- # Begin Project # PROP AllowPerConfigDependencies 0 ! # PROP Scc_ProjName "AnyEdit" ! # PROP Scc_LocalPath "." CPP=cl.exe MTL=midl.exe Index: AnyEdit.dsw =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsw,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AnyEdit.dsw 29 Sep 2002 19:19:42 -0000 1.2 --- AnyEdit.dsw 18 Nov 2003 11:27:21 -0000 1.3 *************** *** 8,11 **** --- 8,15 ---- Package=<5> {{{ + begin source code control + AnyEdit + . + end source code control }}} Index: AnyEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AnyEdit.h 11 Aug 2003 04:03:19 -0000 1.25 --- AnyEdit.h 18 Nov 2003 11:27:21 -0000 1.26 *************** *** 102,105 **** --- 102,109 ---- void UnloadPlugins(); void PluginMenuClicked(UINT id); + void SetModification(BOOL modval) + { + check_modification = modval; + } BOOL CheckModification() { Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AnyEdit.rc 11 Aug 2003 04:03:19 -0000 1.26 --- AnyEdit.rc 18 Nov 2003 11:27:21 -0000 1.27 *************** *** 1778,1784 **** BS_AUTOCHECKBOX | WS_TABSTOP,7,49,88,10 CONTROL "Match case",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,7,64,87,9 CONTROL "&Regular expression",IDC_CHECK3,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,7,78,74,10 CONTROL "Up",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,115,59,68,10 CONTROL "Down",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,115,72,43, --- 1778,1784 ---- BS_AUTOCHECKBOX | WS_TABSTOP,7,49,88,10 CONTROL "Match case",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,7,61,87,9 CONTROL "&Regular expression",IDC_CHECK3,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,7,72,74,10 CONTROL "Up",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,115,59,68,10 CONTROL "Down",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,115,72,43, *************** *** 1790,1795 **** PUSHBUTTON "&Cancel",IDCANCEL,200,76,52,13 LTEXT "Find what",IDC_STATIC,7,10,42,10 ! GROUPBOX "Direction",IDC_STATIC,105,45,84,43 LTEXT "Relace with",IDC_STATIC,7,27,42,10 END --- 1790,1797 ---- PUSHBUTTON "&Cancel",IDCANCEL,200,76,52,13 LTEXT "Find what",IDC_STATIC,7,10,42,10 ! GROUPBOX "Direction",IDC_STATIC,105,50,84,33 LTEXT "Relace with",IDC_STATIC,7,27,42,10 + CONTROL "&Transform backslash expressions",IDC_CHECK4,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,84,118,10 END Index: AnyEditView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AnyEditView.cpp 27 Aug 2003 06:32:42 -0000 1.32 --- AnyEditView.cpp 18 Nov 2003 11:27:22 -0000 1.33 *************** *** 1163,1185 **** CFile file; CFileStatus status; ! file.GetStatus(str,status); ! if(status.m_mtime != last_access_time) ! { ! last_access_time = status.m_mtime; ! CString msg = "'"; ! msg+= str; ! msg+= "'\nFile has been modified outside AnyEdit!\nDo you want to reload it ?"; ! ! if(AfxMessageBox(msg,MB_YESNO)==IDYES) ! { ! m_Scintilla.SetFocus(); ! m_Scintilla.OpenFile(str); ! } ! else ! { ! last_access_time = NULL; ! } ! } } --- 1163,1213 ---- CFile file; CFileStatus status; ! if(!file.GetStatus(str,status)) ! { ! //Find out how to close a view from inside the view ! /* ! CString msg = "'"; ! msg+= str; ! msg+= "'\nFile has been deleted outside AnyEdit!\nDo you want to close the window ?"; ! theApp.SetModification(FALSE); ! if(AfxMessageBox(msg,MB_YESNO)==IDYES) ! { ! if(this) ! { ! last_access_time = NULL; ! this->GetParentFrame()->PostMessage(WM_CLOSE); ! theApp.SetModification(TRUE); ! } ! } ! else ! { ! last_access_time = NULL; ! theApp.SetModification(TRUE); ! }*/ ! ! } ! else ! { ! if(status.m_mtime != last_access_time) ! { ! last_access_time = status.m_mtime; ! CString msg = "'"; ! msg+= str; ! msg+= "'\nFile has been modified outside AnyEdit!\nDo you want to reload it ?"; ! theApp.SetModification(FALSE); ! if(AfxMessageBox(msg,MB_YESNO)==IDYES) ! { ! m_Scintilla.SetFocus(); ! m_Scintilla.OpenFile(str); ! } ! else ! { ! m_Scintilla.SetFocus(); ! last_access_time = NULL; ! } ! theApp.SetModification(TRUE); ! } ! } } Index: BCGCB473.lib =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/BCGCB473.lib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvshpHiP0 and /tmp/cvskGW0rY differ Index: BCGCB473D.lib =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/BCGCB473D.lib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsuDHQ3a and /tmp/cvsgZXf4i differ Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ChangeLog.txt 18 Nov 2003 04:09:50 -0000 1.29 --- ChangeLog.txt 18 Nov 2003 11:27:22 -0000 1.30 *************** *** 35,38 **** --- 35,39 ---- 28) Fixed regular expression in replace patterns [#798478] 29) Added option in replace to remove transform backslash expressions. + 30) Class view display now shows more information [enums, macros, fields] etc., Beta 1.0 Index: ClassView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ClassView.cpp 12 Aug 2003 13:26:35 -0000 1.19 --- ClassView.cpp 18 Nov 2003 11:27:22 -0000 1.20 *************** *** 37,40 **** --- 37,46 ---- #endif + #define GETPARENTCATEGORY(par) if( (retitem= GetItemFromClassName(par,GetRootItem())) == NULL )\ + {\ + retitem = InsertCategory(par);\ + }\ + return retitem; + ///////////////////////////////////////////////////////////////////////////// // CClassView *************** *** 50,55 **** CClassView::~CClassView() { - if(m_SingleLock) - delete m_SingleLock; // to avoid memory leaks when closing the AnyEdit app, CTagEntry classes (that are pointed to by GetItemData // are deleted on WM_DESTROY (OnDestoy function); --- 56,59 ---- *************** *** 98,103 **** char file_ext[_MAX_EXT]; CString targetName,targetExt; ! _splitpath(((CTagEntry ! *)dwData)->filename,file_drive,file_path,file_name,file_ext); targetName=file_name; targetExt=file_ext; --- 102,106 ---- char file_ext[_MAX_EXT]; CString targetName,targetExt; ! _splitpath(((CTagEntry *)dwData)->filename,file_drive,file_path,file_name,file_ext); targetName=file_name; targetExt=file_ext; *************** *** 116,124 **** if(!realpath.IsEmpty()) ! theApp.GotoFileAndLine(((CTagEntry ! *)dwData)->lineno,realpath); else ! theApp.SetSelectedLine(((CTagEntry ! *)dwData)->lineno-1); } } --- 119,125 ---- if(!realpath.IsEmpty()) ! theApp.GotoFileAndLine(((CTagEntry *)dwData)->lineno,realpath); else ! theApp.SetSelectedLine(((CTagEntry *)dwData)->lineno-1); } } *************** *** 183,188 **** { CTagEntry ! * ent = (CTagEntry ! *)functionlist->GetNext(pos); if(ent->deleted==FALSE) InsertFunction(ent); --- 184,188 ---- { CTagEntry ! * ent = (CTagEntry *)functionlist->GetNext(pos); if(ent->deleted==FALSE) InsertFunction(ent); *************** *** 213,218 **** { CTagEntry ! * ent = (CTagEntry ! *)classlist->GetNext(pos); InsertClass(ent); } --- 213,217 ---- { CTagEntry ! * ent = (CTagEntry*)classlist->GetNext(pos); InsertClass(ent); } *************** *** 231,236 **** } ! void CClassView::InsertClass(CTagEntry ! *ent) { HTREEITEM paritem; --- 230,234 ---- } ! void CClassView::InsertClass(CTagEntry*ent) { HTREEITEM paritem; *************** *** 251,260 **** HTREEITEM afterItem=TVI_FIRST; if(paritem==GetRootItem()) afterItem=TVI_LAST; HTREEITEM hItem = InsertItem(ent->tagname,0,0,paritem,afterItem); //SetItemData(hItem,ent->lineno); ! SetItemData(hItem,(DWORD)new CTagEntry ! (ent)); } --- 249,259 ---- HTREEITEM afterItem=TVI_FIRST; if(paritem==GetRootItem()) + { afterItem=TVI_LAST; + } HTREEITEM hItem = InsertItem(ent->tagname,0,0,paritem,afterItem); //SetItemData(hItem,ent->lineno); ! SetItemData(hItem,(DWORD)new CTagEntry(ent)); } *************** *** 286,307 **** } ! CTagEntry ! * CClassView::InsertFunctionByAlphabet(CTagEntry ! * ent) { CString funcname = ent->tagname; CString clPar= ent->classname; - HTREEITEM parItem; - if(clPar==_T("")) - parItem = GetRootItem(); - else - { - int rev = clPar.ReverseFind('.'); - if(rev!=-1) - clPar = clPar.Right(clPar.GetLength()-rev-1); - parItem = GetItemFromClassName(clPar,GetRootItem()); - } - HTREEITEM tempItem = GetChildItem(parItem); BOOL first=TRUE; --- 285,293 ---- } ! CTagEntry* CClassView::InsertFunctionByAlphabet(HTREEITEM parItem,CTagEntry * ent) { CString funcname = ent->tagname; CString clPar= ent->classname; HTREEITEM tempItem = GetChildItem(parItem); BOOL first=TRUE; *************** *** 309,315 **** while(tempItem != NULL) { ! CTagEntry ! * entold = (CTagEntry ! *)GetItemData(tempItem); if(!entold) break; --- 295,299 ---- while(tempItem != NULL) { ! CTagEntry* entold = (CTagEntry*)GetItemData(tempItem); if(!entold) break; *************** *** 337,368 **** HTREEITEM newItem = InsertItem(ent->tagname,imnum,imnum,parItem,ttempItem); ! CTagEntry ! * tempentry ! = new CTagEntry ! (ent); ! SetItemData(newItem,(DWORD)tempentry ! ); ! return tempentry ! ; } ! CTagEntry ! * CClassView::InsertFunctionByLine(CTagEntry ! *ent) { int llineNo = ent->lineno; CString clPar= ent->classname; - HTREEITEM parItem; - if(clPar==_T("")) - parItem = GetRootItem(); - else - { - int rev = clPar.ReverseFind('.'); - if(rev!=-1) - clPar = clPar.Right(clPar.GetLength()-rev-1); - parItem = GetItemFromClassName(clPar,GetRootItem()); - } - HTREEITEM tempItem = GetChildItem(parItem); BOOL first=TRUE; --- 321,334 ---- HTREEITEM newItem = InsertItem(ent->tagname,imnum,imnum,parItem,ttempItem); ! CTagEntry* tempentry = new CTagEntry(ent); ! SetItemData(newItem,(DWORD)tempentry); ! return tempentry; } ! CTagEntry* CClassView::InsertFunctionByLine(HTREEITEM parItem,CTagEntry *ent) { int llineNo = ent->lineno; CString clPar= ent->classname; HTREEITEM tempItem = GetChildItem(parItem); BOOL first=TRUE; *************** *** 370,376 **** while(tempItem != NULL) { ! CTagEntry ! * entold = (CTagEntry ! *)GetItemData(tempItem); if(!entold) break; --- 336,340 ---- while(tempItem != NULL) { ! CTagEntry * entold = (CTagEntry*)GetItemData(tempItem); if(!entold) break; *************** *** 398,429 **** HTREEITEM newItem = InsertItem(ent->tagname,imnum,imnum,parItem,ttempItem); ! CTagEntry ! * tempentry ! = new CTagEntry ! (ent); ! SetItemData(newItem,(DWORD)tempentry ! ); ! return tempentry ! ; } ! void CClassView::InsertFunction(CTagEntry ! *ent) { ! CTagEntry ! * tempentry ! ; if(theApp.GetAlphabetic()) { ! tempentry ! = InsertFunctionByAlphabet(ent); } else { ! tempentry ! =InsertFunctionByLine(ent); } --- 362,385 ---- HTREEITEM newItem = InsertItem(ent->tagname,imnum,imnum,parItem,ttempItem); ! CTagEntry* tempentry= new CTagEntry(ent); ! SetItemData(newItem,(DWORD)tempentry); ! return tempentry; } ! void CClassView::InsertFunction(CTagEntry *ent) { ! CTagEntry* tempentry; ! ! HTREEITEM parItem = GetParentItemForEntry(ent); if(theApp.GetAlphabetic()) { ! tempentry = InsertFunctionByAlphabet(parItem,ent); } else { ! tempentry =InsertFunctionByLine(parItem,ent); } *************** *** 435,445 **** for(i=0;i<imnum;i++) { ! if(((CTagEntry ! *)fbox->GetItemData(i))->lineno > ent->lineno) break; } int itno = fbox->InsertString(i,ent->tagname); ! fbox->SetItemData(itno,(DWORD)tempentry ! ); } } --- 391,399 ---- for(i=0;i<imnum;i++) { ! if(((CTagEntry*)fbox->GetItemData(i))->lineno > ent->lineno) break; } int itno = fbox->InsertString(i,ent->tagname); ! fbox->SetItemData(itno,(DWORD)tempentry); } } *************** *** 470,474 **** int imgNo=0; GetItemImage(hItem,imgNo,imgNo); ! if((imgNo==6)|(imgNo==7)) return; if(imgNo==0) --- 424,428 ---- int imgNo=0; GetItemImage(hItem,imgNo,imgNo); ! if((imgNo==6)||(imgNo==7)||(imgNo==12)) return; if(imgNo==0) *************** *** 495,500 **** POSITION pos = clist->GetHeadPosition(); POSITION posold; ! CTagEntry ! * ent; BOOL removeme = FALSE; --- 449,453 ---- POSITION pos = clist->GetHeadPosition(); POSITION posold; ! CTagEntry* ent; BOOL removeme = FALSE; *************** *** 502,507 **** { posold = pos; ! ent = (CTagEntry ! *) clist->GetNext(pos); if(ent->tagname==clname) { --- 455,459 ---- { posold = pos; ! ent = (CTagEntry*) clist->GetNext(pos); if(ent->tagname==clname) { *************** *** 511,521 **** if (dwData!=0) { ! ((CTagEntry ! *)dwData)->lineno=ent->lineno; } else { ! SetItemData(hItem,(DWORD)new CTagEntry ! (ent)); }; //SetItemData(hItem,ent->lineno); --- 463,471 ---- if (dwData!=0) { ! ((CTagEntry*)dwData)->lineno=ent->lineno; } else { ! SetItemData(hItem,(DWORD)new CTagEntry(ent)); }; //SetItemData(hItem,ent->lineno); *************** *** 544,548 **** HTREEITEM parItem = GetParentItem(hItem); CString par = GetItemText(parItem); ! if(parItem==GetRootItem()) par=""; --- 494,505 ---- HTREEITEM parItem = GetParentItem(hItem); CString par = GetItemText(parItem); ! BOOL iscategory=FALSE; ! DWORD dwda=GetItemData(parItem); ! if (dwda!=0) ! { ! if(((CTagEntry*)dwda)->type == 'z') iscategory=TRUE; ! } ! ! if( (parItem==GetRootItem()) || ( iscategory )) par=""; *************** *** 551,562 **** POSITION pos = funclist->GetHeadPosition(); POSITION posold; ! CTagEntry ! * ent; BOOL removeme = FALSE; while(pos != NULL) { posold = pos; ! ent = (CTagEntry ! *)funclist->GetNext(pos); if(ent==NULL) break; --- 508,517 ---- POSITION pos = funclist->GetHeadPosition(); POSITION posold; ! CTagEntry* ent; BOOL removeme = FALSE; while(pos != NULL) { posold = pos; ! ent = (CTagEntry*)funclist->GetNext(pos); if(ent==NULL) break; *************** *** 569,578 **** if (dwData!=0) { ! ((CTagEntry ! *)dwData)->lineno=ent->lineno; ! ((CTagEntry ! *)dwData)->tagDefinition = ent->tagDefinition; ! ((CTagEntry ! *)dwData)->filename = ent->filename; } --- 524,533 ---- if (dwData!=0) { ! if(((CTagEntry*)dwData)->type == ent->type) ! { ! ((CTagEntry*)dwData)->lineno=ent->lineno; ! ((CTagEntry*)dwData)->tagDefinition = ent->tagDefinition; ! ((CTagEntry*)dwData)->filename = ent->filename; ! } } *************** *** 582,595 **** (ent)); }; ! //SetItemData(hItem,ent->lineno); ! int imnum = GetImageForAccess(ent); ! int oldnum=0; ! int oldselnum=0; ! GetItemImage(hItem,oldnum,oldselnum); ! if(oldnum != imnum) ! SetItemImage(hItem,imnum,imnum); ! ent->deleted=TRUE; ! removeme = TRUE; ! break; } --- 537,553 ---- (ent)); }; ! ! if(((CTagEntry*)dwData)->type == ent->type) ! { ! int imnum = GetImageForAccess(ent); ! int oldnum=0; ! int oldselnum=0; ! GetItemImage(hItem,oldnum,oldselnum); ! if(oldnum != imnum) ! SetItemImage(hItem,imnum,imnum); ! ent->deleted=TRUE; ! removeme = TRUE; ! break; ! } } *************** *** 637,641 **** case 'v': - case 'm': { switch(acc->access) --- 595,598 ---- *************** *** 655,658 **** --- 612,619 ---- } break; + + case 'm': + return 13; + break; } *************** *** 749,754 **** if (dwData!=0) { ! delete (CTagEntry ! *)dwData; SetItemData(hItem,0); }; --- 710,714 ---- if (dwData!=0) { ! delete (CTagEntry*)dwData; SetItemData(hItem,0); }; *************** *** 775,780 **** if (dwData!=0) { ! delete (CTagEntry ! *)dwData; SetItemData(startFrom,0); }; --- 735,739 ---- if (dwData!=0) { ! delete (CTagEntry*)dwData; SetItemData(startFrom,0); }; *************** *** 798,802 **** int imselnum; GetItemImage(hitem,imnum,imselnum); ! if(imnum==0) return TRUE; else --- 757,761 ---- int imselnum; GetItemImage(hitem,imnum,imselnum); ! if((imnum==0) || (imnum==12)) return TRUE; else *************** *** 819,849 **** } - /* Instead of Adding new tag entries alone in the Tag List.. do not clear the project - tag list and append only changes to it and then do the usual fill taglist.,, - void CClassView::AddTagList(CTagList *taglist) - { - proarr.RemoveAll(); - theApp.GetCurrentProjectFiles(proarr); - CheckTagList(GetRootItem(),taglist); - - CObList * classlist = taglist->GetClassList(); - - POSITION pos = classlist->GetHeadPosition(); - while(pos != NULL) - { - CTagEntry * ent = (CTagEntry *)classlist->GetNext(pos); - InsertClass(ent); - } - - CObList * functionlist = taglist->GetFunctionList(); - - pos = functionlist->GetHeadPosition(); - while(pos != NULL) - { - CTagEntry * ent = (CTagEntry *)functionlist->GetNext(pos); - InsertFunction(ent); - } - } - */ void CClassView::PreSubclassWindow() --- 778,781 ---- *************** *** 906,918 **** if (!hItem) return FALSE; ! CTagEntry ! * tagEntry ! = (CTagEntry ! *) GetItemData(hItem); ! if (tagEntry ! !=NULL) { ! strTipText=tagEntry ! ->tagDefinition; } --- 838,845 ---- if (!hItem) return FALSE; ! CTagEntry * tagEntry= (CTagEntry*) GetItemData(hItem); ! if (tagEntry!=NULL) { ! strTipText=tagEntry->tagDefinition; } *************** *** 938,979 **** return TRUE; // message was handled ! /* TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; ! TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; ! CString strTipText; ! UINT nID = pNMHDR->idFrom; ! // Do not process the msg from built in tooltip ! if( nID == (UINT)m_hWnd && (( pNMHDR->code == TTN_NEEDTEXTA && pTTTA->uFlags & TTF_IDISHWND ) ! || ( pNMHDR->code == TTN_NEEDTEXTW && pTTTW->uFlags & TTF_IDISHWND ) ) ) ! return FALSE; ! // Get the mouse position ! const MSG* pMessage; ! CPoint pt; ! pMessage = GetCurrentMessage(); // get mouse pos ! ASSERT ( pMessage ); ! pt = pMessage->pt; ! ScreenToClient( &pt ); ! UINT nFlags; ! HTREEITEM hItem = HitTest( pt, &nFlags ); //Get item pointed by mouse ! ! CTagEntry* tagEntry = (CTagEntry*) GetItemData(hItem); ! if (tagEntry!=NULL) ! { ! strTipText=tagEntry->tagDefinition; ! } ! #ifndef _UNICODE ! if (pNMHDR->code == TTN_NEEDTEXTA) ! lstrcpyn(pTTTA->szText, strTipText, 80); ! else ! _mbstowcsz(pTTTW->szText, strTipText, 80); ! #else ! if (pNMHDR->code == TTN_NEEDTEXTA) ! _wcstombsz(pTTTA->szText, strTipText, 80); ! else ! lstrcpyn(pTTTW->szText, strTipText, 80); ! #endif ! *pResult = 0; ! ! return TRUE; // message was handled ! */ } --- 865,958 ---- return TRUE; // message was handled + } ! HTREEITEM CClassView::InsertCategory(const char * catname) ! { ! ! CTagEntry ent; ! ent.tagname = catname; ! ent.lineno=0; ! ent.type = 'z'; ! ! HTREEITEM paritem = GetRootItem(); ! HTREEITEM afterItem=TVI_FIRST; ! ! HTREEITEM hItem = InsertItem(ent.tagname,12,12,paritem,afterItem); ! //SetItemData(hItem,ent->lineno); ! SetItemData(hItem,(DWORD)new CTagEntry(&ent)); ! return hItem; ! } ! ! ! HTREEITEM CClassView::GetParentItemForEntry(CTagEntry *ent) ! { ! CString funcname = ent->tagname; ! CString clPar= ent->classname; ! ! HTREEITEM parItem = GetRootItem(); ! int rev = clPar.ReverseFind('.'); ! if(rev!=-1) ! { ! clPar = clPar.Right(clPar.GetLength()-rev-1); ! } ! parItem = GetItemFromClassName(clPar,GetRootItem()); ! if(parItem!=NULL) ! return parItem; ! ! switch(ent->filetype) ! { ! case FT_C: //In case of C,CPP files ! return GetParentC(ent); ! case FT_JAVA: ! return GetParentJava(ent); ! break; ! } ! ! return parItem; ! } ! ! HTREEITEM CClassView::GetParentC(CTagEntry *ent) ! { ! HTREEITEM retitem; ! switch(ent->type) ! { ! case 'v': ! GETPARENTCATEGORY("Variables"); ! case 'g': ! GETPARENTCATEGORY("Enumerations"); ! case 'd': ! GETPARENTCATEGORY("Macros"); ! case 'm': ! GETPARENTCATEGORY("Members"); ! case 's': ! GETPARENTCATEGORY("Structures"); ! case 't': ! GETPARENTCATEGORY("Typedefs"); ! case 'x': ! GETPARENTCATEGORY("Externs"); ! case 'u': ! GETPARENTCATEGORY("Unions"); ! case 'n': ! GETPARENTCATEGORY("Namespaces"); ! case 'p': ! GETPARENTCATEGORY("Prototypes"); ! break; ! } ! return GetRootItem(); ! } ! ! HTREEITEM CClassView::GetParentJava(CTagEntry *ent) ! { ! HTREEITEM retitem; ! switch(ent->type) ! { ! case 'f': ! GETPARENTCATEGORY("Fields"); ! case 'i': ! GETPARENTCATEGORY("Interfaces"); ! case 'p': ! GETPARENTCATEGORY("Packages"); ! break; ! } ! return GetRootItem(); } Index: ClassView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClassView.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ClassView.h 12 Aug 2003 13:26:35 -0000 1.15 --- ClassView.h 18 Nov 2003 11:27:22 -0000 1.16 *************** *** 42,46 **** // Implementation public: ! //void AddTagList(CTagList* taglist); int GetFunctionBoxPosition(LPCSTR data); BOOL DeleteItem(HTREEITEM hItem); --- 42,46 ---- // Implementation public: ! //void AddTagList(CTagList* taglist); int GetFunctionBoxPosition(LPCSTR data); BOOL DeleteItem(HTREEITEM hItem); *************** *** 54,57 **** --- 54,60 ---- // Generated message map functions protected: + HTREEITEM GetParentJava(CTagEntry * ent); + HTREEITEM GetParentC(CTagEntry * ent); + HTREEITEM GetParentItemForEntry(CTagEntry * ent); int OnToolHitTest(CPoint point, TOOLINFO * pTI) const; BOOL OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); *************** *** 64,69 **** void CheckTagList(HTREEITEM hItem,CTagList * taglist); void InsertFunction(CTagEntry * ent); ! CTagEntry* InsertFunctionByLine(CTagEntry * ent); ! CTagEntry* InsertFunctionByAlphabet(CTagEntry* ent); int GetImageFTC(CTagEntry * ent); int GetImageFTJAVA(CTagEntry * ent); --- 67,72 ---- void CheckTagList(HTREEITEM hItem,CTagList * taglist); void InsertFunction(CTagEntry * ent); ! CTagEntry* InsertFunctionByLine(HTREEITEM parItem, CTagEntry * ent); ! CTagEntry* InsertFunctionByAlphabet(HTREEITEM parItem,CTagEntry* ent); int GetImageFTC(CTagEntry * ent); int GetImageFTJAVA(CTagEntry * ent); *************** *** 73,76 **** --- 76,80 ---- HTREEITEM GetItemFromClassName(LPCSTR clName, HTREEITEM hItem); + HTREEITEM InsertCategory(const char * category); void InsertClass(CTagEntry * ent); Index: TagList.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagList.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TagList.cpp 12 Aug 2003 13:26:35 -0000 1.8 --- TagList.cpp 18 Nov 2003 11:27:22 -0000 1.9 *************** *** 65,75 **** switch (ent->type) { case 'c': classlist.AddTail(ent); break; ! case 'f': case 'v': case 'm': ! functionlist.AddTail(ent); break; default: --- 65,86 ---- switch (ent->type) { + case 's': case 'c': classlist.AddTail(ent); break; ! case 'e': ! break; ! case 'f': case 'v': + case 'g': + case 'd': case 'm': ! case 't': ! case 'x': ! case 'u': ! case 'n': ! case 'i': ! case 'p': ! functionlist.AddTail(ent); break; default: Index: TagParser.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/TagParser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TagParser.cpp 12 Aug 2003 13:26:35 -0000 1.9 --- TagParser.cpp 18 Nov 2003 11:27:22 -0000 1.10 *************** *** 208,211 **** --- 208,217 ---- list->CheckForClass(line,ent->filename); } + else if(line.Left(7)=="struct:") + { + line = line.Right(line.GetLength()-7); + ent->classname = line; + list->CheckForClass(line,ent->filename); + } else if(line.Left(7)=="access:") { |
From: <td...@us...> - 2003-11-18 11:27:25
|
Update of /cvsroot/anyedit/AnyEditv2/res In directory sc8-pr-cvs1:/tmp/cvs-serv19491/res Modified Files: bmp00019.bmp Log Message: - Changed BCG Libraries - Changed class view handling to display more information Index: bmp00019.bmp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/res/bmp00019.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsNcE3KV and /tmp/cvsYC7aiH differ |
From: <td...@us...> - 2003-11-18 05:41:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv3147 Modified Files: MDITabs.cpp MDITabs.h Added Files: LBSpinButtonCtrl.cpp LBSpinButtonCtrl.h Log Message: Almost OfficeXP style MDI tab implementation --- NEW FILE: LBSpinButtonCtrl.cpp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: LBSpinButtonCtrl.h --- (This appears to be a binary file; contents omitted.) Index: MDITabs.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MDITabs.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MDITabs.cpp 31 Jul 2003 12:25:32 -0000 1.10 --- MDITabs.cpp 18 Nov 2003 05:41:37 -0000 1.11 *************** *** 65,74 **** BEGIN_MESSAGE_MAP(CMDITabs, CTabCtrl) ! //{{AFX_MSG_MAP(CMDITabs) ! ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelChange) ! ON_WM_PAINT() ! ON_WM_NCPAINT() ! ON_WM_CONTEXTMENU() ! ON_WM_LBUTTONDBLCLK() //}}AFX_MSG_MAP ON_MESSAGE(WM_SIZEPARENT, OnSizeParent) --- 65,75 ---- BEGIN_MESSAGE_MAP(CMDITabs, CTabCtrl) ! //{{AFX_MSG_MAP(CMDITabs) ! ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelChange) ! ON_WM_PAINT() ! ON_WM_NCPAINT() ! ON_WM_CONTEXTMENU() ! ON_WM_LBUTTONDBLCLK() ! ON_WM_ERASEBKGND() //}}AFX_MSG_MAP ON_MESSAGE(WM_SIZEPARENT, OnSizeParent) *************** *** 107,111 **** --- 108,176 ---- } ShowWindow(SW_NORMAL); + + if(!gotmspin) + { + CTabCtrl::LockWindowUpdate(); + CTabCtrl::InsertItem(0,"DEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEEDEEEEEEEEEEE"); + + CWnd* pWnd = GetWindow(GW_CHILD); + while(pWnd) + { + char buf[]="msctls_updown32"; + int nRet=::GetClassName(pWnd->m_hWnd,buf,sizeof(buf)/sizeof (buf[0])); + if(nRet && strcmp(buf,"msctls_updown32")) + { + pWnd = pWnd->GetWindow(GW_HWNDNEXT); + } + else + { + CRect m_rectUpDn; + //The msctls_updown32 control is found. + // + pWnd->GetWindowRect(&m_rectUpDn); + ScreenToClient(&m_rectUpDn); + //Update size and position of msctls_updown32 control + //m_rectUpDn.DeflateRect(50,50); + //m_rectUpDn.bottom = rectCli.bottom; + //m_rectUpDn.left +=5; + // m_rectUpDn.right+=2; + //m_rectUpDn.OffsetRect(3,5); + CRect rectCli; + GetClientRect(&rectCli); + + m_rectUpDn.top = rectCli.bottom-25; + m_rectUpDn.bottom = rectCli.bottom-2; + m_rectUpDn.left = rectCli.right - 35; + m_rectUpDn.right = rectCli.right-10; + + pWnd->MoveWindow(&m_rectUpDn); + m_Spin.SubclassWindow(pWnd->m_hWnd); + gotmspin=TRUE; + pWnd=0; + m_Spin.ShowWindow(SW_NORMAL); + } + } + CTabCtrl::DeleteAllItems(); + CTabCtrl::UnlockWindowUpdate(); + } + else + { + CRect rectCli; + GetClientRect(&rectCli); + + CRect m_rectUpDn; + m_rectUpDn.top = rectCli.bottom-25; + m_rectUpDn.bottom = rectCli.bottom-2; + m_rectUpDn.left = rectCli.right - 35; + m_rectUpDn.right = rectCli.right-10; + if(m_Spin) + { + m_Spin.MoveWindow(m_rectUpDn); + m_Spin.ShowWindow(SW_NORMAL); + } + } + } + return 0; } *************** *** 294,297 **** --- 359,402 ---- dc.SelectObject (pOldPen); + + /*CWnd* pWnd = GetWindow(GW_CHILD); + while(pWnd) + { + char buf[]="msctls_updown32"; + int nRet=::GetClassName(pWnd->m_hWnd,buf,sizeof(buf)/sizeof (buf[0])); + if(nRet && strcmp(buf,"msctls_updown32")) + { + pWnd = pWnd->GetWindow(GW_HWNDNEXT); + } + else + { + CRect m_rectUpDn; + //The msctls_updown32 control is found. + // + pWnd->GetWindowRect(&m_rectUpDn); + ScreenToClient(&m_rectUpDn); + //Update size and position of msctls_updown32 control + //m_rectUpDn.DeflateRect(50,50); + m_rectUpDn.top = rectCli.bottom-25; + m_rectUpDn.bottom = rectCli.bottom-1; + //m_rectUpDn.left +=5; + // m_rectUpDn.right+=2; + //m_rectUpDn.OffsetRect(3,5); + pWnd->MoveWindow(&m_rectUpDn); + pWnd=0; + } + }*/ + + if(gotmspin && m_Spin) + { + m_Spin.ShowWindow(SW_NORMAL); + CRect m_rectUpDn; + m_rectUpDn.top = rectCli.bottom-25; + m_rectUpDn.bottom = rectCli.bottom-2; + m_rectUpDn.left = rectCli.right - 25; + m_rectUpDn.right = rectCli.right-1; + m_Spin.MoveWindow(m_rectUpDn); + } + } *************** *** 328,331 **** --- 433,450 ---- ::DeleteObject(pen); ::ReleaseDC(m_hWnd, hdc); + + if(gotmspin && m_Spin) + { + CRect rectCli; + GetClientRect(&rectCli); + + CRect m_rectUpDn; + m_rectUpDn.top = rectCli.bottom-25; + m_rectUpDn.bottom = rectCli.bottom-2; + m_rectUpDn.left = rectCli.right - 35; + m_rectUpDn.right = rectCli.right-10; + m_Spin.MoveWindow(m_rectUpDn); + m_Spin.ShowWindow(SW_NORMAL); + } } *************** *** 469,473 **** metrics.lfStatusFont.lfWeight = FW_BOLD; m_fontbold.CreateFontIndirect(&metrics.lfStatusFont); - } --- 588,595 ---- metrics.lfStatusFont.lfWeight = FW_BOLD; m_fontbold.CreateFontIndirect(&metrics.lfStatusFont); } + BOOL CMDITabs::OnEraseBkgnd(CDC* pDC) + { + return TRUE; + } Index: MDITabs.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MDITabs.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MDITabs.h 31 Jul 2003 12:25:32 -0000 1.4 --- MDITabs.h 18 Nov 2003 05:41:37 -0000 1.5 *************** *** 11,15 **** #ifndef __MDITABS_H #define __MDITABS_H ! /****************************************************************************\ --- 11,15 ---- #ifndef __MDITABS_H #define __MDITABS_H ! #include "LBSpinButtonCtrl.h" /****************************************************************************\ *************** *** 64,68 **** CBrush m_hbrBackground; COLORREF m_clrBackground; ! CImageList m_NumberOverlays; int m_MenuTab; // item on which we opened context menu --- 64,69 ---- CBrush m_hbrBackground; COLORREF m_clrBackground; ! CLBSpinButtonCtrl m_Spin; ! BOOL gotmspin; CImageList m_NumberOverlays; int m_MenuTab; // item on which we opened context menu *************** *** 98,101 **** --- 99,103 ---- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG afx_msg LRESULT OnSizeParent(WPARAM, LPARAM lParam); |
From: <td...@us...> - 2003-11-18 04:09:57
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv21625 Modified Files: ChangeLog.txt FindDialog.cpp FindReplace.cpp FindReplace.h ToDo.txt Log Message: - Fixed regular expression in replace patterns [#798478] - Added option in replace to remove transform backslash expressions. Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ChangeLog.txt 27 Aug 2003 06:32:42 -0000 1.28 --- ChangeLog.txt 18 Nov 2003 04:09:50 -0000 1.29 *************** *** 33,36 **** --- 33,38 ---- 26) Fixed regular expression not working with find and find replace [#787886] 27) Added folding support to html files + 28) Fixed regular expression in replace patterns [#798478] + 29) Added option in replace to remove transform backslash expressions. Beta 1.0 Index: FindDialog.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindDialog.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FindDialog.cpp 27 Aug 2003 06:32:42 -0000 1.10 --- FindDialog.cpp 18 Nov 2003 04:09:50 -0000 1.11 *************** *** 58,63 **** if (!strText.IsEmpty ()) { ! SaveToRegistry ! (); if(m_up.GetCheck()) --- 58,62 ---- if (!strText.IsEmpty ()) { ! SaveToRegistry(); if(m_up.GetCheck()) *************** *** 171,176 **** } ! void CFindDialog::SaveToRegistry ! () { CString tempStr; --- 170,174 ---- } ! void CFindDialog::SaveToRegistry() { CString tempStr; *************** *** 202,207 **** void CFindDialog::OnCancel() { ! SaveToRegistry ! (); CDialog::OnCancel(); } --- 200,204 ---- void CFindDialog::OnCancel() { ! SaveToRegistry(); CDialog::OnCancel(); } Index: FindReplace.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindReplace.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FindReplace.cpp 1 Sep 2003 11:27:34 -0000 1.6 --- FindReplace.cpp 18 Nov 2003 04:09:50 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFindReplace) + DDX_Control(pDX, IDC_CHECK4, m_check4); DDX_Control(pDX, ID_FINDNEXT, m_find); DDX_Control(pDX, IDREPLACE, m_repl); *************** *** 41,45 **** DDX_Control(pDX, IDC_COMBO3, m_replacecombo); DDX_Control(pDX, IDC_COMBO1, m_findcombo); ! //}}AFX_DATA_MAP } --- 42,46 ---- DDX_Control(pDX, IDC_COMBO3, m_replacecombo); DDX_Control(pDX, IDC_COMBO1, m_findcombo); ! //}}AFX_DATA_MAP } *************** *** 64,68 **** if (!strText.IsEmpty ()) { ! //SaveToRegistry(); m_scintilla->SetTargetStart(m_scintilla->GetCurrentPos()); m_scintilla->SetTargetEnd(m_scintilla->GetLength()); --- 65,69 ---- if (!strText.IsEmpty ()) { ! SaveToRegistry(); m_scintilla->SetTargetStart(m_scintilla->GetCurrentPos()); m_scintilla->SetTargetEnd(m_scintilla->GetLength()); *************** *** 100,109 **** { CDialog::OnInitDialog(); m_down.SetCheck(1); ! m_findcombo.SetFocus(); return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CFindReplace::OnReplace() { --- 101,202 ---- { CDialog::OnInitDialog(); + + char tempStr[1024]; + CStringArray tempArr; + CString comboStr = m_reg.GetProfileString(SEC_GREP,_T("FindCombo"),tempStr,""); + tempArr.RemoveAll(); + msc.ReturnDelimitedArray(comboStr,_T("|"),tempArr); + int y = tempArr.GetSize(); + + for(int i=0;i<y;i++) + { + m_findcombo.AddString(tempArr.GetAt(i)); + } + + comboStr = m_reg.GetProfileString(SEC_GREP,_T("ReplaceCombo"),tempStr,""); + tempArr.RemoveAll(); + msc.ReturnDelimitedArray(comboStr,_T("|"),tempArr); + y = tempArr.GetSize(); + + for(i=0;i<y;i++) + { + m_replacecombo.AddString(tempArr.GetAt(i)); + } + + comboStr = m_reg.GetProfileString(SEC_GREP,_T("LastFind"),tempStr,""); + m_findcombo.SetWindowText(comboStr); + + m_check1.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck1"),0 )); + m_check2.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck2"),0 )); + m_check3.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck3"),0 )); + m_check4.SetCheck(m_reg.GetProfileInt(SEC_GREP,_T("FCheck4"),0 )); + m_down.SetCheck(1); ! ! if(!inifind.IsEmpty()) ! { ! m_findcombo.SetWindowText(inifind); ! } ! ! DWORD dwSel; ! ! // Set the selection to be all characters after the current selection. ! if ((dwSel=m_findcombo.GetEditSel()) != CB_ERR) ! { ! m_findcombo.SetEditSel(HIWORD(dwSel), -1); ! } ! m_findcombo.SetFocus(); ! return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } + LPCSTR RemoveBackslash(LPCSTR str) + { + CString tstr = str; + CString retstr; + int tstr_len = tstr.GetLength(); + for(int i=0;i<tstr_len;i++) + { + if(tstr[i]=='\\') + { + if(i<tstr_len) + { + i++; + switch(tstr[i]) + { + case 'a': + retstr+='\a'; + break; + case 't': + retstr+='\t'; + break; + case 'b': + retstr+='\b'; + break; + case 'f': + retstr+='\f'; + break; + case 'n': + retstr+='\n'; + break; + case 'r': + retstr+='\r'; + break; + case 'v': + retstr+='\v'; + break; + + default: + retstr+='\\'; + retstr+=tstr[i]; + } + } + + }else retstr += tstr[i]; + } + return retstr; + } + void CFindReplace::OnReplace() { *************** *** 116,120 **** return; } ! m_scintilla->ReplaceSel(str); OnFindnext(); --- 209,225 ---- return; } ! ! if(m_check4.GetCheck()) ! { ! str = RemoveBackslash(str); ! } ! ! if(m_check3.GetCheck()) ! { ! m_scintilla->ReplaceTargetRE(str.GetLength(),str); ! }else m_scintilla->ReplaceTarget(str.GetLength(),str); ! ! if(m_replacecombo.FindStringExact(0,str)==CB_ERR) ! m_replacecombo.AddString(str); OnFindnext(); *************** *** 166,174 **** { if(m_findcombo.FindStringExact(0,strText)==CB_ERR) m_findcombo.AddString(strText); long stpos = m_scintilla->GetTargetStart(); long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! m_scintilla->ReplaceSel(str); int tint = endpos - stpos; newpos+= tint -str.GetLength(); --- 271,295 ---- { if(m_findcombo.FindStringExact(0,strText)==CB_ERR) + { m_findcombo.AddString(strText); + SaveToRegistry(); + } long stpos = m_scintilla->GetTargetStart(); long endpos = m_scintilla->GetTargetEnd(); m_scintilla->SetSel(stpos,endpos); ! ! if(m_check4.GetCheck()) ! { ! str = RemoveBackslash(str); ! } ! ! ! if(m_check3.GetCheck()) ! { ! m_scintilla->ReplaceTargetRE(str.GetLength(),str); ! }else m_scintilla->ReplaceTarget(str.GetLength(),str); ! if(m_replacecombo.FindStringExact(0,str)==CB_ERR) ! m_replacecombo.AddString(str); ! int tint = endpos - stpos; newpos+= tint -str.GetLength(); *************** *** 187,189 **** --- 308,351 ---- OnReplaceall(); replaceinsel = FALSE; + } + + void CFindReplace::SaveToRegistry() + { + CString tempStr; + m_findcombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); + + tempStr.Empty(); + int y=m_findcombo.GetCount(); + if(y>11) + y=11; + CString lbStr; + for(int i=0;i<y;i++) + { + m_findcombo.GetLBText(i,lbStr); + tempStr+= lbStr+_T("|"); + } + + m_reg.WriteProfileString(SEC_GREP,_T("FindCombo"),tempStr); + + y=m_replacecombo.GetCount(); + if(y>11) + y=11; + lbStr.Empty(); + tempStr.Empty(); + for(int ii=0;ii<y;ii++) + { + m_findcombo.GetLBText(ii,lbStr); + tempStr+= lbStr+_T("|"); + } + + m_reg.WriteProfileString(SEC_GREP,_T("ReplaceCombo"),tempStr); + + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck1"),m_check1.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck2"),m_check2.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck3"),m_check3.GetCheck()); + m_reg.WriteProfileInt(SEC_GREP,_T("FCheck4"),m_check4.GetCheck()); + + m_findcombo.GetWindowText(tempStr); + m_reg.WriteProfileString(SEC_GREP,_T("LastFind"),tempStr); } Index: FindReplace.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindReplace.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FindReplace.h 8 May 2003 12:00:56 -0000 1.3 --- FindReplace.h 18 Nov 2003 04:09:50 -0000 1.4 *************** *** 9,13 **** #include "scintillaif.h" ! ///////////////////////////////////////////////////////////////////////////// // CFindReplace dialog --- 9,14 ---- #include "scintillaif.h" ! #include "RegProfile.h" ! #include "Misc.h" ///////////////////////////////////////////////////////////////////////////// // CFindReplace dialog *************** *** 21,25 **** // Dialog Data //{{AFX_DATA(CFindReplace) ! enum { IDD = IDD_FIND_REPLACE }; CButton m_find; CButton m_repl; --- 22,27 ---- // Dialog Data //{{AFX_DATA(CFindReplace) ! enum { IDD = IDD_FIND_REPLACE }; ! CButton m_check4; CButton m_find; CButton m_repl; *************** *** 31,35 **** CComboBox m_replacecombo; CComboBox m_findcombo; ! //}}AFX_DATA --- 33,37 ---- CComboBox m_replacecombo; CComboBox m_findcombo; ! //}}AFX_DATA *************** *** 43,48 **** --- 45,54 ---- protected: CScintilla * m_scintilla; + CRegProfile m_reg; + CMisc msc; + CString inifind; // Implementation protected: + void SaveToRegistry(); // Generated message map functions Index: ToDo.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ToDo.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ToDo.txt 18 Jul 2003 04:18:13 -0000 1.17 --- ToDo.txt 18 Nov 2003 04:09:50 -0000 1.18 *************** *** 14,18 **** 2) A Very good plugin architecture... possibly with events and configurable menu items 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error ! --- 14,18 ---- 2) A Very good plugin architecture... possibly with events and configurable menu items 3) Error handling facilities.. Marking errors, warnings and taking to a line on clicking error ! 4) Save find replace options and contents in registry. *************** *** 123,126 **** --- 123,139 ---- Bug Fixes ========= + + [ 799649 ] crash on lines > 2510 chars. During an enter after 2510 chars... + + [ 799171 ] file modif checking doesn't handle file deletion properly + When an opened file is deleted from outside AE, AE + notifies a change (whereas it should notify a deletion) + several times (whereas it should do it once only) + proposing to reload it (whereas it should propose to + close it) ! + + [ 798524 ] Auto indentation setting error + + - There is a problem with the "Auto Indentation Style" |