Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
5539 00 JVCL Components trivial always 2011-03-31 17:40 2012-09-10 14:15
ralfiii  
obones  
normal  
resolved Daily / GIT  
fixed  
none    
none 3.46  
0005539: TJvPopupMenu.DefaultDrawItem deprecated
The code of TJvPopupMenu.DefaultDrawItem is absolutely identical to TJvPopupMenu.DrawItem.

Originally this method was used in OwnerDraw-mode to get the "normal" paint-behaviour (=to get the text drawn) and do some custom painting afterwards, typically it was called from the FOnDrawItem-event.

If you now call that method from the OnDrawItem-Event your code is stuck in an endless loop.

If you look into the original Rx-code from that the TJvPopupMenu
origins, you'll see a line
  if Assigned(FOnDrawItem) then FOnDrawItem(Self, Item, Rect, State)
in .DrawItem but this line is missing on .DefaultDrawItem.


As the TJvPopupMenu has extended draw-modes with painters calling the "original" paint routine doesn't work at all, you have to create and use a painter yourself.

So I think that the complete method DefaultDrawItem is deprecated and has to be removed.

And as the function is identical to DrawItem users could call DrawItem instead if they - for some reason - really wanted to call it.
zip file icon bug.zip [^] (1,421 bytes) 2011-06-08 10:56
Issue History
2011-03-31 17:40 ralfiii New Issue
2011-06-07 17:50 obones Note Added: 0018617
2011-06-07 17:50 obones Status new => feedback
2011-06-08 10:56 ralfiii File Added: bug.zip
2011-06-08 10:57 ralfiii Note Added: 0018649
2011-09-21 11:42 obones Status feedback => acknowledged
2012-02-23 10:16 obones Status acknowledged => confirmed
2012-02-23 10:27 obones Note Added: 0019493
2012-02-23 10:27 obones Status confirmed => resolved
2012-02-23 10:27 obones Fixed in Version => Daily / SVN
2012-02-23 10:27 obones Resolution open => fixed
2012-02-23 10:27 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46

Notes
(0018617)
obones   
2011-06-07 17:50   
Could you create an application that illustrates what you are describing here?
I must admit I have a hard time understanding the infinite loop thing
(0018649)
ralfiii   
2011-06-08 10:57   
Attached there's a project with the RxLib-Popup and the Jedi-Popup.
(you can delete the RxLib-stuff and will still see the Jedi-bug)
(0019493)
obones   
2012-02-23 10:27   
DefaultDrawItem is now deprecated in SVN