on 06-13-2005 1:05 PM
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...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
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
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
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);
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.