Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long tooltips
Message
From
11/05/2019 10:31:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01668529
Message ID:
01668543
Views:
70
>Hi everybody,
>
>Do you know of some way to make tooltip on VFP controls to be longer than 255 characters?
>
>We're sun-setting this application, so I don't want to introduce something complex into our project.
>
>Thanks a lot in advance.
Hi,
**************************************************
*-- Class:        _multitooltip (d:\foxproprojects\vervoerskosten\classes\googlemailcomposer.vcx)
*-- ParentClass:  container
*-- BaseClass:    container
*-- Time Stamp:   07/11/18 02:35:06 PM
*
DEFINE CLASS _multitooltip AS container


	Tag = "class made by Benn Kjae"
	Width = 48
	Height = 22
	BackColor = RGB(0,0,0)
	*-- Specifies the maximum width of MultiTooltip
	_maxwidth = 200
	Name = "_multitooltip"


	ADD OBJECT label AS label WITH ;
		FontName = "Tahoma", ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 1, ;
		Top = 2, ;
		Width = 22, ;
		ForeColor = RGB(255,255,255), ;
		Name = "Label"


	PROCEDURE Destroy
		**********************************************************************
		* Program....: _MULTITOOLTIP.DESTROY
		* Version....:
		* Author.....: Benn Kjae
		* Date.......: 11 July 2018, 12:32:40
		* Notice.....: No Copyright © Use at your own risk.
		* Parameters.:
		* Called by..:
		* Purpose....:
		**********************************************************************
		With Thisform
			If Pemstatus(Thisform,'_MultiLineToolTipActive',5)
				._MultiLineToolTipActive = .F.
				._MouseOverObject = .Name
			Endif
		Endwith
	ENDPROC


	PROCEDURE Init
		**********************************************************************
		* Program....: _MULTITOOLTIP.INIT
		* Version....:
		* Author.....: Benn Kjae
		* Date.......: 11 July 2018, 12:31:40
		* Notice.....: No Copyright © Use at your own risk.
		* Parameters.:
		* Called by..:
		* Purpose....:
		**********************************************************************

		Parameters cToolTipText, nXCoord, nYCoord, cName, nNewMaxWidth

		*-- Change ._MaxWidth for the tooltip box
		If Type("nNewMaxWidth") = "N"
			If nNewMaxWidth >= 10
				This._MaxWidth = nNewMaxWidth
			Endif
		Endif

		With Thisform
			._MultiLineToolTipActive = .T.
			._MouseOverObject = cName
		Endwith

		With This.Label
			.Caption = cToolTipText

			This.Left = nXCoord
			This.Top = nYCoord + 17

			This.Visible = .T.

		*-- Make sure that the label resize to it's max width
			.AutoSize = .T.

		*-- Have to wait a moment for the label to be updated
			=Inkey(.0001)

			.AutoSize = .F.

			If .Width > This._MaxWidth
				.Width = This._MaxWidth - 4
				.WordWrap = .T.

		*-- Make sure that the label resize to it's new size
		*-- controled by .Width and .WordWrap
				.AutoSize = .T.
				.AutoSize = .F.
			Endif
			This.Width = .Width + 4
			This.Height = .Height + 2
		Endwith
	ENDPROC


ENDDEFINE
*
*-- EndDefine: _multitooltip
**************************************************
Maybe this class is of any help?

Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform