Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - taskpanel group icons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

taskpanel group icons

 Post Reply Post Reply
Author
Message
mat25 View Drop Down
Newbie
Newbie


Joined: 18 November 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mat25 Quote  Post ReplyReply Direct Link To This Post Topic: taskpanel group icons
    Posted: 18 November 2008 at 4:48pm
hi,
   how can I add icons to groups in a taskpanel ?
   I have looked at the taskpanel sample, but in that sample the groups don't have icons. I want to add 48x48 pixel png icons or 32x32 if 48 is not supported.
 
thanks
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: 19 November 2008 at 5:25am
Hi,
Samples\TaskPanel\TaskPanel  sample has icon in group header.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mat25 View Drop Down
Newbie
Newbie


Joined: 18 November 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mat25 Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2008 at 4:45am
I have tried with pGroup1->SetIconIndex(IDI_ICON);
but the icon is not displayed, can be a problem that I use office 2007 theme ? also the icon is 32bit 32x32
toolkit pro 12.0.2, vc++
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2008 at 12:20am

It seems that the group icons share the same iconlist as the items, which is not very smart.

If I have 48x48 pixels icons in the taskpanel items, how can I add 24x24 icons to groups?
 
Thanks !
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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 December 2008 at 3:12am
Hi,
Just try add. ImageManager supports multiple formats for same Id.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2008 at 3:54am
Hi,
   I have tried AddCustomIcon, but it did not work, here is the code for the task panel icons
 

SetIconSize(CSize(48, 48));

SetFont(pFont);

CXTPTaskPanelGroup* pGroup1 = AddGroup(ID_TASKGROUP_FILEDISK);

CXTPTaskPanelGroup* pGroup2 = AddGroup(ID_TASKGROUP_REGISTRY);

CXTPTaskPanelGroup* pGroup3 = AddGroup(ID_TASKGROUP_INTERNET);

CXTPTaskPanelGroup* pGroup4 = AddGroup(ID_TASKGROUP_SPYWARE);

for (int i = 0; i < m_pSheet->GetPageCount(); i++)

{

CXTPPropertyPage* pPage = m_pSheet->GetPage(i);

CString strCaption = pPage->GetCaption();

CXTPTaskPanelGroupItem* pItem = pGroup1->AddLinkItem(i, i);

pItem->SetCaption(strCaption);

pItem->SetItemData((DWORD_PTR)pPage);

pPage->m_dwData = (DWORD_PTR)pItem;

}

GetImageManager()->SetIcons(IDB_TASKPANEL_MAIN, 0, 0, CSize(48,48));

 

The IDB_TASKPANEL_MAIN is a PNG with 2 48x48 icons

how can I add the 24x24 group Icons? I have them in .ICO format
Thanks !
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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 12:52am
Hi,
 
First add
 
SetGroupIconSize(CSize(24,24));
 
and set IconIndex for Groups

CXTPTaskPanelGroup* pGroup1 = AddGroup(ID_TASKGROUP_FILEDISK, 1);

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2008 at 7:52pm
Hi,
  Now it makes the group icon correctly 24,24 but it takes the icon from IDB_TASKPANEL_MAIN instead of the new custom added icon... and if I set the icon to 3 then the icon is not displayed at all.
 
SetIconSize(CSize(48, 48));
SetGroupIconSize(CSize(24,24));
SetFont(pFont);
CXTPTaskPanelGroup* pGroup1 = AddGroup(ID_TASKGROUP_FILEDISK,3); // If I set this to 3 the icon is not displayed and if I set it to 1 then it gets the icon from IDB_TASKPANEL_MAIN instead of the new custom added icon
 
GetImageManager()->SetIcons(IDB_TASKPANEL_MAIN, 0, 0, CSize(48,48)); // taskpanel item icons, contains 3 icons
GetImageManager()->AddCustomIcon(AfxGetApp()->LoadIconW(IDI_FOLDER_FILEDISK)); // the 24,24 group icon (this should be on index 3 right?
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2008 at 8:05pm
Well I did this and now it works
 
pGroup1->SetIconIndex(GetImageManager()->AddCustomIcon(AfxGetApp()->LoadIconW(IDI_FOLDER_CLEANER)));
 
very strange ! the new added icon index is 68267 !! why not 3 ?
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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: 31 December 2008 at 2:14am
Why have to be 3 ;) ?
 
Actaully I don't recommend use AddCustomIcon - its for CommandBars only. use standard SetIcon
GetImageManager()->SetIcon(IDI_FOLDER_CLEANER, 3);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 31 December 2008 at 4:38am
Well I didn't know that the nIDCommand parameter of the SetIcon is actually the icon index...
It works now with SetIcon :)
 
Thank you very much for your support Oleg !
And I wish you a Happy New Year !
 
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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.125 seconds.