wyBool
TabEditorSplitter::Resize(RECT rcmain)
{
	wyInt32     padding;
		
	SendMessage(m_hwnd, WM_SETREDRAW,  FALSE, NULL);

    padding = m_isdlgsplitter == wyTrue ? 0 : CustomTab_GetTabHeight(m_hwndparent);
	m_rect.bottom	= m_height;
	m_rect.left		= rcmain.left;

	//If we are hiding edit window then m_leftortoppercent = 0,
    m_rect.top      = (long)(padding + ((rcmain.bottom - TAB_HEIGHT + rcmain.top)*((long)m_leftortoppercent /(float)100)));
	m_rect.right	= rcmain.right + 2;

    if(m_rect.top > rcmain.bottom - m_height)
    {
        m_rect.top = rcmain.bottom - m_height;
    }
	
    MoveWindow(m_hwnd,  m_rect.left, m_rect.top, m_rect.right, m_rect.bottom, TRUE);

	SendMessage(m_hwnd, WM_SETREDRAW,  TRUE, NULL);
	InvalidateRect(m_hwnd, NULL, TRUE);
		
	return wyTrue;
}
예제 #2
0
파일: EditorBase.cpp 프로젝트: Fale/sqlyog
void
EditorBase::Resize()
{
	RECT				rcmain; 
	RECT				rctabsplitter;
	wyInt32				hpos, vpos, width, height;
	
	VERIFY(GetWindowRect(m_hwndparent, &rcmain));
	VERIFY(GetWindowRect(m_pctabeditor->m_pcetsplitter->m_hwnd, &rctabsplitter));

	VERIFY(MapWindowPoints(NULL, m_hwndparent, (LPPOINT)&rcmain, 2));
	VERIFY(MapWindowPoints(NULL, m_hwndparent, (LPPOINT)&rctabsplitter, 2));
	
	rcmain.bottom = rctabsplitter.top;

	hpos	= rcmain.left;// + 5;

	vpos	= CustomTab_GetTabHeight(m_hwndparent);
	
	width	= rcmain.right;// - 10;
	
	height = 14;
	
    pGlobals->m_pcmainwin->m_connection->HandleHelp(m_hwndhelp, 
                                &hpos, &vpos, &width, &height, rcmain.bottom);

	height	=	rcmain.bottom - rcmain.top - vpos;

	VERIFY(MoveWindow(m_hwnd, hpos, vpos, width, height, FALSE));
    InvalidateRect(m_hwnd, NULL, TRUE);
	return;
}
예제 #3
0
//function to resize the view
void 
TableView::Resize()
{
    RECT	    rcparent, rctemp, tbrect;
	wyInt32		hpos, vpos, width, height,toolwidth, toolheight;
    wyInt32     padding = 6, itemcount;
    TBBUTTON    tbinfo = {0};

    GetClientRect(m_hwndparent, &rcparent);
	
    hpos	= rcparent.left;
    vpos	= rcparent.top = CustomTab_GetTabHeight(m_hwndparent);
	width	= rcparent.right - rcparent.left;
	height	= rcparent.bottom - rcparent.top;
	
    SetWindowPos(m_hwndframe, HWND_BOTTOM, hpos, vpos, width, height,  SWP_NOZORDER);
    GetClientRect(m_hwndframe, &rcparent);

    GetWindowRect(m_hwndtoolbar, &tbrect);
    ResizeRefreshTool(tbrect.bottom - tbrect.top, &tbrect);
    toolheight = tbrect.bottom - tbrect.top;
        
    itemcount = SendMessage(m_hwndtoolbar, TB_BUTTONCOUNT, 0, 0) - 1;
    memset(&rctemp, 0, sizeof(RECT));

    if(itemcount >= 0)
    {
        SendMessage(m_hwndtoolbar, 
            TB_GETBUTTON, 
            itemcount,
            (LPARAM)&tbinfo);

        SendMessage(m_hwndtoolbar, TB_GETRECT, tbinfo.idCommand, (LPARAM)&rctemp);
        rctemp.right += padding;
    }

    toolwidth = rctemp.right;

    if(toolwidth + tbrect.right < rcparent.right)
    {
        toolwidth = rcparent.right - tbrect.right;
    }

    SetWindowPos(m_hwndpadding, NULL, 0, 0, toolwidth + tbrect.right, DATAVIEW_TOPPADDING, SWP_NOZORDER);
    SetWindowPos(m_hwndtoolbar, NULL, 0, DATAVIEW_TOPPADDING, toolwidth, toolheight, SWP_NOZORDER);
    SetWindowPos(m_hwndrefreshtool, NULL, toolwidth, DATAVIEW_TOPPADDING, tbrect.right, toolheight, SWP_NOZORDER);
        
    rcparent.top += toolheight + DATAVIEW_TOPPADDING;
    ResizeControls(rcparent);
    InvalidateRect(m_hwndframe, NULL, TRUE);
    UpdateWindow(m_hwndframe);
}
예제 #4
0
파일: TabMessage.cpp 프로젝트: Fale/sqlyog
// Function to resize the messageedit box. It resizes itself with respect to its parent window 
// that is the query tab.
void
TabMessage::Resize()
{
	wyInt32     vpos, width, height, tabheight;
	RECT	    rcparent, rccombo;

	GetClientRect(m_hwndparent, &rcparent);
    GetWindowRect(m_hwndcombo, &rccombo);
    tabheight = CustomTab_GetTabHeight(m_hwndparent);
    vpos = tabheight;
	width = rcparent.right - rcparent.left;
	height = ((rcparent.bottom - rcparent.top) - vpos) - ((rccombo.bottom - rccombo.top) + 4);
	
    SetWindowPos(m_hwndcombo, NULL, 0, vpos + height + 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
	MoveWindow(m_hwnd, 0, vpos, width, height, TRUE);
}
예제 #5
0
VOID
TableTabInterfaceTabMgmt::Resize(HWND  hwnd)
{
    RECT			rcmain, rcstatus;
	wyInt32			hpos, vpos, width, height;

    VERIFY(GetWindowRect(GetParent(hwnd), &rcmain));
    VERIFY(MapWindowPoints(NULL, GetParent(hwnd), (LPPOINT)&rcmain, 2));

    VERIFY(GetWindowRect(pGlobals->m_pcmainwin->m_hwndstatus, &rcstatus));
	VERIFY(MapWindowPoints(NULL, GetParent(m_hwndparent), (LPPOINT)&rcstatus, 2));

    hpos    =   rcmain.left;
    vpos    =   CustomTab_GetTabHeight(GetParent(hwnd));
    height  =   rcmain.bottom - vpos; // 25 points : 25 points is the height of the Custom-Tab which shows sub-tabs
    width   =   rcmain.right;

    MoveWindow(hwnd, hpos, vpos, width, height, TRUE);
}
void
TabEditorSplitter::MouseMove(wyBool isinit)
{
	RECT		parentrect;
	POINT		curpos, pt;
    LOGBRUSH    lb = {0};
    WORD        bitmap[] = {0x00AA, 0x0055, 0x00AA, 0x0055, 0x00AA, 0x0055, 0x00AA, 0x0055};
    HBITMAP     hbitmap;

	VERIFY(GetClientRect(m_hwndparent, &parentrect));

    //set the tab height
    parentrect.top = m_isdlgsplitter == wyTrue ? 0 : CustomTab_GetTabHeight(m_hwndparent);
	
	// Get the screen coordinates and convert it into client points.
	VERIFY(GetCursorPos(&curpos));
	VERIFY(ScreenToClient(m_hwndparent, &curpos));

	if(m_isdragged == wyTrue)
	{
        pt = curpos;

        if(isinit == wyTrue)
        {
            m_y = pt.y;
            m_hdc = GetDC(m_hwndparent);
            hbitmap = CreateBitmap(8, 8, 1, 1, bitmap);
            lb.lbStyle = BS_PATTERN; 
            lb.lbColor = 0;     
            lb.lbHatch = (ULONG_PTR)hbitmap;
            m_hpen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_FLAT , 4, &lb, 0, NULL); 
            DeleteBitmap(hbitmap);
        }

        if(curpos.y <= parentrect.top)
		{
			m_rect.top = parentrect.top;
			m_leftortoppercent = 0;
		} 
		else
        {
            m_ischanged = wyTrue;

            if(curpos.y <= (parentrect.bottom - m_height))
            {
                m_rect.top = curpos.y;
                m_leftortoppercent = (((curpos.y - parentrect.top) * 100 / (parentrect.bottom - parentrect.top) * 100) / 100);
            } 
            else 
            {
                m_rect.top = parentrect.bottom - m_height;
                m_leftortoppercent = 100;
            }
        }

        DrawTrackerLine();

        if(isinit == wyTrue)
        {
            return;
        }

        m_y = pt.y;
        DrawTrackerLine();
	}

	return;
}