Enabling and disabling clipboard operations
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
You can enable and disable clipboard operations based
on the type of widget that currently has the input focus (FOCUS:TYPE attribute).
For example, you might disable the pasting (inserting) of values
into a selection list, but enable the copying of selected items
from the list. You typically configure your clipboard operations in
the trigger block of the MENU-DROP event for your Edit menu.
This ensures that you enable or disable menu options based on the
latest selection action that the user has committed in the current
input widget (for example, selected a radio set or a range of text
in an editor widget).
The following code example suggests a possible scenario for enabling
and disabling cut, copy, and paste operations. It defines an Edit menu
(EditMenu) with Cut, Copy,
and Paste options assigned to the corresponding
menu items EM_Cut, EM_Copy, and EM_Paste.
When the user opens the Edit menu (ON MENU-DROP
OF MENU EditMenu), the code determines the available options
from the state of the field-level widget that has the current input
focus.
For example, if an editor widget has the input focus (FOCUS:TYPE
= "EDITOR"), then the Cut and Copy options are available
only if the user has text selected within the widget (LENGTH(FOCUS:SELECTION-TEXT)
> 0). If a radio set, selection list, slider, or toggle
box has the input focus, then only the Copy option is enabled. You
could make the Cut and Paste options meaningful for radio sets and
selection lists, for example, by recreating dynamic radio sets or
removing and inserting items in selection lists.
Although these topics provide useful examples, your code to determine the available clipboard operations can vary widely depending on your application. For example:
|