domingo, 17 de janeiro de 2021

DICAS 3246 - WINDEV - PERGUNTAS E RESPOSTAS 8 - JSON - BUSCA CNPJ - TUTORIAL - RESPONDENDO LAIB AKRAM

https://youtu.be/bmopPOt_eTM



Bom Dia Boa Tarde Boa Noite

Seja Membro do Canal

Esse Video Ao Vivo vai estrear as 19:00 do dia 20/01/2021 

DICAS 3246 - WINDEV - PERGUNTAS E RESPOSTAS 8 - JSON - BUSCA CNPJ - TUTORIAL - RESPONDENDO LAIB AKRAM

https://help.windev.com/en-US/?1000023611&name=TYPE_JSON
https://windevdesenvolvimento.blogspot.com/2021/01/dicas-3246-windev-perguntas-e-respostas.html


ASSUNTOS


httprequest 
json 
foi criado um projeto novo que estara disponivel
no repositorio windev 
utilitarios_amarildo_matos_windev
https://repository.windev.com/
vamos criar uma window busca cnpj
vamos criar um edt cnpj 
vamos criar um edit endereco busca 
vamos criar um botao busca cnpj receita
vamos criar um botao para mostrar no site 
vamos criar um edt retorno 
vamos criar 3 stc , razao social, cnpj , e atividade para mostrar o retorno 
vamos entrar codigo busca cnpj 
vamos dar um httprequest receita para busca cnpj 
o retorno vira em formato json
vamos preencher os campos com o retorno do json 
vamos aprimorar. um pouco 
vamos criar uma procedure global, busca_cnpj_receita
vamos buscar o cnpj pela procedure
vamos testar 

 
=============
// BTN_BUSCA_CNPJ_RECEITA

(EDT_Endereco_busca,EDT_Retorno,STC_Razao_social,STC_Cnpj,STC_Atividade_empresa)=cnpj_busca_receita(EDT_Cnpj)

-----------

//PROCEDURE cnpj_busca_receita(recebe_cnpj)
DADOS_JSON is a JSON = "" // VAMOS CRIAR UMA STRING URL COM ENDERECO DA RECEITA
URL is string = "https://www.receitaws.com.br/v1/cnpj/" // VAMOS JUNTAR O NUMERO DO CNPJ COM O ENDERECO
URL+=recebe_cnpj
IF HTTPRequest(URL) THEN // VAMOS RECUPERAR O RESULTADO DA URL COM HTTPREQUEST
DADOS_JSON = HTTPGetResult() // VAMOS LER O RESULTADO HTTP
DADOS_JSON = UTF8ToAnsi(DADOS_JSON) // CONVERTE string No FORMATO UTF8
END
//VAMOS PEGAR OS DADOS DO JSON //DEPOIS VOU MOSTRAR NO FINAL, COMO PEGUEI OS NOMES DOS CAMPOS 

RESULT (URL,DADOS_JSON,DADOS_JSON.NOME,DADOS_JSON.CNPJ,DADOS_JSON.ATIVIDADE_PRINCIPAL)

// vamos fazer a busca do cnpj
// depois de testado e funcionando
// vamos transformar em procedure para poder ser usado em outros lugares
// VAMOS PRIMEIRO CRIAR A VARIAVEL JSON
// TEM MAIS CAMPOS PARA MOSTRAR MAS FIZ 3 PARA MOSTRAR O FUNCIONAMENTO



=============== INDICE PERGUNTAS E RESPOSTA


======================= INDICE CURSO DO JSON


=========================================





PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
PlayList Windev Mobile 
Amarildo
Donwloads Windev
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Inscricao Evento Pcsof
Site forum Google 
Video sobre 3 Mil Videos Windev 
Video sobre Alfaserver servidor 























sábado, 16 de janeiro de 2021

DICAS 3245 - WINDEV - PERGUNTAS E RESPOSTAS 7 - COMO SAIR OU NAO NO POPUP

https://youtu.be/5hdnSA7XWxI



Bom Dia Boa Tarde Boa Noite

Seja Membro do Canal

Esse Video Ao Vivo vai estrear as 19:00 do dia 19/01/2021 

DICAS 3245 - WINDEV - PERGUNTAS E RESPOSTAS 7 - COMO SAIR OU NAO NO POPUP

ASSUNTOS

vamos fazer um popup , em que digitamos um valor 
como exemplo em closing , 
Vamos ver se foi preenchido esse valor 
caso nao foi vamos perguntar se deseja sair 
vamos criar uma janela para chamar o popup e vamos chamar 
vamos testar 

 
=============
// closing win_popup
IF EDT_Valor=0 THEN
IF YesNo("deseja realmente sair ") THEN
ELSE 
ReturnToCapture(EDT_Valor)
END
END
=============


----------------------------- INDICE POPUP














PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
PlayList Windev Mobile 
Amarildo
Donwloads Windev
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Inscricao Evento Pcsof
Site forum Google 
Video sobre 3 Mil Videos Windev 
Video sobre Alfaserver servidor 












DICAS 3244 - WINDEV - PERGUNTAS E RESPOSTAS 6 - listselectplus - Como vir preenchido automaticamente combox



https://youtu.be/TSllHlpCjFw



Bom Dia Boa Tarde Boa Noite

Seja Membro do Canal

Esse Video Ao Vivo vai estrear as 19:00 do dia 18/01/2021

DICAS 3244 - WINDEV - PERGUNTAS E RESPOSTAS 6 - listselectplus - Como vir preenchido automaticamente combox


ASSUNTOS


listselectplus - Como vir preenchido automaticamente combox
vamos criar um combox por programacao, onde tera 3 condicoes
Grupo de empresas,descricao e desativado 
e vou querer que ele fique em grupo de empresas
vou mostrar tres formas.
primeiro , em propriedades da combox, contente, valor inicial
segundo , no codigo em inicializacao , combol=numero que deseja 
terceiro , vamos usar selectplus

=======================================
// initializing combo_empresa

ListSelectPlus(COMBO_empresa,2)

//COMBO_empresa=3













PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
PlayList Windev Mobile 
Amarildo
Donwloads Windev
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Inscricao Evento Pcsof
Site forum Google 
Video sobre 3 Mil Videos Windev 
Video sobre Alfaserver servidor 












ListSelectPlus (função)
Em francês: ListeSelectPlus
Seleciona um ou mais elementos em um controle List Box (ou ListView) ou em um controle Combo Box.
O elemento é selecionado, mas não é exibido se não estiver visível. Para tornar o elemento selecionado visível, use ListPosition .
Lembrete : O elemento selecionado corresponde ao elemento atual no qual a barra de seleção é exibida.
Observação : ListSelectPlus pode ser usado em:
  • os controles de navegação ou caixa de lista de memória,
  • controles Looper de seleção única ou multisseleção.
Exemplo
// Selecione o elemento encontrado no subscrito 7 em "LIST_CustomerList"
ListSelectPlus ( LIST_ CustomerList , 7 )
Sintaxe
ListSelectPlus (<List Box control> [, <Subscript 1> [... [, <Subscript N>]]])
<List Box control>: Nome do controle
Nome do controle List Box (ou Combo Box) a ser usado.
Se este parâmetro corresponder a uma string vazia (""), o elemento especificado por seu subscrito é selecionado no controle List Box (ou Combo Box) ao qual pertence o evento atual.
WEBDEV - Código do navegador O nome do controle List Box (ou Combo Box) a ser usado deve ser especificado.
<Subscrito 1>: inteiros opcionais
Subscrito do primeiro elemento a ser selecionado.
Se nenhum subscrito for especificado, todos os elementos encontrados no controle List Box ou Combo Box especificado serão selecionados.
ListSelectPlus não tem efeito se esses parâmetros corresponderem a elementos já selecionados.
<Subscript N>: Número inteiro opcional
Subscrito do enésimo elemento a ser selecionado.
Se nenhum subscrito for especificado, todos os elementos encontrados no controle List Box ou Combo Box especificado serão selecionados.
ListSelectPlus não tem efeito se esses parâmetros corresponderem a elementos já selecionados.
Observações

Último elemento

Para posicionar no último elemento do controle List Box, use a seguinte sintaxe:
ListSelectPlus (<controle de caixa de listagem>, <controle de caixa de listagem> .. Contagem)
ou
<Controle de caixa de listagem> = <controle de caixa de listagem> .. Contagem
ou
<List Box control> = ListCount (<List Box control>)

Equivalência

Para um controle List Box de seleção única sem chamar gLink , as duas sintaxes a seguir são equivalentes:
ListSelectPlus (<controle List Box>, <Subscript>)
e
<Controle da caixa de listagem> = <Subscript>

