Page 1 of 1
Checked menuitem
Posted: Wed Jul 12, 2006 8:36 am
by AlexSchaft
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
Posted: Fri Jul 14, 2006 1:42 pm
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.
Compiling
Posted: Mon Jul 17, 2006 6:37 am
by AlexSchaft
Hi,
What #defines do I need to compile this? Compiling fails using Xhb
Tried WIN32
Alex
Posted: Mon Jul 17, 2006 6:46 am
by Antonio Linares
Alex,
We email you the modified library for your review, thanks.
Posted: Mon Jul 17, 2006 4:15 pm
by Enrico Maria Giordano
It seems that there is still a light grey background under the check sign.
EMG
Posted: Mon Jul 17, 2006 4:28 pm
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 );
}
Posted: Mon Jul 17, 2006 4:34 pm
by Enrico Maria Giordano
Can you send me the new lib, please?
EMG
Checked items
Posted: Thu Oct 18, 2007 9:00 am
by AlexSchaft
Hi,
I've gotten menus.c to compile, and highlighted menu items are ok, but unhighlighted items still have the gray background?
Posted: Thu Oct 18, 2007 9:25 am
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
Menu items
Posted: Thu Oct 18, 2007 9:30 am
by AlexSchaft
Hi,
This is the gray background of unselected menu items, as below
Posted: Thu Oct 18, 2007 10:49 am
by Antonio Linares
Alex,
Are those menuitems "checked" ?
Posted: Thu Oct 18, 2007 10:51 am
by AlexSchaft
Yes, they are
Posted: Thu Oct 18, 2007 11:05 am
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 );
}
Posted: Thu Oct 18, 2007 11:59 am
by AlexSchaft
Did that change from your earlier post.
Selected items are ok, unselected are not
Posted: Thu Oct 18, 2007 2:53 pm
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