コード例 #1
0
void CGuiSplitterWnd::OnPaint()
{
	//vil plagio del original

	ASSERT_VALID(this);
	CPaintDC dc(this);

	CRect rectClient;
	GetClientRect(&rectClient);
	rectClient.InflateRect(-m_cxBorder, -m_cyBorder);

	CRect rectInside;
	GetInsideRect(rectInside);

	// draw the splitter boxes
	if (m_bHasVScroll && m_nRows < m_nMaxRows)
	{
		OnDrawSplitter(&dc, splitBox,
			CRect(rectInside.right , rectClient.top,
				rectClient.right, rectClient.top + m_cySplitter));
	}

	if (m_bHasHScroll && m_nCols < m_nMaxCols)
	{
		OnDrawSplitter(&dc, splitBox,
			CRect(rectClient.left, rectInside.bottom,
				rectClient.left + m_cxSplitter, rectClient.bottom));
	}

	// extend split bars to window border (past margins)
	DrawAllSplitBars(&dc, rectInside.right, rectInside.bottom);

	
}
コード例 #2
0
ファイル: Inside.cpp プロジェクト: 2asoft/ConEmu
void CConEmuInside::InsideUpdatePlacement()
{
	if (!isInsideWndSet() || !IsWindow(mh_InsideParentWND))
		return;

	if ((m_InsideIntegration != ii_Explorer) && (m_InsideIntegration != ii_Simple))
		return;

	if ((m_InsideIntegration == ii_Explorer) && mh_InsideParentRel
		&& (!IsWindow(mh_InsideParentRel) || !IsWindowVisible(mh_InsideParentRel)))
	{
		//Vista: Проводник мог пересоздать окошко со списком файлов, его нужно найти повторно
		HWND hChild = NULL;
		bool bFound = false;
		while (((hChild = FindWindowEx(mh_InsideParentWND, hChild, NULL, NULL)) != NULL))
		{
			HWND hView = FindWindowEx(hChild, NULL, L"SHELLDLL_DefView", NULL);
			if (hView && IsWindowVisible(hView))
			{
				bFound = true;
				mh_InsideParentRel = hView;
				break;
			}
		}

		if (!bFound)
			return;
	}

	if (!isParentIconic())
	{
		RECT rcParent = {}, rcRelative = {};
		GetClientRect(mh_InsideParentWND, &rcParent);
		if (m_InsideIntegration != ii_Simple)
		{
			GetWindowRect(mh_InsideParentRel, &rcRelative);
			MapWindowPoints(NULL, mh_InsideParentWND, (LPPOINT)&rcRelative, 2);
		}

		if (memcmp(&mrc_InsideParent, &rcParent, sizeof(rcParent))
			|| ((m_InsideIntegration != ii_Simple) && memcmp(&mrc_InsideParentRel, &rcRelative, sizeof(rcRelative))))
		{
			// Рассчитать
			RECT rcWnd = {}; // GetDefaultRect();
			if (GetInsideRect(&rcWnd))
			{
				// Store new parent coords
				mrc_InsideParent = rcParent;
				mrc_InsideParentRel = rcRelative;

				// Correct our window position
				gpConEmu->UpdateInsideRect(rcWnd);
			}
		}
	}
}
コード例 #3
0
ファイル: DYNSPLITTERWND.CPP プロジェクト: qiupyu/DIP
void CDynSplitterWnd::StartTracking(int ht)
{
	if(!m_bDynSplit)
	{
		CSplitterWnd::StartTracking(ht);
		return;
	}
	
	ASSERT_VALID(this);
	if (ht == noHit)
		return;

	// GetHitRect will restrict 'm_rectLimit' as appropriate
	GetInsideRect(m_rectLimit);

	if (ht >= splitterIntersection1 && ht <= splitterIntersection225)
	{
		// split two directions (two tracking rectangles)
		int row = (ht - splitterIntersection1) / 15;
		int col = (ht - splitterIntersection1) % 15;

		GetHitRect(row + vSplitterBar1, m_rectTracker);
		int yTrackOffset = m_ptTrackOffset.y;
		m_bTracking2 = TRUE;
		GetHitRect(col + hSplitterBar1, m_rectTracker2);
		m_ptTrackOffset.y = yTrackOffset;
	}
	else if (ht == bothSplitterBox)
	{
		// hit on splitter boxes (for keyboard)
		GetHitRect(vSplitterBox, m_rectTracker);
		int yTrackOffset = m_ptTrackOffset.y;
		m_bTracking2 = TRUE;
		GetHitRect(hSplitterBox, m_rectTracker2);
		m_ptTrackOffset.y = yTrackOffset;

		// center it
		m_rectTracker.OffsetRect(0, m_rectLimit.Height()/2);
		m_rectTracker2.OffsetRect(m_rectLimit.Width()/2, 0);
	}
	else
	{
		// only hit one bar
		GetHitRect(ht, m_rectTracker);
	}

	// steal focus and capture
	SetCapture();

	// set tracking state and appropriate cursor
	m_bTracking = TRUE;
	m_htTrack = ht;
	SetSplitCursor(ht);
}
コード例 #4
0
void CEGControlBar::OnPaint()
{
	CPaintDC dc(this);

	CRect rc;
	dc.GetClipBox( &rc );
	dc.FillSolidRect(rc, GetSysColor(COLOR_3DFACE));

	GetInsideRect(rc);
	OnDraw( &dc, rc );
}
コード例 #5
0
void CDuiVisionDesignerBar::OnWindowPosChanged(WINDOWPOS FAR* lpWP) 
{
	CXTDockWindow::OnWindowPosChanged(lpWP);
	
	CRect rc;
	GetInsideRect( rc );
	if( IsFloating()) 
	{
		rc.DeflateRect(2,2);
	}
	if( m_DuiVisionDesignerView.GetSafeHwnd( )) 
	{
		m_DuiVisionDesignerView.MoveWindow(rc.left, rc.top, rc.Width(), rc.Height());
	}
}
コード例 #6
0
void CEGControlBar::OnSize(UINT nType, int cx, int cy)
{
	CControlBar::OnSize(nType, cx, cy);

	DWORD dwStyle = GetBarStyle();
	if ( (dwStyle & CBRS_LEFT ) == CBRS_LEFT ) {
		m_dragRect.SetRect( cx - SPLITTER_SIZE, 0, cx, cy);
	} else if ( (dwStyle & CBRS_RIGHT ) == CBRS_RIGHT ) {
		m_dragRect.SetRect( 0, 0, SPLITTER_SIZE, cy);
	} else if ( (dwStyle & CBRS_TOP ) == CBRS_TOP ) {
		m_dragRect.SetRect( 0, cy - SPLITTER_SIZE, cx, cy);
	} else {
		m_dragRect.SetRect( 0, 0, cx, SPLITTER_SIZE);
	}
	
	CRect rc;
	GetInsideRect( rc );
	OnResize ( rc );
}
コード例 #7
0
ファイル: SplitterWndEx.cpp プロジェクト: jjayne/nSIGHTS
void CSplitterWndEx::RecalcLayout()
{
    ASSERT_VALID(this);
    ASSERT(m_nRows > 0 && m_nCols > 0); // must have at least one pane

    CRect rectClient;
    GetClientRect(rectClient);
    rectClient.InflateRect(-m_cxBorder, -m_cyBorder);
    rectClient.top += m_upBorder;

    CRect rectInside;
    GetInsideRect(rectInside);

    // layout columns (restrict to possible sizes)
    LayoutRowCol(m_pColInfo, m_nCols, rectInside.Width(), m_cxSplitterGap);
    LayoutRowCol(m_pRowInfo, m_nRows, rectInside.Height(), m_cySplitterGap);

    // adjust the panes (and optionally scroll bars)

    // give the hint for the maximum number of HWNDs
    AFX_SIZEPARENTPARAMS layout;
    layout.hDWP = ::BeginDeferWindowPos((m_nCols + 1) * (m_nRows + 1) + 1);

    // size of scrollbars
    int cx = (rectClient.right - rectInside.right - bNotWin4);// - afxData.bNotWin4;
    int cy = (rectClient.bottom - rectInside.bottom - bNotWin4);// - afxData.bNotWin4;

    // reposition size box
    if (m_bHasHScroll && m_bHasVScroll) {
        CWnd* pScrollBar = GetDlgItem(AFX_IDW_SIZE_BOX);
        ASSERT(pScrollBar != NULL);

        // fix style if necessary
        BOOL bSizingParent = (GetSizingParent() != NULL);
        // modifyStyle returns TRUE if style changes
        if (pScrollBar->ModifyStyle(SBS_SIZEGRIP|SBS_SIZEBOX,
                bSizingParent ? SBS_SIZEGRIP : SBS_SIZEBOX))
            pScrollBar->Invalidate();
        pScrollBar->EnableWindow(bSizingParent);

        // reposition the size box
        DeferClientPos(&layout, pScrollBar,
            rectInside.right + bNotWin4,
            rectInside.bottom + bNotWin4, cx, cy, TRUE);
    }

    // reposition scroll bars
    if (m_bHasHScroll) {
        int cxSplitterBox = m_cxSplitter + bNotWin4;// split box bigger
        int x = rectClient.left;
        int y = rectInside.bottom + bNotWin4;
        for (int col = 0; col < m_nCols; col++) {
            CWnd* pScrollBar = GetDlgItem(AFX_IDW_HSCROLL_FIRST + col);
            ASSERT(pScrollBar != NULL);
            int cx = m_pColInfo[col].nCurSize;
            if (col == 0 && m_nCols < m_nMaxCols)
                x += cxSplitterBox, cx -= cxSplitterBox;
            DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
            x += cx + m_cxSplitterGap;
        }
    }

    if (m_bHasVScroll) {
        int cySplitterBox = m_cySplitter + bNotWin4;// split box bigger
        int x = rectInside.right + bNotWin4;
        int y = rectClient.top;
        for (int row = 0; row < m_nRows; row++)
        {
            CWnd* pScrollBar = GetDlgItem(AFX_IDW_VSCROLL_FIRST + row);
            ASSERT(pScrollBar != NULL);
            int cy = m_pRowInfo[row].nCurSize;
            if (row == 0 && m_nRows < m_nMaxRows)
                y += cySplitterBox, cy -= cySplitterBox;
            DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
            y += cy + m_cySplitterGap;
        }
    }

    //BLOCK: Reposition all the panes
    {
        int x = rectClient.left;
        for (int col = 0; col < m_nCols; col++) {
            int cx = m_pColInfo[col].nCurSize;
            int y = rectClient.top;
            for (int row = 0; row < m_nRows; row++) {
                int cy = m_pRowInfo[row].nCurSize;
                CWnd* pWnd = GetPane(row, col);
                DeferClientPos(&layout, pWnd, x, y, cx, cy, FALSE);
                y += cy + m_cySplitterGap;
            }
            x += cx + m_cxSplitterGap;
        }
    }

    // move and resize all the windows at once!
    if (layout.hDWP == NULL || !::EndDeferWindowPos(layout.hDWP))
        TRACE0("Warning: DeferWindowPos failed - low system resources.\n");

    // invalidate all the splitter bars (with NULL pDC)
    DrawAllSplitBars(NULL, rectInside.right, rectInside.bottom);
}