Diversos

  • Para selecionar um elemento em um controle Table, use TableSelectPlus .
  • ListSelectPlus pode ser usado em uma coluna da tabela "Combo Box".
  • ListSelectMinus permite que você desmarque os elementos de um controle List Box ou Combo Box.
WEBDEV - Código do servidorWEBDEV - Código do navegadorAjax 

Selecionando um elemento em um controle List Box que pertence a um controle Looper

Para selecionar um elemento em um controle List Box incluído em um controle Looper, você deve:
  1. Declare um atributo do controle Looper no valor do controle List Box.
  2. No código de um botão (por exemplo), especifique o novo valor do atributo para a linha solicitada.
Por exemplo, se o atributo for ATT_SELECTROW, o código a seguir será usado para selecionar o 3º elemento do controle List Box na 4ª linha:
ATT_ SELECTROW [ 4 ] = 3
Este código pode ser usado no código do servidor e no código do navegador.

quinta-feira, 14 de janeiro de 2021

DICAS 3243 - WINDEV - PERGUNTAS E RESPOSTAS 5 - MouseCursor - VAMOS MUDAR O CURSOR DO MOUSE




https://youtu.be/x2fcvFYTv3k



Bom Dia Boa Tarde Boa Noite

Seja Membro do Canal

Esse Video Ao Vivo vai estrear as 19:00 do dia 15/01/2021 

DICAS 3243 - WINDEV - PERGUNTAS E RESPOSTAS 5 - MouseCursor - VAMOS MUDAR O CURSOR DO MOUSE

https://help.windev.com/en-US/?2510026&name=MouseCursor
https://windevdesenvolvimento.blogspot.com/2021/01/dicas-3243-windev-perguntas-e-respostas.html

ASSUNTOS

VAMOS FAZER UMA WINDOW CHAMADA MOUSE_CURSOR
E VAMOS CRIAR CAMPOS E UM BOTAO
NESSE BOTAO, VOU MUDAR O FORMATO DO MOUSE CURSOR

=======================================

BTN_Gravar..MouseCursor=curHand

=============












PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
PlayList Windev Mobile 
Amarildo
Donwloads Windev
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Inscricao Evento Pcsof
Site forum Google 
Video sobre 3 Mil Videos Windev 
Video sobre Alfaserver servidor 












MouseCursor (Property)
In french: CurseurSouris
...MouseCursor é usado para descobrir e modificar o cursor rollover definido para um controle, uma janela ou uma página.
Lembrete : você pode definir:
  • o cursor de rolagem usado por um controle de janela ou por uma janela na guia "UI" da janela de descrição do controle ou janela.
  • o cursor de rolagem usado por um controle de página ou por uma página na guia "Detalhes" da janela de descrição do controle ou página.
Example
// Modify the cursor of the BTN_Validate button
BTN_Validate..MouseCursor = curHelp
WEBDEV - Server codeWEBDEV - Browser code
// Modify the cursor of the cell
CELL_Bckgrd..MouseCursor = "./cursor/earth.ani"
// Modify the cursor of the edit control
EDT_Name..MouseCursor = "http://MyServer/MYPROJECT_WEB/pen_r.cur"
Syntax
WINDEVAndroidJavaUser code (UMC)

Finding out the rollover cursor used for a window or for a window controlHide the details

<Cursor name> = <Element used>..MouseCursor
<Cursor name>: Character string or integer constant
Name of the cursor used for the specified control or window. Can correspond to:
  • A specific cursor name (file with a .CUR or .ANI extension):
    • name of the cursor if the file is found in the current directory,
    • name and full path of the cursor if the file is found in a directory other than the current directory.
      Java ".CUR" or ".ANI" custom mouse cursors are not supported in Java.
      Android .ANI custom mouse cursors are not supported in Java.
  • A preset cursor identified by one of the following constants:
    curHelpHelp for an object
    curIbeamInput cursor
    curCrossStandard cross
    curArrowStandard arrow
    curUpArrowUp arrow
    curForbiddenSign not allowed
    curHandHand
    curSystemHandSystem hand Java Cursor identical to curHand.
    curWaitHourglass
    curSizeCross Arrow cursor
    curSizeNESWNorth East/South West arrow
    curSizeNWSENorth West/South East arrow
    curSizeWEWest East arrow
    curSizeNSNorth South arrow
