Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Defining the appearance of menu items – PB Docs 70 – PowerBuilder Library

Defining the appearance of menu items – PB Docs 70

Defining the appearance of menu items

You can use the Menu painter to change the appearance and
behavior of your menu and menu items by choosing different settings
in the tabbed pages in the Properties view.

For a list of all menu item properties, see Objects
and Controls

.

To do this Choose this tab
Specify the name of the menu item along
with its MicroHelp and tag
General
Specify the type of menu item and whether
it is checked, enabled, visible, shifted, or merged
General
Specify a shortcut key for the menu item General
Specify the toolbar entry for the menu
item
Toolbar
Associate a toolbar picture with the
menu item
Toolbar

All of these properties are discussed in the sections that
follow.

Setting General
properties

When you select a menu item and then select the General tab
page in the Properties view, you can set a variety of general properties
for the selected menu item.

Menu09.gif

Unlocking menu item names

For information, see “How menu items
are named”
.

Creating MicroHelp and tags

You can create MicroHelp Text and a tag for a menu item. MicroHelp
is a brief text description of the menu item that displays on the
status bar at the bottom of a Multiple Document Interface (MDI)
application window. You can quickly add MicroHelp text to any menu
item in your application. A tag is a text string that you can associate
with an object and use in any way you want.

proc.gif To create MicroHelp text:

  1. Select the General tab in the Properties view.

  2. Select the menu item for which you want to create MicroHelp.

  3. Enter the MicroHelp text in the MicroHelp edit control.

For information about defining MicroHelp text
and tag properties, see the chapter on building MDI applications
in Application Techniques
.

Setting the appearanceof a menu item

On the General tab page in the Properties view, you can also
specify how a menu item appears during execution.

menu10.gif

Property Meaning
Visible Whether the menu item is visible. An
invisible menu item still displays in the WYSIWYG and Tree Menu
views, but during execution, it will not display. In WYSIWYG Menu
view, an invisible item has faded and dotted text.
Enabled Whether the menu item can be selected
Checked Whether the menu item displays with a
checkmark next to it
Default Whether the menu item text is bold. In
popup menu, Default indicates what action occurs if the user double-clicks
instead of right-clicks on an item. In dragging, Default indicates
what happens when an item is dragged with the left mouse button instead
of the right-mouse button
ShiftToRight Whether the menu item shifts to the right
(or down for a dropdown or cascading menu) when you add menu items
in a menu that is inherited from this menu. Selecting this property
allows you to insert menu items in descendent menus, instead of
only being able to add menu items to the end of menus in descendent
menusFor more information, see “About the ShiftToRight
property”
MergeOption The way menus are modified when an OLE
object is activated. Options are: File, Edit, Window, Help, Merge,
ExcludeFor more information, see the chapter about
using OLE in an application in Application Techniques
MenuItemType Whether the menu item you are creating
is Normal, About, Exit, or Help type

The settings you specify here determine how the menu items
display by default. You can change the values of the properties
in scripts during execution.

Assigningaccelerator and shortcut keys

About accelerator and shortcut keys

Every menu item should have an accelerator key,
also called a mnemonic access key, which allows users to select
the item from the keyboard by pressing alt+key
when
the menu is displayed. Accelerator keys display with an underline
in the menu item text.

note.gif

On UNIX On UNIX systems, users press meta+key
instead
of alt+key
to select
the menu item.

You can also define shortcut keys,
which are combinations of keys that a user can press to select a
menu item anytime.

For example, in the following menu all menu items have accelerator
keys (New’s accelerator key is N, Open’s is O,
and so on). New, Open, Close, and Print each have shortcut keys
(the ctrl key in combination with another key or
keys).

menu11.gif

You should adopt conventions for using accelerator and shortcut
keys in your applications. All menu items should have accelerator
keys, and commonly used menu items should have shortcut keys.

If you specify the same shortcut for more than one MenuItem,
the command that occurs later in the menu hierarchy is executed.

Assigning accelerator keys

proc.gif To assign an accelerator key:

  1. Type an ampersand (&) before the
    letter in the menu item text that you want to designate as the accelerator
    key.

    For example, &File designates the F in File as an
    accelerator key and Ma&ximize designates the x in Maximize
    as an accelerator key.

Assigning shortcut keys

proc.gif To assign a shortcut key:

  1. Select the menu item you want to assign
    a shortcut key to.

  2. Select the General tab on the property sheet.

  3. Select a key from the Key dropdown listbox.

    Menu22.gif

  4. Select Shortcut Alt, Shortcut Ctrl, and/or
    Shortcut Shift to create a key combination.

    PowerBuilder displays the shortcut key next to the menu item
    name.

Setting toolbar and picture properties

In an MDI application you can associate a menu item with a
button on a toolbar by performing two steps:

  • Associate the menu
    item with a toolbar button
  • Associate the toolbar button with a picture

You can specify whether the toolbar button will be visible
on the toolbar, its placement on the toolbar, and the pictures it
will use. You can also specify different pictures for the toolbar
button up and down states.

proc.gif To associate a menu item with a toolbar button
and picture:

  1. Select the Toolbar tab on the Menu painter property
    sheet.

    menu13.gif

  2. Enter the following information:

    In this box Do this
    ToolBarItemText Enter the descriptive text for the toolbar
    button. This text displays in the toolbar item when the application
    is running if the display text option is on for toolbars
    ToolBarItemName Enter the name of the picture you want
    to associate with the toolbar button’s normal state by
    selecting a stock picture or using the Browse button to associate
    a cursor, bitmap, or icon file
    ToolBarItemDownName Enter the name of the picture you want
    to associate with the toolbar button’s normal state by
    selecting a stock picture or using the Browse button to associate
    a cursor, bitmap, or icon file
    ToolBarItemVisible If you want the toolbar button to be
    visible, select the checkbox
    ToolBarItemDown If you want the toolbar button to appear
    pressed, select the checkbox
    ToolBarItemSpace Specify the amount of space you want
    before the button in the toolbar
    ToolBarItemOrder Specify the order for the button in the
    toolbar by entering a number. The default is to display buttons in
    the same order as in the menu
    ToolBarItemBarIndex Specify the number of the toolbar in
    which you want the toolbar button to appear
    ObjectType Select Menu or MenuCascade to specify
    the type of menu item the toolbar button is associated with
    Columns (This property only displays if you choose MenuCascade
    in the ObjectType dropdown listbox) Indicate the number of columns
    you want to display in the cascading toolbar
    Drop Down (This property only displays if you choose MenuCascade
    in the ObjectType dropdown listbox) If you want the button to be
    a DropDown toolbar button, select the checkbox

For information about defining toolbars and
picture properties, see the chapter on building MDI applications
in Application Techniques
.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x