Print Page | Close Window

Don't get notifications of task panel

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=5113
Printed Date: 11 November 2025 at 7:33am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Don't get notifications of task panel
Posted By: mailhaim
Subject: Don't get notifications of task panel
Date Posted: 21 September 2006 at 5:37am
Hi,
I have a shortcut bar inside a docking pane.
One of the shortcut bar panes implemented as derived task panel class.
For some reason my override to OnStartItemDrag does NOT get called.
Trying to catch XTPWM_TASKPANEL_NOTIFY in main frame window (owner of the task panel) FAILS also.

What is the problem here?

Here is a code snippest:

In MainFrm.h:
CXTPShortcutBar             m_modelsShortcutBar;
CXTPShortcutBarPane     m_basicShortcutBarPane;
CComponentsTaskPanel m_basicTaskPanel;   // derived from CXTPTaskPanel

In MainFrm.cpp (OnCreate)
// Shortcut Bar
m_modelsShortcutBar.Create( WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this,  IDC_MODELS_SHORTCUT_BAR_ID);
m_modelsShortcutBar.SetOwner(this);
// Shortcut Bar Pane
VERIFY(m_basicShortcutBarPane.Create(_T("Basic Components"), &m_modelsShortcutBar));   
CXTPShortcutBarItem* pBasicShortcutBarPane = m_modelsShortcutBar.AddItem(ID_MODELS_SHORTCUT_BAR_COMPONENTS_ID, &m_basicShortcutBarPane);
// Task Panel    VERIFY(m_basicTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, CRect(0, 0, 0, 0), &m_basicShortcutBarPane, 0));
m_basicShortcutBarPane.AddItem(_T("Basic Components"), &m_basicTaskPanel, 115);
m_basicTaskPanel.SetOwner(this);   

From CComponentsTaskPanel::OnCreate:
{
    ...
    int res = CXTPTaskPanel::OnCreate(lpCreateStruct);
    AllowDrag(0x01);    // 0x80: xtpTaskItemAllowDragMoveOutsideControl
    ...
    return res;
}

Please helppp....




Replies:
Posted By: Oleg
Date Posted: 21 September 2006 at 7:29am
Hello,
 
XTPWM_TASKPANEL_NOTIFY  with code = XTP_TPN_STARTDRAG must be send. Try to set breakpoint in CXTPTaskPanel::OnStartItemDrag and check it was called.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mailhaim
Date Posted: 21 September 2006 at 8:47am
Hi Oleg,
Thanks for the tipe.
It seems that dragging is only supported for groups and link items (see CXTPTaskPanelItem::IsAcceptFocus()) and I have text items

I believe that deriving an item and overrriding IsAcceptFocus() will do the trick, but I'm not sure if I should override CXTPTaskPanelGroupItem or CXTPTaskPanelItem.

What do you say? Is there another way?




Posted By: mailhaim
Date Posted: 21 September 2006 at 9:17am
Hi,
Overriding CXTPTaskPanelGroupItem done the job. Thanks again.

Code snippest:
class CComponentsTaskPanelItem : public CXTPTaskPanelGroupItem
{
    virtual BOOL IsAcceptFocus() { return TRUE; }
};

CComponentsTaskPanelItem* pItem = new CComponentsTaskPanelItem();
pItem->SetType(xtpTaskItemTypeText);
pItem->SetCaption(pGroupMember->text);
pItem->AllowDrag(0x80);    // xtpTaskItemAllowDragMoveOutsideControl
pItem->SetIconIndex(pGroupMember->iconIndex);
pItem->SetID(pGroupMember->id);
m_pTPGroup->GetItems()->Add(pItem, pGroupMember->id);



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