diff options
author | Kai Ahrens <ka@openoffice.org> | 2000-11-17 09:48:12 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2000-11-17 09:48:12 +0000 |
commit | 35364904560975e08e944f7ad8029ffd04edd9de (patch) | |
tree | 71c05fc17e9410f861f8ea37cbb0c9d9c296650d /svx | |
parent | 026e046c1879c9ef73ba624f0f18bdeca7e328cf (diff) |
QueryBox for delete; MouseEventHandler/ValueSet)
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 7 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 105 | ||||
-rw-r--r-- | svx/source/gallery2/gallery.src | 10 |
3 files changed, 58 insertions, 64 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 7628c5aa96c9..66060a88a595 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galbrws1.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ka $ $Date: 2000-11-16 12:16:21 $ + * last change: $Author: ka $ $Date: 2000-11-17 10:47:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -364,7 +364,8 @@ IMPL_LINK( GalleryBrowser1, PopupMenuHdl, Menu*, pMenu ) case( MN_DELETE ): { - mpGallery->RemoveTheme( mpThemes->GetSelectEntry() ); + if( QueryBox( this, WB_YES_NO, String( GAL_RESID( RID_SVXSTR_GALLERY_DELETETHEME ) ) ).Execute() == RET_YES ) + mpGallery->RemoveTheme( mpThemes->GetSelectEntry() ); } break; diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 77a16bfeb2ca..3fce19363a5e 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galbrws2.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ka $ $Date: 2000-11-16 12:16:21 $ + * last change: $Author: ka $ $Date: 2000-11-17 10:47:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,6 +112,7 @@ GalleryValueSet::GalleryValueSet( GalleryBrowser2* pParent, GalleryTheme* pTheme mpTheme ( pTheme ) { EnableDrop( TRUE ); + EnableFullItemMode( FALSE ); } // ------------------------------------------------------------------------ @@ -177,38 +178,7 @@ void GalleryValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aGraphic.Draw( pDev, aPos, aSize ); } - if( GetStyle() & WB_NAMEFIELD ) - { - String aItemText; - - if( mpTheme->IsImported() ) - { - INetURLObject aPathTmp( mpTheme->GetParent()->GetImportURL( mpTheme->GetName() ) ); - - aPathTmp.removeSegment(); - aPathTmp.Append( mpTheme->GetObjectURL( nId - 1 ).GetName() ); - aItemText = aPathTmp.GetMainURL(); - } - else - aItemText = mpTheme->GetObjectURL( nId - 1 ).GetMainURL(); - - if( pObj->GetTitle().Len() ) - { - String aTitleItemText( pObj->GetTitle() ); - - if( pObj->GetObjKind() != SGA_OBJ_SVDRAW ) - { - aTitleItemText += String( RTL_CONSTASCII_USTRINGPARAM( " (" ) ); - aTitleItemText += aItemText; - aTitleItemText += ')'; - } - - aItemText = aTitleItemText; - } - - SetItemText( nId, aItemText ); - } - + SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj ) ); mpTheme->ReleaseObject( pObj ); } } @@ -218,8 +188,12 @@ void GalleryValueSet::UserDraw( const UserDrawEvent& rUDEvt ) void GalleryValueSet::MouseButtonDown( const MouseEvent& rMEvt ) { + BOOL bDefOnly = ( rMEvt.GetClicks() > 1 ) && rMEvt.IsMod1(); + ValueSet::MouseButtonDown( rMEvt ); - GetParent()->MouseButtonDown( rMEvt ); + + if( !bDefOnly ) + GetParent()->MouseButtonDown( rMEvt ); } // ------------------------------------------------------------------------ @@ -686,39 +660,52 @@ void GalleryBrowser2::ImplUpdateInfoBar() if( !mpValueSet->IsNoSelection() && ( nObjPos < mpCurTheme->GetObjectCount() ) ) { - SgaObject* pObj = mpCurTheme->AcquireObject( nObjPos ); - - aInfoText += String( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); + SgaObject* pObj = mpCurTheme->AcquireObject( nObjPos ); - if( mpCurTheme->IsImported() ) + if( pObj ) { - INetURLObject aPathTmp( mpCurTheme->GetParent()->GetImportURL( mpCurTheme->GetName() ) ); - - aPathTmp.removeSegment(); - aPathTmp.Append( mpCurTheme->GetObjectURL( nObjPos ).GetName() ); - aInfoText += aPathTmp.GetMainURL(); + aInfoText = GetItemText( *mpCurTheme, *pObj ); + mpCurTheme->ReleaseObject( pObj ); } - else if( pObj && pObj->GetTitle().Len() ) - { - String aTitleItemText( pObj->GetTitle() ); + } + } - if( pObj->GetObjKind() != SGA_OBJ_SVDRAW ) - { - aTitleItemText += String( RTL_CONSTASCII_USTRINGPARAM( " (" ) ); - aTitleItemText += mpCurTheme->GetObjectURL( nObjPos ).GetMainURL(); - aTitleItemText += ')'; - } + maInfoBar.SetText( aInfoText ); +} - aInfoText += aTitleItemText; - } - else - aInfoText += mpCurTheme->GetObjectURL( nObjPos ).GetMainURL(); +// ----------------------------------------------------------------------------- + +String GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj ) +{ + String aRet( rTheme.GetName() ); - mpCurTheme->ReleaseObject( pObj ); + aRet += String( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); + + if( rTheme.IsImported() ) + { + INetURLObject aPathTmp( rTheme.GetParent()->GetImportURL( rTheme.GetName() ) ); + + aPathTmp.removeSegment(); + aPathTmp.Append( rObj.GetURL().GetName() ); + aRet += aPathTmp.GetMainURL(); + } + else if( rObj.GetTitle().Len() ) + { + String aTitleItemText( rObj.GetTitle() ); + + if( rObj.GetObjKind() != SGA_OBJ_SVDRAW ) + { + aTitleItemText += String( RTL_CONSTASCII_USTRINGPARAM( " (" ) ); + aTitleItemText += rObj.GetURL().GetMainURL(); + aTitleItemText += ')'; } + + aRet += aTitleItemText; } + else + aRet += rObj.GetURL().GetMainURL(); - maInfoBar.SetText( aInfoText ); + return aRet; } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src index 95a9fba556e8..036c4c47ab69 100644 --- a/svx/source/gallery2/gallery.src +++ b/svx/source/gallery2/gallery.src @@ -2,9 +2,9 @@ * * $RCSfile: gallery.src,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: rt $ $Date: 2000-11-15 20:59:17 $ + * last change: $Author: ka $ $Date: 2000-11-17 10:48:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1314,6 +1314,12 @@ String RID_SVXSTR_GALLERY_DELETEOBJ Text[ turkish ] = "Bu nesneyi gerekten\nsilmek istiyor musunuz?"; Text[ language_user1 ] = " "; }; +String RID_SVXSTR_GALLERY_DELETETHEME +{ + Text = "Mchten Sie dieses Thema\nwirklich lschen?" ; + Text [ ENGLISH ] = "Do you really want to\n delete this theme?" ; + Text [ english_us ] = "Do you really want to\ndelete this theme?" ; +}; String RID_SVXSTR_EXTFORMAT1_SYS { Text = "wav" ; |