diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-04-29 07:49:48 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-04-29 07:49:48 +0000 |
commit | 6f50b222758cc4cac01e3179fb776d39036ac819 (patch) | |
tree | fa8f9bb38e74895cb1dc025f378d8777ead934a6 /dbaccess/source/ui | |
parent | #98772# many new bitmaps (diff) | |
download | core-6f50b222758cc4cac01e3179fb776d39036ac819.tar.gz core-6f50b222758cc4cac01e3179fb776d39036ac819.zip |
#98772# hi contrast changes
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/control/marktree.cxx | 34 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 81 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.src | 25 |
3 files changed, 108 insertions, 32 deletions
diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx index f34517ba5d54..0773c97ab65f 100644 --- a/dbaccess/source/ui/control/marktree.cxx +++ b/dbaccess/source/ui/control/marktree.cxx @@ -2,9 +2,9 @@ * * $RCSfile: marktree.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-06-20 09:53:46 $ + * last change: $Author: oj $ $Date: 2002-04-29 08:49:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,13 +83,11 @@ namespace dbaui //------------------------------------------------------------------------ OMarkableTreeListBox::OMarkableTreeListBox( Window* pParent, WinBits nWinStyle ) : SvTreeListBox(pParent,nWinStyle) { - SetNodeBitmaps( Bitmap(ModuleRes(BMP_PLUSBUTTON)),Bitmap(ModuleRes(BMP_MINUSBUTTON))); InitButtonData(); } //------------------------------------------------------------------------ -OMarkableTreeListBox::OMarkableTreeListBox( Window* pParent, const ResId& rResId ) : SvTreeListBox(pParent,rResId) +OMarkableTreeListBox::OMarkableTreeListBox( Window* pParent, const ResId& rResId) : SvTreeListBox(pParent,rResId) { - SetNodeBitmaps( Bitmap(ModuleRes(BMP_PLUSBUTTON)),Bitmap(ModuleRes(BMP_MINUSBUTTON))); InitButtonData(); } //------------------------------------------------------------------------ @@ -97,6 +95,18 @@ OMarkableTreeListBox::~OMarkableTreeListBox() { delete m_pCheckButton; } +// ----------------------------------------------------------------------------- +void OMarkableTreeListBox::notifyHiContrastChanged() +{ + OSL_ENSURE(m_pCheckButton,"No CheckButton!"); + sal_Bool bHiContrast = GetBackground().GetColor().IsDark(); + m_pCheckButton->aBmps[SV_BMP_UNCHECKED] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_UNCHECKED_SCH : BMP_CHECKBUTTON_UNCHECKED ) ); + m_pCheckButton->aBmps[SV_BMP_CHECKED] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_CHECKED_SCH : BMP_CHECKBUTTON_CHECKED ) ); + m_pCheckButton->aBmps[SV_BMP_HICHECKED] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_HICHECKED_SCH : BMP_CHECKBUTTON_HICHECKED ) ); + m_pCheckButton->aBmps[SV_BMP_HIUNCHECKED] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_UNCHECKED_SCH : BMP_CHECKBUTTON_UNCHECKED ) ); + m_pCheckButton->aBmps[SV_BMP_TRISTATE] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_TRISTATE_SCH : BMP_CHECKBUTTON_TRISTATE ) ); + m_pCheckButton->aBmps[SV_BMP_HITRISTATE] = Bitmap( ResId( bHiContrast ? BMP_CHECKBUTTON_HITRISTATE_SCH : BMP_CHECKBUTTON_HITRISTATE ) ); +} //------------------------------------------------------------------------ void OMarkableTreeListBox::Paint(const Rectangle& _rRect) { @@ -118,13 +128,12 @@ void OMarkableTreeListBox::Paint(const Rectangle& _rRect) //------------------------------------------------------------------------ void OMarkableTreeListBox::InitButtonData() { + sal_Bool bHiContrast = GetBackground().GetColor().IsDark(); + SetNodeBitmaps( Bitmap(ModuleRes( bHiContrast ? BMP_PLUSBUTTON_SCH : BMP_PLUSBUTTON)), + Bitmap(ModuleRes( bHiContrast ? BMP_MINUSBUTTON_SCH : BMP_MINUSBUTTON))); + m_pCheckButton = new SvLBoxButtonData(); - m_pCheckButton->aBmps[SV_BMP_UNCHECKED] = Bitmap( ResId( BMP_CHECKBUTTON_UNCHECKED ) ); - m_pCheckButton->aBmps[SV_BMP_CHECKED] = Bitmap( ResId( BMP_CHECKBUTTON_CHECKED ) ); - m_pCheckButton->aBmps[SV_BMP_HICHECKED] = Bitmap( ResId( BMP_CHECKBUTTON_HICHECKED ) ); - m_pCheckButton->aBmps[SV_BMP_HIUNCHECKED] = Bitmap( ResId( BMP_CHECKBUTTON_UNCHECKED ) ); - m_pCheckButton->aBmps[SV_BMP_TRISTATE] = Bitmap( ResId( BMP_CHECKBUTTON_TRISTATE ) ); - m_pCheckButton->aBmps[SV_BMP_HITRISTATE] = Bitmap( ResId( BMP_CHECKBUTTON_HITRISTATE ) ); + OMarkableTreeListBox::notifyHiContrastChanged(); EnableCheckButton( m_pCheckButton ); } //------------------------------------------------------------------------ @@ -358,6 +367,9 @@ SvLBoxEntry* OMarkableTreeListBox::GetEntryPosByName(const String& aName,SvLBoxE /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.5 2001/06/20 09:53:46 fs + * #88485# corrected implDetermineState for a special case + * * Revision 1.4 2001/04/27 08:10:27 fs * +implDeterminedState - needed to correctly implement CheckButtons * diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 8decd60bf639..46c5bb395e2f 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tabletree.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: fs $ $Date: 2001-08-28 08:21:51 $ + * last change: $Author: oj $ $Date: 2002-04-29 08:49:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -124,27 +124,65 @@ using namespace ::com::sun::star::container; using namespace ::dbtools; using namespace ::comphelper; +#define TABLE_TYPE 1 +#define VIEW_TYPE 2 +#define FOLDER_TYPE 3 + //======================================================================== //= OTableTreeListBox //======================================================================== -OTableTreeListBox::OTableTreeListBox( Window* pParent, WinBits nWinStyle,sal_Bool _bVirtualRoot ) +OTableTreeListBox::OTableTreeListBox( Window* pParent, sal_Bool _bHiContrast,WinBits nWinStyle,sal_Bool _bVirtualRoot ) :OMarkableTreeListBox(pParent,nWinStyle) - ,m_aTableImage(ResId(TABLE_TREE_ICON)) - ,m_aViewImage(ResId(VIEW_TREE_ICON)) ,m_bVirtualRoot(_bVirtualRoot) { - SetDefaultExpandedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON))); - SetDefaultCollapsedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON))); + notifyHiContrastChanged(); } //------------------------------------------------------------------------ -OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId ,sal_Bool _bVirtualRoot) +OTableTreeListBox::OTableTreeListBox( Window* pParent, const ResId& rResId ,sal_Bool _bHiContrast,sal_Bool _bVirtualRoot) :OMarkableTreeListBox(pParent,rResId) - ,m_aTableImage(ModuleRes(TABLE_TREE_ICON)) - ,m_aViewImage(ModuleRes(VIEW_TREE_ICON)) ,m_bVirtualRoot(_bVirtualRoot) { - SetDefaultExpandedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON))); - SetDefaultCollapsedEntryBmp(Image(ModuleRes(TABLEFOLDER_TREE_ICON))); + notifyHiContrastChanged(); +} +// ----------------------------------------------------------------------------- +void OTableTreeListBox::notifyHiContrastChanged() +{ + OMarkableTreeListBox::notifyHiContrastChanged(); + + sal_Bool bHiContrast = GetBackground().GetColor().IsDark(); + m_aTableImage = Image(ModuleRes(bHiContrast ? TABLE_TREE_ICON_SCH : TABLE_TREE_ICON)); + m_aViewImage = Image(ModuleRes(bHiContrast ? VIEW_TREE_ICON_SCH : VIEW_TREE_ICON)); + + SetDefaultExpandedEntryBmp(Image(ModuleRes(bHiContrast ? TABLEFOLDER_TREE_ICON_SCH : TABLEFOLDER_TREE_ICON))); + SetDefaultCollapsedEntryBmp(Image(ModuleRes(bHiContrast ? TABLEFOLDER_TREE_ICON_SCH : TABLEFOLDER_TREE_ICON))); + + SvLBoxEntry* pEntryLoop = First(); + while (pEntryLoop) + { + sal_Int32 nType = reinterpret_cast<sal_Int32>(pEntryLoop->GetUserData()); + if ( nType ) + { + USHORT nCount = pEntryLoop->ItemCount(); + for (USHORT i=0;i<nCount;++i) + { + SvLBoxItem* pItem = pEntryLoop->GetItem(i); + if ( pItem && pItem->IsA() == SV_ITEM_ID_LBOXCONTEXTBMP) + { + Image aImage; + switch( nType ) + { + case TABLE_TYPE: aImage = m_aTableImage; break; + case VIEW_TYPE: aImage = m_aViewImage; break; + default: aImage = Image(ModuleRes(bHiContrast ? TABLEFOLDER_TREE_ICON_SCH : TABLEFOLDER_TREE_ICON)); + } + static_cast<SvLBoxContextBmp*>(pItem)->SetBitmap1(pEntryLoop,aImage); + static_cast<SvLBoxContextBmp*>(pItem)->SetBitmap2(pEntryLoop,aImage); + break; + } + } + } + pEntryLoop = Next(pEntryLoop); + } } //------------------------------------------------------------------------ void OTableTreeListBox::Command( const CommandEvent& rEvt ) @@ -377,7 +415,7 @@ void OTableTreeListBox::UpdateTableList(const Reference< XDatabaseMetaData >& _r sRootEntryText = String(ModuleRes(STR_ALL_VIEWS)); else sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS)); - pAllObjects = InsertEntry(sRootEntryText); + pAllObjects = InsertEntry(sRootEntryText,NULL,FALSE,LIST_APPEND,reinterpret_cast<void*>(FOLDER_TYPE)); } if (!_rTables.getLength() && !_rViews.getLength()) @@ -412,7 +450,8 @@ void OTableTreeListBox::UpdateTableList(const Reference< XDatabaseMetaData >& _r _rxConnMetaData, *pCurrentTable, bIsView ? m_aViewImage : m_aTableImage, - pAllObjects + pAllObjects, + bIsView ? VIEW_TYPE : TABLE_TYPE ); } } @@ -519,7 +558,8 @@ void OTableTreeListBox::implAddEntry( const Reference< XDatabaseMetaData >& _rxConnMetaData, const ::rtl::OUString& _rTableName, const Image& _rImage, - SvLBoxEntry* _pParentEntry + SvLBoxEntry* _pParentEntry, + sal_Int32 _nType ) { // split the complete name into it's components @@ -532,7 +572,7 @@ void OTableTreeListBox::implAddEntry( { pCat = GetEntryPosByName(sCatalog, _pParentEntry); if (!pCat) - pCat = InsertEntry(sCatalog, _pParentEntry); + pCat = InsertEntry(sCatalog, _pParentEntry,FALSE,LIST_APPEND,reinterpret_cast<void*>(FOLDER_TYPE)); _pParentEntry = pCat; } @@ -540,12 +580,12 @@ void OTableTreeListBox::implAddEntry( { pSchema = GetEntryPosByName(sSchema, _pParentEntry); if (!pSchema) - pSchema = InsertEntry(sSchema, _pParentEntry); + pSchema = InsertEntry(sSchema, _pParentEntry,FALSE,LIST_APPEND,reinterpret_cast<void*>(FOLDER_TYPE)); _pParentEntry = pSchema; } if (!GetEntryPosByName(sName, _pParentEntry)) - InsertEntry(sName, _rImage, _rImage, _pParentEntry); + InsertEntry(sName, _rImage, _rImage, _pParentEntry,FALSE,LIST_APPEND,reinterpret_cast<void*>(_nType)); } //------------------------------------------------------------------------ @@ -563,7 +603,7 @@ void OTableTreeListBox::addedTable( const Reference< XConnection >& _rxConn, con } // add the entry - implAddEntry( xMeta, _rName, m_aTableImage, getAllObjectsEntry() ); + implAddEntry( xMeta, _rName, m_aTableImage, getAllObjectsEntry(),TABLE_TYPE ); // TODO: the image } catch( const Exception& ) @@ -601,6 +641,9 @@ void OTableTreeListBox::removedTable( const Reference< XConnection >& _rxConn, c /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.19 2001/08/28 08:21:51 fs + * #91573# UpdateTableList returns the driver used for connecting + * * Revision 1.18 2001/08/14 14:13:33 fs * #86945# removed the tables container parameter from UpdateTableList * diff --git a/dbaccess/source/ui/control/tabletree.src b/dbaccess/source/ui/control/tabletree.src index 469666650a88..dbe8cd314186 100644 --- a/dbaccess/source/ui/control/tabletree.src +++ b/dbaccess/source/ui/control/tabletree.src @@ -2,9 +2,9 @@ * * $RCSfile: tabletree.src,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: kz $ $Date: 2002-01-25 21:07:17 $ + * last change: $Author: oj $ $Date: 2002-04-29 08:49:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,24 @@ Image TABLEFOLDER_TREE_ICON MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; +Image TABLE_TREE_ICON_SCH +{ + ImageBitmap = Bitmap { File = "sxh03188.bmp"; }; + MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; +}; + +Image VIEW_TREE_ICON_SCH +{ + ImageBitmap = Bitmap { File = "sxh16670.bmp"; }; + MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; +}; + +Image TABLEFOLDER_TREE_ICON_SCH +{ + ImageBitmap = Bitmap { File = "sxh03187.bmp"; }; + MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; +}; + Menu MENU_TABLETREE_POPUP { ItemList = @@ -351,6 +369,9 @@ String STR_ALL_TABLES_AND_VIEWS /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.23 2002/01/25 21:07:17 kz + * Merge SRC641: 25.01.02 - 22:06:46 + * * Revision 1.22 2002/01/14 21:12:00 kz * Merge SRC641: 01/14/02 - 22:07:08 * |