Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Gylphs - expand/collapse index?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Gylphs - expand/collapse index?

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


Joined: 15 October 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andrew666 Quote  Post ReplyReply Direct Link To This Post Topic: Gylphs - expand/collapse index?
    Posted: 07 December 2008 at 2:56pm
By trial and error I have used the (new in 12.1) .PaintManager.Glyphs.AddIcons method to add a "collapsed" icon at index=1 for the ReportControl.

However, whilst I can get other indexes to work, e.g. with column sort icons, I can't get an index for the "expanded" state to work - I always get the default icon displayed. 

I presume this is index=2, but I have tried lots of others.  Am I missing something?  Thanks.


Regards

--Andrew
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2008 at 11:53am
Index 0, 1 - Expand icons, 2,3,4,5 - Checkbox, 6, 7 sort arrows.
Back to Top
Andrew666 View Drop Down
Groupie
Groupie


Joined: 15 October 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andrew666 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2008 at 2:28pm
Thanks for that --- however, correct me if I'm wrong, but you don't appear to be able to add an image of command "0" to an ImageManager directly (at least in VB).

It also appears that "AddIcon" will not work with command=0; the only method I found that worked was LoadBitmap... but clearly that's not ideal as you end up with loose bmp files.

However, having got the glyphs setup it certainly works fine.  I now have my Vista-style folder tree!  Thanks for the enhancement.

Regards


--Andrew
Back to Top
Andrew666 View Drop Down
Groupie
Groupie


Joined: 15 October 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andrew666 Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2008 at 9:05am
... so is this a bug or is there a work-around to insert icons with ID of 0 for use with glyphs?  Thanks.
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: 23 December 2008 at 4:15am
Hi,
 
You could load bitmaps from ImageManager. It should work but it doesn't...
 
With wndReportControl
    With .PaintManager
        With .Glyphs
            .RemoveAll
            .AddBitmap ImageManager.Icons.GetImage(ID_REPORT_COLLAPSE, 16).Handle, 0, xtpImageNormal, False
            .AddBitmap ImageManager.Icons.GetImage(ID_REPORT_EXPAND, 16).Handle, 1, xtpImageNormal, False
        End With
    End With
End With
 
 
It looks like GetImage is returning same handle for every image in Manager  
 
If this would be fixed you should be able to load images from ImageManager and it wouldn't matter what ID was assigned to it.
 
 
 
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
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: 25 December 2008 at 3:51am
Hi,
 
I did another attempt... because I noticed that images were loaded in a single bitmap side by side...
 
With wndReportControl
    With .PaintManager
        With .Glyphs
            .RemoveAll
            .AddBitmap ImageManager.Icons.GetImage(ID_REPORT_GLYPHS_FIRSTIMAGE, 16).Handle, Array(0,1,2,3,4,5,6,7) , xtpImageNormal, True
        End With
    End With
End With
 
And this isn't working neither if more than 8 images are loaded into ImageManager  (note added 25-12-2008)
 
Note: ID_REPORT_GLYPHS_FIRSTIMAGE = id of first image in ImageManager (the collapse image for ReportControl))
 
 
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
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: 25 December 2008 at 6:08am
Handle indeed return to handle of all icons. Beeter just use AddIcons method:
.Glyphs.AddIcons ImageManager.Icons
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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: 25 December 2008 at 6:38am
Originally posted by oleg oleg wrote:

Handle indeed return to handle of all icons. Beeter just use AddIcons method:
.Glyphs.AddIcons ImageManager.Icons
 
Hi Oleg,
 
That is why we can't use it, because ImageManager icon ID can't be assigned as 0 (as Andrew666 complaint about) and first icon doesn't show. So workaround (above) is needed to get all images from ImageManager needed for .Glyphs icons starting with index = 0. 
 
I don't see any other way, maybe you have something in mind we can use instead...  
 
About handle: why does ImageManager.Icons.GetImage(id, 16).Handle return same handle for every icon in Imagemanager?
 
 
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
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: 25 December 2008 at 10:57am
Hi,
 
I have managed to create a test project for this. It looks like the images will be created for Glyphs images (from ImageManager)
 
I have to point you to post: https://forum.codejock.com/forum_posts.asp?TID=9492 just in case... 
 
 
 
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
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: 26 December 2008 at 1:11am
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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: 26 December 2008 at 3:00am
Originally posted by oleg oleg wrote:

Updated project:
 
uploads/20081226_011131_Icons.zip
 
 
Hi Oleg,
 
If Hans Klok ever needs a new assitant, you could be the one Oleg...  I know magicians don't tell how they do it, but could you make an exception this time?  
 
btw Did you check the .Handle property? Why it returns same handle everytime?
 
Thanks a lot
 
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
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: 26 December 2008 at 4:32pm
Hello,
 
Secret somewhere between "export" and "import" magic words :)
 
As we wrote in release notes for 11.2.1, ImageManager now have only 2 GDI Bitmaps that contains all icons. So developers can have 1000 icons in single image manager and don't worry about GDI objects number. So now Handle return common bitmap handle :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Andrew666 View Drop Down
Groupie
Groupie


Joined: 15 October 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andrew666 Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2008 at 12:15pm
Thanks for that fix Oleg --- I don't know how you got an icon of index=0 into the example imagemanager you uploaded, but if I copy/paste it into my project I can then replace it with my own bitmaps and all is working.

Regards


--Andrew
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: 29 December 2008 at 9:49am
Hi Oleg,
 
OK, now I understand how you did this My approach would be less work and easier to do and it wouldn't matter what ID was assigned to it. The downside is when bitmaps with alpha were added, stdPicture can't deal with those images  
 
I tried something else because of the alpha images...
 
    Dim im As Object
       
    For i = 500 To 507
        Set im = ImageManager.Icons.GetImage(i, 16).CreatePicture(xtpImageNormal)
        wndReportControl.PaintManager.Glyphs.AddIcon im, i - 500, xtpImageNormal
    Next i
 
 
But I'm not sure if this is a correct way to do it. It looks like it's working though  Would be nice if it could like this...
 
Thanks
 
 
 
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
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 December 2008 at 1:08am
Hi,
Such code can work in WindowsXP/Vista but not in older OS that doesn't support Alpha icons :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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: 30 December 2008 at 1:19am
Originally posted by oleg oleg wrote:

Hi,
Such code can work in WindowsXP/Vista but not in older OS that doesn't support Alpha icons :(
 
Hi Oleg,
 
Thanks for reply. If OS doesn't support alpha icons, I can't use alpha icons anyway, right?
 
Thanks
 
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2009 at 11:23am

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 January 2009 at 11:45am
Hi SuperMario,
 
What does this mean?
 
 
A few replies back Oleg said: Hi,
 
Such code can work in WindowsXP/Vista but not in older OS that doesn't support Alpha icons :(
 
And what does this mean?
 
 
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
 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.