<Element used>: Control name or window name
Name of the control or window whose associated cursor must be found.
WEBDEV - Server codeWEBDEV - Browser code

Finding out the rollover cursor used for a page or for a page controlHide the details

<Cursor name> = <Element used>..MouseCursor
<Cursor name>: Character string or integer constant
Name of the cursor used for the specified control or page. The default value is the curAutomatic constant: the cursor is inherited if a parent element is associated with a specific cursor, otherwise the default cursor defined for the control is used.
Can correspond to:
  • A specific cursor name (cursor file managed by the browser). The associated CSS value corresponds to url(<Cursor URL>).
  • A preset cursor CSS value (see table below)
  • A preset cursor identified by one of the following constants:
    curHelpHelp for an object
    Associated CSS value: help
    curAutomaticAutomatic cursor: the cursor is inherited if a parent element is associated with a specific cursor, otherwise the default cursor defined for the control is used.
    Associated CSS value: auto
    curIbeamInput cursor
    Associated CSS value: text
    curCrossStandard cross
    Associated CSS value: crosshair
    curDefaultDefault cursor associated with the control
    Associated CSS value: default
    curArrowForbiddenArrow and sign not allowed
    Associated CSS value: no-drop
    curArrowWaitArrow and hourglass
    Associated CSS value: progress
    curForbiddenSign not allowed
    Associated CSS value: not-allowed
    curHandHand
    Associated CSS value: pointer
    curSystemHandSystem hand
    This cursor is the same as the one displayed by the curHand constant.
    curWaitHourglass
    Associated CSS value: wait
    curSizeCross Arrow cursor
    Associated CSS value: move
    curSizeColumnCursor for resizing columns
    Associated CSS value: col-resize
    curSizeRowCursor for resizing rows
    Associated CSS value: row-resize
    curSizeNESWNorth East/South West arrow
    Associated CSS values: NE-resize Arrows, SW-resize Arrows
    curSizeNWSENorth West/South East arrow
    Associated CSS values: SE-resize Arrows, NW-resize Arrows
    curSizeWEWest East arrow
    Associated CSS values: E-resize Arrows, W-resize Arrows
    curSizeNSNorth South arrow
    Associated CSS values: S-resize Arrows, N-resize Arrows
Remark: The CSS all-scroll and vertical-text values have no associated WLanguage constants.
WEBDEV - Browser code CSS value associated with the cursor or URL address to a cursor managed by the browser. In this case, the value has the following format: 'url(<Cursor URL>)'.
<Element used>: Name of control or page
Name of the control or page whose associated cursor must be found.
WINDEVWindowsAndroidJavaUser code (UMC)

Modifying the rollover cursor defined for a window control or for a windowHide the details

<Element used>..MouseCursor = <Cursor name>
<Element used>: Control name or window name
Name of the control or window whose cursor must be modified
<Cursor name>: Character string or integer constant
Name of the cursor to use. Can correspond to:
  • A specific cursor name (file with a .CUR or .ANI extension):
    • name of the cursor if the file is found in the current directory,
    • name and full path of the cursor if the file is found in a directory other than the current directory.
      Java ".CUR" or ".ANI" custom mouse cursors are not supported in Java.
      Android .ANI custom mouse cursors are not supported in Java.
  • A preset cursor identified by one of the following constants:
    curHelpHelp for an object
    curIbeamInput cursor
    curCrossStandard cross
    curArrowStandard arrow
    curUpArrowUp arrow
    curForbiddenSign not allowed
    curHandHand
    curSystemHandSystem hand
    Java Cursor identical to curHand.
    curWaitHourglass
    curSizeCross Arrow cursor
    curSizeNESWNorth East/South West arrow
    curSizeNWSENorth West/South East arrow
    curSizeWEWest East arrow
WEBDEV - Server codeWEBDEV - Browser code

Modifying the rollover cursor defined for a a page control or for a pageHide the details

