diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-02-22 14:47:55 +0100 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-02-22 14:47:55 +0100 |
commit | 8aa1053a0e36f88d31dba77e846650bff26b8109 (patch) | |
tree | 650d35351853868e2a82b68824855c7561cb9c54 /svx | |
parent | 1e1ee7183aac2cdae7aeab7509ee6c34ee9133d9 (diff) | |
parent | c5a9cb727bc21a36442f77aedc6ce007de82dd97 (diff) |
cws tl74: merge
Diffstat (limited to 'svx')
-rwxr-xr-x | svx/source/dialog/thesdlg.cxx | 182 | ||||
-rwxr-xr-x | svx/source/dialog/thesdlg.hrc | 3 | ||||
-rwxr-xr-x | svx/source/dialog/thesdlg.src | 32 | ||||
-rwxr-xr-x | svx/source/dialog/thesdlg_impl.hxx | 103 |
4 files changed, 199 insertions, 121 deletions
diff --git a/svx/source/dialog/thesdlg.cxx b/svx/source/dialog/thesdlg.cxx index 2c77545d2bae..87272d3ae89b 100755 --- a/svx/source/dialog/thesdlg.cxx +++ b/svx/source/dialog/thesdlg.cxx @@ -97,39 +97,73 @@ static void GetReplaceEditString( String &rText ) rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); } -// class LookUpComboBox -------------------------------------------------- +// class LookUpComboBox_Impl -------------------------------------------------- -LookUpComboBox::LookUpComboBox( +LookUpComboBox_Impl::LookUpComboBox_Impl( + Window *pParent, const ResId &rResId, SvxThesaurusDialog_Impl &rImpl ) : + ComboBox (pParent, rResId), + m_rDialogImpl( rImpl ) +{ + m_aModifyTimer.SetTimeoutHdl( LINK( this, LookUpComboBox_Impl, ModifyTimer_Hdl ) ); + m_aModifyTimer.SetTimeout( 500 ); + + EnableAutocomplete( FALSE ); +} + + +LookUpComboBox_Impl::~LookUpComboBox_Impl() +{ +} + + +void LookUpComboBox_Impl::Modify() +{ + m_aModifyTimer.Start(); +} + + +IMPL_LINK( LookUpComboBox_Impl, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ ) +{ + m_rDialogImpl.LookUp( GetText() ); + m_aModifyTimer.Stop(); + return 0; +} + + +// class ReplaceEdit_Impl -------------------------------------------------- + +ReplaceEdit_Impl::ReplaceEdit_Impl( Window *pParent, const ResId &rResId ) : - ComboBox (pParent, rResId) + Edit (pParent, rResId) { } -LookUpComboBox::~LookUpComboBox() +ReplaceEdit_Impl::~ReplaceEdit_Impl() { } -void LookUpComboBox::Modify() +void ReplaceEdit_Impl::Modify() { if (m_pBtn) m_pBtn->Enable( GetText().Len() > 0 ); } -void LookUpComboBox::SetText( const XubString& rStr ) +void ReplaceEdit_Impl::SetText( const XubString& rStr ) { - ComboBox::SetText( rStr ); + Edit::SetText( rStr ); Modify(); } -void LookUpComboBox::SetText( const XubString& rStr, const Selection& rNewSelection ) +void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSelection ) { - ComboBox::SetText( rStr, rNewSelection ); + Edit::SetText( rStr ); Modify(); } + // class ThesaurusAlternativesCtrl_Impl ---------------------------------- void AlternativesString_Impl::Paint( @@ -182,7 +216,7 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St { SvLBoxEntry* pEntry = new SvLBoxEntry; String aText; - if (bIsHeader) + if (bIsHeader && nVal >= 0) { aText = String::CreateFromInt32( nVal ); aText += A2S( ". " ); @@ -194,7 +228,10 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St AlternativesUserData_Impl* pUserData = new AlternativesUserData_Impl( rText, bIsHeader ); pEntry->SetUserData( pUserData ); - GetModel()->Insert( pEntry ); + USHORT nPos = GetModel()->Insert( pEntry ); + + if (bIsHeader) + GetViewDataEntry( pEntry )->SetSelectable( false ); return pEntry; } @@ -213,6 +250,31 @@ void ThesaurusAlternativesCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) } +void ThesaurusAlternativesCtrl_Impl::Paint( const Rectangle& rRect ) +{ + if (!m_rDialogImpl.m_bWordFound) + { +/* Push( PUSH_FONT ); + + Font aFont( GetFont() ); + aFont.SetHeight( 2 * aFont.GetHeight() ); + SetFont( aFont ); +*/ + Size aTextSize( GetTextWidth( m_rDialogImpl.aErrStr ), GetTextHeight() ); + aTextSize = LogicToPixel( aTextSize ); + Point aPos; + aPos.X() += GetSizePixel().Width() / 2 - aTextSize.Width() / 2; + aPos.Y() += GetSizePixel().Height() / 2 /*- aTextSize.Height() / 2*/; + aPos = PixelToLogic( aPos ); + DrawText( aPos, m_rDialogImpl.aErrStr ); + +// Pop(); + } + else + SvxCheckListBox::Paint( rRect ); +} + + // struct SvxThesaurusDialog_Impl ---------------------------------------- SvxThesaurusDialog_Impl::SvxThesaurusDialog_Impl( Window* pParent ) : @@ -220,8 +282,7 @@ SvxThesaurusDialog_Impl::SvxThesaurusDialog_Impl( Window* pParent ) : aVendorImageFI ( pParent , SVX_RES( IMG_VENDOR ) ), aLeftBtn ( pParent, SVX_RES( BTN_LEFT ) ), aWordText ( pParent, SVX_RES( FT_WORD ) ), - aWordCB ( pParent, SVX_RES( CB_WORD ) ), - aLookUpBtn ( pParent, SVX_RES( BTN_LOOKUP ) ), + aWordCB ( pParent, SVX_RES( CB_WORD ), *this ), m_aAlternativesText ( pParent, SVX_RES( FT_THES_ALTERNATIVES ) ), m_pAlternativesCT ( new ThesaurusAlternativesCtrl_Impl( pParent, *this ) ), aReplaceText ( pParent, SVX_RES( FT_REPL ) ), @@ -229,24 +290,24 @@ SvxThesaurusDialog_Impl::SvxThesaurusDialog_Impl( Window* pParent ) : aFL ( pParent, SVX_RES( FL_VAR ) ), aHelpBtn ( pParent, SVX_RES( BTN_THES_HELP ) ), aLangMBtn ( pParent, SVX_RES( MB_LANGUAGE ) ), - aOkBtn ( pParent, SVX_RES( BTN_THES_OK ) ), + aReplaceBtn ( pParent, SVX_RES( BTN_THES_OK ) ), aCancelBtn ( pParent, SVX_RES( BTN_THES_CANCEL ) ), - aErrStr ( SVX_RES( STR_ERR_WORDNOTFOUND ) ), - aVendorDefaultImage ( SVX_RES( IMG_DEFAULT_VENDOR ) ), - aVendorDefaultImageHC ( SVX_RES( IMG_DEFAULT_VENDOR_HC ) ), + aErrStr ( SVX_RES( STR_ERR_TEXTNOTFOUND ) ), + aVendorDefaultImage ( SVX_RES( IMG_DEFAULT_VENDOR ) ), + aVendorDefaultImageHC ( SVX_RES( IMG_DEFAULT_VENDOR_HC ) ), xThesaurus ( NULL ), aLookUpText (), nLookUpLanguage ( LANGUAGE_NONE ), + m_bWordFound( false ), pErrContext ( NULL ) { // note: FreeResource must only be called in the c-tor of SvxThesaurusDialog - aWordCB.SetButton( &aLookUpBtn ); + aReplaceEdit.SetButton( &aReplaceBtn ); aLeftBtn.SetClickHdl( LINK( this, SvxThesaurusDialog_Impl, LeftBtnHdl_Impl ) ); aWordCB.SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, WordSelectHdl_Impl ) ); - aLangMBtn.SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, LanguageHdl_Impl ) );
- aLookUpBtn.SetClickHdl( LINK( this, SvxThesaurusDialog_Impl, LookUpHdl_Impl ) ); + aLangMBtn.SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, LanguageHdl_Impl ) ); m_pAlternativesCT->SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl )); m_pAlternativesCT->SetDoubleClickHdl( LINK( this, SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl )); @@ -297,12 +358,12 @@ bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl() const sal_Int32 nMeanings = aMeanings.getLength(); const uno::Reference< linguistic2::XMeaning > *pMeanings = aMeanings.getConstArray(); + m_pAlternativesCT->SetUpdateMode( FALSE ); + // clear old user data of control before creating new ones via AddEntry below m_pAlternativesCT->ClearUserData(); m_pAlternativesCT->Clear(); - m_pAlternativesCT->SetUpdateMode( FALSE ); - for (sal_Int32 i = 0; i < nMeanings; ++i) { OUString rMeaningTxt = pMeanings[i]->getMeaning(); @@ -319,10 +380,7 @@ bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl() m_pAlternativesCT->SetUpdateMode( TRUE ); - const bool bWordFound = nMeanings > 0; - if (!bWordFound) - InfoBox( m_pParent, aErrStr ).Execute(); - return bWordFound; + return nMeanings > 0; } @@ -338,6 +396,14 @@ void SvxThesaurusDialog_Impl::SetWindowTitle( LanguageType nLanguage ) } +void SvxThesaurusDialog_Impl::LookUp( const String &rText ) +{ + if (rText != aWordCB.GetText()) // avoid moving of the cursor if the text is the same + aWordCB.SetText( rText ); + LookUp_Impl(); +} + + IMPL_LINK( SvxThesaurusDialog_Impl, LeftBtnHdl_Impl, Button *, pBtn ) { if (pBtn && aLookUpHistory.size() >= 2) @@ -345,13 +411,13 @@ IMPL_LINK( SvxThesaurusDialog_Impl, LeftBtnHdl_Impl, Button *, pBtn ) aLookUpHistory.pop(); // remove current look up word from stack aWordCB.SetText( aLookUpHistory.top() ); // retrieve previous look up word aLookUpHistory.pop(); - LookUpHdl_Impl( NULL ); + LookUp_Impl(); } return 0; } -
-IMPL_LINK( SvxThesaurusDialog_Impl, LanguageHdl_Impl, MenuButton *, pBtn )
+ +IMPL_LINK( SvxThesaurusDialog_Impl, LanguageHdl_Impl, MenuButton *, pBtn ) { PopupMenu *pMenu = aLangMBtn.GetPopupMenu(); if (pMenu && pBtn) @@ -359,18 +425,18 @@ IMPL_LINK( SvxThesaurusDialog_Impl, LanguageHdl_Impl, MenuButton *, pBtn ) USHORT nItem = pBtn->GetCurItemId(); String aLangText( pMenu->GetItemText( nItem ) ); LanguageType nLang = SvtLanguageTable().GetType( aLangText ); - DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" );
- if (xThesaurus->hasLocale( SvxCreateLocale( nLang ) ))
- nLookUpLanguage = nLang;
- SetWindowTitle( nLang );
+ DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); + if (xThesaurus->hasLocale( SvxCreateLocale( nLang ) )) + nLookUpLanguage = nLang; + SetWindowTitle( nLang ); UpdateVendorImage(); - LookUpHdl_Impl( NULL ); + LookUp_Impl(); } return 0; } -IMPL_LINK( SvxThesaurusDialog_Impl, LookUpHdl_Impl, Button *, EMPTYARG /*pBtn*/ ) +void SvxThesaurusDialog_Impl::LookUp_Impl() { String aText( aWordCB.GetText() ); @@ -379,19 +445,14 @@ IMPL_LINK( SvxThesaurusDialog_Impl, LookUpHdl_Impl, Button *, EMPTYARG /*pBtn*/ (aLookUpHistory.size() == 0 || aLookUpText != aLookUpHistory.top())) aLookUpHistory.push( aLookUpText ); - UpdateAlternativesBox_Impl(); + m_bWordFound = UpdateAlternativesBox_Impl(); + m_pAlternativesCT->Enable( m_bWordFound ); if ( aWordCB.GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND ) aWordCB.InsertEntry( aText ); - aWordCB.SelectEntryPos( aWordCB.GetEntryPos( aText ) ); aReplaceEdit.SetText( String() ); - aOkBtn.Enable( FALSE ); - m_pAlternativesCT->GrabFocus(); - aLeftBtn.Enable( aLookUpHistory.size() > 1 ); - - return 0; } @@ -403,9 +464,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, WordSelectHdl_Impl, ComboBox *, pBox ) String aStr( pBox->GetEntry( nPos ) ); GetReplaceEditString( aStr ); aWordCB.SetText( aStr ); - aOkBtn.Enable( aStr.Len() > 0 ); - - LookUpHdl_Impl( NULL ); + LookUp_Impl(); } return 0; @@ -425,7 +484,6 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox GetReplaceEditString( aStr ); } aReplaceEdit.SetText( aStr ); - aOkBtn.Enable( aStr.Len() > 0 ); } return 0; } @@ -443,11 +501,10 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis aStr = pData->GetText(); GetReplaceEditString( aStr ); } - aWordCB.SetText( aStr ); - aOkBtn.Enable( aStr.Len() > 0 ); + aWordCB.SetText( aStr ); if (aStr.Len() > 0) - LookUpHdl_Impl( NULL ); + LookUp_Impl(); } //! workaround to set the selection since calling SelectEntryPos within @@ -457,11 +514,11 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis } -IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox )
-{
- if (pBox && pBox->GetEntryCount() > 0)
- pBox->SelectEntryPos( 0 );
- return 0;
+IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox ) +{ + if (pBox && pBox->GetEntryCount() > 0) + pBox->SelectEntryPos( 0 ); + return 0; } //////////////////////////////////////////////////////////// @@ -628,7 +685,6 @@ IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, VendorImageInitHdl, SvxThesaurusDialo &pThis->aLeftBtn, &pThis->aWordText, &pThis->aWordCB, - &pThis->aLookUpBtn, &pThis->m_aAlternativesText, pThis->m_pAlternativesCT.get(), &pThis->aReplaceText, @@ -636,7 +692,7 @@ IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, VendorImageInitHdl, SvxThesaurusDialo &pThis->aFL, &pThis->aHelpBtn, &pThis->aLangMBtn, - &pThis->aOkBtn, + &pThis->aReplaceBtn, &pThis->aCancelBtn, 0 }; @@ -689,10 +745,10 @@ SvxThesaurusDialog::SvxThesaurusDialog( String aTmp2( aTmp ); m_pImpl->aReplaceEdit.SetText( aTmp2 ); m_pImpl->aWordCB.InsertEntry( aTmp2 ); - m_pImpl->aWordCB.SelectEntryPos( m_pImpl->aWordCB.GetEntryPos( aTmp2 ) ); m_pImpl->SetWindowTitle( nLanguage ); - m_pImpl->UpdateAlternativesBox_Impl(); + + m_pImpl->LookUp( aTmp2 ); m_pImpl->m_pAlternativesCT->GrabFocus(); m_pImpl->aLeftBtn.Enable( sal_False ); @@ -728,11 +784,11 @@ SvxThesaurusDialog::~SvxThesaurusDialog() { } -
-String SvxThesaurusDialog::GetWord()
-{
- return m_pImpl->aReplaceEdit.GetText();
-}
+ +String SvxThesaurusDialog::GetWord() +{ + return m_pImpl->aReplaceEdit.GetText(); +} sal_uInt16 SvxThesaurusDialog::GetLanguage() const diff --git a/svx/source/dialog/thesdlg.hrc b/svx/source/dialog/thesdlg.hrc index 2d776ca92d4f..18ceadad4831 100755 --- a/svx/source/dialog/thesdlg.hrc +++ b/svx/source/dialog/thesdlg.hrc @@ -37,7 +37,6 @@ #define BTN_THES_CANCEL 11 #define MB_LANGUAGE 12 #define BTN_THES_HELP 13 -#define BTN_LOOKUP 14 #define FT_WORD 15 #define CB_WORD 16 #define FT_REPL 21 @@ -49,7 +48,7 @@ #define IMG_DEFAULT_VENDOR 27 #define IMG_DEFAULT_VENDOR_HC 28 -#define STR_ERR_WORDNOTFOUND 101 +#define STR_ERR_TEXTNOTFOUND 101 #endif diff --git a/svx/source/dialog/thesdlg.src b/svx/source/dialog/thesdlg.src index 501b54964946..7cad0bc196de 100755 --- a/svx/source/dialog/thesdlg.src +++ b/svx/source/dialog/thesdlg.src @@ -39,7 +39,7 @@ ModalDialog RID_SVXDLG_THESAURUS { HelpId = SID_THESAURUS ; OutputSize = TRUE ; - Size = MAP_APPFONT ( 265, 230 ) ; + Size = MAP_APPFONT ( 235, 230 ) ; Text [ en-US ] = "Thesaurus" ; SvLook = TRUE ; Moveable = TRUE ; @@ -47,7 +47,7 @@ ModalDialog RID_SVXDLG_THESAURUS FixedImage IMG_VENDOR { Pos = MAP_APPFONT ( 0, 0 ) ; - Size = MAP_APPFONT ( 265, 0 ) ; // correct size will be applied at runtime + Size = MAP_APPFONT ( 235, 0 ) ; // correct size will be applied at runtime Hide = TRUE; }; @@ -69,13 +69,13 @@ ModalDialog RID_SVXDLG_THESAURUS { DropDown = TRUE ; Pos = MAP_APPFONT ( 24 , 16 ) ; - Size = MAP_APPFONT ( 171 , 60 ) ; // have drop down space for several lines + Size = MAP_APPFONT ( 141 , 60 ) ; // have drop down space for several lines }; - PushButton BTN_LOOKUP + MenuButton MB_LANGUAGE { - Pos = MAP_APPFONT ( 200 , 16 ) ; + Pos = MAP_APPFONT ( 170 , 16 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Look ~Up" ; + Text [ en-US ] = "~Language" ; }; FixedText FT_THES_ALTERNATIVES @@ -89,7 +89,7 @@ ModalDialog RID_SVXDLG_THESAURUS { HelpID = HID_CT_THES_ALTERNATIVES ; Pos = MAP_APPFONT ( 5 , 45 ) ; - Size = MAP_APPFONT ( 255 , 121 ) ; + Size = MAP_APPFONT ( 225 , 121 ) ; Border = TRUE; TabStop = TRUE ; }; @@ -105,13 +105,13 @@ ModalDialog RID_SVXDLG_THESAURUS { BORDER = TRUE ; Pos = MAP_APPFONT ( 5 , 184 ) ; - Size = MAP_APPFONT ( 255 , 12 ) ; + Size = MAP_APPFONT ( 225 , 12 ) ; LEFT = TRUE ; }; FixedLine FL_VAR { Pos = MAP_APPFONT ( 0 , 200 ) ; - Size = MAP_APPFONT ( 265 , 8 ) ; + Size = MAP_APPFONT ( 235 , 8 ) ; }; HelpButton BTN_THES_HELP @@ -119,28 +119,22 @@ ModalDialog RID_SVXDLG_THESAURUS Pos = MAP_APPFONT ( 5 , 210 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; }; - MenuButton MB_LANGUAGE - { - Pos = MAP_APPFONT ( 70 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Language" ; - }; OkButton BTN_THES_OK { - Pos = MAP_APPFONT ( 135 , 210 ) ; + Pos = MAP_APPFONT ( 105 , 210 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Replace" ; DefButton = TRUE ; }; CancelButton BTN_THES_CANCEL { - Pos = MAP_APPFONT ( 200 , 210 ) ; + Pos = MAP_APPFONT ( 170 , 210 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; }; - String STR_ERR_WORDNOTFOUND + String STR_ERR_TEXTNOTFOUND { - Text [ en-US ] = "Word not found in thesaurus" ; + Text [ en-US ] = "No alternatives found." ; }; Image IMG_DEFAULT_VENDOR diff --git a/svx/source/dialog/thesdlg_impl.hxx b/svx/source/dialog/thesdlg_impl.hxx index 848d86fca54b..354bc95c09db 100755 --- a/svx/source/dialog/thesdlg_impl.hxx +++ b/svx/source/dialog/thesdlg_impl.hxx @@ -34,15 +34,16 @@ #include <svx/thesdlg.hxx> #include <svx/checklbx.hxx> -#include <vcl/button.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
+#include <vcl/button.hxx> +#include <vcl/combobox.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> #include <vcl/image.hxx> -#include <vcl/lstbox.hxx>
+#include <vcl/lstbox.hxx> #include <vcl/menubtn.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> +#include <vcl/timer.hxx> #include <vcl/wrkwin.hxx> #include <com/sun/star/linguistic2/XThesaurus.hpp> @@ -54,24 +55,49 @@ using namespace ::com::sun::star; using ::rtl::OUString; -// class LookUpComboBox -------------------------------------------------- +// class LookUpComboBox_Impl -------------------------------------------------- -class LookUpComboBox : public ComboBox +class LookUpComboBox_Impl : public ComboBox { - Button * m_pBtn; + Timer m_aModifyTimer; + Selection m_aSelection; + Button * m_pBtn; + SvxThesaurusDialog_Impl & m_rDialogImpl; // disable copy c-tor and assignment operator - LookUpComboBox( const LookUpComboBox & ); - LookUpComboBox & operator = ( const LookUpComboBox & ); + LookUpComboBox_Impl( const LookUpComboBox_Impl & ); + LookUpComboBox_Impl & operator = ( const LookUpComboBox_Impl & ); public: - LookUpComboBox( Window *pParent, const ResId &rResId ); - virtual ~LookUpComboBox(); + LookUpComboBox_Impl( Window *pParent, const ResId &rResId, SvxThesaurusDialog_Impl &rImpl ); + virtual ~LookUpComboBox_Impl(); + + DECL_LINK( ModifyTimer_Hdl, Timer * ); void SetButton( Button *pBtn ) { m_pBtn = pBtn; } // ComboBox virtual void Modify(); +}; + +// class ReplaceEdit_Impl -------------------------------------------------- + +class ReplaceEdit_Impl : public Edit +{ + Button * m_pBtn; + + // disable copy c-tor and assignment operator + ReplaceEdit_Impl( const ReplaceEdit_Impl & ); + ReplaceEdit_Impl & operator = ( const ReplaceEdit_Impl & ); + +public: + ReplaceEdit_Impl( Window *pParent, const ResId &rResId ); + virtual ~ReplaceEdit_Impl(); + + void SetButton( Button *pBtn ) { m_pBtn = pBtn; } + + // Edit + virtual void Modify(); virtual void SetText( const XubString& rStr ); virtual void SetText( const XubString& rStr, const Selection& rNewSelection ); }; @@ -127,7 +153,8 @@ public: SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ); void ClearUserData(); - virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void Paint( const Rectangle& rRect ); }; @@ -135,34 +162,34 @@ public: struct SvxThesaurusDialog_Impl { - Window* m_pParent; - - FixedImage aVendorImageFI; - ImageButton aLeftBtn; - FixedText aWordText;
- LookUpComboBox aWordCB;
- PushButton aLookUpBtn;
- FixedText m_aAlternativesText;
- boost::shared_ptr< ThesaurusAlternativesCtrl_Impl > m_pAlternativesCT;
- FixedText aReplaceText;
- Edit aReplaceEdit;
- FixedLine aFL;
- HelpButton aHelpBtn;
- MenuButton aLangMBtn;
- OKButton aOkBtn;
- CancelButton aCancelBtn;
-
- String aErrStr;
+ Window * m_pParent; + + FixedImage aVendorImageFI; + ImageButton aLeftBtn; + FixedText aWordText; + LookUpComboBox_Impl aWordCB; + FixedText m_aAlternativesText; + boost::shared_ptr< ThesaurusAlternativesCtrl_Impl > m_pAlternativesCT; + FixedText aReplaceText; + ReplaceEdit_Impl aReplaceEdit; + FixedLine aFL; + HelpButton aHelpBtn; + MenuButton aLangMBtn; + OKButton aReplaceBtn; + CancelButton aCancelBtn; + + String aErrStr; Image aVendorDefaultImage; Image aVendorDefaultImageHC; -
+ uno::Reference< linguistic2::XThesaurus > xThesaurus; - OUString aLookUpText; - LanguageType nLookUpLanguage; + OUString aLookUpText; + LanguageType nLookUpLanguage; std::stack< OUString > aLookUpHistory; + bool m_bWordFound; SfxErrorContext* pErrContext; // error context while dfalog is opened -
+ // Handler DECL_LINK( LeftBtnHdl_Impl, Button * ); @@ -176,8 +203,8 @@ struct SvxThesaurusDialog_Impl DECL_STATIC_LINK( SvxThesaurusDialog_Impl, VendorImageInitHdl, SvxThesaurusDialog_Impl * ); - SvxThesaurusDialog_Impl( Window* pParent );
- ~SvxThesaurusDialog_Impl();
+ SvxThesaurusDialog_Impl( Window* pParent ); + ~SvxThesaurusDialog_Impl(); uno::Sequence< uno::Reference< linguistic2::XMeaning > > SAL_CALL queryMeanings_Impl( ::rtl::OUString& rTerm, const lang::Locale& rLocale, const beans::PropertyValues& rProperties ) throw(lang::IllegalArgumentException, uno::RuntimeException); @@ -185,6 +212,8 @@ struct SvxThesaurusDialog_Impl bool UpdateAlternativesBox_Impl(); void UpdateVendorImage(); void SetWindowTitle( LanguageType nLanguage ); + void LookUp( const String &rText ); + void LookUp_Impl(); }; #endif |