From 0900438214c7f3eeb81a6f5e00978357847bbaef Mon Sep 17 00:00:00 2001 From: Manal Alhassoun Date: Mon, 17 Jun 2013 07:38:40 +0300 Subject: fontsizedialog.ui widget Change-Id: I1c91b4c621c5a2da11cebdd8e58a5e5d0d86bf6c --- starmath/UIConfig_smath.mk | 1 + starmath/inc/dialog.hxx | 27 +- starmath/inc/starmath.hrc | 1 - starmath/source/dialog.cxx | 61 ++--- starmath/source/smres.src | 176 ------------- starmath/uiconfig/smath/ui/fontsizedialog.ui | 364 +++++++++++++++++++++++++++ 6 files changed, 399 insertions(+), 231 deletions(-) create mode 100644 starmath/uiconfig/smath/ui/fontsizedialog.ui (limited to 'starmath') diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk index 2f26333cc396..402ddec05f8f 100644 --- a/starmath/UIConfig_smath.mk +++ b/starmath/UIConfig_smath.mk @@ -26,6 +26,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/smath,\ $(eval $(call gb_UIConfig_add_uifiles,modules/smath,\ starmath/uiconfig/smath/ui/alignmentdialog \ starmath/uiconfig/smath/ui/catalogdialog \ + starmath/uiconfig/smath/ui/fontsizedialog \ starmath/uiconfig/smath/ui/printeroptions \ starmath/uiconfig/smath/ui/savedefaultsdialog \ starmath/uiconfig/smath/ui/smathsettings \ diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6c3586e84521..8c1f74d2db1a 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -121,29 +121,20 @@ public: class SmFontSizeDialog : public ModalDialog { - FixedText aFixedText1; - MetricField aBaseSize; - FixedText aFixedText4; - MetricField aTextSize; - FixedText aFixedText5; - MetricField aIndexSize; - FixedText aFixedText6; - MetricField aFunctionSize; - FixedText aFixedText7; - MetricField aOperatorSize; - FixedText aFixedText8; - MetricField aBorderSize; - FixedLine aFixedLine1; - OKButton aOKButton1; - HelpButton aHelpButton1; - CancelButton aCancelButton1; - PushButton aDefaultButton; + MetricField* m_pBaseSize; + MetricField* m_pTextSize; + MetricField* m_pIndexSize; + MetricField* m_pFunctionSize; + MetricField* m_pOperatorSize; + MetricField* m_pBorderSize; + HelpButton* m_pHelpButton1; + PushButton* m_pDefaultButton; DECL_LINK(DefaultButtonClickHdl, Button *); DECL_LINK(HelpButtonClickHdl, Button *); public: - SmFontSizeDialog(Window *pParent, bool bFreeRes = true); + SmFontSizeDialog(Window *pParent); void ReadFrom(const SmFormat &rFormat); void WriteTo (SmFormat &rFormat) const; diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index dedc3f3fd547..74aebf6d8852 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -77,7 +77,6 @@ #define RID_FONTDIALOG (RID_APP_START + 2) -#define RID_FONTSIZEDIALOG (RID_APP_START + 3) #define RID_FONTTYPEDIALOG (RID_APP_START + 4) #define RID_SYMDEFINEDIALOG (RID_APP_START + 9) #define RID_PRINTUIOPTIONS (RID_APP_START + 11) diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 67c4a1dfb2a1..9fc2bb10cb4f 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -446,62 +446,51 @@ IMPL_LINK( SmFontSizeDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/ Help* pHelp = Application::GetHelp(); if( pHelp ) { - pHelp->Start( OUString( "HID_SMA_FONTSIZEDIALOG" ), &aHelpButton1 ); + pHelp->Start( OUString( "HID_SMA_FONTSIZEDIALOG" ), m_pHelpButton1 ); } return 0; } -SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes) - : ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)), - aFixedText1(this, SmResId(1)), - aBaseSize(this, SmResId(1)), - aFixedText4(this, SmResId(4)), - aTextSize(this, SmResId(4)), - aFixedText5(this, SmResId(5)), - aIndexSize(this, SmResId(5)), - aFixedText6(this, SmResId(6)), - aFunctionSize(this, SmResId(6)), - aFixedText7(this, SmResId(7)), - aOperatorSize(this, SmResId(7)), - aFixedText8(this, SmResId(8)), - aBorderSize(this, SmResId(8)), - aFixedLine1(this, SmResId(1)), - aOKButton1(this, SmResId(1)), - aHelpButton1(this, SmResId(1)), - aCancelButton1(this, SmResId(1)), - aDefaultButton(this, SmResId(1)) +SmFontSizeDialog::SmFontSizeDialog(Window * pParent) + : ModalDialog(pParent, "FontSizeDialog", "modules/smath/ui/fontsizedialog.ui") { - if (bFreeRes) - FreeResource(); + get(m_pTextSize, "spinB_text"); + get(m_pIndexSize, "spinB_index"); + get(m_pFunctionSize, "spinB_function"); + get(m_pOperatorSize, "spinB_operator"); + get(m_pBorderSize, "spinB_limit"); + get(m_pBaseSize, "spinB_baseSize"); + get(m_pHelpButton1, "help"); + get(m_pDefaultButton, "default"); - aDefaultButton.SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl)); - aHelpButton1.SetClickHdl(LINK(this, SmFontSizeDialog, HelpButtonClickHdl)); + m_pDefaultButton->SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl)); + m_pHelpButton1->SetClickHdl(LINK(this, SmFontSizeDialog, HelpButtonClickHdl)); } void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat) { //! aufpassen: richtig runden! - aBaseSize.SetValue( SmRoundFraction( + m_pBaseSize->SetValue( SmRoundFraction( Sm100th_mmToPts( rFormat.GetBaseSize().Height() ) ) ); - aTextSize .SetValue( rFormat.GetRelSize(SIZ_TEXT) ); - aIndexSize .SetValue( rFormat.GetRelSize(SIZ_INDEX) ); - aFunctionSize.SetValue( rFormat.GetRelSize(SIZ_FUNCTION) ); - aOperatorSize.SetValue( rFormat.GetRelSize(SIZ_OPERATOR) ); - aBorderSize .SetValue( rFormat.GetRelSize(SIZ_LIMITS) ); + m_pTextSize->SetValue( rFormat.GetRelSize(SIZ_TEXT) ); + m_pIndexSize->SetValue( rFormat.GetRelSize(SIZ_INDEX) ); + m_pFunctionSize->SetValue( rFormat.GetRelSize(SIZ_FUNCTION) ); + m_pOperatorSize->SetValue( rFormat.GetRelSize(SIZ_OPERATOR) ); + m_pBorderSize->SetValue( rFormat.GetRelSize(SIZ_LIMITS) ); } void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const { - rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(aBaseSize.GetValue()))) ); + rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(m_pBaseSize->GetValue()))) ); - rFormat.SetRelSize(SIZ_TEXT, (sal_uInt16) aTextSize .GetValue()); - rFormat.SetRelSize(SIZ_INDEX, (sal_uInt16) aIndexSize .GetValue()); - rFormat.SetRelSize(SIZ_FUNCTION, (sal_uInt16) aFunctionSize.GetValue()); - rFormat.SetRelSize(SIZ_OPERATOR, (sal_uInt16) aOperatorSize.GetValue()); - rFormat.SetRelSize(SIZ_LIMITS, (sal_uInt16) aBorderSize .GetValue()); + rFormat.SetRelSize(SIZ_TEXT, (sal_uInt16) m_pTextSize->GetValue()); + rFormat.SetRelSize(SIZ_INDEX, (sal_uInt16) m_pIndexSize->GetValue()); + rFormat.SetRelSize(SIZ_FUNCTION, (sal_uInt16) m_pFunctionSize->GetValue()); + rFormat.SetRelSize(SIZ_OPERATOR, (sal_uInt16) m_pOperatorSize->GetValue()); + rFormat.SetRelSize(SIZ_LIMITS, (sal_uInt16) m_pBorderSize->GetValue()); const Size aTmp (rFormat.GetBaseSize()); for (sal_uInt16 i = FNT_BEGIN; i <= FNT_END; i++) diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 7a7177e76f48..73d3d4cdf6f3 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -104,182 +104,6 @@ ModalDialog RID_FONTDIALOG }; }; -ModalDialog RID_FONTSIZEDIALOG -{ - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - HelpId = CMD_SID_FONTSIZE ; - Size = MAP_APPFONT ( 171 , 120 ) ; - Text [ en-US ] = "Font Sizes" ; - FixedText 1 - { - Left = TRUE ; - Pos = MAP_APPFONT ( 12 , 7 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Base ~size"; - }; - MetricField 1 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 6 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 4 ; - Maximum = 127 ; - Unit = FUNIT_POINT ; - }; - FixedText 4 - { - Pos = MAP_APPFONT ( 12 , 37 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Text"; - }; - MetricField 4 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:4"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 36 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 200 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - }; - FixedText 5 - { - Pos = MAP_APPFONT ( 12 , 52 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Indexes"; - }; - MetricField 5 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:5"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 51 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 200 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - }; - FixedText 6 - { - Pos = MAP_APPFONT ( 12 , 67 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Functions"; - }; - MetricField 6 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:6"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 66 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 200 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - }; - FixedText 7 - { - Pos = MAP_APPFONT ( 12 , 82 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Operators"; - }; - MetricField 7 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:7"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 81 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 200 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - }; - FixedText 8 - { - Pos = MAP_APPFONT ( 12 , 97 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Limits"; - }; - MetricField 8 - { - HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:8"; - Border = TRUE ; - Pos = MAP_APPFONT ( 57 , 96 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 200 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - }; - FixedLine 1 - { - Pos = MAP_APPFONT ( 6 , 24 ) ; - Size = MAP_APPFONT ( 99 , 8 ) ; - Text [ en-US ] = "Relative sizes" ; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 114 , 3 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 114 , 21 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 114 , 46 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1"; - Text [ en-US ] = "~Help" ; - }; - PushButton 1 - { - HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 114 , 64 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Default" ; - }; -}; - ModalDialog RID_FONTTYPEDIALOG { OutputSize = TRUE ; diff --git a/starmath/uiconfig/smath/ui/fontsizedialog.ui b/starmath/uiconfig/smath/ui/fontsizedialog.ui new file mode 100644 index 000000000000..afb5ee61c91a --- /dev/null +++ b/starmath/uiconfig/smath/ui/fontsizedialog.ui @@ -0,0 +1,364 @@ + + + + + False + 6 + Font Sizes + dialog + + + False + 12 + + + False + vertical + start + + + gtk-ok + True + True + True + True + True + False + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + False + True + + + False + True + 1 + + + + + gtk-help + True + True + True + False + True + + + False + True + 2 + + + + + _Default + True + True + True + False + True + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + False + True + vertical + 12 + + + True + False + True + 12 + + + True + False + Base _size + True + spinB_baseSize:0pt + + + False + True + 0 + + + + + True + True + 12 + True + + adjustmentBaseSize + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + 6 + 12 + 5 + 2 + + + True + True + True + + adjustmentRelativeSizes + + + 1 + 2 + 1 + 1 + + + + + True + False + 0 + _Operators + True + spinB_function:0% + + + 0 + 3 + 1 + 1 + + + + + True + False + 0 + _Limits + True + spinB_limit:0% + + + 0 + 4 + 1 + 1 + + + + + True + True + True + + adjustmentRelativeSizes + + + 1 + 3 + 1 + 1 + + + + + True + True + True + + adjustmentRelativeSizes + + + 1 + 4 + 1 + 1 + + + + + True + False + 0 + _Text + True + spinB_text:0% + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Functions + True + spinB_function:0% + + + 0 + 2 + 1 + 1 + + + + + True + False + 0 + _Indexes + True + spinB_index:0% + + + 0 + 1 + 1 + 1 + + + + + True + True + True + + adjustmentRelativeSizes + + + 1 + 0 + 1 + 1 + + + + + True + True + True + + adjustmentRelativeSizes + + + 1 + 1 + 1 + 1 + + + + + + + + + True + False + Relative sizes + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + ok + cancel + help + default + + + + 4 + 127 + 1 + 10 + + + 5 + 200 + 1 + 10 + + -- cgit