View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003379||JEDI VCL||00 JVCL Components||public||2005-12-23 01:17||2006-01-19 13:25|
|Target Version||Fixed in Version||3.20|
|Summary||0003379: TJvMainMenu and TJvPopupMenu are incompatible with ancestors (TMainMenu and TPopupMenu)|
|Description||TJvMainMenu and TJvPopupMenu are not draw TMenuItem.Bitmap. They only can draw glyphs from Images property.|
They ancestors are draws custom TMenuItem.image from Bitmap property when TMenuItem.ImageIndex or Menu.Images property is not "valid"
This is because this methods are incomplete:
procedure TJvCustomMenuItemPainter.DrawDisabledImage(X, Y: Integer);
procedure TJvCustomMenuItemPainter.DrawEnabledImage(X, Y: Integer);
procedure TJvXPMenuItemPainter.DrawEnabledImage(X, Y: Integer);
procedure TJvXPMenuItemPainter.DrawDisabledImage(X, Y: Integer);
|Tags||No tags attached.|
||More precisely, incomplete method is TJvCustomMenuItemPainter.Paint (does not check Item.Bitmap)|
||Thanks, this is now fixed in CVS.|
Bitmap painting stilll incomplete.
TMenuItem.Bitmap can be any size, but TJvCustomMenuItemPainter.Paint does not uses StretchDraw as it did in menus.pas. So, items icons can have various size, and more, can not be located at all in allocated rect's
Yes, but then which size should I use for the stretch draw?
The values in the ImageSize property?
||I'm not so familiar with JvMenus code. If using of ImageSize property is enough to fit image into item rectangle, I think it good idea|
Well, ImageSize is 0 by default. So I propose the following logic:
If ImageIndex is set, use ImageList size
If Bitmap is set then
if ImageSize is set, use it
else use MenuItem.Height-2 as the width and height of the image rectangle
else use ImageSize
the -2 is to ensure a small margin between adjacent images, which with the current painters is required to fit in the text height. I'm quite sure the VCL hardcoded 16x16, but I prefer to be a bit more flexible.
Any opinions on this? I plan on integrating this tonight (Paris time).
This is now in CVS, the default size being 16x16 (hard coded) as the VCL does.
Should any extensions be required, please create a new issue, do not reopen this one.
|2005-12-23 01:17||ivan_ra||New Issue|
|2005-12-23 02:06||ivan_ra||Note Added: 0008234|
|2006-01-05 07:54||obones||Status||new => assigned|
|2006-01-05 07:54||obones||Assigned To||=> obones|
|2006-01-07 06:43||obones||Status||assigned => resolved|
|2006-01-07 06:43||obones||Resolution||open => fixed|
|2006-01-07 06:43||obones||Note Added: 0008321|
|2006-01-11 02:41||ivan_ra||Status||resolved => feedback|
|2006-01-11 02:41||ivan_ra||Resolution||fixed => reopened|
|2006-01-11 02:41||ivan_ra||Note Added: 0008366|
|2006-01-16 01:49||obones||Note Added: 0008393|
|2006-01-17 21:11||ivan_ra||Note Added: 0008401|
|2006-01-18 04:10||obones||Note Added: 0008402|
|2006-01-19 13:25||obones||Status||feedback => resolved|
|2006-01-19 13:25||obones||Resolution||reopened => fixed|
|2006-01-19 13:25||obones||Note Added: 0008406|