Hi,
in this little samples ther is a problem.
Please try ths
1) select "Marco" from the first get using popget function selecting "Copia" (Copy)
2) then go to the second get.
3) you can note that text is selected ("Enrico")
4) click the right mouse and select "Incolla" (Paste)
5) the result is "EnricoMarco"
This is wrong the result would be "Marco" because "Enrico" was selected
Many thanks
Marco
in this little samples ther is a problem.
Please try ths
1) select "Marco" from the first get using popget function selecting "Copia" (Copy)
2) then go to the second get.
3) you can note that text is selected ("Enrico")
4) click the right mouse and select "Incolla" (Paste)
5) the result is "EnricoMarco"
This is wrong the result would be "Marco" because "Enrico" was selected
Many thanks
Marco
#include "fivewin.ch"
#define EM_SETSEL 177
function main()
local oDlg
local oGet1 , cGet1 := "Marco "
local oGet2 , cGet2 := "Enrico "
local oGet3 , cGet3 := " "
define dialog oDlg
@ 1,1 get oGet1 var cGet1 of oDlg update
oGet1:bGotFocus := { || oGet1:PostMsg( EM_SETSEL, Len( RTrim( cGet1 ) ), 0 ) }
oGet1:bRClicked := { || PopGet( oGet1 ) }
@ 2,1 get oGet2 var cGet2 of oDlg update
oGet2:bGotFocus := { || oGet2:PostMsg( EM_SETSEL, Len( RTrim( cGet2 ) ), 0 ) }
oGet2:bRClicked := { || PopGet( oGet2 ) }
@ 3,1 get oGet3 var cGet3 of oDlg update
oGet3:bGotFocus := { || oGet3:PostMsg( EM_SETSEL, Len( RTrim( cGet3 ) ), 0 ) }
oGet3:bRClicked := { || PopGet( oGet3 ) }
activate dialog oDlg CENTER
return nil
FUNCTION POPGET( oGet )
LOCAL oMen
MENU oMen POPUP 2007
MENUITEM "Taglia" ACTION oGet:Cut()
MENUITEM "Copia" ACTION oGet:Copy()
MENUITEM "Incolla" ACTION oGet:Paste()
MENUITEM "Annulla" ACTION oGet:Undo()
MENUITEM "Svuota" ACTION svuota( oget )
MENUITEM "Seleziona" ACTION oGet:PostMsg( EM_SETSEL, Len( RTrim( oGet:varget() ) ), 0 )
MENUITEM "Seleziona tutto" ACTION oGet:SelectAll()
ENDMENU
oMen:Activate( oGet:nBottom , oGet:nLeft , oGet )
RETURN NIL
FUNCTION SVUOTA( oGet )
M->xSvuotata := oget:varget()
M->cGetCargo := oget:cargo
oGet:VarPut( uValBlank( oGet:VarGet() ) )
oGet:refresh()
RETURN NILMarco Boschi
info@marcoboschi.it
info@marcoboschi.it