Al utilizar los comandos de controles en clases creadas por mi, en algunos controles, me encuento con problemas del preprocesado.
Te pongo un ejemplo claro:
Code: Select all
CLASS MiClase
DATA cDatoaCambiar AS CHARACTER INIT "Valor"
METHOD NEW() INLINE Self
METHOD Prueba()
ENDCLASS
METHOD PRUEBA() CLASS MiClase
LOCAL oDlg, oCbx
LOCAL cCbx := "Uno"
LOCAL aCbx := {"Uno","Dos")
DEFINE DIALOG oDlg NAME "MiDialogo" OF oWnd
REDEFINE COMBOBOX oCbx VAR cCbx ITEMS aCbx ;
ID 205 OF oDlg ;
ON CHANGE (::cDatoaCambiar := "Pepe .T.) ;
UPDATE
ACTIVATE DIALOG oDlg
RETURN NIl
Message not found oCombobox:cDatoaCambiar.
Esto ocurre por que en el procesado de este control es como sigue:
Code: Select all
#xcommand REDEFINE COMBOBOX [ <oCbx> VAR ] <cVar> ;
[ <items: PROMPTS, ITEMS> <aItems> ] ;
[ ID <nId> ] ;
[ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ ON CHANGE <uChange> ] ;
[ VALID <uValid> ] ;
[ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
[ <update: UPDATE> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;
[ STYLE <nStyle> ] ;
[ PICTURE <cPicture> ];
[ ON EDIT CHANGE <uEChange> ] ;
=> ;
[ <oCbx> := ] TComboBox():ReDefine( <nId>, bSETGET(<cVar>),;
<aItems>, <oWnd>, <nHelpId>, <{uValid}>, [{|Self|<uChange>}],;
<nClrText>, <nClrBack>, <cMsg>, <.update.>, <{uWhen}>,;
<acBitmaps>, [{|nItem|<uBmpSelect>}], <nStyle>, <cPicture>,;
[<{uEChange}>] )
=> ;
[ <oCbx> := ] TComboBox():ReDefine( <nId>, bSETGET(<cVar>),;
<aItems>, <oWnd>, <nHelpId>, <{uValid}>, [{|this|<uChange>}],;
<nClrText>, <nClrBack>, <cMsg>, <.update.>, <{uWhen}>,;
<acBitmaps>, [{|nItem|<uBmpSelect>}], <nStyle>, <cPicture>,;
[<{uEChange}>] )
Este problema ocurre en varios controles.
Saludos,
José Luis Capel