Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/widgets/qtextedit.cpp

    r7 r8  
    11621162            case Key_Home:
    11631163            case Key_End:
    1164 #if defined (Q_WS_WIN)
     1164#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    11651165            case Key_Insert:
    11661166            case Key_Delete:
     
    11721172        } else {
    11731173            switch ( ke->key() ) {
    1174 #if defined (Q_WS_WIN)
     1174#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    11751175            case Key_Insert:
    11761176                ke->accept();
     
    12761276        break;
    12771277    case Key_Delete:
    1278 #if defined (Q_WS_WIN)
     1278#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    12791279        if ( e->state() & ShiftButton ) {
    12801280            cut();
     
    12941294        if ( e->state() & ShiftButton )
    12951295            paste();
    1296 #if defined (Q_WS_WIN)
     1296#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    12971297        else if ( e->state() & ControlButton )
    12981298            copy();
     
    13021302        break;
    13031303    case Key_Backspace:
    1304 #if defined (Q_WS_WIN)
     1304#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    13051305        if ( e->state() & AltButton ) {
    13061306            if (e->state() & ControlButton ) {
     
    15171517                    doKeyboardAction( ActionKill );
    15181518                    break;
    1519 #if defined(Q_WS_WIN)
     1519#if defined(Q_WS_WIN) || defined (Q_WS_PM)
    15201520                case Key_Insert:
    15211521                    copy();
     
    24082408            emitLinkClicked( u.toString( FALSE, FALSE ) );
    24092409        }
     2410#ifndef QT_NO_TEXTBROWSER
    24102411        if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0
    24112412            QConnectionList *clist = receivers(
     
    24182419            }
    24192420        }
     2421#endif       
    24202422
    24212423        // emitting linkClicked() may result in that the cursor winds
     
    47244726            }
    47254727            if (!doc->focusIndicator.name.isEmpty()) {
     4728#ifndef QT_NO_TEXTBROWSER
    47264729                if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0
    47274730                    QConnectionList *clist = receivers(
     
    47364739                    }
    47374740                }
     4741#endif               
    47384742            }
    47394743#ifndef QT_NO_CURSOR
     
    47494753                copy();
    47504754                break;
    4751 #ifdef Q_WS_WIN
     4755#if defined (Q_WS_WIN) || defined (Q_WS_PM)
    47524756            case Key_Insert:
    47534757                copy();
     
    50105014        }
    50115015    } else {
    5012 #if defined(Q_OS_WIN32)
     5016#if defined(Q_OS_WIN32) || defined (Q_OS_OS2)
    50135017        // Need to convert CRLF to LF
    50145018        t.replace( "\r\n", "\n" );
     
    66926696    int endLine = startLine + nLines;
    66936697
    6694     if ( startLine >= d->od->numLines )
    6695         return;
     6698    if ( startLine >= d->od->numLines ) {
     6699#if defined (Q_WS_PM)
     6700        // see below for more info
     6701        p->eraseRect( clipx, clipy, clipw, cliph );
     6702#endif
     6703        return;
     6704    }
     6705   
    66966706    if ( (startLine + nLines) > d->od->numLines )
    66976707        nLines = d->od->numLines - startLine;
     
    68426852    td->draw( p, r.x(), r.y(), r.width(), r.height(), colorGroup() );
    68436853    p->translate( 0, -(clipy - offset) );
     6854   
     6855#if defined (Q_WS_PM)
     6856    // QTextEdit has WResizeNoErase and WRepaintNoErase flags (actually applied
     6857    // to the viewport()), so we must erase areas not covered by the text doc.
     6858    // [Win32 version feels ok without this, because it doesn't actually
     6859    // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     6860    // erases the background before WM_PAINT and after every resize].
     6861   
     6862    int tw = td->width();
     6863    // calculate the height the text doc will occupy starting with clipy
     6864    int th = td->height() - offset; 
     6865    if ( clipx + clipw > td->width() ) {
     6866        // erase background to the left of every line
     6867        p->eraseRect( tw, clipy, clipx + clipw - tw, th );
     6868    }
     6869    if ( cliph > th ) {
     6870        // erase background under the text doc
     6871        p->eraseRect( clipx, clipy + th, clipw, cliph - th );
     6872    }
     6873#endif
     6874   
    68446875    delete td;
    68456876}
Note: See TracChangeset for help on using the changeset viewer.