Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Border Color
Message
From
03/10/2018 11:49:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
03/10/2018 10:13:17
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01662372
Message ID:
01662463
Views:
37
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform