Changeset 878
- Timestamp:
- Nov 26, 2007, 2:20:00 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
HISTORY (modified) (1 diff)
-
dll/defview.c (modified) (1 diff)
-
dll/fm3dlg.h (modified) (1 diff)
-
dll/fm3dll.str (modified) (3 diffs)
-
dll/fm3res.rc (modified) (3 diffs)
-
dll/fm3str.h (modified) (4 diffs)
-
dll/init.c (modified) (1 diff)
-
dll/mle.h (modified) (3 diffs)
-
dll/notebook.c (modified) (2 diffs)
-
dll/viewer.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r872 r878 2 2 3 3 3.09(pre) 4 o Correct hex edit buffer sizing to avoid data loss 5 o Use CopyPresParams to fix presparam inconsistencies in menus 6 o Correct variable cast to fix hex code display problem 4 o Add "Save as" menu item to internal viewer (Gregg) 5 o Eliminate deletion of ext path if it was not valid on startup 6 allow saving of a currently not valid ext path with warning (Gregg) 7 o Internal editor now handles readonly files (Gregg) 8 o Correct hex edit buffer sizing to avoid data loss (Steven) 9 o Use CopyPresParams to fix presparam inconsistencies in menus (Gregg) 10 o Correct variable cast to fix hex code display problem (Gregg) 7 11 8 12 3.08 -
trunk/dll/defview.c
r793 r878 309 309 WINDOWED | SEPARATE | 310 310 ((fViewChild) ? CHILD : 0), NULL, dummy, NULL); 311 } 311 } 312 else if (fUseNewViewer) { 313 if (fExternalViewer || strcmp(realappname, FM3Str)) 314 hwndParent = HWND_DESKTOP; 315 StartViewer(hwndParent, 5, filename, hwndFrame); 316 } 312 317 else 313 318 StartMLEEditor(hwndParent, 5, filename, hwndFrame); -
trunk/dll/fm3dlg.h
r828 r878 329 329 #define MLE_VIEWHTTP 21741 330 330 #define MLE_VIEWFTP 21742 331 #define MLE_EXPORTAS 21743 331 332 332 333 #define SRCH_FRAME 21800 -
trunk/dll/fm3dll.str
r846 r878 331 331 No files found. 332 332 FM/2: View HELP files 333 \nModule: %s Line number: %u 333 \nModule: %s Line number: %u 334 334 Error Message Information 335 335 \nModule: %s Line number: %u\nOS/2 error: %d\nClass: %s\nAction: %s\nLocation: %s … … 876 876 877 877 Fatal Error: 878 878 %s is not a valid directory\nDo you wish to delete it? 879 879 Version: 880 880 FM/2 Lite … … 1005 1005 %lu bytes/sector, %lu sector%s/unit 1006 1006 Stats not meaningful 1007 %s is marked Read Only\n You will need to change its name to save.\n Select: yes to continue, no to open in viewer 1008 %s is marked Read Only\n You will need to change its name to save. 1007 1009 $Id$ -
trunk/dll/fm3res.rc
r833 r878 28 28 30 Aug 07 SHL Add accelerator support to QuickList windows 29 29 05 Sep 07 SHL Small change for OpenWatcom wrc compat 30 26 Nov 07 GKY Added "Save as" to internal editor 30 31 31 32 ***********************************************************************/ … … 1730 1731 MENUITEM "~Insert file...\tCtrl + i", MLE_INSERTFILE 1731 1732 MENUITEM "~Save file...\tCtrl + s", MLE_EXPORTFILE 1733 MENUITEM "Save ~as...\tCtrl + e", MLE_EXPORTAS 1732 1734 MENUITEM "~Change filename...\tCtrl + c", MLE_SETEXPORTFILE 1733 1735 MENUITEM "", -1, MIS_SEPARATOR … … 1850 1852 "R", MLE_TOGGLEREADONLY, CONTROL,SHIFT 1851 1853 "s", MLE_EXPORTFILE, CONTROL 1854 "e", MLE_EXPORTAS, CONTROL 1852 1855 "f", MLE_FINDFIRST, CONTROL 1853 1856 "I", MLE_SENSITIVE, SHIFT,CONTROL -
trunk/dll/fm3str.h
r603 r878 16 16 31 Mar 07 GKY Removed IDS_WC window class names 17 17 06 Apr 07 GKY Add error message for drg work around 18 26 Nov 07 GKY Added new readonly in editor & ext path 18 19 19 20 ***********************************************************************/ … … 25 26 // Last string reserved for cvs id 26 27 27 #define IDS_NUMSTRS 100 728 #define IDS_NUMSTRS 1009 28 29 29 30 #define IDS_OPENBUTTONHELP 0 … … 843 844 #define IDS_USUALDISCTEXT 860 844 845 #define IDS_FATALERRORTEXT 876 846 #define IDS_EXTPATHNOTVALIDTEXT 877 845 847 #define IDS_VERSIONTEXT 878 846 848 #define IDS_FM2LITETEXT 879 … … 969 971 #define IDS_SECTORSTEXT 1004 970 972 #define IDS_STATSMEANINGLESSTEXT 1005 973 #define IDS_EDITREADONLYFILETEXT 1006 974 #define IDS_EDITREADONLYFILETEXT2 1007 -
trunk/dll/init.c
r875 r878 37 37 01 Sep 07 GKY Use xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundry 38 38 10 Nov 07 GKY Get thousands separator from country info for file sizes. 39 26 Nov 07 GKY Eliminate check of ext path on start up 39 40 40 41 ***********************************************************************/ -
trunk/dll/mle.h
r551 r878 1 /**************************************************************************/ 2 /* MLE text editor/viewer source code */ 3 /* copyright (c) 1993 by M. Kimes */ 4 /* All rights reserved */ 5 /**************************************************************************/ 1 /*********************************************************************** 2 3 $Id$ 4 5 headers for internal viewer/editor 6 7 Copyright (c) 1993-98 M. Kimes 8 Copyright (c) 2002, 2006 Steven H. Levine 9 10 26 Nov 07 Add items to XMLEWNDPTR struct for "Save as" & readonly file handling 11 12 ***********************************************************************/ 6 13 7 14 /* MLE support macros */ … … 235 242 CHAR exportfilename[1027]; 236 243 CHAR importfilename[1027]; 244 BOOL fileattrreadonly; 237 245 FATTRS fattrs; 238 246 ULONG cp; … … 240 248 ULONG lastpos; 241 249 BOOL killme; 250 BOOL saveas; 242 251 BOOL dontclose; 243 252 HWND hwndRestore, hwndFrame, hwndParent; -
trunk/dll/notebook.c
r876 r878 20 20 19 Aug 07 SHL Sync with SaveDirCnrState mods 21 21 21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the rigth to the left pane 22 26 Nov 07 GKY Allow a currently nonvalid path in the ext path field with warning 22 23 23 24 ***********************************************************************/ … … 207 208 if (IsFile(extractpath)) { 208 209 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 209 "Bad pathname", "%s is not a valid directory\nDo you wish to delete it?", 210 GetPString(IDS_WARNINGTEXT), 211 GetPString(IDS_EXTPATHNOTVALIDTEXT), 210 212 extractpath); 211 213 if (ulResult == MBID_YES) -
trunk/dll/viewer.c
r847 r878 14 14 30 Mar 07 GKY Remove GetPString for window class names 15 15 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 16 26 Nov 07 GKY Allow open of readonly files in the editor with warning 17 26 Nov 07 GKY Add "Save as" menu option to editor 16 18 17 19 ***********************************************************************/ … … 64 66 XMLEWNDPTR *vw; 65 67 ULONG flFrameFlags = FCF_SYSMENU | FCF_SIZEBORDER | FCF_ICON | 66 FCF_TITLEBAR | FCF_MINMAX | FCF_MENU | FCF_ACCELTABLE | FCF_NOBYTEALIGN; 68 FCF_TITLEBAR | FCF_MINMAX | FCF_MENU | FCF_ACCELTABLE | FCF_NOBYTEALIGN; 69 ULONG ulResult; 70 BOOL OpenInViewer = FALSE, readonly = FALSE; 71 FILESTATUS3 fs3; 67 72 68 73 if (fExternalViewer || strcmp(realappname, FM3Str)) 69 74 hwndClient = HWND_DESKTOP; 70 if ((flags & 1) && fUseNewViewer) 71 return StartViewer(hwndClient, (USHORT) flags, filename, hwndRestore); 75 DosQueryPathInfo(filename, FIL_STANDARD, &fs3, sizeof(fs3)); 76 if (fs3.attrFile & FILE_READONLY) { 77 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 78 GetPString(IDS_WARNINGTEXT), 79 GetPString(IDS_EDITREADONLYFILETEXT), 80 filename); 81 switch (ulResult){ 82 case MBID_YES:{ 83 readonly = TRUE; 84 break; 85 } 86 87 case MBID_NO: 88 if (fUseNewViewer) 89 return StartViewer(hwndClient, (USHORT) flags, filename, hwndRestore); 90 else{ 91 OpenInViewer = TRUE; 92 break; 93 } 94 95 case MBID_CANCEL: 96 return (HWND) 0; 97 } 98 } 72 99 73 100 vw = xmallocz(sizeof(XMLEWNDPTR), pszSrcFile, __LINE__); … … 75 102 return (HWND) 0; 76 103 vw->size = sizeof(XMLEWNDPTR); 104 if (readonly) 105 vw->fileattrreadonly = TRUE; 106 else 107 vw->fileattrreadonly = FALSE; 77 108 if (flags & 1) { 78 109 if (flags & 8) … … 95 126 flFrameFlags |= FCF_TASKLIST; 96 127 hwndFrame = WinCreateStdWindow(hwndClient, 97 WS_VISIBLE,128 0, 98 129 &flFrameFlags, 99 130 WC_MLEEDITOR, 100 131 NullStr, 101 WS_VISIBLE |fwsAnimate,132 fwsAnimate, 102 133 FM3ModHandle, MLE_FRAME, &hwnd); 103 134 if (hwndFrame) { … … 143 174 SWP_ACTIVATE); 144 175 } 145 MLEsetreadonly(hwndMLE, ((flags & 1) != 0)); 176 if (OpenInViewer | (flags & 1)) 177 MLEsetreadonly(hwndMLE, ((flags & 1) != 0)); 146 178 WinSetWindowPtr(hwnd, QWL_USER, (PVOID) vw); 147 179 if (!PostMsg(hwnd, UM_SETUP, MPVOID, MPFROMLONG(hwndClient))) … … 731 763 if (temp == MBID_CANCEL) 732 764 break; 733 if (temp == MBID_YES) 765 if (temp == MBID_YES){ 734 766 WinSendMsg(hwnd, 735 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 767 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 768 if (vw->fileattrreadonly) { 769 temp = saymsg(MB_OKCANCEL | MB_ICONEXCLAMATION, 770 hwnd, NullStr, "File is readonly and has not been saved"); 771 if (temp == MBID_CANCEL) 772 return 0; 773 } 774 } 736 775 } 737 776 MLEclearall(hwndMLE); … … 770 809 break; 771 810 811 case MLE_EXPORTAS: 812 vw->saveas = TRUE; 813 WinSendMsg(hwnd, 814 WM_COMMAND, MPFROM2SHORT(MLE_SETEXPORTFILE, 0), MPVOID); 815 break; 816 772 817 case IDM_RENAME: 773 818 case MLE_SETEXPORTFILE: 774 819 if (vw && !MLEgetreadonly(hwndMLE)) { 775 820 776 CHAR filename[1027]; 821 CHAR filename[1027]; 822 ULONG ulResult; 777 823 778 824 strcpy(filename, vw->exportfilename); 779 if (export_filename(hwnd, filename, 1)) {825 if (export_filename(hwnd, filename, !vw->fileattrreadonly)) { 780 826 if (stricmp(filename, vw->exportfilename)) { 781 vw->ch = TRUE; 782 MLEsetchanged(hwndMLE, TRUE); 827 vw->ch = TRUE; 828 vw->fileattrreadonly = FALSE; 829 MLEsetchanged(hwndMLE, TRUE); 783 830 strcpy(vw->exportfilename, filename); 784 WinSendMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 785 } 831 WinSendMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 832 if (vw->saveas) { 833 vw->saveas = FALSE; 834 WinSendMsg(hwnd, 835 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 836 } 837 } 838 else if (vw->fileattrreadonly){ 839 ulResult = saymsg(MB_OKCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 840 GetPString(IDS_WARNINGTEXT), 841 GetPString(IDS_EDITREADONLYFILETEXT2), 842 filename); 843 if (ulResult == MBID_OK){ 844 WinSendMsg(hwnd, 845 WM_COMMAND, MPFROM2SHORT(MLE_SETEXPORTFILE, 0), MPVOID); 846 break; 847 } 848 else 849 vw->saveas = FALSE; 850 } 851 else if (vw->saveas = TRUE) { 852 vw->saveas = FALSE; 853 WinSendMsg(hwnd, 854 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 855 } 786 856 } 787 857 } … … 789 859 790 860 case MLE_EXPORTFILE: 861 if (vw->fileattrreadonly){ 862 WinSendMsg(hwnd, 863 WM_COMMAND, MPFROM2SHORT(MLE_SETEXPORTFILE, 0), MPVOID); 864 break; 865 } 791 866 if (!MLEgetreadonly(hwndMLE)) { 792 867 … … 807 882 FILE *fp; 808 883 809 fp = xfopen(vw->exportfilename, "r+", pszSrcFile, __LINE__);884 fp = fopen(vw->exportfilename, "r+"); //, pszSrcFile, __LINE__); 810 885 if (fp) { 811 886 oldsize = filelength(fileno(fp)); … … 942 1017 943 1018 strcpy(filename, vw->exportfilename); 944 if (export_filename(hwnd, filename, 1))1019 if (export_filename(hwnd, filename, !vw->fileattrreadonly)) 945 1020 MLEdoblock(hwndMLE, WRITE, filename); 946 1021 } … … 1138 1213 if (temp == MBID_CANCEL) 1139 1214 return 0; 1140 if (temp == MBID_YES) 1215 if (temp == MBID_YES){ 1141 1216 WinSendMsg(hwnd, 1142 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 1217 WM_COMMAND, MPFROM2SHORT(MLE_EXPORTFILE, 0), MPVOID); 1218 if (vw->fileattrreadonly) { 1219 temp = saymsg(MB_OKCANCEL | MB_ICONEXCLAMATION, 1220 hwnd, NullStr, "File is readonly and has not been saved"); 1221 if (temp == MBID_CANCEL) 1222 return 0; 1223 } 1224 } 1143 1225 } 1144 1226 }
Note:
See TracChangeset
for help on using the changeset viewer.
