Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Don't get notifications of task panel
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Don't get notifications of task panel

 Post Reply Post Reply
Author
Message
mailhaim View Drop Down
Newbie
Newbie


Joined: 28 September 2005
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote mailhaim Quote  Post ReplyReply Direct Link To This Post Topic: Don't get notifications of task panel
    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....

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: 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
Back to Top
mailhaim View Drop Down
Newbie
Newbie


Joined: 28 September 2005
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote mailhaim Quote  Post ReplyReply Direct Link To This Post 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?


Back to Top
mailhaim View Drop Down
Newbie
Newbie


Joined: 28 September 2005
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote mailhaim Quote  Post ReplyReply Direct Link To This Post 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);
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.031 seconds.