TaskPanel Vs. CXTOutBarCtrl |
Post Reply |
Author | |
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Posted: 28 August 2007 at 8:13am |
If i want to put icons images on CXTTaskPanel, then which the best way to do so?
I was using CXTOutBarCtrl in OLD Code.....So i was able to use the following fns: GetBarFolder(...) InsertItem(...) etc... how do i do it with CXTTaskPanel ???? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Call m_wndOutlookBar.GetImageManager()->SetIcons(...);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
m_wndOutlookBar.GetImageManager()->SetIcons(...); Syntax (using CImageList) shows: BOOL SetIcons( CImageList& imlIcons, UINT* pCommands, int nCount, CSize szIcon, XTPImageState imageState = xtpImageNormal ); But when i call it using: m_wndTaskPanel.GetImageManager()->SetIcons(m_Normal_List,m_pIconId,3,CSize(32,32)); It gives me error as : cannot convert parameter 1 from 'class CImageList ' to 'class CBitmap &' Why should this error come....when the decl of m_Normal_List is: CImageList m_Normal_List; |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Guess problem in m_pIconId. it muse be UINT pointer
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Thanks Oleg,
I was able to call that function. But still not able to see the image: See, my old code is something like /* OLD CODE */ hNorm = (HICON)::LoadImage(hinst, MAKEINTRESOURCE(iconid),IMAGE_ICON, 32, 32, LR_LOADMAP3DCOLORS); m_pIconId = m_pimlNormal->Add( hNorm ); . . . pBarFolder->SetLargeImageList( m_pimlNormal ); pBarFolder->InsertItem(i,CoreViewTable[viewid].szViewLabel, m_pIconId, viewid) Now i want to achieve the same thing using a taskpanel so the new code is : /* NEW CODE */ hNorm = (HICON)::LoadImage(hinst, MAKEINTRESOURCE(iconid), IMAGE_ICON, 32, 32, LR_LOADMAP3DCOLORS); m_pIconId = m_pimlNormal->Add( hNorm ); . . . m_wndTaskPanel.SetImageList(m_pimlNormal,OBS_XT_LARGEICON); result = m_wndTaskPanel.GetImageManager()->SetIcons(*m_pimlNormal,(UINT*)m_pIconId,5,CSize(32,32)); where m_pimlNormal is a CImageList * But it is not showing me any image on the taskpanel... what could be wrong in this ???? Please help :) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Do you convert HICON to UINT*? Actually instead 2 last lines just try
m_wndTaskPanel.SetImageList(m_pimlNormal, CSize(32, 32)); or better see Samples\UserInterface\GUI_Outlook and its BOOL CMainFrame::InitializeOutlookBar() it shows how to add images from icons. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Oleg,
I tried it by just saying: m_wndTaskPanel.SetImageList(m_pimlNormal,CSize(32, 32)); But no effect... Am i missing on something in this ??? Like do i need to enable the task panel or something like this.... Secondly i also checked the code from : BOOL CItemTreeView::InitilalizeTreeControl() But here the icons, icon strings , are present in the resources.... In my case i am loading them from a file.... thats the reason in my call to : pBarFolder->InsertItem(i,CoreViewTable[viewid].szViewLabel, m_pIconId, viewid); i am specifying the Label (name for icon) + ID of icon.... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Think you didn't set IconIndex for Items. its second parameter in AddLinkItem.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Thank you Oleg
This worked perfectly..... Now can you please help me on the following: In my old code i was using: LRESULT CMyClass::OnOutbarNotify(WPARAM wParam, LPARAM lParam) { XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam; int iHitItem = pOBInfo->nIndex; } Now in new code i have: LRESULT CMyClass::OnTaskPanelNotify(WPARAM wParam, LPARAM lParam) { /* how do i get the index info in lParam ???? */ } |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Oleg,
Problem is solved: CXTPTaskPanelGroupItem* pItem = (CXTPTaskPanelGroupItem*)lParam; iHitItem = pItem->GetIconIndex(); |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Right :)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |