-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathMDITabs.h
84 lines (70 loc) · 2.72 KB
/
MDITabs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/****************************************************************************\
Datei : MDITabs.h
Projekt: MDITabs, a tabcontrol for switching between MDI-views
Inhalt : EMDITabStyles, CMDITabs declaration
Datum : 03.10.2001
Autor : Christian Rodemeyer
Hinweis: (C) 2001 by Christian Rodemeyer
\****************************************************************************/
#pragma once
#ifndef __MDITABS_H
#define __MDITABS_H
/****************************************************************************\
EMDITabStyles: Styles for customizing the appeareance of CMDITabs
\****************************************************************************/
enum EMDITabStyles
{
MT_BOTTOM = 0x0000, // places tabs at bottom (default)
MT_TOP = 0x0001, // place tabs at top
MT_IMAGES = 0x0002, // show images
MT_HIDEWLT2VIEWS = 0x0004, // Hide Tabs when less than two views are open (default is one view)
MT_TOOLTIPS = 0x0008, // not implemented (a tooltip can appear about a tab)
MT_BUTTONS = 0x0010, // not implemented (show tabs as buttons)
MT_AUTOSIZE = 0x0020, // not implemented (tabs are sized to fit the entire width of the control)
MT_TASKBAR = 0x0038 // MT_TOOLTIPS|MT_BUTTONS|MT_AUTOSIZE
};
enum EWMMTGetInfo
{
WM_GETTABTIPTEXT = WM_APP + 0x0393, // send to associated view to get a tip text
WM_GETTABSYSMENU = WM_APP + 0x0394 // if neccessary, the view can provide a different systemmenu by answering this message
};
/****************************************************************************\
CMdiTabs: Deklaration
\****************************************************************************/
class CMDITabs : public CTabCtrl
{
public:
CMDITabs();
void Create(CFrameWnd* pMainFrame, DWORD dwStyle = MT_BOTTOM|MT_IMAGES);
void Update(); // sync the tabctrl with all views
void SetMinViews(int minViews) {m_minViews = minViews;}
private:
HWND m_mdiClient;
int m_height;
int m_width;
CImageList m_images;
int m_minViews; // minimum number of views
bool m_bImages;
bool m_bTop;
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMDITabs)
//}}AFX_VIRTUAL
// Implementation
public:
// added by NJG to see if we ever used them
const bool InUse () const { return m_mdiClient != NULL; }
// Generated message map functions
protected:
//{{AFX_MSG(CMDITabs)
afx_msg void OnSelChange(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnPaint();
afx_msg void OnNcPaint();
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
//}}AFX_MSG
afx_msg LRESULT OnSizeParent(WPARAM, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
#endif