Changeset 8 for trunk/src/widgets
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- Location:
- trunk/src/widgets
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/widgets/qdockwindow.cpp
r7 r8 391 391 timer = new QTimer( this ); 392 392 connect( timer, SIGNAL( timeout() ), this, SLOT( minimize() ) ); 393 #if def Q_WS_WIN393 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 394 394 setCursor( SizeAllCursor ); 395 395 #endif -
trunk/src/widgets/qlabel.cpp
r7 r8 280 280 ( ( textformat == AutoText ) && QStyleSheet::mightBeRichText(ltext) ) ); 281 281 #else 282 bool useRichText = TRUE;282 bool useRichText = FALSE; 283 283 #endif 284 284 #ifndef QT_NO_ACCEL … … 711 711 712 712 if ( x + w < cr.right() ) 713 reg = reg.unite( QRect( x + w, cr.y(), cr.right() - x - w , cr.height() ) );713 reg = reg.unite( QRect( x + w, cr.y(), cr.right() - x - w + 1, cr.height() ) ); 714 714 if ( y + h < cr.bottom() ) 715 reg = reg.unite( QRect( cr.x(), y + h, cr.width(), cr.bottom() - y - h ) );715 reg = reg.unite( QRect( cr.x(), y + h, cr.width(), cr.bottom() - y - h + 1 ) ); 716 716 717 717 erase( reg ); -
trunk/src/widgets/qlineedit.cpp
r7 r8 1379 1379 case Key_Left: 1380 1380 case Key_Right: 1381 #if defined (Q_WS_WIN) 1381 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1382 1382 case Key_Insert: 1383 1383 case Key_Delete: … … 1636 1636 } 1637 1637 break; 1638 #if defined (Q_WS_WIN) 1638 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1639 1639 case Key_Insert: 1640 1640 copy(); … … 1713 1713 case Key_Delete: 1714 1714 if ( !d->readOnly ) { 1715 #if defined (Q_WS_WIN) 1715 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1716 1716 if ( e->state() & ShiftButton ) { 1717 1717 cut(); … … 1722 1722 } 1723 1723 break; 1724 #if defined (Q_WS_WIN) 1724 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1725 1725 case Key_Insert: 1726 1726 if ( !d->readOnly && e->state() & ShiftButton ) -
trunk/src/widgets/qpopupmenu.cpp
r7 r8 1509 1509 itemh = sz.height(); 1510 1510 1511 if ( ncols > 1 && y + itemh > contentsRect().bottom() ) {1512 if ( y < contentsRect().bottom() ) {1513 QRect rect(x, y, itemw, contentsRect().bottom() - y );1511 if ( ncols > 1 && y + itemh - 1 > contentsRect().bottom() ) { 1512 if ( y <= contentsRect().bottom() ) { 1513 QRect rect(x, y, itemw, contentsRect().bottom() - y + 1); 1514 1514 if(!p->hasClipping() || p->clipRegion().contains(rect)) { 1515 1515 flags = QStyle::Style_Default; … … 1528 1528 ++row; 1529 1529 } 1530 if ( y < contentsRect().bottom() ) {1531 QRect rect(x, y, itemw, contentsRect().bottom() - y );1530 if ( y <= contentsRect().bottom() ) { 1531 QRect rect(x, y, itemw, contentsRect().bottom() - y + 1); 1532 1532 if(!p->hasClipping() || p->clipRegion().contains(rect)) { 1533 1533 flags = QStyle::Style_Default; … … 1676 1676 actSig( mi->id(), b); 1677 1677 } 1678 #endif 1679 #if defined(Q_WS_PM) 1680 #ifndef QT_NO_WHATSTHIS 1681 else 1682 #endif 1683 //@@TODO (dmik): we need to play a sound when a disabled item is activated 1684 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 1685 // globally in Qt? 1686 WinAlarm( HWND_DESKTOP, WA_ERROR ); 1678 1687 #endif 1679 1688 } else if ( popup ) { … … 1919 1928 #endif 1920 1929 mi = mitems->at( actItem ); 1921 if ( !mi->isEnabled() && !b ) 1930 if ( !mi->isEnabled() && !b ) { 1931 #if defined(Q_WS_PM) 1932 //@@TODO (dmik): we need to play a sound when a disabled item is activated 1933 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 1934 // globally in Qt? 1935 WinAlarm( HWND_DESKTOP, WA_ERROR ); 1936 #endif 1922 1937 break; 1938 } 1923 1939 popup = mi->popup(); 1924 1940 if ( popup ) { … … 2009 2025 popup->setFirstItemActive(); 2010 2026 } else { 2027 #if !defined(Q_WS_PM) // do it later, only in case of item activation 2011 2028 byeMenuBar(); 2029 #endif 2012 2030 #ifndef QT_NO_WHATSTHIS 2013 2031 bool b = QWhatsThis::inWhatsThisMode(); … … 2016 2034 #endif 2017 2035 if ( mi->isEnabledAndVisible() || b ) { 2036 #if defined(Q_WS_PM) 2037 byeMenuBar(); 2038 #endif 2018 2039 active_popup_menu = this; 2019 2040 QGuardedPtr<QSignal> signal = mi->signal(); … … 2023 2044 active_popup_menu = 0; 2024 2045 } 2046 #if defined(Q_WS_PM) 2047 //@@TODO (dmik): we need to play a sound when the disabled item is activated 2048 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 2049 // globally in Qt? 2050 else 2051 WinAlarm( HWND_DESKTOP, WA_ERROR ); 2052 #endif 2025 2053 } 2026 2054 } else if ( clashCount > 1 ) { // Clashes, highlight next... -
trunk/src/widgets/qscrollview.cpp
r7 r8 579 579 580 580 QScrollView::QScrollView( QWidget *parent, const char *name, WFlags f ) : 581 QFrame( parent, name, f & (~WStaticContents) & (~WResizeNoErase) )582 { 583 WFlags flags = WResizeNoErase| (f&WPaintClever) | (f&WRepaintNoErase) | (f&WStaticContents);581 QFrame( parent, name, f & (~WStaticContents) & (~WResizeNoErase) & (~WRepaintNoErase) ) 582 { 583 WFlags flags = (f&WResizeNoErase) | (f&WPaintClever) | (f&WRepaintNoErase) | (f&WStaticContents); 584 584 d = new QScrollViewData( this, flags ); 585 585 -
trunk/src/widgets/qsplitter.cpp
r7 r8 507 507 { 508 508 QPainter paint( this ); 509 paint.setPen( gray);509 paint.setPen( NoPen ); 510 510 paint.setBrush( gray ); 511 511 paint.setRasterOp( XorROP ); … … 513 513 const int rBord = 3; // customizable? 514 514 int hw = handleWidth(); 515 516 int p1, p2, op1, op2, tmp; 517 if ( p >= 0 ) { 518 p1 = p + hw / 2 - rBord; 519 p2 = p1 + 2 * rBord - 1; 520 } 521 if ( opaqueOldPos >= 0 ) { 522 op1 = opaqueOldPos + hw / 2 - rBord; 523 op2 = op1 + 2 * rBord - 1; 524 // exclude overlapping area to avoid flicker 525 if ( p >= 0 ) { 526 if ( p2 >= op1 && p2 <= op2 ) { 527 tmp = op1; 528 op1 = p2 + 1; 529 p2 = tmp - 1; 530 } else if ( p1 >= op1 && p1 <= op2 ) { 531 tmp = op2; 532 op2 = p1 - 1; 533 p1 = tmp + 1; 534 } 535 } 536 } 515 537 if ( orient == Horizontal ) { 516 538 if ( opaqueOldPos >= 0 ) 517 paint.drawRect( opaqueOldPos + hw / 2 - rBord, r.y(), 518 2 * rBord, r.height() ); 539 paint.drawRect( op1, r.y(), op2 - op1 + 1, r.height() ); 519 540 if ( p >= 0 ) 520 paint.drawRect( p + hw / 2 - rBord, r.y(), 2 * rBord, r.height() );541 paint.drawRect( p1, r.y(), p2 - p1 + 1, r.height() ); 521 542 } else { 522 543 if ( opaqueOldPos >= 0 ) 523 paint.drawRect( r.x(), opaqueOldPos + hw / 2 - rBord, 524 r.width(), 2 * rBord ); 544 paint.drawRect( r.x(), op1, r.width(), op2 - op1 + 1 ); 525 545 if ( p >= 0 ) 526 paint.drawRect( r.x(), p + hw / 2 - rBord, r.width(), 2 * rBord);546 paint.drawRect( r.x(), p1, r.width(), p2 - p1 + 1 ); 527 547 } 528 548 opaqueOldPos = p; -
trunk/src/widgets/qtextedit.cpp
r7 r8 1162 1162 case Key_Home: 1163 1163 case Key_End: 1164 #if defined (Q_WS_WIN) 1164 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1165 1165 case Key_Insert: 1166 1166 case Key_Delete: … … 1172 1172 } else { 1173 1173 switch ( ke->key() ) { 1174 #if defined (Q_WS_WIN) 1174 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1175 1175 case Key_Insert: 1176 1176 ke->accept(); … … 1276 1276 break; 1277 1277 case Key_Delete: 1278 #if defined (Q_WS_WIN) 1278 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1279 1279 if ( e->state() & ShiftButton ) { 1280 1280 cut(); … … 1294 1294 if ( e->state() & ShiftButton ) 1295 1295 paste(); 1296 #if defined (Q_WS_WIN) 1296 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1297 1297 else if ( e->state() & ControlButton ) 1298 1298 copy(); … … 1302 1302 break; 1303 1303 case Key_Backspace: 1304 #if defined (Q_WS_WIN) 1304 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1305 1305 if ( e->state() & AltButton ) { 1306 1306 if (e->state() & ControlButton ) { … … 1517 1517 doKeyboardAction( ActionKill ); 1518 1518 break; 1519 #if defined(Q_WS_WIN) 1519 #if defined(Q_WS_WIN) || defined (Q_WS_PM) 1520 1520 case Key_Insert: 1521 1521 copy(); … … 2408 2408 emitLinkClicked( u.toString( FALSE, FALSE ) ); 2409 2409 } 2410 #ifndef QT_NO_TEXTBROWSER 2410 2411 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 2411 2412 QConnectionList *clist = receivers( … … 2418 2419 } 2419 2420 } 2421 #endif 2420 2422 2421 2423 // emitting linkClicked() may result in that the cursor winds … … 4724 4726 } 4725 4727 if (!doc->focusIndicator.name.isEmpty()) { 4728 #ifndef QT_NO_TEXTBROWSER 4726 4729 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 4727 4730 QConnectionList *clist = receivers( … … 4736 4739 } 4737 4740 } 4741 #endif 4738 4742 } 4739 4743 #ifndef QT_NO_CURSOR … … 4749 4753 copy(); 4750 4754 break; 4751 #if def Q_WS_WIN4755 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 4752 4756 case Key_Insert: 4753 4757 copy(); … … 5010 5014 } 5011 5015 } else { 5012 #if defined(Q_OS_WIN32) 5016 #if defined(Q_OS_WIN32) || defined (Q_OS_OS2) 5013 5017 // Need to convert CRLF to LF 5014 5018 t.replace( "\r\n", "\n" ); … … 6692 6696 int endLine = startLine + nLines; 6693 6697 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 6696 6706 if ( (startLine + nLines) > d->od->numLines ) 6697 6707 nLines = d->od->numLines - startLine; … … 6842 6852 td->draw( p, r.x(), r.y(), r.width(), r.height(), colorGroup() ); 6843 6853 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 6844 6875 delete td; 6845 6876 } -
trunk/src/widgets/qtitlebar.cpp
r7 r8 58 58 #if defined(Q_WS_WIN) 59 59 #include "qt_windows.h" 60 #elif defined(Q_WS_PM) 61 #include "qt_os2.h" 60 62 #endif 61 63 … … 189 191 } 190 192 191 #if def Q_WS_WIN193 #if defined (Q_WS_WIN) 192 194 extern QRgb qt_colorref2qrgb(COLORREF col); 195 #elif defined (Q_WS_PM) 196 extern QRgb qt_sysclr2qrgb( LONG sysClr ); 193 197 #endif 194 198 … … 196 200 { 197 201 QPalette pal = palette(); 202 203 #if defined (Q_WS_PM) 204 // we always use PM system colors for titlebars (regardless of 205 // QApplication::desktopSettingsAware()), because the simulation will 206 // most likely produce the same color both for an active and inactive title. 207 pal.setColor( QPalette::Active, QColorGroup::Highlight, 208 QColor( qt_sysclr2qrgb( SYSCLR_ACTIVETITLE ) ) ); 209 pal.setColor( QPalette::Active, QColorGroup::Base, 210 pal.active().highlight() ); 211 pal.setColor( QPalette::Active, QColorGroup::HighlightedText, 212 QColor( qt_sysclr2qrgb( SYSCLR_ACTIVETITLETEXT ) ) ); 213 pal.setColor( QPalette::Inactive, QColorGroup::Highlight, 214 QColor( qt_sysclr2qrgb( SYSCLR_INACTIVETITLE ) ) ); 215 pal.setColor( QPalette::Inactive, QColorGroup::Base, 216 pal.inactive().highlight() ); 217 pal.setColor( QPalette::Inactive, QColorGroup::HighlightedText, 218 QColor( qt_sysclr2qrgb( SYSCLR_INACTIVETITLETEXT ) ) ); 219 #else 198 220 199 221 bool colorsInitialized = FALSE; … … 239 261 pal.setColor( QPalette::Inactive, QColorGroup::HighlightedText, palette().inactive().background() ); 240 262 } 263 #endif // Q_WS_PM 241 264 242 265 setPalette( pal ); -
trunk/src/widgets/qtooltip.cpp
r7 r8 126 126 int wakeUpDelay; 127 127 QTimer fallAsleep; 128 #ifdef Q_WS_PM 129 QTimer doAllowAnimation; 130 #endif 128 131 129 132 QPtrDict<Tip> *tips; … … 164 167 connect( &wakeUp, SIGNAL(timeout()), SLOT(showTip()) ); 165 168 connect( &fallAsleep, SIGNAL(timeout()), SLOT(hideTip()) ); 169 #ifdef Q_WS_PM 170 connect( &doAllowAnimation, SIGNAL(timeout()), SLOT(allowAnimation()) ); 171 #endif 166 172 removeTimer = new QTimer( this ); 167 173 } … … 589 595 void QTipManager::hideTip() 590 596 { 597 #ifdef Q_WS_PM 598 // OS/2 PM has a very low limit on the number of simultaneous PM timers, 599 // so we reuse the same timer instead of creating a new one every time this 600 // function is invoked (it can happen more frequently than once per 250 ms). 601 doAllowAnimation.start( 250, TRUE ); 602 #else 591 603 QTimer::singleShot( 250, this, SLOT(allowAnimation()) ); 604 #endif 592 605 preventAnimation = TRUE; 593 606 -
trunk/src/widgets/qwidgetresizehandler.cpp
r7 r8 45 45 #if defined(Q_WS_WIN) 46 46 #include "qt_windows.h" 47 #elif defined(Q_WS_PM) 48 #include "qt_os2.h" 47 49 #endif 48 50 … … 306 308 ; 307 309 } ); 310 #elif defined(Q_WS_PM) 311 QMSG qmsg; 312 while( WinPeekMsg( 0, &qmsg, widget->winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE ) ) 313 ; 308 314 #endif 309 315
Note:
See TracChangeset
for help on using the changeset viewer.