MENUITEM RESOURCE transparency ?

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Sun Nov 06, 2022 5:16 pm

These styles work with Menu, BtnBmp, Buttonbar and Message Bar ( TMsgBar ), XBrowse
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Mon Nov 07, 2022 1:30 am

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 view

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 view

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Mon Nov 07, 2022 3:43 am

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 view

#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 view

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby Jimmy » Mon Nov 07, 2022 6:43 am

hi,

thx for your work and Sample Code where i have learn a lot
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: MENUITEM RESOURCE transparency ?

Postby cnavarro » Mon Nov 07, 2022 2:28 pm

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
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Tue Nov 08, 2022 2:23 am

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Tue Nov 08, 2022 3:12 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby cnavarro » Tue Nov 08, 2022 4:52 am

Mr. Rao, add the COLORS clause to the menu definition (without putting any style 20?? ) and try.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Tue Nov 08, 2022 6:55 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Tue Nov 08, 2022 7:04 am

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 view
MENU oMenu COLORS

instead of
Code: Select all  Expand view
MENU oMenu


I tested all the samples and all of them work perfectly.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby cnavarro » Tue Nov 08, 2022 8:05 pm

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.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: MENUITEM RESOURCE transparency ?

Postby Jimmy » Tue Nov 08, 2022 9:13 pm

hi,
nageswaragunupudi wrote:if you use
Code: Select all  Expand view
MENU oMenu COLORS

instead of
Code: Select all  Expand view
MENU oMenu

YES, that work fine
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: MENUITEM RESOURCE transparency ?

Postby nageswaragunupudi » Tue Nov 08, 2022 11:44 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MENUITEM RESOURCE transparency ?

Postby Jimmy » Wed Nov 09, 2022 4:22 am

hi,
nageswaragunupudi wrote:Now all our users also know.

i think it must be in Help File so every User can read it
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter and 41 guests