FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in MENU 2007?
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Bug in MENU 2007?
Posted: Fri Feb 04, 2011 02:14 PM
Hi!

With Wine I get this:



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

and on Windows 7:



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 (fw): Select all Collapse
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
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: Bug in MENU 2007?
Posted: Tue Feb 15, 2011 02:38 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in MENU 2007?
Posted: Mon Jun 11, 2012 07:57 AM

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
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: Bug in MENU 2007?
Posted: Mon Jun 11, 2012 10:18 AM
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.
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
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: Bug in MENU 2007?
Posted: Mon Jun 11, 2012 10:22 AM
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 (fw): Select all Collapse
   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
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: Bug in MENU 2007?
Posted: Sat Jun 23, 2012 02:53 PM
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 (fw): Select all Collapse
       ...    
            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

Continue the discussion