terça-feira, 11 de agosto de 2020

DICAS 3011 - WINDEV TUTORIAL 34 - Adicionar e Modificar Janelas - Validacao - PARTE G



https://youtu.be/Us-49OHMQ90

Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 11:00 do dia 24/08/2020 

DICAS 3011 - WINDEV TUTORIAL 34 - Adicionar e Modificar Janelas - Validacao - PARTE G
Tutoriel WINDEV : Leçon 4.2.g. Fenêtres d'ajout et de modification - Validation


ASSUNTOS

ATUALIZAR A TABELA
ENTRAR TABELA E MOSTRAR DADOS ATUALIZADOS
COMANDOS UTILIAZADOS
SCREENTOFILE
HMODIFY
CLOSE
OPEN
TABLEDISPLAY



Video original da Franca

https://youtu.be/840J5StqFD8


Playlist Windev TUTORIAL













Validate the product modifications

Two Buttons controls have been created in the "WIN_Product_form" window:
  • an "OK" Button control to validate changes,
  • a "Cancel" Button control to manage the return to the product list.
We are now going to type the WLanguage code required for them to operate.
  • First of all, display (if necessary) the "WIN_Product_form" window in the editor: click the corresponding button in the open documents bar.
  • We will now write the WLanguage code associated with the "OK" Button control.
    1. Right-click the Button control and select "Code" from the popup menu.
    2. Write the following code in the "Click" WLanguage event:
      ScreenToFile()
      HModify(Product)
      Close()
      Let's take a look at this WLanguage code:
      • ScreenToFile is used to initialize the items with the values of linked controls, for the current record. This function is equivalent to the following code lines:
        Product.Reference = EDT_Reference
        Product.Caption = EDT_Caption
        Product.Description = EDT_Description
        ...
        Our window uses less than 10 controls and the benefit is already there; think of the windows that use a lot more controls: a single code line performs all assignments!
      • HModify is used to update the file data for the current record.
    3. Save the modifications by clicking Save the element among the quick access buttons.
    4. Close the code window (click X at the top right corner of code editor).
  • The modifications performed in the "WIN_Product_form" window must be taken into account in the Table control used to list the products. To do this, we will simply modify the WLanguage code associated with the "Modify" Button control in "WIN_Menu".
    1. Display the "WIN_Menu" window in the editor: click the corresponding button in the button bar.
    2. Select the "Modify" Button control and open the code editor (F2).
    3. Modify the "Click" event as follows:
      Open(WIN_Product_form)
      TableDisplay(TABLE_ProducttaCurrentSelection)
      Let's study this code:
      • TableDisplay is used to update the Table control with the data modified in the product form.
      • The taCurrentSelection constant is used to specify that the Table control must be updated from the position of selection bar.
    4. Save the modifications by clicking Save the element among the quick access buttons.
    5. Close the code window (click X at the top right corner of code editor).

Checking the product modification

  • To check the modification of a product:
    1. Run the project test ( Run project test among the quick access buttons).
      Quick access buttons
    2. WINDEV asks you to select the first project window. In our case, this window corresponds to "WIN_Menu". Select this window and validate.

      Remark

      The first project window corresponds to the first window that will be opened when starting the application. The first project window can be defined:
      • during the project test.
      • when creating the executable.
      • in the "Project explorer" pane: all you have to do is select the requested window, display the popup menu and select "First project window".
      When a first project window is defined, a small red 1 appears in front of the window name in the "Project explorer" pane.
    3. The project starts in test mode and the first window is displayed.
    4. Select a product from the product list (for example the first one) and click "Modify".
    5. The details of the selected product are displayed in the form window.
    6. Modify the price of 100.23 Dollars and enter 200.00 Dollars, then click "OK".
    7. When going back to the list of products, you will notice that the price was updated for this product.
    8. Display the product details again.
    9. Click the "Modify" button below the image. The image picker is displayed. Select an image and validate. The image is displayed in the form.
    10. Click the "Cancel" button. The image modification was ignored in the data file.
    11. Click the cross to close the application





DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C








