FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TMenu
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TMenu
Posted: Mon Jul 25, 2016 02:29 PM
In the following sample, the automatic generated menuitem has not the right color:

Code (fw): Select all Collapse
#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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TMenu
Posted: Mon Jul 25, 2016 02: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TMenu
Posted: Mon Jul 25, 2016 02:47 PM

Thank you Cristobal!

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TMenu
Posted: Tue Jul 26, 2016 10:59 PM
Enrico, problem is in module Menudraw.c

Change this function and test

Code (fw): Select all Collapse
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TMenu
Posted: Wed Jul 27, 2016 08:13 AM

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

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TMenu
Posted: Wed Jul 27, 2016 08: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TMenu
Posted: Wed Jul 27, 2016 03:26 PM

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

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TMenu
Posted: Wed Jul 27, 2016 03: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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TMenu
Posted: Sat Jul 30, 2016 01:33 AM
News features in next versions: LOGOMENU, IMGMENU, etc.

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TMenu
Posted: Sat Jul 30, 2016 06:21 AM

very nice!

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion