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

convert events config page to .ui

Change-Id: Ida0a6d1242333497cde9f2ef7a8830602caa0ccb
üst 119edfed
......@@ -25,7 +25,6 @@ $(eval $(call gb_SrsTarget_set_include,cui/res,\
$(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/customize/acccfg.src \
cui/source/customize/cfg.src \
cui/source/customize/eventdlg.src \
cui/source/customize/macropg.src \
cui/source/dialogs/colorpicker.src \
cui/source/dialogs/commonlingui.src \
......
......@@ -54,6 +54,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/distributiondialog \
cui/uiconfig/ui/distributionpage \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/eventsconfigpage \
cui/uiconfig/ui/formatcellsdialog \
cui/uiconfig/ui/gallerysearchprogress \
cui/uiconfig/ui/gallerythemedialog \
......
......@@ -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 );
......
/* -*- 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: */
......@@ -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;
......
/* -*- 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: */
......@@ -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)
......
......@@ -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
......
......@@ -25,7 +25,6 @@ class _SvxMacroTabPage_Impl
public:
_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
FixedText* pAssignFT;
PushButton* pAssignPB;
PushButton* pAssignComponentPB;
PushButton* pDeletePB;
......
......@@ -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)
......
......@@ -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"
......
This diff is collapsed.
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