summaryrefslogtreecommitdiff
path: root/svtools/source/contnr/svlbitm.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-12-20 13:17:08 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-12-20 13:17:08 +0000
commitde5b0c4c2e9f741703ee1fd40218ebb62f2f18b6 (patch)
tree328d0319548116db6d6b8486b8e8f27c3d6d048c /svtools/source/contnr/svlbitm.cxx
parent374c9a1e601b4facbc92a6bf8901ac46947d3b8d (diff)
INTEGRATION: CWS jl49 (1.11.84); FILE MERGED
2006/11/30 13:44:27 sb 1.11.84.1: #i70481# Extended SvLBoxButton.
Diffstat (limited to 'svtools/source/contnr/svlbitm.cxx')
-rw-r--r--svtools/source/contnr/svlbitm.cxx40
1 files changed, 28 insertions, 12 deletions
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 101c192f2888..227d5e57a03d 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: svlbitm.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 14:34:22 $
+ * last change: $Author: ihi $ $Date: 2006-12-20 14:17:08 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -49,6 +49,9 @@
#ifndef _SV_DECOVIEW_HXX
#include <vcl/decoview.hxx>
#endif
+#ifndef _SV_SOUND_HXX
+#include <vcl/sound.hxx>
+#endif
#define TABOFFS_NOT_VALID -2000000
@@ -353,10 +356,12 @@ void SvLBoxBmp::Clone( SvLBoxItem* pSource )
DBG_NAME(SvLBoxButton);
-SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry,USHORT nFlags,SvLBoxButtonData* pBData)
+SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind,
+ USHORT nFlags, SvLBoxButtonData* pBData )
: SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxButton,0);
+ eKind = eTheKind;
nBaseOffs = 0;
nItemFlags = 0;
SetStateUnchecked();
@@ -366,6 +371,7 @@ SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry,USHORT nFlags,SvLBoxButtonData*
SvLBoxButton::SvLBoxButton() : SvLBoxItem()
{
DBG_CTOR(SvLBoxButton,0);
+ eKind = SvLBoxButtonKind_enabledCheckbox;
nItemFlags = 0;
SetStateUnchecked();
}
@@ -396,12 +402,15 @@ void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvLBoxButton,0);
- if ( IsStateChecked() )
- SetStateUnchecked();
- else
- SetStateChecked();
- pData->StoreButtonState( pEntry, nItemFlags );
- pData->CallLink();
+ if ( CheckModification() )
+ {
+ if ( IsStateChecked() )
+ SetStateUnchecked();
+ else
+ SetStateChecked();
+ pData->StoreButtonState( pEntry, nItemFlags );
+ pData->CallLink();
+ }
return FALSE;
}
@@ -409,8 +418,10 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBoxButton,0);
- USHORT nIndex = pData->GetIndex( nItemFlags );
- USHORT nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+ USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
+ ? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags );
+ USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
+ rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
rDev.DrawImage( rPos, pData->aBmps[nIndex + nBaseOffs] ,nStyle);
}
@@ -435,7 +446,12 @@ void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
pViewData->aSize = Size( pData->Width(), pData->Height() );
}
-
+bool SvLBoxButton::CheckModification() const
+{
+ if( eKind == SvLBoxButtonKind_disabledCheckbox )
+ Sound::Beep();
+ return eKind == SvLBoxButtonKind_enabledCheckbox;
+}
// ***************************************************************
// class SvLBoxContextBmp