Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AnFoxGUI.fll
Message
From
02/05/2018 07:41:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
01/05/2018 16:54:12
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01659662
Message ID:
01659678
Views:
134
>WOW, OK, I do not know where I was getting the impression of the 127 limitation. Applying ToolTips, if I recall, had something to do with the Grid. I need to go back and research my notes.

For more options, I once had to build something like this:
	* this goes into tooltip_access
LOCAL loTooltipForm


	loTooltipForm=CREATEOBJECT("ToolBrowseForm")
	WITH loTooltipForm
		.LEFT=THIS.LEFT+THIS.WIDTH/2
		.TOP=THIS.TOP+THIS.HEIGHT-4
		IF .COLLECT(EVALUATE(THIS.rawresultsfield))
			.MoveNear(THIS, THISFORM)
			.SHOW(1)
			.CLEAR()
		ENDIF
		.RELEASE()
	ENDWITH
return ""

DEFINE CLASS ToolBrowseForm AS FORM


	ADD OBJECT HideTimer AS TIMER WITH	;
		ENABLED=.F., ;
		INTERVAL=200

	ALWAYSONTOP=.T.
	BORDERSTYLE=1
	CLOSABLE=.F.
	COLORSOURCE=0
	FONTNAME="FoxFont"
	FONTSIZE=9
	MAXBUTTON=.F.
	MINBUTTON=.F.
	sizebox=.F.
	TITLEBAR=0
	timeActivated ={ :}
	SHOWWINDOW=1	
	DisplayFont 	= ''	
	DisplayFontSize	= 0	

*******************************
	PROCEDURE SETUP()
		DODEFAULT()
		DECLARE LONG GetSysColor IN User32 INTEGER
*-- 24 - tooltips background
		THIS.BACKCOLOR=GetSysColor(24)


*---------------------------------------------------
	PROCEDURE INIT()
*-- dn 2009/10/05
		THIS.SETUP()

*******************************
	PROCEDURE DEACTIVATE
		THIS.HIDE()

*******************************
	PROCEDURE MOUSELEAVE
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		THIS.HIDE()
*---------------------------------------------------
*[2009/10/06 10:59:12] ndragan -
	PROCEDURE SHOW(tnStyle)
		LOCAL lcSetNull
		tnStyle=EVL(tnStyle, 2)
		lcSetNull=SET("Nulldisplay")
		SET NULLDISPLAY TO "--"
		DODEFAULT(tnStyle)
		THIS.timeActivated =DATETIME()
		THIS.HideTimer.ENABLED=.T.
		SET NULLDISPLAY TO lcSetNull
*******************************
	PROCEDURE MoveNear(toNear, toFrm AS FORM)
		lnTop=toFrm.TOP+OBJTOCLIENT(toNear,1)+toNear.HEIGHT/4+SYSMETRIC(4)+SYSMETRIC(9) + 12	
&& 2011/02/25 - Additional vertical compensation to avoid obscuring the selected record, where sufficient space is available
		lnLeft=toFrm.LEFT+OBJTOCLIENT(toNear,2) + MIN(toNear.WIDTH, toNear.PARENT.WIDTH) + 6
&& 2011/02/25 - Revised for more consistent grid/non-grid positioning by optionally using parent object width
		WITH THIS AS FORM
			lnTop=MIN(lnTop, toFrm.HEIGHT-.HEIGHT-10)
			lnLeft=MIN(lnLeft, toFrm.WIDTH-.WIDTH-16)	
&& 2011/02/25 - Replaced .Left reference with .Width to ensure the full width of the form is visible within the application
			.MOVE(lnLeft, lnTop)
		ENDWITH
*---------------------------------------------------
	PROCEDURE HideTimer.TIMER()
*-- dn 2009/10/05
		LOCAL oOBject, llMouseIsOnMe

		llMouseIsOnMe=.F.

		DO CASE
			CASE DATETIME()-THISFORM.timeActivated <_DBLCLICK*2
				llMouseIsOnMe=.T.		&& five seconds delay before trying to hide
			CASE THISFORM.VISIBLE AND THISFORM.DOCKPOSITION = -1
				oOBject = SYS(1270)

				IF VARTYPE(oOBject) = "O"
*-- this form has no parent, so the topmost parent of any object on it is the form.
					DO WHILE TYPE("oObject.Parent.Name") = "C"
						oOBject = oOBject.PARENT
					ENDDO
					llMouseIsOnMe= oOBject = THISFORM
				ENDIF
		ENDCASE

		IF NOT llMouseIsOnMe
			THIS.ENABLED = .F.
			THISFORM.HIDE()
		ENDIF

ENDDEFINE
This actually had a grid on itself, and some serious code to populate its cursor. In some cases it would contain a picture or something else. It came handy when we wanted to show more details on something that's in a grid. So this is a tooltip form.
The initial idea and set of properties came, IIRC, from Martina (just a feeling that it's so, I mean look at the dates in the comments, wrote tens of thousands of lines since then).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform