From: Ezra B. <ezr...@us...> - 2010-07-11 02:48:52
|
Update of /cvsroot/win32forth/win32forth/apps/Win32ForthIDE In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv7568 Modified Files: Main.f Log Message: Updates. Enhancement to search & replace, auto detect disk file changes,debug tab and others. EAB Index: Main.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/Main.f,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Main.f 1 Feb 2010 01:43:50 -0000 1.65 --- Main.f 11 Jul 2010 02:48:44 -0000 1.66 *************** *** 69,72 **** --- 69,96 ---- 150 175 2value BookMarksPos 225 450 2value BookMarksSize + false value autosavesession? \ save/restore default IDE session? + + true value show-projtab? + true value show-filetab? + true value show-formtab? + true value show-classtab? + true value show-voctab? + true value show-dirtab? + true value show-debugtab? + + -1 value projtab# + -1 value filetab# + -1 value formtab# + -1 value classtab# + -1 value voctab# + -1 value dirtab# + -1 value debugtab# + 0 value tabcount + 0 value frmDebugDlg \ allow forward referencing + + 150 Constant IDT_FILETIME + false value intimer? + true value autodetect? + false value checking? \ in process of of checking for change 0 constant FT_SOURCE *************** *** 164,168 **** drop 0 ; ! : UpdateFileTab ( -- ) ActiveChild 0= ?exit Gethandle: OpenFilesTab Call IsWindow 0= ?exit --- 188,192 ---- drop 0 ; ! : UpdateFileTab ( -- ) ActiveChild 0= ?exit Gethandle: OpenFilesTab Call IsWindow 0= ?exit *************** *** 236,239 **** --- 260,274 ---- then r>drop ; + : ReloadTabFile ( -- ) + tab-index GetFileTabChild >r + GetFileType: [ r@ ] FT_SOURCE = + if ReloadFile: [ r@ ] + then r>drop ; + + : SetActiveRemote ( -- ) + tab-index GetFileTabChild >r + GetFileType: [ r@ ] FT_SOURCE = + if r@ to ActiveRemote + then r>drop update ; PopupBar TabPopup *************** *** 241,244 **** --- 276,280 ---- Popup "" MenuItem "Close" CloseSelectedTabFile ; + :MenuItem mnurel "Reload" ReloadTabFile ; MenuSeparator :MenuItem mnucar "Close all files to right" CloseTabsRight ; *************** *** 251,255 **** GetTabCount: OpenFilesTab 1- tab-index > Enable: mnucar tab-index 0> Enable: mnucal ! tab-index GetFileTabChild GetFileType: [ ] FT_SOURCE = Enable: mnucmp ; : OnTabButton? { \ htinfo -- f } \ was the mouse right clicked on a tab button?, f = -1 if no, tab index if yes --- 287,294 ---- GetTabCount: OpenFilesTab 1- tab-index > Enable: mnucar tab-index 0> Enable: mnucal ! tab-index GetFileTabChild >r GetFileType: [ r@ ] FT_SOURCE = ! dup Enable: mnucmp ! GetFileName: [ r@ ] c@ 0<> and Enable: mnurel ! r>drop ; : OnTabButton? { \ htinfo -- f } \ was the mouse right clicked on a tab button?, f = -1 if no, tab index if yes *************** *** 260,264 **** : Handle_TabRightClick ( -- ) ! OnTabButton? dup to tab-index -1 <> if check-menu-funcs GetHandle: Mainwindow dup get-mouse-xy rot Track: TabPopup --- 299,303 ---- : Handle_TabRightClick ( -- ) ! OnTabButton? dup to tab-index -1 <> if check-menu-funcs GetHandle: Mainwindow dup get-mouse-xy rot Track: TabPopup *************** *** 278,282 **** needs EdReplace.f - TabWindow cTabWindow --- 317,320 ---- *************** *** 306,311 **** ;Object ! : show-project-tab ( -- ) ! PROJECT_TAB ShowTab: cTabWindow ; IDM_SHOWPROJECT_TAB SetCommand : show-form-tab ( -- ) --- 344,354 ---- ;Object ! : show-proj-tab ( -- ) ! projtab# -1 <> ! if projtab# ShowTab: cTabWindow ! else tabcount 1 > ! if 0 ShowTab: cTabWindow ! then ! then ; IDM_SHOWPROJECT_TAB SetCommand : show-form-tab ( -- ) *************** *** 315,319 **** if Close: FormWindow \ close this Start: DetachedFormWindow \ and start this ! show-project-tab \ default then else Close: DetachedFormWindow --- 358,363 ---- if Close: FormWindow \ close this Start: DetachedFormWindow \ and start this ! show-proj-tab \ default ! Resize: cTabWindow then else Close: DetachedFormWindow *************** *** 322,326 **** if cTabWindow Start: FormWindow Resize: cTabWindow ! then FORM_TAB ShowTab: cTabWindow \ and show it then ActiveForm if UpdateStatus: ActiveForm --- 366,370 ---- if cTabWindow Start: FormWindow Resize: cTabWindow ! then formtab# ShowTab: cTabWindow \ and show it then ActiveForm if UpdateStatus: ActiveForm *************** *** 586,589 **** --- 630,643 ---- MonitorTop s>d (d.) s" MonitorTop" "SetDefault Detached? s>d (d.) s" Detached" "SetDefault + AutoDetect? s>d (d.) s" AutoDetect" "SetDefault + AutoSaveSession? s>d (d.) s" AutoSaveSession" "SetDefault + show-projtab? s>d (d.) s" ShowProjectTab" "SetDefault + show-filetab? s>d (d.) s" ShowFileTab" "SetDefault + show-formtab? s>d (d.) s" ShowFormTab" "SetDefault + show-classtab? s>d (d.) s" ShowClassTab" "SetDefault + show-voctab? s>d (d.) s" ShowVocTab" "SetDefault + show-dirtab? s>d (d.) s" ShowDirTab" "SetDefault + show-debugtab? s>d (d.) s" ShowDebugTab" "SetDefault + GetFaceName: EditorFont s" TextFont" "SetDefault GetHeight: EditorFont *************** *** 605,608 **** --- 659,665 ---- SaveRecentProjectFiles SaveRecentFormFiles + autosavesession? + if IDM_SAVEDEFAULT_SESSION DoCommand + then \ SetRegistryKey: ControlToolBar *************** *** 634,640 **** s" StripTrailingWhitespace" "GetDefaultValue 0= IF drop true THEN to StripTrailingWhitespace? ! s" BackColor" "GetDefaultValue 0= IF drop Back-Color THEN to Back-Color ! s" ForeColor" "GetDefaultValue 0= IF drop Fore-Color THEN to Fore-Color ! s" CaretBackColor" "GetDefaultValue 0= IF drop Caret-BackColor THEN to Caret-BackColor s" SelectBackColor" "GetDefaultValue 0= IF drop Select-BackColor THEN to Select-BackColor s" SelectForeColor" "GetDefaultValue 0= IF drop Select-ForeColor THEN to Select-ForeColor --- 691,697 ---- s" StripTrailingWhitespace" "GetDefaultValue 0= IF drop true THEN to StripTrailingWhitespace? ! s" BackColor" "GetDefaultValue 0= IF drop Back-Color THEN to Back-Color ! s" ForeColor" "GetDefaultValue 0= IF drop Fore-Color THEN to Fore-Color ! s" CaretBackColor" "GetDefaultValue 0= IF drop Caret-BackColor THEN to Caret-BackColor s" SelectBackColor" "GetDefaultValue 0= IF drop Select-BackColor THEN to Select-BackColor s" SelectForeColor" "GetDefaultValue 0= IF drop Select-ForeColor THEN to Select-ForeColor *************** *** 642,656 **** s" BrowseBackColor" "GetDefaultValue 0= IF drop Browse-BackColor THEN to Browse-BackColor ! s" AutoIndent" "GetDefaultValue 0= IF drop false THEN to autoindent? ! s" TabsInEditor" "GetDefaultValue 0= IF drop false THEN to with-tabs? s" BookMarksPosition" "GetDefault2Value IF 2to BookMarksPos ELSE 2drop then s" BookMarksSize" "GetDefault2Value IF 2to BookMarksSize ELSE 2drop THEN ! s" AutoProperty" "GetDefaultValue 0= IF drop false THEN to AutoProperty? ! s" SingleControl" "GetDefaultValue 0= IF drop true THEN to SingleControl? ! s" MonitorLeft" "GetDefaultValue if to MonitorLeft else drop then ! s" MonitorTop" "GetDefaultValue if to MonitorTop else drop then ! s" Detached" "GetDefaultValue if to detached? else drop then ! s" TextFont" "GetDefault -IF 2dup SetFaceName: EditorFont THEN 2drop ! s" TextFontSize" "GetDefaultValue if SetHeight: EditorFont else drop then s" SearchText" "GetDefault -IF 2dup "CLIP" find-buf place THEN 2drop --- 699,722 ---- s" BrowseBackColor" "GetDefaultValue 0= IF drop Browse-BackColor THEN to Browse-BackColor ! s" AutoIndent" "GetDefaultValue 0= IF drop false THEN to autoindent? ! s" TabsInEditor" "GetDefaultValue 0= IF drop false THEN to with-tabs? s" BookMarksPosition" "GetDefault2Value IF 2to BookMarksPos ELSE 2drop then s" BookMarksSize" "GetDefault2Value IF 2to BookMarksSize ELSE 2drop THEN ! s" AutoProperty" "GetDefaultValue 0= IF drop false THEN to AutoProperty? ! s" SingleControl" "GetDefaultValue 0= IF drop true THEN to SingleControl? ! s" MonitorLeft" "GetDefaultValue if to MonitorLeft else drop then ! s" MonitorTop" "GetDefaultValue if to MonitorTop else drop then ! s" Detached" "GetDefaultValue if to detached? else drop then ! s" AutoDetect" "GetDefaultValue if to autodetect? else drop then ! s" AutoSaveSession" "GetDefaultValue if to autosavesession? else drop then ! s" ShowProjectTab" "GetDefaultValue if to show-projtab? else drop then ! s" ShowFileTab" "GetDefaultValue if to show-filetab? else drop then ! s" ShowFormTab" "GetDefaultValue if to show-formtab? else drop then ! s" ShowClassTab" "GetDefaultValue if to show-classtab? else drop then ! s" ShowVocTab" "GetDefaultValue if to show-voctab? else drop then ! s" ShowDirTab" "GetDefaultValue if to show-dirtab? else drop then ! s" ShowDebugTab" "GetDefaultValue if to show-debugtab? else drop then ! s" TextFont" "GetDefault -IF 2dup SetFaceName: EditorFont THEN 2drop ! s" TextFontSize" "GetDefaultValue if SetHeight: EditorFont else drop then s" SearchText" "GetDefault -IF 2dup "CLIP" find-buf place THEN 2drop *************** *** 665,668 **** --- 731,737 ---- RestoreRecentProjectFiles RestoreRecentFormFiles + autosavesession? + if IDM_LOADDEFAULT_SESSION DoCommand + then \ SetRegistryKey: ControlToolBar *************** *** 706,716 **** \ WS_CLIPCHILDREN -Style: mdiclient \ WS_CLIPsiblings -Style: mdiclient - load-defaults self Start: OpenFilesTab \ start after mdiclient show-form-tab \ show the form designer whether detached or not Adjust-Monitor TabPopup SetPopupBar: self \ start the popup Update ! show-project-tab \ always default ;M --- 775,787 ---- \ WS_CLIPCHILDREN -Style: mdiclient \ WS_CLIPsiblings -Style: mdiclient self Start: OpenFilesTab \ start after mdiclient + load-defaults + Refresh: cTabWindow show-form-tab \ show the form designer whether detached or not Adjust-Monitor TabPopup SetPopupBar: self \ start the popup Update ! show-proj-tab \ always default ! NULL 1000 IDT_FILETIME GetHandle: self Call SetTimer drop ;M *************** *** 733,743 **** :M WM_CLOSE ( h m w l -- res ) CloseAll: self NotCancelled \ if we don't cancel the close ! IF save-defaults \ save properties in registry ! ExitScintillaControl \ terminate the Scintilla control AccelTable DisableAccelerators \ free the accelerator table - \ IDM_FORM_CloseAll DoCommand - \ close-form-windows bye \ then terminate the program ELSE 1 \ else abort program termination --- 804,812 ---- :M WM_CLOSE ( h m w l -- res ) + save-defaults \ save properties in registry CloseAll: self NotCancelled \ if we don't cancel the close ! IF ExitScintillaControl \ terminate the Scintilla control AccelTable DisableAccelerators \ free the accelerator table bye \ then terminate the program ELSE 1 \ else abort program termination *************** *** 746,749 **** --- 815,819 ---- :M On_Done: ( -- ) Delete: TabFont + IDT_FILETIME GetHandle: self Call KillTimer drop \ (( [cdo] to be removed when SAVE & TURNKEY are ok \ [cdo] actually : is not TURNNKEYed ... but is harmless when SAVEd *************** *** 803,806 **** --- 873,913 ---- FileNotFound ;M + : CheckFileTime ( -- ) + autodetect? 0= ?exit + intimer? ?exit + ActiveChild 0= ?exit \ no file opened + IsEditWnd? 0= ?exit + GetLastWriteTime: ActiveChild 0= ?exit \ new file + CompareFileTime: ActiveChild 0= \ file has changed + if true to intimer? true to checking? + MB_YESNO MB_ICONQUESTION or MB_APPLMODAL or + z" Warning" + z" The current file has been modified outside the IDE. Do you want to reload it?" + GetHandle: self + Call MessageBox IDYES = + if ReloadFile: ActiveChild + else SyncWriteTime: ActiveChild \ set both times the same + then false to intimer? false to checking? + then ; + + : CheckIfDoneDebugging ( -- ) + \ if debugging and console is closed disable debugging functions + w32fForth IsRunning? 0= ActiveRemote 0<> and + if debugtab# -1 <> + if Clear: frmDebugDlg + false GetHandle: frmDebugDlg Call EnableWindow drop + then + then ; + + : HandleTimer ( -- ) \ routine for timer functions, add any others here + CheckFileTime + CheckIfDoneDebugging + ; + + :M WM_TIMER ( h m w l -- ) + over IDT_FILETIME = + if HandleTimer + then 0 ;M + ;Object *************** *** 832,835 **** --- 939,943 ---- :M UpdateFileName: ( -- ) self UpdateFileName: cTabWindow \ update the File in the file list + UpDateFileTab ;M *************** *** 928,931 **** --- 1036,1040 ---- self RemoveFile: cTabWindow \ remove the file from the file list self DeleteFileTab + self ActiveRemote = if Clear: frmDebugDlg then GetHandle: self Destroy: Frame \ sugested by Rod Oakford ChildWindow dispose \ then close the child window *************** *** 1004,1007 **** --- 1113,1117 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + needs SavePrompt.frm needs ScintillaMDI.f fload ScintillaHyperMDI.f *************** *** 1223,1226 **** --- 1333,1337 ---- 0 0 WM_UPDATE SendMessageToAllChildren: Frame UpdateFileTab + ?EnableDebugWindow ; is Update *************** *** 1324,1327 **** --- 1435,1443 ---- fload EdCompile.f needs EdBookMarks.f + needs MsgBoxBuilder.frm + + : MessageBoxBuilder ( -- ) + GetHandle: MainWindow SetParentWindow: frmMsgBoxBuilder + Start: frmMsgBoxBuilder ; IDM_MSGBOX_BUILDER SetCommand \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *************** *** 1383,1387 **** \ Win32Forth menu \ 0 VK_F6 IDM_BUILD_CODE_TREE ACCELENTRY ! \ 0 VK_F8 IDM_SET_BOOKMARK ACCELENTRY 0 VK_F9 IDM_COMPILE_SELECTION ACCELENTRY 0 VK_F12 IDM_COMPILE ACCELENTRY --- 1499,1503 ---- \ Win32Forth menu \ 0 VK_F6 IDM_BUILD_CODE_TREE ACCELENTRY ! 0 VK_F8 IDM_COMPILE_LINE ACCELENTRY 0 VK_F9 IDM_COMPILE_SELECTION ACCELENTRY 0 VK_F12 IDM_COMPILE ACCELENTRY |