Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need function to find Monday by Week No
Message
From
25/09/2005 18:54:03
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01052733
Message ID:
01052892
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>Now I need to figure out how to show the WAIT message next to the "clicked" label. Otherwise, the WAIT message is too far to the right from where I would like it to be.

Why not use ToolTipText?!

In the label's init() you can easily create its tooltiptext.

I also advice you to make a class of the label with a property nWeek. And use that property in the label's init() to create the caption and the tooltiptext. Then, all you have to do is drop that class 52 times on the form, or write a simple piece of code in the form's init() that uses addobject() and xy-coordinates to create the objects.

Oh well, here's the code...
PUBLIC oform1

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

*-- Form:         form1 (someform.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   09/26/05 01:33:11 AM
*
DEFINE CLASS form1 AS form

	Top = 0
	Left = 0
	Height = 286
	Width = 761
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	PROCEDURE Init
		local lnX, lnY, lnW, lcW

*		set classlib to someclasslib.vcx

		for lnW = 1 to 52
			lnX = ( mod( m.lnW - 1, 13 ) ) * 50 + 50
			lnY = ceil( lnW / 13 ) * 20
			lcW = 'lblWeek' + padl( m.lnW, 2, '0' )
			this.addobject( m.lcW, 'weekno', 2005, lnW )
			with this.&lcW
				.left   = m.lnX
				.top    = m.lnY
				.visible = .T.
			endwith
		next

		this.showtips = .t.
	ENDPROC
ENDDEFINE

*-- Class:        weekno (someclasslib.vcx)
*-- ParentClass:  label
*-- BaseClass:    label
*-- Time Stamp:   09/26/05 01:19:07 AM
*
DEFINE CLASS weekno AS label

	Caption = "Label1"
	Height = 17
	Width = 40
	Name = "weekno"
	nWeek = .F.
	nYear = .F.

	PROCEDURE Init
		lparameter tnYear, tnWeek

		with this
			.nYear       = m.tnYear
			.nWeek       = m.tnWeek
			.caption     = str( .nWeek, 2 )
			.tooltiptext = dtoc( DATE(.nYear,1,1)-DOW(DATE(.nYear,1,1),3) + .nWeek*7 )
		endwith
	ENDPROC
ENDDEFINE
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform