[ooo-build-commit] .: patches/dev300
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Wed Feb 3 05:25:23 PST 2010
patches/dev300/toolbar-decorations-fix.diff | 2249 ++++++++++++++++++++++++++++
1 file changed, 2249 insertions(+)
New commits:
commit 8f5da27c37580bed4541c9b397db7c975fcf6278
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Feb 3 14:23:56 2010 +0100
Started refactoring the toolbar popups
* patches/dev300/toolbar-decorations-fix.diff:
diff --git a/patches/dev300/toolbar-decorations-fix.diff b/patches/dev300/toolbar-decorations-fix.diff
new file mode 100644
index 0000000..cb24aae
--- /dev/null
+++ b/patches/dev300/toolbar-decorations-fix.diff
@@ -0,0 +1,2249 @@
+diff --git svtools/source/control/valueset.cxx svtools/source/control/valueset.cxx
+index 014df3c..b559dbd 100644
+--- svtools/source/control/valueset.cxx
++++ svtools/source/control/valueset.cxx
+@@ -299,8 +299,6 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
+ maVirDev.SetFillColor( maColor );
+ else if ( nStyle & WB_MENUSTYLEVALUESET )
+ maVirDev.SetFillColor( rStyleSettings.GetMenuColor() );
+- else if ( IsEnabled() )
+- maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ else
+ maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
+ maVirDev.DrawRect( aRect );
+diff --git svx/inc/extrusioncontrols.hxx svx/inc/extrusioncontrols.hxx
+index b2d03ec..dfa40f4 100644
+--- svx/inc/extrusioncontrols.hxx
++++ svx/inc/extrusioncontrols.hxx
+@@ -57,8 +57,14 @@ class ExtrusionDirectionWindow : public SfxPopupWindow
+ using FloatingWindow::StateChanged;
+
+ private:
+- ToolbarMenu* mpMenu;
++ FixedText* mpTitleTxt;
+ ValueSet* mpDirectionSet;
++ FixedLine* mpSeparator;
++ PushButton* mpPerspectiveBtn;
++ FixedText* mpPerspectiveTxt;
++ PushButton* mpParallelBtn;
++ FixedText* mpParallelTxt;
++
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+ SfxStatusForwarder* mpDirectionForewarder;
+@@ -72,8 +78,6 @@ private:
+ Image maImgParallel;
+ Image maImgParallelH;
+
+- bool mbPopupMode;
+-
+ DECL_LINK( SelectHdl, void * );
+ void FillValueSet();
+
+@@ -83,7 +87,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+@@ -129,27 +132,15 @@ class ExtrusionDepthWindow : public SfxPopupWindow
+ using FloatingWindow::StateChanged;
+
+ private:
+- ToolbarMenu* mpMenu;
+-
+- Image maImgDepth0;
+- Image maImgDepth1;
+- Image maImgDepth2;
+- Image maImgDepth3;
+- Image maImgDepth4;
+- Image maImgDepthInfinity;
+-
+- Image maImgDepth0h;
+- Image maImgDepth1h;
+- Image maImgDepth2h;
+- Image maImgDepth3h;
+- Image maImgDepth4h;
+- Image maImgDepthInfinityh;
++ FixedText* mpTxtTitle;
++ PushButton* mpBtnDepths[6];
++ FixedText* mpTxtDepths[6];
++ PushButton* mpBtnCustom;
+
+ SfxStatusForwarder* mpDepthForewarder;
+ SfxStatusForwarder* mpMetricForewarder;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+- bool mbPopupMode;
+ FieldUnit meUnit;
+ double mfDepth;
+ bool mbEnabled;
+@@ -162,7 +153,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+@@ -208,8 +198,15 @@ class ExtrusionLightingWindow : public SfxPopupWindow
+ using FloatingWindow::StateChanged;
+
+ private:
+- ToolbarMenu* mpMenu;
++ FixedText* mpTitleTxt;
+ ValueSet* mpLightingSet;
++ FixedLine* mpSeparator;
++ ImageButton* mpBrightBtn;
++ FixedText* mpBrightTxt;
++ ImageButton* mpNormalBtn;
++ FixedText* mpNormalTxt;
++ ImageButton* mpDimBtn;
++ FixedText* mpDimTxt;
+
+ Image maImgLightingOff[9];
+ Image maImgLightingOn[9];
+@@ -230,7 +227,6 @@ private:
+ SfxStatusForwarder* mpLightingIntensityForewarder;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+- bool mbPopupMode;
+ int mnLevel;
+ bool mbLevelEnabled;
+ int mnDirection;
+@@ -244,7 +240,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+@@ -289,22 +284,13 @@ class ExtrusionSurfaceWindow : public SfxPopupWindow
+ {
+ using FloatingWindow::StateChanged;
+ private:
+- ToolbarMenu* mpMenu;
+-
+- Image maImgSurface1;
+- Image maImgSurface2;
+- Image maImgSurface3;
+- Image maImgSurface4;
+- Image maImgSurface1h;
+- Image maImgSurface2h;
+- Image maImgSurface3h;
+- Image maImgSurface4h;
++ FixedText* mpTitleTxt;
++ ImageButton* mpSurfacesBtn[4];
++ FixedText* mpSurfacesTxt[4];
+
+ SfxStatusForwarder* mpSurfaceForewarder;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+- bool mbPopupMode;
+-
+ DECL_LINK( SelectHdl, void * );
+
+ void implSetSurface( int nSurface, bool bEnabled );
+@@ -312,7 +298,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+diff --git svx/inc/fontworkgallery.hxx svx/inc/fontworkgallery.hxx
+index 77de26d..30629ec 100644
+--- svx/inc/fontworkgallery.hxx
++++ svx/inc/fontworkgallery.hxx
+@@ -65,23 +65,11 @@ class FontWorkAlignmentWindow : public SfxPopupWindow
+ {
+ using FloatingWindow::StateChanged;
+ private:
+- ToolbarMenu* mpMenu;
+-
+- Image maImgAlgin1;
+- Image maImgAlgin2;
+- Image maImgAlgin3;
+- Image maImgAlgin4;
+- Image maImgAlgin5;
+- Image maImgAlgin1h;
+- Image maImgAlgin2h;
+- Image maImgAlgin3h;
+- Image maImgAlgin4h;
+- Image maImgAlgin5h;
+-
++ FixedText* mpTitleTxt;
++ ImageButton* mpAlignsBtn[5];
++ FixedText* mpAlignsTxt[5];
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+- bool mbPopupMode;
+-
+ DECL_LINK( SelectHdl, void * );
+
+ void implSetAlignment( int nAlignmentMode, bool bEnabled );
+@@ -89,7 +77,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+@@ -136,8 +123,6 @@ private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+- bool mbPopupMode;
+-
+ DECL_LINK( SelectHdl, void * );
+
+ void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
+@@ -146,7 +131,6 @@ private:
+
+ protected:
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+diff --git svx/inc/linectrl.hxx svx/inc/linectrl.hxx
+index e3d3a5d..457e7f1 100644
+--- svx/inc/linectrl.hxx
++++ svx/inc/linectrl.hxx
+@@ -110,14 +110,13 @@ class SvxLineEndWindow : public SfxPopupWindow
+ using FloatingWindow::StateChanged;
+
+ private:
++ FixedText aTitle;
+ XLineEndList* pLineEndList;
+ ValueSet aLineEndSet;
+ USHORT nCols;
+ USHORT nLines;
+ ULONG nLineEndWidth;
+ Size aBmpSize;
+- BOOL bPopupMode;
+- bool mbInResize;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+
+@@ -127,10 +126,7 @@ private:
+ void implInit();
+
+ protected:
+- virtual void Resizing( Size& rSize );
+- virtual void Resize();
+ virtual BOOL Close();
+- virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+diff --git svx/source/tbxctrls/colorwindow.hxx svx/source/tbxctrls/colorwindow.hxx
+index 50388d6..9db6499 100644
+--- svx/source/tbxctrls/colorwindow.hxx
++++ svx/source/tbxctrls/colorwindow.hxx
+@@ -20,6 +20,7 @@ class SvxColorWindow_Impl : public SfxPopupWindow
+ private:
+ const USHORT theSlotId;
+ ValueSet aColorSet;
++ FixedText aLabel;
+ rtl::OUString maCommand;
+
+ #if _SOLAR__PRIVATE
+diff --git svx/source/tbxctrls/extrusioncontrols.cxx svx/source/tbxctrls/extrusioncontrols.cxx
+index 01f6824..4a0f77e 100644
+--- svx/source/tbxctrls/extrusioncontrols.cxx
++++ svx/source/tbxctrls/extrusioncontrols.cxx
+@@ -88,8 +88,7 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow(
+ maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) ),
+ maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) ),
+ maImgParallel( SVX_RES( IMG_PARALLEL ) ),
+- maImgParallelH( SVX_RES( IMG_PARALLEL_H ) ),
+- mbPopupMode ( TRUE )
++ maImgParallelH( SVX_RES( IMG_PARALLEL_H ) )
+ {
+ implInit();
+ }
+@@ -106,15 +105,30 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow(
+ maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) ),
+ maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) ),
+ maImgParallel( SVX_RES( IMG_PARALLEL ) ),
+- maImgParallelH( SVX_RES( IMG_PARALLEL_H ) ),
+- mbPopupMode ( TRUE )
++ maImgParallelH( SVX_RES( IMG_PARALLEL_H ) )
+ {
+ implInit();
+ }
+
+ void ExtrusionDirectionWindow::implInit()
+ {
++ ToolBox* pToolbar = dynamic_cast<ToolBox*>( GetParent( ) );
++ SetText( pToolbar->GetItemText( GetId() ) );
++
++ SetStyle( WB_DIALOGCONTROL | WB_SYSTEMWINDOW );
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ SetHelpId( HID_POPUP_EXTRUSION_DIRECTION );
++
++ mpTitleTxt = new FixedText( this );
++ mpTitleTxt->SetPosPixel( Point( 2, 2 ) );
++ mpTitleTxt->SetSizePixel( Size( 106, 15 ) );
++ mpTitleTxt->SetText( GetText( ) );
++ Font& aFont = const_cast<Font&>( mpTitleTxt->GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ mpTitleTxt->SetFont( aFont );
++ mpTitleTxt->SetBackground( GetBackground( ) );
++ mpTitleTxt->Show( );
+
+ USHORT i;
+ for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
+@@ -126,16 +140,14 @@ void ExtrusionDirectionWindow::implInit()
+ // mpDirectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_DIRECTION, *this );
+ // mpProjectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_PROJECTION, *this );
+
+- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
+- mpMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
+- mpMenu->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
+- mpDirectionSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
++ mpDirectionSet = new ValueSet( this, WB_TABSTOP | WB_NOBORDER | WB_NO_DIRECTSELECT );
+ mpDirectionSet->SetHelpId( HID_VALUESET_EXTRUSION_DIRECTION );
+
+ mpDirectionSet->SetHelpId( HID_POPUP_LINEEND_CTRL );
+ mpDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
+ mpDirectionSet->SetColCount( 3 );
+ mpDirectionSet->EnableFullItemMode( FALSE );
++ mpDirectionSet->Show( );
+
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+@@ -146,16 +158,45 @@ void ExtrusionDirectionWindow::implInit()
+ }
+
+ mpDirectionSet->SetOutputSizePixel( Size( 72, 72 ) );
+-
+- mpMenu->appendEntry( 2, mpDirectionSet );
+- mpMenu->appendSeparator();
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_PERSPECTIVE ) ), bHighContrast ? maImgPerspectiveH : maImgPerspective );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_PARALLEL ) ), bHighContrast ? maImgParallelH : maImgParallel );
+-
+- SetOutputSizePixel( mpMenu->getMenuSize() );
+- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+-
+- mpMenu->Show();
++ mpDirectionSet->SetPosPixel( Point( 19, 19 ) );
++
++ // Configure FixedLine
++ mpSeparator = new FixedLine( this );
++ mpSeparator->SetPosPixel( Point( 2, 93 ) );
++ mpSeparator->SetSizePixel( Size( 106, 3 ) );
++ mpSeparator->Show( );
++
++ // Configure the Perspective button here
++ mpPerspectiveBtn = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpPerspectiveBtn->SetModeImage( bHighContrast ? maImgPerspectiveH : maImgPerspective );
++ mpPerspectiveBtn->SetPosPixel( Point( 2, 99 ) );
++ mpPerspectiveBtn->SetSizePixel( Size( 24, 24 ) );
++ mpPerspectiveBtn->SetClickHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
++ mpPerspectiveBtn->Show( );
++
++ mpPerspectiveTxt = new FixedText( this );
++ mpPerspectiveTxt->SetPosPixel( Point( 28, 103 ) );
++ mpPerspectiveTxt->SetSizePixel( Size( 80, 16 ) );
++ mpPerspectiveTxt->SetText( String( SVX_RES( STR_PERSPECTIVE ) ) );
++ mpPerspectiveTxt->SetBackground( GetBackground( ) );
++ mpPerspectiveTxt->Show( );
++
++ // Configure the Parallel button here
++ mpParallelBtn = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpParallelBtn->SetModeImage( bHighContrast ? maImgParallelH : maImgParallel );
++ mpParallelBtn->SetPosPixel( Point( 2, 125 ) );
++ mpParallelBtn->SetSizePixel( Size( 24, 24 ) );
++ mpParallelBtn->SetClickHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
++ mpParallelBtn->Show( );
++
++ mpParallelTxt = new FixedText( this );
++ mpParallelTxt->SetText( String( SVX_RES( STR_PARALLEL ) ) );
++ mpParallelTxt->SetPosPixel( Point( 28, 129 ) );
++ mpParallelTxt->SetSizePixel( Size( 80, 16 ) );
++ mpParallelTxt->SetBackground( GetBackground( ) );
++ mpParallelTxt->Show( );
++
++ SetOutputSizePixel( Size( 110, 151 ) );
+
+ FreeResource();
+
+@@ -182,8 +223,9 @@ void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
+ mpDirectionSet->SetItemImage( i+1, bHighContrast ? maImgDirectionH[ i ] : maImgDirection[ i ] );
+ }
+
+- mpMenu->setEntryImage( 0, bHighContrast ? maImgPerspectiveH : maImgPerspective );
+- mpMenu->setEntryImage( 1, bHighContrast ? maImgParallelH : maImgParallel );
++ // TODO Change the images
++// mpMenu->setEntryImage( 0, bHighContrast ? maImgPerspectiveH : maImgPerspective );
++// mpMenu->setEntryImage( 1, bHighContrast ? maImgParallelH : maImgParallel );
+ }
+ }
+
+@@ -191,12 +233,18 @@ void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
+
+ ExtrusionDirectionWindow::~ExtrusionDirectionWindow()
+ {
+- delete mpMenu;
++ delete mpTitleTxt;
++ delete mpDirectionSet;
++ delete mpSeparator;
++ delete mpPerspectiveBtn;
++ delete mpPerspectiveTxt;
++ delete mpParallelBtn;
++ delete mpParallelTxt;
+ }
+
+ // -----------------------------------------------------------------------
+
+-void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool bEnabled )
++void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool /*bEnabled*/ )
+ {
+ if( mpDirectionSet )
+ {
+@@ -216,23 +264,16 @@ void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool bEnabled
+ mpDirectionSet->SetNoSelection();
+ }
+ }
+- if( mpMenu )
+- {
+- mpMenu->enableEntry( 2, bEnabled );
+- }
+ }
+
+ // -----------------------------------------------------------------------
+
+ void ExtrusionDirectionWindow::implSetProjection( sal_Int32 nProjection, bool bEnabled )
+ {
+- if( mpMenu )
+- {
+- mpMenu->checkEntry( 0, (nProjection == 0) && bEnabled );
+- mpMenu->checkEntry( 1, (nProjection == 1 ) && bEnabled );
+- mpMenu->enableEntry( 0, bEnabled );
+- mpMenu->enableEntry( 1, bEnabled );
+- }
++ if ( nProjection == 0 )
++ mpPerspectiveBtn->SetPressed( bEnabled );
++ else
++ mpParallelBtn->SetPressed( bEnabled );
+ }
+
+ // -----------------------------------------------------------------------
+@@ -276,10 +317,8 @@ void ExtrusionDirectionWindow::StateChanged( USHORT nSID, SfxItemState eState, c
+
+ IMPL_LINK( ExtrusionDirectionWindow, SelectHdl, void *, pControl )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
+-
+-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ if( pControl == mpDirectionSet )
+ {
+@@ -299,12 +338,15 @@ IMPL_LINK( ExtrusionDirectionWindow, SelectHdl, void *, pControl )
+ mxFrame->getController(), UNO_QUERY ),
+ aCommand,
+ aArgs );
+-
+-// pDisp->Execute( SID_EXTRUSION_DIRECTION, SFX_CALLMODE_RECORD, &aItem, 0L , 0L );
+ }
+ else
+ {
+- int nProjection = mpMenu->getSelectedEntryId();
++ int nProjection = -1;
++ if ( pControl == mpPerspectiveBtn )
++ nProjection = 0;
++ else
++ nProjection = 1;
++
+ if( (nProjection >= 0) && (nProjection < 2 ) )
+ {
+ SfxInt32Item aItem( SID_EXTRUSION_PROJECTION, nProjection );
+@@ -350,17 +392,6 @@ BOOL ExtrusionDirectionWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void ExtrusionDirectionWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void ExtrusionDirectionWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+@@ -401,9 +432,10 @@ SfxPopupWindowType ExtrusionDirectionControl::GetPopupWindowType() const
+ SfxPopupWindow* ExtrusionDirectionControl::CreatePopupWindow()
+ {
+ ExtrusionDirectionWindow* pWin = new ExtrusionDirectionWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++
++ pWin->EnableDocking(true);
++ pWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pWin);
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+@@ -455,20 +487,7 @@ ExtrusionDepthWindow::ExtrusionDepthWindow(
+ SfxPopupWindow( nId,
+ rFrame,
+ SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH )),
+- maImgDepth0( SVX_RES( IMG_DEPTH_0 ) ),
+- maImgDepth1( SVX_RES( IMG_DEPTH_1 ) ),
+- maImgDepth2( SVX_RES( IMG_DEPTH_2 ) ),
+- maImgDepth3( SVX_RES( IMG_DEPTH_3 ) ),
+- maImgDepth4( SVX_RES( IMG_DEPTH_4 ) ),
+- maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) ),
+- maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) ),
+- maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) ),
+- maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) ),
+- maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) ),
+- maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) ),
+- maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) ),
+ mxFrame( rFrame ),
+- mbPopupMode ( true ),
+ mfDepth( -1.0 ),
+ mbEnabled( false )
+ {
+@@ -482,20 +501,7 @@ ExtrusionDepthWindow::ExtrusionDepthWindow( USHORT nId,
+ rFrame,
+ pParentWindow,
+ SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH )),
+- maImgDepth0( SVX_RES( IMG_DEPTH_0 ) ),
+- maImgDepth1( SVX_RES( IMG_DEPTH_1 ) ),
+- maImgDepth2( SVX_RES( IMG_DEPTH_2 ) ),
+- maImgDepth3( SVX_RES( IMG_DEPTH_3 ) ),
+- maImgDepth4( SVX_RES( IMG_DEPTH_4 ) ),
+- maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) ),
+- maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) ),
+- maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) ),
+- maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) ),
+- maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) ),
+- maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) ),
+- maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) ),
+ mxFrame( rFrame ),
+- mbPopupMode ( true ),
+ mfDepth( -1.0 ),
+ mbEnabled( false )
+ {
+@@ -504,31 +510,58 @@ ExtrusionDepthWindow::ExtrusionDepthWindow( USHORT nId,
+
+ void ExtrusionDepthWindow::implInit()
+ {
++ ToolBox* pToolbar = dynamic_cast<ToolBox*>( GetParent( ) );
++ SetText( pToolbar->GetItemText( GetId() ) );
++
+ SetHelpId( HID_POPUP_EXTRUSION_DEPTH );
+
+ // mpDepthForewarder = new SfxStatusForwarder( SID_EXTRUSION_DEPTH, *this );
+ // mpMetricForewarder = new SfxStatusForwarder( SID_ATTR_METRIC, *this );
+
+- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
+- mpMenu->SetHelpId( HID_MENU_EXTRUSION_DEPTH );
++ SetStyle( WB_DIALOGCONTROL | WB_SYSTEMWINDOW );
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
+
+- mpMenu->SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
++ mpTxtTitle = new FixedText( this );
++ mpTxtTitle->SetPosPixel( Point( 2, 2 ) );
++ mpTxtTitle->SetSizePixel( Size( 106, 15 ) );
++ mpTxtTitle->SetText( GetText( ) );
++ Font& aFont = const_cast<Font&>( mpTxtTitle->GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ mpTxtTitle->SetFont( aFont );
++ mpTxtTitle->SetBackground( GetBackground( ) );
++ mpTxtTitle->Show( );
+
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+ String aEmpty;
+- mpMenu->appendEntry( 0, aEmpty, bHighContrast ? maImgDepth0h : maImgDepth0 );
+- mpMenu->appendEntry( 1, aEmpty, bHighContrast ? maImgDepth1h : maImgDepth1 );
+- mpMenu->appendEntry( 2, aEmpty, bHighContrast ? maImgDepth2h : maImgDepth2 );
+- mpMenu->appendEntry( 3, aEmpty, bHighContrast ? maImgDepth3h : maImgDepth3 );
+- mpMenu->appendEntry( 4, aEmpty, bHighContrast ? maImgDepth4h : maImgDepth4 );
+- mpMenu->appendEntry( 5, String( SVX_RES( STR_INFINITY ) ), bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
+- mpMenu->appendEntry( 6, String( SVX_RES( STR_CUSTOM ) ) );
++ for ( int i = 0; i < 6; i++ )
++ {
++ mpBtnDepths[i] = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpBtnDepths[i]->SetPosPixel( Point( 2, i * 26 + 17 ) );
++ mpBtnDepths[i]->SetSizePixel( Size( 24, 24 ) );
++ Image aHcImage = Image( SVX_RES( IMG_DEPTH_0_H + i ) );
++ Image aImage = Image( SVX_RES( IMG_DEPTH_0 + i ) );
++ mpBtnDepths[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ mpBtnDepths[i]->SetClickHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
++ mpBtnDepths[i]->Show( );
++
++ mpTxtDepths[i] = new FixedText( this );
++ mpTxtDepths[i]->SetPosPixel( Point( 28, i * 26 + 22 ) );
++ mpTxtDepths[i]->SetSizePixel( Size( 80, 14 ) );
++ mpTxtDepths[i]->SetBackground( GetBackground( ) );
++ mpTxtDepths[i]->Show( );
++ }
+
+- SetOutputSizePixel( mpMenu->getMenuSize() );
+- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
++ mpTxtDepths[5]->SetText( String( SVX_RES( STR_INFINITY ) ) );
+
+- mpMenu->Show();
++ mpBtnCustom = new PushButton( this );
++ mpBtnCustom->SetPosPixel( Point( 2, 173 ) );
++ mpBtnCustom->SetSizePixel( Size( 106, 24 ) );
++ mpBtnCustom->SetText( String( SVX_RES( STR_CUSTOM ) ) );
++ mpBtnCustom->SetClickHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
++ mpBtnCustom->Show( );
++
++ SetOutputSizePixel( Size( 110, 201 ) );
+
+ FreeResource();
+
+@@ -547,10 +580,12 @@ SfxPopupWindow* ExtrusionDepthWindow::Clone() const
+
+ ExtrusionDepthWindow::~ExtrusionDepthWindow()
+ {
+-// delete mpDepthForewarder;
+-// delete mpMetricForewarder;
+-
+- delete mpMenu;
++ for ( int i = 0; i < 6; i++ )
++ {
++ delete mpBtnDepths[i];
++ delete mpTxtDepths[i];
++ }
++ delete mpBtnCustom;
+ }
+
+ // -----------------------------------------------------------------------
+@@ -562,20 +597,16 @@ void ExtrusionDepthWindow::implSetDepth( double fDepth, bool bEnabled )
+ {
+ mbEnabled = bEnabled;
+ mfDepth = fDepth;
+- if( mpMenu )
++ int i;
++ for( i = 0; i < 6; i++ )
+ {
+- int i;
+- for( i = 0; i < 7; i++ )
++ if( i == 5 )
+ {
+- if( i == 5 )
+- {
+- mpMenu->checkEntry( i, (fDepth >= 338666) && bEnabled );
+- }
+- else if( i != 6 )
+- {
+- mpMenu->checkEntry( i, (fDepth == (IsMetric( meUnit ) ? aDepthListMM[i] : aDepthListInch[i]) && bEnabled ) );
+- }
+- mpMenu->enableEntry( i, bEnabled );
++ mpBtnDepths[i]->SetPressed( (fDepth >= 338666) && bEnabled );
++ }
++ else if( i != 6 )
++ {
++ mpBtnDepths[i]->SetPressed( (fDepth == (IsMetric( meUnit ) ? aDepthListMM[i] : aDepthListInch[i]) && bEnabled ) );
+ }
+ }
+ }
+@@ -590,7 +621,7 @@ void ExtrusionDepthWindow::implFillStrings( FieldUnit eUnit )
+ for( int i = 0; i < 5; i++ )
+ {
+ String aStr( SVX_RES( nResource + i ) );
+- mpMenu->setEntryText( i, aStr );
++ mpTxtDepths[ i ]->SetText( aStr );
+ };
+ }
+
+@@ -637,29 +668,36 @@ void ExtrusionDepthWindow::DataChanged( const DataChangedEvent& rDCEvt )
+ {
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+- mpMenu->setEntryImage( 0, bHighContrast ? maImgDepth0h : maImgDepth0 );
+- mpMenu->setEntryImage( 1, bHighContrast ? maImgDepth1h : maImgDepth1 );
+- mpMenu->setEntryImage( 2, bHighContrast ? maImgDepth2h : maImgDepth2 );
+- mpMenu->setEntryImage( 3, bHighContrast ? maImgDepth3h : maImgDepth3 );
+- mpMenu->setEntryImage( 4, bHighContrast ? maImgDepth4h : maImgDepth4 );
+- mpMenu->setEntryImage( 5, bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
++ for ( int i = 0; i < 6; i++ )
++ {
++ Image aHcImage = Image( SVX_RES( IMG_DEPTH_0_H + i ) );
++ Image aImage = Image( SVX_RES( IMG_DEPTH_0 + i ) );
++ mpBtnDepths[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ }
+ }
+ }
+
+
+ // -----------------------------------------------------------------------
+
+-IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
++IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, pControl )
+ {
+ // SfxDispatcher* pDisp = GetBindings().GetDispatcher();
+
+- int nSelected = mpMenu->getSelectedEntryId();
++ int nSelected = ( pControl == mpBtnCustom ) ? 6 : -1;
++ int i = 0;
++ while ( nSelected < 0 && i < 6 )
++ {
++ if ( pControl == mpBtnDepths[i] )
++ nSelected = i;
++ i++;
++ }
+ if( nSelected != -1 )
+ {
+ if( nSelected == 6 )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ SvxDoubleItem aDepthItem( mfDepth, SID_EXTRUSION_DEPTH );
+ SfxUInt16Item aMetricItem(
+@@ -709,8 +747,8 @@ IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
+ aArgs );
+ implSetDepth( fDepth, true );
+
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+ }
+ }
+ return 0;
+@@ -731,24 +769,16 @@ BOOL ExtrusionDepthWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void ExtrusionDepthWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void ExtrusionDepthWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+ // Grab the focus to the line ends value set so that it can be controlled
+ // with the keyboard.
++ // TODO Fix the focus problem
++#if 0
+ if( mpMenu )
+ mpMenu->GrabFocus();
++#endif
+ }
+
+ // ========================================================================
+@@ -778,9 +808,10 @@ SfxPopupWindowType ExtrusionDepthControl::GetPopupWindowType() const
+ SfxPopupWindow* ExtrusionDepthControl::CreatePopupWindow()
+ {
+ ExtrusionDepthWindow* pWin = new ExtrusionDepthWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++
++ pWin->EnableDocking(true);
++ pWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pWin);
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+@@ -812,7 +843,6 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(
+ maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) ),
+ maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) ),
+ mxFrame( rFrame ),
+- mbPopupMode( true ),
+ mnLevel( 0 ),
+ mbLevelEnabled( false ),
+ mnDirection( FROM_FRONT ),
+@@ -838,7 +868,6 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(
+ maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) ),
+ maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) ),
+ mxFrame( rFrame ),
+- mbPopupMode( true ),
+ mnLevel( 0 ),
+ mbLevelEnabled( false ),
+ mnDirection( FROM_FRONT ),
+@@ -851,7 +880,23 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(
+
+ void ExtrusionLightingWindow::implInit()
+ {
++ ToolBox* pToolbar = dynamic_cast<ToolBox*>( GetParent( ) );
++ SetText( pToolbar->GetItemText( GetId() ) );
++
++ SetStyle( WB_DIALOGCONTROL | WB_SYSTEMWINDOW );
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ SetHelpId( HID_POPUP_EXTRUSION_LIGHTING );
++
++ mpTitleTxt = new FixedText( this );
++ mpTitleTxt->SetPosPixel( Point( 2, 2 ) );
++ mpTitleTxt->SetSizePixel( Size( 106, 15 ) );
++ mpTitleTxt->SetText( GetText( ) );
++ Font& aFont = const_cast<Font&>( mpTitleTxt->GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ mpTitleTxt->SetFont( aFont );
++ mpTitleTxt->SetBackground( GetBackground( ) );
++ mpTitleTxt->Show( );
+
+ USHORT i;
+ for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ )
+@@ -867,20 +912,14 @@ void ExtrusionLightingWindow::implInit()
+ maImgLightingPreviewh[i] = Image( SVX_RES( IMG_LIGHT_PREVIEW_H + i ) );
+ }
+
+-// mpLightingDirectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_DIRECTION, *this );
+-// mpLightingIntensityForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_INTENSITY, *this );
+-
+- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
+- mpMenu->SetHelpId( HID_MENU_EXTRUSION_LIGHTING );
+- mpMenu->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
+-
+- mpLightingSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
++ mpLightingSet = new ValueSet( this, WB_TABSTOP | WB_NOBORDER | WB_NO_DIRECTSELECT );
+ mpLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
+
+ mpLightingSet->SetHelpId( HID_POPUP_LINEEND_CTRL );
+ mpLightingSet->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
+ mpLightingSet->SetColCount( 3 );
+ mpLightingSet->EnableFullItemMode( FALSE );
++ mpLightingSet->Show( );
+
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+@@ -896,17 +935,60 @@ void ExtrusionLightingWindow::implInit()
+ }
+ }
+ mpLightingSet->SetOutputSizePixel( Size( 72, 72 ) );
+-
+- mpMenu->appendEntry( 3, mpLightingSet );
+- mpMenu->appendSeparator();
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_BRIGHT ) ), bHighContrast ? maImgBrighth : maImgBright );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_NORMAL ) ), bHighContrast ? maImgNormalh : maImgNormal );
+- mpMenu->appendEntry( 2, String( SVX_RES( STR_DIM ) ), bHighContrast ? maImgDimh : maImgDim );
+-
+- SetOutputSizePixel( mpMenu->getMenuSize() );
+- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+-
+- mpMenu->Show();
++ mpLightingSet->SetPosPixel( Point( 19, 19 ) );
++
++ // Configure FixedLine
++ mpSeparator = new FixedLine( this );
++ mpSeparator->SetPosPixel( Point( 2, 93 ) );
++ mpSeparator->SetSizePixel( Size( 106, 3 ) );
++ mpSeparator->Show( );
++
++ // Configure the Bright button here
++ mpBrightBtn = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpBrightBtn->SetModeImage( bHighContrast ? maImgBrighth : maImgBright );
++ mpBrightBtn->SetPosPixel( Point( 2, 99 ) );
++ mpBrightBtn->SetSizePixel( Size( 24, 24 ) );
++ mpBrightBtn->SetClickHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
++ mpBrightBtn->Show( );
++
++ mpBrightTxt = new FixedText( this );
++ mpBrightTxt->SetPosPixel( Point( 28, 103 ) );
++ mpBrightTxt->SetSizePixel( Size( 80, 16 ) );
++ mpBrightTxt->SetText( String( SVX_RES( STR_BRIGHT ) ) );
++ mpBrightTxt->SetBackground( GetBackground( ) );
++ mpBrightTxt->Show( );
++
++ // Configure the Normal button here
++ mpNormalBtn = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpNormalBtn->SetModeImage( bHighContrast ? maImgNormalh : maImgNormal );
++ mpNormalBtn->SetPosPixel( Point( 2, 125 ) );
++ mpNormalBtn->SetSizePixel( Size( 24, 24 ) );
++ mpNormalBtn->SetClickHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
++ mpNormalBtn->Show( );
++
++ mpNormalTxt = new FixedText( this );
++ mpNormalTxt->SetPosPixel( Point( 28, 129 ) );
++ mpNormalTxt->SetSizePixel( Size( 80, 16 ) );
++ mpNormalTxt->SetText( String( SVX_RES( STR_NORMAL ) ) );
++ mpNormalTxt->SetBackground( GetBackground( ) );
++ mpNormalTxt->Show( );
++
++ // Configure the Dim button here
++ mpDimBtn = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpDimBtn->SetModeImage( bHighContrast ? maImgDimh : maImgDim );
++ mpDimBtn->SetPosPixel( Point( 2, 151 ) );
++ mpDimBtn->SetSizePixel( Size( 24, 24 ) );
++ mpDimBtn->SetClickHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
++ mpDimBtn->Show( );
++
++ mpDimTxt = new FixedText( this );
++ mpDimTxt->SetPosPixel( Point( 28, 155 ) );
++ mpDimTxt->SetSizePixel( Size( 80, 16 ) );
++ mpDimTxt->SetText( String( SVX_RES( STR_DIM ) ) );
++ mpDimTxt->SetBackground( GetBackground( ) );
++ mpDimTxt->Show( );
++
++ SetOutputSizePixel( Size( 110, 177 ) );
+
+ FreeResource();
+
+@@ -925,7 +1007,14 @@ SfxPopupWindow* ExtrusionLightingWindow::Clone() const
+
+ ExtrusionLightingWindow::~ExtrusionLightingWindow()
+ {
+- delete mpMenu;
++ delete mpLightingSet;
++ delete mpSeparator;
++ delete mpBrightBtn;
++ delete mpBrightTxt;
++ delete mpNormalBtn;
++ delete mpNormalTxt;
++ delete mpDimBtn;
++ delete mpDimTxt;
+ }
+
+ // -----------------------------------------------------------------------
+@@ -934,11 +1023,11 @@ void ExtrusionLightingWindow::implSetIntensity( int nLevel, bool bEnabled )
+ {
+ mnLevel = nLevel;
+ mbLevelEnabled = bEnabled;
++ ImageButton* buttons[] = { mpBrightBtn, mpNormalBtn, mpDimBtn };
+ int i = 0;
+ for( i = 0; i < 3; i++ )
+ {
+- mpMenu->checkEntry( i, (i == nLevel) && bEnabled );
+- mpMenu->enableEntry( i, bEnabled );
++ buttons[i]->SetPressed( (i == nLevel) && bEnabled );
+ }
+ }
+
+@@ -973,8 +1062,6 @@ void ExtrusionLightingWindow::implSetDirection( int nDirection, bool bEnabled )
+ }
+ }
+ }
+-
+- mpMenu->enableEntry( 3, bEnabled );
+ }
+
+ // -----------------------------------------------------------------------
+@@ -1025,9 +1112,9 @@ void ExtrusionLightingWindow::DataChanged( const DataChangedEvent& rDCEvt )
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+ implSetDirection( mnDirection, mbDirectionEnabled );
+- mpMenu->setEntryImage( 0, bHighContrast ? maImgBrighth : maImgBright );
+- mpMenu->setEntryImage( 1, bHighContrast ? maImgNormalh : maImgNormal );
+- mpMenu->setEntryImage( 2, bHighContrast ? maImgDimh : maImgDim );
++ mpBrightBtn->SetModeImage( bHighContrast ? maImgBrighth : maImgBright );
++ mpNormalBtn->SetModeImage( bHighContrast ? maImgNormalh : maImgNormal );
++ mpDimBtn->SetModeImage( bHighContrast ? maImgDimh : maImgDim );
+ }
+ }
+
+@@ -1035,14 +1122,21 @@ void ExtrusionLightingWindow::DataChanged( const DataChangedEvent& rDCEvt )
+
+ IMPL_LINK( ExtrusionLightingWindow, SelectHdl, void *, pControl )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager( )->IsInPopupMode( this ) )
++ GetDockingManager( )->EndPopupMode( this );
+
+ // SfxDispatcher* pDisp = GetBindings().GetDispatcher();
+
+- if( pControl == mpMenu )
++ if( pControl != mpLightingSet )
+ {
+- int nLevel = mpMenu->getSelectedEntryId();
++ int nLevel = -1;
++ if ( pControl == mpBrightBtn )
++ nLevel = 0;
++ else if ( pControl == mpNormalBtn )
++ nLevel = 1;
++ else if ( pControl == mpDimBtn )
++ nLevel = 2;
++
+ if( nLevel >= 0 )
+ {
+ if( nLevel != 3 )
+@@ -1114,24 +1208,16 @@ BOOL ExtrusionLightingWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void ExtrusionLightingWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void ExtrusionLightingWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+ // Grab the focus to the line ends value set so that it can be controlled
+ // with the keyboard.
++ // TODO Fix the focus
++#if 0
+ if( mpMenu )
+ mpMenu->GrabFocus();
++#endif
+ }
+
+ // ========================================================================
+@@ -1160,9 +1246,9 @@ SfxPopupWindowType ExtrusionLightingControl::GetPopupWindowType() const
+ SfxPopupWindow* ExtrusionLightingControl::CreatePopupWindow()
+ {
+ ExtrusionLightingWindow* pWin = new ExtrusionLightingWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++ pWin->EnableDocking(true);
++ pWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pWin);
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+@@ -1188,16 +1274,7 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(
+ SfxPopupWindow( nId,
+ rFrame,
+ SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE )),
+- maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) ),
+- maImgSurface2( SVX_RES( IMG_MATTE ) ),
+- maImgSurface3( SVX_RES( IMG_PLASTIC ) ),
+- maImgSurface4( SVX_RES( IMG_METAL ) ),
+- maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) ),
+- maImgSurface2h( SVX_RES( IMG_MATTE_H ) ),
+- maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) ),
+- maImgSurface4h( SVX_RES( IMG_METAL_H ) ),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ implInit();
+ }
+@@ -1211,16 +1288,7 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(
+ rFrame,
+ pParentWindow,
+ SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE )),
+- maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) ),
+- maImgSurface2( SVX_RES( IMG_MATTE ) ),
+- maImgSurface3( SVX_RES( IMG_PLASTIC ) ),
+- maImgSurface4( SVX_RES( IMG_METAL ) ),
+- maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) ),
+- maImgSurface2h( SVX_RES( IMG_MATTE_H ) ),
+- maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) ),
+- maImgSurface4h( SVX_RES( IMG_METAL_H ) ),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ implInit();
+ }
+@@ -1229,25 +1297,48 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(
+
+ void ExtrusionSurfaceWindow::implInit()
+ {
++ ToolBox* pToolbar = dynamic_cast<ToolBox*>( GetParent( ) );
++ SetText( pToolbar->GetItemText( GetId() ) );
++
+ SetHelpId( HID_POPUP_EXTRUSION_SURFACE );
++
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
+
+- bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
++ mpTitleTxt = new FixedText( this );
++ mpTitleTxt->SetPosPixel( Point( 2, 2 ) );
++ mpTitleTxt->SetSizePixel( Size( 106, 15 ) );
++ mpTitleTxt->SetText( GetText( ) );
++ Font& aFont = const_cast<Font&>( mpTitleTxt->GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ mpTitleTxt->SetFont( aFont );
++ mpTitleTxt->SetBackground( GetBackground( ) );
++ mpTitleTxt->Show( );
+
+-// mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this );
+
+- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
+- mpMenu->SetHelpId( HID_MENU_EXTRUSION_SURFACE );
+- mpMenu->SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) );
++ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
+- mpMenu->appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
+- mpMenu->appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
++// mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this );
+
+- SetOutputSizePixel( mpMenu->getMenuSize() );
+- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
++ for ( int i = 0; i < 4; i++ )
++ {
++ mpSurfacesBtn[i] = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpSurfacesBtn[i]->SetPosPixel( Point( 2, i* 26 + 17 ) );
++ mpSurfacesBtn[i]->SetSizePixel( Size( 24, 24 ) );
++ Image aHcImage = Image( SVX_RES( IMG_WIRE_FRAME_H + i ) );
++ Image aImage = Image( SVX_RES( IMG_WIRE_FRAME + i ) );
++ mpSurfacesBtn[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ mpSurfacesBtn[i]->SetClickHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) );
++ mpSurfacesBtn[i]->Show( );
++
++ mpSurfacesTxt[i] = new FixedText( this );
++ mpSurfacesTxt[i]->SetText( SVX_RES( STR_WIREFRAME + i ) );
++ mpSurfacesTxt[i]->SetPosPixel( Point( 28, i * 26 + 22 ) );
++ mpSurfacesTxt[i]->SetSizePixel( Size( 80, 14 ) );
++ mpSurfacesTxt[i]->SetBackground( GetBackground( ) );
++ mpSurfacesTxt[i]->Show( );
++ }
+
+- mpMenu->Show();
++ SetOutputSizePixel( Size( 110, 121 ) );
+
+ FreeResource();
+
+@@ -1266,22 +1357,22 @@ SfxPopupWindow* ExtrusionSurfaceWindow::Clone() const
+
+ ExtrusionSurfaceWindow::~ExtrusionSurfaceWindow()
+ {
+-// delete mpSurfaceForewarder;
+- delete mpMenu;
++ delete mpTitleTxt;
++ for ( int i = 0; i < 4; i++ )
++ {
++ delete mpSurfacesBtn[i];
++ delete mpSurfacesTxt[i];
++ }
+ }
+
+ // -----------------------------------------------------------------------
+
+ void ExtrusionSurfaceWindow::implSetSurface( int nSurface, bool bEnabled )
+ {
+- if( mpMenu )
++ int i;
++ for( i = 0; i < 4; i++ )
+ {
+- int i;
+- for( i = 0; i < 4; i++ )
+- {
+- mpMenu->checkEntry( i, (i == nSurface) && bEnabled );
+- mpMenu->enableEntry( i, bEnabled );
+- }
++ mpSurfacesBtn[i]->SetPressed( (i == nSurface) && bEnabled );
+ }
+ }
+
+@@ -1318,23 +1409,34 @@ void ExtrusionSurfaceWindow::DataChanged( const DataChangedEvent& rDCEvt )
+ {
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
+- mpMenu->appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
+- mpMenu->appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
++ for ( int i = 0; i < 4; i++ )
++ {
++ Image aHcImage = Image( SVX_RES( IMG_WIRE_FRAME_H + i ) );
++ Image aImage = Image( SVX_RES( IMG_WIRE_FRAME + i ) );
++ mpSurfacesBtn[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ mpSurfacesBtn[i]->SetText( String( SVX_RES( STR_WIREFRAME ) ) );
++ }
+ }
+ }
+
+ // -----------------------------------------------------------------------
+
+-IMPL_LINK( ExtrusionSurfaceWindow, SelectHdl, void *, EMPTYARG )
++IMPL_LINK( ExtrusionSurfaceWindow, SelectHdl, void *, pControl )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ // SfxDispatcher* pDisp = GetBindings().GetDispatcher();
+
+- sal_Int32 nSurface = mpMenu->getSelectedEntryId();
++ sal_Int32 nSurface = -1;
++ int i = 0;
++ while ( nSurface < 0 && i < 4 )
++ {
++ if ( pControl == mpSurfacesBtn[i] )
++ nSurface = i;
++ i++;
++ }
++
+ if( nSurface >= 0 )
+ {
+ SfxInt32Item aItem( SID_EXTRUSION_SURFACE, nSurface );
+@@ -1374,24 +1476,16 @@ BOOL ExtrusionSurfaceWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void ExtrusionSurfaceWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void ExtrusionSurfaceWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+ // Grab the focus to the line ends value set so that it can be controlled
+ // with the keyboard.
++ // TODO Fix the focus problem
++#if 0
+ if( mpMenu )
+ mpMenu->GrabFocus();
++#endif
+ }
+
+ // ========================================================================
+@@ -1421,9 +1515,10 @@ SfxPopupWindowType ExtrusionSurfaceControl::GetPopupWindowType() const
+ SfxPopupWindow* ExtrusionSurfaceControl::CreatePopupWindow()
+ {
+ ExtrusionSurfaceWindow* pWin = new ExtrusionSurfaceWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++
++ pWin->EnableDocking(true);
++ pWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pWin);
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+@@ -1474,9 +1569,16 @@ SfxPopupWindow* ExtrusionColorControl::CreatePopupWindow()
+ m_xFrame,
+ SVX_RESSTR( RID_SVXSTR_EXTRUSION_COLOR ),
+ &GetToolBox() );
++
++ pColorWin->EnableDocking(true);
++ pColorWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pColorWin);
++
++#if 0
+ pColorWin->StartPopupMode( &GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
+- pColorWin->StartSelection();
+ SetPopupWindow( pColorWin );
++#endif
++ pColorWin->StartSelection();
++
+ return pColorWin;
+ }
+
+diff --git svx/source/tbxctrls/extrusioncontrols.src svx/source/tbxctrls/extrusioncontrols.src
+index 3e391de..cd56231 100644
+--- svx/source/tbxctrls/extrusioncontrols.src
++++ svx/source/tbxctrls/extrusioncontrols.src
+@@ -35,14 +35,6 @@
+
+ FloatingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Extrusion Direction" ;
+
+ Image IMG_DIRECTION + DIRECTION_NW
+@@ -205,14 +197,6 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION
+
+ FloatingWindow RID_SVXFLOAT_EXTRUSION_DEPTH
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Extrusion Depth" ;
+
+ String STR_CUSTOM
+@@ -294,14 +278,6 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_DEPTH
+
+ FloatingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Extrusion Lighting" ;
+
+ Image IMG_LIGHT_OFF + FROM_TOP_LEFT
+@@ -610,14 +586,6 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING
+
+ FloatingWindow RID_SVXFLOAT_EXTRUSION_SURFACE
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Extrusion Surface" ;
+
+ String STR_WIREFRAME
+diff --git svx/source/tbxctrls/fontworkgallery.cxx svx/source/tbxctrls/fontworkgallery.cxx
+index 7cb7799..c065851 100644
+--- svx/source/tbxctrls/fontworkgallery.cxx
++++ svx/source/tbxctrls/fontworkgallery.cxx
+@@ -351,18 +351,7 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow(
+ SfxPopupWindow( nId,
+ rFrame,
+ SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT )),
+- maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) ),
+- maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) ),
+- maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) ),
+- maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) ),
+- maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) ),
+- maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) ),
+- maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) ),
+- maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) ),
+- maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) ),
+- maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) ),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ SetHelpId( HID_WIN_FONTWORK_ALIGN );
+ implInit();
+@@ -376,18 +365,7 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow(
+ SfxPopupWindow( nId,
+ rFrame,
+ SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT )),
+- maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) ),
+- maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) ),
+- maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) ),
+- maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) ),
+- maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) ),
+- maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) ),
+- maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) ),
+- maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) ),
+- maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) ),
+- maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) ),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ SetHelpId( HID_WIN_FONTWORK_ALIGN );
+ implInit();
+@@ -397,22 +375,40 @@ void FontWorkAlignmentWindow::implInit()
+ {
+ SetHelpId( HID_POPUP_FONTWORK_ALIGN );
+
+- bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
+
+- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
+- mpMenu->SetHelpId( HID_POPUP_FONTWORK_ALIGN );
+- mpMenu->SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) );
++ mpTitleTxt = new FixedText( this );
++ mpTitleTxt->SetPosPixel( Point( 2, 2 ) );
++ mpTitleTxt->SetSizePixel( Size( 116, 15 ) );
++ mpTitleTxt->SetText( GetText( ) );
++ Font& aFont = const_cast<Font&>( mpTitleTxt->GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ mpTitleTxt->SetFont( aFont );
++ mpTitleTxt->SetBackground( GetBackground( ) );
++ mpTitleTxt->Show( );
+
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
+- mpMenu->appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
+- mpMenu->appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
+- mpMenu->appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
++ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+- SetOutputSizePixel( mpMenu->getMenuSize() );
+- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
++ for ( int i = 0; i < 5; i++ )
++ {
++ mpAlignsBtn[i] = new ImageButton( this, WinBits( WB_TOGGLE ) );
++ mpAlignsBtn[i]->SetPosPixel( Point( 2, i* 26 + 17 ) );
++ mpAlignsBtn[i]->SetSizePixel( Size( 24, 24 ) );
++ Image aHcImage = Image( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H + i * 2) );
++ Image aImage = Image( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 + i * 2 ) );
++ mpAlignsBtn[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ mpAlignsBtn[i]->SetClickHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) );
++ mpAlignsBtn[i]->Show( );
++
++ mpAlignsTxt[i] = new FixedText( this );
++ mpAlignsTxt[i]->SetText( SVX_RES( STR_ALIGN_LEFT + i ) );
++ mpAlignsTxt[i]->SetPosPixel( Point( 28, i * 26 + 22 ) );
++ mpAlignsTxt[i]->SetSizePixel( Size( 90, 14 ) );
++ mpAlignsTxt[i]->SetBackground( GetBackground( ) );
++ mpAlignsTxt[i]->Show( );
++ }
+
+- mpMenu->Show();
++ SetOutputSizePixel( Size( 120, 147 ) );
+
+ FreeResource();
+
+@@ -428,21 +424,23 @@ SfxPopupWindow* FontWorkAlignmentWindow::Clone() const
+
+ FontWorkAlignmentWindow::~FontWorkAlignmentWindow()
+ {
+- delete mpMenu;
++ delete mpTitleTxt;
++
++ for ( int i = 0; i < 5; i++ )
++ {
++ delete mpAlignsBtn[i];
++ delete mpAlignsTxt[i];
++ }
+ }
+
+ // -----------------------------------------------------------------------
+
+ void FontWorkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
+ {
+- if( mpMenu )
++ int i;
++ for( i = 0; i < 5; i++ )
+ {
+- int i;
+- for( i = 0; i < 5; i++ )
+- {
+- mpMenu->checkEntry( i, (i == nSurface) && bEnabled );
+- mpMenu->enableEntry( i, bEnabled );
+- }
++ mpAlignsBtn[i]->SetPressed( (i == nSurface) && bEnabled );
+ }
+ }
+
+@@ -479,24 +477,34 @@ void FontWorkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt )
+ {
+ bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+- mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
+- mpMenu->appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
+- mpMenu->appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
+- mpMenu->appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
+- mpMenu->appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
++ for ( int i = 0; i < 5; i++ )
++ {
++ Image aHcImage = Image( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H + i * 2) );
++ Image aImage = Image( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 + i * 2 ) );
++ mpAlignsBtn[i]->SetModeImage( bHighContrast ? aHcImage : aImage );
++ mpAlignsTxt[i]->SetText( SVX_RES( STR_ALIGN_LEFT + i ) );
++ }
+ }
+ }
+
+ // -----------------------------------------------------------------------
+
+-IMPL_LINK( FontWorkAlignmentWindow, SelectHdl, void *, EMPTYARG )
++IMPL_LINK( FontWorkAlignmentWindow, SelectHdl, void *, pControl )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ // SfxDispatcher* pDisp = GetBindings().GetDispatcher();
+
+- sal_Int32 nAlignment = mpMenu->getSelectedEntryId();
++ sal_Int32 nAlignment = -1;
++ int i = 0;
++ while ( i < 5 && nAlignment < 0 )
++ {
++ if ( mpAlignsBtn[i] == pControl )
++ nAlignment = i;
++ i++;
++ }
++
+ if( nAlignment >= 0 )
+ {
+ SfxInt32Item aItem( SID_FONTWORK_ALIGNMENT, nAlignment );
+@@ -535,24 +543,16 @@ BOOL FontWorkAlignmentWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void FontWorkAlignmentWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void FontWorkAlignmentWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+ // Grab the focus to the line ends value set so that it can be controlled
+ // with the keyboard.
++ // TODO Fix the focus problem
++#if 0
+ if( mpMenu )
+ mpMenu->GrabFocus();
++#endif
+ }
+
+ // ========================================================================
+@@ -582,9 +582,9 @@ SfxPopupWindowType FontWorkAlignmentControl::GetPopupWindowType() const
+ SfxPopupWindow* FontWorkAlignmentControl::CreatePopupWindow()
+ {
+ FontWorkAlignmentWindow* pWin = new FontWorkAlignmentWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++ pWin->EnableDocking( true );
++ pWin->GetDockingManager()->StartPopupMode( &GetToolBox(), pWin );
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+@@ -610,8 +610,7 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow(
+ SfxPopupWindow( nId,
+ rFrame,
+ SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING )),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ SetHelpId( HID_WIN_FONTWORK_CHARSPACE );
+ implInit();
+@@ -626,8 +625,7 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow(
+ rFrame,
+ pParentWindow,
+ SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING )),
+- mxFrame( rFrame ),
+- mbPopupMode( true )
++ mxFrame( rFrame )
+ {
+ SetHelpId( HID_WIN_FONTWORK_CHARSPACE );
+ implInit();
+@@ -771,8 +769,8 @@ void FontWorkCharacterSpacingWindow::DataChanged( const DataChangedEvent& rDCEvt
+
+ IMPL_LINK( FontWorkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
+ {
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ sal_Int32 nSelection = mpMenu->getSelectedEntryId();
+ sal_Int32 nCharacterSpacing;
+@@ -856,17 +854,6 @@ BOOL FontWorkCharacterSpacingWindow::Close()
+
+ // -----------------------------------------------------------------------
+
+-void FontWorkCharacterSpacingWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- mbPopupMode = FALSE;
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void FontWorkCharacterSpacingWindow::GetFocus (void)
+ {
+ SfxPopupWindow::GetFocus();
+@@ -903,9 +890,9 @@ SfxPopupWindowType FontWorkCharacterSpacingControl::GetPopupWindowType() const
+ SfxPopupWindow* FontWorkCharacterSpacingControl::CreatePopupWindow()
+ {
+ FontWorkCharacterSpacingWindow* pWin = new FontWorkCharacterSpacingWindow( GetId(), m_xFrame, &GetToolBox() );
+- pWin->StartPopupMode( &GetToolBox(), TRUE );
++ pWin->EnableDocking( true );
++ pWin->GetDockingManager()->StartPopupMode( &GetToolBox(), pWin );
+ pWin->StartSelection();
+- SetPopupWindow( pWin );
+ return pWin;
+ }
+
+diff --git svx/source/tbxctrls/fontworkgallery.src svx/source/tbxctrls/fontworkgallery.src
+index 880bb5d..a6a3fec 100644
+--- svx/source/tbxctrls/fontworkgallery.src
++++ svx/source/tbxctrls/fontworkgallery.src
+@@ -97,14 +97,6 @@ ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY
+
+ FloatingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Fontwork Alignment" ;
+
+ String STR_ALIGN_LEFT
+@@ -232,14 +224,6 @@ FloatingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
+
+ FloatingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING
+ {
+- Border = TRUE ;
+- Hide = TRUE ;
+- SVLook = TRUE ;
+- Sizeable = FALSE ;
+- Moveable = TRUE ;
+- Closeable = TRUE ;
+- Zoomable = TRUE ;
+-
+ Text [ en-US ] = "Fontwork Character Spacing" ;
+
+ String STR_CHARS_SPACING_VERY_TIGHT
+diff --git svx/source/tbxctrls/linectrl.cxx svx/source/tbxctrls/linectrl.cxx
+index dca3dd0..174bafb 100644
+--- svx/source/tbxctrls/linectrl.cxx
++++ svx/source/tbxctrls/linectrl.cxx
+@@ -385,14 +385,13 @@ SvxLineEndWindow::SvxLineEndWindow(
+ const String& rWndTitle ) :
+ SfxPopupWindow( nSlotId,
+ rFrame,
+- WinBits( WB_BORDER | WB_STDFLOATWIN | WB_SIZEABLE | WB_3DLOOK ) ),
++ WinBits( WB_DIALOGCONTROL | WB_SYSTEMWINDOW ) ),
++ aTitle ( this, WinBits( ) ),
+ pLineEndList ( NULL ),
+ aLineEndSet ( this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ),
+ nCols ( 2 ),
+ nLines ( 12 ),
+ nLineEndWidth ( 400 ),
+- bPopupMode ( TRUE ),
+- mbInResize ( false ),
+ mxFrame ( rFrame )
+ {
+ SetText( rWndTitle );
+@@ -407,14 +406,13 @@ SvxLineEndWindow::SvxLineEndWindow(
+ SfxPopupWindow( nSlotId,
+ rFrame,
+ pParentWindow,
+- WinBits( WB_BORDER | WB_STDFLOATWIN | WB_SIZEABLE | WB_3DLOOK ) ),
++ WinBits( WB_DIALOGCONTROL | WB_SYSTEMWINDOW ) ),
++ aTitle ( this, WinBits( ) ),
+ pLineEndList ( NULL ),
+ aLineEndSet ( this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ),
+ nCols ( 2 ),
+ nLines ( 12 ),
+ nLineEndWidth ( 400 ),
+- bPopupMode ( TRUE ),
+- mbInResize ( false ),
+ mxFrame ( rFrame )
+ {
+ SetText( rWndTitle );
+@@ -426,6 +424,8 @@ void SvxLineEndWindow::implInit()
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ const SfxPoolItem* pItem = NULL;
+
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ SetHelpId( HID_POPUP_LINEEND );
+ aLineEndSet.SetHelpId( HID_POPUP_LINEEND_CTRL );
+
+@@ -447,6 +447,18 @@ void SvxLineEndWindow::implInit()
+ // ValueSet mit Eintraegen der LineEndList fuellen
+ FillValueSet();
+
++ aTitle.SetText( GetText() );
++ aTitle.SetBackground( GetBackground( ) );
++ Font& aFont = const_cast<Font&>( aTitle.GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ aTitle.SetFont( aFont );
++ Size aSize = GetOutputSizePixel( );
++ aSize.Height() = 15;
++ aTitle.SetSizePixel( aSize );
++ aTitle.SetPosPixel( Point( 2, 2 ) );
++ aTitle.Show( );
++
++
+ AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:LineEndListState" )));
+
+ //ChangeHelpId( HID_POPUP_LINEENDSTYLE );
+@@ -491,8 +503,8 @@ IMPL_LINK( SvxLineEndWindow, SelectHdl, void *, EMPTYARG )
+ pLineEndItem = new XLineEndItem( pEntry->GetName(), pEntry->GetLineEnd() );
+ }
+
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ Sequence< PropertyValue > aArgs( 1 );
+ Any a;
+@@ -577,79 +589,6 @@ void SvxLineEndWindow::FillValueSet()
+
+ // -----------------------------------------------------------------------
+
+-void SvxLineEndWindow::Resize()
+-{
+- // since we change the size inside this call, check if we
+- // are called recursive
+- if( !mbInResize )
+- {
+- mbInResize = true;
+- if ( !IsRollUp() )
+- {
+- aLineEndSet.SetColCount( nCols );
+- aLineEndSet.SetLineCount( nLines );
+-
+- SetSize();
+-
+- Size aSize = GetOutputSizePixel();
+- aSize.Width() -= 4;
+- aSize.Height() -= 4;
+- aLineEndSet.SetPosSizePixel( Point( 2, 2 ), aSize );
+- }
+- //SfxPopupWindow::Resize();
+- mbInResize = false;
+- }
+-}
+-
+-// -----------------------------------------------------------------------
+-
+-void __EXPORT SvxLineEndWindow::Resizing( Size& rNewSize )
+-{
+- Size aBitmapSize = aBmpSize; // -> Member
+- aBitmapSize.Width() += 6; //
+- aBitmapSize.Height() += 6; //
+-
+- Size aItemSize = aLineEndSet.CalcItemSizePixel( aBitmapSize ); // -> Member
+- //Size aOldSize = GetOutputSizePixel(); // fuer Breite
+-
+- USHORT nItemCount = aLineEndSet.GetItemCount(); // -> Member
+-
+- // Spalten ermitteln
+- long nItemW = aItemSize.Width();
+- long nW = rNewSize.Width();
+- nCols = (USHORT) Max( ( (ULONG)(( nW + nItemW ) / ( nItemW * 2 ) )),
+- (ULONG) 1L );
+- nCols *= 2;
+-
+- // Reihen ermitteln
+- long nItemH = aItemSize.Height();
+- long nH = rNewSize.Height();
+- nLines = (USHORT) Max( ( ( nH + nItemH / 2 ) / nItemH ), 1L );
+-
+- USHORT nMaxCols = nItemCount / nLines;
+- if( nItemCount % nLines )
+- nMaxCols++;
+- if( nCols > nMaxCols )
+- nCols = nMaxCols;
+- nW = nItemW * nCols;
+-
+- // Keine ungerade Anzahl von Spalten
+- if( nCols % 2 )
+- nCols--;
+- nCols = Max( nCols, (USHORT) 2 );
+-
+- USHORT nMaxLines = nItemCount / nCols;
+- if( nItemCount % nCols )
+- nMaxLines++;
+- if( nLines > nMaxLines )
+- nLines = nMaxLines;
+- nH = nItemH * nLines;
+-
+- rNewSize.Width() = nW;
+- rNewSize.Height() = nH;
+-}
+-// -----------------------------------------------------------------------
+-
+ void SvxLineEndWindow::StartSelection()
+ {
+ aLineEndSet.StartSelection();
+@@ -677,28 +616,12 @@ void SvxLineEndWindow::StateChanged(
+
+ aLineEndSet.Clear();
+ FillValueSet();
+-
+- Size aSize = GetOutputSizePixel();
+- Resizing( aSize );
+- Resize();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------
+
+-void SvxLineEndWindow::PopupModeEnd()
+-{
+- if ( IsVisible() )
+- {
+- bPopupMode = FALSE;
+- SetSize();
+- }
+- SfxPopupWindow::PopupModeEnd();
+-}
+-
+-// -----------------------------------------------------------------------
+-
+ void SvxLineEndWindow::SetSize()
+ {
+ //if( !bPopupMode )
+@@ -721,12 +644,12 @@ void SvxLineEndWindow::SetSize()
+ aSize.Width() += 6;
+ aSize.Height() += 6;
+ aSize = aLineEndSet.CalcWindowSizePixel( aSize );
++ aLineEndSet.SetSizePixel( aSize );
+ aSize.Width() += 4;
+- aSize.Height() += 4;
++ aSize.Height() += 21;
+ SetOutputSizePixel( aSize );
+- aSize.Height() = aBmpSize.Height();
+- aSize.Height() += 14;
+- //SetMinOutputSizePixel( aSize );
++
++ aLineEndSet.SetPosPixel( Point( 2, 19 ) );
+ }
+
+ void SvxLineEndWindow::GetFocus (void)
+@@ -769,9 +692,9 @@ SfxPopupWindow* SvxLineEndToolBoxControl::CreatePopupWindow()
+ {
+ SvxLineEndWindow* pLineEndWin =
+ new SvxLineEndWindow( GetId(), m_xFrame, &GetToolBox(), SVX_RESSTR( RID_SVXSTR_LINEEND ) );
+- pLineEndWin->StartPopupMode( &GetToolBox(), TRUE );
++ pLineEndWin->EnableDocking(true);
++ pLineEndWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pLineEndWin);
+ pLineEndWin->StartSelection();
+- SetPopupWindow( pLineEndWin );
+ return pLineEndWin;
+ }
+
+diff --git svx/source/tbxctrls/tbcontrl.cxx svx/source/tbxctrls/tbcontrl.cxx
+index 94494aa..f6a0e5f 100644
+--- svx/source/tbxctrls/tbcontrl.cxx
++++ svx/source/tbxctrls/tbcontrl.cxx
+@@ -253,6 +253,7 @@ class SvxFrameWindow_Impl : public SfxPopupWindow
+ using FloatingWindow::StateChanged;
+
+ private:
++ FixedText aLabel;
+ SvxFrmValueSet_Impl aFrameSet;
+ ImageList aImgList;
+ sal_Bool bParagraphMode;
+@@ -292,6 +293,7 @@ class SvxLineWindow_Impl : public SfxPopupWindow
+ {
+ private:
+ ValueSet aLineSet;
++ FixedText aLabel;
+ bool m_bIsWriter;
+
+ #if _SOLAR__PRIVATE
+@@ -832,10 +834,11 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
+ const String& rWndTitle,
+ Window* pParentWindow ) :
+
+- SfxPopupWindow( nSlotId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL ) ),
++ SfxPopupWindow( nSlotId, rFrame, pParentWindow, WinBits( WB_DIALOGCONTROL | WB_SYSTEMWINDOW ) ),
+
+ theSlotId( nSlotId ),
+ aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ),
++ aLabel( this, WinBits( ) ),
+ maCommand( rCommand )
+
+ {
+@@ -845,6 +848,8 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
+ BOOL bKillTable = FALSE;
+ const Size aSize12( 13, 13 );
+
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ if ( pDocSh )
+ if ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) )
+ pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+@@ -907,6 +912,17 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
+ aColorSet.SetLineCount( PALETTE_Y );
+
+ lcl_CalcSizeValueSet( *this, aColorSet, aSize12 );
++
++ aLabel.SetText( rWndTitle );
++ aLabel.SetBackground( GetBackground( ) );
++ Font& aFont = const_cast<Font&>( aLabel.GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ aLabel.SetFont( aFont );
++ Size aSize = GetOutputSizePixel( );
++ aSize.Height() = 15;
++ aLabel.SetSizePixel( aSize );
++ aLabel.SetPosPixel( Point( 2, 2 ) );
++ aLabel.Show( );
+
+ SetHelpId( HID_POPUP_COLOR );
+ aColorSet.SetHelpId( HID_POPUP_COLOR_CTRL );
+@@ -917,6 +933,9 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
+ AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColorTableState" )));
+ if ( bKillTable )
+ delete pColorTable;
++
++ WinBits nBits = GetStyle();
++ SetStyle( nBits & ~WB_MOVEABLE );
+ }
+
+ SvxColorWindow_Impl::~SvxColorWindow_Impl()
+@@ -945,8 +964,8 @@ IMPL_LINK( SvxColorWindow_Impl, SelectHdl, void *, EMPTYARG )
+ while in Dispatch()), accessing members will crash in this case. */
+ aColorSet.SetNoSelection();
+
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ if ( !nItemId && ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR == theSlotId ) )
+ {
+@@ -1058,11 +1077,17 @@ void SvxColorWindow_Impl::StateChanged( USHORT nSID, SfxItemState eState, const
+
+ SvxFrameWindow_Impl::SvxFrameWindow_Impl( USHORT nId, const Reference< XFrame >& rFrame, Window* pParentWindow ) :
+
+- SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL ) ),
++ SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_DIALOGCONTROL | WB_SYSTEMWINDOW ) ),
++ aLabel( this, WinBits( ) ),
+ aFrameSet ( this, WinBits( WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ),
+ bParagraphMode(sal_False)
+
+ {
++ WinBits nBits = GetStyle();
++ SetStyle( nBits & ~WB_MOVEABLE );
++
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ BindListener();
+ String sCommand(String::CreateFromAscii( ".uno:BorderReducedMode" ));
+ AddStatusListener( sCommand );
+@@ -1092,6 +1117,17 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( USHORT nId, const Reference< XFrame >&
+ aFrameSet.SetSelectHdl( LINK( this, SvxFrameWindow_Impl, SelectHdl ) );
+
+ lcl_CalcSizeValueSet( *this, aFrameSet,Size( 20, 20 ));
++
++ aLabel.SetText( SVX_RESSTR( RID_SVXSTR_FRAME ) );
++ aLabel.SetBackground( GetBackground( ) );
++ Font& aFont = const_cast<Font&>( aLabel.GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ aLabel.SetFont( aFont );
++ Size aSize = GetOutputSizePixel( );
++ aSize.Height() = 15;
++ aLabel.SetSizePixel( aSize );
++ aLabel.SetPosPixel( Point( 2, 2 ) );
++ aLabel.Show( );
+
+ SetHelpId( HID_POPUP_FRAME );
+ SetText( SVX_RESSTR(RID_SVXSTR_FRAME) );
+@@ -1239,8 +1275,8 @@ IMPL_LINK( SvxFrameWindow_Impl, SelectHdl, void *, EMPTYARG )
+ aBorderInner.SetValid( VALID_DISTANCE, TRUE );
+ aBorderInner.SetValid( VALID_DISABLE, FALSE );
+
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ Any a;
+ Sequence< PropertyValue > aArgs( 2 );
+@@ -1332,10 +1368,16 @@ BOOL SvxFrameWindow_Impl::Close()
+
+ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& rFrame, Window* pParentWindow ) :
+
+- SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL ) ),
++ SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_DIALOGCONTROL | WB_SYSTEMWINDOW ) ),
+
+- aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) )
++ aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) ),
++ aLabel( this, WinBits( ) )
+ {
++ WinBits nBits = GetStyle();
++ SetStyle( nBits & ~WB_MOVEABLE );
++
++ SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor( ) );
++
+ try
+ {
+ Reference< lang::XServiceInfo > xServices( rFrame->getController()->getModel(), UNO_QUERY_THROW );
+@@ -1344,6 +1386,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r
+ catch(const uno::Exception& )
+ {
+ }
++
+ Size aBmpSize( 55, 12 );
+ CreateBitmaps();
+
+@@ -1352,6 +1395,17 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r
+ aLineSet.SetText( SVX_RESSTR(STR_NONE) );
+
+ lcl_CalcSizeValueSet( *this, aLineSet, aBmpSize );
++
++ aLabel.SetText( SVX_RESSTR( RID_SVXSTR_FRAME_STYLE ) );
++ aLabel.SetBackground( GetBackground( ) );
++ Font& aFont = const_cast<Font&>( aLabel.GetFont( ) );
++ aFont.SetWeight( WEIGHT_BOLD );
++ aLabel.SetFont( aFont );
++ Size aSize = GetOutputSizePixel( );
++ aSize.Height() = 15;
++ aLabel.SetSizePixel( aSize );
++ aLabel.SetPosPixel( Point( 2, 2 ) );
++ aLabel.Show( );
+
+ SetHelpId( HID_POPUP_LINE );
+ SetText( SVX_RESSTR(RID_SVXSTR_FRAME_STYLE) );
+@@ -1601,8 +1655,8 @@ IMPL_LINK( SvxLineWindow_Impl, SelectHdl, void *, EMPTYARG )
+ else
+ aLineItem.SetLine( 0 );
+
+- if ( IsInPopupMode() )
+- EndPopupMode();
++ if ( GetDockingManager()->IsInPopupMode( this ) )
++ GetDockingManager()->EndPopupMode( this );
+
+ Any a;
+ Sequence< PropertyValue > aArgs( 1 );
+@@ -2351,10 +2405,10 @@ SfxPopupWindow* SvxFontColorToolBoxControl::CreatePopupWindow()
+ SVX_RESSTR( RID_SVXITEMS_EXTRAS_CHARCOLOR ),
+ &GetToolBox() );
+
+- pColorWin->StartPopupMode( &GetToolBox(),
+- FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
++ pColorWin->EnableDocking(true);
++ pColorWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pColorWin);
+ pColorWin->StartSelection();
+- SetPopupWindow( pColorWin );
++
+ return pColorWin;
+ }
+
+@@ -2422,10 +2476,9 @@ SfxPopupWindow* SvxColorToolBoxControl::CreatePopupWindow()
+ SVX_RESSTR(nResId),
+ &GetToolBox() );
+
+- pColorWin->StartPopupMode( &GetToolBox(),
+- FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
++ pColorWin->EnableDocking( true );
++ pColorWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pColorWin);
+ pColorWin->StartSelection();
+- SetPopupWindow( pColorWin );
+ return pColorWin;
+ }
+
+@@ -2496,16 +2549,15 @@ SfxPopupWindow* SvxFontColorExtToolBoxControl::CreatePopupWindow()
+ m_aCommandURL,
+ GetSlotId(),
+ m_xFrame,
+- SVX_RESSTR( RID_SVXITEMS_EXTRAS_CHARCOLOR ),
++ SVX_RESSTR( RID_SVXSTR_EXTRAS_CHARBACKGROUND ),
+ &GetToolBox() );
+
+ if ( GetSlotId() == SID_ATTR_CHAR_COLOR_BACKGROUND )
+ pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_EXTRAS_CHARBACKGROUND ) );
+
+- pColorWin->StartPopupMode( &GetToolBox(),
+- FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
++ pColorWin->EnableDocking( true );
++ pColorWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pColorWin);
+ pColorWin->StartSelection();
+- SetPopupWindow( pColorWin );
+ return pColorWin;
+ }
+
+@@ -2591,9 +2643,9 @@ SfxPopupWindow* SvxFrameToolBoxControl::CreatePopupWindow()
+ SvxFrameWindow_Impl* pFrameWin = new SvxFrameWindow_Impl(
+ GetSlotId(), m_xFrame, &GetToolBox() );
+
+- pFrameWin->StartPopupMode( &GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS | FLOATWIN_POPUPMODE_ALLOWTEAROFF );
++ pFrameWin->EnableDocking( true );
++ pFrameWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pFrameWin);
+ pFrameWin->StartSelection();
+- SetPopupWindow( pFrameWin );
+
+ return pFrameWin;
+ }
+@@ -2640,9 +2692,9 @@ SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const
+ SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
+ {
+ SvxLineWindow_Impl* pLineWin = new SvxLineWindow_Impl( GetSlotId(), m_xFrame, &GetToolBox() );
+- pLineWin->StartPopupMode( &GetToolBox(), TRUE );
++ pLineWin->EnableDocking( true );
++ pLineWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pLineWin);
+ pLineWin->StartSelection();
+- SetPopupWindow( pLineWin );
+
+ return pLineWin;
+ }
+@@ -2703,10 +2755,9 @@ SfxPopupWindow* SvxFrameLineColorToolBoxControl::CreatePopupWindow()
+ SVX_RESSTR(RID_SVXSTR_FRAME_COLOR),
+ &GetToolBox() );
+
+- pColorWin->StartPopupMode( &GetToolBox(),
+- FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
++ pColorWin->EnableDocking( true );
++ pColorWin->GetDockingManager()->StartPopupMode(&GetToolBox(),pColorWin);
+ pColorWin->StartSelection();
+- SetPopupWindow( pColorWin );
+ return pColorWin;
+ }
+
+@@ -2822,8 +2873,8 @@ void lcl_ResizeValueSet( Window &rWin, ValueSet &rValueSet )
+ {
+ Size aSize = rWin.GetOutputSizePixel();
+ aSize.Width() -= 4;
+- aSize.Height() -= 4;
+- rValueSet.SetPosSizePixel( Point(2,2), aSize );
++ aSize.Height() -= 21;
++ rValueSet.SetPosSizePixel( Point(2,19), aSize );
+ }
+
+ // -----------------------------------------------------------------------
+@@ -2832,7 +2883,7 @@ void lcl_CalcSizeValueSet( Window &rWin, ValueSet &rValueSet, const Size &aItemS
+ {
+ Size aSize = rValueSet.CalcWindowSizePixel( aItemSize );
+ aSize.Width() += 4;
+- aSize.Height() += 4;
++ aSize.Height() += 21;
+ rWin.SetOutputSizePixel( aSize );
+ }
+
+diff --git vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/dockwin.hxx
+index 0110960..6c84898 100644
+--- vcl/inc/vcl/dockwin.hxx
++++ vcl/inc/vcl/dockwin.hxx
+@@ -156,6 +156,7 @@ public:
+ BOOL IsLocked() const;
+
+ void StartPopupMode( ToolBox* pParentToolBox );
++ void EndPopupMode( );
+ BOOL IsInPopupMode() const;
+
+ void TitleButtonClick( USHORT nButton );
+@@ -237,6 +238,7 @@ public:
+ BOOL IsLocked( const Window *pWin );
+
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin );
++ void EndPopupMode( const Window *pWin );
+ BOOL IsInPopupMode( const Window *pWin );
+
+ // required because those methods are not virtual in Window (!!!) and must
+diff --git vcl/source/window/dockmgr.cxx vcl/source/window/dockmgr.cxx
+index 6d70c20..d4e29a7 100644
+--- vcl/source/window/dockmgr.cxx
++++ vcl/source/window/dockmgr.cxx
+@@ -436,6 +436,13 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWin
+ pWrapper->StartPopupMode( pParentToolBox );
+ }
+
++void DockingManager::EndPopupMode( const Window *pWindow )
++{
++ ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
++ if( pWrapper )
++ pWrapper->EndPopupMode( );
++}
++
+ BOOL DockingManager::IsInPopupMode( const Window *pWindow )
+ {
+ ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
+@@ -585,7 +592,10 @@ void ImplPopupFloatWin::ImplSetBorder()
+ // we're using a special border for the grip
+ // by setting those members the method SetOutputSizePixel() can
+ // be used to set the proper window size
+- mpWindowImpl->mnTopBorder = 1 + POPUP_DRAGHEIGHT+2;
++ mpWindowImpl->mnTopBorder = 1;
++ bool bMoveable = ( mpDockingWin->GetFloatStyle() & WB_MOVEABLE) > 0;
++ if ( bMoveable )
++ mpWindowImpl->mnTopBorder = 1 + POPUP_DRAGHEIGHT+2;
+ mpWindowImpl->mnBottomBorder = 1;
+ mpWindowImpl->mnLeftBorder = 1;
+ mpWindowImpl->mnRightBorder = 1;
+@@ -599,7 +609,11 @@ void ImplPopupFloatWin::Resize()
+
+ Rectangle ImplPopupFloatWin::GetDragRect() const
+ {
+- return Rectangle( 1, 1, GetOutputSizePixel().Width()-1, 2+POPUP_DRAGHEIGHT );
++ bool bMoveable = ( mpDockingWin->GetFloatStyle() & WB_MOVEABLE) > 0;
++ Rectangle rect( 0, 0, GetOutputSizePixel().Width() - 1 ,0 );
++ if ( bMoveable )
++ rect = Rectangle( 1, 1, GetOutputSizePixel().Width()-1, 2+POPUP_DRAGHEIGHT );
++ return rect;
+ }
+
+ Point ImplPopupFloatWin::GetToolboxPosition() const
+@@ -650,19 +664,22 @@ void ImplPopupFloatWin::DrawGrip()
+ aRect.nLeft+=3;
+ aRect.nRight-=3;
+
+- if( mbHighlight )
+- {
+- Erase( aRect );
+- DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE );
+- }
+- else
+- {
+- SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() );
+- SetLineColor();
+- DrawRect( aRect );
++ bool bMoveable = ( mpDockingWin->GetFloatStyle() & WB_MOVEABLE) > 0;
++ if ( bMoveable ) {
++ if( mbHighlight )
++ {
++ Erase( aRect );
++ DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE );
++ }
++ else
++ {
++ SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() );
++ SetLineColor();
++ DrawRect( aRect );
++ }
+ }
+
+- if( !ToolBox::AlwaysLocked() ) // no grip if toolboxes are locked
++ if( bMoveable && !ToolBox::AlwaysLocked() ) // no grip if toolboxes are locked
+ {
+ #ifdef TEAROFF_DASHED
+ // draw single dashed line
+@@ -733,8 +750,7 @@ void ImplPopupFloatWin::Paint( const Rectangle& )
+ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
+ {
+ Point aMousePos = rMEvt.GetPosPixel();
+-
+- if( !ToolBox::AlwaysLocked() ) // no tear off if locking is enabled
++ if( ( ( GetStyle( ) & WB_MOVEABLE ) > 0 ) && !ToolBox::AlwaysLocked() ) // no tear off if locking is enabled
+ {
+ if( rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) )
+ {
+@@ -1257,6 +1273,11 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox )
+ }
+ }
+
++void ImplDockingWindowWrapper::EndPopupMode( )
++{
++ mpFloatWin->EndPopupMode();
++}
++
+ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
+ {
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
More information about the ooo-build-commit
mailing list