Create Toolbar

A toolbar normally contains a selection of often used action that are also defined as an action in the pulldown menu. Toolbars are created in the painter and are push buttons with an action handler attached.

Open the screen "Main" in the painter in the ProLinga Developer. We reserved 2 places on the toolbar. We first have to place buttons in those empty slots. Select "Button" from the palette and click on the empty space on the toolbar. It now should put a button in place. Repeat that for the second button.

Figure37.Toolbar With 2 Buttons

Screenshot of the toolbar after placing 2 buttons.

The first button we want to name "Home". The painter comes with a range of icons that can be used on buttons like this. They are called "Stock Buttons". If you click on button 1 on the toolbar you can select the "Stock Button" called "Home" in the Properties Window.

Figure38.Select Stock Button

Screenshot of how to set a stock button.

The action handler that we want to link to this button is the same as the one we linked to the pulldown menu "Home" which is "L-Home". This will call ProLinga logic with the name "Home" when the user clicks on it. To set the action handler, stay in the properties window and click the tab Signals. In the field "Signal" we can define a signal that will trigger the call to our logic "Home". If you press the "..." button next to the field, you will get a list of possible actions. We want this to take place if the user clicks the button. Therefore we select the action "clicked". The handler is, like in the case of the pulldown menu, L-Home. After you have typed then in, you have to press the button "Add" to add this new entry to the list.

Figure39.Link Signal To Toolbar Button

Screenshot of how to link a signal to the button.

The second button will be called "Quit" and the action handler is "C-exit". There is a "Stock Button" for this as well. If all went well, your screen now looks as follows in the painter:

Figure40.Finished Toolbar

Screenshot of a finished toolbar.

Save the screen in the painter, exit the painter and save the screen in the Screen Editor. Run your application and test the toolbar.

Figure41.Finished Toolbar At Run-Time

Screenshot of application at run time with finished toolbar.