From 2dec3d1d4f3e91ce005bb3b5362b826e7c7590c8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 Nov 2013 12:49:18 +0000 Subject: convert 500th dialog (vectorize) to .ui Change-Id: Ib1a8716091a16eb970c9f218f4a8e496de72ff51 --- extras/source/glade/libreoffice-catalog.xml.in | 3 + include/svx/graphctl.hxx | 1 + sd/AllLangResTarget_sd.mk | 1 - sd/UIConfig_sdraw.mk | 1 + sd/inc/helpids.h | 2 - sd/source/ui/dlg/vectdlg.cxx | 114 ++++---- sd/source/ui/dlg/vectdlg.src | 206 ------------- sd/source/ui/inc/vectdlg.hrc | 47 --- sd/source/ui/inc/vectdlg.hxx | 36 +-- sd/uiconfig/sdraw/ui/vectorize.ui | 383 +++++++++++++++++++++++++ svx/source/dialog/graphctl.cxx | 29 ++ 11 files changed, 486 insertions(+), 337 deletions(-) delete mode 100644 sd/source/ui/dlg/vectdlg.src delete mode 100644 sd/source/ui/inc/vectdlg.hrc create mode 100644 sd/uiconfig/sdraw/ui/vectorize.ui diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 83946db41228..a9c74e6d96b2 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -353,6 +353,9 @@ + diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx index 26fca7eb507b..ee183bbb8dd8 100644 --- a/include/svx/graphctl.hxx +++ b/include/svx/graphctl.hxx @@ -81,6 +81,7 @@ protected: public: GraphCtrl( Window* pParent, const ResId& rResId ); + GraphCtrl( Window* pParent, WinBits nStyle ); ~GraphCtrl(); void SetWinStyle( WinBits nWinBits ); diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk index 45d874e5efa2..8385a4913428 100644 --- a/sd/AllLangResTarget_sd.mk +++ b/sd/AllLangResTarget_sd.mk @@ -49,7 +49,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\ sd/source/ui/dlg/PaneDockingWindow.src \ sd/source/ui/dlg/sdpreslt.src \ sd/source/ui/dlg/tpaction.src \ - sd/source/ui/dlg/vectdlg.src \ sd/source/ui/slideshow/slideshow.src \ sd/source/ui/view/DocumentRenderer.src \ )) diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index 228a4d7173c0..5f8ce2280289 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -81,6 +81,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\ sd/uiconfig/sdraw/ui/paranumberingtab \ sd/uiconfig/sdraw/ui/printeroptions \ sd/uiconfig/sdraw/ui/tabledesigndialog \ + sd/uiconfig/sdraw/ui/vectorize \ )) # vim: set noet sw=4 ts=4: diff --git a/sd/inc/helpids.h b/sd/inc/helpids.h index 1bab9f85ecca..ff670351da46 100644 --- a/sd/inc/helpids.h +++ b/sd/inc/helpids.h @@ -155,8 +155,6 @@ #define HID_SD_TABLE_DESIGN "SD_HID_SD_TABLE_DESIGN" #define HID_SD_ANNOTATIONS "SD_HID_SD_ANNOTATIONS" -#define HID_VECTORIZE_DLG "SD_HID_VECTORIZE_DLG" - #define HID_MN_SUB_GRAPHIC "SD_HID_MN_SUB_GRAPHIC" #define HID_MN_SUB_FIELD "SD_HID_MN_SUB_FIELD" #define HID_MN_SUB_TEMPLATES "SD_HID_MN_SUB_TEMPLATES" diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index de8ce7c2a0b0..5abbec90594d 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -26,49 +26,45 @@ #include "sdmod.hxx" #include "sdiocmpt.hxx" #include "vectdlg.hxx" -#include "vectdlg.hrc" #include #include #include #define VECTORIZE_MAX_EXTENT 512 -SdVectorizeDlg::SdVectorizeDlg( - Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell ) : - ModalDialog ( pParent, SdResId( DLG_VECTORIZE ) ), - mpDocSh ( pDocShell ), - aGrpSettings ( this, SdResId( GRP_SETTINGS ) ), - aFtLayers ( this, SdResId( FT_LAYERS ) ), - aNmLayers ( this, SdResId( NM_LAYERS ) ), - aFtReduce ( this, SdResId( FT_REDUCE ) ), - aMtReduce ( this, SdResId( MT_REDUCE ) ), - aFtFillHoles ( this, SdResId( FT_FILLHOLES ) ), - aMtFillHoles ( this, SdResId( MT_FILLHOLES ) ), - aCbFillHoles ( this, SdResId( CB_FILLHOLES ) ), - aFtOriginal ( this, SdResId( FT_ORIGINAL ) ), - aBmpWin ( this, SdResId( CTL_BMP ) ), - aFtVectorized ( this, SdResId( FT_VECTORIZED ) ), - aMtfWin ( this, SdResId( CTL_WMF ) ), - aGrpPrgs ( this, SdResId( GRP_PRGS ) ), - aPrgs ( this, SdResId( WND_PRGS ) ), - aBtnOK ( this, SdResId( BTN_OK ) ), - aBtnCancel ( this, SdResId( BTN_CANCEL ) ), - aBtnHelp ( this, SdResId( BTN_HELP ) ), - aBtnPreview ( this, SdResId( BTN_PREVIEW ) ), - aBmp ( rBmp ) +SdVectorizeDlg::SdVectorizeDlg(Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) + : ModalDialog(pParent, "VectorizeDialog", "modules/sdraw/ui/vectorize.ui") + , mpDocSh(pDocShell) + , aBmp(rBmp) { - FreeResource(); - - aBtnPreview.SetClickHdl( LINK( this, SdVectorizeDlg, ClickPreviewHdl ) ); - aBtnOK.SetClickHdl( LINK( this, SdVectorizeDlg, ClickOKHdl ) ); - aNmLayers.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); - aMtReduce.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); - aMtFillHoles.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); - aCbFillHoles.SetToggleHdl( LINK( this, SdVectorizeDlg, ToggleHdl ) ); + get(m_pNmLayers, "colors"); + get(m_pMtReduce, "points"); + get(m_pCbFillHoles, "fillholes"); + get(m_pFtFillHoles, "tilesft"); + get(m_pMtFillHoles, "tiles"); + get(m_pBmpWin, "source"); + get(m_pMtfWin, "vectorized"); + + Size aSize(LogicToPixel(Size(92, 100), MAP_APPFONT)); + m_pBmpWin->set_width_request(aSize.Width()); + m_pMtfWin->set_width_request(aSize.Width()); + m_pBmpWin->set_height_request(aSize.Height()); + m_pMtfWin->set_height_request(aSize.Height()); + + get(m_pPrgs, "progressbar"); + get(m_pBtnPreview, "preview"); + get(m_pBtnOK, "ok"); + + m_pBtnPreview->SetClickHdl( LINK( this, SdVectorizeDlg, ClickPreviewHdl ) ); + m_pBtnOK->SetClickHdl( LINK( this, SdVectorizeDlg, ClickOKHdl ) ); + m_pNmLayers->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); + m_pMtReduce->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); + m_pMtFillHoles->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) ); + m_pCbFillHoles->SetToggleHdl( LINK( this, SdVectorizeDlg, ToggleHdl ) ); // disable 3D border - aBmpWin.SetBorderStyle(WINDOW_BORDER_MONO); - aMtfWin.SetBorderStyle(WINDOW_BORDER_MONO); + m_pBmpWin->SetBorderStyle(WINDOW_BORDER_MONO); + m_pMtfWin->SetBorderStyle(WINDOW_BORDER_MONO); LoadSettings(); InitPreviewBmp(); @@ -110,11 +106,11 @@ Rectangle SdVectorizeDlg::GetRect( const Size& rDispSize, const Size& rBmpSize ) void SdVectorizeDlg::InitPreviewBmp() { - const Rectangle aRect( GetRect( aBmpWin.GetSizePixel(), aBmp.GetSizePixel() ) ); + const Rectangle aRect( GetRect( m_pBmpWin->GetSizePixel(), aBmp.GetSizePixel() ) ); aPreviewBmp = aBmp; aPreviewBmp.Scale( aRect.GetSize() ); - aBmpWin.SetGraphic( aPreviewBmp ); + m_pBmpWin->SetGraphic( aPreviewBmp ); } Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale ) @@ -131,7 +127,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale ) else rScale = Fraction( 1, 1 ); - aNew.ReduceColors( (sal_uInt16) aNmLayers.GetValue(), BMP_REDUCE_SIMPLE ); + aNew.ReduceColors( (sal_uInt16) m_pNmLayers->GetValue(), BMP_REDUCE_SIMPLE ); return aNew; } @@ -139,7 +135,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale ) void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) { mpDocSh->SetWaitCursor( sal_True ); - aPrgs.SetValue( 0 ); + m_pPrgs->SetValue( 0 ); Fraction aScale; Bitmap aTmp( GetPreparedBitmap( rBmp, aScale ) ); @@ -147,9 +143,9 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) if( !!aTmp ) { const Link aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) ); - aTmp.Vectorize( rMtf, (sal_uInt8) aMtReduce.GetValue(), BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES, &aPrgsHdl ); + aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES, &aPrgsHdl ); - if( aCbFillHoles.IsChecked() ) + if( m_pCbFillHoles->IsChecked() ) { GDIMetaFile aNewMtf; BitmapReadAccess* pRAcc = aTmp.AcquireReadAccess(); @@ -158,8 +154,8 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) { const long nWidth = pRAcc->Width(); const long nHeight = pRAcc->Height(); - const long nTileX = static_cast(aMtFillHoles.GetValue()); - const long nTileY = static_cast(aMtFillHoles.GetValue()); + const long nTileX = static_cast(m_pMtFillHoles->GetValue()); + const long nTileY = static_cast(m_pMtFillHoles->GetValue()); const long nCountX = nWidth / nTileX; const long nCountY = nHeight / nTileY; const long nRestX = nWidth % nTileX; @@ -205,7 +201,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) } } - aPrgs.SetValue( 0 ); + m_pPrgs->SetValue( 0 ); mpDocSh->SetWaitCursor( sal_False ); } @@ -251,22 +247,22 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf, IMPL_LINK( SdVectorizeDlg, ProgressHdl, void*, pData ) { - aPrgs.SetValue( (sal_uInt16)(sal_uLong) pData ); + m_pPrgs->SetValue( (sal_uInt16)(sal_uLong) pData ); return 0L; } IMPL_LINK_NOARG(SdVectorizeDlg, ClickPreviewHdl) { Calculate( aBmp, aMtf ); - aMtfWin.SetGraphic( aMtf ); - aBtnPreview.Disable(); + m_pMtfWin->SetGraphic( aMtf ); + m_pBtnPreview->Disable(); return 0L; } IMPL_LINK_NOARG(SdVectorizeDlg, ClickOKHdl) { - if( aBtnPreview.IsEnabled() ) + if( m_pBtnPreview->IsEnabled() ) Calculate( aBmp, aMtf ); SaveSettings(); @@ -279,13 +275,13 @@ IMPL_LINK( SdVectorizeDlg, ToggleHdl, CheckBox*, pCb ) { if( pCb->IsChecked() ) { - aFtFillHoles.Enable(); - aMtFillHoles.Enable(); + m_pFtFillHoles->Enable(); + m_pMtFillHoles->Enable(); } else { - aFtFillHoles.Disable(); - aMtFillHoles.Disable(); + m_pFtFillHoles->Disable(); + m_pMtFillHoles->Disable(); } ModifyHdl( NULL ); @@ -295,7 +291,7 @@ IMPL_LINK( SdVectorizeDlg, ToggleHdl, CheckBox*, pCb ) IMPL_LINK_NOARG(SdVectorizeDlg, ModifyHdl) { - aBtnPreview.Enable(); + m_pBtnPreview->Enable(); return 0L; } @@ -322,12 +318,12 @@ void SdVectorizeDlg::LoadSettings() bFillHoles = sal_False; } - aNmLayers.SetValue( nLayers ); - aMtReduce.SetValue( nReduce ); - aMtFillHoles.SetValue( nFillHoles ); - aCbFillHoles.Check( bFillHoles ); + m_pNmLayers->SetValue( nLayers ); + m_pMtReduce->SetValue( nReduce ); + m_pMtFillHoles->SetValue( nFillHoles ); + m_pCbFillHoles->Check( bFillHoles ); - ToggleHdl( &aCbFillHoles ); + ToggleHdl(m_pCbFillHoles); } void SdVectorizeDlg::SaveSettings() const @@ -339,8 +335,8 @@ void SdVectorizeDlg::SaveSettings() const if( xOStm.Is() ) { SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 ); - *xOStm << (sal_uInt16) aNmLayers.GetValue() << (sal_uInt16) aMtReduce.GetValue(); - *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << aCbFillHoles.IsChecked(); + *xOStm << (sal_uInt16) m_pNmLayers->GetValue() << (sal_uInt16) m_pMtReduce->GetValue(); + *xOStm << (sal_uInt16) m_pMtFillHoles->GetValue() << m_pCbFillHoles->IsChecked(); } } diff --git a/sd/source/ui/dlg/vectdlg.src b/sd/source/ui/dlg/vectdlg.src deleted file mode 100644 index f95ea8c8a66f..000000000000 --- a/sd/source/ui/dlg/vectdlg.src +++ /dev/null @@ -1,206 +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 "app.hrc" -#include "vectdlg.hrc" -#include "helpids.h" - -ModalDialog DLG_VECTORIZE -{ - HelpID = HID_VECTORIZE_DLG; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 200, 237 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - - Text [ en-US ] = "Convert to Polygon" ; - - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 144 , 6 ); - Size = MAP_APPFONT ( 50 , 14 ); - TabStop = TRUE ; - DefButton = TRUE ; - }; - - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 144 , 23 ); - Size = MAP_APPFONT ( 50 , 14 ); - TabStop = TRUE ; - }; - - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 144 , 43 ); - Size = MAP_APPFONT ( 50 , 14 ); - TabStop = TRUE ; - }; - - PushButton BTN_PREVIEW - { - HelpID = "sd:PushButton:DLG_VECTORIZE:BTN_PREVIEW"; - Pos = MAP_APPFONT ( 144 , 63 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Preview" ; - }; - - FixedLine GRP_SETTINGS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 132 , 8 ) ; - Text [ en-US ] = "Settings" ; - }; - - FixedText FT_LAYERS - { - Pos = MAP_APPFONT ( 12 , 14 ); - Size = MAP_APPFONT ( 79 , 12 ); - Text [ en-US ] = "Number of colors:"; - }; - - NumericField NM_LAYERS - { - HelpID = "sd:NumericField:DLG_VECTORIZE:NM_LAYERS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 92 , 14 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 8; - Maximum = 32 ; - StrictFormat = TRUE ; - First = 8; - Last = 32 ; - SpinSize = 1 ; - }; - - FixedText FT_REDUCE - { - Pos = MAP_APPFONT ( 12 , 29 ); - Size = MAP_APPFONT ( 79 , 12 ); - Text [ en-US ] = "Point reduction:"; - }; - - MetricField MT_REDUCE - { - HelpID = "sd:MetricField:DLG_VECTORIZE:MT_REDUCE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 92 , 29 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0; - Maximum = 32 ; - StrictFormat = TRUE ; - First = 0; - Last = 32 ; - SpinSize = 1 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " Pixel" ; - }; - - CheckBox CB_FILLHOLES - { - HelpID = "sd:CheckBox:DLG_VECTORIZE:CB_FILLHOLES"; - Pos = MAP_APPFONT ( 12 , 44 ) ; - Size = MAP_APPFONT ( 79 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Fill holes:"; - }; - - FixedText FT_FILLHOLES - { - Pos = MAP_APPFONT ( 12 , 59 ); - Size = MAP_APPFONT ( 79 , 12 ); - Text [ en-US ] = "Tile size:"; - }; - - MetricField MT_FILLHOLES - { - HelpID = "sd:MetricField:DLG_VECTORIZE:MT_FILLHOLES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 92 , 59 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 8; - Maximum = 128; - StrictFormat = TRUE ; - First = 8; - Last = 128; - SpinSize = 1; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " Pixel" ; - }; - - FixedText FT_ORIGINAL - { - Pos = MAP_APPFONT ( 6 , 87 ); - Size = MAP_APPFONT ( 92 , 12 ); - Text [ en-US ] = "Source picture:"; - }; - - Control CTL_BMP - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6, 98 ) ; - Size = MAP_APPFONT ( 92, 100 ) ; - Text [ en-US ] = "Source picture" ; - }; - - FixedText FT_VECTORIZED - { - Pos = MAP_APPFONT ( 101 , 87 ); - Size = MAP_APPFONT ( 92 , 12 ); - Text [ en-US ] = "Vectorized image:"; - }; - - Control CTL_WMF - { - Border = TRUE ; - Pos = MAP_APPFONT ( 101, 98 ) ; - Size = MAP_APPFONT ( 93, 100 ) ; - Text [ en-US ] = "Vectorized image" ; - }; - - FixedText GRP_PRGS - { - Pos = MAP_APPFONT ( 6, 204 ); - Size = MAP_APPFONT( 188, 8 ); - Text [ en-US ] = "Progress"; - }; - - Window WND_PRGS - { - Border = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 6, 215 ) ; - Size = MAP_APPFONT ( 188, 10 ) ; - Text [ en-US ] = "Progress" ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/vectdlg.hrc b/sd/source/ui/inc/vectdlg.hrc deleted file mode 100644 index 2ea70d2d6083..000000000000 --- a/sd/source/ui/inc/vectdlg.hrc +++ /dev/null @@ -1,47 +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 . - */ - -#define DLG_VECTORIZE 654 - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 - -#define BTN_PREVIEW 1 - -#define GRP_SETTINGS 1 -#define GRP_PRGS 2 - -#define CTL_BMP 1 -#define CTL_WMF 2 -#define WND_PRGS 3 - -#define FT_LAYERS 1 -#define FT_REDUCE 3 -#define FT_FILLHOLES 4 -#define FT_ORIGINAL 5 -#define FT_VECTORIZED 6 - -#define NM_LAYERS 1 -#define MT_REDUCE 3 -#define MT_FILLHOLES 4 - -#define CB_FILLHOLES 1 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx index f05422f2b8c4..3429dfd73cf9 100644 --- a/sd/source/ui/inc/vectdlg.hxx +++ b/sd/source/ui/inc/vectdlg.hxx @@ -43,28 +43,20 @@ class DrawDocShell; class SdVectorizeDlg : public ModalDialog { ::sd::DrawDocShell * mpDocSh; - FixedLine aGrpSettings; - FixedText aFtLayers; - NumericField aNmLayers; - FixedText aFtReduce; - MetricField aMtReduce; - FixedText aFtFillHoles; - MetricField aMtFillHoles; - CheckBox aCbFillHoles; - - FixedText aFtOriginal; - GraphCtrl aBmpWin; - - FixedText aFtVectorized; - GraphCtrl aMtfWin; - - FixedText aGrpPrgs; - ProgressBar aPrgs; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - PushButton aBtnPreview; + NumericField* m_pNmLayers; + MetricField* m_pMtReduce; + FixedText* m_pFtFillHoles; + MetricField* m_pMtFillHoles; + CheckBox* m_pCbFillHoles; + + GraphCtrl* m_pBmpWin; + + GraphCtrl* m_pMtfWin; + + ProgressBar* m_pPrgs; + + OKButton* m_pBtnOK; + PushButton* m_pBtnPreview; Bitmap aBmp; Bitmap aPreviewBmp; diff --git a/sd/uiconfig/sdraw/ui/vectorize.ui b/sd/uiconfig/sdraw/ui/vectorize.ui new file mode 100644 index 000000000000..63058aef0cd7 --- /dev/null +++ b/sd/uiconfig/sdraw/ui/vectorize.ui @@ -0,0 +1,383 @@ + + + + + + 8 + 32 + 8 + 1 + 10 + + + 32 + 1 + 10 + + + 8 + 128 + 8 + 1 + 10 + + + False + 6 + Convert to Polygon + mouse + dialog + + + False + vertical + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + True + True + 6 + 12 + + + True + False + 0 + Number of colors: + True + colors + + + 0 + 0 + 1 + 1 + + + + + True + True + + True + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + True + False + 0 + Point reduction: + True + points:0px + + + 0 + 1 + 1 + 1 + + + + + True + True + + True + adjustment2 + + + 1 + 1 + 1 + 1 + + + + + True + False + 12 + 0 + Tile size: + True + tiles:0px + + + 0 + 3 + 1 + 1 + + + + + True + True + + True + adjustment3 + + + 1 + 3 + 1 + 1 + + + + + _Fill holes: + True + True + False + True + 0 + True + + + 0 + 2 + 2 + 1 + + + + + + + + + True + False + Settings + + + + + + + + False + True + 0 + + + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + Preview + True + True + True + True + + + False + True + 2 + + + + + gtk-help + True + True + True + True + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + False + True + True + 6 + 12 + + + True + False + 0 + Source image: + True + tiles:0px + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + Vectorized image: + True + tiles:0px + + + 1 + 0 + 1 + 1 + + + + + True + False + True + True + + + 0 + 1 + 1 + 1 + + + + + True + False + True + True + + + 1 + 1 + 1 + 1 + + + + + False + True + 2 + + + + + True + False + True + 12 + + + True + False + 0 + Progress + True + progressbar + + + 0 + 0 + 1 + 1 + + + + + True + False + True + + + 1 + 0 + 1 + 1 + + + + + False + True + 3 + + + + + + ok + cancel + preview + help + + + diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index c4fa12b48667..4fc18b71cbeb 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -74,6 +74,35 @@ GraphCtrl::GraphCtrl( Window* pParent, const ResId& rResId ) : EnableRTL( sal_False ); } +GraphCtrl::GraphCtrl( Window* pParent, WinBits nStyle ) : + Control ( pParent, nStyle ), + aMap100 ( MAP_100TH_MM ), + nWinStyle ( 0 ), + eObjKind ( OBJ_NONE ), + nPolyEdit ( 0 ), + bEditMode ( sal_False ), + bSdrMode ( sal_False ), + bAnim ( sal_False ), + mpAccContext ( NULL ), + pModel ( NULL ), + pView ( NULL ) +{ + pUserCall = new GraphCtrlUserCall( *this ); + aUpdateTimer.SetTimeout( 500 ); + aUpdateTimer.SetTimeoutHdl( LINK( this, GraphCtrl, UpdateHdl ) ); + aUpdateTimer.Start(); + EnableRTL( sal_False ); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeGraphCtrl(Window *pParent, VclBuilder::stringmap &rMap) +{ + WinBits nWinStyle = 0; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new GraphCtrl(pParent, nWinStyle); +} + GraphCtrl::~GraphCtrl() { if( mpAccContext ) -- cgit v1.2.3