diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-22 11:27:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-22 11:45:29 +0100 |
commit | 7c04626ec7b54d8db2ff9bac19df75dd668ad8f7 (patch) | |
tree | 1b63881e46ab5124602544cb6ea04c7ab2cb95bf | |
parent | 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (diff) |
adapt code to alignment dialog .ui conversion
Change-Id: I8a64ddc076e177deaa61a450716d7d3dd8043303
-rw-r--r-- | starmath/UIConfig_smath.mk | 1 | ||||
-rw-r--r-- | starmath/inc/dialog.hxx | 15 | ||||
-rw-r--r-- | starmath/inc/helpids.h | 1 | ||||
-rw-r--r-- | starmath/inc/starmath.hrc | 1 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 56 | ||||
-rw-r--r-- | starmath/source/smres.src | 69 | ||||
-rw-r--r-- | starmath/uiconfig/smath/ui/alignmentdialog.ui (renamed from starmath/uiconfig/smath/ui/alignment.ui) | 46 |
7 files changed, 57 insertions, 132 deletions
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/alignmentdialog.ui index 5e92705cfe51..25ae7dce497a 100644 --- a/starmath/uiconfig/smath/ui/alignment.ui +++ b/starmath/uiconfig/smath/ui/alignmentdialog.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> - <object class="GtkDialog" id="alignment"> + <object class="GtkDialog" id="AlignmentDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes">Alignment</property> @@ -23,7 +23,6 @@ <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -38,7 +37,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -53,7 +51,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -62,6 +59,21 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkButton" id="default"> + <property name="label">_Default</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + <property name="image_position">right</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -74,12 +86,16 @@ <object class="GtkFrame" id="frame1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</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="hexpand">True</property> + <property name="vexpand">True</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> @@ -87,17 +103,17 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkRadioButton" id="radiobutton1"> + <object class="GtkRadioButton" id="left"> <property name="label" translatable="yes">_Left</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> - <property name="active">True</property> <property name="draw_indicator">True</property> + <property name="group">center</property> </object> <packing> <property name="expand">False</property> @@ -106,16 +122,16 @@ </packing> </child> <child> - <object class="GtkRadioButton" id="radiobutton2"> + <object class="GtkRadioButton" id="center"> <property name="label" translatable="yes">_Centered</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> + <property name="group">right</property> </object> <packing> <property name="expand">False</property> @@ -124,16 +140,15 @@ </packing> </child> <child> - <object class="GtkRadioButton" id="radiobutton3"> + <object class="GtkRadioButton" id="right"> <property name="label" translatable="yes">_Right</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> - <property name="active">True</property> <property name="draw_indicator">True</property> + <property name="group">left</property> </object> <packing> <property name="expand">False</property> @@ -149,9 +164,11 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes"><b>Horizontal</b></property> - <property name="font">True</property> + <property name="label" translatable="yes">Horizontal</property> <property name="use_underline">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -167,6 +184,7 @@ <action-widget response="0">ok</action-widget> <action-widget response="0">cancel</action-widget> <action-widget response="0">help</action-widget> + <action-widget response="0">default</action-widget> </action-widgets> </object> </interface> |