1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2006 - Stefan Kueng
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 /////////////////////////////////////////////////////////////////////////////
22 // CSplitterControl window
24 #define SPN_SIZED WM_USER + 1
25 #define CW_LEFTALIGN 1
26 #define CW_RIGHTALIGN 2
28 #define CW_BOTTOMALIGN 4
29 #define SPS_VERTICAL 1
30 #define SPS_HORIZONTAL 2
31 typedef struct SPC_NMHDR
37 class CSplitterControl
: public CStatic
42 virtual ~CSplitterControl();
51 int m_nSavePos
; // Save point on the lbutton down message
52 bool m_bMouseOverControl
;
56 static void ChangePos(CWnd
* pWnd
, int dx
, int dy
);
57 static void ChangeWidth(CWnd
* pWnd
, int dx
, DWORD dwFlag
= CW_LEFTALIGN
);
58 static void ChangeHeight(CWnd
* pWnd
, int dy
, DWORD dwFlag
= CW_TOPALIGN
);
60 void SetRange(int nMin
, int nMax
);
61 void SetRange(int nSubtraction
, int nAddition
, int nRoot
);
63 int GetSplitterStyle();
64 int SetSplitterStyle(int nStyle
= SPS_VERTICAL
);
66 // Generated message map functions
68 virtual void DrawLine(CDC
* pDC
);
69 void MoveWindowTo(CPoint pt
);
70 virtual void PreSubclassWindow();
71 afx_msg
void OnPaint();
72 afx_msg
void OnMouseMove(UINT nFlags
, CPoint point
);
73 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
74 afx_msg
void OnLButtonDown(UINT nFlags
, CPoint point
);
75 afx_msg
void OnLButtonUp(UINT nFlags
, CPoint point
);
76 afx_msg BOOL
OnEraseBkgnd(CDC
* pDC
);
77 afx_msg LRESULT
OnMouseLeave(WPARAM wParam
, LPARAM lParam
);
78 virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct
){UNREFERENCED_PARAMETER(lpDrawItemStruct
);}; //avoid assert fail when alt press