Página 1 de 1

TCombobox redifinition

Publicado: Vie Oct 06, 2006 2:01 pm
por Oleg
Hello!
I want to make Value property in TCombobox class which have the same value
as nIndex property.
I did it like this:
--------
#include "Xailer.ch"
CLASS TCOMBOBOX FROM XCOMBOBOX
PROTECTED:
METHOD SetValue(nVal)
PUBLISHED:
DATA bBlock
DATA xEmpty
PROPERTY Value INIT 0 READ ::nIndex WRITE ::SetValue( nVal )
ENDCLASS
METHOD SetValue( nVal ) CLASS TCombobox
::nIndex:=nVal
RETURN Nil
--------
but when I try to access Value property it is not found (error).
Can I achieve this?
If I use PROPERTY clause without READ/WRITE (PROPERTY Value INIT 0) it
works.
Thank you.
Oleg.

TCombobox redifinition

Publicado: Vie Oct 06, 2006 6:17 pm
por ignacio
Oleg,
Just change this:
PROPERTY Value INIT 0 READ INLINE ::nIndex WRITE SetValue
I hope it will work.
Consult the doucmentation about OOP
Regards,
"Oleg" <info@cluster.samara.ru> wrote in message
news:[email=452637d4@news.xailer.com...]452637d4@news.xailer.com...[/email]
> Hello!
>
> I want to make Value property in TCombobox class which have the same value
> as nIndex property.
> I did it like this:
>
> --------
> #include "Xailer.ch"
>
> CLASS TCOMBOBOX FROM XCOMBOBOX
> PROTECTED:
> METHOD SetValue(nVal)
> PUBLISHED:
> DATA bBlock
> DATA xEmpty
> PROPERTY Value INIT 0 READ ::nIndex WRITE ::SetValue( nVal )
> ENDCLASS
>
> METHOD SetValue( nVal ) CLASS TCombobox
> ::nIndex:=nVal
> RETURN Nil
> --------
>
> but when I try to access Value property it is not found (error).
> Can I achieve this?
>
> If I use PROPERTY clause without READ/WRITE (PROPERTY Value INIT 0) it
> works.
>
> Thank you.
> Oleg.
>
>

TCombobox redifinition

Publicado: Vie Oct 06, 2006 6:17 pm
por NoName
Oleg,
Just change this:
PROPERTY Value INIT 0 READ INLINE ::nIndex WRITE SetValue
I hope it will work.
Consult the doucmentation about OOP
Regards,
"Oleg" <info@cluster.samara.ru> wrote in message
news:[email=452637d4@news.xailer.com...]452637d4@news.xailer.com...[/email]
> Hello!
>
> I want to make Value property in TCombobox class which have the same value
> as nIndex property.
> I did it like this:
>
> --------
> #include "Xailer.ch"
>
> CLASS TCOMBOBOX FROM XCOMBOBOX
> PROTECTED:
> METHOD SetValue(nVal)
> PUBLISHED:
> DATA bBlock
> DATA xEmpty
> PROPERTY Value INIT 0 READ ::nIndex WRITE ::SetValue( nVal )
> ENDCLASS
>
> METHOD SetValue( nVal ) CLASS TCombobox
> ::nIndex:=nVal
> RETURN Nil
> --------
>
> but when I try to access Value property it is not found (error).
> Can I achieve this?
>
> If I use PROPERTY clause without READ/WRITE (PROPERTY Value INIT 0) it
> works.
>
> Thank you.
> Oleg.
>
>

TCombobox redifinition

Publicado: Vie Oct 06, 2006 9:33 pm
por Oleg
Ignacio,
thank you. It works.
Best regards,
Oleg.

TCombobox redifinition

Publicado: Vie Oct 06, 2006 9:33 pm
por Oleg
Ignacio,
thank you. It works.
Best regards,
Oleg.