Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Quick Task Panel Question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Quick Task Panel Question

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

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Topic: Quick Task Panel Question
    Posted: 09 March 2006 at 8:07am
I have a CXTPTaskPanel in my CMainFrame and I'm adding items like:

CXTPTaskPanelGroup* pGroupNew = m_taskPanel.AddGroup(...);
pGroupNew->AddLinkItem(ID_FILE_OPEN, 0);
pGroupNew->AddLinkItem(ID_FILE_NEW, 3);

Question 1) All of the ID_ items I'm adding are already handled in my app (doc/frame/view), and I just want to have the click notifications handled as if they were picked off of the menu, so I added the following:

LRESULT CMainFrame::OnTaskPanelNotify(WPARAM wParam, LPARAM lParam)
{
    if(XTP_TPN_CLICK==wParam){
        CXTPTaskPanelGroupItem* pItem =
                (CXTPTaskPanelGroupItem*)lParam; 
        PostMessage(WM_COMMAND, pItem->GetID(), 0);
    }
    return 0;
}

a) Is this the correct way to do this?
b) Is it okay to use SendMessage instead of PostMessage?
c) The helps says:
// If the application is to process this message, the return value should be TRUE, otherwise the return value is FALSE.
but I wasn't sure what I should return in this case (i.e. what does "process this message" refer to in this context? as the default behaviour doens't seem to do anything?)

Question 2) Since I'm re-using the IDs from my menus and toolbars, how do I get the images to get loaded from those toolbars?
Right now I have to maintain a duplicate image list.

Thanks

Warren
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 09 March 2006 at 10:11am

1. Yes, you can use SendMessage

2. Just something like

XTPImageManager()->InternalAddRef();

m_wndTaskPanel.SetImageManager(XTPImageManager());

 

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.078 seconds.