grid - ENTER e sair

Projeto MiniGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Aqui o DBLCLICK executa a rotina e fecha janela ok.
Mas queria que o ENTER tivesse o mesmo efeito.
Alguém sabe como?

Código: Selecionar todos

FUNCTION gui_Browse( xDlg, xControl, nRow, nCol, nWidth, nHeight, oTbrowse, cField, xValue, workarea )

   LOCAL aHeaderList := {}, aWidthList := {}, aFieldList := {}, aItem

   IF Empty( xControl )
      xControl := gui_newctlname( "BROW" )
   ENDIF
   FOR EACH aItem IN oTbrowse
      AAdd( aHeaderList, aItem[1] )
      AAdd( aFieldList, aItem[2] )
      AAdd( aWidthList, Max( Len( aItem[3] ), Len( Transform(FieldGet(FieldNum(aItem[1] ) ), "" ) ) ) * 10 )
   NEXT
   @ nRow, nCol GRID ( xControl ) ;
      OF ( xDlg ) ;
      WIDTH nWidth ;
      HEIGHT nHeight ;
      ON DBLCLICK gui_BrowseDblClick( xDlg, xControl, workarea, cField, @xValue ) ;
      HEADERS aHeaderList ;
      WIDTHS aWidthList ;
      ROWSOURCE ( workarea ) ;
      COLUMNFIELDS aFieldList

   (xDlg);(cField);(xValue);(workarea)


   RETURN Nil

FUNCTION gui_BrowseDblClick( xDlg, xControl, workarea, cField, xValue )

   IF ! Empty( cField )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )
   ENDIF
   DoMethod( xDlg, "RELEASE" )
   (xDlg);(xControl);(cField);(xValue)

   RETURN Nil
E na HMG 3 a mesma rotina funciona, mas não atualiza o valor do textbox.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
HASA
Colaborador
Colaborador
Mensagens: 1088
Registrado em: 01 Set 2003 19:50
Localização: São Paulo
Contato:

grid - ENTER e sair

Mensagem por HASA »

Boa tarde tenta assim:

ON DBLCLICK { || gui_BrowseDblClick( xDlg, xControl, workarea, cField, @xValue ) , xDlg.RELEASE };

Pode copiar e colocar no seu grid e faça o teste.

HASA
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Não deu tempo de avisar.

O DoMethod( xDlg, "RELEASE" ) resolveu.

O ENTER ficou resolvido com SET NAVIGATION EXTENDED, não tinha colocado pra HMG3.

Só restou um problema agora:

Na HMG Extended ok, tudo funcionando.
Na HMG3 o DBF não é sincronizado, e não serve essa rotina de pegar o campo do arquivo.
Tinha colocado outra antes, que não tinha funcionado, mas não lembro se testei com as duas, igual tá no exemplo SUPER.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Não foi.

Código: Selecionar todos

   IF ! Empty( cField )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )

      //nCol := hb_AScan( oTBrowse, { | e | e[ 2 ] == cField } )
      //IF nCol != 0
      //   nRow := GetProperty( xDlg, xControl, "VALUE" )
      //   aList := GetProperty( xDlg, xControl, "ITEM", nRow )
      //   Msgbox( ValType( aList ) )
      //   xValue := aList[ nCol ]
      //   msgbox( ValType( xvalue ) )
      //ENDIF
   ENDIF
Nem como DBF, nem como array.
Tentar mais um chute depois: colocar como se fosse EDIT.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
HASA
Colaborador
Colaborador
Mensagens: 1088
Registrado em: 01 Set 2003 19:50
Localização: São Paulo
Contato:

grid - ENTER e sair

Mensagem por HASA »

Boa tarde, só uso a HMG Extended - 19.08 acho kkk dai tbm não atualizei mais.
HASA
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Achei.

HMG Extended

Código: Selecionar todos


FUNCTION gui_BrowseDblClick( xDlg, xControl, workarea, cField, xValue )

   IF ! Empty( cField )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )
   ENDIF
   DoMethod( xDlg, "RELEASE" )

   RETURN Nil
HMG 3

Código: Selecionar todos

FUNCTION gui_BrowseDblClick( xDlg, xControl, workarea, cField, xValue )

   LOCAL nRecNo

   IF ! Empty( cField )
      nRecNo := GetProperty( xDlg, xControl, "RECNO" )
      GOTO ( nRecNo )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )
   ENDIF
   DoMethod( xDlg, "RELEASE" )

   RETURN Nil
O mais interessante é que a solução de uma NÃO funciona na outra.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Achei pra OOHG, não é no GRID, mas no BROWSE, parecido com GRID de HMG3

Código: Selecionar todos

FUNCTION gui_BrowseDblClick( xDlg, xControl, workarea, cField, xValue )

   LOCAL nRecNo

   IF ! Empty( cField )
      nRecNo := GetProperty( xDlg, xControl, "VALUE" )
      GOTO ( nRecNo )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )
   ENDIF
   DoMethod( xDlg, "RELEASE" )

   RETURN Nil
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

grid - ENTER e sair

Mensagem por JoséQuintas »

Estou com problemas com o browse da HMG Extended.
Por algum motivo, está causando interferência ao fechar a DIALOG, no que se refere à janela MODAL/NÃO MODAL.

Código: Selecionar todos

FUNCTION gui_BrowseDblClick( xDlg, xControl, workarea, cField, xValue )

   (xControl)
   IF ! Empty( cField )
      xValue := &(workarea)->( FieldGet( FieldNum( cField ) ) )
   ENDIF
   DoMethod( xDlg, "RELEASE" )

   RETURN Nil
Em nenhuma outra LIB acontece isso, só HMG Extended.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder