Changeset 53
- Timestamp:
- Jan 15, 2006, 11:06:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qwidget_pm.cpp
r8 r53 51 51 #include "qcursor.h" 52 52 #include <private/qapplication_p.h> 53 //@@TODO (dmik): remove 53 //@@TODO (dmik): remove? 54 54 //#include <private/qinputcontext_p.h> 55 56 //@@TODO (dmik): need this?57 //#if defined(QT_NON_COMMERCIAL)58 //#include "qnc_win.h"59 //#endif60 61 //@@TODO (dmik): remove62 //#if !defined(WS_EX_TOOLWINDOW)63 //#define WS_EX_TOOLWINDOW 0x0000008064 //#endif65 //66 //#if !defined(GWLP_WNDPROC)67 //#define GWLP_WNDPROC GWL_WNDPROC68 //#endif69 55 70 56 const QString qt_reg_winclass( int ); // defined in qapplication_pm.cpp … … 155 141 //#define QT_DEBUGWINCREATEDESTROY 156 142 157 void QWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) 158 { 143 void QWidget::create( WId window, bool initializeWindow, bool destroyOldWindow ) 144 { 145 // When window is not zero, it represents an existing (external) window 146 // handle we should create a QWidget "wrapper" for to incorporate it to the 147 // Qt widget hierarchy. But so far I have never seen this method called 148 // with window != 0, so we ignore this argument (as well as the other two 149 // that make sense only together with it) for now and will not implement 150 // this functionality until there's a real need. 151 152 Q_ASSERT( window == 0 ); 153 Q_UNUSED( initializeWindow ); 154 Q_UNUSED( destroyOldWindow ); 155 159 156 if ( testWState(WState_Created) && window == 0 ) 160 157 return; … … 170 167 bool dialog = testWFlags(WType_Dialog); 171 168 bool desktop = testWFlags(WType_Desktop); 172 //@@TODO (dmik): guess this is for embedded windows. remove?173 // HWND destroyw = 0;174 169 WId id = 0; 175 170 176 if ( !window ) // always initialize177 initializeWindow = TRUE;178 179 171 if ( popup ) { 180 //@@TODO (dmik): ignored for now? 172 /// @todo (dmik) WStyle_StaysOnTop is ignored for now (does nothing) 181 173 setWFlags(WStyle_StaysOnTop); // a popup stays on top 182 174 } … … 187 179 } 188 180 189 //@@TODO (dmik): guess this is for embedded windows. remove?190 // if ( window ) {191 // // There's no way we can know the background color of the192 // // other window because it could be cleared using the WM_ERASEBKND193 // // message. Therefore we assume white.194 // bg_col = white;195 // }196 197 181 if ( dialog || popup || desktop ) { // these are top-level, too 198 182 topLevel = TRUE; … … 202 186 if ( desktop ) { // desktop widget 203 187 popup = FALSE; // force this flags off 204 // @@TODO (dmik): use WinGetMaxPosition () to take into account such205 // things as XCenter?188 /// @todo (dmik) 189 // use WinGetMaxPosition () to take into account such things as XCenter? 206 190 crect.setRect( 0, 0, sw, sh ); 207 191 } … … 211 195 ULONG fId = 0, fStyle = 0, fcFlags = 0; 212 196 213 //@@TODO (dmik): guess this is for embedded windows. remove?214 // if ( window ) {215 // style = GetWindowLongA( window, GWL_STYLE );216 //#ifndef QT_NO_DEBUG217 // if ( !style )218 // qSystemWarning( "QWidget: GetWindowLong failed" );219 //#endif220 // topLevel = FALSE; // #### needed for some IE plugins??221 // } else if ( popup ) {222 197 if ( popup ) { 223 198 style |= WS_SAVEBITS; 224 199 } else if ( !topLevel ) { 225 //@@TODO (dmik): why should we set these flags for non-toplevel (child) windows?226 // if ( !testWFlags(WStyle_Customize) )227 // setWFlags( WStyle_NormalBorder | WStyle_Title | WStyle_MinMax | WStyle_SysMenu );228 200 if ( !testWFlags(WStyle_Customize) ) 229 setWFlags( WStyle_ Title);201 setWFlags( WStyle_NormalBorder | WStyle_Title | WStyle_MinMax | WStyle_SysMenu ); 230 202 } else if (!desktop ) { 231 203 if ( !testWFlags(WStyle_Customize) ) { … … 244 216 } 245 217 if ( !desktop ) { 246 //@@TODO (dmik): this is temporarily commented out because QSplitter sets 247 // WPaintUnclipped which causes terrible flicker in QFileDialog's list 248 // box and list view. this needs to be investigated. Qt/Win32 does also 249 // comment this out... 250 // if ( !testWFlags( WPaintUnclipped ) ) 218 /// @todo (dmik) 219 // this is temporarily commented out because QSplitter sets 220 // WPaintUnclipped which causes terrible flicker in QFileDialog's list 221 // box and list view. This needs to be investigated. Qt/Win32 does also 222 // comment this out... 223 /* if ( !testWFlags( WPaintUnclipped ) ) */ 251 224 style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN; 252 225 // for all top-level windows except popups we create a WC_FRAME … … 286 259 PCSZ pszClassName = className.latin1(); 287 260 288 //@@TODO (dmik): guess this is for embedded windows. remove? 289 // if ( window ) { // override the old window 290 // if ( destroyOldWindow ) 291 // destroyw = winid; 292 // id = window; 293 // setWinId( window ); 294 // LONG res = SetWindowLongA( window, GWL_STYLE, style ); 295 //#ifndef QT_NO_DEBUG 296 // if ( !res ) 297 // qSystemWarning( "QWidget: Failed to set window style" ); 298 //#endif 299 // res = SetWindowLongA( window, GWLP_WNDPROC, (LONG)QtWndProc ); 300 //#ifndef QT_NO_DEBUG 301 // if ( !res ) 302 // qSystemWarning( "QWidget: Failed to set window procedure" ); 303 //#endif 304 // } else if ( desktop ) { // desktop widget 305 if ( desktop ) { // desktop widget 261 if ( desktop ) { // desktop widget 306 262 id = WinQueryDesktopWindow( 0, 0 ); 307 263 QWidget *otherDesktop = find( id ); // is there another desktop? … … 397 353 #endif 398 354 setWinId( id ); 399 //@@TODO (dmik): remove? 400 // if ( testWFlags( WStyle_StaysOnTop) ) 401 // SetWindowPos( id, HWND_TOPMOST, 0, 0, 100, 100, SWP_NOACTIVATE ); 355 /// @todo (dmik) WStyle_StaysOnTop is ignored for now (does nothing) 356 /* 357 if ( testWFlags( WStyle_StaysOnTop) ) 358 SetWindowPos( id, HWND_TOPMOST, 0, 0, 100, 100, SWP_NOACTIVATE ); 359 */ 402 360 403 361 // When the FS_SHELLPOSITION flag is specified during WC_FRAME window … … 439 397 setWState( WState_Visible ); 440 398 } else { 441 //@@TODO (dmik): remove. probably this is done for embedded windows?442 // RECT fr, cr;443 // GetWindowRect( id, &fr ); // update rects444 // GetClientRect( id, &cr );445 // if ( cr.top == cr.bottom && cr.left == cr.right ) {446 // if ( initializeWindow ) {447 // int x, y, w, h;448 // if ( topLevel ) {449 // x = sw/4;450 // y = 3*sh/10;451 // w = sw/2;452 // h = 4*sh/10;453 // } else {454 // x = y = 0;455 // w = 100;456 // h = 30;457 // }458 //459 // MoveWindow( winId(), x, y, w, h, TRUE );460 // }461 // GetWindowRect( id, &fr ); // update rects462 // GetClientRect( id, &cr );463 // }464 399 SWP cswp; 465 400 WinQueryWindowPos( id, &cswp ); … … 493 428 cswp.y = cy - (cswp.y + cswp.cy); 494 429 crect.setRect( cswp.x, cswp.y, cswp.cx, cswp.cy ); 495 // in case extra data already exists (eg. reparent()). Set it.496 //@@TODO (dmik): what's this? ~~~^497 430 } 498 431 } … … 501 434 hps = 0; // no presentation space 502 435 503 //@@TODO (dmik): guess this is for embedded windows. remove?504 // if ( window ) { // got window from outside505 // if ( IsWindowVisible(window) )506 // setWState( WState_Visible );507 // else508 // clearWState( WState_Visible );509 // }510 511 //@@TODO (dmik): need?512 //#if defined(QT_NON_COMMERCIAL)513 // QT_NC_WIDGET_CREATE514 //#endif515 516 //@@TODO (dmik): guess this is for embedded windows. remove?517 // if ( destroyw ) {518 // WinDestroyWindow( destroyw );519 // }520 521 436 setFontSys(); 522 //@@TODO (dmik): remove? 437 438 /// @todo (dmik) remove? 523 439 // QInputContext::enable( this, im_enabled & !((bool)testWState(WState_Disabled)) ); 524 440 } … … 837 753 topData()->caption = caption; 838 754 839 //@@TODO (dmik): need?840 //#if defined(QT_NON_COMMERCIAL)841 // QT_NC_CAPTION842 //#else843 // QString cap = caption;844 //#endif845 846 755 QCString cap = caption.local8Bit(); 847 756 WinSetWindowText( winFId(), cap ); … … 1255 1164 void QWidget::showWindow() 1256 1165 { 1257 //@@TODO (dmik): need?1258 //#if defined(QT_NON_COMMERCIAL)1259 // QT_NC_SHOW_WINDOW1260 //#endif1261 1166 WinShowWindow( winFId(), TRUE ); 1262 1167 ULONG fl = 0;
Note:
See TracChangeset
for help on using the changeset viewer.