Kushal Tutorials - Document

Desktop Application Development Tutorial | Create Menus & Forms

Kushal Tutorials - Create Menus & Forms in Desktop Applications

In the previous section, you have already created a Project in Kushal. Now, you can add functionality to the Project by adding Forms and Menus.

First, let us Create Forms.

Creating Forms in Desktop Applications

When you create a Project, Kushal will automatically create some default forms. These can be viewed by enabling 'Show Default Forms' check box. Note that Kushal has already created many forms. You are allowed to change only the design of the default forms or its controls, like re-positioning controls, captions, and image changes and so on.

You can turn off Default Forms option and focus on Creating New Forms which are specific to this Project

Click on 'New Form' - A window opens, where you will be able to select the type of form that you want. Kushal offers many types of Forms which find application depending on varying requirements.

Select form Type as "Table-Detail Entry". Select the table name as "Contact Master". The primary key is already set. Click on Create.

In the next window "Control Type Selection", based on the datatypes of the columns, you can set the Control Type as Dropdown, Checkbox, Radio Button, or keep it as default type.

In this form, Since Salutation and Relationship will fetch values from other tables, you have to change the control type to Drop Down Type.

A New Form will be created with all the required buttons such as " New", "Save", "Delete", "Search" & "Export". All of them will have predefined actions. You can delete them if you don't need them, or change their properties if required.

Then, choose the salutation dropdown and select the SQL property. Enter "Select Salutation from Salutation" as SQL Statement, to fetch records from the salutation table.

In the same way, you can configure the relationship dropdown.

If you need to add more relationships, you can do that through the Relationship form.

Create the new form "Relationships" in the same way as the form you just created. You can also access this form directly from the "Contact Master" Form. To do this, add a button, and configure its properties. Change the Action type as "Show Form Refresh" property. Then, in "Form Name" assign "Relationship". Set the input control by choosing the "Relationship" dropdown.

Similarly, you can Create the "Salutation" Form.

Next, you can add a 'Search' Form - Since one of the requirements is to Search Contacts depending on Inputs provided.

You can click on 'New Form' in Forms Tab and Select 'Advanced Search Form'. Click on 'Create', and in the window that opens, click on "Show Query Builder button". The Query Builder window opens, where you can see the database structure. You can easily create a query. Double click on 'Salutation' table, The table is added, and a query is created. Click copy to clipboard button, close the Query Builder and Paste the query in the 'Advanced Search Query' Window. Click on 'OK'. Select the fields and click on 'hit' button, and then click on 'ok'. In the Advanced Search Text Configuration, select the control Types as explained earlier, and click on 'Ok'. Your Advanced Search Form is Ready.

Kushal will create an Advanced Search form. Further changes can be done here but You can just go ahead and assign it to Advanced Search form. Click on the form, and in 'Form Properties', under Miscellaneous Properties, select the "Search Form".

Now, You have completed designing all Forms.

Now you can design the Menu Items.

Designing Menus in Desktop Applications

You will require only 3 Menu Items in this application.

  • Salutation.
  • Relationship.

• Contact Editor.

Select 'Menu Definition' Icon from the Ribbon in Kushal.

Click on 'Add Root Menu' a New Menu will be created. Now click on the 'Rename' button and call that menu as 'Main'.

Right Click on 'Main' Menu and then Click on 'Add Sub Menu' and Create the 3 required Sub Menus - 'Salutation', 'Relationship' and 'Contact Editor'. Now since you have not yet designed Forms, you will not be able to assign any functionality to menus.

Using arrow buttons provided on the right side of the Menu designer, it is possible to move the menu items up and down and also change the Menu Level.

As you change the menu Items, Menu gets changed in this window. You can get a preview of your menu design in the same window.

How to Assign Forms to Menus?

You can now assign Forms to Menus. Come back to Menu Definition Screen. Select 'Salutation' and Right Click and click on "Associate Form". Click on Application Forms button, and in the window that opens, click the "Generate Automatically" button. This is a one-time procedure, whenever a new form is created.

Here, all forms created will now be generated. Close the window, and in the 'List of Forms' window, click on the Form which you want to associate, and click 'Associate' button. Here, associate the 'Salutation' Form.

In the same way, you can associate other forms to menus items.

Now you are ready to build the application.

In the next section, You will learn to generate the Application in Kushal.

Thank you.