Checked menuitem

Post Reply
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Checked menuitem

Post by AlexSchaft »

Hi,

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

Image

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

Alex
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Alex,

Please comment out this line in source\winapi\menus.c line 295:

Code: Select all

           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
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Compiling

Post by AlexSchaft »

Hi,

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

Tried WIN32

Alex
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Alex,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

Please try this:

Code: Select all

           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
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Checked items

Post by AlexSchaft »

Hi,

I've gotten menus.c to compile, and highlighted menu items are ok, but unhighlighted items still have the gray background?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Menu items

Post by AlexSchaft »

Hi,

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

Image
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Alex,

Are those menuitems "checked" ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Post by AlexSchaft »

Yes, they are :)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Alex,

Please make this change in your menus.c:

Code: Select all

           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
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Post by AlexSchaft »

Did that change from your earlier post.

Selected items are ok, unselected are not
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply