Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPTabClientWnd
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabClientWnd

 Post Reply Post Reply
Author
Message
feffe View Drop Down
Groupie
Groupie


Joined: 04 September 2009
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote feffe Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabClientWnd
    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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
feffe View Drop Down
Groupie
Groupie


Joined: 04 September 2009
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote feffe Quote  Post ReplyReply Direct Link To This Post 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);
        }
    }
}
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
feffe View Drop Down
Groupie
Groupie


Joined: 04 September 2009
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote feffe Quote  Post ReplyReply Direct Link To This Post 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

:(

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

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
feffe View Drop Down
Groupie
Groupie


Joined: 04 September 2009
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote feffe Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2009 at 7:22am

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

  Jimmy

Back to Top
feffe View Drop Down
Groupie
Groupie


Joined: 04 September 2009
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote feffe Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2009 at 8:49am
Changing the font?
... Through the skin builder?
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2009 at 9:03am
I don't know realy. But the Paint Manager has function SetFontIndirect

TabManager->GetPaintManager()->SetFontIndirect

  Jimmy

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