Bug in TMenu

Bug in TMenu

Postby Enrico Maria Giordano » Mon Jul 25, 2016 2:29 pm

In the following sample, the automatic generated menuitem has not the right color:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oMenu

    MENU oMenu 2007
        MENUITEM "Window"

        MENU
            MENUITEM "Test"
        ENDMENU
    ENDMENU

    DEFINE WINDOW oWnd MDI;
           TITLE "MDI Test";
           MENU oMenu;
           MENUINFO 1

    ACTIVATE WINDOW oWnd;
             ON INIT CREATECHILD( oWnd )

    RETURN NIL


STATIC FUNCTION CREATECHILD( oMdi )

    LOCAL oWnd, oMenu

    MENU oMenu 2007
        MENUITEM "Window"

        MENU
            MENUITEM "Test"
        ENDMENU
    ENDMENU

    DEFINE WINDOW oWnd MDICHILD OF oMdi;
           TITLE "MDI Child Test";
           MENU oMenu

    ACTIVATE WINDOW oWnd;
             VALID !GETKEYSTATE( VK_ESCAPE )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8524
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMenu

Postby cnavarro » Mon Jul 25, 2016 2:37 pm

Enrico
I will check and comment

Thanks
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: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TMenu

Postby Enrico Maria Giordano » Mon Jul 25, 2016 2:47 pm

Thank you Cristobal!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8524
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMenu

Postby cnavarro » Tue Jul 26, 2016 10:59 pm

Enrico, problem is in module Menudraw.c

Change this function and test

Code: Select all  Expand view


HB_FUNC( MITEMSFW )
 // hMenu, nIni, aHBmps, lSys
{
   .../...

   MENUITEMINFO mi;

   for( w = nIni; w < GetMenuItemCount( hMenu ); w++ )
   {
      memset( ( char * ) &mi, 0, sizeof( MENUITEMINFO ) );
      mi.cbSize = sizeof( MENUITEMINFO );
      if ( bSys )
         mi.fMask  = MIIM_TYPE;
      else
         mi.fMask  = MIIM_FTYPE;
      GetMenuItemInfo( hMenu, w, TRUE, &mi );

      if( ( mi.fType & MFT_OWNERDRAW ) != MFT_OWNERDRAW )
      {
         mi.cbSize = sizeof( MENUITEMINFO );
         mi.fMask  |= MIIM_DATA | MIIM_BITMAP ;
         mi.fType  |= MFT_OWNERDRAW ;
         mi.dwItemData = ( ULONG_PTR ) hMenu;
         SetMenuItemInfo( hMenu, w, TRUE, &mi );
      }
   }
}

 


Please comment result
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: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TMenu

Postby Enrico Maria Giordano » Wed Jul 27, 2016 8:13 am

Already tried your update lib. Still need to try that C function?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8524
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMenu

Postby cnavarro » Wed Jul 27, 2016 8:27 am

Enrico
I published the problem
This function is included in the library that I sent 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: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Re: Bug in TMenu

Postby Enrico Maria Giordano » Wed Jul 27, 2016 3:26 pm

I also tried the above changed C function and it worked fine!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8524
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMenu

Postby cnavarro » Wed Jul 27, 2016 3:34 pm

Enrico Maria Giordano wrote:I also tried the above changed C function and it worked fine!

EMG


Enrico, thanks for your test
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: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TMenu

Postby cnavarro » Sat Jul 30, 2016 1:33 am

News features in next versions: LOGOMENU, IMGMENU, etc.

Image
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: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TMenu

Postby Antonio Linares » Sat Jul 30, 2016 6:21 am

very nice!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests

cron