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

convert grid control show columns dialog to .ui

Change-Id: I5518328c2f527b910b78cb20358f4e55acf07ead
üst 0f19e289
......@@ -40,7 +40,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/dialogs/multipat.src \
cui/source/dialogs/passwdomdlg.src \
cui/source/dialogs/scriptdlg.src \
cui/source/dialogs/showcols.src \
cui/source/dialogs/srchxtra.src \
cui/source/dialogs/svuidlg.src \
cui/source/options/certpath.src \
......
......@@ -131,6 +131,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/securityoptionsdialog \
cui/uiconfig/ui/select_persona_dialog \
cui/uiconfig/ui/shadowtabpage \
cui/uiconfig/ui/showcoldialog \
cui/uiconfig/ui/similaritysearchdialog \
cui/uiconfig/ui/slantcornertabpage \
cui/uiconfig/ui/specialcharacters \
......
......@@ -21,7 +21,6 @@
#include "svl/solar.hrc"
#define RID_SVX_DLG_SHOWGRIDCOLUMNS (RID_FORMS_START + 11)
#define RID_SVXDLG_SEARCHFORM (RID_FORMS_START + 7)
#define RID_STR_SEARCH_ANYWHERE (RID_FORMS_START + 85)
#define RID_STR_SEARCH_BEGINNING (RID_FORMS_START + 86)
......
......@@ -36,23 +36,14 @@
DBG_NAME(FmShowColsDialog)
//--------------------------------------------------------------------------
FmShowColsDialog::FmShowColsDialog(Window* pParent)
:ModalDialog(pParent, CUI_RES(RID_SVX_DLG_SHOWGRIDCOLUMNS))
,m_aList(this, CUI_RES(1))
,m_aLabel(this, CUI_RES(1))
,m_aOK(this, CUI_RES(1))
,m_aCancel(this, CUI_RES(1))
: ModalDialog(pParent, "ShowColDialog", "cui/ui/showcoldialog.ui")
{
DBG_CTOR(FmShowColsDialog,NULL);
m_aList.EnableMultiSelection(sal_True);
m_aOK.SetClickHdl( LINK( this, FmShowColsDialog, OnClickedOk ) );
FreeResource();
}
//--------------------------------------------------------------------------
FmShowColsDialog::~FmShowColsDialog()
{
DBG_DTOR(FmShowColsDialog,NULL);
get(m_pOK, "ok");
get(m_pList, "treeview");
m_pList->set_height_request(m_pList->GetTextHeight() * 8);
m_pList->set_width_request(m_pList->approximate_char_width() * 56);
m_pList->EnableMultiSelection(true);
m_pOK->SetClickHdl( LINK( this, FmShowColsDialog, OnClickedOk ) );
}
//--------------------------------------------------------------------------
......@@ -62,9 +53,9 @@ IMPL_LINK_NOARG(FmShowColsDialog, OnClickedOk)
if (m_xColumns.is())
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xCol;
for (sal_uInt16 i=0; i<m_aList.GetSelectEntryCount(); ++i)
for (sal_uInt16 i=0; i < m_pList->GetSelectEntryCount(); ++i)
{
m_xColumns->getByIndex(sal::static_int_cast<sal_Int32>(reinterpret_cast<sal_uIntPtr>(m_aList.GetEntryData(m_aList.GetSelectEntryPos(i))))) >>= xCol;
m_xColumns->getByIndex(sal::static_int_cast<sal_Int32>(reinterpret_cast<sal_uIntPtr>(m_pList->GetEntryData(m_pList->GetSelectEntryPos(i))))) >>= xCol;
if (xCol.is())
{
try
......@@ -91,7 +82,7 @@ void FmShowColsDialog::SetColumns(const ::com::sun::star::uno::Reference< ::com:
return;
m_xColumns = xCols.get();
m_aList.Clear();
m_pList->Clear();
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xCurCol;
OUString sCurName;
......@@ -116,7 +107,7 @@ void FmShowColsDialog::SetColumns(const ::com::sun::star::uno::Reference< ::com:
// if the col is hidden, put it into the list
if (bIsHidden)
m_aList.SetEntryData( m_aList.InsertEntry(sCurName), reinterpret_cast<void*>((sal_Int64)i) );
m_pList->SetEntryData( m_pList->InsertEntry(sCurName), reinterpret_cast<void*>((sal_Int64)i) );
}
}
......
/* -*- 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 "fmsearch.hrc"
ModalDialog RID_SVX_DLG_SHOWGRIDCOLUMNS
{
HelpID = "cui:ModalDialog:RID_SVX_DLG_SHOWGRIDCOLUMNS";
OutputSize = TRUE;
SVLook = TRUE ;
Size = MAP_APPFONT( 200, 117 );
Moveable = TRUE;
Closeable = TRUE;
FixedText 1
{
Pos = MAP_APPFONT( 6, 6 );
Size = MAP_APPFONT( 188, 30 );
WordBreak = TRUE;
Text [ en-US ] = "The following columns are currently hidden. Please mark the fields you want to show and choose OK.";
};
ListBox 1
{
HelpID = "cui:ListBox:RID_SVX_DLG_SHOWGRIDCOLUMNS:1";
Border = TRUE;
Pos = MAP_APPFONT( 6, 39 );
Size = MAP_APPFONT( 188, 55 );
TabStop = TRUE;
DropDown = FALSE;
AutoHScroll = TRUE;
VScroll = TRUE;
};
OKButton 1
{
Pos = MAP_APPFONT( 6, 97 );
Size = MAP_APPFONT( 50, 14 );
TabStop = TRUE;
DefButton = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT( 144, 97 );
Size = MAP_APPFONT( 50, 14 );
TabStop = TRUE;
};
Text [ en-US ] = "Show columns";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -35,16 +35,13 @@
class FmShowColsDialog : public ModalDialog
{
ListBox m_aList;
FixedText m_aLabel;
OKButton m_aOK;
CancelButton m_aCancel;
ListBox* m_pList;
OKButton* m_pOK;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xColumns;
public:
FmShowColsDialog( Window* pParent );
virtual ~FmShowColsDialog();
FmShowColsDialog(Window* pParent);
void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols);
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="ShowColDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Show columns</property>
<property name="type_hint">dialog</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="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">The following columns are currently hidden. Please mark the fields you want to show and choose OK.</property>
<property name="use_underline">True</property>
<property name="wrap">True</property>
<property name="mnemonic_widget">treeview:border</property>
<property name="max_width_chars">56</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="GtkTreeView" id="treeview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</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