|
-
August 6th, 1999, 08:21 AM
#1
unchangeable splitter pan
How can I set unchangeable splitter pane?
CiMan
[email protected]
-
August 6th, 1999, 09:05 AM
#2
Re: unchangeable splitter pan
Basic concept of splitter windows is to have resizable panes.
But dont know what to do the way you want them to be!
-
August 6th, 1999, 01:06 PM
#3
Re: re- unchangeable size of splitter panes
I found the right solution
for implementation re- unchangeable size of splitter panes.
It is useful to know.
Sometimes it is needed.
Use instead of CSplitterWnd
class CSplitterWndNRS (NoReSizeable)
class CSplitterWndNRS : public CSplitterWnd
{
public:
virtual int HitTest(CPoint pt) const {return 0;};
};
CiMan
[email protected]
-
August 6th, 1999, 04:07 PM
#4
Re: re- unchangeable size of splitter panes
Hi,
I am also looking for the same. But can u put some more light on it. Actually, I have one splitter window with 3 rows and 1 column and i want to avoide resizing through mouse. Pl let me at the earliest.
thanks
yash
-
August 6th, 1999, 10:33 PM
#5
Re: unchangeable splitter pan
Derive a class from CSplitterWnd. In your header file, put
BOOL m_bLockedSplBars;
inline void SetSplBarLock(const BOOL bLocked) {m_bLockedSplBars = bLocked;}
inline BOOL GetSplBarLock() const {return m_bLockedSplBars;}
Use the class wizard to make handlers for WM_LBUTTONDOWN, WM_MOUSEMOVE, and WMSETCURSOR. In the cpp file, add code to the handlers as below.
// --------------------------------------------------------------------------
void CSplWndFixed::OnLButtonDown(UINT nFlags, CPoint point)
{
if (m_bLockedSplBars)
{ // CWnd doesn't do splitter bars.
CWnd::OnLButtonDown(nFlags, point);
}
else
{ // CSplitterWnd handles splitter bars.
CSplitterWnd::OnLButtonDown(nFlags, point);
}
}
// --------------------------------------------------------------------------
void CSplWndFixed::OnMouseMove(UINT nFlags, CPoint point)
{
if (m_bLockedSplBars)
{ // CWnd doesn't do splitter bars.
CWnd::OnMouseMove(nFlags, point);
}
else
{ // CSplitterWnd handles splitter bars.
CSplitterWnd::OnMouseMove(nFlags, point);
}
}
// --------------------------------------------------------------------------
BOOL CSplWndFixed::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (m_bLockedSplBars)
{ // CWnd doesn't do splitter bars.
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
else
{ // CSplitterWnd handles splitter bars.
return CSplitterWnd::OnSetCursor(pWnd, nHitTest, message);
}
}
Initialize m_bLockedSplBars in your constructor or elsewhere.
More info can be found in The MFC Answer Book, by Eugene Kain, Addison Wesley
Details of how CSplitterWnd works are in MFC Internals, by George Shepard and Scot Wingo, Addison Wesley.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|