Holas,
esto inicialmente funciona
Code: Select all | Expand
#include "fivewin.ch"#xcommand @ <nRow>, <nCol> BUTTON [ <oBtn> PROMPT ] <cCaption> ; [ SIZE <nWidth>, <nHeight> ] ; [ ACTION <uAction> ] ; [ <default: DEFAULT> ] ; [ <of:OF, WINDOW, DIALOG> <oWnd> ] ; [ <help:HELP, HELPID, HELP ID> <nHelpId> ] ; [ FONT <oFont> ] ; [ <pixel: PIXEL> ] ; [ <design: DESIGN> ] ; [ MESSAGE <cMsg> ] ; [ <update: UPDATE> ] ; [ WHEN <WhenFunc> ] ; [ VALID <uValid> ] ; [ <lCancel: CANCEL> ] ; [ ON INIT <uInit> ] ; => ; [ <oBtn> := ] TButton():New( <nRow>, <nCol>, <cCaption>, <oWnd>,; <{uAction}>, <nWidth>, <nHeight>, <nHelpId>, <oFont>, <.default.>,; <.pixel.>, <.design.>, <cMsg>, <.update.>, <{WhenFunc}>,; <{uValid}>, <.lCancel.>, [{|Self|<uInit>}] )#command @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ; [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ; [ <pict: PICT, PICTURE> <cPict> ] ; [ VALID <ValidFunc> ] ; [ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ; [ SIZE <nWidth>, <nHeight> ] ; [ FONT <oFont> ] ; [ <design: DESIGN> ] ; [ CURSOR <oCursor> ] ; [ <pixel: PIXEL> ] ; [ MESSAGE <cMsg> ] ; [ <update: UPDATE> ] ; [ WHEN <uWhen> ] ; [ <lCenter: CENTER, CENTERED> ] ; [ <lRight: RIGHT> ] ; [ ON CHANGE <uChange> ] ; [ <readonly: READONLY, NO MODIFY> ] ; [ <pass: PASSWORD> ] ; [ <lNoBorder: NO BORDER, NOBORDER> ] ; [ <help:HELPID, HELP ID> <nHelpId> ] ; [ ACTION <uAction> ] ; [ BITMAP <cBmpName> ] ; [ CUEBANNER <cCueText> ] ; [ ON INIT <uInit> ] ; => ; [ <oGet> := ] TGet():New( <nRow>, <nCol>, bSETGET(<uVar>),; [<oWnd>], <nWidth>, <nHeight>, <cPict>, <{ValidFunc}>,; <nClrFore>, <nClrBack>, <oFont>, <.design.>,; <oCursor>, <.pixel.>, <cMsg>, <.update.>, <{uWhen}>,; <.lCenter.>, <.lRight.>,; [\{|nKey, nFlags, Self| <uChange>\}], <.readonly.>,; <.pass.>, [<.lNoBorder.>], <nHelpId>,,,,,, [\{|self| <uAction> \}], <cBmpName>, <"uVar">,; [<cCueText>], [{|Self|<uInit>}] )
los cambios que se deben realizar son:
en los fuentes tget.prg y button.prg, en los metodos new, añadir un parametro al final binit, luego dentro el cuerpo de cada
metodo new añadir ::binit = binit
en la clase dialog en el metodo Initiate añadir la línea
Code: Select all | Expand
Aeval( ::aControls,{|o| IF( o:bInit != NIL , Eval( o:bInit, o ), NIL ) } )
antes del código
Code: Select all | Expand
if ::bInit != nil lResult = Eval( ::bInit, Self ) if ValType( lResult ) == "L" .and. ! lResult lFocus = .f. endif endif