![]() |
Combine Shortcutbar and taskpanel? |
Post Reply
|
| Author | |
Martin
Newbie
Joined: 26 April 2005 Location: Netherlands Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Topic: Combine Shortcutbar and taskpanel?Posted: 26 September 2005 at 8:40am |
|
Hello, can anyone tell me if it's possible to combine the shortcutbar with the taskpanel? If I select an item from the shortcutbar, I want a taskpanel to appear in the upper section of the shortcutbar (I want to show tasks depending on the selection). I tried to get it to work, but either the taskpanel "overwrites" the shortcutbar or the taskpanel doesn't show at all. Any help is appreciated. Regards, |
|
![]() |
|
nchernick
Newbie
Joined: 16 May 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 September 2005 at 11:57am |
|
Yes this is possible. I am doing it in an application I have. How are you creating the taskpanel?
|
|
![]() |
|
Martin
Newbie
Joined: 26 April 2005 Location: Netherlands Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 September 2005 at 9:51am |
|
Actually I am not sure how to create it, this is what I've tried so far: I first create the taskpanel, as such: if (!m_wndTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS| WS_CLIPCHILDREN, CRect(0, 0, 0, 0), this, 0)) return FALSE; I then create the shortcutbar and attach the taskpanel as follows: m_wndShortcutBar.AddItem(ID_TASKITEM, &m_wndTaskPanel); But I lost all my changes (I revert them back to the old situation) so I am not sure what combinations I already tried. I am almost certain that the creation of the taskpanel isn't correct or that I forget to call an additional member function to set it up correctly. Maybe you can give me some pointers on how to do it? TIA, Edited by Martin |
|
![]() |
|
nchernick
Newbie
Joined: 16 May 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 September 2005 at 10:17am |
|
Well, let's give it a shot....
The way I have done this is to create a class for each pane of your shortcutbar and base it off of CXTPShortcutBarPane (class CMyPane : public CXTPShortcutBarPane). Make sure the class has a CXTPTaskPanel object defined (CXTPTaskPanel m_wndTaskPanel) In the Create Function of this class is where I create my TaskPanel(s). --> m_wndTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS _CLIPSIBLINGS|WS_CLIPCHILDREN, CXTPEmptyRect(), this, ID_SHORTCUT_SHORTPANE); <-- where the last parameter is the ID of the Shortcutbar window you want the task panel created in. So in the MainFrame when you create the ShortCutBar window you do something like this: &nbs p; m_wndShortcutBar.Create(WS_CHILD|WS_VISIBLE|WS_CLI PCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, ID_SHORTCUTBAR); &nbs p; VERIFY(m_paneMyPane.Create(_T("MyPane" ), &m_wndShortcutBar)); CXTPShortcutBarItem* pItem = m_wndShortcutBar.AddItem(ID_SHORTCUT_SHORTPANE, & nbsp; &m_paneMyPane); where: m_wndShortcutBar is a CXTPShortcutBar and m_paneMyPane is a CMyPane One more thing that tripped me up a little was when/where the shortcutbar is created. If you follow some of CodeJock's Samples where they create these things you should be OK. Hope this helps! |
|
![]() |
|
Martin
Newbie
Joined: 26 April 2005 Location: Netherlands Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 September 2005 at 8:07am |
|
Hello, first of all thanks a lot for your quite complete solution! I unfortunately don't have time to look at it today but I will try it next week and will let you know if I succeeded or not (I probably will, since it's almost copy paste Take care, |
|
![]() |
|
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 |