Windows popupmenu setBackgroundColor

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

Windows popupmenu setBackgroundColor

Postby Marco R. » Tue Nov 26, 2013 4:40 pm

Hi all,
I'm trying to execute that code to put a background color on my popup menu.

Code: Select all
var popupmenu = plugins.window.createPopupMenu()
var _item = popupmenu.addMenuItem('<html><b>Marco</b></html>',myMethod)
_item.setBackgroundColor("#808080")


It doesn't work. I've tried to use the html instead but without good results because I have a top border that I'm not able to change.

Thanks in advance for your time
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm

Re: Windows popupmenu setBackgroundColor

Postby Harjo » Tue Nov 26, 2013 6:14 pm

you can set the CSS in the servoy_web_client_default.css
(look also here: https://www.servoyforge.net/projects/se ... t-css/wiki)

like this
Code: Select all
.yuimenuitem,
.yuimenubaritem ,
.yuimenuitemlabel,
.yuimenuitemlabel table td {
   font-family: helvetica, tahoma, sans-serif !important;
   font-weight: 400 !important;
   font-size: 12px !important;
   color:#000000 !important;
   text-decoration:none !important;
   padding-top: 3px !important;
   padding-bottom: 3px !important;
   border-top: solid 1px transparent !important;
   border-bottom: solid 1px transparent !important;
}

.yuimenuitem-selected,
.yuimenubaritem-selected {

    background-color:#d1d1d1 !important;
   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1') !important; /* for IE */
   background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)) !important; /* for webkit browsers */
   background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1) !important; /* for firefox 3.6+ */
    text-decoration:none !important;
   
   border-top: solid 1px #6d6d6d !important;
   border-bottom: solid 1px #6d6d6d !important;
   text-shadow: #eeeeee 0 1px 0 !important;
}
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


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 8 guests

cron