From: Ezra B. <ezr...@us...> - 2006-06-07 01:41:33
|
Update of /cvsroot/win32forth/win32forth/apps/Win32ForthIDE In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26474 Modified Files: EdCommand.f EdTabControl.f Main.f ProjectTree.f Added Files: EdHexViewer.f Log Message: Win32ForthIDE updated to use HexViewer to view binary files in project window. EAB Index: Main.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/Main.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.f 5 Jun 2006 09:19:00 -0000 1.1 --- Main.f 7 Jun 2006 01:41:26 -0000 1.2 *************** *** 40,43 **** --- 40,44 ---- 0 value ActiveRemote \ the MDI child window used for remote opening a file from the console 0 value ACCEL-HNDL \ handle of the AcceleratorKeyTable + ReadFile ViewerFile true value CreateBackup? *************** *** 599,603 **** fload ScintillaMDI.f fload ScintillaHyperMDI.f ! \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Define HTML Child Window class --- 600,604 ---- fload ScintillaMDI.f fload ScintillaHyperMDI.f ! fload EdHexViewer.f \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Define HTML Child Window class *************** *** 671,675 **** New> HtmlChild to ActiveChild MDIClientWindow: Frame Start: ActiveChild ; ! :noname ( -- ) \ open a new child window for browsing the source files \ used by 'the class and vocabulary browser' and the --- 672,676 ---- New> HtmlChild to ActiveChild MDIClientWindow: Frame Start: ActiveChild ; ! :noname ( -- ) \ open a new child window for browsing the source files \ used by 'the class and vocabulary browser' and the *************** *** 703,706 **** --- 704,717 ---- then Update ; + : (OpenBinaryFile) ( adr len -- ) + { \ temp$ -- } + MAX-PATH 2 + LocalAlloc: temp$ + temp$ place + temp$ FileNotFound: Frame + if NewHexViewWnd + temp$ count SetFileName: ActiveChild + GetBuffer: ViewerFile Dump: ActiveChild + then Update ; + : (OpenRemoteFile) ( adr len -- ) { \ temp$ -- } *************** *** 844,848 **** init-shared-type ['] sciedit_win32forth-message is win32forth-message ! HandleCmdLine Turnkeyed? IF Begin key drop again THEN ; --- 855,859 ---- init-shared-type ['] sciedit_win32forth-message is win32forth-message ! \+ sysgen HandleCmdLine Turnkeyed? IF Begin key drop again THEN ; Index: ProjectTree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/ProjectTree.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProjectTree.f 5 Jun 2006 09:19:00 -0000 1.1 --- ProjectTree.f 7 Jun 2006 01:41:26 -0000 1.2 *************** *** 156,160 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! ReadFile ViewerFile Rectangle ItemRect --- 156,160 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! Rectangle ItemRect *************** *** 493,508 **** #items: SelectedItem (.) pad +place pad dup +NULL 1+ ! ReleaseBuffer: viewerfile FileExt off else GetName: SelectedItem dup zcount 2dup ".ext-only" 2dup lower FileExt place \ set FileExt ! LoadFile: viewerfile drop GetName: SelectedItem zcount pad place ! pad IDM_OPEN_RECENT_FILE DoCommand then ! \ 0 Settext: TheStatusBar .buildfile SetFocus: self \ ProjectManager.htm item lost focus before false --- 493,508 ---- #items: SelectedItem (.) pad +place pad dup +NULL 1+ ! \ ReleaseBuffer: viewerfile FileExt off else GetName: SelectedItem dup zcount 2dup ".ext-only" 2dup lower FileExt place \ set FileExt ! \ LoadFile: viewerfile drop GetName: SelectedItem zcount pad place ! pad dup IDM_OPEN_RECENT_FILE DoCommand then ! drop ( for now ) \ 0 Settext: TheStatusBar .buildfile SetFocus: self \ ProjectManager.htm item lost focus before false Index: EdCommand.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdCommand.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdCommand.f 5 Jun 2006 09:19:00 -0000 1.1 --- EdCommand.f 7 Jun 2006 01:41:26 -0000 1.2 *************** *** 92,99 **** : OpenRecentFile ( File$ -- ) ! count 2dup IsHtmlFile? ! if (OpenHtmlFile) ! else (OpenSourceFile) ! then ; IDM_OPEN_RECENT_FILE SetCommand : OpenHighlightedFile ( -- ) --- 92,103 ---- : OpenRecentFile ( File$ -- ) ! count LoadFile: ViewerFile 0= ?exit ! GetName: ViewerFile count is-binary-file? ! if (OpenBinaryFile) ! else 2dup IsHtmlFile? ! if (OpenHtmlFile) ! else (OpenSourceFile) ! then ! then ; IDM_OPEN_RECENT_FILE SetCommand : OpenHighlightedFile ( -- ) --- NEW FILE: EdHexViewer.f --- \ HexViewer.F Adapted from FileDump.f cr .( Loading Hex Viewer...) fload apps\promgr\hexviewer.f : is-binary-file? ( -- f ) true \ default GetBuffer: viewerfile 1000 min 0max \ check first 1000 bytes bounds ?do i c@ bl < if i c@ dup 0x0A <> over 0x0D <> and \ not cr or lf swap 0x09 <> and \ not tab char if unloop exit then then loop not ; :Class HexViewChild <Super MDIChild max-path 2 + bytes FileName :M Start: ( parent -- ) New> HexViewer to ChildWindow self to ChildParent 0 FileName ! Start: super ;M :M On_Close: ( -- ) On_Close: super self ActiveChild = if 0 to ActiveChild then UpdateStatusBar EnableToolbar ;M :M SetFileName: ( addr len -- ) FileName place FileName +null UpdateFileName: super ;M :M GetFileName: ( -- addr ) FileName ;M :M SetWindowTitle: ( -- ) GetFileName: self count SetText: super ;M :M ?Modified: ( -- f ) false ;M :M GetFileType: ( -- n ) FT_HTML ;M :M Update: ( -- ) ;M :M Dump: ( addr cnt -- ) Dump: ChildWindow SetWindowTitle: self ;M ;Class : NewHexViewWnd ( -- ) New> HexViewChild to ActiveChild MDIClientWindow: Frame Start: ActiveChild ; \s Index: EdTabControl.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdTabControl.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdTabControl.f 5 Jun 2006 09:19:00 -0000 1.1 --- EdTabControl.f 7 Jun 2006 01:41:26 -0000 1.2 *************** *** 173,176 **** --- 173,178 ---- ClassBrowserWindow cClassTree ClassBrowserWindow cVocTree + int voc-update \ vocabularies already scanned + int class-update \ ditto classes :M ReSize: ( -- ) *************** *** 221,225 **** SW_HIDE Show: cProjectTree SW_HIDE Show: cClassTree ! AddVocabularies: cVocTree SW_SHOW Show: cVocTree ; --- 223,230 ---- SW_HIDE Show: cProjectTree SW_HIDE Show: cClassTree ! voc-update 0= ! if AddVocabularies: cVocTree ! true to voc-update ! then SW_SHOW Show: cVocTree ; *************** *** 229,233 **** SW_HIDE Show: cProjectTree SW_HIDE Show: cVocTree ! AddClasses: cClassTree SW_SHOW Show: cClassTree ; --- 234,241 ---- SW_HIDE Show: cProjectTree SW_HIDE Show: cVocTree ! class-update 0= ! if AddClasses: cClassTree ! true to class-update ! then SW_SHOW Show: cClassTree ; *************** *** 267,270 **** --- 275,280 ---- :M On_Init: ( -- ) + 0 to class-update + 0 to voc-update self Start: cTab self Start: cFileList |