Changeset 1015 for tests/embedded/embedded.cpp
- Timestamp:
- Aug 20, 2011, 9:59:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/embedded/embedded.cpp
r1010 r1015 1 #ifdef __OS2__2 #include <os2.h>3 #endif4 5 1 #include <QDebug> 6 2 #include <QtGui> 3 4 #ifdef Q_WS_PM 5 #include <qt_os2.h> 6 #endif 7 8 #ifdef Q_WS_WIN 9 #include <qt_windows.h> 10 #endif 7 11 8 12 class VideoWidget : public QFrame … … 31 35 32 36 WId id = stable->winId(); 37 #ifdef Q_WS_PM 33 38 qDebug() << "stable id" << qDebugHWND (id); 39 #else 40 qDebug() << "stable id" << id; 41 #endif 34 42 return id; 35 43 } … … 90 98 91 99 bgWidget = new QLabel ("Background"); 100 bgWidget->setAutoFillBackground (true); 92 101 stackCentralW->addWidget (bgWidget); 93 102 … … 107 116 if (tickCount == 5) 108 117 resize (800, 600); 109 #ifdef __OS2__ 118 119 #ifdef Q_WS_PM 110 120 if (id) 111 121 { 112 122 qDebug() << "window handle" << qDebugFmtHex (id); 113 123 HWND hwnd = id; 124 RECTL rcl; 125 WinQueryWindowRect (hwnd, &rcl); 114 126 HPS hps = WinGetPS (hwnd); 115 127 if (hps) 116 128 { 117 RECTL rcl; 118 // WinQueryWindowRect (hwnd, &rcl); 129 HRGN hrgn = GpiCreateRegion(hps, 1L, &rcl); 130 ULONG rc = qt_WinProcessWindowObstacles (hwnd, NULL, hrgn, CRGN_DIFF, PWO_Default); 131 132 HRGN hrgnOld; 133 GpiSetClipRegion (hps, hrgn, &hrgnOld); 119 134 120 135 rcl.xLeft = 0; … … 127 142 WinDrawBorder (hps, &rcl, 3, 3, CLR_RED, CLR_DARKGREEN, DB_INTERIOR); 128 143 144 GpiDestroyRegion (hps, hrgnOld); 145 129 146 WinReleasePS (hps); 130 147 } 148 } 149 #endif 150 #ifdef Q_WS_WIN 151 if (id) 152 { 153 qDebug() << "window handle" << id; 154 HDC hdc = GetDC (id); 155 RECT rect; 156 rect.left = 0; 157 rect.top = 0; 158 rect.right = videoWidget->size().width(); 159 rect.bottom = videoWidget->size().height(); 160 SetDCBrushColor (hdc, RGB (0x00, 0x80, 0x00)); 161 FillRect (hdc, &rect, (HBRUSH) GetStockObject (DC_BRUSH)); 162 SetDCBrushColor (hdc, RGB (0xFF, 0x00, 0x00)); 163 FrameRect (hdc, &rect, (HBRUSH) GetStockObject (DC_BRUSH)); 164 ReleaseDC (id, hdc); 131 165 } 132 166 #endif
Note:
See TracChangeset
for help on using the changeset viewer.