Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Border Color
Message
De
03/10/2018 11:49:49
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
03/10/2018 10:13:17
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01662372
Message ID:
01662463
Vues:
38
>Hi Thomas,
>
>I just created a PRG from by gathering functionality out of our framework, so yes, it can be written better and more efficient.
>But in your example, no the function is not called often, so performance is not an issue, even though I like your approach.

Your approach has the advantage of getting an object reference, which you may need if you wanted to do more things to it. At this point, with just color, Thomass's wins the elegance contest (and it's a one-liner!). If you wanted to change, say, line pattern or some such property, then it would be easier with object reference.
	PROCEDURE PaintLines()
		LOCAL oLine, oObject 

		oObject = THIS
		TRY
			oLine = GETPEM(oObject.PARENT, oObject.NAME+"_T")
			this.PaintLine(oLine)
			oLine = GETPEM(oObject.PARENT, oObject.NAME+"_L")
			this.PaintLine(oLine)
			oLine = GETPEM(oObject.PARENT, oObject.NAME+"_R")
			this.PaintLine(oLine)
			oLine = GETPEM(oObject.PARENT, oObject.NAME+"_B")
			this.PaintLine(oLine)
			oLine = GETPEM(oObject.PARENT, oObject.NAME+"_H")
			this.PaintLine(oLine)
		ENDTRY

	PROCEDURE PaintLine(toLine)
		with toLine
			.bordercolor=guisettings.gridbordercolor
			.borderstyle=guisettings.gridborderLineStyle
			.borderWidth=guisettings.gridborderLineWidth
		endwith

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform