void
FrameWindowSplitter::EndDrag(wyBool isdrawline)
{
    if(isdrawline == wyTrue)
    {
        DrawTrackerLine();
    }

    if(m_hpen)
    {
        DeletePen(m_hpen);
        m_hpen = NULL;
    }

    if(m_hdc)
    {
        ReleaseDC(m_hwndparent, m_hdc);
        m_hdc = NULL;
    }
}
// Function to drag the window splitter window.
// Window is dragged by trapping the mousemove message 
void
FrameWindowSplitter::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));
	
	// Get the screen coordinates and convert it into client points.
	VERIFY(GetCursorPos (&curpos));
	VERIFY(ScreenToClient(m_hwndparent, &curpos));

    parentrect.left += 2;
    parentrect.right -= 2;
    parentrect.top += 2;
    parentrect.bottom -= 2;

	// logic to move the splitter.
	if(m_isdragged)
	{
        pt = curpos;

        if(isinit == wyTrue)
        {
            m_x = pt.x;
            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.x <= parentrect.left)
		{
			m_rect.left = parentrect.left;
			m_leftortoppercent = 0;
		} 
		else 
		{
            if(curpos.x <= (parentrect.right - m_width))
			{
				m_rect.left = curpos.x;
				m_leftortoppercent = ((curpos.x * 100 / parentrect.right * 100)/ 100);
			} 
			else 
			{
                m_rect.left = (parentrect.right - m_width);
				m_leftortoppercent = 100;
			}
		}
        
        DrawTrackerLine();

        if(isinit == wyTrue)
        {
            return;
        }

        m_x = pt.x;
        DrawTrackerLine();
	}
}
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;
}