HI Ignacio , Jose and all Xailer's
How can we access the onClick event on a dynamically created ( not created
with the ToptionItems designer ) ToptionItem inside a TOptionList that
is included in a TExplorerGroup ???
TIA
Dionisis
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.
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.
How can access dynamically TOptionItems adden in a TOptionList
- Dionisis Divaris
- Mensajes: 485
- Registrado: Jue Jul 12, 2007 8:48 pm
- Ubicación: Athens Greece
How can access dynamically TOptionItems adden in a TOptionList
Dionisis,
Here you are a piece of code that creates an optionlist and assign an
action to onclick event:
WITH OBJECT ::oOpcionesEspeciales := TOptionList():New(
GlobalGes:oForm:oEB_Mantenimiento )
:SetBounds( 11, 36, 245, 88 )
:lAutoSize := .T.
// Generates ImageList
IF LEN( aImageList ) > 0
WITH OBJECT :oImageList
:nWidth := 16
:nHeight := 16
FOR EACH cImage IN aImageList
:Add( cImage )
NEXT
END
ENDIF
FOR EACH aOpcion IN ::aOpcionesEspeciales //
::aOpcionesEspeciales is an array containing info about items to be created
WITH OBJECT :AddItem( aOpcion[1] )
:OnClick := "PorHacer" // this is a method
declared in the form
IF LEN(aOpcion) > 1
nPos := ASCAN(aImageList, aOpcion[2])
:nImage := nPos
ENDIF
END
NEXT
:Create()
END
To launch onclick event 'manually' you should call
::oOpcionesEspeciales:aItems[n]:Click( )
Hope it helps you.
Regards,
José Luis Capel
Dionisis Divaris escribió:
> HI Ignacio , Jose and all Xailer's
>
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
>
> TIA
> Dionisis
>
>
Here you are a piece of code that creates an optionlist and assign an
action to onclick event:
WITH OBJECT ::oOpcionesEspeciales := TOptionList():New(
GlobalGes:oForm:oEB_Mantenimiento )
:SetBounds( 11, 36, 245, 88 )
:lAutoSize := .T.
// Generates ImageList
IF LEN( aImageList ) > 0
WITH OBJECT :oImageList
:nWidth := 16
:nHeight := 16
FOR EACH cImage IN aImageList
:Add( cImage )
NEXT
END
ENDIF
FOR EACH aOpcion IN ::aOpcionesEspeciales //
::aOpcionesEspeciales is an array containing info about items to be created
WITH OBJECT :AddItem( aOpcion[1] )
:OnClick := "PorHacer" // this is a method
declared in the form
IF LEN(aOpcion) > 1
nPos := ASCAN(aImageList, aOpcion[2])
:nImage := nPos
ENDIF
END
NEXT
:Create()
END
To launch onclick event 'manually' you should call
::oOpcionesEspeciales:aItems[n]:Click( )
Hope it helps you.
Regards,
José Luis Capel
Dionisis Divaris escribió:
> HI Ignacio , Jose and all Xailer's
>
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
>
> TIA
> Dionisis
>
>
How can access dynamically TOptionItems adden in a TOptionList
Dionisis,
Here you are a piece of code that creates an optionlist and assign an
action to onclick event:
WITH OBJECT ::oOpcionesEspeciales := TOptionList():New(
GlobalGes:oForm:oEB_Mantenimiento )
:SetBounds( 11, 36, 245, 88 )
:lAutoSize := .T.
// Generates ImageList
IF LEN( aImageList ) > 0
WITH OBJECT :oImageList
:nWidth := 16
:nHeight := 16
FOR EACH cImage IN aImageList
:Add( cImage )
NEXT
END
ENDIF
FOR EACH aOpcion IN ::aOpcionesEspeciales //
::aOpcionesEspeciales is an array containing info about items to be created
WITH OBJECT :AddItem( aOpcion[1] )
:OnClick := "PorHacer" // this is a method
declared in the form
IF LEN(aOpcion) > 1
nPos := ASCAN(aImageList, aOpcion[2])
:nImage := nPos
ENDIF
END
NEXT
:Create()
END
To launch onclick event 'manually' you should call
::oOpcionesEspeciales:aItems[n]:Click( )
Hope it helps you.
Regards,
José Luis Capel
Dionisis Divaris escribió:
> HI Ignacio , Jose and all Xailer's
>
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
>
> TIA
> Dionisis
>
>
Here you are a piece of code that creates an optionlist and assign an
action to onclick event:
WITH OBJECT ::oOpcionesEspeciales := TOptionList():New(
GlobalGes:oForm:oEB_Mantenimiento )
:SetBounds( 11, 36, 245, 88 )
:lAutoSize := .T.
// Generates ImageList
IF LEN( aImageList ) > 0
WITH OBJECT :oImageList
:nWidth := 16
:nHeight := 16
FOR EACH cImage IN aImageList
:Add( cImage )
NEXT
END
ENDIF
FOR EACH aOpcion IN ::aOpcionesEspeciales //
::aOpcionesEspeciales is an array containing info about items to be created
WITH OBJECT :AddItem( aOpcion[1] )
:OnClick := "PorHacer" // this is a method
declared in the form
IF LEN(aOpcion) > 1
nPos := ASCAN(aImageList, aOpcion[2])
:nImage := nPos
ENDIF
END
NEXT
:Create()
END
To launch onclick event 'manually' you should call
::oOpcionesEspeciales:aItems[n]:Click( )
Hope it helps you.
Regards,
José Luis Capel
Dionisis Divaris escribió:
> HI Ignacio , Jose and all Xailer's
>
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
>
> TIA
> Dionisis
>
>
How can access dynamically TOptionItems adden in a TOptionList
Dionisis,
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
You can assign this event directly, just how Jose Luis has pointed:
::oOptionList1:aItems[1]:OnClick := "MethodToBeExecuted"
or
::oOptionList1:aItems[1]:OnClick := {| oSender | DoWhatEverYouWant() }
--
Regards,
Jose F. Gimenez
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
You can assign this event directly, just how Jose Luis has pointed:
::oOptionList1:aItems[1]:OnClick := "MethodToBeExecuted"
or
::oOptionList1:aItems[1]:OnClick := {| oSender | DoWhatEverYouWant() }
--
Regards,
Jose F. Gimenez
How can access dynamically TOptionItems adden in a TOptionList
Dionisis,
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
You can assign this event directly, just how Jose Luis has pointed:
::oOptionList1:aItems[1]:OnClick := "MethodToBeExecuted"
or
::oOptionList1:aItems[1]:OnClick := {| oSender | DoWhatEverYouWant() }
--
Regards,
Jose F. Gimenez
> How can we access the onClick event on a dynamically created ( not created
> with the ToptionItems designer ) ToptionItem inside a TOptionList that
> is included in a TExplorerGroup ???
You can assign this event directly, just how Jose Luis has pointed:
::oOptionList1:aItems[1]:OnClick := "MethodToBeExecuted"
or
::oOptionList1:aItems[1]:OnClick := {| oSender | DoWhatEverYouWant() }
--
Regards,
Jose F. Gimenez