You are on page 1of 7

________________________________________________________________________________

_______
WinDev Training: Session 1
Objectives: - To know the basics of the software - The Basics of W-Language - Cr
eating a converter Prerequisite: None
In this first meeting, we will create a Multi-Unit Converter (currency).
I.
Start WinDev 11
To start WinDev, it is better to proceed as: - Click the Desktop - Browse to the
drive: \ WinDev 11 \ programs \ WinDev11.exe - Click on the run application win
dow appears WinDev.
II.
Create Project
To create your converter, you must create a Project. A project is to gather all
elements of your future application (Windows, databases, files, images, video, e
tc ....). To create a new project then click on Create a Project:
________________________________________________________________________________
_______ The project creation wizard appears, he will guide you in creating your
project: - Write a descriptive name for your project (example: Multi-Converter),
or choose a location will put the project files and give a description of your
project
-
Click on Team (left menu). With WinDev you can work in groups on the same projec
t, as you can work alone. In our case, and since our future application is easy,
everyone will work alone.
________________________________________________________________________________
_______ - Click on Charter (left menu). A charter allows programming to unify th
e style of programming and that using prefixes for variables is the fields as th
eir type, it facilitates reading the code.
-
Then click Next, you WinDev facilitates the creation of the GUI of your applicat
ion, you can choose between several models of graphical interfaces. Choose one!
Click Next and then choose the size of your window among the standard sizes or s
pecify a size (you can change the size later) Then click next to Windev you can
create multilingual applications. In order not to complicate the task we will cr
eate an application that supports French only.
________________________________________________________________________________
_______ - Click Next, WinDev enables and facilitates the creation of software wi
th database. But this is beyond the scope of this first meeting, in one chosen d
idn't use database. - Click Next then click finish. Your project is created, we
must now create the items.
III. Create and customize a window
To create a window, then click on new window.
-
Choose to create a blank window, or choose assistance blank window (this will al
low you to define several parameters of the window ...). Once your window to cre
ate, you can configure (type, title, size, name, ...) and that with a double cli
ck on the window (I leave you to discover all the possibilities).
-
Save your window.
________________________________________________________________________________
_______
IV. Inserting and customizing fields
Now that you have created a window, you just have to position all the fields nec
essary for a converter. In our case we create a converter dirham in several inte
rnational currencies (Euro, Dollars, Yen ...), why we need: • A text box for ent
ering the amount in dirhams Combo • A field to select the currency to which want
s to convert the. • A text box to display the conversion result • One button con
version
Then: - Insert the two input fields (SAI_Dirham, SAI_Convertie) - Insert button
(BTN_Convertir) - Insert field Combo assistance opens to guide you through the c
reation of this field, just click to complete the wizard personalize (name, text
, size, color ...) an input field, just double click below. Provide valid and me
aningful names to your fields. Similarly for the field COMBO in the original wri
te yen, dollar and euro each in a line and detail (left menu), select returns th
e value specified with this Glien to test the user's choice by comparing with th
e text field not with the position of text in the COMBO.
________________________________________________________________________________
_______ And here it is almost finished, your window may be similar to that windo
w?
You can test it by clicking the button on the toolbar Tester window. There remai
ns only the programming part.
V.
Programming
The scenario of the application is very simple: - The user gives the amount in D
irham - The user selects the currency to which it wants to convert the amount -
the user clicks convert - The conversion result is displayed in To convert the s
um field in this scenario remark that the only function performed by the functio
n when the user clicks the button, the application calculates the amount convert
ed at the option and displays the result field. Let's do like - Right click on t
he button and select Code - The code window appears - Insert the following code
And done! Your currency converter is ready for use. The next meeting we will lea
rn to create multi-window applications, and to use other types of fields. Thank
you for your participation
________________________________________________________________________________
_______
Exercise 1
Edit the fields to prohibit the entry of characters and make the field SAI_Conve
rtie display-only and not accessible by tabbing. Modify your program so that the
conversion happens automatically when choosing. Change the code using IF THEN i
nstead of BY
Exercise 2
Create a new application called Exo2 containing: • A window • 4 input fields o N
ame (text, size 50 characters, height of the field 30, size 12 bold font) No Nam
e (text, 50 characters, height of the field 30 font size 12 bold) No Age (Digita
l <100, 30 field height, size 12 bold font) • No Result field a combo containing
: Dear Miss A button • When the user clicks the button in the field should resul
t s display the following sentence: Hello (Dear Miss: the choice of the user) na
me first, you Age years. Example: Hello Sir Michael Scofield you have 31 years.
Hint: the string concatenation is done with +
________________________________________________________________________________
_______
WinDev Training: Session 2
Objectives: 1. Creating Application multiwindow 2. Field manipulation with progr
amming 3. Using dialogs Prerequisites: session 1
In this second meeting, we will create a multi-window application using various
fields and dialogs, using the mechanisms of communication between windows. Start
WinDev 11 and create a project named "TP2" Windows executable without using dat
abase.
I.
Window 1
Create a new window, and specify its size of 800 * 600 and under "Student Direct
ory. Insert the fields with the characteristics:
Name and type of field
SEL_Civilité: Selector Name: Title
Characteristic
Options: - Mr - Mrs - Miss Column Number: 3
SAI_Nom, SAI_Prenom: Input field
Name: Name; Name
COMBO_Niveau: Name: Level Combo SAI_Adresse field: input field Name: Address Fie
ld Multi-line
IMG_Photo:
****
________________________________________________________________________________
_______ BTN_Inserer image, BTN_Vider TABLE_Table: table name: Insert, Clear Name
: Not Column 6 Column Name: field labels above the columns Type: text except for
the image height = width of line image column
Now we insert the elementary fields, our window looks something like this:
Save your window under FEN_Principale.
________________________________________________________________________________
_______
II.
Window 2
Create the following window:
You are predefined in the country field application (look!)
III. Treatment
We will learn to handle all fields and windows to ensure the desired operation o
f the application. The principle is simple:
1. On loading the window fills the field in FEN_P COMBO_Niveau combo with values
:
o First year Second year o o o Fifth year ...
Completing the field programmatically is very useful if the data are not known i
n advance (available in a database, a file ...)
2. By clicking on the field IMG_Photo opens a dialog box to browse the image
the student, once the selected image must be displayed in the image field.
Remember all the syntax of the function fsélecteur is not practical, notice that
once you craft the parenthesis of the function fsélecteur software offers free
assistance!
________________________________________________________________________________
_______
3. Once the user accesses the field SAI_Adresse FEN_Adresse opens the window for
entering
address, the address is retrieved and displayed in this field.
This code means that the window FEN_Adresse returns the address entered. So to c
lose this window it returns the address composed of the concatenation of the fie
lds (street, city, zip code, country)
So the role of BTN_OK button will close the window
4. By clicking on the student adds BTN_Inserer TABLE_table
The SELECTOR field only returns the number of the selection, so we should match
the number associated with civility. Once this is done, add the student to the t
able.
The function TableAjoute (...) allows you to insert information in the table. TA
B to move through the columns on the same line. And that is that our application
is ready for use, but it has several drawbacks: Once it is closed all the store
d data is lost (the next meeting!) There is no check entered information. The im
age appears distorted or only a portion of the image that appears.
Exercise 1
Modify your application to control the input, and displays the data correctly. W
ith well-defined dialogs asking the user to enter information integrity. Tips fu
nctions: Error (...), info (...), dialogue (...) Control fields: field = NULL IF
NOT THEN ... .... END
________________________________________________________________________________
_______
WinDev Training: Session 3
Objectives: 1. Create and manipulate database 2. Creation of three states. Creat
ing menus Prerequisites: session 1, session 2 In this session, we will create a
management application with database. This application is an application for man
aging customer orders.
Creating a project and the database
As usual, create a new project, but we will create a database.
Click on next, the next window asks you to specify the location where you want t
o store the analysis and the name of the analysis, so you can give a description
of your analysis.
________________________________________________________________________________
_______ Then click on Next, the wizard prompts you to specify a password. It wil
l be used to control access to the database and to ensure that data security.
Click Next, the wizard prompts you to choose the database you want to use. Note
the wide variety of database that you can manipulate with WinDev the highest to
the lowest ORACLE Microsoft Access. The database is the easiest to handle and fa
ster and Hyper File. Choose HyperFileClassic.
Click Next and finish the wizard. Now we will create the data logic module MLD,
which is the location and structure of our database. Our MLD will contain: File
command: # NCommande, OrderDate Client File # RC RaisonSociale, Address File sec
tion: # RefArticle, description, PU
________________________________________________________________________________
_______ Create these files using the following
→ Click on Create File → Choose Create a new file description → Give the name of
your "Order" → Choose HyperFileClassic as a database wizard → Finish → Create t
he fields of your command file (NCommande, OrderDate)
Do the same for the files "Customer" and "Article"
Now we must create relationships between files: A client may make one or more co
mmands a command contains one or more articles A command is made by one and only
customer of an article belongs to one or more orders
________________________________________________________________________________
_______ Use the Create a link to that part of the toolbar. A wizard appears to h
elp you in creating the link. Follow these steps:
Set cardinalities in answering questions! Windev adds a link file if necessary.
Click Next until the end of the wizard. Thus the connection between your files "
command" and "customer" is created. Do the same to define the other routes. Chan
ge the file association between Order and Rule Quantity and add attributes.
2 Creating the main window
Create a new blank window: Main menu → Create: Create a menu click Window> Main
Menu> Add the main menu it will contain two menus: - File: Print (Ctrl + I) Repo
rt Dead (Ctrl + X) - Management : Guest Articles
________________________________________________________________________________
_______ → Create the elements of the window quickly
3 Creation of windows management
3.1 Interface
To save development time, we will use the functionality RID for the generation o
f interfaces. We'll create two types of interfaces: plug for adding and modifyin
g data table for displaying data. → Choose new window and then RID
Choose File → simple: we will use it to edit and add new customers. → The wizard
appears: Select the customer table, select all fields and give as FEN_Fiche_Cli
ent name. A customer record window is created, containing 3 fields and 2 button.
Create another window of the same type for the article table (FEN_Fiche_Article
). Create two other windows type table for good and for customer.
________________________________________________________________________________
_______
3.2 Building STATES
A STATE is a data page printable or exportable in many document formats (Excel,
Word, PDF, XML ...). It will print the data in the table as a custom. To create
a new click STATUS> state the wizard will guide you in creating voting state - C
hoose type of table as the state
-
Click Next, and choose a data source Field Table
-
Then choose from the table given, we will create two states, one for customers a
nd one for items
-
See other settings you can customize: orientation of the sheet format ... Give a
meaningful name to your state (eg ETAT_Articles) and finish the wizard. Change
the title of the report: eg "Catalog Item" Save the state.
________________________________________________________________________________
_______
3.3 Programming
Warning: Creating the database HCréationSiInexistant ("*")
3.3.1 Film
The windows form should allow either the addition or modification of data. So we
must pass it a parameter for it to know what the treatment will perform. Becaus
e of this craft in its code and create a comprehensive reporting procedure with
the same name as the window called Constructor.
In initializing the window, you must complete a treatment: If the parameter is e
qual to 1 then the window is open to change data, so we must view these data in
the fields.
When clicking on the OK button, you must either add new data or modify data
When you click on cancel, it closes the window, notice that it's already done by
WinDev. Do the same for the customer record, you paying attention to the functi
on parameters.
Table 3.3.2
The function of a window table is to display all records present in the database
. And open the windows files to edit or add data. To display data in the table,
the table must be completed each time the focus of the window:
-
When you click the New button it opens the page with the parameter 0: When you c
lick on the Edit button, it opens the file with a parameter.
________________________________________________________________________________
_______ - When you click on the delete button, we delete the selected item after
confirmation of the user, then:
-
And finally, when you click on the Print button, you should print a list of item
s the company sells that mean we should print the status of items previously cre
ated.
-
Do the same for the customer record, you paying attention to the function parame
ters.
3.3.3 The main window
At each round of focus, you must complete list of customers with their RC COMBO
-
Adding in the command section is done by clicking on the button "+" → It display
s the type of customer table, you get an article (do not forget RETURN) → then a
sked the quantity of the item → section is added to the table
-
The clicks on the button "-" removes the section of the order after confirmation
(you!) Clicking on save, you must register the command
-
I will let you complete the other buttons to enhance the application (command hi
story, printing orders, seizure control, addition of other fields in the databas
e,€submenu again (Article, customer), free your imagination ... ☺

You might also like