-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAPVIEW.H
109 lines (94 loc) · 4.75 KB
/
MAPVIEW.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef TABVIEW_H
#define TABVIEW_H
// tabview.h : interface of the CMapView class
// Written by Gerry High
// V1.2 4/13/94
//
/////////////////////////////////////////////////////////////////////////////
class CTabInfo : public CObject
{
public:
CTabInfo(){m_tabWidth = 0;m_tabLabel = NULL;m_pView = NULL;m_mnemonic = (char)0;m_active=TRUE;}
~CTabInfo()
{
if(m_tabLabel) delete m_tabLabel;
//don't need to delete view since it will
//be handled by the delete of the parent
// if(m_pView) delete m_pView;
}
int m_tabWidth; // width of tab
char* m_tabLabel; // label of tab
CView* m_pView; // pointer to CView object
char m_mnemonic; // character of mnemonic
BOOL m_active; //is this tab active?
};
enum eLookAndFeel { LAF_CHICAGO,LAF_MSWORD};
enum eTabPosition
{ TABSONTOP, TABSONLEFT, TABSONLEFTBOT,TABSONRIGHT, TABSONRIGHTBOT, TABSONBOTTOM };
class CMapView : public CView
{
protected: // create from serialization only
CMapView();
DECLARE_DYNCREATE(CMapView)
// Attributes
public:
// Operations
public:
// Implementation
public:
virtual ~CMapView();
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate();
virtual CView* addTabView(CRuntimeClass* viewClass,CDocument* document,
char* tabLabel, BOOL border = FALSE,BOOL show = TRUE,int tabWidth = 100);
BOOL doSysCommand(UINT nID,LONG lParam);
void enableView(int viewIndex, BOOL bEnable = TRUE);
void setFrameBorderOn(BOOL on = TRUE);
void setLAF(eLookAndFeel LAF=LAF_MSWORD);
void setMargin(int margin=7);
void setTabHeight(int height=25);
void setTabPosition(eTabPosition tabPos=TABSONTOP);
virtual void switchTab(int viewIndex);
protected:
virtual CView* createTabView(CRuntimeClass* viewClass,CDocument* document,CWnd* parentWnd,
BOOL border,BOOL show);
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CMapView)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void createFonts();
void drawChicagoTabs(CDC *pDC, CPen& blackPen, CPen& darkPen, CPen& lightPen, CPen *pOldPen);
void drawMSWordTabs(CDC *pDC, CPen& blackPen, CPen& darkPen, CPen& lightPen, CPen *pOldPen);
void drawMSWordTopTabs(CDC *pDC, CPen& blackPen, CPen& darkPen, CPen& lightPen, CPen *pOldPen);
void drawMSWordLeftTabs(CDC *pDC, CPen& blackPen, CPen& darkPen, CPen& lightPen, CPen *pOldPen);
void drawMSWordRightTabs(CDC *pDC, CPen& blackPen, CPen& darkPen, CPen& lightPen, CPen *pOldPen);
void repositionViews();
BOOL switchTopTab(CPoint point);
BOOL switchVerticalTab(CPoint point);
int m_width; //view width
int m_height; //view height
int m_curTab; //index of current tab
int m_nTabs; //number of tabs
int m_tabHeight; //height of a tab (including margins, etc.)
CObArray m_tabArray; //array of CTabInfo objects
CView* m_curView; //current view
eLookAndFeel m_lookAndFeel; // Look of Tabs (either LAF_CHICAGO or LAF_MSWORD)
int m_margin; //margin around tab "pages"
eTabPosition m_position; //position of tabs
int m_lfEscapement; //font escapement (rotation)
BOOL m_frameBorderOn;// draw tab page frame?
CFont* m_normalFont; //font of non-current tab
CFont* m_boldFont; //font of current tab
};
/////////////////////////////////////////////////////////////////////////////
#endif //TABVIEW_H