-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsizecbar.h
212 lines (174 loc) · 6.62 KB
/
sizecbar.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#if !defined(__SIZECBAR_H__)
#define __SIZECBAR_H__
#include <afxpriv.h> // for CDockContext
#include <afxtempl.h> // for CTypedPtrArray
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME)
#error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME"
#endif
/////////////////////////////////////////////////////////////////////////
// CSCBDockBar dummy class for access to protected members
class CSCBDockBar : public CDockBar
{
friend class CSizingControlBar;
};
/////////////////////////////////////////////////////////////////////////
// CSizingControlBar control bar styles
#define SCBS_EDGELEFT 0x00000001
#define SCBS_EDGERIGHT 0x00000002
#define SCBS_EDGETOP 0x00000004
#define SCBS_EDGEBOTTOM 0x00000008
#define SCBS_EDGEALL 0x0000000F
#define SCBS_SHOWEDGES 0x00000010
#define SCBS_SIZECHILD 0x00000020
/////////////////////////////////////////////////////////////////////////
// CSizingControlBar control bar
#ifndef baseCSizingControlBar
#define baseCSizingControlBar CControlBar
#endif
class CSizingControlBar;
typedef CTypedPtrArray <CPtrArray, CSizingControlBar*> CSCBArray;
class CSizingControlBar : public baseCSizingControlBar
{
DECLARE_DYNAMIC(CSizingControlBar);
// Construction
public:
CSizingControlBar();
virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
CSize sizeDefault, BOOL bHasGripper,
UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
// Attributes
public:
const BOOL IsFloating() const;
const BOOL IsHorzDocked() const;
const BOOL IsVertDocked() const;
const BOOL IsSideTracking() const;
const BOOL GetSCBStyle() const {return m_dwSCBStyle;}
// Operations
public:
#if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION)
void EnableDocking(DWORD dwDockStyle);
#endif
virtual void LoadState(LPCTSTR lpszProfileName);
virtual void SaveState(LPCTSTR lpszProfileName);
static void GlobalLoadState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
static void GlobalSaveState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
void SetSCBStyle(DWORD dwSCBStyle)
{m_dwSCBStyle = (dwSCBStyle & ~SCBS_EDGEALL);}
// Overridables
virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSizingControlBar)
public:
virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSizingControlBar();
protected:
// implementation helpers
UINT GetEdgeHTCode(int nEdge);
BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
virtual void StartTracking(UINT nHitTest, CPoint point);
virtual void StopTracking();
virtual void OnTrackUpdateSize(CPoint& point);
virtual void OnTrackInvertTracker();
virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID);
virtual void AlignControlBars();
void GetRowInfo(int& nFirst, int& nLast, int& nThis);
void GetRowSizingBars(CSCBArray& arrSCBars);
void GetRowSizingBars(CSCBArray& arrSCBars, int& nThis);
BOOL NegotiateSpace(int nLengthTotal, BOOL bHorz);
protected:
DWORD m_dwSCBStyle;
UINT m_htEdge;
CSize m_szHorz;
CSize m_szVert;
CSize m_szFloat;
CSize m_szMinHorz;
CSize m_szMinVert;
CSize m_szMinFloat;
int m_nTrackPosMin;
int m_nTrackPosMax;
int m_nTrackPosOld;
int m_nTrackEdgeOfs;
BOOL m_bTracking;
BOOL m_bKeepSize;
BOOL m_bParentSizing;
BOOL m_bDragShowContent;
UINT m_nDockBarID;
int m_cxEdge;
// Generated message map functions
protected:
//{{AFX_MSG(CSizingControlBar)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnNcPaint();
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
afx_msg UINT OnNcHitTest(CPoint point);
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnPaint();
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
#ifdef _SCB_REPLACE_MINIFRAME
friend class CSCBMiniDockFrameWnd;
#endif //_SCB_REPLACE_MINIFRAME
};
#ifdef _SCB_REPLACE_MINIFRAME
#ifndef _SCB_MINIFRAME_CAPTION
/////////////////////////////////////////////////////////////////////////
// CSCBDockContext dockcontext
class CSCBDockContext : public CDockContext
{
public:
// Construction
CSCBDockContext(CControlBar* pBar) : CDockContext(pBar) {}
// Drag Operations
virtual void StartDrag(CPoint pt);
};
#endif //_SCB_MINIFRAME_CAPTION
/////////////////////////////////////////////////////////////////////////
// CSCBMiniDockFrameWnd miniframe
#ifndef baseCSCBMiniDockFrameWnd
#define baseCSCBMiniDockFrameWnd CMiniDockFrameWnd
#endif
class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd
{
DECLARE_DYNCREATE(CSCBMiniDockFrameWnd)
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSCBMiniDockFrameWnd)
public:
virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
//}}AFX_VIRTUAL
// Implementation
public:
CSizingControlBar* GetSizingControlBar();
//{{AFX_MSG(CSCBMiniDockFrameWnd)
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //_SCB_REPLACE_MINIFRAME
#endif // !defined(__SIZECBAR_H__)