Click here to Skip to main content
Licence 
First Posted 16 Dec 1999
Views 50,733
Bookmarked 17 times

Detect if window is split

By | 16 Dec 1999 | Article
A function that tells you wether a window is split

Many times it is necessary to know whether a view is currently split or not. This method will return TRUE if the view is split and FALSE if it is not. NOTE: It does NOT detect multiple views, so don't use it to determine whether UpdateAllViews should be called!

int CMySplitterView::IsSplit(void)
{
	CSplitterWnd * parent;
	parent = (CSplitterWnd*)GetParent();
	int rows = parent->GetRowCount();
	if (rows > 1)
	{
		return TRUE;
	}
	int cols = parent->GetColumnCount();
	if (cols > 1)
	{
		return(TRUE);
	}
	return FALSE;
}

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Randy More



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 PinmemberMember 78666403:46 28 Apr '11  
GeneralYac... Pinmemberthenickname8:47 14 Oct '05  
Not much of an article. How about returning an bool instead? Why would you want to return an int, if there's only two possible return values? And I doubt that it isn't possible to make that fcuntion const instead. And did you have to use all those lines of code to do that?
 
bool CMySplitterView::IsSplit(void) const
{
	CSplitterWnd * parent = (CSplitterWnd*)GetParent();
	return (parent->GetRowCount() > 1 || parent->GetColumnCount() > 1);
}

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 17 Dec 1999
Article Copyright 1999 by Randy More
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid