From 0e2ef09316246c10140b1b25036f5c44dfc432ba Mon Sep 17 00:00:00 2001 From: Manal Alhassoun Date: Sun, 1 Sep 2013 15:28:18 +0300 Subject: titlerotationtabpage.ui widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I187ec2b6bbee10820fcea5b770972fc63b2f7117 Reviewed-on: https://gerrit.libreoffice.org/5729 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- chart2/AllLangResTarget_chartcontroller.mk | 1 - chart2/UIConfig_chart2.mk | 1 + .../controller/dialogs/TextDirectionListBox.cxx | 21 +++ .../source/controller/dialogs/tp_TitleRotation.cxx | 47 +++--- .../source/controller/dialogs/tp_TitleRotation.hxx | 16 +- .../source/controller/dialogs/tp_TitleRotation.src | 87 ---------- chart2/source/controller/inc/HelpIds.hrc | 3 - .../source/controller/inc/TextDirectionListBox.hxx | 2 + chart2/uiconfig/ui/titlerotationtabpage.ui | 188 +++++++++++++++++++++ 9 files changed, 242 insertions(+), 124 deletions(-) delete mode 100644 chart2/source/controller/dialogs/tp_TitleRotation.src create mode 100644 chart2/uiconfig/ui/titlerotationtabpage.ui (limited to 'chart2') diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk index ce4309ff7647..3c0cde98f13e 100644 --- a/chart2/AllLangResTarget_chartcontroller.mk +++ b/chart2/AllLangResTarget_chartcontroller.mk @@ -60,7 +60,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ chart2/source/controller/dialogs/tp_PolarOptions.src \ chart2/source/controller/dialogs/tp_RangeChooser.src \ chart2/source/controller/dialogs/tp_Scale.src \ - chart2/source/controller/dialogs/tp_TitleRotation.src \ chart2/source/controller/dialogs/tp_Trendline.src \ chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src \ )) diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 1ad18c7df28a..ea08c586c23a 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -35,6 +35,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/insertgriddlg \ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ + chart2/uiconfig/ui/titlerotationtabpage \ chart2/uiconfig/ui/tp_SeriesToAxis \ )) diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx index af699e4e3d49..25efde3be919 100644 --- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx +++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx @@ -22,6 +22,7 @@ #include "Strings.hrc" #include #include +#include namespace chart { @@ -41,6 +42,26 @@ TextDirectionListBox::TextDirectionListBox( Window* pParent, const ResId& rResId } } +TextDirectionListBox::TextDirectionListBox( Window* pParent, Window* pWindow1, Window* pWindow2 ) : + svx::FrameDirectionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_DROPDOWN) +{ + InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_LTR ), FRMDIR_HORI_LEFT_TOP ); + InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_RTL ), FRMDIR_HORI_RIGHT_TOP ); + InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_SUPER ), FRMDIR_ENVIRONMENT ); + + if( !SvtLanguageOptions().IsCTLFontEnabled() ) + { + Hide(); + if( pWindow1 ) pWindow1->Hide(); + if( pWindow2 ) pWindow2->Hide(); + } +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTextDirectionListBox(Window *pParent, VclBuilder::stringmap &) + { + return new TextDirectionListBox(pParent); + } + TextDirectionListBox::~TextDirectionListBox() { } diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index 225398a54232..e79b3b34a305 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -34,34 +34,31 @@ namespace chart SchAlignmentTabPage::SchAlignmentTabPage(Window* pWindow, const SfxItemSet& rInAttrs, bool bWithRotation) : - SfxTabPage(pWindow, SchResId(TP_ALIGNMENT), rInAttrs), - aFlAlign ( this, SchResId( FL_ALIGN ) ), - aCtrlDial ( this, SchResId( CTR_DIAL ) ), - aFtRotate ( this, SchResId( FT_DEGREES ) ), - aNfRotate ( this, SchResId( NF_ORIENT ) ), - aCbStacked ( this, SchResId( BTN_TXTSTACKED ) ), - aOrientHlp ( aCtrlDial, aNfRotate, aCbStacked ), - aFtTextDirection( this, SchResId( FT_TEXTDIR ) ), - aLbTextDirection( this, SchResId( LB_TEXTDIR ), &aFtTextDirection ) + SfxTabPage(pWindow, "TitleRotationTabPage","modules/schart/ui/titlerotationtabpage.ui", rInAttrs) { - FreeResource(); - - aCbStacked.EnableTriState( sal_False ); - aOrientHlp.AddDependentWindow( aFtRotate, STATE_CHECK ); + get(m_pCtrlDial,"dialCtrl"); + get(m_pFtRotate,"degreeL"); + get(m_pNfRotate,"OrientDegree"); + get(m_pCbStacked,"stackedCB"); + get(m_pFtTextDirection,"textdirL"); + get(m_pLbTextDirection,"textdirLB"); + get(m_pFtABCD,"labelABCD"); + m_pCtrlDial->SetText(m_pFtABCD->GetText()); + m_pOrientHlp = new svx::OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked); + + m_pCbStacked->EnableTriState( sal_False ); + m_pOrientHlp->Enable( sal_True ); + m_pOrientHlp->AddDependentWindow( *m_pFtRotate, STATE_CHECK ); if( !bWithRotation ) { - aOrientHlp.Hide(); - Point aMove( 0, aCtrlDial.GetPosPixel().Y() - aFtTextDirection.GetPosPixel().Y() ); - aFtTextDirection.SetPosPixel( aFtTextDirection.GetPosPixel() + aMove ); - aLbTextDirection.SetPosPixel( aLbTextDirection.GetPosPixel() + aMove ); - - aLbTextDirection.SetHelpId( HID_SCH_TEXTDIRECTION_EQUATION ); + m_pOrientHlp->Hide(); } } SchAlignmentTabPage::~SchAlignmentTabPage() { + delete m_pOrientHlp; } SfxTabPage* SchAlignmentTabPage::Create(Window* pParent, @@ -79,13 +76,13 @@ SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(Window* pParent, sal_Bool SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs) { //Since 04/1998 text can be rotated by an arbitrary angle: SCHATTR_TEXT_DEGREES - bool bStacked = aOrientHlp.GetStackedState() == STATE_CHECK; + bool bStacked = m_pOrientHlp->GetStackedState() == STATE_CHECK; rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bStacked ) ); - sal_Int32 nDegrees = bStacked ? 0 : aCtrlDial.GetRotation(); + sal_Int32 nDegrees = bStacked ? 0 : m_pCtrlDial->GetRotation(); rOutAttrs.Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); - SvxFrameDirection aDirection( aLbTextDirection.GetSelectEntryValue() ); + SvxFrameDirection aDirection( m_pLbTextDirection->GetSelectEntryValue() ); rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, aDirection ) ); return sal_True; @@ -96,14 +93,14 @@ void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs) const SfxPoolItem* pItem = GetItem( rInAttrs, SCHATTR_TEXT_DEGREES ); sal_Int32 nDegrees = pItem ? ((const SfxInt32Item*)pItem)->GetValue() : 0; - aCtrlDial.SetRotation( nDegrees ); + m_pCtrlDial->SetRotation( nDegrees ); pItem = GetItem( rInAttrs, SCHATTR_TEXT_STACKED ); bool bStacked = pItem && ((const SfxBoolItem*)pItem)->GetValue(); - aOrientHlp.SetStackedState( bStacked ? STATE_CHECK : STATE_NOCHECK ); + m_pOrientHlp->SetStackedState( bStacked ? STATE_CHECK : STATE_NOCHECK ); if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, sal_True, &pItem) == SFX_ITEM_SET) - aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pItem)->GetValue()) ); + m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pItem)->GetValue()) ); } } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx index 3d6f504b7078..ebb955ba9b21 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx @@ -33,14 +33,14 @@ namespace chart class SchAlignmentTabPage : public SfxTabPage { private: - FixedLine aFlAlign; - svx::DialControl aCtrlDial; - FixedText aFtRotate; - svx::WrapField aNfRotate; - TriStateBox aCbStacked; - svx::OrientationHelper aOrientHlp; - FixedText aFtTextDirection; - TextDirectionListBox aLbTextDirection; + svx::DialControl* m_pCtrlDial; + FixedText* m_pFtRotate; + svx::WrapField* m_pNfRotate; + TriStateBox* m_pCbStacked; + svx::OrientationHelper* m_pOrientHlp; + FixedText* m_pFtTextDirection; + TextDirectionListBox* m_pLbTextDirection; + FixedText* m_pFtABCD; public: SchAlignmentTabPage(Window* pParent, const SfxItemSet& rInAttrs, bool bWithRotation = true); diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.src b/chart2/source/controller/dialogs/tp_TitleRotation.src deleted file mode 100644 index 4ed821a1b74c..000000000000 --- a/chart2/source/controller/dialogs/tp_TitleRotation.src +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 "HelpIds.hrc" -#include "TabPages.hrc" - -TabPage TP_ALIGNMENT -{ - Hide = TRUE ; - HelpID = HID_SCH_ALIGNMENT ; - SVLook = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Control CTR_DIAL - { - HelpId = HID_SCH_ALIGNMENT_CTR_DIAL ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 43 , 43 ) ; - Text = "ABCD" ; - }; - TriStateBox BTN_TXTSTACKED - { - HelpId = HID_SCH_ALIGNMENT_STACKED ; - Pos = MAP_APPFONT ( 139 , 14 ) ; - Size = MAP_APPFONT ( 116 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Ve~rtically stacked"; - }; - FixedText FT_DEGREES - { - Pos = MAP_APPFONT ( 93 , 32 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - Text [ en-US ] = "~Degrees" ; - }; - NumericField NF_ORIENT - { - HelpId = HID_SCH_ALIGNMENT_DEGREES ; - Border = TRUE ; - Pos = MAP_APPFONT ( 61 , 30 ) ; - Size = MAP_APPFONT ( 28 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - StrictFormat = TRUE ; - SpinSize = 5 ; - Minimum = 0 ; - Maximum = 359 ; - }; - FixedLine FL_ALIGN - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text orientation" ; - }; - FixedText FT_TEXTDIR - { - Pos = MAP_APPFONT ( 12 , 65 ) ; - Size = MAP_APPFONT ( 64 , 8 ) ; - Text [ en-US ] = "Te~xt direction" ; - }; - ListBox LB_TEXTDIR - { - HelpId = HID_SCH_TEXTDIRECTION_TITLE ; - Pos = MAP_APPFONT ( 78 , 63 ) ; - Size = MAP_APPFONT ( 170 , 100 ) ; - Border = TRUE; - TabStop = TRUE; - DropDown = TRUE; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc index 35bed938eac9..fde7e24e9fc2 100644 --- a/chart2/source/controller/inc/HelpIds.hrc +++ b/chart2/source/controller/inc/HelpIds.hrc @@ -19,7 +19,6 @@ #ifndef CHART_HELPIDS_HRC #define CHART_HELPIDS_HRC -#define HID_SCH_ALIGNMENT "CHART2_HID_SCH_ALIGNMENT" #define HID_SCH_LEGEND_POS "CHART2_HID_SCH_LEGEND_POS" #define HID_SCH_DATA_DESCR "CHART2_HID_SCH_DATA_DESCR" @@ -93,8 +92,6 @@ #define HID_SCH_DATALABEL_SEPARATOR "CHART2_HID_SCH_DATALABEL_SEPARATOR" #define HID_SCH_DATALABEL_PLACEMENT "CHART2_HID_SCH_DATALABEL_PLACEMENT" #define HID_SCH_TEXTDIRECTION "CHART2_HID_SCH_TEXTDIRECTION" -#define HID_SCH_TEXTDIRECTION_TITLE "CHART2_HID_SCH_TEXTDIRECTION_TITLE" -#define HID_SCH_TEXTDIRECTION_EQUATION "CHART2_HID_SCH_TEXTDIRECTION_EQUATION" #define HID_SCH_DATALABEL_ROTATION_KNOB "CHART2_HID_SCH_DATALABEL_ROTATION_KNOB" #define HID_SCH_DATALABEL_ROTATION_EDIT "CHART2_HID_SCH_DATALABEL_ROTATION_EDIT" diff --git a/chart2/source/controller/inc/TextDirectionListBox.hxx b/chart2/source/controller/inc/TextDirectionListBox.hxx index 1a6f6ca27f5d..eddb04badfab 100644 --- a/chart2/source/controller/inc/TextDirectionListBox.hxx +++ b/chart2/source/controller/inc/TextDirectionListBox.hxx @@ -32,6 +32,8 @@ class TextDirectionListBox : public svx::FrameDirectionListBox public: explicit TextDirectionListBox( Window* pParent, const ResId& rResId, Window* pWindow1 = 0, Window* pWindow2 = 0 ); + explicit TextDirectionListBox( Window* pParent, + Window* pWindow1 = 0, Window* pWindow2 = 0 ); virtual ~TextDirectionListBox(); }; diff --git a/chart2/uiconfig/ui/titlerotationtabpage.ui b/chart2/uiconfig/ui/titlerotationtabpage.ui new file mode 100644 index 000000000000..a89977a5a3a1 --- /dev/null +++ b/chart2/uiconfig/ui/titlerotationtabpage.ui @@ -0,0 +1,188 @@ + + + + + + 359 + 5 + + + True + False + True + 6 + 0 + none + + + True + False + 6 + 12 + + + True + False + True + 6 + 12 + + + True + False + 6 + 12 + + + True + True + 40 + + True + 1 + adjustmentSpinDegrees + True + + + 0 + 2 + 1 + 1 + + + + + True + False + 40 + _Degrees + True + + + 1 + 2 + 1 + 1 + + + + + + + + + + + + + + + + + 1 + 0 + 1 + 1 + + + + + True + False + center + center + True + + + 0 + 0 + 1 + 1 + + + + + True + False + 6 + 12 + + + Ve_rtically stacked + True + True + False + True + 0.019999999552965164 + True + True + + + 0 + 0 + 1 + 1 + + + + + False + ABCD + + + 0 + 1 + 1 + 1 + + + + + 2 + 0 + 1 + 1 + + + + + True + False + Te_xt direction: + True + + + 0 + 1 + 1 + 1 + + + + + True + False + + + 1 + 1 + 2 + 1 + + + + + + + + + True + False + Text orientation + + + + + + + -- cgit