Page 2 of 2

Re: MENUITEM RESOURCE transparency ?

Posted: Sun Nov 06, 2022 5:16 pm
by nageswaragunupudi
These styles work with Menu, BtnBmp, Buttonbar and Message Bar ( TMsgBar ), XBrowse

Re: MENUITEM RESOURCE transparency ?

Posted: Mon Nov 07, 2022 1:30 am
by nageswaragunupudi
I now tested with the basic menu system, without any styles like 20??.
At the same time this test includes performance of other classes:
Buttonbar and BtnBmps, XImage, XBrowse, all basic styles without 20?? styles.

We have used Bitmaps provided by Mr. Jimmy and also bitmap in \fwh\bitmaps\32x32\cascade.bmp. We used direct file name, resource defined with BITMAP and also resource defined with RCDATA (10).

Program

Code: Select all | Expand

function TestMenu()

   local oWnd, oMenu, oBar, oImage, oBrw

   USE STATES

   DEFINE WINDOW oWnd MENU MyMenu()
   DEFINE BUTTONBAR oBar SIZE 64,64

   DEFINE BUTTON OF oBar RESOURCE "CLEAN32"
   DEFINE BUTTON OF oBar RESOURCE "ABOUTJ"
   DEFINE BUTTON OF oBar RESOURCE "CLOUD"
   DEFINE BUTTON OF oBar RESOURCE "COLORS"
   DEFINE BUTTON OF oBar RESOURCE "CLEANUP"
   DEFINE BUTTON OF oBar RESOURCE "CLIPBOARD"

   @  70,64 XIMAGE oImage SOURCE "CLOUD" SIZE 64,64 OF oWnd
   @ 100,130 SAY "<-- XIMAGE" SIZE 100,24 PIXEL OF oWnd

   @ 140, 0 XBROWSE oBrw SIZE 300,-20 PIXEL OF oWnd ;
      DATASOURCE "STATES" AUTOCOLS ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :l2007   := .f.
      WITH OBJECT :aCols[ 2 ]
         :AddBitmap( { "CLEANUP", "CLIPBOARD", "CLOUD", "COLORS" } )
         :bBmpData   := { || ( oBrw:BookMark - 1 ) % 4 + 1 }
         :nClrBmpBack := CLR_HGRAY
      END
      :CreateFromCode()
   END

   oWnd:nWidth    := 500
   oWnd:nHeight   := 500

   ACTIVATE WINDOW oWnd CENTERED

return nil

function MyMenu()

   local oMenu

   MENU oMenu //2007
      MENUITEM "First"      RESOURCE "CASCADE32"
      MENU
         // from FWH/bitmaps/32x32 folder
         MENUITEM "Cascade"   FILE "c:\fwh\bitmaps\32x32\cascade.bmp"
         MENUITEM "Cascade32" RESOURCE "CASCADE32"
         MENUITEM "Cascade10" RESOURCE "CASCADE10"
         // Mr.Jimmy's bitmaps
         MENUITEM "Clean32" RESOURCE "CLEAN32"
         MENUITEM "CleanUp" FILE "c:\jimmy\bitmaps\no_dpi\cleanup.bmp" //RESOURCE "CLEANUP"
         MENUITEM "ClpBrd"  RESOURCE "CLIPBOARD"
         MENUITEM "Cloud"   RESOURCE "CLOUD"
         MENUITEM "Colors"  RESOURCE "COLORS"
      ENDMENU
      MENUITEM "Second" RESOURCE "CLOUD"
      MENUITEM "Third" FILE "c:\fwh\bitmaps\16x16\browse.bmp"
   ENDMENU

return oMenu
 
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"

CASCADE32 BITMAP "c:\fwh\bitmaps\32x32\cascade.bmp"
CASCADE10 10     "c:\fwh\bitmaps\32x32\cascade.bmp"
 
You need to change the paths suitably.

This is the start up screen when we excute the program.

Image

Observations:
1. Topbar menu should display the bitmaps, but does not display.
2. All other classes paint the images transparently, though a bit differently, eg. "CLOUD"
Please feel free to comment.

Now, let us see the behavior of the Menu system. This is the GIF.

Image

When we click on the first top menu item, we see that bitmaps are not painted transparently.
When we move the cursor over the top menubar, now the bitmaps of the top menu are displayed.

This requires attention of the FWH Team.

Welcome any other comments / observations.

Re: MENUITEM RESOURCE transparency ?

Posted: Mon Nov 07, 2022 3:43 am
by nageswaragunupudi
Till FWH1701, normal menus (without any styles like 20??) were displaying bitmaps from resource and files with transparency.
This is the program and rc I tested with FWH1701.

Code: Select all | Expand

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

static oWnd

function Main()

   DEFINE WINDOW oWnd FROM 1, 5 TO 20, 70 ;
      TITLE FWVERSION + ":Classic Menu Bitmaps" ;
      MENU BuildMenu()

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

LOCAL oMenu

