‎2005 Dec 22 3:07 PM
In the SAP Text edit control (CL_GUI_TEXTEDIT) you can call via right mouse click a context menu.
I would like to know how is it possible to suppress the display of (i.e. I would like to hide) the system default values in this context menu?
The system default options are for example
CUT
COPY
INSERT
UNDO
RESTORE
FIND/REPLACE
FIND NEXT
LOAD LOCAL FILE
SAVE LOCAL FILE.
I would like to suppress (hide) them all but HOW?
It is possible to hide the toolbar, and I'm looking for a similar switch to hide all the default options.
I would like to show just my own entries/functions in the context menu.
Best regards and thanks
Hans-Ludwig
‎2005 Dec 22 3:10 PM
Use the event CONTEXT_MENU means : Define the class to handle the event, set the handler, and then baboum the code you'll put in the method that will be called when the event is raised will do the rest!
In your method :
modify the menu according to the needs
parameters of event is the ct_menu some methods are available...
DISABLE_FUNCTIONS
HIDE_FUNCTIONS
ADD_FUNCTION
can be called on the parameters of the event
thx for the reward
‎2005 Dec 22 3:18 PM
Hi,
this is exactly what I do.
In the event handler method you get a reference on the context menu object (class cl_ctmenu).
Unfortunetaly at that time it is empty. (The system default functions are not availalbe at that time.)
How can I find out the function codes related to the system default entries, so I can execute the HIDE_FUNCTIONS/DISABLE_FUNCTIONS methods?
Best regards
Hans-Ludwig
‎2005 Dec 22 3:24 PM
Hi,
Have you tried SET_LOCAL_CONTEXTMENU_MODE?
to completely disable context menu ?
Have you tried add_function ? did it worked ?
I'm looking for the code of disabling
‎2005 Dec 22 3:27 PM
Yes I did
SET_LOCAL_CONTEXTMENU_MODE, since per default it is set to false, so no local context menu is done.
But even then, a context menu with the mentioned 'system entries' comes up!
ADD_FUNCTION works fine. For my local entries I can also disable the functions, but not for the 'system entries'.
‎2005 Dec 22 3:47 PM
Why don't you use then
event CONTEXT_MENU_SELECTED
to get the code of the function you want to disable (parameter of event is the code)
then use the disable ....
this may be a clue
‎2005 Dec 22 3:55 PM
Unfortunetaly you do not get the event.
It looks like the control itself does adding the functions and also the events directly at the front-end.
I wonder from what it depends whether the options are selectable or not.
Even with the debugger in the system coding I can not see where the options are added to the context menu.
‎2005 Dec 22 3:59 PM
Hi Hans,
I have to go now ! But i'll think about it !
I'll get back to you tomorrow
try this program BC_CONTROLS_TUTORIAL. And see some functions are disable ! I ddin't had time to debug but it may help you !
If you feel that I helped you plz don't forget the reward