/**
 * show previous error.
 *
 *  selects the previous error message and displays the source location.
 *
 * @param           -
 * @return          -
 * @exception       -
 * @see             GetLine(), SelectLine(), EvaluateErrorMessage(), ShowSourceLocation()
*/
void CMsgView::ShowPreviousError()
{
    int     iLine;
    BOOL    bFound = FALSE;
    CString strLine;
    CString strSourceFile;
    CString strLocation;
    CEdit&  editCtrl = GetEditCtrl();

    iLine = editCtrl.LineFromChar();
    --iLine;
    if(iLine < 0)
    {
        iLine = editCtrl.GetLineCount() - 1;
    }

    while(GetLine(iLine, strLine))
    {
        if(EvaluateErrorMessage(strLine, strSourceFile, strLocation))
        {
            SelectLine(iLine);
            GetCDInfo(iLine-1, editCtrl, strSourceFile, dynamic_cast<CMsgFrame*>(GetParentFrame()), GetDocument());
            ShowSourceLocation(strSourceFile, strLocation);
            bFound = TRUE;
            break;
        }
        --iLine;
    }
    if(!bFound)
    {
        MessageBeep(-1);
    }
}
Beispiel #2
0
void CallLine(GLint button, GLint state, GLint x, GLint y){
	static int first=1;

	if (state == GLUT_DOWN && button == GLUT_LEFT_BUTTON){

		if (first == 1){

			x1 = x; 
			y10 = hh - y;
			first++;
		}

		else if(first == 2){

			x2 = x;
			y2 = hh - y;
			first = 1;
			glLineWidth(3.0);
			SelectLine();
		}

	}

	return;
}
/**
 * show current error.
 *
 *  selects current line and shows error location in source if possible.
 *
 * @param           -
 * @return          -
 * @exception       -
 * @see             GetLine(), SelectLine(), EvaluateErrorMessage(), ShowSourceLocation()
*/
void CMsgView::ShowCurrentError()
{
    int     iLine;          // line number of current line
    CString strLine;        // current line as string
    CString strSourceFile;  // source file name without path
    CString strLocation;    // location in source file

    CEdit& editCtrl = GetEditCtrl();

    // get current line
    iLine = editCtrl.LineFromChar();
    if(!SelectLine(iLine))
    {
        return;
    }

    GetLine(iLine, strLine);

    if(EvaluateErrorMessage(strLine, strSourceFile, strLocation))
    {
        GetCDInfo(iLine-1, editCtrl, strSourceFile, dynamic_cast<CMsgFrame*>(GetParentFrame()), GetDocument());
        ShowSourceLocation(strSourceFile, strLocation);
    }
    else
    {
        MessageBeep(-1);
    }
}
void CGrepView::OnUpdate(COutputView* pSender,LPARAM lHint,CObject* pHint) //UPDATE
{
	if (pSender == this)
		return;

	if (m_nIndex < 0)
		return;

	if ((COutputDoc::HINT)lHint == (COutputDoc::hintSelectGrep1Line + m_nIndex))
		SelectLine(*(int*) pHint);
}