diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-07-01 10:46:53 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-07-01 10:46:53 +0000 |
commit | 0444e8f01eeebbe5ae153a265d48a6179da8f939 (patch) | |
tree | 16f1a13b78c13eb2ccd72dedd526c9263e0a4408 /vcl/unx | |
parent | b09bdecd4319270b6f206d37167827c3ecc216be (diff) |
INTEGRATION: CWS pl04 (1.26.2); FILE MERGED
2005/06/08 17:28:07 pl 1.26.2.1: #i43510# #i44986# fix XIM status window handling
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/app/i18n_status.cxx | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx index 0b63d610852a..2c4f04d90f7d 100644 --- a/vcl/unx/source/app/i18n_status.cxx +++ b/vcl/unx/source/app/i18n_status.cxx @@ -2,9 +2,9 @@ * * $RCSfile: i18n_status.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: hr $ $Date: 2005-06-06 16:09:18 $ + * last change: $Author: rt $ $Date: 2005-07-01 11:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,7 +104,7 @@ public: virtual void setText( const String & ) = 0; virtual String getText() const = 0; virtual void show( bool bShow, I18NStatus::ShowReason eReason ) = 0; - virtual void toggle( bool bOn ); + virtual void toggle( bool bOn ) = 0; }; } @@ -120,10 +120,6 @@ void StatusWindow::setPosition( SalFrame* pFrame ) { } -void StatusWindow::toggle( bool bOn ) -{ -} - // -------------------------------------------------------------------------- namespace vcl { @@ -141,6 +137,8 @@ class XIMStatusWindow : public StatusWindow bool m_bDelayedShow; I18NStatus::ShowReason m_eDelayedReason; ULONG m_nDelayedEvent; + // for toggling + bool m_bOn; Point updatePosition(); void layout(); @@ -155,6 +153,7 @@ public: virtual void setText( const String & ); virtual String getText() const; virtual void show( bool bShow, I18NStatus::ShowReason eReason ); + virtual void toggle( bool bOn ); // overload WorkWindow::DataChanged virtual void DataChanged( const DataChangedEvent& rEvt ); @@ -169,7 +168,8 @@ XIMStatusWindow::XIMStatusWindow() : m_bAnchoredAtRight( false ), m_bDelayedShow( false ), m_eDelayedReason( I18NStatus::contextmap ), - m_nDelayedEvent( 0 ) + m_nDelayedEvent( 0 ), + m_bOn( true ) { layout(); } @@ -180,6 +180,12 @@ XIMStatusWindow::~XIMStatusWindow() Application::RemoveUserEvent( m_nDelayedEvent ); } +void XIMStatusWindow::toggle( bool bOn ) +{ + m_bOn = bOn; + show( bOn, I18NStatus::contextmap ); +} + void XIMStatusWindow::layout() { m_aWindowSize.Width() = m_aStatusText.GetTextWidth( m_aStatusText.GetText() )+8; @@ -309,7 +315,7 @@ IMPL_LINK( XIMStatusWindow, DelayedShowHdl, void*, pDummy ) Point aPoint = updatePosition(); pStatusFrame->SetPosSize( aPoint.X(), aPoint.Y(), m_aWindowSize.Width(), m_aWindowSize.Height(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); } - Show( m_bDelayedShow, SHOW_NOACTIVATE ); + Show( m_bDelayedShow && m_bOn, SHOW_NOACTIVATE ); if( m_bDelayedShow ) { XRaiseWindow( (Display*)pData->pDisplay, @@ -660,7 +666,19 @@ void I18NStatus::setStatusText( const String& rText ) String aText( pBuffer ); m_pStatusWindow->setText( aText ); m_pStatusWindow->setPosition( m_pParent ); - m_pStatusWindow->show( true, contextmap ); + + bool bVisible = true; + if( m_pParent ) + { + long w, h; + m_pParent->GetClientSize( w, h ); + if( w == 0 || h == 0 ) + { + bVisible = false; + } + } + + m_pStatusWindow->show( bVisible, contextmap ); } } @@ -722,7 +740,7 @@ SalFrame* I18NStatus::getStatusFrame() const bool I18NStatus::canToggleStatusWindow() const { - return m_aChoices.begin() != m_aChoices.end(); // implies IIIMP + return true; } void I18NStatus::toggleStatusWindow() |