Click here to Skip to main content
15,891,136 members
Articles / Programming Languages / Objective C

Fast Binary Tree Operations

Rate me:
Please Sign up or sign in to vote.
4.75/5 (44 votes)
22 Jan 20057 min read 254.9K   6.1K   107  
Describes main binary tree operations
// Anchor.cpp : implementation file
//

#include "stdafx.h"

#define A_LEFT		1
#define A_TOP		2
#define A_BOTTOM	4
#define A_RIGHT		8

void Anchor(CWnd *pWndParent, UINT ID, DWORD dwAnchor, CSize sizeOld, CSize sizeNew)
{
	CWnd *pWnd = pWndParent->GetDlgItem(ID);
	CRect rect;
	pWnd->GetWindowRect(rect);
	pWndParent->ScreenToClient(rect);
	
	int nCx = sizeNew.cx-sizeOld.cx;
	int nCy = sizeNew.cy-sizeOld.cy;
	if((dwAnchor&A_LEFT) == 0)
		rect.left += nCx;
	if((dwAnchor&A_RIGHT) != 0)
		rect.right += nCx;
	if((dwAnchor&A_TOP) == 0)
		rect.top += nCy;
	if((dwAnchor&A_BOTTOM) != 0)
		rect.bottom += nCy;
	pWnd->MoveWindow(rect);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Software Developer (Senior)
Egypt Egypt

Comments and Discussions