Kaydet (Commit) 5d4a4f75 authored tarafından Caolán McNamara's avatar Caolán McNamara

pick out graphic numbering page to cui and adapt code

Change-Id: I8bfd09a1f48fe892fb1a99962d0a46de8b7cb1ec
üst ad1e2d08
...@@ -20,6 +20,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ ...@@ -20,6 +20,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/macroselectordialog \ cui/uiconfig/ui/macroselectordialog \
cui/uiconfig/ui/numberformatpage \ cui/uiconfig/ui/numberformatpage \
cui/uiconfig/ui/personalization_tab \ cui/uiconfig/ui/personalization_tab \
cui/uiconfig/ui/pickgraphicpage \
cui/uiconfig/ui/picknumberingpage \ cui/uiconfig/ui/picknumberingpage \
cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/scriptorganizer \ cui/uiconfig/ui/scriptorganizer \
......
...@@ -295,7 +295,6 @@ ...@@ -295,7 +295,6 @@
#define HID_FORMAT_PARAGRAPH_STD "CUI_HID_FORMAT_PARAGRAPH_STD" #define HID_FORMAT_PARAGRAPH_STD "CUI_HID_FORMAT_PARAGRAPH_STD"
#define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM" #define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM"
#define HID_VALUESET_NUMBMP "CUI_HID_VALUESET_NUMBMP" #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_OPTIONS "CUI_HID_SVXPAGE_NUM_OPTIONS"
#define HID_SVXPAGE_NUM_POSITION "CUI_HID_SVXPAGE_NUM_POSITION" #define HID_SVXPAGE_NUM_POSITION "CUI_HID_SVXPAGE_NUM_POSITION"
#define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW" #define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW"
......
...@@ -185,10 +185,9 @@ class SvxBitmapPickTabPage : public SfxTabPage ...@@ -185,10 +185,9 @@ class SvxBitmapPickTabPage : public SfxTabPage
using TabPage::ActivatePage; using TabPage::ActivatePage;
using TabPage::DeactivatePage; using TabPage::DeactivatePage;
FixedLine aValuesFL; FixedText* m_pErrorText;
SvxBmpNumValueSet* pExamplesVS; SvxBmpNumValueSet* m_pExamplesVS;
FixedText aErrorText; CheckBox* m_pLinkedCB;
CheckBox aLinkedCB;
std::vector<String> aGrfNames; std::vector<String> aGrfNames;
String sNumCharFmtName; String sNumCharFmtName;
......
...@@ -783,58 +783,53 @@ void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet) ...@@ -783,58 +783,53 @@ void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet)
} }
SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent, SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent,
const SfxItemSet& rSet) : const SfxItemSet& rSet)
SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_BMP ), rSet ), : SfxTabPage(pParent, "PickGraphicPage", "cui/ui/pickgraphicpage.ui", rSet)
aValuesFL( this, CUI_RES(FL_VALUES) ), , pActNum(0)
pExamplesVS( new SvxBmpNumValueSet(this, CUI_RES(VS_VALUES)/*, aGrfNames*/ )), , pSaveNum(0)
aErrorText( this, CUI_RES(FT_ERROR)), , nActNumLvl(USHRT_MAX)
aLinkedCB( this, CUI_RES(CB_LINKED)), , nNumItemId(SID_ATTR_NUMBERING_RULE)
pActNum(0), , bModified(false)
pSaveNum(0), , bPreset(false)
nActNumLvl( USHRT_MAX ),
nNumItemId(SID_ATTR_NUMBERING_RULE),
bModified(sal_False),
bPreset(sal_False)
{ {
FreeResource();
SetExchangeSupport(); 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)); 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 // determine graphic name
GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
pExamplesVS->SetHelpId(HID_VALUESET_NUMBMP );
sal_uInt16 i = 0; sal_uInt16 i = 0;
for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) 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); INetURLObject aObj(*it);
if(aObj.GetProtocol() == INET_PROT_FILE) if(aObj.GetProtocol() == INET_PROT_FILE)
*it = aObj.PathToFileName(); *it = aObj.PathToFileName();
pExamplesVS->SetItemText( i + 1, *it ); m_pExamplesVS->SetItemText( i + 1, *it );
} }
if(aGrfNames.empty()) if(aGrfNames.empty())
{ {
aErrorText.Show(); m_pErrorText->Show();
} }
else else
{ {
pExamplesVS->Show(); m_pExamplesVS->Show();
pExamplesVS->Format(); m_pExamplesVS->Format();
} }
pExamplesVS->SetAccessibleRelationMemberOf( &aValuesFL );
} }
SvxBitmapPickTabPage::~SvxBitmapPickTabPage() SvxBitmapPickTabPage::~SvxBitmapPickTabPage()
{ {
delete pExamplesVS;
delete pActNum; delete pActNum;
delete pSaveNum; delete pSaveNum;
} }
...@@ -866,14 +861,14 @@ void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet) ...@@ -866,14 +861,14 @@ void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(*pSaveNum != *pActNum) if(*pSaveNum != *pActNum)
{ {
*pActNum = *pSaveNum; *pActNum = *pSaveNum;
pExamplesVS->SetNoSelection(); m_pExamplesVS->SetNoSelection();
} }
if(!aGrfNames.empty() && if(!aGrfNames.empty() &&
(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))) (pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset)))
{ {
pExamplesVS->SelectItem(1); m_pExamplesVS->SelectItem(1);
NumSelectHdl_Impl(pExamplesVS); NumSelectHdl_Impl(m_pExamplesVS);
bPreset = sal_True; bPreset = sal_True;
} }
bPreset |= bIsPreset; bPreset |= bIsPreset;
...@@ -930,13 +925,13 @@ void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet ) ...@@ -930,13 +925,13 @@ void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet )
*pActNum = *pSaveNum; *pActNum = *pSaveNum;
if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP)) if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP))
{ {
aLinkedCB.Check(sal_False); m_pLinkedCB->Check(sal_False);
aLinkedCB.Enable(sal_False); m_pLinkedCB->Enable(sal_False);
} }
else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP)) else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP))
{ {
aLinkedCB.Check(sal_True); m_pLinkedCB->Check(sal_True);
aLinkedCB.Enable(sal_False); m_pLinkedCB->Enable(sal_False);
} }
} }
...@@ -946,12 +941,12 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl) ...@@ -946,12 +941,12 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl)
{ {
bPreset = sal_False; bPreset = sal_False;
bModified = sal_True; bModified = sal_True;
sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; sal_uInt16 nIdx = m_pExamplesVS->GetSelectItemId() - 1;
sal_uInt16 nMask = 1; sal_uInt16 nMask = 1;
String aEmptyStr; String aEmptyStr;
sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP; sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP;
if(aLinkedCB.IsChecked()) if(m_pLinkedCB->IsChecked())
nSetNumberingType |= LINK_TOKEN; nSetNumberingType |= LINK_TOKEN;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{ {
...@@ -985,7 +980,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl) ...@@ -985,7 +980,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl)
IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl) IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl)
{ {
NumSelectHdl_Impl(pExamplesVS); NumSelectHdl_Impl(m_pExamplesVS);
OKButton& rOk = GetTabDialog()->GetOKButton(); OKButton& rOk = GetTabDialog()->GetOKButton();
rOk.GetClickHdl().Call(&rOk); rOk.GetClickHdl().Call(&rOk);
return 0; return 0;
...@@ -993,9 +988,9 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl) ...@@ -993,9 +988,9 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl)
IMPL_LINK_NOARG(SvxBitmapPickTabPage, LinkBmpHdl_Impl) IMPL_LINK_NOARG(SvxBitmapPickTabPage, LinkBmpHdl_Impl)
{ {
if(!pExamplesVS->IsNoSelection()) if(!m_pExamplesVS->IsNoSelection())
{ {
NumSelectHdl_Impl(pExamplesVS); NumSelectHdl_Impl(m_pExamplesVS);
} }
return 0; return 0;
} }
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
#define LB_FORM 210 #define LB_FORM 210
#define ED_FORM 211 #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 FT_LEVEL 151
#define LB_LEVEL 152 #define LB_LEVEL 152
#define FL_FORMAT 153 #define FL_FORMAT 153
......
...@@ -21,47 +21,6 @@ ...@@ -21,47 +21,6 @@
#include "numpages.hrc" #include "numpages.hrc"
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
/**************************************************************************/
/* */
/* 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 */ /* TabPage Numerierungsoptionen */
......
<?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>
...@@ -106,8 +106,9 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet ...@@ -106,8 +106,9 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
Timer& GetFormatTimer() {return aFormatTimer;} Timer& GetFormatTimer() {return aFormatTimer;}
public: public:
SvxBmpNumValueSet(Window* pParent, const ResId& rResId); SvxBmpNumValueSet(Window* pParent, const ResId& rResId);
~SvxBmpNumValueSet(); SvxBmpNumValueSet(Window* pParent, WinBits nWinBits = WB_TABSTOP);
~SvxBmpNumValueSet();
virtual void UserDraw( const UserDrawEvent& rUDEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt );
......
...@@ -476,8 +476,20 @@ SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId ) ...@@ -476,8 +476,20 @@ SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId )
init(); init();
} }
SvxBmpNumValueSet::SvxBmpNumValueSet(Window* pParent, WinBits nWinBits)
: SvxNumValueSet(pParent, nWinBits)
{
init();
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxBmpNumValueSet(Window *pParent, VclBuilder::stringmap &)
{
return new SvxBmpNumValueSet(pParent, WB_TABSTOP);
}
void SvxBmpNumValueSet::init() void SvxBmpNumValueSet::init()
{ {
SvxNumValueSet::init(NUM_PAGETYPE_BMP);
bGrfNotFound = sal_False; bGrfNotFound = sal_False;
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS); GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
SetStyle( GetStyle() | WB_VSCROLL ); SetStyle( GetStyle() | WB_VSCROLL );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment