Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to remove picture with SetAll
Message
De
09/05/2003 03:39:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/05/2003 14:03:10
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00786028
Message ID:
00786646
Vues:
16
>Cetin,
>first thanks for the help, it solved the problem.
>But I have some questions...
>
>In the Init event of the grid I remove the Header and add another Header based on my Header class.
>
>
>LOCAL oCol
>FOR EACH oCol IN THIS.COLUMNS
>	IF TYPE('oCol.Header1')='O'
>		oCol.REMOVEOBJECT('Header1')
>		oCol.NEWOBJECT('Header1','Header_indexa','Header_indexa.prg')
>	ENDIF
>	oCol = .NULL.
>ENDFOR
>
>
>What I really dont understand is that in a Form with a Grid I insert this code in the click event of the Header.
>The test I made was this...to insert pictures
>
>THIS.PARENT.PARENT.SETALL("Picture","C:\BMPS\UP.BMP","Header")
>
>and this code in another Header (another column) to remove the pictures
>
> THIS.PARENT.PARENT.SETALL("Picture","","Header")	&& <<- Works fine
>
>It works as expected, then it removes the picture, but in the same doesnt happens when the code is in the Header Class.
>
>Why this works in a Base Header class and not with a Header class defined programtically.
>The UDF Header class is based on a Base Header class, and I think it should work the same way.
>
>
>DEFINE CLASS Header_indexa AS HEADER
>PROCEDURE CLICK
>LOCAL nome_cursor, nome_column, nrecno, nome_grid
>nrecno = RECNO()
>nome_column = THIS.PARENT.CONTROLSOURCE
>nome_column  = SUBSTR(nome_column,AT('.',nome_column) + 1)
>nome_cursor = SUBSTR(nome_column,1,AT('.',nome_column) -1)
>nome_grid = THIS.PARENT.PARENT.NAME
>IF TAGCOUNT(nome_cursor) > 0
>	FOR nCount = 1 TO 30					
>		IF !EMPTY(TAG(nCount))  			
>			IF UPPER(TAG(nCount)) = UPPER(nome_column)    	
>				DO CASE
>				CASE UPPER(JUSTSTEM(THIS.PICTURE)) = "UP"			
>					SET ORDER TO TAG nome_column DESCENDING
>					THIS.PICTURE = 'C:\BMPS\Down.bmp'
>
>				CASE UPPER(JUSTSTEM(THIS.PICTURE)) = "DOWN"			
>					SET ORDER TO TAG nome_column ASCENDING
>					THIS.PICTURE = 'C:\BMPS\UP.BMP'
>
>				OTHERWISE
>					THIS.PARENT.PARENT.SETALL("Picture","","Header")
>
>					SET ORDER TO TAG nome_column ASCENDING
>					THIS.PICTURE = 'C:\BMPS\UP.BMP'
>				ENDCASE
>
>				THIS.PARENT.PARENT.REFRESH	
>				GOTO nrecno
>				EXIT 						
>			ENDIF
>		ENDIF
>	ENDFOR
>ENDIF
>ENDPROC
>ENDDEFINE
>
>
>I would apreciate it if you could explain this behavior that Im not understanding.
>
>TIA
>
>Peter

3rd parameter of Setall is classname not baseclass name. Suppose on a form you've 3 baseclass textboxes and 2 textboxes from myTextbox class :

thisform.Setall('Enabled', .f., 'textbox') && Disables 3 baseclass ones
thisform.Setall('Enabled', .f., 'mytextbox') && Disables 2 subclass ones

this.parent.parent.setall('Picture','','Header_indexa')
Would work for your headers. Since you have the code directly in class itself you could make it more flexible (not hardcoded) :

this.parent.parent.setall('Picture','',this.Class)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform