summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-23 15:16:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-23 15:39:04 +0000
commit83e5a76f0e8803646de26daa736a9d3353d4ae85 (patch)
tree5756755edaf9640c3b97162bbd3445c255b331ff
parentd931b994a4bd2f8fe72f351a7d628a44a35f4abe (diff)
convert autofit width dialog to new .ui
Change-Id: I81bc6e119019f9bd4f90ae4ed77fbb65455260cd
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/UI_swriter.mk1
-rw-r--r--sw/source/ui/inc/rowht.hxx8
-rw-r--r--sw/source/ui/table/rowht.cxx39
-rw-r--r--sw/source/ui/table/rowht.hrc25
-rw-r--r--sw/source/ui/table/rowht.src82
-rw-r--r--sw/uiconfig/swriter/ui/rowheight.ui23
7 files changed, 35 insertions, 144 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 7ba3c4612507..9fbfa3117c3a 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -152,7 +152,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/smartmenu/stmenu.src \
sw/source/ui/table/chartins.src \
sw/source/ui/table/mergetbl.src \
- sw/source/ui/table/rowht.src \
sw/source/ui/table/table.src \
sw/source/ui/table/tabledlg.src \
sw/source/ui/uiview/pview.src \
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index a35b38fa2693..d410de64faeb 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/outlinepositionpage \
sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/printeroptions \
+ sw/uiconfig/swriter/ui/rowheight \
sw/uiconfig/swriter/ui/sortdialog \
sw/uiconfig/swriter/ui/splittable \
sw/uiconfig/swriter/ui/statisticsinfopage \
diff --git a/sw/source/ui/inc/rowht.hxx b/sw/source/ui/inc/rowht.hxx
index c7743f0dd7bc..a84bc608ba00 100644
--- a/sw/source/ui/inc/rowht.hxx
+++ b/sw/source/ui/inc/rowht.hxx
@@ -28,12 +28,8 @@ class SwWrtShell;
class SwTableHeightDlg : public SvxStandardDialog
{
- FixedLine aHeightFL;
- MetricField aHeightEdit;
- CheckBox aAutoHeightCB;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
+ MetricField* m_pHeightEdit;
+ CheckBox* m_pAutoHeightCB;
SwWrtShell &rSh;
protected:
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index 2b1587b044c9..9fec8f0bea1d 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -34,18 +34,14 @@
#include <usrpref.hxx>
#include <cmdid.h>
-#include <rowht.hrc>
#include <table.hrc>
-
-
-
void SwTableHeightDlg::Apply()
{
- SwTwips nHeight = static_cast< SwTwips >(aHeightEdit.Denormalize(aHeightEdit.GetValue(FUNIT_TWIP)));
+ SwTwips nHeight = static_cast< SwTwips >(m_pHeightEdit->Denormalize(m_pHeightEdit->GetValue(FUNIT_TWIP)));
SwFmtFrmSize aSz(ATT_FIX_SIZE, 0, nHeight);
- SwFrmSize eFrmSize = (SwFrmSize) aAutoHeightCB.IsChecked() ?
+ SwFrmSize eFrmSize = (SwFrmSize) m_pAutoHeightCB->IsChecked() ?
ATT_MIN_SIZE : ATT_FIX_SIZE;
if(eFrmSize != aSz.GetHeightSizeType())
{
@@ -54,37 +50,28 @@ void SwTableHeightDlg::Apply()
rSh.SetRowHeight( aSz );
}
-// CTOR / DTOR -----------------------------------------------------------
-
-
-SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
-
- SvxStandardDialog(pParent, SW_RES(DLG_ROW_HEIGHT)),
- aHeightFL(this, SW_RES(FL_HEIGHT)),
- aHeightEdit(this, SW_RES(ED_HEIGHT)),
- aAutoHeightCB(this, SW_RES(CB_AUTOHEIGHT)),
- aOKBtn(this, SW_RES(BT_OK)),
- aCancelBtn(this, SW_RES(BT_CANCEL)),
- aHelpBtn( this, SW_RES( BT_HELP ) ),
- rSh( rS )
+SwTableHeightDlg::SwTableHeightDlg(Window *pParent, SwWrtShell &rS)
+ : SvxStandardDialog(pParent, "RowHeightDialog", "modules/swriter/ui/rowheight.ui")
+ , rSh( rS )
{
- FreeResource();
+ get(m_pHeightEdit, "heightmf");
+ get(m_pAutoHeightCB, "fit");
FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( 0 != PTR_CAST( SwWebDocShell,
rSh.GetView().GetDocShell() ) )->GetMetric();
- ::SetFieldUnit( aHeightEdit, eFieldUnit );
+ ::SetFieldUnit(*m_pHeightEdit, eFieldUnit);
- aHeightEdit.SetMin(MINLAY, FUNIT_TWIP);
- if(!aHeightEdit.GetMin())
- aHeightEdit.SetMin(1);
+ m_pHeightEdit->SetMin(MINLAY, FUNIT_TWIP);
+ if(!m_pHeightEdit->GetMin())
+ m_pHeightEdit->SetMin(1);
SwFmtFrmSize *pSz;
rSh.GetRowHeight( pSz );
if ( pSz )
{
long nHeight = pSz->GetHeight();
- aAutoHeightCB.Check(pSz->GetHeightSizeType() != ATT_FIX_SIZE);
- aHeightEdit.SetValue(aHeightEdit.Normalize(nHeight), FUNIT_TWIP);
+ m_pAutoHeightCB->Check(pSz->GetHeightSizeType() != ATT_FIX_SIZE);
+ m_pHeightEdit->SetValue(m_pHeightEdit->Normalize(nHeight), FUNIT_TWIP);
delete pSz;
}
diff --git a/sw/source/ui/table/rowht.hrc b/sw/source/ui/table/rowht.hrc
deleted file mode 100644
index cddbe4f45627..000000000000
--- a/sw/source/ui/table/rowht.hrc
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 ED_HEIGHT 1
-#define CB_AUTOHEIGHT 2
-#define FL_HEIGHT 3
-
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
-
diff --git a/sw/source/ui/table/rowht.src b/sw/source/ui/table/rowht.src
deleted file mode 100644
index bee371c01429..000000000000
--- a/sw/source/ui/table/rowht.src
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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 "table.hrc"
-#include "rowht.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_ROW_HEIGHT
-{
- HelpID = CMD_FN_TABLE_SET_ROW_HEIGHT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 157 , 60 ) ;
- Text [ en-US ] = "Row Height" ;
- Moveable = TRUE ;
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 101 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 101 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 101 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- MetricField ED_HEIGHT
- {
- HelpID = "sw:MetricField:DLG_ROW_HEIGHT:ED_HEIGHT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 990 ;
- DecimalDigits = 1 ;
- Value = 10 ;
- Unit = FUNIT_CM ;
- First = 100 ;
- Last = 9999 ;
- };
- CheckBox CB_AUTOHEIGHT
- {
- HelpID = "sw:CheckBox:DLG_ROW_HEIGHT:CB_AUTOHEIGHT";
- Pos = MAP_APPFONT ( 12 , 34 ) ;
- Size = MAP_APPFONT ( 80 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Fit to size" ;
- };
- FixedLine FL_HEIGHT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 89 , 8 ) ;
- Text [ en-US ] = "Height" ;
- };
-};
diff --git a/sw/uiconfig/swriter/ui/rowheight.ui b/sw/uiconfig/swriter/ui/rowheight.ui
index e3fc9490b5d7..07a3f1770fbc 100644
--- a/sw/uiconfig/swriter/ui/rowheight.ui
+++ b/sw/uiconfig/swriter/ui/rowheight.ui
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkAction" id="action1"/>
- <object class="GtkDialog" id="Row Height">
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="lower">0.01</property>
+ <property name="upper">99</property>
+ <property name="value">0.01</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="RowHeightDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="title" translatable="yes">Row Height</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -20,6 +27,8 @@
<property name="label">gtk-ok</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>
@@ -75,6 +84,7 @@
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box1">
@@ -83,10 +93,11 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkSpinButton" id="spinbutton1">
+ <object class="GtkSpinButton" id="heightmf:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
+ <property name="adjustment">adjustment1</property>
<property name="digits">2</property>
</object>
<packing>
@@ -96,11 +107,12 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="checkbutton1">
+ <object class="GtkCheckButton" id="fit">
<property name="label" translatable="yes">_Fit to size</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
@@ -119,6 +131,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Height</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
</child>
</object>