Kaydet (Commit) 4b42db15 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert docinfo field page to .ui

Change-Id: Ic968fdf76f31373240ab70d45192f9716375628b
üst 81aa4049
......@@ -392,6 +392,10 @@
generic-name="PropertyControl" parent="VclComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
<glade-widget-class title="NumFormatListBox" name="swlo-NumFormatListBox"
generic-name="NumFormatListBox" parent="VclComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
<glade-widget-class title="Reference Button" name="foruilo-RefButton"
generic-name="Reference Button" parent="GtkButton"
icon-name="widget-gtk-button"/>
......
......@@ -194,6 +194,12 @@ public:
{
return m_pTabCtrl->GetCurPageId();
}
SfxTabPage* GetCurTabPage() const
{
return GetTabPage(m_pTabCtrl->GetCurPageId());
}
OUString GetPageText( sal_uInt16 nPageId ) const
{
return m_pTabCtrl->GetPageText(nPageId);
......
......@@ -102,7 +102,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/envelp/labfmt.src \
sw/source/ui/envelp/mailmrge.src \
sw/source/ui/fldui/flddb.src \
sw/source/ui/fldui/flddinf.src \
sw/source/ui/fldui/flddok.src \
sw/source/ui/fldui/fldfunc.src \
sw/source/ui/fldui/fldref.src \
......
......@@ -90,6 +90,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/envformatpage \
sw/uiconfig/swriter/ui/envprinterpage \
sw/uiconfig/swriter/ui/exchangedatabases \
sw/uiconfig/swriter/ui/flddocinfopage \
sw/uiconfig/swriter/ui/formatsectiondialog \
sw/uiconfig/swriter/ui/formattablepage \
sw/uiconfig/swriter/ui/footendnotedialog \
......
......@@ -145,7 +145,6 @@
#define HID_COND_COLL "SW_HID_COND_COLL"
#define HID_FLD_DB "SW_HID_FLD_DB"
#define HID_FLD_DOKINF "SW_HID_FLD_DOKINF"
#define HID_FLD_VAR "SW_HID_FLD_VAR"
#define HID_FLD_DOK "SW_HID_FLD_DOK"
#define HID_FLD_FUNC "SW_HID_FLD_FUNC"
......@@ -332,7 +331,6 @@
#define HID_COND_COLL_TABLIST "SW_HID_COND_COLL_TABLIST"
#define HID_DB_SELECTION_TLB "SW_HID_DB_SELECTION_TLB"
#define HID_FIELD_DINF_TYPE "SW_HID_FIELD_DINF_TYPE"
#define HID_SELECT_TEMPLATE "SW_HID_SELECT_TEMPLATE"
......
This diff is collapsed.
......@@ -21,6 +21,7 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/button.hxx>
#include <vcl/group.hxx>
......@@ -35,19 +36,16 @@ namespace com{namespace sun{ namespace star{ namespace beans{
class SwFldDokInfPage : public SwFldPage
{
FixedText aTypeFT;
SvTreeListBox aTypeTLB;
FixedText aSelectionFT;
ListBox aSelectionLB;
FixedText aFormatFT;
NumFormatListBox aFormatLB;
CheckBox aFixedCB;
SvTreeListBox* m_pTypeTLB;
VclContainer* m_pSelection;
ListBox* m_pSelectionLB;
VclContainer* m_pFormat;
NumFormatListBox* m_pFormatLB;
CheckBox* m_pFixedCB;
SvTreeListEntry* pSelEntry;
com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet;
String aInfoStr;
sal_uInt16 nOldSel;
sal_uLong nOldFormat;
OUString m_sOldCustomFieldName;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "globals.hrc"
#include "fldtdlg.hrc"
#include "helpid.h"
TabPage TP_FLD_DOKINF
{
HelpID = HID_FLD_DOKINF ;
SVLook = TRUE ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_DOKINFTYPE
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 76 , 8 ) ;
Text [ en-US ] = "~Type" ;
Left = TRUE ;
};
Control TLB_DOKINFTYPE
{
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 16 ) ;
Size = MAP_APPFONT ( 76 , 163 ) ;
TabStop = TRUE ;
};
FixedText FT_DOKINFSELECTION
{
Pos = MAP_APPFONT ( 88 , 3 ) ;
Size = MAP_APPFONT ( 76 , 8 ) ;
Text [ en-US ] = "S~elect" ;
Left = TRUE ;
};
ListBox LB_DOKINFSELECTION
{
HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFSELECTION";
Border = TRUE ;
Pos = MAP_APPFONT ( 88 , 16 ) ;
Size = MAP_APPFONT ( 76 , 163 ) ;
TabStop = TRUE ;
StringList [ en-US ] =
{
< "Author" ; > ;
< "Time" ; > ;
< "Date" ; > ;
< "Date Time Author" ; > ;
};
};
FixedText FT_DOKINFFORMAT
{
Pos = MAP_APPFONT ( 170 , 3 ) ;
Size = MAP_APPFONT ( 84 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "F~ormat" ;
};
ListBox LB_DOKINFFORMAT
{
HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFFORMAT";
Border = TRUE ;
Pos = MAP_APPFONT ( 170 , 16 ) ;
Size = MAP_APPFONT ( 84 , 148 ) ;
TabStop = TRUE ;
AutoHScroll = TRUE ;
};
CheckBox CB_DOKINFFIXEDCONTENT
{
HelpID = "sw:CheckBox:TP_FLD_DOKINF:CB_DOKINFFIXEDCONTENT";
Pos = MAP_APPFONT ( 170 , 170 ) ;
Size = MAP_APPFONT ( 72 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Fixed content" ;
};
Bitmap BMP_DOKINFROOT_OPENED
{
File = "plus.bmp" ;
};
Bitmap BMP_DOKINFROOT_CLOSED
{
File = "minus.bmp" ;
};
String STR_DOKINF_INFO
{
Text [ en-US ] = "Info" ;
};
Text [ en-US ] = "DocInformation" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -46,7 +46,6 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
:SfxTabPage (pParent, rId, rAttrSet),
m_pCurFld (0),
m_pWrtShell (0),
m_nPageId ( static_cast< sal_uInt16 >(rId.GetId()) ),
m_nTypeSel (LISTBOX_ENTRY_NOTFOUND),
m_nSelectionSel (LISTBOX_ENTRY_NOTFOUND),
m_bFldEdit (false),
......@@ -58,6 +57,21 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
}
SwFldPage::SwFldPage(Window *pParent, const OString& rID,
const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet)
: SfxTabPage(pParent, rID, rUIXMLDescription, rAttrSet)
, m_pCurFld(0)
, m_pWrtShell(0)
, m_nTypeSel(LISTBOX_ENTRY_NOTFOUND)
, m_nSelectionSel(LISTBOX_ENTRY_NOTFOUND)
, m_bFldEdit(false)
, m_bInsert(true)
, m_bFldDlgHtmlMode(false)
, m_bRefresh(false)
, m_bFirstHTMLInit(true)
{
}
SwFldPage::~SwFldPage()
{
}
......@@ -354,7 +368,7 @@ void SwFldPage::EnableInsert(sal_Bool bEnable)
if (pDlg)
{
if (pDlg->GetCurPageId() == m_nPageId)
if (pDlg->GetCurTabPage() == this)
pDlg->EnableInsert(bEnable);
}
else
......
......@@ -32,7 +32,6 @@ class SwFldPage : public SfxTabPage
SwFldMgr m_aMgr;
SwField *m_pCurFld;
SwWrtShell* m_pWrtShell;
sal_uInt16 m_nPageId;
sal_uInt16 m_nTypeSel;
sal_uInt16 m_nSelectionSel;
bool m_bFldEdit;
......@@ -80,7 +79,10 @@ public:
const ResId &rId,
const SfxItemSet &rAttrSet );
virtual ~SwFldPage();
SwFldPage(Window *pParent, const OString& rID,
const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet);
virtual ~SwFldPage();
virtual void ActivatePage();
......
......@@ -42,22 +42,8 @@
#define FT_ADDDB (RC_TP_DB_START + 16)
#define PB_ADDDB (RC_TP_DB_START + 17)
// Documentinfo-TabPage:
#define RC_TP_DOCINF_START (RC_TP_DB_END)
#define FT_DOKINFTYPE (RC_TP_DOCINF_START + 1)
#define TLB_DOKINFTYPE (RC_TP_DOCINF_START + 2)
#define FT_DOKINFSELECTION (RC_TP_DOCINF_START + 3)
#define LB_DOKINFSELECTION (RC_TP_DOCINF_START + 4)
#define FT_DOKINFFORMAT (RC_TP_DOCINF_START + 5)
#define LB_DOKINFFORMAT (RC_TP_DOCINF_START + 6)
#define CB_DOKINFFIXEDCONTENT (RC_TP_DOCINF_START + 7)
#define BMP_DOKINFROOT_OPENED (RC_TP_DOCINF_START + 8)
#define BMP_DOKINFROOT_CLOSED (RC_TP_DOCINF_START + 9)
#define STR_DOKINF_INFO (RC_TP_DOCINF_START + 10)
#define RC_TP_DOCINF_END (RC_TP_DOCINF_START + 11)
// Variable-TabPage:
#define RC_TP_VAR_START (RC_TP_DOCINF_END)
#define RC_TP_VAR_START (RC_TP_DB_END)
#define FT_VARTYPE (RC_TP_VAR_START + 1)
#define LB_VARTYPE (RC_TP_VAR_START + 2)
#define FT_VARSELECTION (RC_TP_VAR_START + 3)
......
......@@ -45,6 +45,8 @@ class SW_DLLPUBLIC NumFormatListBox : public ListBox
SW_DLLPRIVATE SwView* GetView();
public:
NumFormatListBox(Window* pWin, WinBits nStyle);
NumFormatListBox( Window* pWin, const ResId& rResId,
short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0,
sal_Bool bUsrFmts = sal_True );
......
......@@ -70,6 +70,34 @@ NumFormatListBox::NumFormatListBox( Window* pWin, const ResId& rResId,
Init(nFormatType, bUsrFmts);
}
NumFormatListBox::NumFormatListBox(Window* pWin, WinBits nStyle) :
ListBox ( pWin, nStyle ),
nCurrFormatType (-1),
nStdEntry (0),
bOneArea (sal_False),
nDefFormat (0),
pVw (0),
pOwnFormatter (0),
bShowLanguageControl(sal_False),
bUseAutomaticLanguage(sal_True)
{
Init(NUMBERFORMAT_NUMBER, true);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeNumFormatListBox(Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
bool bDropdown = VclBuilder::extractDropdown(rMap);
if (bDropdown)
nBits |= WB_DROPDOWN;
else
nBits |= WB_BORDER;
return new NumFormatListBox(pParent, nBits|WB_SIMPLEMODE);
}
NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView,
const ResId& rResId, short nFormatType,
sal_uLong nDefFmt, sal_Bool bUsrFmts ) :
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="FldDocInfoPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkFrame" id="typeframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</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="hexpand">True</property>
<property name="top_padding">6</property>
<child>
<object class="svtlo-SvTreeListBox" id="type: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="treeview-selection1"/>
</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">_Type</property>
<property name="use_underline">True</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="selectframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="top_padding">6</property>
<child>
<object class="GtkTreeView" id="select:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection3"/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<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">S_elect</property>
<property name="use_underline">True</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">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="formatframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="top_padding">6</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="swlo-NumFormatListBox" id="format:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="dropdown">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="fixed">
<property name="label" translatable="yes">_Fixed content</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="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">F_ormat</property>
<property name="use_underline">True</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">2</property>
</packing>
</child>
</object>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Author</col>
</row>
<row>
<col id="0" translatable="yes">Time</col>
</row>
<row>
<col id="0" translatable="yes">Date</col>
</row>
<row>
<col id="0" translatable="yes">Date Time Author</col>
</row>
</data>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<property name="mode">both</property>
<widgets>
<widget name="type:border"/>
<widget name="select:border"/>
<widget name="format:border"/>
</widgets>
</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