Kaydet (Commit) a44a0690 authored tarafından Rishabh Kumar's avatar Rishabh Kumar Kaydeden (comit) Samuel Mehrbrodt

[GSoC] Add Bitmap tab to area dialog

Change-Id: I6549e7eb4efd24d035b0383a750698a4c3f16cf7
Reviewed-on: https://gerrit.libreoffice.org/27546Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst c9b2af04
......@@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/tabpages/textanim \
cui/source/tabpages/textattr \
cui/source/tabpages/tparea \
cui/source/tabpages/tpbitmap \
cui/source/tabpages/tpcolor \
cui/source/tabpages/tpgradnt \
cui/source/tabpages/tphatch \
......
......@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/autocorrectdialog \
cui/uiconfig/ui/backgroundpage \
cui/uiconfig/ui/baselinksdialog \
cui/uiconfig/ui/bitmaptabpage \
cui/uiconfig/ui/blackorwhitelistentrydialog \
cui/uiconfig/ui/borderareatransparencydialog \
cui/uiconfig/ui/borderbackgrounddialog \
......
......@@ -46,7 +46,7 @@ class SvxAreaTabDialog : public SfxTabDialog
sal_uInt16 m_nColorTabPage;
sal_uInt16 m_nGradientTabPage;
sal_uInt16 m_nHatchTabPage;
//sal_uInt16 m_nBitmapTabPage;
sal_uInt16 m_nBitmapTabPage;
sal_uInt16 m_nPatternTabPage;
private:
......@@ -553,6 +553,65 @@ public:
/************************************************************************/
class SvxBitmapTabPage : public SvxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
VclPtr<SvxPresetListBox> m_pBitmapLB;
VclPtr<PushButton> m_pBtnImport;
VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
const SfxItemSet& m_rOutAttrs;
XBitmapListRef m_pBitmapList;
ChangeType* m_pnBitmapListState;
XFillStyleItem m_aXFStyleItem;
XFillBitmapItem m_aXBitmapItem;
sal_uInt16* m_nPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_nPos;
bool* m_pbAreaTP;
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
DECL_LINK_TYPED( ModifyBitmapHdl, ValueSet*, void );
DECL_LINK_TYPED( ClickRenameHdl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickDeleteHdl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickImportHdl, Button*, void );
void ClickBitmapHdl_Impl();
sal_Int32 SearchBitmapList(const OUString& rBitmapName);
public:
SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxBitmapTabPage();
virtual void dispose() override;
void Construct();
static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
virtual void ActivatePage( const SfxItemSet& rSet ) override;
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override;
void SetBitmapList( XBitmapListRef pBmpLst) { m_pBitmapList = pBmpLst; }
void SetPageType( sal_uInt16* pInType ) { m_nPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_nPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
void SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; }
};
/************************************************************************/
class SvxPatternTabPage : public SvxTabPage
{
using TabPage::ActivatePage;
......
......@@ -92,6 +92,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, nullptr );
m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, nullptr );
m_nHatchTabPage = AddTabPage( "RID_SVXPAGE_HATCH", SvxHatchTabPage::Create, nullptr );
m_nBitmapTabPage = AddTabPage( "RID_SVXPAGE_BITMAP", SvxBitmapTabPage::Create, nullptr );
m_nPatternTabPage = AddTabPage( "RID_SVXPAGE_PATTERN", SvxPatternTabPage::Create, nullptr);
SetCurPageId( "RID_SVXPAGE_AREA" );
......@@ -309,6 +310,16 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
static_cast<SvxHatchTabPage&>(rPage).SetColorChgd( &mnColorListState );
static_cast<SvxHatchTabPage&>(rPage).Construct();
}
else if (nId == m_nBitmapTabPage )
{
static_cast<SvxBitmapTabPage&>(rPage).SetBitmapList( mpBitmapList );
static_cast<SvxBitmapTabPage&>(rPage).SetPageType( &mnPageType );
static_cast<SvxBitmapTabPage&>(rPage).SetDlgType( 0 );
static_cast<SvxBitmapTabPage&>(rPage).SetPos( &mnPos );
static_cast<SvxBitmapTabPage&>(rPage).SetAreaTP( &mbAreaTP );
static_cast<SvxBitmapTabPage&>(rPage).SetBmpChgd( &mnBitmapListState );
static_cast<SvxBitmapTabPage&>(rPage).Construct();
}
else if (nId == m_nPatternTabPage)
{
static_cast<SvxPatternTabPage&>(rPage).SetColorList( mpColorList );
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="AreaDialog">
......@@ -176,6 +176,20 @@
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="RID_SVXPAGE_BITMAP">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Bitmap</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="RID_SVXPAGE_PATTERN">
<property name="visible">True</property>
......@@ -183,7 +197,7 @@
<property name="label" translatable="yes">Patterns</property>
</object>
<packing>
<property name="position">6</property>
<property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="BitmapTabPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
<object class="GtkFrame" id="Fill Frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</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="halign">start</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="spacing">6</property>
<child>
<object class="svxcorelo-SvxPresetListBox" id="BITMAP">
<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="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BTN_IMPORT">
<property name="label" translatable="yes">Add / Import</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Fill</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="orientation">vertical</property>
<child>
<object class="svxlo-SvxXRectPreview" id="CTL_BITMAP_PREVIEW">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="CTL_BITMAP_PREVIEW-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Example</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Preview</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
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