Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: ON KEYLABEL call form.release
Message
From
10/08/2003 12:11:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
BUG: ON KEYLABEL call form.release
Miscellaneous
Thread ID:
00818703
Message ID:
00818703
Views:
56
Hi,
release a form with OOP need to call form.release method.
But this have bugs:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	AllowOutput = .F.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT tx1 AS textbox WITH ;
		Left = 14, ;
		Top = 11, ;
		Width = 100, ;
		Name = "TX1"

	PROCEDURE Activate
		ON KEY LABEL CTRL+F11 _SCREEN.ActiveForm.Release		&& bug 1+big 2
                ON KEY LABEL CTRL+F12 RELEASE  WINDOWS _SCREEN.ActiveForm.Name && warning 1
	ENDPROC

	PROCEDURE Deactivate
		ON KEY LABEL CTRL+F11 && BUG 3
		ON KEY LABEL CTRL+F12
	ENDPROC

	PROCEDURE Release
		? 'release'
	ENDPROC

	PROCEDURE tx1.GotFocus
		? 'gotfocus' 
	ENDPROC


	PROCEDURE tx1.When
		? 'when'
	ENDPROC


	PROCEDURE tx1.Valid
		? 'valid'
	ENDPROC


	PROCEDURE tx1.LostFocus
		? 'lostfocus'
	ENDPROC

ENDDEFINE
bug 1:
if you exec form.release with a focus control, no events fired on focus
control ( Valid and Lostfocus sequence are need)

bug 2:
use a KEY LABEL shortcut for release, exec release method,
but after fired a when+gotfocus (like setfocus cycle) events on focus control.

bug 3: this simple schema is not applicable because deactivate not
fired when the avtive form is released.

warning 1: this command is not oop foxpro command, and fired a
form.queryunload event, but need a management of form names for
make they unique ( if VFP open one SCX two times, the name is the same ).
Next
Reply
Map
View

Click here to load this message in the networking platform