00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00028
00029 #if !defined(__SIZECBAR_H__)
00030 #define __SIZECBAR_H__
00031
00032 #include <afxpriv.h>
00033 #include <afxtempl.h>
00034
00035 #if _MSC_VER >= 1000
00036 #pragma once
00037 #endif // _MSC_VER >= 1000
00038
00039
00040 #if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME)
00041 #error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME"
00042 #endif
00043
00045
00046
00047 class CSCBDockBar : public CDockBar
00048 {
00049 friend class CSizingControlBar;
00050 };
00051
00053
00054
00055 #define SCBS_EDGELEFT 0x00000001
00056 #define SCBS_EDGERIGHT 0x00000002
00057 #define SCBS_EDGETOP 0x00000004
00058 #define SCBS_EDGEBOTTOM 0x00000008
00059 #define SCBS_EDGEALL 0x0000000F
00060 #define SCBS_SHOWEDGES 0x00000010
00061 #define SCBS_SIZECHILD 0x00000020
00062
00064
00065
00066 #ifndef baseCSizingControlBar
00067 #define baseCSizingControlBar CControlBar
00068 #endif
00069
00070 class CSizingControlBar;
00071 typedef CTypedPtrArray <CPtrArray, CSizingControlBar*> CSCBArray;
00072
00073 class CSizingControlBar : public baseCSizingControlBar
00074 {
00075 DECLARE_DYNAMIC(CSizingControlBar);
00076
00077
00078 public:
00079 CSizingControlBar();
00080
00081 virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
00082 CSize sizeDefault, BOOL bHasGripper,
00083 UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
00084 virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
00085 UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
00086
00087
00088 public:
00089 const BOOL IsFloating() const;
00090 const BOOL IsHorzDocked() const;
00091 const BOOL IsVertDocked() const;
00092 const BOOL IsSideTracking() const;
00093 const BOOL GetSCBStyle() const {return m_dwSCBStyle;}
00094
00095
00096 public:
00097 #if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION)
00098 void EnableDocking(DWORD dwDockStyle);
00099 #endif
00100 virtual void LoadState(LPCTSTR lpszProfileName);
00101 virtual void SaveState(LPCTSTR lpszProfileName);
00102 static void GlobalLoadState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
00103 static void GlobalSaveState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
00104 void SetSCBStyle(DWORD dwSCBStyle)
00105 {m_dwSCBStyle = (dwSCBStyle & ~SCBS_EDGEALL);}
00106
00107 void SetHeight(const int nHeight)
00108 {
00109 m_szFloat.cy = m_szHorz.cy = m_szVert.cy = nHeight;
00110 m_pDockSite->DelayRecalcLayout();
00111 }
00112
00113
00114
00115 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00116
00117
00118 public:
00119
00120
00121 public:
00122 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00123 virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);
00124
00125
00126
00127 public:
00128 virtual ~CSizingControlBar();
00129
00130 protected:
00131
00132 UINT GetEdgeHTCode(int nEdge);
00133 BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
00134 virtual void StartTracking(UINT nHitTest, CPoint point);
00135 virtual void StopTracking();
00136 virtual void OnTrackUpdateSize(CPoint& point);
00137 virtual void OnTrackInvertTracker();
00138 virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
00139 virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID);
00140
00141 virtual void AlignControlBars();
00142 void GetRowInfo(int& nFirst, int& nLast, int& nThis);
00143 void GetRowSizingBars(CSCBArray& arrSCBars);
00144 void GetRowSizingBars(CSCBArray& arrSCBars, int& nThis);
00145 BOOL NegotiateSpace(int nLengthTotal, BOOL bHorz);
00146
00147 protected:
00148 DWORD m_dwSCBStyle;
00149 UINT m_htEdge;
00150
00151 CSize m_szHorz;
00152 CSize m_szVert;
00153 CSize m_szFloat;
00154 CSize m_szMinHorz;
00155 CSize m_szMinVert;
00156 CSize m_szMinFloat;
00157 int m_nTrackPosMin;
00158 int m_nTrackPosMax;
00159 int m_nTrackPosOld;
00160 int m_nTrackEdgeOfs;
00161 BOOL m_bTracking;
00162 BOOL m_bKeepSize;
00163 BOOL m_bParentSizing;
00164 BOOL m_bDragShowContent;
00165 UINT m_nDockBarID;
00166 int m_cxEdge;
00167
00168 BOOL m_bFixedFloat;
00169 CSize m_szFixedFloat;
00170
00171
00172 protected:
00173
00174 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00175 afx_msg void OnNcPaint();
00176 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
00177 afx_msg LRESULT OnNcHitTest(CPoint point);
00178 afx_msg void OnCaptureChanged(CWnd *pWnd);
00179 afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
00180 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00181 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00182 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00183 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00184 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00185 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00186 afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
00187 afx_msg void OnPaint();
00188 afx_msg void OnClose();
00189 afx_msg void OnSize(UINT nType, int cx, int cy);
00190
00191 afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
00192
00193 DECLARE_MESSAGE_MAP()
00194
00195 #ifdef _SCB_REPLACE_MINIFRAME
00196 friend class CSCBMiniDockFrameWnd;
00197 #endif //_SCB_REPLACE_MINIFRAME
00198 };
00199
00200 #ifdef _SCB_REPLACE_MINIFRAME
00201 #ifndef _SCB_MINIFRAME_CAPTION
00202
00203
00204
00205 class CSCBDockContext : public CDockContext
00206 {
00207 public:
00208
00209 CSCBDockContext(CControlBar* pBar) : CDockContext(pBar) {}
00210
00211
00212 virtual void StartDrag(CPoint pt);
00213 };
00214 #endif //_SCB_MINIFRAME_CAPTION
00215
00217
00218
00219 #ifndef baseCSCBMiniDockFrameWnd
00220 #define baseCSCBMiniDockFrameWnd CMiniDockFrameWnd
00221 #endif
00222
00223 class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd
00224 {
00225 DECLARE_DYNCREATE(CSCBMiniDockFrameWnd)
00226
00227
00228
00229
00230 public:
00231 virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
00232
00233
00234
00235 public:
00236 CSizingControlBar* GetSizingControlBar();
00237
00238
00239 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00240 afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
00241 afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
00242 afx_msg void OnSize(UINT nType, int cx, int cy);
00243
00244 DECLARE_MESSAGE_MAP()
00245 };
00246 #endif
00247
00248 #endif
00249