diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-06 09:46:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-06 11:26:36 +0000 |
commit | e7737fef7f84f065ec94f114761d70fc7f90ed5a (patch) | |
tree | 3bb571ec8e7597e8605b4ce6c7f1d66052e0e84d /svtools/source | |
parent | f9a4af41ca574760dbd22c8207661fabb6823e3b (diff) |
ditch archaic taskbox/taskmisc/taskstat implementations
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/control/taskbox.cxx | 277 | ||||
-rw-r--r-- | svtools/source/control/taskmisc.cxx | 57 | ||||
-rw-r--r-- | svtools/source/control/taskstat.cxx | 459 |
3 files changed, 0 insertions, 793 deletions
diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx deleted file mode 100644 index deb6f4ca1623..000000000000 --- a/svtools/source/control/taskbox.cxx +++ /dev/null @@ -1,277 +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. - * - ************************************************************************/ - - -#define _TASKBAR_CXX - -#include <tools/debug.hxx> -#include <vcl/image.hxx> -#include <vcl/help.hxx> -#include <svtools/taskbar.hxx> - -// ======================================================================= - -#define TASKBOX_TASKOFF 3 - -// ======================================================================= - -struct ImplTaskItem -{ - Image maImage; - XubString maText; -}; - -// ======================================================================= - -TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) : - ToolBox( pParent, nWinStyle | WB_SCROLL | WB_3DLOOK ) -{ - mpItemList = new ImplTaskItemList; - mnMaxTextWidth = 0; - mnActiveItemId = 0; - mnSmallItem = TOOLBOX_ITEM_NOTFOUND; - mbMinActivate = sal_False; - - SetAlign( WINDOWALIGN_BOTTOM ); - SetButtonType( BUTTON_SYMBOLTEXT ); -} - -// ----------------------------------------------------------------------- - -TaskToolBox::~TaskToolBox() -{ - for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) { - delete (*mpItemList)[ i ]; - } - mpItemList->clear(); - delete mpItemList; -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::ActivateTaskItem( sal_uInt16 nItemId, sal_Bool bMinActivate ) -{ - if ( nItemId ) - { - if ( nItemId != mnActiveItemId ) - { - if ( mnActiveItemId ) - CheckItem( mnActiveItemId, sal_False ); - CheckItem( nItemId ); - mnActiveItemId = nItemId; - } - else - { - if ( !bMinActivate ) - return; - - mbMinActivate = sal_True; - } - - ActivateTask(); - mbMinActivate = sal_False; - } -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::ActivateTask() -{ - maActivateTaskHdl.Call( this ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::ContextMenu() -{ - maContextMenuHdl.Call( this ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::MouseButtonDown( const MouseEvent& rMEvt ) -{ - if ( !rMEvt.IsRight() ) - ToolBox::MouseButtonDown( rMEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::Resize() -{ - mnOldItemCount = mpItemList->size(); - mnUpdatePos = mnOldItemCount; - mnUpdateNewPos = TOOLBOX_ITEM_NOTFOUND; - ImplFormatTaskToolBox(); - ToolBox::Resize(); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::Command( const CommandEvent& rCEvt ) -{ - if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) - { - maContextMenuPos = rCEvt.GetMousePosPixel(); - ContextMenu(); - maContextMenuPos = Point(); - } - else - ToolBox::Command( rCEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::RequestHelp( const HelpEvent& rHEvt ) -{ - if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) ) - { - size_t nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); - - if ( nItemId ) - { - ImplTaskItem* pItem = ( nItemId-1 < mpItemList->size() ) ? (*mpItemList)[ nItemId-1 ] : NULL; - if ( pItem ) - { - if ( pItem->maText != GetItemText( nItemId ) ) - { - Rectangle aItemRect = GetItemRect( nItemId ); - if ( rHEvt.GetMode() & HELPMODE_QUICK ) - Help::ShowQuickHelp( this, aItemRect, pItem->maText ); - else - Help::ShowBalloon( this, aItemRect.Center(), aItemRect, pItem->maText ); - } - else - Help::ShowQuickHelp( this, Rectangle(), String() ); - return; - } - } - } - - ToolBox::RequestHelp( rHEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::Select() -{ - sal_uInt16 nItemId = GetCurItemId(); - ActivateTaskItem( nItemId, sal_True ); -} - -// ----------------------------------------------------------------------- - -void TaskToolBox::ImplFormatTaskToolBox() -{ - if ( mnUpdateNewPos == TOOLBOX_ITEM_NOTFOUND ) - { - // Eintraege aus der Liste entfernen - while ( mpItemList->size() > mnUpdatePos ) { - delete mpItemList->back(); - mpItemList->pop_back(); - } - mnUpdateNewPos = mnUpdatePos; - } - - // Maximale Itemgroesse berechnen - long nOldMaxTextWidth = mnMaxTextWidth; - mnMaxTextWidth = 70; - if ( !mpItemList->empty() ) - { - long nWinSize = GetOutputSizePixel().Width()-8; - long nItemSize = (*mpItemList)[ 0 ]->maImage.GetSizePixel().Width()+7+TASKBOX_TASKOFF+2; - nWinSize -= mpItemList->size()*nItemSize; - if ( nWinSize > 0 ) - nWinSize /= mpItemList->size(); - else - nWinSize = 0; - if ( nWinSize < mnMaxTextWidth ) - mnMaxTextWidth = nWinSize; - if ( (mnMaxTextWidth < nOldMaxTextWidth) || - ((mnMaxTextWidth-nOldMaxTextWidth > 3) && - (mnSmallItem != TOOLBOX_ITEM_NOTFOUND)) ) - { - mnSmallItem = TOOLBOX_ITEM_NOTFOUND; - mnUpdateNewPos = 0; - } - } - - // Eintraege aus der ToolBox entfernen, die ersetzt werden - sal_uInt16 nBtnPos = (mnUpdateNewPos*2); - while ( nBtnPos < GetItemCount() ) - RemoveItem( nBtnPos ); - if ( mnUpdateNewPos <= (mnActiveItemId-1) ) - mnActiveItemId = 0; - - // Neue Eintrage einfuegen - size_t i = mnUpdateNewPos; - while ( i < mpItemList->size() ) - { - ImplTaskItem* pItem = (*mpItemList)[ i ]; - - // Textlaenge berechnen - XubString aText = pItem->maText; - if ( !aText.Len() ) - aText = ' '; - long nTxtWidth = GetTextWidth( aText ); - if ( nTxtWidth > mnMaxTextWidth ) - { - if ( mnSmallItem == TOOLBOX_ITEM_NOTFOUND ) - mnSmallItem = i; - // 3 == Len of "..." - aText.AppendAscii( "..." ); - do - { - aText.Erase( aText.Len()-3-1, 1 ); - nTxtWidth = GetTextWidth( aText ); - } - while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) ); - } - - sal_uInt16 nItemId = i+1; - if ( aText.EqualsAscii( "..." ) ) - InsertItem( nItemId, pItem->maImage, TIB_LEFT ); - else - InsertItem( nItemId, pItem->maImage, aText, TIB_LEFT ); - InsertSeparator( TOOLBOX_APPEND, TASKBOX_TASKOFF ); - i++; - } - - if ( mnUpdateNewPos != 0 ) - mnMaxTextWidth = nOldMaxTextWidth; - - if ( mnNewActivePos+1 != mnActiveItemId ) - { - if ( mnActiveItemId ) - CheckItem( mnActiveItemId, sal_False ); - mnActiveItemId = mnNewActivePos+1; - CheckItem( mnActiveItemId ); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx deleted file mode 100644 index 0735de900249..000000000000 --- a/svtools/source/control/taskmisc.cxx +++ /dev/null @@ -1,57 +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. - * - ************************************************************************/ - - -#define _TASKBAR_CXX - -#include <vcl/help.hxx> -#include <svtools/taskbar.hxx> - -// ======================================================================= - -TaskButtonBar::TaskButtonBar( Window* pParent, WinBits nWinStyle ) : - ToolBox( pParent, nWinStyle | WB_3DLOOK ) -{ - SetAlign( WINDOWALIGN_BOTTOM ); - SetButtonType( BUTTON_SYMBOLTEXT ); -} - -// ----------------------------------------------------------------------- - -TaskButtonBar::~TaskButtonBar() -{ -} - -// ----------------------------------------------------------------------- - -void TaskButtonBar::RequestHelp( const HelpEvent& rHEvt ) -{ - ToolBox::RequestHelp( rHEvt ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx deleted file mode 100644 index cb26d23b98b2..000000000000 --- a/svtools/source/control/taskstat.cxx +++ /dev/null @@ -1,459 +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. - * - ************************************************************************/ - - -#define _TASKBAR_CXX - -#include <tools/date.hxx> -#include <vcl/image.hxx> -#include <vcl/help.hxx> -#include <vcl/svapp.hxx> -#include <unotools/calendarwrapper.hxx> -#include <unotools/syslocale.hxx> -#include <svtools/taskbar.hxx> - -// ======================================================================= - -#define TASKSTATUSBAR_CLOCXOFFX 3 -#define TASKSTATUSBAR_IMAGEOFFX 1 - -// ======================================================================= - -struct ImplTaskSBFldItem -{ - TaskStatusFieldItem maItem; - sal_uInt16 mnId; - long mnOffX; -}; - -// ======================================================================= - -sal_Bool ITaskStatusNotify::MouseButtonDown( sal_uInt16, const MouseEvent& ) -{ - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool ITaskStatusNotify::MouseButtonUp( sal_uInt16, const MouseEvent& ) -{ - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool ITaskStatusNotify::MouseMove( sal_uInt16, const MouseEvent& ) -{ - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool ITaskStatusNotify::Command( sal_uInt16, const CommandEvent& ) -{ - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool ITaskStatusNotify::UpdateHelp( sal_uInt16 ) -{ - return sal_False; -} - -// ======================================================================= - -TaskStatusFieldItem::TaskStatusFieldItem() -{ - mpNotify = NULL; - mnFlags = 0; -} - -// ----------------------------------------------------------------------- - -TaskStatusFieldItem::TaskStatusFieldItem( const TaskStatusFieldItem& rItem ) : - mpNotify( rItem.mpNotify ), - maImage( rItem.maImage ), - maQuickHelpText( rItem.maQuickHelpText ), - maHelpText( rItem.maHelpText ), - mnFlags( rItem.mnFlags ) -{ -} - -// ----------------------------------------------------------------------- - -TaskStatusFieldItem::~TaskStatusFieldItem() -{ -} - -// ----------------------------------------------------------------------- - -const TaskStatusFieldItem& TaskStatusFieldItem::operator=( const TaskStatusFieldItem& rItem ) -{ - mpNotify = rItem.mpNotify; - maImage = rItem.maImage; - maQuickHelpText = rItem.maQuickHelpText; - maHelpText = rItem.maHelpText; - mnFlags = rItem.mnFlags; - return *this; -} - -// ======================================================================= - -TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) : - StatusBar( pParent, nWinStyle | WB_3DLOOK ), - maTime( 0, 0, 0 ) -{ - mpFieldItemList = NULL; - mpNotify = NULL; - mnClockWidth = 0; - mnItemWidth = 0; - mnFieldWidth = 0; - mnFieldFlags = 0; - mbFlashItems = sal_False; - mbOutInterval = sal_False; - - maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) ); -} - -// ----------------------------------------------------------------------- - -TaskStatusBar::~TaskStatusBar() -{ - if ( mpFieldItemList ) - { - for ( size_t i = 0, n = mpFieldItemList->size(); i < n; ++i ) { - delete (*mpFieldItemList)[ i ]; - } - mpFieldItemList->clear(); - delete mpFieldItemList; - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(TaskStatusBar, ImplTimerHdl) -{ - sal_Bool bUpdate = ImplUpdateClock(); - if ( ImplUpdateFlashItems() ) - bUpdate = sal_True; - if ( bUpdate ) - SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL ); - - return 0; -} - -// ----------------------------------------------------------------------- - -ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const -{ - if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID ) - { - rFieldRect = sal_True; - - if ( mpFieldItemList ) - { - long nX = rPos.X()-GetItemRect( TASKSTATUSBAR_STATUSFIELDID ).Left(); - for ( size_t i = 0, n = mpFieldItemList->size(); i < n; ++i ) { - ImplTaskSBFldItem* pItem = (*mpFieldItemList)[ i ]; - if ( nX < pItem->mnOffX + pItem->maItem.GetImage().GetSizePixel().Width() ) { - return pItem; - } - } - } - } - else - rFieldRect = sal_False; - - return NULL; -} - -// ----------------------------------------------------------------------- - -sal_Bool TaskStatusBar::ImplUpdateClock() -{ - if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) - { - Time aTime( Time::SYSTEM ); - maTimer.SetTimeout( ((long)60000)-((aTime.GetSec()*1000)+(aTime.Get100Sec()*10)) ); - if ( (aTime.GetMin() != maTime.GetMin()) || - (aTime.GetHour() != maTime.GetHour()) ) - { - maTime = aTime; - maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, sal_False, sal_False ); - return sal_True; - } - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool TaskStatusBar::ImplUpdateFlashItems() -{ - if ( mbFlashItems ) - { - if ( mbOutInterval ) - { - maTimer.SetTimeout( 900 ); - mbOutInterval = sal_False; - } - else - { - maTimer.SetTimeout( 700 ); - mbOutInterval = sal_True; - } - - return sal_True; - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt ) -{ - sal_Bool bFieldRect; - sal_Bool bBaseClass = sal_False; - ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); - - ITaskStatusNotify* pNotify = mpNotify; - sal_uInt16 nItemId = 0; - - if ( bFieldRect ) - nItemId = TASKSTATUSBAR_CLOCKID; - - if ( pItem ) - { - pNotify = pItem->maItem.GetNotifyObject(); - nItemId = pItem->mnId; - } - - if ( pNotify ) - bBaseClass = pNotify->MouseButtonDown( nItemId, rMEvt ); - - if ( bBaseClass ) - StatusBar::MouseButtonDown( rMEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt ) -{ - sal_Bool bFieldRect; - sal_Bool bBaseClass = sal_False; - ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); - - ITaskStatusNotify* pNotify = mpNotify; - sal_uInt16 nItemId = 0; - - if ( bFieldRect ) - nItemId = TASKSTATUSBAR_CLOCKID; - - if ( pItem ) - { - pNotify = pItem->maItem.GetNotifyObject(); - nItemId = pItem->mnId; - } - - if ( pNotify ) - bBaseClass = pNotify->MouseButtonUp( nItemId, rMEvt ); - - if ( bBaseClass ) - StatusBar::MouseButtonUp( rMEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::MouseMove( const MouseEvent& rMEvt ) -{ - sal_Bool bFieldRect; - sal_Bool bBaseClass = sal_False; - ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); - - ITaskStatusNotify* pNotify = mpNotify; - sal_uInt16 nItemId = 0; - - if ( bFieldRect ) - nItemId = TASKSTATUSBAR_CLOCKID; - - if ( pItem ) - { - pNotify = pItem->maItem.GetNotifyObject(); - nItemId = pItem->mnId; - } - - if ( pNotify ) - bBaseClass = pNotify->MouseMove( nItemId, rMEvt ); - - if ( bBaseClass ) - StatusBar::MouseMove( rMEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::Command( const CommandEvent& rCEvt ) -{ - sal_Bool bFieldRect; - sal_Bool bBaseClass = sal_False; - ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect ); - - ITaskStatusNotify* pNotify = mpNotify; - sal_uInt16 nItemId = 0; - - if ( bFieldRect ) - nItemId = TASKSTATUSBAR_CLOCKID; - - if ( pItem ) - { - pNotify = pItem->maItem.GetNotifyObject(); - nItemId = pItem->mnId; - } - - if ( pNotify ) - bBaseClass = pNotify->Command( nItemId, rCEvt ); - - if ( bBaseClass ) - StatusBar::Command( rCEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) -{ - sal_Bool bFieldRect; - ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect ); - if ( bFieldRect ) - { - ITaskStatusNotify* pNotify = mpNotify; - sal_uInt16 nItemId = 0; - - if ( pItem ) - { - pNotify = pItem->maItem.GetNotifyObject(); - nItemId = pItem->mnId; - } - - if ( pNotify ) - pNotify->UpdateHelp( nItemId ); - - if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) ) - { - Rectangle aItemRect = GetItemRect( TASKSTATUSBAR_STATUSFIELDID ); - Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); - aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); - if ( pItem ) - { - if ( rHEvt.GetMode() & HELPMODE_BALLOON ) - { - XubString aStr = pItem->maItem.GetHelpText(); - if ( !aStr.Len() ) - aStr = pItem->maItem.GetQuickHelpText(); - Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); - } - else - Help::ShowQuickHelp( this, aItemRect, pItem->maItem.GetQuickHelpText() ); - } - else - { - SvtSysLocale aSL; - const LocaleDataWrapper& rLDW = aSL.GetLocaleData(); - CalendarWrapper aCal( rLDW.getServiceFactory()); - aCal.loadDefaultCalendar( rLDW.getLoadedLocale()); - XubString aStr = rLDW.getLongDate( Date( Date::SYSTEM), aCal ); - if ( rHEvt.GetMode() & HELPMODE_BALLOON ) - Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); - else - Help::ShowQuickHelp( this, aItemRect, aStr ); - } - return; - } - else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) - { - if ( pItem ) - { - rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); - if ( !aHelpId.isEmpty() ) - { - // Wenn eine Hilfe existiert, dann ausloesen - Help* pHelp = Application::GetHelp(); - if ( pHelp ) - pHelp->Start( aHelpId, this ); - return; - } - } - } - } - - StatusBar::RequestHelp( rHEvt ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt ) -{ - if ( rUDEvt.GetItemId() == TASKSTATUSBAR_STATUSFIELDID ) - { - OutputDevice* pDev = rUDEvt.GetDevice(); - Rectangle aRect = rUDEvt.GetRect(); - - if ( mpFieldItemList ) - { - for ( size_t i = 0, n = mpFieldItemList->size(); i < n; ++i ) - { - ImplTaskSBFldItem* pItem = (*mpFieldItemList)[ i ]; - if ( !mbOutInterval || !(pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH) ) - { - const Image& rImage = pItem->maItem.GetImage(); - Size aImgSize = rImage.GetSizePixel(); - pDev->DrawImage( Point( aRect.Left()+pItem->mnOffX, - aRect.Top()+((aRect.GetHeight()-aImgSize.Width())/2) ), - rImage ); - } - } - } - - if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) - { - long nX = mnItemWidth+TASKSTATUSBAR_CLOCXOFFX; - Point aPos = GetItemTextPos( TASKSTATUSBAR_STATUSFIELDID ); - aPos.X() = aRect.Left()+nX; - pDev->DrawText( aPos, maTimeText ); - } - } - else - StatusBar::UserDraw( rUDEvt ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |