Page 1 of 2

MENUITEM RESOURCE transparency ?

Posted: Mon Oct 31, 2022 11:28 pm
by Jimmy
hi,

what is need when use Resource to make it transparency :?:
Image

Re: MENUITEM RESOURCE transparency ?

Posted: Wed Nov 02, 2022 4:38 am
by cnavarro
Check that those resources have transparency enabled in their layout.

Re: MENUITEM RESOURCE transparency ?

Posted: Wed Nov 02, 2022 6:06 am
by Jimmy
hi,
cnavarro wrote:Check that those resources have transparency enabled in their layout.
does work with HMG and Xbase++ like this (same Resource)
Image

Code: Select all | Expand

STATIC PROCEDURE BuildMainMenu()
LOCAL oMenu
   MENU oMenu
      MENUITEM "&Action"
      MENU
         MENUITEM "Left Side" + CHR( 9 ) + "ALT+F1" RESOURCE "MYLEFTSIDE" ;
                               ACCELERATOR ACC_ALT, 65648 ;
                               ACTION OpenComboSide( "left" )
         MENUITEM "Right Side" + CHR( 9 ) + "ALT+F2" RESOURCE "MYRIGHTSIDE" ;
                                ACCELERATOR ACC_ALT, 65649 ;
                                ACTION OpenComboSide( "right" )
         MENUITEM "E&xit" + CHR( 9 ) + "ALT+F4" RESOURCE "MYEXIT" ACTION oMain:End()
      ENDMENU
   ENDMENU
RETURN

Re: MENUITEM RESOURCE transparency ?

Posted: Thu Nov 03, 2022 2:18 pm
by Jimmy
hi,

have try different Bitmap as Resource for MENU
Image

Image

Image
as i can say none "match" with MENU which IHMO do not hamdle Transparency
please tell me a IMAGE from
c:\fwh\bitmaps\16x16\
c:\fwh\bitmaps\32x32\
c:\fwh\bitmaps\AlphaBmp\
c:\fwh\bitmaps\backgrnd\
c:\fwh\bitmaps\hires\
c:\fwh\bitmaps\metro\
c:\fwh\bitmaps\pngs\
c:\fwh\icons\hires\
which will work, thx

p.s. which COLOR have MENU Background :?:

Re: MENUITEM RESOURCE transparency ?

Posted: Thu Nov 03, 2022 2:53 pm
by Jimmy
hi,

i have for COLOR_MENU (Window 10)
Image
so it is {240,240,240}

---

does Fivewin have a Ownerdraw MENU :idea:

Re: MENUITEM RESOURCE transparency ?

Posted: Thu Nov 03, 2022 3:42 pm
by cnavarro
DearJimmy
If you not use clause COLOR or STYLE 2007, 2010, 2013, 2015, Fivewin use Windows menus

Re: MENUITEM RESOURCE transparency ?

Posted: Thu Nov 03, 2022 5:10 pm
by Jimmy
hi,

to "modify" IMAGE to have COLOR_MENU is "just" a Workaround
i can get COLOR of Windows Theme COLOR_MENU "on-fly" ... what about STYLE 2007, 2010, 2013, 2015 how to "get" Color :?: ,

as you see i have try different IMAGE, also from Fivewin \BITMAP, but none of them work with "transparency"
so i guess transparency for MENU IMAGE is not include under Fivewin or what did i wrong :?:

Re: MENUITEM RESOURCE transparency ?

Posted: Thu Nov 03, 2022 6:42 pm
by cnavarro
Please look for clauses include\menu.ch, and
http://forums.fivetechsupport.com/viewt ... 15#p254324

Re: MENUITEM RESOURCE transparency ?

Posted: Sat Nov 05, 2022 1:32 pm
by nageswaragunupudi

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oWnd, oMenu

   DEFINE WINDOW oWnd MENU MyMenu()


   oWnd:nWidth    := 400
   oWnd:nHeight   := 300

   ACTIVATE WINDOW oWnd CENTERED

return nil

function MyMenu()

   local oMenu

   MENU oMenu 2007
      MENUITEM "File"      FILE "\fwh\bitmaps\16x16\index.bmp"
      MENU
         MENUITEM "Open"   FILE "\fwh\bitmaps\16x16\open.bmp"
         MENUITEM "Save"   FILE "\fwh\bitmaps\16x16\save2.bmp"
         MENUITEM "Close"  FILE "\fwh\bitmaps\16x16\close2.bmp"
         SEPARATOR
         MENUITEM "Exit"   FILE "\fwh\bitmaps\16x16\exit2.bmp"
      ENDMENU
   ENDMENU

