[Libreoffice-commits] core.git: starmath/inc starmath/source starmath/uiconfig starmath/UIConfig_smath.mk
Caolán McNamara
caolanm at redhat.com
Wed May 22 03:45:49 PDT 2013
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(-)
New commits:
commit 7c04626ec7b54d8db2ff9bac19df75dd668ad8f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 22 11:27:10 2013 +0100
adapt code to alignment dialog .ui conversion
Change-Id: I8a64ddc076e177deaa61a450716d7d3dd8043303
diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk
index 9fe1f8f..83a127a 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 ac0508f..34511b9 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 6d7f7bb..34fd0db 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 a9bfbfa..c9dc005 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 005b41a..435911a 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 ec96e52..91338da 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
similarity index 81%
rename from starmath/uiconfig/smath/ui/alignment.ui
rename to starmath/uiconfig/smath/ui/alignmentdialog.ui
index 5e92705..25ae7dc 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>
More information about the Libreoffice-commits
mailing list