How Do I...

Example: Add popup menus

Add pop-up menus No tip for this topic No example for this topic Display message boxes

The text editor example has four choices on its Edit pull-down menu that would be useful to have on a popup menu.

Adding a popup menu

To add a popup menu that has the four choices:

  1. Select Popup Menu icon (Popup Menu part) from Menus category icon (Menus category).
  2. Click on the free-form surface.
  3. Put a check mark in the Sticky check box.
  4. Select Menu Choice icon (Menu Choice part).
  5. Click four times on the Popup Menu part.
  6. Click on Selection tool (Selection tool) to de-activate the Sticky.
  7. Change the labels of the popup menu choices to Cut, Copy, Paste, and Select all.

Adding a separator

Next, add a separator between the Paste and Select all choices.

Separator icon (Separator part) is in Menus category icon (Menus category).

Adding the connections

Finally, add the connections. Connect the clicked event of each menu choice to the following actions:

Menu choice
Target action

Cut
Multi-line Edit's cutSelection

Copy
Multi-line Edit's copySelection

Paste
Multi-line Edit's paste

Select all
Multi-line Edit's selectAll

And, connect the popup menu's self attribute to the Multi-line Edit's menu attribute.

Now you're done! Select Test (Test tool) and try out the menus. Then, save the part.


[ Top of Page | Previous Page | Next Page | Table of Contents ]