Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Custom Draw object disappear on hover [Beta bug?]
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom Draw object disappear on hover [Beta bug?]

 Post Reply Post Reply
Author
Message
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Topic: Custom Draw object disappear on hover [Beta bug?]
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 2:56am
Hi,
add
Handled = True
 
default implementation just draw above your icon.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 9:59am
How can I get the hover effect in a custom draw item?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 12:51pm
Hi,
 
use PaintManager.DrawRectangle method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 1:09pm

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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 1:54pm
Hello,
Selected value will be True.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2007 at 3:03pm
Thank you.
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2007 at 8:27am
What is the recommended API way to draw text on a custom draw item?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2007 at 10:14am
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
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2007 at 12:27pm
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?
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2007 at 12:37pm
Nevermind. I figured out that I had to use SetRect to specify the Rect and then pass that.
 
 
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2007 at 9:35am
Is there a way I can make the text bold or change the color?
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2007 at 9:48am

Nevermind. I created a font and got it to work as desired.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.