Print Page | Close Window

Combine Shortcutbar and taskpanel?

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


Topic: Combine Shortcutbar and taskpanel?
Posted By: Martin
Subject: Combine Shortcutbar and taskpanel?
Date 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




Replies:
Posted By: nchernick
Date 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?


Posted By: Martin
Date 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



Posted By: nchernick
Date 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!




Posted By: Martin
Date 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




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