Kaydet (Commit) be49b805 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert slant & Corner radius tabpage to Widget UI

Conflicts:
	cui/source/inc/helpid.hrc

Change-Id: Id0a51421e7d6cb7e0d0265f88de31ff3d9c574ec
Reviewed-on: https://gerrit.libreoffice.org/5505Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 81f14df6
......@@ -103,6 +103,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/securityoptionsdialog \
cui/uiconfig/ui/select_persona_dialog \
cui/uiconfig/ui/shadowtabpage \
cui/uiconfig/ui/slantcornertabpage \
cui/uiconfig/ui/specialcharacters \
cui/uiconfig/ui/spellingdialog \
cui/uiconfig/ui/splitcellsdialog \
......
......@@ -212,7 +212,6 @@
#define HID_TPROTATION_CTRL1 "CUI_HID_TPROTATION_CTRL1"
#define HID_TPROTATION_CTRL2 "CUI_HID_TPROTATION_CTRL2"
#define HID_TRANS_ANGLE "CUI_HID_TRANS_ANGLE"
#define HID_TRANS_SLANT "CUI_HID_TRANS_SLANT"
#define HID_TPHATCH_CTRL "CUI_HID_TPHATCH_CTRL"
#define HID_SEARCHATTR_CTL_ATTR "CUI_HID_SEARCHATTR_CTL_ATTR"
#define HID_SEARCHATTR "CUI_HID_SEARCHATTR"
......
......@@ -230,12 +230,10 @@ class SvxSlantTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
FixedLine aFlRadius;
FixedText aFtRadius;
MetricField aMtrRadius;
FixedLine aFlAngle;
FixedText aFtAngle;
MetricField aMtrAngle;
VclFrame* m_pFlRadius;
MetricField* m_pMtrRadius;
VclFrame* m_pFlAngle;
MetricField* m_pMtrAngle;
const SfxItemSet& rOutAttrs;
......
......@@ -463,17 +463,16 @@ void SvxAngleTabPage::PointChanged(Window* pWindow, RECT_POINT eRP)
\************************************************************************/
SvxSlantTabPage::SvxSlantTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_SLANT ), rInAttrs ),
aFlRadius ( this, CUI_RES( FL_RADIUS ) ),
aFtRadius ( this, CUI_RES( FT_RADIUS ) ),
aMtrRadius ( this, CUI_RES( MTR_FLD_RADIUS ) ),
aFlAngle ( this, CUI_RES( FL_SLANT ) ),
aFtAngle ( this, CUI_RES( FT_ANGLE ) ),
aMtrAngle ( this, CUI_RES( MTR_FLD_ANGLE ) ),
SvxTabPage ( pParent
,"SlantAndCornerRadius"
,"cui/ui/slantcornertabpage.ui"
, rInAttrs ),
rOutAttrs ( rInAttrs )
{
FreeResource();
get(m_pFlRadius, "FL_RADIUS");
get(m_pMtrRadius, "MTR_FLD_RADIUS");
get(m_pFlAngle, "FL_SLANT");
get(m_pMtrAngle, "MTR_FLD_ANGLE");
// this page needs ExchangeSupport
SetExchangeSupport();
......@@ -491,7 +490,7 @@ void SvxSlantTabPage::Construct()
// get the range
DBG_ASSERT(pView, "no valid view (!)");
eDlgUnit = GetModuleFieldUnit(GetItemSet());
SetFieldUnit(aMtrRadius, eDlgUnit, sal_True);
SetFieldUnit(*m_pMtrRadius, eDlgUnit, sal_True);
{ // #i75273#
Rectangle aTempRect(pView->GetAllMarkedRect());
......@@ -505,23 +504,23 @@ void SvxSlantTabPage::Construct()
sal_Bool SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
{
sal_Bool bModified = sal_False;
String aStr = aMtrRadius.GetText();
String aStr = m_pMtrRadius->GetText();
if( aStr != aMtrRadius.GetSavedValue() )
if( aStr != m_pMtrRadius->GetSavedValue() )
{
Fraction aUIScale = pView->GetModel()->GetUIScale();
long nTmp = GetCoreValue( aMtrRadius, ePoolUnit );
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
nTmp = Fraction( nTmp ) * aUIScale;
rAttrs.Put( SdrEckenradiusItem( nTmp ) );
bModified = sal_True;
}
aStr = aMtrAngle.GetText();
aStr = m_pMtrAngle->GetText();
if( aStr != aMtrAngle.GetSavedValue() )
if( aStr != m_pMtrAngle->GetSavedValue() )
{
sal_Int32 nValue = static_cast<sal_Int32>(aMtrAngle.GetValue());
sal_Int32 nValue = static_cast<sal_Int32>(m_pMtrAngle->GetValue());
rAttrs.Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) );
bModified = sal_True;
}
......@@ -552,10 +551,8 @@ void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs)
// corner radius
if(!pView->IsEdgeRadiusAllowed())
{
aFlRadius.Disable();
aFtRadius.Disable();
aMtrRadius.Disable();
aMtrRadius.SetText( String() );
m_pMtrRadius->SetText( "" );
m_pFlRadius->Disable();
}
else
{
......@@ -565,23 +562,21 @@ void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs)
{
const double fUIScale(double(pView->GetModel()->GetUIScale()));
const double fTmp((double)((const SdrEckenradiusItem*)pItem)->GetValue() / fUIScale);
SetMetricValue(aMtrRadius, basegfx::fround(fTmp), ePoolUnit);
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
}
else
{
aMtrRadius.SetText( String() );
m_pMtrRadius->SetText( "" );
}
}
aMtrRadius.SaveValue();
m_pMtrRadius->SaveValue();
// slant: angle
if( !pView->IsShearAllowed() )
{
aFlAngle.Disable();
aFtAngle.Disable();
aMtrAngle.Disable();
aMtrAngle.SetText( String() );
m_pMtrAngle->SetText( "" );
m_pFlAngle->Disable();
}
else
{
......@@ -589,15 +584,15 @@ void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs)
if( pItem )
{
aMtrAngle.SetValue( ( (const SfxInt32Item*)pItem )->GetValue() );
m_pMtrAngle->SetValue( ( (const SfxInt32Item*)pItem )->GetValue() );
}
else
{
aMtrAngle.SetText( String() );
m_pMtrAngle->SetText( "" );
}
}
aMtrAngle.SaveValue();
m_pMtrAngle->SaveValue();
}
// -----------------------------------------------------------------------
......
......@@ -141,74 +141,6 @@ TabPage RID_SVXPAGE_ANGLE
QuickHelpText [ en-US ] = "Rotation Angle";
};
};
// RID_SVXPAGE_SLANT -----------------------------------------------------
TabPage RID_SVXPAGE_SLANT
{
HelpId = HID_TRANS_SLANT ;
Hide = TRUE ;
Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ;
Text [ en-US ] = "Slant & Corner Radius" ;
FixedLine FL_RADIUS
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
Text [ en-US ] = "Corner radius" ;
};
FixedText FT_RADIUS
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Radius" ;
};
MetricField MTR_FLD_RADIUS
{
HelpID = "cui:MetricField:RID_SVXPAGE_SLANT:MTR_FLD_RADIUS";
Border = TRUE ;
Pos = MAP_APPFONT ( 56 , 14 ) ;
Size = MAP_APPFONT ( 54 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 0 ;
Maximum = 500000 ;
StrictFormat = TRUE ;
DecimalDigits = 2 ;
Unit = FUNIT_MM ;
SpinSize = 10 ;
};
FixedLine FL_SLANT
{
Pos = MAP_APPFONT ( 6 , 35 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
Text [ en-US ] = "Slant" ;
};
FixedText FT_ANGLE
{
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Angle" ;
};
MetricField MTR_FLD_ANGLE
{
HelpID = "cui:MetricField:RID_SVXPAGE_SLANT:MTR_FLD_ANGLE";
Border = TRUE ;
Pos = MAP_APPFONT ( 56 , 46 ) ;
Size = MAP_APPFONT ( 54 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = -8900 ;
First = -8900 ;
Maximum = 8900 ;
Last = 8900 ;
StrictFormat = TRUE ;
DecimalDigits = 2 ;
Unit = FUNIT_CUSTOM ;
SpinSize = 500 ;
CustomUnitText [ en-US ] = " degrees" ;
};
};
// RID_SVXDLG_TRANSFORM -----------------------------------------------------
#define _POS_SIZE_TEXT \
Text [ en-US ] = "Position and Size" ; \
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAdjustment" id="adjustmentRADIUS">
<property name="upper">500</property>
<property name="step_increment">10</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustmentSLANT">
<property name="lower">-89</property>
<property name="upper">89</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkBox" id="SlantAndCornerRadius">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFrame" id="FL_RADIUS">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<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="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="FT_RADIUS">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Radius</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">MTR_FLD_RADIUS:0.00cm</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="MTR_FLD_RADIUS:0.00cm">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="invisible_char"></property>
<property name="adjustment">adjustmentRADIUS</property>
<property name="digits">2</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Corner radius</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="FL_SLANT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<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="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="FT_ANGLE">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Angle</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">MTR_FLD_ANGLE:0.00degrees</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="MTR_FLD_ANGLE:0.00degrees">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="invisible_char"></property>
<property name="adjustment">adjustmentSLANT</property>
<property name="digits">2</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Slant</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="FT_RADIUS"/>
<widget name="FT_ANGLE"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup2">
<widgets>
<widget name="MTR_FLD_RADIUS:0.00cm"/>
<widget name="MTR_FLD_ANGLE:0.00degrees"/>
</widgets>
</object>
</interface>
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