コード例 #1
0
	vector<size_t> CKNearestNeighbor::GetCoordinate(const StringVector& header)
	{
		vector<size_t> coord;

		vector<size_t> posX = GetColumnPos(header, "X", true);
		vector<size_t> posY = GetColumnPos(header, "Y", true);
		if (posX.size() == 1 && posY.size() == 1)
		{
			coord.push_back(posX[0]);
			coord.push_back(posY[0]);
		}


		return coord;
	}
コード例 #2
0
ファイル: headerctrlg.cpp プロジェクト: Toonerz/project64
bool wxHeaderCtrl::EndReordering(int xPhysical)
{
    wxASSERT_MSG( IsReordering(), "shouldn't be called if we're not reordering" );

    EndDragging();

    ReleaseMouse();

    const int colOld = m_colBeingReordered,
              colNew = FindColumnAtPoint(xPhysical);

    m_colBeingReordered = COL_NONE;

    if ( xPhysical - GetColStart(colOld) == m_dragOffset )
        return false;

    if ( colNew != colOld )
    {
        wxHeaderCtrlEvent event(wxEVT_COMMAND_HEADER_END_REORDER, GetId());
        event.SetEventObject(this);
        event.SetColumn(colOld);

        const unsigned pos = GetColumnPos(FindColumnAtPoint(xPhysical));
        event.SetNewOrder(pos);

        if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
        {
            // do reorder the columns
            DoMoveCol(colOld, pos);
        }
    }

    // whether we moved the column or not, the user did move the mouse and so
    // did try to do it so return true
    return true;
}