Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 version of PreVFP historic code
Message
 
To
14/07/2004 10:48:09
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00922398
Message ID:
00924548
Views:
32
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

*!*USE IN DF
Class code I don't feel any more modifications will be required to it.
*** Class to show the popup for Data Folder selection
DEFINE CLASS frmSelectDataFolder AS FORM
	SHOWWINDOW = 1 && 0=In Screen, 1=In Top-Level Form, 2=As Top-Level Form
	WINDOWTYPE = 1 && 0=Modeless, 1=Modal
	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	&& Allow ENTER to terminate
			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
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform