Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Code to move tabs in CXTPTabClientWnd?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Code to move tabs in CXTPTabClientWnd?

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: Code to move tabs in CXTPTabClientWnd?
    Posted: 30 March 2005 at 12:26am

Is it possible to move tabs and create new workspaces with CXTPTabClientWnd (groups are enabled) using just code?

I want to create two child windows (maybe, they could exist already) and put them in two different tab group workspaces. I need to create workspaces if there is less than two, and put the two newly created windows into the last two tab groups (if the user has created more than two of them).

I can't seem to see a way. I am trying to derive from CXTPTabClientWnd but many things are private such as DoWorkspaceCommand()

Edited by Ark42
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 30 March 2005 at 8:30am
Did you tried

OnWorkspaceCommand?

 

try

OnWorkspaceCommand(XTP_ID_WORKSAPCE_NEWVERTICAL);

OnWorkspaceCommand(XTP_ID_WORKSAPCE_MOVEPREVIOUS);

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2005 at 10:41am

Yes but MOVEPREVIOUS/MOVENEXT don't help when I need to move to a specific workspace.

Also, NEWVERTICAL and many other MTI related stuff doesn't work if I wrap my code with:
::SendMessage(m_hWndMDIClient, WM_SETREDRAW, FALSE, 0);
//create and/or move child windows and/or workspaces
::SendMessage(m_hWndMDIClient, WM_SETREDRAW, TRUE, 0);
::RedrawWindow(m_hWndMDIClient, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN | RDW_FRAME);

In order to prevent flickering.

Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2005 at 6:12pm
Here are the functions I added to my derived class that I felt were useful for programmatically moving windows around in the workspaces:
I did have to put DoWorkspaceCommand() as protected instead of private so that I could use it.

int MyCXTPTabClientWndDerivedClass::GetActiveWorkspace(void)
{
    return GetWndWorkspace(MDIGetActive());
}

int MyCXTPTabClientWndDerivedClass::GetWndWorkspace(CWnd *pWnd)
{
    if( !pWnd ) {
        return -1;
    }
    CXTPTabManagerItem* pItem = FindItem(pWnd->m_hWnd);
    if( !pItem ) {
        return -1;
    }
    return FindIndex(pItem->GetTabManager());
}

void MyCXTPTabClientWndDerivedClass::MoveWndToWorkspace(CWnd *pWnd, int nNum)
{
    CXTPTabManagerItem *pItem = FindItem(pWnd->GetSafeHwnd());

    if( pItem != NULL ) {
        int nCount = GetWorkspaceCount();
        if( nNum < nCount ) {
            CWorkspace *pDest = GetWorkspace(nNum);
            if( pDest != pItem->GetTabManager() ) {
                DoWorkspaceCommand(pItem, pDest, ACTION_ATTACH);
            }
        } else {
            DoWorkspaceCommand(pItem, GetWorkspace(nCount - 1), ACTION_INSERTVERT);
        }
    }
}

void MyCXTPTabClientWndDerivedClass::EnsureTabVisible(CWnd *pWnd)
{
    CXTPTabManagerItem *pItem = FindItem(pWnd->GetSafeHwnd());

    if( pItem != NULL ) {
        pItem->GetTabManager()->EnsureVisible(pItem);
    }
}

Do you think DoWorkspaceCommand() could become protected instead in the next release so I can continue to use these functions?

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 06 April 2005 at 4:56am

Yes, we changed it to protected.

Thank you!

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
maxjock View Drop Down
Newbie
Newbie


Joined: 20 April 2005
Location: Romania
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote maxjock Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2005 at 7:33am

I use Xtreme Toolkit Pro v9.60 - 30 days trial version to build a demo application so that my boss could take the decision to buy your library.

I need to do exactly what Ark42 want to do, but I don't have a licence (and the source code of the library).

I tried OnWorkspaceCommand(XTP_ID_WORKSAPCE_NEWVERTICAL); but it doesn't work.

I can not use a class like MyCXTPTabClientWndDerivedClass because ACTION_ATTACH and ACTION_INSERTVERT are not defined and of course DoWorkspaceCommand is private.

Tell me if there is any workaround.

Many thanks in advance.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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 April 2005 at 11:20pm
Please, wait 9.70. We are preparing it now.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
maxjock View Drop Down
Newbie
Newbie


Joined: 20 April 2005
Location: Romania
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote maxjock Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2005 at 2:48am
I am working under pressure and I need to know when 9.70 will be released.

Thanks again.
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.109 seconds.