Creating a gambas2 program, step by step, a telephone index

From : http://listingambas.blogspot.com/2011/06/empezamos-objetivo-de-nuestro-programa.html



To begin: goal of our program Listin


The goal is to create a program that manages contacts (either privates or job related) with their phones, address, photo, etc.. In order to add, edit, delete, we must also help find data in a simple way and export or import data from other applications (we will do it using the clipboard) and we must allow user to save and read data allready entered or to modify it, each time he starts the program.

Therefore, the first thing we do is an outline of the data and actions that we will manage.

schema




Define the visual environment of our program: Form Fmain

Let's define our main form.
It is divided into 4 areas:
Data input:


Label





Textbox





PictureBox

Buttons for different actions: Edit / Delete / Search


Buttons
OK / Cancel / bin / Filter



Data Displays


Gridviews

Menus: To Save / Read / Import / Export
We design it with the menu editor (Ctrl + E)
Menu Editor
Note: we will put a name for each menu item that referred to what it does.

It will remain one thing to do: to write on the label the text we want to be displayed (Label.text property).
In textboxt, we must put on the property (
NAME) the name that will match with its contents. For example textboxName, textboxSurname, etc. But we let TextBox.Text property with blank (delete the text it contains).
For picturebox, we change the following properties: "NAME "pictureboxPhoto" BORDER "plain" STRETCH "True". In order to display the full image, we shrink the size of our PictureBox.Picture"icon:/96/gambas"
As to buttons, we also change the properties; for example: NAME: buttonAccept ButtonAccept.text: OK.
ButtonAccept.picture: choose the icon applied and let the button as is.

Concerning the gridview, we also changed the name of GridView1 into GridViewData.

design

Button design



Upon completion of this process we get the following form:
Main Form
     We can also add an icon to our application.
   
 In
form fmain property icon we can tell which icon
     the application  will exhibit (once selected, we will
     see it at the top left corner)

Icone appli
       




Note: It is important to give their names at the beginning (from the time of the creation of the form and components), in order to clearly carry programming  ahead to events handling.
It will make
our code more readable and easy to modify .