Example #1
0
// back-end, now that a wrapper is provided for the front-end code to do the actual scrolling
void
MemoContentUpdated ()
{
    int caretPos;

    if(lastCurrent <= currLast) DoHighlight( lastCurrent, FALSE );

    lastFirst = currFirst;
    lastLast = currLast;
    lastCurrent = currCurrent;
    lastGames = storedGames;
    lastLastMove[0] = '\0';

    if( lastLast > 0 ) {
      safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) );
    }

    /* Deselect any text, move caret to end of memo */
    if( currCurrent >= 0 ) {
        caretPos = histMoves[currCurrent].memoOffset + histMoves[currCurrent].memoLength;
    }
    else {
        caretPos = -1;
    }

    ScrollToCurrent(caretPos);
    DoHighlight( currCurrent, TRUE ); // [HGM] moved last, because in X some scrolling methods spoil highlighting
}
Example #2
0
// back-end, now that a wrapper is provided for the front-end code to do the actual scrolling
void MemoContentUpdated()
{
    int caretPos;

    DoHighlight( lastCurrent, FALSE );
    DoHighlight( currCurrent, TRUE );

    lastFirst = currFirst;
    lastLast = currLast;
    lastCurrent = currCurrent;
    lastLastMove[0] = '\0';

    if( lastLast > 0 ) {
      safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) );
    }

    /* Deselect any text, move caret to end of memo */
    if( currCurrent >= 0 ) {
        caretPos = histMoves[currCurrent].memoOffset + histMoves[currCurrent].memoLength;
    }
    else {
        caretPos = -1;
    }

    ScrollToCurrent(caretPos);
}