void DialogClientView::LayoutContentsView()
 {
     gfx::Rect lb = GetContentsBounds();
     lb.set_height(std::max(0, lb.height()-GetButtonsHeight()));
     contents_view()->SetBoundsRect(lb);
     contents_view()->Layout();
 }
Example #2
0
BOOL COXMulticlipboardDlg::GetProposedRect(UINT nNumber, CRect &rect)
{
	CRect rectDialog;
	CRect rectClient;

	//the function calculates the placement for the
	//specified pocket
	//this placement does not included edge offset
	//(borders of the pocket), just size of the icon
	//because COXClipPocket::Create() will increase
	//this rect on edge offset itself.
	GetClientRect(&rectClient);	

	rect.left=GetIconSpace()+GetStaticDimension()+
		GetEdgeOffset()+(GetIconWidth()+2*GetEdgeOffset()+
		GetIconSpace())*(nNumber%m_nPocketsInRow);
	rect.right=rect.left+GetIconWidth();
	rect.top=GetButtonsHeight()+GetIconSpace()+GetStaticDimension()+
		+GetEdgeOffset()+
		(GetIconSpace()+GetIconHeight()+GetEdgeOffset()*2)*
		(nNumber/m_nPocketsInRow);
	
	rect.bottom=rect.top+GetIconHeight();

	return TRUE;

}
Example #3
0
void COXMulticlipboardDlg::MoveStatic()
{

	//this function calculates and moves
	//static control to proper position
	CRect rectStatic;

	GetClientRect(&rectStatic);
	rectStatic.DeflateRect(GetStaticDimension(),
		GetStaticDimension());
	rectStatic.top+=GetButtonsHeight();
	CWnd* pWnd=GetDlgItem(IDC_OX_STATIC_EDGE);
	pWnd->MoveWindow(&rectStatic);

}
Example #4
0
void COXMulticlipboardDlg::CalculateDesiredRect(int nPockets, CRect &rect)
{
	//the function calculates desired rect
	//for certain number of the pockets

	nPockets=nPockets?nPockets:1;

	UINT nRows=nPockets/m_nPocketsInRow;
	nRows+=(nPockets%m_nPocketsInRow)?1:0;
	UINT nCols=min(m_nPocketsInRow,nPockets);

	rect.left=rect.top=0;
	rect.right=GetIconSpace()+2*GetStaticDimension()+
		nCols*(GetIconWidth()+
		GetIconSpace()+2*GetEdgeOffset());

	rect.bottom=GetButtonsHeight()+GetIconSpace()+
		2*GetStaticDimension()+nRows*
		(GetIconHeight()+GetIconSpace()+2*GetEdgeOffset());

}