problems with radio and radioitem
Posted: Tue Jul 14, 2015 3:11 pm
Guys ... I'm tweaking some functions and realized that the radio (standing inside a folder, in a dialog works correctly) to choose an option passes twice in the function, and this is causing me slowly to select the records because two processes times the while, is to fix this?
working example:
example with problem
thank you
working example:
- Code: Select all Expand view
DEFINE DIALOG oDlg FROM 0,0 TO 520,820 PIXEL
@ 000,195 GROUP TO 045,335 LABEL "Tipo do Relatório" PIXEL TRANSPARENT OF oDlg
@ 007,195 RADIO oTipo VAR nTipo PROMPT "Tabela de Preço", "Tabela de Promoção", "Lista de Compra", "Lista de Compra Ideal" SIZE 65,9 PIXEL ON CHANGE Troca() OF oDlg
@ 007,265 RADIOITEM "Sugestão de Compra" RADIOMENU oTipo SIZE 65,08 PIXEL OF oDlg
@ 016,265 RADIOITEM "Estoque Mínimo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oDlg
@ 025,265 RADIOITEM "Estoque Negativo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oDlg
@ 034,265 RADIOITEM "Estoque Positivo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oDlg
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
example with problem
- Code: Select all Expand view
DEFINE DIALOG oDlg FROM 0,0 TO 520,820 PIXEL
@ 90,03 FOLDER oFld OF oDlg PROMPT "&Produto","&Movimentação","&Valores" ;
PIXEL SIZE 405,208
@ 000,195 GROUP TO 045,335 LABEL "Tipo do Relatório" PIXEL TRANSPARENT OF oFld:aDialogs[1]
@ 007,195 RADIO oTipo VAR nTipo PROMPT "Tabela de Preço", "Tabela de Promoção", "Lista de Compra", "Lista de Compra Ideal" SIZE 65,9 PIXEL ON CHANGE Troca() OF oFld:aDialogs[1]
@ 007,265 RADIOITEM "Sugestão de Compra" RADIOMENU oTipo SIZE 65,08 PIXEL OF oFld:aDialogs[1]
@ 016,265 RADIOITEM "Estoque Mínimo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oFld:aDialogs[1]
@ 025,265 RADIOITEM "Estoque Negativo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oFld:aDialogs[1]
@ 034,265 RADIOITEM "Estoque Positivo" RADIOMENU oTipo SIZE 65,08 PIXEL OF oFld:aDialogs[1]
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
- Code: Select all Expand view
function Troca()
?"with folder passes twice" + CRLF + "with dialog passes once"
RETURN
thank you