DICAS 3010 - WINDEV TUTORIAL 33 - Adicionar e Modificar Janelas - Modifica Imagen - PARTE F



https://youtu.be/S_8Au6cThlc


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 09:00 do dia 24/08/2020 

DICAS 3010 - WINDEV TUTORIAL 33 - Adicionar e Modificar Janelas - Modifica Imagen - PARTE F
Tutoriel WINDEV : Leçon 4.2.f. Fenêtres d'ajout et de modification - Modification de l'image


ASSUNTOS

Explicando o que sera feito
Adicionando um botao abaixo imagen
FimageSelect


Video original da Franca

https://youtu.be/tIfjSFSUyjM


Playlist Windev TUTORIAL

// BTN_PROCURA_IMAGEN 

sFile is string
sFile = fImageSelect("","","Seleciona Imagen")
IF sFile<>"" THEN
IMG_Visual=sFile
END




Modification de l'image du produit

L'utilisateur va pouvoir modifier l'image du produit dans la fiche Produit. Pour cela, nous allons lui proposer un champ Bouton "Modifier" situé en dessous de l'image du produit. Ce champ ouvrira un sélecteur de fichiers permettant de sélectionner l'image à utiliser.
  • Tout d'abord, affichez si nécessaire la fenêtre "FEN_Fiche_du_produit" sous l'éditeur : cliquez sur le bouton correspondant dans la barre des documents ouverts.
  • Pour créer le champ Bouton permettant de modifier l'image :
    1. Sous le volet "Création", dans le groupe "Champs usuels", déroulez "Bouton". Dans la liste des champs Bouton prédéfinis que s'affiche, saisissez "Modifier" dans la zone de recherche. Cliquez sur "Bouton Modifier".
    2. La forme du champ apparaît sous la souris. Cliquez ensuite dans la fenêtre, sous l'image du produit.
    3. Redimensionnez si nécessaire le champ Bouton (à l'aide des poignées) pour que le champ ait la même largeur que le champ Image.

      Note

      Lors du redimensionnement du champ, un effet de magnétisme automatique simplifie l'alignement du champ Bouton avec le champ Image.
      Interface de la fenêtre fiche sous l'éditeur
    4. Faites un clic droit sur le champ Bouton. Dans le menu qui s'affiche, sélectionnez l'option "Code".
    5. Dans la fenêtre de code qui apparaît, saisissez le code WLangage suivant dans l'événement "Clic sur" :
      fSélecteurImage(
      Assistant de fonction dans l'éditeur de code
    6. L'éditeur de code propose un assistant de code.
      • Cliquez sur "Assistant de la fonction fSélecteurImage".
      • L'assistant de code se lance.

        Note

        WINDEV propose de nombreux assistants de code qui à l'aide de questions simples vont écrire la ou les ligne(s) de code correspondant. N'hésitez pas à les utiliser, vous éviterez ainsi des erreurs de syntaxe.
    7. Conservez toutes les options par défaut de l'assistant et validez. Le code WLangage correspondant est automatiquement inséré.
      sFichier est une chaîne
       
      // Ouvre le sélecteur d'images
      sFichier = fSélecteurImage("""""Sélectionnez une image...")
    8. Ajoutez le code WLangage suivant à la suite :
      // Si un fichier a été sélectionné
      SI sFichier <> "" ALORS
      // Affecte l'image au champ Image
      IMG_Visuel = sFichier
      FIN
      Ce code WLangage permet d'affecter le fichier sélectionné au champ Image présent dans la fenêtre.
    9. Fermez l'éditeur de code (cliquez sur la croix en haut à droite de l'éditeur de code).
Nous testerons cette fonctionnalité lorsque la gestion des modifications effectuées dans la fiche sera finie.










DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C







DICAS 3009 - WINDEV TUTORIAL 32 - Adicionar e Modificar Janelas - Exibicao registro - PARTE E



https://youtu.be/q4wfxmDkU8k

Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 19:00 do dia 21/08/2020 

DICAS 3009 - WINDEV TUTORIAL 32 - Adicionar e Modificar Janelas - Exibicao do registro - PARTE E
Tutoriel WINDEV : Leçon 4.2.e. Fenêtres d'ajout et de modification - Affichage de la fiche

https://windevdesenvolvimento.blogspot.com/2020/08/dicas-3009-windev-tutorial-32-adicionar.html


ASSUNTOS

EXPLICANDO O QUE SERA FEITO
REDIMENSIONANDO A JANELA 
MOSTRANDO O MESMO REDIMENSIOANMENTO MAS APERTANDO SHIFT
ENTRAR NA RELACAO PRODUTOS - MENU
ACRESCENTAR O BOTAO MODIFICA 
Open(WIN_FICHA_DE_PRODUTOS)
ENTRAR NO CODIGO FICHA PRODUTOS
FileToScreen ()




Video original da Franca

https://youtu.be/DGPU8cAnDS4


Playlist Windev TUTORIAL

https://www.youtube.com/playlist?list=PLwJwZaqiZW-lxU1XF0M0htb5S5f8pavuE














Displaying the form from the list of products

Now, let's see how to display the form of the product selected in the list of products. The principle is straightforward: the user will select the product in the Table control and display the product details via a Button control.
  • We are going to modify the "WIN_Menu" window to create a modification Button control:
    1. Position the cursor on the "Menu" window: click "WIN_Menu" in the open documents bar:
      Open documents bar
    2. At this time, the Table control occupies the entire window. Enlarge the window to the right via the sizing handles.
    3. Reduce the size of Table control:
      • Hold the Shift key down.
      • Reduce the Table control via its sizing handles.

        Remark

        Pressing the Shift key allows you to ignore the anchoring options of controls during the resize operation.
    4. We now have space on the right to create the Button control that will allow us to view the selected product in the Table control.
  • To create the Button control to view the product:
    1. On the "Creation" pane, in the "Usual controls" group, expand "Button" (click the arrow under Creating a Button control ).
    2. Enter "Modify" in the search box at the top of the list of preset Button controls. Click "Modify button". The shape of the control appears under the mouse pointer. Then, click on the right of the Table control to create the Button control.
      Window with Button control in the editor
    3. Right-click the control that was just created. Select "Code" from the menu that is displayed.
    4. In the code window that appears, write the following WLanguage code in the "Click" event:
      Open(WIN_Product_form)

      Remark

      The assisted code input (also called "completion") is going to help you: as soon as you type the opening bracket "(", a drop-down list proposes the name of all existing windows found in the project. Simply select the name of the window with the keyboard or mouse.
      If the window name is not displayed in the list, it means that this window was not saved beforehand.
    5. Let's take a look at this WLanguage code: Open is used to open the "WIN_Product_form" window. This function was already presented in the first part of this tutorial.
    6. Save the modifications by clicking Save the element among the quick access buttons.
    7. Close the code window (click X at the top right corner of code editor).
We are now going to modify the "WIN_Product_form" window to display the selected product in the Table control.
  • Open the "WIN_Product_form" window in the editor: click the corresponding button in the open documents bar.
  • To display the product data:
    1. Display the events associated with the window:
      • Perform a right mouse click in the area found beside the window (called "Home area").
      • Select "Code" from the popup menu that is displayed.
      • The code editor appears. The WLanguage events associated with the window are displayed.
    2. Enter the following WLanguage code in the event "End of initialization of WIN_Product_form":
      // Assigns the content of items to the controls
      FileToScreen()
      FileToScreen is used to display in the controls the data found in the data file, for the current record. In our case, the current record will be the record selected in the Table control of "WIN_Menu" window.
    3. Close the code window.
    4. Save the window (Ctrl + S).
  • Display the "WIN_Menu" window in the editor: click the corresponding button in the open documents bar.
  • Run the window test ( Running a window test among the quick access buttons).
    • In the list of products, click one of the products with the mouse.
    • Click the "Modify" button.
    • The detailed product window is displayed.
  • Close the different test windows using the "X" at the top right of the windows.




DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C









Teste

Teste
teste