taskpanel group icons |
Post Reply |
Author | |
mat25
Newbie Joined: 18 November 2008 Status: Offline Points: 2 |
Post Options
Thanks(0)
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Samples\TaskPanel\TaskPanel sample has icon in group header.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mat25
Newbie Joined: 18 November 2008 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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++
|
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Just try add. ImageManager supports multiple formats for same Id.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
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) |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
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) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |