PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 24 → Wx - Capturar Click no Browse List
Wx - Capturar Click no Browse List
Débuté par adrianoboller, 16 fév. 2016 00:24 - 12 réponses
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 00:24
Para capturar um evento no Browse List, segue códigos exemplos.

FILTRO BROWSER LIST - Inicializing of TABLE_t012_filiais:
//Filtro
IF Cliente_ID > 0
MySource.pClienteID = Cliente_ID
ELSE
MySource.pClienteID = ""
END



SELECT A ROW OF TABLE_t012_filiais
Registro_ID = TABLE_t012_filiais[TABLE_t012_filiais].COL_T012_filiaisID



EMBED CODE - EVENTO LEFT BUTTON DOUBLE CLICK:

// retrieve the row that was clicked
nRowNum is int=TableInfoXY(TABLE_t012_filiais,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=TABLE_t012_filiais..Occurrence THEN
// modify the user
gsAcao = "Alterar"
Registro_ID = TABLE_t012_filiais[TABLE_t012_filiais].COL_T012_filiaisID
//info(Registro_ID)
ExecuteProcess(TAB_Geral.BTN_Alterar_Filial,trtClick)
ELSE
// new user
gsAcao = "Incluir"
ExecuteProcess(TAB_Geral.Btn_Incluir_Filial,trtClick)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 01:46
BOTÃO INCLUIR

// Create a new record
gsAcao = "Incluir"
HReset(t012_filiais)
HExecuteQuery(QRY_MaxFilial,hQueryDefault)
FOR EACH QRY_MaxFilial
Registro_ID = QRY_MaxFilial.maximum_t012_filiaisID
END
Registro_ID += 1

// Open the form of t010_enderecos file in creation mode
IF Open(WIN_Form_t012_filiais,Cliente_ID,Registro_ID) THEN

// Refresh the table
Refresh()

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 01:48
BOTÃO ALTERAR

// Is a row selected?
gsAcao = "Alterar"
IF TableSelect(TABLE_t012_filiais)=-1 THEN RETURN

// Open the form of t012_filiais file in modification mode
Open(WIN_Form_t012_filiais,Cliente_ID,Registro_ID)

// Refresh the table
TableDisplay(TABLE_t012_filiais,taCurrentSelection)


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 01:51
BOTÃO EXCLUIR

//1: &Delete
// Is a row selected?
gsAcao = "Excluir"
IF TableSelect(TABLE_t012_filiais) = -1 THEN RETURN

//1: &Delete
//2: Do&n't delete
SWITCH Dialog("Excluir?")
// &Delete
CASE 1
// Delete the t007_eventos record from the table
ok is boolean = HExecuteQuery(QRY_Delete_t012_FILIAIS,hQueryDefault,Registro_ID,Cliente_ID)

IF ok = True THEN

Info("Excluido com sucesso!")

END

// Position on the current record
Refresh()

// Do&n't delete
CASE 2

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 01:56
Máximo

SELECT
Max(t012_filiais.t012_filiaisID) AS maximum_t012_filiaisID
FROM
t012_filiais



Deleta registro filho

Delete FROM
t012_filiais
WHERE
t012_filiais.t012_filiaisID = {pFilialID}
AND t012_filiais.t002_cliente_ID = {pClienteID}


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 13:22
No FORMULÁRIO

//global
Procedure WIN_Form_t012_filiais(ClienteID, RegistroID)


//Inicialize
// Display the records
FileToScreen()

COMBO_T002_cliente_ID..Value = ClienteID
COMBO_T002_Filiais_ID..Value = RegistroID

// Default return value
MyWindow..ReturnedValue = False

IF ClienteID = 0 OR RegistroID = 0
Info("Registro não encontrado!")
Close()
ELSE

ok is boolean = HExecuteQuery(QRY_Select_t012_filial_Filtro,hQueryDefault,RegistroID,ClienteID)

IF ok = True THEN

FOR EACH QRY_Select_t010_endereco_Filtro
EDT_T012_bairro = QRY_Select_t012_filial_Filtro.t012_bairro
EDT_T012_celular = QRY_Select_t012_filial_Filtro.t012_celular
EDT_T012_cep = QRY_Select_t012_filial_Filtro.t012_cep
EDT_T012_cidade = QRY_Select_t012_filial_Filtro.t012_cidade
EDT_T012_complemento = QRY_Select_t012_filial_Filtro.t012_complemento
EDT_T012_contato = QRY_Select_t012_filial_Filtro.t012_contato
EDT_T012_email = QRY_Select_t012_filial_Filtro.t012_email
EDT_T012_endereco = QRY_Select_t012_filial_Filtro.t012_endereco
EDT_T012_nome = QRY_Select_t012_filial_Filtro.t012_nome
EDT_T012_numero = QRY_Select_t012_filial_Filtro.t012_numero
EDT_T012_obs = QRY_Select_t012_filial_Filtro.t012_obs
EDT_T012_telefone = QRY_Select_t012_filial_Filtro.t012_telefone
EDT_T012_uf = QRY_Select_t012_filial_Filtro.t012_uf
END

END

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 16 février 2016 - 14:25
Botao Salvar

// Read the information entered
ScreenToFile()

ok is boolean

// Add / modify the record
IF gsAcao = "Incluir" THEN

ok = HExecuteQuery(QRY_Insert_t012_filial,hQueryDefault,COMBO_T002_Filiais_ID,COMBO_T002_cliente_ID,EDT_T012_nome,EDT_T012_endereco,EDT_T012_numero,EDT_T012_bairro,EDT_T012_cidade,EDT_T012_uf,EDT_T012_complemento,EDT_T012_cep,EDT_T012_email,EDT_T012_contato,EDT_T012_celular,EDT_T012_telefone,EDT_T012_obs)
IF ok = True THEN

Info("Incluiu com sucesso!")

END

ELSE IF gsAcao = "Alterar" THEN

ok = HExecuteQuery(QRY_Update_t012_filiais,hQueryDefault,EDT_T012_nome,EDT_T012_endereco,EDT_T012_numero,EDT_T012_bairro,EDT_T012_cidade,EDT_T012_uf,EDT_T012_complemento,EDT_T012_cep,EDT_T012_email,EDT_T012_contato,EDT_T012_celular,EDT_T012_telefone,EDT_T012_obs,COMBO_T002_Filiais_ID,COMBO_T002_cliente_ID)
IF ok = True THEN

Info("Alterar com sucesso!")

END

END


// Return value of the window
MyWindow..ReturnedValue = True


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 18 février 2016 - 14:56
// retrieve the row that was clicked
nRowNum is int=TableInfoXY(TABLE_t012_filiais,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=TABLE_t012_filiais..Occurrence THEN
// modify the user
gsAcao = "Alterar"
Registro_ID = TABLE_t012_filiais[nRowNum].COL_T012_filiaisID // <---- nRowNum ATENÇÃO AQUI VC DEVE COLOCAR O NUMERO DA LINHA
//info(Registro_ID)
ExecuteProcess(TAB_Geral.BTN_Alterar_Filial,trtClick)
ELSE
// new user
gsAcao = "Incluir"
ExecuteProcess(TAB_Geral.Btn_Incluir_Filial,trtClick)


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 18 février 2016 - 16:01
HELP ADICIONAL:

http://help.windev.com/en-US/…

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 03 août 2016 - 20:46
adrianoboller a écrit :
Para capturar um evento no Browse List, segue códigos exemplos.

FILTRO BROWSER LIST - Inicializing of TABLE_t012_filiais:
//Filtro
IF Cliente_ID > 0
MySource.pClienteID = Cliente_ID
ELSE
MySource.pClienteID = ""
END



SELECT A ROW OF TABLE_t012_filiais
Registro_ID = TABLE_t012_filiais[TABLE_t012_filiais].COL_T012_filiaisID



EMBED CODE - EVENTO LEFT BUTTON DOUBLE CLICK:

// retrieve the row that was clicked
nRowNum is int=TableInfoXY(TABLE_t012_filiais,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=TABLE_t012_filiais..Occurrence THEN
// modify the user
gsAcao = "Alterar"
Registro_ID = TABLE_t012_filiais[nRowNum].COL_T012_filiaisID
//info(Registro_ID)
ExecuteProcess(TAB_Geral.BTN_Alterar_Filial,trtClick)
ELSE
// new user
gsAcao = "Incluir"
ExecuteProcess(TAB_Geral.Btn_Incluir_Filial,trtClick)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 02 novembre 2016 - 16:19
//Captura click do Mouse em uma table e retorna o registro exato para ser trabalhado
nRowNum is int = TableInfoXY(TABLE_T0001_config,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=TABLE_T0001_config..Occurrence THEN
// modify
gsAcao = "Alterar"
gsRegistro = TABLE_T0001_config[nRowNum].COL_T0001_ID
//info(gsRegistro)
ok is boolean = HReadSeekFirst(t0001_config,t0001_ID,gsRegistro,hKeepFilter)
IF ok = True
WIN_Config.EDT_T0001_config = t0001_config.t0001_config
WIN_Config.EDT_T0001_valor = t0001_config.t0001_valor
WIN_Config..Plane = 2
ELSE
Info("Não existe nenhum registro cadastrado")
END
ELSE
// new
gsAcao = "Incluir"
HReset(t0001_config)
WIN_Config.EDT_T0001_config = ""
WIN_Config.EDT_T0001_valor = ""
WIN_Config..Plane = 2
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 02 novembre 2016 - 16:20
//Captura click do Mouse para exclusao de registros
nRowNum is int = TableInfoXY(TABLE_T0001_config,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=TABLE_T0001_config..Occurrence THEN
// excluir
gsAcao = "Excluir"
gsRegistro = TABLE_T0001_config[nRowNum].COL_T0001_ID
//Info(gsRegistro)
ok is boolean = HReadSeekFirst(t0001_config,t0001_ID,gsRegistro,hKeepFilter)
IF ok = True THEN

//1 : Sim
//2 : Não
SWITCH Dialog("Deseja excluir o registro atual?")
// Sim
CASE 1
ok = HDelete(t0001_config)
IF ok = True THEN
Info("Excluido com sucesso!")
ELSE
Info("Erro ao Excluir registro!"+ErrorInfo())
END
// Não
CASE 2

END

WIN_Config..Plane = 1
TableDisplay(TABLE_T0001_config,taReExecuteQuery)
TableDisplay(TABLE_T0001_config,taInit)

ELSE
Info("Não existe nenhum registro cadastrado")
END
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membre enregistré
2 907 messages
Popularité : +89 (91 votes)
Posté le 27 juillet 2017 - 18:05
// retrieve the row that was clicked
nRowNum is int=LooperInfoXY(LOOP_t001_clientes,tiLineNumber,MouseXPos(),MouseYPos())
// if the row corresponds to a user
IF nRowNum>0 _AND_ nRowNum<=LOOP_t001_clientes..Occurrence THEN
// modify the user
gsAcao = "Alterar"
gsID = LOOP_t001_clientes[nRowNum].ATT_AttStatic
OpenMobileWindow(WIN_update_clientes,gsID,gsAcao)
ELSE
// new user
gsAcao = "Incluir"
gsID = 0
OpenMobileWindow(WIN_update_clientes,gsID,gsAcao)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/