Print Page | Close Window

taskpanel group icons

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12719
Printed Date: 27 September 2024 at 7:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: taskpanel group icons
Posted By: mat25
Subject: taskpanel group icons
Date 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



Replies:
Posted By: Oleg
Date Posted: 19 November 2008 at 5:25am
Hi,
Samples\TaskPanel\TaskPanel  sample has icon in group header.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mat25
Date 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++


Posted By: evoX
Date 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)


Posted By: Oleg
Date Posted: 29 December 2008 at 3:12am
Hi,
Just try add. ImageManager supports multiple formats for same Id.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: evoX
Date 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)


Posted By: Oleg
Date 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


Posted By: evoX
Date 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)


Posted By: evoX
Date 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)


Posted By: Oleg
Date 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


Posted By: evoX
Date 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)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net