From 8362bf63dea22bbf6736609b0f49c152f975eb63 Mon Sep 17 00:00:00 2001
From: tpearson
+You can define a database as a collection of data on one topic. It is organised in a way allowing to easily browse the information, make changes or add new items.
+
+Look at this diagram for one of the above examples: a simple phone book.
+
+
+1.1. What is a database?
+
+
A diagram of a phone number database
+
+The above picture shows a set of two contacts each of which is presented on a separate card. It appears that such a card can constitute a single line in a table:
+
+
+
+Contacts
+Name Tel No.
+Joan 699 23 43 12
+Adam 711 19 77 21
+Terms and definitions: A single data which constitutes a part of a greater collection can be called a line or more professionally a record. The collection is narmally called a table. Moreover, the most natural name for the table is one describing the data it offers/stores which is Contacts. Furthermore, each line in the table consists of columns often also called fields. In the table Contacts there are two columns (fields): Name and Tel No.. + +
++For simple uses a single table can make up a database. Many people consider these two equivalent. As you will see, for real databases we usually need more than one table. +
++To sum up, you have already got a simple database with one table Contacts. + + +
\ No newline at end of file diff --git a/kexi/doc/handbook/html.tmp/01_02_00_db_spreadsheet.html b/kexi/doc/handbook/html.tmp/01_02_00_db_spreadsheet.html new file mode 100644 index 00000000..e7959df7 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/01_02_00_db_spreadsheet.html @@ -0,0 +1,206 @@ ++It is very likely that you have already used spreadsheet applications like KSpread, OpenOffice.org Calc or Microsoft Excel. If so, you will probably wonder: since both spreadsheets and databases have tables, why should I use the latter? +
++While comparing spreadsheets and databases you may encounter the following issues which you will later see in greater detail: +
++Gradually exceeding the capacity of a mobile phone, expand your table Contacts adding a column (field) Address. Add more telephone numbers (office, home) for each person and add surnames to names. To make it simpler we assume the following: +
++
Contacts | ||
Name and surname | Tel | Address |
Joan Smith | 699 23 43 12 | Western Gate 1, Warsaw |
Adam Willson | 711 19 77 21 | London, Frogs Drive 5 |
Joan Smith | 110 98 98 00 | Western Gate 1 |
Smith Joan | 312 43 42 22 | Warsaw, Western Gate 1 |
ADAM Willson | 231 83 02 04 | Frogs Drive 5, London |
+Such a table can be made both in a spreadsheet and in a database. +Using a spreadsheet is very easy, of couse. What problems do we encounter at this stage? + + + +
+Suppose you are using a spreadsheet and you need to change the address of at least one person. You have a small problem: you often have to change the address in many lines. For example, Joan takes three lines. A real problem will arise if you forget to change one of the lines - the address asigned to this person will be ambiguous, hence your data loses integrity. +
++Moreover there is no simple way of deleting a chosen person from the table since you have to remember about deleting all the lines releted to him or her. +
+ + ++This is directly connected to the previous problem. In fields Name and surname and Address the same data is entered many times. This is typical of spreadsheets, ineffective way of storing data because the database grows unnecessarily, thus requiring more computer resources (larger size of data and slower access). +
+How can you solve these problems with a database? You can split information into smaller chunks by creating additional table Persons with only two columns: Name and suname and Address: +
++
+
Persons | |
Name and surname | Address |
Joan Smith | Western Gate 1, Warsaw |
Adam Willson | Frogs Drive 5, London |
+Each line in the table Persons corresponds to a single person. +Table Contacts is from now in a relation to the table Persons (see next paragraph). +
+ + ++Note the way data is entered in fields Name and surname and Address. People entering data can be fallible, sometimes even negligent. In our sample data we have both different sequence of entering name and surname (Joan Smith and Smith Joan; Adam and ADAM) and many more ways of entering the same address. Surely you can think of many other ways. +
+The above problem shows that e.g. when searching the telephone number of a person whose address is "Western Gate 1, Warsaw" you will not get a full result. You will get only one line instead of three. Moreover You will also not find all the telephone numbers searching for the value "Joan Smith" in the field Name and surname, because "Smith Joan" will not fit to "Joan Smith". +
+How can you solve these problems using a database? You can do this by changing the design of the table Persons by: +
++
Dividing data in the field Name and surname into two separate fields: Name and Surname. +
Dividing data in the field Address into three separate fields Street, House number and Town. +
Guaranteeing data correctness: by ensuring that no fields are empty, e.g. you must always enter house number. +
++A modified table looks something like this: +
++
Persons | ||||
Name | Surname | Street | House number | City |
Joan | Smith | Western Gate | 1 | Warsaw |
Adam | Willson | Frogs Drive | 5 | London |
Conditions | ||||
required field | required field | required field | required field | required field |
+Thanks to introducing conditions required field we can be sure that the entered data is complete. In case of other tables you may of course allow omitting certain fields while entering data. +
+ + ++Spreadsheet displays all lines and columns of the table which is bothersome in case of very large data sheets. You may of course filter and sort lines in spreadsheets, however you must be extra careful while doing so. Spreadsheet users are in risk of forgetting that their data view has been filtered what can lead to mistakes. For example, while calculating sums you may think you have 100 rows of data while in fact there are 20 rows more hidden. +
+If you want to work on a small subset of data, e.g. to send it for others to edit, you can copy and paste it to another spreadsheet and after editing paste the changed data back to the main spreadsheet. Such "manual" editing may cause data loss or incorect calculations. +
+To limit the data view database applications offer queries, forms and reports. +
+A very practical way of limitting is the following extended version of the previously described table Persons: +
++
Persons | |||||
Name | Surname | Street | House number | City | Income |
Joan | Smith | Western Gate | 1 | Warsaw | 2300 |
Adam | Willson | Frogs Drive | 5 | London | 1900 |
+Let's assume that the newly introduced column Income contains confidential data. How can you share e.g. contact details of the persons with your coworkers but without revealing their income? It is possible if you share only a query and not the whole table. The query could select all columns except for the column Income. In database world such a query is often known as a view +
+ + ++Your computer is probably quite fast, however you will easily see that it doesn't help with slow, large spreadsheets. Their low efficiency is first of all due to lack of indexes accelertaing the process of data search (databases do offer them). Moreover if you use things like system clipboard, even copying data may become troublesome with time. +
+Spreadsheets containing large data sets may take ages to open. Spreadsheet loads lots of data to the computer's memory while opening. Most of the data loaded are probably useless/unneccessary for you at the moment. Databases unlike spreadsheets load data from computer storage only when needed. +
++In most cases you will not have to worry how the database stores its data. This means that unlike spreadsheets, databases do not care about: +
++Together with Limiting data view described in the previous paragraph these qualities constitute the advantage of databases. +
+ + ++The latest editions of applications for creating spreadsheets enable you to design data-entry forms. Such forms are most useful if your data cannot be conveniently displayed in tabular view, e.g. if the text occupies too many lines or if all the columns do not fit on the screen. +
++In this case the very way the spreadsheet works is problematic. Fields for data entry are placed loosely within the spreadsheet and very often are not secure against the user's (intentional or accidental) intervention. +
+ + ++Databases enable grouping, limiting and summing up data in a form of a report. Spreadsheets are usually printed in a form of small tables without fully automatic control over page divisions and the layout of fields. +
+ + ++Applications for creating databases often contain full programming languages. Newer spreadsheets have this capability too, however calculations come down to modifying the spreadsheet's fields and simple data copying, regardless of the relevance an integrity rules mentioned in previous paragraphs. +
++Data processing within a spreadsheet is usually done via a graphical user's interface which may slow down the data processing speed. Databases are capable of working in background, outside of graphical interfaces. +
+ + +It is hard to imagine a multiuse of one spreadsheet. Even if it is technically possible in the case of the latest applications, it requires a lot of discipline, attention and knowledge from the users, and these cannot be guaranteed. +
+A classical way to sharing data saved in a spreadsheet with other person is to send a file as a whole (usually using e-mail) or providing a spreadsheet file in a computer network. This way of work is ineffective for larger groups of people - data that could be needed in a particular time may be currently locked by another person. +
++On the other hand, databases have been designed mainly with multiuser access in mind. Even for simplest version locking at particular table row's level is possible, what enables easy sharing of table data. +
+ + ++Securing a spreadsheet or its particular sections with a password is only symbolic activity. +After providing a spreadsheet file in computer network, every person being able to copy the file can try to break the password. It is sometimes not so hard as the password is stored in the same file as the spreadsheet. +
+Features for edit locking or copy locking of a spreadsheet (or its part) is equally easy to break. +
++Databases (except these saved in a file instead of a server) do not need to be available in a single file. You're accessing them using a computer network, usually by providing a user name and a password. You are gaining access only to these areas (tables, forms or even selected rows and columns) whose were assigned to you by setting appropriate access rights. +
++Access rights can affect ability of data editing or only data reading. If any data is not avaliable to you, it will not be even sent to your computer, so there is no possibility of making a copy of the data in such easy way as in case of spreadsheet files. +
diff --git a/kexi/doc/handbook/html.tmp/01_03_00_design.html b/kexi/doc/handbook/html.tmp/01_03_00_design.html new file mode 100644 index 00000000..63650191 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/01_03_00_design.html @@ -0,0 +1,8 @@ ++Database design needs careful planning. Note that Contacts table redesign proposed in this section 1.2 can generate problems when the table is filled with data. For exampe, renaming a field is a simple task, but splitting Address field into two separate fields requires careful and tedious work. +
++To avoid such situations, rethink your database project before you create it in your computer, and before you and others will start to use it. Thus, by investing some time initially, you will most probably save your time on everyday use. +
diff --git a/kexi/doc/handbook/html.tmp/01_04_00_who_needs.html b/kexi/doc/handbook/html.tmp/01_04_00_who_needs.html new file mode 100644 index 00000000..33a5f379 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/01_04_00_who_needs.html @@ -0,0 +1,24 @@ ++Stick to spreadsheets if: +
++
+Consider using databases if: +
++So far you have learnt the general characteristics of databases without going into much +detail about specific applications for designing them. +
++The first databases were built together with large mainframe computers in the 60s, e.g. IBM System/360. +Those were not the days of PCs, therefore these databases required a highly specialized personnel. +Although the old computers' hardware was unreliable, they were immeasurably slower and had less +storage capacity, one feature of databases still remains most attractive: the data access by many +users through network. +
+ ++In the 70s scientists formed the theory of relational databases +(terms like: table, record, column (field) and relationality and many others). +On the basis of this theory IBM DB2 and Oracle databases were created, +which have been developed and used till today. In the late 70s the first PCs +were constructed. Their users could (gradually) utilize many types of applications, +including those for database construction. +
+When it comes to large databases in companies, the situation hasn't changed: +they still require powerful computers or computer complexes called clusters. +This goes, however, beyond the topic of this manual. +
++In the area of "accessible" databases with graphic user interface +for PCs you can choose from the following: +
++
DBase +- a tool for databases operation for DOS popular in the 80s. Files in DBase format +are still used in some specific cases due to their simplicity. +
FoxPro +- an application similar to DBase (early 90s). After being taken over by +Microsoft, graphic user interfaces were introduced and therefore it is +used for creating databases on PCs. This product is still offered, though seems a bit obsolete. +
Microsoft Access +- an application for databases (data and graphic interface design) with many simplifications, +therefore suitable for beginners, designed in the late 80s, +based on 16-Bit Architecture. Product offered and widely used till today, especially by small companies, +where efficiency and multiuser requirements are not very demanding. +
FileMaker - popular application similar to MS Access in simplicity, operating on Windows and Macintosh platforms, offered sice 1985. +
Kexi +- a multiplatform application (Unix/Linux, Windows, Mac OS X) designed in 2003, +developed according to OpenSource principles, part of the global K Desktop Environment project, i.e. graphic environment for Unix/Linux systems. A significant contributor to Kexi's development is OpenOffice Poland company. +
+In this chapter you will learn what Kexi application is and how it can be of use to you. You will be able to decide which areas of your work can be simplified or automatized using Kexi. +
++Perhaps you already know some tools for creating databases or at least spreadsheets. If so, here you can learn about the basic differences between Kexi and other popular applications. +
diff --git a/kexi/doc/handbook/html.tmp/02_01_00_what_is_kexi.html b/kexi/doc/handbook/html.tmp/02_01_00_what_is_kexi.html new file mode 100644 index 00000000..9cfbe28d --- /dev/null +++ b/kexi/doc/handbook/html.tmp/02_01_00_what_is_kexi.html @@ -0,0 +1,25 @@ ++Briefly speaking, Kexi is the application for creating databases and for data management. It enables you: +
++
+Kexi is a member of a PlusOfficePL family of products offered by OpenOffice Polska together with technical support. Kexi należ±cy do rodziny programów PlusOfficePL, oferowanej wraz ze wsparciem technicznym przez firmę OpenOffice Polska. +
++The motto of Kexi application is "Database creation for everyone". Introduction of this product was motivated by the lack of software Rapid Application Development tools similiar to Microsoft Access, FoxPro, Oracle Forms or FileMaker, that would be available for all contemporary hardware and system platforms. Kexi was made to fill this gap. +
++Kexi is the first large KDE application available for Microsoft Windows, which makes it easier for the user to transfer data between platforms, integrate and migrate for more cost-efficient systems like Linux. +
++Kexi is also one of the products of an international K Desktop Environment project, a graphic environment for Unix/Linux systems. The KDE project involves many companies (including the largest ones such as Novell and IBM), organisations and independent authors. +
diff --git a/kexi/doc/handbook/html.tmp/02_02_00_features_of_kexi.html b/kexi/doc/handbook/html.tmp/02_02_00_features_of_kexi.html new file mode 100644 index 00000000..9666e8d1 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/02_02_00_features_of_kexi.html @@ -0,0 +1,15 @@ ++Kexi has many features that distinguish it from the competition: +
++
+Kexi is designed to serve both beginners (when it comes to databases) as well as more advanced users who know a great deal about databases. If you belong to the latter group, you will probably want to skip the sections of this documentation you are familiar with. However you will surely benefit from reading chapter 2.4 intended especially for experts. +
++If you have only used spreadsheets for data processing so far, you should read chapter 1.2. Database and spreadsheet. +If you feel that while using spreadsheets some activities, like entering the data, are too tedious and time-consuming, and final result contains hard-to-find errors, then Kexi could be a good solution for you. +Even if you use only a small part of functions provided by Kexi, your data stored in a form of database will probably be more legible and easier to comprehend for your coworkers. +
++If you have previously used applications with a graphic user interface (which is highly probable), using Kexi should be easy since it is in many ways similar. +
diff --git a/kexi/doc/handbook/html.tmp/02_04_00_differences.html b/kexi/doc/handbook/html.tmp/02_04_00_differences.html new file mode 100644 index 00000000..6e0c3ccd --- /dev/null +++ b/kexi/doc/handbook/html.tmp/02_04_00_differences.html @@ -0,0 +1,103 @@ ++English terms are bracketed. +
++
Kexi | MS Access | dBase i FoxPro | Paradox | +
---|---|---|---|
Database (Database) | Database | Catalog (Catalog) | Directory of Related files (Directory of Related files) | +
Table (Table) | Table | Database file (Database file) | Table | +
Datasheet (Datasheet) | Datasheet | BROWSE Command | View Command | +
Table design (Table design) | Table design | MODIFY STRUCTURE Command | Modify Restructure Command | +
Primary key (Primary key) | Primary key | Unique Index | Key field | +
Index (Index) | Index | Index | Tools QuerySpeed | +
Validation rule | Validation rule | PICTURE/VALID Clause | ValChecks | +
Query (Query) | Query | Query, QBE, View | Query | +
Form (Form) | Form | Screen | Forms | +
Subform (Subform) | Subform | Multiple File Screen | Multiple-record selection | +
"Open a form" Command (Open a form | Open a form Command | SET FORMAT TO, EDIT Command | Image PickForm | +
Find command (Find command) | Find command | LOCATE AND SEEK Command | Zoom | +
List box, combo box | List box, combo box | Pick list | Lookup | +
Macro (Macro) | Macro | - | - | +
Script (Script) | Script | Program file | Script | +
+As you can see from the table above the terminology used in Kexi is close to the one used in MS Access application. +
+ ++
Kexi | MS Access | dBase i FoxPro | Paradox | +
---|---|---|---|
Text (Text) | Text | Character | Alphanumeric | +
Long text (Long text) | Memo | Memo | Memo | +
Date, Time (Date, Time) | Date, Time | Date | DateTime | +
Object (Object) | OLE Object (OLE Object) | General | OLE, Graphical, Binary | +
Yes/No (Yes/No) | Yes/No | Logical | Logical | +
Integer number (Integer number) | Number (Integer) | Numeric | Integer | +
Big Integer number (Big integer number) | Liczba całkowita długa (Long integer) | Numeric | Long Integer | +Floating-point number: Single/Double precision (Floating-point number) | Single/Double precision number (Single/Double precision number) | Float | Number | + +
Many applications such as OpenOffice.org or Microsoft Excel create files which are called documents. Kexi also creates files but we will call them Kexi projects or Kexi database files. +
+ +
+
+
Kexi project file on the desktop
+The name of the Kexi database file has extention .kexi both on MS Windows and Linux.
+
+In the K menu of the K Desktop Environment click Office folder and then click Kexi entry. +
++You may also run Kexi from command line (e.g. using Konsole application or hotkey Alt+F2) and entering: +
++kexi ++
+See chapter 6.4. Using the command line. +
+ ++Choose Applications from menu Start and Kexi folder. Click Kexi shortcut. +
+ ++In folder Applications click icon Kexi. +
diff --git a/kexi/doc/handbook/html.tmp/04_03_00_creating_database.html b/kexi/doc/handbook/html.tmp/04_03_00_creating_database.html new file mode 100644 index 00000000..aa27e210 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/04_03_00_creating_database.html @@ -0,0 +1,18 @@ +
+Run Kexi (see Running Kexi). You will see the following window:
+
+
+
Kexi startup window
+
+
Click Ok button to run the creation of a new project.
Click Cancel button or press Escape to close window. You will see an empty application window (only menu). +
+
+ + diff --git a/kexi/doc/handbook/html.tmp/04_04_00_project_opening.html b/kexi/doc/handbook/html.tmp/04_04_00_project_opening.html new file mode 100644 index 00000000..65da0854 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/04_04_00_project_opening.html @@ -0,0 +1,59 @@ ++To open an existing Kexi database file: +
++
+ + + ++
+Run Kexi application (see Running Kexi). You should see "Choose Project" startup dialog window. Choose Open Existing Project tab. You will see following dialog:
+
+
Startup window: Open Existing Project tab
+
From Look in drop down, pick a folder containing a file you are looking for. +
Pick a file, you want to open ir enter its name using the File name box. +
Click OK button. +
+
+Click file's icon using your file manager or desktop: +
+ ++Kexi will open this database project automatically. +
+ ++
Note about databse files accessed remotely. You may want to open a database file that is located on a remote source (e.g. an web or FTP server or MS Windows share). K Desktop Environment allows you to open files from remote sources directly in applications and saving changes back to the source, but this is not the case with database files. By clicking on a database file located on a remote source, you will cause a download the file to a temporary directory on your computer and all eventual your changes will be made to this local file. The remote original of the file will remain unchanged after you close Kexi, so it's recommended to copy (download) the file to your computer first, then open the file and copy it back to remove source if you want to make it up to date.
+Following ways to get built-in help in Kexi are available: +
+
+
Kexi's main window
+
+Main elements of Kexi application's window are:
+
Menubar - contains available commands for the application. You will find detailed description of any of the commands in Appendix ??. +
Toolbar - contains most frequently used commands. +
Opened database objects area - a central area of the application taking most of the screen space. For IDEAl user interface mode it contains a switchable tabs with windows that are always maximized. For Childframe user interface mode it contains floating windows. +
Properties pane - contains a list of properties of currently activated database object. For certain objects (e.g. form's widgets) it can be consisted of several tabs. +
Taskbar - contains a list of currently opened windows with database objects. For IDEAl user interface mode, it is available as a number of tabs. For Childframe user interface mode, it is available as a number of buttons, behaving just like your operating system's taskbar. +
+Project Navigator pane is one of the most frequently used elements of the Kexi main window.
+The pane contains a list of all objects created within the currently opened Kexi database project. The objects are splitted into groups: tables, queries, forms.
+
+
+Project Navigator pane also contains a small toolbar for most frequently used commands (from left to right): Open selected object, Design selected object, Create a new object, and Delete selected object. +
+
+
+
A toolbar in the Project Navigator pane
+
+
+
+For each object on the list context menu is available using the &RMB;. For example, this is context menu for persons table:
+
+
Project Navigator pane's context menu
+
+Commands of this menu is documented in Appendix A.10.
+
+See also a list of available shortcuts in Appendix B.2. Project Navigator pane . +
+ ++Double clicking with &LMB; on the object's name on the list allows to open the object in Data View. If the object's window was alread opened, the action just activates the window without switching it's view mode. +
++Note that your operating system can be set up to handle single clicks instead of double clicks. In this case it is enough to single click on the object name to open it's window. + +
diff --git a/kexi/doc/handbook/html.tmp/04_06_02_object_windows.html b/kexi/doc/handbook/html.tmp/04_06_02_object_windows.html new file mode 100644 index 00000000..42bd0a08 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/04_06_02_object_windows.html @@ -0,0 +1,35 @@ ++To open a database object in a window: +
Select the object in Project Navigator pane
Click Open button on the Project Navigator pane's toolbar.
+When the IDEAl user interface mode (the default) is used, each window has it's own tab. Move the mouse pointer to the tab. You will see close button. Click it to close the tab. +
++In the Childframe on the right hand of each opened window there are buttons you can use to control the window. Click the first one on the right hand to close the window. +
++Alternatively, regardless of the user interface mode you are using, you can select Window ->Close from the Menubar. +
+ +
+
+
Window's buttons
+Other button's (from right to left) can be used to: maximize, minimize and undock the window.
+
+There's a small icon on the left hand of the window which can be clicked to show a context menu with commands related to the window. +
++See also 8.2. Docking and undocking of the windows. +
diff --git a/kexi/doc/handbook/html.tmp/04_06_03_property_editor.html b/kexi/doc/handbook/html.tmp/04_06_03_property_editor.html new file mode 100644 index 00000000..d823c056 --- /dev/null +++ b/kexi/doc/handbook/html.tmp/04_06_03_property_editor.html @@ -0,0 +1,44 @@ ++The Property Editor pane allows to change properties of object displayed in the active window. Depending on the context, the pane is consisted of one or more tabs. The first, always visible, Propertiestab contains the list of available properties. +
+
+
+
Property Editor
+
+Rules for using the Property Editor: +
++
+Property Editor pane is empty if: +
+See also the list of keyboard shortcuts available for the Property Editor pane in appendix B.3. Property Editor pane. +
diff --git a/kexi/doc/handbook/html.tmp/05_00_00_idx_building_simple_database.html b/kexi/doc/handbook/html.tmp/05_00_00_idx_building_simple_database.html new file mode 100644 index 00000000..77be8d8c --- /dev/null +++ b/kexi/doc/handbook/html.tmp/05_00_00_idx_building_simple_database.html @@ -0,0 +1,18 @@ + ++ To learn basics of Kexi usage, first you could build a simple database utilizing most elementary Kexi's features. To make things simpler, advanced database design topics will not be covered here. +
++Start by creating a new empty Phone Book. See chapter 4.3. Creating a new database project for information how to do this. +
++Having a new empty database project, perform the following steps: +
+First, there will be two tables added to your database: persons and phone_numbers. These are exactly the same tables as described in chapter 1.2. A database and a spreadsheet. A layout for Persons can be found in section Data integrity and validity in that chapter. +
+ ++
+Select Insert->Table from the Menubar. You can also use button + Create object: table on the Project Navigator's toolbar (see section 4.6.1. Project Navigator pane). +
+Table Designer's window will appear. Looking at the top of designer's window you will notice that Kexi proposed you a generic name like template for the new table. The table design is not saved yet so you will be able to assign more proper name later. Moreover, because of the same reason, the table name is not yet visible in the Project navigator. +
+Table Designer window consists of following columns: +
+In Table designer window, every row corresponds to a single table field. You can recognize you are in design mode because the
+To start entering the Persons table design: +
In the first row click on the cell in Field name column and enter name field name.
+
+
Entering names for table fields
+
+
+Use down arrow key to move to next row. In the Data Type column, Text type appeared automatically. This is what you actually expected since a person's name should be in fact of type text. +
+In a similar way, enter the following fields into the table design: +
+All above fields except house_number are of type text. Change house_number field's type to integer number. To do this, click on a cell in the Data Type column, house_number row and then click on drop down list's button (you can also press F4 or Alt+Down arrow keys). The list of data types will appear. Select Integer number type.
+
+
Changing data type of a filed to integer number
+Since now, house_number field only acepts numbers.
+
+Persons table desgin is ready. Click
+As the design is not yet saved in the database, "Save Object As" dialog window appears. You need to specify the name for the new table.
+
+
Entering table name before saving its design
+
+Kexi offers a generic name like Table1. To change the name, enter Persons into the Caption field and press Enter key or click OK button. Caption field will be used to displaying the table to database end-users, e.g. as a form. Unlike the name, the caption can contain any characters including spaces a special characters.
+
+
+Note that filling Caption field automatically fills Name field. For your convenience the rule for using only latin letters, digits and the "_" character is kept. You can alter contents of the Name field if you want to.
+
+
+
Example of automatically filled Name field
+
+You are asked about an agreement for automatic adding of primary key to the table. The idea of primary keys is described in chapter 6. Click Add primary key button to continue.
+
+
A question about automatic adding a primary key
+
+Persons table has been created and opened in Data View. Its name appears in the Project Navigator pane.
+
+
Persons table in the Project Navigator pane
+
+Create phone_numbers table, in a similar way as persons table. +
+Create person field of type Integer number and phone of type Text. Do not use a number type here because phone number can have many different forms and prefixes. +
+Click
+You have designed two Persons and phone_numbers tables. Both contain no data yet. You can enter some. In this chapter you will learn how to do this fast and effectively. +
++
+Start with persons table. Open it in Data View using Project Navigtor. +Current cell is marked with (usually black) rectangle, a cursor. Contents of the cell, if exists, is highlighted with a diferent color. Current row, i.e. the one you have placed your rectangular cursor in, is marked on the left hand using with an arrow symbol . +
+You can navigate through table cells using mouse or arrow keys, Page Down, Page Down, Home, End keys. To learn more about available of the key bindings for the data table view, see the section B.4. Data Table in the Appendix B. Key Bindings. +
+
+Initially, after opening table Persons, the cursor is placed in the id column. The column has autonumber property defined, marked with blue (autonumber) text in the last row. That means you do not have to enter values there by hand when entering data for a new row because the cell will be filled automatically with successive numbers.
+
+
Data entry
+
+Inserting new rows and entering data for them in &kexi; is different from the way of doing this in spreadsheets.
+To enter data for a new row, you need to use the arrow keys or mouse, to move your cursor to the special empty last row marked with
+Fill the phone_numbers table with data, e.g. similar to provided in the figure below. In the persons column you need to provide a number of the person existing in the persons table.
+
+
Example contents of the phone_numbers table
+
+A database's primary purpose is to store and help extracting information you are looking for. Unlike databases written on a paper sheets, Kexi database allows you to specify for much more search criterias. Results are returend faster without much dependency of. This all is a power of databases, however to be able to perform efffective queries in your database, you need to learn how to tell the database what are you looking for. +
++With database queries you can limit data coming from a table to a predefined set of rows and columns as well as dynamically join data coming from multiple tables. +
++To see how queries work in practice you will create contacts query joining data from two tables persons and phone_numbers designed in chapter 5.1 and filled with data in chapter 5.2. +
+ ++
+Create a new empty query by selecting
+Select table persons in the drop down list Table: located at the top of the window and click Add button. A graphical representation of the table will appear in the the relations area. Do the same for phone_numbers table to insert it too, as in the figure below.
+
+
contacts query design
+
+Add query relationship using mouse drag & drop technique: click the field id in the table persons table, drag it and drop onto the person field of the phone_numbers table. This will join both fields by creating a new relationship. +
+Doube-clik the name field in the persons table, to add the field as a query column. In a similar way, add surname, street, house_number, city fields from the persons table and phone from the phone_numbers table. +
+Query design is now ready to test it. Click
+
Contacts query results
+
+
+ + ++
+
+Container widget - a widget that can contain other widgets within its area. For example, frame widget or tab widget are containers. Form's surface itself is a container as well. Command button cannot be called as container because it is not possible to insert a widget inside it. In more complex cases, container widget can be inserted inside a container, so nesting is possible.
+
+
+
Example container widgets
+
+In chapter 5.2 you learned about how to enter data directly into tables using their data sheet view. However, in many cases forms are better suited for data entry: +
+As with table or query design, you are able to use Data View and Design View. Form designing is performed in Design View. We will ofter refer to form design window as to Form Designer. +
++As with table design, Form Designer provides Property pane. To save some space on the screen, the pane has been splitted with three tabs related to the currently selected form: +
+Additional toolbars are also available: +
+The "Widgets" tab in the Property pane provides a list of form widgets and their hierarchy. Each widget is presented within the hierarchy beside other widgets being on the same level (the same parent container). Child widgets (inside containers) are presented using indented names. +
+ +
+On the picture below, the form (a container) contains two widgets: "groupBox2" and "options" command button. In turn, "groupBox2" (being a container itself) contains two check box widgets.
+
+
+
Using the "Widgets" tab
+
+Each widget has displayed its name and type. The type has also an icon displayed - the same as the one displayed on the toolbar used while form designing is performed.
+
Let's create a form providing information about persons, i.e. a form connected it with Persons table. +
++If the form being designed should present data obtained from the database, you need to place appropriate fields on it. To do this, use Widgets toolbar containing a set of togglable buttons. Each button corresponds with a single widget type. +
+ ++
+
+The fields you inserted have no data source assigned yet, so these are not able to display information from the database. To assign data source,
+The very first step is to specify the form's data source, i.e. a place the displayed data will be fetched from. As mentioned above, you will use table persons as a data source for your new form. +
+ ++
+You have assigned form's data source. Now you need to do specify field widget's data source. +
+ ++
+You can now save the form's design (this is not mandatory to test the form in action). To save, click the
+It is right moment for testing your form. Click the
+
+
The Persons form in data view after inserting text fields and assigning data sources
+
+
+To make it easier for the form's user to identify meaning of every field widget, these should have added text labels with appropriate titles. To create text labels
+Insert three text label widgets onto the form, placing them on the left hand of the text fields (or on the right hand if your operating system uses right-to-left layout). On inserting every new label, a text cursor appears inside where you can enter desired title. Enter consecutively: Name, Surname and Street. Additionally, on the top of the form insert another label displaying name of the form, i.e. "Persons". Enlarge this label's size and set larger font using Format -> Font menu command. +
+
+
+
Ready to use form after adding text labels
+
+Action is a single activity isolates in the application, available for user to execute. It can be also executed automatically as an reaction for a given event (e.g. after opening a form). +
+ + + ++Most actions can be assigned to form button. Assigned action is executed after button is clicked. +
++To assign action: +
+
+
Assigning "Delete Row" action to a form's button
+
+After switching to the form's data view you can try whether the action works. For example, if you assigned "Delete Row" action, clicking the button, the current database row will be deleted, similarly to executing Edit > Delete Row menu command (depending on your settings you may be asked to confirm the removal). +
++In most cases form widgets should be reasonable placed and aligned. Positioning, aligning and resizing widgets by hand is not easy and these parameters are not adjusted when the user resizes the form. In fact the situation is even worse because you cannot assume a given form requires a given space because users have different font sizes and display resolutions. +
+
+The following example presents a form where text fields and labels were placed by hand. Some of them cannot fit in the form's window.
+
+
An example form with widgets that cannot not fit in the window
+
+Using special tool called widget layouts can help to automatically lay out the form widgets. Widget layout is an action of grouping two or more widgets so these are well positioned and have appropriate sizes. +
+
+Using layout in this form improves alignment. Moreover, its space is better developed. Text fields are closer each other, spacing is constant.
+
+
+
Example form with layout used
+
+There are two methods to create widget layout. +
+
+
Selecting widgets that will be put into a layout
+
+
Four widgets are selected
+
+
Using the context menu for putting the widgets into a grid layout
+
+Widget layout is presented in the design view using a blue, green or red box drawn with broken line. This line is displayed only in the form's design view. +
+
+
+
+
Widgets within a grid layout
+
+Besides the grid type, there are other widget layout types. +
+A spring in widget layouts is a special, invisible element allowing to adjust widget's position and size within layouts. Such a spring stretches or squeezes a widget on the right, top, bottom or left hand, so it can have desired size and position. +
+To use a spring: +
+For the following example, the spring has been inserted on the left hand of the text label "Persons". The label is thus displayed on the right hand of the form. To make the spring work, it has been put into a common horizontal layout with the label.
+
+
Horizontal layout containing a spring and a text label
+
+To make springs work you need to create a global widget layout i.e. a layout for the form itself. Then, springs can use edges of the form as a boundary for expanding. +
+ + ++Widget layouts can be combined (or nested). On the following example you can identify two nested layouts: +
++
+
+
Two widget layouts combined: horizontal layout inside of a grid layout
+
+The horizontal layout is treat in the example as a single widget by the grid layout - it takes exactly one "cell" of the grid. +After opening a form designed this way in the data view, you can notice (by resizing the form) that: +
+
+
+
The form using the two layouts displayed in data view
+
+To remove widget layout without removing widgets, perform one of these actions: +
Removing widget layout using the Break Layout command will not remove widgets contained in the layout. If you want to remove the widgets as well, just select the layout by clicking on its border and press Delete key or use
+Instead of setting a fixed size for your widgets, in &kexi; you can choose between various widget's size policies. A size policy is a flexible strategy for controlling how a widget is stretched (or shrunk) depending on other neighbouring widgets and space available within the form. +
++After putting widgets into a layout, typically each widget gets a proportional (Preferred) size policy. These widgets will be automatically resized with preferred settings, depending on their type and size of the entire layout itself. For example, three buttons put into the horizontal layout will be resized to fit their visible text. +
+
+For each widget inserted into the form, there are settings for size policy available in the Property Editor. The settings are presented as a group of properties called Size Policy.
+
+
+
A group of properties for defining a widget's size policy
+
+This group of properties contains:
+
+There are following values available on the drop down list for Horizontal Size Policy and Vertical Size Policy properties visible in the Property Editor: +
+Minimum value means that the original size of the widget is set as minimal allowed, it is sufficient and there is no need for expanding the widget, but the widget will be expanded if needed. This type of policy can be used to force widget to be expanded to the whole width or height, especially if you set a stretch value greater than 0.
+
+
Text field and two buttons within a grid layout (Minimum horizontal size policy is set for both buttons, so these are slightly wider than needed)
+
Preferred value means that the original size of the widget is the best and preferred; the widget can be shrunk or expanded however and it will stay readable,
+
+
Text field and two buttons within a grid layout (Preferred horizontal size policy is set for both buttons)
+
+
+The most frequently used size policies are Preferred, Minimum and Maximum. +
+ +
+Vertical Stretch and Horizontal Stretch properties accept integer values greater or equal to 0. These properties allow to fine-tune the behavior of size policies. Default value for the properties is 0. Greater value of the stretch means that the widget will be expanded more than other widgets having smaller stretch value set. For example, the following image presents two buttons where the first button has Vertical Stretch set to 0 and the second button has Vertical Stretch set to 1.
+
+
+
Size of button widgets affected by setting Vertical Stretch property of the second button to 1
+
+
+In case when your form has no main layout set for auto-positioning and auto-resizing its widgets, you will probably want to align widget's position and size so the form can look cleaner and be easier to use. The &kexi; form designer simplifies this task by offering the following groups of commands: +
+Adjusting sizes of selected widgets. The commands are available in the Format -> Adjust Widgets Size submenu of the Menubar and in the Adjust Widgets Size submenu of the context menu. Toolbar's drop down button
Aligning positions of the selected widgets. The commands are available in the Format -> Align Widgets Position submenu of the Menubar and in the Align Widgets Position submenu of the context menu. Toolbar's drop down button
+ None of the above commands resizes the widgets. +
+
+There are also additional commands available:
+
+Widget's focus determines widget's activity available using keyboard. Focus is related to widgets displayed in form's data view. Exactly one form widget can have focus at the same time. Most frequent use of focus is text entry (when a given text field is active, i.e. it is focused). Other example is a button widget - when focused, it is possible to "press" it using the Enter or Space key instead of a mouse button. +
+There are a few methods of making the widgets active (moving the focus to the widget): clicking with a mouse button, rotating the mouse wheel over the widget, or using the Tab key. The latter method is often used because of it's speed and convenience for users. Availability of the focusing methods is controlled by Focus Policy property of a given widget. +
++There is relationship between focusing (activating) widgets using Tab key and tab order setting of a form. After pressing the Tab key, the next widget should be focused, so the form should know about the tab order.
++To alter table order for a form's widget: +
+The window contains a list with two columns: the first column displays widget names, the second - types of the widgets. To make it easier to recognize meaning of the names and types for the user, icons related to the types are also displayed. The list contains only widgets having focus policy allowing to use the Tab key. +The window allows you to change tab order or set the automatic tab order. +
++To change tab order, either: +
+Data entering and editing is usually database application user's task, not developer's. In practice it is desirable to check the form in terms of valid data entry, and see whether the form works as expected. +
++To test your form, switch to its data view. A single database row (record) of data will be displayed and a text cursor will be set inside the first data field. You can move between fields using &RMB; or Tab and Shift+Tab keys. While editing, there will be pencil icon visible near the record navigator. After entering row's (record) data you can press Shift+Enter keys or toolbar button to accept changes made to the current row. Clicking toolbar button discards changes made to the current row and restores contents of the data fields. You can use record navigator's button to move to a new row. All the navigator's functions are also available in similar way as in the data table view. + +
++
+ + diff --git a/kexi/doc/handbook/html.tmp/08_00_00_kexi_tuning.html b/kexi/doc/handbook/html.tmp/08_00_00_kexi_tuning.html new file mode 100644 index 00000000..ad577cbb --- /dev/null +++ b/kexi/doc/handbook/html.tmp/08_00_00_kexi_tuning.html @@ -0,0 +1,11 @@ ++Kexi application has a customizable user interface allowing the user to adjust it to his preferences. +
++
+MDI (Multiple Document Interface) modes enable the user to choose the way to manage the aplication's widows. You can choose one of two modes according to your preferences - it will be also used next time you run the application. +
++The change of MDI mode is possible using the MDI mode command from the Window menu bar. +Following modes are available: +
+To undock a window you must drag it from the inside of the Kexi application and drop it so that you can e.g. maximize or move it freely. This is particularly useful when working on a small screen or when working with large datasheets. Undocking can also be used when working on two display monitors connected to one computer: you can move selected windows to the other display. +
++Docking is a command opposite to undocking: the window is placed back inside the application. +
++Docking in windows is available only in childframe mode of the graphic interface. The command is always available in case of panes. +
++The Dock/undock command is also available: +
+This option allows to change the shortcuts in Kexi application. To do this, use the Configure Shortcuts command from the Settings menu.
+
+
+
Shortcuts configuration dialog box
+To confirm the introduced changes click OK button. Changes are permanent which means that they will also be available next time you run Kexi application.
+
+Available actions: +
To quickly change a command type its name in the Search radio button.
Click the Defaults button at the bottom of the dialog box to restore standard shortcut settings for Kexi application.
Select the requested command from the list and select the None radio button to remove a shortcut for this command.
Select the requested command from the list and select the Default radio button to restore the standard shortcut for this command. Shortcut description will appear at the bottom of the dialog box.
Select the requested command from the list and tick the Custom radio button to change the shortcut for this command. Shortcut configuration dialog box will pop up:
+
+
Shortcut configuration dialog box
+ You can provide one or two shortcuts.
+
+ Available actions: +