Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form flashes for a moment...
Message
From
10/09/2002 18:07:07
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00699077
Message ID:
00699100
Views:
12
Nadya,

hmmm...don't you already have a READ EVENTS in effect when you call loGlobalEditor.show(2)? My guess is the second READ EVENTS is ignored, loGlobalEditor goes out of scope (because it is not modal), the destroy method does a CLEAR EVENTS. The second time around, the READ EVENTS works.

These are merely suppositions. Can the new form be modal? What happens if you put CLEAR EVENTS before the show()?

>Hi everybody,
>
>I have a very urgent problem. I have a main application. The main program of this application has read events.
>
>This application has a modeless form called Job Viewer. This form can invoke any other application, for instance, my Address Standardization application. Address Standardization application has a modeless main form. By pressing Alt+G [the form has an invisible button with G underlined] on this form I can invoke another modeless form (Global Editor). Here is the code, which invokes Global Editor:
>
>********************************************************************
>*  Description.......: InvokeMainGlobalEditor
>*  Calling Samples...:
>*  Parameter List....:
>*  Created by........: Nadya Nosonovsky 08/16/2002 01:44:24 PM
>*  Modified by.......: Nadya Nosonovsky 09/06/2002 01:33:55 PM
>********************************************************************
>*=messagebox('Global Editor') && For testing
>*--------------------------------------------------------------------------
>* -- updated:rmm:09/25/01
>* -- Get the global edit field list form the gefldlist table from Alan -
>* --	per edittype
>*--------------------------------------------------------------------------
>local lcShow, lnFieldCount, lnCount, lcSetRelation
>if not used('GeFldList') and not OpenTble('GeFldList','GeFldList','shared noupdate')
>	return .f. && we can not open GeFldList table
>endif
>
>if seek(upper(padr(thisform.name,25)+ ;
>   padr(thisform.EditType,10)),'GeFldList','FormMode') ;
>   and GeFldList.EnableGE
>&& Could be, that the mode is not found
>	lcShow = GeFldList.GeFldList
>	local array laShow[1]
>	lnFieldCount = aparser(@laShow, m.lcShow, ", ")
>*!*		select &lcShow. from BldMstr where .f. into cursor curTemp
>*!*		select curTemp
>*!*		lnFieldCount = afields(laGe)
>*!*		use in curTemp
>*!*		dimension laShow(m.lnFieldCount,1)
>*!*		for lnCount = 1 to m.lnFieldCount
>*!*			laShow(1,m.lnCount) = laGe(m.lnCount,1)
>*!*		endfor
>	=asort(laShow) && Sort alphabetically
>
>	local loGlobalEditor, lnSecurity, lcClassLib
>	lnSecurity = 5
>	
>&& This command button is hidden, so let's everybody to invoke it by secret Alt+G key	
>*!*		if vartype(oJC)='O'
>*!*			lnSecurity = oJC.Sec_Grp
>*!*		endif
>
>* tcTableAlias - alias to process (BldMstr in most cases, ltResolve in Validate case)
>* tlDisDelGrpOpt - if true, Delete Group is disabled
>* tlDisLinkOpt  - if true, Link button is invisible
>* tcForOpt - For Condition
>* taTargFields - array of fields, which could be changed
>* tcEType - form's EditType
>* tlConvNull -  if true, Clear Field  converts to NULL
>* tnSecurityLevel - Security Group (if less than 4 Global Editor is not accessible)
>* tcAddlReplace - Additional Replace command
>*!*	    select BldMstr
>*!*	    lcSetRelation = set('relation')
>*!*	    set relation to && close the relations
>    lcClassLib = 'GlobalEditor.vcx'
>	loGlobalEditor = newobject('GlobalEditor',m.lcClassLib,"", ;
>		"BldMstr",.f.,,,@laShow, ;
>		thisform.EditType, thisform.ConvNull, m.lnSecurity, thisform.AdditionalReplace)
>		
>	if vartype(m.loGlobalEditor)='O'
>		loGlobalEditor.show(2) && Show non-modal
>		read events
>	endif
>*!*	    select BldMstr
>*!*	    if not empty(m.lcSetRelation)
>*!*	       set relation to &lcSetRelation && Restore relations
>*!*	    endif
>else && Mode is not found - should never happen
>	=messagebox('Global editing is not allowed for this operation.',0,'Global Editor')
>endif
>
>In Global Editor Destroy method I added the following code:
>
>thisform.RestoreNLocked()
>if this.WindowType = 0 && Modeless, so read events was issued
>   clear events
>endif
>
>The behavior I observe is the following: I press Alt+G and Global Editor form flashes and immediatelly disappears. I press it again and the form stays.
>
>Could you please help me? What should I do? It's very urgent!
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform