Hyderabad Jobs Book Website FREE PowerBuilder Training I Love Hyderabad Hyderabad Colleges
Home Business Emails Hyderabad Classifieds Contact Us
7 Wonders of Hyderabad Web Hosting Yellow Pages Our Network

 
Webpowerbuilder.hyderabad-colleges.com

Introduction to PowerBuilder

HomePrevious Lesson: Menu Painter
Next Lesson: Menu Properties

Types of menus

You can create three different types of menus in PowerBuilder:
DropDown menus
Cascading menus
Popup menus

DropDown Menus

DropDown menus are displayed when you select an option from a menu bar which is on the top side of a window. The available options are grouped into logical collections and the group names are displayed horizontally on the menu bar. The following picture illustrates a typical DropDown menu.

Selecting a menu option which has … (ellipses) would bring up a response window for getting more information. For example, selecting the "Printer Setup" menu option would display Printer Setup dialog box which is a response window (You cannot do anything in the application unless you close the response window).

Some of the menu options work in toggle mode, i.e. clicking on a menu option would turn it and selecting it again would turn it off. An example of it would be the Print Preview option. When you select it for the first time, the report is displayed in the preview mode and by selecting it again the report is displayed in the normal mode. The current state of the toggle menu options are displayed by a check mark just before the menu option (see in the picture).

Cascading Menus

A Cascading menu can display more menu options than a DropDown menu. In simple terms, if a menu option has a sub menu, it is called a  Cascading Menu. As you must have noticed, in the window painter all aligning options are available under the Align menu option which is under the Edit option. You can identify a cascading menu when you see a right arrow icon next to the menu option. Clearly, Cascading menus are usually used in conjunction with the DropDown type menus.

Popup Menus

A Popup menu is displayed in response to a specific event. Unlike DropDown menus a Popup menu is not displayed at a fixed place, but it pops up at the current mouse position. Clicking with the right mouse button invokes the popup menu. Programmatically, you can activate a popup menu for any event, but the usual way of activating popup menus is with the right mouse button.

Similar to the DropDown and Cascading menus, Popup menus use the ellipses, right arrow head and check mark conventions. However, Popup menus are more versatile than other menus, since they don't have to be associated with any particular window and can offer different options depending on the object and the position of the right mouse button.

Creation of a popup menu is no different from other menus, except that you need to write few lines of extra code to invoke it.

Creating a Menu

Invoke the menu painter from the Painterbar and select New from the Select Menu dialog box.

Items that are displayed horizontally, such as File, Edit, Window, Help are called Menu bar items. Items that belong to menu bar items are called Menu Items. For example, you may want to display Print, Exit for the File menu bar item and Cut, Paste for the Edit menu bar item and so on.

You need to type Menu bar items in the Edit Control that is placed above 'Menu For' heading. After typing each item, you need to scroll the scrollbar that is placed after 'Menu Bar Items' heading, by clicking on the right arrow. To create a menu with two menu bar items 'File' and 'Help', first type 'File' and click the right arrow on the scrollbar and type 'Help' in the Edit Control.

Now, you might want to display 'File', 'Exit' under the 'File' menu bar item. To do this, make the 'File' menu bar item visible with the help of the scrollbar and type one item per line under the 'Menu For' heading. You see two edit controls per line under the 'Menu For' heading. Leave the right side edit control empty ( PowerBuilder doesn't allow you to type there anyway ).
HomePrevious Lesson: Menu Painter
Next Lesson: Menu Properties

Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com