summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoros <os@openoffice.org>2009-11-23 10:19:33 +0100
committeros <os@openoffice.org>2009-11-23 10:19:33 +0100
commita2ddb3f40fbdec3ee962024151c4874f4fb87547 (patch)
tree47c00cfacb06248f12f2bc142f4890fe2df2cabd
parent9b59d6ce1a1708c9668f0c889483390aef1acee7 (diff)
#i97029# duration support added to custom properties dialog
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx32
-rw-r--r--sfx2/source/dialog/dialog.hrc2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx208
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc22
-rw-r--r--sfx2/source/dialog/dinfdlg.src200
-rw-r--r--sfx2/source/inc/sfxlocal.hrc2
6 files changed, 449 insertions, 17 deletions
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index f25760f06282..00e557e4af7e 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -53,6 +53,9 @@ namespace com { namespace sun { namespace star {
namespace document {
class XDocumentProperties;
}
+ namespace util {
+ class Duration;
+ }
} } }
struct CustomProperty;
@@ -382,6 +385,30 @@ public:
inline CustomPropertyLine* GetLine() const { return m_pLine; }
};
+class CustomPropertiesDurationField : public Edit
+{
+ CustomPropertyLine* m_pLine;
+ com::sun::star::util::Duration m_aDuration;
+protected:
+ virtual void RequestHelp(const HelpEvent& rEvt);
+public:
+ CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine );
+ ~CustomPropertiesDurationField();
+
+ void SetDuration( const com::sun::star::util::Duration& rDuration );
+ const com::sun::star::util::Duration& GetDuration() const { return m_aDuration; }
+};
+
+class CustomPropertiesEditButton : public PushButton
+{
+ CustomPropertyLine* m_pLine;
+
+public:
+ CustomPropertiesEditButton( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine );
+ ~CustomPropertiesEditButton();
+
+ DECL_LINK(ClickHdl, PushButton*);
+};
class CustomPropertiesRemoveButton : public ImageButton
{
@@ -421,6 +448,9 @@ struct CustomPropertyLine
CustomPropertiesEdit m_aValueEdit;
CustomPropertiesDateField m_aDateField;
CustomPropertiesTimeField m_aTimeField;
+ const String m_sDurationFormat;
+ CustomPropertiesDurationField m_aDurationField;
+ CustomPropertiesEditButton m_aEditButton;
CustomPropertiesYesNoButton m_aYesNoButton;
CustomPropertiesRemoveButton m_aRemoveButton;
@@ -446,6 +476,8 @@ private:
Edit m_aValueEdit;
DateField m_aDateField;
TimeField m_aTimeField;
+ Edit m_aDurationField;
+ PushButton m_aEditButton;
CustomPropertiesYesNoButton m_aYesNoButton;
ImageButton m_aRemoveButton;
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc
index 72cc8c659bc4..44d9c7e346cf 100644
--- a/sfx2/source/dialog/dialog.hrc
+++ b/sfx2/source/dialog/dialog.hrc
@@ -109,6 +109,8 @@
#define STR_PDF_EXPORT_SEND ( RC_DIALOG_BEGIN + 120 )
#define STR_RECHECK_DOCUMENT ( RC_DIALOG_BEGIN + 121 )
#define IMG_INFO ( RC_DIALOG_BEGIN + 122 )
+#define RID_EDIT_DURATIONS ( RC_DIALOG_BEGIN + 123 )
+#define SFX_PB_EDIT ( RC_DIALOG_BEGIN + 124 )
#endif // #ifndef _SFX_DIALOG_HRC
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index fb5156a1f182..b8b6a5e99098 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/util/Duration.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <vcl/timer.hxx>
@@ -75,6 +76,8 @@
#include <sfx2/sfx.hrc>
#include "dinfdlg.hrc"
#include "sfxlocal.hrc"
+#include <dialog.hrc>
+#include <vcl/help.hxx>
#include <algorithm>
@@ -1569,7 +1572,168 @@ CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( Window* pParent, const
m_aYesButton.SetBackground( aWall );
m_aNoButton.SetBackground( aWall );
}
+class DurationDialog_Impl : public ModalDialog
+{
+ FixedLine aDurationFL;
+
+ OKButton aOKPB;
+ CancelButton aCancelPB;
+ HelpButton aHelpPB;
+
+ CheckBox aNegativeCB;
+ FixedText aYearFT;
+ NumericField aYearNF;
+ FixedText aMonthFT;
+ NumericField aMonthNF;
+ FixedText aDayFT;
+ NumericField aDayNF;
+ FixedText aHourFT;
+ NumericField aHourNF;
+ FixedText aMinuteFT;
+ NumericField aMinuteNF;
+ FixedText aSecondFT;
+ NumericField aSecondNF;
+ FixedText aHSecondFT;
+ NumericField aHSecondNF;
+
+public:
+
+ DurationDialog_Impl( Window* pParent, const util::Duration& rDuration );
+ ~DurationDialog_Impl();
+
+ util::Duration GetDuration() const;
+};
+/*-- 20.11.2009 15:40:46---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& rDuration ) :
+ ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ),
+ aDurationFL(this, SfxResId( FL_DURATION )),
+ aOKPB( this, SfxResId( PB_OK )),
+ aCancelPB( this, SfxResId( PB_CANCEL )),
+ aHelpPB( this, SfxResId( PB_HELP )),
+ aNegativeCB(this, SfxResId( CB_NEGATIVE )),
+ aYearFT( this, SfxResId( FT_YEAR )),
+ aYearNF( this, SfxResId( ED_YEAR )),
+ aMonthFT( this, SfxResId( FT_MONTH )),
+ aMonthNF( this, SfxResId( ED_MONTH )),
+ aDayFT( this, SfxResId( FT_DAY )),
+ aDayNF( this, SfxResId( ED_DAY )),
+ aHourFT( this, SfxResId( FT_HOUR )),
+ aHourNF( this, SfxResId( ED_HOUR )),
+ aMinuteFT( this, SfxResId( FT_MINUTE )),
+ aMinuteNF( this, SfxResId( ED_MINUTE )),
+ aSecondFT( this, SfxResId( FT_SECOND )),
+ aSecondNF( this, SfxResId( ED_SECOND )),
+ aHSecondFT( this, SfxResId( FT_HSECOND )),
+ aHSecondNF( this, SfxResId( ED_HSECOND ))
+{
+ FreeResource();
+ aNegativeCB.Check(rDuration.Negative);
+ aYearNF.SetValue(rDuration.Years);
+ aMonthNF.SetValue(rDuration.Months );
+ aDayNF.SetValue(rDuration.Days );
+ aHourNF.SetValue(rDuration.Hours );
+ aMinuteNF.SetValue(rDuration.Minutes);
+ aSecondNF.SetValue(rDuration.Seconds);
+ aHSecondNF.SetValue(rDuration.HundredthSeconds);
+}
+/*-- 20.11.2009 16:08:55---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+DurationDialog_Impl::~DurationDialog_Impl()
+{
+}
+/*-- 20.11.2009 15:41:47---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+util::Duration DurationDialog_Impl::GetDuration() const
+{
+ util::Duration aRet;
+ aRet.Negative = aNegativeCB.IsChecked();
+ aRet.Years = aYearNF.GetValue();
+ aRet.Months = aMonthNF.GetValue( );
+ aRet.Days = aDayNF.GetValue( );
+ aRet.Hours = aHourNF.GetValue( );
+ aRet.Minutes = aMinuteNF.GetValue();
+ aRet.Seconds = aSecondNF.GetValue();
+ aRet.HundredthSeconds = aHSecondNF.GetValue();
+ return aRet;
+}
+
+/*-- 20.11.2009 15:30:58---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+CustomPropertiesDurationField::CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ Edit( pParent, rResId ), m_pLine( pLine )
+
+{
+ SetDuration( util::Duration(false, 0, 0, 0, 0, 0, 0, 0) );
+}
+/*-- 23.11.2009 08:46:02---------------------------------------------------
+ -----------------------------------------------------------------------*/
+CustomPropertiesDurationField::~CustomPropertiesDurationField()
+{
+}
+/*-- 23.11.2009 09:23:35---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt )
+{
+ if( rHEvt.GetMode() & HELPMODE_QUICK )
+ {
+ Size aSize( GetSizePixel() );
+ Rectangle aItemRect( rHEvt.GetMousePosPixel(), aSize );
+ if(Help::IsBalloonHelpEnabled())
+ Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), GetText() );
+ else
+ Help::ShowQuickHelp( this, aItemRect, GetText(),
+ QUICKHELP_LEFT|QUICKHELP_VCENTER );
+ }
+}
+/*-- 20.11.2009 15:30:58---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration )
+{
+ m_aDuration = rDuration;
+ String sText(rDuration.Negative ? '-' : '+');
+ sText += m_pLine->m_sDurationFormat;
+ sText.SearchAndReplace(String::CreateFromAscii( "%1"), String::CreateFromInt32( rDuration.Years ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%2"), String::CreateFromInt32( rDuration.Months ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%3"), String::CreateFromInt32( rDuration.Days ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%4"), String::CreateFromInt32( rDuration.Hours ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%5"), String::CreateFromInt32( rDuration.Minutes) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%6"), String::CreateFromInt32( rDuration.Seconds) );
+ SetText( sText );
+}
+/*-- 23.11.2009 08:51:15---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+CustomPropertiesEditButton::CustomPropertiesEditButton( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ PushButton( pParent, rResId ), m_pLine( pLine )
+{
+ SetClickHdl( LINK( this, CustomPropertiesEditButton, ClickHdl ));
+}
+/*-- 23.11.2009 08:51:15---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+CustomPropertiesEditButton::~CustomPropertiesEditButton()
+{
+}
+/*-- 23.11.2009 08:47:37---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+IMPL_LINK( CustomPropertiesEditButton, ClickHdl, PushButton*, EMPTY_ARG )
+{
+ DurationDialog_Impl* pDurationDlg = new DurationDialog_Impl( this, m_pLine->m_aDurationField.GetDuration() );
+ if( RET_OK == pDurationDlg->Execute() )
+ m_pLine->m_aDurationField.SetDuration( pDurationDlg->GetDuration() );
+ delete pDurationDlg;
+ return 1;
+}
+//--------------------------------------------------------------------------
void CustomPropertiesYesNoButton::Resize()
{
const long nWidth = GetSizePixel().Width();
@@ -1592,6 +1756,9 @@ CustomPropertyLine::CustomPropertyLine( Window* pParent ) :
m_aValueEdit ( pParent, SfxResId( SFX_ED_PROPERTY_VALUE ), this ),
m_aDateField ( pParent, SfxResId( SFX_FLD_DATE), this),
m_aTimeField ( pParent, SfxResId( SFX_FLD_TIME), this),
+ m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT )),
+ m_aDurationField( pParent, SfxResId( SFX_FLD_DURATION), this),
+ m_aEditButton( pParent, SfxResId( SFX_PB_EDIT ), this),
m_aYesNoButton ( pParent, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( pParent, SfxResId( SFX_PB_PROPERTY_REMOVE ), this ),
m_bIsRemoved ( false ),
@@ -1614,6 +1781,8 @@ void CustomPropertyLine::SetRemoved()
m_aValueEdit.Hide();
m_aDateField.Hide();
m_aTimeField.Hide();
+ m_aDurationField.Hide();
+ m_aEditButton.Hide();
m_aYesNoButton.Hide();
m_aRemoveButton.Hide();
}
@@ -1628,6 +1797,8 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR
m_aValueEdit ( this, SfxResId( SFX_ED_PROPERTY_VALUE ) ),
m_aDateField ( this, SfxResId( SFX_FLD_DATE) ),
m_aTimeField ( this, SfxResId( SFX_FLD_TIME) ),
+ m_aDurationField( this, SfxResId( SFX_FLD_DURATION) ),
+ m_aEditButton( this, SfxResId( SFX_PB_EDIT )),
m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( this, SfxResId( SFX_PB_PROPERTY_REMOVE ) ),
m_nScrollPos (0),
@@ -1654,7 +1825,9 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
CustomPropertyLine* pLine = pBox->GetLine();
pLine->m_aValueEdit.Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) );
pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) );
- pLine->m_aTimeField.Show( (CUSTOM_TYPE_TIME == nType) || (CUSTOM_TYPE_DATETIME == nType) );
+ pLine->m_aTimeField.Show( CUSTOM_TYPE_DATETIME == nType );
+ pLine->m_aDurationField.Show( CUSTOM_TYPE_DURATION == nType );
+ pLine->m_aEditButton.Show( CUSTOM_TYPE_DURATION == nType );
pLine->m_aYesNoButton.Show( CUSTOM_TYPE_BOOLEAN == nType );
//adjust positions of date and time controls
if( nType == CUSTOM_TYPE_DATE )
@@ -1666,10 +1839,6 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
pLine->m_aDateField.SetPosSizePixel( pLine->m_aDatePos, pLine->m_aDateTimeSize );
pLine->m_aTimeField.SetPosSizePixel(pLine->m_aTimePos, pLine->m_aDateTimeSize );
}
- else if( nType == CUSTOM_TYPE_TIME)
- {
- pLine->m_aTimeField.SetPosSizePixel(pLine->m_aValueEdit.GetPosPixel(), pLine->m_aValueEdit.GetSizePixel());
- }
return 0;
}
@@ -1693,6 +1862,7 @@ IMPL_LINK( CustomPropertiesWindow, RemoveHdl, CustomPropertiesRemoveButton*, pBu
Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit,
&pLine->m_aDateField, &pLine->m_aTimeField,
+ &pLine->m_aDurationField, &pLine->m_aEditButton,
&pLine->m_aYesNoButton, &pLine->m_aRemoveButton, NULL };
Window** pCurrent = pWindows;
while ( *pCurrent )
@@ -1804,6 +1974,8 @@ void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
m_aValueEdit.Hide();
m_aDateField.Hide();
m_aTimeField.Hide();
+ m_aDurationField.Hide();
+ m_aEditButton.Hide();
m_aYesNoButton.Hide();
m_aRemoveButton.Hide();
@@ -1835,6 +2007,13 @@ void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
if ( *pCurrent == &m_aValueEdit )
{
+ Point aDurationPos( aPos );
+ m_aDurationField.SetPosPixel( aDurationPos );
+ Size aDurationSize(aSize);
+ aDurationSize.Width() -= (m_aEditButton.GetSizePixel().Width() + 3 );
+ m_aDurationField.SetSizePixel(aDurationSize);
+ aDurationPos.X() = aPos.X() - m_aEditButton.GetSizePixel().Width() + aSize.Width();
+ m_aEditButton.SetPosPixel(aDurationPos);
aSize = m_aYesNoButton.GetSizePixel();
aPos = m_aYesNoButton.GetPosPixel();
aSize.Width() = nWidth;
@@ -1881,10 +2060,12 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
m_aCustomPropertiesLines.push_back( pNewLine );
Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit,
&m_aDateField, &m_aTimeField,
+ &m_aDurationField, &m_aEditButton,
&m_aYesNoButton, &m_aRemoveButton, NULL };
Window* pNewWindows[] =
{ &pNewLine->m_aNameBox, &pNewLine->m_aTypeBox, &pNewLine->m_aValueEdit,
&pNewLine->m_aDateField, &pNewLine->m_aTimeField,
+ &pNewLine->m_aDurationField, &pNewLine->m_aEditButton,
&pNewLine->m_aYesNoButton, &pNewLine->m_aRemoveButton, NULL };
Window** pCurrent = pWindows;
Window** pNewCurrent = pNewWindows;
@@ -1909,7 +2090,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
::rtl::OUString sTmpValue;
util::DateTime aTmpDateTime;
util::Date aTmpDate;
- util::Time aTmpTime;
+ util::Duration aTmpDuration;
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData();
pNewLine->m_aNameBox.SetText( sName );
@@ -1931,7 +2112,6 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
else if ( rAny >>= sTmpValue )
{
pNewLine->m_aValueEdit.SetText( sTmpValue );
-// sValue = String( sTmpValue );
nType = CUSTOM_TYPE_TEXT;
}
else if ( rAny >>= aTmpDate )
@@ -1940,10 +2120,10 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) );
}
- else if ( rAny >>= aTmpTime )
+ else if ( rAny >>= aTmpDuration )
{
- nType = CUSTOM_TYPE_TIME;
- pNewLine->m_aTimeField.SetTime( Time( aTmpTime.Hours, aTmpTime.Minutes, aTmpTime.Seconds, aTmpTime.HundredthSeconds ) );
+ nType = CUSTOM_TYPE_DURATION;
+ pNewLine->m_aDurationField.SetDuration( aTmpDuration );
}
else if ( rAny >>= aTmpDateTime )
{
@@ -2012,7 +2192,7 @@ void CustomPropertiesWindow::DoScroll( sal_Int32 nNewPos )
if ( pLine->m_bIsRemoved )
continue;
- Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit,
+ Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit, &pLine->m_aDurationField,
&pLine->m_aYesNoButton, &pLine->m_aRemoveButton, NULL };
Window** pCurrent = pWindows;
while ( *pCurrent )
@@ -2084,11 +2264,9 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear() );
aPropertiesSeq[i].Value <<= aDateTime;
}
- else if ( CUSTOM_TYPE_TIME == nType )
+ else if ( CUSTOM_TYPE_DURATION == nType )
{
- Time aTmpTime = pLine->m_aTimeField.GetTime();
- util::Time aTime( aTmpTime.Get100Sec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour() );
- aPropertiesSeq[i].Value <<= aTime;
+ aPropertiesSeq[i].Value <<= pLine->m_aDurationField.GetDuration();
}
else if ( CUSTOM_TYPE_DATE == nType )
{
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
index 64cca40a9905..49647c40e3ee 100644
--- a/sfx2/source/dialog/dinfdlg.hrc
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -39,7 +39,7 @@
#define CUSTOM_TYPE_NUMBER 2
#define CUSTOM_TYPE_DATE 3
#define CUSTOM_TYPE_BOOLEAN 4
-#define CUSTOM_TYPE_TIME 5
+#define CUSTOM_TYPE_DURATION 5
#define CUSTOM_TYPE_DATETIME 6
// 4 TP_DOCINFORELOAD
@@ -156,5 +156,25 @@
#define STR_HEADER_VALUE 92
#define STR_HEADER_ACTION 93
+#define PB_OK 100
+#define PB_CANCEL 101
+#define PB_HELP 102
+#define CB_NEGATIVE 103
+#define FT_YEAR 104
+#define ED_YEAR 105
+#define FT_MONTH 106
+#define ED_MONTH 107
+#define FT_DAY 108
+#define ED_DAY 109
+#define FT_HOUR 110
+#define ED_HOUR 111
+#define FT_MINUTE 112
+#define ED_MINUTE 113
+#define FT_SECOND 114
+#define ED_SECOND 115
+#define FT_HSECOND 116
+#define ED_HSECOND 117
+#define FL_DURATION 118
+
#endif
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index 4f77f4cf799a..31edbf06b506 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -34,6 +34,7 @@
#include "helpid.hrc"
#include "sfxlocal.hrc"
#include "dinfdlg.hrc"
+#include <dialog.hrc>
// TP_DOCINFODESC --------------------------------------------------------
String STR_SFX_NEWOFFICEDOC
@@ -588,7 +589,7 @@ ListBox SFX_LB_PROPERTY_TYPE
< "Text" ; CUSTOM_TYPE_TEXT ; > ;
< "DateTime" ; CUSTOM_TYPE_DATETIME ; > ;
< "Date" ; CUSTOM_TYPE_DATE ; > ;
- < "Time" ; CUSTOM_TYPE_TIME ; > ;
+ < "Duration" ; CUSTOM_TYPE_DURATION ; > ;
< "Number" ; CUSTOM_TYPE_NUMBER ; > ;
< "Yes or no" ; CUSTOM_TYPE_BOOLEAN ; > ;
};
@@ -620,6 +621,25 @@ TimeField SFX_FLD_TIME
Spin = TRUE;
};
+Edit SFX_FLD_DURATION
+{
+ Readonly = TRUE;
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 159 , 2 ) ;
+ Size = MAP_APPFONT ( 61 - RSC_CD_TEXTBOX_HEIGHT - 2, RSC_CD_TEXTBOX_HEIGHT ) ;
+ TabStop = TRUE ;
+};
+PushButton SFX_PB_EDIT
+{
+ Pos = MAP_APPFONT ( 159 , 2 ) ;
+ Size = MAP_APPFONT ( RSC_CD_TEXTBOX_HEIGHT , RSC_CD_TEXTBOX_HEIGHT ) ;
+ Text = "...";
+};
+String SFX_ST_DURATION_FORMAT
+{
+ Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6";
+};
+
Control SFX_WIN_PROPERTY_YESNO
{
HelpId = HID_CTRL_CUSTOMPROPS_YES_NO;
@@ -705,3 +725,181 @@ TabDialog SID_DOCINFO
};
};
+ModalDialog RID_EDIT_DURATIONS
+{
+ OutputSize = TRUE ;
+ Size = MAP_APPFONT ( 176 , 140 ) ;
+ Text [ en-US ] = "Edit Duration" ;
+ Moveable = TRUE ;
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( 120 , 7 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE;
+ };
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( 120 , 24 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ HelpButton PB_HELP
+ {
+ Pos = MAP_APPFONT ( 120 , 48 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ FixedLine FL_DURATION
+ {
+ Pos = MAP_APPFONT ( 6 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
+ Text [ en-US ] = "Duration" ;
+ };
+ CheckBox CB_NEGATIVE
+ {
+ Pos = MAP_APPFONT ( 6 , 21 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Text [ en-US ] = "~Negative" ;
+ };
+ FixedText FT_YEAR
+ {
+ Pos = MAP_APPFONT ( 6 , 38 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Years" ;
+ };
+ NumericField ED_YEAR
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 36 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_MONTH
+ {
+ Pos = MAP_APPFONT ( 6 , 52 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Months" ;
+ };
+ NumericField ED_MONTH
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 50 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_DAY
+ {
+ Pos = MAP_APPFONT ( 6 , 66 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Days" ;
+ };
+ NumericField ED_DAY
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 64 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_HOUR
+ {
+ Pos = MAP_APPFONT ( 6 , 80 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "H~ours" ;
+ };
+ NumericField ED_HOUR
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 78 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_MINUTE
+ {
+ Pos = MAP_APPFONT ( 6 , 94 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "Min~utes" ;
+ };
+ NumericField ED_MINUTE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70, 92) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_SECOND
+ {
+ Pos = MAP_APPFONT ( 6, 108 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Seconds" ;
+ };
+ NumericField ED_SECOND
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 106 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+ FixedText FT_HSECOND
+ {
+ Pos = MAP_APPFONT ( 6 , 122 ) ;
+ Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "1/100 se~conds" ;
+ };
+ NumericField ED_HSECOND
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 120 ) ;
+ Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 0 ;
+ First = 1 ;
+ Last = 100 ;
+ SpinSize = 1 ;
+ Value = 0 ;
+ };
+
+
+
+};
diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc
index 11afee9185d6..bc7d267d75d8 100644
--- a/sfx2/source/inc/sfxlocal.hrc
+++ b/sfx2/source/inc/sfxlocal.hrc
@@ -62,6 +62,8 @@
#define SFX_IMG_PROPERTY_REMOVE_HC (RID_SFX_SFXLOCAL_START + 9)
#define SFX_FLD_DATE (RID_SFX_SFXLOCAL_START + 10)
#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11)
+#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12)
+#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13)
#endif