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

convert RID_DLG_SELECTION to .ui format

Change-Id: Ib23d8ec34c757bb8268651d4a1d00c6528dac9c1
üst dbaed27d
......@@ -32,8 +32,4 @@ $(eval $(call gb_SrsTarget_add_files,pcr/res,\
extensions/source/propctrlr/formlinkdialog.src \
))
$(eval $(call gb_SrsTarget_add_nonlocalizable_files,pcr/res,\
extensions/source/propctrlr/listselectiondlg.src \
))
# vim:set noet sw=4 ts=4:
......@@ -15,6 +15,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\
extensions/uiconfig/spropctrlr/ui/fieldlinkrow \
extensions/uiconfig/spropctrlr/ui/formlinksdialog \
extensions/uiconfig/spropctrlr/ui/labelselectiondialog \
extensions/uiconfig/spropctrlr/ui/listselectdialog \
extensions/uiconfig/spropctrlr/ui/taborder \
))
......
......@@ -274,11 +274,6 @@
#define RID_STR_CONFIRM_DELETE_DATA_TYPE ( RID_FORMBROWSER_START + 500 )
// - dialogs
#define RID_DLG_TABORDER ( RID_PROPCONTROLLER_START + 1 )
#define RID_DLG_SELECTION ( RID_PROPCONTROLLER_START + 3 )
// - ImageLists
#define RID_IL_FORMEXPLORER ( RID_PROPCONTROLLER_START + 0 )
......
......@@ -18,47 +18,36 @@
*/
#include "listselectiondlg.hxx"
#include "listselectiondlg.hrc"
#include "modulepcr.hxx"
#include "formresid.hrc"
#include "formstrings.hxx"
#include <vcl/msgbox.hxx>
namespace pcr
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
//= ListSelectionDialog
ListSelectionDialog::ListSelectionDialog( Window* _pParent, const Reference< XPropertySet >& _rxListBox,
const OUString& _rPropertyName, const OUString& _rPropertyUIName )
:ModalDialog( _pParent, PcrRes( RID_DLG_SELECTION ) )
,m_aLabel ( this, PcrRes( FT_ENTRIES ) )
,m_aEntries ( this, PcrRes( LB_ENTRIES ) )
,m_aOK ( this, PcrRes( PB_OK ) )
,m_aCancel ( this, PcrRes( PB_CANCEL ) )
,m_aHelp ( this, PcrRes( PB_HELP ) )
ListSelectionDialog::ListSelectionDialog(Window* _pParent, const Reference< XPropertySet >& _rxListBox,
const OUString& _rPropertyName, const OUString& _rPropertyUIName)
: ModalDialog( _pParent, "ListSelectDialog", "modules/spropctrlr/ui/listselectdialog.ui" )
,m_xListBox ( _rxListBox )
,m_sPropertyName( _rPropertyName )
{
FreeResource();
OSL_PRECOND( m_xListBox.is(), "ListSelectionDialog::ListSelectionDialog: invalid list box!" );
SetText( _rPropertyUIName );
m_aLabel.SetText( _rPropertyUIName );
get(m_pEntries, "treeview");
Size aSize(LogicToPixel(Size(85, 97), MAP_APPFONT));
m_pEntries->set_width_request(aSize.Width());
m_pEntries->set_height_request(aSize.Height());
SetText(_rPropertyUIName);
get<VclFrame>("frame")->set_label(_rPropertyUIName);
initialize( );
}
short ListSelectionDialog::Execute()
{
short nResult = ModalDialog::Execute();
......@@ -75,14 +64,14 @@ namespace pcr
if ( !m_xListBox.is() )
return;
m_aEntries.SetStyle( GetStyle() | WB_SIMPLEMODE );
m_pEntries->SetStyle( GetStyle() | WB_SIMPLEMODE );
try
{
// initialize the multi-selection flag
bool bMultiSelection = false;
OSL_VERIFY( m_xListBox->getPropertyValue( PROPERTY_MULTISELECTION ) >>= bMultiSelection );
m_aEntries.EnableMultiSelection( bMultiSelection );
m_pEntries->EnableMultiSelection( bMultiSelection );
// fill the list box with all entries
Sequence< OUString > aListEntries;
......@@ -122,31 +111,31 @@ namespace pcr
void ListSelectionDialog::fillEntryList( const Sequence< OUString >& _rListEntries )
{
m_aEntries.Clear();
m_pEntries->Clear();
const OUString* _pListEntries = _rListEntries.getConstArray();
const OUString* _pListEntriesEnd = _rListEntries.getConstArray() + _rListEntries.getLength();
for ( ; _pListEntries < _pListEntriesEnd; ++_pListEntries )
m_aEntries.InsertEntry( *_pListEntries );
m_pEntries->InsertEntry( *_pListEntries );
}
void ListSelectionDialog::collectSelection( Sequence< sal_Int16 >& /* [out] */ _rSelection )
{
sal_uInt16 nSelectedCount = m_aEntries.GetSelectEntryCount( );
sal_uInt16 nSelectedCount = m_pEntries->GetSelectEntryCount( );
_rSelection.realloc( nSelectedCount );
sal_Int16* pSelection = _rSelection.getArray();
for ( sal_uInt16 selected = 0; selected < nSelectedCount; ++selected, ++pSelection )
*pSelection = static_cast< sal_Int16 >( m_aEntries.GetSelectEntryPos( selected ) );
*pSelection = static_cast< sal_Int16 >( m_pEntries->GetSelectEntryPos( selected ) );
}
void ListSelectionDialog::selectEntries( const Sequence< sal_Int16 >& /* [in ] */ _rSelection )
{
m_aEntries.SetNoSelection();
m_pEntries->SetNoSelection();
const sal_Int16* pSelection = _rSelection.getConstArray();
const sal_Int16* pSelectionEnd = _rSelection.getConstArray() + _rSelection.getLength();
for ( ; pSelection != pSelectionEnd; ++pSelection )
m_aEntries.SelectEntryPos( *pSelection );
m_pEntries->SelectEntryPos( *pSelection );
}
......
......@@ -21,28 +21,17 @@
#define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
namespace pcr
{
//= ListSelectionDialog
class ListSelectionDialog : public ModalDialog
{
private:
FixedText m_aLabel;
ListBox m_aEntries;
OKButton m_aOK;
CancelButton m_aCancel;
HelpButton m_aHelp;
ListBox* m_pEntries;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xListBox;
......
/* -*- 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 "propctrlr.hrc"
#include "listselectiondlg.hrc"
ModalDialog RID_DLG_SELECTION
{
HelpID = "extensions:ModalDialog:RID_DLG_SELECTION";
OutputSize = TRUE ;
Moveable = TRUE ;
Closeable = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 150, 120 ) ;
FixedText FT_ENTRIES
{
Pos = MAP_APPFONT( 6, 6 );
Size = MAP_APPFONT( 85, 8 );
};
ListBox LB_ENTRIES
{
HelpID = "extensions:ListBox:RID_DLG_SELECTION:LB_ENTRIES";
Pos = MAP_APPFONT( 6, 17 );
Size = MAP_APPFONT( 85, 97 );
Border = TRUE;
DropDown = FALSE;
};
OKButton PB_OK
{
Pos = MAP_APPFONT( 97, 6 );
Size = MAP_APPFONT( 50, 14 );
TabStop = TRUE;
DefButton = TRUE;
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT( 97, 23 );
Size = MAP_APPFONT( 50, 14 );
TabStop = TRUE;
};
HelpButton PB_HELP
{
Pos = MAP_APPFONT( 97, 43 );
Size = MAP_APPFONT( 50, 14 );
TabStop = TRUE;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="ListSelectDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTreeView" id="treeview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
</action-widgets>
</object>
</interface>
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