1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 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.
23 * \ingroup TortoiseMerge
24 * Extends the MFC CSplitterWnd with the functionality to
25 * Show/Hide specific columns and rows, allows to lock
26 * the splitter bars so the user can't move them
27 * and also allows dynamic replacing of views with
36 class CXSplitter
: public CSplitterWnd
40 virtual ~CXSplitter();
44 * Checks if the splitter has its bars locked.
46 BOOL
IsBarLocked() const {return m_bBarLocked
;}
48 * Locks/Unlocks the bar so the user can't move it.
49 * \param bState TRUE to lock, FALSE to unlock
51 void LockBar(BOOL bState
=TRUE
) {m_bBarLocked
=bState
;}
53 * Replaces a view in the Splitter with another view.
55 BOOL
ReplaceView(int row
, int col
,CRuntimeClass
* pViewClass
, SIZE size
);
57 * Shows a splitter column which was previously hidden. Don't call
58 * this method if the column is already visible! Check it first
59 * with IsColumnHidden()
63 * Hides the given splitter column. Don't call this method on already hidden columns!
64 * Check it first with IsColumnHidden()
65 * \param nColHide The column to hide
67 void HideColumn(int nColHide
);
69 * Checks if a given column is hidden.
71 BOOL
IsColumnHidden(int nCol
) const {return (m_nHiddenCol
== nCol
);}
73 * Shows a splitter row which was previously hidden. Don't call
74 * this method if the row is already visible! Check it first
79 * Hides the given splitter row. Don't call this method on already hidden rows!
80 * Check it first with IsRowHidden()
81 * \param nRowHide The row to hide
83 void HideRow(int nRowHide
);
85 * Checks if a given row is hidden.
87 BOOL
IsRowHidden(int nRow
) const {return (m_nHiddenRow
== nRow
);}
90 afx_msg
void OnLButtonDown(UINT nFlags
, CPoint point
);
91 afx_msg
void OnMouseMove(UINT nFlags
, CPoint point
);
92 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
96 BOOL m_bBarLocked
; ///< is the splitter bar locked?
97 int m_nHiddenCol
; ///< Index of the hidden column.
98 int m_nHiddenRow
; ///< Index of the hidden row.