summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-02 22:42:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-03 15:58:26 +0100
commit77ce41f2571c3158f00e2b632ce006059282c462 (patch)
tree8fec039e7eaca527e45c2cd050208e81b70157c1 /svx
parent2f60a1bdabac11e985dbcc6265dd8b97ef1ca6fd (diff)
convert RID_SVXTBX_UNDO_REDO_CTRL floating window to .ui
Change-Id: I88a5e0aec20170dfb71bf28cb35e860773657937
Diffstat (limited to 'svx')
-rw-r--r--svx/UIConfig_svx.mk1
-rw-r--r--svx/inc/helpid.hrc1
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx52
-rw-r--r--svx/source/tbxctrls/lboxctrl.hrc22
-rw-r--r--svx/source/tbxctrls/lboxctrl.src21
-rw-r--r--svx/uiconfig/ui/floatingundoredo.ui42
6 files changed, 61 insertions, 78 deletions
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 21ac190369f8..b5db9b0df7e8 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/docrecoverysavedialog \
svx/uiconfig/ui/extrustiondepthdialog \
svx/uiconfig/ui/findreplacedialog \
+ svx/uiconfig/ui/floatingundoredo \
svx/uiconfig/ui/fontworkgallerydialog \
svx/uiconfig/ui/fontworkspacingdialog \
svx/uiconfig/ui/formlinkwarndialog \
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index c69725247b1c..33fd0a6e68d7 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -112,7 +112,6 @@
#define HID_POPUP_LINEEND "SVX_HID_POPUP_LINEEND"
#define HID_POPUP_LINEEND_CTRL "SVX_HID_POPUP_LINEEND_CTRL"
#define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX"
-#define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL"
#define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN"
#define HID_SVX_TP_DOCRECOVERY_RECOVER "SVX_HID_SVX_TP_DOCRECOVERY_RECOVER"
#define HID_VALUESET_EXTRUSION_DIRECTION "SVX_HID_VALUESET_EXTRUSION_DIRECTION"
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index a6b2600bebf0..33340d59cddf 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -44,33 +44,24 @@
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
-#include "lboxctrl.hrc"
-
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
class SvxPopupWindowListBox;
-
-
class SvxPopupWindowListBox: public SfxPopupWindow
{
using FloatingWindow::StateChanged;
- ListBox * pListBox;
+ ListBox * m_pListBox;
ToolBox & rToolBox;
bool bUserSel;
sal_uInt16 nTbxId;
OUString maCommandURL;
- // disallow copy-constructor and assignment-operator
-
-// SvxPopupWindowListBox( sal_uInt16 nSlotId, ToolBox& rTbx, sal_uInt16 nTbxItemId );
public:
SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nTbxId, ToolBox& rTbx );
- virtual ~SvxPopupWindowListBox();
// SfxPopupWindow
virtual SfxPopupWindow * Clone() const SAL_OVERRIDE;
@@ -78,43 +69,38 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- inline ListBox & GetListBox() { return *pListBox; }
+ inline ListBox & GetListBox() { return *m_pListBox; }
bool IsUserSelected() const { return bUserSel; }
void SetUserSelected( bool bVal ) { bUserSel = bVal; }
- /*virtual*/Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
+ virtual Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
};
-
-
-SvxPopupWindowListBox::SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx ) :
- SfxPopupWindow( nSlotId, Reference< XFrame >(), SVX_RES( RID_SVXTBX_UNDO_REDO_CTRL ) ),
- rToolBox ( rTbx ),
- bUserSel ( false ),
- nTbxId ( nId ),
- maCommandURL( rCommandURL )
+SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx)
+ : SfxPopupWindow(nSlotId, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui")
+ , rToolBox(rTbx)
+ , bUserSel(false)
+ , nTbxId(nId)
+ , maCommandURL(rCommandURL)
{
DBG_ASSERT( nSlotId == GetId(), "id mismatch" );
- pListBox = new ListBox( this, SVX_RES( LB_SVXTBX_UNDO_REDO_CTRL ) );
- FreeResource();
- pListBox->EnableMultiSelection( true, true );
+ get(m_pListBox, "treeview");
+ WinBits nBits(m_pListBox->GetStyle());
+ nBits &= ~(WB_SIMPLEMODE);
+ m_pListBox->SetStyle(nBits);
+ Size aSize(LogicToPixel(Size(100, 85), MAP_APPFONT));
+ m_pListBox->set_width_request(aSize.Width());
+ m_pListBox->set_height_request(aSize.Height());
+ m_pListBox->EnableMultiSelection( true, true );
SetBackground( GetSettings().GetStyleSettings().GetDialogColor() );
AddStatusListener( rCommandURL );
}
-
-SvxPopupWindowListBox::~SvxPopupWindowListBox()
-{
- delete pListBox;
-}
-
-
SfxPopupWindow* SvxPopupWindowListBox::Clone() const
{
return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
}
-
void SvxPopupWindowListBox::PopupModeEnd()
{
rToolBox.EndSelection();
@@ -141,11 +127,9 @@ Window* SvxPopupWindowListBox::GetPreferredKeyInputWindow()
{
// allows forwarding key events in the correct window
// without setting the focus
- return pListBox->GetPreferredKeyInputWindow();
+ return m_pListBox->GetPreferredKeyInputWindow();
}
-
-
SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx ),
pPopupWin ( 0 )
diff --git a/svx/source/tbxctrls/lboxctrl.hrc b/svx/source/tbxctrls/lboxctrl.hrc
deleted file mode 100644
index 8320a91c8884..000000000000
--- a/svx/source/tbxctrls/lboxctrl.hrc
+++ /dev/null
@@ -1,22 +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 .
- */
-
-#define LB_SVXTBX_UNDO_REDO_CTRL 11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/lboxctrl.src b/svx/source/tbxctrls/lboxctrl.src
index 7961f3913410..f9b5ab12004d 100644
--- a/svx/source/tbxctrls/lboxctrl.src
+++ b/svx/source/tbxctrls/lboxctrl.src
@@ -19,27 +19,6 @@
#include <svx/dialogs.hrc>
#include <helpid.hrc>
-#include "lboxctrl.hrc"
-
-FloatingWindow RID_SVXTBX_UNDO_REDO_CTRL
-{
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 102 , 87 ) ;
- HelpID = HID_SVXTBX_UNDO_REDO_CTRL ;
- StdPopup = TRUE;
- Hide = TRUE ;
- OutputSize = TRUE ;
-
- ListBox LB_SVXTBX_UNDO_REDO_CTRL
- {
- HelpID = "svx:ListBox:RID_SVXTBX_UNDO_REDO_CTRL:LB_SVXTBX_UNDO_REDO_CTRL";
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 100 , 85 ) ;
- Border = TRUE ;
- DropDown = FALSE ;
- OutputSize = TRUE ;
- };
-};
String RID_SVXSTR_NUM_UNDO_ACTIONS
{
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
new file mode 100644
index 000000000000..66f30a614dcb
--- /dev/null
+++ b/svx/uiconfig/ui/floatingundoredo.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkWindow" id="FloatingUndoRedo:border">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">6</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">popup-menu</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="decorated">False</property>
+ <property name="deletable">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <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="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>