Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic tooltip on command button ?
Message
De
12/07/2005 06:36:13
 
 
À
12/07/2005 04:56:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01031548
Message ID:
01031570
Vues:
11
>Hi,
>
>FabioL has often cited a way of calling or evaluating a dynamic tooltip. I would like to show some validation reasons via the tooltip on a disabled commandbutton so that the users know why the command button is disabled.
>
>Thanks,

You can play with this:
- run
- wait without do anything ( no move the mouse !)
- the button appear :)
- press reset
- wait for visible
- go into the button and look the dynamic tooltip,
move the mouse within the button ( you look the tooltip refresh )

Another:
- press reset
- set focus into another form ( Command,....)
- move the mouse over the Form1 without click.
PUBLIC oform1

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


DEFINE CLASS form1 AS form

	ShowTips = .T.
	Caption = "Form1"
	timeout = (DATETIME()+15)

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 24, ;
		Left = 76, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "resettime", ;
		Name = "Command2"


	ADD OBJECT cm_dynamic1 AS cm_dynamic WITH ;
		Top = 159, ;
		Left = 94, ;
		Caption = "moveMouse", ;
		eenabled = "DATETIME()>M.THISFORM.TIMEOUT", ;
		etooltiptext = [IIF(DATETIME()<M.THISFORM.TIMEOUT,"Wait "+TRANS(M.THISFORM.TIMEOUT-DATETIME()),'')], ;
		evisible = "DATETIME()+10>M.THISFORM.TIMEOUT", ;
		Name = "Cm_dynamic1"


	PROCEDURE command2.Click
		thisform.Timeout=DATETIME()+15
	ENDPROC

ENDDEFINE

DEFINE CLASS cm_dynamic AS commandbutton

	eenabled	= "m.This.Enabled"
	etooltiptext	= "m.This.ToolTipText"
	evisible	= "m.This.Visible"

	HIDDEN PROCEDURE tooltiptext_access
		RETURN EVALUATE(m.THIS.eToolTipText)
	ENDPROC

	PROCEDURE visible_access
		this.Enabled = EVALUATE(m.This.eEnabled)
		this.Visible = EVALUATE(m.This.eVisible)
		RETURN m.this.Visible
	ENDPROC


ENDDEFINE
Of course, to play with baseclass's property_access can be a risk.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform