Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why Control Does not show?
Message
From
20/10/2006 14:48:57
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01163697
Message ID:
01163727
Views:
8
Hi Enmanuel

Maybe I am missing something but this looks strange.
>>		DIMENSION Thisform.msgObjetos[nElements+1] As Object
>>		
>>		*--- Creo el objeto que mostrará el mensaje de error
>>			Thisform.msgObjetos[nElements]=CREATEOBJECT("image")
Looks like you are dimensioning nElements+1 and then adding the object to the old dimension number which could overwrite the existing object.

>Thanks for your reply Don! Actually, that was made on purpose because I create the array initially with one element. However, I don't think that's the problem because in the Debugger Locals window I can see the object with all its properties correctly set.
>
>I'm thinking it's an object scope problem and right now I'm trying changing from an array to a collection object to hold references to the objects created instead of the object itself.
>
>Enmanuel
>
>
>
>>I think its your re DIMENSION... You re-dimension with +1 for the new object (image) you want to create, then you refer to [nElements], not the [nElements+1].
>>
>>Try updating the nElements count before dimension, then the rest should go...
>>
>>
>>
>>        // you had...
>>	// nElements = ALEN(Thisform.msgObjetos)
>>        // Change to...
>>	nElements = ALEN(Thisform.msgObjetos) +1
>>
>>        // then, refer to the NEW object entry you allocate for
>>	// was: DIMENSION Thisform.msgObjetos[nElements+1] As Object
>>	DIMENSION Thisform.msgObjetos[nElements] As Object
>>
>>        // now you are referring to the last element from the re-DIMENSION
>>	Thisform.msgObjetos[nElements]=CREATEOBJECT("image")
>>	WITH Thisform.msgObjetos[nElements]
>>
>>
>>
>>
>>>I'm redesining my "ErrorProvider" class to allow multiple error objects to be shown and the same time. Basically I create an array of objects and every time the Raiseerror method is called I add an error object to the array and set some properties based on parameters passed to the method to allow for a proper positioning on the form. However, even when the code doesn't fire any error message the object does not show.
>>>
>>>This is the code in my RaiseError Method:
>>>
>>>
>>>		LPARAMETERS oObjeto,cMensaje,iSeverity,lLeft
>>>		**** Parametros
>>>		*--- oObjeto    - Objeto que se esta validando
>>>		*--- cMensaje   - Mensaje de error a desplegarse en el tooltip
>>>		*--- iSeverity  - Severidad del mensaje (1- Error, 2- Advertencia, 3- Pregunta ?)
>>>		*--- lLeft      - Verdadero si el icono se va a posicionar a la izquierda del control que lo está llamando
>>>		*---
>>>		* Imitando el control ErrorProvider de .NET
>>>		*---
>>>		* Resembles the .NET ErrorProvider Control
>>>		*---
>>>		* Por Enmanuel Gómez B.
>>>		* Version Original Feb 4, 2005
>>>		* 2da Version : Oct. 19, 2006
>>>		*---
>>>
>>>		*--- Siempre añado un Elemento al Arreglo de objetos
>>>		LOCAL nElements
>>>		IF !PEMSTATUS(Thisform,"msgObjetos",5)
>>>			Thisform.AddProperty("msgObjetos(1)")
>>>		ENDIF
>>>		nElements = ALEN(Thisform.msgObjetos)
>>>	
>>>		DIMENSION Thisform.msgObjetos[nElements+1] As Object
>>>		
>>>		*--- Creo el objeto que mostrará el mensaje de error
>>>			Thisform.msgObjetos[nElements]=CREATEOBJECT("image")
>>>			
>>>			WITH Thisform.msgObjetos[nElements]
>>>				*--- Posicion del Objeto
>>>				IF !lLeft
>>>					.Left= oObjeto.Left+oObjeto.Width
>>>				ELSE
>>>					.Left=oObjeto.Left-(.Width+3)
>>>				ENDIF
>>>				.Top=oObjeto.Top
>>>				.ToolTipText=cMensaje
>>>				
>>>				*--- Mensaje de error
>>>				.ToolTipText=cMensaje
>>>
>>>				*--- Severidad
>>>				DO CASE
>>>					CASE iSeverity=1
>>>						.Picture=This.Image1.Picture
>>>					CASE iSeverity=2
>>>						.Picture=This.Image2.Picture
>>>					CASE iSeverity=3
>>>						.Picture=This.Image3.Picture
>>>				ENDCASE
>>>
>>>				*---
>>>				.Visible=.t.
>>>
>>>			ENDWITH
>>>
>>>
>>>
>>>
>>>Can anybody tell me what am I missing here?
>>>
>>>TIA,
>>>
>>>Enmanuel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform