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 --- |