Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logical fields
Message
De
20/04/2015 15:56:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/04/2015 04:15:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01618597
Message ID:
01618825
Vues:
45
>>>Hi All,
>>>
>>>A strange question perhaps; logical fields in a table start of as blank when browsed. But once set to .T. or .F. you cannot revert the field to a blank. Anyway to do that? Just a curiosity really.
>>
>>BLANK FIELDS ...
>>
>>But WHY?
>>:-)
>
>Thanks :) It's basically I am browsing a table which has many logical fields, > 50. And I am only really interested in those that are set to .T. I am just scanning the table for certain things and if I could see only those that are .T. and the rest are blank then they visually stand out better. Just a minor thing.

Here... you may fiddle with the captions for gCheck class, perhaps add a case for isblank().
LPARAMETERS justaparameter
*[2002/05/29 03:53:34] nDragan - poslednja neobeležena verzija
*[2011/03/13 14:44:51] nDragan - dynamicbackcolor
oForm=CREATEOBJECT("browform")
oForm.SHOW()
READ EVENTS
RELEASE oForm

DEFINE CLASS browform AS FORM
	ADD OBJECT oGrid AS GRID WITH RECORDSOURCE=ALIAS()
	KEYPREVIEW=.T.
	DATASESSION=1

	PROCEDURE ACTIVATE
	THIS.CAPTION="Browse "+THIS.oGrid.RECORDSOURCE
	THIS.RESIZE()
	ENDPROC

*---------------------------------------------------
	PROCEDURE INIT()
*-- dn 2011/03/13
	THIS.NEWOBJECT("srpos","srposition","generall.vcx","", "top,left,height,width")

*---------------------------------------------------
	PROCEDURE KEYPRESS(tnKey, tnSCA)
*-- dn 2011/03/13
	LOCAL c, o, N, i, l, cCRS
	IF tnKey=27
		THIS.HIDE()
	ENDIF

*---------------------------------------------------
	PROCEDURE QUERYUNLOAD()
	THIS.HIDE()
	RETURN .F.

*---------------------------------------------------
	PROCEDURE HIDE()
*-- dn 2011/07/30
	CLEAR EVENTS
	DODEFAULT()

*---------------------------------------------------
	PROCEDURE oGrid.INIT
	LOCAL i, N
	SET PROCEDURE TO BROWSE.prg
	FOR i=1 TO THIS.COLUMNCOUNT
		WITH THIS.COLUMNS[i]
			cSource=.CONTROLSOURCE
			cType=TYPE(cSource)
			DO CASE
				CASE cType="L"
					.ADDOBJECT("check","gcheck")
					.CHECK.VISIBLE=.T.
					.REMOVEOBJECT("text1")
					.CURRENTCONTROL="check"
					.CHECK.READONLY=.F.
					.SPARSE=.F.
			ENDCASE
			.DYNAMICBACKCOLOR="icase(ISNULL("+.CONTROLSOURCE+"), 0xcecece, ISblank("+.CONTROLSOURCE+"), 0xceffce,0xffffff)"
		ENDWITH
	ENDFOR
	WITH THIS AS GRID
		.GRIDLINECOLOR=0xcaaaaa
		.SETALL("fontname","consolas")
		.AUTOFIT()
	ENDWITH

	ENDPROC


	PROCEDURE RESIZE
	WITH THIS.oGrid
		.TOP=0
		.LEFT=0
		.WIDTH=THIS.WIDTH
		.HEIGHT=THIS.HEIGHT
		.SETALL("selectonentry",.F.)
	ENDWITH
	ENDPROC

ENDDEFINE


DEFINE CLASS gcheck AS CHECKBOX

	caption_yes = ("Yes")
	caption_no = ("No")
	caption_null= ("<null>")
	NAME = "gcheck"


	PROCEDURE INIT
* fire value_assign
	THIS.VALUE=THIS.VALUE
	ENDPROC

	PROCEDURE value_assign(tu_val)
	DO CASE
		CASE ISNULL(tu_val)
			THIS.CAPTION=THIS.caption_null
		CASE EMPTY(tu_val)
			THIS.CAPTION=THIS.caption_no
		OTHERWISE
			THIS.CAPTION=THIS.caption_yes
	ENDCASE
	THIS.REFRESH()
	THIS.VALUE = tu_val
	ENDPROC


	PROCEDURE INTERACTIVECHANGE
	THIS.VALUE=THIS.VALUE
	ENDPROC


	PROCEDURE CLICK
	DODEFAULT()
	THIS.REFRESH
	NODEFAULT
	ENDPROC


ENDDEFINE

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
Répondre
Fil
Voir

Click here to load this message in the networking platform