View Issue Details

IDProjectCategoryView StatusLast Update
0003379JEDI VCL00 JVCL Componentspublic2006-01-19 13:25
Reporterivan_raAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.20 
Summary0003379: TJvMainMenu and TJvPopupMenu are incompatible with ancestors (TMainMenu and TPopupMenu)
DescriptionTJvMainMenu 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);
TagsNo tags attached.



2005-12-23 02:06

developer   ~0008234

More precisely, incomplete method is TJvCustomMenuItemPainter.Paint (does not check Item.Bitmap)


2006-01-07 06:43

administrator   ~0008321

Thanks, this is now fixed in CVS.


2006-01-11 02:41

developer   ~0008366

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


2006-01-16 01:49

administrator   ~0008393

Yes, but then which size should I use for the stretch draw?
The values in the ImageSize property?


2006-01-17 21:11

developer   ~0008401

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


2006-01-18 04:10

administrator   ~0008402

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).


2006-01-19 13:25

administrator   ~0008406

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.

Issue History

Date Modified Username Field Change
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