2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
31 #include "TearoffContainerWindow.h"
35 class CTabsDlg : public CDialog
37 // DECLARE_DYNAMIC ( CTabsDlg )
41 CTabsDlg(UINT ID ,CWnd* pParent = NULL); // standard constructor
43 typedef void (*pfnOnDockEvent)( bool , int , CWnd* );
45 void AddDockedWindow ( CWnd* wnd , int ID , int imageID , const CString& title , bool dock , pfnOnDockEvent dockCallback = NULL);
46 void DockWindow ( int ID , bool dock );
47 bool RectWithinDockManager ( CRect& rect );
48 void FocusWindow ( int ID );
49 void SetImageList ( CImageList* list )
52 m_Tabs.SetImageList( list );
55 bool IsDocked ( CWnd* wnd );
58 int CTabsDlg::PreTranslateMessage ( MSG* msg );
62 CImageList m_TabImages;
63 CPoint m_DragDownPoint;
64 CMapWordToPtr m_Windows;
67 void DoDataExchange(CDataExchange* pDX);
69 //private struct that holds the info we need about each window
70 struct DockedWindowInfo {
71 DockedWindowInfo ( CWnd* wnd , int ID , int imageID , const CString& title = "" , pfnOnDockEvent dockCallback = NULL)
77 m_TabControlIndex = -1;
78 if ( title.GetLength() == 0 )
80 m_Window->GetWindowText( m_Title );
88 m_DockCallback = dockCallback;
91 enum eState {DOCKED,FLOATING} ;
92 CTearoffContainerWindow m_Container; //the floating window that will hold m_Window when it's undocked
97 int m_TabControlIndex;
99 pfnOnDockEvent m_DockCallback;
101 void ShowAllWindows ( bool show = true );
103 void HandleUndock ();
104 void UpdateTabControlIndices ();
106 // Generated message map functions
107 virtual BOOL OnInitDialog();
108 DECLARE_MESSAGE_MAP()
112 afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
113 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
114 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
115 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
116 afx_msg void OnDestroy();
118 void SaveWindowPlacement ( int ID = -1 );