Getting a literal tilda (~) in menu item text

The Application Programming Interface and the OASIS Open Document Format

Getting a literal tilda (~) in menu item text

Postby kwalcock » Fri Oct 17, 2014 11:01 am

Including a tilda (~) in menu item text will create a handy shortcut, but how can I get a plain, literal tilda character? I can find no documentation about how to "escape" the special character. None of ~~, '~, \~ work. The tildas are all removed. It works for the undo and redo menu items, so there must be a secret way. Who knows it?
Apache OpenOffice 4.0.1
Windows, Linux, MacOS
kwalcock
 
Posts: 24
Joined: Thu Oct 09, 2014 11:54 am

Re: Getting a literal tilda (~) in menu item text

Postby kingfisher » Sat Oct 18, 2014 3:40 am

Code to set a tilde to a cell is quite simple. Exactly what do you mean ? Are you trying to add a menu item with Tools > Customise ?
Apache OpenOffice 4.1.6 on PCLinuxOS
User avatar
kingfisher
Volunteer
 
Posts: 2120
Joined: Tue Nov 20, 2007 10:53 am

Re: Getting a literal tilda (~) in menu item text

Postby kwalcock » Sat Oct 18, 2014 8:41 am

I wouldn't say there was a cell involved. This is a custom menu and menu items for an addon. Showing that it can be done from Addons.xcu would be a first step. Because I change the menu item text on the fly, I change the menu item text using FeatureStateEvent.State. The changed text may have its own tildas in addition to the tilda that is used for the shortcut. For example, the text could end up being "~Undo: Typing: 'he~llo'". I see that OpenOffice gets it wrong on Windows. This particular tilda in 'he~llo' does not show up correctly.
Apache OpenOffice 4.0.1
Windows, Linux, MacOS
kwalcock
 
Posts: 24
Joined: Thu Oct 09, 2014 11:54 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests