Context menu selection

The Application Programming Interface and the OASIS Open Document Format

Context menu selection

Postby Fraz627 » Wed Apr 11, 2018 8:33 pm

I am playing around with the context menu interceptor.
how would I determine which context menu is being selected, I guess what I'm trying to get at
is would like to know if I selected the tab context menu or cell context menu so the correct one could be modified.

Open Office 4.1 on Windows 10
Posts: 22
Joined: Sat Jun 17, 2017 8:31 am

Re: Context menu selection

Postby JeJe » Wed Apr 11, 2018 11:16 pm

Doesn't the interceptor give you the menu so you can look at the first menu item and its text or commandURL?

Edit... this tells you about the resource identifiers... ... ementation
Openoffice 4.1.2
Windows 8
Posts: 747
Joined: Wed Mar 09, 2016 2:40 pm

Re: Context menu selection

Postby Sébastien C » Wed May 23, 2018 2:05 pm

I understand that this does not exactly answer your specific question of whether this or that contextual menu is called.

I hear just as well that this code snippet is (partially) in French. But G****** Tr******* is your friend.

And you use the formula "I am playing around [...]".

So maybe this little gem will bring water to your mill for "playing"...
LibreOffice under GNU-Linux ARMbian on the Rock64 and M$-W XP
User avatar
Sébastien C
Posts: 90
Joined: Mon Jan 04, 2010 5:06 pm
Location: Meymac, France

Re: Context menu selection

Postby JeJe » Thu May 24, 2018 9:47 am

I've been playing around with Sébastien C's linked to code (thanks, may use this myself - method works with writer too and it seems to be okay with calling your own custom menu and setting the context menu to CANCELLED)

In the Function ThisDocument_notifyContextMenuExecute try this

Code: Select all   Expand viewCollapse view

  dim nn
  set nn = oATContainer.getbyindex(0)
  msgbox nn.commandurl

'I get the result:
'tab context menu - slot 26269
'cell - slot 26067 ... igger.html

(.text causes a crash)
Openoffice 4.1.2
Windows 8
Posts: 747
Joined: Wed Mar 09, 2016 2:40 pm

Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 0 guests