summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-12 14:49:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-12 15:00:46 +0100
commit6a5eeaee0853c87e498ebd0546d97e9177dc4190 (patch)
treeb1e81b54085f99bf0362d67e3e51d69fd285000f
parentlisten for formula related configuration changes (diff)
downloadcore-6a5eeaee0853c87e498ebd0546d97e9177dc4190.tar.gz
core-6a5eeaee0853c87e498ebd0546d97e9177dc4190.zip
convert visiting cards page to .ui
Change-Id: Id541e1749572701827ab5a49df5197f77554c789
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/helpid.h2
-rw-r--r--sw/source/ui/envelp/label.hrc8
-rw-r--r--sw/source/ui/envelp/label.src44
-rw-r--r--sw/source/ui/envelp/label1.cxx73
-rw-r--r--sw/source/ui/envelp/labelexp.cxx32
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx10
-rw-r--r--sw/uiconfig/swriter/ui/cardformatpage.ui129
8 files changed, 183 insertions, 116 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 311364ce8cb6..8cb55b4c7ab1 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/bulletsandnumbering \
sw/uiconfig/swriter/ui/cannotsavelabeldialog \
sw/uiconfig/swriter/ui/captionoptions \
+ sw/uiconfig/swriter/ui/cardformatpage \
sw/uiconfig/swriter/ui/cardmediumpage \
sw/uiconfig/swriter/ui/characterproperties \
sw/uiconfig/swriter/ui/charurlpage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 3c54ef4f33fb..0766a2b6c898 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -166,7 +166,6 @@
#define HID_OPTCAPTION_PAGE "SW_HID_OPTCAPTION_PAGE"
#define HID_TP_TOX_SELECT "SW_HID_TP_TOX_SELECT"
#define HID_TP_TOX_ENTRY "SW_HID_TP_TOX_ENTRY"
-#define HID_TP_VISITING_CARDS "SW_HID_TP_VISITING_CARDS"
#define HID_DLG_ADD_IDX_STYLES "SW_HID_DLG_ADD_IDX_STYLES"
#define HID_ADD_STYLES_TLB "SW_HID_ADD_STYLES_TLB"
#define HID_OLE_CHECKLB "SW_HID_OLE_CHECKLB"
@@ -394,7 +393,6 @@
#define HID_AUTH_FIELD_ISBN "SW_HID_AUTH_FIELD_ISBN"
#define HID_INSERT_INDEX_ENTRY_LEVEL_LB "SW_HID_INSERT_INDEX_ENTRY_LEVEL_LB"
-#define HID_BUSINESS_CARD_CONTENT "SW_HID_BUSINESS_CARD_CONTENT"
#define HID_BUSINESS_FMT_PAGE "SW_HID_BUSINESS_FMT_PAGE"
#define HID_BUSINESS_FMT_PAGE_CONT "SW_HID_BUSINESS_FMT_PAGE_CONT"
#define HID_BUSINESS_FMT_PAGE_SHEET "SW_HID_BUSINESS_FMT_PAGE_SHEET"
diff --git a/sw/source/ui/envelp/label.hrc b/sw/source/ui/envelp/label.hrc
index b7bfaefc735a..4130face98d2 100644
--- a/sw/source/ui/envelp/label.hrc
+++ b/sw/source/ui/envelp/label.hrc
@@ -26,14 +26,6 @@
#define BTN_SYNC 20
-#define LB_AUTO_TEXT 3
-#define FT_AUTO_TEXT_GROUP 4
-#define LB_AUTO_TEXT_GROUP 5
-#define ED_TEXT 6
-#define FL_CONTENT 7
-#define WIN_EXAMPLE 8
-#define ST_VISCARD_GROUP 10
-
#define FL_DATA 30
#define FT_NAME 31
#define ED_FIRSTNAME 32
diff --git a/sw/source/ui/envelp/label.src b/sw/source/ui/envelp/label.src
index 4008642045fe..d19939c850a8 100644
--- a/sw/source/ui/envelp/label.src
+++ b/sw/source/ui/envelp/label.src
@@ -116,50 +116,6 @@ String STR_CUSTOM
Text [ en-US ] = "[User]";
};
/********************************************************************/
-TabPage TP_VISITING_CARDS
-{
- HelpID = HID_TP_VISITING_CARDS ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- Hide = TRUE ;
-
- Control LB_AUTO_TEXT
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 109 , 135 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_AUTO_TEXT_GROUP
- {
- Pos = MAP_APPFONT ( 12 , 153) ;
- Size = MAP_APPFONT ( 109 , 8 ) ;
- Text [ en-US ] = "AutoText - Section";
- };
- ListBox LB_AUTO_TEXT_GROUP
- {
- HelpID = "sw:ListBox:TP_VISITING_CARDS:LB_AUTO_TEXT_GROUP";
- Pos = MAP_APPFONT ( 12 , 164) ;
- Size = MAP_APPFONT ( 109 , 50 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedLine FL_CONTENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Content";
- };
- Window WIN_EXAMPLE
- {
- Pos = MAP_APPFONT ( 139, 14 ) ;
- Size = MAP_APPFONT ( 109 , 162 ) ;
- };
- String ST_VISCARD_GROUP
- {
- Text = "Cards";
- };
-};
TabPage TP_PRIVATE_DATA
{
HelpID = HID_TP_PRIVATE_DATA ;
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index d9383708f9c1..188ef9f197e9 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -548,11 +548,11 @@ void SwLabPage::Reset(const SfxItemSet& rSet)
void SwVisitingCardPage::ClearUserData()
{
- SvTreeListEntry* pEntry = aAutoTextLB.First();
+ SvTreeListEntry* pEntry = m_pAutoTextLB->First();
while(pEntry)
{
delete (String*)pEntry->GetUserData();
- pEntry = aAutoTextLB.Next(pEntry);
+ pEntry = m_pAutoTextLB->Next(pEntry);
}
}
@@ -561,43 +561,38 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt,
{
for( sal_uInt32 i = 0; i < nCnt; ++i )
{
- SvTreeListEntry* pEntry = aAutoTextLB.InsertEntry( pNames[ i ] );
+ SvTreeListEntry* pEntry = m_pAutoTextLB->InsertEntry( pNames[ i ] );
pEntry->SetUserData( new String( pValues[ i ] ));
}
}
-SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) :
- SfxTabPage(pParent, SW_RES(TP_VISITING_CARDS), rSet),
- aContentFL(this, SW_RES( FL_CONTENT )),
- aAutoTextLB(this, SW_RES( LB_AUTO_TEXT )),
- aAutoTextGroupFT(this, SW_RES( FT_AUTO_TEXT_GROUP )),
- aAutoTextGroupLB(this, SW_RES( LB_AUTO_TEXT_GROUP )),
- aExampleWIN(this, SW_RES( WIN_EXAMPLE )),
- sVisCardGroup(SW_RES(ST_VISCARD_GROUP)),
- pExampleFrame(0)
+SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "CardFormatPage",
+ "modules/swriter/ui/cardformatpage.ui", rSet)
+ , pExampleFrame(0)
{
- FreeResource();
- aAutoTextLB.SetStyle( aAutoTextLB.GetStyle() | WB_HSCROLL );
- aAutoTextLB.SetSpaceBetweenEntries(0);
- aAutoTextLB.SetSelectionMode( SINGLE_SELECTION );
- aAutoTextLB.SetHelpId(HID_BUSINESS_CARD_CONTENT);
+ get(m_pAutoTextLB, "treeview");
+ m_pAutoTextLB->set_height_request(m_pAutoTextLB->GetTextHeight() * 16);
+ get(m_pAutoTextGroupLB, "autotext");
+ get(m_pExampleWIN, "preview");
+
+ m_pAutoTextLB->SetStyle( m_pAutoTextLB->GetStyle() | WB_HSCROLL );
+ m_pAutoTextLB->SetSpaceBetweenEntries(0);
+ m_pAutoTextLB->SetSelectionMode( SINGLE_SELECTION );
SetExchangeSupport();
- aAutoTextLB.SetSelectHdl(LINK(this, SwVisitingCardPage, AutoTextSelectHdl));
- aAutoTextGroupLB.SetSelectHdl(LINK(this, SwVisitingCardPage, AutoTextSelectHdl));
+ m_pAutoTextLB->SetSelectHdl(LINK(this, SwVisitingCardPage, AutoTextSelectHdl));
+ m_pAutoTextGroupLB->SetSelectHdl(LINK(this, SwVisitingCardPage, AutoTextSelectHdl));
- aExampleWIN.Hide();
+ m_pExampleWIN->Hide();
- aAutoTextLB.Show();
- aAutoTextGroupFT.Show();
- aAutoTextGroupLB.Show();
InitFrameControl();
}
SwVisitingCardPage::~SwVisitingCardPage()
{
- for(sal_uInt16 i = 0; i < aAutoTextGroupLB.GetEntryCount(); i++)
- delete (String*)aAutoTextGroupLB.GetEntryData( i );
+ for(sal_uInt16 i = 0; i < m_pAutoTextGroupLB->GetEntryCount(); i++)
+ delete (String*)m_pAutoTextGroupLB->GetEntryData( i );
m_xAutoText = 0;
ClearUserData();
@@ -624,14 +619,14 @@ int SwVisitingCardPage::DeactivatePage(SfxItemSet* _pSet)
sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet)
{
- String* pGroup = (String*)aAutoTextGroupLB.GetEntryData(
- aAutoTextGroupLB.GetSelectEntryPos());
+ String* pGroup = (String*)m_pAutoTextGroupLB->GetEntryData(
+ m_pAutoTextGroupLB->GetSelectEntryPos());
OSL_ENSURE(pGroup, "no group selected?");
if(pGroup)
aLabItem.sGlossaryGroup = *pGroup;
- SvTreeListEntry* pSelEntry = aAutoTextLB.FirstSelected();
+ SvTreeListEntry* pSelEntry = m_pAutoTextLB->FirstSelected();
if(pSelEntry)
aLabItem.sGlossaryBlockName = *(String*)pSelEntry->GetUserData();
rSet.Put(aLabItem);
@@ -674,9 +669,9 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet)
bool bFound = false;
sal_uInt16 i;
- for(i = 0; i < aAutoTextGroupLB.GetEntryCount() && !bFound; i++)
+ for(i = 0; i < m_pAutoTextGroupLB->GetEntryCount() && !bFound; i++)
if( String(aLabItem.sGlossaryGroup) ==
- *(String*)aAutoTextGroupLB.GetEntryData( i ))
+ *(String*)m_pAutoTextGroupLB->GetEntryData( i ))
{
bFound = true;
break;
@@ -686,8 +681,8 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet)
{
// initially search for a group starting with "crd" which is the name of the
// business card AutoTexts
- for(i = 0; i < aAutoTextGroupLB.GetEntryCount() && !bFound; i++)
- if(0 == (*(String*)aAutoTextGroupLB.GetEntryData( i )).SearchAscii( "crd") )
+ for(i = 0; i < m_pAutoTextGroupLB->GetEntryCount() && !bFound; i++)
+ if(0 == (*(String*)m_pAutoTextGroupLB->GetEntryData( i )).SearchAscii( "crd") )
{
bFound = true;
break;
@@ -695,19 +690,19 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet)
}
if(bFound)
{
- if(aAutoTextGroupLB.GetSelectEntryPos() != i)
+ if(m_pAutoTextGroupLB->GetSelectEntryPos() != i)
{
- aAutoTextGroupLB.SelectEntryPos(i);
- AutoTextSelectHdl(&aAutoTextGroupLB);
+ m_pAutoTextGroupLB->SelectEntryPos(i);
+ AutoTextSelectHdl(m_pAutoTextGroupLB);
}
- if(lcl_FindBlock(aAutoTextLB, aLabItem.sGlossaryBlockName))
+ if(lcl_FindBlock(*m_pAutoTextLB, aLabItem.sGlossaryBlockName))
{
- SvTreeListEntry* pSelEntry = aAutoTextLB.FirstSelected();
+ SvTreeListEntry* pSelEntry = m_pAutoTextLB->FirstSelected();
if( pSelEntry &&
*(String*)pSelEntry->GetUserData() != String(aLabItem.sGlossaryBlockName))
{
- lcl_SelectBlock(aAutoTextLB, aLabItem.sGlossaryBlockName);
- AutoTextSelectHdl(&aAutoTextLB);
+ lcl_SelectBlock(*m_pAutoTextLB, aLabItem.sGlossaryBlockName);
+ AutoTextSelectHdl(m_pAutoTextLB);
}
}
}
diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx
index 7104b8829fb3..b8ae603439a2 100644
--- a/sw/source/ui/envelp/labelexp.cxx
+++ b/sw/source/ui/envelp/labelexp.cxx
@@ -45,8 +45,8 @@ using namespace ::comphelper;
void SwVisitingCardPage::InitFrameControl()
{
Link aLink(LINK(this, SwVisitingCardPage, FrameControlInitializedHdl));
- aExampleWIN.Show();
- pExampleFrame = new SwOneExampleFrame( aExampleWIN,
+ m_pExampleWIN->Show();
+ pExampleFrame = new SwOneExampleFrame( *m_pExampleWIN,
EX_SHOW_BUSINESS_CARDS, &aLink );
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
@@ -74,20 +74,20 @@ void SwVisitingCardPage::InitFrameControl()
OUString uTitle;
aTitle >>= uTitle;
String sGroup(pGroups[i]);
- sal_uInt16 nEntry = aAutoTextGroupLB.InsertEntry(uTitle);
- aAutoTextGroupLB.SetEntryData(nEntry, new String(sGroup));
+ sal_uInt16 nEntry = m_pAutoTextGroupLB->InsertEntry(uTitle);
+ m_pAutoTextGroupLB->SetEntryData(nEntry, new String(sGroup));
}
}
catch (const Exception&)
{
}
}
- if(aAutoTextGroupLB.GetEntryCount())
+ if(m_pAutoTextGroupLB->GetEntryCount())
{
- if(LISTBOX_ENTRY_NOTFOUND == aAutoTextGroupLB.GetSelectEntryPos())
- aAutoTextGroupLB.SelectEntryPos(0);
+ if(LISTBOX_ENTRY_NOTFOUND == m_pAutoTextGroupLB->GetSelectEntryPos())
+ m_pAutoTextGroupLB->SelectEntryPos(0);
String sCurGroupName(
- *(String*)aAutoTextGroupLB.GetEntryData(aAutoTextGroupLB.GetSelectEntryPos()));
+ *(String*)m_pAutoTextGroupLB->GetEntryData(m_pAutoTextGroupLB->GetSelectEntryPos()));
if(m_xAutoText->hasByName(sCurGroupName))
{
uno::Any aGroup = m_xAutoText->getByName(sCurGroupName);
@@ -111,17 +111,17 @@ void SwVisitingCardPage::InitFrameControl()
IMPL_LINK_NOARG(SwVisitingCardPage, FrameControlInitializedHdl)
{
- SvTreeListEntry* pSel = aAutoTextLB.FirstSelected();
+ SvTreeListEntry* pSel = m_pAutoTextLB->FirstSelected();
String sEntry;
if( pSel )
sEntry = *(String*)pSel->GetUserData();
uno::Reference< text::XTextCursor > & xCrsr = pExampleFrame->GetTextCursor();
OUString uEntry(sEntry);
- if(LISTBOX_ENTRY_NOTFOUND != aAutoTextGroupLB.GetSelectEntryPos())
+ if(LISTBOX_ENTRY_NOTFOUND != m_pAutoTextGroupLB->GetSelectEntryPos())
{
- String sGroup( *(String*)aAutoTextGroupLB.GetEntryData(
- aAutoTextGroupLB.GetSelectEntryPos() ) );
+ String sGroup( *(String*)m_pAutoTextGroupLB->GetEntryData(
+ m_pAutoTextGroupLB->GetSelectEntryPos() ) );
uno::Any aGroup = m_xAutoText->getByName(sGroup);
uno::Reference< text::XAutoTextGroup > xGroup;
aGroup >>= xGroup;
@@ -146,16 +146,16 @@ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox )
{
if(m_xAutoText.is())
{
- if( &aAutoTextGroupLB == pBox )
+ if (m_pAutoTextGroupLB == pBox)
{
- String sGroup( *(String*)aAutoTextGroupLB.GetEntryData(
- aAutoTextGroupLB.GetSelectEntryPos()));
+ String sGroup( *(String*)m_pAutoTextGroupLB->GetEntryData(
+ m_pAutoTextGroupLB->GetSelectEntryPos()));
uno::Any aGroup = m_xAutoText->getByName(sGroup);
uno::Reference< text::XAutoTextGroup > xGroup;
aGroup >>= xGroup;
ClearUserData();
- aAutoTextLB.Clear();
+ m_pAutoTextLB->Clear();
uno::Sequence<OUString> aBlockNames = xGroup->getElementNames();
uno::Sequence< OUString > aTitles = xGroup->getTitles() ;
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 52e0f9033920..977e2f97b7ce 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -83,14 +83,10 @@ public:
class SwOneExampleFrame;
class SwVisitingCardPage : public SfxTabPage
{
- FixedLine aContentFL;
- SvTreeListBox aAutoTextLB;
- FixedText aAutoTextGroupFT;
- ListBox aAutoTextGroupLB;
+ SvTreeListBox* m_pAutoTextLB;
+ ListBox* m_pAutoTextGroupLB;
+ Window* m_pExampleWIN;
- Window aExampleWIN;
-
- String sVisCardGroup;
String sTempURL;
SwLabItem aLabItem;
diff --git a/sw/uiconfig/swriter/ui/cardformatpage.ui b/sw/uiconfig/swriter/ui/cardformatpage.ui
new file mode 100644
index 000000000000..2f5752f40ee0
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/cardformatpage.ui
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkFrame" id="CardFormatPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</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="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="column_spacing">12</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">AutoText - Section</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">autotext</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>
+ <child>
+ <object class="GtkComboBoxText" id="autotext">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="entry_text_column">0</property>
+ <property name="id_column">1</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>
+ </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="svtlo-SvTreeListBox" id="treeview:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Tree List-selection1"/>
+ </child>
+ </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>
+ <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>
+ <child>
+ <object class="GtkBox" id="preview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</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="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Content</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+</interface>