Difference between revisions of "LibreOffice-Suite-Base/C2/Add-Push-Button-to-a-form/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '{| border=1 !Visual Cues !Narration |- |Show Slide Number 1 Spoken tutorial on LibreOffice Base : Push Button Control Learning Objectives Add a Push Button to a form |Welcome t…')
 
 
(No difference)

Latest revision as of 18:53, 1 December 2012

Visual Cues Narration
Show Slide Number 1

Spoken tutorial on LibreOffice Base : Push Button Control Learning Objectives

Add a Push Button to a form

Welcome to the Spoken tutorial on LibreOffice Base.

In this tutorial, we will learn how to

Add a Push Button to a form.

Show Slide Number 2

Adding Push Button to a form

Show Image BookIssueForm1stViewScript6.JPG and point at the buttons at the bottom of the image.

In the last tutorial, we learnt how to add a list box form control to a form.

Now in this tutorial, we will learn how to add push buttons to a form.

Open LibreOffice Base program from Windows Start-->All Programs-->LibreOffice Suite--> LibreOffice Base

Click on the 'open an existing database file' option.

Let us first invoke the LibreOffice Base program, if it is not already open<pause>

And open our Library database. You probably now how to open an existing database by now.

Click Open under the File menu and choose Library database.

In the Base main window,


Click on the Forms icon on the left panel

Right click on the form 'Books Issued to Members', and click edit.

Now we are in the Library database.

Let us open the 'Books Issued to Members' form that we were working with in the last tutorial.

To do this, let us click on the Forms icon on the left panel

And then right click on the 'Books Issued to Members' form on the right panel. Now click on Edit.

We are now in the form design window.

Go to the Form design window.

Right-click on the text box next to Member name label. Click on Cut.

Before we talk about adding Push buttons to our form, let us make some way for the second list box for Member names.

Remember, we had an assignment of creating the second list box in the previous tutorial.

First, let us remove the text box that is on the right of the Member Name label

by right-clicking on this text box and then clicking on Cut.

The text box is deleted.

Select all the form elements that are below the Book title label.

Use the click, drag, drop method.

Now click on this area, drag it vertically down, so that there is enough space for the list box. Refer BookIssueForm1stViewScript6.JPG

Select all the form elements that are below the Member Name label. Use the click, drag, drop method.

Now click on this area, drag it vertically down, so that there is enough space for the second list box that we will add in the next step. Refer BookIssueForm1stViewScript6.JPG

Next, let us arrange the form elements.

Since list boxes need more space than text boxes, we will push the form elements further down on the form.

Here is how we will do this.

First let us select all the form elements that are below the Book title label.

For this, we will use the click, drag and drop method.

Next, let us click on the selected area and drag it vertically down,

so that there is enough room for the first list box that is adjacent to the Book Title label.

Now, let us repeat the same step for the Member Name label as well. <pause>

Click, drag and drop the second list box, that is to the left of the Member name label and move to its right, so that it is aligned with the rest of the form controls.

Refer BookIssueForm1stViewScript6.JPG

Save form using Control S.

Now, let us click, drag and drop the second list box, that is to the left of the Member Name label

And move to its right, so that it is aligned with the rest of the form controls nicely.

Okay, let us save our work on the form so far, by using the keyboard shortcut Control S.

Show Slide Number 3

Adding Push Button to a form

Show Image BookIssueForm1stViewScript6.JPG and point at the buttons at the bottom of the image.

Point cursor over the buttons

Now, we are ready to add Push buttons to our form.

A push button is another example of a form control.

We are familiar with OK, Cancel, Next, and Finish buttons; these are some examples of Push buttons.

With Base, we can add these Push buttons to our form and instruct Base, to perform specific actions when clicked.

Again, Save or Undo, or Delete are some examples. Let us see how.

Let us now add four push buttons to our form, below all the other form elements, just as in the image shown here.

Go to the form design window

Click once on the Push button icon in the Form Controls toolbar. (This icon looks like a button with the word Ok on it.)

Draw the first button at the bottom left. Use click, drag, drop for this.

Resize again by click, drag and drop. Refer BookIssueForm1stViewScript6.JPG

Add three more buttons, following the above mentioned way. Align them in one horizontal line, at the bottom.

Double-click on the first button.

In the Properties window, type 'Save Record' against 'Label'.

Click on the second button on the form. In the properties window, type 'Undo Changes' against label.

For the third and the fourth buttons, type 'Delete Record' and 'New Record' respectively.

To do this, let us go back to our form design window.

And, click once on the Push button icon in the Form Controls toolbar.

This icon looks like a button with the word Ok on it.

Notice that the mouse pointer looks like a plus symbol.

Now let us draw our first button at the bottom left, by clicking, dragging and dropping on the form, below all the other elements.

And, we will resize it accordingly.

Now let us repeat the above step three more times, <pause>

and now, we have three more buttons, all aligned in one horizontal line.

We are done drawing the push buttons on the form; now let us change their labels.

To do this, double-click on the first button.

We now see the Properties window. Here let us type 'Save Record' against the 'Label'.

Now, let us click on the second button on the form.

And in the properties window, we will type 'Undo Changes' against the 'Label'.

For the third and the fourth buttons, let us type 'Delete Record' and 'New Record' respectively.

Now let us define their actions.

Click on the 'Save Record' button,

And in the Properties window, scroll down until we spot the 'Action' label. Click on the drop down list box and click on the 'Save record'.

Similarly for 'Undo Changes' button, choose 'Undo changes' action.

For the 'Delete Record' button, choose the 'Delete Record' action

And for the 'New Record' button, choose the 'New Record' action.

To do this, let us click on the 'Save Record' button,

And in the Properties window, let us scroll down until we spot the 'Action' label.

Here, we will click on the drop down list box and click on the 'Save record'.

Let us follow the same steps for the other three buttons.

For the 'Undo Changes' button, we will choose the 'Undo changes' action.

For the 'Delete Record' button, we will choose the 'Delete Record' action

And for the 'New Record' button, we will choose the 'New Record' action.

So, now we have added the push buttons.

Press Control S.

Close the window.

Go to the Base main window. Click on the Forms icon on the left panel

and click on 'Books Issued to members' form on the right panel.

Okay, let us save our form by using the keyboard shortcut Control S,

and close this window.

In the next tutorial, we will go through just three more simple modifications to our form

and then we can use the form for data entry and data updates.

For example, when a Library member returns a book, we can update this information in the database using this form.

Show Slide Number 4

Assignment: Add a push button to Refresh the form. Add 4 narrow push buttons for record navigation (First, Previous, Next, Last)

Here is an assignment:

Add a fifth push button to the form beside the fourth, and when used, it should refresh the form.

And add 4 narrow push buttons in the next line below. These buttons should help us navigate through the records.

Show Slide Number 5

Adding a Push Button to a form

This brings us to the end of this tutorial on LibreOffice Base

To summarize, we learned how to: Add a Push Button to a form.

Acknowledgement Slide Spoken Tutorial Project is a part of the Talk to a Teacher project, supported by the National Mission on Education through ICT, MHRD, Government of India. This project is co-ordinated by http://spoken-tutorial.org. More information on the same is available at the following link http://spoken-tutorial.org/NMEICT-Intro. This script has been contributed by Priya Suresh, DesiCrew Solutions Pvt Ltd, Thanks for joining.

Contributors and Content Editors

Chandrika, Pravin1389