TaskPanel Vs. CXTOutBarCtrl
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=7891
Printed Date: 04 December 2024 at 1:46pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: TaskPanel Vs. CXTOutBarCtrl
Posted By: amitb
Subject: TaskPanel Vs. CXTOutBarCtrl
Date 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 ????
|
Replies:
Posted By: Oleg
Date Posted: 03 September 2007 at 7:16am
Hello,
Call m_wndOutlookBar.GetImageManager()->SetIcons(...);
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: amitb
Date Posted: 06 September 2007 at 6:41am
m_wndOutlookBar.GetImageManager()->SetIcons(...);
Syntax (using CImageList) shows: CXTPImageManager__SetIcons@UINT@XTPImageState.html - 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;
|
Posted By: Oleg
Date Posted: 07 September 2007 at 2:01am
Hi,
Guess problem in m_pIconId. it muse be UINT pointer
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: amitb
Date Posted: 07 September 2007 at 7:50am
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 :)
|
Posted By: Oleg
Date Posted: 07 September 2007 at 8:14am
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
|
Posted By: amitb
Date Posted: 07 September 2007 at 8:54am
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....
|
Posted By: Oleg
Date Posted: 07 September 2007 at 10:41am
Hi,
Think you didn't set IconIndex for Items. its second parameter in AddLinkItem.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: amitb
Date Posted: 12 September 2007 at 6:14am
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 ???? */ }
|
Posted By: amitb
Date Posted: 12 September 2007 at 6:41am
Oleg, Problem is solved:
CXTPTaskPanelGroupItem* pItem = (CXTPTaskPanelGroupItem*)lParam; iHitItem = pItem->GetIconIndex();
|
Posted By: Oleg
Date Posted: 12 September 2007 at 9:12am
Right :)
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
|