summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/AllLangResTarget_cui.mk1
-rw-r--r--cui/UIConfig_cui.mk1
-rw-r--r--cui/source/dialogs/fmsearch.hrc1
-rw-r--r--cui/source/dialogs/showcols.cxx31
-rw-r--r--cui/source/dialogs/showcols.src68
-rw-r--r--cui/source/inc/showcols.hxx9
-rw-r--r--cui/uiconfig/ui/showcoldialog.ui112
7 files changed, 127 insertions, 96 deletions
diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk
index 9bf5505cd229..16a1feb57848 100644
--- a/cui/AllLangResTarget_cui.mk
+++ b/cui/AllLangResTarget_cui.mk
@@ -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 \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index d2bb6c60b723..b508acc4ed7a 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -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 \
diff --git a/cui/source/dialogs/fmsearch.hrc b/cui/source/dialogs/fmsearch.hrc
index 3b65fdb85225..5403f5fda8b6 100644
--- a/cui/source/dialogs/fmsearch.hrc
+++ b/cui/source/dialogs/fmsearch.hrc
@@ -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)
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index 7bce6ac6ef59..599cd1c1b8b6 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -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) );
}
}
diff --git a/cui/source/dialogs/showcols.src b/cui/source/dialogs/showcols.src
deleted file mode 100644
index f8bd455824d6..000000000000
--- a/cui/source/dialogs/showcols.src
+++ /dev/null
@@ -1,68 +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 "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: */
diff --git a/cui/source/inc/showcols.hxx b/cui/source/inc/showcols.hxx
index aca17ddf90b6..65ee78511695 100644
--- a/cui/source/inc/showcols.hxx
+++ b/cui/source/inc/showcols.hxx
@@ -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);
diff --git a/cui/uiconfig/ui/showcoldialog.ui b/cui/uiconfig/ui/showcoldialog.ui
new file mode 100644
index 000000000000..ee1a23bbd2bf
--- /dev/null
+++ b/cui/uiconfig/ui/showcoldialog.ui
@@ -0,0 +1,112 @@
+<?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>