From: Ezra B. <ezr...@us...> - 2009-04-10 16:38:53
|
Update of /cvsroot/win32forth/win32forth/apps/Win32ForthIDE In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16183/apps/Win32ForthIDE Modified Files: EDSplitterWindow.f EdFORTHFORM.F Log Message: IDE Enhancements. Bug Fixes. Doc Updates. Index: EdFORTHFORM.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdFORTHFORM.F,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EdFORTHFORM.F 24 Aug 2008 05:07:27 -0000 1.6 --- EdFORTHFORM.F 10 Apr 2009 16:38:36 -0000 1.7 *************** *** 3,11 **** cr .( Loading Form Designer...) - \ add the ForthForm folder's to our path list - \ September 20th, 2003 - 9:57 dbu - s" apps\forthform" "fpath+ - s" apps\forthform\res" "fpath+ - vocabulary forthform vocabulary testvocab \ for testing forms to avoid conflicts --- 3,6 ---- *************** *** 55,59 **** 0 value picturebmp 0 value staticbmp ! 32 1024 * cell+ constant max-codesize 20300 constant fform_version# --- 50,54 ---- 0 value picturebmp 0 value staticbmp ! 32 1024 * cell+ constant max-codesize \ 32k for now but can be changed 20300 constant fform_version# *************** *** 70,77 **** formwindow-link off false value detached? \ is form designer window detached from tabcontrol? ColorObject FormColor \ background form color Font ControlFont \ default font for text to be written in control ! ListBox FormPicker \ list of open forms \ status labels --- 65,73 ---- formwindow-link off false value detached? \ is form designer window detached from tabcontrol? + false value don't-refresh? \ refresh code window only when necessary ColorObject FormColor \ background form color Font ControlFont \ default font for text to be written in control ! \ ListBox FormPicker \ list of open forms \ status labels *************** *** 91,94 **** --- 87,108 ---- defer UpdatePropertyWindow defer UpdateSystem + defer NewCodeWindow + + \ The value show-code? prevents control code from being displayed automatically in the IDE until + \ the control is selected from the Code Editor. So if just creating forms normally without + \ adding any code the Code Editor can be ignored. If a control is selected from the Code Editor + \ window the flag will be set so that for any further controls added or clicked will display + \ that control's code in the IDE. It can be reset when by closing the code editing window. + false value show-code? + + 1 to enum-value + enum: + FLAG_GLOBAL + FLAG_LOCAL + FLAG_ONINIT + FLAG_CODE ; + + : RefreshActiveCoder ( flag -- ) + NewCodeWindow Refresh: ActiveCoder ; : link-formwindow { win -- } *************** *** 182,186 **** ActiveForm 0= ?exit \ for obvious reasons ActiveControl: Activeform 0= ?exit ! ChangeControl: ActiveForm ; : ChangeControlFont ( -- ) \ change the font for a control --- 196,201 ---- ActiveForm 0= ?exit \ for obvious reasons ActiveControl: Activeform 0= ?exit ! ChangeControl: ActiveForm ! doUpdate ; : ChangeControlFont ( -- ) \ change the font for a control *************** *** 189,192 **** --- 204,208 ---- if GetUserFont: [ ] IsModified: ActiveForm + doUpdate then ; *************** *** 196,201 **** --- 212,236 ---- if DefaultFont: [ ] IsModified: ActiveForm + doUpdate then ; + : font-type? ( ctrltype -- f ) \ allow font change for this control? + dup 0= ?exit + | TypePushbutton + TypeGroupBox + TypeCheckBox + TypeRadioButton + TypeLabel + TypeTextBox + TypeMultiLineBox + TypeListBox + TypeComboBox + TypeComboListBox + TypeMultiListBox + TypeGeneric \ in case we just want a font + |if true + else false + then ; + : #Forms ( -- n ) \ return number of open forms FormList *************** *** 234,237 **** --- 269,296 ---- ; + 10 constant #ids + create IDList + s" DEFAULT" ", \ default id + s" IDOK" ", \ OK button was selected. + s" IDCANCEL" ", \ Cancel button was selected. + s" IDYES" ", \ Yes button was selected. + s" IDNO" ", \ No button was selected. + s" IDABORT" ", \ Abort button was selected. + s" IDIGNORE" ", \ Ignore button was selected. + s" IDCONTINUE" ", \ Continue button was selected. + s" IDRETRY" ", \ Retry button was selected. + s" IDTRYAGAIN" ", \ Try Again button was selected. + 0 , align + + : check-id ( n1 -- n2 ) \ n2 = n1 or 0 + dup 0 #ids within not + if drop 0 \ make it in range + then ; + + : GetID$ ( n -- addr cnt ) + check-id IDList swap 0 + ?do count + + loop count ; + FileOpenDialog OpenSessionDlg "Load Session File" "Session Files|*.ses|" FileSaveDialog SaveSessionDlg "Save Session File" "Session Files|*.ses|" *************** *** 240,244 **** FileOpenDialog GetBitmapDlg "Get Bitmap" "Bitmap Files|*.bmp;*.dib|" - needs edformwindow.f \ form designer window \ all ForthForm dialogs needs ControlProperty.frm --- 299,302 ---- *************** *** 253,287 **** needs formcontrols.f \ subclassed control object needs groupaction.f \ positioning of controls ! needs formobject.f \ load form class needs taborder.f \ change tab order form needs formproperty.f \ edit of form properties needs CreateToolBar.f \ toolbar generator ...but you knew that right? needs SplitterWindow.f \ this is also an easy guess! needs CreateMenu.f \ now what could this file be for? needs CreatePropertyForm.f \ generate property sheet like template - needs FormCodeEditor.f \ adding code to forms Form DummyForm \ dummy ControlObject DummyControl \ objects - : UpdateFormPicker ( -- ) \ update combolist control - GetHandle: FormPicker 0= ?exit \ not opened - Clear: FormPicker \ reset it - #Forms ?dup \ if we have any - if 1+ 1 - ?do i >Link#: FormList - Data@: FormList FormName: [ ] - count asciiz AddStringTo: FormPicker \ add string - loop ActiveForm ?dup - if ?FormNumber 1- 0max SetSelection: FormPicker \ show active form - then - then ; : updatewin ( -- ) \ update everything - UpdateFormPicker UpdateProperties++ ?EnableFormMenuItems Update: Monitor - Refresh: CodeWindow ; ' updatewin is doupdate --- 311,332 ---- needs formcontrols.f \ subclassed control object needs groupaction.f \ positioning of controls ! needs FormCodeEditor.f \ adding code to forms needs taborder.f \ change tab order form needs formproperty.f \ edit of form properties + needs edformwindow.f \ form designer window + needs formobject.f \ load form class needs CreateToolBar.f \ toolbar generator ...but you knew that right? needs SplitterWindow.f \ this is also an easy guess! needs CreateMenu.f \ now what could this file be for? needs CreatePropertyForm.f \ generate property sheet like template Form DummyForm \ dummy ControlObject DummyControl \ objects : updatewin ( -- ) \ update everything UpdateProperties++ ?EnableFormMenuItems Update: Monitor ; ' updatewin is doupdate *************** *** 306,310 **** Start: ThisForm Display: ThisForm ! doupdate ; IDM_FORM_New SetCommand : (OpenForm) { fname fcnt -- } \ open form given its name --- 351,356 ---- Start: ThisForm Display: ThisForm ! doupdate ! ; IDM_FORM_New SetCommand : (OpenForm) { fname fcnt -- } \ open form given its name *************** *** 420,425 **** SetFocus: MainWindow 0 to ActiveForm ! Close: frmProperties++ ! Close: CodeWindow FormList Dispose 0 to FormList ActiveChild 0= \ no other file opened --- 466,474 ---- SetFocus: MainWindow 0 to ActiveForm ! Clear: frmProperties++ ! Clear-CodeLists ! ActiveCoder ?dup ! if GetHandle: [ ] CloseChild: MainWindow ! then FormList Dispose 0 to FormList ActiveChild 0= \ no other file opened *************** *** 427,433 **** then else SetFocus: [ Data@: FormList ] ! ActiveControl: Activeform ! if UpdatePropertyWindow ! then then #Forms 2 < \ less than two forms opened if Close: frmCreatePropertyForm \ makes no sense --- 476,486 ---- then else SetFocus: [ Data@: FormList ] ! UpdatePropertyWindow ! ActiveCoder ! if ActiveControl: ActiveForm ! if FLAG_CODE ! else FLAG_GLOBAL ! then Refresh: ActiveCoder ! then then #Forms 2 < \ less than two forms opened if Close: frmCreatePropertyForm \ makes no sense *************** *** 439,446 **** >FirstLink: FormList Begin FormList ! While Data@: FormList IDM_FORM_Close DoCommand Repeat ; IDM_FORM_CloseAll SetCommand : AddFormToProject ( form -- ) \ include in project TextFile: [ ] 2dup s" untitled.frm" istr= not if AddForm: TheProject --- 492,500 ---- >FirstLink: FormList Begin FormList ! While Data@: FormList CloseForm Repeat ; IDM_FORM_CloseAll SetCommand : AddFormToProject ( form -- ) \ include in project + \ Form must be compiled first TextFile: [ ] 2dup s" untitled.frm" istr= not if AddForm: TheProject *************** *** 449,452 **** --- 503,507 ---- : AddOpenForms ( -- ) \ include all open forms in project + \ Forms should have been compiled first #Forms ?dup if 1+ 1 *************** *** 485,497 **** else drop then ; create buf 200 allot ! : File= { \ tmp# -- } ( <name> -- ) \ get file name from input stream -1 to tmp# ',' word dup c@ if count buf dup>r place more? ! if 0 word count number? if drop to tmp# else 2drop then then r@ count file-status nip 0= \ if still exist --- 540,558 ---- else drop then ; + create buf 200 allot ! : File= { \ tmp# browsing? -- } ( <name> -- ) \ get file name from input stream ! false to browsing? -1 to tmp# ',' word dup c@ if count buf dup>r place more? ! if ',' word count number? if drop to tmp# else 2drop + then more? + if 0 word count s" browsing" istr= + if true to browsing? + then then then r@ count file-status nip 0= \ if still exist *************** *** 499,503 **** tmp# -1 <> if tmp# GotoPos: CurrentWindow ! then then r>drop else drop --- 560,564 ---- tmp# -1 <> if tmp# GotoPos: CurrentWindow ! then browsing? SetBrowseMode: ActiveChild then r>drop else drop *************** *** 553,557 **** if ',' cappend ChildWindow: ThisChild ! GetCurrentPos: [ ] (.) append&crlf else +crlf then --- 614,623 ---- if ',' cappend ChildWindow: ThisChild ! GetCurrentPos: [ ] (.) append ! ',' cappend ! ?BrowseMode: ThisChild ! if s" BROWSING" ! else s" EDITING" ! THEN append&crlf else +crlf then Index: EDSplitterWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EDSplitterWindow.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EDSplitterWindow.f 8 Sep 2008 03:05:10 -0000 1.2 --- EDSplitterWindow.f 10 Apr 2009 16:38:36 -0000 1.3 *************** *** 424,429 **** child2 SetTabInfo: OpenFilesTab ; ! : SplitWindow { win-func split-type \ modified? curpos textbuf textlen name$ -- } ActiveChild 0= ?exit GetFileType: ActiveChild FT_SOURCE <> ?exit GetSplitType: ActiveChild split-type = ?exit --- 424,430 ---- child2 SetTabInfo: OpenFilesTab ; ! : SplitWindow { win-func split-type \ modified? curpos textbuf textlen name$ browsing? -- } ActiveChild 0= ?exit + ActiveChild ActiveCoder = ?exit \ no splitting for code window GetFileType: ActiveChild FT_SOURCE <> ?exit GetSplitType: ActiveChild split-type = ?exit *************** *** 435,438 **** --- 436,440 ---- GetCurrentPos: CurrentWindow to curpos \ position in document GetFileName: ActiveChild count name$ place \ file name + ?BrowseMode: ActiveChild to browsing? SetSavepoint: CurrentWindow \ mark as not modified ActiveChild >r *************** *** 442,445 **** --- 444,448 ---- curpos GotoPos: CurrentWindow modified? 0= IF SetSavePoint: CurrentWindow THEN + browsing? SetBrowseMode: ActiveChild textbuf release r@ TabPosition ActiveChild TabPosition SwapTabs |