summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-11-11 08:14:53 +0000
committerRüdiger Timm <rt@openoffice.org>2005-11-11 08:14:53 +0000
commitf457ae51c12c66d415bf52c16f8ba36eda7db4c5 (patch)
treeda49effc91423967a82b8b74290b03b983a45516
parent5ff585db3d41a8128bbf31b40474572c74ed7ad3 (diff)
INTEGRATION: CWS xmlsec13 (1.16.30); FILE MERGED
2005/11/01 07:38:56 jl 1.16.30.2: RESYNC: (1.16-1.17); FILE MERGED 2005/10/26 16:15:37 ssa 1.16.30.1: #i56706# implement Set/GetQuickHelpText to enable tooltips in statusbar
-rw-r--r--vcl/source/window/status.cxx64
1 files changed, 45 insertions, 19 deletions
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 262693784486..1a4dbbf02eea 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: status.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: rt $ $Date: 2005-09-09 12:30:07 $
+ * last change: $Author: rt $ $Date: 2005-11-11 09:14:53 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -108,6 +108,7 @@ struct ImplStatusItem
long mnX;
XubString maText;
XubString maHelpText;
+ XubString maQuickHelpText;
ULONG mnHelpId;
void* mpUserData;
BOOL mbVisible;
@@ -760,33 +761,33 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
if ( nItemId )
{
+ Rectangle aItemRect = GetItemRect( nItemId );
+ 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 ( rHEvt.GetMode() & HELPMODE_BALLOON )
{
- Rectangle aItemRect = GetItemRect( nItemId );
- 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();
XubString aStr = GetHelpText( nItemId );
Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
return;
}
else if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
- Rectangle aItemRect = GetItemRect( nItemId );
- XubString aStr = GetItemText( nItemId );
- // Wir zeigen die Quick-Hilfe nur an, wenn Text nicht
- // vollstaendig sichtbar
+ XubString aStr = GetQuickHelpText( nItemId );
+ // Show quickhelp if available
+ if( aStr.Len() )
+ {
+ Help::ShowQuickHelp( this, aItemRect, aStr );
+ return;
+ }
+ aStr = GetItemText( nItemId );
+ // show a quick help if item text doesn't fit
if ( GetTextWidth( aStr ) > aItemRect.GetWidth() )
{
- 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();
Help::ShowQuickHelp( this, aItemRect, aStr );
return;
}
@@ -1371,6 +1372,31 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
+void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ mpItemList->GetObject( nPos )->maQuickHelpText = rText;
+}
+
+// -----------------------------------------------------------------------
+
+const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ return pItem->maQuickHelpText;
+ }
+ else
+ return ImplGetSVEmptyStr();
+}
+
+// -----------------------------------------------------------------------
+
void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
{
USHORT nPos = GetItemPos( nItemId );