Page 1 of 1

Bug in MENU 2007?

PostPosted: Fri Feb 04, 2011 2:14 pm
by IBTC
Hi!

With Wine I get this:

Image

1: the colour of the text should be black
2: the background of the arrow should be transparent

and on Windows 7:

Image

3: the arrow should be dark

How/where can I define the text colour of the highlighted item? And also the arrow image?

The code:

Code: Select all  Expand view

FUNCTION MAIN()

   LOCAL oWnd

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Test Menu" MENU BuildMenu()

   ACTIVATE WINDOW oWnd

return(0)

function BuildMenu()

   local oMenu

   MENU oMenu 2007

      MENUITEM "Item 1"

         MENU

            MENUITEM "Item 1.1"
            MENUITEM "Item 1.2"

            MENU
               MENUITEM "Item 1.2a"
               MENUITEM "Item 1.2b"
            ENDMENU

         ENDMENU

   ENDMENU

return oMenu
 


Thanks for help.

Re: Bug in MENU 2007?

PostPosted: Tue Feb 15, 2011 2:38 pm
by IBTC
These problems still exists in FWH 11.01. :(

It should be fixed, especially using Wine/WinBottler is recommended from Antonio for FWH Windows app on Linux/Mac (see e.g. From PC to MAC - Urgent, compatibilidad FWH con FiveMac y FiveLinux). So we have more modern locking Windows apps also on Linux/Mac.

I would try to fix it on my own, but MENU 2007 use functions which are not available for FWH users, like MITEMS2007(). I fear that the fix had to made in one of these functions :(

Re: Bug in MENU 2007?

PostPosted: Mon Jun 11, 2012 7:57 am
by Antonio Linares
Ruediger,

Those differences are based on existing differences between true Windows and Wine.

If you need some code for testing on Wine we can help you with modifications, etc

Have you considered not to use the 2007 style on the menu on Wine ?

Re: Bug in MENU 2007?

PostPosted: Mon Jun 11, 2012 10:18 am
by IBTC
Hi Antonio,
Antonio Linares wrote:If you need some code for testing on Wine we can help you with modifications, etc


This would be great. Thanks!

Antonio Linares wrote:Have you considered not to use the 2007 style on the menu on Wine ?


We want to use the 2007 style because than the app looks much better on Wine than without.

Re: Bug in MENU 2007?

PostPosted: Mon Jun 11, 2012 10:22 am
by IBTC
BTW... If you use a FWH 12.05 app under wine 1.2.3 and want to open a menu without 2007 clause the app crashes without any notice. The problem is at these lines at menus.c:

Code: Select all  Expand view
  if( lpdis->itemState & ODS_GRAYED )
                 RectDisable( lpdis->hDC, &lpdis->rcItem );
 


If I disable this it works under wine 1.2.3.

Re: Bug in MENU 2007?

PostPosted: Sat Jun 23, 2012 2:53 pm
by IBTC
Antonio Linares wrote:If you need some code for testing on Wine we can help you with modifications, etc


The solution is insert in MENUDRAW2007() following lines:

Code: Select all  Expand view

       ...    
            else
                uFormat = DT_CENTER; 

       // New:
      SetBkColor(  lpdis->hDC, RGB( 250, 250, 250) );
      SetTextColor( lpdis->hDC, RGB( 0, 0, 0 ) );

            SetBkMode( lpdis->hDC, TRANSPARENT );
           
            if( lpdis->itemState & ODS_GRAYED )
                SetTextColor( lpdis->hDC, RGB( 192, 192, 192 ) );

       // New:
       if( lpdis->itemState & ODS_SELECTED )
      {
        if( ! ( lpdis->itemState & ODS_GRAYED ) )
        {
           SetBkColor(  lpdis->hDC, RGB( 255, 233, 162 ) );
        }
      }

            if( ! bTab )
    ...