00001 #ifndef GENERATING_DOXYGEN_OUTPUT
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #if !defined(INC_MGUI_SIZINGCB_H) && defined(WIN32_MFC)
00026 #define INC_MGUI_SIZINGCB_H
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #include <afxpriv.h>
00062 #include <afxtempl.h>
00063
00064 #if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME)
00065 #error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME"
00066 #endif
00067
00068
00069
00070
00071 class CSCBDockBar : public CDockBar
00072 {
00073 friend class CSizingControlBar;
00074 };
00075
00076
00077
00078
00079 #define SCBS_EDGELEFT 0x00000001
00080 #define SCBS_EDGERIGHT 0x00000002
00081 #define SCBS_EDGETOP 0x00000004
00082 #define SCBS_EDGEBOTTOM 0x00000008
00083 #define SCBS_EDGEALL 0x0000000F
00084 #define SCBS_SHOWEDGES 0x00000010
00085 #define SCBS_SIZECHILD 0x00000020
00086
00087
00088
00089
00090 #ifndef baseCSizingControlBar
00091 #define baseCSizingControlBar CControlBar
00092 #endif
00093
00094 class CSizingControlBar;
00095 typedef CTypedPtrArray <CPtrArray, CSizingControlBar*> CSCBArray;
00096
00097 class CSizingControlBar : public baseCSizingControlBar
00098 {
00099 DECLARE_DYNAMIC(CSizingControlBar);
00100
00101
00102 public:
00103 CSizingControlBar();
00104
00105 virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
00106 CSize sizeDefault, BOOL bHasGripper,
00107 UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
00108 virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
00109 UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
00110
00111
00112 public:
00113 const BOOL IsFloating() const;
00114 const BOOL IsHorzDocked() const;
00115 const BOOL IsVertDocked() const;
00116 const BOOL IsSideTracking() const;
00117 const BOOL GetSCBStyle() const {return m_dwSCBStyle;}
00118
00119
00120 public:
00121 #if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION)
00122 void EnableDocking(DWORD dwDockStyle);
00123 #endif
00124 virtual void LoadState(LPCTSTR lpszProfileName);
00125 virtual void SaveState(LPCTSTR lpszProfileName);
00126 static void GlobalLoadState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
00127 static void GlobalSaveState(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
00128 void SetSCBStyle(DWORD dwSCBStyle)
00129 {m_dwSCBStyle = (dwSCBStyle & ~SCBS_EDGEALL);}
00130
00131
00132 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00133
00134
00135 public:
00136
00137
00138 public:
00139 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00140 virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);
00141
00142
00143
00144 public:
00145 virtual ~CSizingControlBar();
00146
00147 protected:
00148
00149 UINT GetEdgeHTCode(int nEdge);
00150 BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
00151 virtual void StartTracking(UINT nHitTest, CPoint point);
00152 virtual void StopTracking();
00153 virtual void OnTrackUpdateSize(CPoint& point);
00154 virtual void OnTrackInvertTracker();
00155 virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
00156 virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID);
00157
00158 virtual void AlignControlBars();
00159 void GetRowInfo(int& nFirst, int& nLast, int& nThis);
00160 void GetRowSizingBars(CSCBArray& arrSCBars);
00161 void GetRowSizingBars(CSCBArray& arrSCBars, int& nThis);
00162 BOOL NegotiateSpace(int nLengthTotal, BOOL bHorz);
00163
00164 protected:
00165 DWORD m_dwSCBStyle;
00166 UINT m_htEdge;
00167
00168 CSize m_szHorz;
00169 CSize m_szVert;
00170 CSize m_szFloat;
00171 CSize m_szMinHorz;
00172 CSize m_szMinVert;
00173 CSize m_szMinFloat;
00174 int m_nTrackPosMin;
00175 int m_nTrackPosMax;
00176 int m_nTrackPosOld;
00177 int m_nTrackEdgeOfs;
00178 BOOL m_bTracking;
00179 BOOL m_bKeepSize;
00180 BOOL m_bParentSizing;
00181 BOOL m_bDragShowContent;
00182 UINT m_nDockBarID;
00183 int m_cxEdge;
00184
00185
00186 protected:
00187
00188 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00189 afx_msg void OnNcPaint();
00190 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
00191 afx_msg UINT OnNcHitTest(CPoint point);
00192 afx_msg void OnCaptureChanged(CWnd *pWnd);
00193 afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
00194 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00195 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00196 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00197 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00198 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00199 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00200 afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
00201 afx_msg void OnPaint();
00202 afx_msg void OnClose();
00203 afx_msg void OnSize(UINT nType, int cx, int cy);
00204
00205 afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
00206
00207 DECLARE_MESSAGE_MAP()
00208
00209 #ifdef _SCB_REPLACE_MINIFRAME
00210 friend class CSCBMiniDockFrameWnd;
00211 #endif
00212 };
00213
00214 #ifdef _SCB_REPLACE_MINIFRAME
00215 #ifndef _SCB_MINIFRAME_CAPTION
00216
00217
00218
00219 class CSCBDockContext : public CDockContext
00220 {
00221 public:
00222
00223 CSCBDockContext(CControlBar* pBar) : CDockContext(pBar) {}
00224
00225
00226 virtual void StartDrag(CPoint pt);
00227 };
00228 #endif
00229
00230
00231
00232
00233 #ifndef baseCSCBMiniDockFrameWnd
00234 #define baseCSCBMiniDockFrameWnd CMiniDockFrameWnd
00235 #endif
00236
00237 class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd
00238 {
00239 DECLARE_DYNCREATE(CSCBMiniDockFrameWnd)
00240
00241
00242
00243
00244 public:
00245 virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
00246
00247
00248
00249 public:
00250 CSizingControlBar* GetSizingControlBar();
00251
00252
00253 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00254 afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
00255 afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
00256 afx_msg void OnSize(UINT nType, int cx, int cy);
00257
00258 DECLARE_MESSAGE_MAP()
00259 };
00260 #endif
00261
00262
00263
00264
00265
00266
00267 class CSCBButton
00268 {
00269 public:
00270 CSCBButton();
00271
00272 void Move(CPoint ptTo) {ptOrg = ptTo; };
00273 CRect GetRect() { return CRect(ptOrg, CSize(11, 11)); };
00274 void Paint(CDC* pDC);
00275
00276 BOOL bPushed;
00277 BOOL bRaised;
00278
00279 protected:
00280 CPoint ptOrg;
00281 };
00282
00283
00284
00285
00286 #ifndef baseCSizingControlBarG
00287 #define baseCSizingControlBarG CSizingControlBar
00288 #endif
00289
00290 class CSizingControlBarG : public baseCSizingControlBarG
00291 {
00292 DECLARE_DYNAMIC(CSizingControlBarG);
00293
00294
00295 public:
00296 CSizingControlBarG();
00297
00298
00299 public:
00300 virtual BOOL HasGripper() const;
00301
00302
00303 public:
00304
00305
00306 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00307
00308
00309 public:
00310
00311
00312
00313
00314
00315 public:
00316 virtual ~CSizingControlBarG();
00317
00318 protected:
00319
00320 virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
00321 virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID);
00322
00323 protected:
00324 int m_cyGripper;
00325
00326 CSCBButton m_biHide;
00327
00328
00329 protected:
00330
00331 afx_msg UINT OnNcHitTest(CPoint point);
00332 afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
00333
00334
00335 DECLARE_MESSAGE_MAP()
00336 };
00337
00338
00339
00340
00341
00342 #ifndef baseCSizingControlBarCF
00343 #define baseCSizingControlBarCF CSizingControlBarG
00344 #endif
00345
00346 class CSizingControlBarCF : public baseCSizingControlBarCF
00347 {
00348 DECLARE_DYNAMIC(CSizingControlBarCF)
00349
00350
00351 public:
00352 CSizingControlBarCF();
00353
00354
00355 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00356
00357
00358 protected:
00359
00360 virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
00361
00362 protected:
00363 BOOL m_bActive;
00364 CString m_sFontFace;
00365
00366
00367 protected:
00368
00369
00370 afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
00371
00372 DECLARE_MESSAGE_MAP()
00373 };
00374
00375
00376
00377 #endif // INC_MGUI_SIZINGCB_H
00378 #endif // GENERATING_DOXYGEN_OUTPUT