cancel
Showing results for 
Search instead for 
Did you mean: 

Image background color in menu

Former Member
0 Kudos

Hi there,

I've been searching through the forums and found a lot of topics how to create nice menuitems and how to add a picture to it (bmp or jpeg) but the only thing I didn't found is how to make the background transparant?

I also searched the helpfiles and developer guides, but didn't find a answer... Is there a specific color that I can use as a background color so that SBO (2004) identify that color as a transparant?

Thanks in advance...

Accepted Solutions (1)

Accepted Solutions (1)

FOA
Advisor
Advisor
0 Kudos

Hi J.

Check the BackColor propertiy of the Item Object in the UI API documentation part.

Here the info of the supported color ranges:

BackColor Property (Item)Description

Returns or sets a value specifying the background color of text or graphics in an item.

Property type

Read-write property

Remarks

RGB value in long representation. You can use the standard Visual Basic colors, for example, vbBlue, vbYellow, etc.

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).

See Also

Item Object

Best regards,

Felipe

Former Member
0 Kudos

Hi Felipe, thanks for your input,

I was aware of the background property of the Item object, but I need to have a transparant background in the image that I for a MenuItem...

Look at these two images:

http://zooi.ookvan.mine.nu/sbo_menu_normal.jpg

http://zooi.ookvan.mine.nu/sbo_menu_hover.jpg

The first, everything looks normal, but in the second you see that the image used has a fixed background color. It's a BMP, so doesn't have transperancy, but jpg does not either, but this are the only two allowed in SBO... Although I discovered that PNG also does work, but SBO thrashes up the transperancy part...

Does anybody knows how to make the background color of my menuitem transparant?

Former Member
0 Kudos

Hello,

sorry this post is not an answer to your question, but a question I want to ask you. I looked at the picture, and I can see that your menu "Pulse Menu" is not at the end of the menuy but in the middle (between Financieel and Opportunities)

How can you do that ? I was not aware thet you can choose the position of the menu. Each time I add a menu, it goes at the end.

thanks for your help

Sebastien

Former Member
0 Kudos

Hi Sébastien

You can choose wherever you want to add your menu.

I added menus with xml (using LoadBatchActions) as following:

<Application>
	<Menus>
		<action type="add">
			<Menu Checked="0" Enabled="1" FatherUID="2304" String="Your Item" Type="1" UniqueID="2000000000"
				Image="" position="1"></Menu>
		</action>
	</Menus>
</Application>

The attribute FatherUID and the attribute position determine where your menu will appear.

But what is the transparant color? Good question !

Greetz

Eddy

Former Member
0 Kudos

Hi Sébastien, I'll hope you'll understand C#, because I'm not that good in VB (the most used language around here?)

See the code snippet below, you can see that the Position property from the MenuCreationParams object determines the order of your menu's...


/* SBO_Application is my reference to the application */
SAPbouiCOM.MenuCreationParams MCP = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);
  
/* Set some variables */
MCP.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
MCP.UniqueID = "NICE_ID";
MCP.String = "Pulse Menu";
MCP.Image = "Pulse-16x16.bmp";
MCP.Enabled = true;
MCP.Position = 2; /* <-- Set the order of your item 🙂 */
  
/* Add the item */
SBO_Application.Menus.Item("43520").SubMenus.AddEx(MCP);

Former Member
0 Kudos

Thanks you guys

I didn't know this property position. I don't have it in the UI help.

Thanks again

Sebastien

Message was edited by: Sébastien Danober

Former Member
0 Kudos

Hi Sébastien

You can find it by the MenuCreationParams Objectin the UI API Reference...

(If you don't have that API and would like to have it I can email it to you...)

Former Member
0 Kudos

Hi,

We changed the subject. But can anyone solve the original problem with the background color?

Greetz

Eddy

> Hi Felipe, thanks for your input,

>

> I was aware of the background property of the Item

> object, but I need to have a transparant background

> in the image that I for a MenuItem...

>

> Look at these two images:

> http://zooi.ookvan.mine.nu/sbo_menu_normal.jpg

> http://zooi.ookvan.mine.nu/sbo_menu_hover.jpg

>

> The first, everything looks normal, but in the second

> you see that the image used has a fixed background

> color. It's a BMP, so doesn't have transperancy, but

> jpg does not either, but this are the only two

> allowed in SBO... Although I discovered that PNG also

> does work, but SBO thrashes up the transperancy

> part...

>

> Does anybody knows how to make the background color

> of my menuitem transparant?

Former Member
0 Kudos

Does <i>anybody</i> have a answer to this one..?

I'm very curious, I can't find anything about this...?

Answers (1)

Answers (1)

szymkaw
Explorer
0 Kudos

There is a specific background color for transparent areas. It is R:192 G:220 B:192. It works in SBO 2004 with menu items

Best Regards

Szymon