return oMenu
Image

Re: MENUITEM RESOURCE transparency ?

Posted: Sat Nov 05, 2022 1:47 pm
by Antonio Linares
FWH uses the pixel color at zero, zero to apply transparency and that may be the reason

Re: MENUITEM RESOURCE transparency ?

Posted: Sat Nov 05, 2022 2:04 pm
by nageswaragunupudi
Now, from Resources.

Use this rc file:

Code: Select all | Expand

INDEX  BITMAP "\fwh\bitmaps\16x16\index.bmp"
OPEN2  BITMAP "\fwh\bitmaps\16x16\open.bmp"
SAVE   BITMAP "\fwh\bitmaps\16x16\save2.bmp"
CLOSE3 BITMAP "\fwh\bitmaps\16x16\close2.bmp"
EXIT   BITMAP "\fwh\bitmaps\16x16\exit2.bmp"
 
Modify the MyMenu() function in the above sample program like this:

Code: Select all | Expand

function MyMenu()

   local oMenu

   MENU oMenu 2007
      MENUITEM "File"      RESOURCE "INDEX"
      MENU
         MENUITEM "Open"   RESOURCE "OPEN2"
         MENUITEM "Save"   RESOURCE "SAVE"
         MENUITEM "Close"  RESOURCE "CLOSE3"
         SEPARATOR
         MENUITEM "Exit"   RESOURCE "EXIT"
      ENDMENU
   ENDMENU

return oMenu
Result is exactly same as the above image in my last post.

Re: MENUITEM RESOURCE transparency ?

Posted: Sat Nov 05, 2022 2:39 pm
by nageswaragunupudi
Sometime back, Mr. Jimmy sent me some "no_dpi" bitmaps.
I tried with those bmp files in RC file:

This is the rc file:

Code: Select all | Expand

ABOUTJ    10 "c:\jimmy\bitmaps\no_dpi\about.bmp"
CLEAN32   10 "c:\jimmy\bitmaps\no_dpi\clean32.bmp"
CLEANUP   10 "c:\jimmy\bitmaps\no_dpi\cleanup.bmp"
CLIPBOARD 10 "c:\jimmy\bitmaps\no_dpi\clipboard.bmp"
CLOUD     10 "c:\jimmy\bitmaps\no_dpi\cloud.bmp"
COLORS    10 "c:\jimmy\bitmaps\no_dpi\colors.bmp"
 
Revised MyMenu() function:

Code: Select all | Expand

function MyMenu()

   local oMenu

   MENU oMenu 2007
      MENUITEM "File"      RESOURCE "INDEX"
      MENU
         MENUITEM "About"   RESOURCE "ABOUTJ"
         MENUITEM "Clean32" RESOURCE "CLEAN32"
         MENUITEM "CleanUp" RESOURCE "CLEANUP"
         MENUITEM "ClpBrd"  RESOURCE "CLIPBOARD"
         MENUITEM "Cloud"   RESOURCE "CLOUD"
         MENUITEM "Colors"  RESOURCE "COLORS"
      ENDMENU
   ENDMENU

return oMenu
I find no problem with transparency

Image

Can you please send the bitmaps, with which you have problem of transparency?

Re: MENUITEM RESOURCE transparency ?

Posted: Sun Nov 06, 2022 5:30 am
by Jimmy
hi,

thx for your work and Sample

as i can "see" you use a "Trick" to change Style to 2007, than it look much better

but how should a Newbie "know" this while Help File does not say it
without "Trick" it look like i say
Image
Image

so my Question : how to use this Technique when want "Dark-Mode" :?:

p.s. which Style can be used with MENU :?:
Help File does not say it

Re: MENUITEM RESOURCE transparency ?

Posted: Sun Nov 06, 2022 2:22 pm
by nageswaragunupudi
Thanks.
I used style 2007, because I always used that style, because I like it. In most samples I post here also you can find that style.
It is our duty to provide full support honestly and not to play tricks. I do my job with utmost sincerity.

After reading your post, I did find some issues with classical menu with no-style. I will fully study and come out with all the issues. FWH will fix wherever necessary.

Re: MENUITEM RESOURCE transparency ?

Posted: Sun Nov 06, 2022 2:38 pm
by Jimmy
hi,

i have look at those Office Style : NICE :!:

Question : is there a Way to "detect" OS Style and use it as Menu Style :?:
those Office Style are identical with OS Style when they have released

Offtopic : does those Office Style also work on other Fivewin Control :idea: