summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/lboxctrl.cxx
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/source/tbxctrls/lboxctrl.cxx
parent2f60a1bdabac11e985dbcc6265dd8b97ef1ca6fd (diff)
convert RID_SVXTBX_UNDO_REDO_CTRL floating window to .ui
Change-Id: I88a5e0aec20170dfb71bf28cb35e860773657937
Diffstat (limited to 'svx/source/tbxctrls/lboxctrl.cxx')
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx52
1 files changed, 18 insertions, 34 deletions
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 )