From 7c04626ec7b54d8db2ff9bac19df75dd668ad8f7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 May 2013 11:27:10 +0100 Subject: adapt code to alignment dialog .ui conversion Change-Id: I8a64ddc076e177deaa61a450716d7d3dd8043303 --- starmath/UIConfig_smath.mk | 1 + starmath/inc/dialog.hxx | 15 +- starmath/inc/helpids.h | 1 - starmath/inc/starmath.hrc | 1 - starmath/source/dialog.cxx | 56 +++----- starmath/source/smres.src | 69 ---------- starmath/uiconfig/smath/ui/alignment.ui | 172 ----------------------- starmath/uiconfig/smath/ui/alignmentdialog.ui | 190 ++++++++++++++++++++++++++ 8 files changed, 215 insertions(+), 290 deletions(-) delete mode 100644 starmath/uiconfig/smath/ui/alignment.ui create mode 100644 starmath/uiconfig/smath/ui/alignmentdialog.ui (limited to 'starmath') diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk index 9fe1f8fa0f72..83a127ae2dc6 100644 --- a/starmath/UIConfig_smath.mk +++ b/starmath/UIConfig_smath.mk @@ -24,6 +24,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/printeroptions \ )) diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index ac0508f4ae29..34511b998923 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -271,20 +271,15 @@ public: class SmAlignDialog : public ModalDialog { - RadioButton aLeft; - RadioButton aCenter; - RadioButton aRight; - FixedLine aFixedLine1; - OKButton aOKButton1; - HelpButton aHelpButton1; - CancelButton aCancelButton1; - PushButton aDefaultButton; + RadioButton* m_pLeft; + RadioButton* m_pCenter; + RadioButton* m_pRight; + PushButton* m_pDefaultButton; DECL_LINK(DefaultButtonClickHdl, Button *); - DECL_LINK(HelpButtonClickHdl, Button *); public: - SmAlignDialog(Window *pParent, bool bFreeRes = true); + SmAlignDialog(Window *pParent); void ReadFrom(const SmFormat &rFormat); void WriteTo (SmFormat &rFormat) const; diff --git a/starmath/inc/helpids.h b/starmath/inc/helpids.h index 6d7f7bb89bff..34fd0db85950 100644 --- a/starmath/inc/helpids.h +++ b/starmath/inc/helpids.h @@ -23,7 +23,6 @@ #define HID_SMA_FONTSIZEDIALOG "STARMATH_HID_SMA_FONTSIZEDIALOG" #define HID_SMA_FONTTYPEDIALOG "STARMATH_HID_SMA_FONTTYPEDIALOG" #define HID_SMA_DISTANCEDIALOG "STARMATH_HID_SMA_DISTANCEDIALOG" -#define HID_SMA_ALIGNDIALOG "STARMATH_HID_SMA_ALIGNDIALOG" #define HID_SMA_SYMBOLDIALOG "STARMATH_HID_SMA_SYMBOLDIALOG" #define HID_SMA_SYMDEFINEDIALOG "STARMATH_HID_SMA_SYMDEFINEDIALOG" #define HID_SMA_WIN_DOCUMENT "STARMATH_HID_SMA_WIN_DOCUMENT" diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index a9bfbfa83119..c9dc005e4ab9 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -85,7 +85,6 @@ #define RID_FONTSIZEDIALOG (RID_APP_START + 3) #define RID_FONTTYPEDIALOG (RID_APP_START + 4) #define RID_DISTANCEDIALOG (RID_APP_START + 5) -#define RID_ALIGNDIALOG (RID_APP_START + 6) #define RID_PRINTOPTIONPAGE (RID_APP_START + 7) #define RID_SYMBOLDIALOG (RID_APP_START + 8) #define RID_SYMDEFINEDIALOG (RID_APP_START + 9) diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 005b41a383b4..435911aeacf4 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1077,33 +1077,15 @@ IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ } -IMPL_LINK( SmAlignDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) +SmAlignDialog::SmAlignDialog(Window * pParent) + : ModalDialog(pParent, "AlignmentDialog", + "modules/smath/ui/alignmentdialog.ui") { - // start help system - Help* pHelp = Application::GetHelp(); - if( pHelp ) - { - pHelp->Start( OUString( "HID_SMA_ALIGNDIALOG" ), &aHelpButton1 ); - } - return 0; -} - -SmAlignDialog::SmAlignDialog(Window * pParent, bool bFreeRes) - : ModalDialog(pParent, SmResId(RID_ALIGNDIALOG)), - aLeft (this, SmResId(1)), - aCenter (this, SmResId(2)), - aRight (this, SmResId(3)), - aFixedLine1 (this, SmResId(1)), - aOKButton1 (this, SmResId(1)), - aHelpButton1 (this, SmResId(1)), - aCancelButton1 (this, SmResId(1)), - aDefaultButton (this, SmResId(1)) -{ - if (bFreeRes) - FreeResource(); - - aDefaultButton.SetClickHdl(LINK(this, SmAlignDialog, DefaultButtonClickHdl)); - aHelpButton1.SetClickHdl(LINK(this, SmAlignDialog, HelpButtonClickHdl)); + get(m_pLeft, "left"); + get(m_pCenter, "center"); + get(m_pRight, "right"); + get(m_pDefaultButton, "default"); + m_pDefaultButton->SetClickHdl(LINK(this, SmAlignDialog, DefaultButtonClickHdl)); } @@ -1112,21 +1094,21 @@ void SmAlignDialog::ReadFrom(const SmFormat &rFormat) switch (rFormat.GetHorAlign()) { case AlignLeft: - aLeft .Check(true); - aCenter.Check(false); - aRight .Check(false); + m_pLeft->Check(true); + m_pCenter->Check(false); + m_pRight->Check(false); break; case AlignCenter: - aLeft .Check(false); - aCenter.Check(true); - aRight .Check(false); + m_pLeft->Check(false); + m_pCenter->Check(true); + m_pRight->Check(false); break; case AlignRight: - aLeft .Check(false); - aCenter.Check(false); - aRight .Check(true); + m_pLeft->Check(false); + m_pCenter->Check(false); + m_pRight->Check(true); break; } } @@ -1134,9 +1116,9 @@ void SmAlignDialog::ReadFrom(const SmFormat &rFormat) void SmAlignDialog::WriteTo(SmFormat &rFormat) const { - if (aLeft.IsChecked()) + if (m_pLeft->IsChecked()) rFormat.SetHorAlign(AlignLeft); - else if (aRight.IsChecked()) + else if (m_pRight->IsChecked()) rFormat.SetHorAlign(AlignRight); else rFormat.SetHorAlign(AlignCenter); diff --git a/starmath/source/smres.src b/starmath/source/smres.src index ec96e52a5623..91338dafc374 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -869,75 +869,6 @@ ModalDialog RID_DISTANCEDIALOG }; -ModalDialog RID_ALIGNDIALOG -{ - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - HelpId = CMD_SID_ALIGN ; - Size = MAP_APPFONT ( 139 , 80 ) ; - Text [ en-US ] = "Alignment" ; - RadioButton 1 - { - HelpID = "starmath:RadioButton:RID_ALIGNDIALOG:1"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 17 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "~Left" ; - }; - RadioButton 2 - { - HelpID = "starmath:RadioButton:RID_ALIGNDIALOG:2"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "~Centered" ; - }; - RadioButton 3 - { - HelpID = "starmath:RadioButton:RID_ALIGNDIALOG:3"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 44 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "~Right" ; - }; - FixedLine 1 - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 71 , 8 ) ; - Text [ en-US ] = "Horizontal" ; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 83 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 83 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 83 , 46 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - HelpID = "starmath:HelpButton:RID_ALIGNDIALOG:1"; - Text [ en-US ] = "~Help" ; - }; - PushButton 1 - { - HelpID = "starmath:PushButton:RID_ALIGNDIALOG:1"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 83 , 63 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Default" ; - }; -}; - TabPage RID_PRINTOPTIONPAGE { HelpID = "starmath:TabPage:RID_PRINTOPTIONPAGE"; diff --git a/starmath/uiconfig/smath/ui/alignment.ui b/starmath/uiconfig/smath/ui/alignment.ui deleted file mode 100644 index 5e92705cfe51..000000000000 --- a/starmath/uiconfig/smath/ui/alignment.ui +++ /dev/null @@ -1,172 +0,0 @@ - - - - - False - 6 - Alignment - 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 - - - - - False - True - end - 0 - - - - - True - False - 0 - none - - - True - False - 6 - 12 - - - True - False - vertical - - - _Left - True - True - False - False - True - 0 - True - True - - - False - True - 0 - - - - - _Centered - True - True - False - False - True - 0 - True - True - - - False - True - 1 - - - - - _Right - True - True - False - False - True - 0 - True - True - - - False - True - 2 - - - - - - - - - True - False - <b>Horizontal</b> - True - True - - - - - False - True - 1 - - - - - - ok - cancel - help - - - diff --git a/starmath/uiconfig/smath/ui/alignmentdialog.ui b/starmath/uiconfig/smath/ui/alignmentdialog.ui new file mode 100644 index 000000000000..25ae7dce497a --- /dev/null +++ b/starmath/uiconfig/smath/ui/alignmentdialog.ui @@ -0,0 +1,190 @@ + + + + + False + 6 + Alignment + dialog + + + False + 12 + + + False + vertical + start + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + _Default + True + True + True + True + right + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + vertical + 6 + + + _Left + True + True + False + True + 0 + True + center + + + False + True + 0 + + + + + _Centered + True + True + False + True + 0 + True + True + right + + + False + True + 1 + + + + + _Right + True + True + False + True + 0 + True + left + + + False + True + 2 + + + + + + + + + True + False + Horizontal + True + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + default + + + -- cgit