Style for plugins.window.createPopupMenu()

Questions and answers on developing, deploying and using plugins and JavaBeans

Style for plugins.window.createPopupMenu()

Postby Robert Huber » Mon Feb 20, 2012 6:41 pm

I try to find out on what style sheet the plugins.window.createPopupMenu() text is based? I tried with combobox and the other styles, but couldn't find which one can be used to style the plugins.window.createPopupMenu()

Regards,
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: Style for plugins.window.createPopupMenu()

Postby Harjo » Mon Feb 20, 2012 8:55 pm

AFAIK for smartclient you can't style the popupmenu, that's Java LAF depended.

for webclient you can style and change the default webclient css.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Style for plugins.window.createPopupMenu()

Postby Robert Huber » Mon Feb 20, 2012 11:49 pm

Harjo wrote:AFAIK for smartclient you can't style the popupmenu, that's Java LAF depended


It's possible for SmartClient as well using it like

Code: Select all
var popupMenu = plugins.window.createPopupMenu();

popupMenu.addMenuItem('<html><span style = "font-size: 12; color: #0f0f0f; font-weight: regular">' + i18n.getI18NMessage(menuItems[i].name) + '</span></html>', menuItems[i].method, null, null, itemEnabled, null);


The code is in a for loop with i as index, therefor the menuItems[i].x

There is variation with the font-size: xxx or the font: xxx possible, one can also specify a font or set 'Default', but I can't seem to find on which style tag of the style sheet it's based (if it is at all). Anyway that would be great.

Regards,
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: Style for plugins.window.createPopupMenu()

Postby Robert Huber » Sat Feb 25, 2012 12:00 pm

Anyone can help on what style the createPopupMenu() is based, or on what font is the method based on, i. e. which font is used and where is it defined?

Regards,
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: Style for plugins.window.createPopupMenu()

Postby Harjo » Sat Feb 25, 2012 12:34 pm

As I said, that is L&F dependent in Smart client.
of course you can fiddle around yourself with html in it, but that is only for the label's (strings) inside opupmenu,
You can't control the main-border, main background etc.... with that...
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Style for plugins.window.createPopupMenu()

Postby sem » Sat Feb 25, 2012 12:44 pm

You could try to change the values of the PopupMenu UI Defaults, but as I'm not mistaken this will depend on the LAF you use if these defaults are used:

Code: Select all
//on solution open
var uiDefaults = Packages.javax.swing.UIManager.getDefaults();
var font = new Packages.javax.swing.plaf.FontUIResource("Tahoma",0,11);
     uiDefaults.put("PopupMenu.font", font);
//etc, search google for all the java ui defaults PopupMenu.*
Sem Tukenmez
Elvendi
sem
 
Posts: 1
Joined: Sat Feb 25, 2012 12:38 pm

Re: Style for plugins.window.createPopupMenu()

Postby Robert Huber » Thu Mar 01, 2012 1:16 pm

Hi Harjo

If you say L&F dependent, can I somewhere (in Servoy) get the information what font the L&F uses? I assume what you say means there is no link to a style in a Servoy Style definition file, and it is not possible to create a link to a Servoy Style, is this assumption correct?

Harjo wrote:As I said, that is L&F dependent in Smart client.
of course you can fiddle around yourself with html in it, but that is only for the label's (strings) inside opupmenu,
You can't control the main-border, main background etc.... with that...


Regards,
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: Style for plugins.window.createPopupMenu()

Postby lesouef » Sat Mar 23, 2013 7:25 pm

Has anyone tried the popupmenu with web client?
It changes the current styles when you click on it. For instance, the tabpanel labels font is changed.
Is there a way to force the plugin to use a certain style (not important, it's ok like it is), but more important would be to prevent it from altering the page current styles? A dedicated style for it would fixe it?
lesouef
 
Posts: 420
Joined: Thu Oct 20, 2005 8:13 pm
Location: Strasbourg & Paris - France

Re: Style for plugins.window.createPopupMenu()

Postby ina.wels » Wed Nov 27, 2013 3:50 pm

Hi,
I also would like to know if there is a way too keep the style from the page while showing the popup.
Thanks
ina.wels
 
Posts: 16
Joined: Fri Jan 27, 2012 10:51 am


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 34 guests