<Element used>..MouseCursor = <Cursor name>
<Element used>: Name of control or page
Name of the control or page whose cursor must be modified
<Cursor name>: Character string or integer constant
Name of the cursor used for the specified control or window. The default value is the curAutomatic constant: the cursor is inherited if a parent element is associated with a specific cursor, otherwise the default cursor defined for the control is used.
Can correspond to:
  • The full name of a cursor file (file with a .CUR or .ANI extension). This file must be found in the _WEB directory of the site.
    Remark: the .cur and .ani files are not supported by Firefox.
    WEBDEV - Browser code The custom cursors are not supported.
  • A specific cursor name (cursor file managed by the browser). The associated CSS value corresponds to url(uri).
  • A preset cursor CSS value (see table below)
  • A preset cursor identified by one of the following constants:
    curHelpHelp for an object
    Associated CSS value: help
    curAutomaticAutomatic cursor: the cursor is inherited if a parent element is associated with a specific cursor, otherwise the default cursor defined for the control is used.

    Associated CSS value: auto
    curIbeamInput cursor
    Associated CSS value: text
    curCrossStandard cross
    Associated CSS value: crosshair
    curDefaultDefault cursor associated with the control
    Associated CSS value: default
    curArrowForbiddenArrow and sign not allowed
    Associated CSS value: no-drop
    curArrowWaitArrow and hourglass
    Associated CSS value: progress
    curForbiddenSign not allowed
    Associated CSS value: not-allowed
    curHandHand
    Associated CSS value: pointer
    curSystemHandSystem hand
    This cursor is the same as the one displayed by the curHand constant.
    curWaitHourglass
    Associated CSS value: wait
    curSizeCross Arrow cursor
    Associated CSS value: move
    curSizeColumnCursor for resizing columns
    Associated CSS value: col-resize
    curSizeRowCursor for resizing rows
    Associated CSS value: row-resize
    curSizeNESWNorth East/South West arrow
    Associated CSS values: NE-resize Arrows, SW-resize Arrows
    curSizeNWSENorth West/South East arrow
    Associated CSS values: SE-resize Arrows, NW-resize Arrows
    curSizeWEWest East arrow
    Associated CSS values: E-resize Arrows, W-resize Arrows
    curSizeNSNorth South arrow
    Associated CSS values: S-resize Arrows, N-resize Arrows

Remark: The CSS all-scroll and vertical-text values have no associated WLanguage constants.
WEBDEV - Browser code CSS value associated with the cursor or URL address to a cursor managed by the browser. In this case, the value has the following format: 'url(<Cursor URL>)'.
Remarks
WINDEVWindowsJava 

Preset cursors

The preset cursors correspond to the Windows cursors and they can be modified via the control panel (or the desktop themes). The illustrations correspond to the default values and they can change according to the user preferences.
WEBDEV - Server codeWEBDEV - Browser code 

Defining a custom cursor for the browser

To specify a specific cursor in a page or in a page control, all you have to do is indicate a character string with ..MouseCursor. The following operations are automatically performed by WEBDEV when the cursor is displayed in the page:
  • If the string starts with "url(" , the string that follows is considered as being a direct CSS value and the value is directly written into the style.
  • If the string starts with "http://" , the CSS value 'url()' is automatically added around the address.
  • If the string contains a dot (.) and starts with '/' : the specified URL is considered as being relative to the site. The '\' characters are changed into '/' and the CSS value 'url()' is added around the address.
  • If the string contains a dot (.) and does not start with '/' : the specified URL is considered as being relative to the _WEB directory. The '\' characters are changed into '/', fWebDir is added before the URL and the CSS value 'url()' is added around the address.
Remark: To display the cursors with a IIS server, the MIME type must be configured for the .cur and .ani files. The MIME type to use is "application/octet-stream".
WEBDEV - Server codeWEBDEV - Browser code 

Limitation for the List Box control and Combo Box control

..MouseCursor has no effect if the following conditions are fulfilled:
  • List Box or Combo Box control
  • Browser used: Internet Explorer (test run on Internet Explorer 7 and earlier)
WINDEVWEBDEV - Server codeWEBDEV - Browser codeJava 

Limits

WINDEV ..MouseCursor only applies to the:
  • Window controls.
  • Windows.
  • Control templates.
This property cannot be used with:
  • The menus
  • The table rows
  • The table columns
Java ..MouseCursor only applies to the following elements:
  • Button.
  • Static control.
  • Edit control.
  • Image.
  • Check Box.
  • Radio Button.
  • List Box.
  • Combo Box.
  • TreeView.
  • Tab.
  • Table.
  • Table column.
Android ..MouseCursor is available from Android 7.
WEBDEV - Server codeWEBDEV - Browser code ..MouseCursor only applies to the:
  • Page controls,
  • Pages.

Teste

Teste
teste