diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-08-18 22:41:40 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-19 10:20:52 +0000 |
commit | be49b8052489b788046d7250ed851408be759900 (patch) | |
tree | 1887dec87cffe4d948eb24d51d12500acc864593 /cui | |
parent | 81f14df66d64f869ac481219ad1e441f089579de (diff) |
Convert slant & Corner radius tabpage to Widget UI
Conflicts:
cui/source/inc/helpid.hrc
Change-Id: Id0a51421e7d6cb7e0d0265f88de31ff3d9c574ec
Reviewed-on: https://gerrit.libreoffice.org/5505
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/transfrm.hxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 55 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.src | 68 | ||||
-rw-r--r-- | cui/uiconfig/ui/slantcornertabpage.ui | 170 |
6 files changed, 200 insertions, 105 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 833212db1bb5..e1ebd9360e6d 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -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 \ diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index be0f17edcc40..3d123ecac4ba 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -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" diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx index bc474fca950c..a3754180456a 100644 --- a/cui/source/inc/transfrm.hxx +++ b/cui/source/inc/transfrm.hxx @@ -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; diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 628efe3e2c94..c83e6c2b2f13 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -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(); } // ----------------------------------------------------------------------- diff --git a/cui/source/tabpages/transfrm.src b/cui/source/tabpages/transfrm.src index 6c1668c4fba3..898537a6795d 100644 --- a/cui/source/tabpages/transfrm.src +++ b/cui/source/tabpages/transfrm.src @@ -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" ; \ diff --git a/cui/uiconfig/ui/slantcornertabpage.ui b/cui/uiconfig/ui/slantcornertabpage.ui new file mode 100644 index 000000000000..3c976ca8817d --- /dev/null +++ b/cui/uiconfig/ui/slantcornertabpage.ui @@ -0,0 +1,170 @@ +<?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> |