summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-11-14 10:40:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-11-14 11:05:38 +0000
commitf13a47fa04db2e8c653df8adf8249a89ca06b291 (patch)
tree8efefb4b06478b6b7afe185c941ad066dba4935b /sd/source
parent8820448bfebc362b31e673a5b7d01a8dc9144eca (diff)
convert insert slides dialog to .ui
Change-Id: I9dc8366d2e8bd2ab16ce11c9e69cbdbdca0ccae5
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/dlg/inspagob.cxx59
-rw-r--r--sd/source/ui/dlg/inspagob.src76
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx39
-rw-r--r--sd/source/ui/inc/inspagob.hrc27
-rw-r--r--sd/source/ui/inc/inspagob.hxx9
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx3
6 files changed, 70 insertions, 143 deletions
diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx
index 813c54356bb5..1c1ed12d9cc2 100644
--- a/sd/source/ui/dlg/inspagob.cxx
+++ b/sd/source/ui/dlg/inspagob.cxx
@@ -25,30 +25,27 @@
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
#include "ViewShell.hxx"
-#include "inspagob.hrc"
SdInsertPagesObjsDlg::SdInsertPagesObjsDlg(
- ::Window* pWindow,
- const SdDrawDocument* pInDoc,
- SfxMedium* pSfxMedium,
- const OUString& rFileName )
- : ModalDialog ( pWindow, SdResId( DLG_INSERT_PAGES_OBJS ) ),
- aLbTree ( this, SdResId( LB_TREE ) ),
- aCbxLink ( this, SdResId( CBX_LINK ) ),
- aCbxMasters ( this, SdResId( CBX_CHECK_MASTERS ) ),
- aBtnOk ( this, SdResId( BTN_OK ) ),
- aBtnCancel ( this, SdResId( BTN_CANCEL ) ),
- aBtnHelp ( this, SdResId( BTN_HELP ) ),
- pMedium ( pSfxMedium ),
- mpDoc ( pInDoc ),
- rName ( rFileName )
+ ::Window* pWindow, const SdDrawDocument* pInDoc,
+ SfxMedium* pSfxMedium, const OUString& rFileName )
+ : ModalDialog(pWindow, "InsertSlidesDialog",
+ "modules/sdraw/ui/insertslidesdialog.ui")
+ , pMedium(pSfxMedium)
+ , mpDoc(pInDoc)
+ , rName(rFileName)
{
- FreeResource();
+ get(m_pLbTree, "tree");
+ get(m_pCbxMasters, "backgrounds");
+ get(m_pCbxLink, "links");
- aLbTree.SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
+ m_pLbTree->set_width_request(m_pLbTree->approximate_char_width() * 50);
+ m_pLbTree->set_height_request(m_pLbTree->GetTextHeight() * 12);
- aLbTree.SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
+ m_pLbTree->SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
+
+ m_pLbTree->SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
// insert text
if( !pMedium )
@@ -70,20 +67,20 @@ void SdInsertPagesObjsDlg::Reset()
{
if( pMedium )
{
- aLbTree.SetSelectionMode( MULTIPLE_SELECTION );
+ m_pLbTree->SetSelectionMode( MULTIPLE_SELECTION );
// transfer ownership of Medium
- aLbTree.Fill( mpDoc, pMedium, rName );
+ m_pLbTree->Fill( mpDoc, pMedium, rName );
}
else
{
Color aColor( COL_WHITE );
Bitmap aBmpText( SdResId( BMP_DOC_TEXT ) );
Image aImgText( aBmpText, aColor );
- aLbTree.InsertEntry( rName, aImgText, aImgText );
+ m_pLbTree->InsertEntry( rName, aImgText, aImgText );
}
- aCbxMasters.Check( sal_True );
+ m_pCbxMasters->Check( sal_True );
}
std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
@@ -93,16 +90,16 @@ std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
{
// to ensure that bookmarks are opened
// (when the whole document is selected)
- aLbTree.GetBookmarkDoc();
+ m_pLbTree->GetBookmarkDoc();
// If the document is selected (too) or nothing is selected,
// the whole document is inserted (but not more!)
- if( aLbTree.GetSelectionCount() == 0 ||
- ( aLbTree.IsSelected( aLbTree.First() ) ) )
+ if( m_pLbTree->GetSelectionCount() == 0 ||
+ ( m_pLbTree->IsSelected( m_pLbTree->First() ) ) )
return std::vector<OUString>();
}
- return aLbTree.GetSelectEntryList( nType );
+ return m_pLbTree->GetSelectEntryList( nType );
}
/**
@@ -110,7 +107,7 @@ std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
*/
sal_Bool SdInsertPagesObjsDlg::IsLink()
{
- return( aCbxLink.IsChecked() );
+ return( m_pCbxLink->IsChecked() );
}
/**
@@ -118,7 +115,7 @@ sal_Bool SdInsertPagesObjsDlg::IsLink()
*/
sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
{
- return( aCbxMasters.IsChecked() );
+ return( m_pCbxMasters->IsChecked() );
}
/**
@@ -126,10 +123,10 @@ sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
*/
IMPL_LINK_NOARG(SdInsertPagesObjsDlg, SelectObjectHdl)
{
- if( aLbTree.IsLinkableSelected() )
- aCbxLink.Enable();
+ if( m_pLbTree->IsLinkableSelected() )
+ m_pCbxLink->Enable();
else
- aCbxLink.Disable();
+ m_pCbxLink->Disable();
return( 0 );
}
diff --git a/sd/source/ui/dlg/inspagob.src b/sd/source/ui/dlg/inspagob.src
deleted file mode 100644
index b26936e0c7fc..000000000000
--- a/sd/source/ui/dlg/inspagob.src
+++ /dev/null
@@ -1,76 +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 "helpids.h"
-#include "inspagob.hrc"
-
-ModalDialog DLG_INSERT_PAGES_OBJS
-{
- HelpID = HID_DLG_INSERT_PAGES_OBJS ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 200 , 128 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "Insert Slides/Objects" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 144 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 144 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 144 , 46 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- Control LB_TREE
- {
- HelpId = HID_SD_PAGEOBJSTLB;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 132 , 88 ) ;
- TabStop = TRUE ;
- };
- CheckBox CBX_LINK
- {
- HelpID = "sd:CheckBox:DLG_INSERT_PAGES_OBJS:CBX_LINK";
- Pos = MAP_APPFONT ( 6 , 100 ) ;
- Size = MAP_APPFONT ( 140 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Link" ;
- };
- CheckBox CBX_CHECK_MASTERS
- {
- HelpID = "sd:CheckBox:DLG_INSERT_PAGES_OBJS:CBX_CHECK_MASTERS";
- Pos = MAP_APPFONT ( 6 , 114 ) ;
- Size = MAP_APPFONT ( 140 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Delete unused backg~rounds";
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index f01c00cb7554..311d17846bca 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -100,8 +100,14 @@ SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable(
{
}
-
-
+extern "C" SAL_DLLPUBLIC_EXPORT ::Window* SAL_CALL makeSdPageObjsTLB(::Window *pParent, VclBuilder::stringmap &rMap)
+{
+ WinBits nWinStyle = WB_TABSTOP;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nWinStyle |= WB_BORDER;
+ return new SdPageObjsTLB(pParent, nWinStyle);
+}
SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable()
{
@@ -243,6 +249,35 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId )
SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
}
+SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, WinBits nStyle )
+: SvTreeListBox ( pParentWin, nStyle )
+, mpParent ( pParentWin )
+, mpDoc ( NULL )
+, mpBookmarkDoc ( NULL )
+, mpMedium ( NULL )
+, mpOwnMedium ( NULL )
+, maImgOle ( BitmapEx( SdResId( BMP_OLE ) ) )
+, maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) )
+, mbLinkableSelected ( sal_False )
+, mpDropNavWin ( NULL )
+, mbShowAllShapes ( false )
+, mbShowAllPages ( false )
+
+{
+ // add lines to Tree-ListBox
+ SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
+ WB_HASBUTTONS | // WB_HASLINESATROOT |
+ WB_HSCROLL |
+ WB_HASBUTTONSATROOT |
+ WB_QUICK_SEARCH /* i31275 */ );
+ SetNodeBitmaps( Image(Bitmap( SdResId(BMP_EXPAND) )),
+ Image(Bitmap( SdResId(BMP_COLLAPSE) )));
+
+ SetDragDropMode(
+ SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY |
+ SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
+}
+
SdPageObjsTLB::~SdPageObjsTLB()
{
diff --git a/sd/source/ui/inc/inspagob.hrc b/sd/source/ui/inc/inspagob.hrc
deleted file mode 100644
index 4248b25282cc..000000000000
--- a/sd/source/ui/inc/inspagob.hrc
+++ /dev/null
@@ -1,27 +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 DLG_INSERT_PAGES_OBJS 938
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define LB_TREE 1
-#define CBX_LINK 1
-#define CBX_CHECK_MASTERS 2
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx
index a0d2da4ad745..ae2f68aa770e 100644
--- a/sd/source/ui/inc/inspagob.hxx
+++ b/sd/source/ui/inc/inspagob.hxx
@@ -31,12 +31,9 @@ class SdDrawDocument;
class SdInsertPagesObjsDlg : public ModalDialog
{
private:
- SdPageObjsTLB aLbTree;
- CheckBox aCbxLink;
- CheckBox aCbxMasters;
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
+ SdPageObjsTLB* m_pLbTree;
+ CheckBox* m_pCbxLink;
+ CheckBox* m_pCbxMasters;
SfxMedium* pMedium;
const SdDrawDocument* mpDoc;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index f78d5becb34a..252a40384144 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -179,7 +179,8 @@ protected:
public:
- SdPageObjsTLB( Window* pParent, const SdResId& rSdResId );
+ SdPageObjsTLB( Window* pParent, const SdResId& rSdResId );
+ SdPageObjsTLB( Window* pParent, WinBits nStyle );
~SdPageObjsTLB();
virtual void SelectHdl();