Ejemplo n.º 1
0
void CSimpleReport::RowDownMulti()
{
	CXTPReportSelectedRows* pRows = GetSelectedRows();
	if (!pRows)
		return;

	int total = GetRows()->GetCount() - 1;
	int cnt = pRows->GetCount();

	CXTPReportRow* pRow = pRows->GetAt(cnt-1);	// 선택 영역의 마지막 row
	if (!pRow)
		return;
	int n = pRow->GetIndex();
	if (n >= total)					// 더이상 내려갈 수 없음
		return;

	// 마지막 row 뒤에 paste하기 위해 m_bAdd를 true로 만듬.
	// 그럼 cut후 add가 됨

	if (n+1 >= total)
		m_bAdd = true;

	// focus는 cut된 시점에서 첫번째로 잡음.
	pRow = pRows->GetAt(0);
	n = pRow->GetIndex();

	Cut();			// 컷하면 선택된 갯수는 제거되므로 total-cnt가 
	RowSetFocused(n+1);
	Paste();
	SetFocus();
}
Ejemplo n.º 2
0
int CSimpleReport::RowGetFocused() 
{ 
	CXTPReportRow* pRow = GetFocusedRow();
	if (!pRow)
		return -1;
	return pRow->GetIndex();
}
void CXTPReportIconNavigator::MoveUpStep(BOOL bShiftKey, BOOL bControlKey)
{
	if (!m_pReportControl)
		return;

	if (m_pReportControl->IsMultiSelectionMode())
		bControlKey = TRUE;

	CXTPReportRow* pPrevRow = NULL;
	CXTPReportRow* pFocusedRow = m_pReportControl->GetFocusedRow();
	if (!pFocusedRow)
		return;

	if (m_pReportControl->IsIconView())
	{
		int iPrevRowIndex = -1;
		int iFocusRow = pFocusedRow->GetIndex();
// body rows
		pPrevRow = m_pReportControl->GetRows()->GetPrev(pFocusedRow, m_pReportControl->IsSkipGroupsFocusEnabled());
		if (pPrevRow)
		{
			if (pPrevRow && pPrevRow->GetIndex() != iPrevRowIndex)
			{
// from the first body row jump to the last header row
				if (iFocusRow <= pPrevRow->GetIndex())
				{
					if (m_pReportControl->IsHeaderRowsVisible() && m_pReportControl->IsHeaderRowsAllowAccess())
						MoveLastVisibleRow(xtpRowTypeHeader);
				}
				else
				{
					m_pReportControl->SetFocusedRow(pPrevRow, bShiftKey, bControlKey);
				}
			}
		}
	}
}
Ejemplo n.º 4
0
void CSimpleReport::RowUpMulti()
{
	// 한꺼번에 여러개를 올림

	CXTPReportSelectedRows* pRows = GetSelectedRows();
	if (!pRows)
		return;
	CXTPReportRow* pRow = pRows->GetAt(0);
	if (!pRow)
		return;
	int n = pRow->GetIndex();
	if (n == 0)	// 더이상 올라갈 수 없음
		return;

	Cut();
	RowSetFocused(n-1);
	Paste();
	SetFocus();
}
void CXTPReportIconNavigator::MoveDown(BOOL bShiftKey, BOOL bControlKey)
{
	if (!m_pReportControl)
		return;

	if (m_pReportControl->IsMultiSelectionMode())
		bControlKey = TRUE;

	CXTPReportRow* pNextRow = NULL;
	CXTPReportRow* pFocusedRow = m_pReportControl->GetFocusedRow();
	if (!pFocusedRow)
		return;

	int iPrevRowIndex = -1;
	int iFocusRow = pFocusedRow->GetIndex();
	int nRpL = m_pReportControl->GetRowsPerLine();
	int iRowOffset = iFocusRow % nRpL;
// body rows
	pNextRow = m_pReportControl->GetRows()->GetNext(pFocusedRow, m_pReportControl->IsSkipGroupsFocusEnabled());

	if (pNextRow)
	{
		while(
		pNextRow
		&& pNextRow->GetIndex() != iPrevRowIndex
		&& iRowOffset != pNextRow->GetIndex() % nRpL)
		{
			iPrevRowIndex = pNextRow->GetIndex();
			pNextRow = m_pReportControl->GetRows()->GetNext(pNextRow, m_pReportControl->IsSkipGroupsFocusEnabled());
		}

		if (pNextRow && pNextRow->GetIndex() != iPrevRowIndex)
		{
// from the last body row jump to the first header row
			if (iFocusRow >= pNextRow->GetIndex())
			{
				if (m_pReportControl->IsFooterRowsVisible() && m_pReportControl->IsFooterRowsAllowAccess())
					MoveFirstVisibleRow(xtpRowTypeFooter);
			}
			else
			{
				m_pReportControl->SetFocusedRow(pNextRow, bShiftKey, bControlKey);
			}
		}
	}
}