Kaydet (Commit) ac696f8b authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst d8f53bbe
...@@ -134,7 +134,6 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow ...@@ -134,7 +134,6 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
void* pCheckObj; void* pCheckObj;
SvxIMapDlgItem aIMapItem; SvxIMapDlgItem aIMapItem;
virtual void Resize() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE; virtual bool Close() SAL_OVERRIDE;
DECL_LINK( TbxClickHdl, ToolBox* ); DECL_LINK( TbxClickHdl, ToolBox* );
......
...@@ -125,12 +125,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStatusBar(Window *pParent, ...@@ -125,12 +125,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStatusBar(Window *pParent,
return new StatusBar(pParent); return new StatusBar(pParent);
} }
SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, Window* _pParent)
Window* _pParent ) : : SfxModelessDialog(_pBindings, pCW, _pParent, "ImapDialog", "svx/ui/imapdialog.ui")
SfxModelessDialog ( _pBindings, pCW, _pParent, "ImapDialog", "svx/ui/imapdialog.ui" ), , maImageList(SVX_RES(IL_IMAPDLG))
maImageList ( SVX_RES( IL_IMAPDLG ) ), , pCheckObj(NULL)
pCheckObj ( NULL ), , aIMapItem(SID_IMAP_EXEC, *this, *_pBindings)
aIMapItem ( SID_IMAP_EXEC, *this, *_pBindings )
{ {
get(m_pTbxIMapDlg1, "toolbar"); get(m_pTbxIMapDlg1, "toolbar");
m_pTbxIMapDlg1->InsertSeparator(3, 5); m_pTbxIMapDlg1->InsertSeparator(3, 5);
...@@ -180,10 +179,23 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, ...@@ -180,10 +179,23 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW,
get(m_pEdtText, "text"); get(m_pEdtText, "text");
get(m_pFtTarget, "targetft"); get(m_pFtTarget, "targetft");
get(m_pCbbTarget, "target"); 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"); get(m_pStbStatus, "statusbar");
VclVBox* _pContainer = get<VclVBox>("container"); VclVBox* _pContainer = get<VclVBox>("container");
pIMapWnd = new IMapWindow( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() ); pIMapWnd = new IMapWindow( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() );
pIMapWnd->set_hexpand(true);
pIMapWnd->set_vexpand(true);
pIMapWnd->Show(); pIMapWnd->Show();
ApplyImageList(); ApplyImageList();
...@@ -237,30 +249,6 @@ SvxIMapDlg::~SvxIMapDlg() ...@@ -237,30 +249,6 @@ SvxIMapDlg::~SvxIMapDlg()
delete pOwnData; delete pOwnData;
} }
void SvxIMapDlg::Resize()
{
Size aMinSize( GetMinOutputSizePixel() );
Size aNewSize( GetOutputSizePixel() );
if ( aNewSize.Height() >= aMinSize.Height() )
{
VclVBox *_pMainBox = get<VclVBox>("mainbox");
_pMainBox->SetSizePixel( aNewSize );
Size _aSize( m_pStbStatus->GetSizePixel() );
Point aPoint( 0, aNewSize.Height() - _aSize.Height() );
// Position the EditWindow
VclVBox *_pContainer = get<VclVBox>("container");
_aSize.Width() = aNewSize.Width() - 6;
_aSize.Height() = aPoint.Y() - _pContainer->GetPosPixel().Y() - 12;
pIMapWnd->SetSizePixel( _aSize );
aLastSize = aNewSize;
}
}
bool SvxIMapDlg::Close() bool SvxIMapDlg::Close()
{ {
bool bRet = true; bool bRet = true;
...@@ -317,7 +305,7 @@ const ImageMap& SvxIMapDlg::GetImageMap() const ...@@ -317,7 +305,7 @@ const ImageMap& SvxIMapDlg::GetImageMap() const
void SvxIMapDlg::SetTargetList( const TargetList& rTargetList ) void SvxIMapDlg::SetTargetList( const TargetList& rTargetList )
{ {
TargetList aNewList( rTargetList ); TargetList aNewList( rTargetList );
pIMapWnd->SetTargetList( aNewList ); pIMapWnd->SetTargetList( aNewList );
......
...@@ -75,6 +75,11 @@ IMapWindow::~IMapWindow() ...@@ -75,6 +75,11 @@ IMapWindow::~IMapWindow()
delete[] pItemInfo; delete[] pItemInfo;
} }
Size IMapWindow::GetOptimalSize() const
{
return LogicToPixel(Size(270, 170), MAP_APPFONT);
}
void IMapWindow::SetImageMap( const ImageMap& rImageMap ) void IMapWindow::SetImageMap( const ImageMap& rImageMap )
{ {
ReplaceImageMap( rImageMap, false ); ReplaceImageMap( rImageMap, false );
......
...@@ -107,6 +107,7 @@ protected: ...@@ -107,6 +107,7 @@ protected:
// GraphCtrl // GraphCtrl
virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE; virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE; virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE; virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE;
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="QueryModifyImageMapChangesDialog"> <object class="GtkMessageDialog" id="QueryModifyImageMapChangesDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">12</property> <property name="border_width">12</property>
...@@ -26,6 +27,8 @@ ...@@ -26,6 +27,8 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="QuerySaveImageMapChangesDialog"> <object class="GtkMessageDialog" id="QuerySaveImageMapChangesDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">12</property> <property name="border_width">12</property>
...@@ -26,6 +27,8 @@ ...@@ -26,6 +27,8 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment