diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-04 11:31:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-04 12:49:27 +0100 |
commit | 77407d7ad0cece76eed9e7767765b12229e6449d (patch) | |
tree | 2d03934bd883b64567d8f6a5f9e4630f4ba94a64 /cui | |
parent | c5850f4b25d2b735ea59bb0ac8c2bc58527ac17e (diff) |
convert thesaurus dialog to .ui format
Change-Id: I58c128b78f19b1141b82c2cecb37ed390a5db82b
Diffstat (limited to 'cui')
-rw-r--r-- | cui/AllLangResTarget_cui.mk | 2 | ||||
-rw-r--r-- | cui/UI_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/dialogs/cuires.src | 17 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.cxx | 347 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.hrc | 40 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.src | 146 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg_impl.hxx | 8 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 3 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/thesdlg.hxx | 71 | ||||
-rw-r--r-- | cui/uiconfig/ui/thesaurus.ui | 217 |
11 files changed, 394 insertions, 459 deletions
diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index 4af405878fb3..f3d76a961c2a 100644 --- a/cui/AllLangResTarget_cui.mk +++ b/cui/AllLangResTarget_cui.mk @@ -58,6 +58,7 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/dialogs/colorpicker.src \ cui/source/dialogs/commonlingui.src \ cui/source/dialogs/cuiimapdlg.src \ + cui/source/dialogs/cuires.src \ cui/source/dialogs/dlgname.src \ cui/source/dialogs/fmsearch.src \ cui/source/dialogs/gallery.src \ @@ -80,7 +81,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/dialogs/srchxtra.src \ cui/source/dialogs/svuidlg.src \ cui/source/dialogs/tbxform.src \ - cui/source/dialogs/thesdlg.src \ cui/source/options/certpath.src \ cui/source/options/connpooloptions.src \ cui/source/options/dbregister.src \ diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk index c2d51e6afb46..717107dd79d2 100644 --- a/cui/UI_cui.mk +++ b/cui/UI_cui.mk @@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ cui/uiconfig/ui/effectspage \ cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/specialcharacters \ + cui/uiconfig/ui/thesaurus \ cui/uiconfig/ui/twolinespage \ cui/uiconfig/ui/zoomdialog \ )) diff --git a/cui/source/dialogs/cuires.src b/cui/source/dialogs/cuires.src new file mode 100644 index 000000000000..6b7e8fc1aab5 --- /dev/null +++ b/cui/source/dialogs/cuires.src @@ -0,0 +1,17 @@ +/* -*- 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/. + */ + +#include "cuires.hrc" + +String RID_SVXSTR_ERR_TEXTNOTFOUND +{ + Text [ en-US ] = "No alternatives found." ; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index c794b2a9512d..7be748a60f6b 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -26,7 +26,6 @@ * ************************************************************************/ -#include "thesdlg.hrc" #include "thesdlg.hxx" #include "thesdlg_impl.hxx" #include "cuires.hrc" @@ -63,69 +62,83 @@ using namespace ::com::sun::star; using ::rtl::OUString; -// class LookUpComboBox_Impl -------------------------------------------------- +// class LookUpComboBox -------------------------------------------------- -LookUpComboBox_Impl::LookUpComboBox_Impl( - Window *pParent, const ResId &rResId, SvxThesaurusDialog &rImpl ) : - ComboBox (pParent, rResId), - m_rDialogImpl( rImpl ) +LookUpComboBox::LookUpComboBox(Window *pParent) + : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK) { - m_aModifyTimer.SetTimeoutHdl( LINK( this, LookUpComboBox_Impl, ModifyTimer_Hdl ) ); + SetBestDropDownLineCount(); + + m_aModifyTimer.SetTimeoutHdl( LINK( this, LookUpComboBox, ModifyTimer_Hdl ) ); m_aModifyTimer.SetTimeout( 500 ); EnableAutocomplete( sal_False ); } -LookUpComboBox_Impl::~LookUpComboBox_Impl() +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLookUpComboBox(Window *pParent, VclBuilder::stringmap &) { + return new LookUpComboBox(pParent); } -void LookUpComboBox_Impl::Modify() +void LookUpComboBox::init(SvxThesaurusDialog *pDialog) +{ + m_pDialog = pDialog; +} + +LookUpComboBox::~LookUpComboBox() +{ +} + +void LookUpComboBox::Modify() { m_aModifyTimer.Start(); } -IMPL_LINK( LookUpComboBox_Impl, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ ) +IMPL_LINK( LookUpComboBox, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ ) { - m_rDialogImpl.LookUp( GetText() ); + m_pDialog->LookUp( GetText() ); m_aModifyTimer.Stop(); return 0; } -// class ReplaceEdit_Impl -------------------------------------------------- +// class ReplaceEdit -------------------------------------------------- -ReplaceEdit_Impl::ReplaceEdit_Impl( Window *pParent, const ResId &rResId ) - : Edit(pParent, rResId) - , m_pBtn(NULL) +ReplaceEdit::ReplaceEdit(Window *pParent) + : Edit(pParent) { } -ReplaceEdit_Impl::~ReplaceEdit_Impl() +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeReplaceEdit(Window *pParent, VclBuilder::stringmap &) { + return new ReplaceEdit(pParent); } -void ReplaceEdit_Impl::Modify() +ReplaceEdit::~ReplaceEdit() +{ +} + +void ReplaceEdit::Modify() { if (m_pBtn) m_pBtn->Enable( GetText().Len() > 0 ); } -void ReplaceEdit_Impl::SetText( const XubString& rStr ) +void ReplaceEdit::SetText( const XubString& rStr ) { Edit::SetText( rStr ); Modify(); } -void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSelection ) +void ReplaceEdit::SetText( const XubString& rStr, const Selection& rNewSelection ) { Edit::SetText( rStr, rNewSelection ); Modify(); } -// class ThesaurusAlternativesCtrl_Impl ---------------------------------- +// class ThesaurusAlternativesCtrl ---------------------------------- -AlternativesString_Impl::AlternativesString_Impl( - ThesaurusAlternativesCtrl_Impl &rControl, +AlternativesString::AlternativesString( + ThesaurusAlternativesCtrl &rControl, SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ), @@ -133,7 +146,7 @@ AlternativesString_Impl::AlternativesString_Impl( { } -void AlternativesString_Impl::Paint( +void AlternativesString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* pEntry ) @@ -154,28 +167,35 @@ void AlternativesString_Impl::Paint( rDev.SetFont( aOldFont ); } -ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl( - Window* pParent, - SvxThesaurusDialog &rImpl ) : - SvxCheckListBox( pParent, CUI_RES( CT_THES_ALTERNATIVES ) ), - m_rDialogImpl( rImpl ) +ThesaurusAlternativesCtrl::ThesaurusAlternativesCtrl(Window* pParent) + : SvxCheckListBox(pParent) { SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE ); SetHighlightRange(); } -ThesaurusAlternativesCtrl_Impl::~ThesaurusAlternativesCtrl_Impl() +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeThesaurusAlternativesCtrl(Window *pParent, VclBuilder::stringmap &) +{ + return new ThesaurusAlternativesCtrl(pParent); +} + +void ThesaurusAlternativesCtrl::init(SvxThesaurusDialog *pDialog) +{ + m_pDialog = pDialog; +} + +ThesaurusAlternativesCtrl::~ThesaurusAlternativesCtrl() { ClearExtraData(); } -void ThesaurusAlternativesCtrl_Impl::ClearExtraData() +void ThesaurusAlternativesCtrl::ClearExtraData() { UserDataMap_t aEmpty; m_aUserData.swap( aEmpty ); } -void ThesaurusAlternativesCtrl_Impl::SetExtraData( +void ThesaurusAlternativesCtrl::SetExtraData( const SvLBoxEntry *pEntry, const AlternativesExtraData &rData ) { @@ -189,7 +209,7 @@ void ThesaurusAlternativesCtrl_Impl::SetExtraData( m_aUserData[ pEntry ] = rData; } -AlternativesExtraData * ThesaurusAlternativesCtrl_Impl::GetExtraData( +AlternativesExtraData * ThesaurusAlternativesCtrl::GetExtraData( const SvLBoxEntry *pEntry ) { AlternativesExtraData *pRes = NULL; @@ -199,7 +219,7 @@ AlternativesExtraData * ThesaurusAlternativesCtrl_Impl::GetExtraData( return pRes; } -SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ) +SvLBoxEntry * ThesaurusAlternativesCtrl::AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ) { SvLBoxEntry* pEntry = new SvLBoxEntry; String aText; @@ -211,7 +231,7 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column aText += rText; pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash - pEntry->AddItem( new AlternativesString_Impl( *this, pEntry, 0, aText ) ); + pEntry->AddItem( new AlternativesString( *this, pEntry, 0, aText ) ); SetExtraData( pEntry, AlternativesExtraData( rText, bIsHeader ) ); GetModel()->Insert( pEntry ); @@ -222,29 +242,29 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St return pEntry; } -void ThesaurusAlternativesCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) +void ThesaurusAlternativesCtrl::KeyInput( const KeyEvent& rKEvt ) { const KeyCode& rKey = rKEvt.GetKeyCode(); if (rKey.GetCode() == KEY_RETURN || rKey.GetCode() == KEY_ESCAPE) GetParent()->KeyInput( rKEvt ); // parent will close dialog... else if (rKey.GetCode() == KEY_SPACE) - m_rDialogImpl.AlternativesDoubleClickHdl_Impl( this ); // look up current selected entry + m_pDialog->AlternativesDoubleClickHdl_Impl( this ); // look up current selected entry else if (GetEntryCount()) SvxCheckListBox::KeyInput( rKEvt ); } -void ThesaurusAlternativesCtrl_Impl::Paint( const Rectangle& rRect ) +void ThesaurusAlternativesCtrl::Paint( const Rectangle& rRect ) { - if (!m_rDialogImpl.WordFound()) + if (!m_pDialog->WordFound()) { - Size aTextSize( GetTextWidth( m_rDialogImpl.getErrStr() ), GetTextHeight() ); + Size aTextSize( GetTextWidth( m_pDialog->getErrStr() ), GetTextHeight() ); aTextSize = LogicToPixel( aTextSize ); Point aPos; aPos.X() += GetSizePixel().Width() / 2 - aTextSize.Width() / 2; aPos.Y() += GetSizePixel().Height() / 2; aPos = PixelToLogic( aPos ); - DrawText( aPos, m_rDialogImpl.getErrStr() ); + DrawText( aPos, m_pDialog->getErrStr() ); } else @@ -312,8 +332,8 @@ bool SvxThesaurusDialog::UpdateAlternativesBox_Impl() void SvxThesaurusDialog::LookUp( const String &rText ) { - if (rText != aWordCB.GetText()) // avoid moving of the cursor if the text is the same - aWordCB.SetText( rText ); + if (rText != m_pWordCB->GetText()) // avoid moving of the cursor if the text is the same + m_pWordCB->SetText( rText ); LookUp_Impl(); } @@ -322,16 +342,16 @@ IMPL_LINK( SvxThesaurusDialog, LeftBtnHdl_Impl, Button *, pBtn ) if (pBtn && aLookUpHistory.size() >= 2) { aLookUpHistory.pop(); // remove current look up word from stack - aWordCB.SetText( aLookUpHistory.top() ); // retrieve previous look up word + m_pWordCB->SetText( aLookUpHistory.top() ); // retrieve previous look up word aLookUpHistory.pop(); LookUp_Impl(); } return 0; } -IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, MenuButton *, pBtn ) +IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, MenuButton*, pBtn ) { - PopupMenu *pMenu = aLangMBtn.GetPopupMenu(); + PopupMenu *pMenu = m_pLangMBtn->GetPopupMenu(); if (pMenu && pBtn) { sal_uInt16 nItem = pBtn->GetCurItemId(); @@ -341,7 +361,6 @@ IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, MenuButton *, pBtn ) if (xThesaurus->hasLocale( SvxCreateLocale( nLang ) )) nLookUpLanguage = nLang; SetWindowTitle( nLang ); - UpdateVendorImage(); LookUp_Impl(); } return 0; @@ -349,7 +368,7 @@ IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, MenuButton *, pBtn ) void SvxThesaurusDialog::LookUp_Impl() { - String aText( aWordCB.GetText() ); + String aText( m_pWordCB->GetText() ); aLookUpText = OUString( aText ); if (!aLookUpText.isEmpty() && @@ -359,21 +378,21 @@ void SvxThesaurusDialog::LookUp_Impl() m_bWordFound = UpdateAlternativesBox_Impl(); m_pAlternativesCT->Enable( m_bWordFound ); - if ( aWordCB.GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND ) - aWordCB.InsertEntry( aText ); + if ( m_pWordCB->GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND ) + m_pWordCB->InsertEntry( aText ); - aReplaceEdit.SetText( String() ); - aLeftBtn.Enable( aLookUpHistory.size() > 1 ); + m_pReplaceEdit->SetText( String() ); + m_pLeftBtn->Enable( aLookUpHistory.size() > 1 ); } IMPL_LINK( SvxThesaurusDialog, WordSelectHdl_Impl, ComboBox *, pBox ) { - if (pBox && !aWordCB.IsTravelSelect()) // act only upon return key and not when traveling with cursor keys + if (pBox && !m_pWordCB->IsTravelSelect()) // act only upon return key and not when traveling with cursor keys { sal_uInt16 nPos = pBox->GetSelectEntryPos(); String aStr( pBox->GetEntry( nPos ) ); aStr = linguistic::GetThesaurusReplaceText( aStr ); - aWordCB.SetText( aStr ); + m_pWordCB->SetText( aStr ); LookUp_Impl(); } @@ -392,7 +411,7 @@ IMPL_LINK( SvxThesaurusDialog, AlternativesSelectHdl_Impl, SvxCheckListBox *, pB aStr = pData->GetText(); aStr = linguistic::GetThesaurusReplaceText( aStr ); } - aReplaceEdit.SetText( aStr ); + m_pReplaceEdit->SetText( aStr ); } return 0; } @@ -410,7 +429,7 @@ IMPL_LINK( SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl, SvxCheckListBox aStr = linguistic::GetThesaurusReplaceText( aStr ); } - aWordCB.SetText( aStr ); + m_pWordCB->SetText( aStr ); if (aStr.Len() > 0) LookUp_Impl(); } @@ -429,192 +448,57 @@ IMPL_STATIC_LINK( SvxThesaurusDialog, SelectFirstHdl_Impl, SvxCheckListBox *, pB return 0; } -//////////////////////////////////////////////////////////// - -static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl ) -{ - Image aRes; - - OUString aTmp; - osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); - - Graphic aGraphic; - const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) ); - if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic, NULL, NULL ) ) - { - aRes = Image( aGraphic.GetBitmapEx() ); - } - return aRes; -} - -static String lcl_GetThesImplName( const lang::Locale &rLocale ) -{ - String aRes; - - uno::Reference< linguistic2::XLinguServiceManager > xLngMgr; - try - { - uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xLngMgr = uno::Reference< linguistic2::XLinguServiceManager >( xMSF->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.linguistic2.LinguServiceManager" ))), uno::UNO_QUERY_THROW ); - - DBG_ASSERT( xLngMgr.is(), "LinguServiceManager missing" ); - if (xLngMgr.is()) - { - uno::Sequence< OUString > aServiceNames = xLngMgr->getConfiguredServices( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.Thesaurus")), rLocale ); - // there should be at most one thesaurus configured for each language - DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); - if (aServiceNames.getLength() == 1) - aRes = aServiceNames[0]; - } - } - catch (uno::Exception &e) - { - (void) e; - DBG_ASSERT( 0, "failed to get thesaurus" ); - } - - return aRes; -} - -void SvxThesaurusDialog::UpdateVendorImage() -{ - SetUpdateMode( sal_False ); - - SvtLinguConfig aCfg; - if (aCfg.HasVendorImages( "ThesaurusDialogImage" )) - { - Image aImage; - String sThesImplName( lcl_GetThesImplName( SvxCreateLocale( nLookUpLanguage ) ) ); - OUString aThesDialogImageUrl( aCfg.GetThesaurusDialogImage( sThesImplName ) ); - if (sThesImplName.Len() > 0 && !aThesDialogImageUrl.isEmpty()) - aImage = Image( lcl_GetImageFromPngUrl( aThesDialogImageUrl ) ); - else - aImage = aVendorDefaultImage; - aVendorImageFI.SetImage( aImage ); - } - - SetUpdateMode( sal_True ); -} +// class SvxThesaurusDialog ---------------------------------------------- -IMPL_STATIC_LINK( SvxThesaurusDialog, VendorImageInitHdl, SvxThesaurusDialog*, EMPTYARG ) +SvxThesaurusDialog::SvxThesaurusDialog( + Window* pParent, + uno::Reference< linguistic2::XThesaurus > xThes, + const String &rWord, + LanguageType nLanguage) + : SvxStandardDialog(pParent, "ThesaurusDialog", "cui/ui/thesaurus.ui") + , m_aErrStr(CUI_RESSTR(RID_SVXSTR_ERR_TEXTNOTFOUND)) + , xThesaurus(NULL) + , aLookUpText() + , nLookUpLanguage(LANGUAGE_NONE) + , m_bWordFound(false) { - pThis->SetUpdateMode( sal_False ); + get(m_pLeftBtn, "left"); - SvtLinguConfig aCfg; - if (aCfg.HasVendorImages( "ThesaurusDialogImage" )) - { - Image aImage( pThis->aVendorDefaultImage ); - pThis->aVendorImageFI.SetImage( aImage ); - pThis->aVendorImageFI.Show(); - - // move down visible controls according to the vendor images height - Size aVendorSize = pThis->aVendorImageFI.GetSizePixel(); - Size aImageSize = pThis->aVendorImageFI.GetImage().GetSizePixel(); - if (aImageSize.Height()) - { - aVendorSize.Height() = aImageSize.Height(); - if(aVendorSize.Width() < aImageSize.Width()) - aVendorSize.Width() = aImageSize.Width(); - pThis->aVendorImageFI.SetSizePixel( aVendorSize ); - } - const sal_Int32 nDiff = aVendorSize.Height(); - pThis->aVendorImageFI.SetSizePixel( aVendorSize ); - Control* aControls[] = { - &pThis->aLeftBtn, - &pThis->aWordText, - &pThis->aWordCB, - &pThis->m_aAlternativesText, - pThis->m_pAlternativesCT.get(), - &pThis->aReplaceText, - &pThis->aReplaceEdit, - &pThis->aFL, - &pThis->aHelpBtn, - &pThis->aLangMBtn, - &pThis->aReplaceBtn, - &pThis->aCancelBtn, - 0 - }; - sal_Int32 nControl = 0; - while (aControls[nControl]) - { - Point aPos = aControls[nControl]->GetPosPixel(); - aPos.Y() += nDiff; - aControls[nControl]->SetPosPixel(aPos); - ++nControl; - } - Size aDlgSize = pThis->GetSizePixel(); - aDlgSize.Height() += nDiff; - pThis->SetSizePixel( aDlgSize ); - pThis->Invalidate(); - } + get(m_pWordCB, "wordcb"); + m_pWordCB->init(this); - pThis->UpdateVendorImage(); - pThis->SetUpdateMode( sal_True ); + get(m_pAlternativesCT, "alternatives"); + m_pAlternativesCT->init(this); - return 0; -}; + get(m_pReplaceEdit, "replaceed"); + PushButton *pReplaceBtn = get<PushButton>("replace"); + m_pReplaceEdit->init(pReplaceBtn); -// class SvxThesaurusDialog ---------------------------------------------- + get(m_pLangMBtn, "langcb"); -SvxThesaurusDialog::SvxThesaurusDialog( - Window* pParent, - uno::Reference< linguistic2::XThesaurus > xThes, - const String &rWord, - LanguageType nLanguage ) : - - SvxStandardDialog( pParent, CUI_RES( RID_SVXDLG_THESAURUS ) ), - - aVendorImageFI ( this, CUI_RES( IMG_VENDOR ) ), - aLeftBtn ( this, CUI_RES( BTN_LEFT ) ), - aWordText ( this, CUI_RES( FT_WORD ) ), - aWordCB ( this, CUI_RES( CB_WORD ), *this ), - m_aAlternativesText ( this, CUI_RES( FT_THES_ALTERNATIVES ) ), - m_pAlternativesCT ( new ThesaurusAlternativesCtrl_Impl( this, *this ) ), - aReplaceText ( this, CUI_RES( FT_REPL ) ), - aReplaceEdit ( this, CUI_RES( ED_REPL ) ), - aFL ( this, CUI_RES( FL_VAR ) ), - aHelpBtn ( this, CUI_RES( BTN_THES_HELP ) ), - aLangMBtn ( this, CUI_RES( MB_LANGUAGE ) ), - aReplaceBtn ( this, CUI_RES( BTN_THES_OK ) ), - aCancelBtn ( this, CUI_RES( BTN_THES_CANCEL ) ), - aErrStr ( CUI_RES( STR_ERR_TEXTNOTFOUND ) ), - aVendorDefaultImage ( CUI_RES( IMG_DEFAULT_VENDOR ) ), - xThesaurus ( NULL ), - aLookUpText (), - nLookUpLanguage ( LANGUAGE_NONE ), - m_bWordFound( false ) -{ - aReplaceEdit.SetButton( &aReplaceBtn ); - - aLeftBtn.SetClickHdl( LINK( this, SvxThesaurusDialog, LeftBtnHdl_Impl ) ); - aWordCB.SetSelectHdl( LINK( this, SvxThesaurusDialog, WordSelectHdl_Impl ) ); - aLangMBtn.SetSelectHdl( LINK( this, SvxThesaurusDialog, LanguageHdl_Impl ) ); + pReplaceBtn->SetClickHdl( LINK( this, SvxThesaurusDialog, ReplaceBtnHdl_Impl ) ); + m_pLeftBtn->SetClickHdl( LINK( this, SvxThesaurusDialog, LeftBtnHdl_Impl ) ); + m_pWordCB->SetSelectHdl( LINK( this, SvxThesaurusDialog, WordSelectHdl_Impl ) ); + m_pLangMBtn->SetSelectHdl( LINK( this, SvxThesaurusDialog, LanguageHdl_Impl ) ); m_pAlternativesCT->SetSelectHdl( LINK( this, SvxThesaurusDialog, AlternativesSelectHdl_Impl )); m_pAlternativesCT->SetDoubleClickHdl( LINK( this, SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl )); - Application::PostUserEvent( STATIC_LINK( this, SvxThesaurusDialog, VendorImageInitHdl ) ); - xThesaurus = xThes; aLookUpText = OUString( rWord ); nLookUpLanguage = nLanguage; if (rWord.Len() > 0) aLookUpHistory.push( rWord ); - FreeResource(); - OUString aTmp( rWord ); linguistic::RemoveHyphens( aTmp ); linguistic::ReplaceControlChars( aTmp ); String aTmp2( aTmp ); - aReplaceEdit.SetText( aTmp2 ); - aWordCB.InsertEntry( aTmp2 ); + m_pReplaceEdit->SetText( aTmp2 ); + m_pWordCB->InsertEntry( aTmp2 ); LookUp( aTmp2 ); m_pAlternativesCT->GrabFocus(); - aLeftBtn.Enable( sal_False ); + m_pLeftBtn->Enable( sal_False ); // fill language menu button list SvtLanguageTable aLangTab; @@ -623,11 +507,11 @@ SvxThesaurusDialog::SvxThesaurusDialog( aLocales = xThesaurus->getLocales(); const sal_Int32 nLocales = aLocales.getLength(); const lang::Locale *pLocales = aLocales.getConstArray(); - delete aLangMBtn.GetPopupMenu(); - PopupMenu* pMenu = new PopupMenu; - pMenu->SetMenuFlags( MENU_FLAG_NOAUTOMNEMONICS ); + PopupMenu* pMenu = m_pLangMBtn->GetPopupMenu(); + pMenu->Clear(); + pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); std::vector< OUString > aLangVec; - for (sal_Int32 i = 0; i < nLocales; ++i ) + for (sal_Int32 i = 0; i < nLocales; ++i) { const LanguageType nLang = SvxLocaleToLanguage( pLocales[i] ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); @@ -636,18 +520,29 @@ SvxThesaurusDialog::SvxThesaurusDialog( std::sort( aLangVec.begin(), aLangVec.end() ); for (size_t i = 0; i < aLangVec.size(); ++i) pMenu->InsertItem( (sal_uInt16)i+1, aLangVec[i] ); // menu items should be enumerated from 1 and not 0 - aLangMBtn.SetPopupMenu( pMenu ); - SetWindowTitle( nLanguage ); + std::vector< OUString >::iterator aI = std::find(aLangVec.begin(), aLangVec.end(), aLangTab.GetString(nLanguage)); + if (aI != aLangVec.end()) + { + pMenu->SetSelectedEntry(std::distance(aLangVec.begin(), aI) + 1); + pMenu->Select(); + } + + SetWindowTitle(nLanguage); // disable controls if service is missing if (!xThesaurus.is()) Enable( sal_False ); } +IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ ) +{ + EndDialog(true); + return 0; +} + SvxThesaurusDialog::~SvxThesaurusDialog() { - delete aLangMBtn.GetPopupMenu(); } void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage ) @@ -663,7 +558,7 @@ void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage ) String SvxThesaurusDialog::GetWord() { - return aReplaceEdit.GetText(); + return m_pReplaceEdit->GetText(); } sal_uInt16 SvxThesaurusDialog::GetLanguage() const diff --git a/cui/source/dialogs/thesdlg.hrc b/cui/source/dialogs/thesdlg.hrc deleted file mode 100644 index 56c6333e0949..000000000000 --- a/cui/source/dialogs/thesdlg.hrc +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 . - */ -#ifndef _SVX_THESDLG_HRC -#define _SVX_THESDLG_HRC - -// defines --------------------------------------------------------------- - -#define BTN_LEFT 9 -#define BTN_THES_OK 10 -#define BTN_THES_CANCEL 11 -#define MB_LANGUAGE 12 -#define BTN_THES_HELP 13 -#define FT_WORD 15 -#define CB_WORD 16 -#define FT_REPL 21 -#define ED_REPL 22 -#define FL_VAR 23 -#define FT_THES_ALTERNATIVES 24 -#define CT_THES_ALTERNATIVES 25 -#define IMG_VENDOR 26 -#define IMG_DEFAULT_VENDOR 27 - -#define STR_ERR_TEXTNOTFOUND 101 - -#endif diff --git a/cui/source/dialogs/thesdlg.src b/cui/source/dialogs/thesdlg.src deleted file mode 100644 index 67fdced0f137..000000000000 --- a/cui/source/dialogs/thesdlg.src +++ /dev/null @@ -1,146 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "cuires.hrc" -#include "thesdlg.hrc" -#include "helpid.hrc" -#include <svx/svxids.hrc> // SID_THESAURUS - - - // RID_SVXDLG_THES ------------------------------------------------------- -ModalDialog RID_SVXDLG_THESAURUS -{ - HelpId = CMD_SID_THESAURUS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 235, 230 ) ; - Text [ en-US ] = "Thesaurus" ; - SvLook = TRUE ; - Moveable = TRUE ; - - FixedImage IMG_VENDOR - { - Pos = MAP_APPFONT ( 0, 0 ) ; - Size = MAP_APPFONT ( 235, 0 ) ; // correct size will be applied at runtime - Hide = TRUE; - }; - - ImageButton BTN_LEFT - { - HelpID = "cui:ImageButton:RID_SVXDLG_THESAURUS:BTN_LEFT"; - Pos = MAP_APPFONT ( 5 , 15 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - SYMBOL = IMAGEBUTTON_ARROW_LEFT ; - }; - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 24 , 5 ) ; - Size = MAP_APPFONT ( 143 , 8 ) ; - Text [ en-US ] = "~Current word" ; - LEFT = TRUE ; - }; - ComboBox CB_WORD - { - HelpID = "cui:ComboBox:RID_SVXDLG_THESAURUS:CB_WORD"; - DropDown = TRUE ; - Pos = MAP_APPFONT ( 24 , 16 ) ; - Size = MAP_APPFONT ( 141 , 60 ) ; // have drop down space for several lines - }; - MenuButton MB_LANGUAGE - { - HelpID = "cui:MenuButton:RID_SVXDLG_THESAURUS:MB_LANGUAGE"; - Pos = MAP_APPFONT ( 170 , 16 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Language" ; - }; - - FixedText FT_THES_ALTERNATIVES - { - Pos = MAP_APPFONT ( 5 , 33 ) ; - Size = MAP_APPFONT ( 255 , 8 ) ; - Text [ en-US ] = "~Alternatives" ; - LEFT = TRUE ; - }; - Control CT_THES_ALTERNATIVES - { - HelpID = HID_CT_THES_ALTERNATIVES ; // also needed for automatic testing to find the control - Pos = MAP_APPFONT ( 5 , 45 ) ; - Size = MAP_APPFONT ( 225 , 121 ) ; - Border = TRUE; - TabStop = TRUE ; - }; - - FixedText FT_REPL - { - Pos = MAP_APPFONT ( 5 , 173 ) ; - Size = MAP_APPFONT ( 255 , 8 ) ; - Text [ en-US ] = "~Replace with" ; - LEFT = TRUE ; - }; - Edit ED_REPL - { - HelpID = "cui:Edit:RID_SVXDLG_THESAURUS:ED_REPL"; - BORDER = TRUE ; - Pos = MAP_APPFONT ( 5 , 184 ) ; - Size = MAP_APPFONT ( 225 , 12 ) ; - LEFT = TRUE ; - }; - FixedLine FL_VAR - { - Pos = MAP_APPFONT ( 0 , 200 ) ; - Size = MAP_APPFONT ( 235 , 8 ) ; - }; - - HelpButton BTN_THES_HELP - { - Pos = MAP_APPFONT ( 5 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - OkButton BTN_THES_OK - { - Pos = MAP_APPFONT ( 105 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Replace" ; - DefButton = TRUE ; - }; - CancelButton BTN_THES_CANCEL - { - Pos = MAP_APPFONT ( 170 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - - String STR_ERR_TEXTNOTFOUND - { - Text [ en-US ] = "No alternatives found." ; - }; - - Image IMG_DEFAULT_VENDOR - { - ImageBitmap = Bitmap { File = "vendor01.png"; }; - }; -}; - diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx index f1c5209be7e9..a0c73bbb7b57 100644 --- a/cui/source/dialogs/thesdlg_impl.hxx +++ b/cui/source/dialogs/thesdlg_impl.hxx @@ -55,14 +55,14 @@ using namespace ::com::sun::star; using ::rtl::OUString; class SvLBoxEntry; -class ThesaurusAlternativesCtrl_Impl; +class ThesaurusAlternativesCtrl; -class AlternativesString_Impl : public SvLBoxString +class AlternativesString : public SvLBoxString { - ThesaurusAlternativesCtrl_Impl & m_rControlImpl; + ThesaurusAlternativesCtrl& m_rControlImpl; public: - AlternativesString_Impl( ThesaurusAlternativesCtrl_Impl &rControl, + AlternativesString( ThesaurusAlternativesCtrl &rControl, SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rStr ); virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index f9e9571737b1..0899f959350b 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -212,7 +212,6 @@ #define RID_SVX_GRFFILTER_DLG_EMBOSS_TAB (RID_SVX_START + 337) #define RID_SVXDLG_SEARCHATTR (RID_SVX_START + 22) #define RID_SVXDLG_HYPHENATE (RID_SVX_START + 30) -#define RID_SVXDLG_THESAURUS (RID_SVX_START + 31) #define RID_SVXSTR_HMERR_CHECKINSTALL (RID_SVX_START + 94) // hyperlink dialog @@ -429,6 +428,8 @@ #define RID_SVXSTR_EVENT_CALCULATE (RID_SVX_START + 1193) #define RID_SVXSTR_EVENT_CONTENTCHANGED (RID_SVX_START + 1194) +#define RID_SVXSTR_ERR_TEXTNOTFOUND (RID_SVX_START + 1195) + #define RID_SVXDLG_CERTPATH (RID_SVX_START + 1198) #define RID_CUI_DIALOG_COLORPICKER (RID_SVX_START + 3) diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index 169b1ef45e3e..432992e07672 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -376,7 +376,6 @@ #define HID_OFAPAGE_QUOTE_SW_CLB "CUI_HID_OFAPAGE_QUOTE_SW_CLB" #define HID_OFAPAGE_QUOTE_CLB "CUI_HID_OFAPAGE_QUOTE_CLB" #define HID_POSTIT_DIALOG "CUI_HID_POSTIT_DIALOG" -#define HID_CT_THES_ALTERNATIVES "CUI_HID_CT_THES_ALTERNATIVES" #define HID_DLG_PASSWORD_TO_OPEN_MODIFY "CUI_HID_DLG_PASSWORD_TO_OPEN_MODIFY" #define HID_DLG_PASSWORD_TO_OPEN_MODIFY_PASSWORD_TO_OPEN "CUI_HID_DLG_PASSWORD_TO_OPEN_MODIFY_PASSWORD_TO_OPEN" diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx index 8809c5a38417..c6b43a646e35 100644 --- a/cui/source/inc/thesdlg.hxx +++ b/cui/source/inc/thesdlg.hxx @@ -35,24 +35,23 @@ using namespace ::com::sun::star; class SvxThesaurusDialog; -class LookUpComboBox_Impl : public ComboBox +class LookUpComboBox : public ComboBox { Timer m_aModifyTimer; Selection m_aSelection; - Button * m_pBtn; - SvxThesaurusDialog& m_rDialogImpl; + SvxThesaurusDialog* m_pDialog; /// disable copy ctor and assignment operator - LookUpComboBox_Impl( const LookUpComboBox_Impl & ); - LookUpComboBox_Impl & operator = ( const LookUpComboBox_Impl & ); + LookUpComboBox( const LookUpComboBox & ); + LookUpComboBox& operator = ( const LookUpComboBox & ); public: - LookUpComboBox_Impl( Window *pParent, const ResId &rResId, SvxThesaurusDialog &rImpl ); - virtual ~LookUpComboBox_Impl(); + LookUpComboBox(Window *pParent); + virtual ~LookUpComboBox(); DECL_LINK( ModifyTimer_Hdl, Timer * ); - void SetButton( Button *pBtn ) { m_pBtn = pBtn; } + void init(SvxThesaurusDialog *pDialog); // ComboBox virtual void Modify(); @@ -75,21 +74,23 @@ public: const String& GetText() const { return sText; } }; -class ThesaurusAlternativesCtrl_Impl : - public SvxCheckListBox +class ThesaurusAlternativesCtrl + : public SvxCheckListBox { - SvxThesaurusDialog& m_rDialogImpl; + SvxThesaurusDialog* m_pDialog; typedef std::map< const SvLBoxEntry *, AlternativesExtraData > UserDataMap_t; UserDataMap_t m_aUserData; /// disable copy ctor and assignment operator - ThesaurusAlternativesCtrl_Impl( const ThesaurusAlternativesCtrl_Impl & ); - ThesaurusAlternativesCtrl_Impl & operator = ( const ThesaurusAlternativesCtrl_Impl & ); + ThesaurusAlternativesCtrl( const ThesaurusAlternativesCtrl & ); + ThesaurusAlternativesCtrl & operator = ( const ThesaurusAlternativesCtrl & ); public: - ThesaurusAlternativesCtrl_Impl( Window* pParent, SvxThesaurusDialog &rImpl ); - virtual ~ThesaurusAlternativesCtrl_Impl(); + ThesaurusAlternativesCtrl(Window* pParent); + + void init(SvxThesaurusDialog *pDialog); + virtual ~ThesaurusAlternativesCtrl(); SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ); @@ -102,19 +103,19 @@ public: virtual void Paint( const Rectangle& rRect ); }; -class ReplaceEdit_Impl : public Edit +class ReplaceEdit : public Edit { Button * m_pBtn; /// disable copy ctor and assignment operator - ReplaceEdit_Impl( const ReplaceEdit_Impl & ); - ReplaceEdit_Impl & operator = ( const ReplaceEdit_Impl & ); + ReplaceEdit( const ReplaceEdit & ); + ReplaceEdit & operator = ( const ReplaceEdit & ); public: - ReplaceEdit_Impl( Window *pParent, const ResId &rResId ); - virtual ~ReplaceEdit_Impl(); + ReplaceEdit(Window *pParent); + virtual ~ReplaceEdit(); - void SetButton( Button *pBtn ) { m_pBtn = pBtn; } + void init(Button *pBtn) { m_pBtn = pBtn; } // Edit virtual void Modify(); @@ -124,22 +125,13 @@ public: class SvxThesaurusDialog : public SvxStandardDialog { - 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; + PushButton* m_pLeftBtn; + LookUpComboBox* m_pWordCB; + ThesaurusAlternativesCtrl* m_pAlternativesCT; + ReplaceEdit* m_pReplaceEdit; + MenuButton* m_pLangMBtn; + + OUString m_aErrStr; uno::Reference< linguistic2::XThesaurus > xThesaurus; OUString aLookUpText; @@ -149,9 +141,10 @@ class SvxThesaurusDialog : public SvxStandardDialog public: bool WordFound() const { return m_bWordFound; } - OUString getErrStr() const { return aErrStr; } + OUString getErrStr() const { return m_aErrStr; } // Handler + DECL_LINK( ReplaceBtnHdl_Impl, Button * ); DECL_LINK( LeftBtnHdl_Impl, Button * ); DECL_LINK( LanguageHdl_Impl, MenuButton * ); DECL_LINK( LookUpHdl_Impl, Button * ); @@ -160,13 +153,11 @@ public: DECL_LINK( AlternativesDoubleClickHdl_Impl, SvxCheckListBox * ); DECL_STATIC_LINK( SvxThesaurusDialog, SelectFirstHdl_Impl, SvxCheckListBox * ); - DECL_STATIC_LINK( SvxThesaurusDialog, VendorImageInitHdl, SvxThesaurusDialog * ); uno::Sequence< uno::Reference< linguistic2::XMeaning > > queryMeanings_Impl( ::rtl::OUString& rTerm, const lang::Locale& rLocale, const beans::PropertyValues& rProperties ) throw(lang::IllegalArgumentException, uno::RuntimeException); bool UpdateAlternativesBox_Impl(); - void UpdateVendorImage(); void LookUp( const String &rText ); void LookUp_Impl(); virtual void Apply(); diff --git a/cui/uiconfig/ui/thesaurus.ui b/cui/uiconfig/ui/thesaurus.ui new file mode 100644 index 000000000000..8df35d08561d --- /dev/null +++ b/cui/uiconfig/ui/thesaurus.ui @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="ThesaurusDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Thesaurus</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="replace"> + <property name="label" translatable="yes">Replace</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <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">Current word</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <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">Alternatives</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <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">Replace with</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="cuilo:ReplaceEdit" id="replaceed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="cuilo:LookUpComboBox" id="wordcb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="left"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">start</property> + <property name="use_action_appearance">False</property> + <property name="image">image1</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> + <child> + <object class="GtkComboBoxText" id="langcb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="cuilo:ThesaurusAlternativesCtrl" id="alternatives"> + <property name="width_request">500</property> + <property name="height_request">300</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">label</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">help</action-widget> + <action-widget response="0">replace</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-back</property> + </object> +</interface> |