diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:26:37 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:26:37 +0000 |
commit | 04a59adcc7fd221ee6b7644aa1fa53fed8dd3c0e (patch) | |
tree | 98e45c3b1a1418ca54ef4a83f6022691099078e0 /vcl/source/window | |
parent | 554b7023a920d8701ef9d38c6e4952ebb41d1b5f (diff) | |
parent | c0bfd066e3d8355d35c2ea22d5a98ac7f43406da (diff) |
ab71: merge with DEV300_m54
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/accel.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/keycod.cxx | 54 | ||||
-rw-r--r-- | vcl/source/window/keyevent.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 40 | ||||
-rw-r--r-- | vcl/source/window/mouseevent.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 34 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 107 |
9 files changed, 158 insertions, 97 deletions
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 7dfc70c0fe32..34e831d2daf8 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -231,7 +231,8 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode, USHORT nCode1; USHORT nCode2; USHORT nCode3; - ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3 ); + USHORT nCode4; + ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 ); if ( nCode1 ) ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel ); if ( nCode2 ) diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 1e9a3350c88e..392c2ceaa478 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -1166,7 +1166,7 @@ KeyEvent Window::GetActivationKey() const nCode = KEY_A + (nAccel-'A'); else if( nAccel >= '0' && nAccel <= '9' ) nCode = KEY_0 + (nAccel-'0'); - KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE ); + KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE ); aKeyEvent = KeyEvent( nAccel, aKeyCode ); } return aKeyEvent; diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 042eac37aa41..21030b9422fb 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -49,38 +49,39 @@ // ======================================================================= -static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] = +static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] = { - 0, 0, 0, // KEYFUNC_DONTKNOW - KEY_N | KEY_MOD1, 0, 0, // KEYFUNC_NEW - KEY_O | KEY_MOD1, KEY_OPEN, 0, // KEYFUNC_OPEN - KEY_S | KEY_MOD1, 0, 0, // KEYFUNC_SAVE - 0, 0, 0, // KEYFUNC_SAVEAS - KEY_P | KEY_MOD1, 0, 0, // KEYFUNC_PRINT - KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, // KEYFUNC_CLOSE - KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, // KEYFUNC_QUIT - KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, // KEYFUNC_CUT - KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, // KEYFUNC_COPY - KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, // KEYFUNC_PASTE - KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, // KEYFUNC_UNDO - 0, 0, 0, // KEYFUNC_REDO - KEY_DELETE, 0, 0, // KEYFUNC_DELETE - KEY_REPEAT, 0, 0, // KEYFUNC_REPEAT - KEY_F | KEY_MOD1, KEY_FIND, 0, // KEYFUNC_FIND - KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, // KEYFUNC_FINDBACKWARD - KEY_RETURN | KEY_MOD2, 0, 0, // KEYFUNC_PROPERTIES - 0, 0, 0 // KEYFUNC_FRONT + 0, 0, 0, 0, // KEYFUNC_DONTKNOW + KEY_N | KEY_MOD1, 0, 0, 0, // KEYFUNC_NEW + KEY_O | KEY_MOD1, KEY_OPEN, 0, 0, // KEYFUNC_OPEN + KEY_S | KEY_MOD1, 0, 0, 0, // KEYFUNC_SAVE + 0, 0, 0, 0, // KEYFUNC_SAVEAS + KEY_P | KEY_MOD1, 0, 0, 0, // KEYFUNC_PRINT + KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, 0, // KEYFUNC_CLOSE + KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, 0, // KEYFUNC_QUIT + KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, 0, // KEYFUNC_CUT + KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, 0, // KEYFUNC_COPY + KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, 0, // KEYFUNC_PASTE + KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, 0, // KEYFUNC_UNDO + 0, 0, 0, 0, // KEYFUNC_REDO + KEY_DELETE, 0, 0, 0, // KEYFUNC_DELETE + KEY_REPEAT, 0, 0, 0, // KEYFUNC_REPEAT + KEY_F | KEY_MOD1, KEY_FIND, 0, 0, // KEYFUNC_FIND + KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, 0, // KEYFUNC_FINDBACKWARD + KEY_RETURN | KEY_MOD2, 0, 0, 0, // KEYFUNC_PROPERTIES + 0, 0, 0, 0 // KEYFUNC_FRONT }; // ----------------------------------------------------------------------- -void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 ) +void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 ) { USHORT nIndex = (USHORT)eFunc; - nIndex *= 3; + nIndex *= 4; rCode1 = aImplKeyFuncTab[nIndex]; rCode2 = aImplKeyFuncTab[nIndex+1]; rCode3 = aImplKeyFuncTab[nIndex+2]; + rCode4 = aImplKeyFuncTab[nIndex+3]; } // ======================================================================= @@ -88,7 +89,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& KeyCode::KeyCode( KeyFuncType eFunction ) { USHORT nDummy; - ImplGetKeyCode( eFunction, nCode, nDummy, nDummy ); + ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy ); eFunc = eFunction; } @@ -111,7 +112,7 @@ KeyCode::KeyCode( const ResId& rResId ) if ( eFunc != KEYFUNC_DONTKNOW ) { USHORT nDummy; - ImplGetKeyCode( eFunc, nCode, nDummy, nDummy ); + ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy ); } else nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier); @@ -151,8 +152,9 @@ KeyFuncType KeyCode::GetFunction() const USHORT nKeyCode1; USHORT nKeyCode2; USHORT nKeyCode3; - ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3 ); - if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) ) + USHORT nKeyCode4; + ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 ); + if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) ) return (KeyFuncType)i; } } diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx index e3a92194040f..e8474c6efa5d 100644 --- a/vcl/source/window/keyevent.cxx +++ b/vcl/source/window/keyevent.cxx @@ -49,7 +49,8 @@ KeyEvent::KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent ) rEvent.KeyCode, (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::SHIFT) != 0, (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD1) != 0, - (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 ); + (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0, + (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0); mnRepeat = 0; mnCharCode = rEvent.KeyChar; } @@ -64,6 +65,8 @@ void KeyEvent::InitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent ) const rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1; if( GetKeyCode().IsMod2() ) rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2; + if( GetKeyCode().IsMod3() ) + rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3; rEvent.KeyCode = GetKeyCode().GetCode(); rEvent.KeyChar = GetCharCode(); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index adbc2a8de06e..ccf75dbd59b3 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2487,23 +2487,8 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec if( ! bNativeOk ) { const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings(); - if( i_bHighlight ) - { - i_pWindow->Push( PUSH_ALL ); - Color aCol = rSettings.GetMenuHighlightTextColor(); - i_pWindow->SetFillColor( rSettings.GetMenuHighlightTextColor() ); - if( aCol.IsDark() ) - aCol.IncreaseLuminance( 128 ); - else - aCol.DecreaseLuminance( 128 ); - i_pWindow->SetLineColor( aCol ); - Polygon aPoly( i_rRect ); - PolyPolygon aPolyPoly( aPoly ); - i_pWindow->DrawTransparent( aPolyPoly, 20 ); - i_pWindow->Pop(); - } - else - i_pWindow->DrawSelectionBackground( i_rRect, 1, FALSE, TRUE, FALSE ); + Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); + i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor ); } } @@ -3495,11 +3480,6 @@ USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT n USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst ) { - - // #59614# Mit TH abgesprochen dass die ASSERTION raus kommt, - // weil es evtl. legitim ist... -// DBG_ASSERT( !PopupMenu::IsInExecute() || pSFrom, "PopupMenu::Execute() called in PopupMenu::Execute()" ); - if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) ) return 0; @@ -3675,8 +3655,16 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM { pWin->ImplAddDel( &aDelData ); + ImplDelData aModalWinDel; + pW->ImplAddDel( &aModalWinDel ); + pW->ImplIncModalCount(); + pWin->Execute(); + DBG_ASSERT( ! aModalWinDel.IsDead(), "window for popup died, modal count incorrect !" ); + if( ! aModalWinDel.IsDead() ) + pW->ImplDecModalCount(); + if ( !aDelData.IsDelete() ) pWin->ImplRemoveDel( &aDelData ); else @@ -5056,11 +5044,11 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : if( pResMgr ) { - Bitmap aBitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) ); - Bitmap aBitmapHC( ResId( SV_RESID_BITMAP_CLOSEDOCHC, *pResMgr ) ); + BitmapEx aBitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) ); + BitmapEx aBitmapHC( ResId( SV_RESID_BITMAP_CLOSEDOCHC, *pResMgr ) ); - aCloser.maImage = Image( aBitmap, Color( COL_LIGHTMAGENTA ) ); - aCloser.maImageHC = Image( aBitmapHC, Color( COL_LIGHTMAGENTA ) ); + aCloser.maImage = Image( aBitmap ); + aCloser.maImageHC = Image( aBitmapHC ); aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT ); aCloser.SetBackground(); diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx index 90ca259cc425..a95b90f5e1d0 100644 --- a/vcl/source/window/mouseevent.cxx +++ b/vcl/source/window/mouseevent.cxx @@ -52,6 +52,8 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ) mnCode |= KEY_MOD1; if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 ) mnCode |= KEY_MOD2; + if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 ) + mnCode |= KEY_MOD3; } if( rEvent.Buttons ) @@ -75,6 +77,8 @@ void MouseEvent::InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) con rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1; if ( IsMod2() ) rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2; + if ( IsMod3() ) + rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3; rEvent.Buttons = 0; if ( IsLeft() ) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index bfa456757272..bb1f428c6626 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1703,6 +1703,8 @@ void ToolBox::ImplInitSettings( BOOL bFont, SetBackground( aColor ); SetPaintTransparent( FALSE ); SetParentClipMode( 0 ); + + ImplUpdateImageList(); } } } @@ -3376,7 +3378,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl } if( !bNativeOk ) - pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow ); + pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL ); } void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout ) @@ -5053,7 +5055,7 @@ void ToolBox::StateChanged( StateChangedType nType ) } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( FALSE, FALSE, TRUE ); // font, foreground, background Invalidate(); } } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 9e1a6671460b..7fa8f76e1586 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -49,6 +49,9 @@ #include <vcl/unohelp.hxx> #include <unotools/confignode.hxx> +#include <vcl/ImageListProvider.hxx> +#include <com/sun/star/lang/IllegalArgumentException.hpp> + using namespace vcl; using namespace rtl; @@ -58,7 +61,10 @@ using namespace rtl; // ----------------------------------------------------------------------- -ImplToolBoxPrivateData::ImplToolBoxPrivateData() : m_pLayoutData( NULL ) +ImplToolBoxPrivateData::ImplToolBoxPrivateData() : + m_pLayoutData( NULL ), + mpImageListProvider( NULL ), + meImageListType( vcl::IMAGELISTTYPE_UNKNOWN ) { meButtonSize = TOOLBOX_BUTTONSIZE_DONTCARE; mpMenu = new PopupMenu(); @@ -69,6 +75,7 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() : m_pLayoutData( NULL ) maMenubuttonItem.meState = STATE_NOCHECK; mnMenuButtonWidth = TB_MENUBUTTON_SIZE; + mbIsLocked = FALSE; mbNativeButtons = FALSE; mbIsPaintLocked = FALSE; @@ -2402,4 +2409,29 @@ void ToolBox::WillUsePopupMode( BOOL b ) mpData->mbWillUsePopupMode = b; } +void ToolBox::ImplUpdateImageList() +{ + if (mpData->mpImageListProvider != NULL) + { + BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + try + { + ImageListType eType = bIsDark ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO; + + if (eType != mpData->meImageListType) + { + vcl::IImageListProvider* pImageListProvider = mpData->mpImageListProvider; + SetImageList( pImageListProvider->getImageList(eType) ); + mpData->meImageListType = eType; + } + } + catch (com::sun::star::lang::IllegalArgumentException &) {} + } +} + +void ToolBox::SetImageListProvider(vcl::IImageListProvider* _pProvider) +{ + mpData->mpImageListProvider = _pProvider; + ImplUpdateImageList(); +} // ----------------------------------------------------------------------- diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index ec16b65cf41f..5333d20d4306 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -497,24 +497,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) } } - // Detect if images in menus are allowed or not - { - sal_Bool bTmp = sal_False, bUseImagesInMenus = sal_True; - utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( - vcl::unohelper::GetMultiServiceFactory(), - OUString::createFromAscii( "org.openoffice.Office.Common/View/Menu" ) ); // note: case sensisitive ! - if ( aNode.isValid() ) - { - ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "ShowIconsInMenues" ) ); - if( aValue >>= bTmp ) - bUseImagesInMenus = bTmp; - } - - aStyleSettings = rSettings.GetStyleSettings(); - aStyleSettings.SetUseImagesInMenus( bUseImagesInMenus ); - rSettings.SetStyleSettings( aStyleSettings ); - } - #ifdef DBG_UTIL // Evt. AppFont auf Fett schalten, damit man feststellen kann, // ob fuer die Texte auf anderen Systemen genuegend Platz @@ -2541,12 +2523,15 @@ void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags ) if ( !ImplIsOverlapWindow() ) { Window* pTempWindow = this; + USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0; do { pTempWindow = pTempWindow->ImplGetParent(); if ( pTempWindow->mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINTCHILDS ) break; - pTempWindow->mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINTCHILDS; + pTempWindow->mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINTCHILDS | nTranspPaint; + if( ! pTempWindow->IsPaintTransparent() ) + nTranspPaint = 0; } while ( !pTempWindow->ImplIsOverlapWindow() ); } @@ -5859,18 +5844,15 @@ void Window::UpdateSettings( const AllSettings& rSettings, BOOL bChild ) ImplInitResolutionSettings(); /* #i73785# - * do not overwrite a NoWheelActionWithoutFocus with false - * this looks kind of a hack, but NoWheelActionWithoutFocus + * do not overwrite a WheelBehavior with false + * this looks kind of a hack, but WheelBehavior * is always a local change, not a system property, - * so we can spare all our users the hassel of reacting on + * so we can spare all our users the hassle of reacting on * this in their respective DataChanged. */ - if( aOldSettings.GetMouseSettings().GetNoWheelActionWithoutFocus() ) - { - MouseSettings aSet( maSettings.GetMouseSettings() ); - aSet.SetNoWheelActionWithoutFocus( TRUE ); - maSettings.SetMouseSettings( aSet ); - } + MouseSettings aSet( maSettings.GetMouseSettings() ); + aSet.SetWheelBehavior( aOldSettings.GetMouseSettings().GetWheelBehavior() ); + maSettings.SetMouseSettings( aSet ); if( (nChangeFlags & SETTINGS_STYLE) && IsBackground() ) { @@ -6239,6 +6221,15 @@ void Window::SetParent( Window* pNewParent ) pSysWin->GetTaskPaneList()->RemoveWindow( this ); } } + // remove ownerdraw decorated windows from list in the top-most frame window + if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame ) + { + ::std::vector< Window* >& rList = ImplGetOwnerDrawList(); + ::std::vector< Window* >::iterator p; + p = ::std::find( rList.begin(), rList.end(), this ); + if( p != rList.end() ) + rList.erase( p ); + } ImplSetFrameParent( pNewParent ); @@ -6368,6 +6359,9 @@ void Window::SetParent( Window* pNewParent ) if( bChangeTaskPaneList ) pNewSysWin->GetTaskPaneList()->AddWindow( this ); + if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame ) + ImplGetOwnerDrawList().push_back( this ); + if ( bVisible ) Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } @@ -6526,7 +6520,10 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) if ( !mpWindowImpl->mbFrame ) { - ImplInvalidate( NULL, INVALIDATE_NOTRANSPARENT | INVALIDATE_CHILDREN ); + USHORT nInvalidateFlags = INVALIDATE_CHILDREN; + if( ! IsPaintTransparent() ) + nInvalidateFlags |= INVALIDATE_NOTRANSPARENT; + ImplInvalidate( NULL, nInvalidateFlags ); ImplGenerateMouseMove(); } } @@ -9252,19 +9249,34 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol ) void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly ) { - DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, NULL ); + DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL ); } void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor ) { + DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL ); +} + +void Window::DrawSelectionBackground( const Rectangle& rRect, + USHORT highlight, + BOOL bChecked, + BOOL bDrawBorder, + BOOL bDrawExtBorderOnly, + long nCornerRadius, + Color* pSelectionTextColor, + Color* pPaintColor + ) +{ if( rRect.IsEmpty() ) return; + bool bRoundEdges = nCornerRadius > 0; + const StyleSettings& rStyles = GetSettings().GetStyleSettings(); // colors used for item highlighting - Color aSelectionBorderCol( rStyles.GetHighlightColor() ); + Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() ); Color aSelectionFillCol( aSelectionBorderCol ); BOOL bDark = rStyles.GetFaceColor().IsDark(); @@ -9273,7 +9285,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, int c1 = aSelectionBorderCol.GetLuminance(); int c2 = GetDisplayBackground().GetColor().GetLuminance(); - if( !bDark && !bBright && abs( c2-c1 ) < 75 ) + if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) ) { // constrast too low USHORT h,s,b; @@ -9284,6 +9296,14 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, aSelectionBorderCol = aSelectionFillCol; } + if( bRoundEdges ) + { + if( aSelectionBorderCol.IsDark() ) + aSelectionBorderCol.IncreaseLuminance( 128 ); + else + aSelectionBorderCol.DecreaseLuminance( 128 ); + } + Rectangle aRect( rRect ); if( bDrawExtBorderOnly ) { @@ -9306,7 +9326,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, if( bDark ) aSelectionFillCol = COL_BLACK; else - nPercent = 80; // just checked (light) + nPercent = bRoundEdges ? 90 : 80; // just checked (light) } else { @@ -9321,7 +9341,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, nPercent = 0; } else - nPercent = 20; // selected, pressed or checked ( very dark ) + nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark ) } else if( bChecked || highlight == 1 ) { @@ -9334,7 +9354,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, nPercent = 0; } else - nPercent = 35; // selected, pressed or checked ( very dark ) + nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark ) } else { @@ -9350,7 +9370,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, nPercent = 0; } else - nPercent = 70; // selected ( dark ) + nPercent = bRoundEdges ? 80 : 70; // selected ( dark ) } } @@ -9380,9 +9400,18 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, } else { - Polygon aPoly( aRect ); - PolyPolygon aPolyPoly( aPoly ); - DrawTransparent( aPolyPoly, nPercent ); + if( bRoundEdges ) + { + Polygon aPoly( aRect, nCornerRadius, nCornerRadius ); + PolyPolygon aPolyPoly( aPoly ); + DrawTransparent( aPolyPoly, nPercent ); + } + else + { + Polygon aPoly( aRect ); + PolyPolygon aPolyPoly( aPoly ); + DrawTransparent( aPolyPoly, nPercent ); + } } SetFillColor( oldFillCol ); |