Ejemplo n.º 1
0
//------------------------------------------------------------------------
//! Called by the framework when a drop operation is to occur, where the
//! origin is the CGridListCtrlEx itself
//!
//! @param pDataObject Points to the data object containing the data that can be dropped
//! @param dropEffect The effect that the user chose for the drop operation (DROPEFFECT_COPY, DROPEFFECT_MOVE, DROPEFFECT_LINK)
//! @param point Contains the current location of the cursor in client coordinates.
//! @return Nonzero if the drop is successful; otherwise 0
//------------------------------------------------------------------------
BOOL CGridListCtrlGroups::OnDropSelf(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
	// Internal drag (Move rows to other group)
	int nRow, nCol;
	CellHitTest(point, nRow, nCol);
	if (!IsGroupViewEnabled())
		return CGridListCtrlEx::MoveSelectedRows(nRow);

	if (GetStyle() & LVS_OWNERDATA)
		return false;

	int nGroupId = nRow!=-1 ? GetRowGroupId(nRow) : GroupHitTest(point);
	if (nGroupId==-1)
		return FALSE;
		
	if (MoveSelectedRows(nGroupId))
	{
		if (nRow!=-1)
		{
			EnsureVisible(nRow, FALSE);
			SetFocusRow(nRow);
		}
	}
	return TRUE;
}
Ejemplo n.º 2
0
void
PackageListView::SelectPackage(const PackageInfoRef& package)
{
	PackageRow* row = _FindRow(package);
	BRow* selected = CurrentSelection();
	if (row != selected)
		DeselectAll();
	if (row != NULL) {
		AddToSelection(row);
		SetFocusRow(row, false);
		ScrollTo(row);
	}
}
Ejemplo n.º 3
0
void TextField::OnFocusGain()
{
    KeyboardCursor::GetInstance().SetHwndId(GetHwndId());
    UIManager::GetInstance().DirtyRenderList(mHwndId);

    auto mani = UIManager::GetInstance().GetTextManipulator();
    mani->AddObserver(ITextManipulatorObserver::Default, std::dynamic_pointer_cast<ITextManipulatorObserver>(mSelfPtr.lock()));
    mani->SetText(&mTextw);


    auto propertyList = IsInPropertyList();
    if (propertyList)
    {
        ListItem* listItem = (ListItem*)GetParent().get();
        propertyList->SetFocusRow(listItem->GetRowIndex());
    }

    KeyboardCursor::GetInstance().SetScissorRegion(GetScissorRegion());
}