diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-01 21:32:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-07 16:17:51 +0000 |
commit | 5d4a4f75981a9a8c199164959d3acee438d864b4 (patch) | |
tree | dd3c159ec7e3e5968387c3392354564e2e4c0cca /cui | |
parent | ad1e2d087b3b313174bdbbc929ace3788074a2f4 (diff) |
pick out graphic numbering page to cui and adapt code
Change-Id: I8bfd09a1f48fe892fb1a99962d0a46de8b7cb1ec
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UI_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/numpages.hxx | 7 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 69 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.hrc | 6 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.src | 41 | ||||
-rw-r--r-- | cui/uiconfig/ui/pickgraphicpage.ui | 85 |
7 files changed, 121 insertions, 89 deletions
diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk index e12646039772..4b43725a81e0 100644 --- a/cui/UI_cui.mk +++ b/cui/UI_cui.mk @@ -20,6 +20,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ cui/uiconfig/ui/macroselectordialog \ cui/uiconfig/ui/numberformatpage \ cui/uiconfig/ui/personalization_tab \ + cui/uiconfig/ui/pickgraphicpage \ cui/uiconfig/ui/picknumberingpage \ cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/scriptorganizer \ diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index 22993bcb2b6f..cfd077f3eda7 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -295,7 +295,6 @@ #define HID_FORMAT_PARAGRAPH_STD "CUI_HID_FORMAT_PARAGRAPH_STD" #define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM" #define HID_VALUESET_NUMBMP "CUI_HID_VALUESET_NUMBMP" -#define HID_SVXPAGE_PICK_BMP "CUI_HID_SVXPAGE_PICK_BMP" #define HID_SVXPAGE_NUM_OPTIONS "CUI_HID_SVXPAGE_NUM_OPTIONS" #define HID_SVXPAGE_NUM_POSITION "CUI_HID_SVXPAGE_NUM_POSITION" #define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW" diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 6a909c84861e..830c7a8d03c3 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -185,10 +185,9 @@ class SvxBitmapPickTabPage : public SfxTabPage using TabPage::ActivatePage; using TabPage::DeactivatePage; - FixedLine aValuesFL; - SvxBmpNumValueSet* pExamplesVS; - FixedText aErrorText; - CheckBox aLinkedCB; + FixedText* m_pErrorText; + SvxBmpNumValueSet* m_pExamplesVS; + CheckBox* m_pLinkedCB; std::vector<String> aGrfNames; String sNumCharFmtName; diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 527e9513fd19..06c917943c12 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -783,58 +783,53 @@ void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet) } SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_BMP ), rSet ), - aValuesFL( this, CUI_RES(FL_VALUES) ), - pExamplesVS( new SvxBmpNumValueSet(this, CUI_RES(VS_VALUES)/*, aGrfNames*/ )), - aErrorText( this, CUI_RES(FT_ERROR)), - aLinkedCB( this, CUI_RES(CB_LINKED)), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - nNumItemId(SID_ATTR_NUMBERING_RULE), - bModified(sal_False), - bPreset(sal_False) + const SfxItemSet& rSet) + : SfxTabPage(pParent, "PickGraphicPage", "cui/ui/pickgraphicpage.ui", rSet) + , pActNum(0) + , pSaveNum(0) + , nActNumLvl(USHRT_MAX) + , nNumItemId(SID_ATTR_NUMBERING_RULE) + , bModified(false) + , bPreset(false) { - FreeResource(); SetExchangeSupport(); + get(m_pErrorText, "errorft"); + get(m_pLinkedCB, "linkgraphics"); + get(m_pExamplesVS, "valueset"); + m_pExamplesVS->SetSelectHdl(LINK(this, SvxBitmapPickTabPage, NumSelectHdl_Impl)); + m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, DoubleClickHdl_Impl)); + m_pLinkedCB->SetClickHdl(LINK(this, SvxBitmapPickTabPage, LinkBmpHdl_Impl)); + eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE)); - pExamplesVS->SetSelectHdl(LINK(this, SvxBitmapPickTabPage, NumSelectHdl_Impl)); - pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, DoubleClickHdl_Impl)); - aLinkedCB.SetClickHdl(LINK(this, SvxBitmapPickTabPage, LinkBmpHdl_Impl)); // determine graphic name GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); - pExamplesVS->SetHelpId(HID_VALUESET_NUMBMP ); sal_uInt16 i = 0; for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) { - pExamplesVS->InsertItem( i + 1, i); + m_pExamplesVS->InsertItem( i + 1, i); INetURLObject aObj(*it); if(aObj.GetProtocol() == INET_PROT_FILE) *it = aObj.PathToFileName(); - pExamplesVS->SetItemText( i + 1, *it ); + m_pExamplesVS->SetItemText( i + 1, *it ); } if(aGrfNames.empty()) { - aErrorText.Show(); + m_pErrorText->Show(); } else { - pExamplesVS->Show(); - pExamplesVS->Format(); + m_pExamplesVS->Show(); + m_pExamplesVS->Format(); } - - pExamplesVS->SetAccessibleRelationMemberOf( &aValuesFL ); } SvxBitmapPickTabPage::~SvxBitmapPickTabPage() { - delete pExamplesVS; delete pActNum; delete pSaveNum; } @@ -866,14 +861,14 @@ void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet) if(*pSaveNum != *pActNum) { *pActNum = *pSaveNum; - pExamplesVS->SetNoSelection(); + m_pExamplesVS->SetNoSelection(); } if(!aGrfNames.empty() && (pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))) { - pExamplesVS->SelectItem(1); - NumSelectHdl_Impl(pExamplesVS); + m_pExamplesVS->SelectItem(1); + NumSelectHdl_Impl(m_pExamplesVS); bPreset = sal_True; } bPreset |= bIsPreset; @@ -930,13 +925,13 @@ void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet ) *pActNum = *pSaveNum; if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP)) { - aLinkedCB.Check(sal_False); - aLinkedCB.Enable(sal_False); + m_pLinkedCB->Check(sal_False); + m_pLinkedCB->Enable(sal_False); } else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP)) { - aLinkedCB.Check(sal_True); - aLinkedCB.Enable(sal_False); + m_pLinkedCB->Check(sal_True); + m_pLinkedCB->Enable(sal_False); } } @@ -946,12 +941,12 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl) { bPreset = sal_False; bModified = sal_True; - sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; + sal_uInt16 nIdx = m_pExamplesVS->GetSelectItemId() - 1; sal_uInt16 nMask = 1; String aEmptyStr; sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP; - if(aLinkedCB.IsChecked()) + if(m_pLinkedCB->IsChecked()) nSetNumberingType |= LINK_TOKEN; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) { @@ -985,7 +980,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl) IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl) { - NumSelectHdl_Impl(pExamplesVS); + NumSelectHdl_Impl(m_pExamplesVS); OKButton& rOk = GetTabDialog()->GetOKButton(); rOk.GetClickHdl().Call(&rOk); return 0; @@ -993,9 +988,9 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl) IMPL_LINK_NOARG(SvxBitmapPickTabPage, LinkBmpHdl_Impl) { - if(!pExamplesVS->IsNoSelection()) + if(!m_pExamplesVS->IsNoSelection()) { - NumSelectHdl_Impl(pExamplesVS); + NumSelectHdl_Impl(m_pExamplesVS); } return 0; } diff --git a/cui/source/tabpages/numpages.hrc b/cui/source/tabpages/numpages.hrc index 0ed76b42a988..728b6306758f 100644 --- a/cui/source/tabpages/numpages.hrc +++ b/cui/source/tabpages/numpages.hrc @@ -27,12 +27,6 @@ #define LB_FORM 210 #define ED_FORM 211 -#define FL_VALUES 220 -#define VS_VALUES 221 -#define ST_CUSTOMIZE 222 -#define FT_ERROR 223 -#define CB_LINKED 224 - #define FT_LEVEL 151 #define LB_LEVEL 152 #define FL_FORMAT 153 diff --git a/cui/source/tabpages/numpages.src b/cui/source/tabpages/numpages.src index 335dd794389b..310f61b4e49c 100644 --- a/cui/source/tabpages/numpages.src +++ b/cui/source/tabpages/numpages.src @@ -23,47 +23,6 @@ /**************************************************************************/ /* */ -/* TabPage */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_PICK_BMP -{ - HelpID = HID_SVXPAGE_PICK_BMP; - SVLook = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Hide = TRUE; - FixedLine FL_VALUES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_VALUES - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 152 ) ; - TabStop = TRUE ; - Hide = TRUE ; - }; - CheckBox CB_LINKED - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PICK_BMP:CB_LINKED"; - Pos = MAP_APPFONT ( 9 , 169 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Link graphics"; - }; - FixedText FT_ERROR - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 30 ) ; - Text [ en-US ] = "The Gallery theme 'Bullets' is empty (no graphics)." ; - Hide = TRUE ; - WordBreak = TRUE ; - }; -}; -/**************************************************************************/ -/* */ /* TabPage Numerierungsoptionen */ /* */ /**************************************************************************/ diff --git a/cui/uiconfig/ui/pickgraphicpage.ui b/cui/uiconfig/ui/pickgraphicpage.ui new file mode 100644 index 000000000000..0fe5b6eb7085 --- /dev/null +++ b/cui/uiconfig/ui/pickgraphicpage.ui @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkFrame" id="PickGraphicPage"> + <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="alignment7"> + <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> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <object class="GtkCheckButton" id="linkgraphics"> + <property name="label" translatable="yes">_Link graphics</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="cuilo:SvxBmpNumValueSet" id="valueset"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="errorft"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">The Gallery theme 'Bullets' is empty (no graphics).</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Selection</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> +</interface> |