Bug in MENU 2007?

Post Reply
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Bug in MENU 2007?

Post 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

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.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Re: Bug in MENU 2007?

Post 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 :(
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Bug in MENU 2007?

Post 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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Re: Bug in MENU 2007?

Post 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.
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Re: Bug in MENU 2007?

Post 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

   if( lpdis->itemState & ODS_GRAYED )
                 RectDisable( lpdis->hDC, &lpdis->rcItem );
 
If I disable this it works under wine 1.2.3.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Re: Bug in MENU 2007?

Post 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

       ...    
            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 )
    ...
 
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
Post Reply