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

convert autofit width dialog to new .ui

Change-Id: I81bc6e119019f9bd4f90ae4ed77fbb65455260cd
üst d931b994
......@@ -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 \
......
......@@ -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 \
......
......@@ -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:
......
......@@ -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;
}
......
/*
* 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
/*
* 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" ;
};
};
<?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>
......
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