MENU oMenu
  MENUITEM "&File" RESOURCE "OPEN"
    MENU
      MENUITEM "&Open" ;
          RESOURCE "OPEN" ; 
          ACTION MsgInfo( "Open" )
      MENUITEM "&Close" ;
          RESOURCE "CLOSE" ;
          ACTION MsgInfo( "Close" )
      MENUITEM "&Save" ;
          RESOURCE "SAVE" ;
          ACTION MsgInfo( "Save" )
      MENUITEM "&End" ;
          RESOURCE  "CANCEL" ;
          ACTION ( MsgInfo( "End" ), oWnd:End() )
   ENDMENU
   MENUITEM "Browse" RESOURCE "BROWSE"
ENDMENU

return oMenu
 
RC file

Code: Select all | Expand

OPEN   BITMAP "..\bitmaps\16x16\open.bmp"
CLOSE  BITMAP "..\bitmaps\16x16\close2.bmp"
SAVE   BITMAP "..\bitmaps\16x16\save.bmp"
CANCEL BITMAP "..\bitmaps\16x16\cancel.bmp"
BROWSE BITMAP "..\bitmaps\16x16\browse.bmp"
 
Image

There is a break between 1701 and 1709.

Re: MENUITEM RESOURCE transparency ?

Posted: Mon Nov 07, 2022 6:43 am
by Jimmy
hi,

thx for your work and Sample Code where i have learn a lot

Re: MENUITEM RESOURCE transparency ?

Posted: Mon Nov 07, 2022 2:28 pm
by cnavarro
nageswaragunupudi wrote: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.
Dear Rao
Please, explain to me what is not working correctly.
Thank you

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 2:23 am
by nageswaragunupudi
Please see the last sample I posted above and also the screenshot I posted when tested with FWH1701.
All bitmaps are displayed with transparency as expected.

If we test the same program with FWH1709 till the latest version, we find these problems.

1. When the window is first displayed, bitmaps on the top menu bar are not displayed.
2. When we click a menu item the bitmaps on the drop-down are NOT painted transparently.
3. When we hover the mouse over topbar menuitems, the bitmaps start appearing and that too without transperency.

This happens with Menus without any 20?? style.

Image

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 3:12 am
by nageswaragunupudi
What is surprising is that in the last 5 years, nobody has complained about this.
The reason must be that everybody, including FWTeam, must be defining menus with some favorite style 20?? and did not notice the issue with the classic menu without any style.

My personal advice to Mr. Jimmy is to use some 20?? style of his taste for the time being, till the issue is sorted out.

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 4:52 am
by cnavarro
Mr. Rao, add the COLORS clause to the menu definition (without putting any style 20?? ) and try.

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 6:55 am
by nageswaragunupudi
cnavarro wrote:Mr. Rao, add the COLORS clause to the menu definition (without putting any style 20?? ) and try.
This works perfectly both with FWH1709 and the latest version.
Thanks.

May ask?
Is it possible to make it work like this without any clause like "COLORS" ?
You know better but we like to have your clarification.

Thanks again.

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 7:04 am
by nageswaragunupudi
Mr. Jimmy

I would have saved lot of time had I sought guidance of Mr. Cristobal before posting here.

Now, you need not use any style. You can have classic menus working perfectly with transparency
if you use

Code: Select all | Expand

MENU oMenu COLORS
instead of

Code: Select all | Expand

MENU oMenu
I tested all the samples and all of them work perfectly.

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 8:05 pm
by cnavarro
nageswaragunupudi wrote:
cnavarro wrote:Mr. Rao, add the COLORS clause to the menu definition (without putting any style 20?? ) and try.
This works perfectly both with FWH1709 and the latest version.
Thanks.

May ask?
Is it possible to make it work like this without any clause like "COLORS" ?
You know better but we like to have your clarification.

Thanks again.
Dear Rao
The menus defined without any clause ( COLORS or styles 20?? ), are painted by the Windows API ( S.O. ) with the limitations that this produced for us.
To improve them, I introduced the COLORS clause that allows you to use colors and images and fonts both in the main menu items and in the popups without any limitation in addition to other clauses.

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 9:13 pm
by Jimmy
hi,
nageswaragunupudi wrote: if you use

Code: Select all | Expand

MENU oMenu COLORS
instead of

Code: Select all | Expand

MENU oMenu
YES, that work fine

Re: MENUITEM RESOURCE transparency ?

Posted: Tue Nov 08, 2022 11:44 pm
by nageswaragunupudi
Dear Rao
The menus defined without any clause ( COLORS or styles 20?? ), are painted by the Windows API ( S.O. ) with the limitations that this produced for us.
To improve them, I introduced the COLORS clause that allows you to use colors and images and fonts both in the main menu items and in the popups without any limitation in addition to other clauses.
Thank you very much.
I recollect you telling me this years back.
Now all our users also know.

Re: MENUITEM RESOURCE transparency ?

Posted: Wed Nov 09, 2022 4:22 am
by Jimmy
hi,
nageswaragunupudi wrote:Now all our users also know.
i think it must be in Help File so every User can read it