diff options
author | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-07-17 10:45:08 +0200 |
---|---|---|
committer | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-07-17 10:45:08 +0200 |
commit | 67bf3f3c70141811ea2e2be5804e20b2de0ecf0a (patch) | |
tree | ddebaeab7096f0744b447589c36bc7a238fe8ae3 | |
parent | 358a8ffde16c30d364317459757ed93c246df5ce (diff) |
CMIS properties dialog
Greyed out YesNo button when the property is readonly
Change-Id: I093651c9a17e8e1e23a164a6f91d6971d3ecc67a
-rw-r--r-- | include/sfx2/dinfdlg.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index dde187e13509..e677f57d2301 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -576,6 +576,8 @@ public: virtual void Resize(); + void SetReadOnly( ); + inline void CheckYes() { m_aYesButton.Check(); } inline void CheckNo() { m_aNoButton.Check(); } inline bool IsYesChecked() const { return m_aYesButton.IsChecked() != sal_False; } diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 99c103d416a4..ac003af39bec 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2252,6 +2252,12 @@ CmisPropertiesYesNoButton::CmisPropertiesYesNoButton( Window* pParent, const Res m_aNoButton.SetBackground( aWall ); } +void CmisPropertiesYesNoButton::SetReadOnly( ) +{ + m_aNoButton.Enable( sal_False ); + m_aYesButton.Enable( sal_False ); +} + CmisPropertiesEditButton::CmisPropertiesEditButton( Window* pParent, const ResId& rResId, CmisPropertyLine* pLine ) : PushButton( pParent, rResId ), m_pLine( pLine ) { @@ -2503,6 +2509,8 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, pNewLine->m_aValueEdit.SetReadOnly( !bUpdatable ); pNewLine->m_aDateField.SetReadOnly( !bUpdatable ); pNewLine->m_aTimeField.SetReadOnly( !bUpdatable ); + if ( !bUpdatable) + pNewLine->m_aYesNoButton.SetReadOnly( ); m_nLineHeight = m_aValueEdit.GetSizePixel().Height() ; @@ -2533,7 +2541,8 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, pNewLine->m_aTimePos = pNewLine->m_aTimeField.GetPosPixel(); pNewLine->m_aDateTimeSize = pNewLine->m_aDateField.GetSizePixel(); - double nTmpValue = 0; + sal_Int32 nTmpValue = 0; + double dTmpValue = 0.0; bool bTmpValue = false; OUString sTmpValue; util::DateTime aTmpDateTime; @@ -2550,6 +2559,13 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, pNewLine->m_aValueEdit.SetText( sValue ); sType = CMIS_TYPE_NUMBER; } + else if ( rAny >>= dTmpValue ) + { + sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM ); + m_aNumberFormatter.GetInputLineString( dTmpValue, nIndex, sValue ); + pNewLine->m_aValueEdit.SetText( sValue ); + sType = CMIS_TYPE_NUMBER; + } else if ( rAny >>= bTmpValue ) { sValue = ( bTmpValue ? rLocaleWrapper.getTrueWord() : rLocaleWrapper.getFalseWord() ); @@ -2590,7 +2606,6 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, pNewLine->m_aDateField.SetPosSizePixel(pNewLine->m_aDatePos, pNewLine->m_aDateTimeSize ); pNewLine->m_aTimeField.SetPosSizePixel(pNewLine->m_aTimePos, pNewLine->m_aDateTimeSize ); } - pNewLine->m_aName.GrabFocus(); } |