diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-26 09:55:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-26 09:59:39 +0000 |
commit | fdc1b1fc174da27e3016370fdb603d6bbe49af4d (patch) | |
tree | a747f4c78b6c333fa71ed40296135d153a07778b /cui | |
parent | 297f5b525f22e05bad8b17c98be2a716463d0408 (diff) |
convert search format dialog to .ui
Change-Id: I29db27f8adf2afda7e47b69c43b032758c1e7b24
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/dialogs/srchxtra.cxx | 112 | ||||
-rw-r--r-- | cui/source/dialogs/srchxtra.src | 62 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 20 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 5 | ||||
-rw-r--r-- | cui/source/inc/srchxtra.hxx | 10 | ||||
-rw-r--r-- | cui/uiconfig/ui/searchformatdialog.ui | 233 |
7 files changed, 298 insertions, 145 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index b508acc4ed7a..95fdba3dd17e 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -128,6 +128,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/recordnumberdialog \ cui/uiconfig/ui/rotationtabpage \ cui/uiconfig/ui/scriptorganizer \ + cui/uiconfig/ui/searchformatdialog \ cui/uiconfig/ui/securityoptionsdialog \ cui/uiconfig/ui/select_persona_dialog \ cui/uiconfig/ui/shadowtabpage \ diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 87857a97287a..7000d954e778 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -37,87 +37,77 @@ #include <rtl/strbuf.hxx> #include "svtools/treelistentry.hxx" -// class SvxSearchFormatDialog ------------------------------------------- - -SvxSearchFormatDialog::SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet ) : - - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_SEARCHFORMAT ), &rSet ), - - pFontList( NULL ) - +SvxSearchFormatDialog::SvxSearchFormatDialog(Window* pParent, const SfxItemSet& rSet) + : SfxTabDialog(pParent, "SearchFormatDialog", "cui/ui/searchformatdialog.ui", &rSet) + , m_pFontList(NULL) + , m_nNamePageId(0) + , m_nParaStdPageId(0) + , m_nParaAlignPageId(0) + , m_nBackPageId(0) { - FreeResource(); - - AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_CHAR_TWOLINES, SvxCharTwoLinesPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 ); + m_nNamePageId = AddTabPage("font", SvxCharNamePage::Create, 0); + AddTabPage("fonteffects", SvxCharEffectsPage::Create, 0); + AddTabPage("position", SvxCharPositionPage::Create, 0); + AddTabPage("asianlayout", SvxCharTwoLinesPage::Create, 0); + m_nParaStdPageId = AddTabPage("labelTP_PARA_STD", SvxStdParagraphTabPage::Create, 0); + m_nParaAlignPageId = AddTabPage("labelTP_PARA_ALIGN", SvxParaAlignTabPage::Create, 0); + AddTabPage("labelTP_PARA_EXT", SvxExtParagraphTabPage::Create, 0); + AddTabPage("labelTP_PARA_ASIAN", SvxAsianTabPage::Create, 0 ); + m_nBackPageId = AddTabPage("background", SvxBackgroundTabPage::Create, 0); // remove asian tabpages if necessary SvtCJKOptions aCJKOptions; if ( !aCJKOptions.IsDoubleLinesEnabled() ) - RemoveTabPage( RID_SVXPAGE_CHAR_TWOLINES ); + RemoveTabPage("asianlayout"); if ( !aCJKOptions.IsAsianTypographyEnabled() ) - RemoveTabPage( RID_SVXPAGE_PARA_ASIAN ); + RemoveTabPage("labelTP_PARA_ASIAN"); } -// ----------------------------------------------------------------------- - SvxSearchFormatDialog::~SvxSearchFormatDialog() { - delete pFontList; + delete m_pFontList; } -// ----------------------------------------------------------------------- - void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage ) { - switch ( nId ) + if (nId == m_nNamePageId) { - case RID_SVXPAGE_CHAR_NAME: - { - const FontList* pAppFontList = 0; - SfxObjectShell* pSh = SfxObjectShell::Current(); + const FontList* pApm_pFontList = 0; + SfxObjectShell* pSh = SfxObjectShell::Current(); - if ( pSh ) - { - const SvxFontListItem* pFLItem = (const SvxFontListItem*) - pSh->GetItem( SID_ATTR_CHAR_FONTLIST ); - if ( pFLItem ) - pAppFontList = pFLItem->GetFontList(); - } + if ( pSh ) + { + const SvxFontListItem* pFLItem = (const SvxFontListItem*) + pSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + if ( pFLItem ) + pApm_pFontList = pFLItem->GetFontList(); + } - const FontList* pList = pAppFontList; + const FontList* pList = pApm_pFontList; - if ( !pList ) - { - if ( !pFontList ) - pFontList = new FontList( this ); - pList = pFontList; - } - - if ( pList ) - ( (SvxCharNamePage&)rPage ). - SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) ); - ( (SvxCharNamePage&)rPage ).EnableSearchMode(); - break; + if ( !pList ) + { + if ( !m_pFontList ) + m_pFontList = new FontList( this ); + pList = m_pFontList; } - case RID_SVXPAGE_STD_PARAGRAPH: - ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine(); - break; - - case RID_SVXPAGE_ALIGN_PARAGRAPH: - ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt(); - break; - case RID_SVXPAGE_BACKGROUND : - ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(sal_True); - break; + if ( pList ) + ( (SvxCharNamePage&)rPage ). + SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) ); + ( (SvxCharNamePage&)rPage ).EnableSearchMode(); + } + else if (nId == m_nParaStdPageId) + { + ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine(); + } + else if (nId == m_nParaAlignPageId) + { + ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt(); + } + else if (nId == m_nBackPageId) + { + ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(sal_True); } } diff --git a/cui/source/dialogs/srchxtra.src b/cui/source/dialogs/srchxtra.src index ec032f7d3fda..d8b2b5a718d7 100644 --- a/cui/source/dialogs/srchxtra.src +++ b/cui/source/dialogs/srchxtra.src @@ -22,67 +22,7 @@ #include "srchxtra.hrc" #include <svx/dialogs.hrc> - // RID_SVXDLG_SEARCHFORMAT ----------------------------------------------- -TabDialog RID_SVXDLG_SEARCHFORMAT -{ - OutputSize = TRUE ; - SvLook = TRUE ; - Text [ en-US ] = "Text Format" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_CHAR_NAME ; - Text [ en-US ] = "Font" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_EFFECTS ; - Text [ en-US ] = "Font Effects" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_POSITION ; - Text [ en-US ] = "Position" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_TWOLINES ; - Text [ en-US ] = "Asian Layout" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_STD_PARAGRAPH ; - Text [ en-US ] = "Indents & Spacing" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ; - Text [ en-US ] = "Alignment" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_EXT_PARAGRAPH ; - Text [ en-US ] = "Text Flow" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_PARA_ASIAN; - Text [ en-US ] = "Asian Typography"; - }; - PageItem - { - Identifier = RID_SVXPAGE_BACKGROUND; - Text [ en-US ] = "Background" ; - }; - }; - }; -}; - // RID_SVXDLG_SEARCHATTRIBUTE -------------------------------------------- +// RID_SVXDLG_SEARCHATTRIBUTE -------------------------------------------- ModalDialog RID_SVXDLG_SEARCHATTR { HelpId = HID_SEARCHATTR ; diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 3cf3d972e8b2..a7a96c3ffc45 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1313,23 +1313,11 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( sal_uInt32, return new CuiAbstractSfxDialog_Impl( pDlg ); } -SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog( Window* pParent, - const SfxItemSet& rSet, - sal_uInt32 nResId) +SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog(Window* pParent, + const SfxItemSet& rSet) { - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case RID_SVXDLG_SEARCHFORMAT : - pDlg = new SvxSearchFormatDialog( pParent, rSet ); - break; - default: - break; - } - - if ( pDlg ) - return new CuiAbstractTabDialog_Impl( pDlg ); - return 0; + SfxTabDialog* pDlg = new SvxSearchFormatDialog(pParent, rSet); + return new CuiAbstractTabDialog_Impl(pDlg); } VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog( Window* pParent, diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 784130e0ad5c..cee1226ef3c4 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -552,9 +552,8 @@ public: const SfxItemSet* pAttrSet, SdrView* pView, SdrModel* pModel=0 ); - virtual SfxAbstractTabDialog* CreateTabItemDialog( Window* pParent, - const SfxItemSet& rSet, - sal_uInt32 nResId); + virtual SfxAbstractTabDialog* CreateTabItemDialog(Window* pParent, + const SfxItemSet& rSet); virtual AbstractSvxCaptionDialog* CreateCaptionDialog( Window* pParent, const SdrView* pView, sal_uInt16 nAnchorTypes = 0 ); diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx index 642f3c79aa28..d505204799a4 100644 --- a/cui/source/inc/srchxtra.hxx +++ b/cui/source/inc/srchxtra.hxx @@ -26,19 +26,21 @@ #include <svx/checklbx.hxx> #include <svx/srchdlg.hxx> -// class SvxSearchFormatDialog ------------------------------------------- - class SvxSearchFormatDialog : public SfxTabDialog { public: SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet ); - ~SvxSearchFormatDialog(); + virtual ~SvxSearchFormatDialog(); protected: virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); private: - FontList* pFontList; + FontList* m_pFontList; + sal_uInt16 m_nNamePageId; + sal_uInt16 m_nParaStdPageId; + sal_uInt16 m_nParaAlignPageId; + sal_uInt16 m_nBackPageId; }; // class SvxSearchFormatDialog ------------------------------------------- diff --git a/cui/uiconfig/ui/searchformatdialog.ui b/cui/uiconfig/ui/searchformatdialog.ui new file mode 100644 index 000000000000..0e1e9abf5223 --- /dev/null +++ b/cui/uiconfig/ui/searchformatdialog.ui @@ -0,0 +1,233 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="SearchFormatDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Text Format</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</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> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="font"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Font</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="fonteffects"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Font Effects</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="position"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Position</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="asianlayout"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Asian Layout</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="labelTP_PARA_STD"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Indents & Spacing</property> + </object> + <packing> + <property name="position">4</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="labelTP_PARA_ALIGN"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0.4699999988079071</property> + <property name="label" translatable="yes">Alignment</property> + </object> + <packing> + <property name="position">5</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="labelTP_PARA_EXT"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0.46000000834465027</property> + <property name="label" translatable="yes">Text Flow</property> + </object> + <packing> + <property name="position">6</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="labelTP_PARA_ASIAN"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Asian Typography</property> + </object> + <packing> + <property name="position">7</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="background"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Background</property> + </object> + <packing> + <property name="position">8</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <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">reset</action-widget> + </action-widgets> + </object> +</interface> |