Detect if 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;
	rows = parent->GetRowCount();
	if(rows>1)
	{
		return(TRUE);
	}
	int cols;
	cols = parent->GetColumnCount();
	if(cols>1)
	{
		return(TRUE);
	}
	return(FALSE);
}



Comments

  • A little problem

    Posted by Legacy on 11/24/2002 12:00am

    Originally posted by: LuoJg

    I used this function in SDI. I didn't split it.
    but I got" rows = 0, cols = 1598738480." I don't know what's wrong?

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds