OSDN Git Service

Modify Git Clone Control Tab order
[tortoisegit/TortoiseGitJp.git] / src / TortoiseMerge / XSplitter.h
1 // TortoiseMerge - a Diff/Patch program\r
2 \r
3 // Copyright (C) 2006 - Stefan Kueng\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #pragma once\r
20 \r
21 \r
22 /**\r
23  * \ingroup TortoiseMerge\r
24  * Extends the MFC CSplitterWnd with the functionality to\r
25  * Show/Hide specific columns and rows, allows to lock\r
26  * the splitter bars so the user can't move them\r
27  * and also allows dynamic replacing of views with\r
28  * other views.\r
29  *\r
30  * \par requirements\r
31  * win98 or later\n\r
32  * win2k or later\n\r
33  * MFC\n\r
34  *\r
35  */\r
36 class CXSplitter : public CSplitterWnd\r
37 {\r
38 public:\r
39         CXSplitter();\r
40         virtual ~CXSplitter();\r
41 \r
42 public:\r
43         /**\r
44          * Checks if the splitter has its bars locked.\r
45          */\r
46         BOOL            IsBarLocked() const  {return m_bBarLocked;}\r
47         /**\r
48          * Locks/Unlocks the bar so the user can't move it.\r
49          * \param bState TRUE to lock, FALSE to unlock\r
50          */\r
51         void            LockBar(BOOL bState=TRUE) {m_bBarLocked=bState;}\r
52         /**\r
53          * Replaces a view in the Splitter with another view.\r
54          */\r
55         BOOL            ReplaceView(int row, int col,CRuntimeClass * pViewClass, SIZE size);\r
56     /**\r
57      * Shows a splitter column which was previously hidden. Don't call\r
58          * this method if the column is already visible! Check it first\r
59          * with IsColumnHidden()\r
60      */\r
61     void                ShowColumn();\r
62     /**\r
63      * Hides the given splitter column. Don't call this method on already hidden columns!\r
64          * Check it first with IsColumnHidden()\r
65      * \param nColHide The column to hide\r
66      */\r
67     void                HideColumn(int nColHide);\r
68         /**\r
69          * Checks if a given column is hidden.\r
70          */\r
71         BOOL            IsColumnHidden(int nCol) const {return (m_nHiddenCol == nCol);}\r
72     /**\r
73      * Shows a splitter row which was previously hidden. Don't call\r
74          * this method if the row is already visible! Check it first\r
75          * with IsRowHidden()\r
76      */\r
77     void                ShowRow();\r
78     /**\r
79      * Hides the given splitter row. Don't call this method on already hidden rows!\r
80          * Check it first with IsRowHidden()\r
81      * \param nRowHide The row to hide\r
82      */\r
83     void                HideRow(int nRowHide);\r
84         /**\r
85          * Checks if a given row is hidden.\r
86          */\r
87         BOOL            IsRowHidden(int nRow) const  {return (m_nHiddenRow == nRow);}\r
88 \r
89 protected:\r
90         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);\r
91         afx_msg void OnMouseMove(UINT nFlags, CPoint point);\r
92         afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);\r
93         DECLARE_MESSAGE_MAP()\r
94 \r
95 private:\r
96         BOOL            m_bBarLocked;   ///< is the splitter bar locked?\r
97     int                 m_nHiddenCol;   ///< Index of the hidden column.\r
98     int                 m_nHiddenRow;   ///< Index of the hidden row.\r
99 \r
100 };\r