Ejemplo n.º 1
0
void
EditorTab::Resize()
{
	RECT	    rcmain, rcvsplitter, rchsplitter;
	wyInt32     hpos, vpos, width, height;
    wyInt32     tabcount, selindex;
    CTCITEM	    item;

	MDIWindow       *pcquerywnd	        =(MDIWindow*)GetWindowLong(m_hwndparent, GWL_USERDATA);
	FrameWindowSplitter  *pcqueryvsplitter   = pcquerywnd->GetVSplitter();
	FrameWindowSplitter  *pcqueryhsplitter   = pcquerywnd->GetHSplitter();
	
	VERIFY(GetClientRect(m_hwndparent, &rcmain));

	VERIFY(GetWindowRect(pcqueryvsplitter->GetHwnd(), &rcvsplitter));
	VERIFY(GetWindowRect(pcqueryhsplitter->GetHwnd(), &rchsplitter));

	VERIFY(MapWindowPoints(NULL, m_hwndparent,(LPPOINT)&rcvsplitter, 2));
	VERIFY(MapWindowPoints(NULL, m_hwndparent,(LPPOINT)&rchsplitter, 2));

	hpos			=	(rcvsplitter.right);
	vpos			=	5;
	width			=	(rcmain.right - hpos) - 2;

	if(pcquerywnd->m_iseditwindow == wyTrue)
		height		=	(rchsplitter.top - rcvsplitter.top) - 3;
	else
		height		=	0;

	SendMessage(m_hwnd, WM_SETREDRAW,  FALSE, NULL);

	VERIFY(MoveWindow(m_hwnd, hpos, vpos, width, height, TRUE));

    SendMessage(m_hwnd, WM_SETREDRAW, TRUE, NULL);
	
    item.m_mask = CTBIF_LPARAM;

	selindex = CustomTab_GetCurSel(m_hwnd);

	for(tabcount = 0; tabcount < CustomTab_GetItemCount(m_hwnd); tabcount++)
	{
		CustomTab_GetItem(m_hwnd, tabcount, &item);
		EditorBase *eb =(EditorBase *)item.m_lparam;
		eb->Resize();		

        pGlobals->m_pcmainwin->m_connection->HandleEditorControls(eb->m_hwnd,
            eb->m_hwndhelp, eb->m_hwndfilename, eb->m_save, tabcount, selindex);
	}
			
	InvalidateRect(m_hwnd, NULL, TRUE);

	return;
}
void 
Announcements::Resize(HWND hwnd, wyBool isstart)
{
	RECT                rcmain, rcvsplitter;
	wyInt32             ret;
	wyInt32             hpos, vpos_ob, vpos, width, height, ob_height, ypos;
	MDIWindow			*wnd = (MDIWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
	FrameWindowSplitter	*pcqueryvsplitter = wnd->GetVSplitter();

	VERIFY(GetClientRect(hwnd, &rcmain));
	VERIFY(GetWindowRect(pcqueryvsplitter->GetHwnd(), &rcvsplitter));
	VERIFY(MapWindowPoints(NULL, hwnd,(LPPOINT)&rcvsplitter, 2));

	ob_height		=	wnd->m_pcqueryobject->m_height;
	hpos			=	2;
	ypos			=	2;
	vpos_ob			=	(ob_height + 10) > 22 ? ob_height + 10: 22;
	width			=	rcvsplitter.left-2;
	height			=	rcmain.bottom - (2 * vpos_ob) - 10;
	m_htmlh			=   (wyInt32)(0.3 * height);
	vpos			=	(vpos_ob * 2)+ 8 + height - m_htmlh; 

	if( wnd->m_isanncreate == wyFalse )	
	{
		VERIFY(ret = MoveWindow(m_hwndHTML, 0, ypos, width, m_htmlh, TRUE));
		m_htmlw = width;
	}
	else
	{
		VERIFY(ret = MoveWindow(m_hwndHTML, m_htmlx, ypos, width, m_htmlh, TRUE));
		m_htmlw = width;
	}

	if(!(wnd->m_isanncreate || isstart))
		wnd->m_isanncreate = wyTrue;

	VERIFY(ret = MoveWindow(m_hwnd, hpos, vpos-ypos, width, m_htmlh+2, TRUE));

}