Clipper On Line • Ver Tópico - Selecionar todos os gets
Página 1 de 1

Selecionar todos os gets

MensagemEnviado: 13 Ago 2015 15:26
por Kapiaba
#include "FiveWin.ch"

function Main()

   local oDlg, IDCOR
   local dDay   := Date()
   local aGet   := ARRAY(5)
   local cName  := [MY NAME]
   local cEnder := [MY ADRESS]
   local cCity  := [MY CITY]
   local cPais  := [MY COUNTRY]

   define dialog oDlg title "From Code" size 300,300

   @ 2,  6 GET aGet[1] VAR dDay   OF oDlg SIZE 60, 10

   @ 3,  6 GET aGet[2] VAR cName  OF oDlg SIZE 60, 10

   @ 4,  6 GET aGet[3] VAR cEnder OF oDlg SIZE 60, 10

   @ 5,  6 GET aGet[4] VAR cCity  OF oDlg SIZE 60, 10

   @ 6,  6 GET aGet[5] VAR cPais  OF oDlg SIZE 60, 10

   For IDCor = 1 To 5

      aGet[IDCOR]:bGotFocus := { | o | o:SelectAll() }

   NEXT

   @ 6,  7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
   @ 6, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

   ACTIVATE DIALOG oDlg CENTERED

return nil



Selecionar todos os gets

MensagemEnviado: 13 Ago 2015 15:29
por Kapiaba
Ou,

#include "FiveWin.ch"

function Main()
   local oDlg, IDCOR
   local dDay   := Date()
   local aGet   := ARRAY(5)
   local cName  := [MY NAME]
   local cEnder := [MY ADRESS]
   local cCity  := [MY CITY]
   local cPais  := [MY COUNTRY]

   define dialog oDlg title "From Code" size 300,300

   @ 2,  6 GET aGet[1] VAR dDay   OF oDlg SIZE 60, 10
   @ 3,  6 GET aGet[2] VAR cName  OF oDlg SIZE 60, 10
   @ 4,  6 GET aGet[3] VAR cEnder OF oDlg SIZE 60, 10
   @ 5,  6 GET aGet[4] VAR cCity  OF oDlg SIZE 60, 10
   @ 6,  6 GET aGet[5] VAR cPais  OF oDlg SIZE 60, 10

   GetSelectAll( oDlg )

   @ 6,  7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
   @ 6, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

   ACTIVATE DIALOG oDlg CENTERED

return nil

Function GetSelectAll( oDlg )

   AEval( oDlg:aControls, { | o | IF( o:ClassName() = "TGET", ( o:bGotFocus := { | o | o:SelectAll() } ), ) } )

Return nil