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

convert new data type dialog to .ui

Change-Id: Ia354e003903c20435947e82afa293a34a367773a
üst 0a508c70
......@@ -30,7 +30,6 @@ $(eval $(call gb_SrsTarget_add_files,pcr/res,\
extensions/source/propctrlr/pcrmiscres.src \
extensions/source/propctrlr/selectlabeldialog.src \
extensions/source/propctrlr/formlinkdialog.src \
extensions/source/propctrlr/newdatatype.src \
))
$(eval $(call gb_SrsTarget_add_nonlocalizable_files,pcr/res,\
......
......@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,modules/spropctrlr))
$(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\
extensions/uiconfig/spropctrlr/ui/controlfontdialog \
extensions/uiconfig/spropctrlr/ui/datatypedialog \
extensions/uiconfig/spropctrlr/ui/taborder \
))
......
......@@ -281,7 +281,6 @@
#define RID_DLG_TABORDER ( RID_PROPCONTROLLER_START + 1 )
#define RID_DLG_FORMLINKS ( RID_PROPCONTROLLER_START + 2 )
#define RID_DLG_SELECTION ( RID_PROPCONTROLLER_START + 3 )
#define RID_DLG_NEW_DATA_TYPE ( RID_PROPCONTROLLER_START + 4 )
// - ImageLists
......
......@@ -18,12 +18,9 @@
*/
#include "newdatatype.hxx"
#include "newdatatype.hrc"
#include "modulepcr.hxx"
#include "formresid.hrc"
namespace pcr
{
......@@ -33,16 +30,14 @@ namespace pcr
NewDataTypeDialog::NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames )
:ModalDialog( _pParent, PcrRes( RID_DLG_NEW_DATA_TYPE ) )
,m_aLabel ( this, PcrRes( FT_LABEL ) )
,m_aName ( this, PcrRes( ED_NAME ) )
,m_aOK ( this, PcrRes( PB_OK ) )
,m_aCancel ( this, PcrRes( PB_CANCEL ) )
,m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() )
: ModalDialog( _pParent, "DataTypeDialog",
"modules/spropctrlr/ui/datatypedialog.ui" )
, m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() )
{
FreeResource();
get(m_pName, "entry");
get(m_pOK, "ok");
m_aName.SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) );
m_pName->SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) );
// find an initial name
// for this, first remove trailing digits
......@@ -68,7 +63,7 @@ namespace pcr
}
while ( m_aProhibitedNames.find( sInitialName ) != m_aProhibitedNames.end() );
m_aName.SetText( sInitialName );
m_pName->SetText( sInitialName );
OnNameModified( NULL );
}
......@@ -79,7 +74,7 @@ namespace pcr
bool bNameIsOK = ( !sCurrentName.isEmpty() )
&& ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() );
m_aOK.Enable( bNameIsOK );
m_pOK->Enable( bNameIsOK );
return 0L;
}
......
/* -*- 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 .
*/
#ifndef EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC
#define EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC
#define FT_LABEL 1
#define ED_NAME 2
#define PB_OK 1
#define PB_CANCEL 2
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -31,26 +31,20 @@
namespace pcr
{
//= NewDataTypeDialog
class NewDataTypeDialog : public ModalDialog
{
private:
FixedText m_aLabel;
Edit m_aName;
OKButton m_aOK;
CancelButton m_aCancel;
Edit* m_pName;
OKButton* m_pOK;
::std::set< OUString >
m_aProhibitedNames;
::std::set< OUString > m_aProhibitedNames;
public:
NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames );
NewDataTypeDialog(Window* _pParent, const OUString& _rNameBase,
const ::std::vector< OUString >& _rProhibitedNames );
inline OUString GetName() const { return m_aName.GetText(); }
OUString GetName() const { return m_pName->GetText(); }
private:
DECL_LINK( OnNameModified, void* );
......
/* -*- 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 "newdatatype.hrc"
#define DIALOG_WIDTH 150
#define DIALOG_HEIGHT 55
#define BUTTON_WIDTH 50
#define BUTTON_HEIGHT 14
ModalDialog RID_DLG_NEW_DATA_TYPE
{
HelpID = "extensions:ModalDialog:RID_DLG_NEW_DATA_TYPE";
OutputSize = TRUE ;
Moveable = TRUE ;
Closeable = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( DIALOG_WIDTH, DIALOG_HEIGHT ) ;
Text [ en-US ] = "New Data Type";
FixedText FT_LABEL
{
Pos = MAP_APPFONT( 6, 6 );
Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 8 );
Text [ en-US ] = "Type a name for the new data type:";
};
Edit ED_NAME
{
HelpID = "extensions:Edit:RID_DLG_NEW_DATA_TYPE:ED_NAME";
Pos = MAP_APPFONT( 6, 17 );
Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 12 );
Border = TRUE;
};
OKButton PB_OK
{
Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH - 3 - BUTTON_WIDTH, 35 );
Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT );
DefButton = TRUE;
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH, 35 );
Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT );
};
};
/* 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="DataTypeDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">New Data Type</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>
</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="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Type a name for the new data type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">entry</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</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-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