12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Work<strong>in</strong>g with the Form Designer and the Menu Designer<br />

Batch Modification of Properties<br />

Sometimes you want to modify several menu items’ properties at one time. For example, we<br />

have a few menu items <strong>in</strong> the ScratchPad application that we are not ready to implement at<br />

this time. We aren’t ready for pr<strong>in</strong>t<strong>in</strong>g support, for <strong>in</strong>stance, nor are we ready to implement<br />

the help system. We need to gray out (disable) those menu items:<br />

1. Choose Help | Contents <strong>in</strong> the Menu Designer.<br />

2. Change the Enabled property to False. The menu item is grayed out.<br />

3. Click on the File menu.<br />

4. Click on the Pr<strong>in</strong>t menu item, hold down the Shift key, and click on the Pr<strong>in</strong>t<br />

Setup menu item. Both items are selected.<br />

5. In the Object Inspector, change the Enabled property to False. Both menu items<br />

are disabled.<br />

6. Repeat steps 4 and 5 to disable the F<strong>in</strong>d and Replace items on the Edit menu.<br />

You can modify a group of menu items at one time with this method. Simply select the items<br />

you want to modify and then change the property you want to modify. All menu items<br />

currently selected will have the new property value.<br />

Creat<strong>in</strong>g Submenus<br />

There’s noth<strong>in</strong>g special or tricky about creat<strong>in</strong>g submenus. A submenu is a menu item that,<br />

when clicked, expands to show more menu choices. A submenu is denoted by a rightpo<strong>in</strong>t<strong>in</strong>g<br />

arrow next to the menu item text. You can create a submenu by choos<strong>in</strong>g Create<br />

Submenu from the Menu Designer speed menu or by hold<strong>in</strong>g down the Ctrl key and press<strong>in</strong>g<br />

the right-arrow key. When you create a submenu, a blank menu item is placed to the right<br />

of the submenu. You can add menu items to the submenu just as you did when creat<strong>in</strong>g the<br />

ma<strong>in</strong> menu. You can create a submenu by <strong>in</strong>sert<strong>in</strong>g a menu template as well.<br />

Add<strong>in</strong>g Shortcuts<br />

You can easily add keyboard shortcuts to your menu items by chang<strong>in</strong>g the ShortCut property<br />

of the menu item <strong>in</strong> the Object Inspector. The Edit menu that we <strong>in</strong>serted earlier already had<br />

keyboard shortcuts built <strong>in</strong>. For <strong>in</strong>stance, the customary shortcut for Cut is Ctrl+X. If you<br />

look at the Edit menu, you will see Ctrl+X listed next to the Cut item. Click on the Cut menu<br />

item, and you will see that the ShortCut property says Ctrl+X. Click on the Value column<br />

next to the ShortCut property. On the right side of the Value column you will see a drop-down<br />

button. Click on the button to display the list of available shortcuts. The list you see there<br />

conta<strong>in</strong>s just about any keyboard shortcut you would need. To set the keyboard shortcut for<br />

a menu item, simply pick one of the shortcuts from the list.<br />

251<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!