Custom Draw object disappear on hover [Beta bug?] |
Post Reply |
Author | |
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
Posted: 27 October 2007 at 7:38pm |
I am using the DrawItem event to draw a custom icon on a gallery item
The gallery item is set to style icon and caption (using the 11.2.1. beta). The galleryitem already has an icon assigned to it. This displays just fine. I am drawing another miniature icon custom beside it. This works.
Dim Icon As ImageManagerIcon
Set Icon = Me.ImageManagerPanel.Icons.GetImage(ID_AUDIO_AVAILABLE, 22) Icon.Draw hdc, x + 150, y + 80, 22, 22, xtpImageNormal The problem is that when the mouse hovers over an item, the custom drawn icon disappears. When the mouse is not hovering over the item, it will appear.
See image: http://img528.imageshack.us/my.php?image=imageam7.jpg
How can i draw the icon on the item so that it appears even when it is hovering over it. Is this a bug in 11.2.1?
Thank you.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
add
Handled = True
default implementation just draw above your icon.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
How can I get the hover effect in a custom draw item?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
use PaintManager.DrawRectangle method.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Sorry, what I meant was - how can I determine when the user is hovering over an item? ByVal Enabled As Boolean, ByVal Selected As Boolean, ByVal Pressed As Boolean, ByVal Checked As Boolean
As far as I can see, only Enabled turns up true when the DrawItem event is fired. I want redraw the item when it hovering over an item but how can I differentiate?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Selected value will be True.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Thank you.
|
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
What is the recommended API way to draw text on a custom draw item?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
I must be doing something wrong then:
In the drawitem event I have
Dim rc as Rect
rc.Top = Y
rc.Left = X rc.Bottom = cy rc.Right = cx DrawText HDC, Item.Caption, -1, rc, 0& handled=True
I see the first item caption in the list but not the others. Any suggestions?
|
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Nevermind. I figured out that I had to use SetRect to specify the Rect and then pass that.
|
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Is there a way I can make the text bold or change the color?
|
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Nevermind. I created a font and got it to work as desired. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |