Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - TaskPanel Vs. CXTOutBarCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskPanel Vs. CXTOutBarCtrl

 Post Reply Post Reply
Author
Message
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Topic: TaskPanel Vs. CXTOutBarCtrl
    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 ????
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: 03 September 2007 at 7:16am
Hello,
 
Call m_wndOutlookBar.GetImageManager()->SetIcons(...);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 06 September 2007 at 6:41am

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;



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: 07 September 2007 at 2:01am
Hi,
Guess problem in m_pIconId. it muse be UINT pointer
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post 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 :)
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: 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
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post 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....

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: 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
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post 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 ???? */
}


Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2007 at 6:41am
Oleg,
Problem is solved:

CXTPTaskPanelGroupItem* pItem = (CXTPTaskPanelGroupItem*)lParam;
iHitItem = pItem->GetIconIndex();


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: 12 September 2007 at 9:12am
Right :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.156 seconds.