vclxtoolkit.cxx (e821fb77) | vclxtoolkit.cxx (61161268) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 367 unchanged lines hidden (view full) --- 376 sizeof( aComponentInfos ) / sizeof( ComponentInfo ), 377 sizeof( ComponentInfo ), 378 ComponentInfoCompare ); 379 380 return pInf ? pInf->nWinType : 0; 381} 382 383 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 367 unchanged lines hidden (view full) --- 376 sizeof( aComponentInfos ) / sizeof( ComponentInfo ), 377 sizeof( ComponentInfo ), 378 ComponentInfoCompare ); 379 380 return pInf ? pInf->nWinType : 0; 381} 382 383 |
384namespace 385{ 386 struct MessageBoxTypeInfo 387 { 388 css::awt::MessageBoxType eType; 389 const sal_Char *pName; 390 sal_Int32 nLen; 391 }; 392 393 static MessageBoxTypeInfo aMessageBoxTypeInfo[] = 394 { 395 { css::awt::MessageBoxType_MESSAGEBOX, RTL_CONSTASCII_STRINGPARAM("messbox") }, 396 { css::awt::MessageBoxType_INFOBOX, RTL_CONSTASCII_STRINGPARAM("infobox") }, 397 { css::awt::MessageBoxType_WARNINGBOX, RTL_CONSTASCII_STRINGPARAM("warningbox") }, 398 { css::awt::MessageBoxType_ERRORBOX, RTL_CONSTASCII_STRINGPARAM("errorbox") }, 399 { css::awt::MessageBoxType_QUERYBOX, RTL_CONSTASCII_STRINGPARAM("querybox") }, 400 { css::awt::MessageBoxType_MAKE_FIXED_SIZE, 0, 0 } 401 }; 402 403 static bool lcl_convertMessageBoxType( 404 rtl::OUString &sType, 405 css::awt::MessageBoxType eType ) 406 { 407 const MessageBoxTypeInfo *pMap = aMessageBoxTypeInfo; 408 css::awt::MessageBoxType eVal = css::awt::MessageBoxType_MAKE_FIXED_SIZE; 409 410 while ( pMap->pName ) 411 { 412 if ( pMap->eType == eType ) 413 { 414 eVal = eType; 415 sType = rtl::OUString( pMap->pName, pMap->nLen, RTL_TEXTENCODING_ASCII_US ); 416 break; 417 } 418 pMap++; 419 } 420 421 return ( eVal != css::awt::MessageBoxType_MAKE_FIXED_SIZE ); 422 } 423} 424 |
|
384// ---------------------------------------------------- 385// class VCLXToolkit 386// ---------------------------------------------------- 387 388static sal_Int32 nVCLToolkitInstanceCount = 0; 389static sal_Bool bInitedByVCLToolkit = sal_False; 390//static cppu::OInterfaceContainerHelper * pToolkits = 0; 391 --- 827 unchanged lines hidden (view full) --- 1219 xPeer = pPeer; 1220 } 1221 1222 return xPeer; 1223} 1224 1225// ::com::sun::star::awt::XMessageBoxFactory 1226::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessageBox( | 425// ---------------------------------------------------- 426// class VCLXToolkit 427// ---------------------------------------------------- 428 429static sal_Int32 nVCLToolkitInstanceCount = 0; 430static sal_Bool bInitedByVCLToolkit = sal_False; 431//static cppu::OInterfaceContainerHelper * pToolkits = 0; 432 --- 827 unchanged lines hidden (view full) --- 1260 xPeer = pPeer; 1261 } 1262 1263 return xPeer; 1264} 1265 1266// ::com::sun::star::awt::XMessageBoxFactory 1267::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessageBox( |
1227 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, 1228 const ::com::sun::star::awt::Rectangle& aPosSize, 1229 const ::rtl::OUString& aType, | 1268 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, 1269 ::com::sun::star::awt::MessageBoxType eType, |
1230 ::sal_Int32 aButtons, 1231 const ::rtl::OUString& aTitle, 1232 const ::rtl::OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException) 1233{ 1234 ::com::sun::star::awt::WindowDescriptor aDescriptor; 1235 1236 sal_Int32 nWindowAttributes = css::awt::WindowAttribute::BORDER|css::awt::WindowAttribute::MOVEABLE|css::awt::WindowAttribute::CLOSEABLE; 1237 --- 23 unchanged lines hidden (view full) --- 1261 1262 // No more bits for VclWindowPeerAttribute possible. Mapping must be 1263 // done explicitly using VCL methods 1264 WinBits nAddWinBits( 0 ); 1265 if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_ABORT_IGNORE_RETRY ) 1266 nAddWinBits |= WB_ABORT_RETRY_IGNORE; 1267 if ( sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_IGNORE ) 1268 nAddWinBits |= WB_DEF_IGNORE; | 1270 ::sal_Int32 aButtons, 1271 const ::rtl::OUString& aTitle, 1272 const ::rtl::OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException) 1273{ 1274 ::com::sun::star::awt::WindowDescriptor aDescriptor; 1275 1276 sal_Int32 nWindowAttributes = css::awt::WindowAttribute::BORDER|css::awt::WindowAttribute::MOVEABLE|css::awt::WindowAttribute::CLOSEABLE; 1277 --- 23 unchanged lines hidden (view full) --- 1301 1302 // No more bits for VclWindowPeerAttribute possible. Mapping must be 1303 // done explicitly using VCL methods 1304 WinBits nAddWinBits( 0 ); 1305 if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_ABORT_IGNORE_RETRY ) 1306 nAddWinBits |= WB_ABORT_RETRY_IGNORE; 1307 if ( sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_IGNORE ) 1308 nAddWinBits |= WB_DEF_IGNORE; |
1269 | 1309 1310 rtl::OUString aType; 1311 lcl_convertMessageBoxType( aType, eType ); 1312 |
1270 aDescriptor.Type = css::awt::WindowClass_MODALTOP; 1271 aDescriptor.WindowServiceName = aType; 1272 aDescriptor.ParentIndex = -1; 1273 aDescriptor.Parent = aParent; | 1313 aDescriptor.Type = css::awt::WindowClass_MODALTOP; 1314 aDescriptor.WindowServiceName = aType; 1315 aDescriptor.ParentIndex = -1; 1316 aDescriptor.Parent = aParent; |
1274 aDescriptor.Bounds = aPosSize; | |
1275 aDescriptor.WindowAttributes = nWindowAttributes; 1276 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > xMsgBox( 1277 ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY ); 1278 css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY ); 1279 if ( xMsgBox.is() && xWindow.is() ) 1280 { 1281 Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); 1282 if ( pWindow ) --- 443 unchanged lines hidden --- | 1317 aDescriptor.WindowAttributes = nWindowAttributes; 1318 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > xMsgBox( 1319 ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY ); 1320 css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY ); 1321 if ( xMsgBox.is() && xWindow.is() ) 1322 { 1323 Window * pWindow = VCLUnoHelper::GetWindow( xWindow ); 1324 if ( pWindow ) --- 443 unchanged lines hidden --- |