diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-15 10:36:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-15 10:38:00 +0100 |
commit | 4f4ab917261e0f3fef242e54a2a5e45fb75aeb82 (patch) | |
tree | 8b802493b79a52c29e1e0d3a5886ecdfcc256592 /sc/source/ui/miscdlgs | |
parent | 8d124bc49a3b89705763e81e0acc2335f6e090f7 (diff) |
convert external data dialog to .ui
Change-Id: I2dfaf152bd473f73fdeec08a8c2ac6b007d38352
Diffstat (limited to 'sc/source/ui/miscdlgs')
-rw-r--r-- | sc/source/ui/miscdlgs/linkarea.cxx | 93 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/linkarea.src | 119 |
2 files changed, 41 insertions, 171 deletions
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 6e448ca072be..c88bbf7f3477 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -34,7 +34,6 @@ #include <vcl/waitobj.hxx> #include "linkarea.hxx" -#include "linkarea.hrc" #include "scresid.hxx" #include "sc.hrc" #include "rangeutl.hxx" @@ -43,37 +42,27 @@ //================================================================== -ScLinkedAreaDlg::ScLinkedAreaDlg( Window* pParent ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_LINKAREA ) ), - // - aFlLocation ( this, ScResId( FL_LOCATION ) ), - aCbUrl ( this, ScResId( CB_URL ) ), - aBtnBrowse ( this, ScResId( BTN_BROWSE ) ), - aTxtHint ( this, ScResId( FT_HINT ) ), - aFtRanges ( this, ScResId( FT_RANGES ) ), - aLbRanges ( this, ScResId( LB_RANGES ) ), - aBtnReload ( this, ScResId( BTN_RELOAD ) ), - aNfDelay ( this, ScResId( NF_DELAY ) ), - aFtSeconds ( this, ScResId( FT_SECONDS ) ), - aBtnOk ( this, ScResId( BTN_OK ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ), - // - pSourceShell( NULL ), - pDocInserter( NULL ) +ScLinkedAreaDlg::ScLinkedAreaDlg(Window* pParent) + : ModalDialog(pParent, "ExternalDataDialog", "modules/scalc/ui/externaldata.ui") + , pSourceShell(NULL) + , pDocInserter(NULL) { - FreeResource(); - - aCbUrl.SetHelpId( HID_SCDLG_LINKAREAURL ); // SvtURLBox ctor always sets SID_OPENURL - aCbUrl.SetSelectHdl( LINK( this, ScLinkedAreaDlg, FileHdl ) ); - aBtnBrowse.SetClickHdl( LINK( this, ScLinkedAreaDlg, BrowseHdl ) ); - aLbRanges.SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) ); - aBtnReload.SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) ); + get(m_pCbUrl, "url"); + get(m_pLbRanges, "ranges"); + m_pLbRanges->EnableMultiSelection(true); + m_pLbRanges->SetDropDownLineCount(8); + get(m_pBtnBrowse, "browse"); + get(m_pBtnReload, "reload"); + get(m_pNfDelay, "delay"); + get(m_pFtSeconds, "secondsft"); + get(m_pBtnOk, "ok"); + + m_pCbUrl->SetSelectHdl( LINK( this, ScLinkedAreaDlg, FileHdl ) ); + m_pBtnBrowse->SetClickHdl( LINK( this, ScLinkedAreaDlg, BrowseHdl ) ); + m_pLbRanges->SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) ); + m_pBtnReload->SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) ); UpdateEnable(); - - aNfDelay.SetAccessibleName(aBtnReload.GetText()); - aNfDelay.SetAccessibleRelationLabeledBy(&aBtnReload); } ScLinkedAreaDlg::~ScLinkedAreaDlg() @@ -109,7 +98,7 @@ IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl) IMPL_LINK_NOARG(ScLinkedAreaDlg, FileHdl) { - OUString aEntered = aCbUrl.GetURL(); + OUString aEntered = m_pCbUrl->GetURL(); if (pSourceShell) { SfxMedium* pMed = pSourceShell->GetMedium(); @@ -179,10 +168,10 @@ void ScLinkedAreaDlg::InitFromOldLink( const String& rFile, const String& rFilte if (pSourceShell) { SfxMedium* pMed = pSourceShell->GetMedium(); - aCbUrl.SetText( pMed->GetName() ); + m_pCbUrl->SetText( pMed->GetName() ); } else - aCbUrl.SetText( EMPTY_STRING ); + m_pCbUrl->SetText( EMPTY_STRING ); UpdateSourceRanges(); @@ -190,13 +179,13 @@ void ScLinkedAreaDlg::InitFromOldLink( const String& rFile, const String& rFilte for ( xub_StrLen i=0; i<nRangeCount; i++ ) { String aRange = rSource.GetToken(i); - aLbRanges.SelectEntry( aRange ); + m_pLbRanges->SelectEntry( aRange ); } bool bDoRefresh = (nRefresh != 0); - aBtnReload.Check( bDoRefresh ); + m_pBtnReload->Check( bDoRefresh ); if (bDoRefresh) - aNfDelay.SetValue( nRefresh ); + m_pNfDelay->SetValue( nRefresh ); UpdateEnable(); } @@ -254,7 +243,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg if ( !pSourceShell->GetError() ) // only errors { - aCbUrl.SetText( pMed->GetName() ); + m_pCbUrl->SetText( pMed->GetName() ); } else { @@ -262,7 +251,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg pSourceShell = NULL; aSourceRef.Clear(); - aCbUrl.SetText( EMPTY_STRING ); + m_pCbUrl->SetText( EMPTY_STRING ); } } @@ -276,32 +265,32 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg void ScLinkedAreaDlg::UpdateSourceRanges() { - aLbRanges.SetUpdateMode(false); + m_pLbRanges->SetUpdateMode(false); - aLbRanges.Clear(); + m_pLbRanges->Clear(); if ( pSourceShell ) { ScAreaNameIterator aIter( pSourceShell->GetDocument() ); ScRange aDummy; OUString aName; while ( aIter.Next( aName, aDummy ) ) - aLbRanges.InsertEntry( aName ); + m_pLbRanges->InsertEntry( aName ); } - aLbRanges.SetUpdateMode(true); + m_pLbRanges->SetUpdateMode(true); - if ( aLbRanges.GetEntryCount() == 1 ) - aLbRanges.SelectEntryPos(0); + if ( m_pLbRanges->GetEntryCount() == 1 ) + m_pLbRanges->SelectEntryPos(0); } void ScLinkedAreaDlg::UpdateEnable() { - bool bEnable = ( pSourceShell && aLbRanges.GetSelectEntryCount() ); - aBtnOk.Enable( bEnable ); + bool bEnable = ( pSourceShell && m_pLbRanges->GetSelectEntryCount() ); + m_pBtnOk->Enable( bEnable ); - bool bReload = aBtnReload.IsChecked(); - aNfDelay.Enable( bReload ); - aFtSeconds.Enable( bReload ); + bool bReload = m_pBtnReload->IsChecked(); + m_pNfDelay->Enable( bReload ); + m_pFtSeconds->Enable( bReload ); } OUString ScLinkedAreaDlg::GetURL() @@ -337,20 +326,20 @@ OUString ScLinkedAreaDlg::GetOptions() OUString ScLinkedAreaDlg::GetSource() { OUStringBuffer aBuf; - sal_uInt16 nCount = aLbRanges.GetSelectEntryCount(); + sal_uInt16 nCount = m_pLbRanges->GetSelectEntryCount(); for (sal_uInt16 i=0; i<nCount; i++) { if (i > 0) aBuf.append(sal_Unicode(';')); - aBuf.append(aLbRanges.GetSelectEntry(i)); + aBuf.append(m_pLbRanges->GetSelectEntry(i)); } return aBuf.makeStringAndClear(); } sal_uLong ScLinkedAreaDlg::GetRefresh() { - if ( aBtnReload.IsChecked() ) - return sal::static_int_cast<sal_uLong>( aNfDelay.GetValue() ); + if ( m_pBtnReload->IsChecked() ) + return sal::static_int_cast<sal_uLong>( m_pNfDelay->GetValue() ); else return 0; // disabled } diff --git a/sc/source/ui/miscdlgs/linkarea.src b/sc/source/ui/miscdlgs/linkarea.src deleted file mode 100644 index e8fcb33d3a52..000000000000 --- a/sc/source/ui/miscdlgs/linkarea.src +++ /dev/null @@ -1,119 +0,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 . - */ - -#include "linkarea.hrc" - -ModalDialog RID_SCDLG_LINKAREA -{ - HelpID = "sc:ModalDialog:RID_SCDLG_LINKAREA"; - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Size = MAP_APPFONT ( 274 , 190 ) ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 218 , 8 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 218 , 25 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 218 , 49 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - FixedLine FL_LOCATION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 204 , 8 ) ; - Text [ en-US ] = "URL of ~external data source"; - }; - ComboBox CB_URL - { - HelpID = "sc:ComboBox:RID_SCDLG_LINKAREA:CB_URL"; - Pos = MAP_APPFONT ( 12 , 15 ) ; - Size = MAP_APPFONT ( 174 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - PushButton BTN_BROWSE - { - HelpID = "sc:PushButton:RID_SCDLG_LINKAREA:BTN_BROWSE"; - Pos = MAP_APPFONT ( 190 , 14 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - Text = "~..." ; - }; - FixedText FT_HINT - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 192 , 26 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "(Enter the URL of the source document in the local file system or Internet here.)"; - }; - FixedText FT_RANGES - { - Pos = MAP_APPFONT ( 6 , 62 ) ; - Size = MAP_APPFONT ( 198 , 8 ) ; - Text [ en-US ] = "~Available tables/ranges"; - }; - MultiListBox LB_RANGES - { - HelpID = "sc:MultiListBox:RID_SCDLG_LINKAREA:LB_RANGES"; - SimpleMode = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 74 ) ; - Size = MAP_APPFONT ( 192 , 80 ) ; - AutoHScroll = TRUE ; - }; - CheckBox BTN_RELOAD - { - HelpID = "sc:CheckBox:RID_SCDLG_LINKAREA:BTN_RELOAD"; - Pos = MAP_APPFONT ( 12 , 168 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Update every"; - }; - NumericField NF_DELAY - { - HelpID = "sc:NumericField:RID_SCDLG_LINKAREA:NF_DELAY"; - Border = TRUE ; - Pos = MAP_APPFONT ( 113 , 166 ) ; - Size = MAP_APPFONT ( 32 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - Minimum = 1 ; - Maximum = 99999 ; - Value = 60 ; - }; - FixedText FT_SECONDS - { - Pos = MAP_APPFONT ( 149 , 168 ) ; - Size = MAP_APPFONT ( 59 , 8 ) ; - Text [ en-US ] = "seconds"; - }; - Text [ en-US ] = "External Data"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |