diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-07 10:48:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-07 11:04:25 +0000 |
commit | f8eb77651943a3f893c9426366b7d5374b28a3c7 (patch) | |
tree | 0d94f09f07ad6864125d17cc6174441a530c230e /cui/source | |
parent | 119edfedbe63810a6e44325689c83cc518645ab2 (diff) |
convert events config page to .ui
Change-Id: Ida0a6d1242333497cde9f2ef7a8830602caa0ccb
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/eventdlg.cxx | 71 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.hrc | 30 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.hxx | 3 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.src | 98 | ||||
-rw-r--r-- | cui/source/customize/macropg.cxx | 3 | ||||
-rw-r--r-- | cui/source/customize/macropg.hrc | 1 | ||||
-rw-r--r-- | cui/source/customize/macropg_impl.hxx | 1 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 2 |
9 files changed, 29 insertions, 181 deletions
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index ea10378a8594..9320c2bbe90e 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -46,7 +46,6 @@ #include <dialmgr.hxx> #include <cuires.hrc> -#include "eventdlg.hrc" #include "helpid.hrc" #include "selector.hxx" #include "cfg.hxx" @@ -55,30 +54,28 @@ using namespace ::com::sun::star; -SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, SvxEventConfigPage::EarlyInit ) : - - _SvxMacroTabPage( pParent, CUI_RES(RID_SVXPAGE_EVENTS), rSet ), - aSaveInText( this, CUI_RES( TXT_SAVEIN ) ), - aSaveInListBox( this, CUI_RES( LB_SAVEIN ) ), - bAppConfig ( sal_True ) +SvxEventConfigPage::SvxEventConfigPage(Window *pParent, const SfxItemSet& rSet, + SvxEventConfigPage::EarlyInit) + : _SvxMacroTabPage(pParent, "EventsConfigPage", + "cui/ui/eventsconfigpage.ui", rSet) + , bAppConfig(true) { - mpImpl->sStrEvent = OUString( CUI_RES( STR_EVENT )); - mpImpl->sAssignedMacro = OUString( CUI_RES( STR_ASSMACRO )); - mpImpl->pEventLB = new MacroEventListBox( this, CUI_RES( LB_EVENT )); - mpImpl->pAssignFT = new FixedText( this, CUI_RES( FT_ASSIGN )); - mpImpl->pAssignPB = new PushButton( this, CUI_RES( PB_ASSIGN )); - mpImpl->pDeletePB = new PushButton( this, CUI_RES( PB_DELETE )); - mpImpl->aMacroImg = Image( CUI_RES( IMG_MACRO) ); - mpImpl->aComponentImg = Image( CUI_RES( IMG_COMPONENT) ); - - FreeResource(); - - // must be done after FreeResource is called - InitResources(); + get(m_pSaveInListBox, "savein"); + + mpImpl->sStrEvent = get<FixedText>("eventft")->GetText(); + mpImpl->sAssignedMacro = get<FixedText>("actionft")->GetText(); + get(mpImpl->pEventLB, "events"); + Size aSize(LogicToPixel(Size(205, 229), MAP_APPFONT)); + mpImpl->pEventLB->set_width_request(aSize.Width()); + mpImpl->pEventLB->set_height_request(aSize.Height()); + get(mpImpl->pAssignPB, "macro"); + get(mpImpl->pDeletePB, "delete"); + mpImpl->aMacroImg = get<FixedImage>("macroimg")->GetImage(); + mpImpl->aComponentImg = get<FixedImage>("componentimg")->GetImage(); - mpImpl->pEventLB->GetListBox().SetHelpId( HID_SVX_MACRO_LB_EVENT ); + InitResources(); - aSaveInListBox.SetSelectHdl( LINK( this, SvxEventConfigPage, + m_pSaveInListBox->SetSelectHdl( LINK( this, SvxEventConfigPage, SelectHdl_Impl ) ); uno::Reference< frame::XGlobalEventBroadcaster > xSupplier; @@ -88,13 +85,12 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, sal_uInt16 nPos(0); m_xAppEvents = xSupplier->getEvents(); - nPos = aSaveInListBox.InsertEntry( + nPos = m_pSaveInListBox->InsertEntry( utl::ConfigManager::getProductName() ); - aSaveInListBox.SetEntryData( nPos, new bool(true) ); - aSaveInListBox.SelectEntryPos( nPos, true ); + m_pSaveInListBox->SetEntryData( nPos, new bool(true) ); + m_pSaveInListBox->SelectEntryPos( nPos, true ); } - void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFrame ) { SetFrame( _rxFrame ); @@ -105,8 +101,6 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra SelectHdl_Impl( NULL ); } - - SvxEventConfigPage::~SvxEventConfigPage() { // need to delete the user data @@ -119,15 +113,8 @@ SvxEventConfigPage::~SvxEventConfigPage() pE->SetUserData((void*)0); pE = rListBox.NextSibling( pE ); } - delete mpImpl->pEventLB; - - delete mpImpl->pAssignFT; - delete mpImpl->pAssignPB; - delete mpImpl->pDeletePB; } - - void SvxEventConfigPage::ImplInitDocument() { uno::Reference< frame::XFrame > xFrame( GetFrame() ); @@ -160,10 +147,10 @@ void SvxEventConfigPage::ImplInitDocument() m_xDocumentModifiable = m_xDocumentModifiable.query( xModel ); OUString aTitle = ::comphelper::DocumentInfo::getDocumentTitle( xModel ); - sal_uInt16 nPos = aSaveInListBox.InsertEntry( aTitle ); + sal_uInt16 nPos = m_pSaveInListBox->InsertEntry( aTitle ); - aSaveInListBox.SetEntryData( nPos, new bool(false) ); - aSaveInListBox.SelectEntryPos( nPos, true ); + m_pSaveInListBox->SetEntryData( nPos, new bool(false) ); + m_pSaveInListBox->SelectEntryPos( nPos, true ); bAppConfig = false; } @@ -174,14 +161,12 @@ void SvxEventConfigPage::ImplInitDocument() } } - - IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) { (void)pBox; - bool* bApp = (bool*) aSaveInListBox.GetEntryData( - aSaveInListBox.GetSelectEntryPos()); + bool* bApp = (bool*) m_pSaveInListBox->GetEntryData( + m_pSaveInListBox->GetSelectEntryPos()); mpImpl->pEventLB->SetUpdateMode( false ); bAppConfig = *bApp; @@ -221,8 +206,6 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) return sal_True; } - - sal_Bool SvxEventConfigPage::FillItemSet( SfxItemSet& rSet ) { return _SvxMacroTabPage::FillItemSet( rSet ); diff --git a/cui/source/customize/eventdlg.hrc b/cui/source/customize/eventdlg.hrc deleted file mode 100644 index 59fe5af2e6eb..000000000000 --- a/cui/source/customize/eventdlg.hrc +++ /dev/null @@ -1,30 +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 . - */ - -/* StarView resource header file */ - - ////DF temp to figure out what's needed from these -//DF #include "sfx.hrc" -#include <cuires.hrc> -#include "macropg.hrc" - -#define TXT_SAVEIN 10 -#define LB_SAVEIN 11 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx index 0039c857946e..734812b4c984 100644 --- a/cui/source/customize/eventdlg.hxx +++ b/cui/source/customize/eventdlg.hxx @@ -29,8 +29,7 @@ class SvxEventConfigPage : public _SvxMacroTabPage { - FixedText aSaveInText; - ListBox aSaveInListBox; + ListBox* m_pSaveInListBox; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xAppEvents; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocumentEvents; diff --git a/cui/source/customize/eventdlg.src b/cui/source/customize/eventdlg.src deleted file mode 100644 index 75f65bffc9d1..000000000000 --- a/cui/source/customize/eventdlg.src +++ /dev/null @@ -1,98 +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 "helpid.hrc" -#include "eventdlg.hrc" - -#define MASKCOLOR MaskColor = \ - Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - - // TP_CONFIG_EVENT ------------------------------------------------------- -TabPage RID_SVXPAGE_EVENTS -{ - HelpId = HID_SVX_CONFIG_EVENT ; - OutputSize = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 272 , 258 ) ; - String STR_EVENT - { - Text [ en-US ] = "Event" ; - }; - String STR_ASSMACRO - { - Text [ en-US ] = "Assigned Action" ; - }; - Control LB_EVENT - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 205 , 229 ) ; - TabStop = TRUE ; - HelpID = HID_SVX_MACRO_LB_EVENT ; - }; - FixedText TXT_SAVEIN - { - Pos = MAP_APPFONT ( 6 , 240 ) ; - Size = MAP_APPFONT ( 55 , 8 ) ; - Group = TRUE ; - Text [ en-US ] = "Save In" ; - }; - ListBox LB_SAVEIN - { - HelpID = "cui:ListBox:RID_SVXPAGE_EVENTS:LB_SAVEIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 62 , 238 ) ; - Size = MAP_APPFONT ( 132 , 53 ) ; - DropDown = TRUE ; - }; - FixedText FT_ASSIGN - { - Pos = MAP_APPFONT ( 217, ROW0 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Assign:" ; - }; - PushButton PB_ASSIGN - { - HelpID = "cui:PushButton:RID_SVXPAGE_EVENTS:PB_ASSIGN"; - Pos = MAP_APPFONT ( 217 , ROW0A ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Disable = TRUE ; - Text [ en-US ] = "M~acro..." ; - }; - PushButton PB_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_EVENTS:PB_DELETE"; - Pos = MAP_APPFONT ( 217 , ROW0A+RSC_CD_PUSHBUTTON_HEIGHT+12 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Disable = TRUE ; - Text [ en-US ] = "~Remove" ; - }; - Image IMG_MACRO - { - ImageBitmap = Bitmap { File = "id018.png"; }; - MASKCOLOR - }; - Image IMG_COMPONENT - { - ImageBitmap = Bitmap { File = "component_16.png"; }; - MASKCOLOR - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 9fad89c57cdf..00e0851cd923 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -53,8 +53,7 @@ static OUString aVndSunStarUNO( "vnd.sun.star.UNO:" ); static OUString aVndSunStarScript( "vnd.sun.star.script:" ); _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) - : pAssignFT(NULL) - , pAssignPB(NULL) + : pAssignPB(NULL) , pAssignComponentPB(NULL) , pDeletePB(NULL) , pEventLB(NULL) diff --git a/cui/source/customize/macropg.hrc b/cui/source/customize/macropg.hrc index 2b9150eff323..7a1d3e29370c 100644 --- a/cui/source/customize/macropg.hrc +++ b/cui/source/customize/macropg.hrc @@ -30,7 +30,6 @@ #define FT_ASSIGN 6 #define PB_ASSIGN_COMPONENT 7 -// Starting new IDs with 30 as eventdlg.hrc also includes this file #define IMG_MACRO 30 #define IMG_COMPONENT 31 diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx index 49f3c7b785ef..7d31ebd73ac9 100644 --- a/cui/source/customize/macropg_impl.hxx +++ b/cui/source/customize/macropg_impl.hxx @@ -25,7 +25,6 @@ class _SvxMacroTabPage_Impl public: _SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ); - FixedText* pAssignFT; PushButton* pAssignPB; PushButton* pAssignComponentPB; PushButton* pDeletePB; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 2440828f13fb..c1ea7df3278c 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -263,7 +263,6 @@ #define RID_SVXDLG_CUSTOMIZE (RID_SVX_START + 291) #define RID_SVXPAGE_MENUS (RID_SVX_START + 292) #define RID_SVXPAGE_TOOLBARS (RID_SVX_START + 294) -#define RID_SVXPAGE_EVENTS (RID_SVX_START + 295) #define RID_SVXPAGE_CONFIGGROUPBOX (RID_SVX_START + 304) #define RID_SVXDLG_ASSIGNCOMPONENT (RID_SVX_START + 297) diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index 702b9c1ec0b0..9598b66b29ec 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -128,8 +128,6 @@ #define HID_COLORPAGE_SQLPARAMETER_CB "CUI_HID_COLORPAGE_SQLPARAMETER_CB" #define HID_COLORPAGE_SQLCOMMENT_CB "CUI_HID_COLORPAGE_SQLCOMMENT_CB" #define HID_NUMBERINGOPT_SEL_GRF_FROM_FILE "CUI_HID_NUMBERINGOPT_SEL_GRF_FROM_FILE" -#define HID_SVX_MACRO_LB_EVENT "CUI_HID_SVX_MACRO_LB_EVENT" -#define HID_SVX_CONFIG_EVENT "CUI_HID_SVX_CONFIG_EVENT" #define HID_CONFIG_EVENT_OFFICE_BASED "CUI_HID_CONFIG_EVENT_OFFICE_BASED" #define HID_CONFIG_EVENT_DOCUMENT_BASED "CUI_HID_CONFIG_EVENT_DOCUMENT_BASED" #define HID_SVX_CONFIG_TOOLBAR "CUI_HID_SVX_CONFIG_TOOLBAR" |