Print Page | Close Window

Quick Task Panel Question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3748
Printed Date: 10 November 2025 at 1:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Quick Task Panel Question
Posted By: Warren
Subject: Quick Task Panel Question
Date 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



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net