![]() |
Don't get notifications of task panel |
Post Reply
|
| Author | |
mailhaim
Newbie
Joined: 28 September 2005 Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
Topic: Don't get notifications of task panelPosted: 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.... |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
mailhaim
Newbie
Joined: 28 September 2005 Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
mailhaim
Newbie
Joined: 28 September 2005 Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
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); |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |