summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-10-04 23:35:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-10-05 14:37:49 +0100
commiteef849b8fb396201395ef6913d9c4e161aded88d (patch)
tree70ec4835a77504e4b7684282df0b9bc4f223ef63 /cui/source/dialogs
parent3479c1fb010df54ef675413d8b3659a8d619388d (diff)
convert hyphenate dialog to .ui
Change-Id: I0025ce0107deaaf6b4698745691c9f0bfddc7c34
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/hyphen.cxx113
-rw-r--r--cui/source/dialogs/hyphen.hrc37
-rw-r--r--cui/source/dialogs/hyphen.src119
3 files changed, 54 insertions, 215 deletions
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 36a5b3447a71..cd0f7756e182 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -18,7 +18,6 @@
*/
#include "hyphen.hxx"
-#include "hyphen.hrc"
#include "cuires.hrc"
#include "dialmgr.hxx"
@@ -36,12 +35,15 @@
#define CUR_HYPH_POS_CHAR '-'
-
-HyphenEdit::HyphenEdit( Window* pParent, const ResId& rResId ) :
- Edit( pParent, rResId )
+HyphenEdit::HyphenEdit(Window* pParent)
+ : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
{
}
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeHyphenEdit(Window *pParent, VclBuilder::stringmap &)
+{
+ return new HyphenEdit(pParent);
+}
void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
{
@@ -75,12 +77,12 @@ void SvxHyphenWordDialog::EnableLRBtn_Impl()
xub_StrLen nLen = aTxt.Len();
xub_StrLen i;
- aRightBtn.Disable();
+ m_pRightBtn->Disable();
for ( i = nOldPos + 2; i < nLen; ++i )
{
if ( aTxt.GetChar( i ) == sal_Unicode( HYPH_POS_CHAR ) )
{
- aRightBtn.Enable();
+ m_pRightBtn->Enable();
break;
}
}
@@ -88,12 +90,12 @@ void SvxHyphenWordDialog::EnableLRBtn_Impl()
DBG_ASSERT(nOldPos < aTxt.Len(), "nOldPos out of range");
if (nOldPos >= aTxt.Len())
nOldPos = aTxt.Len() - 1;
- aLeftBtn.Disable();
+ m_pLeftBtn->Disable();
for ( i = nOldPos; i-- > 0; )
{
if ( aTxt.GetChar( i ) == sal_Unicode( HYPH_POS_CHAR ) )
{
- aLeftBtn.Enable();
+ m_pLeftBtn->Enable();
break;
}
}
@@ -211,7 +213,7 @@ void SvxHyphenWordDialog::InitControls_Impl()
if (xPossHyph.is())
aEditWord = EraseUnusableHyphens_Impl( xPossHyph, nMaxHyphenationPos );
}
- aWordEdit.SetText( aEditWord );
+ m_pWordEdit->SetText( aEditWord );
nOldPos = aEditWord.Len();
SelLeft();
@@ -277,7 +279,7 @@ void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos )
sal_uInt16 SvxHyphenWordDialog::GetHyphIndex_Impl()
{
sal_uInt16 nPos = 0;
- String aTxt( aWordEdit.GetText() );
+ String aTxt( m_pWordEdit->GetText() );
for ( sal_uInt16 i=0 ; i < aTxt.Len(); ++i )
{
@@ -305,9 +307,9 @@ void SvxHyphenWordDialog::SelLeft()
aTxt.SetChar( i, sal_Unicode( CUR_HYPH_POS_CHAR ) );
nOldPos = i;
- aWordEdit.SetText( aTxt );
- aWordEdit.GrabFocus();
- aWordEdit.SetSelection( Selection( i, i + 1 ) );
+ m_pWordEdit->SetText( aTxt );
+ m_pWordEdit->GrabFocus();
+ m_pWordEdit->SetSelection( Selection( i, i + 1 ) );
break;
}
}
@@ -327,9 +329,9 @@ void SvxHyphenWordDialog::SelRight()
aTxt.SetChar( i, sal_Unicode( CUR_HYPH_POS_CHAR ) );
nOldPos = i;
- aWordEdit.SetText( aTxt );
- aWordEdit.GrabFocus();
- aWordEdit.SetSelection( Selection( i, i + 1 ) );
+ m_pWordEdit->SetText( aTxt );
+ m_pWordEdit->GrabFocus();
+ m_pWordEdit->SetSelection( Selection( i, i + 1 ) );
break;
}
}
@@ -443,7 +445,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl)
IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl)
{
- aWordEdit.SetSelection( Selection( nOldPos, nOldPos + 1 ) );
+ m_pWordEdit->SetSelection( Selection( nOldPos, nOldPos + 1 ) );
return 0;
}
@@ -454,37 +456,32 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
const String &rWord, LanguageType nLang,
Window* pParent,
uno::Reference< linguistic2::XHyphenator > &xHyphen,
- SvxSpellWrapper* pWrapper ) :
-
- SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_HYPHENATE ) ),
-
- aWordFT ( this, CUI_RES( FT_WORD ) ),
- aWordEdit ( this, CUI_RES( ED_WORD ) ),
- aLeftBtn ( this, CUI_RES( BTN_LEFT ) ),
- aRightBtn ( this, CUI_RES( BTN_RIGHT ) ),
- aOkBtn ( this, CUI_RES( BTN_HYPH_CUT ) ),
- aContBtn ( this, CUI_RES( BTN_HYPH_CONTINUE ) ),
- aDelBtn ( this, CUI_RES( BTN_HYPH_DELETE ) ),
- aFLBottom ( this, CUI_RES( FL_BOTTOM ) ),
- aHelpBtn ( this, CUI_RES( BTN_HYPH_HELP ) ),
- aHyphAll ( this, CUI_RES( BTN_HYPH_ALL ) ),
- aCancelBtn ( this, CUI_RES( BTN_HYPH_CANCEL ) ),
- aLabel ( GetText() ),
- pHyphWrapper ( NULL ),
- xHyphenator ( NULL ),
- xPossHyph ( NULL ),
- aActWord ( ),
- nActLanguage ( LANGUAGE_NONE ),
- nMaxHyphenationPos ( 0 ),
- nHyphPos ( 0 ),
- nOldPos ( 0 ),
- nHyphenationPositionsOffset( 0 ),
- bBusy ( sal_False )
+ SvxSpellWrapper* pWrapper)
+ : SfxModalDialog(pParent, "HyphenateDialog", "cui/ui/hyphenate.ui")
+ , pHyphWrapper(NULL)
+ , xHyphenator(NULL)
+ , xPossHyph(NULL)
+ , nActLanguage(LANGUAGE_NONE)
+ , nMaxHyphenationPos(0)
+ , nHyphPos(0)
+ , nOldPos(0)
+ , nHyphenationPositionsOffset(0)
+ , bBusy(sal_False)
{
- aActWord = rWord;
- nActLanguage = nLang;
- xHyphenator = xHyphen;
- pHyphWrapper = pWrapper;
+ get(m_pWordEdit, "worded");
+ get(m_pLeftBtn, "left");
+ get(m_pRightBtn, "right");
+ get(m_pOkBtn, "ok");
+ get(m_pContBtn, "continue");
+ get(m_pDelBtn, "delete");
+ get(m_pHyphAll, "hyphall");
+ get(m_pCloseBtn, "close");
+
+ aLabel = GetText();
+ aActWord = rWord;
+ nActLanguage = nLang;
+ xHyphenator = xHyphen;
+ pHyphWrapper = pWrapper;
uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( pHyphWrapper ?
pHyphWrapper->GetLast() : NULL, uno::UNO_QUERY );
@@ -497,18 +494,16 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
}
InitControls_Impl();
- aWordEdit.GrabFocus();
-
- aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) );
- aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) );
- aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) );
- aContBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) );
- aHyphAll.SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) );
- aCancelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) );
- aWordEdit.SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) );
-
- FreeResource();
+ m_pWordEdit->GrabFocus();
+
+ m_pLeftBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) );
+ m_pRightBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) );
+ m_pOkBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) );
+ m_pContBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) );
+ m_pDelBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) );
+ m_pHyphAll->SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) );
+ m_pCloseBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) );
+ m_pWordEdit->SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) );
SetWindowTitle( nLang );
diff --git a/cui/source/dialogs/hyphen.hrc b/cui/source/dialogs/hyphen.hrc
deleted file mode 100644
index 1c6e376edb3f..000000000000
--- a/cui/source/dialogs/hyphen.hrc
+++ /dev/null
@@ -1,37 +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_HYPHEN_HRC
-#define _SVX_HYPHEN_HRC
-
-// defines ------------------------------------------------------------------
-
-#define ED_WORD 10
-#define BTN_LEFT 11
-#define BTN_RIGHT 12
-#define FT_WORD 13
-#define FL_BOTTOM 14
-
-#define BTN_HYPH_CONTINUE 20
-#define BTN_HYPH_DELETE 21
-#define BTN_HYPH_CUT 22
-#define BTN_HYPH_CANCEL 23
-#define BTN_HYPH_HELP 24
-#define BTN_HYPH_ALL 25
-
-#endif
-
diff --git a/cui/source/dialogs/hyphen.src b/cui/source/dialogs/hyphen.src
deleted file mode 100644
index 753bde0577cf..000000000000
--- a/cui/source/dialogs/hyphen.src
+++ /dev/null
@@ -1,119 +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 .
- */
-
-#include "helpid.hrc"
-#include "cuires.hrc"
-#include "hyphen.hrc"
-
-String RID_SVXSTR_HMERR_CHECKINSTALL
-{
- Text [ en-US ] = "is not available for spellchecking\nPlease check your installation and install the desired language\n" ;
-};
-
- // RID_SVXDLG_HYPHENATE --------------------------------------------------
-ModalDialog RID_SVXDLG_HYPHENATE
-{
- HelpId = HID_HYPHENATE ;
- Size = MAP_APPFONT ( 200 , 111 ) ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Text [ en-US ] = "Hyphenation" ;
- Moveable = TRUE ;
-
- FixedText FT_WORD
- {
- Pos = MAP_APPFONT ( 5 , 5 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "~Word" ;
- };
- Edit ED_WORD
- {
- HelpID = "cui:Edit:RID_SVXDLG_HYPHENATE:ED_WORD";
- BORDER = TRUE ;
- Pos = MAP_APPFONT ( 5 , 17 ) ;
- Size = MAP_APPFONT ( 132 , 12 ) ;
- TABSTOP = TRUE ;
- LEFT = TRUE ;
- };
- ImageButton BTN_LEFT
- {
- HelpID = "cui:ImageButton:RID_SVXDLG_HYPHENATE:BTN_LEFT";
- Pos = MAP_APPFONT ( 56 , 33 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TABSTOP = TRUE ;
- SYMBOL = IMAGEBUTTON_ARROW_LEFT ;
- };
- ImageButton BTN_RIGHT
- {
- HelpID = "cui:ImageButton:RID_SVXDLG_HYPHENATE:BTN_RIGHT";
- Pos = MAP_APPFONT ( 75 , 33 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TABSTOP = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_RIGHT ;
- };
- OKButton BTN_HYPH_CUT
- {
- Pos = MAP_APPFONT ( 144 , 17 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "H~yphenate" ;
- TABSTOP = TRUE ;
- DEFBUTTON = TRUE ;
- };
- PushButton BTN_HYPH_CONTINUE
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_CONTINUE";
- Pos = MAP_APPFONT ( 144 , 35 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Skip" ;
- TABSTOP = TRUE ;
- };
- PushButton BTN_HYPH_DELETE
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_DELETE";
- Pos = MAP_APPFONT ( 144 , 52 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Remove" ;
- TABSTOP = TRUE ;
- };
- FixedLine FL_BOTTOM
- {
- Pos = MAP_APPFONT ( 0 , 81 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
- };
- HelpButton BTN_HYPH_HELP
- {
- Pos = MAP_APPFONT ( 5 , 93 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TABSTOP = TRUE ;
- };
- PushButton BTN_HYPH_ALL
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_ALL";
- Pos = MAP_APPFONT ( 63 , 93 ) ;
- Size = MAP_APPFONT ( 74 , 14 ) ;
- Text [ en-US ] = "Hyphenate ~All" ;
- TABSTOP = TRUE ;
- };
- CancelButton BTN_HYPH_CANCEL
- {
- Pos = MAP_APPFONT ( 144 , 93 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Close";
- TABSTOP = TRUE ;
- };
-};