Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - SOLVED - AddIcon Fault?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED - AddIcon Fault?

 Post Reply Post Reply
Author
Message
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED - AddIcon Fault?
    Posted: 30 March 2009 at 12:18pm
Hi All,
 
I'm having trouble getting the AddIcon method working in the ReportControl.  I'm familiar with this method and use it with various other controls (eg, CommandBars, ShortcutBar, TaskPanel etc).
 
I have an icon defined which is 16x16.  If I use the LoadIcon method then the icon is correctly set for a column, but if I switch to use the AddIcon method it doesn't display.
 
Has anybody used this successfully?
 
Regards,
 
Andy
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2009 at 6:55pm
try  to use wndReportControl.SetImageList YourImageList - you can assign image to ImageList in VB Form Editor and set proper mask to use transperent icons
Back to Top
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2009 at 4:47am
Hi Mark,
 
Unfortunately, the language that we use is Clarion and this doesn't support the ImageList function so I can't really use SetImageList.
 
As I mentioned earlier, the AddIcon works perfectly in Clarion for all of the other controls but will not work for the ReportControl - is there something different in this control or does it just not work?
 
Regards,
 
Andy
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2009 at 12:03pm
still try wndReportControl.SetImageList YourClarionLoadedIcon
Back to Top
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2009 at 11:37am
Hi Mark,
 
Excuse my ignorance but doesn't that method require an object whereas all I have is a handle to a compiled in icon - that's why I want to use the AddIcon method.
 
Can you think of any other way to get AddIcon to work?
 
Regards,
 
Andy
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2009 at 11:51am
Internally now ReportControl use ImageManager this is why I recommended to use it. Call wndReportControl.SetImageList use ImageManager inside ActiveX to pass you params.
 
There is old VB-way to deal with icons. You can try it also.
 
Dim iconArray(0 To 9) As Long
    'There are 10 icons in the Bitmap file, the bitmap file is 160x16,
    'which contains 10 16x16 icons. You need to make sure that there is
    'an element in the array for each icon in the Bitmap.
    'Width of icons = Width of Bitmap / number of elements in array
    'I.e. Width of icons = 160/10 = 16
    'IconId can not be Zero (0), so do not assign 0 to any of the array elements
    iconArray(0) = COLUMN_MAIL_ICON
    iconArray(1) = COLUMN_IMPORTANCE_ICON
    iconArray(2) = COLUMN_CHECK_ICON
    iconArray(3) = RECORD_UNREAD_MAIL_ICON
    iconArray(4) = RECORD_READ_MAIL_ICON
    iconArray(5) = RECORD_REPLIED_ICON
    iconArray(6) = RECORD_IMPORTANCE_HIGH_ICON
    iconArray(7) = COLUMN_ATTACHMENT_ICON
    iconArray(8) = COLUMN_ATTACHMENT_NORMAL_ICON
    iconArray(9) = RECORD_IMPORTANCE_LOW_ICON
    'Passing the iconArray for the "Commands" parameter will add an icon to the collection
    'of icons for each item in the array. So Number of icons added = Number of elements in array.
    'Icon width = Total width of Bitmap/Number of elements in array.
    'The icons will be assigned the index of the array elements as an Index.
    wndReportControl.Icons.LoadBitmap App.Path & "\Icons\bmreport.bmp", iconArray, xtpImageNormal
Back to Top
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 4:26am
Hi Mark,
 
Thanks, I'll take a closer look at the SetImageList but I'm not convinced I'll be able to use this with Clarion.
 
Interesting, If I use the LoadIcon method with the desired parameters it all works fine, its just the AddIcon method - I can only presume that its faulty.
 
Regards,
 
Andy
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 April 2009 at 2:46am
Originally posted by AndyWilton AndyWilton wrote:

Hi All,
 
I'm having trouble getting the AddIcon method working in the ReportControl.  I'm familiar with this method and use it with various other controls (eg, CommandBars, ShortcutBar, TaskPanel etc).
 
I have an icon defined which is 16x16.  If I use the LoadIcon method then the icon is correctly set for a column, but if I switch to use the AddIcon method it doesn't display.
 
Has anybody used this successfully?
 
Regards,
 
Andy
 
Hi,
 
If you use wndReportControl.Icons.AddBitmap Picture1.Picture.Handle, 1, xtpImageNormal, False it will display the image in columnheader.
                                                                                   |
                                                                                This is PictureBox with image
 
 
If I use .AddIcon it doesn't. Columnheader image supports icons so it should work... 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2009 at 7:15am
Hi All,
 
Ahh - found it.  It was my fault after all, but I thought I'd share the answer with everyone as it could quite easily catch others out.
 
The AddIcon method requires the handle to the compiled in icon.  To obtain this, I use the 'LoadImage' API call with parameters 4 and 5 (desired width and height) set to 0 - default size.
 
The problem is that even though the icon is defined as 16x16, I am getting a handle to an image of 32x32 and of course, the ReportControl doesn't like this size for its icons.  If I set the width / height parameters of 'LoadImage' to 16x16 then it returns a handle to an image of 16x16 and then of course the ReportControl displays it correctly.
 
Regards,
 
Andy
 
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
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.156 seconds.