2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* $RCSfile: ctrl.cxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* $Revision: 1.19 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* last change: $Author: rt $ $Date: 2005-09-09 11:45:22 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* This library 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 for more details.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 10:45:22 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _SV_RC_H
|
2004-01-06 12:16:48 +00:00
|
|
|
#include <tools/rc.h>
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
2001-08-27 08:45:10 +00:00
|
|
|
#ifndef _SV_SVDATA_HXX
|
|
|
|
#include <svdata.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
#include <svapp.hxx>
|
|
|
|
#endif
|
2001-07-06 15:12:47 +00:00
|
|
|
#ifndef _SV_EVENT_HXX
|
|
|
|
#include <event.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SV_CTRL_HXX
|
|
|
|
#include <ctrl.hxx>
|
|
|
|
#endif
|
2004-09-08 16:47:19 +00:00
|
|
|
#ifndef _SV_DECOVIEW_HXX
|
|
|
|
#include <decoview.hxx>
|
|
|
|
#endif
|
2002-04-29 16:46:18 +00:00
|
|
|
#ifndef _VCL_CONTROLLAYOUT_HXX
|
|
|
|
#include <controllayout.hxx>
|
|
|
|
#endif
|
2004-05-10 14:46:26 +00:00
|
|
|
#ifndef _SV_NATIVEWIDGETS_HXX
|
|
|
|
#include <salnativewidgets.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-12-01 12:10:50 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-04-29 16:46:18 +00:00
|
|
|
using namespace vcl;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// =======================================================================
|
|
|
|
|
|
|
|
void Control::ImplInitData()
|
|
|
|
{
|
2002-04-29 16:46:18 +00:00
|
|
|
mbHasFocus = FALSE;
|
|
|
|
mpLayoutData = NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Control::Control( WindowType nType ) :
|
|
|
|
Window( nType )
|
|
|
|
{
|
|
|
|
ImplInitData();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Control::Control( Window* pParent, WinBits nStyle ) :
|
|
|
|
Window( WINDOW_CONTROL )
|
|
|
|
{
|
|
|
|
ImplInitData();
|
|
|
|
Window::ImplInit( pParent, nStyle, NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Control::Control( Window* pParent, const ResId& rResId ) :
|
|
|
|
Window( WINDOW_CONTROL )
|
|
|
|
{
|
|
|
|
ImplInitData();
|
|
|
|
rResId.SetRT( RSC_CONTROL );
|
|
|
|
WinBits nStyle = ImplInitRes( rResId );
|
|
|
|
ImplInit( pParent, nStyle, NULL );
|
|
|
|
ImplLoadRes( rResId );
|
|
|
|
|
|
|
|
if ( !(nStyle & WB_HIDE) )
|
|
|
|
Show();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-04-29 16:46:18 +00:00
|
|
|
Control::~Control()
|
|
|
|
{
|
2002-05-03 12:04:12 +00:00
|
|
|
delete mpLayoutData, mpLayoutData = NULL;
|
2002-04-29 16:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void Control::GetFocus()
|
|
|
|
{
|
|
|
|
Window::GetFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Control::LoseFocus()
|
|
|
|
{
|
|
|
|
Window::LoseFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-05-08 15:05:42 +00:00
|
|
|
void Control::Resize()
|
|
|
|
{
|
|
|
|
delete mpLayoutData, mpLayoutData = NULL;
|
|
|
|
Window::Resize();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-04-29 16:46:18 +00:00
|
|
|
void Control::FillLayoutData() const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Control::SetText( const String& rStr )
|
|
|
|
{
|
|
|
|
delete mpLayoutData;
|
|
|
|
mpLayoutData = NULL;
|
|
|
|
Window::SetText( rStr );
|
|
|
|
}
|
|
|
|
|
2002-05-16 10:52:50 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const
|
|
|
|
{
|
2005-01-13 16:58:56 +00:00
|
|
|
return (nIndex >= 0 && nIndex < (long) m_aUnicodeBoundRects.size()) ? m_aUnicodeBoundRects[ nIndex ] : Rectangle();
|
2002-05-16 10:52:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-29 16:46:18 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Rectangle Control::GetCharacterBounds( long nIndex ) const
|
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
2002-05-16 10:52:50 +00:00
|
|
|
return mpLayoutData ? mpLayoutData->GetCharacterBounds( nIndex ) : Rectangle();
|
2002-04-29 16:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-05-16 10:52:50 +00:00
|
|
|
long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
|
|
|
long nIndex = -1;
|
2002-05-16 10:52:50 +00:00
|
|
|
for( long i = m_aUnicodeBoundRects.size()-1; i >= 0; i-- )
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
2002-05-16 10:52:50 +00:00
|
|
|
if( m_aUnicodeBoundRects[ i ].IsInside( rPoint ) )
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
2002-05-16 10:52:50 +00:00
|
|
|
nIndex = i;
|
|
|
|
break;
|
2002-04-29 16:46:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-05-16 10:52:50 +00:00
|
|
|
long Control::GetIndexForPoint( const Point& rPoint ) const
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
2002-05-16 10:52:50 +00:00
|
|
|
return mpLayoutData ? mpLayoutData->GetIndexForPoint( rPoint ) : -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
long ControlLayoutData::GetLineCount() const
|
|
|
|
{
|
|
|
|
long nLines = m_aLineIndices.size();
|
|
|
|
if( nLines == 0 && m_aDisplayText.Len() )
|
|
|
|
nLines = 1;
|
2002-04-29 16:46:18 +00:00
|
|
|
return nLines;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-05-16 10:52:50 +00:00
|
|
|
long Control::GetLineCount() const
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
2002-05-16 10:52:50 +00:00
|
|
|
return mpLayoutData ? mpLayoutData->GetLineCount() : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Pair ControlLayoutData::GetLineStartEnd( long nLine ) const
|
|
|
|
{
|
|
|
|
Pair aPair( -1, -1 );
|
|
|
|
|
|
|
|
int nDisplayLines = m_aLineIndices.size();
|
|
|
|
if( nLine >= 0 && nLine < nDisplayLines )
|
2002-04-29 16:46:18 +00:00
|
|
|
{
|
2002-05-16 10:52:50 +00:00
|
|
|
aPair.A() = m_aLineIndices[nLine];
|
2003-06-04 10:21:43 +00:00
|
|
|
if( nLine+1 < nDisplayLines )
|
2002-05-16 10:52:50 +00:00
|
|
|
aPair.B() = m_aLineIndices[nLine+1]-1;
|
|
|
|
else
|
|
|
|
aPair.B() = m_aDisplayText.Len()-1;
|
|
|
|
}
|
|
|
|
else if( nLine == 0 && nDisplayLines == 0 && m_aDisplayText.Len() )
|
|
|
|
{
|
|
|
|
// special case for single line controls so the implementations
|
|
|
|
// in that case do not have to fill in the line indices
|
|
|
|
aPair.A() = 0;
|
|
|
|
aPair.B() = m_aDisplayText.Len()-1;
|
2002-04-29 16:46:18 +00:00
|
|
|
}
|
|
|
|
return aPair;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-05-16 10:52:50 +00:00
|
|
|
Pair Control::GetLineStartEnd( long nLine ) const
|
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
|
|
|
return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-05-18 09:54:12 +00:00
|
|
|
long ControlLayoutData::ToRelativeLineIndex( long nIndex ) const
|
|
|
|
{
|
|
|
|
// is the index sensible at all ?
|
|
|
|
if( nIndex >= 0 && nIndex < m_aDisplayText.Len() )
|
|
|
|
{
|
|
|
|
int nDisplayLines = m_aLineIndices.size();
|
|
|
|
// if only 1 line exists, then absolute and relative index are
|
|
|
|
// identical -> do nothing
|
|
|
|
if( nDisplayLines > 1 )
|
|
|
|
{
|
|
|
|
int nLine;
|
|
|
|
for( nLine = nDisplayLines-1; nLine >= 0; nLine-- )
|
|
|
|
{
|
|
|
|
if( m_aLineIndices[nLine] <= nIndex )
|
|
|
|
{
|
|
|
|
nIndex -= m_aLineIndices[nLine];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( nLine < 0 )
|
|
|
|
{
|
|
|
|
DBG_ASSERT( nLine >= 0, "ToRelativeLineIndex failed" );
|
|
|
|
nIndex = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nIndex = -1;
|
|
|
|
|
|
|
|
return nIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
long Control::ToRelativeLineIndex( long nIndex ) const
|
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
|
|
|
return mpLayoutData ? mpLayoutData->ToRelativeLineIndex( nIndex ) : -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2002-04-29 16:46:18 +00:00
|
|
|
String Control::GetDisplayText() const
|
|
|
|
{
|
|
|
|
if( ! mpLayoutData )
|
|
|
|
FillLayoutData();
|
|
|
|
return mpLayoutData ? mpLayoutData->m_aDisplayText : GetText();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
long Control::Notify( NotifyEvent& rNEvt )
|
|
|
|
{
|
|
|
|
if ( rNEvt.GetType() == EVENT_GETFOCUS )
|
|
|
|
{
|
|
|
|
if ( !mbHasFocus )
|
|
|
|
{
|
|
|
|
mbHasFocus = TRUE;
|
2004-10-22 11:12:52 +00:00
|
|
|
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) )
|
|
|
|
// been destroyed within the handler
|
2001-11-27 08:54:45 +00:00
|
|
|
return TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
|
|
|
|
{
|
|
|
|
Window* pFocusWin = Application::GetFocusWindow();
|
|
|
|
if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
|
|
|
|
{
|
|
|
|
mbHasFocus = FALSE;
|
2004-10-22 11:12:52 +00:00
|
|
|
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) )
|
|
|
|
// been destroyed within the handler
|
2001-08-27 08:45:10 +00:00
|
|
|
return TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return Window::Notify( rNEvt );
|
|
|
|
}
|
2002-04-29 16:46:18 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Control::StateChanged( StateChangedType nStateChange )
|
|
|
|
{
|
|
|
|
if( nStateChange == STATE_CHANGE_INITSHOW ||
|
|
|
|
nStateChange == STATE_CHANGE_VISIBLE ||
|
|
|
|
nStateChange == STATE_CHANGE_FORMAT ||
|
|
|
|
nStateChange == STATE_CHANGE_ZOOM ||
|
|
|
|
nStateChange == STATE_CHANGE_BORDER ||
|
|
|
|
nStateChange == STATE_CHANGE_CONTROLFONT
|
|
|
|
)
|
|
|
|
{
|
|
|
|
delete mpLayoutData;
|
|
|
|
mpLayoutData = NULL;
|
|
|
|
}
|
|
|
|
Window::StateChanged( nStateChange );
|
|
|
|
}
|
2002-05-03 12:04:12 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Control::AppendLayoutData( const Control& rSubControl ) const
|
|
|
|
{
|
|
|
|
if( ! rSubControl.mpLayoutData )
|
|
|
|
rSubControl.FillLayoutData();
|
|
|
|
if( ! rSubControl.mpLayoutData || ! rSubControl.mpLayoutData->m_aDisplayText.Len() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
long nCurrentIndex = mpLayoutData->m_aDisplayText.Len();
|
|
|
|
mpLayoutData->m_aDisplayText.Append( rSubControl.mpLayoutData->m_aDisplayText );
|
|
|
|
int nLines = rSubControl.mpLayoutData->m_aLineIndices.size();
|
|
|
|
int n;
|
|
|
|
mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
|
|
|
|
for( n = 1; n < nLines; n++ )
|
|
|
|
mpLayoutData->m_aLineIndices.push_back( rSubControl.mpLayoutData->m_aLineIndices[n] + nCurrentIndex );
|
|
|
|
int nRectangles = rSubControl.mpLayoutData->m_aUnicodeBoundRects.size();
|
2003-04-04 15:53:26 +00:00
|
|
|
Rectangle aRel = const_cast<Control&>(rSubControl).GetWindowExtentsRelative( const_cast<Control*>(this) );
|
2002-05-03 12:04:12 +00:00
|
|
|
for( n = 0; n < nRectangles; n++ )
|
|
|
|
{
|
2003-04-04 15:53:26 +00:00
|
|
|
Rectangle aRect = rSubControl.mpLayoutData->m_aUnicodeBoundRects[n];
|
|
|
|
aRect.Move( aRel.Left(), aRel.Top() );
|
2002-05-03 12:04:12 +00:00
|
|
|
mpLayoutData->m_aUnicodeBoundRects.push_back( aRect );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------
|
|
|
|
|
2004-10-22 11:12:52 +00:00
|
|
|
BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHandler, void* pCaller )
|
|
|
|
{
|
|
|
|
ImplDelData aCheckDelete;
|
|
|
|
ImplAddDel( &aCheckDelete );
|
|
|
|
|
|
|
|
ImplCallEventListeners( nEvent );
|
|
|
|
if ( !aCheckDelete.IsDelete() )
|
|
|
|
{
|
|
|
|
rHandler.Call( pCaller );
|
|
|
|
|
|
|
|
if ( !aCheckDelete.IsDelete() )
|
|
|
|
{
|
|
|
|
ImplRemoveDel( &aCheckDelete );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------
|
|
|
|
|
2002-05-03 12:04:12 +00:00
|
|
|
void Control::SetLayoutDataParent( const Control* pParent ) const
|
|
|
|
{
|
|
|
|
if( mpLayoutData )
|
|
|
|
mpLayoutData->m_pParent = pParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------
|
|
|
|
|
2004-05-18 09:54:12 +00:00
|
|
|
void Control::ImplClearLayoutData() const
|
2002-05-03 12:04:12 +00:00
|
|
|
{
|
|
|
|
delete mpLayoutData, mpLayoutData = NULL;
|
|
|
|
}
|
|
|
|
|
2004-07-05 14:41:56 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-09-08 16:47:19 +00:00
|
|
|
void Control::ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect )
|
|
|
|
{
|
|
|
|
// use a deco view to draw the frame
|
|
|
|
// However, since there happens a lot of magic there, we need to fake some (style) settings
|
|
|
|
// on the device
|
|
|
|
AllSettings aOriginalSettings( pDev->GetSettings() );
|
|
|
|
|
|
|
|
AllSettings aNewSettings( aOriginalSettings );
|
|
|
|
StyleSettings aStyle( aNewSettings.GetStyleSettings() );
|
|
|
|
|
|
|
|
// The *only known* clients of the Draw methods of the various VCL-controls are form controls:
|
|
|
|
// During print preview, and during printing, Draw is called. Thus, drawing always happens with a
|
|
|
|
// mono (colored) border
|
|
|
|
aStyle.SetOptions( aStyle.GetOptions() | STYLE_OPTION_MONO );
|
|
|
|
aStyle.SetMonoColor( GetSettings().GetStyleSettings().GetMonoColor() );
|
|
|
|
|
|
|
|
aNewSettings.SetStyleSettings( aStyle );
|
|
|
|
pDev->SetSettings( aNewSettings );
|
|
|
|
|
|
|
|
DecorationView aDecoView( pDev );
|
|
|
|
rRect = aDecoView.DrawFrame( rRect, FRAME_DRAW_WINDOWBORDER );
|
|
|
|
|
|
|
|
pDev->SetSettings( aOriginalSettings );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-07-05 14:41:56 +00:00
|
|
|
void Control::DataChanged( const DataChangedEvent& rDCEvt)
|
|
|
|
{
|
|
|
|
// we don't want to loose some style settings for controls created with the
|
|
|
|
// toolkit
|
|
|
|
if ( IsCreatedWithToolkit() &&
|
|
|
|
(rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
|
|
|
|
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
|
|
|
|
{
|
|
|
|
AllSettings aSettings = GetSettings();
|
|
|
|
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
|
|
|
|
ULONG nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
|
|
|
|
ULONG nNewOptions = aStyleSettings.GetOptions();
|
|
|
|
|
|
|
|
if ( !(nNewOptions & STYLE_OPTION_MONO) && ( nOldOptions & STYLE_OPTION_MONO ) )
|
|
|
|
{
|
|
|
|
nNewOptions |= STYLE_OPTION_MONO;
|
|
|
|
aStyleSettings.SetOptions( nNewOptions );
|
|
|
|
aStyleSettings.SetMonoColor( rDCEvt.GetOldSettings()->GetStyleSettings().GetMonoColor() );
|
|
|
|
aSettings.SetStyleSettings( aStyleSettings );
|
|
|
|
SetSettings( aSettings );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-05-03 12:04:12 +00:00
|
|
|
// -----------------------------------------------------------------
|
|
|
|
|
|
|
|
ControlLayoutData::~ControlLayoutData()
|
|
|
|
{
|
|
|
|
if( m_pParent )
|
2004-05-18 09:54:12 +00:00
|
|
|
m_pParent->ImplClearLayoutData();
|
2002-05-03 12:04:12 +00:00
|
|
|
}
|