Hi Alan
>OK. So we have a menu to click on. This should have an Exit option with a CLEAR READ to close the program. What do you click on after starting the program?
Nothing the FW waits after issuing the RE. I have put in a customized line in the FW issuing KEYBOARD to open the data entry menu popup, so that the user knows he is supposed to do something and not waste company time <g>. So first time I will be calling our form just before the FW issues the RE (this is the time when my logic regarding the tlFirstTime boots in and issues a RE and CE in the class destroy, hey wait a minute, there is no destroy in this new logic only a deactivate
...
Hi, I gave it a try and it looks positive, the new class code follows so is the calling code. I was doing a CR in the destroy (for the first time when the FW RE is still not in effect). Things are pretty much streamlined now. The first time execution is pure perfection. The second time round, though the class window is shown allows selection, etc. but there is no pause in code during the selection in the class window, it goes no through to the wait window assigning whatever record (generally first) is available, so though I feel I am doing a selection the second time round, actually the calling code has already been executed and the selection I have done (rather will be doing) has no meaning.
How can I get the class to wait after the loDF.VISIBLE = .T. for the IF NOT tlFirstTime? This solved and the whole things should work beautifully. I have tried making the class window MODAL and MODALESS using the properties, but no luck
Calling code
IF lnRecs > 1
IF tlFirstTime
PUBLIC loDF
loDF = CREATEOBJECT("frmSelectDataFolder", tlFirstTime)
loDF.VISIBLE = .T.
READ EVENTS
ELSE
loDF.VISIBLE = .T.
ENDIF
ENDIF
tcFireBirdPath = ADDBS(cDataPath) + "vso3.fdb"
wait window tcFireBirdPath
Class code I don't feel any more modifications will be required to it.
DEFINE CLASS frmSelectDataFolder AS FORM
SHOWWINDOW = 1
WINDOWTYPE = 1
ALWAYSONTOP = .T.
HEIGHT = 60
WIDTH = 220
CAPTION = "Select Data Folder"
MAXBUTTON = .F.
MINBUTTON = .F.
lFirstTime = .F.
nOldSelect = 0
ADD OBJECT lstDataFolders AS LISTBOX WITH ;
LEFT = 0,;
TOP = 0,;
HEIGHT = 60,;
WIDTH = 220,;
COLUMNCOUNT = 3,;
COLUMNWIDTHS = '70,70,0',;
FIRSTELEMENT = 1,;
NUMBEROFELEMENTS = 0,;
ROWSOURCE = 'cName,cExtra,iID',;
ROWSOURCETYPE = 6
FUNCTION INIT
LPARAMETERS tlFT
THISFORM.lFirstTime = tlFT
ENDFUNC
FUNCTION lstDataFolders.DBLCLICK
THISFORM.VISIBLE=.F.
ENDFUNC
FUNCTION lstDataFolders.KEYPRESS
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13
THISFORM.VISIBLE=.F.
ENDIF
ENDFUNC
FUNCTION ACTIVATE
THISFORM.nOldSelect = SELECT()
SELECT df
ENDFUNC
FUNCTION DEACTIVATE
IF THISFORM.lFirstTime
THISFORM.lFirstTime = .F.
CLEAR EVENTS
ENDIF
SELECT (THISFORM.nOldSelect)
ENDFUNC
ENDDEFINE