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,\
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 \
......
......@@ -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"
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
......@@ -21,47 +21,6 @@
#include "numpages.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 */
......
<?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
Timer& GetFormatTimer() {return aFormatTimer;}
public:
SvxBmpNumValueSet(Window* pParent, const ResId& rResId);
~SvxBmpNumValueSet();
SvxBmpNumValueSet(Window* pParent, const ResId& rResId);
SvxBmpNumValueSet(Window* pParent, WinBits nWinBits = WB_TABSTOP);
~SvxBmpNumValueSet();
virtual void UserDraw( const UserDrawEvent& rUDEvt );
......
......@@ -476,8 +476,20 @@ SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId )
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()
{
SvxNumValueSet::init(NUM_PAGETYPE_BMP);
bGrfNotFound = sal_False;
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
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