new member for hiding first entry
This commit is contained in:
parent
8080cddf3e
commit
15175b3575
2 changed files with 30 additions and 17 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: tabletree.cxx,v $
|
||||
*
|
||||
* $Revision: 1.7 $
|
||||
* $Revision: 1.8 $
|
||||
*
|
||||
* last change: $Author: fs $ $Date: 2001-01-30 08:29:43 $
|
||||
* last change: $Author: oj $ $Date: 2001-02-05 14:44:53 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -127,19 +127,21 @@ using namespace ::comphelper;
|
|||
//========================================================================
|
||||
//= OTableTreeListBox
|
||||
//========================================================================
|
||||
OTableTreeListBox::OTableTreeListBox( Window* pParent, WinBits nWinStyle )
|
||||
OTableTreeListBox::OTableTreeListBox( Window* pParent, WinBits nWinStyle,sal_Bool _bShowFirstEntry )
|
||||
:OMarkableTreeListBox(pParent,nWinStyle)
|
||||
,m_aTableImage(ResId(TABLE_TREE_ICON))
|
||||
,m_aViewImage(ResId(VIEW_TREE_ICON))
|
||||
,m_bShowFirstEntry(_bShowFirstEntry)
|
||||
{
|
||||
SetDefaultExpandedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON)));
|
||||
SetDefaultCollapsedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON)));
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId )
|
||||
OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId ,sal_Bool _bShowFirstEntry)
|
||||
:OMarkableTreeListBox(pParent,rResId)
|
||||
,m_aTableImage(ModuleRes(TABLE_TREE_ICON))
|
||||
,m_aViewImage(ModuleRes(VIEW_TREE_ICON))
|
||||
,m_bShowFirstEntry(_bShowFirstEntry)
|
||||
{
|
||||
SetDefaultExpandedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON)));
|
||||
SetDefaultCollapsedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON)));
|
||||
|
@ -366,14 +368,18 @@ void OTableTreeListBox::UpdateTableList(const Reference< XDatabaseMetaData >& _r
|
|||
try
|
||||
{
|
||||
// the root entry saying "all objects"
|
||||
String sRootEntryText;
|
||||
if (!_rViews.getLength())
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_TABLES));
|
||||
else if (!_rTables.getLength())
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_VIEWS));
|
||||
else
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS));
|
||||
SvLBoxEntry* pAllObjects = InsertEntry(sRootEntryText);
|
||||
SvLBoxEntry* pAllObjects = NULL;
|
||||
if(m_bShowFirstEntry)
|
||||
{
|
||||
String sRootEntryText;
|
||||
if (!_rViews.getLength())
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_TABLES));
|
||||
else if (!_rTables.getLength())
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_VIEWS));
|
||||
else
|
||||
sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS));
|
||||
pAllObjects = InsertEntry(sRootEntryText);
|
||||
}
|
||||
|
||||
// get the table/view names
|
||||
const ::rtl::OUString* pTables = NULL;
|
||||
|
@ -456,7 +462,7 @@ void OTableTreeListBox::checkWildcard(SvLBoxEntry* _pEntry)
|
|||
//------------------------------------------------------------------------
|
||||
SvLBoxEntry* OTableTreeListBox::getAllObjectsEntry() const
|
||||
{
|
||||
return First();
|
||||
return m_bShowFirstEntry ? First() : NULL;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
@ -520,6 +526,9 @@ void OTableTreeListBox::InitEntry(SvLBoxEntry* _pEntry, const XubString& _rStrin
|
|||
/*************************************************************************
|
||||
* history:
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2001/01/30 08:29:43 fs
|
||||
* 'wildcard checking'
|
||||
*
|
||||
* Revision 1.6 2001/01/15 10:55:43 oj
|
||||
* wrong image for table used
|
||||
*
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: tabletree.hxx,v $
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* last change: $Author: fs $ $Date: 2001-01-30 08:28:15 $
|
||||
* last change: $Author: oj $ $Date: 2001-02-05 14:45:04 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -97,10 +97,11 @@ protected:
|
|||
Image m_aViewImage;
|
||||
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
|
||||
sal_Bool m_bShowFirstEntry; // should the first entry be visible
|
||||
|
||||
public:
|
||||
OTableTreeListBox( Window* pParent, WinBits nWinStyle = NULL );
|
||||
OTableTreeListBox( Window* pParent, const ResId& rResId );
|
||||
OTableTreeListBox( Window* pParent, WinBits nWinStyle = NULL,sal_Bool _bShowFirstEntry=sal_True );
|
||||
OTableTreeListBox( Window* pParent, const ResId& rResId,sal_Bool _bShowFirstEntry=sal_True );
|
||||
|
||||
void setServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB)
|
||||
{ m_xORB = _rxORB; }
|
||||
|
@ -163,6 +164,9 @@ protected:
|
|||
/*************************************************************************
|
||||
* history:
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2001/01/30 08:28:15 fs
|
||||
* 'wildcard checking'
|
||||
*
|
||||
* Revision 1.2 2000/10/30 15:20:02 fs
|
||||
* #79816# second UpdateTableList got other parameters
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue