From 2f7f7e7717075867080433ba09188a09830584ab Mon Sep 17 00:00:00 2001 From: Manal Alhassoun Date: Tue, 17 Sep 2013 08:46:10 +0300 Subject: Convert tab order dialog to widget UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2aebcf6486b80af31f1a06e9ae38e5610bee0cb4 Reviewed-on: https://gerrit.libreoffice.org/5970 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- extensions/AllLangResTarget_pcr.mk | 1 - extensions/Module_extensions.mk | 1 + extensions/UIConfig_spropctrlr.mk | 16 ++ extensions/source/propctrlr/taborder.cxx | 75 ++++----- extensions/source/propctrlr/taborder.hrc | 36 ----- extensions/source/propctrlr/taborder.hxx | 15 +- extensions/source/propctrlr/taborder.src | 96 ------------ .../propctrlr/uiconfig/spropctrlr/ui/taborder.ui | 170 +++++++++++++++++++++ 8 files changed, 234 insertions(+), 176 deletions(-) create mode 100644 extensions/UIConfig_spropctrlr.mk create mode 100644 extensions/source/propctrlr/uiconfig/spropctrlr/ui/taborder.ui (limited to 'extensions') diff --git a/extensions/AllLangResTarget_pcr.mk b/extensions/AllLangResTarget_pcr.mk index ad32eb54059a..415cb5538e38 100644 --- a/extensions/AllLangResTarget_pcr.mk +++ b/extensions/AllLangResTarget_pcr.mk @@ -28,7 +28,6 @@ $(eval $(call gb_SrsTarget_add_files,pcr/res,\ extensions/source/propctrlr/propres.src \ extensions/source/propctrlr/formres.src \ extensions/source/propctrlr/pcrmiscres.src \ - extensions/source/propctrlr/taborder.src \ extensions/source/propctrlr/fontdialog.src \ extensions/source/propctrlr/selectlabeldialog.src \ extensions/source/propctrlr/formlinkdialog.src \ diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk index 0f7857e4a7b8..20fc58ceefa1 100644 --- a/extensions/Module_extensions.mk +++ b/extensions/Module_extensions.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Module_add_targets,extensions,\ Library_dbp \ Library_pcr \ UIConfig_sbibliography \ + UIConfig_spropctrlr \ )) endif diff --git a/extensions/UIConfig_spropctrlr.mk b/extensions/UIConfig_spropctrlr.mk new file mode 100644 index 000000000000..4a4becc27bd4 --- /dev/null +++ b/extensions/UIConfig_spropctrlr.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +$(eval $(call gb_UIConfig_UIConfig,modules/spropctrlr)) + +$(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\ + extensions/source/propctrlr/uiconfig/spropctrlr/ui/taborder \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index bbb0f6fcde8b..285aedc75617 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -18,7 +18,6 @@ */ #include "taborder.hxx" -#include "taborder.hrc" #include "modulepcr.hxx" #include "formresid.hrc" @@ -29,7 +28,8 @@ #include #include #include -#include "svtools/treelistentry.hxx" +#include +#include //............................................................................ namespace pcr @@ -74,27 +74,25 @@ namespace pcr //------------------------------------------------------------------------ TabOrderDialog::TabOrderDialog( Window* _pParent, const Reference< XTabControllerModel >& _rxTabModel, const Reference< XControlContainer >& _rxControlCont, const Reference< XComponentContext >& _rxORB ) - :ModalDialog( _pParent, PcrRes( RID_DLG_TABORDER ) ) + :ModalDialog( _pParent, "TabOrderDialog", "modules/spropctrlr/ui/taborder.ui") ,m_xModel( _rxTabModel ) ,m_xControlContainer( _rxControlCont ) ,m_xORB( _rxORB ) - ,aFT_Controls( this, PcrRes( FT_CONTROLS ) ) - ,aLB_Controls( this, PcrRes( CTRL_TREE ) ) - ,aPB_OK( this, PcrRes( PB_OK ) ) - ,aPB_CANCEL( this, PcrRes( PB_CANCEL ) ) - ,aPB_HELP( this, PcrRes( PB_HELP ) ) - ,aPB_MoveUp( this, PcrRes( PB_MOVE_UP ) ) - ,aPB_MoveDown( this, PcrRes( PB_MOVE_DOWN ) ) - ,aPB_AutoOrder( this, PcrRes( PB_AUTO_ORDER ) ) ,pImageList( NULL ) { + get(m_pLB_Controls, "CTRLtree"); + get(m_pPB_OK, "ok"); + get(m_pPB_MoveUp, "upB"); + get(m_pPB_MoveDown, "downB"); + get(m_pPB_AutoOrder, "autoB"); + DBG_CTOR(TabOrderDialog,NULL); - aPB_MoveUp.SetClickHdl( LINK( this, TabOrderDialog, MoveUpClickHdl ) ); - aPB_MoveDown.SetClickHdl( LINK( this, TabOrderDialog, MoveDownClickHdl ) ); - aPB_AutoOrder.SetClickHdl( LINK( this, TabOrderDialog, AutoOrderClickHdl ) ); - aPB_OK.SetClickHdl( LINK( this, TabOrderDialog, OKClickHdl ) ); - aPB_OK.Disable(); + m_pPB_MoveUp->SetClickHdl( LINK( this, TabOrderDialog, MoveUpClickHdl ) ); + m_pPB_MoveDown->SetClickHdl( LINK( this, TabOrderDialog, MoveDownClickHdl ) ); + m_pPB_AutoOrder->SetClickHdl( LINK( this, TabOrderDialog, AutoOrderClickHdl ) ); + m_pPB_OK->SetClickHdl( LINK( this, TabOrderDialog, OKClickHdl ) ); + m_pPB_OK->Disable(); pImageList = new ImageList( PcrRes( RID_IL_FORMEXPLORER ) ); @@ -104,26 +102,25 @@ namespace pcr if ( m_xTempModel.is() && m_xControlContainer.is() ) FillList(); - if ( aLB_Controls.GetEntryCount() < 2 ) + if ( m_pLB_Controls->GetEntryCount() < 2 ) { - aPB_MoveUp.Disable(); - aPB_MoveDown.Disable(); - aPB_AutoOrder.Disable(); + m_pPB_MoveUp->Disable(); + m_pPB_MoveDown->Disable(); + m_pPB_AutoOrder->Disable(); } - FreeResource(); } //------------------------------------------------------------------------ void TabOrderDialog::SetModified() { - aPB_OK.Enable(); + m_pPB_OK->Enable(); } //------------------------------------------------------------------------ TabOrderDialog::~TabOrderDialog() { - aLB_Controls.Hide(); + m_pLB_Controls->Hide(); // delete pLB_Controls; delete pImageList; @@ -175,7 +172,7 @@ namespace pcr if ( !m_xTempModel.is() || !m_xControlContainer.is() ) return; - aLB_Controls.Clear(); + m_pLB_Controls->Clear(); try { @@ -199,14 +196,14 @@ namespace pcr aName = ::comphelper::getString( xControl->getPropertyValue( PROPERTY_NAME ) ); // TODO: do Basic controls have a name? aImage = GetImage( xControl ); - aLB_Controls.InsertEntry( aName, aImage, aImage, 0, sal_False, LIST_APPEND, xControl.get() ); + m_pLB_Controls->InsertEntry( aName, aImage, aImage, 0, sal_False, LIST_APPEND, xControl.get() ); } } else { // no property set -> no tab order OSL_FAIL( "TabOrderDialog::FillList: invalid control encountered!" ); - aLB_Controls.Clear(); + m_pLB_Controls->Clear(); break; } } @@ -217,22 +214,22 @@ namespace pcr } // select first entry - SvTreeListEntry* pFirstEntry = aLB_Controls.GetEntry( 0 ); + SvTreeListEntry* pFirstEntry = m_pLB_Controls->GetEntry( 0 ); if ( pFirstEntry ) - aLB_Controls.Select( pFirstEntry ); + m_pLB_Controls->Select( pFirstEntry ); } //------------------------------------------------------------------------ IMPL_LINK( TabOrderDialog, MoveUpClickHdl, Button*, /*pButton*/ ) { - aLB_Controls.MoveSelection( -1 ); + m_pLB_Controls->MoveSelection( -1 ); return 0; } //------------------------------------------------------------------------ IMPL_LINK( TabOrderDialog, MoveDownClickHdl, Button*, /*pButton*/ ) { - aLB_Controls.MoveSelection( 1 ); + m_pLB_Controls->MoveSelection( 1 ); return 0; } @@ -263,7 +260,7 @@ namespace pcr //------------------------------------------------------------------------ IMPL_LINK( TabOrderDialog, OKClickHdl, Button*, /*pButton*/ ) { - sal_uLong nEntryCount = aLB_Controls.GetEntryCount(); + sal_uLong nEntryCount = m_pLB_Controls->GetEntryCount(); Sequence< Reference< XControlModel > > aSortedControlModelSeq( nEntryCount ); Sequence< Reference< XControlModel > > aControlModels( m_xTempModel->getControlModels()); Reference< XControlModel > * pSortedControlModels = aSortedControlModelSeq.getArray(); @@ -271,7 +268,7 @@ namespace pcr for (sal_uLong i=0; i < nEntryCount; i++) { - SvTreeListEntry* pEntry = aLB_Controls.GetEntry(i); + SvTreeListEntry* pEntry = m_pLB_Controls->GetEntry(i); for( sal_Int32 j=0; j m_xORB; - FixedText aFT_Controls; - TabOrderListBox aLB_Controls; + TabOrderListBox* m_pLB_Controls; - OKButton aPB_OK; - CancelButton aPB_CANCEL; - HelpButton aPB_HELP; + OKButton* m_pPB_OK; - PushButton aPB_MoveUp; - PushButton aPB_MoveDown; - PushButton aPB_AutoOrder; + PushButton* m_pPB_MoveUp; + PushButton* m_pPB_MoveDown; + PushButton* m_pPB_AutoOrder; ImageList* pImageList; diff --git a/extensions/source/propctrlr/taborder.src b/extensions/source/propctrlr/taborder.src index 9560f253a1f5..e69de29bb2d1 100644 --- a/extensions/source/propctrlr/taborder.src +++ b/extensions/source/propctrlr/taborder.src @@ -1,96 +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 "formresid.hrc" -#include "taborder.hrc" -#include "propctrlr.hrc" - -ModalDialog RID_DLG_TABORDER -{ - HelpID = "extensions:ModalDialog:RID_DLG_TABORDER"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 168 , 158 ) ; - Text [ en-US ] = "Tab Order" ; - Moveable = TRUE ; - Closeable = TRUE ; - - FixedText FT_CONTROLS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Controls" ; - }; - - Control CTRL_TREE - { - Border = TRUE; - Pos = MAP_APPFONT ( 6, 14) ; - Size = MAP_APPFONT ( 90, 136 ) ; - TabStop = TRUE; - HelpId = HID_PROP_TABORDER_CONTROLS; - }; - - PushButton PB_MOVE_UP - { - HelpID = "extensions:PushButton:RID_DLG_TABORDER:PB_MOVE_UP"; - Pos = MAP_APPFONT ( 102 , 14 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Move Up" ; - }; - - PushButton PB_MOVE_DOWN - { - HelpID = "extensions:PushButton:RID_DLG_TABORDER:PB_MOVE_DOWN"; - Pos = MAP_APPFONT ( 102 , 32 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Move Down" ; - }; - - PushButton PB_AUTO_ORDER - { - HelpID = "extensions:PushButton:RID_DLG_TABORDER:PB_AUTO_ORDER"; - Pos = MAP_APPFONT ( 102 , 50 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Automatic Sort" ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 102 , 100 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE; - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 102 , 118 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - }; - - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 102 , 136 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/propctrlr/uiconfig/spropctrlr/ui/taborder.ui b/extensions/source/propctrlr/uiconfig/spropctrlr/ui/taborder.ui new file mode 100644 index 000000000000..d87b7e99d798 --- /dev/null +++ b/extensions/source/propctrlr/uiconfig/spropctrlr/ui/taborder.ui @@ -0,0 +1,170 @@ + + + + + + False + 6 + Tab Order + dialog + + + False + 12 + + + False + vertical + end + + + _Move Up + True + True + True + True + + + False + True + 0 + + + + + Move _Down + True + True + True + True + + + False + True + 1 + + + + + _Automatic Sort + True + True + True + 30 + True + + + False + True + 2 + + + + + gtk-ok + True + True + True + True + True + True + + + False + True + 3 + + + + + gtk-cancel + True + True + True + True + + + False + True + 4 + + + + + gtk-help + True + True + True + True + + + False + True + 5 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + 30 + + + + + + + + + + True + False + Controls + + + + + + + + False + True + 1 + + + + + + upB + downB + autoB + ok + cancel + help + + + -- cgit