From: Dirk B. <db...@us...> - 2006-06-11 09:03:50
|
Update of /cvsroot/win32forth/win32forth/apps/Win32ForthIDE In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26541/apps/Win32ForthIDE Modified Files: CommandID.f EdCommand.f EdMenu.f EdTabControl.f Main.f ProjectTree.f Log Message: Some more work on the ProjectManger within the IDE. Index: EdTabControl.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdTabControl.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EdTabControl.f 9 Jun 2006 11:44:56 -0000 1.7 --- EdTabControl.f 11 Jun 2006 09:03:45 -0000 1.8 *************** *** 198,207 **** ReSize: self ;M - :M AutoSize: ( -- ) - \ *G Resize the control to fit in the client area of the parent window. - tempRect.AddrOf GetClientRect: Parent - 0 0 Right: tempRect Bottom: tempRect \ x,y,h,w - Move: self ;M - : ShowFiles ( -- ) SW_SHOW Show: cFileList \ show before hide --- 198,201 ---- Index: EdMenu.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdMenu.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EdMenu.f 10 Jun 2006 17:26:44 -0000 1.7 --- EdMenu.f 11 Jun 2006 09:03:45 -0000 1.8 *************** *** 84,89 **** MenuItem "&Rename...\tCtrl+R" IDM_RENAME_PRJ DoCommand ; MenuSeparator ! MenuItem "&Build \tCtrl+B" IDM_BUILD_PRJ DoCommand ; ! MenuItem "Set search &path for build..." IDM_SET_BUILD_PATH_PRJ DoCommand ; \ MenuSeparator \ MenuItem "&Compile \tF12" IDM_COMPILE_PRJ DoCommand ; --- 84,91 ---- MenuItem "&Rename...\tCtrl+R" IDM_RENAME_PRJ DoCommand ; MenuSeparator ! MenuItem "&Build \tCtrl+B" IDM_BUILD_PRJ DoCommand ; ! MenuItem "&Rebuild \tCtrl+B" IDM_REBUILD_PRJ DoCommand ; ! \ MenuItem "Set build file\tCtrl+B" IDM_SET_BUILD_FILE_PRJ DoCommand ; ! \ MenuItem "Set search &path for build..." IDM_SET_BUILD_PATH_PRJ DoCommand ; \ MenuSeparator \ MenuItem "&Compile \tF12" IDM_COMPILE_PRJ DoCommand ; *************** *** 133,137 **** :MenuItem mp_efle "&Ensure final line ending" IDM_ENSURE_FINAL_LINE_ENDING DoCommand ; MenuSeparator ! :MenuItem mp_sabcompile "&Save all files before Compile" IDM_SAVE_ALL_BEFORE_COMPILE DoCommand ; MenuSeparator :MenuItem mp_tabs "&Set Tab options..." IDM_TABS DoCommand ; --- 135,141 ---- :MenuItem mp_efle "&Ensure final line ending" IDM_ENSURE_FINAL_LINE_ENDING DoCommand ; MenuSeparator ! :MenuItem mp_sabcompile "&Save all files before Compile" IDM_SAVE_ALL_BEFORE_COMPILE DoCommand ; ! :MenuItem mp_compileproject "&Always compile main Project file" IDM_COMPILE_PROJECT DoCommand ; ! MenuSeparator :MenuItem mp_tabs "&Set Tab options..." IDM_TABS DoCommand ; *************** *** 143,146 **** --- 147,151 ---- Popup "&Win32Forth" :MenuItem mp_compile "&Compile\tF12" IDM_COMPILE DoCommand ; + MenuSeparator :MenuItem mp_debug "&Debug...\tF11" IDM_DEBUG DoCommand ; :MenuItem mp_HandleW32FMsg "&Handle debug messages?" IDM_HANDLEW32FMSG DoCommand ; *************** *** 273,279 **** \ Win32Forth menu - dup Enable: mp_compile dup Enable: mp_debug - \ dup Enable: mp_HandleW32FMsg \ Help menu --- 278,282 ---- *************** *** 282,285 **** --- 285,301 ---- drop ; + : CompileActiveChild? ( -- f ) + ActiveChild + if GetTextLength: ActiveChild + else false + then ; + + : Compile? ( -- f ) + CompileProject? + if GetBuildFile: TheProject nip 0= + if CompileActiveChild? else true then + else CompileActiveChild? + then ; + : EnableMenuBar ( -- ) \ enable/disable the menu items IsEditWnd? dup EnableEdit *************** *** 331,344 **** \ Options menu ! EOL SC_EOL_CRLF = Check: mf_windows ! EOL SC_EOL_LF = Check: mf_unix ! EOL SC_EOL_CR = Check: mf_mac ! CreateBackup? Check: mp_backup ! SaveAllBeforeCompile? Check: mp_sabcompile StripTrailingWhitespace? Check: mp_rtwh FinalNewLine? Check: mp_efle \ Win32Forth menu - GetTextLength: ActiveChild Enable: mp_compile ActiveRemote ActiveChild = HandleW32FMsg? and Enable: mp_debug HandleW32FMsg? Check: mp_HandleW32FMsg --- 347,359 ---- \ Options menu ! EOL SC_EOL_CRLF = Check: mf_windows ! EOL SC_EOL_LF = Check: mf_unix ! EOL SC_EOL_CR = Check: mf_mac ! CreateBackup? Check: mp_backup ! SaveAllBeforeCompile? Check: mp_sabcompile StripTrailingWhitespace? Check: mp_rtwh FinalNewLine? Check: mp_efle \ Win32Forth menu ActiveRemote ActiveChild = HandleW32FMsg? and Enable: mp_debug HandleW32FMsg? Check: mp_HandleW32FMsg *************** *** 349,356 **** then ! ShowToolbar? Check: mp_showtb ! ShowStatusbar? Check: mp_showsb ! ShowToolbar? Enable: mp_customizetb ! ForthForm? Enable: me_addforms ActiveChild 0<> dup Enable: mf_saveall --- 364,373 ---- then ! ShowToolbar? Check: mp_showtb ! ShowStatusbar? Check: mp_showsb ! ShowToolbar? Enable: mp_customizetb ! ForthForm? Enable: me_addforms ! CompileProject? Check: mp_compileproject ! Compile? Enable: mp_compile ActiveChild 0<> dup Enable: mf_saveall Index: ProjectTree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/ProjectTree.f,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ProjectTree.f 10 Jun 2006 17:26:44 -0000 1.6 --- ProjectTree.f 11 Jun 2006 09:03:45 -0000 1.7 *************** *** 19,23 **** 0 value ThisList \ temp pointer to list being used 0 value ThisItem \ temp pointer to new item - 0 value TheProject 0 value TheStatusBar 0 value dirty? --- 19,22 ---- *************** *** 128,141 **** :m handle: ( -- n ) ! hwndlist ;m ! :m ishandle: ( hwnd -- ) ! to hwndlist ;m :m itemid: ( -- f ) ! itemid ;m :m isitemid: ( f -- ) ! to itemid ;m :m setname: ( addr cnt -- ) --- 127,140 ---- :m handle: ( -- n ) ! hwndlist ;m ! :m ishandle: ( hwnd -- ) ! to hwndlist ;m :m itemid: ( -- f ) ! itemid ;m :m isitemid: ( f -- ) ! to itemid ;m :m setname: ( addr cnt -- ) *************** *** 177,226 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - - Rectangle ItemRect - :class ProjectTreeViewControl <super TreeViewControl - : SendMessage ( lParam wParam message -- result ) hWnd Call SendMessage ; - : SendMessageDrop ( lParam wParam message -- ) SendMessage drop ; - - :M InsertItem: ( -- hItem ) tvins 0 TVM_INSERTITEM SendMessage ;M - :M SetImageList: ( himl iImage -- ) TVM_SETIMAGELIST SendMessageDrop ;M - :M DeleteItem: ( hItem -- f ) 0 TVM_DELETEITEM SendMessage ;M - :M SetItem: ( -- ) tvitem 0 TVM_SETITEM SendMessageDrop ;M - :M Expand: ( hItem f -- ) TVM_EXPAND SendMessageDrop ;M - \ :M ToggleExpandItem: ( hItem -- ) TVE_TOGGLE Expand: self ;M - :M CollapseReset: ( hItem -- ) TVE_COLLAPSERESET TVE_COLLAPSE or Expand: self ;M - :M GetItemRect: ( hItem -- f ) ItemRect ! ItemRect true TVM_GETITEMRECT SendMessage ;M - :M SelectItem: ( hItem -- ) TVGN_CARET TVM_SELECTITEM SendMessageDrop ;M - :M GetNextItem: ( hItem -- h ) TVM_GETNEXTITEM SendMessage ;M - :M GetRoot: ( -- hItem ) 0 TVGN_ROOT GetNextItem: self ;M - :M GetChild: ( hItem -- hItem ) TVGN_CHILD GetNextItem: self ;M - :M GetParentItem: ( hItem -- hItem ) TVGN_PARENT GetNextItem: self ;M - :M GetNext: ( hItem -- hItem ) TVGN_NEXT GetNextItem: self ;M - :M GetPrevious: ( hItem -- hItem ) TVGN_PREVIOUS GetNextItem: self ;M - int maxwidth - : ItemWidthMax ( hItem -- hItem ) - dup GetItemRect: self IF right: ItemRect maxwidth max to maxwidth THEN ; - - :M GetMaxWidth: ( -- n ) - 0 to MaxWidth - GetRoot: self - ItemWidthMax - GetChild: self - Begin dup dup - While - ItemWidthMax - GetChild: self - Begin dup - While - ItemWidthMax - GetNext: self - Repeat drop - GetNext: self - Repeat drop drop - MaxWidth - ;M - File ProjectFile load-bitmap imagelist "treeimages.bmp" --- 176,181 ---- *************** *** 263,269 **** 33 bytes projectname ! : GenerateID ( -- ) ! TreeId to id ! 1 +to TreeId ; :M MainList: ( -- list ) --- 218,224 ---- 33 bytes projectname ! : GenerateID ( -- ) ! TreeId to id ! 1 +to TreeId ; :M MainList: ( -- list ) *************** *** 288,299 **** DocList ;M ! : ?itemimages ( -- i1 i2 ) \ i2= normal image, i1=image to display when selected ThisList case ! ResList of 4 4 endof ! FormList of 5 5 endof ! ModuleList of 3 3 endof ! DLLList of 6 6 endof ! 2 2 rot endcase ; --- 243,254 ---- DocList ;M ! : ?itemimages ( -- i1 i2 ) \ i2= normal image, i1=image to display when selected ThisList case ! ResList of 4 4 endof ! FormList of 5 5 endof ! ModuleList of 3 3 endof ! DLLList of 6 6 endof ! 2 2 rot endcase ; *************** *** 308,313 **** then to pszText ThisItem to lparam ! ?itemimages to iImage ! to iSelectedImage [ TVIF_TEXT TVIF_CHILDREN or TVIF_PARAM or TVIF_IMAGE or TVIF_SELECTEDIMAGE or ] literal to mask tvitem->tvins --- 263,272 ---- then to pszText ThisItem to lparam ! ! GetName: ThisItem zcount mainfile count ISTR= ! if 7 7 \ display the main project file with a different icon ! else ?itemimages ! then to iImage to iSelectedImage ! [ TVIF_TEXT TVIF_CHILDREN or TVIF_PARAM or TVIF_IMAGE or TVIF_SELECTEDIMAGE or ] literal to mask tvitem->tvins *************** *** 320,324 **** self IsParentTree: ThisItem AddChildItem ! 1 +to #addedfiles ; :M AddItem: ( str cnt parentlist -- ) --- 279,284 ---- self IsParentTree: ThisItem AddChildItem ! 1 +to #addedfiles ! ; :M AddItem: ( str cnt parentlist -- ) *************** *** 390,393 **** --- 350,363 ---- ; + :M SortParentLists: ( -- ) + \ Sort the content of the lists + handle: modulelist SortChildren: self + handle: formlist SortChildren: self + handle: DLLList SortChildren: self + handle: auxlist SortChildren: self + handle: reslist SortChildren: self + handle: doclist SortChildren: self + ;M + :m SetProjectName: ( addr cnt -- ) projectname 33 erase *************** *** 724,727 **** --- 694,698 ---- Rename: TheProject SetFocus: TheProject + SortParentLists: TheProject SetProjectTitle reset-results *************** *** 828,862 **** : add-tree-file { \ sitem -- } ! \ add one or more files SelectedItem 0= ?exit SelectedItem dup itemid: [ ] 0= \ if child selected ! if parentitem: [ ] \ use its parent ! then to sitem SelectAFile c@ ! if #SelectedFiles: GetFilesDialog 0 ! do i GetFile: GetFilesDialog sitem AddItem: TheProject ! loop ! Handle: ThisItem SelectItem: TheProject ! true to Modified ! else drop ! then ! ; IDM_ADD_PRJ SetCommand : delete-item ( -- ) ! \ Delete a file from the project ! Delete: TheProject ; IDM_DELETE_PRJ SetCommand : AddForms ( -- ) ! \ Get open forms from ForthForm ! ForthForm? if 0 WANT_FORMS win32forth-message then ! ; IDM_ADD_FORMS_PRJ SetCommand create datfile ," projectpath.dat" : save-path-to-file ( -- ) ! prognam>pad datfile count pad +place ! pad count w/o create-file ! if drop exit ! then >r path-ptr count r@ write-line drop ! r> close-file drop ; : set-build-path ( -- ) --- 799,835 ---- : add-tree-file { \ sitem -- } ! \ Add one or more files to the project SelectedItem 0= ?exit SelectedItem dup itemid: [ ] 0= \ if child selected ! if parentitem: [ ] \ use its parent ! then to sitem SelectAFile c@ ! if #SelectedFiles: GetFilesDialog 0 ! do i GetFile: GetFilesDialog sitem AddItem: TheProject ! loop ! Handle: ThisItem SelectItem: TheProject ! SortParentLists: TheProject ! true to Modified ! else drop ! then ; IDM_ADD_PRJ SetCommand : delete-item ( -- ) ! \ Delete a file from the project. ! Delete: TheProject ; IDM_DELETE_PRJ SetCommand : AddForms ( -- ) ! \ Add the open forms from ForthForm to the project. ! ForthForm? ! if 0 WANT_FORMS win32forth-message ! SortParentLists: TheProject ! then ; IDM_ADD_FORMS_PRJ SetCommand create datfile ," projectpath.dat" : save-path-to-file ( -- ) ! prognam>pad datfile count pad +place ! pad count w/o create-file ! if drop exit then ! >r path-ptr count r@ write-line drop ! r> close-file drop ; : set-build-path ( -- ) *************** *** 1025,1041 **** r> to source-id ; ! : build-project ( -- ) reset-results GetBuildFile: TheProject nip 0= ! if SelectAFile c@ ! if 0 GetFile: GetFilesDialog ! SetBuildFile: TheProject ! else drop exit ! then GetBuildFile: TheProject ModuleList: TheProject ! AddItem: TheProject ! true to Modified ! then \ Close: TheProject Leftpane Start: TheProject \ uncomment to start fresh \ clear-status-bar GetBuildFile: TheProject BuildNeededFiles \ #addedfiles Modified or to Modified \ #addedfiles (.) pad place --- 998,1019 ---- r> to source-id ; ! : (build-project) ( f -- ) reset-results GetBuildFile: TheProject nip 0= ! if SelectAFile c@ ! if 0 GetFile: GetFilesDialog ! SetBuildFile: TheProject ! else 2drop exit ! then ! then ! ! if Clear: TheProject then ! GetBuildFile: TheProject ModuleList: TheProject ! AddItem: TheProject ! true to Modified ! \ clear-status-bar GetBuildFile: TheProject BuildNeededFiles + SortParentLists: TheProject \ #addedfiles Modified or to Modified \ #addedfiles (.) pad place *************** *** 1048,1049 **** --- 1026,1037 ---- \ pad 1+ 0 SetText: ProjectStatusBar ; IDM_BUILD_PRJ SetCommand + + : build-project ( -- ) + \ Build the project + \ The files that are currently added to the project are not removed. + false (build-project) ; IDM_BUILD_PRJ SetCommand + + : rebuild-project ( -- ) + \ Rewbuild the project + \ The files that are currently added to the project are removed first. + true (build-project) ; IDM_REBUILD_PRJ SetCommand Index: EdCommand.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdCommand.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EdCommand.f 9 Jun 2006 04:31:07 -0000 1.3 --- EdCommand.f 11 Jun 2006 09:03:45 -0000 1.4 *************** *** 283,297 **** THEN Update ; IDM_TABS SetCommand \ -------------------------------------------------------------------------- \ Win32Forth menu \ -------------------------------------------------------------------------- : mcCompile ( -- ) ! IsEditWnd? ! if SaveAllBeforeCompile? ! if SaveAllSourceFiles then ! Compile: ActiveChild ! ActiveChild to ActiveRemote \ make the current child to our active ! \ remote window for debugging ! else beep then ; IDM_COMPILE SetCommand --- 283,316 ---- THEN Update ; IDM_TABS SetCommand + : CompileProject ( -- ) + CompileProject? 0= to CompileProject? Update ; IDM_COMPILE_PROJECT SetCommand + \ -------------------------------------------------------------------------- \ Win32Forth menu \ -------------------------------------------------------------------------- + + : CompileProjectFile ( -- f ) + GetBuildFile: TheProject + ?dup + if Compile-File true + else drop false + then ; + + : CompileActiveFile ( -- ) + IsEditWnd? + if Compile: ActiveChild + \ ActiveChild to ActiveRemote \ make the current child to our active + \ \ remote window for debugging + then ; + : mcCompile ( -- ) ! SaveAllBeforeCompile? ! if SaveAllSourceFiles then ! ! CompileProject? ! if CompileProjectFile 0= ! if CompileActiveFile ! then ! else CompileActiveFile then ; IDM_COMPILE SetCommand Index: Main.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/Main.f,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Main.f 9 Jun 2006 17:03:35 -0000 1.9 --- Main.f 11 Jun 2006 09:03:45 -0000 1.10 *************** *** 41,44 **** --- 41,45 ---- 0 value ACCEL-HNDL \ handle of the AcceleratorKeyTable 0 value MainWindow \ the address of the main window object + 0 value TheProject \ the address of the Project window object ReadFile ViewerFile *************** *** 58,61 **** --- 59,63 ---- true value StripTrailingWhitespace? true value FinalNewLine? + false value CompileProject? 0 constant FT_SOURCE *************** *** 340,343 **** --- 342,346 ---- FinalNewLine? s>d (d.) s" FinalNewLine" "SetDefault LeftWidth s>d (d.) s" LeftWidth" "SetDefault + CompileProject? s>d (d.) s" CompileProject" "SetDefault SaveAllBeforeCompile? s>d (d.) s" SaveAllBeforeCompile" "SetDefault StripTrailingWhitespace? s>d (d.) s" StripTrailingSpaces" "SetDefault *************** *** 380,383 **** --- 383,387 ---- s" FinalNewLine" "GetDefaultValue 0= IF drop true THEN to FinalNewLine? s" LeftWidth" "GetDefaultValue 0= IF drop 225 THEN to LeftWidth + s" CompileProject" "GetDefaultValue 0= IF drop true THEN to CompileProject? s" SaveAllBeforeCompile" "GetDefaultValue 0= IF drop true THEN to SaveAllBeforeCompile? Index: CommandID.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/CommandID.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CommandID.f 7 Jun 2006 15:39:34 -0000 1.2 --- CommandID.f 11 Jun 2006 09:03:45 -0000 1.3 *************** *** 86,89 **** --- 86,90 ---- NewID IDM_REMOVE_TRAILING_WHITE NewID IDM_ENSURE_FINAL_LINE_ENDING + NewID IDM_COMPILE_PROJECT \ Win32Forth menu *************** *** 121,124 **** --- 122,126 ---- NewID IDM_RENAME_PRJ NewID IDM_BUILD_PRJ + NewID IDM_REBUILD_PRJ NewID IDM_SET_BUILD_PATH_PRJ NewID IDM_COMPILE_PRJ |