summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-10-11 16:13:12 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-10-11 23:35:15 -0400
commitac7acb0ab1329913b0cec79790adcde0263960be (patch)
treed9d01baa97e42524c280e6e31f768e3d6119f41a
parentddf31912ddb5573a085b8601669cf31bf4b1f690 (diff)
Merged SvTreeListBox and SvLBox.
There is no reason to keep SvLBox separate. Change-Id: I0b34aa8f8ca539d4f4f0f9cea9fa9b8faec241e8
-rw-r--r--accessibility/source/extended/accessiblelistbox.cxx2
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx2
-rw-r--r--accessibility/source/extended/listboxaccessible.cxx2
-rw-r--r--basctl/source/basicide/bastype2.hxx2
-rw-r--r--basctl/source/basicide/moduldl2.cxx7
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataSourceControls.hxx2
-rw-r--r--cui/source/customize/acccfg.cxx14
-rw-r--r--cui/source/customize/cfg.cxx3
-rw-r--r--cui/source/customize/macropg.cxx5
-rw-r--r--cui/source/dialogs/thesdlg.cxx4
-rw-r--r--cui/source/dialogs/thesdlg_impl.hxx2
-rw-r--r--cui/source/inc/acccfg.hxx2
-rw-r--r--cui/source/inc/cfg.hxx2
-rw-r--r--cui/source/inc/cfgutil.hxx2
-rw-r--r--cui/source/inc/hlmarkwn.hxx2
-rw-r--r--cui/source/inc/scriptdlg.hxx2
-rw-r--r--cui/source/inc/selector.hxx2
-rw-r--r--cui/source/options/fontsubs.cxx1
-rw-r--r--cui/source/options/optHeaderTabListbox.cxx5
-rw-r--r--cui/source/options/optfltr.cxx2
-rw-r--r--cui/source/options/optlingu.cxx10
-rw-r--r--cui/source/options/radiobtnbox.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx4
-rw-r--r--cui/source/tabpages/macroass.cxx1
-rw-r--r--dbaccess/source/ui/app/AppController.cxx2
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.hxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailView.hxx2
-rw-r--r--dbaccess/source/ui/browser/dbtreemodel.hxx2
-rw-r--r--dbaccess/source/ui/browser/dbtreeview.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--dbaccess/source/ui/control/listviewitems.cxx4
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx2
-rw-r--r--dbaccess/source/ui/inc/TableWindowListBox.hxx2
-rw-r--r--dbaccess/source/ui/inc/dbtreelistbox.hxx2
-rw-r--r--dbaccess/source/ui/inc/indexdialog.hxx2
-rw-r--r--dbaccess/source/ui/inc/listviewitems.hxx4
-rw-r--r--dbaccess/source/ui/inc/marktree.hxx1
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx2
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.hxx2
-rw-r--r--extensions/source/propctrlr/taborder.hxx2
-rw-r--r--extensions/source/scanner/sanedlg.hxx2
-rw-r--r--formula/source/ui/dlg/formula.cxx2
-rw-r--r--formula/source/ui/dlg/funcpage.hxx2
-rw-r--r--formula/source/ui/dlg/structpg.hxx2
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx2
-rw-r--r--reportdesign/source/ui/inc/AddField.hxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx2
-rw-r--r--sc/source/ui/inc/content.hxx2
-rw-r--r--sc/source/ui/inc/funcpage.hxx2
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx4
-rw-r--r--sc/source/ui/navipi/content.cxx1
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx1
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx18
-rw-r--r--sd/source/ui/animations/CustomAnimationList.hxx2
-rw-r--r--sd/source/ui/dlg/RemoteDialog.hxx2
-rw-r--r--sd/source/ui/dlg/dlgassim.cxx1
-rw-r--r--sd/source/ui/dlg/dlgassim.hxx2
-rw-r--r--sd/source/ui/inc/custsdlg.hxx2
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx4
-rw-r--r--sfx2/inc/docvor.hxx8
-rw-r--r--sfx2/source/appl/newhelp.hxx2
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/doc/docvor.cxx44
-rw-r--r--sfx2/source/inc/templdgi.hxx4
-rw-r--r--sfx2/source/view/orgmgr.cxx6
-rw-r--r--svtools/Library_svt.mk3
-rw-r--r--svtools/Package_inc.mk3
-rw-r--r--svtools/inc/svtools/svlbitm.hxx33
-rw-r--r--svtools/inc/svtools/svtabbx.hxx2
-rw-r--r--svtools/inc/svtools/svtreebx.hxx403
-rw-r--r--svtools/inc/svtools/treelistbox.hxx (renamed from svtools/inc/svtools/svlbox.hxx)425
-rw-r--r--svtools/source/contnr/svimpbox.cxx6
-rw-r--r--svtools/source/contnr/svlbitm.cxx22
-rw-r--r--svtools/source/contnr/svlbox.cxx1794
-rw-r--r--svtools/source/contnr/svtabbx.cxx5
-rw-r--r--svtools/source/contnr/treelistbox.cxx (renamed from svtools/source/contnr/svtreebx.cxx)1697
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx12
-rw-r--r--svtools/source/uno/unoiface.cxx2
-rw-r--r--svx/inc/svx/checklbx.hxx2
-rw-r--r--svx/inc/svx/ctredlin.hxx3
-rw-r--r--svx/inc/svx/fontlb.hxx5
-rw-r--r--svx/source/dialog/ctredlin.cxx3
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--svx/source/dialog/fontlb.cxx4
-rw-r--r--svx/source/dialog/simptabl.cxx1
-rw-r--r--svx/source/form/filtnav.cxx17
-rw-r--r--svx/source/form/fmexch.cxx2
-rw-r--r--svx/source/inc/datanavi.hxx2
-rw-r--r--svx/source/inc/docrecovery.hxx9
-rw-r--r--svx/source/inc/filtnav.hxx2
-rw-r--r--svx/source/inc/fmexpl.hxx2
-rw-r--r--svx/source/inc/tabwin.hxx6
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx1
-rw-r--r--svx/workben/msview/msview.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/envelp/labimp.hxx2
-rw-r--r--sw/source/ui/fldui/FldRefTreeListBox.hxx2
-rw-r--r--sw/source/ui/fldui/flddinf.hxx2
-rw-r--r--sw/source/ui/inc/changedb.hxx2
-rw-r--r--sw/source/ui/inc/cnttab.hxx2
-rw-r--r--sw/source/ui/inc/conttree.hxx11
-rw-r--r--sw/source/ui/inc/dbtree.hxx2
-rw-r--r--sw/source/ui/inc/glossary.hxx2
-rw-r--r--sw/source/ui/inc/regionsw.hxx2
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx2
-rw-r--r--sw/source/ui/utlui/content.cxx4
-rw-r--r--sw/source/ui/utlui/glbltree.cxx2
112 files changed, 2228 insertions, 2531 deletions
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index 6f8a4649718d..4a43b6c235fd 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -19,7 +19,7 @@
#include <accessibility/extended/accessiblelistbox.hxx>
#include <accessibility/extended/accessiblelistboxentry.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 68f056315e2a..16ef81de82e8 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -18,7 +18,7 @@
*/
#include "accessibility/extended/accessiblelistboxentry.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/stringtransfer.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx
index 077ae5fd64ca..d5ea35feebb6 100644
--- a/accessibility/source/extended/listboxaccessible.cxx
+++ b/accessibility/source/extended/listboxaccessible.cxx
@@ -18,7 +18,7 @@
*/
#include <accessibility/extended/listboxaccessible.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
//........................................................................
namespace accessibility
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index b718ce2df6de..1c0de301f33f 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -24,7 +24,7 @@
#include <memory>
#include "tools/solar.h"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svl/lstner.hxx>
#include <basic/sbstar.hxx>
#include <sbxitem.hxx>
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 931e727c6f64..4986ad2dad37 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -40,6 +40,7 @@
#include <sfx2/request.hxx>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
+#include <svtools/svlbitm.hxx>
#include <sot/storage.hxx>
#include <com/sun/star/io/Pipe.hpp>
@@ -121,12 +122,12 @@ public:
LibLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
SvLBoxString( pEntry, nFlags, rTxt ) {}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
};
//----------------------------------------------------------------------------
-void LibLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
+void LibLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
{
// Change text color if library is read only:
bool bReadOnly = false;
@@ -1445,7 +1446,7 @@ void LibPage::DeleteCurrent()
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) )
xDlgLibContainer->removeLibrary( aOULibName );
- static_cast<SvLBox&>(aLibBox).GetModel()->Remove( pCurEntry );
+ static_cast<SvTreeListBox&>(aLibBox).GetModel()->Remove( pCurEntry );
MarkDocumentModified( m_aCurDocument );
}
}
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index c7edca5550c3..8eed40cfe86d 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -35,7 +35,7 @@
// header for class SvTabListBox
#include <svtools/svtabbx.hxx>
// header for class SvTreeListBox
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
diff --git a/chart2/source/controller/dialogs/tp_DataSourceControls.hxx b/chart2/source/controller/dialogs/tp_DataSourceControls.hxx
index 72f9697a53e2..c2f0b798aaf0 100644
--- a/chart2/source/controller/dialogs/tp_DataSourceControls.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSourceControls.hxx
@@ -26,7 +26,7 @@
// header for class SvTabListBox
#include <svtools/svtabbx.hxx>
// header for class SvTreeListBox
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
namespace chart
{
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index a3dbed09dabd..1bfbfd48853f 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -628,10 +628,8 @@ class SfxAccCfgLBoxString_Impl : public SvLBoxString
virtual ~SfxAccCfgLBoxString_Impl();
- virtual void Paint(const Point& aPos ,
- SvLBox& rDevice,
- sal_uInt16 nFlags ,
- SvLBoxEntry* pEntry );
+ virtual void Paint(
+ const Point& aPos, SvTreeListBox& rDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
//-----------------------------------------------
@@ -647,13 +645,9 @@ SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl()
{
}
-//-----------------------------------------------
-void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos ,
- SvLBox& rDevice,
- sal_uInt16 /*nFlags*/,
- SvLBoxEntry* pEntry )
+void SfxAccCfgLBoxString_Impl::Paint(
+ const Point& aPos, SvTreeListBox& rDevice, sal_uInt16 /*nFlags*/, SvLBoxEntry* pEntry)
{
-
if (!pEntry)
return;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 2f1945c6cd36..50e21ff19710 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -43,6 +43,7 @@
#include <sfx2/filedlghelper.hxx>
#include <svl/stritem.hxx>
#include <svtools/miscopt.hxx>
+#include <svtools/svlbitm.hxx>
#include <tools/diagnose_ex.h>
#include <toolkit/unohlp.hxx>
@@ -1358,7 +1359,7 @@ public:
~PopupPainter() { }
- void Paint( const Point& rPos, SvLBox& rOutDev,
+ void Paint( const Point& rPos, SvTreeListBox& rOutDev,
sal_uInt16 nViewDataEntryFlags, SvLBoxEntry* pEntry )
{
SvLBoxString::Paint( rPos, rOutDev, nViewDataEntryFlags, pEntry );
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index c4d90cfdd529..7aa0c95e3101 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -22,6 +22,7 @@
#include "macropg.hxx"
#include <vcl/msgbox.hxx>
#include <svtools/svmedit.hxx>
+#include <svtools/svlbitm.hxx>
#include <svl/eitem.hxx>
#include <tools/diagnose_ex.h>
#include <sfx2/app.hxx>
@@ -434,7 +435,7 @@ class IconLBoxString : public SvLBoxString
public:
IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& sText,
Image* pMacroImg, Image* pComponentImg );
- virtual void Paint(const Point& aPos, SvLBox& aDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
+ virtual void Paint(const Point& aPos, SvTreeListBox& aDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
};
@@ -448,7 +449,7 @@ IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const St
}
//===============================================
-void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice,
+void IconLBoxString::Paint( const Point& aPos, SvTreeListBox& aDevice,
sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
{
String aTxt( GetText() );
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index fea6127f3bfd..47a396549d91 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -26,7 +26,7 @@
#include <svl/lngmisc.hxx>
#include <svtools/filter.hxx>
#include <svtools/svlbitm.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
@@ -139,7 +139,7 @@ AlternativesString::AlternativesString(
void AlternativesString::Paint(
const Point& rPos,
- SvLBox& rDev, sal_uInt16,
+ SvTreeListBox& rDev, sal_uInt16,
SvLBoxEntry* pEntry )
{
AlternativesExtraData* pData = m_rControlImpl.GetExtraData( pEntry );
diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx
index 5269cb30fdf9..8c827fde6b72 100644
--- a/cui/source/dialogs/thesdlg_impl.hxx
+++ b/cui/source/dialogs/thesdlg_impl.hxx
@@ -56,7 +56,7 @@ public:
AlternativesString( ThesaurusAlternativesCtrl &rControl,
SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rStr );
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
#endif
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 6686cb3139c2..ca4a8c5c6dbd 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -40,7 +40,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/group.hxx>
#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sfx2/tabdlg.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/minarray.hxx>
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index d37911ce86fe..3db2a5506981 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -24,7 +24,7 @@
#include <vcl/group.hxx>
#include <vcl/menubtn.hxx>
#include <vcl/toolbox.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/svmedit2.hxx>
#include <svtools/svmedit.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index fe869d957f65..52584ebc822a 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -31,7 +31,7 @@
#include <com/sun/star/script/browse/XBrowseNode.hpp>
#include <vcl/timer.hxx>
#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/image.hxx>
class SfxMacroInfoItem;
diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx
index de683b4f7299..eb51856f96a6 100644
--- a/cui/source/inc/hlmarkwn.hxx
+++ b/cui/source/inc/hlmarkwn.hxx
@@ -23,7 +23,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "hlmarkwn_def.hxx"
class SvxHyperlinkTabPageBase;
diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx
index 514089c7dbdf..9aef16f40e46 100644
--- a/cui/source/inc/scriptdlg.hxx
+++ b/cui/source/inc/scriptdlg.hxx
@@ -24,7 +24,7 @@
#include "tools/solar.h"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index 4da182f509c0..c2828114c164 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -23,7 +23,7 @@
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/menubtn.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XFrame.hpp>
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index c250a2d55299..13ef512dbbb6 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -22,6 +22,7 @@
#include <officecfg/Office/Common.hxx>
#include <tools/shl.hxx>
#include <svtools/ctrltool.hxx>
+#include <svtools/svlbitm.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <svtools/fontsubstconfig.hxx>
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 49cb98527809..a479751a3986 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -20,6 +20,7 @@
#include "optHeaderTabListbox.hxx"
#include <vcl/svapp.hxx>
#include <svtools/headbar.hxx>
+#include <svtools/svlbitm.hxx>
namespace svx
{
@@ -31,12 +32,12 @@ public:
OptLBoxString_Impl( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
SvLBoxString( pEntry, nFlags, rTxt ) {}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
};
// -----------------------------------------------------------------------
-void OptLBoxString_Impl::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
+void OptLBoxString_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
{
Font aOldFont( rDev.GetFont() );
Font aFont( aOldFont );
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index fc6a2185210d..6afeba5bdbfe 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -25,6 +25,8 @@
#include "helpid.hrc"
#include <dialmgr.hxx>
+#include "svtools/svlbitm.hxx"
+
enum MSFltrPg2_CheckBoxEntries {
Math,
Writer,
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 3ea970e72d3b..cae53775497a 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <unotools/extendedsecurityoptions.hxx>
-#include <svtools/svlbox.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/langhelp.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
@@ -283,11 +283,11 @@ public:
BrwStringDic_Impl( SvLBoxEntry* pEntry, sal_uInt16 nFlags,
const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry);
};
-void BrwStringDic_Impl::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16,
+void BrwStringDic_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16,
SvLBoxEntry* pEntry )
{
ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
@@ -450,11 +450,11 @@ public:
BrwString_Impl( SvLBoxEntry* pEntry, sal_uInt16 nFlags,
const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry);
};
-void BrwString_Impl::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16,
+void BrwString_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16,
SvLBoxEntry* pEntry )
{
Point aPos(rPos);
diff --git a/cui/source/options/radiobtnbox.cxx b/cui/source/options/radiobtnbox.cxx
index 76b1a4ffca4e..dd5fb5979c7d 100644
--- a/cui/source/options/radiobtnbox.cxx
+++ b/cui/source/options/radiobtnbox.cxx
@@ -20,6 +20,8 @@
#include "radiobtnbox.hxx"
#include <dialmgr.hxx>
+#include "svtools/svlbitm.hxx"
+
namespace svx {
// class SvxRadioButtonListBox ----------------------------------------------------
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 8d839d0e1203..646e48b8fdd0 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -333,11 +333,11 @@ public:
OfaImpBrwString( SvLBoxEntry* pEntry, sal_uInt16 nFlags,
const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr){}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry);
};
-void OfaImpBrwString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/,
+void OfaImpBrwString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/,
SvLBoxEntry* pEntry )
{
rDev.DrawText( rPos, GetText() );
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 881e59a7d2cf..6fa74205d4fd 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -36,6 +36,7 @@
#include "cuires.hrc"
#include <vcl/fixed.hxx>
#include "headertablistbox.hxx"
+#include "svtools/svlbitm.hxx"
using ::com::sun::star::uno::Reference;
using ::com::sun::star::frame::XFrame;
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index aaa71c380db0..72520aa7e42f 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -66,7 +66,7 @@
#include <svl/urihelper.hxx>
#include <svl/filenotation.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/transfer.hxx>
#include <svtools/cliplistener.hxx>
#include <svtools/svlbitm.hxx>
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 0225c000af04..6ed5db02d53f 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -69,7 +69,7 @@
#include "dbexchange.hxx"
#include "UITools.hxx"
#include <algorithm>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
#include <unotools/pathoptions.hxx>
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index 00a2725bb8d1..8b34d8c4a6ff 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -26,7 +26,7 @@
#include <com/sun/star/sdb/application/NamedDatabaseObject.hpp>
#include <com/sun/star/ucb/XContent.hpp>
#include "AppElementType.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/DocumentInfoPreview.hxx>
#include <vcl/fixed.hxx>
#include <vcl/toolbox.hxx>
diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx
index 497c050281b0..220b31f10f2a 100644
--- a/dbaccess/source/ui/app/AppDetailView.hxx
+++ b/dbaccess/source/ui/app/AppDetailView.hxx
@@ -30,7 +30,7 @@
#include "IClipBoardTest.hxx"
#include "AppTitleWindow.hxx"
#include "AppElementType.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "VertSplitView.hxx"
#include <vector>
diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx
index 5da08ba7f0eb..b939ac31e8ef 100644
--- a/dbaccess/source/ui/browser/dbtreemodel.hxx
+++ b/dbaccess/source/ui/browser/dbtreemodel.hxx
@@ -21,8 +21,6 @@
#define DBAUI_DBTREEMODEL_HXX
#include <com/sun/star/container/XNameAccess.hpp>
-#include <svtools/svlbox.hxx>
-#include <svtools/svlbitm.hxx>
#include "unodatbr.hxx"
#include "commontypes.hxx"
diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx
index b557766fe3d3..6f26f6c063f3 100644
--- a/dbaccess/source/ui/browser/dbtreeview.cxx
+++ b/dbaccess/source/ui/browser/dbtreeview.cxx
@@ -19,7 +19,7 @@
#include "dbtreeview.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "dbtreelistbox.hxx"
#include "dbtreemodel.hxx"
#include "dbaccess_helpid.hrc"
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 058aaefcadf4..5e0b0075e98f 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -106,7 +106,7 @@
#include <svl/intitem.hxx>
#include <unotools/moduleoptions.hxx>
#include <svtools/svlbitm.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svx/algitem.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <svx/databaseregistrationui.hxx>
diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx
index 0e884a82f0a1..56b19f2eefa3 100644
--- a/dbaccess/source/ui/control/listviewitems.cxx
+++ b/dbaccess/source/ui/control/listviewitems.cxx
@@ -28,7 +28,7 @@ namespace dbaui
// class OBoldListboxString
//========================================================================
//------------------------------------------------------------------------
- void OBoldListboxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData)
+ void OBoldListboxString::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData)
{
SvLBoxString::InitViewData( pView, pEntry, _pViewData );
if ( !m_bEmphasized )
@@ -50,7 +50,7 @@ namespace dbaui
}
//------------------------------------------------------------------------
- void OBoldListboxString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
+ void OBoldListboxString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
{
if (m_bEmphasized)
{
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index af4f3e332b94..323d819ef61d 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/sdb/SQLContext.hpp>
#include <vcl/fixed.hxx>
#include <osl/diagnose.h>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/svmedit.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/sqlerror.hxx>
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index 1bec9757ed0d..890f69887e6e 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -19,7 +19,7 @@
#ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
#define DBAUI_TABLEWINDOWLISTBOX_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "callbacks.hxx"
struct AcceptDropEvent;
diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx
index 7ef0cd1a328c..f5948baee4cd 100644
--- a/dbaccess/source/ui/inc/dbtreelistbox.hxx
+++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx
@@ -24,7 +24,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/timer.hxx>
#include <set>
diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx
index 1a0ab7e7709a..61ae42971402 100644
--- a/dbaccess/source/ui/inc/indexdialog.hxx
+++ b/dbaccess/source/ui/inc/indexdialog.hxx
@@ -29,7 +29,7 @@
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <vcl/toolbox.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <unotools/viewoptions.hxx>
#include "indexes.hxx"
#include "ToolBoxHelper.hxx"
diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx
index 6fb05f0a1a20..99aca2095a40 100644
--- a/dbaccess/source/ui/inc/listviewitems.hxx
+++ b/dbaccess/source/ui/inc/listviewitems.hxx
@@ -45,8 +45,8 @@ namespace dbaui
virtual sal_uInt16 IsA();
- virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
- virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData);
+ virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData);
sal_Bool isEmphasized() const { return m_bEmphasized; }
void emphasize(sal_Bool _bEmphasize) { m_bEmphasized = _bEmphasize; }
diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx
index 12db88750880..adda68952197 100644
--- a/dbaccess/source/ui/inc/marktree.hxx
+++ b/dbaccess/source/ui/inc/marktree.hxx
@@ -22,6 +22,7 @@
#include "dbtreelistbox.hxx"
+#include "svtools/svlbitm.hxx"
//.........................................................................
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 569a7a7caed0..b68b329a3162 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -335,10 +335,10 @@ public:
{
}
- virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
//------------------------------------------------------------------------
-void OColumnString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
+void OColumnString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
{
if(m_bReadOnly)
{
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index e22463347c1d..0b6a8df76fde 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -93,7 +93,7 @@
#include "sal/types.h"
#include "salhelper/thread.hxx"
#include "svtools/svlbitm.hxx"
-#include "svtools/svlbox.hxx"
+#include "svtools/treelistbox.hxx"
#include <svtools/controldims.hrc>
#include "svx/checklbx.hxx"
#include "tools/gen.hxx"
diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx
index 3c62009187fa..314b7c43daed 100644
--- a/extensions/source/propctrlr/selectlabeldialog.hxx
+++ b/extensions/source/propctrlr/selectlabeldialog.hxx
@@ -21,7 +21,7 @@
#define _EXTENSIONS_PROPCTRLR_SELECTLABELDIALOG_HXX_
#include <vcl/fixed.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/button.hxx>
#include <vcl/image.hxx>
#include <vcl/dialog.hxx>
diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx
index 3bc732aef62b..6e3d96925757 100644
--- a/extensions/source/propctrlr/taborder.hxx
+++ b/extensions/source/propctrlr/taborder.hxx
@@ -20,7 +20,7 @@
#ifndef EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HXX
#define EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/awt/XTabControllerModel.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index e1aae9e2f247..8b8f93fca198 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -35,7 +35,7 @@
#include <vcl/group.hxx>
#include <vcl/field.hxx>
#include <vcl/edit.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sane.hxx>
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 26473c01f8cb..03f41dc6b914 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -30,7 +30,7 @@
#include <svtools/stdctrl.hxx>
#include <svtools/svmedit.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svl/stritem.hxx>
#include <svl/zforlist.hxx>
#include <svl/eitem.hxx>
diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx
index 031617137d09..bcd59f3c11ec 100644
--- a/formula/source/ui/dlg/funcpage.hxx
+++ b/formula/source/ui/dlg/funcpage.hxx
@@ -28,7 +28,7 @@
#include <vcl/tabctrl.hxx>
#include <vcl/button.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <boost/shared_ptr.hpp>
#include <vector>
diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx
index 38a4b8616455..151c57e1c088 100644
--- a/formula/source/ui/dlg/structpg.hxx
+++ b/formula/source/ui/dlg/structpg.hxx
@@ -26,7 +26,7 @@
#include <svtools/svmedit.hxx>
#include <vcl/tabpage.hxx>
#include <vcl/tabctrl.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "formula/IFunctionDescription.hxx"
#include "formula/omoduleclient.hxx"
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index 26baf9fe5077..28b7604c6950 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -40,7 +40,7 @@
#include <comphelper/types.hxx>
#include "cppuhelper/basemutex.hxx"
#include "comphelper/SelectionMultiplex.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svl/solar.hrc>
#include "ReportVisitor.hxx"
#include "ModuleHelper.hxx"
diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx
index 81198a25c4ef..bcbb8446364a 100644
--- a/reportdesign/source/ui/inc/AddField.hxx
+++ b/reportdesign/source/ui/inc/AddField.hxx
@@ -27,7 +27,7 @@
#include <svtools/transfer.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/transfer.hxx>
#include <vcl/floatwin.hxx>
#include <comphelper/propmultiplex.hxx>
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index e5cdf92bfb43..b96919261207 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -32,7 +32,7 @@
#include <sfx2/objsh.hxx>
#include <svl/zforlist.hxx>
#include <svl/stritem.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sfx2/viewfrm.hxx>
#include <vcl/svapp.hxx>
#include <vcl/mnemonic.hxx>
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index c0451d673d85..f6f757fc783f 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -29,7 +29,7 @@
#ifndef SC_CONTENT_HXX
#define SC_CONTENT_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "global.hxx"
#include "address.hxx"
#include <tools/solar.h>
diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx
index bcfa2dc068c9..f3e7c51a23d5 100644
--- a/sc/source/ui/inc/funcpage.hxx
+++ b/sc/source/ui/inc/funcpage.hxx
@@ -30,7 +30,7 @@
#include <vcl/tabctrl.hxx>
#include "parawin.hxx"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "compiler.hxx"
#include "cell.hxx"
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 90f3e28e08b2..4465052cbb9f 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -85,10 +85,10 @@ public:
void SetDoubleValue( double fNew ) { mbIsDouble = true; mfDoubleValue = fNew; }
void SetIntValue( sal_Int32 nNew ) { mbIsDouble = false; mnIntValue = nNew; }
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
};
-void ScSolverOptionsString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* /* pEntry */ )
+void ScSolverOptionsString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* /* pEntry */ )
{
//! move position? (SvxLinguTabPage: aPos.X() += 20)
String aNormalStr( GetText() );
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 86bc5454203a..1eac9d3a68fc 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -39,6 +39,7 @@
#include <vcl/svapp.hxx>
#include <tools/urlobj.hxx>
#include <svl/urlbmk.hxx>
+#include "svtools/svlbitm.hxx"
#include <stdlib.h>
#include "content.hxx"
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 69bd2a8c3332..c4df06a4c1a6 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -42,10 +42,10 @@ public:
OptionString(const rtl::OUString& rDesc, const rtl::OUString& rValue) :
maDesc(rDesc), maValue(rValue) {}
- virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
-void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/)
+void OptionString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/)
{
Point aPos = rPos;
rtl::OUString aDesc = maDesc + rtl::OUString(": ");
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f4e317e10317..3899b2db861a 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -42,7 +42,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/docfile.hxx>
#include <svl/stritem.hxx>
-#include <svtools/svlbox.hxx>
#include <svtools/svtabbx.hxx>
#include <svl/urlbmk.hxx>
#include <vcl/cursor.hxx>
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 55393d8ab8fb..a9378697ab37 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -45,6 +45,8 @@
#include <vcl/svapp.hxx>
#include "sdresid.hxx"
+#include "svtools/svlbitm.hxx"
+
#include "res_bmp.hrc"
#include "glob.hrc"
@@ -210,8 +212,8 @@ class CustomAnimationListEntryItem : public SvLBoxString
public:
CustomAnimationListEntryItem( SvLBoxEntry*,sal_uInt16 nFlags, OUString aDescription, CustomAnimationEffectPtr pEffect, CustomAnimationList* pParent );
virtual ~CustomAnimationListEntryItem();
- void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
+ void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
+ void Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
@@ -239,7 +241,7 @@ CustomAnimationListEntryItem::~CustomAnimationListEntryItem()
// --------------------------------------------------------------------
-void CustomAnimationListEntryItem::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
+void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
{
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
@@ -252,7 +254,7 @@ void CustomAnimationListEntryItem::InitViewData( SvLBox* pView, SvLBoxEntry* pEn
// --------------------------------------------------------------------
-void CustomAnimationListEntryItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
+void CustomAnimationListEntryItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
{
SvViewDataItem* pViewData = mpParent->GetViewDataItem( pEntry, this );
@@ -361,8 +363,8 @@ public:
CustomAnimationTriggerEntryItem( SvLBoxEntry*,sal_uInt16 nFlags, OUString aDescription );
virtual ~CustomAnimationTriggerEntryItem();
virtual sal_uInt16 IsA();
- void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
+ void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
+ void Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
@@ -392,7 +394,7 @@ sal_uInt16 CustomAnimationTriggerEntryItem::IsA()
// --------------------------------------------------------------------
-void CustomAnimationTriggerEntryItem::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
+void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
{
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
@@ -405,7 +407,7 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvLBox* pView, SvLBoxEntry*
// --------------------------------------------------------------------
-void CustomAnimationTriggerEntryItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* )
+void CustomAnimationTriggerEntryItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* )
{
Size aSize( rDev.GetOutputSizePixel().Width(), static_cast< SvTreeListBox* >(&rDev)->GetEntryHeight() );
diff --git a/sd/source/ui/animations/CustomAnimationList.hxx b/sd/source/ui/animations/CustomAnimationList.hxx
index 914e29e685d7..693d6e3422dc 100644
--- a/sd/source/ui/animations/CustomAnimationList.hxx
+++ b/sd/source/ui/animations/CustomAnimationList.hxx
@@ -30,7 +30,7 @@
#define _SD_CUSTOMANIMATIONLIST_HXX
#include <com/sun/star/drawing/XShape.hpp>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <CustomAnimationEffect.hxx>
#include "CustomAnimationPreset.hxx"
#include "CustomAnimation.hrc"
diff --git a/sd/source/ui/dlg/RemoteDialog.hxx b/sd/source/ui/dlg/RemoteDialog.hxx
index 3ef7de15d53d..bc4831bd4ab6 100644
--- a/sd/source/ui/dlg/RemoteDialog.hxx
+++ b/sd/source/ui/dlg/RemoteDialog.hxx
@@ -14,7 +14,7 @@
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/field.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "RemoteDialogClientBox.hxx"
diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx
index 321605ee59d2..c5dcc2c70a30 100644
--- a/sd/source/ui/dlg/dlgassim.cxx
+++ b/sd/source/ui/dlg/dlgassim.cxx
@@ -38,6 +38,7 @@
#include "res_bmp.hrc"
#include <vcl/svapp.hxx>
+#include "svtools/svlbitm.hxx"
#include "dlgassim.hxx"
diff --git a/sd/source/ui/dlg/dlgassim.hxx b/sd/source/ui/dlg/dlgassim.hxx
index aec9c1d8ce31..f6f9b792bf35 100644
--- a/sd/source/ui/dlg/dlgassim.hxx
+++ b/sd/source/ui/dlg/dlgassim.hxx
@@ -29,7 +29,7 @@
#include <svl/dateitem.hxx>
#include "drawdoc.hxx"
#include <svx/svdotext.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "sdresid.hxx"
diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx
index 774497664932..a176707e9912 100644
--- a/sd/source/ui/inc/custsdlg.hxx
+++ b/sd/source/ui/inc/custsdlg.hxx
@@ -34,7 +34,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/dialog.hxx>
class SdDrawDocument;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 63ac738498e5..21d89c9a6705 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -35,7 +35,7 @@
#include "pres.hxx"
#include "sddllapi.h"
#include <tools/string.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svl/urlbmk.hxx>
#include <tools/ref.hxx>
#include "sdxfer.hxx"
@@ -223,7 +223,7 @@ public:
sal_Bool IsLinkableSelected() const { return mbLinkableSelected; }
static sal_Bool IsInDrag();
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::ExecuteDrop;
using SvTreeListBox::SelectEntry;
private:
diff --git a/sfx2/inc/docvor.hxx b/sfx2/inc/docvor.hxx
index 86e6d189b10e..4bdc1c7c6622 100644
--- a/sfx2/inc/docvor.hxx
+++ b/sfx2/inc/docvor.hxx
@@ -21,7 +21,7 @@
#include <vcl/dialog.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sfx2/objsh.hxx>
#include "orgmgr.hxx"
@@ -68,7 +68,7 @@ protected:
virtual long ExpandingHdl();
virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::ExecuteDrop;
// new d&d
virtual DragDropMode NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* );
virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* );
@@ -97,13 +97,13 @@ public:
private:
sal_Bool IsStandard_Impl( SvLBoxEntry *) const;
- sal_Bool MoveOrCopyTemplates(SvLBox *pSourceBox,
+ sal_Bool MoveOrCopyTemplates(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
sal_uIntPtr &rIdx,
sal_Bool bCopy);
- sal_Bool MoveOrCopyContents(SvLBox *pSourceBox,
+ sal_Bool MoveOrCopyContents(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 6b60bb8cf8bf..74d73a32194c 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -40,7 +40,7 @@ namespace com { namespace sun { namespace star { namespace text { class XTextRan
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/dialog.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <unotools/moduleoptions.hxx>
#include "srchdlg.hxx"
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index df3a812d358c..e501569efdad 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -442,7 +442,7 @@ public:
void SetDoubleClickHdl(const Link &rLink) { aDoubleClickLink = rLink; }
void SetDropHdl(const Link &rLink) { aDropLink = rLink; }
- using SvLBox::GetParent;
+ using SvTreeListBox::GetParent;
const String& GetParent() const { return aParent; }
const String& GetStyle() const { return aStyle; }
void MakeExpanded_Impl(ExpandedEntries_t& rEntries) const;
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 2c28cd354b81..e976a393316b 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -114,7 +114,7 @@ friend class SfxOrganizeListBox_Impl;
Printer* pPrt;
// save pointer for asynchronous D&D
- SvLBox* pSourceView;
+ SvTreeListBox* pSourceView;
SvLBoxEntry* pTargetEntry;
SfxOrganizeListBox_Impl* pFinishedBox;
sal_Int8 nDropAction;
@@ -391,7 +391,7 @@ class Path
{
ImpPath_Impl *pData;
public:
- Path(SvLBox *pBox, SvLBoxEntry *pEntry);
+ Path(SvTreeListBox *pBox, SvLBoxEntry *pEntry);
Path(const Path &rPath):
pData(rPath.pData)
{
@@ -422,7 +422,7 @@ public:
//-------------------------------------------------------------------------
-Path::Path(SvLBox *pBox, SvLBoxEntry *pEntry) :
+Path::Path(SvTreeListBox *pBox, SvLBoxEntry *pEntry) :
pData(new ImpPath_Impl)
{
DBG_ASSERT(pEntry != 0, "EntryPtr ist NULL");
@@ -441,7 +441,7 @@ Path::Path(SvLBox *pBox, SvLBoxEntry *pEntry) :
//-------------------------------------------------------------------------
-SvLBoxEntry *GetIndices_Impl(SvLBox *pBox,
+SvLBoxEntry *GetIndices_Impl(SvTreeListBox *pBox,
SvLBoxEntry *pEntry,
sal_uInt16 &rRegion,
sal_uInt16 &rOffset)
@@ -451,7 +451,7 @@ SvLBoxEntry *GetIndices_Impl(SvLBox *pBox,
[Parameter]
- SvLBox *pBox Listbox where the event occurred
+ SvTreeListBox *pBox Listbox where the event occurred
SvLBoxEntry *pEntry Entry whose position is to be determined
sal_uInt16 &rRegion the region within the region of the
document template (Out-Parameter)
@@ -504,7 +504,7 @@ sal_Bool SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, sal_Bool bSelect
//-------------------------------------------------------------------------
-sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -516,7 +516,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
[Parameter]
- SvLBox *pSourceBox Source Listbox, at which the event occurred
+ SvTreeListBox *pSourceBox Source Listbox, at which the event occurred
SvLBoxEntry* pTarget Target entry, to where it will be moved
SvLBoxEntry *pSource Source entry, to be copied / moved
SvLBoxEntry *&pNewParent the parent of the target position generated
@@ -529,7 +529,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
[Cross-references]
- <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -577,7 +577,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
rIdx = 0;
}
else
- SvLBox::NotifyCopying(
+ SvTreeListBox::NotifyCopying(
pTarget, pSource, pNewParent, rIdx);
}
}
@@ -595,7 +595,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
//-------------------------------------------------------------------------
-sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -607,7 +607,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
[Parameter]
- SvLBox *pSourceBox Source Listbox, at which the event occurred
+ SvTreeListBox *pSourceBox Source Listbox, at which the event occurred
SvLBoxEntry* pTarget Target entry, to where it will be moved
SvLBoxEntry *pSource Source entry, to be copied / moved
SvLBoxEntry *&pNewParent the parent of the target position generated
@@ -620,7 +620,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
[Cross-references]
- <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -769,13 +769,13 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
[Cross-references]
- <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
sal_uIntPtr &rIdx,
sal_Bool bCopy)>
- <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -789,7 +789,7 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
{
sal_Bool bOk = sal_False;
- SvLBox* pSourceBox = GetSourceView();
+ SvTreeListBox* pSourceBox = GetSourceView();
if ( !pSourceBox )
pSourceBox = pDlg->pSourceView;
DBG_ASSERT( pSourceBox, "no source view" );
@@ -828,13 +828,13 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
[Cross-references]
- <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
sal_uIntPtr &rIdx,
sal_Bool bCopy)>
- <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox,
SvLBoxEntry *pSource,
SvLBoxEntry* pTarget,
SvLBoxEntry *&pNewParent,
@@ -847,7 +847,7 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
*/
{
sal_Bool bOk = sal_False;
- SvLBox* pSourceBox = GetSourceView();
+ SvTreeListBox* pSourceBox = GetSourceView();
if ( !pSourceBox )
pSourceBox = pDlg->pSourceView;
DBG_ASSERT( pSourceBox, "no source view" );
@@ -963,7 +963,7 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyAcceptDrop( SvLBoxEntry* pEntry )
{
if(!pEntry)
return sal_False;
- SvLBox *pSource = GetSourceView();
+ SvTreeListBox *pSource = GetSourceView();
SvLBoxEntry *pSourceEntry = pSource->FirstSelected();
if(pEntry == pSourceEntry)
return sal_False;
@@ -1203,11 +1203,11 @@ long SfxOrganizeListBox_Impl::ExpandingHdl()
else
pMgr->DeleteObjectShell(aPath[0], aPath[1]);
// Delete all SubEntries
- SvLBoxEntry *pToDel = SvLBox::GetEntry(pEntry, 0);
+ SvLBoxEntry *pToDel = SvTreeListBox::GetEntry(pEntry, 0);
while(pToDel)
{
GetModel()->Remove(pToDel);
- pToDel = SvLBox::GetEntry(pEntry, 0);
+ pToDel = SvTreeListBox::GetEntry(pEntry, 0);
}
}
}
@@ -1333,7 +1333,7 @@ IMPL_LINK( SfxOrganizeListBox_Impl, OnAsyncExecuteDrop, ExecuteDropEvent*, pEven
DBG_ASSERT( pEvent, "invalid DropEvent" );
if ( pEvent )
{
- SvLBox* pSourceView = GetSourceView();
+ SvTreeListBox* pSourceView = GetSourceView();
if ( !pSourceView )
pSourceView = pDlg->pSourceView;
pDlg->bExecDropFinished = false;
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 0cc98f327bf4..12fe31533776 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -25,7 +25,7 @@ class SfxTemplateControllerItem;
#include <vcl/toolbox.hxx>
#include <vcl/lstbox.hxx>
#include <svl/lstner.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svl/eitem.hxx>
#include <rsc/rscsfx.hxx>
@@ -68,7 +68,7 @@ public:
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::ExecuteDrop;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
sal_uInt16 GetModifier() const { return nModifier; }
diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx
index e224d55b2242..a2d686206ec6 100644
--- a/sfx2/source/view/orgmgr.cxx
+++ b/sfx2/source/view/orgmgr.cxx
@@ -467,7 +467,7 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
{
// deleting of a group
- SvLBoxEntry *pGroupToDelete = pCaller->SvLBox::GetEntry(nRegion);
+ SvLBoxEntry *pGroupToDelete = pCaller->GetEntry(nRegion);
if ( pGroupToDelete )
{
sal_uInt16 nItemNum = (sal_uInt16)( pCaller->GetModel()->GetChildCount( pGroupToDelete ) );
@@ -481,7 +481,7 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
if ( pTemplates->Delete( nRegion, nInd ) )
{
bModified = 1;
- pEntriesToDelete.push_back( pCaller->SvLBox::GetEntry( pGroupToDelete, nInd ) );
+ pEntriesToDelete.push_back( pCaller->GetEntry( pGroupToDelete, nInd ) );
}
}
@@ -504,7 +504,7 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
{
bModified = 1;
// Entry to be deleted.
- SvLBoxEntry *pEntryToDelete = pCaller->SvLBox::GetEntry(pCaller->SvLBox::GetEntry(nRegion), nIdx);
+ SvLBoxEntry *pEntryToDelete = pCaller->GetEntry(pCaller->GetEntry(nRegion), nIdx);
pCaller->GetModel()->Remove(pEntryToDelete);
}
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index d78caa23be90..89d3f184a4f9 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -101,11 +101,10 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/ivctrl \
svtools/source/contnr/svimpbox \
svtools/source/contnr/svlbitm \
- svtools/source/contnr/svlbox \
svtools/source/contnr/svtabbx \
- svtools/source/contnr/svtreebx \
svtools/source/contnr/templwin \
svtools/source/contnr/treelist \
+ svtools/source/contnr/treelistbox \
svtools/source/control/asynclink \
svtools/source/control/calendar \
svtools/source/control/collatorres \
diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk
index d06053c0f0ec..c1ed7e1ad6fa 100644
--- a/svtools/Package_inc.mk
+++ b/svtools/Package_inc.mk
@@ -138,7 +138,7 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdctrl.hxx,svtools/st
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdmenu.hxx,svtools/stdmenu.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stringtransfer.hxx,svtools/stringtransfer.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbitm.hxx,svtools/svlbitm.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbox.hxx,svtools/svlbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/treelistbox.hxx,svtools/treelistbox.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svmedit.hxx,svtools/svmedit.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svmedit2.hxx,svtools/svmedit2.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svparser.hxx,svtools/svparser.hxx))
@@ -146,7 +146,6 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtabbx.hxx,svtools/sv
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtresid.hxx,svtools/svtresid.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtdllapi.h,svtools/svtdllapi.h))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtools.hrc,svtools/svtools.hrc))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtreebx.hxx,svtools/svtreebx.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/syntaxhighlight.hxx,svtools/syntaxhighlight.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/tabbar.hxx,svtools/tabbar.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablecontrolinterface.hxx,svtools/table/tablecontrolinterface.hxx))
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index 727a0a5ce5c4..6bca37e7f492 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -35,16 +35,10 @@
#include <tools/link.hxx>
#include <vcl/image.hxx>
-#include <svtools/svlbox.hxx>
+#include <svtools/treelistbox.hxx>
class SvLBoxEntry;
-#define SV_ITEM_ID_LBOXSTRING 1
-#define SV_ITEM_ID_LBOXBMP 2
-#define SV_ITEM_ID_LBOXBUTTON 3
-#define SV_ITEM_ID_LBOXCONTEXTBMP 4
-
-enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE };
#define SV_BMP_UNCHECKED 0
#define SV_BMP_CHECKED 1
@@ -129,10 +123,10 @@ public:
SvLBoxString();
virtual ~SvLBoxString();
virtual sal_uInt16 IsA();
- virtual void InitViewData(SvLBox*, SvLBoxEntry*, SvViewDataItem*);
+ virtual void InitViewData(SvTreeListBox*, SvLBoxEntry*, SvViewDataItem*);
rtl::OUString GetText() const { return maText; }
void SetText( const rtl::OUString& rText ) { maText = rText; }
- virtual void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
+ virtual void Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
virtual SvLBoxItem* Create() const;
virtual void Clone( SvLBoxItem* pSource );
};
@@ -144,8 +138,8 @@ public:
SvLBoxBmp();
virtual ~SvLBoxBmp();
virtual sal_uInt16 IsA();
- virtual void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- virtual void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
+ virtual void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
+ virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
virtual SvLBoxItem* Create() const;
virtual void Clone( SvLBoxItem* pSource );
};
@@ -157,13 +151,6 @@ public:
#define SV_ITEMSTATE_HILIGHTED 0x0008
#define SV_STATE_MASK 0xFFF8 // zum Loeschen von UNCHECKED,CHECKED,TRISTATE
-enum SvLBoxButtonKind
-{
- SvLBoxButtonKind_enabledCheckbox,
- SvLBoxButtonKind_disabledCheckbox,
- SvLBoxButtonKind_staticImage
-};
-
class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
{
SvLBoxButtonData* pData;
@@ -183,10 +170,10 @@ public:
SvLBoxButtonData* pBData );
SvLBoxButton();
virtual ~SvLBoxButton();
- virtual void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ virtual void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
virtual sal_uInt16 IsA();
- virtual sal_Bool ClickHdl(SvLBox* pView, SvLBoxEntry* );
- virtual void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
+ virtual sal_Bool ClickHdl(SvTreeListBox* pView, SvLBoxEntry* );
+ virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
virtual SvLBoxItem* Create() const;
virtual void Clone( SvLBoxItem* pSource );
sal_uInt16 GetButtonFlags() const { return nItemFlags; }
@@ -243,8 +230,8 @@ public:
SvLBoxContextBmp();
virtual ~SvLBoxContextBmp();
virtual sal_uInt16 IsA();
- virtual void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- virtual void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
+ virtual void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
+ virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
virtual SvLBoxItem* Create() const;
virtual void Clone( SvLBoxItem* pSource );
diff --git a/svtools/inc/svtools/svtabbx.hxx b/svtools/inc/svtools/svtabbx.hxx
index e4537d4d6cc8..ef9a2d1b1c3f 100644
--- a/svtools/inc/svtools/svtabbx.hxx
+++ b/svtools/inc/svtools/svtabbx.hxx
@@ -29,7 +29,7 @@
#define _SVTABBX_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/accessibletableprovider.hxx>
#include <vector>
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
deleted file mode 100644
index 02c223e6e44c..000000000000
--- a/svtools/inc/svtools/svtreebx.hxx
+++ /dev/null
@@ -1,403 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVTREEBOX_HXX
-#define _SVTREEBOX_HXX
-
-#include "svtools/svtdllapi.h"
-#include <svtools/svlbox.hxx>
-#include <svtools/svlbitm.hxx>
-
-// forward and defines ---------------------------------------------------
-
-class SvImpLBox;
-
-#define SV_TAB_BORDER 8
-
-#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
-#define SV_ENTRYHEIGHTOFFS_PIXEL 2
-
-#define TREEFLAG_CHKBTN 0x0001
-#define TREEFLAG_USESEL 0x0002
-#define TREEFLAG_MANINS 0x0004
-#define TREEFLAG_RECALCTABS 0x0008
-
-typedef sal_Int64 ExtendedWinBits;
-
-// disable the behavior of automatically selecting a "CurEntry" upon painting the control
-#define EWB_NO_AUTO_CURENTRY 0x00000001
-
-// class SvTreeListBox ---------------------------------------------------
-
-class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
-{
- friend class SvImpLBox;
- friend class ImpLBSelEng;
- friend class TreeControlPeer;
-
- SvImpLBox* pImp;
- Link aCheckButtonHdl;
- Link aScrolledHdl;
- Accelerator aInpEditAcc;
- Image aPrevInsertedExpBmp;
- Image aPrevInsertedColBmp;
- Image aCurInsertedExpBmp;
- Image aCurInsertedColBmp;
-
- short nContextBmpWidthMax;
- sal_uInt16 nFirstSelTab, nLastSelTab;
- short nEntryHeight;
- short nEntryHeightOffs;
- short nIndent;
- short nFocusWidth;
- sal_uInt16 aContextBmpMode;
-
- long mnCheckboxItemWidth;
-
-#ifdef _SVTREEBX_CXX
- DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
-
- SVT_DLLPRIVATE short GetHeightOffset( const Image& rBmp, Size& rLogicSize);
- SVT_DLLPRIVATE short GetHeightOffset( const Font& rFont, Size& rLogicSize);
-
- SVT_DLLPRIVATE void SetEntryHeight( SvLBoxEntry* pEntry );
- SVT_DLLPRIVATE void AdjustEntryHeight( const Image& rBmp );
- SVT_DLLPRIVATE void AdjustEntryHeight( const Font& rFont );
-
- SVT_DLLPRIVATE void ImpEntryInserted( SvLBoxEntry* pEntry );
- SVT_DLLPRIVATE long PaintEntry1( SvLBoxEntry*, long nLine,
- sal_uInt16 nTabFlagMask=0xffff,
- sal_Bool bHasClipRegion=sal_False );
-
- SVT_DLLPRIVATE void InitTreeView();
- SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
- sal_uInt16 nEmptyWidth );
- SVT_DLLPRIVATE void ImplInitStyle();
-
-#endif
-
-protected:
- SvLBoxButtonData* pCheckButtonData;
- sal_uInt16 nTreeFlags;
-
- SvLBoxEntry* pEdEntry;
- SvLBoxItem* pEdItem;
-
- void EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
- const Selection& );
- void EditedText( const XubString& );
- void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
- const Point& rMousePos );
-
- std::vector<SvLBoxTab*> aTabs;
-
- // berechnet abhaengig von TreeList-Style & Bitmap-Groessen
- // alle Tabulatoren neu; wird beim Einfuegen/Austauschen von
- // Bitmaps, beim Wechsel des Models usw. automatisch gerufen
- virtual void SetTabs();
- void SetTabs_Impl();
- void AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
- void* pUserData = 0 );
- sal_uInt16 TabCount() const { return aTabs.size(); }
- SvLBoxTab* GetFirstDynamicTab() const;
- SvLBoxTab* GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
- SvLBoxTab* GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
- SvLBoxTab* GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
- SvLBoxTab* GetTab( SvLBoxEntry*, SvLBoxItem* ) const;
- void ClearTabList();
-
- virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind);
-
- virtual void NotifyBeginScroll();
- virtual void NotifyEndScroll();
- // nLines == 0 => horizontales Scrolling
- virtual void NotifyScrolling( long nLines );
- virtual void NotifyScrolled();
- void SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
- const Link& GetScrolledHdl() const { return aScrolledHdl; }
- long GetXOffset() const { return GetMapMode().GetOrigin().X(); }
-
- // wird aufgerufen, _bevor_ Bereiche im Control invalidiert werden,
- // kann zum Hiden von Elementen benutzt werden, die von aussen
- // in das Control hineingezeichnet werden
- virtual void NotifyInvalidating();
-
- virtual sal_uLong GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
- virtual sal_uLong GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
- virtual void Command( const CommandEvent& rCEvt );
-
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void CursorMoved( SvLBoxEntry* pNewCursor );
- virtual void PreparePaint( SvLBoxEntry* );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void StateChanged( StateChangedType nStateChange );
-
- void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
- sal_Bool IsCellFocusEnabled() const;
- bool SetCurrentTabPos( sal_uInt16 _nNewPos );
- sal_uInt16 GetCurrentTabPos() const;
- void CallImplEventListeners(sal_uLong nEvent, void* pData);
-
- void ImplEditEntry( SvLBoxEntry* pEntry );
-
- sal_Bool AreChildrenTransient() const;
- void SetChildrenNotTransient();
-
-public:
- SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
- SvTreeListBox( Window* pParent, const ResId& rResId );
- ~SvTreeListBox();
-
- void SetExtendedWinBits( ExtendedWinBits _nBits );
-
- void DisconnectFromModel();
-
- void EnableCheckButton( SvLBoxButtonData* );
- void SetCheckButtonData( SvLBoxButtonData* );
- void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp );
-
- /** returns the default image which clients should use for expanded nodes, to have a consistent user
- interface experience in the whole product.
- */
- static const Image& GetDefaultExpandedNodeImage( );
-
- /** returns the default image which clients should use for expanded nodes, to have a consistent user
- interface experience in the whole product.
- */
- static const Image& GetDefaultCollapsedNodeImage( );
-
- /** sets default bitmaps for collapsed and expanded nodes.
- */
- inline void SetNodeDefaultImages( )
- {
- SetNodeBitmaps(
- GetDefaultCollapsedNodeImage( ),
- GetDefaultExpandedNodeImage( )
- );
- }
-
- virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
- sal_Bool bChildrenOnDemand = sal_False,
- sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
- SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
-
- virtual SvLBoxEntry* InsertEntry( const XubString& rText,
- const Image& rExpandedEntryBmp,
- const Image& rCollapsedEntryBmp,
- SvLBoxEntry* pParent = 0,
- sal_Bool bChildrenOnDemand = sal_False,
- sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
- SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
-
- const Image& GetDefaultExpandedEntryBmp( ) const;
- const Image& GetDefaultCollapsedEntryBmp( ) const;
-
- void SetDefaultExpandedEntryBmp( const Image& rBmp );
- void SetDefaultCollapsedEntryBmp( const Image& rBmp );
-
- void SetCheckButtonState( SvLBoxEntry*, SvButtonState );
- SvButtonState GetCheckButtonState( SvLBoxEntry* ) const;
-
- sal_Bool IsExpandBitmapOnCursor() const { return (sal_Bool)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
-
- void SetEntryText(SvLBoxEntry*, const XubString& );
- void SetExpandedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage );
- void SetCollapsedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage );
-
- virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
- String SearchEntryText( SvLBoxEntry* pEntry ) const;
- const Image& GetExpandedEntryBmp(SvLBoxEntry* _pEntry ) const;
- const Image& GetCollapsedEntryBmp(SvLBoxEntry* _pEntry ) const;
-
- void SetCheckButtonHdl( const Link& rLink ) { aCheckButtonHdl=rLink; }
- Link GetCheckButtonHdl() const { return aCheckButtonHdl; }
- virtual void CheckButtonHdl();
-
- virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
-
- virtual sal_uInt16 IsA();
-
- void SetSublistOpenWithReturn( sal_Bool bMode = sal_True ); // open/close sublist with return/enter
- void SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True ); // open/close sublist with cursor left/right
-
- void EnableInplaceEditing( sal_Bool bEnable );
- sal_Bool IsInplaceEditingEnabled() const { return SvLBox::IsInplaceEditingEnabled(); }
- inline void ForbidEmptyText() { SvLBox::ForbidEmptyText(); }
- // Editiert das erste StringItem des Entries, 0==Cursor
- void EditEntry( SvLBoxEntry* pEntry = NULL );
- virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
- virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText );
- sal_Bool IsEditingActive() const { return SvLBox::IsEditingActive(); }
- void EndEditing( sal_Bool bCancel = sal_False ) { SvLBox::EndEditing( bCancel ); }
- sal_Bool EditingCanceled() const { return SvLBox::EditingCanceled(); }
-
- virtual void RequestingChildren( SvLBoxEntry* pParent );
-
- virtual void Paint( const Rectangle& rRect );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void Resize();
- virtual void GetFocus();
- virtual void LoseFocus();
- void SetUpdateMode( sal_Bool );
-
- using SvListView::SetModel;
- void SetModel( SvLBoxTreeList* );
- virtual void ModelHasCleared();
- virtual void ModelHasInserted( SvListEntry* pEntry );
- virtual void ModelHasInsertedTree( SvListEntry* pEntry );
- virtual void ModelIsMoving(SvListEntry* pSource,
- SvListEntry* pTargetParent, sal_uLong nChildPos );
- virtual void ModelHasMoved(SvListEntry* pSource );
- virtual void ModelIsRemoving( SvListEntry* pEntry );
- virtual void ModelHasRemoved( SvListEntry* pEntry );
- virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
-
- void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
- using Window::GetDropTarget;
- SvLBoxEntry* GetDropTarget( const Point& );
- void ScrollOutputArea( short nDeltaEntries );
-
- short GetEntryHeight() const { return nEntryHeight; }
- void SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
- Size GetOutputSizePixel() const;
- short GetIndent() const { return nIndent; }
- void SetIndent( short nIndent );
- void SetSpaceBetweenEntries( short nSpace );
- short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
- Point GetEntryPosition( SvLBoxEntry* ) const;
- void ShowEntry( SvLBoxEntry* ); // !!!OBSOLETE, use MakeVisible
- virtual void MakeVisible( SvLBoxEntry* );
- void MakeVisible( SvLBoxEntry*, sal_Bool bMoveToTop );
-
- void SetCollapsedNodeBmp( const Image& );
- void SetExpandedNodeBmp( const Image& );
- Image GetExpandedNodeBmp( ) const;
-
- void SetFont( const Font& rFont );
-
- using Window::SetCursor;
- void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
-
- SvLBoxEntry* GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
- SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uLong nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
- SvLBoxEntry* GetEntry( sal_uLong nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
-
- void PaintEntry( SvLBoxEntry* );
- long PaintEntry( SvLBoxEntry*, long nLine,
- sal_uInt16 nTabFlagMask=0xffff );
- virtual Rectangle GetFocusRect( SvLBoxEntry*, long nLine );
- // Beruecksichtigt Einrueckung
- virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
- void InvalidateEntry( SvLBoxEntry* );
- SvLBoxItem* GetItem( SvLBoxEntry*, long nX, SvLBoxTab** ppTab);
- SvLBoxItem* GetItem( SvLBoxEntry*, long nX );
-
- void SetDragDropMode( DragDropMode );
- void SetSelectionMode( SelectionMode );
-
- virtual sal_Bool Expand( SvLBoxEntry* pParent );
- virtual sal_Bool Collapse( SvLBoxEntry* pParent );
- virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
- virtual sal_uLong SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect );
- virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
- virtual void SetCurEntry( SvLBoxEntry* _pEntry );
- virtual SvLBoxEntry*
- GetCurEntry() const;
-
- using Window::Invalidate;
- virtual void Invalidate( sal_uInt16 nFlags = 0);
- virtual void Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
-
- void SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
-
- virtual Region GetDragRegion() const;
-
- // Children des Parents werden Children des naechstoberen Parents
- void RemoveParentKeepChildren( SvLBoxEntry* pParent );
-
- DECL_LINK( DefaultCompare, SvSortData* );
- virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, sal_uLong nPos );
-
- void EndSelection();
- void RepaintScrollBars() const;
- ScrollBar* GetVScroll();
- ScrollBar* GetHScroll();
- void EnableAsyncDrag( sal_Bool b );
-
- SvLBoxEntry* GetFirstEntryInView() const;
- SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const;
- SvLBoxEntry* GetLastEntryInView() const;
- void ScrollToAbsPos( long nPos );
-
- void ShowFocusRect( const SvLBoxEntry* pEntry );
- void InitStartEntry();
-
- virtual PopupMenu* CreateContextMenu( void );
- virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
-
- void EnableContextMenuHandling( void );
- void EnableContextMenuHandling( sal_Bool bEnable );
- sal_Bool IsContextMenuHandlingEnabled( void ) const;
-
- void EnableList( bool _bEnable );
-
- // ACCESSIBILITY ==========================================================
-
- /** Creates and returns the accessible object of the Box. */
- virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible > CreateAccessible();
-
- /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
- virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
-
- /** Fills the StateSet of one entry. */
- virtual void FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
-
- /** Calculate and returns the bounding rectangle of an entry.
- @param pEntry
- The entry.
- @return The bounding rectangle of an entry. */
- virtual Rectangle GetBoundingRect( SvLBoxEntry* pEntry );
-
- /** Enables, that one cell of a tablistbox entry can be focused */
- void EnableCellFocus();
-
-protected:
- using SvListView::Expand;
- using SvListView::Collapse;
- using SvListView::Select;
- using SvListView::SelectAll;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/treelistbox.hxx
index b582806aa5d0..ced8c5c5f980 100644
--- a/svtools/inc/svtools/svlbox.hxx
+++ b/svtools/inc/svtools/treelistbox.hxx
@@ -26,8 +26,8 @@
*
************************************************************************/
-#ifndef _SVLBOX_HXX
-#define _SVLBOX_HXX
+#ifndef __SVTOOLS_TREELISTBOX_HXX__
+#define __SVTOOLS_TREELISTBOX_HXX__
#include "svtools/svtdllapi.h"
@@ -40,13 +40,14 @@
#include <vcl/accel.hxx>
#include <vcl/mnemonicengine.hxx>
#include <vcl/quickselectionengine.hxx>
+#include <vcl/image.hxx>
#include <tools/gen.hxx>
#include <tools/contnr.hxx>
#include <svtools/treelist.hxx>
#include <svtools/transfer.hxx>
class Application;
-class SvLBox;
+class SvTreeListBox;
class SvLBoxEntry;
class SvViewDataItem;
class SvViewDataEntry;
@@ -55,12 +56,23 @@ class SvLBoxString;
class SvLBoxButton;
class SvLBoxContextBmp;
class SvLBoxBmp;
+class SvImpLBox;
+class SvLBoxButtonData;
struct SvLBoxDDInfo;
namespace utl {
class AccessibleStateSetHelper;
}
+enum SvLBoxButtonKind
+{
+ SvLBoxButtonKind_enabledCheckbox,
+ SvLBoxButtonKind_disabledCheckbox,
+ SvLBoxButtonKind_staticImage
+};
+
+enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE };
+
// *********************************************************************
// *************************** Tabulatoren *****************************
// *********************************************************************
@@ -87,6 +99,26 @@ namespace utl {
// Tabs entspricht jetzt exakt den eingestellten Flags &
// Spaltenbreiten.
+#define SV_TAB_BORDER 8
+
+#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
+#define SV_ENTRYHEIGHTOFFS_PIXEL 2
+
+#define TREEFLAG_CHKBTN 0x0001
+#define TREEFLAG_USESEL 0x0002
+#define TREEFLAG_MANINS 0x0004
+#define TREEFLAG_RECALCTABS 0x0008
+
+typedef sal_Int64 ExtendedWinBits;
+
+// disable the behavior of automatically selecting a "CurEntry" upon painting the control
+#define EWB_NO_AUTO_CURENTRY 0x00000001
+
+#define SV_ITEM_ID_LBOXSTRING 1
+#define SV_ITEM_ID_LBOXBMP 2
+#define SV_ITEM_ID_LBOXBUTTON 3
+#define SV_ITEM_ID_LBOXCONTEXTBMP 4
+
class SvLBoxTab
{
long nPos;
@@ -123,7 +155,7 @@ public:
};
// View-abhaengige Daten fuer einen Entry werden in virtueller Fkt.
-// SvLBox::CreateViewData erzeugt. Die ViewDaten-Erzeugung von
+// SvTreeListBox::CreateViewData erzeugt. Die ViewDaten-Erzeugung von
// Items kann nicht veraendert werden (wg. Array)
class SvViewDataEntry : public SvViewData
{
@@ -146,18 +178,18 @@ public:
SvLBoxItem();
virtual ~SvLBoxItem();
virtual sal_uInt16 IsA() = 0;
- const Size& GetSize( SvLBox* pView, SvLBoxEntry* pEntry );
+ const Size& GetSize( SvTreeListBox* pView, SvLBoxEntry* pEntry );
const Size& GetSize( SvViewDataEntry* pData, sal_uInt16 nItemPos )
{
SvViewDataItem* pIData=pData->pItemData+nItemPos;
return pIData->aSize;
}
- virtual void Paint( const Point& rPos, SvLBox& rOutDev,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rOutDev,
sal_uInt16 nViewDataEntryFlags,
SvLBoxEntry* pEntry ) = 0;
- virtual void InitViewData( SvLBox* pView, SvLBoxEntry* pEntry,
+ virtual void InitViewData( SvTreeListBox* pView, SvLBoxEntry* pEntry,
// wenn != 0 muss dieser Pointer benutzt werden!
// wenn == 0 muss er ueber die View geholt werden
SvViewDataItem* pViewData = 0) = 0;
@@ -180,7 +212,7 @@ public:
class SVT_DLLPUBLIC SvLBoxEntry : public SvListEntry
{
- friend class SvLBox;
+ friend class SvTreeListBox;
std::vector<SvLBoxItem*> aItems;
void* pUserData;
@@ -234,7 +266,7 @@ public:
};
// *********************************************************************
-// ****************************** SvLBox *******************************
+// ****************************** SvTreeListBox *******************************
// *********************************************************************
#define WB_FORCE_SELECTION ((WinBits)0x8000)
@@ -250,7 +282,7 @@ public:
// Das Drop-Target ist in diesem Fall 0
#define SV_DRAGDROP_ENABLE_TOP (DragDropMode)0x0020
-#define SVLISTBOX_ID_LBOX 0 // fuer SvLBox::IsA()
+#define SVLISTBOX_ID_LBOX 0 // fuer SvTreeListBox::IsA()
#define SVLBOX_IN_EDT 0x0001
#define SVLBOX_EDT_ENABLED 0x0002
@@ -259,7 +291,7 @@ public:
#define SVLBOX_TARGEMPH_VIS 0x0010
#define SVLBOX_EDTEND_CALLED 0x0020
-class SvLBox;
+class SvTreeListBox;
struct SvLBox_Impl
{
bool m_bIsEmptyTextAllowed;
@@ -269,10 +301,10 @@ struct SvLBox_Impl
::vcl::MnemonicEngine m_aMnemonicEngine;
::vcl::QuickSelectionEngine m_aQuickSelectionEngine;
- SvLBox_Impl( SvLBox& _rBox );
+ SvLBox_Impl( SvTreeListBox& _rBox );
};
-class SVT_DLLPUBLIC SvLBox
+class SVT_DLLPUBLIC SvTreeListBox
:public Control
,public SvListView
,public DropTargetHelper
@@ -292,9 +324,9 @@ class SVT_DLLPUBLIC SvLBox
// call. AddBox method is called from the GetDragFinishedHdl() and the
// remove is called in link callback and in the destructor. So it can't
// called to a deleted object.
- SVT_DLLPRIVATE static void AddBoxToDDList_Impl( const SvLBox& rB );
- SVT_DLLPRIVATE static void RemoveBoxFromDDList_Impl( const SvLBox& rB );
- DECL_DLLPRIVATE_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8* );
+ SVT_DLLPRIVATE static void AddBoxToDDList_Impl( const SvTreeListBox& rB );
+ SVT_DLLPRIVATE static void RemoveBoxFromDDList_Impl( const SvTreeListBox& rB );
+ DECL_DLLPRIVATE_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8* );
DragDropMode nOldDragMode;
@@ -319,7 +351,7 @@ protected:
SelectionMode eSelMode;
sal_Int8 nDragOptions;
- sal_Bool CheckDragAndDropMode( SvLBox* pSource, sal_Int8 );
+ sal_Bool CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 );
void ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow);
void EnableSelectionAsDropTarget( sal_Bool bEnable = sal_True,
sal_Bool bWithChildren = sal_True );
@@ -335,28 +367,19 @@ protected:
virtual void ReadDragServerInfo( const Point&,SvLBoxDDInfo* );
// invalidate children on enable/disable
- virtual void StateChanged( StateChangedType );
+ virtual void StateChanged( StateChangedType eType );
virtual sal_uLong Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,sal_uLong nPos=LIST_APPEND);
virtual sal_uLong Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos = LIST_APPEND );
// Inplace-Editing
SvInplaceEdit2* pEdCtrl;
- void EnableInplaceEditing( sal_Bool bEnable){if(bEnable)nImpFlags|=SVLBOX_EDT_ENABLED; else nImpFlags&=~SVLBOX_EDT_ENABLED;}
- sal_Bool IsInplaceEditingEnabled() const { return (sal_Bool)((nImpFlags&SVLBOX_EDT_ENABLED)!=0); }
- virtual void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
- const Point& rMousePos );
void EditText( const String&, const Rectangle&,const Selection&);
void EditText( const String&, const Rectangle&,const Selection&, sal_Bool bMulti);
void EditTextMultiLine( const String&, const Rectangle&,const Selection&);
void CancelTextEditing();
- sal_Bool IsEditingActive() const { return (sal_Bool)((nImpFlags & SVLBOX_IN_EDT)!=0); }
sal_Bool EditingCanceled() const;
- void EndEditing( sal_Bool bCancel = sal_False );
bool IsEmptyTextAllowed() const;
- void ForbidEmptyText();
- // Callback EditText
- virtual void EditedText( const String& );
// Rueckgabewert muss von SvViewDataEntry abgeleitet sein!
virtual SvViewData* CreateViewData( SvListEntry* );
@@ -368,21 +391,16 @@ protected:
// Callback von RecalcViewData
virtual void ViewDataInitialized( SvLBoxEntry* );
- virtual void Command( const CommandEvent& rCEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual SvLBoxEntry* GetEntry( const Point& rPos, sal_Bool bHit=sal_False ) const;
- virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
-
// handler and methods for Drag - finished handler. This link can be set
// to the TransferDataContainer. The AddBox/RemoveBox methods must be
// called before the StartDrag call.
// The Remove will be called from the handler, which then called
- // DragFinish method. The Remove also called in the DTOR of the SvLBox -
+ // DragFinish method. The Remove also called in the DTOR of the SvTreeListBox -
// so it can't called to a deleted object.
Link GetDragFinishedHdl() const;
// for asynchronous D&D
- sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView );
+ sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox* pSourceView );
void OnCurrentEntryChanged();
@@ -399,16 +417,15 @@ protected:
public:
- SvLBox( Window* pParent, WinBits nWinStyle=0 );
- SvLBox( Window* pParent, const ResId& rResId );
- ~SvLBox();
+ SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
+ SvTreeListBox( Window* pParent, const ResId& rResId );
+ ~SvTreeListBox();
SvLBoxTreeList* GetModel() const { return (SvLBoxTreeList*)pModel; }
using SvListView::SetModel;
void SetModel( SvLBoxTreeList* );
- void DisconnectFromModel();
- virtual sal_uInt16 IsA();
+ sal_uInt16 IsA();
sal_uLong GetEntryCount() const {return pModel->GetEntryCount();}
SvLBoxEntry* First() const { return (SvLBoxEntry*)(pModel->First()); }
SvLBoxEntry* Next( SvLBoxEntry* pEntry, sal_uInt16* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Next(pEntry,pDepth));}
@@ -426,15 +443,13 @@ public:
SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); }
SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); }
- sal_Bool CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget );
- sal_Bool MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget );
- sal_Bool MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback );
+ sal_Bool CopySelection( SvTreeListBox* pSource, SvLBoxEntry* pTarget );
+ sal_Bool MoveSelection( SvTreeListBox* pSource, SvLBoxEntry* pTarget );
+ sal_Bool MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback );
void RemoveSelection();
DragDropMode GetDragDropMode() const { return nDragDropMode; }
- virtual void SetDragDropMode( DragDropMode );
SelectionMode GetSelectionMode() const { return eSelMode; }
- virtual void SetSelectionMode( SelectionMode );
// pParent==0 -> Root-Ebene
SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uLong nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); }
@@ -442,7 +457,6 @@ public:
SvLBoxEntry* GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
void FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
- virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
using Window::GetParent;
SvLBoxEntry* GetParent( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetParent(pEntry)); }
@@ -455,7 +469,11 @@ public:
SvViewDataEntry* GetViewDataEntry( SvListEntry* pEntry ) const { return (SvViewDataEntry*)SvListView::GetViewData(pEntry); }
SvViewDataItem* GetViewDataItem( SvListEntry*, SvLBoxItem* ) const;
- virtual void MakeVisible( SvLBoxEntry* pEntry );
+ bool IsInplaceEditingEnabled() const { return ((nImpFlags & SVLBOX_EDT_ENABLED) != 0); }
+ bool IsEditingActive() const { return ((nImpFlags & SVLBOX_IN_EDT) != 0); }
+ void EndEditing( bool bCancel = false );
+ void ForbidEmptyText();
+
void Clear();
/** enables or disables mnemonic characters in the entry texts.
@@ -493,16 +511,6 @@ public:
*/
bool HandleKeyInput( const KeyEvent& rKEvt );
- virtual sal_Bool Expand( SvLBoxEntry* pParent );
- virtual sal_Bool Collapse( SvLBoxEntry* pParent );
- virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
- virtual sal_uLong SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect );
- virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint=sal_True );
-
- virtual void SetCurEntry( SvLBoxEntry* _pEntry ) = 0;
- virtual SvLBoxEntry*
- GetCurEntry() const = 0;
-
void SetSelectHdl( const Link& rNewHdl ) {aSelectHdl=rNewHdl; }
void SetDeselectHdl( const Link& rNewHdl ) {aDeselectHdl=rNewHdl; }
void SetDoubleClickHdl(const Link& rNewHdl) {aDoubleClickHdl=rNewHdl;}
@@ -540,10 +548,9 @@ public:
void SetDragOptions( sal_Int8 nOptions ) { nDragOptions = nOptions; }
sal_Int8 GetDragOptions() const { return nDragOptions; }
- SvLBox* GetSourceView() const;
+ SvTreeListBox* GetSourceView() const;
virtual void NotifyRemoving( SvLBoxEntry* );
- virtual void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
virtual SvLBoxEntry* CreateEntry() const; // zum 'new'en von Entries
@@ -572,24 +579,322 @@ public:
/** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
+ /** Fills the StateSet of one entry. */
+ virtual void FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
/** Calculate and returns the bounding rectangle of an entry.
@param pEntry
The entry.
@return The bounding rectangle of an entry. */
virtual Rectangle GetBoundingRect( SvLBoxEntry* pEntry );
+ /** Enables, that one cell of a tablistbox entry can be focused */
+ void EnableCellFocus();
+
protected:
using SvListView::Expand;
using SvListView::Collapse;
using SvListView::Select;
using SvListView::SelectAll;
+
+// boundary ----- former SvTreeListBox ends here.
+
+ friend class SvImpLBox;
+ friend class ImpLBSelEng;
+ friend class TreeControlPeer;
+
+ SvImpLBox* pImp;
+ Link aCheckButtonHdl;
+ Link aScrolledHdl;
+ Accelerator aInpEditAcc;
+ Image aPrevInsertedExpBmp;
+ Image aPrevInsertedColBmp;
+ Image aCurInsertedExpBmp;
+ Image aCurInsertedColBmp;
+
+ short nContextBmpWidthMax;
+ sal_uInt16 nFirstSelTab, nLastSelTab;
+ short nEntryHeight;
+ short nEntryHeightOffs;
+ short nIndent;
+ short nFocusWidth;
+ sal_uInt16 aContextBmpMode;
+
+ long mnCheckboxItemWidth;
+
+ DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
+
+ SVT_DLLPRIVATE short GetHeightOffset( const Image& rBmp, Size& rLogicSize);
+ SVT_DLLPRIVATE short GetHeightOffset( const Font& rFont, Size& rLogicSize);
+
+ SVT_DLLPRIVATE void SetEntryHeight( SvLBoxEntry* pEntry );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Image& rBmp );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Font& rFont );
+
+ SVT_DLLPRIVATE void ImpEntryInserted( SvLBoxEntry* pEntry );
+ SVT_DLLPRIVATE long PaintEntry1( SvLBoxEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff,
+ sal_Bool bHasClipRegion=sal_False );
+
+ SVT_DLLPRIVATE void InitTreeView();
+ SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
+ sal_uInt16 nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
+protected:
+ SvLBoxButtonData* pCheckButtonData;
+ sal_uInt16 nTreeFlags;
+
+ SvLBoxEntry* pEdEntry;
+ SvLBoxItem* pEdItem;
+
+ void EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
+ const Selection& );
+ void EditedText( const XubString& );
+ void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Point& rMousePos );
+
+ std::vector<SvLBoxTab*> aTabs;
+
+ // berechnet abhaengig von TreeList-Style & Bitmap-Groessen
+ // alle Tabulatoren neu; wird beim Einfuegen/Austauschen von
+ // Bitmaps, beim Wechsel des Models usw. automatisch gerufen
+ virtual void SetTabs();
+ void SetTabs_Impl();
+ void AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
+ void* pUserData = 0 );
+ sal_uInt16 TabCount() const { return aTabs.size(); }
+ SvLBoxTab* GetFirstDynamicTab() const;
+ SvLBoxTab* GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
+ SvLBoxTab* GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetTab( SvLBoxEntry*, SvLBoxItem* ) const;
+ void ClearTabList();
+
+ virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind);
+
+ virtual void NotifyBeginScroll();
+ virtual void NotifyEndScroll();
+ // nLines == 0 => horizontales Scrolling
+ virtual void NotifyScrolling( long nLines );
+ virtual void NotifyScrolled();
+ void SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
+ const Link& GetScrolledHdl() const { return aScrolledHdl; }
+ long GetXOffset() const { return GetMapMode().GetOrigin().X(); }
+
+ // wird aufgerufen, _bevor_ Bereiche im Control invalidiert werden,
+ // kann zum Hiden von Elementen benutzt werden, die von aussen
+ // in das Control hineingezeichnet werden
+ virtual void NotifyInvalidating();
+
+ virtual sal_uLong GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual sal_uLong GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void CursorMoved( SvLBoxEntry* pNewCursor );
+ virtual void PreparePaint( SvLBoxEntry* );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
+ sal_Bool IsCellFocusEnabled() const;
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ sal_uInt16 GetCurrentTabPos() const;
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
+
+ void ImplEditEntry( SvLBoxEntry* pEntry );
+
+ sal_Bool AreChildrenTransient() const;
+ void SetChildrenNotTransient();
+
+public:
+
+ void SetExtendedWinBits( ExtendedWinBits _nBits );
+
+ void DisconnectFromModel();
+
+ void EnableCheckButton( SvLBoxButtonData* );
+ void SetCheckButtonData( SvLBoxButtonData* );
+ void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp );
+
+ /** returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultExpandedNodeImage( );
+
+ /** returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultCollapsedNodeImage( );
+
+ /** sets default bitmaps for collapsed and expanded nodes.
+ */
+ inline void SetNodeDefaultImages( )
+ {
+ SetNodeBitmaps(
+ GetDefaultCollapsedNodeImage( ),
+ GetDefaultExpandedNodeImage( )
+ );
+ }
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ const Image& GetDefaultExpandedEntryBmp( ) const;
+ const Image& GetDefaultCollapsedEntryBmp( ) const;
+
+ void SetDefaultExpandedEntryBmp( const Image& rBmp );
+ void SetDefaultCollapsedEntryBmp( const Image& rBmp );
+
+ void SetCheckButtonState( SvLBoxEntry*, SvButtonState );
+ SvButtonState GetCheckButtonState( SvLBoxEntry* ) const;
+
+ sal_Bool IsExpandBitmapOnCursor() const { return (sal_Bool)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
+
+ void SetEntryText(SvLBoxEntry*, const XubString& );
+ void SetExpandedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage );
+ void SetCollapsedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage );
+
+ virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
+ String SearchEntryText( SvLBoxEntry* pEntry ) const;
+ const Image& GetExpandedEntryBmp(SvLBoxEntry* _pEntry ) const;
+ const Image& GetCollapsedEntryBmp(SvLBoxEntry* _pEntry ) const;
+
+ void SetCheckButtonHdl( const Link& rLink ) { aCheckButtonHdl=rLink; }
+ Link GetCheckButtonHdl() const { return aCheckButtonHdl; }
+ virtual void CheckButtonHdl();
+
+ void SetSublistOpenWithReturn( sal_Bool bMode = sal_True ); // open/close sublist with return/enter
+ void SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True ); // open/close sublist with cursor left/right
+
+ void EnableInplaceEditing( bool bEnable );
+ // Editiert das erste StringItem des Entries, 0==Cursor
+ void EditEntry( SvLBoxEntry* pEntry = NULL );
+ virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ void SetUpdateMode( sal_Bool );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvListEntry* pEntry );
+ virtual void ModelIsMoving(SvListEntry* pSource,
+ SvListEntry* pTargetParent, sal_uLong nChildPos );
+ virtual void ModelHasMoved(SvListEntry* pSource );
+ virtual void ModelIsRemoving( SvListEntry* pEntry );
+ virtual void ModelHasRemoved( SvListEntry* pEntry );
+ void ModelHasEntryInvalidated( SvListEntry* pEntry );
+
+ void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
+ void ScrollOutputArea( short nDeltaEntries );
+
+ short GetEntryHeight() const { return nEntryHeight; }
+ void SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
+ Size GetOutputSizePixel() const;
+ short GetIndent() const { return nIndent; }
+ void SetIndent( short nIndent );
+ void SetSpaceBetweenEntries( short nSpace );
+ short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
+ Point GetEntryPosition( SvLBoxEntry* ) const;
+ void ShowEntry( SvLBoxEntry* ); // !!!OBSOLETE, use MakeVisible
+ void MakeVisible( SvLBoxEntry* pEntry );
+ void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop );
+
+ void SetCollapsedNodeBmp( const Image& );
+ void SetExpandedNodeBmp( const Image& );
+ Image GetExpandedNodeBmp( ) const;
+
+ void SetFont( const Font& rFont );
+
+ using Window::SetCursor;
+ void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
+
+ SvLBoxEntry* GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
+
+ void PaintEntry( SvLBoxEntry* );
+ long PaintEntry( SvLBoxEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff );
+ virtual Rectangle GetFocusRect( SvLBoxEntry*, long nLine );
+ // Beruecksichtigt Einrueckung
+ virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
+ void InvalidateEntry( SvLBoxEntry* );
+ SvLBoxItem* GetItem( SvLBoxEntry*, long nX, SvLBoxTab** ppTab);
+ SvLBoxItem* GetItem( SvLBoxEntry*, long nX );
+
+ void SetDragDropMode( DragDropMode );
+ void SetSelectionMode( SelectionMode );
+
+ sal_Bool Expand( SvLBoxEntry* pParent );
+ sal_Bool Collapse( SvLBoxEntry* pParent );
+ sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
+ sal_uLong SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+
+ void SetCurEntry( SvLBoxEntry* _pEntry );
+ SvLBoxEntry* GetCurEntry() const;
+
+ using Window::Invalidate;
+ virtual void Invalidate( sal_uInt16 nFlags = 0);
+ virtual void Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
+
+ void SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
+
+ virtual Region GetDragRegion() const;
+
+ // Children des Parents werden Children des naechstoberen Parents
+ void RemoveParentKeepChildren( SvLBoxEntry* pParent );
+
+ DECL_LINK( DefaultCompare, SvSortData* );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos );
+
+ void EndSelection();
+ void RepaintScrollBars() const;
+ ScrollBar* GetVScroll();
+ ScrollBar* GetHScroll();
+ void EnableAsyncDrag( sal_Bool b );
+
+ SvLBoxEntry* GetFirstEntryInView() const;
+ SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const;
+ SvLBoxEntry* GetLastEntryInView() const;
+ void ScrollToAbsPos( long nPos );
+
+ void ShowFocusRect( const SvLBoxEntry* pEntry );
+ void InitStartEntry();
+
+ virtual PopupMenu* CreateContextMenu( void );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
+
+ void EnableContextMenuHandling( void );
+ void EnableContextMenuHandling( sal_Bool bEnable );
+ sal_Bool IsContextMenuHandlingEnabled( void ) const;
+
+ void EnableList( bool _bEnable );
};
#define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT"
struct SvLBoxDDInfo
{
Application* pApp;
- SvLBox* pSource;
+ SvTreeListBox* pSource;
SvLBoxEntry* pDDStartEntry;
// relative Position im Eintrag bei Drag-Beginn (IconView)
long nMouseRelX,nMouseRelY;
@@ -625,7 +930,7 @@ public:
void Hide();
};
-inline SvViewDataItem* SvLBox::GetViewDataItem( SvListEntry* pEntry,
+inline SvViewDataItem* SvTreeListBox::GetViewDataItem( SvListEntry* pEntry,
SvLBoxItem* pItem) const
{
SvViewDataEntry* pEntryData =
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 6149811e00c5..a2b230604088 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -32,9 +32,9 @@
#include <stack>
-#define _SVTREEBX_CXX
-#include <svtools/svtreebx.hxx>
-#include <svtools/svlbox.hxx>
+#include <svtools/treelistbox.hxx>
+#include <svtools/treelistbox.hxx>
+#include <svtools/svlbitm.hxx>
#include <svimpbox.hxx>
#include <rtl/instance.hxx>
#include <svtools/svtresid.hxx>
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 17d3c9804901..0d3e4e8b7085 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -26,7 +26,7 @@
*
************************************************************************/
-#include <svtools/svlbox.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/svlbitm.hxx>
#include <vcl/svapp.hxx>
#include <vcl/button.hxx>
@@ -219,7 +219,7 @@ sal_uInt16 SvLBoxString::IsA()
return SV_ITEM_ID_LBOXSTRING;
}
-void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
+void SvLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* _pEntry)
{
DBG_CHKTHIS(SvLBoxString,0);
@@ -247,8 +247,8 @@ void SvLBoxString::Clone( SvLBoxItem* pSource )
maText = ((SvLBoxString*)pSource)->maText;
}
-void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
- SvViewDataItem* pViewData)
+void SvLBoxString::InitViewData(
+ SvTreeListBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
{
DBG_CHKTHIS(SvLBoxString,0);
if( !pViewData )
@@ -278,7 +278,7 @@ sal_uInt16 SvLBoxBmp::IsA()
return SV_ITEM_ID_LBOXBMP;
}
-void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+void SvLBoxBmp::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData)
{
DBG_CHKTHIS(SvLBoxBmp,0);
@@ -287,7 +287,7 @@ void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
pViewData->aSize = aBmp.GetSizePixel();
}
-void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
+void SvLBoxBmp::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBoxBmp,0);
@@ -344,7 +344,7 @@ sal_uInt16 SvLBoxButton::IsA()
return SV_ITEM_ID_LBOXBUTTON;
}
-sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
+sal_Bool SvLBoxButton::ClickHdl( SvTreeListBox*, SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvLBoxButton,0);
if ( CheckModification() )
@@ -359,7 +359,7 @@ sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
return sal_False;
}
-void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
+void SvLBoxButton::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
@@ -444,7 +444,7 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Windo
}
}
-void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+void SvLBoxButton::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
@@ -527,7 +527,7 @@ Image& SvLBoxContextBmp::implGetImageStore( sal_Bool _bFirst )
return _bFirst ? m_pImpl->m_aImage1 : m_pImpl->m_aImage2;
}
-void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+void SvLBoxContextBmp::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData)
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
@@ -536,7 +536,7 @@ void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
pViewData->aSize = m_pImpl->m_aImage1.GetSizePixel();
}
-void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
+void SvLBoxContextBmp::Paint( const Point& _rPos, SvTreeListBox& _rDev,
sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
deleted file mode 100644
index a16e72328471..000000000000
--- a/svtools/source/contnr/svlbox.cxx
+++ /dev/null
@@ -1,1794 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-/*
- TODO:
- - delete anchor in SelectionEngine when selecting manually
- - SelectAll( sal_False ) => only repaint the delselected entries
-*/
-
-#include <string.h>
-#include <svtools/svlbox.hxx>
-#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#include <vcl/svapp.hxx>
-#include <vcl/accel.hxx>
-#include <vcl/i18nhelp.hxx>
-#include <sot/formats.hxx>
-#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/instance.hxx>
-
-#include <svtools/svmedit.hxx>
-#include <svtools/svlbitm.hxx>
-
-#include <set>
-
-using namespace ::com::sun::star::accessibility;
-
-// Drag&Drop
-static SvLBox* pDDSource = NULL;
-static SvLBox* pDDTarget = NULL;
-
-DBG_NAME(SvInplaceEdit2)
-
-#define SVLBOX_ACC_RETURN 1
-#define SVLBOX_ACC_ESCAPE 2
-
-// ***************************************************************
-
-class MyEdit_Impl : public Edit
-{
- SvInplaceEdit2* pOwner;
-public:
- MyEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void LoseFocus();
-};
-
-class MyMultiEdit_Impl : public MultiLineEdit
-{
- SvInplaceEdit2* pOwner;
-public:
- MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void LoseFocus();
-};
-
-MyEdit_Impl::MyEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner ) :
-
- Edit( pParent, WB_LEFT ),
-
- pOwner( _pOwner )
-
-{
-}
-
-void MyEdit_Impl::KeyInput( const KeyEvent& rKEvt )
-{
- if( !pOwner->KeyInput( rKEvt ))
- Edit::KeyInput( rKEvt );
-}
-
-void MyEdit_Impl::LoseFocus()
-{
- pOwner->LoseFocus();
-}
-
-MyMultiEdit_Impl::MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner )
- : MultiLineEdit( pParent,
- WB_CENTER
- ), pOwner(_pOwner)
-{
-}
-
-void MyMultiEdit_Impl::KeyInput( const KeyEvent& rKEvt )
-{
- if( !pOwner->KeyInput( rKEvt ))
- MultiLineEdit::KeyInput( rKEvt );
-}
-
-void MyMultiEdit_Impl::LoseFocus()
-{
- pOwner->LoseFocus();
-}
-
-
-SvInplaceEdit2::SvInplaceEdit2
-(
- Window* pParent, const Point& rPos,
- const Size& rSize,
- const String& rData,
- const Link& rNotifyEditEnd,
- const Selection& rSelection,
- sal_Bool bMulti
-) :
-
- aCallBackHdl ( rNotifyEditEnd ),
- bCanceled ( sal_False ),
- bAlreadyInCallBack ( sal_False )
-
-{
- DBG_CTOR(SvInplaceEdit2,0);
-
- if( bMulti )
- pEdit = new MyMultiEdit_Impl( pParent, this );
- else
- pEdit = new MyEdit_Impl( pParent, this );
-
- Font aFont( pParent->GetFont() );
- aFont.SetTransparent( sal_False );
- Color aColor( pParent->GetBackground().GetColor() );
- aFont.SetFillColor(aColor );
- pEdit->SetFont( aFont );
- pEdit->SetBackground( pParent->GetBackground() );
- pEdit->SetPosPixel( rPos );
- pEdit->SetSizePixel( rSize );
- pEdit->SetText( rData );
- pEdit->SetSelection( rSelection );
- pEdit->SaveValue();
-
- aAccReturn.InsertItem( SVLBOX_ACC_RETURN, KeyCode(KEY_RETURN) );
- aAccEscape.InsertItem( SVLBOX_ACC_ESCAPE, KeyCode(KEY_ESCAPE) );
-
- aAccReturn.SetActivateHdl( LINK( this, SvInplaceEdit2, ReturnHdl_Impl) );
- aAccEscape.SetActivateHdl( LINK( this, SvInplaceEdit2, EscapeHdl_Impl) );
- GetpApp()->InsertAccel( &aAccReturn );
- GetpApp()->InsertAccel( &aAccEscape );
-
- pEdit->Show();
- pEdit->GrabFocus();
-}
-
-SvInplaceEdit2::~SvInplaceEdit2()
-{
- DBG_DTOR(SvInplaceEdit2,0);
- if( !bAlreadyInCallBack )
- {
- GetpApp()->RemoveAccel( &aAccReturn );
- GetpApp()->RemoveAccel( &aAccEscape );
- }
- delete pEdit;
-}
-
-String SvInplaceEdit2::GetSavedValue() const
-{
- return pEdit->GetSavedValue();
-}
-
-void SvInplaceEdit2::Hide()
-{
- pEdit->Hide();
-}
-
-
-IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, ReturnHdl_Impl)
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = sal_False;
- CallCallBackHdl_Impl();
- return 1;
-}
-IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, ReturnHdl_Impl)
-
-IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, EscapeHdl_Impl)
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = sal_True;
- CallCallBackHdl_Impl();
- return 1;
-}
-IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, EscapeHdl_Impl)
-
-
-sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- KeyCode aCode = rKEvt.GetKeyCode();
- sal_uInt16 nCode = aCode.GetCode();
-
- switch ( nCode )
- {
- case KEY_ESCAPE:
- bCanceled = sal_True;
- CallCallBackHdl_Impl();
- return sal_True;
-
- case KEY_RETURN:
- bCanceled = sal_False;
- CallCallBackHdl_Impl();
- return sal_True;
- }
- return sal_False;
-}
-
-void SvInplaceEdit2::StopEditing( sal_Bool bCancel )
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- if ( !bAlreadyInCallBack )
- {
- bCanceled = bCancel;
- CallCallBackHdl_Impl();
- }
-}
-
-void SvInplaceEdit2::LoseFocus()
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- if ( !bAlreadyInCallBack
- && ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
- )
- {
- bCanceled = sal_False;
- aTimer.SetTimeout(10);
- aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl));
- aTimer.Start();
- }
-}
-
-IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, Timeout_Impl)
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- CallCallBackHdl_Impl();
- return 0;
-}
-IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, Timeout_Impl)
-
-void SvInplaceEdit2::CallCallBackHdl_Impl()
-{
- DBG_CHKTHIS(SvInplaceEdit2,0);
- aTimer.Stop();
- if ( !bAlreadyInCallBack )
- {
- bAlreadyInCallBack = sal_True;
- GetpApp()->RemoveAccel( &aAccReturn );
- GetpApp()->RemoveAccel( &aAccEscape );
- pEdit->Hide();
- aCallBackHdl.Call( this );
- }
-}
-
-String SvInplaceEdit2::GetText() const
-{
- return pEdit->GetText();
-}
-
-// ***************************************************************
-// class SvLBoxTab
-// ***************************************************************
-
-DBG_NAME(SvLBoxTab);
-
-SvLBoxTab::SvLBoxTab()
-{
- DBG_CTOR(SvLBoxTab,0);
- nPos = 0;
- pUserData = 0;
- nFlags = 0;
-}
-
-SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags )
-{
- DBG_CTOR(SvLBoxTab,0);
- nPos = nPosition;
- pUserData = 0;
- nFlags = nTabFlags;
-}
-
-SvLBoxTab::SvLBoxTab( const SvLBoxTab& rTab )
-{
- DBG_CTOR(SvLBoxTab,0);
- nPos = rTab.nPos;
- pUserData = rTab.pUserData;
- nFlags = rTab.nFlags;
-}
-
-SvLBoxTab::~SvLBoxTab()
-{
- DBG_DTOR(SvLBoxTab,0);
-}
-
-
-long SvLBoxTab::CalcOffset( long nItemWidth, long nTabWidth )
-{
- DBG_CHKTHIS(SvLBoxTab,0);
- long nOffset = 0;
- if ( nFlags & SV_LBOXTAB_ADJUST_RIGHT )
- {
- nOffset = nTabWidth - nItemWidth;
- if( nOffset < 0 )
- nOffset = 0;
- }
- else if ( nFlags & SV_LBOXTAB_ADJUST_CENTER )
- {
- if( nFlags & SV_LBOXTAB_FORCE )
- {
- // correct implementation of centering
- nOffset = ( nTabWidth - nItemWidth ) / 2;
- if( nOffset < 0 )
- nOffset = 0;
- }
- else
- {
- // historically grown, wrong calculation of tabs which is needed by
- // Abo-Tabbox, Tools/Options/Customize etc.
- nItemWidth++;
- nOffset = -( nItemWidth / 2 );
- }
- }
- return nOffset;
-}
-
-// ***************************************************************
-// class SvLBoxItem
-// ***************************************************************
-
-DBG_NAME(SvLBoxItem);
-
-SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 )
-{
- DBG_CTOR(SvLBoxItem,0);
-}
-
-SvLBoxItem::SvLBoxItem()
-{
- DBG_CTOR(SvLBoxItem,0);
-}
-
-SvLBoxItem::~SvLBoxItem()
-{
- DBG_DTOR(SvLBoxItem,0);
-}
-
-const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry )
-{
- DBG_CHKTHIS(SvLBoxItem,0);
- SvViewDataItem* pViewData = pView->GetViewDataItem( pEntry, this );
- return pViewData->aSize;
-}
-
-DBG_NAME(SvViewDataItem);
-
-SvViewDataItem::SvViewDataItem()
-{
- DBG_CTOR(SvViewDataItem,0);
-}
-
-SvViewDataItem::~SvViewDataItem()
-{
- DBG_DTOR(SvViewDataItem,0);
-}
-
-
-
-// ***************************************************************
-// class SvLBoxEntry
-// ***************************************************************
-
-DBG_NAME(SvLBoxEntry);
-
-SvLBoxEntry::SvLBoxEntry() : aItems()
-{
- DBG_CTOR(SvLBoxEntry,0);
- nEntryFlags = 0;
- pUserData = 0;
-}
-
-SvLBoxEntry::~SvLBoxEntry()
-{
- DBG_DTOR(SvLBoxEntry,0);
- DeleteItems_Impl();
-}
-
-void SvLBoxEntry::DeleteItems_Impl()
-{
- DBG_CHKTHIS(SvLBoxEntry,0);
- sal_uInt16 nCount = aItems.size();
- while( nCount )
- {
- nCount--;
- SvLBoxItem* pItem = aItems[ nCount ];
- delete pItem;
- }
- aItems.clear();
-}
-
-
-void SvLBoxEntry::AddItem( SvLBoxItem* pItem )
-{
- DBG_CHKTHIS(SvLBoxEntry,0);
- aItems.push_back( pItem );
-}
-
-void SvLBoxEntry::Clone( SvListEntry* pSource )
-{
- DBG_CHKTHIS(SvLBoxEntry,0);
- SvListEntry::Clone( pSource );
- SvLBoxItem* pNewItem;
- DeleteItems_Impl();
- sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount();
- sal_uInt16 nCurPos = 0;
- while( nCurPos < nCount )
- {
- SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos );
- pNewItem = pItem->Create();
- pNewItem->Clone( pItem );
- AddItem( pNewItem );
- nCurPos++;
- }
- pUserData = ((SvLBoxEntry*)pSource)->GetUserData();
- nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags;
-}
-
-void SvLBoxEntry::EnableChildrenOnDemand( sal_Bool bEnable )
-{
- DBG_CHKTHIS(SvLBoxEntry,0);
- if ( bEnable )
- nEntryFlags |= SV_ENTRYFLAG_CHILDREN_ON_DEMAND;
- else
- nEntryFlags &= (~SV_ENTRYFLAG_CHILDREN_ON_DEMAND);
-}
-
-void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos )
-{
- DBG_CHKTHIS(SvLBoxEntry,0);
- DBG_ASSERT(pNewItem,"ReplaceItem:No Item");
- SvLBoxItem* pOld = GetItem( nPos );
- if ( pOld )
- {
- aItems[ nPos ] = pNewItem;
- delete pOld;
- }
-}
-
-SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId )
-{
- sal_uInt16 nCount = aItems.size();
- sal_uInt16 nCur = 0;
- SvLBoxItem* pItem;
- while( nCur < nCount )
- {
- pItem = GetItem( nCur );
- if( pItem->IsA() == nId )
- return pItem;
- nCur++;
- }
- return 0;
-}
-
-SvLBoxEntry* SvLBoxTreeList::First() const
-{
- return (SvLBoxEntry*)SvTreeList::First();
-}
-
-SvLBoxEntry* SvLBoxTreeList::Next( SvListEntry* pEntry, sal_uInt16* pDepth ) const
-{
- return (SvLBoxEntry*)SvTreeList::Next(pEntry,pDepth);
-}
-
-SvLBoxEntry* SvLBoxTreeList::Prev( SvListEntry* pEntry, sal_uInt16* pDepth ) const
-{
- return (SvLBoxEntry*)SvTreeList::Prev(pEntry,pDepth);
-}
-
-SvLBoxEntry* SvLBoxTreeList::Last() const
-{
- return (SvLBoxEntry*)SvTreeList::Last();
-}
-
-SvLBoxEntry* SvLBoxTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const
-{
- return (SvLBoxEntry*)SvTreeList::Clone(pEntry,nCloneCount);
-}
-
-SvLBoxEntry* SvLBoxTreeList::GetEntry( SvListEntry* pParent, sal_uLong nPos ) const
-{
- return (SvLBoxEntry*)SvTreeList::GetEntry(pParent,nPos);
-}
-
-SvLBoxEntry* SvLBoxTreeList::GetEntry( sal_uLong nRootPos ) const
-{
- return (SvLBoxEntry*)SvTreeList::GetEntry(nRootPos);
-}
-
-SvLBoxEntry* SvLBoxTreeList::GetParent( SvListEntry* pEntry ) const
-{
- return (SvLBoxEntry*)SvTreeList::GetParent(pEntry);
-}
-
-SvLBoxEntry* SvLBoxTreeList::FirstChild( SvLBoxEntry* pParent ) const
-{
- return (SvLBoxEntry*)SvTreeList::FirstChild(pParent);
-}
-
-SvLBoxEntry* SvLBoxTreeList::NextSibling( SvLBoxEntry* pEntry ) const
-{
- return (SvLBoxEntry*)SvTreeList::NextSibling(pEntry);
-}
-
-SvLBoxEntry* SvLBoxTreeList::PrevSibling( SvLBoxEntry* pEntry ) const
-{
- return (SvLBoxEntry*)SvTreeList::PrevSibling(pEntry);
-}
-
-SvLBoxEntry* SvLBoxTreeList::LastSibling( SvLBoxEntry* pEntry ) const
-{
- return (SvLBoxEntry*)SvTreeList::LastSibling(pEntry);
-}
-
-SvLBoxEntry* SvLBoxTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
-{
- return (SvLBoxEntry*)SvTreeList::GetEntryAtAbsPos( nAbsPos);
-}
-
-// ***************************************************************
-// class SvLBoxViewData
-// ***************************************************************
-
-DBG_NAME(SvViewDataEntry);
-
-SvViewDataEntry::SvViewDataEntry()
- : SvViewData()
-{
- DBG_CTOR(SvViewDataEntry,0);
- pItemData = 0;
-}
-
-SvViewDataEntry::~SvViewDataEntry()
-{
- DBG_DTOR(SvViewDataEntry,0);
- delete [] pItemData;
-}
-
-// ***************************************************************
-// struct SvLBox_Impl
-// ***************************************************************
-SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
- :m_bIsEmptyTextAllowed( true )
- ,m_bEntryMnemonicsEnabled( false )
- ,m_bDoingQuickSelection( false )
- ,m_pLink( NULL )
- ,m_aMnemonicEngine( _rBox )
- ,m_aQuickSelectionEngine( _rBox )
-{
-}
-
-// ***************************************************************
-// class SvLBox
-// ***************************************************************
-
-DBG_NAME(SvLBox);
-
-SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, nWinStyle | WB_CLIPCHILDREN ),
- DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
-{
- DBG_CTOR(SvLBox,0);
- nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
- nImpFlags = 0;
- pTargetEntry = 0;
- nDragDropMode = 0;
- pLBoxImpl = new SvLBox_Impl( *this );
- SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
- pTempModel->SetRefCount( 0 );
- SetModel( pTempModel );
- pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
- pModel->InsertView( this );
- pHdlEntry = 0;
- pEdCtrl = 0;
- SetSelectionMode( SINGLE_SELECTION ); // check if TreeListBox is called
- SetDragDropMode( SV_DRAGDROP_NONE );
- SetType(WINDOW_TREELISTBOX);
-}
-
-SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
- Control( pParent, rResId ),
- DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
-{
- DBG_CTOR(SvLBox,0);
- pTargetEntry = 0;
- nImpFlags = 0;
- pLBoxImpl = new SvLBox_Impl( *this );
- nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
- nDragDropMode = 0;
- SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
- pTempModel->SetRefCount( 0 );
- SetModel( pTempModel );
- pModel->InsertView( this );
- pHdlEntry = 0;
- pEdCtrl = 0;
- pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
- SetType(WINDOW_TREELISTBOX);
-}
-
-SvLBox::~SvLBox()
-{
- DBG_DTOR(SvLBox,0);
- delete pEdCtrl;
- pEdCtrl = 0;
- pModel->RemoveView( this );
- if ( pModel->GetRefCount() == 0 )
- {
- pModel->Clear();
- delete pModel;
- pModel = NULL;
- }
-
- SvLBox::RemoveBoxFromDDList_Impl( *this );
-
- if( this == pDDSource )
- pDDSource = 0;
- if( this == pDDTarget )
- pDDTarget = 0;
- delete pLBoxImpl;
-}
-
-void SvLBox::SetModel( SvLBoxTreeList* pNewModel )
-{
- DBG_CHKTHIS(SvLBox,0);
- // does the CleanUp
- SvListView::SetModel( pNewModel );
- pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
- SvLBoxEntry* pEntry = First();
- while( pEntry )
- {
- ModelHasInserted( pEntry );
- pEntry = Next( pEntry );
- }
-}
-
-void SvLBox::DisconnectFromModel()
-{
- DBG_CHKTHIS(SvLBox,0);
- SvLBoxTreeList* pNewModel = new SvLBoxTreeList;
- pNewModel->SetRefCount( 0 ); // else this will never be deleted
- SvListView::SetModel( pNewModel );
-}
-
-void SvLBox::Clear()
-{
- DBG_CHKTHIS(SvLBox,0);
- pModel->Clear(); // Model calls SvLBox::ModelHasCleared()
-}
-
-void SvLBox::EnableEntryMnemonics( bool _bEnable )
-{
- if ( _bEnable == IsEntryMnemonicsEnabled() )
- return;
-
- pLBoxImpl->m_bEntryMnemonicsEnabled = _bEnable;
- Invalidate();
-}
-
-bool SvLBox::IsEntryMnemonicsEnabled() const
-{
- return pLBoxImpl->m_bEntryMnemonicsEnabled;
-}
-
-sal_uInt16 SvLBox::IsA()
-{
- DBG_CHKTHIS(SvLBox,0);
- return SVLISTBOX_ID_LBOX;
-}
-
-IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
-{
- DBG_CHKTHIS(SvLBox,0);
- return (long)(CloneEntry((SvLBoxEntry*)pEntry));
-}
-IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
-
-sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uLong nPos )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos );
- return nInsPos;
-}
-
-sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos );
- return nInsPos;
-}
-
-long SvLBox::ExpandingHdl()
-{
- DBG_CHKTHIS(SvLBox,0);
- return aExpandingHdl.IsSet() ? aExpandingHdl.Call( this ) : 1;
-}
-
-void SvLBox::ExpandedHdl()
-{
- DBG_CHKTHIS(SvLBox,0);
- aExpandedHdl.Call( this );
-}
-
-void SvLBox::SelectHdl()
-{
- DBG_CHKTHIS(SvLBox,0);
- aSelectHdl.Call( this );
-}
-
-void SvLBox::DeselectHdl()
-{
- DBG_CHKTHIS(SvLBox,0);
- aDeselectHdl.Call( this );
-}
-
-sal_Bool SvLBox::DoubleClickHdl()
-{
- DBG_CHKTHIS(SvLBox,0);
- aDoubleClickHdl.Call( this );
- return sal_True;
-}
-
-
-sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction )
-{
- DBG_CHKTHIS(SvLBox,0);
- if ( pSource == this )
- {
- if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
- return sal_False; // D&D locked within list
- if( DND_ACTION_MOVE == nAction )
- {
- if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
- return sal_False; // no local move
- }
- else
- {
- if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
- return sal_False; // no local copy
- }
- }
- else
- {
- if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
- return sal_False; // no drop
- if ( DND_ACTION_MOVE == nAction )
- {
- if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
- return sal_False; // no global move
- }
- else
- {
- if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
- return sal_False; // no global copy
- }
- }
- return sal_True;
-}
-
-
-
-
-void SvLBox::NotifyRemoving( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-/*
- NotifyMoving/Copying
- ====================
-
- default behavior:
-
- 1. target doesn't have children
- - entry becomes sibling of target. entry comes after target
- (->Window: below the target)
- 2. target is an expanded parent
- - entry inserted at the beginning of the target childlist
- 3. target is a collapsed parent
- - entry is inserted at the end of the target childlist
-*/
-#ifdef DBG_UTIL
-sal_Bool SvLBox::NotifyMoving(
- SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
- SvLBoxEntry* pEntry, // entry that we want to move, from
- // GetSourceListBox()->GetModel()
- SvLBoxEntry*& rpNewParent, // new target parent
- sal_uLong& rNewChildPos) // position in childlist of target parent
-#else
-sal_Bool SvLBox::NotifyMoving(
- SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
- SvLBoxEntry*, // entry that we want to move, from
- // GetSourceListBox()->GetModel()
- SvLBoxEntry*& rpNewParent, // new target parent
- sal_uLong& rNewChildPos) // position in childlist of target parent
-#endif
-{
- DBG_CHKTHIS(SvLBox,0);
- DBG_ASSERT(pEntry,"NotifyMoving:SoureEntry?");
- if( !pTarget )
- {
- rpNewParent = 0;
- rNewChildPos = 0;
- return sal_True;
- }
- if ( !pTarget->HasChildren() && !pTarget->HasChildrenOnDemand() )
- {
- // case 1
- rpNewParent = GetParent( pTarget );
- rNewChildPos = pModel->GetRelPos( pTarget ) + 1;
- rNewChildPos += nCurEntrySelPos;
- nCurEntrySelPos++;
- }
- else
- {
- // cases 2 & 3
- rpNewParent = pTarget;
- if( IsExpanded(pTarget))
- rNewChildPos = 0;
- else
- rNewChildPos = LIST_APPEND;
- }
- return sal_True;
-}
-
-sal_Bool SvLBox::NotifyCopying(
- SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
- SvLBoxEntry* pEntry, // entry that we want to move, from
- // GetSourceListBox()->GetModel()
- SvLBoxEntry*& rpNewParent, // new target parent
- sal_uLong& rNewChildPos) // position in childlist of target parent
-{
- DBG_CHKTHIS(SvLBox,0);
- return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
-}
-
-SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource )
-{
- DBG_CHKTHIS(SvLBox,0);
- SvLBoxEntry* pEntry = (SvLBoxEntry*)CreateEntry(); // new SvLBoxEntry;
- pEntry->Clone( (SvListEntry*)pSource );
- return pEntry;
-}
-
-
-// return: all entries copied
-sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
-{
- DBG_CHKTHIS(SvLBox,0);
- nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
- sal_Bool bSuccess = sal_True;
- SvTreeEntryList aList;
- sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
- Link aCloneLink( pModel->GetCloneLink() );
- pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
-
- // cache selection to simplify iterating over the selection when doing a D&D
- // exchange within the same listbox
- SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
- while ( pSourceEntry )
- {
- // children are copied automatically
- pSource->SelectChildren( pSourceEntry, sal_False );
- aList.push_back( pSourceEntry );
- pSourceEntry = pSource->NextSelected( pSourceEntry );
- }
-
- SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
- for (; it != itEnd; ++it)
- {
- pSourceEntry = static_cast<SvLBoxEntry*>(*it);
- SvLBoxEntry* pNewParent = 0;
- sal_uLong nInsertionPos = ULONG_MAX;
- sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
- if ( bOk )
- {
- if ( bClone )
- {
- sal_uLong nCloneCount = 0;
- pSourceEntry = (SvLBoxEntry*)
- pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
- pModel->InsertTree( (SvListEntry*)pSourceEntry,
- (SvListEntry*)pNewParent, nInsertionPos );
- }
- else
- {
- sal_uLong nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
- (SvListEntry*)pNewParent, nInsertionPos );
- pSourceEntry = GetEntry( pNewParent, nListPos );
- }
- }
- else
- bSuccess = sal_False;
-
- if( bOk == (sal_Bool)2 ) // HACK: make visible moved entry?
- MakeVisible( pSourceEntry );
- }
- pModel->SetCloneLink( aCloneLink );
- return bSuccess;
-}
-
-// return: all entries were moved
-sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
-{
- return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False );
-}
-
-sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
-{
- DBG_CHKTHIS(SvLBox,0);
- nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
- sal_Bool bSuccess = sal_True;
- SvTreeEntryList aList;
- sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
- Link aCloneLink( pModel->GetCloneLink() );
- if ( bClone )
- pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
-
- SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
- while ( pSourceEntry )
- {
- // children are automatically moved
- pSource->SelectChildren( pSourceEntry, sal_False );
- aList.push_back( pSourceEntry );
- pSourceEntry = pSource->NextSelected( pSourceEntry );
- }
-
- SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
- for (; it != itEnd; ++it)
- {
- pSourceEntry = static_cast<SvLBoxEntry*>(*it);
-
- SvLBoxEntry* pNewParent = 0;
- sal_uLong nInsertionPos = ULONG_MAX;
- sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
- sal_Bool bCopyOk = bOk;
- if ( !bOk && bAllowCopyFallback )
- {
- nInsertionPos = LIST_APPEND;
- bCopyOk = NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
- }
-
- if ( bOk || bCopyOk )
- {
- if ( bClone )
- {
- sal_uLong nCloneCount = 0;
- pSourceEntry = (SvLBoxEntry*)
- pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
- pModel->InsertTree( (SvListEntry*)pSourceEntry,
- (SvListEntry*)pNewParent, nInsertionPos );
- }
- else
- {
- if ( bOk )
- pModel->Move( (SvListEntry*)pSourceEntry,
- (SvListEntry*)pNewParent, nInsertionPos );
- else
- pModel->Copy( (SvListEntry*)pSourceEntry,
- (SvListEntry*)pNewParent, nInsertionPos );
- }
- }
- else
- bSuccess = sal_False;
-
- if( bOk == (sal_Bool)2 ) // HACK: make moved entry visible?
- MakeVisible( pSourceEntry );
- }
- pModel->SetCloneLink( aCloneLink );
- return bSuccess;
-}
-
-void SvLBox::RemoveSelection()
-{
- DBG_CHKTHIS(SvLBox,0);
- SvTreeEntryList aList;
- // cache selection, as the implementation deselects everything on the first
- // remove
- SvLBoxEntry* pEntry = FirstSelected();
- while ( pEntry )
- {
- aList.push_back( pEntry );
- if ( pEntry->HasChildren() )
- // remove deletes all children automatically
- SelectChildren( pEntry, sal_False );
- pEntry = NextSelected( pEntry );
- }
-
- SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
- for (; it != itEnd; ++it)
- {
- pEntry = static_cast<SvLBoxEntry*>(*it);
- pModel->Remove(pEntry);
- }
-}
-
-SvLBox* SvLBox::GetSourceView() const
-{
- return pDDSource;
-}
-
-void SvLBox::RequestingChildren( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- OSL_FAIL("Child-Request-Hdl not implemented!");
-}
-
-void SvLBox::RecalcViewData()
-{
- DBG_CHKTHIS(SvLBox,0);
- SvLBoxEntry* pEntry = First();
- while( pEntry )
- {
- sal_uInt16 nCount = pEntry->ItemCount();
- sal_uInt16 nCurPos = 0;
- while ( nCurPos < nCount )
- {
- SvLBoxItem* pItem = pEntry->GetItem( nCurPos );
- pItem->InitViewData( this, pEntry );
- nCurPos++;
- }
- ViewDataInitialized( pEntry );
- pEntry = Next( pEntry );
- }
-}
-
-void SvLBox::ViewDataInitialized( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-void SvLBox::StateChanged( StateChangedType eType )
-{
- if( eType == STATE_CHANGE_ENABLE )
- Invalidate( INVALIDATE_CHILDREN );
- Control::StateChanged( eType );
-}
-
-void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow)
-{
- DBG_CHKTHIS(SvLBox,0);
- if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
- return;
- if ( !bShow && !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
- return;
- ShowTargetEmphasis( pEntry, bShow );
- if( bShow )
- nImpFlags |= SVLBOX_TARGEMPH_VIS;
- else
- nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
-}
-
-void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, sal_Bool /* bShow */ )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-
-sal_Bool SvLBox::Expand( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- return sal_True;
-}
-
-sal_Bool SvLBox::Collapse( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- return sal_True;
-}
-
-sal_Bool SvLBox::Select( SvLBoxEntry*, sal_Bool )
-{
- DBG_CHKTHIS(SvLBox,0);
- return sal_False;
-}
-
-sal_uLong SvLBox::SelectChildren( SvLBoxEntry* , sal_Bool )
-{
- DBG_CHKTHIS(SvLBox,0);
- return 0;
-}
-
-void SvLBox::OnCurrentEntryChanged()
-{
- if ( !pLBoxImpl->m_bDoingQuickSelection )
- pLBoxImpl->m_aQuickSelectionEngine.Reset();
-}
-
-void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-SvLBoxEntry* SvLBox::GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const
-{
- DBG_CHKTHIS(SvLBox,0);
-
- SvLBoxEntry* pEntry = NULL;
- SvLBoxEntry* pParent = NULL;
- for( ::std::deque< sal_Int32 >::const_iterator pItem = _rPath.begin(); pItem != _rPath.end(); ++pItem )
- {
- pEntry = GetEntry( pParent, *pItem );
- if ( !pEntry )
- break;
- pParent = pEntry;
- }
-
- return pEntry;
-}
-
-void SvLBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const
-{
- DBG_CHKTHIS(SvLBox,0);
-
- if ( pEntry )
- {
- SvLBoxEntry* pParentEntry = GetParent( pEntry );
- while ( sal_True )
- {
- sal_uLong i, nCount = GetLevelChildCount( pParentEntry );
- for ( i = 0; i < nCount; ++i )
- {
- SvLBoxEntry* pTemp = GetEntry( pParentEntry, i );
- DBG_ASSERT( pEntry, "invalid entry" );
- if ( pEntry == pTemp )
- {
- _rPath.push_front( (sal_Int32)i );
- break;
- }
- }
-
- if ( pParentEntry )
- {
- pEntry = pParentEntry;
- pParentEntry = GetParent( pParentEntry );
- }
- else
- break;
- }
- }
-}
-
-String SvLBox::GetEntryText( SvLBoxEntry* ) const
-{
- DBG_CHKTHIS(SvLBox,0);
-
- return String();
-}
-
-sal_uLong SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
-{
- DBG_CHKTHIS(SvLBox,0);
-
- sal_uLong nCount = 0;
- SvLBoxEntry* pEntry = FirstChild( _pParent );
- while ( pEntry )
- {
- ++nCount;
- pEntry = NextSibling( pEntry );
- }
-
- return nCount;
-}
-
-void SvLBox::SetSelectionMode( SelectionMode eSelectMode )
-{
- DBG_CHKTHIS(SvLBox,0);
- eSelMode = eSelectMode;
-}
-
-void SvLBox::SetDragDropMode( DragDropMode nDDMode )
-{
- DBG_CHKTHIS(SvLBox,0);
- nDragDropMode = nDDMode;
-}
-
-SvViewData* SvLBox::CreateViewData( SvListEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- SvViewDataEntry* pEntryData = new SvViewDataEntry;
- return (SvViewData*)pEntryData;
-}
-
-void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
-{
- DBG_CHKTHIS(SvLBox,0);
- SvLBoxEntry* pInhEntry = (SvLBoxEntry*)pEntry;
- SvViewDataEntry* pEntryData = (SvViewDataEntry*)pData;
-
- pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ];
- SvViewDataItem* pItemData = pEntryData->pItemData;
- pEntryData->nItmCnt = pInhEntry->ItemCount(); // number of items to delete
- sal_uInt16 nCount = pInhEntry->ItemCount();
- sal_uInt16 nCurPos = 0;
- while( nCurPos < nCount )
- {
- SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos );
- pItem->InitViewData( this, pInhEntry, pItemData );
- pItemData++;
- nCurPos++;
- }
-}
-
-
-
-void SvLBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChildren )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_uInt16 nRefDepth;
- SvLBoxEntry* pTemp;
-
- SvLBoxEntry* pSelEntry = FirstSelected();
- while( pSelEntry )
- {
- if ( !bEnable )
- {
- pSelEntry->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
- if ( bWithChildren )
- {
- nRefDepth = pModel->GetDepth( pSelEntry );
- pTemp = Next( pSelEntry );
- while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
- {
- pTemp->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
- pTemp = Next( pTemp );
- }
- }
- }
- else
- {
- pSelEntry->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
- if ( bWithChildren )
- {
- nRefDepth = pModel->GetDepth( pSelEntry );
- pTemp = Next( pSelEntry );
- while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
- {
- pTemp->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
- pTemp = Next( pTemp );
- }
- }
- }
- pSelEntry = NextSelected( pSelEntry );
- }
-}
-
-SvLBoxEntry* SvLBox::GetDropTarget( const Point& )
-{
- DBG_CHKTHIS(SvLBox,0);
- return 0;
-}
-
-// ******************************************************************
-// InplaceEditing
-// ******************************************************************
-
-void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
- const Selection& rSel )
-{
- EditText( rStr, rRect, rSel, sal_False );
-}
-
-void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
- const Selection& rSel, sal_Bool bMulti )
-{
- DBG_CHKTHIS(SvLBox,0);
- if( pEdCtrl )
- delete pEdCtrl;
- nImpFlags |= SVLBOX_IN_EDT;
- nImpFlags &= ~SVLBOX_EDTEND_CALLED;
- HideFocus();
- pEdCtrl = new SvInplaceEdit2(
- this, rRect.TopLeft(), rRect.GetSize(), rStr,
- LINK( this, SvLBox, TextEditEndedHdl_Impl ),
- rSel, bMulti );
-}
-
-IMPL_LINK_NOARG(SvLBox, TextEditEndedHdl_Impl)
-{
- DBG_CHKTHIS(SvLBox,0);
- if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // avoid nesting
- return 0;
- nImpFlags |= SVLBOX_EDTEND_CALLED;
- String aStr;
- if ( !pEdCtrl->EditingCanceled() )
- aStr = pEdCtrl->GetText();
- else
- aStr = pEdCtrl->GetSavedValue();
- if ( IsEmptyTextAllowed() || aStr.Len() > 0 )
- EditedText( aStr );
- // Hide may only be called after the new text was put into the entry, so
- // that we don't call the selection handler in the GetFocus of the listbox
- // with the old entry text.
- pEdCtrl->Hide();
- // delete pEdCtrl;
- // pEdCtrl = 0;
- nImpFlags &= (~SVLBOX_IN_EDT);
- GrabFocus();
- return 0;
-}
-
-void SvLBox::CancelTextEditing()
-{
- DBG_CHKTHIS(SvLBox,0);
- if ( pEdCtrl )
- pEdCtrl->StopEditing( sal_True );
- nImpFlags &= (~SVLBOX_IN_EDT);
-}
-
-void SvLBox::EndEditing( sal_Bool bCancel )
-{
- DBG_CHKTHIS(SvLBox,0);
- if( pEdCtrl )
- pEdCtrl->StopEditing( bCancel );
- nImpFlags &= (~SVLBOX_IN_EDT);
-}
-
-
-bool SvLBox::IsEmptyTextAllowed() const
-{
- DBG_CHKTHIS(SvLBox,0);
- return pLBoxImpl->m_bIsEmptyTextAllowed;
-}
-
-void SvLBox::ForbidEmptyText()
-{
- DBG_CHKTHIS(SvLBox,0);
- pLBoxImpl->m_bIsEmptyTextAllowed = false;
-}
-
-void SvLBox::EditedText( const String& )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-void SvLBox::EditingRequest( SvLBoxEntry*, SvLBoxItem*,const Point& )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-
-SvLBoxEntry* SvLBox::CreateEntry() const
-{
- DBG_CHKTHIS(SvLBox,0);
- return new SvLBoxEntry;
-}
-
-void SvLBox::MakeVisible( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-void SvLBox::Command( const CommandEvent& i_rCommandEvent )
-{
- DBG_CHKTHIS(SvLBox,0);
-
- if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() )
- {
- Point aEventPos( i_rCommandEvent.GetMousePosPixel() );
- MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
- MouseButtonUp( aMouseEvt );
- }
- Control::Command( i_rCommandEvent );
-}
-
-void SvLBox::KeyInput( const KeyEvent& rKEvt )
-{
- bool bHandled = HandleKeyInput( rKEvt );
- if ( !bHandled )
- Control::KeyInput( rKEvt );
-}
-
-const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const
-{
- SvLBoxEntry* pEntry = GetCurEntry();
- if ( pEntry )
- pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
- else
- {
- pEntry = FirstSelected();
- if ( !pEntry )
- pEntry = First();
- }
-
- if ( pEntry )
- _rEntryText = GetEntryText( pEntry );
-
- return pEntry;
-}
-
-const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
-{
- SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
-
- if ( ( ( GetChildCount( pEntry ) > 0 )
- || ( pEntry->HasChildrenOnDemand() )
- )
- && !IsExpanded( pEntry )
- )
- {
- pEntry = NextSibling( pEntry );
- }
- else
- {
- pEntry = Next( pEntry );
- }
-
- if ( !pEntry )
- pEntry = First();
-
- if ( pEntry )
- _rEntryText = GetEntryText( pEntry );
-
- return pEntry;
-}
-
-void SvLBox::SelectSearchEntry( const void* _pEntry )
-{
- SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
- DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" );
- if ( !pEntry )
- return;
-
- SelectAll( sal_False );
- SetCurEntry( pEntry );
- Select( pEntry );
-}
-
-void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
-{
- // nothing to do here, we have no "execution"
-}
-
-::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const
-{
- // always accept the current entry if there is one
- SvLBoxEntry* pCurrentEntry( GetCurEntry() );
- if ( pCurrentEntry )
- {
- _out_entryText = GetEntryText( pCurrentEntry );
- return pCurrentEntry;
- }
- return FirstSearchEntry( _out_entryText );
-}
-
-::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
-{
- return NextSearchEntry( _currentEntry, _out_entryText );
-}
-
-void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
-{
- SelectSearchEntry( _entry );
-}
-
-bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt )
-{
- if ( IsEntryMnemonicsEnabled()
- && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
- )
- return true;
-
- if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
- {
- pLBoxImpl->m_bDoingQuickSelection = true;
- const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
- pLBoxImpl->m_bDoingQuickSelection = false;
- if ( bHandled )
- return true;
- }
-
- return false;
-}
-
-SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const
-{
- DBG_CHKTHIS(SvLBox,0);
- return 0;
-}
-
-void SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
- for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ )
- {
- SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx );
- pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 );
- }
-}
-
-void SvLBox::WriteDragServerInfo( const Point&, SvLBoxDDInfo* )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* )
-{
- DBG_CHKTHIS(SvLBox,0);
-}
-
-sal_Bool SvLBox::EditingCanceled() const
-{
- if( pEdCtrl && pEdCtrl->EditingCanceled() )
- return sal_True;
- return sal_False;
-}
-
-
-//JP 28.3.2001: new Drag & Drop API
-sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_Int8 nRet = DND_ACTION_NONE;
-
- if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) )
- {
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- }
- else if( !nDragDropMode )
- {
- SAL_WARN( "svtools.contnr", "SvLBox::QueryDrop(): no target" );
- }
- else
- {
- SvLBoxEntry* pEntry = GetDropTarget( rEvt.maPosPixel );
- if( !IsDropFormatSupported( SOT_FORMATSTR_ID_TREELISTBOX ) )
- {
- SAL_WARN( "svtools.contnr", "SvLBox::QueryDrop(): no format" );
- }
- else
- {
- DBG_ASSERT( pDDSource, "SvLBox::QueryDrop(): SourceBox == 0" );
- if( !( pEntry && pDDSource->GetModel() == this->GetModel()
- && DND_ACTION_MOVE == rEvt.mnAction
- && ( pEntry->nEntryFlags & SV_ENTRYFLAG_DISABLE_DROP ) ))
- {
- if( NotifyAcceptDrop( pEntry ))
- nRet = rEvt.mnAction;
- }
- }
-
- // **** draw emphasis ****
- if( DND_ACTION_NONE == nRet )
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
- {
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, sal_True );
- }
- }
- return nRet;
-}
-
-sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView )
-{
- DBG_CHKTHIS(SvLBox,0);
- sal_Int8 nRet = DND_ACTION_NONE;
-
- DBG_ASSERT( pSourceView, "SvLBox::ExecuteDrop(): no source view" );
- pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True );
-
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- pDDTarget = this;
-
- SvLBoxDDInfo aDDInfo;
-
- TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
- if( aData.HasFormat( SOT_FORMATSTR_ID_TREELISTBOX ))
- {
- ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
- if( aData.GetSequence( SOT_FORMATSTR_ID_TREELISTBOX, aSeq ) &&
- sizeof(SvLBoxDDInfo) == aSeq.getLength() )
- {
- memcpy( &aDDInfo, aSeq.getConstArray(), sizeof(SvLBoxDDInfo) );
- nRet = rEvt.mnAction;
- }
- }
-
- if( DND_ACTION_NONE != nRet )
- {
- nRet = DND_ACTION_NONE;
-
- ReadDragServerInfo( rEvt.maPosPixel, &aDDInfo );
-
- SvLBoxEntry* pTarget = pTargetEntry; // may be 0!
-
- if( DND_ACTION_COPY == rEvt.mnAction )
- {
- if ( CopySelection( aDDInfo.pSource, pTarget ) )
- nRet = rEvt.mnAction;
- }
- else if( DND_ACTION_MOVE == rEvt.mnAction )
- {
- if ( MoveSelection( aDDInfo.pSource, pTarget ) )
- nRet = rEvt.mnAction;
- }
- else if( DND_ACTION_COPYMOVE == rEvt.mnAction )
- {
- if ( MoveSelectionCopyFallbackPossible( aDDInfo.pSource, pTarget, sal_True ) )
- nRet = rEvt.mnAction;
- }
- }
- return nRet;
-}
-
-sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt )
-{
- DBG_CHKTHIS(SvLBox,0);
- return ExecuteDrop( rEvt, GetSourceView() );
-}
-
-void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
-{
- DBG_CHKTHIS(SvLBox,0);
-
- Point aEventPos( rPosPixel );
- MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
- MouseButtonUp( aMouseEvt );
-
- nOldDragMode = GetDragDropMode();
- if ( !nOldDragMode )
- return;
-
- ReleaseMouse();
-
- SvLBoxEntry* pEntry = GetEntry( rPosPixel ); // GetDropTarget( rPos );
- if( !pEntry )
- {
- DragFinished( DND_ACTION_NONE );
- return;
- }
-
- TransferDataContainer* pContainer = new TransferDataContainer;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::datatransfer::XTransferable > xRef( pContainer );
-
- nDragDropMode = NotifyStartDrag( *pContainer, pEntry );
- if( !nDragDropMode || 0 == GetSelectionCount() )
- {
- nDragDropMode = nOldDragMode;
- DragFinished( DND_ACTION_NONE );
- return;
- }
-
- SvLBoxDDInfo aDDInfo;
- memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
- aDDInfo.pApp = GetpApp();
- aDDInfo.pSource = this;
- aDDInfo.pDDStartEntry = pEntry;
- // let derived views do their thing
- WriteDragServerInfo( rPosPixel, &aDDInfo );
-
- pContainer->CopyAnyData( SOT_FORMATSTR_ID_TREELISTBOX,
- (sal_Char*)&aDDInfo, sizeof(SvLBoxDDInfo) );
- pDDSource = this;
- pDDTarget = 0;
-
- sal_Bool bOldUpdateMode = Control::IsUpdateMode();
- Control::SetUpdateMode( sal_True );
- Update();
- Control::SetUpdateMode( bOldUpdateMode );
-
- // Disallow using the selection and its children as drop targets.
- // Important: If the selection of the SourceListBox is changed in the
- // DropHandler, the entries have to be allowed as drop targets again:
- // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );)
- EnableSelectionAsDropTarget( sal_False, sal_True /* with children */ );
-
- pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() );
-}
-
-void SvLBox::DragFinished( sal_Int8
-#ifndef UNX
-nAction
-#endif
-)
-{
- EnableSelectionAsDropTarget( sal_True, sal_True );
-
-#ifndef UNX
- if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget &&
- ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
- !pDDTarget ))
- {
- RemoveSelection();
- }
-#endif
-
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- pDDSource = 0;
- pDDTarget = 0;
- pTargetEntry = 0;
- nDragDropMode = nOldDragMode;
-}
-
-DragDropMode SvLBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- return (DragDropMode)0xffff;
-}
-
-sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
-{
- DBG_CHKTHIS(SvLBox,0);
- return sal_True;
-}
-
-// Handler and methods for Drag - finished handler.
-// The with get GetDragFinishedHdl() get link can set on the
-// TransferDataContainer. This link is a callback for the DragFinished
-// call. AddBox method is called from the GetDragFinishedHdl() and the
-// remove is called in link callback and in the destructor. So it can't
-// called to a deleted object.
-
-namespace
-{
- struct SortLBoxes : public rtl::Static<std::set<sal_uLong>, SortLBoxes> {};
-}
-
-void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB )
-{
- sal_uLong nVal = (sal_uLong)&rB;
- SortLBoxes::get().insert( nVal );
-}
-
-void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB )
-{
- sal_uLong nVal = (sal_uLong)&rB;
- SortLBoxes::get().erase( nVal );
-}
-
-IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction )
-{
- sal_uLong nVal = (sal_uLong)pThis;
- std::set<sal_uLong> &rSortLBoxes = SortLBoxes::get();
- std::set<sal_uLong>::const_iterator it = rSortLBoxes.find(nVal);
- if( it != rSortLBoxes.end() )
- {
- pThis->DragFinished( *pAction );
- rSortLBoxes.erase( it );
- }
- return 0;
-}
-
-Link SvLBox::GetDragFinishedHdl() const
-{
- AddBoxToDDList_Impl( *this );
- return STATIC_LINK( this, SvLBox, DragFinishHdl_Impl );
-}
-
-void SvLBox::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& ) const
-{
-}
-
-::com::sun::star::uno::Reference< XAccessible > SvLBox::CreateAccessible()
-{
- return ::com::sun::star::uno::Reference< XAccessible >();
-}
-
-Rectangle SvLBox::GetBoundingRect( SvLBoxEntry* )
-{
- return Rectangle();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index eba80955ff27..6f410fa4e846 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -29,6 +29,7 @@
#include <svtools/svtabbx.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtresid.hxx>
+#include <svtools/svlbitm.hxx>
#include <svtools/svtools.hrc>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
@@ -838,12 +839,12 @@ sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SetNoSelection()
{
- SvLBox::SelectAll( sal_False );
+ SvTreeListBox::SelectAll(false);
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SelectAll()
{
- SvLBox::SelectAll( sal_True );
+ SvTreeListBox::SelectAll(true);
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SelectAll( sal_Bool bSelect, sal_Bool bPaint )
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/treelistbox.cxx
index 92d91d2e188a..ad75c6497a00 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -26,48 +26,609 @@
*
************************************************************************/
-#define _SVTREEBX_CXX
+
+/*
+ TODO:
+ - delete anchor in SelectionEngine when selecting manually
+ - SelectAll( sal_False ) => only repaint the delselected entries
+*/
+
+#include <svtools/treelistbox.hxx>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <vcl/svapp.hxx>
+#include <vcl/accel.hxx>
+#include <vcl/i18nhelp.hxx>
+#include <sot/formats.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <rtl/instance.hxx>
+#include <comphelper/string.hxx>
-#include <svtools/svlbox.hxx>
+#include <svtools/svmedit.hxx>
#include <svtools/svlbitm.hxx>
-#include <svtools/svtreebx.hxx>
-#include <comphelper/string.hxx>
-#include <svimpbox.hxx>
-#include <unotools/accessiblestatesethelper.hxx>
-#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#include <com/sun/star/awt/XWindowPeer.hpp>
+#include "svimpbox.hxx"
+#include <set>
+#include <string.h>
using namespace ::com::sun::star::accessibility;
-/*
- Bugs/TODO
+// Drag&Drop
+static SvTreeListBox* pDDSource = NULL;
+static SvTreeListBox* pDDTarget = NULL;
- - calculate rectangle when editing in-place (bug with some fonts)
- - SetSpaceBetweenEntries: offset is not taken into account in SetEntryHeight
-*/
+DBG_NAME(SvInplaceEdit2)
-#define TREEFLAG_FIXEDHEIGHT 0x0010
+#define SVLBOX_ACC_RETURN 1
+#define SVLBOX_ACC_ESCAPE 2
+// ***************************************************************
-DBG_NAME(SvTreeListBox)
+class MyEdit_Impl : public Edit
+{
+ SvInplaceEdit2* pOwner;
+public:
+ MyEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+};
-#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
+class MyMultiEdit_Impl : public MultiLineEdit
+{
+ SvInplaceEdit2* pOwner;
+public:
+ MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+};
+
+MyEdit_Impl::MyEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner ) :
+
+ Edit( pParent, WB_LEFT ),
+
+ pOwner( _pOwner )
+
+{
+}
+
+void MyEdit_Impl::KeyInput( const KeyEvent& rKEvt )
+{
+ if( !pOwner->KeyInput( rKEvt ))
+ Edit::KeyInput( rKEvt );
+}
+
+void MyEdit_Impl::LoseFocus()
+{
+ pOwner->LoseFocus();
+}
+
+MyMultiEdit_Impl::MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner )
+ : MultiLineEdit( pParent,
+ WB_CENTER
+ ), pOwner(_pOwner)
+{
+}
+
+void MyMultiEdit_Impl::KeyInput( const KeyEvent& rKEvt )
+{
+ if( !pOwner->KeyInput( rKEvt ))
+ MultiLineEdit::KeyInput( rKEvt );
+}
+
+void MyMultiEdit_Impl::LoseFocus()
+{
+ pOwner->LoseFocus();
+}
+
+
+SvInplaceEdit2::SvInplaceEdit2
+(
+ Window* pParent, const Point& rPos,
+ const Size& rSize,
+ const String& rData,
+ const Link& rNotifyEditEnd,
+ const Selection& rSelection,
+ sal_Bool bMulti
+) :
+
+ aCallBackHdl ( rNotifyEditEnd ),
+ bCanceled ( sal_False ),
+ bAlreadyInCallBack ( sal_False )
+
+{
+ DBG_CTOR(SvInplaceEdit2,0);
+
+ if( bMulti )
+ pEdit = new MyMultiEdit_Impl( pParent, this );
+ else
+ pEdit = new MyEdit_Impl( pParent, this );
+
+ Font aFont( pParent->GetFont() );
+ aFont.SetTransparent( sal_False );
+ Color aColor( pParent->GetBackground().GetColor() );
+ aFont.SetFillColor(aColor );
+ pEdit->SetFont( aFont );
+ pEdit->SetBackground( pParent->GetBackground() );
+ pEdit->SetPosPixel( rPos );
+ pEdit->SetSizePixel( rSize );
+ pEdit->SetText( rData );
+ pEdit->SetSelection( rSelection );
+ pEdit->SaveValue();
+
+ aAccReturn.InsertItem( SVLBOX_ACC_RETURN, KeyCode(KEY_RETURN) );
+ aAccEscape.InsertItem( SVLBOX_ACC_ESCAPE, KeyCode(KEY_ESCAPE) );
+
+ aAccReturn.SetActivateHdl( LINK( this, SvInplaceEdit2, ReturnHdl_Impl) );
+ aAccEscape.SetActivateHdl( LINK( this, SvInplaceEdit2, EscapeHdl_Impl) );
+ GetpApp()->InsertAccel( &aAccReturn );
+ GetpApp()->InsertAccel( &aAccEscape );
+
+ pEdit->Show();
+ pEdit->GrabFocus();
+}
+
+SvInplaceEdit2::~SvInplaceEdit2()
+{
+ DBG_DTOR(SvInplaceEdit2,0);
+ if( !bAlreadyInCallBack )
+ {
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ }
+ delete pEdit;
+}
+
+String SvInplaceEdit2::GetSavedValue() const
+{
+ return pEdit->GetSavedValue();
+}
+
+void SvInplaceEdit2::Hide()
+{
+ pEdit->Hide();
+}
+
+
+IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, ReturnHdl_Impl)
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ bCanceled = sal_False;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, ReturnHdl_Impl)
+
+IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, EscapeHdl_Impl)
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ bCanceled = sal_True;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, EscapeHdl_Impl)
+
+
+sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ KeyCode aCode = rKEvt.GetKeyCode();
+ sal_uInt16 nCode = aCode.GetCode();
+
+ switch ( nCode )
+ {
+ case KEY_ESCAPE:
+ bCanceled = sal_True;
+ CallCallBackHdl_Impl();
+ return sal_True;
+
+ case KEY_RETURN:
+ bCanceled = sal_False;
+ CallCallBackHdl_Impl();
+ return sal_True;
+ }
+ return sal_False;
+}
+
+void SvInplaceEdit2::StopEditing( sal_Bool bCancel )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ if ( !bAlreadyInCallBack )
+ {
+ bCanceled = bCancel;
+ CallCallBackHdl_Impl();
+ }
+}
+
+void SvInplaceEdit2::LoseFocus()
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ if ( !bAlreadyInCallBack
+ && ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
+ )
+ {
+ bCanceled = sal_False;
+ aTimer.SetTimeout(10);
+ aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl));
+ aTimer.Start();
+ }
+}
+
+IMPL_LINK_NOARG_INLINE_START(SvInplaceEdit2, Timeout_Impl)
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ CallCallBackHdl_Impl();
+ return 0;
+}
+IMPL_LINK_NOARG_INLINE_END(SvInplaceEdit2, Timeout_Impl)
+
+void SvInplaceEdit2::CallCallBackHdl_Impl()
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ aTimer.Stop();
+ if ( !bAlreadyInCallBack )
+ {
+ bAlreadyInCallBack = sal_True;
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ pEdit->Hide();
+ aCallBackHdl.Call( this );
+ }
+}
+
+String SvInplaceEdit2::GetText() const
+{
+ return pEdit->GetText();
+}
+
+// ***************************************************************
+// class SvLBoxTab
+// ***************************************************************
+
+DBG_NAME(SvLBoxTab);
+
+SvLBoxTab::SvLBoxTab()
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = 0;
+ pUserData = 0;
+ nFlags = 0;
+}
+
+SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags )
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = nPosition;
+ pUserData = 0;
+ nFlags = nTabFlags;
+}
+
+SvLBoxTab::SvLBoxTab( const SvLBoxTab& rTab )
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = rTab.nPos;
+ pUserData = rTab.pUserData;
+ nFlags = rTab.nFlags;
+}
+
+SvLBoxTab::~SvLBoxTab()
+{
+ DBG_DTOR(SvLBoxTab,0);
+}
+
+
+long SvLBoxTab::CalcOffset( long nItemWidth, long nTabWidth )
+{
+ DBG_CHKTHIS(SvLBoxTab,0);
+ long nOffset = 0;
+ if ( nFlags & SV_LBOXTAB_ADJUST_RIGHT )
+ {
+ nOffset = nTabWidth - nItemWidth;
+ if( nOffset < 0 )
+ nOffset = 0;
+ }
+ else if ( nFlags & SV_LBOXTAB_ADJUST_CENTER )
+ {
+ if( nFlags & SV_LBOXTAB_FORCE )
+ {
+ // correct implementation of centering
+ nOffset = ( nTabWidth - nItemWidth ) / 2;
+ if( nOffset < 0 )
+ nOffset = 0;
+ }
+ else
+ {
+ // historically grown, wrong calculation of tabs which is needed by
+ // Abo-Tabbox, Tools/Options/Customize etc.
+ nItemWidth++;
+ nOffset = -( nItemWidth / 2 );
+ }
+ }
+ return nOffset;
+}
+
+// ***************************************************************
+// class SvLBoxItem
+// ***************************************************************
+
+DBG_NAME(SvLBoxItem);
+
+SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 )
+{
+ DBG_CTOR(SvLBoxItem,0);
+}
+
+SvLBoxItem::SvLBoxItem()
+{
+ DBG_CTOR(SvLBoxItem,0);
+}
+
+SvLBoxItem::~SvLBoxItem()
+{
+ DBG_DTOR(SvLBoxItem,0);
+}
+
+const Size& SvLBoxItem::GetSize( SvTreeListBox* pView,SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBoxItem,0);
+ SvViewDataItem* pViewData = pView->GetViewDataItem( pEntry, this );
+ return pViewData->aSize;
+}
+
+DBG_NAME(SvViewDataItem);
+
+SvViewDataItem::SvViewDataItem()
+{
+ DBG_CTOR(SvViewDataItem,0);
+}
+
+SvViewDataItem::~SvViewDataItem()
+{
+ DBG_DTOR(SvViewDataItem,0);
+}
+
+
+
+// ***************************************************************
+// class SvLBoxEntry
+// ***************************************************************
+
+DBG_NAME(SvLBoxEntry);
+
+SvLBoxEntry::SvLBoxEntry() : aItems()
+{
+ DBG_CTOR(SvLBoxEntry,0);
+ nEntryFlags = 0;
+ pUserData = 0;
+}
+
+SvLBoxEntry::~SvLBoxEntry()
+{
+ DBG_DTOR(SvLBoxEntry,0);
+ DeleteItems_Impl();
+}
+
+void SvLBoxEntry::DeleteItems_Impl()
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ sal_uInt16 nCount = aItems.size();
+ while( nCount )
+ {
+ nCount--;
+ SvLBoxItem* pItem = aItems[ nCount ];
+ delete pItem;
+ }
+ aItems.clear();
+}
+
+
+void SvLBoxEntry::AddItem( SvLBoxItem* pItem )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ aItems.push_back( pItem );
+}
+
+void SvLBoxEntry::Clone( SvListEntry* pSource )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ SvListEntry::Clone( pSource );
+ SvLBoxItem* pNewItem;
+ DeleteItems_Impl();
+ sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount();
+ sal_uInt16 nCurPos = 0;
+ while( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos );
+ pNewItem = pItem->Create();
+ pNewItem->Clone( pItem );
+ AddItem( pNewItem );
+ nCurPos++;
+ }
+ pUserData = ((SvLBoxEntry*)pSource)->GetUserData();
+ nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags;
+}
+
+void SvLBoxEntry::EnableChildrenOnDemand( sal_Bool bEnable )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ if ( bEnable )
+ nEntryFlags |= SV_ENTRYFLAG_CHILDREN_ON_DEMAND;
+ else
+ nEntryFlags &= (~SV_ENTRYFLAG_CHILDREN_ON_DEMAND);
+}
+
+void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ DBG_ASSERT(pNewItem,"ReplaceItem:No Item");
+ SvLBoxItem* pOld = GetItem( nPos );
+ if ( pOld )
+ {
+ aItems[ nPos ] = pNewItem;
+ delete pOld;
+ }
+}
+
+SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId )
+{
+ sal_uInt16 nCount = aItems.size();
+ sal_uInt16 nCur = 0;
+ SvLBoxItem* pItem;
+ while( nCur < nCount )
+ {
+ pItem = GetItem( nCur );
+ if( pItem->IsA() == nId )
+ return pItem;
+ nCur++;
+ }
+ return 0;
+}
+
+SvLBoxEntry* SvLBoxTreeList::First() const
+{
+ return (SvLBoxEntry*)SvTreeList::First();
+}
+
+SvLBoxEntry* SvLBoxTreeList::Next( SvListEntry* pEntry, sal_uInt16* pDepth ) const
+{
+ return (SvLBoxEntry*)SvTreeList::Next(pEntry,pDepth);
+}
+
+SvLBoxEntry* SvLBoxTreeList::Prev( SvListEntry* pEntry, sal_uInt16* pDepth ) const
+{
+ return (SvLBoxEntry*)SvTreeList::Prev(pEntry,pDepth);
+}
+
+SvLBoxEntry* SvLBoxTreeList::Last() const
+{
+ return (SvLBoxEntry*)SvTreeList::Last();
+}
+
+SvLBoxEntry* SvLBoxTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const
+{
+ return (SvLBoxEntry*)SvTreeList::Clone(pEntry,nCloneCount);
+}
+
+SvLBoxEntry* SvLBoxTreeList::GetEntry( SvListEntry* pParent, sal_uLong nPos ) const
+{
+ return (SvLBoxEntry*)SvTreeList::GetEntry(pParent,nPos);
+}
+
+SvLBoxEntry* SvLBoxTreeList::GetEntry( sal_uLong nRootPos ) const
+{
+ return (SvLBoxEntry*)SvTreeList::GetEntry(nRootPos);
+}
+
+SvLBoxEntry* SvLBoxTreeList::GetParent( SvListEntry* pEntry ) const
+{
+ return (SvLBoxEntry*)SvTreeList::GetParent(pEntry);
+}
+
+SvLBoxEntry* SvLBoxTreeList::FirstChild( SvLBoxEntry* pParent ) const
+{
+ return (SvLBoxEntry*)SvTreeList::FirstChild(pParent);
+}
+
+SvLBoxEntry* SvLBoxTreeList::NextSibling( SvLBoxEntry* pEntry ) const
+{
+ return (SvLBoxEntry*)SvTreeList::NextSibling(pEntry);
+}
+
+SvLBoxEntry* SvLBoxTreeList::PrevSibling( SvLBoxEntry* pEntry ) const
+{
+ return (SvLBoxEntry*)SvTreeList::PrevSibling(pEntry);
+}
+
+SvLBoxEntry* SvLBoxTreeList::LastSibling( SvLBoxEntry* pEntry ) const
+{
+ return (SvLBoxEntry*)SvTreeList::LastSibling(pEntry);
+}
+
+SvLBoxEntry* SvLBoxTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
+{
+ return (SvLBoxEntry*)SvTreeList::GetEntryAtAbsPos( nAbsPos);
+}
+
+// ***************************************************************
+// class SvLBoxViewData
+// ***************************************************************
-SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox( pParent, nWinStyle )
+DBG_NAME(SvViewDataEntry);
+
+SvViewDataEntry::SvViewDataEntry()
+ : SvViewData()
+{
+ DBG_CTOR(SvViewDataEntry,0);
+ pItemData = 0;
+}
+
+SvViewDataEntry::~SvViewDataEntry()
+{
+ DBG_DTOR(SvViewDataEntry,0);
+ delete [] pItemData;
+}
+
+// ***************************************************************
+// struct SvLBox_Impl
+// ***************************************************************
+SvLBox_Impl::SvLBox_Impl( SvTreeListBox& _rBox )
+ :m_bIsEmptyTextAllowed( true )
+ ,m_bEntryMnemonicsEnabled( false )
+ ,m_bDoingQuickSelection( false )
+ ,m_pLink( NULL )
+ ,m_aMnemonicEngine( _rBox )
+ ,m_aQuickSelectionEngine( _rBox )
+{
+}
+
+// ***************************************************************
+// class SvTreeListBox
+// ***************************************************************
+
+DBG_NAME(SvTreeListBox);
+
+SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle ) :
+ Control( pParent, nWinStyle | WB_CLIPCHILDREN ),
+ DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvTreeListBox,0);
+ nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
+ nImpFlags = 0;
+ pTargetEntry = 0;
+ nDragDropMode = 0;
+ pLBoxImpl = new SvLBox_Impl( *this );
+ SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
+ pTempModel->SetRefCount( 0 );
+ SetModel( pTempModel );
+ pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
+ pModel->InsertView( this );
+ pHdlEntry = 0;
+ pEdCtrl = 0;
+ SetSelectionMode( SINGLE_SELECTION ); // check if TreeListBox is called
+ SetDragDropMode( SV_DRAGDROP_NONE );
+ SetType(WINDOW_TREELISTBOX);
+
InitTreeView();
SetSublistOpenWithLeftRight();
}
-SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
- : SvLBox( pParent,rResId )
+SvTreeListBox::SvTreeListBox( Window* pParent, const ResId& rResId ) :
+ Control( pParent, rResId ),
+ DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvTreeListBox,0);
+ pTargetEntry = 0;
+ nImpFlags = 0;
+ pLBoxImpl = new SvLBox_Impl( *this );
+ nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
+ nDragDropMode = 0;
+ SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
+ pTempModel->SetRefCount( 0 );
+ SetModel( pTempModel );
+ pModel->InsertView( this );
+ pHdlEntry = 0;
+ pEdCtrl = 0;
+ pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
+ SetType(WINDOW_TREELISTBOX);
InitTreeView();
Resize();
@@ -75,6 +636,989 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
SetSublistOpenWithLeftRight();
}
+void SvTreeListBox::Clear()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pModel->Clear(); // Model calls SvTreeListBox::ModelHasCleared()
+}
+
+void SvTreeListBox::EnableEntryMnemonics( bool _bEnable )
+{
+ if ( _bEnable == IsEntryMnemonicsEnabled() )
+ return;
+
+ pLBoxImpl->m_bEntryMnemonicsEnabled = _bEnable;
+ Invalidate();
+}
+
+bool SvTreeListBox::IsEntryMnemonicsEnabled() const
+{
+ return pLBoxImpl->m_bEntryMnemonicsEnabled;
+}
+
+IMPL_LINK_INLINE_START( SvTreeListBox, CloneHdl_Impl, SvListEntry*, pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return (long)(CloneEntry((SvLBoxEntry*)pEntry));
+}
+IMPL_LINK_INLINE_END( SvTreeListBox, CloneHdl_Impl, SvListEntry*, pEntry )
+
+sal_uLong SvTreeListBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uLong nPos )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos );
+ return nInsPos;
+}
+
+sal_uLong SvTreeListBox::Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos );
+ return nInsPos;
+}
+
+long SvTreeListBox::ExpandingHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return aExpandingHdl.IsSet() ? aExpandingHdl.Call( this ) : 1;
+}
+
+void SvTreeListBox::ExpandedHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aExpandedHdl.Call( this );
+}
+
+void SvTreeListBox::SelectHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aSelectHdl.Call( this );
+}
+
+void SvTreeListBox::DeselectHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aDeselectHdl.Call( this );
+}
+
+sal_Bool SvTreeListBox::DoubleClickHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aDoubleClickHdl.Call( this );
+ return sal_True;
+}
+
+
+sal_Bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 nAction )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if ( pSource == this )
+ {
+ if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
+ return sal_False; // D&D locked within list
+ if( DND_ACTION_MOVE == nAction )
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
+ return sal_False; // no local move
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
+ return sal_False; // no local copy
+ }
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
+ return sal_False; // no drop
+ if ( DND_ACTION_MOVE == nAction )
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
+ return sal_False; // no global move
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
+ return sal_False; // no global copy
+ }
+ }
+ return sal_True;
+}
+
+
+
+
+void SvTreeListBox::NotifyRemoving( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+/*
+ NotifyMoving/Copying
+ ====================
+
+ default behavior:
+
+ 1. target doesn't have children
+ - entry becomes sibling of target. entry comes after target
+ (->Window: below the target)
+ 2. target is an expanded parent
+ - entry inserted at the beginning of the target childlist
+ 3. target is a collapsed parent
+ - entry is inserted at the end of the target childlist
+*/
+#ifdef DBG_UTIL
+sal_Bool SvTreeListBox::NotifyMoving(
+ SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
+ SvLBoxEntry* pEntry, // entry that we want to move, from
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // new target parent
+ sal_uLong& rNewChildPos) // position in childlist of target parent
+#else
+sal_Bool SvTreeListBox::NotifyMoving(
+ SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
+ SvLBoxEntry*, // entry that we want to move, from
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // new target parent
+ sal_uLong& rNewChildPos) // position in childlist of target parent
+#endif
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"NotifyMoving:SoureEntry?");
+ if( !pTarget )
+ {
+ rpNewParent = 0;
+ rNewChildPos = 0;
+ return sal_True;
+ }
+ if ( !pTarget->HasChildren() && !pTarget->HasChildrenOnDemand() )
+ {
+ // case 1
+ rpNewParent = GetParent( pTarget );
+ rNewChildPos = pModel->GetRelPos( pTarget ) + 1;
+ rNewChildPos += nCurEntrySelPos;
+ nCurEntrySelPos++;
+ }
+ else
+ {
+ // cases 2 & 3
+ rpNewParent = pTarget;
+ if( IsExpanded(pTarget))
+ rNewChildPos = 0;
+ else
+ rNewChildPos = LIST_APPEND;
+ }
+ return sal_True;
+}
+
+sal_Bool SvTreeListBox::NotifyCopying(
+ SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel()
+ SvLBoxEntry* pEntry, // entry that we want to move, from
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // new target parent
+ sal_uLong& rNewChildPos) // position in childlist of target parent
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
+}
+
+// return: all entries copied
+sal_Bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvLBoxEntry* pTarget )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
+ sal_Bool bSuccess = sal_True;
+ SvTreeEntryList aList;
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
+ Link aCloneLink( pModel->GetCloneLink() );
+ pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
+
+ // cache selection to simplify iterating over the selection when doing a D&D
+ // exchange within the same listbox
+ SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
+ while ( pSourceEntry )
+ {
+ // children are copied automatically
+ pSource->SelectChildren( pSourceEntry, sal_False );
+ aList.push_back( pSourceEntry );
+ pSourceEntry = pSource->NextSelected( pSourceEntry );
+ }
+
+ SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
+ for (; it != itEnd; ++it)
+ {
+ pSourceEntry = static_cast<SvLBoxEntry*>(*it);
+ SvLBoxEntry* pNewParent = 0;
+ sal_uLong nInsertionPos = ULONG_MAX;
+ sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ if ( bOk )
+ {
+ if ( bClone )
+ {
+ sal_uLong nCloneCount = 0;
+ pSourceEntry = (SvLBoxEntry*)
+ pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
+ pModel->InsertTree( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ else
+ {
+ sal_uLong nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ pSourceEntry = GetEntry( pNewParent, nListPos );
+ }
+ }
+ else
+ bSuccess = sal_False;
+
+ if( bOk == (sal_Bool)2 ) // HACK: make visible moved entry?
+ MakeVisible( pSourceEntry );
+ }
+ pModel->SetCloneLink( aCloneLink );
+ return bSuccess;
+}
+
+// return: all entries were moved
+sal_Bool SvTreeListBox::MoveSelection( SvTreeListBox* pSource, SvLBoxEntry* pTarget )
+{
+ return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False );
+}
+
+sal_Bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
+ sal_Bool bSuccess = sal_True;
+ SvTreeEntryList aList;
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
+ Link aCloneLink( pModel->GetCloneLink() );
+ if ( bClone )
+ pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
+
+ SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
+ while ( pSourceEntry )
+ {
+ // children are automatically moved
+ pSource->SelectChildren( pSourceEntry, sal_False );
+ aList.push_back( pSourceEntry );
+ pSourceEntry = pSource->NextSelected( pSourceEntry );
+ }
+
+ SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
+ for (; it != itEnd; ++it)
+ {
+ pSourceEntry = static_cast<SvLBoxEntry*>(*it);
+
+ SvLBoxEntry* pNewParent = 0;
+ sal_uLong nInsertionPos = ULONG_MAX;
+ sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ sal_Bool bCopyOk = bOk;
+ if ( !bOk && bAllowCopyFallback )
+ {
+ nInsertionPos = LIST_APPEND;
+ bCopyOk = NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ }
+
+ if ( bOk || bCopyOk )
+ {
+ if ( bClone )
+ {
+ sal_uLong nCloneCount = 0;
+ pSourceEntry = (SvLBoxEntry*)
+ pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
+ pModel->InsertTree( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ else
+ {
+ if ( bOk )
+ pModel->Move( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ else
+ pModel->Copy( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ }
+ else
+ bSuccess = sal_False;
+
+ if( bOk == (sal_Bool)2 ) // HACK: make moved entry visible?
+ MakeVisible( pSourceEntry );
+ }
+ pModel->SetCloneLink( aCloneLink );
+ return bSuccess;
+}
+
+void SvTreeListBox::RemoveSelection()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvTreeEntryList aList;
+ // cache selection, as the implementation deselects everything on the first
+ // remove
+ SvLBoxEntry* pEntry = FirstSelected();
+ while ( pEntry )
+ {
+ aList.push_back( pEntry );
+ if ( pEntry->HasChildren() )
+ // remove deletes all children automatically
+ SelectChildren( pEntry, sal_False );
+ pEntry = NextSelected( pEntry );
+ }
+
+ SvTreeEntryList::iterator it = aList.begin(), itEnd = aList.end();
+ for (; it != itEnd; ++it)
+ {
+ pEntry = static_cast<SvLBoxEntry*>(*it);
+ pModel->Remove(pEntry);
+ }
+}
+
+SvTreeListBox* SvTreeListBox::GetSourceView() const
+{
+ return pDDSource;
+}
+
+void SvTreeListBox::RecalcViewData()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxEntry* pEntry = First();
+ while( pEntry )
+ {
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
+ while ( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = pEntry->GetItem( nCurPos );
+ pItem->InitViewData( this, pEntry );
+ nCurPos++;
+ }
+ ViewDataInitialized( pEntry );
+ pEntry = Next( pEntry );
+ }
+}
+
+void SvTreeListBox::ViewDataInitialized( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ return;
+ if ( !bShow && !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ return;
+ ShowTargetEmphasis( pEntry, bShow );
+ if( bShow )
+ nImpFlags |= SVLBOX_TARGEMPH_VIS;
+ else
+ nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
+}
+
+void SvTreeListBox::OnCurrentEntryChanged()
+{
+ if ( !pLBoxImpl->m_bDoingQuickSelection )
+ pLBoxImpl->m_aQuickSelectionEngine.Reset();
+}
+
+SvLBoxEntry* SvTreeListBox::GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ SvLBoxEntry* pEntry = NULL;
+ SvLBoxEntry* pParent = NULL;
+ for( ::std::deque< sal_Int32 >::const_iterator pItem = _rPath.begin(); pItem != _rPath.end(); ++pItem )
+ {
+ pEntry = GetEntry( pParent, *pItem );
+ if ( !pEntry )
+ break;
+ pParent = pEntry;
+ }
+
+ return pEntry;
+}
+
+void SvTreeListBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ if ( pEntry )
+ {
+ SvLBoxEntry* pParentEntry = GetParent( pEntry );
+ while ( sal_True )
+ {
+ sal_uLong i, nCount = GetLevelChildCount( pParentEntry );
+ for ( i = 0; i < nCount; ++i )
+ {
+ SvLBoxEntry* pTemp = GetEntry( pParentEntry, i );
+ DBG_ASSERT( pEntry, "invalid entry" );
+ if ( pEntry == pTemp )
+ {
+ _rPath.push_front( (sal_Int32)i );
+ break;
+ }
+ }
+
+ if ( pParentEntry )
+ {
+ pEntry = pParentEntry;
+ pParentEntry = GetParent( pParentEntry );
+ }
+ else
+ break;
+ }
+ }
+}
+
+sal_uLong SvTreeListBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ sal_uLong nCount = 0;
+ SvLBoxEntry* pEntry = FirstChild( _pParent );
+ while ( pEntry )
+ {
+ ++nCount;
+ pEntry = NextSibling( pEntry );
+ }
+
+ return nCount;
+}
+
+SvViewData* SvTreeListBox::CreateViewData( SvListEntry* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvViewDataEntry* pEntryData = new SvViewDataEntry;
+ return (SvViewData*)pEntryData;
+}
+
+void SvTreeListBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxEntry* pInhEntry = (SvLBoxEntry*)pEntry;
+ SvViewDataEntry* pEntryData = (SvViewDataEntry*)pData;
+
+ pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ];
+ SvViewDataItem* pItemData = pEntryData->pItemData;
+ pEntryData->nItmCnt = pInhEntry->ItemCount(); // number of items to delete
+ sal_uInt16 nCount = pInhEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
+ while( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos );
+ pItem->InitViewData( this, pInhEntry, pItemData );
+ pItemData++;
+ nCurPos++;
+ }
+}
+
+
+
+void SvTreeListBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChildren )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ sal_uInt16 nRefDepth;
+ SvLBoxEntry* pTemp;
+
+ SvLBoxEntry* pSelEntry = FirstSelected();
+ while( pSelEntry )
+ {
+ if ( !bEnable )
+ {
+ pSelEntry->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+ if ( bWithChildren )
+ {
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
+ {
+ pTemp->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+ pTemp = Next( pTemp );
+ }
+ }
+ }
+ else
+ {
+ pSelEntry->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+ if ( bWithChildren )
+ {
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
+ {
+ pTemp->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+ pTemp = Next( pTemp );
+ }
+ }
+ }
+ pSelEntry = NextSelected( pSelEntry );
+ }
+}
+
+// ******************************************************************
+// InplaceEditing
+// ******************************************************************
+
+void SvTreeListBox::EditText( const String& rStr, const Rectangle& rRect,
+ const Selection& rSel )
+{
+ EditText( rStr, rRect, rSel, sal_False );
+}
+
+void SvTreeListBox::EditText( const String& rStr, const Rectangle& rRect,
+ const Selection& rSel, sal_Bool bMulti )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( pEdCtrl )
+ delete pEdCtrl;
+ nImpFlags |= SVLBOX_IN_EDT;
+ nImpFlags &= ~SVLBOX_EDTEND_CALLED;
+ HideFocus();
+ pEdCtrl = new SvInplaceEdit2(
+ this, rRect.TopLeft(), rRect.GetSize(), rStr,
+ LINK( this, SvTreeListBox, TextEditEndedHdl_Impl ),
+ rSel, bMulti );
+}
+
+IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // avoid nesting
+ return 0;
+ nImpFlags |= SVLBOX_EDTEND_CALLED;
+ String aStr;
+ if ( !pEdCtrl->EditingCanceled() )
+ aStr = pEdCtrl->GetText();
+ else
+ aStr = pEdCtrl->GetSavedValue();
+ if ( IsEmptyTextAllowed() || aStr.Len() > 0 )
+ EditedText( aStr );
+ // Hide may only be called after the new text was put into the entry, so
+ // that we don't call the selection handler in the GetFocus of the listbox
+ // with the old entry text.
+ pEdCtrl->Hide();
+ // delete pEdCtrl;
+ // pEdCtrl = 0;
+ nImpFlags &= (~SVLBOX_IN_EDT);
+ GrabFocus();
+ return 0;
+}
+
+void SvTreeListBox::CancelTextEditing()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if ( pEdCtrl )
+ pEdCtrl->StopEditing( sal_True );
+ nImpFlags &= (~SVLBOX_IN_EDT);
+}
+
+void SvTreeListBox::EndEditing( bool bCancel )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( pEdCtrl )
+ pEdCtrl->StopEditing( bCancel );
+ nImpFlags &= (~SVLBOX_IN_EDT);
+}
+
+
+bool SvTreeListBox::IsEmptyTextAllowed() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return pLBoxImpl->m_bIsEmptyTextAllowed;
+}
+
+void SvTreeListBox::ForbidEmptyText()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pLBoxImpl->m_bIsEmptyTextAllowed = false;
+}
+
+SvLBoxEntry* SvTreeListBox::CreateEntry() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return new SvLBoxEntry;
+}
+
+const void* SvTreeListBox::FirstSearchEntry( String& _rEntryText ) const
+{
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if ( pEntry )
+ pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
+ else
+ {
+ pEntry = FirstSelected();
+ if ( !pEntry )
+ pEntry = First();
+ }
+
+ if ( pEntry )
+ _rEntryText = GetEntryText( pEntry );
+
+ return pEntry;
+}
+
+const void* SvTreeListBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
+{
+ SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
+
+ if ( ( ( GetChildCount( pEntry ) > 0 )
+ || ( pEntry->HasChildrenOnDemand() )
+ )
+ && !IsExpanded( pEntry )
+ )
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ else
+ {
+ pEntry = Next( pEntry );
+ }
+
+ if ( !pEntry )
+ pEntry = First();
+
+ if ( pEntry )
+ _rEntryText = GetEntryText( pEntry );
+
+ return pEntry;
+}
+
+void SvTreeListBox::SelectSearchEntry( const void* _pEntry )
+{
+ SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
+ DBG_ASSERT( pEntry, "SvTreeListBox::SelectSearchEntry: invalid entry!" );
+ if ( !pEntry )
+ return;
+
+ SelectAll( sal_False );
+ SetCurEntry( pEntry );
+ Select( pEntry );
+}
+
+void SvTreeListBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
+{
+ // nothing to do here, we have no "execution"
+}
+
+::vcl::StringEntryIdentifier SvTreeListBox::CurrentEntry( String& _out_entryText ) const
+{
+ // always accept the current entry if there is one
+ SvLBoxEntry* pCurrentEntry( GetCurEntry() );
+ if ( pCurrentEntry )
+ {
+ _out_entryText = GetEntryText( pCurrentEntry );
+ return pCurrentEntry;
+ }
+ return FirstSearchEntry( _out_entryText );
+}
+
+::vcl::StringEntryIdentifier SvTreeListBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ return NextSearchEntry( _currentEntry, _out_entryText );
+}
+
+void SvTreeListBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ SelectSearchEntry( _entry );
+}
+
+bool SvTreeListBox::HandleKeyInput( const KeyEvent& _rKEvt )
+{
+ if ( IsEntryMnemonicsEnabled()
+ && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
+ )
+ return true;
+
+ if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
+ {
+ pLBoxImpl->m_bDoingQuickSelection = true;
+ const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
+ pLBoxImpl->m_bDoingQuickSelection = false;
+ if ( bHandled )
+ return true;
+ }
+
+ return false;
+}
+
+void SvTreeListBox::WriteDragServerInfo( const Point&, SvLBoxDDInfo* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+sal_Bool SvTreeListBox::EditingCanceled() const
+{
+ if( pEdCtrl && pEdCtrl->EditingCanceled() )
+ return sal_True;
+ return sal_False;
+}
+
+
+//JP 28.3.2001: new Drag & Drop API
+sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ sal_Int8 nRet = DND_ACTION_NONE;
+
+ if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) )
+ {
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ }
+ else if( !nDragDropMode )
+ {
+ SAL_WARN( "svtools.contnr", "SvTreeListBox::QueryDrop(): no target" );
+ }
+ else
+ {
+ SvLBoxEntry* pEntry = GetDropTarget( rEvt.maPosPixel );
+ if( !IsDropFormatSupported( SOT_FORMATSTR_ID_TREELISTBOX ) )
+ {
+ SAL_WARN( "svtools.contnr", "SvTreeListBox::QueryDrop(): no format" );
+ }
+ else
+ {
+ DBG_ASSERT( pDDSource, "SvTreeListBox::QueryDrop(): SourceBox == 0" );
+ if( !( pEntry && pDDSource->GetModel() == this->GetModel()
+ && DND_ACTION_MOVE == rEvt.mnAction
+ && ( pEntry->nEntryFlags & SV_ENTRYFLAG_DISABLE_DROP ) ))
+ {
+ if( NotifyAcceptDrop( pEntry ))
+ nRet = rEvt.mnAction;
+ }
+ }
+
+ // **** draw emphasis ****
+ if( DND_ACTION_NONE == nRet )
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ {
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ pTargetEntry = pEntry;
+ ImplShowTargetEmphasis( pTargetEntry, sal_True );
+ }
+ }
+ return nRet;
+}
+
+sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox* pSourceView )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ sal_Int8 nRet = DND_ACTION_NONE;
+
+ DBG_ASSERT( pSourceView, "SvTreeListBox::ExecuteDrop(): no source view" );
+ pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True );
+
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ pDDTarget = this;
+
+ SvLBoxDDInfo aDDInfo;
+
+ TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
+ if( aData.HasFormat( SOT_FORMATSTR_ID_TREELISTBOX ))
+ {
+ ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
+ if( aData.GetSequence( SOT_FORMATSTR_ID_TREELISTBOX, aSeq ) &&
+ sizeof(SvLBoxDDInfo) == aSeq.getLength() )
+ {
+ memcpy( &aDDInfo, aSeq.getConstArray(), sizeof(SvLBoxDDInfo) );
+ nRet = rEvt.mnAction;
+ }
+ }
+
+ if( DND_ACTION_NONE != nRet )
+ {
+ nRet = DND_ACTION_NONE;
+
+ ReadDragServerInfo( rEvt.maPosPixel, &aDDInfo );
+
+ SvLBoxEntry* pTarget = pTargetEntry; // may be 0!
+
+ if( DND_ACTION_COPY == rEvt.mnAction )
+ {
+ if ( CopySelection( aDDInfo.pSource, pTarget ) )
+ nRet = rEvt.mnAction;
+ }
+ else if( DND_ACTION_MOVE == rEvt.mnAction )
+ {
+ if ( MoveSelection( aDDInfo.pSource, pTarget ) )
+ nRet = rEvt.mnAction;
+ }
+ else if( DND_ACTION_COPYMOVE == rEvt.mnAction )
+ {
+ if ( MoveSelectionCopyFallbackPossible( aDDInfo.pSource, pTarget, sal_True ) )
+ nRet = rEvt.mnAction;
+ }
+ }
+ return nRet;
+}
+
+sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return ExecuteDrop( rEvt, GetSourceView() );
+}
+
+void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ Point aEventPos( rPosPixel );
+ MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+ MouseButtonUp( aMouseEvt );
+
+ nOldDragMode = GetDragDropMode();
+ if ( !nOldDragMode )
+ return;
+
+ ReleaseMouse();
+
+ SvLBoxEntry* pEntry = GetEntry( rPosPixel ); // GetDropTarget( rPos );
+ if( !pEntry )
+ {
+ DragFinished( DND_ACTION_NONE );
+ return;
+ }
+
+ TransferDataContainer* pContainer = new TransferDataContainer;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::datatransfer::XTransferable > xRef( pContainer );
+
+ nDragDropMode = NotifyStartDrag( *pContainer, pEntry );
+ if( !nDragDropMode || 0 == GetSelectionCount() )
+ {
+ nDragDropMode = nOldDragMode;
+ DragFinished( DND_ACTION_NONE );
+ return;
+ }
+
+ SvLBoxDDInfo aDDInfo;
+ memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
+ aDDInfo.pApp = GetpApp();
+ aDDInfo.pSource = this;
+ aDDInfo.pDDStartEntry = pEntry;
+ // let derived views do their thing
+ WriteDragServerInfo( rPosPixel, &aDDInfo );
+
+ pContainer->CopyAnyData( SOT_FORMATSTR_ID_TREELISTBOX,
+ (sal_Char*)&aDDInfo, sizeof(SvLBoxDDInfo) );
+ pDDSource = this;
+ pDDTarget = 0;
+
+ sal_Bool bOldUpdateMode = Control::IsUpdateMode();
+ Control::SetUpdateMode( sal_True );
+ Update();
+ Control::SetUpdateMode( bOldUpdateMode );
+
+ // Disallow using the selection and its children as drop targets.
+ // Important: If the selection of the SourceListBox is changed in the
+ // DropHandler, the entries have to be allowed as drop targets again:
+ // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );)
+ EnableSelectionAsDropTarget( sal_False, sal_True /* with children */ );
+
+ pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() );
+}
+
+void SvTreeListBox::DragFinished( sal_Int8
+#ifndef UNX
+nAction
+#endif
+)
+{
+ EnableSelectionAsDropTarget( sal_True, sal_True );
+
+#ifndef UNX
+ if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget &&
+ ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
+ !pDDTarget ))
+ {
+ RemoveSelection();
+ }
+#endif
+
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ pDDSource = 0;
+ pDDTarget = 0;
+ pTargetEntry = 0;
+ nDragDropMode = nOldDragMode;
+}
+
+DragDropMode SvTreeListBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return (DragDropMode)0xffff;
+}
+
+sal_Bool SvTreeListBox::NotifyAcceptDrop( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return sal_True;
+}
+
+// Handler and methods for Drag - finished handler.
+// The with get GetDragFinishedHdl() get link can set on the
+// TransferDataContainer. This link is a callback for the DragFinished
+// call. AddBox method is called from the GetDragFinishedHdl() and the
+// remove is called in link callback and in the destructor. So it can't
+// called to a deleted object.
+
+namespace
+{
+ struct SortLBoxes : public rtl::Static<std::set<sal_uLong>, SortLBoxes> {};
+}
+
+void SvTreeListBox::AddBoxToDDList_Impl( const SvTreeListBox& rB )
+{
+ sal_uLong nVal = (sal_uLong)&rB;
+ SortLBoxes::get().insert( nVal );
+}
+
+void SvTreeListBox::RemoveBoxFromDDList_Impl( const SvTreeListBox& rB )
+{
+ sal_uLong nVal = (sal_uLong)&rB;
+ SortLBoxes::get().erase( nVal );
+}
+
+IMPL_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8*, pAction )
+{
+ sal_uLong nVal = (sal_uLong)pThis;
+ std::set<sal_uLong> &rSortLBoxes = SortLBoxes::get();
+ std::set<sal_uLong>::const_iterator it = rSortLBoxes.find(nVal);
+ if( it != rSortLBoxes.end() )
+ {
+ pThis->DragFinished( *pAction );
+ rSortLBoxes.erase( it );
+ }
+ return 0;
+}
+
+Link SvTreeListBox::GetDragFinishedHdl() const
+{
+ AddBoxToDDList_Impl( *this );
+ return STATIC_LINK( this, SvTreeListBox, DragFinishHdl_Impl );
+}
+
+// --- boundary of former SvLBox ---
+
+/*
+ Bugs/TODO
+
+ - calculate rectangle when editing in-place (bug with some fonts)
+ - SetSpaceBetweenEntries: offset is not taken into account in SetEntryHeight
+*/
+
+#define TREEFLAG_FIXEDHEIGHT 0x0010
+
+
+DBG_NAME(SvTreeListBox)
+
+#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
+
void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
@@ -110,6 +1654,24 @@ void SvTreeListBox::InitTreeView()
SvTreeListBox::~SvTreeListBox()
{
DBG_DTOR(SvTreeListBox,0);
+ delete pEdCtrl;
+ pEdCtrl = 0;
+ pModel->RemoveView( this );
+ if ( pModel->GetRefCount() == 0 )
+ {
+ pModel->Clear();
+ delete pModel;
+ pModel = NULL;
+ }
+
+ SvTreeListBox::RemoveBoxFromDDList_Impl( *this );
+
+ if( this == pDDSource )
+ pDDSource = 0;
+ if( this == pDDTarget )
+ pDDTarget = 0;
+ delete pLBoxImpl;
+
pImp->CallEventListeners( VCLEVENT_OBJECT_DYING );
delete pImp;
delete pLBoxImpl->m_pLink;
@@ -125,13 +1687,25 @@ void SvTreeListBox::SetModel( SvLBoxTreeList* pNewModel )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetModel( pNewModel );
- SvLBox::SetModel( pNewModel );
+
+ // does the CleanUp
+ SvListView::SetModel( pNewModel );
+ pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
+ SvLBoxEntry* pEntry = First();
+ while( pEntry )
+ {
+ ModelHasInserted( pEntry );
+ pEntry = Next( pEntry );
+ }
}
void SvTreeListBox::DisconnectFromModel()
{
DBG_CHKTHIS(SvTreeListBox,0);
- SvLBox::DisconnectFromModel();
+ SvLBoxTreeList* pNewModel = new SvLBoxTreeList;
+ pNewModel->SetRefCount( 0 ); // else this will never be deleted
+ SvListView::SetModel( pNewModel );
+
pImp->SetModel( GetModel() );
}
@@ -157,7 +1731,9 @@ void SvTreeListBox::Resize()
DBG_CHKTHIS(SvTreeListBox,0);
if( IsEditingActive() )
EndEditing( sal_True );
- SvLBox::Resize();
+
+ Control::Resize();
+
pImp->Resize();
nFocusWidth = -1;
pImp->ShowCursor( sal_False );
@@ -399,9 +1975,9 @@ SvLBoxEntry* SvTreeListBox::InsertEntry(
pEntry->EnableChildrenOnDemand( bChildrenOnDemand );
if( !pParent )
- SvLBox::Insert( pEntry, nPos );
+ Insert( pEntry, nPos );
else
- SvLBox::Insert( pEntry, pParent, nPos );
+ Insert( pEntry, pParent, nPos );
aPrevInsertedExpBmp = rDefExpBmp;
aPrevInsertedColBmp = rDefColBmp;
@@ -429,9 +2005,9 @@ SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,
pEntry->EnableChildrenOnDemand( bChildrenOnDemand );
if( !pParent )
- SvLBox::Insert( pEntry, nPos );
+ Insert( pEntry, nPos );
else
- SvLBox::Insert( pEntry, pParent, nPos );
+ Insert( pEntry, pParent, nPos );
aPrevInsertedExpBmp = aExpEntryBmp;
aPrevInsertedColBmp = aCollEntryBmp;
@@ -718,10 +2294,13 @@ sal_Bool SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const rtl::OUString
return sal_True;
}
-void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn )
+void SvTreeListBox::EnableInplaceEditing( bool bOn )
{
DBG_CHKTHIS(SvTreeListBox,0);
- SvLBox::EnableInplaceEditing( bOn );
+ if (bOn)
+ nImpFlags |= SVLBOX_EDT_ENABLED;
+ else
+ nImpFlags &= ~SVLBOX_EDT_ENABLED;
}
void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
@@ -748,7 +2327,11 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
#endif
if( !pImp->KeyInput( rKEvt ) )
- SvLBox::KeyInput( rKEvt );
+ {
+ bool bHandled = HandleKeyInput( rKEvt );
+ if ( !bHandled )
+ Control::KeyInput( rKEvt );
+ }
nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
}
@@ -764,7 +2347,7 @@ void SvTreeListBox::GetFocus()
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->GetFocus();
- SvLBox::GetFocus();
+ Control::GetFocus();
SvLBoxEntry* pEntry = FirstSelected();
if ( pEntry )
@@ -776,7 +2359,7 @@ void SvTreeListBox::LoseFocus()
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->LoseFocus();
- SvLBox::LoseFocus();
+ Control::LoseFocus();
}
void SvTreeListBox::ModelHasCleared()
@@ -798,10 +2381,10 @@ void SvTreeListBox::ModelHasCleared()
AdjustEntryHeight( GetDefaultExpandedEntryBmp() );
AdjustEntryHeight( GetDefaultCollapsedEntryBmp() );
- SvLBox::ModelHasCleared();
+ SvListView::ModelHasCleared();
}
-void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /* bShow */ )
+void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /*bShow*/ )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->PaintDDCursor( pEntry );
@@ -845,14 +2428,14 @@ void SvTreeListBox::ScrollToAbsPos( long nPos )
void SvTreeListBox::SetSelectionMode( SelectionMode eSelectMode )
{
DBG_CHKTHIS(SvTreeListBox,0);
- SvLBox::SetSelectionMode( eSelectMode );
+ eSelMode = eSelectMode;
pImp->SetSelectionMode( eSelectMode );
}
void SvTreeListBox::SetDragDropMode( DragDropMode nDDMode )
{
DBG_CHKTHIS(SvTreeListBox,0);
- SvLBox::SetDragDropMode( nDDMode );
+ nDragDropMode = nDDMode;
pImp->SetDragDropMode( nDDMode );
}
@@ -895,7 +2478,7 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
if( nHeightMax > nEntryHeight )
{
nEntryHeight = nHeightMax;
- SvLBox::SetFont( GetFont() );
+ Control::SetFont( GetFont() );
pImp->SetEntryHeight( nHeightMax );
}
}
@@ -911,7 +2494,7 @@ void SvTreeListBox::SetEntryHeight( short nHeight, sal_Bool bAlways )
nTreeFlags |= TREEFLAG_FIXEDHEIGHT;
else
nTreeFlags &= ~TREEFLAG_FIXEDHEIGHT;
- SvLBox::SetFont( GetFont() );
+ Control::SetFont( GetFont() );
pImp->SetEntryHeight( nHeight );
}
}
@@ -1138,7 +2721,7 @@ void SvTreeListBox::SetFont( const Font& rFont )
void SvTreeListBox::Paint( const Rectangle& rRect )
{
DBG_CHKTHIS(SvTreeListBox,0);
- SvLBox::Paint( rRect );
+ Control::Paint( rRect );
if( nTreeFlags & TREEFLAG_RECALCTABS )
SetTabs();
pImp->Paint( rRect );
@@ -1223,8 +2806,15 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
void SvTreeListBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
+
// reinitialize the separate items of the entries
- SvLBox::ModelHasEntryInvalidated( pEntry );
+ sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
+ for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ )
+ {
+ SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx );
+ pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 );
+ }
+
// repaint
pImp->InvalidateEntry( (SvLBoxEntry*)pEntry );
}
@@ -1370,15 +2960,13 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
}
}
-
-
SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
{
DBG_CHKTHIS(SvTreeListBox,0);
// scroll
if( rPos.Y() < 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
+ ImplShowTargetEmphasis(pTargetEntry, false);
ScrollOutputArea( +1 );
}
else
@@ -1386,7 +2974,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
Size aSize( pImp->GetOutputSize() );
if( rPos.Y() > aSize.Height() - 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
+ ImplShowTargetEmphasis(pTargetEntry, false);
ScrollOutputArea( -1 );
}
}
@@ -2064,7 +3652,7 @@ void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags )
// after painting
pImp->RecalcFocusRect();
NotifyInvalidating();
- SvLBox::Invalidate( nInvalidateFlags );
+ Control::Invalidate( nInvalidateFlags );
pImp->Invalidate();
}
@@ -2076,7 +3664,7 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFl
// after painting
pImp->RecalcFocusRect();
NotifyInvalidating();
- SvLBox::Invalidate( rRect, nInvalidateFlags );
+ Control::Invalidate( rRect, nInvalidateFlags );
}
@@ -2186,7 +3774,7 @@ SvLBoxTab* SvTreeListBox::GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos
void SvTreeListBox::RequestHelp( const HelpEvent& rHEvt )
{
if( !pImp->RequestHelp( rHEvt ) )
- SvLBox::RequestHelp( rHEvt );
+ Control::RequestHelp( rHEvt );
}
void SvTreeListBox::CursorMoved( SvLBoxEntry* )
@@ -2209,7 +3797,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry
if( nActionId == LISTACTION_CLEARING )
CancelTextEditing();
- SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
+ SvListView::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
switch( nActionId )
{
case LISTACTION_INSERTED:
@@ -2337,10 +3925,14 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
Control::DataChanged( rDCEvt );
}
-void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
+void SvTreeListBox::StateChanged( StateChangedType eType )
{
- SvLBox::StateChanged( i_nStateChange );
- if ( i_nStateChange == STATE_CHANGE_STYLE )
+ if( eType == STATE_CHANGE_ENABLE )
+ Invalidate( INVALIDATE_CHILDREN );
+
+ Control::StateChanged( eType );
+
+ if ( eType == STATE_CHANGE_STYLE )
ImplInitStyle();
}
@@ -2486,9 +4078,8 @@ void SvTreeListBox::CallImplEventListeners(sal_uLong nEvent, void* pData)
CallEventListeners(nEvent, pData);
}
-void SvTreeListBox::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const
+void SvTreeListBox::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& /*rStateSet*/ ) const
{
- SvLBox::FillAccessibleStateSet( rStateSet );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index 8e77362b08f3..3e8648ccad95 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -27,7 +27,6 @@
************************************************************************/
-#define _SVTREEBX_CXX
#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
@@ -42,7 +41,8 @@
#include <rtl/ref.hxx>
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
+#include <svtools/svlbitm.hxx>
#include <map>
@@ -118,12 +118,12 @@ public:
UnoTreeListItem( SvLBoxEntry* );
UnoTreeListItem();
virtual ~UnoTreeListItem();
- void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
Image GetImage() const;
void SetImage( const Image& rImage );
OUString GetGraphicURL() const;
void SetGraphicURL( const OUString& rGraphicURL );
- void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
@@ -1608,7 +1608,7 @@ UnoTreeListItem::~UnoTreeListItem()
// --------------------------------------------------------------------
-void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry)
+void UnoTreeListItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry)
{
Point aPos( rPos );
if( _pEntry )
@@ -1676,7 +1676,7 @@ void UnoTreeListItem::SetGraphicURL( const OUString& rGraphicURL )
// --------------------------------------------------------------------
-void UnoTreeListItem::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
+void UnoTreeListItem::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
{
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index cdb58e639bb9..cd1688c392dc 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -44,7 +44,7 @@
#include <svl/numuno.hxx>
#include <svtools/calendar.hxx>
#include <svtools/prgsbar.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "treecontrolpeer.hxx"
#include "svtxgridcontrol.hxx"
#include <svtools/table/tablecontrol.hxx>
diff --git a/svx/inc/svx/checklbx.hxx b/svx/inc/svx/checklbx.hxx
index 79d35ae7b1c4..1e977ddeff83 100644
--- a/svx/inc/svx/checklbx.hxx
+++ b/svx/inc/svx/checklbx.hxx
@@ -28,7 +28,7 @@
#ifndef _SVX_CHECKLBX_HXX
#define _SVX_CHECKLBX_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/svlbitm.hxx>
#include <vcl/lstbox.hxx>
diff --git a/svx/inc/svx/ctredlin.hxx b/svx/inc/svx/ctredlin.hxx
index 74e92bcce50b..64348d9bbfc1 100644
--- a/svx/inc/svx/ctredlin.hxx
+++ b/svx/inc/svx/ctredlin.hxx
@@ -33,6 +33,7 @@
#include <vcl/combobox.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
+#include "svtools/svlbitm.hxx"
#include <vcl/lstbox.hxx>
#include <vcl/tabpage.hxx>
#include <vcl/field.hxx>
@@ -86,7 +87,7 @@ public:
SvLBoxColorString();
~SvLBoxColorString();
- void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
};
diff --git a/svx/inc/svx/fontlb.hxx b/svx/inc/svx/fontlb.hxx
index ab6dfe8081c6..dad16fa35218 100644
--- a/svx/inc/svx/fontlb.hxx
+++ b/svx/inc/svx/fontlb.hxx
@@ -30,6 +30,7 @@
#define SVX_FONTLB_HXX
#include <svtools/svtabbx.hxx>
+#include <svtools/svlbitm.hxx>
#include <vcl/virdev.hxx>
#include "svx/svxdllapi.h"
@@ -56,12 +57,12 @@ public:
/** Creates a new empty list box item. */
virtual SvLBoxItem* Create() const;
- void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ void InitViewData( SvTreeListBox*,SvLBoxEntry*,SvViewDataItem* );
/** Paints this entry to the specified position, using the own font settings. */
void Paint(
const Point& rPos,
- SvLBox& rDev,
+ SvTreeListBox& rDev,
sal_uInt16 nFlags,
SvLBoxEntry* pEntry );
};
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 01e1c4cdf174..e1600455b8e2 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -31,6 +31,7 @@
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
#include <svtools/txtcmp.hxx>
+#include <svtools/svlbitm.hxx>
#include <unotools/charclass.hxx>
#include <editeng/unolingu.hxx>
@@ -120,7 +121,7 @@ SvLBoxItem* SvLBoxColorString::Create() const
return new SvLBoxColorString;
}
-void SvLBoxColorString::Paint( const Point& rPos, SvLBox& rDev,
+void SvLBoxColorString::Paint( const Point& rPos, SvTreeListBox& rDev,
sal_uInt16 nFlags, SvLBoxEntry* pEntry )
/* [Description]
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 59126ffc1643..621c928dc6f0 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -892,7 +892,7 @@ RecovDocListEntry::RecovDocListEntry( SvLBoxEntry* pEntry,
//===============================================
void RecovDocListEntry::Paint(const Point& aPos ,
- SvLBox& aDevice,
+ SvTreeListBox& aDevice,
sal_uInt16 /*nFlags */,
SvLBoxEntry* pEntry )
{
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index b697a66061c8..eaaee5f49964 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -64,7 +64,7 @@ SvLBoxItem* SvLBoxFontString::Create() const
return new SvLBoxFontString;
}
-void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
+void SvLBoxFontString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
{
DBG_CHKTHIS( SvLBoxFontString, 0 );
Font aOldFont( rDev.GetFont() );
@@ -81,7 +81,7 @@ void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags
rDev.SetFont( aOldFont );
}
-void SvLBoxFontString::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
+void SvLBoxFontString::InitViewData( SvTreeListBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
{
DBG_CHKTHIS( SvLBoxFontString, 0 );
Font aOldFont( pView->GetFont() );
diff --git a/svx/source/dialog/simptabl.cxx b/svx/source/dialog/simptabl.cxx
index 97c223d094c4..e76ad7ba8f18 100644
--- a/svx/source/dialog/simptabl.cxx
+++ b/svx/source/dialog/simptabl.cxx
@@ -31,6 +31,7 @@
#include <comphelper/processfactory.hxx>
#include <unotools/intlwrapper.hxx>
+#include <svtools/svlbitm.hxx>
// SvxSimpleTableContainer ------------------------------------------------------
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 270b9562d81e..9a9fba93093a 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -62,6 +62,7 @@
#include <tools/shl.hxx>
#include <vcl/wrkwin.hxx>
#include <tools/diagnose_ex.h>
+#include <svtools/svlbitm.hxx>
#include <functional>
@@ -1040,13 +1041,13 @@ public:
FmFilterItemsString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const XubString& rStr )
:SvLBoxString(pEntry,nFlags,rStr){}
- virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
- virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData);
+ virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData);
};
const int nxDBmp = 12;
//------------------------------------------------------------------------
-void FmFilterItemsString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* pEntry )
+void FmFilterItemsString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* pEntry )
{
FmFilterItems* pRow = (FmFilterItems*)pEntry->GetUserData();
FmFormItem* pForm = (FmFormItem*)pRow->GetParent();
@@ -1079,7 +1080,7 @@ void FmFilterItemsString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nF
}
//------------------------------------------------------------------------
-void FmFilterItemsString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
+void FmFilterItemsString::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
{
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
@@ -1104,14 +1105,14 @@ public:
m_aName.AppendAscii(": ");
}
- virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
- virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData);
+ virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+ virtual void InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData);
};
const int nxD = 4;
//------------------------------------------------------------------------
-void FmFilterString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
+void FmFilterString::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData)
{
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
@@ -1128,7 +1129,7 @@ void FmFilterString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewData
}
//------------------------------------------------------------------------
-void FmFilterString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
+void FmFilterString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
{
Font aOldFont( rDev.GetFont());
Font aFont( aOldFont );
diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx
index 32c2bf1622bf..fab396509a3a 100644
--- a/svx/source/form/fmexch.cxx
+++ b/svx/source/form/fmexch.cxx
@@ -32,7 +32,7 @@
#include <svl/itempool.hxx>
#include <sot/formats.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <tools/diagnose_ex.h>
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index e814bfc0d6eb..462c9911665e 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -38,7 +38,7 @@
#include <vcl/toolbox.hxx>
#include <svtools/inettbc.hxx>
#include <svtools/svmedit.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sfx2/dockwin.hxx>
#include <sfx2/ctrlitem.hxx>
#include <svx/simptabl.hxx>
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index fe0254aed368..12cb6804b1d6 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -35,7 +35,8 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <svtools/svmedit2.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
+#include <svtools/svlbitm.hxx>
#include <svx/simptabl.hxx>
#include <cppuhelper/implbase1.hxx>
@@ -576,10 +577,8 @@ class RecovDocListEntry : public SvLBoxString
//---------------------------------------
/** @short TODO */
- virtual void Paint(const Point& aPos ,
- SvLBox& aDevice,
- sal_uInt16 nFlags ,
- SvLBoxEntry* pEntry );
+ virtual void Paint(
+ const Point& aPos, SvTreeListBox& aDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
//===============================================
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index cb80e295820c..753b38db21a2 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -41,7 +41,7 @@
#include <sfx2/dockwin.hxx>
#include <sfx2/ctrlitem.hxx>
#include <vcl/image.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/dialog.hxx>
#include <vcl/group.hxx>
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index 6d7131ae050a..89a8dd67702b 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -47,7 +47,7 @@
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/dialog.hxx>
#include <vcl/group.hxx>
diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx
index 3362316204c3..ba6f87c1be98 100644
--- a/svx/source/inc/tabwin.hxx
+++ b/svx/source/inc/tabwin.hxx
@@ -19,7 +19,7 @@
#ifndef _SVX_TABWIN_HXX
#define _SVX_TABWIN_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/floatwin.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/childwin.hxx>
@@ -51,10 +51,10 @@ protected:
// DragSourceHelper
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
- // SvLBox
+ // SvTreeListBox
virtual sal_Bool DoubleClickHdl();
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::ExecuteDrop;
};
//========================================================================
diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx
index 0c487f6af7ac..2218543b9de6 100644
--- a/svx/source/tbxctrls/extrusioncontrols.hxx
+++ b/svx/source/tbxctrls/extrusioncontrols.hxx
@@ -30,7 +30,7 @@
#include "svx/svxdllapi.h"
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/field.hxx>
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 3d347f319d78..f58ef9e722c6 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/Locale.hpp>
// header for class HeaderBar
#include <svtools/headbar.hxx>
+#include <svtools/svlbitm.hxx>
// header for define RET_OK
#include <vcl/msgbox.hxx>
// header for class SvtLinguConfigItem
diff --git a/svx/workben/msview/msview.cxx b/svx/workben/msview/msview.cxx
index 03c0375f578d..4d35ebaf515b 100644
--- a/svx/workben/msview/msview.cxx
+++ b/svx/workben/msview/msview.cxx
@@ -47,7 +47,7 @@
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
#include <vcl/unohelp2.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svtools/svmedit.hxx>
#include <sfx2/filedlghelper.hxx>
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 11f89c23eebd..17ae90ee6f7f 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -37,7 +37,7 @@
#include <vcl/lstbox.hxx>
#include <svtools/svmedit.hxx>
#include <svtools/headbar.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/combobox.hxx>
#include <svl/lstner.hxx>
class SwMailMergeWizard;
diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx
index 2c7c4007a443..d4d98dc17fc8 100644
--- a/sw/source/ui/envelp/labimp.hxx
+++ b/sw/source/ui/envelp/labimp.hxx
@@ -80,7 +80,7 @@
#include <com/sun/star/awt/XLayoutConstrains.hpp>
#include <com/sun/star/awt/XProgressBar.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <label.hxx>
#include <labimg.hxx>
#include <vector>
diff --git a/sw/source/ui/fldui/FldRefTreeListBox.hxx b/sw/source/ui/fldui/FldRefTreeListBox.hxx
index bdb7d1c7e14e..782f4571013d 100644
--- a/sw/source/ui/fldui/FldRefTreeListBox.hxx
+++ b/sw/source/ui/fldui/FldRefTreeListBox.hxx
@@ -19,7 +19,7 @@
#ifndef _FLDREFTREELISTBOX_HXX
#define _FLDREFTREELISTBOX_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
class SwFldRefTreeListBox : public SvTreeListBox
{
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index 57182d6ed1b2..0ab9d75758c4 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -33,7 +33,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/button.hxx>
#include <vcl/group.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include "numfmtlb.hxx"
#include "fldpage.hxx"
diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx
index 92a4cc00fd25..c7f6042c6e47 100644
--- a/sw/source/ui/inc/changedb.hxx
+++ b/sw/source/ui/inc/changedb.hxx
@@ -33,7 +33,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <svtools/stdctrl.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svx/stddlg.hxx>
#include "dbtree.hxx"
diff --git a/sw/source/ui/inc/cnttab.hxx b/sw/source/ui/inc/cnttab.hxx
index e18522b42d6f..ae91648db673 100644
--- a/sw/source/ui/inc/cnttab.hxx
+++ b/sw/source/ui/inc/cnttab.hxx
@@ -35,7 +35,7 @@
#include <toxmgr.hxx>
#include <svx/checklbx.hxx>
#include <tools/resary.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/menubtn.hxx>
#include <svx/langbox.hxx>
diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx
index 01e90a6c9056..5725a5df0826 100644
--- a/sw/source/ui/inc/conttree.hxx
+++ b/sw/source/ui/inc/conttree.hxx
@@ -28,7 +28,8 @@
#ifndef _CONTTREE_HXX
#define _CONTTREE_HXX
-#include <svtools/svtreebx.hxx>
+#include "svtools/treelistbox.hxx"
+#include "svtools/svlbitm.hxx"
#include "swcont.hxx"
#include <map>
@@ -101,7 +102,7 @@ class SwContentTree : public SvTreeListBox
void FindActiveTypeAndRemoveUserData();
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::ExecuteDrop;
using SvTreeListBox::EditEntry;
using SvListView::Expand;
using SvListView::Collapse;
@@ -219,7 +220,7 @@ public:
{
}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry);
};
@@ -254,8 +255,8 @@ private:
DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
- using SvLBox::DoubleClickHdl;
- using SvLBox::ExecuteDrop;
+ using SvTreeListBox::DoubleClickHdl;
+ using SvTreeListBox::ExecuteDrop;
using Window::Update;
protected:
diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx
index 08d29470ebf0..fdcaf5368259 100644
--- a/sw/source/ui/inc/dbtree.hxx
+++ b/sw/source/ui/inc/dbtree.hxx
@@ -28,7 +28,7 @@
#ifndef _DBTREE_HXX
#define _DBTREE_HXX
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <com/sun/star/uno/Reference.h>
#include "swdllapi.h"
diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx
index 2181cc576ba4..c707f46e25e6 100644
--- a/sw/source/ui/inc/glossary.hxx
+++ b/sw/source/ui/inc/glossary.hxx
@@ -29,7 +29,7 @@
#define _GLOSSARY_HXX
#include <vcl/edit.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <svx/stddlg.hxx>
#include <vcl/button.hxx>
diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx
index 0217dbfd7f31..8fce92f63ed1 100644
--- a/sw/source/ui/inc/regionsw.hxx
+++ b/sw/source/ui/inc/regionsw.hxx
@@ -36,7 +36,7 @@
#include <vcl/fixed.hxx>
#include <vcl/combobox.hxx>
#include <vcl/group.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/tabdlg.hxx>
#include <editeng/brshitem.hxx>
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 30f1c5f0627e..8c57979a3f4a 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -43,7 +43,7 @@
#include "tox.hxx"
#include <toxmgr.hxx>
#include <svx/checklbx.hxx>
-#include <svtools/svtreebx.hxx>
+#include <svtools/treelistbox.hxx>
#include <vcl/menubtn.hxx>
#include <svx/langbox.hxx>
#include <cnttab.hxx>
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index c3d0d44c2ee5..c000e4c980d5 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -3130,7 +3130,7 @@ public:
SwContentLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags,
const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {}
- virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+ virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry);
};
@@ -3145,7 +3145,7 @@ void SwContentTree::InitEntry(SvLBoxEntry* pEntry,
pEntry->ReplaceItem( pStr, nColToHilite );
}
-void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+void SwContentLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry )
{
if(lcl_IsContent(pEntry) &&
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index bd460d33f5a0..f3d2929c7597 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -1234,7 +1234,7 @@ void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry,
pEntry->ReplaceItem( pStr, nColToHilite );
}
-void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+void SwLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry )
{
SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData();