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
void* pCheckObj;
SvxIMapDlgItem aIMapItem;
virtual void Resize() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
DECL_LINK( TbxClickHdl, ToolBox* );
......
......@@ -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<VclVBox>("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<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 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 );
......
......@@ -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 );
......
......@@ -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;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkWindow" id="ImapDialog">
<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">ImageMap Editor</property>
<child>
<object class="GtkBox" id="mainbox">
......@@ -26,7 +28,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_APPLY</property>
<property name="label" translatable="yes">Apply</property>
<property name="icon_name">svx/res/id01.png</property>
......@@ -42,7 +43,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_OPEN</property>
<property name="label" translatable="yes">Open...</property>
<property name="icon_name">svx/res/id02.png</property>
......@@ -58,7 +58,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_SAVEAS</property>
<property name="label" translatable="yes">Save...</property>
<property name="icon_name">svx/res/id03.png</property>
......@@ -74,7 +73,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_SELECT</property>
<property name="label" translatable="yes">Select</property>
<property name="icon_name">svx/res/id04.png</property>
......@@ -90,7 +88,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_RECT</property>
<property name="label" translatable="yes">Rectangle</property>
<property name="icon_name">svx/res/id05.png</property>
......@@ -106,7 +103,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_CIRCLE</property>
<property name="label" translatable="yes">Ellipse</property>
<property name="icon_name">svx/res/id06.png</property>
......@@ -122,7 +118,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_POLY</property>
<property name="label" translatable="yes">Polygon</property>
<property name="icon_name">svx/res/id07.png</property>
......@@ -138,7 +133,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_FREEPOLY</property>
<property name="label" translatable="yes">Freeform Polygon</property>
<property name="icon_name">svx/res/id08.png</property>
......@@ -154,7 +148,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_POLYEDIT</property>
<property name="label" translatable="yes">Edit Points</property>
<property name="icon_name">svx/res/id030.png</property>
......@@ -170,7 +163,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_POLYMOVE</property>
<property name="label" translatable="yes">Move Points</property>
<property name="icon_name">svx/res/id031.png</property>
......@@ -186,7 +178,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_POLYINSERT</property>
<property name="label" translatable="yes">Insert Points</property>
<property name="icon_name">svx/res/id032.png</property>
......@@ -202,7 +193,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_POLYDELETE</property>
<property name="label" translatable="yes">Delete Points</property>
<property name="icon_name">svx/res/id033.png</property>
......@@ -218,7 +208,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_UNDO</property>
<property name="label" translatable="yes">Undo </property>
<property name="icon_name">svx/res/id040.png</property>
......@@ -234,7 +223,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_REDO</property>
<property name="label" translatable="yes">Redo</property>
<property name="icon_name">svx/res/id041.png</property>
......@@ -250,7 +238,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_ACTIVE</property>
<property name="label" translatable="yes">Active</property>
<property name="icon_name">svx/res/id016.png</property>
......@@ -266,7 +253,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_MACRO</property>
<property name="label" translatable="yes">Macro...</property>
<property name="icon_name">svx/res/id018.png</property>
......@@ -282,7 +268,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="use_action_appearance">False</property>
<property name="action_name">TBI_PROPERTY</property>
<property name="label" translatable="yes">Properties...</property>
<property name="icon_name">svx/res/id019.png</property>
......@@ -304,13 +289,15 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="urlft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Address:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">url</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -320,38 +307,71 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="textft">
<object class="svtlo-SvtURLBox" id="url">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Text:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="targetft">
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Frame:</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="targetft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Frame:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">target</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>
<child>
<object class="GtkEntry" id="text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
</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="GtkComboBox" id="target">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="combobox-entry">
<property name="can_focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -361,32 +381,16 @@
</packing>
</child>
<child>
<object class="svtlo-SvtURLBox" id="url">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">3</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="target">
<object class="GtkLabel" id="textft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="combobox-entry">
<property name="can_focus">False</property>
</object>
</child>
<property name="halign">start</property>
<property name="label" translatable="yes">Text:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">text</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
......@@ -401,7 +405,6 @@
</child>
<child>
<object class="GtkBox" id="container:border">
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="QueryModifyImageMapChangesDialog">
<property name="can_focus">False</property>
<property name="border_width">12</property>
......@@ -26,6 +27,8 @@
<property name="label">gtk-cancel</property>
<property name="visible">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="use_stock">True</property>
</object>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="QuerySaveImageMapChangesDialog">
<property name="can_focus">False</property>
<property name="border_width">12</property>
......@@ -26,6 +27,8 @@
<property name="label">gtk-cancel</property>
<property name="visible">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="use_stock">True</property>
</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