Página 1 de 1

How do OnInitialize on Command Line?

Publicado: Sab Abr 04, 2015 6:28 am
por Cassiano de Oliveira
By Google Translator - Sorry :(
The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { || ::
Close ( ) } ) }
ok works
How do it on command ?
I tried the way down and could not.
WITH OBJECT oForm : = TForm ( )
: SetBounds ( 508, 218, 894, 534 )
: SetClientSize ( 880, 520)
: cText : = ' Sales Query '
: oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
: nBorderStyle : = bsNONE
// : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close
( ) } ) } // so it did not work .
: New ( Application : oActiveForm )
: OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) } ) }
: ShowModal (.T . )
END
Regards,
Cassiano.
---
Este email foi escaneado pelo Avast antiví­rus.
http://www.avast.com

How do OnInitialize on Command Line?

Publicado: Dom Abr 05, 2015 8:46 pm
por jfgimenez
Cassiano,
> By Google Translator - Sorry :(
>
> The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { ||
> :: Close ( ) } ) }
> ok works
>
> How do it on command ?
>
> I tried the way down and could not.
>
> WITH OBJECT oForm : = TForm ( )
> : SetBounds ( 508, 218, 894, 534 )
> : SetClientSize ( 880, 520)
> : cText : = ' Sales Query '
> : oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
> : nBorderStyle : = bsNONE
> // : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close (
> ) } ) } // so it did not work .
> : New ( Application : oActiveForm )
> : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) }
> ) }
> : ShowModal (.T . )
> END
Although it's possible to put a codeblock into another codeblock, in
this case you'll get errors due to the presence of :: (Self). So, you'll
need to write that event as a regular method:
:OnInitialize := "FormInitialize"
...
METHOD FormInitialize( oSender ) CLASS TForm1
SetKey( VK_ESCAPE , 0 , {|| ::Close ( ) } )
RETURN Nil
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

How do OnInitialize on Command Line?

Publicado: Dom Abr 05, 2015 11:58 pm
por Cassiano de Oliveira
thanks
"Jose F. Gimenez" wrote in message news:55218314$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Cassiano,
> By Google Translator - Sorry :(
>
> The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { ||
> :: Close ( ) } ) }
> ok works
>
> How do it on command ?
>
> I tried the way down and could not.
>
> WITH OBJECT oForm : = TForm ( )
> : SetBounds ( 508, 218, 894, 534 )
> : SetClientSize ( 880, 520)
> : cText : = ' Sales Query '
> : oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
> : nBorderStyle : = bsNONE
> // : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close (
> ) } ) } // so it did not work .
> : New ( Application : oActiveForm )
> : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) }
> ) }
> : ShowModal (.T . )
> END
Although it's possible to put a codeblock into another codeblock, in
this case you'll get errors due to the presence of :: (Self). So, you'll
need to write that event as a regular method:
:OnInitialize := "FormInitialize"
...
METHOD FormInitialize( oSender ) CLASS TForm1
SetKey( VK_ESCAPE , 0 , {|| ::Close ( ) } )
RETURN Nil
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
---
Este email foi escaneado pelo Avast antiví­rus.
http://www.avast.com