Lista de controles EDIT

Projeto HwGui - 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

Lista de controles EDIT

Mensagem por JoséQuintas »

Como é que eu pego a lista de controles HEDIT do formulário?
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

Lista de controles EDIT

Mensagem por JoséQuintas »

Ok, por enquanto resolvi de outra forma.

Porque simplificar se dá pra complicar.... kkkkk

FOR EACH agora com 3 elementos

Código: Selecionar todos

   FOR EACH xValue, oField, hEdit IN aValues, aStru, ::hEditList
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/
alxsts
Colaborador
Colaborador
Mensagens: 3092
Registrado em: 12 Ago 2008 15:50
Localização: São Paulo-SP-Brasil

Lista de controles EDIT

Mensagem por alxsts »

Olá!

Costumo usar o debugger da HwGUI para descobrir este tipo de coisas.
Capturar.PNG
Veja na imagem: ODlg tem um array contendo todos os controles filhos. Cada controle filho tem o método hControl que retorna uma string onde aparece o tipo e pode ser testado em um loop no aControls, desde que se conheça os tipos disponíveis:

Código: Selecionar todos

oDlg:aControls[8]:hControl()  ==> "Class HEDIT object"
[]´s
Alexandre Santos (AlxSts)
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Lista de controles EDIT

Mensagem por JoséQuintas »

E provavelmente vai precisar de Main() para o debug.
Acho que vou ter que definir alguma Main() em hwgui pra eu usar.
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

Lista de controles EDIT

Mensagem por JoséQuintas »

Então... acabei resolvendo de outra forma, da forma que uso naquela outra LIB...
Crio um array com os HEdit.

Código: Selecionar todos

   FOR EACH xValue, oField, hEdit IN aValues, aStru, ::hEditList
      @ nCol + 110, nRow GET hEdit VAR xValue SIZE oField[ DBS_LEN ] * 12, 25 ;
Basta que o controle seja um elemento do array.

Na outra é oControl := wvgxxx():New()
Na HWGui, apesar de não ficar visível, também é oControl := hEdit():New()

Então.... acabei fazendo igual, apenas o #command do CH não deixa enxergar isso.

No final, tô fazendo a mesma coisa que fazia antes, só mudaram os nomes.
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

Lista de controles EDIT

Mensagem por JoséQuintas »

curiosidade:

Código: Selecionar todos

   INIT DIALOG ::oFrm CLIPPER NOEXIT TITLE ::cTitulo AT 20, 0 SIZE 800, 600 ON EXIT hwg_EndDialog()
      @ nCol, nRow SAY oField[ DBS_NAME ] SIZE 100, 25
      @ nCol + 110, nRow GET hEdit VAR xValue SIZE oField[ DBS_LEN ] * 12, 25 ;
         STYLE iif( oField[ DBS_TYPE ] == "N", ES_RIGHT, ES_LEFT ) ;
         MAXLENGTH oField[ DBS_LEN ]
      @ nCol, nRow ICON IconFromCaption( cCaption ) FROM RESOURCE ;
         SIZE 55, 55 ;
         ON CLICK bCode ;
         TOOLTIP cCaption
no PPO

Código: Selecionar todos

   ::oFrm := HDialog():New( Iif(.F.,10,11),,20,0,800,600,::cTitulo,,,hwg_EndDialog(),,,,,,.T.,,,.T.,,,.F.,,.F. )
      HStaticEx():New(,,,nCol,nRow,100, 25,oField[ 1 ],,,,,,,,.F.,,, );
      HSayIcon():New(,,nCol,nRow,55, 55,IconFromCaption( cCaption ),.T.,,,cCaption,,bCode, )
      hEdit := HEdit():New(,,xValue, {|v|Iif(v==Nil,xValue,xValue:=v)}, iif( oField[ 2 ] == "N", 2, 0 ),nCol + 110,nRow,oField[ 3 ] * 12,25,,,,,,,,,,.F.,oField[ 3 ],.F.,, ) ; hwg_SetCtrlName( hEdit,"hEdit" )
No HSayIcon() e HStaticEx() não defini nome, então fica só no array interno da hwgui.
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