In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

problems with TComboBox

Foro público de Xailer en español
Responder
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

problems with TComboBox

Mensaje por Ingo »

Hello ,
TComboBox (using the new obj files) causes me more problems:
1. After deleting the text in the Editcontrol of the ComboBox and entering
the 1st letter, ComboBox:cText contains and shows still the old deleted
text. Only after the second letter the content of :cText is changed. Is
this the intended behavior?
2. After selecting an item from the list ComboBox:cText does not update
immediately. How can I get the real text from the InplaceEdit just in
time?
3. The returnvalue of ComboBox:FindString(ComboBox:cText) begins with 0 and
not with 1, on the other side ComboBox:GetText(nItem) begins with 1. Is this
intended?
Please take a look in the testcode in combotest.zip
Regards
Ingo


Attached files ComboTest.zip (2.3 KB)Â
Xevi
Mensajes: 1706
Registrado: Jue Sep 08, 2005 12:58 pm

problems with TComboBox

Mensaje por Xevi »

Ingo,
Sorry, I don't English...
Debes utilizar el método OnChange() del ComboBox...
Te adjunto el Test.
Regards,
Xevi.
"Ingo" <ing.jh@web.de> escribió en el mensaje
news:[email=434ea5d3@ozsrvnegro.ozlan.local...]434ea5d3@ozsrvnegro.ozlan.local...[/email]
>
> Hello ,
> TComboBox (using the new obj files) causes me more problems:
>
> 1. After deleting the text in the Editcontrol of the ComboBox and entering
> the 1st letter, ComboBox:cText contains and shows still the old deleted
> text. Only after the second letter the content of :cText is changed. Is
> this the intended behavior?
>
> 2. After selecting an item from the list ComboBox:cText does not update
> immediately. How can I get the real text from the InplaceEdit just in
> time?
>
> 3. The returnvalue of ComboBox:FindString(ComboBox:cText) begins with 0
> and
> not with 1, on the other side ComboBox:GetText(nItem) begins with 1. Is
> this
> intended?
>
> Please take a look in the testcode in combotest.zip
>
> Regards
>
> Ingo
>
>
>


Attached files test.zip (1.9 KB)Â
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

problems with TComboBox

Mensaje por jfgimenez »

Ingo,
> 1. After deleting the text in the Editcontrol of the ComboBox and entering
> the 1st letter, ComboBox:cText contains and shows still the old deleted
> text. Only after the second letter the content of :cText is changed. Is
> this the intended behavior?
No. It's fixed now, althought nIndex isn't update inmediately due to the own
windows control behavior
> 2. After selecting an item from the list ComboBox:cText does not update
> immediately. How can I get the real text from the InplaceEdit just in
> time?
There was a bug. Now you can get it reading the property cText at any time
> 3. The returnvalue of ComboBox:FindString(ComboBox:cText) begins with 0
> and
> not with 1, on the other side ComboBox:GetText(nItem) begins with 1. Is
> this
> intended?
You are right. Now it's fixed.
> Please take a look in the testcode in combotest.zip
Thanks for the sample and the info. Here you are the fixed module.
--
Regards,
Jose F. Gimenez


Attached files ComboBox.zip (5.6 KB)Â
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

problems with TComboBox

Mensaje por Ingo »

Jose,
thanks a lot for the rapid fix, but
1. now ComboBox:nIndex will be not aktualized when you select an item of the
list
2. ComboBox:GetText(nItem) returns not the complete element but only the
first letter. The returned string is the same like ComboBox:cText
//------------
METHOD GetText( nItem )
nItem: Posición del elemento en la lista
cText: Texto del elemento <---- should it be
the whole element?
Devuelve un elemento de la lista de valores
RETURN cText
//------------
Regards
Ingo
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:[email=434eccc8@ozsrvnegro.ozlan.local...]434eccc8@ozsrvnegro.ozlan.local...[/email]
> Ingo,
>
>> 1. After deleting the text in the Editcontrol of the ComboBox and
>> entering
>> the 1st letter, ComboBox:cText contains and shows still the old deleted
>> text. Only after the second letter the content of :cText is changed. Is
>> this the intended behavior?
>
> No. It's fixed now, althought nIndex isn't update inmediately due to the
> own windows control behavior
>
>
>> 2. After selecting an item from the list ComboBox:cText does not update
>> immediately. How can I get the real text from the InplaceEdit just in
>> time?
>
> There was a bug. Now you can get it reading the property cText at any time
>
>
>> 3. The returnvalue of ComboBox:FindString(ComboBox:cText) begins with 0
>> and
>> not with 1, on the other side ComboBox:GetText(nItem) begins with 1. Is
>> this
>> intended?
>
> You are right. Now it's fixed.
>
>
>> Please take a look in the testcode in combotest.zip
>
> Thanks for the sample and the info. Here you are the fixed module.
>
>
> --
> Regards,
>
> Jose F. Gimenez
>
>
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

problems with TComboBox

Mensaje por Ingo »

Hola Xevi,
no veo ninguna diferencia. Pienso que OnChange() está llamado solamente si
la posición en la lista está cambiando o no.
//---------------------------------------------------------- ----------------
EVENT OnChange( oSender, nIndex )
oSender: Referencia al objeto que dispara el evento
nIndex: Indice del elemento seleccionado
Evento que se dispara cada vez que se cambia el elemento
seleccionado
RETURN Nil
//---------------------------------------------------------- ----------------
Saludos
Ingo
"Xevi" <xevicomas@terra.es> schrieb im Newsbeitrag
news:434ea906$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ingo,
>
> Sorry, I don't English...
>
> Debes utilizar el método OnChange() del ComboBox...
> Te adjunto el Test.
>
>
> Regards,
> Xevi.
>
>
> "Ingo" <ing.jh@web.de> escribió en el mensaje
> news:[email=434ea5d3@ozsrvnegro.ozlan.local...]434ea5d3@ozsrvnegro.ozlan.local...[/email]
>>
>> Hello ,
>> TComboBox (using the new obj files) causes me more problems:
>>
>> 1. After deleting the text in the Editcontrol of the ComboBox and
>> entering
>> the 1st letter, ComboBox:cText contains and shows still the old deleted
>> text. Only after the second letter the content of :cText is changed. Is
>> this the intended behavior?
>>
>> 2. After selecting an item from the list ComboBox:cText does not update
>> immediately. How can I get the real text from the InplaceEdit just in
>> time?
>>
>> 3. The returnvalue of ComboBox:FindString(ComboBox:cText) begins with 0
>> and
>> not with 1, on the other side ComboBox:GetText(nItem) begins with 1. Is
>> this
>> intended?
>>
>> Please take a look in the testcode in combotest.zip
>>
>> Regards
>>
>> Ingo
>>
>>
>>
>
>
>
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

problems with TComboBox

Mensaje por jfgimenez »

Ingo,
I've checked it again and:
> 1. now ComboBox:nIndex will be not aktualized when you select an item of
> the list
Please, try with the attached sample. Notice that when you select an item
from the list, the event which is fired is OnChange, not OnEditUpdate nor
OnEditChange. And OnChange receives 3 params: oSender, nIndex and nOldIndex,
but it's fired before nIndex is changed; the reason is that if you return
..F. from this event, the combo doesn't change.
However, if you use a csDROPDOWN combo that allow the user to type anything
in it, then IMO, you should not worry about nIndex at all. You should
consider to deal only with cText. And if you are interested in if the typed
string is in the list, then you can use :FindString() or a simple AScan() to
locate it.
> 2. ComboBox:GetText(nItem) returns not the complete element but only the
> first letter. The returned string is the same like ComboBox:cText
Sorry, I'm not able to reproduce this behavior. In the attached sample,
cText and GetText() return always the exact string item.
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

problems with TComboBox

Mensaje por jfgimenez »

Ingo,
oops, sorry... the sample ;-)
Regards,
Jose F. Gimenez


Attached files test.zip (1.9 KB)Â
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

problems with TComboBox

Mensaje por Ingo »

Jose,
sorry I thought GetText(nItem) returns the item of the list and not
ComboBox:cText:
//---------------------------------------------------------- ----------------
METHOD GetText( nItem )
nItem: Posición del elemento en la lista
cText: Texto del elemento
Devuelve un elemento de la lista de valores
RETURN cText
//---------------------------------------------------------- ----------------
Please try this, put "antonia" (lower case) in:
ComboBox:cText has the string "antonia" - this is correct
FindString returns 1 - this is correct too
GetText(1) returns "antonia" - the same string like cText but it should
be "Antonia", because ComboBox:aItems[1] is "Antonia" not "antonia" - am I
wrong?
Regards
Ingo
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

problems with TComboBox

Mensaje por jfgimenez »

Ingo,
> Please try this, put "antonia" (lower case) in:
> ComboBox:cText has the string "antonia" - this is correct
> FindString returns 1 - this is correct too
> GetText(1) returns "antonia" - the same string like cText but it should
> be "Antonia", because ComboBox:aItems[1] is "Antonia" not "antonia" - am I
> wrong?
You are right. I didn't understand the problem before. Attached is the fixed
module.
Thanks for your feedback.
--
Regards,
Jose F. Gimenez


Attached files ComboBox.zip (5.7 KB)Â
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder