Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Combine Shortcutbar and taskpanel?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combine Shortcutbar and taskpanel?

 Post Reply Post Reply
Author
Message
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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,
Martin

Back to Top
nchernick View Drop Down
Newbie
Newbie


Joined: 16 May 2004
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote nchernick Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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,
Martin



Edited by Martin
Back to Top
nchernick View Drop Down
Newbie
Newbie


Joined: 16 May 2004
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote nchernick Quote  Post ReplyReply Direct Link To This Post 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!


Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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,
Martin

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.061 seconds.