diff options
-rw-r--r-- | include/svx/contdlg.hxx | 4 | ||||
-rw-r--r-- | include/svx/graphctl.hxx | 5 | ||||
-rw-r--r-- | include/svx/imapdlg.hxx | 22 | ||||
-rw-r--r-- | svx/AllLangResTarget_svx.mk | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/inc/helpid.hrc | 16 | ||||
-rw-r--r-- | svx/source/dialog/_contdlg.cxx | 424 | ||||
-rw-r--r-- | svx/source/dialog/contdlg.hrc | 60 | ||||
-rw-r--r-- | svx/source/dialog/contdlg.src | 222 | ||||
-rw-r--r-- | svx/source/dialog/contimp.hxx | 39 | ||||
-rw-r--r-- | svx/source/dialog/contwnd.cxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/contwnd.hxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 20 | ||||
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 50 | ||||
-rw-r--r-- | svx/uiconfig/ui/floatingcontour.ui | 359 |
15 files changed, 580 insertions, 658 deletions
diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx index 37d1a942a827..4d42c1d47d84 100644 --- a/include/svx/contdlg.hxx +++ b/include/svx/contdlg.hxx @@ -73,8 +73,8 @@ protected: public: - SvxContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW, - Window* pParent, const ResId& rResId ); + SvxContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW, + Window* pParent); virtual ~SvxContourDlg(); const Graphic& GetGraphic() const; diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx index 495ba9ff8d71..1e04dc6d31c2 100644 --- a/include/svx/graphctl.hxx +++ b/include/svx/graphctl.hxx @@ -80,9 +80,8 @@ protected: public: - GraphCtrl( Window* pParent, const ResId& rResId ); - GraphCtrl( Window* pParent, WinBits nStyle ); - virtual ~GraphCtrl(); + GraphCtrl( Window* pParent, WinBits nStyle ); + virtual ~GraphCtrl(); void SetWinStyle( WinBits nWinBits ); WinBits GetWinStyle() const { return nWinStyle; } diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx index dbf06f20a3b6..200fa88bdb31 100644 --- a/include/svx/imapdlg.hxx +++ b/include/svx/imapdlg.hxx @@ -90,7 +90,6 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow FixedText *m_pFtTarget; ComboBox *m_pCbbTarget; StatusBar *m_pStbStatus; - ImageList maImageList; sal_uInt16 mnApplyId; sal_uInt16 mnOpenId; @@ -110,24 +109,6 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow sal_uInt16 mnMacroId; sal_uInt16 mnPropertyId; - Image maApplyImg; - Image maOpenImg; - Image maSaveAsImg; - Image maSelectImg; - Image maRectImg; - Image maCircleImg; - Image maPolyImg; - Image maFreePolyImg; - Image maPolyEditImg; - Image maPolyMoveImg; - Image maPolyInsertImg; - Image maPolyDeleteImg; - Image maUndoImg; - Image maRedoImg; - Image maActiveImg; - Image maMacroImg; - Image maPropertyImg; - Size aLastSize; IMapWindow* pIMapWnd; IMapOwnData* pOwnData; @@ -172,9 +153,6 @@ public: const TargetList* pTargetList = NULL, void* pEditingObj = NULL ); virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; - - virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; - void ApplyImageList(); }; diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index edcb3ae3e7ef..b85fe015c1d3 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -39,7 +39,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\ svx/source/accessibility/accessibility.src \ svx/source/core/graphichelper.src \ svx/source/dialog/bmpmask.src \ - svx/source/dialog/contdlg.src \ svx/source/dialog/compressgraphicdialog.src \ svx/source/dialog/dlgctrl.src \ svx/source/dialog/docrecovery.src \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index b5db9b0df7e8..f313408bbee4 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/docrecoverysavedialog \ svx/uiconfig/ui/extrustiondepthdialog \ svx/uiconfig/ui/findreplacedialog \ + svx/uiconfig/ui/floatingcontour \ svx/uiconfig/ui/floatingundoredo \ svx/uiconfig/ui/fontworkgallerydialog \ svx/uiconfig/ui/fontworkspacingdialog \ diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index 33fd0a6e68d7..5021cb8c63e4 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -27,22 +27,6 @@ #define HID_BMPMASK_CTL_QCOL_1 "SVX_HID_BMPMASK_CTL_QCOL_1" #define HID_BMPMASK_TBI_PIPETTE "SVX_HID_BMPMASK_TBI_PIPETTE" #define HID_COLOR_CTL_COLORS "SVX_HID_COLOR_CTL_COLORS" -#define HID_CONTDLG_APPLY "SVX_HID_CONTDLG_APPLY" -#define HID_CONTDLG_AUTOCONTOUR "SVX_HID_CONTDLG_AUTOCONTOUR" -#define HID_CONTDLG_CIRCLE "SVX_HID_CONTDLG_CIRCLE" -#define HID_CONTDLG_GRAPHWND "SVX_HID_CONTDLG_GRAPHWND" -#define HID_CONTDLG_PIPETTE "SVX_HID_CONTDLG_PIPETTE" -#define HID_CONTDLG_POLY "SVX_HID_CONTDLG_POLY" -#define HID_CONTDLG_POLYDELETE "SVX_HID_CONTDLG_POLYDELETE" -#define HID_CONTDLG_POLYEDIT "SVX_HID_CONTDLG_POLYEDIT" -#define HID_CONTDLG_POLYINSERT "SVX_HID_CONTDLG_POLYINSERT" -#define HID_CONTDLG_POLYMOVE "SVX_HID_CONTDLG_POLYMOVE" -#define HID_CONTDLG_RECT "SVX_HID_CONTDLG_RECT" -#define HID_CONTDLG_REDO "SVX_HID_CONTDLG_REDO" -#define HID_CONTDLG_SELECT "SVX_HID_CONTDLG_SELECT" -#define HID_CONTDLG_TOOLBOX "SVX_HID_CONTDLG_TOOLBOX" -#define HID_CONTDLG_UNDO "SVX_HID_CONTDLG_UNDO" -#define HID_CONTDLG_WORKPLACE "SVX_HID_CONTDLG_WORKPLACE" #define HID_CTRL3D_HSCROLL "SVX_HID_CTRL3D_HSCROLL" #define HID_CTRL3D_SWITCHER "SVX_HID_CTRL3D_SWITCHER" #define HID_CTRL3D_VSCROLL "SVX_HID_CTRL3D_VSCROLL" diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 349ad07dfa8c..f61f60cde809 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -34,7 +34,6 @@ #include <svx/svxids.hrc> #include <svx/contdlg.hxx> #include "contimp.hxx" -#include "contdlg.hrc" #include "contwnd.hxx" #include <svx/svdtrans.hxx> #include <svx/svdopath.hxx> @@ -68,7 +67,7 @@ SvxContourDlgChildWindow::SvxContourDlgChildWindow( Window* _pParent, sal_uInt16 SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { - SvxSuperContourDlg* pDlg = new SvxSuperContourDlg( pBindings, this, _pParent, CONT_RESID( RID_SVXDLG_CONTOUR ) ); + SvxSuperContourDlg* pDlg = new SvxSuperContourDlg(pBindings, this, _pParent); pWindow = pDlg; if ( pInfo->nFlags & SFX_CHILDWIN_ZOOMIN ) @@ -79,9 +78,10 @@ SvxContourDlgChildWindow::SvxContourDlgChildWindow( Window* _pParent, sal_uInt16 pDlg->Initialize( pInfo ); } -SvxContourDlg::SvxContourDlg( SfxBindings* _pBindings, SfxChildWindow* pCW, - Window* _pParent, const ResId& rResId ) - : SfxFloatingWindow(_pBindings, pCW, _pParent, rResId) +SvxContourDlg::SvxContourDlg(SfxBindings* _pBindings, SfxChildWindow* pCW, + Window* _pParent) + : SfxFloatingWindow(_pBindings, pCW, _pParent , "FloatingContour", + "svx/ui/floatingcontour.ui") , pSuperClass(NULL) { } @@ -198,55 +198,69 @@ void SvxContourDlg::Update( const Graphic& rGraphic, bool bGraphicLinked, pSuperClass->UpdateGraphic( rGraphic, bGraphicLinked, pPolyPoly, pEditingObj ); } -SvxSuperContourDlg::SvxSuperContourDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, - Window* _pParent, const ResId& rResId ) : - SvxContourDlg ( _pBindings, pCW, _pParent, rResId ), +SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, + Window* _pParent) : + SvxContourDlg ( _pBindings, pCW, _pParent ), pUpdateEditingObject( NULL ), pCheckObj ( NULL ), aContourItem ( SID_CONTOUR_EXEC, *this, *_pBindings ), - aTbx1 ( this, ResId( TBX1, *rResId.GetResMgr() ) ), - aMtfTolerance ( this, ResId( MTF_TOLERANCE, *rResId.GetResMgr() ) ), - aContourWnd ( this, ResId( CTL_CONTOUR, *rResId.GetResMgr() ) ), - aStbStatus ( this, WB_BORDER | WB_3DLOOK | WB_LEFT ), nGrfChanged ( 0UL ), bExecState ( false ), bUpdateGraphicLinked( false ), - bGraphicLinked ( false ), - maImageList ( SVX_RES( CD_IMAPDLG ) ) -{ - ApplyImageList(); - - FreeResource(); + bGraphicLinked ( false ) +{ + get(m_pTbx1, "toolbar"); + get(m_pMtfTolerance, "spinbutton"); + m_pContourWnd = new ContourWindow(get<Window>("container"), WB_BORDER); + m_pContourWnd->set_hexpand(true); + m_pContourWnd->set_vexpand(true); + m_pContourWnd->Show(); + get(m_pStbStatus, "statusbar"); + + mnApplyId = m_pTbx1->GetItemId("TBI_APPLY"); + mnWorkSpaceId = m_pTbx1->GetItemId("TBI_WORKPLACE"); + mnSelectId = m_pTbx1->GetItemId("TBI_SELECT"); + mnRectId = m_pTbx1->GetItemId("TBI_RECT"); + mnCircleId = m_pTbx1->GetItemId("TBI_CIRCLE"); + mnPolyId = m_pTbx1->GetItemId("TBI_POLY"); + mnPolyEditId = m_pTbx1->GetItemId("TBI_POLYEDIT"); + mnPolyMoveId = m_pTbx1->GetItemId("TBI_POLYMOVE"); + mnPolyInsertId = m_pTbx1->GetItemId("TBI_POLYINSERT"); + mnPolyDeleteId = m_pTbx1->GetItemId("TBI_POLYDELETE"); + mnAutoContourId = m_pTbx1->GetItemId("TBI_AUTOCONTOUR"); + mnUndoId = m_pTbx1->GetItemId("TBI_UNDO"); + mnRedoId = m_pTbx1->GetItemId("TBI_REDO"); + mnPipetteId = m_pTbx1->GetItemId("TBI_PIPETTE"); SvxContourDlg::SetSuperClass( *this ); - aContourWnd.SetMousePosLink( LINK( this, SvxSuperContourDlg, MousePosHdl ) ); - aContourWnd.SetGraphSizeLink( LINK( this, SvxSuperContourDlg, GraphSizeHdl ) ); - aContourWnd.SetUpdateLink( LINK( this, SvxSuperContourDlg, StateHdl ) ); - aContourWnd.SetPipetteHdl( LINK( this, SvxSuperContourDlg, PipetteHdl ) ); - aContourWnd.SetPipetteClickHdl( LINK( this, SvxSuperContourDlg, PipetteClickHdl ) ); - aContourWnd.SetWorkplaceClickHdl( LINK( this, SvxSuperContourDlg, WorkplaceClickHdl ) ); + m_pContourWnd->SetMousePosLink( LINK( this, SvxSuperContourDlg, MousePosHdl ) ); + m_pContourWnd->SetGraphSizeLink( LINK( this, SvxSuperContourDlg, GraphSizeHdl ) ); + m_pContourWnd->SetUpdateLink( LINK( this, SvxSuperContourDlg, StateHdl ) ); + m_pContourWnd->SetPipetteHdl( LINK( this, SvxSuperContourDlg, PipetteHdl ) ); + m_pContourWnd->SetPipetteClickHdl( LINK( this, SvxSuperContourDlg, PipetteClickHdl ) ); + m_pContourWnd->SetWorkplaceClickHdl( LINK( this, SvxSuperContourDlg, WorkplaceClickHdl ) ); - const Size aTbxSize( aTbx1.CalcWindowSizePixel() ); - Point aPos( aTbx1.GetPosPixel() ); + const Size aTbxSize( m_pTbx1->CalcWindowSizePixel() ); + Point aPos( m_pTbx1->GetPosPixel() ); SvtMiscOptions aMiscOptions; aMiscOptions.AddListenerLink( LINK( this, SvxSuperContourDlg, MiscHdl ) ); - aTbx1.SetOutStyle( aMiscOptions.GetToolboxStyle() ); - aTbx1.SetSizePixel( aTbxSize ); - aTbx1.SetSelectHdl( LINK( this, SvxSuperContourDlg, Tbx1ClickHdl ) ); + m_pTbx1->SetOutStyle( aMiscOptions.GetToolboxStyle() ); + m_pTbx1->SetSizePixel( aTbxSize ); + m_pTbx1->SetSelectHdl( LINK( this, SvxSuperContourDlg, Tbx1ClickHdl ) ); aPos.X() += aTbxSize.Width() + LogicToPixel( Size( 3, 0 ), MapMode( MAP_APPFONT ) ).Width(); - aMtfTolerance.SetPosPixel( aPos ); - aMtfTolerance.SetValue( 10L ); + m_pMtfTolerance->SetPosPixel( aPos ); + m_pMtfTolerance->SetValue( 10L ); SetMinOutputSizePixel( aLastSize = GetOutputSizePixel() ); - aStbStatus.InsertItem( 1, 130, SIB_LEFT | SIB_IN | SIB_AUTOSIZE ); - aStbStatus.InsertItem( 2, 10 + GetTextWidth( OUString(" 9999,99 cm / 9999,99 cm ") ), SIB_CENTER | SIB_IN ); - aStbStatus.InsertItem( 3, 10 + GetTextWidth( OUString(" 9999,99 cm x 9999,99 cm ") ), SIB_CENTER | SIB_IN ); - aStbStatus.InsertItem( 4, 20, SIB_CENTER | SIB_IN ); + m_pStbStatus->InsertItem( 1, 130, SIB_LEFT | SIB_IN | SIB_AUTOSIZE ); + m_pStbStatus->InsertItem( 2, 10 + GetTextWidth( OUString(" 9999,99 cm / 9999,99 cm ") ), SIB_CENTER | SIB_IN ); + m_pStbStatus->InsertItem( 3, 10 + GetTextWidth( OUString(" 9999,99 cm x 9999,99 cm ") ), SIB_CENTER | SIB_IN ); + m_pStbStatus->InsertItem( 4, 20, SIB_CENTER | SIB_IN ); Resize(); @@ -261,38 +275,14 @@ SvxSuperContourDlg::~SvxSuperContourDlg() { SvtMiscOptions aMiscOptions; aMiscOptions.RemoveListenerLink( LINK(this, SvxSuperContourDlg, MiscHdl) ); -} - -void SvxSuperContourDlg::Resize() -{ - SfxFloatingWindow::Resize(); - - Size aMinSize( GetMinOutputSizePixel() ); - Size aNewSize( GetOutputSizePixel() ); - - if ( aNewSize.Height() >= aMinSize.Height() ) - { - Size _aSize( aStbStatus.GetSizePixel() ); - Point aPoint( 0, aNewSize.Height() - _aSize.Height() ); - - // Position the StatusBar - aStbStatus.SetPosSizePixel( aPoint, Size( aNewSize.Width(), _aSize.Height() ) ); - aStbStatus.Show(); - - // Position the EditWindow - _aSize.Width() = aNewSize.Width() - 18; - _aSize.Height() = aPoint.Y() - aContourWnd.GetPosPixel().Y() - 6; - aContourWnd.SetSizePixel( _aSize ); - - aLastSize = aNewSize; - } + delete m_pContourWnd; } bool SvxSuperContourDlg::Close() { bool bRet = true; - if ( aTbx1.IsItemEnabled( TBI_APPLY ) ) + if (m_pTbx1->IsItemEnabled(mnApplyId)) { MessageDialog aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui"); const long nRet = aQBox.Execute(); @@ -322,12 +312,12 @@ void SvxSuperContourDlg::SetGraphic( const Graphic& rGraphic ) aUndoGraphic = aRedoGraphic = Graphic(); aGraphic = rGraphic; nGrfChanged = 0UL; - aContourWnd.SetGraphic( aGraphic ); + m_pContourWnd->SetGraphic( aGraphic ); } void SvxSuperContourDlg::SetPolyPolygon( const PolyPolygon& rPolyPoly ) { - DBG_ASSERT( aContourWnd.GetGraphic().GetType() != GRAPHIC_NONE, "Graphic must've been set first!" ); + DBG_ASSERT( m_pContourWnd->GetGraphic().GetType() != GRAPHIC_NONE, "Graphic must've been set first!" ); PolyPolygon aPolyPoly( rPolyPoly ); const MapMode aMap100( MAP_100TH_MM ); @@ -350,13 +340,13 @@ void SvxSuperContourDlg::SetPolyPolygon( const PolyPolygon& rPolyPoly ) } } - aContourWnd.SetPolyPolygon( aPolyPoly ); - aContourWnd.GetSdrModel()->SetChanged( true ); + m_pContourWnd->SetPolyPolygon( aPolyPoly ); + m_pContourWnd->GetSdrModel()->SetChanged( true ); } PolyPolygon SvxSuperContourDlg::GetPolyPolygon( bool bRescaleToGraphic ) { - PolyPolygon aRetPolyPoly( aContourWnd.GetPolyPolygon() ); + PolyPolygon aRetPolyPoly( m_pContourWnd->GetPolyPolygon() ); if ( bRescaleToGraphic ) { @@ -415,133 +405,103 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx ) { sal_uInt16 nNewItemId = pTbx->GetCurItemId(); - switch( pTbx->GetCurItemId() ) + sal_uInt16 nId = pTbx->GetCurItemId(); + if (nId == mnApplyId) { - case( TBI_APPLY ): - { - SfxBoolItem aBoolItem( SID_CONTOUR_EXEC, true ); - GetBindings().GetDispatcher()->Execute( - SID_CONTOUR_EXEC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aBoolItem, 0L ); - } - break; - - case( TBI_WORKPLACE ): + SfxBoolItem aBoolItem( SID_CONTOUR_EXEC, true ); + GetBindings().GetDispatcher()->Execute( + SID_CONTOUR_EXEC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aBoolItem, 0L ); + } + else if (nId == mnWorkSpaceId) + { + if (m_pTbx1->IsItemChecked(mnWorkSpaceId)) { - if ( aTbx1.IsItemChecked( TBI_WORKPLACE ) ) - { - MessageDialog aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui"); + MessageDialog aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui"); - if ( !aContourWnd.IsContourChanged() || ( aQBox.Execute() == RET_YES ) ) - aContourWnd.SetWorkplaceMode( true ); - else - aTbx1.CheckItem( TBI_WORKPLACE, false ); - } + if ( !m_pContourWnd->IsContourChanged() || ( aQBox.Execute() == RET_YES ) ) + m_pContourWnd->SetWorkplaceMode( true ); else - aContourWnd.SetWorkplaceMode( false ); + m_pTbx1->CheckItem(mnWorkSpaceId, false); } - break; - - case( TBI_SELECT ): - { - pTbx->CheckItem( nNewItemId, true ); - aContourWnd.SetEditMode( true ); - } - break; - - case( TBI_RECT ): - { - pTbx->CheckItem( nNewItemId, true ); - aContourWnd.SetObjKind( OBJ_RECT ); - } - break; - - case( TBI_CIRCLE ): - { - pTbx->CheckItem( nNewItemId, true ); - aContourWnd.SetObjKind( OBJ_CIRC ); - - } - break; - - case( TBI_POLY ): - { - pTbx->CheckItem( nNewItemId, true ); - aContourWnd.SetObjKind( OBJ_POLY ); - } - break; - - case( TBI_FREEPOLY ): - { - pTbx->CheckItem( nNewItemId, true ); - aContourWnd.SetObjKind( OBJ_FREEFILL ); - } - break; - - case( TBI_POLYEDIT ): - aContourWnd.SetPolyEditMode( pTbx->IsItemChecked( TBI_POLYEDIT ) ? SID_BEZIER_MOVE : 0 ); - break; - - case( TBI_POLYMOVE ): - aContourWnd.SetPolyEditMode( SID_BEZIER_MOVE ); - break; - - case( TBI_POLYINSERT ): - aContourWnd.SetPolyEditMode( SID_BEZIER_INSERT ); - break; - - case( TBI_POLYDELETE ): - aContourWnd.GetSdrView()->DeleteMarkedPoints(); - break; - - case( TBI_UNDO ): - { - nGrfChanged = nGrfChanged ? nGrfChanged - 1 : 0UL; - aRedoGraphic = aGraphic; - aGraphic = aUndoGraphic; - aUndoGraphic = Graphic(); - aContourWnd.SetGraphic( aGraphic, false ); - } - break; - - case( TBI_REDO ): - { - nGrfChanged++; - aUndoGraphic = aGraphic; - aGraphic = aRedoGraphic; - aRedoGraphic = Graphic(); - aContourWnd.SetGraphic( aGraphic, false ); - } - break; - - case( TBI_AUTOCONTOUR ): - aCreateTimer.Start(); - break; + else + m_pContourWnd->SetWorkplaceMode( false ); + } + else if (nId == mnSelectId) + { + pTbx->CheckItem( nNewItemId, true ); + m_pContourWnd->SetEditMode( true ); + } + else if (nId == mnRectId) + { + pTbx->CheckItem( nNewItemId, true ); + m_pContourWnd->SetObjKind( OBJ_RECT ); + } + else if (nId == mnCircleId) + { + pTbx->CheckItem( nNewItemId, true ); + m_pContourWnd->SetObjKind( OBJ_CIRC ); + } + else if (nId == mnPolyId) + { + pTbx->CheckItem( nNewItemId, true ); + m_pContourWnd->SetObjKind( OBJ_POLY ); + } + else if (nId == mnPolyEditId) + { + m_pContourWnd->SetPolyEditMode(pTbx->IsItemChecked(mnPolyEditId) ? SID_BEZIER_MOVE : 0); + } + else if (nId == mnPolyMoveId) + { + m_pContourWnd->SetPolyEditMode( SID_BEZIER_MOVE ); + } + else if (nId == mnPolyInsertId) + { + m_pContourWnd->SetPolyEditMode( SID_BEZIER_INSERT ); + } + else if (nId == mnPolyDeleteId) + { + m_pContourWnd->GetSdrView()->DeleteMarkedPoints(); + } + else if (nId == mnUndoId) + { + nGrfChanged = nGrfChanged ? nGrfChanged - 1 : 0UL; + aRedoGraphic = aGraphic; + aGraphic = aUndoGraphic; + aUndoGraphic = Graphic(); + m_pContourWnd->SetGraphic( aGraphic, false ); + } + else if (nId == mnRedoId) + { + nGrfChanged++; + aUndoGraphic = aGraphic; + aGraphic = aRedoGraphic; + aRedoGraphic = Graphic(); + m_pContourWnd->SetGraphic( aGraphic, false ); + } + else if (nId == mnAutoContourId) + { + aCreateTimer.Start(); + } + else if (nId == mnPipetteId) + { + bool bPipette = m_pTbx1->IsItemChecked(mnPipetteId); - case( TBI_PIPETTE ): + if ( !bPipette ) + m_pStbStatus->Invalidate(); + else if ( bGraphicLinked ) { - bool bPipette = aTbx1.IsItemChecked( TBI_PIPETTE ); + MessageDialog aQBox(this, "QueryUnlinkGraphicsDialog", + "svx/ui/queryunlinkgraphicsdialog.ui"); - if ( !bPipette ) - aStbStatus.Invalidate(); - else if ( bGraphicLinked ) + if (aQBox.Execute() != RET_YES) { - MessageDialog aQBox(this, "QueryUnlinkGraphicsDialog", - "svx/ui/queryunlinkgraphicsdialog.ui"); - - if (aQBox.Execute() != RET_YES) - { - bPipette = false; - aTbx1.CheckItem(TBI_PIPETTE, bPipette); - aStbStatus.Invalidate(); - } + bPipette = false; + m_pTbx1->CheckItem(mnPipetteId, bPipette); + m_pStbStatus->Invalidate(); } - - aContourWnd.SetPipetteMode( bPipette ); } - break; - default: - break; + m_pContourWnd->SetPipetteMode( bPipette ); } return 0L; @@ -559,7 +519,7 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) aStr += " / "; aStr += GetUnitString( rMousePos.Y(), eFieldUnit, cSep ); - aStbStatus.SetItemText( 2, aStr ); + m_pStbStatus->SetItemText( 2, aStr ); return 0L; } @@ -576,7 +536,7 @@ IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd ) aStr += " x "; aStr += GetUnitString( rSize.Height(), eFieldUnit, cSep ); - aStbStatus.SetItemText( 3, aStr ); + m_pStbStatus->SetItemText( 3, aStr ); return 0L; } @@ -588,7 +548,7 @@ IMPL_LINK_NOARG(SvxSuperContourDlg, UpdateHdl) if ( pUpdateEditingObject != pCheckObj ) { if( !GetEditingObject() ) - aContourWnd.GrabFocus(); + m_pContourWnd->GrabFocus(); SetGraphic( aUpdateGraphic ); SetPolyPolygon( aUpdatePolyPoly ); @@ -599,7 +559,7 @@ IMPL_LINK_NOARG(SvxSuperContourDlg, UpdateHdl) aUpdatePolyPoly = PolyPolygon(); bUpdateGraphicLinked = false; - aContourWnd.GetSdrModel()->SetChanged( false ); + m_pContourWnd->GetSdrModel()->SetChanged( false ); } GetBindings().Invalidate( SID_CONTOUR_EXEC ); @@ -611,8 +571,8 @@ IMPL_LINK_NOARG(SvxSuperContourDlg, CreateHdl) { aCreateTimer.Stop(); - const Rectangle aWorkRect = aContourWnd.LogicToPixel( aContourWnd.GetWorkRect(), MapMode( MAP_100TH_MM ) ); - const Graphic& rGraphic = aContourWnd.GetGraphic(); + const Rectangle aWorkRect = m_pContourWnd->LogicToPixel( m_pContourWnd->GetWorkRect(), MapMode( MAP_100TH_MM ) ); + const Graphic& rGraphic = m_pContourWnd->GetGraphic(); const bool bValid = aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom(); EnterWait(); @@ -627,32 +587,31 @@ IMPL_LINK( SvxSuperContourDlg, StateHdl, ContourWindow*, pWnd ) const SdrObject* pObj = pWnd->GetSelectedSdrObject(); const SdrView* pView = pWnd->GetSdrView(); const bool bPolyEdit = ( pObj != NULL ) && pObj->ISA( SdrPathObj ); - const bool bDrawEnabled = !( bPolyEdit && aTbx1.IsItemChecked( TBI_POLYEDIT ) ); - const bool bPipette = aTbx1.IsItemChecked( TBI_PIPETTE ); - const bool bWorkplace = aTbx1.IsItemChecked( TBI_WORKPLACE ); + const bool bDrawEnabled = !(bPolyEdit && m_pTbx1->IsItemChecked(mnPolyEditId)); + const bool bPipette = m_pTbx1->IsItemChecked(mnPipetteId); + const bool bWorkplace = m_pTbx1->IsItemChecked(mnWorkSpaceId); const bool bDontHide = !( bPipette || bWorkplace ); const bool bBitmap = pWnd->GetGraphic().GetType() == GRAPHIC_BITMAP; - aTbx1.EnableItem( TBI_APPLY, bDontHide && bExecState && pWnd->IsChanged() ); + m_pTbx1->EnableItem(mnApplyId, bDontHide && bExecState && pWnd->IsChanged()); - aTbx1.EnableItem( TBI_WORKPLACE, !bPipette && bDrawEnabled ); + m_pTbx1->EnableItem(mnWorkSpaceId, !bPipette && bDrawEnabled); - aTbx1.EnableItem( TBI_SELECT, bDontHide && bDrawEnabled ); - aTbx1.EnableItem( TBI_RECT, bDontHide && bDrawEnabled ); - aTbx1.EnableItem( TBI_CIRCLE, bDontHide && bDrawEnabled ); - aTbx1.EnableItem( TBI_POLY, bDontHide && bDrawEnabled ); - aTbx1.EnableItem( TBI_FREEPOLY, bDontHide && bDrawEnabled ); + m_pTbx1->EnableItem(mnSelectId, bDontHide && bDrawEnabled); + m_pTbx1->EnableItem(mnRectId, bDontHide && bDrawEnabled); + m_pTbx1->EnableItem(mnCircleId, bDontHide && bDrawEnabled); + m_pTbx1->EnableItem(mnPolyId, bDontHide && bDrawEnabled); - aTbx1.EnableItem( TBI_POLYEDIT, bDontHide && bPolyEdit ); - aTbx1.EnableItem( TBI_POLYMOVE, bDontHide && !bDrawEnabled ); - aTbx1.EnableItem( TBI_POLYINSERT, bDontHide && !bDrawEnabled ); - aTbx1.EnableItem( TBI_POLYDELETE, bDontHide && !bDrawEnabled && pView->IsDeleteMarkedPointsPossible() ); + m_pTbx1->EnableItem(mnPolyEditId, bDontHide && bPolyEdit); + m_pTbx1->EnableItem(mnPolyMoveId, bDontHide && !bDrawEnabled); + m_pTbx1->EnableItem(mnPolyInsertId, bDontHide && !bDrawEnabled); + m_pTbx1->EnableItem(mnPolyDeleteId, bDontHide && !bDrawEnabled && pView->IsDeleteMarkedPointsPossible()); - aTbx1.EnableItem( TBI_AUTOCONTOUR, bDontHide && bDrawEnabled ); - aTbx1.EnableItem( TBI_PIPETTE, !bWorkplace && bDrawEnabled && bBitmap ); + m_pTbx1->EnableItem(mnAutoContourId, bDontHide && bDrawEnabled); + m_pTbx1->EnableItem(mnPipetteId, !bWorkplace && bDrawEnabled && bBitmap); - aTbx1.EnableItem( TBI_UNDO, bDontHide && IsUndoPossible() ); - aTbx1.EnableItem( TBI_REDO, bDontHide && IsRedoPossible() ); + m_pTbx1->EnableItem(mnUndoId, bDontHide && IsUndoPossible()); + m_pTbx1->EnableItem(mnRedoId, bDontHide && IsRedoPossible()); if ( bPolyEdit ) { @@ -660,20 +619,20 @@ IMPL_LINK( SvxSuperContourDlg, StateHdl, ContourWindow*, pWnd ) switch( pWnd->GetPolyEditMode() ) { - case( SID_BEZIER_MOVE ): nId = TBI_POLYMOVE; break; - case( SID_BEZIER_INSERT ): nId = TBI_POLYINSERT; break; + case( SID_BEZIER_MOVE ): nId = mnPolyMoveId; break; + case( SID_BEZIER_INSERT ): nId = mnPolyInsertId; break; default: break; } - aTbx1.CheckItem( nId, true ); + m_pTbx1->CheckItem( nId, true ); } else { - aTbx1.CheckItem( TBI_POLYEDIT, false ); - aTbx1.CheckItem( TBI_POLYMOVE, true ); - aTbx1.CheckItem( TBI_POLYINSERT, false ); + m_pTbx1->CheckItem(mnPolyEditId, false); + m_pTbx1->CheckItem(mnPolyMoveId, true); + m_pTbx1->CheckItem(mnPolyInsertId, false); pWnd->SetPolyEditMode( 0 ); } @@ -682,24 +641,24 @@ IMPL_LINK( SvxSuperContourDlg, StateHdl, ContourWindow*, pWnd ) IMPL_LINK( SvxSuperContourDlg, PipetteHdl, ContourWindow*, pWnd ) { - const Color& rOldLineColor = aStbStatus.GetLineColor(); - const Color& rOldFillColor = aStbStatus.GetFillColor(); + const Color& rOldLineColor = m_pStbStatus->GetLineColor(); + const Color& rOldFillColor = m_pStbStatus->GetFillColor(); - Rectangle aRect( aStbStatus.GetItemRect( 4 ) ); + Rectangle aRect( m_pStbStatus->GetItemRect( 4 ) ); const Color& rColor = pWnd->GetPipetteColor(); - aStbStatus.SetLineColor( rColor ); - aStbStatus.SetFillColor( rColor ); + m_pStbStatus->SetLineColor( rColor ); + m_pStbStatus->SetFillColor( rColor ); aRect.Left() += 4; aRect.Top() += 4; aRect.Right() -= 4; aRect.Bottom() -= 4; - aStbStatus.DrawRect( aRect ); + m_pStbStatus->DrawRect( aRect ); - aStbStatus.SetLineColor( rOldLineColor ); - aStbStatus.SetFillColor( rOldFillColor ); + m_pStbStatus->SetLineColor( rOldLineColor ); + m_pStbStatus->SetFillColor( rOldFillColor ); return 0L; } @@ -716,7 +675,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd ) if( aGraphic.GetType() == GRAPHIC_BITMAP ) { Bitmap aBmp( aGraphic.GetBitmap() ); - const long nTol = static_cast<long>(aMtfTolerance.GetValue() * 255L / 100L); + const long nTol = static_cast<long>(m_pMtfTolerance->GetValue() * 255L / 100L); aMask = aBmp.CreateMask( rColor, nTol ); @@ -744,41 +703,26 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd ) LeaveWait(); } - aTbx1.CheckItem( TBI_PIPETTE, false ); + m_pTbx1->CheckItem(mnPipetteId, false); pWnd->SetPipetteMode( false ); - aStbStatus.Invalidate(); + m_pStbStatus->Invalidate(); return 0L; } IMPL_LINK( SvxSuperContourDlg, WorkplaceClickHdl, ContourWindow*, pWnd ) { - aTbx1.CheckItem( TBI_WORKPLACE, false ); - aTbx1.CheckItem( TBI_SELECT, true ); + m_pTbx1->CheckItem(mnWorkSpaceId, false); + m_pTbx1->CheckItem(mnSelectId, true); pWnd->SetWorkplaceMode( false ); return 0L; } -void SvxSuperContourDlg::ApplyImageList() -{ - ImageList& rImgLst = maImageList; - - aTbx1.SetImageList( rImgLst ); -} - -void SvxSuperContourDlg::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxFloatingWindow::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - ApplyImageList(); -} - IMPL_LINK_NOARG(SvxSuperContourDlg, MiscHdl) { SvtMiscOptions aMiscOptions; - aTbx1.SetOutStyle( aMiscOptions.GetToolboxStyle() ); + m_pTbx1->SetOutStyle( aMiscOptions.GetToolboxStyle() ); return 0L; } diff --git a/svx/source/dialog/contdlg.hrc b/svx/source/dialog/contdlg.hrc deleted file mode 100644 index cae14d19a6e8..000000000000 --- a/svx/source/dialog/contdlg.hrc +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#include <svx/dialogs.hrc> - -// ImapDlg dialog -#define RID_SVX_CONTOURDLG_START RID_SVX_CONTOUR_START - -/******************************************************************************/ - -#define RID_SVXDLG_CONTOUR (RID_SVX_CONTOURDLG_START) - -#define TBX1 1 -#define TBI_APPLY 1 - -#define TBI_WORKPLACE 2 - -#define TBI_SELECT 5 -#define TBI_RECT 6 -#define TBI_CIRCLE 7 -#define TBI_POLY 8 -#define TBI_FREEPOLY 9 - -#define TBI_POLYEDIT 15 -#define TBI_POLYMOVE 16 -#define TBI_POLYINSERT 17 -#define TBI_POLYDELETE 18 - -#define TBI_UNDO 20 -#define TBI_REDO 21 - -#define TBI_AUTOCONTOUR 25 -#define TBI_PIPETTE 26 - -#define MTF_TOLERANCE 1 - -#define CTL_CONTOUR 1 - -#define STB_STATUS 1 - -#define CD_IMAPDLG 1300 - -/******************************************************************************/ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/contdlg.src b/svx/source/dialog/contdlg.src deleted file mode 100644 index e3dd2dc4d576..000000000000 --- a/svx/source/dialog/contdlg.src +++ /dev/null @@ -1,222 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "helpid.hrc" -#include "contdlg.hrc" - -#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } ; - - // RID_SVXDLG_CONTOUR ---------------------------------------------------- -FloatingWindow RID_SVXDLG_CONTOUR -{ - HelpID = "svx:FloatingWindow:RID_SVXDLG_CONTOUR"; - OutputSize = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 270 , 213 ) ; - Text [ en-US ] = "Contour Editor" ; - Sizeable = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - ToolBox TBX1 - { - SVLook = TRUE ; - Pos = MAP_APPFONT ( 6 , 6 ) ; - HelpId = HID_CONTDLG_TOOLBOX ; - ItemList = - { - ToolBoxItem - { - Identifier = TBI_APPLY ; - HelpId = HID_CONTDLG_APPLY ; - Text [ en-US ] = "Apply" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = TBI_WORKPLACE ; - HelpId = HID_CONTDLG_WORKPLACE ; - Text [ en-US ] = "Workspace" ; - AutoCheck = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = TBI_SELECT ; - HelpId = HID_CONTDLG_SELECT ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - Text [ en-US ] = "Select" ; - }; - ToolBoxItem - { - Identifier = TBI_RECT ; - HelpId = HID_CONTDLG_RECT ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - Text [ en-US ] = "Rectangle" ; - }; - ToolBoxItem - { - Identifier = TBI_CIRCLE ; - HelpId = HID_CONTDLG_CIRCLE ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - Text [ en-US ] = "Ellipse" ; - }; - ToolBoxItem - { - Identifier = TBI_POLY ; - HelpId = HID_CONTDLG_POLY ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - Text [ en-US ] = "Polygon" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = TBI_POLYEDIT ; - HelpId = HID_CONTDLG_POLYEDIT ; - Text [ en-US ] = "Edit Points" ; - AutoCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = TBI_POLYMOVE ; - HelpId = HID_CONTDLG_POLYMOVE ; - Text [ en-US ] = "Move Points" ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = TBI_POLYINSERT ; - HelpId = HID_CONTDLG_POLYINSERT ; - Text [ en-US ] = "Insert Points" ; - RadioCheck = TRUE ; - AutoCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = TBI_POLYDELETE ; - HelpId = HID_CONTDLG_POLYDELETE ; - Text [ en-US ] = "Delete Points" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = TBI_AUTOCONTOUR ; - HelpId = HID_CONTDLG_AUTOCONTOUR ; - Text [ en-US ] = "AutoContour" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = TBI_UNDO ; - HelpId = HID_CONTDLG_UNDO ; - - Text [ en-US ] = "Undo " ; - }; - ToolBoxItem - { - Identifier = TBI_REDO ; - HelpId = HID_CONTDLG_REDO ; - - Text [ en-US ] = "Redo " ; - }; - ToolBoxItem - { - Identifier = TBI_PIPETTE ; - HelpId = HID_CONTDLG_PIPETTE ; - Text [ en-US ] = "Pipette" ; - AutoCheck = TRUE ; - }; - }; - }; - MetricField MTF_TOLERANCE - { - HelpID = "svx:MetricField:RID_SVXDLG_CONTOUR:MTF_TOLERANCE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 28 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - Last = 99 ; - SpinSize = 1 ; - Unit = FUNIT_PERCENT ; - QuickHelpText [ en-US ] = "Color Tolerance" ; - }; - Control CTL_CONTOUR - { - Border = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 6 , 24 ) ; - HelpId = HID_CONTDLG_GRAPHWND ; - }; - -#define CONTOURDLG_IDLIST \ - IdList = \ - { \ - TBI_APPLY ; \ - TBI_WORKPLACE ; \ - TBI_SELECT ; \ - TBI_RECT ; \ - TBI_CIRCLE ; \ - TBI_POLY ; \ - TBI_POLYEDIT ; \ - TBI_POLYMOVE ; \ - TBI_POLYINSERT ; \ - TBI_POLYDELETE ; \ - TBI_AUTOCONTOUR ; \ - TBI_UNDO ; \ - TBI_REDO ; \ - TBI_PIPETTE ; \ - }; \ - IdCount = { 14 ; }; - - ImageList CD_IMAPDLG - { - Prefix = "cd"; - MASKCOLOR - CONTOURDLG_IDLIST - }; -}; - -/******************************************************************************/ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx index 2bdbd53d3a3e..e7cc1dac7d87 100644 --- a/svx/source/dialog/contimp.hxx +++ b/svx/source/dialog/contimp.hxx @@ -41,17 +41,30 @@ class SvxSuperContourDlg : public SvxContourDlg void* pUpdateEditingObject; void* pCheckObj; SvxContourDlgItem aContourItem; - ToolBox aTbx1; - MetricField aMtfTolerance; - ContourWindow aContourWnd; - StatusBar aStbStatus; - sal_uIntPtr nGrfChanged; + ToolBox* m_pTbx1; + MetricField* m_pMtfTolerance; + ContourWindow* m_pContourWnd; + StatusBar* m_pStbStatus; + sal_uIntPtr nGrfChanged; bool bExecState; bool bUpdateGraphicLinked; bool bGraphicLinked; - ImageList maImageList; - virtual void Resize() SAL_OVERRIDE; + sal_uInt16 mnApplyId; + sal_uInt16 mnWorkSpaceId; + sal_uInt16 mnSelectId; + sal_uInt16 mnRectId; + sal_uInt16 mnCircleId; + sal_uInt16 mnPolyId; + sal_uInt16 mnPolyEditId; + sal_uInt16 mnPolyMoveId; + sal_uInt16 mnPolyInsertId; + sal_uInt16 mnPolyDeleteId; + sal_uInt16 mnAutoContourId; + sal_uInt16 mnUndoId; + sal_uInt16 mnRedoId; + sal_uInt16 mnPipetteId; + virtual bool Close() SAL_OVERRIDE; DECL_LINK( Tbx1ClickHdl, ToolBox* ); @@ -67,8 +80,8 @@ class SvxSuperContourDlg : public SvxContourDlg public: - SvxSuperContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW, - Window* pParent, const ResId& rResId ); + SvxSuperContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW, + Window* pParent); virtual ~SvxSuperContourDlg(); void SetExecState( bool bEnable ); @@ -90,14 +103,6 @@ public: void UpdateGraphic( const Graphic& rGraphic, bool bGraphicLinked, const PolyPolygon* pPolyPoly = NULL, void* pEditingObj = NULL ); - - /** switches the toolbox images depending on the actuall high contrast display mode state */ - void ApplyImageList(); - - /** virtual method from Window is used to detect change in high contrast display mode - to switch the toolbox images */ - virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; - }; diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index d1765f6ee936..6289f3db1e75 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -20,7 +20,6 @@ #include <svx/xoutbmp.hxx> #include <svx/dialogs.hrc> #include <svx/svxids.hrc> -#include <contdlg.hrc> #include <contwnd.hxx> #include <svx/svdpage.hxx> #include <svx/svdopath.hxx> @@ -34,8 +33,8 @@ using namespace com::sun::star; #define TRANSCOL Color( COL_WHITE ) -ContourWindow::ContourWindow( Window* pParent, const ResId& rResId ) : - GraphCtrl ( pParent, rResId ), +ContourWindow::ContourWindow( Window* pParent, WinBits nBits ) : + GraphCtrl ( pParent, nBits ), aWorkRect ( 0, 0, 0, 0 ), bPipetteMode ( false ), bWorkplaceMode ( false ), @@ -267,4 +266,9 @@ void ContourWindow::Paint( const Rectangle& rRect ) pView->EndCompleteRedraw(*pPaintWindow, true); } +Size ContourWindow::GetOptimalSize() const +{ + return LogicToPixel(Size(270, 170), MAP_APPFONT); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/contwnd.hxx b/svx/source/dialog/contwnd.hxx index c9839dae3299..e92f45bd93e9 100644 --- a/svx/source/dialog/contwnd.hxx +++ b/svx/source/dialog/contwnd.hxx @@ -43,13 +43,14 @@ protected: virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE; virtual void InitSdrModel() SAL_OVERRIDE; virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; + virtual Size GetOptimalSize() const SAL_OVERRIDE; void CreatePolyPolygon(); public: - ContourWindow( Window* pParent, const ResId& rResId ); - virtual ~ContourWindow(); + ContourWindow(Window* pParent, WinBits nBits); + virtual ~ContourWindow(); void SetPolyPolygon( const PolyPolygon& rPolyPoly ); const PolyPolygon& GetPolyPolygon(); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index f11e6892db23..03ba7aebb062 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -53,26 +53,6 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c } } -GraphCtrl::GraphCtrl( Window* pParent, const ResId& rResId ) : - Control ( pParent, rResId ), - aMap100 ( MAP_100TH_MM ), - nWinStyle ( 0 ), - eObjKind ( OBJ_NONE ), - nPolyEdit ( 0 ), - bEditMode ( false ), - bSdrMode ( false ), - bAnim ( false ), - mpAccContext ( NULL ), - pModel ( NULL ), - pView ( NULL ) -{ - pUserCall = new GraphCtrlUserCall( *this ); - aUpdateTimer.SetTimeout( 500 ); - aUpdateTimer.SetTimeoutHdl( LINK( this, GraphCtrl, UpdateHdl ) ); - aUpdateTimer.Start(); - EnableRTL( false ); -} - GraphCtrl::GraphCtrl( Window* pParent, WinBits nStyle ) : Control ( pParent, nStyle ), aMap100 ( MAP_100TH_MM ), diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 416faa608bc6..5deb794ed74c 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -124,7 +124,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStatusBar(Window *pParent, SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, Window* _pParent) : SfxModelessDialog(_pBindings, pCW, _pParent, "ImapDialog", "svx/ui/imapdialog.ui") - , maImageList(SVX_RES(IL_IMAPDLG)) , pCheckObj(NULL) , aIMapItem(SID_IMAP_EXEC, *this, *_pBindings) { @@ -152,24 +151,6 @@ SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, Window* _pP mnMacroId = m_pTbxIMapDlg1->GetItemId("TBI_MACRO"); mnPropertyId = m_pTbxIMapDlg1->GetItemId("TBI_PROPERTY"); - maApplyImg = maImageList.GetImage(TBI_APPLY); - maOpenImg = maImageList.GetImage(TBI_OPEN); - maSaveAsImg = maImageList.GetImage(TBI_SAVEAS); - maSelectImg = maImageList.GetImage(TBI_SELECT); - maRectImg = maImageList.GetImage(TBI_RECT); - maCircleImg = maImageList.GetImage(TBI_CIRCLE); - maPolyImg = maImageList.GetImage(TBI_POLY); - maFreePolyImg = maImageList.GetImage(TBI_FREEPOLY); - maPolyEditImg = maImageList.GetImage(TBI_POLYEDIT); - maPolyMoveImg = maImageList.GetImage(TBI_POLYMOVE); - maPolyInsertImg = maImageList.GetImage(TBI_POLYINSERT); - maPolyDeleteImg = maImageList.GetImage(TBI_POLYDELETE); - maUndoImg = maImageList.GetImage(TBI_UNDO); - maRedoImg = maImageList.GetImage(TBI_REDO); - maActiveImg = maImageList.GetImage(TBI_ACTIVE); - maMacroImg = maImageList.GetImage(TBI_MACRO); - maPropertyImg = maImageList.GetImage(TBI_PROPERTY); - get(m_pFtURL, "urlft"); get(m_pURLBox, "url"); get(m_pFtText, "textft"); @@ -195,8 +176,6 @@ SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, Window* _pP pIMapWnd->set_vexpand(true); pIMapWnd->Show(); - ApplyImageList(); - pOwnData = new IMapOwnData; pIMapWnd->SetInfoLink( LINK( this, SvxIMapDlg, InfoHdl ) ); @@ -797,33 +776,4 @@ IMPL_LINK_NOARG(SvxIMapDlg, MiscHdl) return 0L; } -void SvxIMapDlg::ApplyImageList() -{ - m_pTbxIMapDlg1->SetItemImage(mnApplyId, maApplyImg); - m_pTbxIMapDlg1->SetItemImage(mnOpenId, maOpenImg); - m_pTbxIMapDlg1->SetItemImage(mnSaveAsId, maSaveAsImg); - m_pTbxIMapDlg1->SetItemImage(mnSelectId, maSelectImg); - m_pTbxIMapDlg1->SetItemImage(mnRectId, maRectImg); - m_pTbxIMapDlg1->SetItemImage(mnCircleId, maCircleImg); - m_pTbxIMapDlg1->SetItemImage(mnPolyId, maPolyImg); - m_pTbxIMapDlg1->SetItemImage(mnFreePolyId, maFreePolyImg); - m_pTbxIMapDlg1->SetItemImage(mnPolyEditId, maPolyEditImg); - m_pTbxIMapDlg1->SetItemImage(mnPolyMoveId, maPolyMoveImg); - m_pTbxIMapDlg1->SetItemImage(mnPolyInsertId, maPolyInsertImg); - m_pTbxIMapDlg1->SetItemImage(mnPolyDeleteId, maPolyDeleteImg); - m_pTbxIMapDlg1->SetItemImage(mnUndoId, maUndoImg); - m_pTbxIMapDlg1->SetItemImage(mnRedoId, maRedoImg); - m_pTbxIMapDlg1->SetItemImage(mnActiveId, maActiveImg); - m_pTbxIMapDlg1->SetItemImage(mnMacroId, maMacroImg); - m_pTbxIMapDlg1->SetItemImage(mnPropertyId, maPropertyImg); -} - -void SvxIMapDlg::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxModelessDialog::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - ApplyImageList(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/floatingcontour.ui b/svx/uiconfig/ui/floatingcontour.ui new file mode 100644 index 000000000000..2edef2280ff0 --- /dev/null +++ b/svx/uiconfig/ui/floatingcontour.ui @@ -0,0 +1,359 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">99</property> + <property name="value">10</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkWindow" id="FloatingContour"> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Contour Editor</property> + <child> + <object class="GtkBox" id="mainbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="hexpand">True</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkToolbar" id="toolbar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="toolbar_style">icons</property> + <child> + <object class="GtkToolButton" id="TBI_APPLY"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_APPLY</property> + <property name="label" translatable="yes">Apply</property> + <property name="icon_name">svx/res/cd01.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_WORKPLACE"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_WORKPLACE</property> + <property name="label" translatable="yes">Workspace</property> + <property name="icon_name">svx/res/cd02.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_SELECT"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_SELECT</property> + <property name="label" translatable="yes">Select</property> + <property name="icon_name">svx/res/cd05.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_RECT"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_RECT</property> + <property name="label" translatable="yes">Rectangle</property> + <property name="icon_name">svx/res/cd06.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_CIRCLE"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_CIRCLE</property> + <property name="label" translatable="yes">Ellipse</property> + <property name="icon_name">svx/res/cd07.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_POLY"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_POLY</property> + <property name="label" translatable="yes">Polygon</property> + <property name="icon_name">svx/res/cd08.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_POLYEDIT"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_POLYEDIT</property> + <property name="label" translatable="yes">Edit Points</property> + <property name="icon_name">svx/res/cd015.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_POLYMOVE"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_POLYMOVE</property> + <property name="label" translatable="yes">Move Points</property> + <property name="icon_name">svx/res/cd016.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_POLYINSERT"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_POLYINSERT</property> + <property name="label" translatable="yes">Insert Points</property> + <property name="icon_name">svx/res/cd017.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_POLYDELETE"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_POLYDELETE</property> + <property name="label" translatable="yes">Delete Points</property> + <property name="icon_name">svx/res/cd018.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_AUTOCONTOUR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="action_name">TBI_AUTOCONTOUR</property> + <property name="label" translatable="yes">AutoContour</property> + <property name="use_underline">True</property> + <property name="icon_name">svx/res/cd025.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_UNDO"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_UNDO</property> + <property name="label" translatable="yes">Undo </property> + <property name="icon_name">svx/res/cd020.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_REDO"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_REDO</property> + <property name="label" translatable="yes">Redo</property> + <property name="icon_name">svx/res/cd021.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="TBI_PIPETTE"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="action_name">TBI_PIPETTE</property> + <property name="label" translatable="yes">Pipette</property> + <property name="icon_name">svx/res/cd026.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spinbutton:0%"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="container"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="svxlo-StatusBar" id="statusbar"> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> +</interface> |