Print Page | Close Window

CXTPTabClientWnd

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=15813
Printed Date: 23 May 2024 at 12:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabClientWnd
Posted By: feffe
Subject: CXTPTabClientWnd
Date Posted: 10 December 2009 at 10:23am

Hi,

I'd like to

1. change the tabs heihgt in my CXTPTabClientWnd.

2.add a contextmenu: when the user right-clicks a tab, a contextmenu is opened for closing the cuurent window or
all opened windows.
 
Any suggestion/sample can I have a look at?
 
Thanks a lot



Replies:
Posted By: mgampi
Date Posted: 10 December 2009 at 12:53pm
Hi;

Showing a context menu is easy:

Catch the WM_XTP_PRETRANSLATEMOUSEMSG in your tab owner and in the handler do this:

LRESULT CMainFrame::OnTabbarMouseMsg( WPARAM wp, LPARAM lp ) {
    CPoint point = CPoint(static_cast<DWORD>(lp));

    CXTPTabManagerItem* pItem = _tabClient.HitTest(point);

    if (pItem) {
       if (wp == WM_RBUTTONDOWN) {

          CWnd* pFrame = CWnd::FromHandle(pItem->GetHandle());
          MDIActivate(pFrame);

          _tabClient.Refresh();

          CMenu menuPopup;
          VERIFY(menuPopup.LoadMenu(IDR_WORKSPACE_POPUP));

          _tabClient.WorkspaceToScreen(&point);
          GetCommandBars()->TrackPopupMenuEx(menuPopup.GetSubMenu(0), 0, point.x, point.y, this);

          _tabClient.Refresh();

          return TRUE;
       }
    }

    return FALSE;

}




-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: feffe
Date Posted: 11 December 2009 at 3:16am
Thank you very much!
 
For me it's difficult to find out these message in Codejock.
Now I'll try to see if there are simple command also for closing all opened views.
 
EDIT: I've tried this.
 

void CMainFrame::OnCloseAllButThis()
{  int nCount = _tabClient.GetItemCount();
   CXTPTabManagerItem *pItem;
   for( int i = 0; i < nCount; i++ )
   {  pItem = _tabClient.GetItem(i);
       if( pItem)
        {  pFrame = CWnd::FromHandle(pItem->GetHandle());
            if( pFrame != MDIGetActive() )
                pFrame->PostMessage(WM_CLOSE,0,0);
        }
    }
}
 


Posted By: mgampi
Date Posted: 11 December 2009 at 4:45am
Hi;

I do it this way:

Whenever the app creates a new view, I put a pointer to this view into a container by calling a Register function of my main window. When the user closes the view I call a Deregister function of the main window to erase the pointer from this container.
So when the user executes a close all command I only have to loop through the container and post a WM_CLOSE message to the view. Deregister is called by the view while closing. Keep this in mind when interating through the container...



-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: feffe
Date Posted: 11 December 2009 at 5:24am

Ok, thanks.

For the tab heights, any suggestion?

I always have problem when I try to resize ribbon, tabs etc when my application is skinned

:(



Posted By: mgampi
Date Posted: 11 December 2009 at 5:33am
Originally posted by feffe feffe wrote:

Ok, thanks.

For the tab heights, any suggestion?

I always have problem when I try to resize ribbon, tabs etc when my application is skinned

:(


Sorry, no idea!


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: jimmy
Date Posted: 11 December 2009 at 6:04am
Hi,

The height is calculate automatic with the font size.
Change font size, than the height will change.
Look for m_nButtonHeight in the XTPTabPaintManagerAppearance.cpp.
Another way is change the button margin. (Tab Manager Sample). With Copy/Paste you can insert -3 int the top & bottom of
Button Margin.

  Jimmy



Posted By: feffe
Date Posted: 11 December 2009 at 6:43am
Thank you very much guys!
 
My work goes on much faster now
 
I've tried to set button margin, it still remains this problem:
 
 
but maybe it's enough to change font height.
BTW... a simple call to SetFont? It doesn't seem to work.
 
If you have any suggestion about my ribbonbuttons post...
 
Thank you so much!


Posted By: jimmy
Date Posted: 11 December 2009 at 7:22am

Sorry, have no suggestion about your ribbon button trouble.
I don't use ribbin bar.

  Jimmy



Posted By: feffe
Date Posted: 11 December 2009 at 8:49am
Changing the font?
... Through the skin builder?


Posted By: jimmy
Date Posted: 11 December 2009 at 9:03am
I don't know realy. But the Paint Manager has function SetFontIndirect

TabManager->GetPaintManager()->SetFontIndirect

  Jimmy




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