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: Leon W. <moo...@us...> - 2005-10-17 17:36:53
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6048 Modified Files: ScintillaEx.cpp ScintillaEx.h Log Message: Fixed bookmark handling, so Find->BookmarkAll works. Index: ScintillaEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ScintillaEx.cpp 16 Oct 2005 12:23:22 -0000 1.27 --- ScintillaEx.cpp 17 Oct 2005 17:36:45 -0000 1.28 *************** *** 50,53 **** --- 50,54 ---- m_bSaveConvertTabToSpaces = false; m_bSaveTrimTrailingSpaces = false; + m_iBookmarkCount = 0; m_lastPosCallTip = 0; m_Api = NULL; *************** *** 464,468 **** bool CScintillaEx::HasBookmarks(void) { ! return !dqBookmarks.empty(); } --- 465,469 ---- bool CScintillaEx::HasBookmarks(void) { ! return m_iBookmarkCount != 0; } *************** *** 473,504 **** { MarkerDelete( lLine, SC_BOOKMARK ); // Check if all the handles are still valid. - if( !dqBookmarks.empty() ) - { - std::deque<int>::iterator pos; - pos = dqBookmarks.begin(); - while( pos < dqBookmarks.end() ) - { - if( -1 == MarkerLineFromHandle( *pos ) ) - { - pos = dqBookmarks.erase( pos ); - } - else - { - ++ pos; - } - } - } } else { ! dqBookmarks.push_back( MarkerAdd( lLine, SC_BOOKMARK ) ); } } ! void CScintillaEx::ClearBookmarks() { ! MarkerDeleteAll( SC_BOOKMARK ); ! dqBookmarks.clear(); } --- 474,502 ---- { MarkerDelete( lLine, SC_BOOKMARK ); + m_iBookmarkCount --; // Check if all the handles are still valid. } else { ! m_iBookmarkCount ++; } } ! int CScintillaEx::MarkerAdd(int line, int markerNumber) { ! m_iBookmarkCount ++; ! return (int)SPerform(SCI_MARKERADD, (long)line, (long)markerNumber); ! } ! ! void CScintillaEx::MarkerDelete(int line, int markerNumber) ! { ! m_iBookmarkCount --; ! SPerform(SCI_MARKERDELETE, (long)line, (long)markerNumber); ! } ! ! void CScintillaEx::MarkerDeleteAll(int markerNumber) ! { ! m_iBookmarkCount = 0; ! SPerform(SCI_MARKERDELETEALL, (long)markerNumber, 0); } Index: ScintillaEx.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ScintillaEx.h 16 Oct 2005 12:23:23 -0000 1.19 --- ScintillaEx.h 17 Oct 2005 17:36:45 -0000 1.20 *************** *** 125,129 **** bool HasBookmarks(void); void ToggleBookmark(long lLine); ! void ClearBookmarks(void); void FirstBookmark(void); void LastBookmark(void); --- 125,140 ---- bool HasBookmarks(void); void ToggleBookmark(long lLine); ! /** ! * Add a marker to a line, returning an ID which can be used to find or delete the marker. ! */ ! int MarkerAdd(int line, int markerNumber); ! /** ! * Delete a marker from a line. ! */ ! void MarkerDelete(int line, int markerNumber); ! /** ! * Delete all markers with a particular number from all lines. ! */ ! void MarkerDeleteAll(int markerNumber); void FirstBookmark(void); void LastBookmark(void); *************** *** 201,206 **** CStringArray m_saBlockComment; ! /// The deque to store the bookmark handles ! std::deque<int> dqBookmarks; public: CString SelectionURL(int pos); --- 212,217 ---- CStringArray m_saBlockComment; ! /// Bookmark reference counter ! int m_iBookmarkCount; public: CString SelectionURL(int pos); |
From: Leon W. <moo...@us...> - 2005-10-17 17:21:54
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3114 Modified Files: FindDialog.cpp Log Message: Bugfix: Find dialog didn't find all occurences for bookmarking. Index: FindDialog.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindDialog.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FindDialog.cpp 12 Oct 2005 18:55:57 -0000 1.17 --- FindDialog.cpp 17 Oct 2005 17:21:42 -0000 1.18 *************** *** 136,140 **** if(!m_strFindInitial.IsEmpty()) ! m_cmbFind.SetWindowText(m_strFindInitial); // Set the selection to be all characters after the current selection. --- 136,143 ---- if(!m_strFindInitial.IsEmpty()) ! { ! m_cmbFind.InsertString(0,m_strFindInitial); ! } ! m_cmbFind.SetCurSel(0); // Set the selection to be all characters after the current selection. *************** *** 176,180 **** pMgr->AddFindString(strFind); ! m_pScintilla->SetCurrentPos(0); long nPosFind = pMgr->Find(m_pScintilla); --- 179,183 ---- pMgr->AddFindString(strFind); ! m_pScintilla->SetSel(0,0); long nPosFind = pMgr->Find(m_pScintilla); *************** *** 200,204 **** nPosFind = pMgr->Find(m_pScintilla); } ! m_pScintilla->SetCurrentPos(nCurrentPos); } } --- 203,208 ---- nPosFind = pMgr->Find(m_pScintilla); } ! m_pScintilla->SetSel(nCurrentPos,nCurrentPos); ! CDialog::OnOK(); } } |
From: Leon W. <moo...@us...> - 2005-10-17 17:19:06
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2490 Modified Files: OutputEdit.cpp Log Message: Fixed adding lines to OutputEdit. It now scrolls without jumping to the start of the EditBox. Index: OutputEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputEdit.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OutputEdit.cpp 12 Oct 2005 18:55:57 -0000 1.9 --- OutputEdit.cpp 17 Oct 2005 17:18:59 -0000 1.10 *************** *** 67,75 **** { CString szCurrentText; GetWindowText(szCurrentText); ! if( !szCurrentText.IsEmpty() ) szCurrentText += "\r\n"; ! szCurrentText += lpszNewStr; ! SetWindowText(szCurrentText); ! SetSel(szCurrentText.GetLength()+1,szCurrentText.GetLength()+1); } --- 67,90 ---- { CString szCurrentText; + + // Construct the new line with EOL + szCurrentText = lpszNewStr; + szCurrentText += "\r\n"; + + // This trick prevents the jump to the first + // line in when Setting the Window Text. We + // paste the text from the Clipboard at the + // end of the Edit box. + CopyStrToClipboard(szCurrentText); + Paste(); + // TODO: Is there a way to save the clipboard content? + EmptyClipboard(); + + // Set the new text of the Edit box. GetWindowText(szCurrentText); ! ! // Scroll the Editbox, so the last line is visible. ! int length = szCurrentText.GetLength(); ! SetSel(length,length); } |
From: Leon W. <moo...@us...> - 2005-10-17 17:17:38
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2108 Modified Files: MainFrm.cpp Log Message: Bug-fix: UserImages path wasn't correctly resolved when starting from associated files. Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** MainFrm.cpp 5 Apr 2005 08:20:20 -0000 1.78 --- MainFrm.cpp 17 Oct 2005 17:17:29 -0000 1.79 *************** *** 162,166 **** // Load toolbar user images: //-------------------------- ! if (!m_UserImages.Load (_T(".\\UserImages.bmp"))) { TRACE(_T("Failed to load user images\n")); --- 162,166 ---- // Load toolbar user images: //-------------------------- ! if (!m_UserImages.Load (_T(theApp.GetAppPath() + "UserImages.bmp"))) { TRACE(_T("Failed to load user images\n")); |
From: Leon W. <moo...@us...> - 2005-10-17 17:16:17
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1790 Modified Files: ClipTree.cpp Log Message: Bug-fix: Crash when Tabpage wasn't visible at startup. Index: ClipTree.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ClipTree.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClipTree.cpp 7 Jun 2004 09:23:44 -0000 1.5 --- ClipTree.cpp 17 Oct 2005 17:16:05 -0000 1.6 *************** *** 70,74 **** if(loadedList) return; ! DeleteAllItems(); CStringArray arr; --- 70,74 ---- if(loadedList) return; ! if( m_hWnd != NULL ) DeleteAllItems(); CStringArray arr; |
From: Leon W. <moo...@us...> - 2005-10-17 17:14:55
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1371 Modified Files: CreditStatic.cpp Log Message: Bug-fix: Removed crash in Release version, because of ommited ASSERT line. Index: CreditStatic.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/CreditStatic.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CreditStatic.cpp 12 Oct 2005 18:55:57 -0000 1.5 --- CreditStatic.cpp 17 Oct 2005 17:14:46 -0000 1.6 *************** *** 941,945 **** if(TimerOn) ! ASSERT(KillTimer(DISPLAY_TIMER_ID)); } --- 941,948 ---- if(TimerOn) ! { ! int result = KillTimer(DISPLAY_TIMER_ID); ! ASSERT(result); ! } } |
From: boca4711 <boc...@us...> - 2005-10-16 12:30:19
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24022 Modified Files: AnyEdit.rc resource.h Log Message: - Modified menus - Added new accelarators - Modifed font and color pref - Added date dialog - Added file property dialog Index: resource.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/resource.h,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** resource.h 5 Apr 2005 08:20:21 -0000 1.75 --- resource.h 16 Oct 2005 12:30:05 -0000 1.76 *************** *** 112,115 **** --- 112,117 ---- #define IDH_STARTUP 109 #define IDR_REPLACE_PATTERN 110 + #define IDD_DATEDIALOG 111 + #define IDD_EDIT_FILE_PROPPAGE4 138 #define IDC_IN_SELECTION 1000 #define IDC_EDIT_DUMPDLG_DATA 1001 *************** *** 376,380 **** --- 378,418 ---- #define IDC_BUTTON_SUB_100 1260 #define IDC_BUTTON_SUB_10 1261 + #define IDC_CHECK_EOL_FILLED 1261 + #define IDC_COMBO_CASE 1262 + #define IDC_STATIC_HEADING 1263 + #define IDC_DATEDIALOG_LIST 1264 + #define IDC_BUTTON_DATE_DEFAULT 1265 + #define IDC_EDIT_FILENAME 1267 + #define IDC_TOUCH 1268 #define ID_AE_REFRESH_STARTUPPAGE 1340 + #define IDD_EDIT_FILE_PROPPAGE1 8410 + #define IDD_EDIT_FILE_PROPPAGE2 8411 + #define IDD_EDIT_FILE_PROPPAGE3 8412 + #define IDC_EDIT_TEXT 8440 + #define IDC_EDIT_COUNT_ALL 8457 + #define IDC_EDIT_RADIO1 8500 + #define IDC_EDIT_RADIO2 8501 + #define IDC_EDIT_RADIO3 8502 + #define IDC_EDIT_RADIO4 8503 + #define IDC_EDIT_LANGUAGE 8516 + #define IDC_EDIT_TIME 8538 + #define IDC_EDIT_TIME_OPTIONS 8541 + #define IDC_EDIT_DATE_OPTIONS 8542 + #define IDC_EDIT_ENCODING 8544 + #define IDC_EDIT_SAVEDDATE 8548 + #define IDC_EDIT_FILESIZE 8549 + #define IDC_EDIT_TABSIZE 8550 + #define IDC_EDIT_INDENTSIZE 8551 + #define IDC_EDIT_DESCRIPTION 8552 + #define ID_EDIT_ADV_ENCODING 8554 + #define IDC_EDIT_TOUCH 8556 + #define IDC_EDIT_DEFAULTS 8559 + #define IDC_EDIT_CLR_FOREGND 8566 + #define IDC_EDIT_CLR_BACKGND 8567 + #define IDC_EDIT_LINEMARKS 8570 + #define IDC_EDIT_SPIN1 8599 + #define IDC_EDIT_SPIN2 8600 + #define IDC_EDIT_CRLF_STYLE 8606 + #define IDC_EDIT_WHOLE_WORD 8612 #define ID_EDIT_FIRST 32768 #define ID_INDICATOR_LINECOL 32771 *************** *** 650,653 **** --- 688,707 ---- #define ID_EXTRAS_OPEN_FILE 33041 #define ID_CLASSVIEW_UPDATE 33042 + #define ID_TOOLS_CALLTIP 33043 + #define ID_SEARCH_JUMP_TO_LAST_CHANGE 33044 + #define ID_EDIT_INSERT_FILENAME 33045 + #define ID_EDIT_INSERT_FILENAME_WITH_PATH 33046 + #define ID_EDIT_INSERT_PATH 33047 + #define ID_EDIT_INSERT_DATE_TIME 33048 + #define ID_EDIT_INSERT_DATE 33050 + #define ID_EDIT_INSERT_GUID 33051 + #define ID_EDIT_TAB 33052 + #define ID_EDIT_FORMAT_JOIN 33053 + #define ID_EDIT_FORMAT_SPLIT 33054 + #define ID_EDIT_FORMAT_NORMALIZE 33055 + #define ID_EDIT_FORMAT_LEFT 33056 + #define ID_EDIT_FORMAT_RIGHT 33057 + #define ID_EDIT_FORMAT_CENTER 33058 + #define ID_EDIT_FORMAT_BLOCK 33059 #define ID_EDIT_LAST 59999 #define ID_MENU_LANGUAGE 60000 *************** *** 658,664 **** #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 110 ! #define _APS_NEXT_COMMAND_VALUE 33043 ! #define _APS_NEXT_CONTROL_VALUE 1261 #define _APS_NEXT_SYMED_VALUE 1341 #endif --- 712,718 ---- #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 114 ! #define _APS_NEXT_COMMAND_VALUE 33060 ! #define _APS_NEXT_CONTROL_VALUE 1269 #define _APS_NEXT_SYMED_VALUE 1341 #endif Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** AnyEdit.rc 8 May 2005 10:54:18 -0000 1.120 --- AnyEdit.rc 16 Oct 2005 12:30:05 -0000 1.121 *************** *** 14,18 **** ///////////////////////////////////////////////////////////////////////////// ! // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) --- 14,18 ---- ///////////////////////////////////////////////////////////////////////////// ! // Englisch (USA) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) *************** *** 263,266 **** --- 263,284 ---- MENUITEM "Select &All\tCtrl+A", ID_EDIT_SELECTALL END + POPUP "Insert" + BEGIN + MENUITEM "Insert Filename...", ID_EDIT_INSERT_FILENAME + MENUITEM "Insert Filename With Path...", + ID_EDIT_INSERT_FILENAME_WITH_PATH + + MENUITEM "Insert Path...", ID_EDIT_INSERT_PATH + MENUITEM SEPARATOR + MENUITEM "Insert Date", ID_EDIT_INSERT_DATE + MENUITEM "Insert Date/Time...", ID_EDIT_INSERT_DATE_TIME + MENUITEM SEPARATOR + MENUITEM "Insert GUID", ID_EDIT_INSERT_GUID + MENUITEM SEPARATOR + MENUITEM "Insert &File...", ID_EDIT_ADVANCED_INSERTFILE + + MENUITEM "Insert &Text Into Lines...", ID_EDIT_ADVANCED_INSERT_TEXT_INTO_LINES + + END MENUITEM SEPARATOR POPUP "F&ormat" *************** *** 287,290 **** --- 305,317 ---- MENUITEM "T&rim Trailing Spaces", ID_EDIT_FORMAT_TRIMTRAILINGSPACES + MENUITEM SEPARATOR + MENUITEM "&Join", ID_EDIT_FORMAT_JOIN + MENUITEM "S&plit", ID_EDIT_FORMAT_SPLIT + MENUITEM "&Normalize", ID_EDIT_FORMAT_NORMALIZE + MENUITEM SEPARATOR + MENUITEM "Justify &Left", ID_EDIT_FORMAT_LEFT + MENUITEM "Justify &Right", ID_EDIT_FORMAT_RIGHT + MENUITEM "Justify &Center", ID_EDIT_FORMAT_CENTER + MENUITEM "Block Aligned", ID_EDIT_FORMAT_BLOCK END POPUP "C&hange Case" *************** *** 318,327 **** MENUITEM "Num Minus\tCtrl + PgDown", ID_MACROHELPER_NUMMINUS MENUITEM SEPARATOR - MENUITEM "Insert &File...", ID_EDIT_ADVANCED_INSERTFILE - MENUITEM "Sa&ve selection...", ID_EDIT_ADVANCED_SAVE_SELECTION - MENUITEM "Insert &Text Into Lines...", ID_EDIT_ADVANCED_INSERT_TEXT_INTO_LINES - END MENUITEM SEPARATOR --- 345,350 ---- *************** *** 386,389 **** --- 409,415 ---- MENUITEM SEPARATOR MENUITEM "&Go to Line\tCtrl+G", ID_SEARCH_GOTOLINE + MENUITEM "Jump To Last Change\tShift+F5", + ID_SEARCH_JUMP_TO_LAST_CHANGE + MENUITEM "&Quick Jump\tCtrl+J", ID_SEARCH_QUICKJUMP MENUITEM "Next &Tag", ID_SEARCH_NEXTTAG *************** *** 436,439 **** --- 462,466 ---- MENUITEM "&Auto Complete Editor", ID_CONFIGURE_AUTOCOMPLETEEDITOR + MENUITEM "Show Calltip", ID_TOOLS_CALLTIP MENUITEM SEPARATOR MENUITEM "&Sort...", ID_TOOLS_SORT *************** *** 521,524 **** --- 548,569 ---- MENUITEM "Select &All\tCtrl+A", ID_EDIT_SELECTALL END + POPUP "Insert" + BEGIN + MENUITEM "Insert Filename...", ID_EDIT_INSERT_FILENAME + MENUITEM "Insert Filename With Path...", + ID_EDIT_INSERT_FILENAME_WITH_PATH + + MENUITEM "Insert Path...", ID_EDIT_INSERT_PATH + MENUITEM SEPARATOR + MENUITEM "Insert Date", ID_EDIT_INSERT_DATE + MENUITEM "Insert Date/Time...", ID_EDIT_INSERT_DATE_TIME + MENUITEM SEPARATOR + MENUITEM "Insert GUID", ID_EDIT_INSERT_GUID + MENUITEM SEPARATOR + MENUITEM "Insert &File...", ID_EDIT_ADVANCED_INSERTFILE + + MENUITEM "Insert &Text Into Lines...", ID_EDIT_ADVANCED_INSERT_TEXT_INTO_LINES + + END MENUITEM SEPARATOR POPUP "F&ormat" *************** *** 545,548 **** --- 590,602 ---- MENUITEM "T&rim Trailing Spaces", ID_EDIT_FORMAT_TRIMTRAILINGSPACES + MENUITEM SEPARATOR + MENUITEM "&Join", ID_EDIT_FORMAT_JOIN + MENUITEM "S&plit", ID_EDIT_FORMAT_SPLIT + MENUITEM "&Normalize", ID_EDIT_FORMAT_NORMALIZE + MENUITEM SEPARATOR + MENUITEM "Justify &Left", ID_EDIT_FORMAT_LEFT + MENUITEM "Justify &Right", ID_EDIT_FORMAT_RIGHT + MENUITEM "Justify &Center", ID_EDIT_FORMAT_CENTER + MENUITEM "Block Aligned", ID_EDIT_FORMAT_BLOCK END POPUP "C&hange Case" *************** *** 576,582 **** MENUITEM "Num Minus\tCtrl + PgDown", ID_MACROHELPER_NUMMINUS MENUITEM SEPARATOR ! MENUITEM "Insert &File...", ID_EDIT_ADVANCED_INSERTFILE ! ! MENUITEM "Insert &Text Into Lines...", ID_EDIT_ADVANCED_INSERT_TEXT_INTO_LINES END --- 630,634 ---- MENUITEM "Num Minus\tCtrl + PgDown", ID_MACROHELPER_NUMMINUS MENUITEM SEPARATOR ! MENUITEM "Sa&ve selection...", ID_EDIT_ADVANCED_SAVE_SELECTION END *************** *** 1337,1340 **** --- 1389,1393 ---- "D", ID_EDIT_ADVANCED_DUPLICATELINE, VIRTKEY, CONTROL, NOINVERT + "D", ID_EDIT_INSERT_DATE, VIRTKEY, ALT, NOINVERT "F", ID_SEARCH_FIND, VIRTKEY, CONTROL, NOINVERT "G", ID_SEARCH_GOTOLINE, VIRTKEY, CONTROL, NOINVERT *************** *** 1381,1384 **** --- 1434,1438 ---- VK_F3, ID_SEARCH_FINDPREVWORD, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_F5, ID_SEARCH_JUMP_TO_LAST_CHANGE, VIRTKEY, SHIFT, NOINVERT VK_F9, ID_TOOLS_SORT, VIRTKEY, NOINVERT VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT *************** *** 1390,1393 **** --- 1444,1448 ---- NOINVERT VK_SUBTRACT, ID_VIEW_ZOOMLEVEL_ZOOMOUT, VIRTKEY, CONTROL, NOINVERT + VK_TAB, ID_EDIT_TAB, VIRTKEY, NOINVERT "X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT "Y", ID_EDIT_REDO, VIRTKEY, CONTROL, NOINVERT *************** *** 1525,1551 **** FONT 8, "MS Sans Serif" BEGIN ! EDITTEXT IDC_EDIT_FONTNAME,24,34,142,13,ES_AUTOHSCROLL ! EDITTEXT IDC_EDIT_FONTSIZE,174,34,69,13,ES_AUTOHSCROLL ! LISTBOX IDC_LIST_FONTNAME,24,49,142,78,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP ! LISTBOX IDC_LIST_FONTSIZE,174,49,69,78,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP ! GROUPBOX "",IDC_STATIC,175,131,69,41 CONTROL "Bold",IDC_CHECK_BOLD,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,181,138,30,9 CONTROL "Italic",IDC_CHECK_ITALIC,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,181,149,30,10 CONTROL "Underline",IDC_CHECK_UNDERLINE,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,181,160,46,9 ! GROUPBOX "Sample Text Area",IDC_STATIC,23,131,144,41 ! CTEXT "Sample Text",IDC_SAMPLE_TEXT,29,141,132,26, SS_CENTERIMAGE | SS_SUNKEN ! COMBOBOX IDC_COMBO_STYLE,46,17,120,96,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "Style",IDC_STATIC_STYLE,26,18,16,9 ! PUSHBUTTON "Apply to all Styles",IDC_BUTTON_TOALLSTYLES,174,16,70, ! 14 END --- 1580,1608 ---- FONT 8, "MS Sans Serif" BEGIN ! EDITTEXT IDC_EDIT_FONTNAME,25,25,142,13,ES_AUTOHSCROLL ! EDITTEXT IDC_EDIT_FONTSIZE,175,25,69,13,ES_AUTOHSCROLL ! LISTBOX IDC_LIST_FONTNAME,25,40,142,78,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP ! LISTBOX IDC_LIST_FONTSIZE,175,40,69,78,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP ! GROUPBOX "",IDC_STATIC,176,122,69,41 CONTROL "Bold",IDC_CHECK_BOLD,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,182,129,30,9 CONTROL "Italic",IDC_CHECK_ITALIC,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,182,140,30,10 CONTROL "Underline",IDC_CHECK_UNDERLINE,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,182,151,46,9 ! GROUPBOX "Sample Text Area",IDC_STATIC,24,122,144,41 ! CTEXT "Sample Text",IDC_SAMPLE_TEXT,30,132,132,26, SS_CENTERIMAGE | SS_SUNKEN ! COMBOBOX IDC_COMBO_STYLE,47,8,120,96,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "Style",IDC_STATIC_STYLE,27,9,16,9 ! PUSHBUTTON "Apply to all Styles",IDC_BUTTON_TOALLSTYLES,175,7,70,14 ! COMBOBOX IDC_COMBO_CASE,64,168,104,46,CBS_DROPDOWN | WS_VSCROLL | ! WS_TABSTOP ! LTEXT "Case",IDC_STATIC,24,170,17,8 END *************** *** 1554,1567 **** FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN ! PUSHBUTTON "Button1",IDC_CBUTTON_FORE,143,33,127,13 ! LTEXT "Foreground Color",IDC_STATIC,143,22,100,9 ! LTEXT "Background Color",IDC_STATIC,143,57,74,9 ! PUSHBUTTON "Button2",IDC_CBUTTON_BACK,144,68,126,13 ! GROUPBOX "Sample Editor Area",IDC_STATIC,144,85,126,54 ! LISTBOX IDC_EDIT_LIST,12,22,119,136,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,WS_EX_CLIENTEDGE ! PUSHBUTTON "Reset All Colors",IDC_BUTTON_RESETCOLORS,153,145,107,12 ! CTEXT "Sample Text",IDC_SAMPLE_TEXT,154,97,105,33, SS_CENTERIMAGE | SS_SUNKEN END --- 1611,1626 ---- FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN ! PUSHBUTTON "Button1",IDC_CBUTTON_FORE,143,29,127,13 ! LTEXT "Foreground Color",IDC_STATIC,143,18,100,9 ! LTEXT "Background Color",IDC_STATIC,143,50,74,9 ! PUSHBUTTON "Button2",IDC_CBUTTON_BACK,144,61,126,13 ! GROUPBOX "Sample Editor Area",IDC_STATIC,144,98,126,54 ! LISTBOX IDC_EDIT_LIST,7,19,119,151,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,WS_EX_CLIENTEDGE ! PUSHBUTTON "Reset All Colors",IDC_BUTTON_RESETCOLORS,153,158,107,12 ! CTEXT "Sample Text",IDC_SAMPLE_TEXT,154,110,105,33, SS_CENTERIMAGE | SS_SUNKEN + CONTROL "Filled to end of line",IDC_CHECK_EOL_FILLED,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,144,82,126,10 END *************** *** 1779,1783 **** STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Input" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Static",IDC_HEADER,3,3,197,11 --- 1838,1842 ---- STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Input" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Static",IDC_HEADER,3,3,197,11 *************** *** 1826,1830 **** 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 --- 1885,1889 ---- 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 *************** *** 2027,2032 **** FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "Go",IDOK,7,52,50,14 - PUSHBUTTON "Cancel",IDCANCEL,66,52,50,14 EDITTEXT IDC_EDIT_GOTO,39,28,41,14,ES_RIGHT | ES_AUTOHSCROLL CONTROL "Spin1",IDC_SPIN_GOTO,"msctls_updown32",UDS_SETBUDDYINT | --- 2086,2089 ---- *************** *** 2037,2040 **** --- 2094,2099 ---- PUSHBUTTON "-100",IDC_BUTTON_SUB_100,63,7,25,14 PUSHBUTTON "-10",IDC_BUTTON_SUB_10,91,7,25,14 + DEFPUSHBUTTON "Go",IDOK,7,52,50,14 + PUSHBUTTON "Cancel",IDCANCEL,66,52,50,14 END *************** *** 2173,2177 **** BEGIN LTEXT "Do you wish to save the file?",IDC_STATIC,101,13,92,8 ! ICON "",IDC_QUESTION,252,7,21,20 DEFPUSHBUTTON "&Yes",IDYES,7,32,50,14 PUSHBUTTON "&No",IDNO,65,32,50,14 --- 2232,2236 ---- BEGIN LTEXT "Do you wish to save the file?",IDC_STATIC,101,13,92,8 ! ICON "",IDC_QUESTION,23,7,21,20 DEFPUSHBUTTON "&Yes",IDYES,7,32,50,14 PUSHBUTTON "&No",IDNO,65,32,50,14 *************** *** 2256,2259 **** --- 2315,2418 ---- END + IDD_DATEDIALOG DIALOG DISCARDABLE 0, 0, 185, 112 + STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU + CAPTION "Date and Time" + FONT 8, "MS Sans Serif" + BEGIN + LTEXT "&Available formats:",IDC_STATIC_HEADING,7,7,111,8,NOT + WS_GROUP + LISTBOX IDC_DATEDIALOG_LIST,7,17,113,87,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,127,17,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,34,50,14 + PUSHBUTTON "&Default",IDC_BUTTON_DATE_DEFAULT,127,90,50,14 + END + + IDD_EDIT_FILE_PROPPAGE4 DIALOG DISCARDABLE 0, 0, 280, 112 + STYLE DS_MODALFRAME | WS_CHILD | WS_CAPTION + CAPTION "Touch" + FONT 8, "MS Sans Serif" + BEGIN + PUSHBUTTON "Touch",IDC_EDIT_TOUCH,217,66,52,14 + GROUPBOX "File Date and Time:",IDC_STATIC,4,2,271,46 + CONTROL "Created",IDC_EDIT_RADIO1,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,93,14,41,10 + CONTROL "Modified",IDC_EDIT_RADIO2,"Button",BS_AUTORADIOBUTTON, + 147,14,41,10 + CONTROL "Accessed",IDC_EDIT_RADIO3,"Button",BS_AUTORADIOBUTTON, + 201,14,47,10 + CTEXT "Current Time",IDC_EDIT_DEFAULTS,13,30,254,8 + GROUPBOX "New Date and Time",IDC_STATIC,4,54,271,33 + LTEXT "Date:",IDC_STATIC,10,70,17,8 + CONTROL "DateTimePicker1",IDC_EDIT_DATE_OPTIONS, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_APPCANPARSE | + WS_TABSTOP,30,66,86,15 + LTEXT "Time:",IDC_STATIC,122,70,17,8 + CONTROL "DateTimePicker2",IDC_EDIT_TIME_OPTIONS, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | + DTS_APPCANPARSE | WS_TABSTOP | 0x8,143,66,64,15 + RTEXT "Watch",IDC_EDIT_TIME,61,96,209,9 + PUSHBUTTON "Touch",IDC_TOUCH,4,92,50,14 + END + + IDD_EDIT_FILE_PROPPAGE2 DIALOG DISCARDABLE 0, 0, 280, 112 + STYLE WS_CHILD | WS_CAPTION + CAPTION "Word Count" + FONT 8, "MS Sans Serif" + BEGIN + LTEXT "Number of Lines:",IDC_STATIC,5,25,114,8 + LTEXT "Number of Words:",IDC_STATIC,5,38,114,8 + LTEXT "Number of Characters (non-space):",IDC_STATIC,5,51,114, + 8 + LTEXT "Total Number of Characters:",IDC_STATIC,5,64,114,8 + CONTROL "info",IDC_EDIT_LINEMARKS,"Static",SS_LEFTNOWORDWRAP | + WS_GROUP,125,25,44,8 + CONTROL "info",IDC_EDIT_WHOLE_WORD,"Static",SS_LEFTNOWORDWRAP | + WS_GROUP,125,38,44,8 + CONTROL "info",IDC_EDIT_TEXT,"Static",SS_LEFTNOWORDWRAP | + WS_GROUP,125,51,44,8 + CONTROL "info",IDC_EDIT_COUNT_ALL,"Static",SS_LEFTNOWORDWRAP | + WS_GROUP,125,64,44,8 + LTEXT "For the selected text",IDC_EDIT_CLR_FOREGND,184,11,84,8 + LTEXT "For the whole document",IDC_EDIT_CLR_BACKGND,79,10,96,8 + LTEXT "Info",IDC_EDIT_RADIO1,213,25,44,8 + LTEXT "Info",IDC_EDIT_RADIO2,213,38,44,8 + LTEXT "Info",IDC_EDIT_RADIO3,213,51,44,8 + LTEXT "Info",IDC_EDIT_RADIO4,213,64,44,8 + END + + IDD_EDIT_FILE_PROPPAGE1 DIALOGEX 0, 0, 280, 112 + STYLE WS_CHILD | WS_CAPTION + CAPTION "General" + FONT 8, "MS Sans Serif", 0, 0, 0x1 + BEGIN + COMBOBOX IDC_EDIT_LANGUAGE,58,24,164,180,CBS_DROPDOWNLIST | + CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + LTEXT "File name:",IDC_STATIC,8,8,34,8 + LTEXT "Language:",IDC_STATIC,8,24,34,12,SS_CENTERIMAGE + LTEXT "Saved:",IDC_STATIC,8,66,34,8 + LTEXT "?",IDC_EDIT_SAVEDDATE,48,66,145,8 + LTEXT "Size:",IDC_STATIC,8,81,34,8 + LTEXT "-",IDC_EDIT_FILESIZE,48,81,145,8 + LTEXT "Tab size:",IDC_STATIC,198,71,34,8,SS_CENTERIMAGE + LTEXT "Indent size:",IDC_STATIC,198,88,36,8,SS_CENTERIMAGE + EDITTEXT IDC_EDIT_TABSIZE,239,67,27,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_INDENTSIZE,239,85,27,14,ES_AUTOHSCROLL + LTEXT "Line Endings:",IDC_STATIC,8,45,41,12,SS_CENTERIMAGE + COMBOBOX IDC_EDIT_CRLF_STYLE,58,42,164,55,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "Type:",IDC_STATIC,8,95,34,8 + LTEXT "File",IDC_EDIT_DESCRIPTION,48,95,145,8 + ICON "",IDC_EDIT_DEFAULTS,234,27,20,20,SS_NOTIFY + CONTROL "Spin1",IDC_EDIT_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | + UDS_HOTTRACK,259,67,10,14 + CONTROL "Spin1",IDC_EDIT_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | + UDS_HOTTRACK,260,85,10,14 + EDITTEXT IDC_EDIT_FILENAME,48,8,225,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,WS_EX_TRANSPARENT + END + #ifndef _MAC *************** *** 2567,2570 **** --- 2726,2753 ---- BOTTOMMARGIN, 191 END + + IDD_EDIT_FILE_PROPPAGE4, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 275 + TOPMARGIN, 2 + BOTTOMMARGIN, 106 + END + + IDD_EDIT_FILE_PROPPAGE2, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 104 + END + + IDD_EDIT_FILE_PROPPAGE1, DIALOG + BEGIN + LEFTMARGIN, 8 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 105 + END END #endif // APSTUDIO_INVOKED *************** *** 2636,2639 **** --- 2819,2833 ---- END + IDD_PREF_FONT DLGINIT + BEGIN + IDC_COMBO_CASE, 0x403, 6, 0 + 0x694d, 0x6578, 0x0064, + IDC_COMBO_CASE, 0x403, 6, 0 + 0x5055, 0x4550, 0x0052, + IDC_COMBO_CASE, 0x403, 6, 0 + 0x6f6c, 0x6577, 0x0072, + 0 + END + ///////////////////////////////////////////////////////////////////////////// *************** *** 2748,2751 **** --- 2942,2958 ---- ID_EXTRAS_OPEN_FILE "Open document at current cursor position\nOpen Document" ID_CLASSVIEW_UPDATE "Update the Classview\nUpdate the Classview" + ID_TOOLS_CALLTIP "Show calltip if available\nShow Calltip" + ID_SEARCH_JUMP_TO_LAST_CHANGE + "Jumps to last position of change\nJump to last change" + ID_EDIT_INSERT_FILENAME "Insert filename at current position\nInsert filename" + ID_EDIT_INSERT_FILENAME_WITH_PATH + "Insert filename with full path\nInsert Filename With Path" + ID_EDIT_INSERT_PATH "Insert path\nInsert path" + ID_EDIT_INSERT_DATE_TIME "Insert date or time\nInsert Date/Time" + ID_EDIT_INSERT_DATE "Insert Date in default format\nInsert Date" + ID_EDIT_INSERT_GUID "Creates and inserts a GUID\nInsert GUID" + ID_EDIT_FORMAT_JOIN "Join lines to long line\nJoin" + ID_EDIT_FORMAT_SPLIT "Split long line into lines\nSplit" + ID_EDIT_FORMAT_NORMALIZE "Remove double spaces\nNormalize" END *************** *** 3103,3107 **** END ! #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// --- 3310,3322 ---- END ! STRINGTABLE DISCARDABLE ! BEGIN ! ID_EDIT_FORMAT_LEFT "Format block left aligned\nJustify Left" ! ID_EDIT_FORMAT_RIGHT "Format block right aligned\nJustify Right" ! ID_EDIT_FORMAT_CENTER "Fomat block centered\nJustify Center" ! ID_EDIT_FORMAT_BLOCK "Format block block aligned\nBlock Aligned" ! END ! ! #endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// |
From: boca4711 <boc...@us...> - 2005-10-16 12:29:28
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23908 Modified Files: AnyEdit.dsp Log Message: - Added class for folder dialog - Added clas for date dialog - Added class for datetime formatting - Added classes for file property dialog Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** AnyEdit.dsp 30 Nov 2004 19:18:07 -0000 1.75 --- AnyEdit.dsp 16 Oct 2005 12:29:05 -0000 1.76 *************** *** 1702,1705 **** --- 1702,1761 ---- # End Source File # End Group + # Begin Source File + + SOURCE=.\DateDlg.cpp + # End Source File + # Begin Source File + + SOURCE=.\DateDlg.h + # End Source File + # Begin Source File + + SOURCE=.\DateTimeFormat.cpp + # End Source File + # Begin Source File + + SOURCE=.\DateTimeFormat.h + # End Source File + # Begin Source File + + SOURCE=.\FilePropertyDlg.cpp + # End Source File + # Begin Source File + + SOURCE=.\FilePropertyDlg.h + # End Source File + # Begin Source File + + SOURCE=.\FilePropGeneral.cpp + # End Source File + # Begin Source File + + SOURCE=.\FilePropGeneral.h + # End Source File + # Begin Source File + + SOURCE=.\FilePropTouch.cpp + # End Source File + # Begin Source File + + SOURCE=.\FilePropTouch.h + # End Source File + # Begin Source File + + SOURCE=.\FilePropWordCount.cpp + # End Source File + # Begin Source File + + SOURCE=.\FilePropWordCount.h + # End Source File + # Begin Source File + + SOURCE=.\FolderDlg.cpp + # End Source File + # Begin Source File + + SOURCE=.\FolderDlg.h + # End Source File # End Target # End Project |
From: boca4711 <boc...@us...> - 2005-10-16 12:24:52
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23150 Modified Files: SyntaxFile.cpp SyntaxFile.h Log Message: - Added API for calltips - Added autocompletion - Added EOLfilled mode - Added case in keywords Index: SyntaxFile.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/SyntaxFile.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** SyntaxFile.cpp 12 Oct 2005 18:55:57 -0000 1.29 --- SyntaxFile.cpp 16 Oct 2005 12:24:38 -0000 1.30 *************** *** 31,34 **** --- 31,37 ---- #include <iostream> #include <fstream> + #include <io.h> + #include "AnyEdit.h" + #include "Misc.h" #ifdef _DEBUG *************** *** 91,94 **** --- 94,105 ---- KeywordsSpaceDelimited[iCount] = GetDelimitedKeywordSet( iCount, ' ' ); } + sApiFilename = GetApiFilename(); + if (! sApiFilename.IsEmpty()) + { + CMisc msc; + msc.LoadFileToArray(sApiFilename, Api); + // SortStringArray gets CaseSensitive (= !IgnoreCase) + msc.SortStringArray(Api, ! GetCalltipIgnorecase()); + } return m_bParsed = true; *************** *** 240,243 **** --- 251,256 ---- } } + szDelimited.Remove('~'); + return szDelimited; } *************** *** 287,292 **** 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; --- 300,305 ---- 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; *************** *** 753,757 **** } - bool CSyntaxFile::GetStyleFontBold( int iStyle ) { --- 766,769 ---- *************** *** 891,895 **** } - int CSyntaxFile::GetStyleColorForeground( int iStyle ) { --- 903,906 ---- *************** *** 1089,1090 **** --- 1100,1227 ---- return m_bModified = true; } + + CStringArray* CSyntaxFile::GetApi() + { + return &Api; + } + + CString CSyntaxFile::GetApiFilename() + { + CString szApiFilename = GetStringFromXMLFile( TAG_API, TAG_API_FILENAME ); + + if (!szApiFilename.IsEmpty() && _access(szApiFilename, 0) != 0) + { + szApiFilename = theApp.GetAppPath() + "api\\" + szApiFilename; + if (_access(szApiFilename, 0) != 0) + szApiFilename.Empty(); + } + + return szApiFilename; + } + + bool CSyntaxFile::SetApiFilename(CString szApiFilename) + { + return SetStringToXMLFile( TAG_API, TAG_API_FILENAME, szApiFilename, false ); + } + + bool CSyntaxFile::GetCalltipIgnorecase() + { + return GetBoolFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_IGNORECASE); + } + + bool CSyntaxFile::SetCalltipIgnorecase(bool bIgnorecase) + { + return SetBoolToXMLFile(TAG_CALLTIP, TAG_CALLTIP_IGNORECASE, bIgnorecase); + } + + CString CSyntaxFile::GetCalltipWordCharacters() + { + return GetStringFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_WORDCHARACTERS); + } + + bool CSyntaxFile::SetCalltipWordCharacters(CString szWordCharacters) + { + return SetStringToXMLFile(TAG_CALLTIP, TAG_CALLTIP_WORDCHARACTERS, szWordCharacters); + } + + CString CSyntaxFile::GetCalltipParameterStart() + { + return GetStringFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSSTART); + } + + bool CSyntaxFile::SetCalltipParameterStart(CString szStart) + { + return SetStringToXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSSTART, szStart); + } + + CString CSyntaxFile::GetCalltipParameterEnd() + { + return GetStringFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSEND); + } + + bool CSyntaxFile::SetCalltipParameterEnd(CString szEnd) + { + return SetStringToXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSEND, szEnd); + } + + CString CSyntaxFile::GetCalltipParameterSeparator() + { + return GetStringFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSSEPARATOR); + } + + bool CSyntaxFile::SetCalltipSeparator(CString szSeparator) + { + return SetStringToXMLFile(TAG_CALLTIP, TAG_CALLTIP_PARAMETERSSEPARATOR, szSeparator); + } + + CString CSyntaxFile::GetCalltipEndDefinition() + { + return GetStringFromXMLFile(TAG_CALLTIP, TAG_CALLTIP_ENDDEFINITION); + } + + bool CSyntaxFile::SetCalltipEndDefinition(CString szEndDefinition) + { + return SetStringToXMLFile(TAG_CALLTIP, TAG_CALLTIP_ENDDEFINITION, szEndDefinition); + } + + bool CSyntaxFile::GetAutocompleteIgnoreCase() + { + return GetBoolFromXMLFile(TAG_AUTOCOMP, TAG_AUTOCOMP_IGNORECASE); + } + + bool CSyntaxFile::SetAutoCompleteIgnoreCase(bool bIgnoreCase) + { + return SetBoolToXMLFile(TAG_AUTOCOMP, TAG_AUTOCOMP_IGNORECASE, bIgnoreCase); + } + + CString CSyntaxFile::GetAutocompleteStartCharacters() + { + return GetStringFromXMLFile(TAG_AUTOCOMP, TAG_AUTOCOMP_STARTCHARACTERS); + } + + bool CSyntaxFile::SetAutocompleteStartCharacters(CString szStartCharacters) + { + return SetStringToXMLFile(TAG_AUTOCOMP, TAG_AUTOCOMP_STARTCHARACTERS, szStartCharacters); + } + + bool CSyntaxFile::GetStyleEolFilled(int iStyle) + { + return GetBoolFromXMLFile( GetStyleNode( iStyle ), TAG_STYLE_EOL_FILLED ); + } + + int CSyntaxFile::GetStyleCase(int iStyle) + { + return GetIntFromXMLFile( GetStyleNode( iStyle ), TAG_STYLE_CASE ); + } + + bool CSyntaxFile::SetStyleEolFilled(int iStyle, bool bValue) + { + pug::xml_node node(GetStyleNode(iStyle)); + return SetBoolToXMLFile( node, TAG_STYLE_EOL_FILLED, bValue); + } + + bool CSyntaxFile::SetStyleCase(int iStyle, int iValue) + { + pug::xml_node node(GetStyleNode(iStyle)); + return SetIntToXMLFile( node, TAG_STYLE_CASE, iValue); + } Index: SyntaxFile.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/SyntaxFile.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SyntaxFile.h 12 Oct 2005 18:55:57 -0000 1.20 --- SyntaxFile.h 16 Oct 2005 12:24:38 -0000 1.21 *************** *** 53,56 **** --- 53,58 ---- #define TAG_MARGINS "Margins" #define TAG_LANGUAGEDEFINES "LanguageDefines" + #define TAG_API "API" + #define TAG_CALLTIP "Calltip" // Lexer sub tags *************** *** 83,86 **** --- 85,90 ---- #define TAG_AUTOCOMP_CODECOMPLETION "CodeCompletion" #define TAG_AUTOCOMP_AUTOCOMPKEY "AutoCompKey" + #define TAG_AUTOCOMP_IGNORECASE "IgnoreCase" + #define TAG_AUTOCOMP_STARTCHARACTERS "StartCharacters" // On save sub tags *************** *** 128,131 **** --- 132,138 ---- #define TAG_STYLE_COLOR_BACKGROUND "Background" + #define TAG_STYLE_EOL_FILLED "EolFilled" + #define TAG_STYLE_CASE "Case" + // Language Defines tags #define TAG_LANGDEFS_CLASSVIEWLANGUAGE "ClassViewLanguage" *************** *** 138,141 **** --- 145,159 ---- #define ATT_LANGDEFS_DEFAULT "default" + // API tags + #define TAG_API_FILENAME "Filename" + + // Calltip tags + #define TAG_CALLTIP_IGNORECASE "IgnoreCase" + #define TAG_CALLTIP_WORDCHARACTERS "WordCharacters" + #define TAG_CALLTIP_PARAMETERSSTART "ParametersStart" + #define TAG_CALLTIP_PARAMETERSEND "ParametersEnd" + #define TAG_CALLTIP_PARAMETERSSEPARATOR "ParametersSeparator" + #define TAG_CALLTIP_ENDDEFINITION "EndDefinition" + /** \class CSyntaxFile * \brief A class with the interface to a xml file with language definitions *************** *** 169,173 **** --- 187,220 ---- pug::xml_node GetStyleColorNode( int iStyle ); + /// Filename of api file. + CString sApiFilename; + + /// Sorted array with api. + CStringArray Api; + public: + bool SetStyleCase(int iStyle, int iValue); + bool SetStyleEolFilled(int iStyle, bool bValue); + int GetStyleCase(int iStyle); + bool GetStyleEolFilled(int iStyle); + bool SetAutocompleteStartCharacters(CString szStartCharacters); + CString GetAutocompleteStartCharacters(void); + bool SetAutoCompleteIgnoreCase(bool bIgnoreCase); + bool GetAutocompleteIgnoreCase(void); + bool SetCalltipEndDefinition(CString szEndDefinition); + CString GetCalltipEndDefinition(void); + bool SetCalltipSeparator(CString szSeparator); + CString GetCalltipParameterSeparator(void); + bool SetCalltipParameterEnd(CString szEnd); + CString GetCalltipParameterEnd(void); + bool SetCalltipParameterStart(CString szStart); + CString GetCalltipParameterStart(void); + bool SetCalltipWordCharacters(CString szWordCharacters); + CString GetCalltipWordCharacters(void); + bool SetCalltipIgnorecase(bool bIgnorecase); + bool GetCalltipIgnorecase(void); + bool SetApiFilename(CString szApiFilename); + CString GetApiFilename(void); + CStringArray* GetApi(void); DECLARE_DYNAMIC(CSyntaxFile) |
From: boca4711 <boc...@us...> - 2005-10-16 12:23:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22874 Modified Files: ScintillaEx.cpp ScintillaEx.h Log Message: - Added calltip handling with API files - Added GetLineText to get complete line as string - Added autocompletion handling - Added matching and highlighting of " and ' - Added smart tab and smart insert Index: ScintillaEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ScintillaEx.cpp 12 Oct 2005 18:55:57 -0000 1.26 --- ScintillaEx.cpp 16 Oct 2005 12:23:22 -0000 1.27 *************** *** 50,53 **** --- 50,71 ---- m_bSaveConvertTabToSpaces = false; m_bSaveTrimTrailingSpaces = false; + m_lastPosCallTip = 0; + m_Api = NULL; + m_nMaxCallTips = 1; + m_nCurrentCallTip = 0; + m_nStartCalltipWord = 0; + m_nBraceCount = 0; + + m_bCallTipIgnoreCase = true; + m_calltipParametersStart = "("; + m_calltipParametersEnd = ")"; + m_calltipParametersSeparators = ",;"; + m_calltipWordCharacters = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + m_bAutoCompleteIgnoreCase = true; + m_autoCompleteStartCharacters = "."; + + m_bSmartInsert = false; + m_bSmartTab = false; } *************** *** 218,221 **** --- 236,249 ---- } + /// Contains string s char ch? + static bool contains(const char *s, char ch) { + return (s && *s) ? strchr(s, ch) != 0 : false; + } + + // Should also use word.characters.*, if exists, in the opposite way (in set instead of not in set) + static bool iswordcharforsel(char ch) { + return !strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch); + } + /// Handles notifications from scintilla control. int CScintillaEx::HandleNotify(LPARAM lParam) *************** *** 235,247 **** HighlightBraces(GetCurrentPos() - 1); else ! BraceHighlight(-1, -1); */ case SCN_CHARADDED: ! if (((scn->ch == '\r') || (scn->ch == '\n')) && (GetAutoIndent() >= 1)) ! AutoIndentIn(scn->ch); ! else if ((scn->ch == '{') && (GetAutoIndent() >= 2)) ! AutoIndentOut(scn->ch); ! else if ((scn->ch == '}') && (GetAutoIndent() >= 2)) ! AutoIndentOut(scn->ch); break; case SCN_MODIFIED: --- 263,356 ---- HighlightBraces(GetCurrentPos() - 1); else ! BraceHighlight(INVALID_POSITION, INVALID_POSITION); */ case SCN_CHARADDED: ! { ! if (m_bSmartInsert) ! { ! if (strchr("({[\"\'", scn->ch) != 0 ! && isspace(GetCharAt(GetCurrentPos() + 1))) ! { ! char ch = '\0'; ! switch (scn->ch) ! { ! case '(': ! ch = ')'; ! break; ! case '[': ! ch = ']'; ! break; ! case '{': ! ch = '}'; ! break; ! case '\"': ! ch = '\"'; ! break; ! case '\'': ! ch = '\''; ! break; ! default: ! break; ! } ! if (ch) ! { ! InsertChar(GetCurrentPos(), ch); ! } ! } ! } ! CharacterRange crange = GetSelection(); ! int selStart = crange.cpMin; ! int selEnd = crange.cpMax; ! if ((selEnd == selStart) && (selStart > 0)) { ! int style = GetStyleAt(selStart - 1); ! //Platform::DebugPrintf("Char added %d style = %d %d\n", scn->ch, style, braceCount); ! if (style != 1) { ! if (CallTipActive()) { ! if (contains(m_calltipParametersEnd, scn->ch)) { ! m_nBraceCount--; ! if (m_nBraceCount < 1) ! CallTipCancel(); ! else ! StartCallTip(); ! } else if (contains(m_calltipParametersStart, scn->ch)) { ! m_nBraceCount++; ! StartCallTip(); ! } else { ! ContinueCallTip(); ! } ! } else if (AutoCActive()) { ! if (contains(m_calltipParametersStart, scn->ch)) { ! m_nBraceCount++; ! StartCallTip(); ! } else if (contains(m_calltipParametersEnd, scn->ch)) { ! m_nBraceCount--; ! } else if (!contains(m_strWordCharacters, scn->ch)) { ! AutoCCancel(); ! if (contains(m_autoCompleteStartCharacters, scn->ch)) { ! StartAutoComplete(); ! } ! /* } else if (autoCCausedByOnlyOne) { ! StartAutoCompleteWord(true); ! */ ! } ! } else { ! if (contains(m_calltipParametersStart, scn->ch)) { ! m_nBraceCount = 1; ! StartCallTip(); ! } else { ! if (((scn->ch == '\r') || (scn->ch == '\n')) && (GetAutoIndent() >= 1)) ! AutoIndentIn(scn->ch); ! else if ((scn->ch == '{') && (GetAutoIndent() >= 2)) ! AutoIndentOut(scn->ch); ! else if ((scn->ch == '}') && (GetAutoIndent() >= 2)) ! AutoIndentOut(scn->ch); ! if (contains(m_autoCompleteStartCharacters, scn->ch)) { ! StartAutoComplete(); ! } ! } ! } ! } ! } ! } break; case SCN_MODIFIED: *************** *** 252,255 **** --- 361,395 ---- SetLineNumberWidth(); break; + case SCN_CALLTIPCLICK: + if (scn->position == 1 && m_nCurrentCallTip > 0) + { + m_nCurrentCallTip--; + FillFunctionDefinition(); + } else if (scn->position == 0 && m_nCurrentCallTip + 1 < m_nMaxCallTips) { + m_nCurrentCallTip++; + FillFunctionDefinition(); + } + break; + case SCN_DWELLSTART: + { + if (INVALID_POSITION == scn->position) { + char message[200]; + sprintf(message, "%0d (%0d,%0d)", scn->position, scn->x, scn->y); + } else { + int selStart = scn->position; + int selEnd = scn->position; + char sel[200]; + RangeExtendAndGrab(sel, 200, selStart, selEnd, GetLength(), iswordcharforsel); + if (*sel) { + CallTipShow(scn->position, sel); + } + } + } + break; + + case SCN_DWELLEND: + CallTipCancel(); + break; + } return scn->nmhdr.code; *************** *** 2014,2015 **** --- 2154,2832 ---- return _T(""); } + + void CScintillaEx::FillFunctionDefinition(int pos) + { + if (pos > 0) + { + m_lastPosCallTip = pos; + } + if (m_Api && m_Api->GetSize() > 0) + { + CString words = GetNearestWords(m_Api, m_currentCallTipWord, strlen(m_currentCallTipWord), + m_bCallTipIgnoreCase, m_calltipParametersStart[0], true); + if (words.IsEmpty()) + return; + // Counts how many call tips + const char *spacePos = strchr(words, ' '); + m_nMaxCallTips = 1; + while (spacePos) { + m_nMaxCallTips++; + spacePos = strchr(spacePos + 1, ' '); + } + + // Should get current api definition + const char *word = GetNearestWord(m_Api, m_currentCallTipWord, strlen(m_currentCallTipWord), + m_bCallTipIgnoreCase, m_calltipWordCharacters, m_nCurrentCallTip); + if (word) { + m_functionDefinition = word; + if (m_nMaxCallTips > 1) { + m_functionDefinition.Insert(0, "\001"); + } + + if (! m_calltipEndDefinition.IsEmpty()) { + int posEndDef = m_functionDefinition.Find(m_calltipEndDefinition); + if (m_nMaxCallTips > 1) { + if ((posEndDef > 1) && + ((posEndDef + m_calltipEndDefinition.GetLength()) < m_functionDefinition.GetLength())) { + m_functionDefinition.Insert(posEndDef + m_calltipEndDefinition.GetLength(), "\n\002"); + } else { + m_functionDefinition + "\n\002"; + } + } else { + if ((posEndDef > 1) && + ((posEndDef + m_calltipEndDefinition.GetLength()) < m_functionDefinition.GetLength())) { + m_functionDefinition.Insert(posEndDef + m_calltipEndDefinition.GetLength(), "\n"); + } + } + } + CallTipShow(m_lastPosCallTip - strlen(m_currentCallTipWord), m_functionDefinition); + ContinueCallTip(); + } + } + } + + bool CScintillaEx::StartCallTip() + { + m_nCurrentCallTip = 0; + m_currentCallTipWord.Empty(); + CString strLine = GetLineText(); + int current = GetCaretInLine(); + int pos = GetCurrentPos(); + int braces; + do { + braces = 0; + while (current > 0 && (braces || !contains(m_calltipParametersStart, strLine[current - 1]))) { + if (contains(m_calltipParametersStart, strLine[current - 1])) + braces--; + else if (contains(m_calltipParametersEnd, strLine[current - 1])) + braces++; + current--; + pos--; + } + if (current > 0) { + current--; + pos--; + } else + break; + while (current > 0 && isspace(strLine[current - 1])) { + current--; + pos--; + } + } while (current > 0 && !contains(m_calltipWordCharacters, strLine[current - 1])); + if (current <= 0) + return true; + + m_nStartCalltipWord = current - 1; + while (m_nStartCalltipWord > 0 && + contains(m_calltipWordCharacters, strLine[m_nStartCalltipWord - 1])) { + m_nStartCalltipWord--; + } + + strLine.SetAt(current, '\0'); + m_currentCallTipWord = strLine.Mid(m_nStartCalltipWord); + m_functionDefinition.Empty(); + //Platform::DebugPrintf("word is [%s] %d %d %d\n", currentCallTipWord.c_str(), currentCallTipWord.length(), pos, pos - rootlen); + FillFunctionDefinition(pos); + return true; + } + + void CScintillaEx::ContinueCallTip() + { + CString strLine = GetLineText(); + int current = GetCaretInLine(); + const char* functionDefinition = m_functionDefinition; + + int braces = 0; + int commas = 0; + for (int i = m_nStartCalltipWord; i < current; i++) { + if (contains(m_calltipParametersStart, strLine[i])) + braces++; + else if (contains(m_calltipParametersEnd, strLine[i]) && braces > 0) + braces--; + else if (braces == 1 && contains(m_calltipParametersSeparators, strLine[i])) + commas++; + } + + int startHighlight = 0; + while (functionDefinition[startHighlight] && !contains(m_calltipParametersStart, m_functionDefinition[startHighlight])) + startHighlight++; + if (contains(m_calltipParametersStart, functionDefinition[startHighlight])) + startHighlight++; + while (functionDefinition[startHighlight] && commas > 0) { + if (contains(m_calltipParametersSeparators, functionDefinition[startHighlight])) + commas--; + // If it reached the end of the argument list it means that the user typed in more + // arguments than the ones listed in the calltip + if (contains(m_calltipParametersEnd, functionDefinition[startHighlight])) + commas = 0; + else + startHighlight++; + } + if (contains(m_calltipParametersSeparators, functionDefinition[startHighlight])) + startHighlight++; + int endHighlight = startHighlight; + while (functionDefinition[endHighlight] && !contains(m_calltipParametersSeparators, functionDefinition[endHighlight]) && !contains(m_calltipParametersEnd, functionDefinition[endHighlight])) + endHighlight++; + + // SendEditor(SCI_CALLTIPSETHLT, startHighlight, endHighlight); + CallTipSetHlt(startHighlight, endHighlight); + } + + /** + * Find the length of a 'word' which is actually an identifier in a string + * which looks like "identifier(..." or "identifier" and where + * there may be extra spaces after the identifier that should not be + * counted in the length. + */ + static unsigned int LengthWord(const char *word, char otherSeparator) { + // Find a '('. If that fails go to the end of the string. + const char *endWord = strchr(word, '('); + if (!endWord && otherSeparator) + endWord = strchr(word, otherSeparator); + if (!endWord) + endWord = word + strlen(word); + // Last case always succeeds so endWord != 0 + + // Drop any space characters. + if (endWord > word) { + endWord--; // Back from the '(', otherSeparator, or '\0' + // Move backwards over any spaces + // while ((endWord > word) && (IsASpace(*endWord))) { + while ((endWord > word) && (isspace(*endWord))) { + endWord--; + } + } + return endWord - word; + } + + /** + * Returns elements (first words of them) of the wordlist array which have + * the same beginning as the passed string. + * The length of the word to compare is passed too. + * Letter case can be ignored or preserved (default). + * If there are more words meeting the condition they are returned all of + * them in the ascending order separated with spaces. + */ + CString CScintillaEx::GetNearestWords( + CStringArray *arr, + const char *wordStart, + int searchLen, + bool ignoreCase /*= false*/, + char otherSeparator /*= '\0'*/, + bool exactLen /*=false*/) + { + unsigned int wordlen; // length of the word part (before the '(' brace) of the api array element + CString wordsNear; + int start = 0; // lower bound of the api array block to search + int end = arr->GetSize() - 1; // upper bound of the api array block to search + int pivot; // index of api array element just being compared + int cond; // comparison result (in the sense of strcmp() result) + + if (0 == arr->GetSize()) + return wordsNear; // is empty + if (ignoreCase) { + /* if (!sortedNoCase) { + sortedNoCase = true; + SortWordListNoCase(wordsNoCase, len); + } + */ + while (start <= end) { // Binary searching loop + pivot = (start + end) / 2; + cond = _strnicmp(wordStart, arr->GetAt(pivot), searchLen); + if (!cond) { + // Find first match + while ((pivot > start) && + (0 == _strnicmp(wordStart, arr->GetAt(pivot-1), searchLen))) { + --pivot; + } + // Grab each match + while ((pivot <= end) && + (0 == _strnicmp(wordStart, arr->GetAt(pivot), searchLen))) { + wordlen = LengthWord(arr->GetAt(pivot), otherSeparator) + 1; + ++pivot; + if (exactLen && wordlen != LengthWord(wordStart, otherSeparator) + 1) + continue; + if (!wordsNear.IsEmpty()) + wordsNear += ' '; + wordsNear += arr->GetAt(pivot-1).Left(wordlen); + } + return wordsNear; + } else if (cond < 0) { + end = pivot - 1; + } else if (cond > 0) { + start = pivot + 1; + } + } + } else { // Preserve the letter case + /* if (!sorted) { + sorted = true; + SortWordList(words, len); + } + */ + while (start <= end) { // Binary searching loop + pivot = (start + end) / 2; + cond = strncmp(wordStart, arr->GetAt(pivot), searchLen); + if (!cond) { + // Find first match + while ((pivot > start) && + (0 == strncmp(wordStart, + arr->GetAt(pivot-1), searchLen))) { + --pivot; + } + // Grab each match + while ((pivot <= end) && + (0 == strncmp(wordStart, arr->GetAt(pivot), searchLen))) { + wordlen = LengthWord(arr->GetAt(pivot), otherSeparator) + 1; + ++pivot; + if (exactLen && wordlen != LengthWord(wordStart, otherSeparator) + 1) + continue; + if (!wordsNear.IsEmpty()) + wordsNear += ' '; + wordsNear += arr->GetAt(pivot-1).Left(wordlen); + } + return wordsNear; + } else if (cond < 0) { + end = pivot - 1; + } else if (cond > 0) { + start = pivot + 1; + } + } + } + return wordsNear; // is empty + } + + void CScintillaEx::SetApi(CStringArray *api) + { + m_Api = api; + } + + /** + * Returns an element (complete) of the wordlist array which has + * the same beginning as the passed string. + * The length of the word to compare is passed too. + * Letter case can be ignored or preserved (default). + */ + const char *CScintillaEx::GetNearestWord(CStringArray *arr, const char *wordStart, int searchLen, bool ignoreCase /*= false*/, CString wordCharacters /*='/0' */, int wordIndex /*= -1 */) { + int start = 0; // lower bound of the api array block to search + int end = arr->GetSize() - 1; // upper bound of the api array block to search + int pivot; // index of api array element just being compared + int cond; // comparison result (in the sense of strcmp() result) + CString word; // api array element just being compared + + if (0 == arr->GetSize()) + return NULL; + if (ignoreCase) { + /* if (!sortedNoCase) { + sortedNoCase = true; + SortWordListNoCase(wordsNoCase, len); + } + */ + while (start <= end) { // binary searching loop + pivot = (start + end) >> 1; + word = arr->GetAt(pivot); + // cond = CompareNCaseInsensitive(wordStart, word, searchLen); + cond = _strnicmp(wordStart, word, searchLen); + if (!cond) { + // find first word + start = pivot; + while (start > 0 && !_strnicmp(wordStart, arr->GetAt(start-1), searchLen)) { + start--; + } + // find last word + end = pivot; + while (end < arr->GetSize() - 1 && !_strnicmp(wordStart, arr->GetAt(end+1), searchLen)) { + end++; + } + + // Finds first word in a series of equal words + for (pivot = start; pivot <= end; pivot++) { + word = arr->GetAt(pivot); + const char* w = word; + if (!contains(m_strWordCharacters, w[searchLen])) { + if (wordIndex <= 0) // Checks if a specific index was requested + return word; // result must not be freed with free() + wordIndex--; + } + } + return NULL; + } + else if (cond > 0) + start = pivot + 1; + else if (cond < 0) + end = pivot - 1; + } + } else { // preserve the letter case + /* if (!sorted) { + sorted = true; + SortWordList(words, len); + } + */ + while (start <= end) { // binary searching loop + pivot = (start + end) >> 1; + word = arr->GetAt(pivot); + cond = strncmp(wordStart, word, searchLen); + if (!cond) { + // find first word + start = pivot; + while (start > 0 && !strncmp(wordStart, arr->GetAt(start-1), searchLen)) { + start--; + } + // find last word + end = pivot; + while (end < arr->GetSize() - 1 && !strncmp(wordStart, arr->GetAt(end+1), searchLen)) { + end++; + } + + // Finds first word in a series of equal words + pivot = start; + while (pivot <= end) { + word = arr->GetAt(pivot); + const char* w = word; + if (!contains(m_strWordCharacters, w[searchLen])) { + if (wordIndex <= 0) // Checks if a specific index was requested + return word; // result must not be freed with free() + wordIndex--; + } + pivot++; + } + return NULL; + } + else if (cond > 0) + start = pivot + 1; + else if (cond < 0) + end = pivot - 1; + } + } + return NULL; + } + + /// Get line as string. + CString CScintillaEx::GetLineText(int nLine) + { + LPTSTR linebuf; + CString strLine; + + int nLen; + // Get needed buffer size + if (nLine < 0) + nLen = GetCurLine(0, 0); + else + nLen = GetLine(nLine, 0); + + // Allocate buffer + linebuf = strLine.GetBuffer(nLen + 1); + // And get the line + if (nLine < 0) + GetCurLine(nLen, linebuf); + else + GetLine(nLine, linebuf); + + linebuf[nLen] = '\0'; + strLine.ReleaseBuffer(); + + return strLine; + } + + void CScintillaEx::SetCalltipIgnoreCase(bool bIgnoreCase) + { + m_bCallTipIgnoreCase = bIgnoreCase; + } + + void CScintillaEx::SetCalltipWordCharacters(CString szWordCharacters) + { + m_calltipWordCharacters = szWordCharacters; + } + + void CScintillaEx::SetCalltipParametersStart(CString szParametersStart) + { + m_calltipParametersStart = szParametersStart; + } + + void CScintillaEx::SetCalltipParametersEnd(CString szParametersEnd) + { + m_calltipParametersEnd = szParametersEnd; + } + + void CScintillaEx::SetCalltipParametersSeparator(CString szParametersSeparator) + { + m_calltipParametersSeparators = szParametersSeparator; + } + + void CScintillaEx::SetCalltipEndDefinition(CString szEndDefinition) + { + m_calltipEndDefinition = szEndDefinition; + } + + bool CScintillaEx::StartAutoComplete() + { + CString line = GetLineText(); + int current = GetCaretInLine(); + + int startword = current; + + while ((startword > 0) && + (contains(m_calltipWordCharacters, line[startword - 1]) || + contains(m_autoCompleteStartCharacters, line[startword - 1]))) { + startword--; + } + + CString root = line.Mid(startword, current - startword); + if (m_Api && m_Api->GetSize() > 0) + { + CString words = GetNearestWords(m_Api, root, strlen(root), + m_bAutoCompleteIgnoreCase, m_calltipParametersStart[0]); + if (!words.IsEmpty()) { + EliminateDuplicateWords(words); + AutoCShow(strlen(root), words); + } + } + return true; + } + + void CScintillaEx::SetAutocompIgnoreCase(bool bIgnoreCase) + { + m_bAutoCompleteIgnoreCase = bIgnoreCase; + } + + void CScintillaEx::SetAutocompStartCharacters(CString szStartCharacters) + { + m_autoCompleteStartCharacters = szStartCharacters; + } + + void CScintillaEx::EliminateDuplicateWords(const char *words) + { + char *firstWord = (char *) words; + char *firstSpace = strchr(firstWord, ' '); + char *secondWord; + char *secondSpace; + int firstLen, secondLen; + + while (firstSpace) { + firstLen = firstSpace - firstWord; + secondWord = firstWord + firstLen + 1; + secondSpace = strchr(secondWord, ' '); + + if (secondSpace) + secondLen = secondSpace - secondWord; + else + secondLen = strlen(secondWord); + + if (firstLen == secondLen && + !strncmp(firstWord, secondWord, firstLen)) { + strcpy(firstWord, secondWord); + firstSpace = strchr(firstWord, ' '); + } else { + firstWord = secondWord; + firstSpace = secondSpace; + } + } + } + + bool CScintillaEx::ExistsApi() + { + return (m_Api && m_Api->GetSize() > 0); + } + + void CScintillaEx::SetSmartInsert(bool bSmartInsert) + { + m_bSmartInsert = bSmartInsert; + } + + void CScintillaEx::HighlightQuotation(long nPos) + { + long match = QuotationMatch(nPos); + if (match == INVALID_POSITION) + { + BraceHighlight(INVALID_POSITION, INVALID_POSITION); + BraceBadLight(nPos); + } + else + BraceHighlight(nPos, match); + } + + bool CScintillaEx::GetAutocompIgnoreCase() + { + return m_bAutoCompleteIgnoreCase; + } + + long CScintillaEx::QuotationMatch(long pos) + { + int ch = GetCharAt(pos); + int nOpposite = INVALID_POSITION; + int nStyle = GetStyleAt(pos); + int nLine = LineFromPosition(pos); + + // at first try to find quotation mark in same line + + // search forward to end of line + if (GetStyleAt(pos + 1) == nStyle) + { + for (int i = pos + 1; i < GetLineEndPosition(nLine); i++) + { + if (isspace(GetCharAt(i))) + continue; + if (GetStyleAt(i) != nStyle) + { + nOpposite = INVALID_POSITION; + break; + } + if (GetCharAt(i) == ch) + { + nOpposite = i; + break; + } + } + } + // search backward to begin of line if not found + if (nOpposite == INVALID_POSITION && GetStyleAt(pos - 1) == nStyle) + { + for (int i = pos - 1; i >= PositionFromLine(nLine); i--) + { + if (isspace(GetCharAt(i))) + continue; + if (GetStyleAt(i) != nStyle) + { + nOpposite = INVALID_POSITION; + break; + } + if (GetCharAt(i) == ch) + { + nOpposite = i; + break; + } + } + } + // search forward to end of file if not found + if (nOpposite == INVALID_POSITION && GetStyleAt(pos + 1) == nStyle) + { + for (int i = pos + 1; i < GetLength(); i++) + { + if (isspace(GetCharAt(i))) + continue; + if (GetStyleAt(i) != nStyle) + { + nOpposite = INVALID_POSITION; + break; + } + if (GetCharAt(i) == ch) + { + nOpposite = i; + break; + } + } + } + // search backward to begin of file if not found + if (nOpposite == INVALID_POSITION && GetStyleAt(pos - 1) == nStyle) + { + for (int i = pos - 1; i >= 0; i--) + { + if (isspace(GetCharAt(i))) + continue; + if (GetStyleAt(i) != nStyle) + { + nOpposite = INVALID_POSITION; + break; + } + if (GetCharAt(i) == ch) + { + nOpposite = i; + break; + } + } + } + return nOpposite; + } + + void CScintillaEx::SetSmartTab(bool bSmartTab) + { + m_bSmartTab = bSmartTab; + } + + /** Jump to next non white space position like in previous lines. + * If smart tab is available then tab gets current column and tries + * to find next non white space position like in previous lines. + * If previous line is too short then the next previous line is checked. + * EOLs are jump positions too. If new line is longer than all lines before + * tab inserts normal tabs. + */ + void CScintillaEx::TabExtended() + { + const int nMaxPreviousLines = 100; + + if (IsSelection() || !GetSmartTab()) + Tab(); + else + { + long nCurrentPos = GetCurrentPos(); + long nCurrentCol = GetColumn(nCurrentPos); + long nCurrentLine = GetCurLineNumber(); + long nNewCol = INVALID_POSITION; + long nFirstLine = nCurrentLine - nMaxPreviousLines; + if (nFirstLine < 0) + nFirstLine = 0; + for (int i = nCurrentLine - 1; i >= nFirstLine; i--) + { + if (GetColumn(GetLineEndPosition(i)) <= nCurrentCol) + continue; + long nPos = FindColumn(i, nCurrentCol); + // Find next white space + while (GetCharAt(nPos) != _T(' ') && GetCharAt(nPos) && _T('\t')) + { + if (GetCharAt(nPos) == _T('\r') || GetCharAt(nPos) == _T('\n')) + break; + nPos++; + } + // Find next non white space + while (GetCharAt(nPos) == _T(' ') || GetCharAt(nPos) == _T('\t')) + nPos++; + long nDiff = GetColumn(nPos) - nCurrentCol; + CString strIndent(' ', nDiff); + InsertText(-1, strIndent); + GotoPos(nCurrentPos + nDiff); + nNewCol = nCurrentCol + nDiff; + break; + } + if (nNewCol == INVALID_POSITION) + Tab(); + } + } + + bool CScintillaEx::GetSmartTab() + { + return m_bSmartTab; + } + + static bool isURLforsel(char ch) { + return !strchr("\t\n\r \"", ch); + } + + /// Select URL at current position + CString CScintillaEx::SelectionURL(int pos) + { + char selection[1000]; + int nStart = pos; + int nEnd = pos; + RangeExtendAndGrab(selection, 1000, nStart, nEnd, GetLength(), isURLforsel); + return CString(selection); + } + Index: ScintillaEx.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ScintillaEx.h 12 Oct 2005 18:55:57 -0000 1.18 --- ScintillaEx.h 16 Oct 2005 12:23:23 -0000 1.19 *************** *** 94,97 **** --- 94,99 ---- { public: + bool StartCallTip(void); + CString GetLineText(int nLine = -1); void NumMinus(); void NumPlus(); *************** *** 156,159 **** --- 158,185 ---- protected: + bool m_bSmartTab; + bool m_bSmartInsert; + void EliminateDuplicateWords(const char *words); + bool m_bAutoCompleteIgnoreCase; + bool StartAutoComplete(void); + CString m_autoCompleteStartCharacters; + int m_nBraceCount; + int m_nStartCalltipWord; + CString m_calltipWordCharacters; + CString m_calltipParametersStart; + CString m_calltipParametersEnd; + CString m_calltipParametersSeparators; + CString m_calltipEndDefinition; + CString m_functionDefinition; + int m_nCurrentCallTip; + int m_nMaxCallTips; + bool m_bCallTipIgnoreCase; + CStringArray* m_Api; + const char *GetNearestWord(CStringArray *arr, const char *wordStart, int searchLen, bool ignoreCase = false, CString wordCharacters = "/0", int wordIndex = -1); + CString GetNearestWords(CStringArray *arr, const char *wordStart, int searchLen, bool ignoreCase = false, char otherSeparator = '\0', bool exactLen = false); + CString m_currentCallTipWord; + int m_lastPosCallTip; + void ContinueCallTip(void); + void FillFunctionDefinition(int pos = -1); bool m_bSaveConvertTabToSpaces; bool m_bSaveTrimTrailingSpaces; *************** *** 178,181 **** --- 204,228 ---- std::deque<int> dqBookmarks; public: + CString SelectionURL(int pos); + bool GetSmartTab(void); + void TabExtended(void); + void SetSmartTab(bool bSmartTab); + /** + * Find the position of a matching quotation or INVALID_POSITION if no match. + */ + long QuotationMatch(long pos); + bool GetAutocompIgnoreCase(void); + void HighlightQuotation(long nPos); + void SetSmartInsert(bool bSmartInsert); + bool ExistsApi(void); + void SetAutocompStartCharacters(CString szStartCharacters); + void SetAutocompIgnoreCase(bool bIgnoreCase); + void SetCalltipEndDefinition(CString szEndDefinition); + void SetCalltipParametersSeparator(CString szParametersSeparator); + void SetCalltipParametersEnd(CString szParametersEnd); + void SetCalltipParametersStart(CString szParametersStart); + void SetCalltipWordCharacters(CString szWordCharacters); + void SetCalltipIgnoreCase(bool bIgnoreCase); + void SetApi(CStringArray *api); CString GetEOLString(int nEOLMode = NULL); int GetSelectionEndLine(void); |
From: boca4711 <boc...@us...> - 2005-10-16 12:21:28
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22599 Modified Files: Misc.cpp Misc.h Log Message: - Added SortStringArray to sort string arrays - Added GetGUID to create and return a GUID string Index: Misc.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Misc.cpp 8 May 2005 11:03:03 -0000 1.14 --- Misc.cpp 16 Oct 2005 12:21:19 -0000 1.15 *************** *** 43,46 **** --- 43,60 ---- #endif + static int Compare(const void *a, const void *b) + { + CString *pA = (CString*)a; + CString *pB = (CString*)b; + return (pA->Compare(*pB)); + } + + static int CompareNoCase(const void *a, const void *b) + { + CString *pA = (CString*)a; + CString *pB = (CString*)b; + return (pA->CompareNoCase(*pB)); + } + ////////////////////////////////////////////////////////////////////// // Construction/Destruction *************** *** 570,571 **** --- 584,627 ---- s++; } + + void CMisc::SortStringArray (CStringArray& csa, bool bCaseSensitive) + { + int iArraySize = csa.GetSize(); + if (iArraySize <= 0) + return; + + int iCSSize = sizeof (CString*); + void* pArrayStart = (void *)&csa[0]; + + if (bCaseSensitive) + qsort (pArrayStart, iArraySize, iCSSize, Compare); + else + qsort (pArrayStart, iArraySize, iCSSize, CompareNoCase); + } + + CString CMisc::GetGUID() + { + CString strGUID; + + GUID m_guid; + ::CoCreateGuid(&m_guid); + LPOLESTR wszCLSID = NULL; + StringFromCLSID(m_guid, &wszCLSID); + int nLen = lstrlenW(wszCLSID); + + TCHAR* szCLSID = new TCHAR[nLen + 1]; + + #ifndef _UNICODE + wcstombs(szCLSID, wszCLSID, nLen); + szCLSID[nLen] = 0; + #else + lstrcpy(szCLSID, wszCLSID); + #endif + + CoTaskMemFree(wszCLSID); + + strGUID = szCLSID; + delete szCLSID; + + return strGUID; + } Index: Misc.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Misc.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Misc.h 12 Oct 2005 18:55:57 -0000 1.13 --- Misc.h 16 Oct 2005 12:21:19 -0000 1.14 *************** *** 39,42 **** --- 39,44 ---- { public: + CString GetGUID(); + void SortStringArray (CStringArray& csa, bool bCaseSensitive); void NormalizeString(char *s); BOOL ShortToLongPath(CString &sShortPath, CString &sLongPath); |
From: boca4711 <boc...@us...> - 2005-10-16 12:19:15
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22130 Modified Files: FuncComboBox.cpp Log Message: - Modified selection, combo box doesn't show functions only Index: FuncComboBox.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FuncComboBox.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FuncComboBox.cpp 18 Sep 2004 18:42:28 -0000 1.7 --- FuncComboBox.cpp 16 Oct 2005 12:19:07 -0000 1.8 *************** *** 155,159 **** void CFuncComboBox::OnAddedTag(AETagListForFile* pList, AETag* pTag) { ! AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); if (pFunction == NULL) return; --- 155,160 ---- void CFuncComboBox::OnAddedTag(AETagListForFile* pList, AETag* pTag) { ! // AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); ! AETag* pFunction = pTag; if (pFunction == NULL) return; *************** *** 165,169 **** void CFuncComboBox::OnRemovedTag(AETagListForFile* pList, AETag* pTag) { ! AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); if (pFunction == NULL) return; --- 166,171 ---- void CFuncComboBox::OnRemovedTag(AETagListForFile* pList, AETag* pTag) { ! // AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); ! AETag* pFunction = pTag; if (pFunction == NULL) return; *************** *** 184,188 **** { int nIndex = FindItem(pTag); ! AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); if (pFunction == NULL) { --- 186,191 ---- { int nIndex = FindItem(pTag); ! // AEFunctionTag* pFunction = dynamic_cast<AEFunctionTag*>(pTag); ! AETag* pFunction = pTag; if (pFunction == NULL) { *************** *** 258,262 **** void CFuncComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { ! AEFunctionTag* pTag = (AEFunctionTag*)lpDrawItemStruct->itemData; COLORREF clr; CRect rect(lpDrawItemStruct->rcItem); --- 261,266 ---- void CFuncComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { ! // AEFunctionTag* pTag = (AEFunctionTag*)lpDrawItemStruct->itemData; ! AETag* pTag = (AEFunctionTag*)lpDrawItemStruct->itemData; COLORREF clr; CRect rect(lpDrawItemStruct->rcItem); *************** *** 285,293 **** } // Find the tag! ! const AEFunctionTag* pFunction, *pPrevFunction = NULL; const AEProjectFile* pFile = m_pTagList->GetFile(); for (TAGLIST::const_iterator i = m_pTagList->GetTagListByLocation().begin(); i != m_pTagList->GetTagListByLocation().end(); i++) { ! pFunction = dynamic_cast<const AEFunctionTag*>(*i); if (pFunction == NULL) continue; --- 289,299 ---- } // Find the tag! ! // const AEFunctionTag* pFunction, *pPrevFunction = NULL; ! const AETag* pFunction, *pPrevFunction = NULL; const AEProjectFile* pFile = m_pTagList->GetFile(); for (TAGLIST::const_iterator i = m_pTagList->GetTagListByLocation().begin(); i != m_pTagList->GetTagListByLocation().end(); i++) { ! // pFunction = dynamic_cast<const AEFunctionTag*>(*i); ! pFunction = *i; if (pFunction == NULL) continue; *************** *** 340,344 **** CFuncComboBox* pWndCombo = new CFuncComboBox; ! if (!pWndCombo->Create (m_dwStyle|CBS_DROPDOWN|CBS_DISABLENOSCROLL|CBS_HASSTRINGS|CBS_OWNERDRAWFIXED, rect, pWndParent, m_nID)) { delete pWndCombo; --- 346,350 ---- CFuncComboBox* pWndCombo = new CFuncComboBox; ! if (!pWndCombo->Create (m_dwStyle|CBS_DROPDOWN|CBS_DISABLENOSCROLL|CBS_HASSTRINGS|CBS_OWNERDRAWFIXED|CBS_SORT, rect, pWndParent, m_nID)) { delete pWndCombo; |
From: boca4711 <boc...@us...> - 2005-10-16 12:18:09
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21866 Modified Files: FontPref.cpp FontPref.h Log Message: - Added case in keywords Index: FontPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FontPref.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FontPref.h 12 Oct 2005 18:55:57 -0000 1.8 --- FontPref.h 16 Oct 2005 12:17:57 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- // CFontPref dialog #include "SAPrefsSubDlg.h" + #include "MyComboBox.h" class CFontPref : public CSAPrefsSubDlg *************** *** 46,49 **** --- 47,51 ---- //{{AFX_DATA(CFontPref) enum { IDD = IDD_PREF_FONT }; + CMyComboBox m_ComboCase; CButton m_Underline; CButton m_Italic; *************** *** 65,68 **** --- 67,71 ---- CMap<int,int,BOOL,BOOL> mapItalic; CMap<int,int,BOOL,BOOL> mapUnderline; + CMap<int,int,int,int> mapCase; protected: *************** *** 99,102 **** --- 102,106 ---- afx_msg void OnCheckUnderline(); afx_msg void OnButtonToAllStyles(); + afx_msg void OnSelchangeComboCase(); //}}AFX_MSG DECLARE_MESSAGE_MAP() Index: FontPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FontPref.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FontPref.cpp 25 Sep 2004 13:10:08 -0000 1.11 --- FontPref.cpp 16 Oct 2005 12:17:57 -0000 1.12 *************** *** 52,55 **** --- 52,56 ---- CSAPrefsSubDlg::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFontPref) + DDX_Control(pDX, IDC_COMBO_CASE, m_ComboCase); DDX_Control(pDX, IDC_CHECK_UNDERLINE, m_Underline); DDX_Control(pDX, IDC_CHECK_ITALIC, m_Italic); *************** *** 78,81 **** --- 79,83 ---- ON_BN_CLICKED(IDC_CHECK_UNDERLINE, OnCheckUnderline) ON_BN_CLICKED(IDC_BUTTON_TOALLSTYLES, OnButtonToAllStyles) + ON_CBN_SELCHANGE(IDC_COMBO_CASE, OnSelchangeComboCase) //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 158,161 **** --- 160,164 ---- mapItalic.SetAt( iCount, m_pSyntaxFile->GetStyleFontItalic( iCount ) ); mapUnderline.SetAt( iCount, m_pSyntaxFile->GetStyleFontUnderline( iCount ) ); + mapCase.SetAt( iCount, m_pSyntaxFile->GetStyleCase( iCount ) ); ++ iNrOfStyles; } *************** *** 197,200 **** --- 200,204 ---- CString szTemp; BOOL bCheck; + int iCase; // Set Font name and size *************** *** 214,217 **** --- 218,226 ---- mapUnderline.Lookup( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), bCheck ); m_Underline.SetCheck( bCheck ); + + mapCase.Lookup( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), iCase ); + m_ComboCase.SetCurSel(iCase); + + UpdateSampleText(); } *************** *** 389,392 **** --- 398,402 ---- int iCount; int iStyleNumber; + int iCase; BOOL bBold; BOOL bItalic; *************** *** 411,414 **** --- 421,425 ---- mapItalic.Lookup( iStyleNumber, bItalic ); mapUnderline.Lookup( iStyleNumber, bUnderline ); + mapCase.Lookup( iStyleNumber, iCase ); // Change the values in the SyntaxFile object *************** *** 418,421 **** --- 429,433 ---- m_pSyntaxFile->SetStyleFontItalic( iStyleNumber, bItalic ? true : false ); m_pSyntaxFile->SetStyleFontUnderline( iStyleNumber, bUnderline ? true : false ); + m_pSyntaxFile->SetStyleCase( iStyleNumber, iCase ); } return bChanged; *************** *** 426,429 **** --- 438,442 ---- CString szListFontName; CString szListFontSize; + CString szSampleText = _T("Sample Text"); // Get the fontname and fontsize from the listboxes *************** *** 440,442 **** --- 453,473 ---- // Change the font of the Sample Text m_SampleText.SetFont( &m_fontSampleText ); + + if (m_ComboCase.GetCurSel() == 1) + szSampleText.MakeUpper(); + if (m_ComboCase.GetCurSel() == 2) + szSampleText.MakeLower(); + m_SampleText.SetWindowText(szSampleText); + } + + void CFontPref::OnSelchangeComboCase() + { + int iCase = m_ComboCase.GetCurSel(); + mapCase.SetAt( m_ComboStyle.GetItemData( m_ComboStyle.GetCurSel() ), iCase ); + + // Update Sample Text + UpdateSampleText(); + + // Tell the parent something changed, so the apply button can be activated + NotifyParentOfChange(); } |
From: boca4711 <boc...@us...> - 2005-10-16 12:17:34
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723 Added Files: FolderDlg.cpp FolderDlg.h Log Message: - Folder dialog to choose folder. --- NEW FILE: FolderDlg.cpp --- ///////////////////////////////////////////////////////////////////////////// /* DESCRIPTION: CFolderDialog - Folder Selection Dialog Class Copyright(C) Armen Hakobyan, 2002 - 2005 http://www.codeproject.com/dialog/cfolderdialog.asp VERSION HISTORY: 24 Mar 2002 - First release 30 Mar 2003 - Some minor changes - Added missing in old Platform SDK new flag definitions - Added support for both MFC 6.0 and 7.0 - Added OnIUnknown handler for Windows XP folder filtration - Added SetExpanded and SetOKText and GetSelectedFolder functions 24 May 2003 - Added OnSelChanged implementation 14 Jul 2003 - Added custom filtration for Windows XP, thanks to Arik Poznanski 29 Nov 2003 - Added SetRootFolder, thanks to Eckhard Schwabe ( and Jose Insa ) 02 Jan 2004 - Added GetRootFolder, uncomment if needed 15 Feb 2005 - Small bug fix in DoModal, thanks to WindSeven */ ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "FolderDlg.h" ///////////////////////////////////////////////////////////////////////////// #ifndef BFFM_VALIDATEFAILED #ifndef UNICODE #define BFFM_VALIDATEFAILED 3 #else #define BFFM_VALIDATEFAILED 4 #endif #endif #ifndef BFFM_IUNKNOWN #define BFFM_IUNKNOWN 5 #endif ///////////////////////////////////////////////////////////////////////////// // CFolderDialog IMPLEMENT_DYNAMIC( CFolderDialog, CDialog ) CFolderDialog::CFolderDialog( IN LPCTSTR pszTitle /*NULL*/, IN LPCTSTR pszSelPath /*NULL*/, IN CWnd* pWndParent /*NULL*/, IN UINT uFlags /*BIF_RETURNONLYFSDIRS*/ ) : CCommonDialog( pWndParent ) , m_hWnd( NULL ) { ::ZeroMemory( &m_bi, sizeof( BROWSEINFO ) ); ::ZeroMemory( m_szFolPath, MAX_PATH ); ::ZeroMemory( m_szSelPath, MAX_PATH ); // Fill data m_bi.hwndOwner = pWndParent->GetSafeHwnd(); m_bi.pidlRoot = NULL; m_bi.lpszTitle = pszTitle; m_bi.ulFlags = uFlags; m_bi.lpfn = (BFFCALLBACK)&BrowseCallbackProc; m_bi.lParam = (LPARAM)this; // The size of this buffer is assumed to be MAX_PATH bytes: m_bi.pszDisplayName = new TCHAR[ MAX_PATH ]; ASSERT( m_bi.pszDisplayName != NULL ); SAFE_ZEROMEMORY( m_bi.pszDisplayName, ( MAX_PATH * sizeof( TCHAR ) ) ); if( pszSelPath ) SetSelectedFolder( pszSelPath ); } CFolderDialog::~CFolderDialog( VOID ) { SAFE_COTASKMEMFREE( m_bi.pidlRoot ); SAFE_DELETE2( m_bi.pszDisplayName ); ::ZeroMemory( &m_bi, sizeof( BROWSEINFO ) ); } BEGIN_MESSAGE_MAP( CFolderDialog, CCommonDialog ) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CFolderDialog message handlers // SetRootFolder By Jose Insa // Microsoft knowledge Base Article // ID Q132750: Convert a File Path to an ITEMIDLIST BOOL CFolderDialog::SetRootFolder( IN LPCTSTR pszPath ) { ASSERT_VALID( this ); if( !pszPath ) { SAFE_COTASKMEMFREE( m_bi.pidlRoot ); return TRUE; } ASSERT( AfxIsValidString( pszPath, MAX_PATH ) ); HRESULT hResult = S_FALSE; IShellFolder* pDeskFolder = NULL; hResult = ::SHGetDesktopFolder( &pDeskFolder ); if ( hResult == S_OK ) { LPITEMIDLIST pidlRoot = NULL; LPTSTR pszRoot = const_cast< LPTSTR >( pszPath ); // Convert the path to an ITEMIDLIST: USES_CONVERSION; hResult = pDeskFolder->ParseDisplayName( NULL, NULL, T2W( pszRoot ), NULL, &pidlRoot, NULL ); if( hResult == S_OK ) { SAFE_COTASKMEMFREE( m_bi.pidlRoot ); m_bi.pidlRoot = pidlRoot; } SAFE_RELEASE( pDeskFolder ); } return ( hResult == S_OK ); } // NOTE: pszPath buffer must be at least // MAX_PATH characters in size: BOOL CFolderDialog::GetRootFolder( IN OUT LPTSTR pszPath ) { ASSERT_VALID( this ); ASSERT( AfxIsValidString( pszPath, MAX_PATH ) ); return ::SHGetPathFromIDList( m_bi.pidlRoot, pszPath ); } BOOL CFolderDialog::SetSelectedFolder( IN LPCTSTR pszPath ) { ASSERT( AfxIsValidString( pszPath, MAX_PATH ) ); return (BOOL)::lstrcpy( m_szSelPath, pszPath ); } ///////////////////////////////////////////////////////////////////////////// #if ( _MFC_VER >= 0x0700 ) INT_PTR CFolderDialog::DoModal( VOID ) #else INT CFolderDialog::DoModal( VOID ) #endif { ASSERT_VALID( this ); ASSERT( m_bi.lpfn != NULL ); INT_PTR nRet = -1; m_bi.hwndOwner = PreModal(); LPITEMIDLIST pItemIDList = ::SHBrowseForFolder( &m_bi ); if( pItemIDList ) { if( ::SHGetPathFromIDList( pItemIDList, m_szFolPath ) ) nRet = IDOK; SAFE_COTASKMEMFREE( pItemIDList ); } else nRet = IDCANCEL; PostModal(); return ( nRet ); } ///////////////////////////////////////////////////////////////////////////// // Overridables: VOID CFolderDialog::OnInitialized( VOID ) { if( ::lstrlen( m_szSelPath ) > 0 ) SetSelection( m_szSelPath ); } VOID CFolderDialog::OnSelChanged( IN LPITEMIDLIST pItemIDList ) { if( m_bi.ulFlags & BIF_STATUSTEXT ) { TCHAR szSelFol[ MAX_PATH ] = { 0 }; if( ::SHGetPathFromIDList( pItemIDList, szSelFol ) ) SetStatusText( szSelFol ); } } INT CFolderDialog::OnValidateFailed( IN LPCTSTR /*pszPath*/ ) { ::MessageBeep( MB_ICONHAND ); return 1; // Return 1 to leave dialog open, 0 - to end one } VOID CFolderDialog::OnIUnknown( IN IUnknown* /*pIUnknown*/ ) { } ///////////////////////////////////////////////////////////////////////////// // Callback function used with the SHBrowseForFolder function. INT CALLBACK CFolderDialog::BrowseCallbackProc( IN HWND hWnd, IN UINT uMsg, IN LPARAM lParam, IN LPARAM lpData ) { CFolderDialog* pThis = (CFolderDialog*)lpData; ASSERT( pThis != NULL ); INT nRet = 0; pThis->m_hWnd = hWnd; switch( uMsg ) { case BFFM_INITIALIZED: pThis->OnInitialized(); break; case BFFM_SELCHANGED: pThis->OnSelChanged( (LPITEMIDLIST)lParam ); break; case BFFM_VALIDATEFAILED: nRet = pThis->OnValidateFailed( (LPCTSTR)lParam ); break; case BFFM_IUNKNOWN: pThis->OnIUnknown( (IUnknown*)lParam ); break; default: ASSERT( FALSE ); break; } pThis->m_hWnd = NULL; return nRet; } ///////////////////////////////////////////////////////////////////////////// // Commands, valid to call only from handlers VOID CFolderDialog::SetExpanded( IN LPCTSTR pszPath ) { USES_CONVERSION; ASSERT( m_hWnd != NULL ); ASSERT( AfxIsValidString( pszPath, MAX_PATH ) ); ::SendMessage( m_hWnd, BFFM_SETEXPANDED, (WPARAM)TRUE, (LPARAM)T2CW( pszPath ) ); } VOID CFolderDialog::SetOKText( IN LPCTSTR pszText ) { USES_CONVERSION; ASSERT( m_hWnd != NULL ); ::SendMessage( m_hWnd, BFFM_SETOKTEXT, (WPARAM)0, (LPARAM)T2CW( pszText ) ); } VOID CFolderDialog::EnableOK( IN BOOL bEnable /*TRUE*/ ) { ASSERT( m_hWnd != NULL ); ::SendMessage( m_hWnd, BFFM_ENABLEOK, (WPARAM)bEnable, 0L ); } VOID CFolderDialog::SetSelection( IN LPITEMIDLIST pItemIDList ) { ASSERT( m_hWnd != NULL ); ::SendMessage( m_hWnd, BFFM_SETSELECTION, (WPARAM)FALSE, (LPARAM)pItemIDList ); } VOID CFolderDialog::SetSelection( IN LPCTSTR pszPath ) { ASSERT( m_hWnd != NULL ); ASSERT( AfxIsValidString( pszPath, MAX_PATH ) ); ::SendMessage( m_hWnd, BFFM_SETSELECTION, (WPARAM)TRUE, (LPARAM)pszPath ); } VOID CFolderDialog::SetStatusText( IN LPCTSTR pszText ) { ASSERT( m_hWnd != NULL ); ::SendMessage( m_hWnd, BFFM_SETSTATUSTEXT, (WPARAM)0, (LPARAM)pszText ); } // Shell version 5.0 or later: VOID CFolderDialog::SetExpanded( IN LPITEMIDLIST pItemIDList ) { ASSERT( m_hWnd != NULL ); ::SendMessage( m_hWnd, BFFM_SETEXPANDED, (WPARAM)FALSE, (LPARAM)pItemIDList ); } ///////////////////////////////////////////////////////////////////////////// --- NEW FILE: FolderDlg.h --- ///////////////////////////////////////////////////////////////////////////// /* DESCRIPTION: CFolderDialog - Folder Selection Dialog Class Copyright(C) Armen Hakobyan, 2002 - 2005 http://www.codeproject.com/dialog/cfolderdialog.asp VERSION HISTORY: 24 Mar 2002 - First release 30 Mar 2003 - Some minor changes - Added missing in old Platform SDK new flag definitions - Added support for both MFC 6.0 and 7.0 - Added OnIUnknown handler for Windows XP folder filtration - Added SetExpanded and SetOKText and GetSelectedFolder functions 24 May 2003 - Added OnSelChanged implementation 14 Jul 2003 - Added custom filtration for Windows XP, thanks to Arik Poznanski 29 Nov 2003 - Added SetRootFolder, thanks to Eckhard Schwabe ( and Jose Insa ) 02 Jan 2004 - Added GetRootFolder, uncomment if needed 15 Feb 2005 - Small bug fix in DoModal, thanks to WindSeven */ ///////////////////////////////////////////////////////////////////////////// #ifndef __FOLDERDLG_H__ #define __FOLDERDLG_H__ #if defined( _MSC_VER ) && ( _MSC_VER >= 1020 ) #pragma once #endif ///////////////////////////////////////////////////////////////////////////// #ifndef __AFXDLGS_H__ #include < AfxDlgs.h > #endif #ifndef __ATLCONV_H__ #include < AtlConv.h > // MBCS/Unicode Conversion Macros #endif // Uncomment if using GetRootFolder //#ifndef _INC_SHLWAPI // #include < shlwapi.h > //#endif //#pragma comment( lib, "shlwapi.lib" ) ///////////////////////////////////////////////////////////////////////////// #ifndef SAFE_DELETE2 #define SAFE_DELETE2( p ) \ if( p ){ delete[] p; p = NULL; } #endif #ifndef SAFE_ZEROMEMORY #define SAFE_ZEROMEMORY( p, size ) \ if( p ){ ZeroMemory( p, size ); } #endif #ifndef SAFE_RELEASE #if defined( __cplusplus ) #define SAFE_RELEASE( p ) \ if( p ){ p->Release(); p = NULL; } #else #define SAFE_RELEASE( p ) \ if( p ){ p->lpVtbl->Release( p ); p = NULL; } #endif #endif #ifndef SAFE_COTASKMEMFREE #define SAFE_COTASKMEMFREE( p ) \ if( p ){ CoTaskMemFree( (LPVOID)p ); p = NULL; } #endif #ifndef _countof #define _countof( x ) \ ( sizeof( x ) / sizeof( x[ 0 ] ) ) #endif ///////////////////////////////////////////////////////////////////////////// #ifndef BFFM_SETOKTEXT // Version 5.0 or later #define BFFM_SETOKTEXT ( WM_USER + 105 ) // Unicode only, req. BIF_USENEWUI #define BFFM_SETEXPANDED ( WM_USER + 106 ) // Unicode only, req. BIF_USENEWUI #endif #ifndef BIF_NEWDIALOGSTYLE // Version 5.0 or later #define BIF_NEWDIALOGSTYLE 0x0040 #define BIF_BROWSEINCLUDEURLS 0x0080 #define BIF_UAHINT 0x0100 // Req. BIF_NEWDIALOGSTYLE #define BIF_NONEWFOLDERBUTTON 0x0200 #define BIF_NOTRANSLATETARGETS 0x0400 #define BIF_SHAREABLE 0x8000 // Req. BIF_USENEWUI #define BIF_USENEWUI ( BIF_NEWDIALOGSTYLE | BIF_EDITBOX ) #endif ///////////////////////////////////////////////////////////////////////////// class CFolderDialog : public CCommonDialog { DECLARE_DYNAMIC( CFolderDialog ) public: CFolderDialog( IN LPCTSTR pszTitle = NULL, IN LPCTSTR pszSelPath = NULL, IN CWnd* pWndParent = NULL, IN UINT uFlags = BIF_RETURNONLYFSDIRS ); virtual ~CFolderDialog( VOID ); public: #if ( _MFC_VER >= 0x0700 ) // VC++ 2002 (7.0) virtual INT_PTR DoModal( VOID ); #else virtual INT DoModal( VOID ); #endif BOOL SetRootFolder( IN LPCTSTR pszPath ); BOOL GetRootFolder( IN OUT LPTSTR pszPath ); BOOL SetSelectedFolder( IN LPCTSTR pszPath ); public: AFX_INLINE LPCTSTR GetFolderPath( VOID ) const; AFX_INLINE LPCTSTR GetFolderName( VOID ) const; AFX_INLINE INT GetFolderImage( VOID ) const; AFX_INLINE LPCTSTR GetSelectedFolder( VOID ) const; AFX_INLINE BROWSEINFO& GetBI( VOID ); AFX_INLINE const BROWSEINFO& GetBI( VOID ) const; protected: BROWSEINFO m_bi; TCHAR m_szSelPath[ MAX_PATH ]; TCHAR m_szFolPath[ MAX_PATH ]; protected: DECLARE_MESSAGE_MAP() protected: // Overridables virtual VOID OnInitialized( VOID ); virtual VOID OnSelChanged( IN LPITEMIDLIST pItemIDList ); virtual INT OnValidateFailed( IN LPCTSTR /*pszPath*/ ); protected: // Windows XP or later virtual VOID OnIUnknown( IN IUnknown* /*pIUnknown*/ ); protected: // Valid to call only from the above handlers VOID EnableOK( IN BOOL bEnable = TRUE ); VOID SetSelection( IN LPITEMIDLIST pItemIDList ); VOID SetSelection( IN LPCTSTR pszPath ); VOID SetStatusText( IN LPCTSTR pszText ); protected: // Shell version 5.0 or later: VOID SetExpanded( IN LPCTSTR pszPath ); VOID SetExpanded( IN LPITEMIDLIST pItemIDList ); VOID SetOKText( IN LPCTSTR pszText ); private: HWND m_hWnd; // used only in the callback function private: static INT CALLBACK BrowseCallbackProc( IN HWND hWnd, IN UINT uMsg, IN LPARAM lParam, IN LPARAM lpData ); }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE LPCTSTR CFolderDialog::GetSelectedFolder( VOID ) const { return m_szSelPath; } AFX_INLINE BROWSEINFO& CFolderDialog::GetBI( VOID ) { return m_bi; } AFX_INLINE const BROWSEINFO& CFolderDialog::GetBI( VOID ) const { return m_bi; } ///////////////////////////////////////////////////////////////////////////// // Filled after a call to DoModal AFX_INLINE LPCTSTR CFolderDialog::GetFolderPath( VOID ) const { return m_szFolPath; } AFX_INLINE LPCTSTR CFolderDialog::GetFolderName( VOID ) const { return m_bi.pszDisplayName; } AFX_INLINE INT CFolderDialog::GetFolderImage( VOID ) const { return m_bi.iImage; } ///////////////////////////////////////////////////////////////////////////// #endif // __FOLDERDLG_H__ ///////////////////////////////////////////////////////////////////////////// |
From: boca4711 <boc...@us...> - 2005-10-16 12:16:30
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21482 Modified Files: FlatComboBox.cpp FlatComboBox.h Log Message: - Subclassed from CMyComboBox instead fo CComboBox Index: FlatComboBox.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FlatComboBox.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FlatComboBox.cpp 26 Jul 2004 21:36:00 -0000 1.4 --- FlatComboBox.cpp 16 Oct 2005 12:16:21 -0000 1.5 *************** *** 91,95 **** } ! BEGIN_MESSAGE_MAP(CFlatComboBox, CComboBox) //{{AFX_MSG_MAP(CFlatComboBox) ON_WM_MOUSEMOVE() --- 91,95 ---- } ! BEGIN_MESSAGE_MAP(CFlatComboBox, CMyComboBox) //{{AFX_MSG_MAP(CFlatComboBox) ON_WM_MOUSEMOVE() *************** *** 109,113 **** { SetTimer(FLAT_TIMER, 10, NULL); ! CComboBox::OnMouseMove(nFlags, point); } --- 109,113 ---- { SetTimer(FLAT_TIMER, 10, NULL); ! CMyComboBox::OnMouseMove(nFlags, point); } *************** *** 115,119 **** { m_bLBtnDown = TRUE; ! CComboBox::OnLButtonDown(nFlags, point); } --- 115,119 ---- { m_bLBtnDown = TRUE; ! CMyComboBox::OnLButtonDown(nFlags, point); } *************** *** 122,126 **** m_bLBtnDown = FALSE; Invalidate(); ! CComboBox::OnLButtonUp(nFlags, point); } --- 122,126 ---- m_bLBtnDown = FALSE; Invalidate(); ! CMyComboBox::OnLButtonUp(nFlags, point); } *************** *** 129,133 **** if (nIDEvent != FLAT_TIMER) { ! CComboBox::OnTimer(nIDEvent); return; } --- 129,133 ---- if (nIDEvent != FLAT_TIMER) { ! CMyComboBox::OnTimer(nIDEvent); return; } Index: FlatComboBox.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FlatComboBox.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FlatComboBox.h 26 Jul 2004 21:36:00 -0000 1.4 --- FlatComboBox.h 16 Oct 2005 12:16:21 -0000 1.5 *************** *** 31,34 **** --- 31,36 ---- #endif // _MSC_VER > 1000 + #include "MyComboBox.h" + #define FC_DRAWNORMAL 0x00000001 #define FC_DRAWRAISED 0x00000002 *************** *** 38,42 **** // CFlatComboBox window ! class CFlatComboBox : public CComboBox { // Construction --- 40,44 ---- // CFlatComboBox window ! class CFlatComboBox : public CMyComboBox { // Construction |
From: boca4711 <boc...@us...> - 2005-10-16 12:15:29
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21313 Modified Files: FindComboBox.cpp Log Message: - Added drop down reflection to handle drop down notification Index: FindComboBox.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FindComboBox.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FindComboBox.cpp 10 Jul 2004 19:07:57 -0000 1.5 --- FindComboBox.cpp 16 Oct 2005 12:15:18 -0000 1.6 *************** *** 56,59 **** --- 56,60 ---- ON_CONTROL_REFLECT(CBN_EDITUPDATE, OnEditUpdate) ON_CONTROL_REFLECT(CBN_SETFOCUS, OnSetFocus) + ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown) //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 158,161 **** --- 159,166 ---- bRes = TRUE; break; + + case CBN_DROPDOWN: + bRes = TRUE; + break; } *************** *** 168,172 **** CFindComboBox* pWndCombo = new CFindComboBox; ! if (!pWndCombo->Create (m_dwStyle, rect, pWndParent, m_nID)) { delete pWndCombo; --- 173,177 ---- CFindComboBox* pWndCombo = new CFindComboBox; ! if (!pWndCombo->Create (m_dwStyle | CBS_DROPDOWN, rect, pWndParent, m_nID)) { delete pWndCombo; |
From: boca4711 <boc...@us...> - 2005-10-16 12:13:39
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20904 Modified Files: FileTypeManager.cpp Log Message: - Added EOLfilled mode - Added case of keywords - Added calltips/API - Added autocompletion - Added smart insert ( becomes () - Added smart tab - Modified fold flags - Added caret sticky - Added visual line wrapping Index: FileTypeManager.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/FileTypeManager.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** FileTypeManager.cpp 14 Apr 2005 12:01:42 -0000 1.29 --- FileTypeManager.cpp 16 Oct 2005 12:13:31 -0000 1.30 *************** *** 312,315 **** --- 312,316 ---- if( NULL == pSyntaxFile ) return; + pScintilla->ClearDocumentStyle(); // Clear the Scintilla object // Before we can clear the object first make sure the default style is set. *************** *** 324,327 **** --- 325,330 ---- pScintilla->StyleSetFore( STYLE_DEFAULT, pSyntaxFile->GetStyleColorForeground( STYLE_DEFAULT ) ); pScintilla->StyleSetBack( STYLE_DEFAULT, pSyntaxFile->GetStyleColorBackground( STYLE_DEFAULT ) ); + pScintilla->StyleSetEOLFilled( STYLE_DEFAULT, pSyntaxFile->GetStyleEolFilled( STYLE_DEFAULT ) ); + pScintilla->StyleSetCase( STYLE_DEFAULT, pSyntaxFile->GetStyleCase( STYLE_DEFAULT ) ) ; pScintilla->StyleClearAll(); *************** *** 431,434 **** --- 434,440 ---- pScintilla->StyleSetFore( iCount, pSyntaxFile->GetStyleColorForeground( iCount ) ); pScintilla->StyleSetBack( iCount, pSyntaxFile->GetStyleColorBackground( iCount ) ); + + pScintilla->StyleSetEOLFilled( iCount, pSyntaxFile->GetStyleEolFilled( iCount ) ); + pScintilla->StyleSetCase( iCount, pSyntaxFile->GetStyleCase( iCount ) ) ; } *************** *** 457,460 **** --- 463,469 ---- pScintilla->StyleSetBack( iCount, pSyntaxFile->GetStyleColorBackground( iCount ) ); + pScintilla->StyleSetEOLFilled( iCount, pSyntaxFile->GetStyleEolFilled( iCount ) ); + pScintilla->StyleSetCase( iCount, pSyntaxFile->GetStyleCase( iCount ) ) ; + // With no syntax highlighting we can skip 1 to STYLE_DEFAULT // STYLE_DEFAULT has already been set when we cleared all. *************** *** 463,466 **** --- 472,491 ---- } } + pScintilla->SetVisibleLineNumber(pSyntaxFile->GetMarginLineNumber()); + + pScintilla->SetCalltipIgnoreCase(pSyntaxFile->GetCalltipIgnorecase()); + pScintilla->SetCalltipWordCharacters(pSyntaxFile->GetCalltipWordCharacters()); + pScintilla->SetCalltipParametersStart(pSyntaxFile->GetCalltipParameterStart()); + pScintilla->SetCalltipParametersEnd(pSyntaxFile->GetCalltipParameterEnd()); + pScintilla->SetCalltipParametersSeparator(pSyntaxFile->GetCalltipParameterSeparator()); + pScintilla->SetCalltipEndDefinition(pSyntaxFile->GetCalltipEndDefinition()); + + pScintilla->SetApi(pSyntaxFile->GetApi()); + + pScintilla->SetAutocompIgnoreCase(pSyntaxFile->GetAutocompleteIgnoreCase()); + pScintilla->SetAutocompStartCharacters(pSyntaxFile->GetAutocompleteStartCharacters()); + + pScintilla->SetSmartInsert(pConfigFile->GetSmartInsert()); + pScintilla->SetSmartTab(pConfigFile->GetSmartTab()); // Ok now restyle the document. *************** *** 537,540 **** --- 562,569 ---- pScintilla->DefineMarker(SC_BOOKMARK, SC_MARK_ARROW, RGB(0,0,255), RGB(231,231,255)); pScintilla->DefineMarker(SC_MARK_SHORTARROW, SC_MARK_SHORTARROW, RGB(107,27,18), RGB(251,252,226)); + pScintilla->SetFoldFlags(16 + 4); + pScintilla->SetCaretSticky(true); + pScintilla->SetWrapVisualFlags(SC_WRAPVISUALFLAG_END); + pScintilla->SetWrapVisualFlagsLocation(SC_WRAPVISUALFLAGLOC_END_BY_TEXT); // Set Caret and Visibility Policy |
From: boca4711 <boc...@us...> - 2005-10-16 12:10:19
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19983 Added Files: FilePropWordCount.cpp FilePropWordCount.h Log Message: Page to show statistical file informations. --- NEW FILE: FilePropWordCount.cpp --- // FilePropWordCount.cpp: Implementierungsdatei // #include "stdafx.h" #include "anyedit.h" #include "FilePropWordCount.h" #include "AnyEditDoc.h" #include "AnyEditView.h" #include "FilePropertyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropWordCount CFilePropWordCount::CFilePropWordCount(CWnd* pParent /*=NULL*/) : CPropertyPage(CFilePropWordCount::IDD) { //{{AFX_DATA_INIT(CFilePropWordCount) // HINWEIS: Der Klassen-Assistent fügt hier Elementinitialisierung ein //}}AFX_DATA_INIT m_pFileProp = NULL; } void CFilePropWordCount::DoDataExchange(CDataExchange* pDX) { CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFilePropWordCount) // HINWEIS: Der Klassen-Assistent fügt hier DDX- und DDV-Aufrufe ein //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFilePropWordCount, CPropertyPage) //{{AFX_MSG_MAP(CFilePropWordCount) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CFilePropWordCount BOOL CFilePropWordCount::OnInitDialog() { CPropertyPage::OnInitDialog(); SetDlgItemText(IDC_EDIT_LINEMARKS, _T("1")); SetDlgItemText(IDC_EDIT_WHOLE_WORD, _T("0")); SetDlgItemText(IDC_EDIT_TEXT, _T("0")); SetDlgItemText(IDC_EDIT_COUNT_ALL, _T("0")); SetDlgItemText(IDC_EDIT_RADIO1, _T("")); SetDlgItemText(IDC_EDIT_RADIO2, _T("")); SetDlgItemText(IDC_EDIT_RADIO3, _T("")); SetDlgItemText(IDC_EDIT_RADIO4, _T("")); CString strFileName; if (m_pFileProp) { strFileName = m_pFileProp->m_strTempFilePath; long lCharCount = 0; long lLineCount = 0; long lSpaceCount = 0; long lWordCount = 0; if (!strFileName.IsEmpty() && CountWords(strFileName, lCharCount, lLineCount, lSpaceCount, lWordCount)) { TCHAR szFormat[32] = {0}; wsprintf(szFormat, _T("%d"), lLineCount); SetDlgItemText(IDC_EDIT_LINEMARKS, szFormat); wsprintf(szFormat, _T("%d"), lWordCount); SetDlgItemText(IDC_EDIT_WHOLE_WORD, szFormat); wsprintf(szFormat, _T("%d"), lCharCount); SetDlgItemText(IDC_EDIT_TEXT, szFormat); wsprintf(szFormat, _T("%d"), lSpaceCount + lCharCount); SetDlgItemText(IDC_EDIT_COUNT_ALL, szFormat); } strFileName = m_pFileProp->m_strSelFilePath; if (! strFileName.IsEmpty()) { if (CountWords(strFileName, lCharCount, lLineCount, lSpaceCount, lWordCount)) { TCHAR szFormat[32] = {0}; wsprintf(szFormat, _T("%d"), lLineCount); SetDlgItemText(IDC_EDIT_RADIO1, szFormat); wsprintf(szFormat, _T("%d"), lWordCount); SetDlgItemText(IDC_EDIT_RADIO2, szFormat); wsprintf(szFormat, _T("%d"), lCharCount); SetDlgItemText(IDC_EDIT_RADIO3, szFormat); wsprintf(szFormat, _T("%d"), lSpaceCount + lCharCount); SetDlgItemText(IDC_EDIT_RADIO4, szFormat); } } } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } bool CFilePropWordCount::CountWords(LPCTSTR lpszFileName, long& lCharCount, long& lLineCount, long& lSpaceCount, long& lWordCount) { if (lpszFileName == NULL) return false; ATLASSERT(lpszFileName); lCharCount = 0; lLineCount = 0; lSpaceCount = 0; lWordCount = 0; FILE* pFile = _tfopen(lpszFileName, _T("rb")); if (pFile != NULL) { int c = 0, nState = 0; const int chNewLine = _T('\n'); while ((c = _gettc(pFile)) != EOF) { if (!_istspace(c)) ++lCharCount; if (c == chNewLine) ++lLineCount; if (_istspace(c)) { nState = 0; if (!_istcntrl(c)) ++lSpaceCount; } else if (nState == 0) { nState = 1; ++lWordCount; } } fclose(pFile); return true; } return false; } void CFilePropWordCount::SetFileInfo(CFileProperty *pFileInfo) { m_pFileProp = pFileInfo; } --- NEW FILE: FilePropWordCount.h --- (This appears to be a binary file; contents omitted.) |
From: boca4711 <boc...@us...> - 2005-10-16 12:09:47
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19755 Added Files: FilePropTouch.cpp FilePropTouch.h Log Message: Page to show or modify file timestamps. --- NEW FILE: FilePropTouch.cpp --- // FilePropTouch.cpp: Implementierungsdatei // #include "stdafx.h" #include "anyedit.h" #include "FilePropTouch.h" #include "AnyEditDoc.h" #include "AnyEditView.h" #include "DateTimeFormat.h" #include "FilePropertyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropTouch CFilePropTouch::CFilePropTouch(CWnd* pParent /*=NULL*/) : CPropertyPage(CFilePropTouch::IDD) { //{{AFX_DATA_INIT(CFilePropTouch) // HINWEIS: Der Klassen-Assistent fügt hier Elementinitialisierung ein //}}AFX_DATA_INIT m_pFileProp = NULL; } void CFilePropTouch::DoDataExchange(CDataExchange* pDX) { CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFilePropTouch) DDX_Control(pDX, IDC_EDIT_TIME_OPTIONS, m_wndTime); DDX_Control(pDX, IDC_EDIT_DATE_OPTIONS, m_wndDate); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFilePropTouch, CPropertyPage) //{{AFX_MSG_MAP(CFilePropTouch) ON_WM_TIMER() ON_BN_CLICKED(IDC_EDIT_TOUCH, OnEditTouch) ON_BN_CLICKED(IDC_EDIT_RADIO1, OnEditRadio1) ON_BN_CLICKED(IDC_EDIT_RADIO2, OnEditRadio2) ON_BN_CLICKED(IDC_EDIT_RADIO3, OnEditRadio3) ON_BN_CLICKED(IDC_TOUCH, OnTouch) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CFilePropTouch BOOL CFilePropTouch::OnInitDialog() { CPropertyPage::OnInitDialog(); SetDlgItemText(IDC_EDIT_TIME, _T("")); CheckRadioButton(IDC_EDIT_RADIO1, IDC_EDIT_RADIO3, IDC_EDIT_RADIO1); m_nTimerID = SetTimer(m_nTimerID, 1000, NULL); // if (m_pFileInfo && !m_strFilePath.IsEmpty()) m_strFilePath = m_pFileProp->m_strFilePath; if (!m_strFilePath.IsEmpty()) { CTime objTime; CFileStatus fStatus; CFile::GetStatus(m_strFilePath, fStatus); SetDlgItemText(IDC_EDIT_DEFAULTS, GetDateString(fStatus.m_ctime)); // Update the controls to the current file time m_wndDate.SetTime(&(fStatus.m_ctime)); m_wndTime.SetTime(&(fStatus.m_ctime)); } CString strTime = CTime::GetCurrentTime().Format(_T("Current Time: %X")); //TODO--PAUL-from resource SetDlgItemText(IDC_EDIT_TIME, strTime); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } void CFilePropTouch::OnTimer(UINT nIDEvent) { ASSERT(m_nTimerID == nIDEvent); if (nIDEvent == m_nTimerID) { CString strTime = CTime::GetCurrentTime().Format(_T("Current Time: %X")); //TODO--PAUL-from resource SetDlgItemText(IDC_EDIT_TIME, strTime); } } void CFilePropTouch::OnEditTouch() { SYSTEMTIME stTempDate; // Temporarily holds date data SYSTEMTIME stTempTime; // Temporarily holds date data // Firstly, the Modified Date/Time Info ... // Get the Date info from the DTP m_wndDate.GetTime(&stTempDate); // Get the Time info m_wndTime.GetTime(&stTempTime); // Fill the Date and time CTime objTime(stTempDate.wYear, stTempDate.wMonth, stTempDate.wDay, stTempTime.wHour, stTempTime.wMinute, stTempTime.wSecond); FILETIME ftTouch; TimeToFileTime(objTime, &ftTouch); if (IsDlgButtonChecked(IDC_EDIT_RADIO1)) // change creation time { Touch(m_strFilePath, NULL, NULL, &ftTouch); UpdateControls(1); } else if (IsDlgButtonChecked(IDC_EDIT_RADIO2)) // change modification time { Touch(m_strFilePath, NULL, &ftTouch, NULL); UpdateControls(2); } else if (IsDlgButtonChecked(IDC_EDIT_RADIO3)) // change accessing time { Touch(m_strFilePath, &ftTouch, NULL, NULL); UpdateControls(2); } } // The magic function which does all the touching DWORD CFilePropTouch::Touch(LPCTSTR lpszFile, FILETIME* atime, FILETIME* mtime, FILETIME* ctime) { ASSERT(lpszFile); if (lpszFile == NULL) return 0; SetLastError(ERROR_SUCCESS); HANDLE hFile = CreateFile( lpszFile, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); DWORD dwRetVal = GetLastError(); // Check for CreateFile() special cases if (dwRetVal != ERROR_SUCCESS) { if (dwRetVal == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; // not an error else if(hFile != INVALID_HANDLE_VALUE && dwRetVal == ERROR_ALREADY_EXISTS) dwRetVal = ERROR_SUCCESS; // not an error according to MSDN docs } if(dwRetVal != ERROR_SUCCESS) return dwRetVal; // Is there any template timestamp? if (atime || mtime || ctime) { SetLastError(ERROR_SUCCESS); SetFileTime(hFile, ctime, atime, mtime); dwRetVal = GetLastError(); } CloseHandle(hFile); return dwRetVal; } void CFilePropTouch::OnEditRadio1() { UpdateControls(1); } void CFilePropTouch::OnEditRadio2() { UpdateControls(2); } void CFilePropTouch::OnEditRadio3() { UpdateControls(3); } void CFilePropTouch::UpdateControls(int nRadioButton) { if (!m_strFilePath.IsEmpty()) { CFileStatus fStatus; CFile::GetStatus(m_strFilePath, fStatus); CTime t; switch(nRadioButton) { case 1: t = fStatus.m_ctime; break; case 2: t = fStatus.m_mtime; break; case 3: t = fStatus.m_atime; break; } m_wndDate.SetTime(&t); m_wndTime.SetTime(&t); SetDlgItemText(IDC_EDIT_DEFAULTS, GetDateString(t)); } } CString CFilePropTouch::GetDateString(CTime t) { COleDateTime odt(t.GetTime()); CDateTimeFormat dtf; dtf.SetDateTime(odt); CString strFormat; TCHAR szTemp[MAX_PATH] = {0}; GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, szTemp, MAX_PATH); strFormat = szTemp; GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, szTemp, MAX_PATH); strFormat += _T(", "); strFormat += szTemp; dtf.SetFormat(strFormat); return dtf.GetString(); } void CFilePropTouch::SetFileInfo(CFileProperty *pFileInfo) { m_pFileProp = pFileInfo; } void CFilePropTouch::OnTouch() { // Fill the Date and time CTime objTime = CTime::GetCurrentTime(); FILETIME ftTouch; TimeToFileTime(objTime, &ftTouch); if (IsDlgButtonChecked(IDC_EDIT_RADIO1)) // change creation time { Touch(m_strFilePath, NULL, NULL, &ftTouch); UpdateControls(1); } else if (IsDlgButtonChecked(IDC_EDIT_RADIO2)) // change modification time { Touch(m_strFilePath, NULL, &ftTouch, NULL); UpdateControls(2); } else if (IsDlgButtonChecked(IDC_EDIT_RADIO3)) // change accessing time { Touch(m_strFilePath, &ftTouch, NULL, NULL); UpdateControls(2); } } --- NEW FILE: FilePropTouch.h --- (This appears to be a binary file; contents omitted.) |
From: boca4711 <boc...@us...> - 2005-10-16 12:09:03
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19487 Added Files: FilePropGeneral.cpp FilePropGeneral.h Log Message: Page to show general file informations. --- NEW FILE: FilePropGeneral.h --- (This appears to be a binary file; contents omitted.) --- NEW FILE: FilePropGeneral.cpp --- // FilePropGeneral.cpp: Implementierungsdatei // #include "stdafx.h" #include "anyedit.h" #include "FilePropGeneral.h" #include "AnyEditDoc.h" #include "AnyEditView.h" #include "DateTimeFormat.h" #include "FilePropertyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropGeneral CFilePropGeneral::CFilePropGeneral(CWnd* pParent /*=NULL*/) : CPropertyPage(CFilePropGeneral::IDD) { //{{AFX_DATA_INIT(CFilePropGeneral) m_strFileSize = _T(""); m_strSaveDate = _T(""); m_nIndentSize = 0; m_nTabSize = 0; m_strDescription = _T(""); m_strFilename = _T(""); //}}AFX_DATA_INIT m_hFileIcon = NULL; m_pFileProp = NULL; } void CFilePropGeneral::DoDataExchange(CDataExchange* pDX) { CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFilePropGeneral) DDX_Control(pDX, IDC_EDIT_DEFAULTS, m_iconDefaults); DDX_Control(pDX, IDC_EDIT_SPIN2, m_spinIndent); DDX_Control(pDX, IDC_EDIT_SPIN1, m_spinTab); DDX_Control(pDX, IDC_EDIT_LANGUAGE, m_comboLanguages); DDX_Control(pDX, IDC_EDIT_CRLF_STYLE, m_comboCRLFStyle); DDX_Text(pDX, IDC_EDIT_FILESIZE, m_strFileSize); DDX_Text(pDX, IDC_EDIT_SAVEDDATE, m_strSaveDate); DDX_Text(pDX, IDC_EDIT_INDENTSIZE, m_nIndentSize); DDV_MinMaxUInt(pDX, m_nIndentSize, 1, 32); DDX_Text(pDX, IDC_EDIT_TABSIZE, m_nTabSize); DDV_MinMaxUInt(pDX, m_nTabSize, 1, 32); DDX_Text(pDX, IDC_EDIT_DESCRIPTION, m_strDescription); DDX_Text(pDX, IDC_EDIT_FILENAME, m_strFilename); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFilePropGeneral, CPropertyPage) //{{AFX_MSG_MAP(CFilePropGeneral) ON_CBN_SELCHANGE(IDC_EDIT_LANGUAGE, OnSelchangeEditLanguage) ON_CBN_SELCHANGE(IDC_EDIT_CRLF_STYLE, OnSelchangeEditCrlfStyle) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CFilePropGeneral BOOL CFilePropGeneral::OnInitDialog() { CPropertyPage::OnInitDialog(); if (m_pFileProp) { m_nTabSize = m_pFileProp->m_nTabSize; m_nIndentSize = m_pFileProp->m_nIndentSize; m_nCRLFStyle = m_pFileProp->m_nCRLF; } m_spinTab.SetBuddy(GetDlgItem(IDC_EDIT_TABSIZE)); m_spinTab.SetRange(1, 32); m_spinTab.SetPos(m_nTabSize); m_spinIndent.SetBuddy(GetDlgItem(IDC_EDIT_INDENTSIZE)); m_spinIndent.SetRange(1, 32); m_spinIndent.SetPos(m_nIndentSize); // m_comboCRLFStyle.AddString(_T("Automatic")); //TODO--From resource int nIndex = m_comboCRLFStyle.AddString(_T("Windows (CR LF)")); //TODO--From resource m_comboCRLFStyle.SetItemData(nIndex, SC_EOL_CRLF); nIndex = m_comboCRLFStyle.AddString(_T("Unix (LF)")); //TODO--From resource m_comboCRLFStyle.SetItemData(nIndex, SC_EOL_LF); nIndex = m_comboCRLFStyle.AddString(_T("Macintosh (CR)")); //TODO--From resource m_comboCRLFStyle.SetItemData(nIndex, SC_EOL_CR); for (int i = 0; i < m_comboCRLFStyle.GetCount(); i++) { if (m_comboCRLFStyle.GetItemData(i) == m_nCRLFStyle) { m_comboCRLFStyle.SetCurSel(i); break; } } /* switch (m_nCRLFStyle) { case SC_EOL_CRLF: m_comboCRLFStyle.SetCurSel(1); break; case SC_EOL_LF: m_comboCRLFStyle.SetCurSel(2); break; case SC_EOL_CR: m_comboCRLFStyle.SetCurSel(3); break; default: m_comboCRLFStyle.SetCurSel(0); } */ int nCurrentLexer = 0; CConfigFile* pConfigFile = theApp.GetConfigFile(); ASSERT(pConfigFile != NULL); int iActiveLanguage = -1; iActiveLanguage = m_pFileProp->m_nLanguage; int iNrOfLanguages = pConfigFile->GetLanguageCount(); for(int iCount = 0; iCount < iNrOfLanguages; ++ iCount ) { CString strLanguage(pConfigFile->GetLanguageName( iCount )); if (!strLanguage.IsEmpty()) { int nIndex = m_comboLanguages.AddString(strLanguage); m_comboLanguages.SetItemData(nIndex, (DWORD)iCount); } if (iActiveLanguage == iCount) nCurrentLexer = iCount; } m_comboLanguages.SetCurSel(nCurrentLexer); m_strFilename = m_pFileProp->m_strFilePath; if (!m_strFilename.IsEmpty()) // get and set file properties { SetDlgItemText(IDC_EDIT_FILENAME, m_strFilename); WIN32_FIND_DATA fd; HANDLE hFind = ::FindFirstFile(m_strFilename, &fd); if(hFind != INVALID_HANDLE_VALUE) { int nSizeK = (int)(fd.nFileSizeLow / 1024); // assume it not bigger than 2GB if (nSizeK == 0 && fd.nFileSizeLow != 0) nSizeK = 1; TCHAR szBuff[100]; wsprintf(szBuff, _T("%i KB"), nSizeK); SetDlgItemText(IDC_EDIT_FILESIZE, szBuff); COleDateTime odt(fd.ftLastWriteTime); CDateTimeFormat dtf; dtf.SetDateTime(odt); CString strFormat; TCHAR szTemp[MAX_PATH] = {0}; GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, szTemp, MAX_PATH); strFormat = szTemp; GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, szTemp, MAX_PATH); strFormat += _T(", "); strFormat += szTemp; dtf.SetFormat(strFormat); SetDlgItemText(IDC_EDIT_SAVEDDATE, dtf.GetString()); ::FindClose(hFind); } SHFILEINFO sfi; if (::SHGetFileInfo(m_strFilename, 0, &sfi, sizeof(SHFILEINFO), SHGFI_TYPENAME | SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_LARGEICON)) { m_hFileIcon = sfi.hIcon; m_strDescription = sfi.szTypeName; SetDlgItemText(IDC_EDIT_DESCRIPTION, m_strDescription); m_iconDefaults.SetIcon(m_hFileIcon); } } else { } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } CFilePropGeneral::~CFilePropGeneral() { if (m_hFileIcon != NULL) { ::DestroyIcon(m_hFileIcon); m_hFileIcon = NULL; } } void CFilePropGeneral::SetFileInfo(CFileProperty *pFileInfo) { m_pFileProp = pFileInfo; } void CFilePropGeneral::OnSelchangeEditLanguage() { int nIndex = m_comboLanguages.GetCurSel(); if (nIndex != CB_ERR && m_pFileProp != NULL) { m_pFileProp->m_nLanguage = m_comboLanguages.GetItemData(nIndex); } } void CFilePropGeneral::OnSelchangeEditCrlfStyle() { int nIndex = m_comboCRLFStyle.GetCurSel(); if (nIndex != CB_ERR && m_pFileProp != NULL) { m_pFileProp->m_nCRLF = m_comboCRLFStyle.GetItemData(nIndex); } } BOOL CFilePropGeneral::OnApply() { UpdateData(TRUE); if (m_pFileProp) { m_pFileProp->m_nTabSize = m_nTabSize; m_pFileProp->m_nIndentSize = m_nIndentSize; } return CPropertyPage::OnApply(); } |
From: boca4711 <boc...@us...> - 2005-10-16 12:08:38
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19258 Added Files: FilePropertyDlg.cpp FilePropertyDlg.h Log Message: Dialog to show file properties. --- NEW FILE: FilePropertyDlg.cpp --- // FilePropertyDlg.cpp: Implementierungsdatei // #include "stdafx.h" #include "anyedit.h" #include "FilePropertyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropertyDlg CFilePropertyDlg::CFilePropertyDlg(LPCTSTR pszCaption) : CPropertySheet(pszCaption) { //{{AFX_DATA_INIT(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Elementinitialisierung ein //}}AFX_DATA_INIT m_psh.dwFlags |= PSH_NOAPPLYNOW; } void CFilePropertyDlg::DoDataExchange(CDataExchange* pDX) { CPropertySheet::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier DDX- und DDV-Aufrufe ein //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFilePropertyDlg, CPropertySheet) //{{AFX_MSG_MAP(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Zuordnungsmakros für Nachrichten ein //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CFilePropertyDlg int CFilePropertyDlg::DoModal() { AddPage(&m_pageGeneral); AddPage(&m_pageWordCount); // AddPage(&m_pageEncoding); AddPage(&m_pageTouch); return CPropertySheet::DoModal(); } void CFilePropertyDlg::SetFileInfo(CFileProperty *pFileInfo) { m_pageGeneral.SetFileInfo(pFileInfo); m_pageWordCount.SetFileInfo(pFileInfo); m_pageTouch.SetFileInfo(pFileInfo); } --- NEW FILE: FilePropertyDlg.h --- #if !defined(AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_) #define AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // FilePropertyDlg.h : Header-Datei // #include "FilePropGeneral.h" #include "FilePropWordCount.h" #include "FilePropTouch.h" #include "Shlwapi.h" class CFileProperty { public: CString m_strFilePath; CString m_strTempFilePath; CString m_strSelFilePath; int m_nTabSize; int m_nIndentSize; int m_nCRLF; HWND m_hwndEditor; bool m_bIsSelection; int m_nCodePage; int m_nSimpleEncoding; bool m_bSimpleEncoding; UINT m_nLanguage; /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ CFileProperty() { m_strFilePath = _T(""); m_strTempFilePath = _T(""); m_strSelFilePath = _T(""); m_nTabSize = 4; m_nIndentSize = 4; m_nCRLF = 0; m_hwndEditor = NULL; m_bIsSelection = false; m_nCodePage = 0xFFFF; m_nSimpleEncoding = 0; m_bSimpleEncoding = true; m_nLanguage = NULL; } /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ virtual ~CFileProperty() { if (!m_strTempFilePath.IsEmpty() && ::PathFileExists(m_strTempFilePath)) { ::DeleteFile(m_strTempFilePath); } if (!m_strSelFilePath.IsEmpty() && ::PathFileExists(m_strSelFilePath)) { ::DeleteFile(m_strSelFilePath); } } /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ CFileProperty& operator=(const CFileProperty& opt) { m_strFilePath = opt.m_strFilePath; m_strTempFilePath = opt.m_strTempFilePath; m_strSelFilePath = opt.m_strSelFilePath; m_nTabSize = opt.m_nTabSize; m_nIndentSize = opt.m_nIndentSize; m_nCRLF = opt.m_nCRLF; m_hwndEditor = opt.m_hwndEditor; m_bIsSelection = opt.m_bIsSelection; m_nCodePage = opt.m_nCodePage; m_nSimpleEncoding = opt.m_nSimpleEncoding; m_bSimpleEncoding = opt.m_bSimpleEncoding; m_nLanguage = opt.m_nLanguage; return *this; } }; class CFileProperty; ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropertyDlg class CFilePropertyDlg : public CPropertySheet { // Konstruktion public: void SetFileInfo(CFileProperty* pFileInfo); CScintillaEx* GetScintillaControl(void); CFilePropertyDlg(LPCTSTR pszCaption); // Standardkonstruktor // Dialogfelddaten //{{AFX_DATA(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Datenelemente ein //}}AFX_DATA // Überschreibungen // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CFilePropertyDlg) public: virtual int DoModal(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: CFilePropGeneral m_pageGeneral; CFilePropWordCount m_pageWordCount; CFilePropTouch m_pageTouch; // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Member-Funktionen ein //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. #endif // AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_ |
From: boca4711 <boc...@us...> - 2005-10-16 12:07:14
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18851 Added Files: DateTimeFormat.cpp DateTimeFormat.h Log Message: Class to format date and time in one string. --- NEW FILE: DateTimeFormat.h --- // DateTimeFormat.h: interface for the CDateTimeFormat class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_DATETIMEFORMAT_H__6F7F9D68_B703_4159_9437_5133AAA087B5__INCLUDED_) #define AFX_DATETIMEFORMAT_H__6F7F9D68_B703_4159_9437_5133AAA087B5__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 //! Formats a date and time value // class CDateTimeFormat { public: CDateTimeFormat(); virtual ~CDateTimeFormat(); //! Sets the date time value void SetDateTime(COleDateTime &odt); //! Sets the format string. void SetFormat(LPCTSTR pszFormat); //! Sets the format buffer for in-place formatting. //! This avoids an eventual CString copy on GetString. void SetFormatBuf(LPTSTR pszBuf) {m_pszBuf = pszBuf;} //! Returns the formatted string LPCTSTR GetString() {return m_pszBuf;} protected: void ClearCounters (); void FormatSection (); void FormatDay (); void FormatMonth (); void FormatYear (); void FormatHour (); void FormatAMPM (); void FormatWeek (); void FormatQuarter (); void FormatDigit (int nDigits, int nValue); COleDateTime m_odt; BOOL m_fValid; //!< Is the date valid? int m_nd, //!< Day format m_nM, //!< Month format m_ny, //!< Year format m_nw, //!< Week format m_nq, //!< Quarter format m_ng, //!< Period format m_nh, //!< Hour format (12 hours) m_nH, //!< Hour format (24 hours) m_nm, //!< Minute format m_ns, //!< Seconds format m_nt; //!< Time marker TCHAR m_szRes[256]; //!< Resulting formatted string TCHAR* m_pszBuf; //!< Pointer to buffer (local or not) }; #endif // !defined(AFX_DATETIMEFORMAT_H__6F7F9D68_B703_4159_9437_5133AAA087B5__INCLUDED_) --- NEW FILE: DateTimeFormat.cpp --- // DateTimeFormat.cpp: implementation of the CDateTimeFormat class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "DateTimeFormat.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CDateTimeFormat::CDateTimeFormat() { ClearCounters(); m_szRes[0] = 0; m_pszBuf = m_szRes; } CDateTimeFormat::~CDateTimeFormat() { } void CDateTimeFormat::ClearCounters() { m_nd = m_nM = m_ny = m_nw = m_nq = m_ng = m_nh = m_nH = m_nm = m_ns = m_nt = 0; } // CDateTimeFormat::SetDateTime // // Sets the date and time values // void CDateTimeFormat::SetDateTime(COleDateTime &odt) { if(odt.GetStatus() == COleDateTime::valid) { m_odt = odt; m_fValid = TRUE; } else m_fValid = FALSE; } // CDateTimeFormat::FormatDay // // Formats a day // void CDateTimeFormat::FormatDay() { TCHAR szFmt[128]; LCTYPE lct; LCTYPE lcAbbr[] = { LOCALE_SABBREVDAYNAME7, // Sunday LOCALE_SABBREVDAYNAME1, // Monday LOCALE_SABBREVDAYNAME2, // Tuesday LOCALE_SABBREVDAYNAME3, // Wednesday LOCALE_SABBREVDAYNAME4, // Thursday LOCALE_SABBREVDAYNAME5, // Friday LOCALE_SABBREVDAYNAME6 }; // Saturday LCTYPE lcFull[] = { LOCALE_SDAYNAME7, LOCALE_SDAYNAME1, LOCALE_SDAYNAME2, LOCALE_SDAYNAME3, LOCALE_SDAYNAME4, LOCALE_SDAYNAME5, LOCALE_SDAYNAME6 }; switch(m_nd) { case 1: _stprintf(szFmt, _T("%d"), m_odt.GetDay()); break; case 2: _stprintf(szFmt, _T("%02d"), m_odt.GetDay()); break; case 3: lct = lcAbbr[m_odt.GetDayOfWeek()-1]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, lct, szFmt, 128); break; case 4: lct = lcFull[m_odt.GetDayOfWeek()-1]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, lct, szFmt, 128); break; default: _tcscpy(szFmt, _T("???")); }; _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatWeek // // Formats a week number // void CDateTimeFormat::FormatWeek() { TCHAR szFmt[16]; int nDayOfYear = m_odt.GetDayOfYear(), nWeek; COleDateTime odtFirst(m_odt.GetYear(), 1, 1, 0, 0, 0); nWeek = (nDayOfYear + odtFirst.GetDayOfWeek()) / 7 + 1; switch(m_nw) { case 1: _stprintf(szFmt, _T("%d"), nWeek); break; case 2: _stprintf(szFmt, _T("%02d"), nWeek); break; default: _tcscpy(szFmt, _T("???")); } _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatMonth // // Formats a month // void CDateTimeFormat::FormatMonth() { TCHAR szFmt[128]; LCTYPE lct; LCTYPE lcAbbr[] = { LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2, LOCALE_SABBREVMONTHNAME3, LOCALE_SABBREVMONTHNAME4, LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6, LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8, LOCALE_SABBREVMONTHNAME9, LOCALE_SABBREVMONTHNAME10, LOCALE_SABBREVMONTHNAME11, LOCALE_SABBREVMONTHNAME12, LOCALE_SABBREVMONTHNAME13 }; LCTYPE lcFull[] = { LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3, LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6, LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9, LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12, LOCALE_SMONTHNAME13 }; switch(m_nM) { case 1: _stprintf(szFmt, _T("%d"), m_odt.GetMonth()); break; case 2: _stprintf(szFmt, _T("%02d"), m_odt.GetMonth()); break; case 3: lct = lcAbbr[m_odt.GetMonth()-1]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, lct, szFmt, 127); break; case 4: lct = lcFull[m_odt.GetMonth()-1]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, lct, szFmt, 127); break; default: _tcscpy(szFmt, _T("???")); }; _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatQuarter // // Formats a quarter number // void CDateTimeFormat::FormatQuarter() { TCHAR szFmt[16]; switch(m_nq) { case 1: _stprintf(szFmt, _T("%d"), (m_odt.GetMonth() - 1) / 3 + 1); break; default: _tcscpy(szFmt, _T("???")); } _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatYear // // Formats a year // void CDateTimeFormat::FormatYear() { TCHAR szFmt[16]; switch(m_ny) { case 1: _stprintf(szFmt, _T("%d"), m_odt.GetYear()); break; case 2: _stprintf(szFmt, _T("%02d"), m_odt.GetYear() % 100); break; case 4: _stprintf(szFmt, _T("%04d"), m_odt.GetYear()); break; default: _tcscpy(szFmt, _T("???")); }; _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatHour // // Formats an hour // void CDateTimeFormat::FormatHour() { TCHAR szFmt[16]; int nHour = m_odt.GetHour(); int nDig; // // Check if we are formatting for a 12-hour clock // if(m_nh) { if(nHour > 12) { nHour -= 12; } nDig = m_nh; } else nDig = m_nH; switch(nDig) { case 1: _stprintf(szFmt, _T("%d"), nHour); break; case 2: _stprintf(szFmt, _T("%02d"), nHour); break; default: _tcscpy(szFmt, _T("???")); }; _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatDigit // // Formats numbers like '2' or '02' // void CDateTimeFormat::FormatDigit(int nDigits, int nValue) { TCHAR szFmt[16]; switch(nDigits) { case 1: _stprintf(szFmt, _T("%d"), nValue); break; case 2: _stprintf(szFmt, _T("%02d"), nValue); break; default: _tcscpy(szFmt, _T("???")); }; _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatAMPM // // Inserts the AM / PM symbols // void CDateTimeFormat::FormatAMPM() { TCHAR szFmt[128]; int nHour; if(m_nt > 0 && m_nt < 3) { nHour = m_odt.GetHour(); // Returns a value between 0 and 23 if(nHour >= 12) { GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_S2359, szFmt, 127); } else { GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_S1159, szFmt, 127); } if(m_nt == 1) szFmt[1] = 0; } else { _tcscpy(szFmt, _T("???")); } _tcscat(m_pszBuf, szFmt); } // CDateTimeFormat::FormatSection // // Come here whenever a section is ready to be formatted // void CDateTimeFormat::FormatSection() { CString str; if(m_nd) { FormatDay(); } else if(m_nM) { FormatMonth(); } else if(m_ny) { FormatYear(); } else if(m_nq) { FormatQuarter(); } else if(m_nw) { FormatWeek(); } else if(m_ng) { // Not yet implemented } else if(m_nh || m_nH) { FormatHour(); } else if(m_nm) { FormatDigit(m_nm, m_odt.GetMinute()); } else if(m_ns) { FormatDigit(m_ns, m_odt.GetSecond()); } else if(m_nt) { FormatAMPM(); } else _tcscat(m_pszBuf, _T("???") ); ClearCounters(); } // CDateTimeFormat::SetFormat // // Set and scan the format string // Generates the result string // void CDateTimeFormat::SetFormat(LPCTSTR pszFormat) { LPCTSTR p; TCHAR c = 0; BOOL fFmt = FALSE, // Formatting fLit = FALSE; // Literal characters // TCHAR szChar[2] = {0, 0}, TCHAR szLit[128] = {0}; TCHAR* pLit = szLit; m_pszBuf[0] = 0; // Clear the string the C way ClearCounters(); // Clear the internal counters for(p = pszFormat; *p; p++) { // // Scanning formats? // if(fFmt) { if(*p != c) // Did the format char changed? { if(szLit[0]) { *pLit = 0; _tcscat(m_pszBuf, szLit); pLit = szLit; *pLit = 0; } FormatSection(); // So format the section, fFmt = FALSE; // and say we are not formatting } } c = *p; // // What literal mode? // if(!fLit) { // // Not in literal mode // switch(c) { case _T('d'): m_nd++; fFmt = TRUE; break; case _T('M'): m_nM++; fFmt = TRUE; break; case _T('y'): m_ny++; fFmt = TRUE; break; case _T('g'): m_ng++; fFmt = TRUE; break; case _T('h'): m_nh++; fFmt = TRUE; break; case _T('H'): m_nH++; fFmt = TRUE; break; case _T('m'): m_nm++; fFmt = TRUE; break; case _T('s'): m_ns++; fFmt = TRUE; break; case _T('t'): m_nt++; fFmt = TRUE; break; case _T('w'): m_nw++; fFmt = TRUE; break; case _T('q'): m_nq++; fFmt = TRUE; break; case _T('\''): fLit = TRUE; break; default: *pLit++ = c; break; } } else { // // In literal mode // if(c == _T('\'')) { fLit = FALSE; // Terminate the literal mode *pLit = 0; // Terminate the literal string _tcscat(m_pszBuf, szLit); // Append the literal string pLit = szLit; // Reinitialize the literal string *pLit = 0; } else *pLit++ = c; // Copy character to literal string } } // // Last check for a pending format // if(fFmt) { if(*szLit) { *pLit = 0; _tcscat(m_pszBuf, szLit); } FormatSection(); } } |
From: boca4711 <boc...@us...> - 2005-10-16 12:06:04
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18549 Added Files: DateDlg.cpp DateDlg.h Log Message: Date dialog to insert date in several formats. --- NEW FILE: DateDlg.h --- // datedial.h : header file // // This is a part of the Microsoft Foundation Classes C++ library. // Copyright (c) Microsoft Corporation. All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. ///////////////////////////////////////////////////////////////////////////// // CDateDialog dialog class CDateDialog : public CDialog { // Construction public: static CStringArray* m_pArDateFormats; CDateDialog(CWnd* pParent = NULL); // standard constructor // Attributes static SYSTEMTIME m_time; static LCID m_id; static CListBox* m_pListBox; static BOOL CALLBACK DateFmtEnumProc(LPTSTR lpszFormatString); static BOOL CALLBACK TimeFmtEnumProc(LPTSTR lpszFormatString); // Dialog Data //{{AFX_DATA(CDateDialog) enum { IDD = IDD_DATEDIALOG }; CListBox m_listBox; CString m_strSel; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDateDialog) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: CStringArray m_arDateFormats; // static const DWORD m_nHelpIDs[]; // virtual const DWORD* GetHelpIDs() {return m_nHelpIDs;} // Generated message map functions //{{AFX_MSG(CDateDialog) virtual BOOL OnInitDialog(); afx_msg void OnDblclkDatedialogList(); afx_msg void OnButtonDateDefault(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; --- NEW FILE: DateDlg.cpp --- // datedial.cpp : implementation file // // This is a part of the Microsoft Foundation Classes C++ library. // Copyright (c) Microsoft Corporation. All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #include "stdafx.h" #include "AnyEdit.h" #include "DateDlg.h" #include <winnls.h> #ifdef _DEBUG #undef THIS_FILE static char BASED_CODE THIS_FILE[] = __FILE__; #endif SYSTEMTIME CDateDialog::m_time; LCID CDateDialog::m_id; CListBox* CDateDialog::m_pListBox = NULL; CStringArray* CDateDialog::m_pArDateFormats = NULL; ///////////////////////////////////////////////////////////////////////////// // CDateDialog dialog /* const DWORD CDateDialog::m_nHelpIDs[] = { IDC_DATEDIALOG_LIST, IDH_WORDPAD_TIMEDATE, IDC_STATIC_HEADING, IDH_WORDPAD_TIMEDATE, IDOK, IDH_WORDPAD_TIMEDATE, IDCANCEL, IDH_WORDPAD_TIMEDATE, 0 , 0 }; */ CDateDialog::CDateDialog(CWnd* pParent /*=NULL*/) : CDialog(CDateDialog::IDD, pParent) { //{{AFX_DATA_INIT(CDateDialog) m_strSel = _T(""); //}}AFX_DATA_INIT } void CDateDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDateDialog) DDX_Control(pDX, IDC_DATEDIALOG_LIST, m_listBox); DDX_LBString(pDX, IDC_DATEDIALOG_LIST, m_strSel); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDateDialog, CDialog) //{{AFX_MSG_MAP(CDateDialog) ON_LBN_DBLCLK(IDC_DATEDIALOG_LIST, OnDblclkDatedialogList) ON_BN_CLICKED(IDC_BUTTON_DATE_DEFAULT, OnButtonDateDefault) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDateDialog message handlers BOOL CDateDialog::OnInitDialog() { CDialog::OnInitDialog(); m_pListBox = &m_listBox; // set static member m_pArDateFormats = &m_arDateFormats; m_arDateFormats.RemoveAll(); GetLocalTime(&m_time); m_id = GetUserDefaultLCID(); EnumDateFormats(DateFmtEnumProc, m_id, DATE_SHORTDATE); EnumDateFormats(DateFmtEnumProc, m_id, DATE_LONGDATE); EnumTimeFormats(TimeFmtEnumProc, m_id, 0); m_pListBox = NULL; m_pArDateFormats = NULL; m_listBox.SetCurSel(0); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } BOOL CALLBACK CDateDialog::DateFmtEnumProc(LPTSTR lpszFormatString) { ASSERT(m_pListBox != NULL); TCHAR buf[256]; VERIFY(GetDateFormat(m_id, 0, &m_time, lpszFormatString, buf, 256)); // we can end up with same format because a format with leading // zeroes may be the same as one without when a number is big enough // e.g. 09/10/94 9/10/94 are different but 10/10/94 and 10/10/94 are // the same if (m_pListBox->FindStringExact(-1,buf) == CB_ERR) { int nPos = m_pListBox->AddString(buf); int nIndex = m_pArDateFormats->Add(lpszFormatString); m_pListBox->SetItemData(nPos, nIndex); } return TRUE; } BOOL CALLBACK CDateDialog::TimeFmtEnumProc(LPTSTR lpszFormatString) { ASSERT(m_pListBox != NULL); TCHAR buf[256]; VERIFY(GetTimeFormat(m_id, 0, &m_time, lpszFormatString, buf, 256)); // we can end up with same format because a format with leading // zeroes may be the same as one without when a number is big enough // e.g. 09/10/94 9/10/94 are different but 10/10/94 and 10/10/94 are // the same if (m_pListBox->FindStringExact(-1,buf) == CB_ERR) { int nPos = m_pListBox->AddString(buf); int nIndex = m_pArDateFormats->Add(lpszFormatString); m_pListBox->SetItemData(nPos, nIndex); } return TRUE; } void CDateDialog::OnDblclkDatedialogList() { OnOK(); } void CDateDialog::OnButtonDateDefault() { CConfigFile* pConfigFile = theApp.GetConfigFile(); int nIndex = m_listBox.GetItemData(m_listBox.GetCurSel()); pConfigFile->SetDefaultDateFormat(m_arDateFormats[nIndex]); } |
From: boca4711 <boc...@us...> - 2005-10-16 12:04:43
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17835 Modified Files: ConfigFile.cpp ConfigFile.h Log Message: - Added smart insert; ( becomes () - Added default date format - Added smart tab Index: ConfigFile.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ConfigFile.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ConfigFile.h 12 Oct 2005 18:55:57 -0000 1.23 --- ConfigFile.h 16 Oct 2005 12:04:32 -0000 1.24 *************** *** 49,52 **** --- 49,53 ---- #define TAG_CLASSVIEW "ClassView" #define TAG_INSERTTEXT "InsertText" + #define TAG_DATE_TIME_FORMAT "DateTimeFormat" // General tags *************** *** 87,90 **** --- 88,93 ---- #define TAG_EDITOR_RIGHTEDGECOLUMN "RightEdgeColumn" #define TAG_EDITOR_RIGHTEDGECOLOR "RightEdgeColor" + #define TAG_EDITOR_SMARTINSERT "SmartInsert" + #define TAG_EDITOR_SMARTTAB "SmartTab" // Editor attributes *************** *** 132,135 **** --- 135,141 ---- #define TAG_INSERTTEXT_WORD "Word" + // Date/Time Default + #define TAG_DATE_TIME_DEFAULT "Default" + /** \class CConfigFile * \brief A class with the interface to the AnyEdit config file in XML, derived from CXMLFile *************** *** 146,149 **** --- 152,159 ---- public: + bool SetSmartTab(bool bSmartTab); + bool GetSmartTab(void); + CString GetDefaultDateFormat(void); + bool SetDefaultDateFormat(CString szFormat); DECLARE_DYNAMIC(CConfigFile) *************** *** 498,501 **** --- 508,517 ---- /// Remove all insert text words. bool RemoveInsertTextWords(); + + /// Get smart insert of ([{"' + bool GetSmartInsert(void); + + /// Set smart insert of ([{"' + bool SetSmartInsert(bool bSmartInsert); }; Index: ConfigFile.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ConfigFile.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ConfigFile.cpp 12 Oct 2005 18:55:57 -0000 1.24 --- ConfigFile.cpp 16 Oct 2005 12:04:32 -0000 1.25 *************** *** 1179,1180 **** --- 1179,1210 ---- return m_bModified = true; } + + bool CConfigFile::GetSmartInsert() + { + return GetBoolFromXMLFile( TAG_EDITOR, TAG_EDITOR_SMARTINSERT ); + } + + bool CConfigFile::SetSmartInsert(bool bSmartInsert) + { + return SetBoolToXMLFile( TAG_EDITOR, TAG_EDITOR_SMARTINSERT, bSmartInsert ); + } + + bool CConfigFile::SetDefaultDateFormat(CString szFormat) + { + return SetStringToXMLFile( TAG_DATE_TIME_FORMAT, TAG_DATE_TIME_DEFAULT, szFormat, true ); + } + + CString CConfigFile::GetDefaultDateFormat() + { + return GetStringFromXMLFile( TAG_DATE_TIME_FORMAT, TAG_DATE_TIME_DEFAULT ); + } + + bool CConfigFile::GetSmartTab() + { + return GetBoolFromXMLFile( TAG_EDITOR, TAG_EDITOR_SMARTTAB ); + } + + bool CConfigFile::SetSmartTab(bool bSmartTab) + { + return SetBoolToXMLFile( TAG_EDITOR, TAG_EDITOR_SMARTTAB, bSmartTab ); + } |
From: boca4711 <boc...@us...> - 2005-10-16 12:02:42
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17386 Modified Files: ColorPref.cpp ColorPref.h Log Message: - Added EOLfilled mode Index: ColorPref.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ColorPref.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ColorPref.cpp 6 Apr 2004 09:01:36 -0000 1.8 --- ColorPref.cpp 16 Oct 2005 12:02:32 -0000 1.9 *************** *** 54,57 **** --- 54,58 ---- CSAPrefsSubDlg::DoDataExchange(pDX); //{{AFX_DATA_MAP(CColorPref) + DDX_Control(pDX, IDC_CHECK_EOL_FILLED, m_EolFilled); DDX_Control(pDX, IDC_SAMPLE_TEXT, m_sample); DDX_Control(pDX, IDC_EDIT_LIST, m_colorList); *************** *** 64,72 **** BEGIN_MESSAGE_MAP(CColorPref, CSAPrefsSubDlg) //{{AFX_MSG_MAP(CColorPref) ! ON_WM_CREATE() ! ON_LBN_SELCHANGE(IDC_EDIT_LIST, OnChangeColorList) ! ON_MESSAGE(CPN_SELENDOK,OnColorChange) ! ON_BN_CLICKED(IDC_BUTTON_RESETCOLORS, OnResetAllColors) ! //}}AFX_MSG_MAP END_MESSAGE_MAP() --- 65,74 ---- BEGIN_MESSAGE_MAP(CColorPref, CSAPrefsSubDlg) //{{AFX_MSG_MAP(CColorPref) ! ON_WM_CREATE() ! ON_LBN_SELCHANGE(IDC_EDIT_LIST, OnChangeColorList) ! ON_MESSAGE(CPN_SELENDOK,OnColorChange) ! ON_BN_CLICKED(IDC_BUTTON_RESETCOLORS, OnResetAllColors) ! ON_BN_CLICKED(IDC_CHECK_EOL_FILLED, OnCheckEolFilled) ! //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 106,109 **** --- 108,112 ---- if( -1 == iColor ) iColor = 0; m_BackgroundColors.SetAt( iCount, iColor ); + mapEolFilled.SetAt( iCount, m_pSyntaxFile->GetStyleEolFilled( iCount ) ); ++ iNrOfStyles; } *************** *** 124,127 **** --- 127,131 ---- int iStyleNumber; int iColor; + BOOL bEolFilled; // If the last selected is the same as the current selected *************** *** 138,141 **** --- 142,147 ---- m_ForegroundColors.SetAt( iStyleNumber, m_forecbutton.Color ); m_BackgroundColors.SetAt( iStyleNumber, m_backcbutton.Color ); + mapEolFilled.SetAt( iStyleNumber, m_EolFilled.GetCheck() ); + } *************** *** 148,151 **** --- 154,159 ---- m_BackgroundColors.Lookup( m_colorList.GetItemData( m_colorList.GetCurSel() ), iColor ); m_backcbutton.Color = iColor; + mapEolFilled.Lookup( m_colorList.GetItemData( m_colorList.GetCurSel() ), bEolFilled); + m_EolFilled.SetCheck(bEolFilled); // Make sure the color buttons are enabled. *************** *** 253,256 **** --- 261,265 ---- if( -1 == iColor ) iColor = 0; m_BackgroundColors.SetAt( iCount, iColor ); + mapEolFilled.SetAt( iCount, pSyntaxFile->GetStyleEolFilled( iCount ) ); } *************** *** 269,272 **** --- 278,282 ---- int iColor; int iStyleNumber; + BOOL bEolFilled; POSITION pos; *************** *** 285,289 **** --- 295,320 ---- m_pSyntaxFile->SetStyleColorBackground( iStyleNumber, iColor ); } + pos = mapEolFilled.GetStartPosition(); + for( iCount = 0; iCount < mapEolFilled.GetCount(); ++ iCount ) + { + mapEolFilled.GetNextAssoc( pos, iStyleNumber, bEolFilled ); + m_pSyntaxFile->SetStyleEolFilled( iStyleNumber, (bEolFilled ? true : false)); + } + return bChanged; } + + void CColorPref::OnCheckEolFilled() + { + // Get the style number of the last selected item. + int iStyleNumber = m_colorList.GetItemData( iLastSelected ); + + // Get the style number from the combobox and change the eol_filled value in the eol_filled map + mapEolFilled.SetAt( iStyleNumber, m_EolFilled.GetCheck() ); + + UpdateColorSample(); + + // Tell the parent something changed, so the apply button can be activated + NotifyParentOfChange(); + } Index: ColorPref.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ColorPref.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ColorPref.h 12 Oct 2005 18:55:57 -0000 1.6 --- ColorPref.h 16 Oct 2005 12:02:32 -0000 1.7 *************** *** 48,51 **** --- 48,52 ---- //{{AFX_DATA(CColorPref) enum { IDD = IDD_PREF_COLOR }; + CButton m_EolFilled; CColorStatic m_sample; CListBox m_colorList; *************** *** 67,70 **** --- 68,72 ---- CMap<int, int, int, int> m_ForegroundColors; CMap<int, int, int, int> m_BackgroundColors; + CMap<int, int, BOOL, BOOL> mapEolFilled; void UpdateColorSample(); *************** *** 81,85 **** afx_msg LONG OnColorChange(UINT lParam, LONG wParam); afx_msg void OnResetAllColors(); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; --- 83,88 ---- afx_msg LONG OnColorChange(UINT lParam, LONG wParam); afx_msg void OnResetAllColors(); ! afx_msg void OnCheckEolFilled(); ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; |