diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-09-09 15:23:23 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-09-09 15:23:23 +0000 |
commit | 3d4db04773f84a1da84c26d26c306dfcb01bb68e (patch) | |
tree | e171c29c54c1e3deca93237d086d0e1b96d12d44 | |
parent | ecf46187906585863072a22f9e32a799c343b54c (diff) |
INTEGRATION: CWS toolbars2 (1.13.24); FILE MERGED
2004/08/16 15:16:46 gh 1.13.24.4: #i32516#remove Set/GetHelpIdAsString from ToolBox and GetUniqueOrHelpId from Windows
2004/08/10 13:39:42 gh 1.13.24.3: #i32516#use SmartIds for UniqueIds as well + fixes
2004/08/06 14:10:18 gh 1.13.24.2: #i32449#support to hold numeric and String Id on Windows
2004/07/30 11:57:51 ssa 1.13.24.1: #i32198# initial suport for system floaters with owner draw decoration
-rw-r--r-- | vcl/source/window/window2.cxx | 116 |
1 files changed, 114 insertions, 2 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 92165989fdd1..53db7156c81b 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: window2.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: obo $ $Date: 2004-07-06 13:50:18 $ + * last change: $Author: obo $ $Date: 2004-09-09 16:23:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1460,3 +1460,115 @@ void Window::EnableDocking( BOOL bEnable ) else ImplGetDockingManager()->RemoveWindow( this ); } + + +// retrieves the list of owner draw decorated windows for this window hiearchy +::std::vector<Window *>& Window::ImplGetOwnerDrawList() +{ + return ImplGetTopmostFrameWindow()->mpFrameData->maOwnerDrawList; +} + +Window* Window::ImplGetTopmostFrameWindow() +{ + Window *pTopmostParent = this; + while( pTopmostParent->ImplGetParent() ) + pTopmostParent = pTopmostParent->ImplGetParent(); + return pTopmostParent->mpFrameWindow; +} + +// making these Methods out of line to be able to change them lateron without complete rebuild +// TODO: Set the SmartId in here and remove mnHelpId +void Window::SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; } +ULONG Window::GetHelpId() const { return mnHelpId; } + +void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode ) +{ + // create SmartId if required + if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) ) + { + if ( !ImplGetWinData()->mpSmartHelpId ) + ImplGetWinData()->mpSmartHelpId = new SmartId(); + } + + // if we have a SmartId (eather from earlier call or just created) fill with new values + if ( mpWinData && mpWinData->mpSmartHelpId ) + ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode ); + + if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) ) + mnHelpId = aId.GetNum(); +} + +SmartId Window::GetSmartHelpId() const +{ + if ( mpWinData && mpWinData->mpSmartHelpId ) + { + if ( mnHelpId || mpWinData->mpSmartHelpId->HasNumeric() ) + mpWinData->mpSmartHelpId->UpdateId( SmartId( mnHelpId ), SMART_SET_NUM ); + return *mpWinData->mpSmartHelpId; + } + else + { + if ( mnHelpId ) + return SmartId( mnHelpId ); + else + return SmartId(); + } +} + + +// making these Methods out of line to be able to change them lateron without complete rebuild +// TODO: Set the SmartId in here and remove mnUniqId +void Window::SetUniqueId( ULONG nUniqueId ) { mnUniqId = nUniqueId; } +ULONG Window::GetUniqueId() const { return mnUniqId; } + + +void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode ) +{ + // create SmartId if required + if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) ) + { + if ( !ImplGetWinData()->mpSmartUniqueId ) + ImplGetWinData()->mpSmartUniqueId = new SmartId(); + } + + // if we have a SmartId (eather from earlier call or just created) fill with new values + if ( mpWinData && mpWinData->mpSmartUniqueId ) + ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode ); + + if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) ) + mnUniqId = aId.GetNum(); +} + +SmartId Window::GetSmartUniqueId() const +{ + if ( mpWinData && mpWinData->mpSmartUniqueId ) + { + if ( mnUniqId || mpWinData->mpSmartUniqueId->HasNumeric() ) + mpWinData->mpSmartUniqueId->UpdateId( SmartId( mnUniqId ), SMART_SET_NUM ); + return *mpWinData->mpSmartUniqueId; + } + else + { + if ( mnUniqId ) + return SmartId( mnUniqId ); + else + return SmartId(); + } +} + +SmartId Window::GetSmartUniqueOrHelpId() const +{ + if ( ( mpWinData && mpWinData->mpSmartHelpId ) || mnHelpId ) + { + if ( ( mpWinData && mpWinData->mpSmartUniqueId ) || mnUniqId ) + { + SmartId aTemp = GetSmartHelpId(); + aTemp.UpdateId( GetSmartUniqueId() ); + return aTemp; + } + else + return GetSmartHelpId(); + } + else + return GetSmartUniqueId(); +} |