Kaydet (Commit) 3a9d2f27 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert chinese dictionary dialog to .ui

Change-Id: I2c239c1e7115d26f7b1dba00b08256b650cc183e
üst 98c94047
...@@ -83,7 +83,6 @@ STD_RES_FILE( gid_File_Res_Svt, svt ) ...@@ -83,7 +83,6 @@ STD_RES_FILE( gid_File_Res_Svt, svt )
STD_RES_FILE( gid_File_Res_Svx, svx ) STD_RES_FILE( gid_File_Res_Svx, svx )
STD_RES_FILE( gid_File_Res_Editeng, editeng ) STD_RES_FILE( gid_File_Res_Editeng, editeng )
STD_RES_FILE( gid_File_Res_TextConversionDlgs, textconversiondlgs )
STD_RES_FILE( gid_File_Res_Cui, cui ) STD_RES_FILE( gid_File_Res_Cui, cui )
......
...@@ -93,7 +93,6 @@ Module gid_Module_Langpack_Resource_Template ...@@ -93,7 +93,6 @@ Module gid_Module_Langpack_Resource_Template
gid_File_Res_Svt, gid_File_Res_Svt,
gid_File_Res_Svx, gid_File_Res_Svx,
gid_File_Res_Cui, gid_File_Res_Cui,
gid_File_Res_TextConversionDlgs,
gid_File_Res_Sw, gid_File_Res_Sw,
gid_File_Res_Tk, gid_File_Res_Tk,
gid_File_Res_Acc, gid_File_Res_Acc,
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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 .
#
$(eval $(call gb_AllLangResTarget_AllLangResTarget,textconversiondlgs))
$(eval $(call gb_AllLangResTarget_set_reslocation,textconversiondlgs,svx))
$(eval $(call gb_AllLangResTarget_add_srs,textconversiondlgs,\
svx/textconversiondlgs \
))
$(eval $(call gb_SrsTarget_SrsTarget,svx/textconversiondlgs))
$(eval $(call gb_SrsTarget_add_files,svx/textconversiondlgs,\
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.src \
))
# vim: set noet sw=4 ts=4:
...@@ -50,7 +50,6 @@ $(eval $(call gb_Library_add_exception_objects,textconversiondlgs,\ ...@@ -50,7 +50,6 @@ $(eval $(call gb_Library_add_exception_objects,textconversiondlgs,\
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog \ svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog \
svx/source/unodialogs/textconversiondlgs/chinese_translationdialog \ svx/source/unodialogs/textconversiondlgs/chinese_translationdialog \
svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog \ svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog \
svx/source/unodialogs/textconversiondlgs/resid \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -29,7 +29,6 @@ $(eval $(call gb_Module_add_l10n_targets,svx,\ ...@@ -29,7 +29,6 @@ $(eval $(call gb_Module_add_l10n_targets,svx,\
AllLangResTarget_svx \ AllLangResTarget_svx \
AllLangResTarget_ofa \ AllLangResTarget_ofa \
AllLangResTarget_gal \ AllLangResTarget_gal \
AllLangResTarget_textconversiondlgs \
UIConfig_svx \ UIConfig_svx \
)) ))
......
...@@ -19,6 +19,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ ...@@ -19,6 +19,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/addsubmissiondialog \ svx/uiconfig/ui/addsubmissiondialog \
svx/uiconfig/ui/asianphoneticguidedialog \ svx/uiconfig/ui/asianphoneticguidedialog \
svx/uiconfig/ui/chineseconversiondialog \ svx/uiconfig/ui/chineseconversiondialog \
svx/uiconfig/ui/chinesedictionary \
svx/uiconfig/ui/compressgraphicdialog \ svx/uiconfig/ui/compressgraphicdialog \
svx/uiconfig/ui/deleteheaderdialog \ svx/uiconfig/ui/deleteheaderdialog \
svx/uiconfig/ui/deletefooterdialog \ svx/uiconfig/ui/deletefooterdialog \
......
...@@ -154,14 +154,7 @@ ...@@ -154,14 +154,7 @@
#define HID_REDLINING_TABCONTROL "SVX_HID_REDLINING_TABCONTROL" #define HID_REDLINING_TABCONTROL "SVX_HID_REDLINING_TABCONTROL"
#define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX" #define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX"
#define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL" #define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL"
#define HID_SVX_CHINESE_DICTIONARY_CB_REVERSE "SVX_HID_SVX_CHINESE_DICTIONARY_CB_REVERSE"
#define HID_SVX_CHINESE_DICTIONARY_LB_HEADER "SVX_HID_SVX_CHINESE_DICTIONARY_LB_HEADER" #define HID_SVX_CHINESE_DICTIONARY_LB_HEADER "SVX_HID_SVX_CHINESE_DICTIONARY_LB_HEADER"
#define HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED"
#define HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL"
#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED"
#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL"
#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED"
#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL"
#define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN" #define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN"
#define HID_SVX_MDLG_DOCRECOVERY_PROGR "SVX_HID_SVX_MDLG_DOCRECOVERY_PROGR" #define HID_SVX_MDLG_DOCRECOVERY_PROGR "SVX_HID_SVX_MDLG_DOCRECOVERY_PROGR"
#define HID_SVX_MDLG_ERR_REP_OPTIONS "SVX_HID_SVX_MDLG_ERR_REP_OPTIONS" #define HID_SVX_MDLG_ERR_REP_OPTIONS "SVX_HID_SVX_MDLG_ERR_REP_OPTIONS"
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#ifndef _UNODIALOGS_BUTTONGROUP_HRC #ifndef _UNODIALOGS_BUTTONGROUP_HRC
#define _UNODIALOGS_BUTTONGROUP_HRC #define _UNODIALOGS_BUTTONGROUP_HRC
#include "resids.hrc"
#define PB_OK 1 #define PB_OK 1
#define PB_CANCEL 1 #define PB_CANCEL 1
#define PB_HELP 1 #define PB_HELP 1
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include "chinese_dictionarydialog.hxx" #include "chinese_dictionarydialog.hxx"
#include "chinese_dictionarydialog.hrc"
#include "resid.hxx"
#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx>
#include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp>
#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp> #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
...@@ -55,21 +53,12 @@ using namespace ::com::sun::star::uno; ...@@ -55,21 +53,12 @@ using namespace ::com::sun::star::uno;
#define HEADER_BAR_BITS ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_FIXED | HIB_FIXEDPOS ) #define HEADER_BAR_BITS ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_FIXED | HIB_FIXEDPOS )
DictionaryList::DictionaryList( Window* pParent, const ResId& rResId) DictionaryList::DictionaryList(SvSimpleTableContainer& rParent, WinBits nBits)
: SvHeaderTabListBox( pParent, rResId ) : SvSimpleTable(rParent, nBits)
, m_xDictionary(0) , m_xDictionary(0)
, m_pHeaderBar(0) , m_pED_Term(0)
, m_pPropertyTypeNameListBox(0) , m_pED_Mapping(0)
, m_aToBeDeleted() , m_pLB_Property(0)
, m_nSortColumnIndex(0)
{
}
DictionaryList::DictionaryList( Window* pParent )
: SvHeaderTabListBox( pParent, 0 )
, m_xDictionary(0)
, m_pHeaderBar(0)
, m_pPropertyTypeNameListBox(0)
, m_aToBeDeleted() , m_aToBeDeleted()
, m_nSortColumnIndex(0) , m_nSortColumnIndex(0)
{ {
...@@ -77,13 +66,13 @@ DictionaryList::DictionaryList( Window* pParent ) ...@@ -77,13 +66,13 @@ DictionaryList::DictionaryList( Window* pParent )
OUString DictionaryList::getPropertyTypeName( sal_Int16 nConversionPropertyType ) const OUString DictionaryList::getPropertyTypeName( sal_Int16 nConversionPropertyType ) const
{ {
if(!m_pPropertyTypeNameListBox || !m_pPropertyTypeNameListBox->GetEntryCount()) if(!m_pLB_Property || !m_pLB_Property->GetEntryCount())
return OUString(); return OUString();
sal_uInt16 nPos = static_cast<sal_uInt16>( nConversionPropertyType )-1; sal_uInt16 nPos = static_cast<sal_uInt16>( nConversionPropertyType )-1;
if(nPos<m_pPropertyTypeNameListBox->GetEntryCount()) if(nPos<m_pLB_Property->GetEntryCount())
return m_pPropertyTypeNameListBox->GetEntry(nPos); return m_pLB_Property->GetEntry(nPos);
return m_pPropertyTypeNameListBox->GetEntry(0); return m_pLB_Property->GetEntry(0);
} }
OUString DictionaryList::makeTabString( const DictionaryEntry& rEntry ) const OUString DictionaryList::makeTabString( const DictionaryEntry& rEntry ) const
...@@ -96,21 +85,6 @@ OUString DictionaryList::makeTabString( const DictionaryEntry& rEntry ) const ...@@ -96,21 +85,6 @@ OUString DictionaryList::makeTabString( const DictionaryEntry& rEntry ) const
return aStr; return aStr;
} }
void DictionaryList::initDictionaryControl( const Reference< linguistic2::XConversionDictionary>& xDictionary
, ListBox* pPropertyTypeNameListBox )
{
SetStyle( WB_VSCROLL | WB_TABSTOP );
SetSelectionMode( SINGLE_SELECTION );
SetBorderStyle( WINDOW_BORDER_MONO );
SetHighlightRange();
if(m_xDictionary.is())
return;
m_xDictionary = xDictionary;
m_pPropertyTypeNameListBox = pPropertyTypeNameListBox;
}
void DictionaryList::save() void DictionaryList::save()
{ {
if( !m_xDictionary.is() ) if( !m_xDictionary.is() )
...@@ -289,55 +263,6 @@ sal_uIntPtr DictionaryList::deleteEntries( const OUString& rTerm ) ...@@ -289,55 +263,6 @@ sal_uIntPtr DictionaryList::deleteEntries( const OUString& rTerm )
return nPos; return nPos;
} }
DictionaryList::~DictionaryList()
{
}
void DictionaryList::activate( HeaderBar* pHeaderBar )
{
if(!m_pHeaderBar)
{
m_pHeaderBar = pHeaderBar;
Point aPos = GetPosPixel();
Size aSize = GetSizePixel();
Size aHeadSize = pHeaderBar->GetSizePixel();
aPos.Y() += aHeadSize.Height();
SetPosSizePixel( aPos, Size( aSize.Width(), aSize.Height() - aHeadSize.Height() ) );
InitHeaderBar( pHeaderBar );
}
Show();
}
HeaderBar* DictionaryList::createHeaderBar( const OUString& rColumn1, const OUString& rColumn2, const OUString& rColumn3
, long nWidth1, long nWidth2, long nWidth3 )
{
HeaderBar* pHeaderBar = new HeaderBar( Control::GetParent(), WB_BUTTONSTYLE | WB_BOTTOMBORDER );
pHeaderBar->SetPosSizePixel( GetPosPixel(), pHeaderBar->CalcWindowSizePixel() );
HeaderBarItemBits nBits = HEADER_BAR_BITS;
pHeaderBar->InsertItem( 1, rColumn1, nWidth1, nBits | HIB_UPARROW );
pHeaderBar->InsertItem( 2, rColumn2, nWidth2, nBits );
pHeaderBar->InsertItem( 3, rColumn3, nWidth3, nBits );
pHeaderBar->Show();
return pHeaderBar;
}
void DictionaryList::Resize()
{
SvHeaderTabListBox::Resize();
Size aBoxSize = GetOutputSizePixel();
if ( !aBoxSize.Width() )
return;
Size aBarSize = m_pHeaderBar->GetSizePixel();
aBarSize.Width() = GetSizePixel().Width();
m_pHeaderBar->SetSizePixel( aBarSize );
}
void DictionaryList::sortByColumn( sal_uInt16 nSortColumnIndex, bool bSortAtoZ ) void DictionaryList::sortByColumn( sal_uInt16 nSortColumnIndex, bool bSortAtoZ )
{ {
m_nSortColumnIndex=nSortColumnIndex; m_nSortColumnIndex=nSortColumnIndex;
...@@ -437,52 +362,115 @@ bool DictionaryEntry::operator==( const DictionaryEntry& rE ) const ...@@ -437,52 +362,115 @@ bool DictionaryEntry::operator==( const DictionaryEntry& rE ) const
&& m_nConversionPropertyType == rE.m_nConversionPropertyType; && m_nConversionPropertyType == rE.m_nConversionPropertyType;
} }
//----------------------------------------------------------------------------- void DictionaryList::setColSizes()
//----------------------------------------------------------------------------- {
//----------------------------------------------------------------------------- HeaderBar &rBar = GetTheHeaderBar();
if (rBar.GetItemCount() < 3)
return;
long nWidth1 = m_pED_Term->get_preferred_size().Width();
long nWidth2 = m_pED_Mapping->get_preferred_size().Width();
long nWidth3 = m_pLB_Property->get_preferred_size().Width();
long nWidth = GetSizePixel().Width();
long nPos3 = nWidth - nWidth3;
long nRemainder = nWidth - (nWidth1 + nWidth2 + nWidth3);
long aStaticTabs[] = { 3, 0, nWidth1 + (nRemainder/2), nPos3 };
SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
}
void DictionaryList::Resize()
{
SvSimpleTable::Resize();
setColSizes();
}
void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>& xDictionary,
Window *pED_Term, Window *pED_Mapping, ListBox *pLB_Property,
Window *pFT_Term, Window *pFT_Mapping, Window *pFT_Property)
{
SetStyle( WB_VSCROLL | WB_TABSTOP );
SetSelectionMode( SINGLE_SELECTION );
SetBorderStyle( WINDOW_BORDER_MONO );
SetHighlightRange();
if (m_xDictionary.is())
return;
m_xDictionary = xDictionary;
m_pED_Term = pED_Term;
m_pED_Mapping = pED_Mapping;
m_pLB_Property = pLB_Property;
HeaderBar& rHeaderBar = GetTheHeaderBar();
OUString aColumn1( OutputDevice::GetNonMnemonicString( pFT_Term->GetText() ) );
OUString aColumn2( OutputDevice::GetNonMnemonicString( pFT_Mapping->GetText() ) );
OUString aColumn3( OutputDevice::GetNonMnemonicString( pFT_Property->GetText() ) );
long nWidth1 = m_pED_Term->get_preferred_size().Width();
long nWidth2 = m_pED_Mapping->get_preferred_size().Width();
long nWidth3 = m_pLB_Property->get_preferred_size().Width();
HeaderBarItemBits nBits = HEADER_BAR_BITS;
rHeaderBar.InsertItem( 1, aColumn1, nWidth1, nBits | HIB_UPARROW );
rHeaderBar.InsertItem( 2, aColumn2, nWidth2, nBits );
rHeaderBar.InsertItem( 3, aColumn3, nWidth3, nBits );
long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 };
SetTabs( &pTabs[0], MAP_PIXEL );
}
void ChineseDictionaryDialog::initDictionaryControl(DictionaryList *pList,
const Reference< linguistic2::XConversionDictionary>& xDictionary)
{
//init HeaderBar and set tabs
HeaderBar& rHeaderBar = pList->GetTheHeaderBar();
//set hdl
rHeaderBar.SetSelectHdl( LINK( this, ChineseDictionaryDialog, HeaderBarClick ) );
//set widgets to track the width of for columns
pList->init(xDictionary,
m_pED_Term, m_pED_Mapping, m_pLB_Property,
m_pFT_Term, m_pFT_Mapping, m_pFT_Property);
}
ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
: ModalDialog( pParent, TextConversionDlgs_ResId( DLG_CHINESEDICTIONARY ) ) : ModalDialog(pParent, "ChineseDictionaryDialog",
, m_nTextConversionOptions( i18n::TextConversionOption::NONE ) "svx/ui/chinesedictionary.ui")
, m_aRB_To_Simplified( this, TextConversionDlgs_ResId( RB_TO_SIMPLIFIED ) ) , m_nTextConversionOptions(i18n::TextConversionOption::NONE)
, m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) ) , m_xContext(0)
, m_aCB_Reverse( this, TextConversionDlgs_ResId( CB_REVERSE ) ) {
, m_aFT_Term( this, TextConversionDlgs_ResId( FT_TERM ) ) get(m_pRB_To_Simplified, "tradtosimple");
, m_aED_Term( this, TextConversionDlgs_ResId( ED_TERM ) ) get(m_pRB_To_Traditional, "simpletotrad");
, m_aFT_Mapping( this, TextConversionDlgs_ResId( FT_MAPPING ) ) get(m_pCB_Reverse, "reverse");
, m_aED_Mapping( this, TextConversionDlgs_ResId( ED_MAPPING ) ) get(m_pFT_Term, "termft");
, m_aFT_Property( this, TextConversionDlgs_ResId( FT_PROPERTY ) ) get(m_pED_Term, "term");
, m_aLB_Property( this, TextConversionDlgs_ResId( LB_PROPERTY ) ) get(m_pFT_Mapping, "mappingft");
, m_pHeaderBar( 0 ) get(m_pED_Mapping, "mapping");
, m_aCT_DictionaryToSimplified( this, TextConversionDlgs_ResId( CT_MAPPINGLIST ) ) get(m_pFT_Property, "propertyft");
, m_aCT_DictionaryToTraditional( this ) get(m_pLB_Property, "property");
, m_aPB_Add( this, TextConversionDlgs_ResId( PB_ADD ) )
, m_aPB_Modify( this, TextConversionDlgs_ResId( PB_MODIFY ) ) get(m_pPB_Add, "add");
, m_aPB_Delete( this, TextConversionDlgs_ResId( PB_DELETE ) ) get(m_pPB_Modify, "modify");
, m_aFL_Bottomline( this, TextConversionDlgs_ResId( FL_BOTTOMLINE ) ) get(m_pPB_Delete, "delete");
, m_aBP_OK( this, TextConversionDlgs_ResId( PB_OK ) )
, m_aBP_Cancel( this, TextConversionDlgs_ResId( PB_CANCEL ) ) get(mpToSimplifiedContainer, "tradtosimpleview");
, m_aBP_Help( this, TextConversionDlgs_ResId( PB_HELP ) ) mpToSimplifiedContainer->set_height_request(mpToSimplifiedContainer->GetTextHeight() * 8);
, m_xContext( 0 ) m_pCT_DictionaryToSimplified = new DictionaryList(*mpToSimplifiedContainer, 0);
{ get(mpToTraditionalContainer, "simpletotradview");
FreeResource(); mpToTraditionalContainer->set_height_request(mpToTraditionalContainer->GetTextHeight() * 8);
m_pCT_DictionaryToTraditional = new DictionaryList(*mpToTraditionalContainer, 0);
m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED );
m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL );
m_aCB_Reverse.SetHelpId( HID_SVX_CHINESE_DICTIONARY_CB_REVERSE );
m_aCT_DictionaryToSimplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED );
m_aCT_DictionaryToTraditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL );
SvtLinguConfig aLngCfg; SvtLinguConfig aLngCfg;
sal_Bool bValue = sal_Bool(); sal_Bool bValue = sal_Bool();
Any aAny( aLngCfg.GetProperty( OUString( UPN_IS_REVERSE_MAPPING ) ) ); Any aAny( aLngCfg.GetProperty( OUString( UPN_IS_REVERSE_MAPPING ) ) );
if( aAny >>= bValue ) if( aAny >>= bValue )
m_aCB_Reverse.Check( bValue ); m_pCB_Reverse->Check( bValue );
m_aLB_Property.SetDropDownLineCount( m_aLB_Property.GetEntryCount() ); m_pLB_Property->SetDropDownLineCount( m_pLB_Property->GetEntryCount() );
m_aLB_Property.SelectEntryPos(0); m_pLB_Property->SelectEntryPos(0);
Reference< linguistic2::XConversionDictionary > xDictionary_To_Simplified(0); Reference< linguistic2::XConversionDictionary > xDictionary_To_Simplified(0);
Reference< linguistic2::XConversionDictionary > xDictionary_To_Traditional(0); Reference< linguistic2::XConversionDictionary > xDictionary_To_Traditional(0);
...@@ -533,79 +521,53 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) ...@@ -533,79 +521,53 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
xDictionary_To_Traditional->setActive( sal_True ); xDictionary_To_Traditional->setActive( sal_True );
} }
catch( uno::Exception& ) catch(const uno::Exception& )
{ {
} }
} }
} }
} }
//init HeaderBar and set tabs
{
OUString aColumn1( OutputDevice::GetNonMnemonicString( m_aFT_Term.GetText() ) );
OUString aColumn2( OutputDevice::GetNonMnemonicString( m_aFT_Mapping.GetText() ) );
OUString aColumn3( OutputDevice::GetNonMnemonicString( m_aFT_Property.GetText() ) );
long nWidth1 = m_aED_Mapping.GetPosPixel().X() - m_aED_Term.GetPosPixel().X();
long nWidth2 = m_aLB_Property.GetPosPixel().X() - m_aED_Mapping.GetPosPixel().X();
long nWidth3 = m_aLB_Property.GetSizePixel().Width();
m_pHeaderBar = m_aCT_DictionaryToSimplified.createHeaderBar( aColumn1, aColumn2, aColumn3, nWidth1, nWidth2, nWidth3 );
if(m_pHeaderBar)
m_pHeaderBar->SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_HEADER );
long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 };
m_aCT_DictionaryToSimplified.SetTabs( &pTabs[0], MAP_PIXEL );
m_aCT_DictionaryToTraditional.SetTabs( &pTabs[0], MAP_PIXEL );
}
//init dictionary controls //init dictionary controls
m_aCT_DictionaryToTraditional.SetPosPixel( m_aCT_DictionaryToSimplified.GetPosPixel() ); initDictionaryControl(m_pCT_DictionaryToSimplified, xDictionary_To_Simplified);
m_aCT_DictionaryToTraditional.SetSizePixel( m_aCT_DictionaryToSimplified.GetSizePixel() ); initDictionaryControl(m_pCT_DictionaryToTraditional, xDictionary_To_Traditional);
m_aCT_DictionaryToSimplified.initDictionaryControl( xDictionary_To_Simplified, &m_aLB_Property );
m_aCT_DictionaryToTraditional.initDictionaryControl( xDictionary_To_Traditional, &m_aLB_Property );
//
updateAfterDirectionChange(); updateAfterDirectionChange();
//set hdl m_pED_Term->SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
if(m_pHeaderBar) m_pED_Mapping->SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
m_pHeaderBar->SetSelectHdl( LINK( this, ChineseDictionaryDialog, HeaderBarClick ) ); m_pLB_Property->SetSelectHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
m_aED_Term.SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
m_aED_Mapping.SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
m_aLB_Property.SetSelectHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
m_aRB_To_Simplified.SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) ); m_pRB_To_Simplified->SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) );
m_aRB_To_Traditional.SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) ); m_pRB_To_Traditional->SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) );
m_aCT_DictionaryToSimplified.SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl )); m_pCT_DictionaryToSimplified->SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
m_aCT_DictionaryToTraditional.SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl )); m_pCT_DictionaryToTraditional->SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
m_aPB_Add.SetClickHdl( LINK( this, ChineseDictionaryDialog, AddHdl ) ); m_pPB_Add->SetClickHdl( LINK( this, ChineseDictionaryDialog, AddHdl ) );
m_aPB_Modify.SetClickHdl( LINK( this, ChineseDictionaryDialog, ModifyHdl ) ); m_pPB_Modify->SetClickHdl( LINK( this, ChineseDictionaryDialog, ModifyHdl ) );
m_aPB_Delete.SetClickHdl( LINK( this, ChineseDictionaryDialog, DeleteHdl ) ); m_pPB_Delete->SetClickHdl( LINK( this, ChineseDictionaryDialog, DeleteHdl ) );
} }
ChineseDictionaryDialog::~ChineseDictionaryDialog() ChineseDictionaryDialog::~ChineseDictionaryDialog()
{ {
m_xContext=0; m_xContext=0;
delete m_pHeaderBar; delete m_pCT_DictionaryToSimplified;
delete m_pCT_DictionaryToTraditional;
} }
void ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirectionToSimplified, sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ ) void ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirectionToSimplified, sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ )
{ {
if( bDirectionToSimplified == bool(m_aRB_To_Simplified.IsChecked()) if( bDirectionToSimplified == bool(m_pRB_To_Simplified->IsChecked())
&& nTextConversionOptions == m_nTextConversionOptions ) && nTextConversionOptions == m_nTextConversionOptions )
return; return;
m_nTextConversionOptions = nTextConversionOptions; m_nTextConversionOptions = nTextConversionOptions;
if( bDirectionToSimplified ) if( bDirectionToSimplified )
m_aRB_To_Simplified.Check(); m_pRB_To_Simplified->Check();
else else
m_aRB_To_Traditional.Check(); m_pRB_To_Traditional->Check();
updateAfterDirectionChange(); updateAfterDirectionChange();
} }
...@@ -619,17 +581,17 @@ void ChineseDictionaryDialog::updateAfterDirectionChange() ...@@ -619,17 +581,17 @@ void ChineseDictionaryDialog::updateAfterDirectionChange()
{ {
Reference< linguistic2::XConversionDictionary > xDictionary(0); Reference< linguistic2::XConversionDictionary > xDictionary(0);
if( m_aRB_To_Simplified.IsChecked() ) if( m_pRB_To_Simplified->IsChecked() )
{ {
m_aCT_DictionaryToSimplified.activate( m_pHeaderBar ); mpToTraditionalContainer->Hide();
m_aCT_DictionaryToTraditional.Hide(); mpToSimplifiedContainer->Show();
xDictionary = m_aCT_DictionaryToSimplified.m_xDictionary; xDictionary = m_pCT_DictionaryToSimplified->m_xDictionary;
} }
else else
{ {
m_aCT_DictionaryToTraditional.activate( m_pHeaderBar ); mpToSimplifiedContainer->Hide();
m_aCT_DictionaryToSimplified.Hide(); mpToTraditionalContainer->Show();
xDictionary = m_aCT_DictionaryToTraditional.m_xDictionary; xDictionary = m_pCT_DictionaryToTraditional->m_xDictionary;
} }
updateButtons(); updateButtons();
...@@ -645,13 +607,13 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, MappingSelectHdl) ...@@ -645,13 +607,13 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, MappingSelectHdl)
DictionaryEntry* pE = getActiveDictionary().getFirstSelectedEntry(); DictionaryEntry* pE = getActiveDictionary().getFirstSelectedEntry();
if(pE) if(pE)
{ {
m_aED_Term.SetText( pE->m_aTerm ); m_pED_Term->SetText( pE->m_aTerm );
m_aED_Mapping.SetText( pE->m_aMapping ); m_pED_Mapping->SetText( pE->m_aMapping );
sal_Int16 nPos = pE->m_nConversionPropertyType-1; sal_Int16 nPos = pE->m_nConversionPropertyType-1;
if( nPos<0 || nPos>=m_aLB_Property.GetEntryCount() ) if( nPos<0 || nPos>=m_pLB_Property->GetEntryCount() )
nPos=0; nPos=0;
if( m_aLB_Property.GetEntryCount() ) if( m_pLB_Property->GetEntryCount() )
m_aLB_Property.SelectEntryPos(nPos); m_pLB_Property->SelectEntryPos(nPos);
} }
updateButtons(); updateButtons();
...@@ -660,7 +622,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, MappingSelectHdl) ...@@ -660,7 +622,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, MappingSelectHdl)
bool ChineseDictionaryDialog::isEditFieldsHaveContent() const bool ChineseDictionaryDialog::isEditFieldsHaveContent() const
{ {
return !m_aED_Term.GetText().isEmpty() && !m_aED_Mapping.GetText().isEmpty(); return !m_pED_Term->GetText().isEmpty() && !m_pED_Mapping->GetText().isEmpty();
} }
bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() const bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() const
...@@ -668,11 +630,11 @@ bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() con ...@@ -668,11 +630,11 @@ bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() con
DictionaryEntry* pE = getActiveDictionary().getFirstSelectedEntry(); DictionaryEntry* pE = getActiveDictionary().getFirstSelectedEntry();
if( pE ) if( pE )
{ {
if( pE->m_aTerm != OUString( m_aED_Term.GetText() ) ) if( pE->m_aTerm != OUString( m_pED_Term->GetText() ) )
return false; return false;
if( pE->m_aMapping != OUString( m_aED_Mapping.GetText() ) ) if( pE->m_aMapping != OUString( m_pED_Mapping->GetText() ) )
return false; return false;
if( pE->m_nConversionPropertyType != m_aLB_Property.GetSelectEntryPos()+1 ) if( pE->m_nConversionPropertyType != m_pLB_Property->GetSelectEntryPos()+1 )
return false; return false;
return true; return true;
} }
...@@ -681,38 +643,38 @@ bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() con ...@@ -681,38 +643,38 @@ bool ChineseDictionaryDialog::isEditFieldsContentEqualsSelectedListContent() con
const DictionaryList& ChineseDictionaryDialog::getActiveDictionary() const const DictionaryList& ChineseDictionaryDialog::getActiveDictionary() const
{ {
if( m_aRB_To_Traditional.IsChecked() ) if( m_pRB_To_Traditional->IsChecked() )
return m_aCT_DictionaryToTraditional; return *m_pCT_DictionaryToTraditional;
return m_aCT_DictionaryToSimplified; return *m_pCT_DictionaryToSimplified;
} }
DictionaryList& ChineseDictionaryDialog::getActiveDictionary() DictionaryList& ChineseDictionaryDialog::getActiveDictionary()
{ {
if( m_aRB_To_Traditional.IsChecked() ) if( m_pRB_To_Traditional->IsChecked() )
return m_aCT_DictionaryToTraditional; return *m_pCT_DictionaryToTraditional;
return m_aCT_DictionaryToSimplified; return *m_pCT_DictionaryToSimplified;
} }
const DictionaryList& ChineseDictionaryDialog::getReverseDictionary() const const DictionaryList& ChineseDictionaryDialog::getReverseDictionary() const
{ {
if( m_aRB_To_Traditional.IsChecked() ) if( m_pRB_To_Traditional->IsChecked() )
return m_aCT_DictionaryToSimplified; return *m_pCT_DictionaryToSimplified;
return m_aCT_DictionaryToTraditional; return *m_pCT_DictionaryToTraditional;
} }
DictionaryList& ChineseDictionaryDialog::getReverseDictionary() DictionaryList& ChineseDictionaryDialog::getReverseDictionary()
{ {
if( m_aRB_To_Traditional.IsChecked() ) if( m_pRB_To_Traditional->IsChecked() )
return m_aCT_DictionaryToSimplified; return *m_pCT_DictionaryToSimplified;
return m_aCT_DictionaryToTraditional; return *m_pCT_DictionaryToTraditional;
} }
void ChineseDictionaryDialog::updateButtons() void ChineseDictionaryDialog::updateButtons()
{ {
bool bAdd = isEditFieldsHaveContent() && !getActiveDictionary().hasTerm( m_aED_Term.GetText() ); bool bAdd = isEditFieldsHaveContent() && !getActiveDictionary().hasTerm( m_pED_Term->GetText() );
m_aPB_Add.Enable( bAdd ); m_pPB_Add->Enable( bAdd );
m_aPB_Delete.Enable( !bAdd && getActiveDictionary().GetSelectedRowCount()>0 ); m_pPB_Delete->Enable( !bAdd && getActiveDictionary().GetSelectedRowCount()>0 );
// DictionaryEntry* pFirstSelectedEntry = getActiveDictionary().getFirstSelectedEntry(); // DictionaryEntry* pFirstSelectedEntry = getActiveDictionary().getFirstSelectedEntry();
...@@ -720,11 +682,11 @@ void ChineseDictionaryDialog::updateButtons() ...@@ -720,11 +682,11 @@ void ChineseDictionaryDialog::updateButtons()
{ {
DictionaryEntry* pFirstSelectedEntry = getActiveDictionary().getFirstSelectedEntry(); DictionaryEntry* pFirstSelectedEntry = getActiveDictionary().getFirstSelectedEntry();
bModify = !bAdd && getActiveDictionary().GetSelectedRowCount()==1 bModify = !bAdd && getActiveDictionary().GetSelectedRowCount()==1
&& pFirstSelectedEntry && pFirstSelectedEntry->m_aTerm.equals( m_aED_Term.GetText() ); && pFirstSelectedEntry && pFirstSelectedEntry->m_aTerm.equals( m_pED_Term->GetText() );
if( bModify && isEditFieldsContentEqualsSelectedListContent() ) if( bModify && isEditFieldsContentEqualsSelectedListContent() )
bModify = false; bModify = false;
} }
m_aPB_Modify.Enable( bModify ); m_pPB_Modify->Enable( bModify );
} }
IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl) IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl)
...@@ -732,14 +694,14 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl) ...@@ -732,14 +694,14 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl)
if( !isEditFieldsHaveContent() ) if( !isEditFieldsHaveContent() )
return 0; return 0;
sal_Int16 nConversionPropertyType = m_aLB_Property.GetSelectEntryPos()+1; sal_Int16 nConversionPropertyType = m_pLB_Property->GetSelectEntryPos()+1;
getActiveDictionary().addEntry( m_aED_Term.GetText(), m_aED_Mapping.GetText(), nConversionPropertyType ); getActiveDictionary().addEntry( m_pED_Term->GetText(), m_pED_Mapping->GetText(), nConversionPropertyType );
if( m_aCB_Reverse.IsChecked() ) if( m_pCB_Reverse->IsChecked() )
{ {
getReverseDictionary().deleteEntries( m_aED_Mapping.GetText() ); getReverseDictionary().deleteEntries( m_pED_Mapping->GetText() );
getReverseDictionary().addEntry( m_aED_Mapping.GetText(), m_aED_Term.GetText(), nConversionPropertyType ); getReverseDictionary().addEntry( m_pED_Mapping->GetText(), m_pED_Term->GetText(), nConversionPropertyType );
} }
updateButtons(); updateButtons();
...@@ -747,9 +709,9 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl) ...@@ -747,9 +709,9 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl)
} }
IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl) IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl)
{ {
OUString aTerm( m_aED_Term.GetText() ); OUString aTerm( m_pED_Term->GetText() );
OUString aMapping( m_aED_Mapping.GetText() ); OUString aMapping( m_pED_Mapping->GetText() );
sal_Int16 nConversionPropertyType = m_aLB_Property.GetSelectEntryPos()+1; sal_Int16 nConversionPropertyType = m_pLB_Property->GetSelectEntryPos()+1;
DictionaryList& rActive = getActiveDictionary(); DictionaryList& rActive = getActiveDictionary();
DictionaryList& rReverse = getReverseDictionary(); DictionaryList& rReverse = getReverseDictionary();
...@@ -762,7 +724,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl) ...@@ -762,7 +724,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl)
{ {
if( pE->m_aMapping != aMapping || pE->m_nConversionPropertyType != nConversionPropertyType ) if( pE->m_aMapping != aMapping || pE->m_nConversionPropertyType != nConversionPropertyType )
{ {
if( m_aCB_Reverse.IsChecked() ) if( m_pCB_Reverse->IsChecked() )
{ {
sal_uIntPtr nPos = rReverse.deleteEntries( pE->m_aMapping ); sal_uIntPtr nPos = rReverse.deleteEntries( pE->m_aMapping );
nPos = rReverse.deleteEntries( aMapping ); nPos = rReverse.deleteEntries( aMapping );
...@@ -797,7 +759,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, DeleteHdl) ...@@ -797,7 +759,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, DeleteHdl)
{ {
aMapping = pEntry->m_aMapping; aMapping = pEntry->m_aMapping;
rActive.deleteEntryOnPos( nN ); rActive.deleteEntryOnPos( nN );
if( m_aCB_Reverse.IsChecked() ) if( m_pCB_Reverse->IsChecked() )
rReverse.deleteEntries( aMapping ); rReverse.deleteEntries( aMapping );
} }
break; break;
...@@ -815,8 +777,8 @@ short ChineseDictionaryDialog::Execute() ...@@ -815,8 +777,8 @@ short ChineseDictionaryDialog::Execute()
if(m_nTextConversionOptions & i18n::TextConversionOption::USE_CHARACTER_VARIANTS ) if(m_nTextConversionOptions & i18n::TextConversionOption::USE_CHARACTER_VARIANTS )
nTextConversionOptions = nTextConversionOptions^i18n::TextConversionOption::USE_CHARACTER_VARIANTS ; nTextConversionOptions = nTextConversionOptions^i18n::TextConversionOption::USE_CHARACTER_VARIANTS ;
m_aCT_DictionaryToSimplified.refillFromDictionary( nTextConversionOptions ); m_pCT_DictionaryToSimplified->refillFromDictionary( nTextConversionOptions );
m_aCT_DictionaryToTraditional.refillFromDictionary( m_nTextConversionOptions ); m_pCT_DictionaryToTraditional->refillFromDictionary( m_nTextConversionOptions );
short nRet = ModalDialog::Execute(); short nRet = ModalDialog::Execute();
...@@ -825,41 +787,39 @@ short ChineseDictionaryDialog::Execute() ...@@ -825,41 +787,39 @@ short ChineseDictionaryDialog::Execute()
//save settings to configuration //save settings to configuration
SvtLinguConfig aLngCfg; SvtLinguConfig aLngCfg;
Any aAny; Any aAny;
aAny <<= sal_Bool( !!m_aCB_Reverse.IsChecked() ); aAny <<= sal_Bool( !!m_pCB_Reverse->IsChecked() );
aLngCfg.SetProperty( OUString( UPN_IS_REVERSE_MAPPING ), aAny ); aLngCfg.SetProperty( OUString( UPN_IS_REVERSE_MAPPING ), aAny );
m_aCT_DictionaryToSimplified.save(); m_pCT_DictionaryToSimplified->save();
m_aCT_DictionaryToTraditional.save(); m_pCT_DictionaryToTraditional->save();
} }
m_aCT_DictionaryToSimplified.deleteAll(); m_pCT_DictionaryToSimplified->deleteAll();
m_aCT_DictionaryToTraditional.deleteAll(); m_pCT_DictionaryToTraditional->deleteAll();
return nRet; return nRet;
} }
IMPL_LINK_NOARG(ChineseDictionaryDialog, HeaderBarClick) IMPL_LINK(ChineseDictionaryDialog, HeaderBarClick, HeaderBar*, pHeaderBar)
{ {
if(m_pHeaderBar) sal_uInt16 nId = pHeaderBar->GetCurItemId();
{ HeaderBarItemBits nBits = pHeaderBar->GetItemBits(nId);
sal_uInt16 nId = m_pHeaderBar->GetCurItemId();
HeaderBarItemBits nBits = m_pHeaderBar->GetItemBits(nId);
if( nBits & HIB_CLICKABLE ) if( nBits & HIB_CLICKABLE )
{ {
//set new arrow positions in headerbar //set new arrow positions in headerbar
m_pHeaderBar->SetItemBits( getActiveDictionary().getSortColumn()+1, HEADER_BAR_BITS ); pHeaderBar->SetItemBits( getActiveDictionary().getSortColumn()+1, HEADER_BAR_BITS );
if( nBits & HIB_UPARROW ) if( nBits & HIB_UPARROW )
m_pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_DOWNARROW ); pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_DOWNARROW );
else else
m_pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_UPARROW ); pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_UPARROW );
//sort lists //sort lists
nBits = m_pHeaderBar->GetItemBits(nId); nBits = pHeaderBar->GetItemBits(nId);
bool bSortAtoZ = nBits & HIB_UPARROW; bool bSortAtoZ = nBits & HIB_UPARROW;
getActiveDictionary().sortByColumn(nId-1,bSortAtoZ); getActiveDictionary().sortByColumn(nId-1,bSortAtoZ);
getReverseDictionary().sortByColumn(nId-1,bSortAtoZ); getReverseDictionary().sortByColumn(nId-1,bSortAtoZ);
} }
}
return 0; return 0;
} }
......
/* -*- 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 .
*/
#ifndef _TEXTCONVERSIONDLGS_CHINESE_DICTIONARYDLG_HRC
#define _TEXTCONVERSIONDLGS_CHINESE_DICTIONARYDLG_HRC
#include "resids.hrc"
#include "buttongroup.hrc"
#include "chinese_direction_ids.hrc"
#define ED_TERM 1
#define ED_MAPPING 2
#define LB_PROPERTY 1
#define CB_REVERSE 1
#define FT_TERM 1
#define FT_MAPPING 2
#define FT_PROPERTY 3
#define CT_MAPPINGLIST 1
#define PB_ADD 1
#define PB_MODIFY 2
#define PB_DELETE 3
#define FL_BOTTOMLINE 1
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
// header for class ListBox // header for class ListBox
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
// header for class SvHeaderTabListBox #include <svtools/simptabl.hxx>
#include <svtools/svtabbx.hxx>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/linguistic2/XConversionDictionary.hpp> #include <com/sun/star/linguistic2/XConversionDictionary.hpp>
...@@ -62,19 +61,15 @@ struct DictionaryEntry ...@@ -62,19 +61,15 @@ struct DictionaryEntry
bool m_bNewEntry; bool m_bNewEntry;
}; };
class DictionaryList : public SvHeaderTabListBox class DictionaryList : public SvSimpleTable
{ {
public: public:
DictionaryList( Window* pParent, const ResId& ); DictionaryList(SvSimpleTableContainer& rParent, WinBits nBits);
DictionaryList( Window* pParent );
virtual ~DictionaryList();
HeaderBar* createHeaderBar( const OUString& rColumn1, const OUString& rColumn2, const OUString& rColumn3 void init(const css::uno::Reference< css::linguistic2::XConversionDictionary>& xDictionary,
, long nWidth1, long nWidth2, long nWidth3 ); Window *pED_Term, Window *pED_Mapping, ListBox *pLB_Property,
Window *pFT_Term, Window *pFT_Mapping, Window *pFT_Property);
void initDictionaryControl( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XConversionDictionary>& xDictionary
, ListBox* pPropertyTypeNameListBox );
void activate( HeaderBar* pHeaderBar );
void deleteAll(); void deleteAll();
void refillFromDictionary( sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ ); void refillFromDictionary( sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ );
void save(); void save();
...@@ -92,8 +87,6 @@ public: ...@@ -92,8 +87,6 @@ public:
void sortByColumn( sal_uInt16 nSortColumnIndex, bool bSortAtoZ ); void sortByColumn( sal_uInt16 nSortColumnIndex, bool bSortAtoZ );
sal_uInt16 getSortColumn() const; sal_uInt16 getSortColumn() const;
virtual void Resize();
private: private:
OUString getPropertyTypeName( sal_Int16 nConversionPropertyType /*linguistic2::ConversionPropertyType*/ ) const; OUString getPropertyTypeName( sal_Int16 nConversionPropertyType /*linguistic2::ConversionPropertyType*/ ) const;
OUString makeTabString( const DictionaryEntry& rEntry ) const; OUString makeTabString( const DictionaryEntry& rEntry ) const;
...@@ -102,13 +95,17 @@ private: ...@@ -102,13 +95,17 @@ private:
sal_Int32 ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight ); sal_Int32 ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight );
SvLBoxItem* getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const; SvLBoxItem* getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const;
void setColSizes();
virtual void Resize();
public: public:
::com::sun::star::uno::Reference< css::uno::Reference<css::linguistic2::XConversionDictionary> m_xDictionary;
::com::sun::star::linguistic2::XConversionDictionary> m_xDictionary;
private: private:
HeaderBar* m_pHeaderBar; Window* m_pED_Term;
ListBox* m_pPropertyTypeNameListBox; Window* m_pED_Mapping;
ListBox* m_pLB_Property;
std::vector< DictionaryEntry* > m_aToBeDeleted; std::vector< DictionaryEntry* > m_aToBeDeleted;
...@@ -133,7 +130,10 @@ private: ...@@ -133,7 +130,10 @@ private:
DECL_LINK( AddHdl, void* ); DECL_LINK( AddHdl, void* );
DECL_LINK( ModifyHdl, void* ); DECL_LINK( ModifyHdl, void* );
DECL_LINK( DeleteHdl, void* ); DECL_LINK( DeleteHdl, void* );
DECL_LINK( HeaderBarClick, void* ); DECL_LINK( HeaderBarClick, HeaderBar* );
void initDictionaryControl(DictionaryList *pList,
const css::uno::Reference< css::linguistic2::XConversionDictionary>& xDictionary);
void updateAfterDirectionChange(); void updateAfterDirectionChange();
void updateButtons(); void updateButtons();
...@@ -150,36 +150,30 @@ private: ...@@ -150,36 +150,30 @@ private:
private: private:
sal_Int32 m_nTextConversionOptions; //i18n::TextConversionOption sal_Int32 m_nTextConversionOptions; //i18n::TextConversionOption
RadioButton m_aRB_To_Simplified; RadioButton* m_pRB_To_Simplified;
RadioButton m_aRB_To_Traditional; RadioButton* m_pRB_To_Traditional;
CheckBox m_aCB_Reverse;
FixedText m_aFT_Term;
Edit m_aED_Term;
FixedText m_aFT_Mapping; CheckBox* m_pCB_Reverse;
Edit m_aED_Mapping;
FixedText m_aFT_Property; FixedText* m_pFT_Term;
ListBox m_aLB_Property; Edit* m_pED_Term;
HeaderBar* m_pHeaderBar; FixedText* m_pFT_Mapping;
DictionaryList m_aCT_DictionaryToSimplified; Edit* m_pED_Mapping;
DictionaryList m_aCT_DictionaryToTraditional;
PushButton m_aPB_Add; FixedText* m_pFT_Property;
PushButton m_aPB_Modify; ListBox* m_pLB_Property;
PushButton m_aPB_Delete;
FixedLine m_aFL_Bottomline; SvSimpleTableContainer* mpToSimplifiedContainer;
DictionaryList* m_pCT_DictionaryToSimplified;
SvSimpleTableContainer* mpToTraditionalContainer;
DictionaryList* m_pCT_DictionaryToTraditional;
OKButton m_aBP_OK; PushButton* m_pPB_Add;
CancelButton m_aBP_Cancel; PushButton* m_pPB_Modify;
HelpButton m_aBP_Help; PushButton* m_pPB_Delete;
::com::sun::star::uno::Reference< css::uno::Reference<css::uno::XComponentContext> m_xContext;
::com::sun::star::uno::XComponentContext > m_xContext;
}; };
//............................................................................. //.............................................................................
......
/* -*- 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 "chinese_dictionarydialog.hrc"
#include <svtools/controldims.hrc>
#define DIRECTION_RADIOBUTTONS( D_XPOS, D_YPOS, D_FULLWIDTH ) \
RadioButton RB_TO_SIMPLIFIED \
{ \
Pos = MAP_APPFONT( D_XPOS, D_YPOS ); \
Size = MAP_APPFONT ( D_FULLWIDTH, RSC_CD_RADIOBUTTON_HEIGHT ) ; \
Text [ en-US ] = "~Traditional Chinese to simplified Chinese"; \
}; \
RadioButton RB_TO_TRADITIONAL \
{ \
Pos = MAP_APPFONT( D_XPOS, D_YPOS + RSC_CD_RADIOBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y ); \
Size = MAP_APPFONT ( D_FULLWIDTH, RSC_CD_RADIOBUTTON_HEIGHT ) ; \
Text [ en-US ] = "~Simplified Chinese to traditional Chinese"; \
};
//-----------------------------------------------------------------------------
//defines for positions and sizes:
#define FULL_WIDTH (245)
#define FULL_HEIGHT (165)
#define ROW_1 (RSC_SP_DLG_INNERBORDER_TOP)
#define ROW_2 (ROW_1+RSC_CD_RADIOBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y)
#define ROW_3 (ROW_2+RSC_CD_RADIOBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y)
#define ROW_4 (ROW_3+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_CTRL_GROUP_Y)
#define ROW_5 (ROW_4+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y)
#define ROW_6 (ROW_5+RSC_CD_TEXTBOX_HEIGHT+RSC_SP_CTRL_DESC_Y)
#define ROW_5a (ROW_5+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_DESC_Y)
#define ROW_5b (ROW_5a+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_DESC_Y)
#define ROW_8 (FULL_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM-RSC_CD_PUSHBUTTON_HEIGHT)
#define ROW_7 (ROW_8-RSC_CD_FIXEDLINE_HEIGHT-2)
#define LIST_HEIGHT (ROW_7-RSC_SP_CTRL_Y-ROW_6)
#define COL_WIDTH 60
#define BUTTONCOL_WIDTH 40
#define COL_1 (RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_FLGR_SPACE_X)
#define COL_2 (COL_1+COL_WIDTH+1)
#define COL_3 (COL_2+COL_WIDTH+1)
#define COL_4 (FULL_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT-BUTTONCOL_WIDTH)
#define REST_COL_WIDTH (COL_4-COL_3-RSC_SP_CTRL_GROUP_X)
//-----------------------------------------------------------------------------
ModalDialog DLG_CHINESEDICTIONARY
{
HelpID = "svx:ModalDialog:DLG_CHINESEDICTIONARY";
//HelpId = ;
Size = MAP_APPFONT( FULL_WIDTH, FULL_HEIGHT );
OutputSize = TRUE;
Closeable = TRUE ;
Moveable = TRUE ;
SVLook = TRUE;
Text [ en-US ] = "Edit Dictionary";
DIRECTION_RADIOBUTTONS( COL_1, ROW_1, FULL_WIDTH - COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT )
CheckBox CB_REVERSE
{
HelpID = "svx:CheckBox:DLG_CHINESEDICTIONARY:CB_REVERSE";
Pos = MAP_APPFONT ( COL_1, ROW_3 ) ;
Size = MAP_APPFONT ( FULL_WIDTH - COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "Reverse mapping";
};
FixedText FT_TERM
{
Pos = MAP_APPFONT ( COL_1 , ROW_4 ) ;
Size = MAP_APPFONT ( COL_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT ) ;
Text [ en-US ] = "Term";
};
Edit ED_TERM
{
HelpID = "svx:Edit:DLG_CHINESEDICTIONARY:ED_TERM";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_1 , ROW_5 ) ;
Size = MAP_APPFONT ( COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ;
};
FixedText FT_MAPPING
{
Pos = MAP_APPFONT ( COL_2 , ROW_4 ) ;
Size = MAP_APPFONT ( COL_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT ) ;
Text [ en-US ] = "Mapping";
};
Edit ED_MAPPING
{
HelpID = "svx:Edit:DLG_CHINESEDICTIONARY:ED_MAPPING";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_2 , ROW_5 ) ;
Size = MAP_APPFONT ( COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ;
};
FixedText FT_PROPERTY
{
Pos = MAP_APPFONT ( COL_3 , ROW_4 ) ;
Size = MAP_APPFONT ( REST_COL_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT ) ;
Text [ en-US ] = "Property";
};
ListBox LB_PROPERTY
{
HelpID = "svx:ListBox:DLG_CHINESEDICTIONARY:LB_PROPERTY";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_3 , ROW_5 ) ;
Size = MAP_APPFONT ( REST_COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ;
DropDown = TRUE ;
stringlist [ en-US ] =
{
< "Other" ; Default ; > ;
< "Foreign" ; > ;
< "First name" ; > ;
< "Last name" ; > ;
< "Title" ; > ;
< "Status" ; > ;
< "Place name" ; > ;
< "Business" ; > ;
< "Adjective" ; > ;
< "Idiom" ; > ;
< "Abbreviation" ; > ;
< "Numerical" ; > ;
< "Noun" ; > ;
< "Verb" ; > ;
< "Brand name" ; > ;
};
};
Control CT_MAPPINGLIST
{
Pos = MAP_APPFONT ( COL_1, ROW_6 ) ;
Size = MAP_APPFONT ( COL_4 - COL_1 - RSC_SP_CTRL_GROUP_X, LIST_HEIGHT ) ;
TabStop = TRUE ;
};
PushButton PB_ADD
{
HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_ADD";
Pos = MAP_APPFONT( COL_4, ROW_5 );
Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "~Add";
};
PushButton PB_MODIFY
{
HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_MODIFY";
Pos = MAP_APPFONT( COL_4, ROW_5a );
Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "~Modify";
};
PushButton PB_DELETE
{
HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_DELETE";
Pos = MAP_APPFONT( COL_4, ROW_5b );
Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "~Delete";
};
FixedLine FL_BOTTOMLINE
{
Pos = MAP_APPFONT ( 0 , ROW_7 ) ;
Size = MAP_APPFONT ( FULL_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ) ;
};
BUTTONS_OK_CANCEL_HELP_ABREAST( FULL_WIDTH - RSC_SP_DLG_INNERBORDER_RIGHT, ROW_8 )
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "chinese_translationdialog.hxx" #include "chinese_translationdialog.hxx"
#include "resid.hxx"
#include "chinese_dictionarydialog.hxx" #include "chinese_dictionarydialog.hxx"
#include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp>
// header for define RET_OK // header for define RET_OK
...@@ -47,9 +46,6 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent ) ...@@ -47,9 +46,6 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
get(m_pRB_To_Traditional, "totraditional"); get(m_pRB_To_Traditional, "totraditional");
get(m_pCB_Translate_Commonterms, "commonterms"); get(m_pCB_Translate_Commonterms, "commonterms");
m_pRB_To_Simplified->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
m_pRB_To_Traditional->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL );
SvtLinguConfig aLngCfg; SvtLinguConfig aLngCfg;
sal_Bool bValue = sal_Bool(); sal_Bool bValue = sal_Bool();
Any aAny( aLngCfg.GetProperty( OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ) ) ); Any aAny( aLngCfg.GetProperty( OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ) ) );
......
/* -*- 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 "resid.hxx"
#include <tools/resmgr.hxx>
//.............................................................................
namespace textconversiondlgs
{
//.............................................................................
static ResMgr* getTextConversionResMgr()
{
static ResMgr* pMgr = NULL;
if( ! pMgr )
pMgr = ResMgr::CreateResMgr( "textconversiondlgs" );
return pMgr;
}
TextConversionDlgs_ResId::TextConversionDlgs_ResId(sal_uInt16 nId)
: ResId( nId, *getTextConversionResMgr() )
{
}
//.............................................................................
} //end namespace
//.............................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SVX_SOURCE_UNODIALOGS_TEXTCONVERSIONDLGS_RESID_HXX
#define INCLUDED_SVX_SOURCE_UNODIALOGS_TEXTCONVERSIONDLGS_RESID_HXX
#include <tools/resid.hxx>
//.............................................................................
namespace textconversiondlgs
{
//.............................................................................
//-----------------------------------------------------------------------------
/**
*/
class TextConversionDlgs_ResId : public ResId
{
public:
TextConversionDlgs_ResId(sal_uInt16 nId);
};
//.............................................................................
} //end namespace
//.............................................................................
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef _TEXTCONVERSIONDLGS_RESID_HRC
#define _TEXTCONVERSIONDLGS_RESID_HRC
#define DLG_CHINESEDICTIONARY 301
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkDialog" id="ChineseDictionaryDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Edit Dictionary</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">12</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="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</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="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</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="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkRadioButton" id="tradtosimple">
<property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</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="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">simpletotrad</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="simpletotrad">
<property name="label" translatable="yes">_Simplified Chinese to traditional Chinese</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>
<property name="group">tradtosimple</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="GtkCheckButton" id="reverse">
<property name="label" translatable="yes">Reverse mapping</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="termft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Term</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="term">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</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="GtkLabel" id="mappingft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Mapping</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="mapping">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</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="GtkLabel" id="propertyft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Property</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="property">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item translatable="yes">Other</item>
<item translatable="yes">Foreign</item>
<item translatable="yes">First name</item>
<item translatable="yes">Last name</item>
<item translatable="yes">Title</item>
<item translatable="yes">Status</item>
<item translatable="yes">Place name</item>
<item translatable="yes">Business</item>
<item translatable="yes">Adjective</item>
<item translatable="yes">Idiom</item>
<item translatable="yes">Abbreviation</item>
<item translatable="yes">Numerical</item>
<item translatable="yes">Noun</item>
<item translatable="yes">Verb</item>
<item translatable="yes">Brand name</item>
</items>
</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="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="add">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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="modify">
<property name="label" translatable="yes">_Modify</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</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="delete">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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="left_attach">3</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<child>
<object class="svtlo-SvSimpleTableContainer" id="tradtosimpleview: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="Simple Table Container-selection"/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svtlo-SvSimpleTableContainer" id="simpletotradview:border">
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Simple Table Container-selection1"/>
</child>
</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>
</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>
<placeholder/>
</child>
</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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
</action-widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup2">
<widgets>
<widget name="termft"/>
<widget name="term"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup3">
<widgets>
<widget name="mappingft"/>
<widget name="mapping"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup4">
<widgets>
<widget name="propertyft"/>
<widget name="property"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<property name="mode">both</property>
<widgets>
<widget name="tradtosimpleview:border"/>
<widget name="simpletotradview: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