FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Checked menuitem
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Checked menuitem
Posted: Wed Jul 12, 2006 08:36 AM
Hi,

Why do menu items with checks appear with the check in a border?



Also, is there a way to "bullet" a menu item, like the view menu in windows explorer?

Alex
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Fri Jul 14, 2006 01:42 PM
Alex,

Please comment out this line in source\winapi\menus.c line 295:
           if( lpdis->itemState & ODS_CHECKED )
           {
              HBITMAP hBmp = LoadBitmap( 0, MAKEINTRESOURCE( OBM_CHECK ) );

              if( ! ( lpdis->itemState & ODS_SELECTED ) )
                 DrawGrayed( lpdis->hDC, hBmp, lpdis->rcItem.top + 1,
                             lpdis->rcItem.left + 1 );
              else
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 1,
                             lpdis->rcItem.left + 1 );
              DeleteObject( hBmp );
              // WindowInset( lpdis->hDC, &rct );   HERE!
           }

We have to implement the bullet option.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Compiling
Posted: Mon Jul 17, 2006 06:37 AM

Hi,

What #defines do I need to compile this? Compiling fails using Xhb

Tried WIN32

Alex

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Mon Jul 17, 2006 06:46 AM

Alex,

We email you the modified library for your review, thanks.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Checked menuitem
Posted: Mon Jul 17, 2006 04:15 PM

It seems that there is still a light grey background under the check sign.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Mon Jul 17, 2006 04:28 PM
Enrico,

Please try this:
           if( lpdis->itemState & ODS_CHECKED ) 
           { 
              HBITMAP hBmp = LoadBitmap( 0, MAKEINTRESOURCE( OBM_CHECK ) ); 

              DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 1, 
                                lpdis->rcItem.left + 1 ); 
              DeleteObject( hBmp ); 
           }
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Checked menuitem
Posted: Mon Jul 17, 2006 04:34 PM

Can you send me the new lib, please?

EMG

Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Checked items
Posted: Thu Oct 18, 2007 09:00 AM

Hi,

I've gotten menus.c to compile, and highlighted menu items are ok, but unhighlighted items still have the gray background?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Thu Oct 18, 2007 09:25 AM

Alex,

Are you still using DrawMasked() ? If yes, does your bitmap has the transparent color at pixel 0, 0 ?

Please post a screenshot of the bitmap and how it looks in the menu. Thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Menu items
Posted: Thu Oct 18, 2007 09:30 AM
Hi,

This is the gray background of unselected menu items, as below

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Thu Oct 18, 2007 10:49 AM

Alex,

Are those menuitems "checked" ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Checked menuitem
Posted: Thu Oct 18, 2007 10:51 AM

Yes, they are :)

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Thu Oct 18, 2007 11:05 AM
Alex,

Please make this change in your menus.c:
           if( lpdis->itemState & ODS_CHECKED )
           {
              HBITMAP hBmp = LoadBitmap( 0, MAKEINTRESOURCE( OBM_CHECK ) );

              DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 1,
                          lpdis->rcItem.left + 1 );
              DeleteObject( hBmp );
           }
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Checked menuitem
Posted: Thu Oct 18, 2007 11:59 AM

Did that change from your earlier post.

Selected items are ok, unselected are not

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checked menuitem
Posted: Thu Oct 18, 2007 02:53 PM

Alex,

You are using white as the menu color, please select another menu color and check if that makes a difference, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion