From ac696f8b2d4ef40d6bf50207bcab8d902cd06415 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 9 Jul 2014 10:47:33 +0100 Subject: tweak conversion a bit a) rework to remove the need for a ::Resize impl b) move the explicit pixel size into relative APP_FONT size c) lock down the target combobox size so it doesn't jump around Change-Id: Iad995453c178234d1ad0f794b5193920dcd275fe --- svx/source/dialog/imapdlg.cxx | 50 +++----- svx/source/dialog/imapwnd.cxx | 5 + svx/source/dialog/imapwnd.hxx | 1 + svx/uiconfig/ui/imapdialog.ui | 127 +++++++++++---------- .../ui/querymodifyimagemapchangesdialog.ui | 5 +- svx/uiconfig/ui/querysaveimagemapchangesdialog.ui | 5 +- 6 files changed, 98 insertions(+), 95 deletions(-) (limited to 'svx') diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index c153103f752f..64bcedda3c67 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -125,12 +125,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStatusBar(Window *pParent, return new StatusBar(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 ) +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) { get(m_pTbxIMapDlg1, "toolbar"); m_pTbxIMapDlg1->InsertSeparator(3, 5); @@ -180,10 +179,23 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, get(m_pEdtText, "text"); get(m_pFtTarget, "targetft"); get(m_pCbbTarget, "target"); + + //lock this down so it doesn't jump around in size + //as entries are added later on + TargetList aTmpList; + SfxFrame::GetDefaultTargetList(aTmpList); + for (size_t i = 0, n = aTmpList.size(); i < n; ++i) + m_pCbbTarget->InsertEntry(aTmpList[i]); + Size aPrefSize(m_pCbbTarget->get_preferred_size()); + m_pCbbTarget->set_width_request(aPrefSize.Width()); + m_pCbbTarget->Clear(); + get(m_pStbStatus, "statusbar"); VclVBox* _pContainer = get("container"); pIMapWnd = new IMapWindow( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() ); + pIMapWnd->set_hexpand(true); + pIMapWnd->set_vexpand(true); pIMapWnd->Show(); ApplyImageList(); @@ -237,30 +249,6 @@ SvxIMapDlg::~SvxIMapDlg() delete pOwnData; } -void SvxIMapDlg::Resize() -{ - Size aMinSize( GetMinOutputSizePixel() ); - Size aNewSize( GetOutputSizePixel() ); - - if ( aNewSize.Height() >= aMinSize.Height() ) - { - VclVBox *_pMainBox = get("mainbox"); - _pMainBox->SetSizePixel( aNewSize ); - - Size _aSize( m_pStbStatus->GetSizePixel() ); - Point aPoint( 0, aNewSize.Height() - _aSize.Height() ); - - // Position the EditWindow - VclVBox *_pContainer = get("container"); - _aSize.Width() = aNewSize.Width() - 6; - _aSize.Height() = aPoint.Y() - _pContainer->GetPosPixel().Y() - 12; - - pIMapWnd->SetSizePixel( _aSize ); - - aLastSize = aNewSize; - } -} - bool SvxIMapDlg::Close() { bool bRet = true; @@ -317,7 +305,7 @@ const ImageMap& SvxIMapDlg::GetImageMap() const void SvxIMapDlg::SetTargetList( const TargetList& rTargetList ) { - TargetList aNewList( rTargetList ); + TargetList aNewList( rTargetList ); pIMapWnd->SetTargetList( aNewList ); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 3b62e39595af..67fe824c34b2 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -75,6 +75,11 @@ IMapWindow::~IMapWindow() delete[] pItemInfo; } +Size IMapWindow::GetOptimalSize() const +{ + return LogicToPixel(Size(270, 170), MAP_APPFONT); +} + void IMapWindow::SetImageMap( const ImageMap& rImageMap ) { ReplaceImageMap( rImageMap, false ); diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx index 1d2ee7e6547e..f62a832c7758 100644 --- a/svx/source/dialog/imapwnd.hxx +++ b/svx/source/dialog/imapwnd.hxx @@ -107,6 +107,7 @@ protected: // GraphCtrl virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE; + virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE; diff --git a/svx/uiconfig/ui/imapdialog.ui b/svx/uiconfig/ui/imapdialog.ui index 8c249e12abc6..45be1786aee8 100644 --- a/svx/uiconfig/ui/imapdialog.ui +++ b/svx/uiconfig/ui/imapdialog.ui @@ -1,11 +1,13 @@ + - + False True True + 6 ImageMap Editor @@ -26,7 +28,6 @@ True False start - False TBI_APPLY Apply svx/res/id01.png @@ -42,7 +43,6 @@ True False start - False TBI_OPEN Open... svx/res/id02.png @@ -58,7 +58,6 @@ True False start - False TBI_SAVEAS Save... svx/res/id03.png @@ -74,7 +73,6 @@ True False start - False TBI_SELECT Select svx/res/id04.png @@ -90,7 +88,6 @@ True False start - False TBI_RECT Rectangle svx/res/id05.png @@ -106,7 +103,6 @@ True False start - False TBI_CIRCLE Ellipse svx/res/id06.png @@ -122,7 +118,6 @@ True False start - False TBI_POLY Polygon svx/res/id07.png @@ -138,7 +133,6 @@ True False start - False TBI_FREEPOLY Freeform Polygon svx/res/id08.png @@ -154,7 +148,6 @@ True False start - False TBI_POLYEDIT Edit Points svx/res/id030.png @@ -170,7 +163,6 @@ True False start - False TBI_POLYMOVE Move Points svx/res/id031.png @@ -186,7 +178,6 @@ True False start - False TBI_POLYINSERT Insert Points svx/res/id032.png @@ -202,7 +193,6 @@ True False start - False TBI_POLYDELETE Delete Points svx/res/id033.png @@ -218,7 +208,6 @@ True False start - False TBI_UNDO Undo svx/res/id040.png @@ -234,7 +223,6 @@ True False start - False TBI_REDO Redo svx/res/id041.png @@ -250,7 +238,6 @@ True False start - False TBI_ACTIVE Active svx/res/id016.png @@ -266,7 +253,6 @@ True False start - False TBI_MACRO Macro... svx/res/id018.png @@ -282,7 +268,6 @@ True False start - False TBI_PROPERTY Properties... svx/res/id019.png @@ -304,13 +289,15 @@ True False 6 - 6 + 12 True False start Address: + True + url 0 @@ -320,38 +307,71 @@ - + True False - start - Text: - 0 - 1 + 1 + 0 1 1 - + True False - start - Frame: - - - 2 - 1 - 1 - 1 - - - - - True - True True + 6 + 12 + + + True + False + start + Frame: + True + target + + + 1 + 0 + 1 + 1 + + + + + True + True + True + + + 0 + 0 + 1 + 1 + + + + + True + False + True + + + True + + + + + 2 + 0 + 1 + 1 + + 1 @@ -361,32 +381,16 @@ - - True - False - True - - - 1 - 0 - 3 - 1 - - - - + True False - True - True - - - False - - + start + Text: + True + text - 3 + 0 1 1 1 @@ -401,7 +405,6 @@ - 200 True False True diff --git a/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui b/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui index 33e388e4a550..c7a6a4442a2c 100644 --- a/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui +++ b/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui @@ -1,6 +1,7 @@ + - + False 12 @@ -26,6 +27,8 @@ gtk-cancel True True + True + True True True diff --git a/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui b/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui index bf49e7315634..2a56108e5dcf 100644 --- a/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui +++ b/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui @@ -1,6 +1,7 @@ + - + False 12 @@ -26,6 +27,8 @@ gtk-cancel True True + True + True True True -- cgit