From df311b82a3df1576732dcf74a45c47316d31f7ee Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Sat, 16 Mar 2013 16:35:34 -0300 Subject: Widget UI for Calc cell alignment page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Format - cell, alignment tab Change-Id: I78e4252064671720d41ad3af086b41d2efe06ac1 Reviewed-on: https://gerrit.libreoffice.org/2773 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- cui/UI_cui.mk | 1 + cui/source/inc/align.hxx | 69 +++-- cui/source/tabpages/align.cxx | 178 +++++------ cui/source/tabpages/align.hrc | 44 +-- cui/source/tabpages/align.src | 204 +------------ cui/uiconfig/ui/cellalignment.ui | 628 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 767 insertions(+), 357 deletions(-) create mode 100644 cui/uiconfig/ui/cellalignment.ui (limited to 'cui') diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk index c3b6fe7150b3..ba288665eeb9 100644 --- a/cui/UI_cui.mk +++ b/cui/UI_cui.mk @@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ cui/uiconfig/ui/asiantypography \ cui/uiconfig/ui/backgroundpage \ cui/uiconfig/ui/borderpage \ + cui/uiconfig/ui/cellalignment \ cui/uiconfig/ui/charnamepage \ cui/uiconfig/ui/colorpage \ cui/uiconfig/ui/comment \ diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx index c47afaedb14b..7e85836e1c3d 100644 --- a/cui/source/inc/align.hxx +++ b/cui/source/inc/align.hxx @@ -19,6 +19,23 @@ #ifndef _SVX_ALIGN_HXX #define _SVX_ALIGN_HXX +// list box indexes +#define ALIGNDLG_HORALIGN_STD 0 +#define ALIGNDLG_HORALIGN_LEFT 1 +#define ALIGNDLG_HORALIGN_CENTER 2 +#define ALIGNDLG_HORALIGN_RIGHT 3 +#define ALIGNDLG_HORALIGN_BLOCK 4 +#define ALIGNDLG_HORALIGN_FILL 5 +#define ALIGNDLG_HORALIGN_DISTRIBUTED 6 + +#define ALIGNDLG_VERALIGN_STD 0 +#define ALIGNDLG_VERALIGN_TOP 1 +#define ALIGNDLG_VERALIGN_MID 2 +#define ALIGNDLG_VERALIGN_BOTTOM 3 +#define ALIGNDLG_VERALIGN_BLOCK 4 +#define ALIGNDLG_VERALIGN_DISTRIBUTED 5 + + #include #include #include @@ -42,7 +59,7 @@ public: virtual ~AlignmentTabPage(); static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet ); - static sal_uInt16* GetRanges(); + static sal_uInt16* GetRanges(); virtual sal_Bool FillItemSet( SfxItemSet& rSet ); virtual void Reset( const SfxItemSet& rSet ); @@ -60,30 +77,32 @@ private: DECL_LINK( UpdateEnableHdl, void* ); private: - FixedLine maFlAlignment; - FixedText maFtHorAlign; - ListBox maLbHorAlign; - FixedText maFtIndent; - MetricField maEdIndent; - FixedText maFtVerAlign; - ListBox maLbVerAlign; - - FixedLine maFlOrient; - DialControl maCtrlDial; - FixedText maFtRotate; - WrapField maNfRotate; - FixedText maFtRefEdge; - ValueSet maVsRefEdge; - TriStateBox maCbStacked; - TriStateBox maCbAsianMode; - OrientationHelper maOrientHlp; - - FixedLine maFlProperties; - TriStateBox maBtnWrap; - TriStateBox maBtnHyphen; - TriStateBox maBtnShrink; - FixedText maFtFrameDir; - FrameDirListBox maLbFrameDir; + ListBox* m_pLbHorAlign; + FixedText* m_pFtIndent; + MetricField* m_pEdIndent; + ListBox* m_pLbVerAlign; + + DialControl* m_pCtrlDial; + FixedText* m_pFtRotate; + WrapField* m_pNfRotate; + FixedText* m_pFtRefEdge; + ValueSet* m_pVsRefEdge; + TriStateBox* m_pCbStacked; + TriStateBox* m_pCbAsianMode; + OrientationHelper* m_pOrientHlp; + + VclHBox* m_pBoxDirection; + TriStateBox* m_pBtnWrap; + TriStateBox* m_pBtnHyphen; + TriStateBox* m_pBtnShrink; + FrameDirListBox* m_pLbFrameDir; + + // hidden labels/string + FixedText* m_pFtBotLock; + FixedText* m_pFtTopLock; + FixedText* m_pFtCelLock; + FixedText* m_pFtABCD; + }; // ============================================================================ diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index b2aa8a4fdd28..9aa47e8566dc 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -147,97 +147,105 @@ void lcl_SetJustifyMethodToItemSet(SfxItemSet& rSet, sal_uInt16 nWhichJM, const rSet.Put(aItem); } -} +}//namespace // ============================================================================ AlignmentTabPage::AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreAttrs ) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_ALIGNMENT ), rCoreAttrs ), - - maFlAlignment ( this, CUI_RES( FL_ALIGNMENT ) ), - maFtHorAlign ( this, CUI_RES( FT_HORALIGN ) ), - maLbHorAlign ( this, CUI_RES( LB_HORALIGN ) ), - maFtIndent ( this, CUI_RES( FT_INDENT ) ), - maEdIndent ( this, CUI_RES( ED_INDENT ) ), - maFtVerAlign ( this, CUI_RES( FT_VERALIGN ) ), - maLbVerAlign ( this, CUI_RES( LB_VERALIGN ) ), - - maFlOrient ( this, CUI_RES( FL_ORIENTATION ) ), - maCtrlDial ( this, CUI_RES( CTR_DIAL ) ), - maFtRotate ( this, CUI_RES( FT_DEGREES ) ), - maNfRotate ( this, CUI_RES( NF_DEGREES ) ), - maFtRefEdge ( this, CUI_RES( FT_BORDER_LOCK ) ), - maVsRefEdge ( this, CUI_RES( CTR_BORDER_LOCK ) ), - maCbStacked ( this, CUI_RES( BTN_TXTSTACKED ) ), - maCbAsianMode ( this, CUI_RES( BTN_ASIAN_VERTICAL ) ), - maOrientHlp ( maCtrlDial, maNfRotate, maCbStacked ), - - maFlProperties ( this, CUI_RES( FL_WRAP ) ), - maBtnWrap ( this, CUI_RES( BTN_WRAP ) ), - maBtnHyphen ( this, CUI_RES( BTN_HYPH ) ), - maBtnShrink ( this, CUI_RES( BTN_SHRINK ) ), - maFtFrameDir ( this, CUI_RES( FT_TEXTFLOW ) ), - maLbFrameDir ( this, CUI_RES( LB_FRAMEDIR ) ) + SfxTabPage( pParent, "CellAlignPage","cui/ui/cellalignment.ui", rCoreAttrs ) + { + // text alignment + get(m_pLbHorAlign,"comboboxHorzAlign"); + get(m_pFtIndent,"labelIndent"); + get(m_pEdIndent,"spinIndentFrom"); + get(m_pLbVerAlign,"comboboxVertAlign"); + + //text rotation + get(m_pNfRotate,"spinDegrees"); + get(m_pCtrlDial,"dialcontrol"); + get(m_pFtRotate,"labelDegrees"); + get(m_pFtRefEdge,"labelRefEdge"); + get(m_pVsRefEdge,"references"); + get(m_pBoxDirection,"boxDirection"); + + //Asian mode + get(m_pCbStacked,"checkVertStack"); + get(m_pCbAsianMode,"checkAsianMode"); + + m_pOrientHlp = new OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked); + + // Properties + get(m_pBtnWrap,"checkWrapTextAuto"); + get(m_pBtnHyphen,"checkHyphActive"); + get(m_pBtnShrink,"checkShrinkFitCellSize"); + get(m_pLbFrameDir,"comboTextDirBox"); + + //ValueSet hover strings + get(m_pFtBotLock,"labelSTR_BOTTOMLOCK"); + get(m_pFtTopLock,"labelSTR_TOPLOCK"); + get(m_pFtCelLock,"labelSTR_CELLLOCK"); + get(m_pFtABCD,"labelABCD"); + + m_pCtrlDial->SetText(m_pFtABCD->GetText()); + InitVsRefEgde(); // windows to be disabled, if stacked text is turned ON - maOrientHlp.AddDependentWindow( maFtRotate, STATE_CHECK ); - maOrientHlp.AddDependentWindow( maFtRefEdge, STATE_CHECK ); - maOrientHlp.AddDependentWindow( maVsRefEdge, STATE_CHECK ); + m_pOrientHlp->AddDependentWindow( *m_pFtRotate, STATE_CHECK ); + m_pOrientHlp->AddDependentWindow( *m_pFtRefEdge, STATE_CHECK ); + m_pOrientHlp->AddDependentWindow( *m_pVsRefEdge, STATE_CHECK ); // windows to be disabled, if stacked text is turned OFF - maOrientHlp.AddDependentWindow( maCbAsianMode, STATE_NOCHECK ); + m_pOrientHlp->AddDependentWindow( *m_pCbAsianMode, STATE_NOCHECK ); Link aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); - maLbHorAlign.SetSelectHdl( aLink ); - maBtnWrap.SetClickHdl( aLink ); + m_pLbHorAlign->SetSelectHdl( aLink ); + m_pBtnWrap->SetClickHdl( aLink ); // Asian vertical mode - maCbAsianMode.Show( SvtCJKOptions().IsVerticalTextEnabled() ); + m_pCbAsianMode->Show( SvtCJKOptions().IsVerticalTextEnabled() ); + - // CTL frame direction - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); if( !SvtLanguageOptions().IsCTLFontEnabled() ) { - maFtFrameDir.Hide(); - maLbFrameDir.Hide(); + m_pBoxDirection->Hide(); + } + else + { + // CTL frame direction + m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); + m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); + m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); + m_pBoxDirection->Show(); } // This page needs ExchangeSupport. SetExchangeSupport(); - FreeResource(); - - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maFtHorAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new HorJustConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maLbHorAlign, s_pHorJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_INDENT, maFtIndent, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::UInt16MetricConnection( SID_ATTR_ALIGN_INDENT, maEdIndent, FUNIT_TWIP, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maFtVerAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new VerJustConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maLbVerAlign, s_pVerJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new DialControlConnection( SID_ATTR_ALIGN_DEGREES, maCtrlDial, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_DEGREES, maFtRotate, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_LOCKPOS, maFtRefEdge, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new RotateModeConnection( SID_ATTR_ALIGN_LOCKPOS, maVsRefEdge, s_pRotateModeMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new OrientStackedConnection( SID_ATTR_ALIGN_STACKED, maOrientHlp ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_STACKED, maCbStacked, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_ASIANVERTICAL, maCbAsianMode, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_LINEBREAK, maBtnWrap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_HYPHENATION, maBtnHyphen, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_SHRINKTOFIT, maBtnShrink, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_FRAMEDIRECTION, maFtFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new FrameDirListBoxConnection( SID_ATTR_FRAMEDIRECTION, maLbFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - - maLbHorAlign.SetAccessibleRelationMemberOf( &maFlAlignment ); - maEdIndent.SetAccessibleRelationMemberOf( &maFlAlignment ); - maLbVerAlign.SetAccessibleRelationMemberOf( &maFlAlignment ); + AddItemConnection( new HorJustConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, *m_pLbHorAlign, s_pHorJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_INDENT, *m_pFtIndent, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::UInt16MetricConnection( SID_ATTR_ALIGN_INDENT, *m_pEdIndent, FUNIT_TWIP, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new VerJustConnection( SID_ATTR_ALIGN_VER_JUSTIFY, *m_pLbVerAlign, s_pVerJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new DialControlConnection( SID_ATTR_ALIGN_DEGREES, *m_pCtrlDial, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_DEGREES, *m_pFtRotate, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_LOCKPOS, *m_pFtRefEdge, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new RotateModeConnection( SID_ATTR_ALIGN_LOCKPOS, *m_pVsRefEdge, s_pRotateModeMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new OrientStackedConnection( SID_ATTR_ALIGN_STACKED, *m_pOrientHlp ) ); + AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_STACKED, *m_pCbStacked, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_ASIANVERTICAL, *m_pCbAsianMode, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_LINEBREAK, *m_pBtnWrap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_HYPHENATION, *m_pBtnHyphen, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_SHRINKTOFIT, *m_pBtnShrink, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_FRAMEDIRECTION, *m_pBoxDirection, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + AddItemConnection( new FrameDirListBoxConnection( SID_ATTR_FRAMEDIRECTION, *m_pLbFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) ); + } AlignmentTabPage::~AlignmentTabPage() { + delete m_pOrientHlp; } SfxTabPage* AlignmentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) @@ -258,12 +266,12 @@ sal_Bool AlignmentTabPage::FillItemSet( SfxItemSet& rSet ) // method to 'distribute' to distinguish from the normal justification. sal_uInt16 nWhichHorJM = GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD); - lcl_SetJustifyMethodToItemSet(rSet, nWhichHorJM, maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED); + lcl_SetJustifyMethodToItemSet(rSet, nWhichHorJM, *m_pLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED); if (!bChanged) bChanged = HasAlignmentChanged(rSet, nWhichHorJM); sal_uInt16 nWhichVerJM = GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD); - lcl_SetJustifyMethodToItemSet(rSet, nWhichVerJM, maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED); + lcl_SetJustifyMethodToItemSet(rSet, nWhichVerJM, *m_pLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED); if (!bChanged) bChanged = HasAlignmentChanged(rSet, nWhichVerJM); @@ -278,12 +286,12 @@ void AlignmentTabPage::Reset( const SfxItemSet& rCoreAttrs ) // method to 'distribute' to distinguish from the normal justification. lcl_MaybeResetAlignToDistro( - maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED, rCoreAttrs, + *m_pLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED, rCoreAttrs, GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY), GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD), SVX_HOR_JUSTIFY_BLOCK); lcl_MaybeResetAlignToDistro( - maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED, rCoreAttrs, + *m_pLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED, rCoreAttrs, GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY), GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD), SVX_VER_JUSTIFY_BLOCK); @@ -310,50 +318,46 @@ void AlignmentTabPage::DataChanged( const DataChangedEvent& rDCEvt ) void AlignmentTabPage::InitVsRefEgde() { // remember selection - is deleted in call to ValueSet::Clear() - sal_uInt16 nSel = maVsRefEdge.GetSelectItemId(); + sal_uInt16 nSel = m_pVsRefEdge->GetSelectItemId(); ResId aResId( IL_LOCK_BMPS, CUI_MGR() ); ImageList aImageList( aResId ); Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() ); - maVsRefEdge.Clear(); - maVsRefEdge.SetStyle( maVsRefEdge.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); + m_pVsRefEdge->Clear(); + m_pVsRefEdge->SetStyle( m_pVsRefEdge->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); - maVsRefEdge.SetColCount( 3 ); - maVsRefEdge.InsertItem( IID_BOTTOMLOCK, aImageList.GetImage( IID_BOTTOMLOCK ), String( CUI_RES( STR_BOTTOMLOCK ) ) ); - maVsRefEdge.InsertItem( IID_TOPLOCK, aImageList.GetImage( IID_TOPLOCK ), String( CUI_RES( STR_TOPLOCK ) ) ); - maVsRefEdge.InsertItem( IID_CELLLOCK, aImageList.GetImage( IID_CELLLOCK ), String( CUI_RES( STR_CELLLOCK ) ) ); + m_pVsRefEdge->SetColCount( 3 ); + m_pVsRefEdge->InsertItem( IID_BOTTOMLOCK, aImageList.GetImage( IID_BOTTOMLOCK ), m_pFtBotLock->GetText() ); + m_pVsRefEdge->InsertItem( IID_TOPLOCK, aImageList.GetImage( IID_TOPLOCK ), m_pFtTopLock->GetText() ); + m_pVsRefEdge->InsertItem( IID_CELLLOCK, aImageList.GetImage( IID_CELLLOCK ), m_pFtCelLock->GetText() ); - maVsRefEdge.SetSizePixel( maVsRefEdge.CalcWindowSizePixel( aItemSize ) ); + m_pVsRefEdge->SetSizePixel( m_pVsRefEdge->CalcWindowSizePixel( aItemSize ) ); - maVsRefEdge.SelectItem( nSel ); + m_pVsRefEdge->SelectItem( nSel ); } void AlignmentTabPage::UpdateEnableControls() { - sal_uInt16 nHorAlign = maLbHorAlign.GetSelectEntryPos(); + sal_uInt16 nHorAlign = m_pLbHorAlign->GetSelectEntryPos(); bool bHorLeft = (nHorAlign == ALIGNDLG_HORALIGN_LEFT); bool bHorBlock = (nHorAlign == ALIGNDLG_HORALIGN_BLOCK); bool bHorFill = (nHorAlign == ALIGNDLG_HORALIGN_FILL); bool bHorDist = (nHorAlign == ALIGNDLG_HORALIGN_DISTRIBUTED); // indent edit field only for left alignment - maFtIndent.Enable( bHorLeft ); - maEdIndent.Enable( bHorLeft ); + m_pFtIndent->Enable( bHorLeft ); + m_pEdIndent->Enable( bHorLeft ); // rotation/stacked disabled for fill alignment - maOrientHlp.Enable( !bHorFill ); + m_pOrientHlp->Enable( !bHorFill ); // hyphenation only for automatic line breaks or for block alignment - maBtnHyphen.Enable( maBtnWrap.IsChecked() || bHorBlock ); + m_pBtnHyphen->Enable( m_pBtnWrap->IsChecked() || bHorBlock ); // shrink only without automatic line break, and not for block, fill or distribute. - maBtnShrink.Enable( (maBtnWrap.GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill && !bHorDist ); + m_pBtnShrink->Enable( (m_pBtnWrap->GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill && !bHorDist ); - // visibility of fixed lines - maFlAlignment.Show( maLbHorAlign.IsVisible() || maEdIndent.IsVisible() || maLbVerAlign.IsVisible() ); - maFlOrient.Show( maCtrlDial.IsVisible() || maVsRefEdge.IsVisible() || maCbStacked.IsVisible() || maCbAsianMode.IsVisible() ); - maFlProperties.Show( maBtnWrap.IsVisible() || maBtnHyphen.IsVisible() || maBtnShrink.IsVisible() || maLbFrameDir.IsVisible() ); } bool AlignmentTabPage::HasAlignmentChanged( const SfxItemSet& rNew, sal_uInt16 nWhich ) const diff --git a/cui/source/tabpages/align.hrc b/cui/source/tabpages/align.hrc index 4f7b79be1adb..e56d7d1be172 100644 --- a/cui/source/tabpages/align.hrc +++ b/cui/source/tabpages/align.hrc @@ -16,52 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #ifndef _SVX_ALIGN_HRC #define _SVX_ALIGN_HRC -// defines ------------------------------------------------------------------ - -// resource id's -#define FL_ALIGNMENT 10 -#define FT_HORALIGN 11 -#define LB_HORALIGN 12 -#define FT_INDENT 13 -#define ED_INDENT 14 -#define FT_VERALIGN 15 -#define LB_VERALIGN 16 - -#define FL_ORIENTATION 20 -#define BTN_TXTSTACKED 21 -#define CTR_DIAL 22 -#define FT_DEGREES 23 -#define NF_DEGREES 24 -#define FT_BORDER_LOCK 25 -#define CTR_BORDER_LOCK 26 -#define BTN_ASIAN_VERTICAL 27 - -#define FL_WRAP 40 -#define BTN_WRAP 41 -#define BTN_HYPH 42 -#define FT_TEXTFLOW 43 -#define LB_FRAMEDIR 44 -#define BTN_SHRINK 45 - -// list box indexes -#define ALIGNDLG_HORALIGN_STD 0 -#define ALIGNDLG_HORALIGN_LEFT 1 -#define ALIGNDLG_HORALIGN_CENTER 2 -#define ALIGNDLG_HORALIGN_RIGHT 3 -#define ALIGNDLG_HORALIGN_BLOCK 4 -#define ALIGNDLG_HORALIGN_FILL 5 -#define ALIGNDLG_HORALIGN_DISTRIBUTED 6 - -#define ALIGNDLG_VERALIGN_STD 0 -#define ALIGNDLG_VERALIGN_TOP 1 -#define ALIGNDLG_VERALIGN_MID 2 -#define ALIGNDLG_VERALIGN_BOTTOM 3 -#define ALIGNDLG_VERALIGN_BLOCK 4 -#define ALIGNDLG_VERALIGN_DISTRIBUTED 5 - // image list for ValueSets: #define IL_LOCK_BMPS 1100 #define IID_BOTTOMLOCK 1 diff --git a/cui/source/tabpages/align.src b/cui/source/tabpages/align.src index 958af0906d40..a1736f5a0823 100644 --- a/cui/source/tabpages/align.src +++ b/cui/source/tabpages/align.src @@ -17,202 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include "helpid.hrc" #include "align.hrc" -#include #define MASKCOLOR \ MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; } // define --------------------------------------------------------------- #define IL_LOCK_MCOL Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; } - // RID_SVXPAGE_ALIGNMENT ------------------------------------------------- -TabPage RID_SVXPAGE_ALIGNMENT -{ - HelpId = HID_ALIGNMENT ; - Hide = TRUE ; - Text [ en-US ] = "Alignment" ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - SVLook = TRUE ; - FixedLine FL_ALIGNMENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text alignment"; - }; - FixedText FT_HORALIGN - { - Pos = MAP_APPFONT ( 12 ,14 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "Hori~zontal"; - }; - ListBox LB_HORALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_HORALIGN"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 25 ); - Size = MAP_APPFONT ( 100 , 60 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Default" ; ALIGNDLG_HORALIGN_STD ; > ; - < "Left" ; ALIGNDLG_HORALIGN_LEFT ; > ; - < "Center" ; ALIGNDLG_HORALIGN_CENTER ; > ; - < "Right" ; ALIGNDLG_HORALIGN_RIGHT ; > ; - < "Justified" ; ALIGNDLG_HORALIGN_BLOCK ; > ; - < "Filled" ; ALIGNDLG_HORALIGN_FILL ; > ; - < "Distributed" ; ALIGNDLG_HORALIGN_DISTRIBUTED ; > ; - }; - }; - FixedText FT_INDENT - { - Pos = MAP_APPFONT ( 118 , 14 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "I~ndent" ; - }; - MetricField ED_INDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_ALIGNMENT:ED_INDENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 118 , 25 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 990 ; - SpinSize = 10 ; - Unit = FUNIT_POINT ; - }; - FixedText FT_VERALIGN - { - Pos = MAP_APPFONT ( 160 , 14 ) ; - Size = MAP_APPFONT ( 88 , 8 ) ; - Text [ en-US ] = "~Vertical"; - }; - ListBox LB_VERALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_VERALIGN"; - Border = TRUE; - Pos = MAP_APPFONT ( 160 , 25 ); - Size = MAP_APPFONT ( 88 , 60 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Default" ; ALIGNDLG_VERALIGN_STD ; > ; - < "Top" ; ALIGNDLG_VERALIGN_TOP ; > ; - < "Middle" ; ALIGNDLG_VERALIGN_MID ; > ; - < "Bottom" ; ALIGNDLG_VERALIGN_BOTTOM ; > ; - < "Justified" ; ALIGNDLG_VERALIGN_BLOCK ; > ; - < "Distributed" ; ALIGNDLG_VERALIGN_DISTRIBUTED ; > ; - }; - }; - FixedLine FL_ORIENTATION - { - Pos = MAP_APPFONT ( 6 , 43 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text orientation" ; - }; - TriStateBox BTN_TXTSTACKED - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_TXTSTACKED"; - Pos = MAP_APPFONT ( 133 , 54 ) ; - Size = MAP_APPFONT ( 115 , 10 ) ; - TabStop = TRUE ; - Text[ en-US ] = "Ve~rtically stacked"; - }; - Control CTR_DIAL - { - HelpId = HID_ALIGNMENT_CTR_DIAL ; - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 42 , 43 ) ; - Text = "ABCD" ; - }; - FixedText FT_DEGREES - { - Pos = MAP_APPFONT ( 72 , 54 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "De~grees"; - }; - NumericField NF_DEGREES - { - HelpID = "cui:NumericField:RID_SVXPAGE_ALIGNMENT:NF_DEGREES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 65 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 359 ; - SpinSize = 5 ; - StrictFormat = TRUE ; - }; - FixedText FT_BORDER_LOCK - { - Pos = MAP_APPFONT ( 72 , 83 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "Re~ference edge" ; - }; - Control CTR_BORDER_LOCK - { - HelpId = HID_ALIGNMENT_CTR_BORDER_LOCK ; - Pos = MAP_APPFONT ( 72 , 94 ) ; - Size = MAP_APPFONT ( 50 , 15 ) ; - TabStop = TRUE ; - }; - TriStateBox BTN_ASIAN_VERTICAL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_ASIAN_VERTICAL"; - Pos = MAP_APPFONT ( 143 , 68 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Asian layout ~mode" ; - }; - FixedLine FL_WRAP - { - Pos = MAP_APPFONT ( 6 , 115 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Properties" ; - }; - TriStateBox BTN_WRAP - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_WRAP"; - Pos = MAP_APPFONT ( 12 , 126 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Wrap text automatically" ; - }; - TriStateBox BTN_HYPH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_HYPH"; - Pos = MAP_APPFONT ( 22 , 139 ) ; - Size = MAP_APPFONT ( 226 , 10 ) ; - Text [ en-US ] = "Hyphenation ~active"; - }; - TriStateBox BTN_SHRINK - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_SHRINK"; - Pos = MAP_APPFONT( 12, 152 ); - Size = MAP_APPFONT( 236, 10 ); - Text [ en-US ] = "~Shrink to fit cell size"; - }; - FixedText FT_TEXTFLOW - { - Pos = MAP_APPFONT( 12 , 170 ); - Size = MAP_APPFONT( 64 , 8 ); - Text [ en-US ] = "Te~xt direction"; - }; - ListBox LB_FRAMEDIR - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_FRAMEDIR"; - Pos = MAP_APPFONT( 78 , 168 ); - Size = MAP_APPFONT( 170 , 50 ); - Border = TRUE; - DropDown = TRUE; - }; - ImageList IL_LOCK_BMPS + +ImageList IL_LOCK_BMPS { Prefix = "lo"; MaskColor = IL_LOCK_MCOL ; @@ -224,19 +37,6 @@ TabPage RID_SVXPAGE_ALIGNMENT }; IdCount = { 3 ; }; }; - String STR_BOTTOMLOCK - { - Text [ en-US ] = "Text Extension From Lower Cell Border" ; - }; - String STR_TOPLOCK - { - Text [ en-US ] = "Text Extension From Upper Cell Border" ; - }; - String STR_CELLLOCK - { - Text [ en-US ] = "Text Extension Inside Cell" ; - }; -}; // ********************************************************************** EOF /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/cellalignment.ui b/cui/uiconfig/ui/cellalignment.ui new file mode 100644 index 000000000000..2b9f4fb085eb --- /dev/null +++ b/cui/uiconfig/ui/cellalignment.ui @@ -0,0 +1,628 @@ + + + + + + 990 + 10 + 10 + + + 359 + 5 + + + True + False + 6 + 12 + 6 + + + True + False + True + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + True + False + 0 + _Degrees + True + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Reference edge + True + references + + + 0 + 2 + 1 + 1 + + + + + True + True + start + + + 0 + 3 + 1 + 1 + + + + + True + True + + True + 1 + adjustmentSpinDegrees + True + + + 0 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + + + + True + False + True + + + 0 + 0 + 1 + 1 + + + + + True + False + 6 + 12 + + + Vertically s_tacked + True + True + False + True + 0.019999999552965164 + True + True + + + 0 + 0 + 1 + 1 + + + + + Asian layout _mode + True + True + False + 25 + True + 0.5 + True + True + + + 0 + 1 + 1 + 1 + + + + + 2 + 0 + 1 + 1 + + + + + + + + + True + False + Text orientation + + + + + + + + 0 + 1 + 1 + 1 + + + + + True + False + True + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + _Wrap text automatically + True + True + False + True + True + 0 + True + True + + + 0 + 0 + 1 + 1 + + + + + _Shrink to fit cell size + True + True + False + True + 0 + True + True + + + 0 + 2 + 1 + 1 + + + + + Hyphenation _active + True + True + False + True + 25 + True + 0 + True + True + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Properties + + + + + + + + 0 + 2 + 1 + 1 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 6 + 12 + + + True + True + + True + adjustmentIndent + 1 + + + 1 + 1 + 1 + 1 + + + + + True + False + 0 + Hori_zontal + True + comboboxHorzAlign + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Vertical + True + comboboxVertAlign + + + 2 + 0 + 1 + 1 + + + + + True + False + 0 + I_ndent + True + spinIndentFrom:0.00pt + + + 1 + 0 + 1 + 1 + + + + + True + False + liststoreHorzAlign + + + 0 + 1 + 1 + 1 + + + + + True + False + liststoreVertAlign + + + 2 + 1 + 1 + 1 + + + + + + + + + True + False + Text alignment + + + + + + + + 0 + 0 + 1 + 1 + + + + + True + False + 6 + 12 + + + True + False + 0 + Te_xt direction + True + comboTextDirBox + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + 0 + 3 + 1 + 1 + + + + + True + False + vertical + + + False + Text Extension From Lower Cell Border + + + False + True + 0 + + + + + False + Text Extension From Upper Cell Border + + + False + True + 1 + + + + + False + Text Extension Inside Cell + + + False + True + 2 + + + + + False + ABCD + + + False + True + 3 + + + + + 0 + 4 + 1 + 1 + + + + + + + + + + + + + Default + 0 + + + Left + 1 + + + Center + 2 + + + Right + 3 + + + Justified + 4 + + + Filled + 5 + + + Distributed + 6 + + + + + + + + + + + + + Default + 0 + + + Top + 1 + + + Middle + 2 + + + Bottom + 3 + + + Justified + 4 + + + Distributed + 5 + + + + + both + True + + + + + + + + + + + True + + + + + + + + + + + + + + + + -- cgit