~ubuntu-branches/ubuntu/gutsy/tk8.4/gutsy-updates

« back to all changes in this revision

Viewing changes to generic/tkTextDisp.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-05 15:56:45 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070105155645-8srmlwqo7m1q86qi
Tags: 8.4.14-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 * See the file "license.terms" for information on usage and redistribution
12
12
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
13
 *
14
 
 * RCS: @(#) $Id: tkTextDisp.c,v 1.14.2.1 2005/11/27 02:44:26 das Exp $
 
14
 * RCS: @(#) $Id: tkTextDisp.c,v 1.14.2.4 2006/09/10 17:07:35 das Exp $
15
15
 */
16
16
 
17
17
#include "tkPort.h"
546
546
        tagPtr = tagPtrs[i];
547
547
 
548
548
        /*
549
 
         * On Windows and Mac, we need to skip the selection tag if
550
 
         * we don't have focus.
 
549
         * Skip the selection tag if we don't have focus,
 
550
         * unless we always want to show the selection.
551
551
         */
552
552
 
553
 
#ifndef ALWAYS_SHOW_SELECTION
554
 
        if ((tagPtr == textPtr->selTagPtr) && !(textPtr->flags & GOT_FOCUS)) {
 
553
        if (
 
554
#ifndef MAC_OSX_TK
 
555
                !TkpAlwaysShowSelection(textPtr->tkwin)
 
556
#else
 
557
                /* Don't show inactive selection in disabled widgets. */
 
558
                textPtr->state == TK_STATE_DISABLED
 
559
#endif
 
560
                && (tagPtr == textPtr->selTagPtr)
 
561
                && !(textPtr->flags & GOT_FOCUS)) {
555
562
            continue;
556
563
        }
557
 
#endif
558
564
 
559
565
        if ((tagPtr->border != NULL) && (tagPtr->priority > borderPrio)) {
560
566
            styleValues.border = tagPtr->border;
4176
4182
    }
4177
4183
    if (dlPtr->chunkPtr == NULL) dlPtr = validdlPtr;
4178
4184
 
 
4185
    *indexPtr = dlPtr->index;
 
4186
 
 
4187
    /*
 
4188
     * If it is still empty, we have nothing to access. [Bug 1442102]
 
4189
     */
 
4190
 
 
4191
    if (dlPtr->chunkPtr == NULL) {
 
4192
        return;
 
4193
    }
4179
4194
 
4180
4195
    /*
4181
4196
     * Scan through the line's chunks to find the one that contains
4184
4199
     * coordinate system of the line (to take account of x-scrolling).
4185
4200
     */
4186
4201
 
4187
 
    *indexPtr = dlPtr->index;
4188
4202
    x = x - dInfoPtr->x + dInfoPtr->curPixelOffset;
4189
4203
    for (chunkPtr = dlPtr->chunkPtr; x >= (chunkPtr->x + chunkPtr->width);
4190
4204
            indexPtr->byteIndex += chunkPtr->numBytes,