2001-02-15 13:08:36 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 14:19:49 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2005-09-08 14:19:49 +00:00
|
|
|
* $RCSfile: wizardmachine.cxx,v $
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2007-07-10 14:31:46 +00:00
|
|
|
* $Revision: 1.20 $
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2007-07-10 14:31:46 +00:00
|
|
|
* last change: $Author: ihi $ $Date: 2007-07-10 15:31:46 $
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2005-09-08 14:19:49 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 14:19:49 +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
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2005-09-08 14:19:49 +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.
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2005-09-08 14:19:49 +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.
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
2005-09-08 14:19:49 +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
|
2001-02-15 13:08:36 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 13:46:30 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svtools.hxx"
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
#ifndef _SVTOOLS_WIZARDMACHINE_HXX_
|
2007-06-27 20:29:43 +00:00
|
|
|
#include <svtools/wizardmachine.hxx>
|
2001-02-15 13:08:36 +00:00
|
|
|
#endif
|
2007-06-27 20:29:43 +00:00
|
|
|
#include <svtools/helpid.hrc>
|
2001-02-15 13:08:36 +00:00
|
|
|
#ifndef _TOOLS_DEBUG_HXX
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_MSGBOX_HXX
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVTOOLS_SVTDATA_HXX
|
2007-06-27 20:29:43 +00:00
|
|
|
#include <svtools/svtdata.hxx>
|
2001-02-15 13:08:36 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _SVTOOLS_HRC
|
2007-06-27 20:29:43 +00:00
|
|
|
#include <svtools/svtools.hrc>
|
2001-02-15 13:08:36 +00:00
|
|
|
#endif
|
2001-08-02 09:37:38 +00:00
|
|
|
#ifndef SVTOOLS_WIZARDHEADER_HXX
|
|
|
|
#include "wizardheader.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_BITMAP_HXX
|
|
|
|
#include <vcl/bitmap.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HEADER_SIZE_Y 30
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
namespace svt
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
//=====================================================================
|
|
|
|
//= WizardPageImplData
|
|
|
|
//=====================================================================
|
|
|
|
struct WizardPageImplData
|
|
|
|
{
|
|
|
|
WizardHeader* pHeader;
|
|
|
|
|
|
|
|
WizardPageImplData()
|
|
|
|
:pHeader( NULL )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//=====================================================================
|
|
|
|
//= OWizardPage
|
|
|
|
//=====================================================================
|
2001-02-23 07:21:21 +00:00
|
|
|
//---------------------------------------------------------------------
|
2007-05-22 18:33:44 +00:00
|
|
|
OWizardPage::OWizardPage( Window* _pParent, WinBits _nStyle )
|
2001-02-23 07:21:21 +00:00
|
|
|
:TabPage( _pParent, _nStyle )
|
2001-08-02 09:37:38 +00:00
|
|
|
,m_pImpl( new WizardPageImplData )
|
2001-02-23 07:21:21 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2007-05-22 18:33:44 +00:00
|
|
|
OWizardPage::OWizardPage( Window* _pParent, const ResId& _rResId )
|
2001-02-23 07:21:21 +00:00
|
|
|
:TabPage( _pParent, _rResId )
|
2001-08-02 09:37:38 +00:00
|
|
|
,m_pImpl( new WizardPageImplData )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
OWizardPage::~OWizardPage()
|
2001-02-23 07:21:21 +00:00
|
|
|
{
|
2001-08-02 09:37:38 +00:00
|
|
|
delete m_pImpl->pHeader;
|
|
|
|
delete m_pImpl;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardPage::isHeaderEnabled( ) const
|
|
|
|
{
|
|
|
|
return NULL != m_pImpl->pHeader;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2004-08-02 13:37:20 +00:00
|
|
|
void OWizardPage::enableHeader( const Bitmap& _rBitmap, sal_Int32 _nPixelHeight, IWizardPage::GrantAccess )
|
2001-08-02 09:37:38 +00:00
|
|
|
{
|
|
|
|
//.................................................................
|
|
|
|
// create the header control
|
|
|
|
m_pImpl->pHeader = new WizardHeader( this );
|
|
|
|
|
|
|
|
// move it to the upper left corner
|
|
|
|
m_pImpl->pHeader->SetPosPixel( Point( 0, 0 ) );
|
|
|
|
|
|
|
|
// size it: as wide as we are, and 30 APPFONT units high
|
|
|
|
Size aHeaderSize( GetSizePixel().Width(), _nPixelHeight );
|
|
|
|
m_pImpl->pHeader->SetSizePixel( aHeaderSize );
|
|
|
|
|
|
|
|
// set bitmap / text of the control
|
|
|
|
m_pImpl->pHeader->setHeaderBitmap( _rBitmap );
|
|
|
|
m_pImpl->pHeader->setHeaderText( GetText() );
|
|
|
|
|
|
|
|
// show
|
|
|
|
m_pImpl->pHeader->Show( );
|
|
|
|
|
|
|
|
//.................................................................
|
|
|
|
// move all the other controls down
|
|
|
|
Point aChildPos;
|
|
|
|
// loop through the children
|
|
|
|
Window* pChildLoop = GetWindow( WINDOW_FIRSTCHILD );
|
|
|
|
while ( pChildLoop )
|
|
|
|
{
|
|
|
|
if ( pChildLoop != m_pImpl->pHeader )
|
|
|
|
{ // it's not the header itself
|
|
|
|
aChildPos = pChildLoop->GetPosPixel();
|
|
|
|
aChildPos.Y() += aHeaderSize.Height();
|
|
|
|
pChildLoop->SetPosPixel( aChildPos );
|
|
|
|
}
|
|
|
|
|
|
|
|
pChildLoop = pChildLoop->GetWindow( WINDOW_NEXT );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardPage::setHeaderText( const String& _rHeaderText )
|
|
|
|
{
|
|
|
|
if ( !isHeaderEnabled() )
|
|
|
|
{
|
|
|
|
DBG_ERROR( "OWizardPage::setHeaderText: have no header!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_pImpl->pHeader->setHeaderText( _rHeaderText );
|
2001-02-23 07:21:21 +00:00
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardPage::initializePage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-02-23 07:21:21 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardPage::ActivatePage()
|
|
|
|
{
|
|
|
|
TabPage::ActivatePage();
|
|
|
|
implCheckNextButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardPage::implCheckNextButton()
|
|
|
|
{
|
2007-05-22 18:33:44 +00:00
|
|
|
OWizardMachine * pWizardMachine = dynamic_cast< OWizardMachine* >(GetParent());
|
|
|
|
if( pWizardMachine )
|
|
|
|
pWizardMachine->enableButtons(WZB_NEXT, determineNextButtonState());
|
2001-02-23 07:21:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardPage::determineNextButtonState()
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//---------------------------------------------------------------------
|
2006-06-19 20:00:47 +00:00
|
|
|
sal_Bool OWizardPage::commitPage(IWizardPage::COMMIT_REASON)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
//=====================================================================
|
|
|
|
//= WizardMachineImplData
|
|
|
|
//=====================================================================
|
2004-05-19 13:01:49 +00:00
|
|
|
struct WizardMachineImplData : public WizardTypes
|
2001-08-02 09:37:38 +00:00
|
|
|
{
|
|
|
|
String sTitleBase; // the base for the title
|
2004-05-19 13:01:49 +00:00
|
|
|
::std::stack< WizardState > aStateHistory; // the history of all states (used for implementing "Back")
|
2001-08-02 09:37:38 +00:00
|
|
|
Bitmap aHeaderBitmap; // the bitmap to use for the page header
|
|
|
|
|
|
|
|
sal_Int32 nHeaderHeight; // the height (in pixels) of the page header
|
|
|
|
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nFirstUnknownPage;
|
2001-08-02 09:37:38 +00:00
|
|
|
// the WizardDialog does not allow non-linear transitions (e.g. it's
|
|
|
|
// not possible to add pages in a non-linear order), so we need some own maintainance data
|
|
|
|
|
|
|
|
sal_Bool bUsingHeaders; // do we use page headers?
|
2004-08-02 13:37:20 +00:00
|
|
|
sal_Bool m_bCheckButtonStates;
|
2001-08-02 09:37:38 +00:00
|
|
|
|
2005-03-11 09:42:17 +00:00
|
|
|
bool m_bInCallOfLink;
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
WizardMachineImplData()
|
|
|
|
:nFirstUnknownPage( 0 )
|
|
|
|
,bUsingHeaders( sal_False )
|
2005-03-11 09:42:17 +00:00
|
|
|
,m_bInCallOfLink( false )
|
2001-08-02 09:37:38 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-10-27 12:23:37 +00:00
|
|
|
long OWizardMachine::calcRightHelpOffset(sal_uInt32 _nButtonFlags)
|
|
|
|
{
|
|
|
|
sal_Int32 nMask = 1;
|
|
|
|
sal_Int32 nRightAlignedButtonCount = -1;
|
2006-06-19 20:00:47 +00:00
|
|
|
for (unsigned int i = 0; i < 8*sizeof(_nButtonFlags); i++ )
|
2004-10-27 12:23:37 +00:00
|
|
|
{
|
|
|
|
if( ( _nButtonFlags & nMask ) != 0 )
|
|
|
|
nRightAlignedButtonCount++;
|
|
|
|
nMask <<= 1;
|
|
|
|
}
|
|
|
|
Size aSize = GetPageSizePixel();
|
|
|
|
sal_Int32 nTotButtonWidth = nRightAlignedButtonCount * LogicalCoordinateToPixel(50);
|
|
|
|
sal_Int32 nTotRightButtonSpaceOffset = (nRightAlignedButtonCount) * WIZARDDIALOG_BUTTON_STDOFFSET_X;
|
|
|
|
if ((_nButtonFlags & WZB_NEXT) && (_nButtonFlags & WZB_NEXT))
|
|
|
|
nTotRightButtonSpaceOffset = (nTotRightButtonSpaceOffset - WIZARDDIALOG_BUTTON_STDOFFSET_X) + WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X;
|
|
|
|
return aSize.Width() - nTotButtonWidth - nTotRightButtonSpaceOffset;
|
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//=====================================================================
|
|
|
|
//= OWizardMachine
|
|
|
|
//=====================================================================
|
|
|
|
//---------------------------------------------------------------------
|
2004-10-27 12:23:37 +00:00
|
|
|
OWizardMachine::OWizardMachine(Window* _pParent, const ResId& _rRes, sal_uInt32 _nButtonFlags, sal_Bool _bCheckButtonStates, sal_Bool _RoadmapMode, sal_Int16 _nLeftAlignCount )
|
|
|
|
:WizardDialog(_pParent, _rRes, _RoadmapMode, _nLeftAlignCount )
|
2001-02-15 13:08:36 +00:00
|
|
|
,m_pFinish(NULL)
|
|
|
|
,m_pCancel(NULL)
|
|
|
|
,m_pNextPage(NULL)
|
|
|
|
,m_pPrevPage(NULL)
|
|
|
|
,m_pHelp(NULL)
|
2001-08-02 09:37:38 +00:00
|
|
|
,m_pImpl( new WizardMachineImplData )
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
2001-08-02 09:37:38 +00:00
|
|
|
m_pImpl->sTitleBase = GetText();
|
2004-08-02 13:37:20 +00:00
|
|
|
m_pImpl->m_bCheckButtonStates = _bCheckButtonStates;
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
// create the buttons according to the wizard button flags
|
2001-08-08 13:57:10 +00:00
|
|
|
// the help button
|
|
|
|
if (_nButtonFlags & WZB_HELP)
|
|
|
|
{
|
|
|
|
m_pHelp= new HelpButton(this, WB_TABSTOP);
|
|
|
|
m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
|
|
|
|
m_pHelp->Show();
|
2004-10-27 12:23:37 +00:00
|
|
|
AddButton( m_pHelp, WIZARDDIALOG_BUTTON_STDOFFSET_X);
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// the previous button
|
|
|
|
if (_nButtonFlags & WZB_PREVIOUS)
|
|
|
|
{
|
|
|
|
m_pPrevPage = new PushButton(this, WB_TABSTOP);
|
2007-05-22 18:33:44 +00:00
|
|
|
m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) );
|
2001-02-15 13:08:36 +00:00
|
|
|
m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
|
|
|
|
m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS)));
|
|
|
|
m_pPrevPage->Show();
|
|
|
|
|
|
|
|
if (_nButtonFlags & WZB_NEXT)
|
2004-10-27 12:23:37 +00:00
|
|
|
AddButton( m_pPrevPage, ( WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X) ); // half x-offset to the next button
|
2001-02-15 13:08:36 +00:00
|
|
|
else
|
|
|
|
AddButton( m_pPrevPage, WIZARDDIALOG_BUTTON_STDOFFSET_X );
|
|
|
|
SetPrevButton( m_pPrevPage );
|
|
|
|
m_pPrevPage->SetClickHdl( LINK( this, OWizardMachine, OnPrevPage ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// the next button
|
|
|
|
if (_nButtonFlags & WZB_NEXT)
|
|
|
|
{
|
|
|
|
m_pNextPage = new PushButton(this, WB_TABSTOP);
|
2007-05-22 18:33:44 +00:00
|
|
|
m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) );
|
2001-02-15 13:08:36 +00:00
|
|
|
m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
|
|
|
|
m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT)));
|
|
|
|
m_pNextPage->Show();
|
|
|
|
|
|
|
|
AddButton( m_pNextPage, WIZARDDIALOG_BUTTON_STDOFFSET_X );
|
|
|
|
SetNextButton( m_pNextPage );
|
|
|
|
m_pNextPage->SetClickHdl( LINK( this, OWizardMachine, OnNextPage ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// the finish button
|
|
|
|
if (_nButtonFlags & WZB_FINISH)
|
|
|
|
{
|
|
|
|
m_pFinish = new OKButton(this, WB_TABSTOP);
|
|
|
|
m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
|
|
|
|
m_pFinish->SetText(String(SvtResId(STR_WIZDLG_FINISH)));
|
|
|
|
m_pFinish->Show();
|
|
|
|
|
|
|
|
AddButton( m_pFinish, WIZARDDIALOG_BUTTON_STDOFFSET_X );
|
|
|
|
m_pFinish->SetClickHdl( LINK( this, OWizardMachine, OnFinish ) );
|
|
|
|
}
|
|
|
|
|
2004-10-27 12:23:37 +00:00
|
|
|
// the cancel button
|
|
|
|
if (_nButtonFlags & WZB_CANCEL)
|
|
|
|
{
|
|
|
|
m_pCancel = new CancelButton(this, WB_TABSTOP);
|
|
|
|
m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
|
|
|
|
m_pCancel->Show();
|
|
|
|
|
|
|
|
AddButton( m_pCancel, WIZARDDIALOG_BUTTON_STDOFFSET_X );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
OWizardMachine::~OWizardMachine()
|
|
|
|
{
|
|
|
|
delete m_pFinish;
|
|
|
|
delete m_pCancel;
|
|
|
|
delete m_pNextPage;
|
|
|
|
delete m_pPrevPage;
|
|
|
|
delete m_pHelp;
|
|
|
|
|
2004-05-19 13:01:49 +00:00
|
|
|
for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i)
|
2001-02-15 13:08:36 +00:00
|
|
|
delete GetPage(i);
|
2001-08-02 09:37:38 +00:00
|
|
|
|
|
|
|
delete m_pImpl;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::implUpdateTitle()
|
|
|
|
{
|
2001-08-02 09:37:38 +00:00
|
|
|
String sCompleteTitle(m_pImpl->sTitleBase);
|
|
|
|
if ( !m_pImpl->bUsingHeaders )
|
|
|
|
{ // append the page title only if we're not using headers - in this case, the title
|
|
|
|
// would be part of the header
|
2004-08-02 13:37:20 +00:00
|
|
|
TabPage* pCurrentPage = GetPage(getCurrentState());
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( pCurrentPage && pCurrentPage->GetText().Len() )
|
2001-08-02 09:37:38 +00:00
|
|
|
{
|
|
|
|
sCompleteTitle += String::CreateFromAscii(" - ");
|
|
|
|
sCompleteTitle += pCurrentPage->GetText();
|
|
|
|
}
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
SetText(sCompleteTitle);
|
|
|
|
}
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::enableHeader( const Bitmap& _rBitmap, sal_Int32 _nPixelHeight )
|
|
|
|
{
|
|
|
|
if ( m_pImpl->bUsingHeaders )
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
|
|
|
|
// is the height defaulted?
|
|
|
|
if ( -1 == _nPixelHeight )
|
|
|
|
{
|
|
|
|
_nPixelHeight = LogicToPixel( Size( 0, 30 ), MAP_APPFONT ).Height();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pImpl->bUsingHeaders = sal_True;
|
|
|
|
m_pImpl->aHeaderBitmap = _rBitmap;
|
|
|
|
m_pImpl->nHeaderHeight = _nPixelHeight;
|
|
|
|
|
|
|
|
#ifdef DBG_UTIL
|
2004-05-19 13:01:49 +00:00
|
|
|
for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i)
|
2001-08-02 09:37:38 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( NULL == GetPage( i ), "OWizardMachine::enableHeader: there already are pages!" );
|
|
|
|
// this method has not to be called if there already have been created any pages
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
const String& OWizardMachine::getTitleBase() const
|
|
|
|
{
|
|
|
|
return m_pImpl->sTitleBase;
|
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::setTitleBase(const String& _rTitleBase)
|
|
|
|
{
|
2001-08-02 09:37:38 +00:00
|
|
|
m_pImpl->sTitleBase = _rTitleBase;
|
2001-02-15 13:08:36 +00:00
|
|
|
implUpdateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::ActivatePage()
|
|
|
|
{
|
|
|
|
WizardDialog::ActivatePage();
|
|
|
|
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nCurrentLevel = GetCurLevel();
|
2001-02-15 13:08:36 +00:00
|
|
|
if (NULL == GetPage(nCurrentLevel))
|
|
|
|
{
|
2004-08-02 13:37:20 +00:00
|
|
|
TabPage* pNewPage = createPage(nCurrentLevel);
|
2001-02-15 13:08:36 +00:00
|
|
|
DBG_ASSERT(pNewPage, "OWizardMachine::ActivatePage: invalid new page (NULL)!");
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
// announce our header bitmap to the page
|
|
|
|
if ( m_pImpl->bUsingHeaders )
|
2004-08-02 13:37:20 +00:00
|
|
|
{
|
|
|
|
IWizardPage* pHeader = getWizardPage(pNewPage);
|
|
|
|
if ( pHeader )
|
|
|
|
pHeader->enableHeader( m_pImpl->aHeaderBitmap, m_pImpl->nHeaderHeight, IWizardPage::GrantAccess() );
|
|
|
|
}
|
2001-08-02 09:37:38 +00:00
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
// fill up the page sequence of our base class (with dummies)
|
2001-08-02 09:37:38 +00:00
|
|
|
while (m_pImpl->nFirstUnknownPage < nCurrentLevel)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
AddPage(NULL);
|
2001-08-02 09:37:38 +00:00
|
|
|
++m_pImpl->nFirstUnknownPage;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
2001-08-02 09:37:38 +00:00
|
|
|
if (m_pImpl->nFirstUnknownPage == nCurrentLevel)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
// encountered this page number the first time
|
|
|
|
AddPage(pNewPage);
|
2001-08-02 09:37:38 +00:00
|
|
|
++m_pImpl->nFirstUnknownPage;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
// already had this page - just change it
|
|
|
|
SetPage(nCurrentLevel, pNewPage);
|
|
|
|
}
|
|
|
|
|
|
|
|
enterState(nCurrentLevel);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
long OWizardMachine::DeactivatePage()
|
|
|
|
{
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nCurrentState = getCurrentState();
|
2001-02-15 13:08:36 +00:00
|
|
|
if (!leaveState(nCurrentState) || !WizardDialog::DeactivatePage())
|
|
|
|
return sal_False;
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::defaultButton(sal_uInt32 _nWizardButtonFlags)
|
|
|
|
{
|
|
|
|
// the new default button
|
|
|
|
PushButton* pNewDefButton = NULL;
|
|
|
|
if (m_pFinish && (_nWizardButtonFlags & WZB_FINISH))
|
|
|
|
pNewDefButton = m_pFinish;
|
|
|
|
if (m_pNextPage && (_nWizardButtonFlags & WZB_NEXT))
|
|
|
|
pNewDefButton = m_pNextPage;
|
|
|
|
if (m_pPrevPage && (_nWizardButtonFlags & WZB_PREVIOUS))
|
|
|
|
pNewDefButton = m_pPrevPage;
|
|
|
|
if (m_pHelp && (_nWizardButtonFlags & WZB_HELP))
|
|
|
|
pNewDefButton = m_pHelp;
|
|
|
|
if (m_pCancel && (_nWizardButtonFlags & WZB_CANCEL))
|
|
|
|
pNewDefButton = m_pCancel;
|
|
|
|
|
|
|
|
if (pNewDefButton)
|
|
|
|
defaultButton(pNewDefButton);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::implResetDefault(Window* _pWindow)
|
|
|
|
{
|
|
|
|
Window* pChildLoop = _pWindow->GetWindow(WINDOW_FIRSTCHILD);
|
|
|
|
while (pChildLoop)
|
|
|
|
{
|
|
|
|
// does the window participate in the tabbing order?
|
|
|
|
if (pChildLoop->GetStyle() & WB_DIALOGCONTROL)
|
|
|
|
implResetDefault(pChildLoop);
|
|
|
|
|
|
|
|
// is it a button?
|
|
|
|
WindowType eType = pChildLoop->GetType();
|
|
|
|
if ( (WINDOW_BUTTON == eType)
|
|
|
|
|| (WINDOW_PUSHBUTTON == eType)
|
|
|
|
|| (WINDOW_OKBUTTON == eType)
|
|
|
|
|| (WINDOW_CANCELBUTTON == eType)
|
|
|
|
|| (WINDOW_HELPBUTTON == eType)
|
|
|
|
|| (WINDOW_IMAGEBUTTON == eType)
|
|
|
|
|| (WINDOW_MENUBUTTON == eType)
|
|
|
|
|| (WINDOW_MOREBUTTON == eType)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
pChildLoop->SetStyle(pChildLoop->GetStyle() & ~WB_DEFBUTTON);
|
|
|
|
}
|
|
|
|
|
|
|
|
// the next one ...
|
|
|
|
pChildLoop = pChildLoop->GetWindow(WINDOW_NEXT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::defaultButton(PushButton* _pNewDefButton)
|
|
|
|
{
|
|
|
|
// loop through all (direct and indirect) descendants which participate in our tabbing order, and
|
|
|
|
// reset the WB_DEFBUTTON for every window which is a button
|
|
|
|
implResetDefault(this);
|
|
|
|
|
|
|
|
// set it's new style
|
|
|
|
if (_pNewDefButton)
|
|
|
|
_pNewDefButton->SetStyle(_pNewDefButton->GetStyle() | WB_DEFBUTTON);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::enableButtons(sal_uInt32 _nWizardButtonFlags, sal_Bool _bEnable)
|
|
|
|
{
|
|
|
|
if (m_pFinish && (_nWizardButtonFlags & WZB_FINISH))
|
|
|
|
m_pFinish->Enable(_bEnable);
|
|
|
|
if (m_pNextPage && (_nWizardButtonFlags & WZB_NEXT))
|
|
|
|
m_pNextPage->Enable(_bEnable);
|
|
|
|
if (m_pPrevPage && (_nWizardButtonFlags & WZB_PREVIOUS))
|
|
|
|
m_pPrevPage->Enable(_bEnable);
|
|
|
|
if (m_pHelp && (_nWizardButtonFlags & WZB_HELP))
|
|
|
|
m_pHelp->Enable(_bEnable);
|
|
|
|
if (m_pCancel && (_nWizardButtonFlags & WZB_CANCEL))
|
|
|
|
m_pCancel->Enable(_bEnable);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2004-05-19 13:01:49 +00:00
|
|
|
void OWizardMachine::enterState(WizardState _nState)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
// tell the page
|
2004-08-02 13:37:20 +00:00
|
|
|
IWizardPage* pCurrentPage = getWizardPage(GetPage(_nState));
|
|
|
|
if ( pCurrentPage )
|
2001-02-15 13:08:36 +00:00
|
|
|
pCurrentPage->initializePage();
|
|
|
|
|
2004-08-02 13:37:20 +00:00
|
|
|
if ( m_pImpl->m_bCheckButtonStates )
|
|
|
|
enableButtons(WZB_NEXT,WZS_INVALID_STATE != determineNextState(_nState) );
|
|
|
|
enableButtons(WZB_PREVIOUS,!m_pImpl->aStateHistory.empty());
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
// set the new title - it depends on the current page (i.e. state)
|
|
|
|
implUpdateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2006-06-19 20:00:47 +00:00
|
|
|
sal_Bool OWizardMachine::leaveState(WizardState)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
// no need to ask the page here.
|
|
|
|
// If we reach this point, we already gave the current page the chance to commit it's data,
|
|
|
|
// and it was allowed to commit it's data
|
|
|
|
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::onFinish(sal_Int32 _nResult)
|
|
|
|
{
|
|
|
|
return Finnish(_nResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2006-06-19 20:00:47 +00:00
|
|
|
IMPL_LINK(OWizardMachine, OnFinish, PushButton*, EMPTYARG)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
2005-03-11 09:42:17 +00:00
|
|
|
if( IsInCallOfLink() )
|
|
|
|
return 0;
|
|
|
|
SetInCallOfLink( true );
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( !prepareLeaveCurrentState( eFinish ) )
|
2005-03-11 09:42:17 +00:00
|
|
|
{
|
|
|
|
SetInCallOfLink( false);
|
2001-02-15 13:08:36 +00:00
|
|
|
return 0L;
|
2005-03-11 09:42:17 +00:00
|
|
|
}
|
|
|
|
long nRet = onFinish( RET_OK );
|
|
|
|
SetInCallOfLink( false);
|
|
|
|
return nRet;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2004-05-19 13:01:49 +00:00
|
|
|
OWizardMachine::WizardState OWizardMachine::determineNextState( WizardState _nCurrentState )
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
|
|
|
return _nCurrentState + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2004-05-19 13:01:49 +00:00
|
|
|
sal_Bool OWizardMachine::prepareLeaveCurrentState( CommitPageReason _eReason )
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
2004-08-02 13:37:20 +00:00
|
|
|
IWizardPage* pCurrentPage = getWizardPage(GetPage(getCurrentState()));
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( pCurrentPage )
|
2004-08-02 13:37:20 +00:00
|
|
|
return pCurrentPage->commitPage( ( IWizardPage::COMMIT_REASON )_eReason );
|
2004-05-19 13:01:49 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::skipBackwardUntil( WizardState _nTargetState )
|
|
|
|
{
|
|
|
|
// alowed to leave the current page?
|
|
|
|
if ( !prepareLeaveCurrentState( eTravelBackward ) )
|
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
// don't travel directly on m_pImpl->aStateHistory, in case something goes wrong
|
|
|
|
::std::stack< WizardState > aTravelVirtually = m_pImpl->aStateHistory;
|
2004-10-27 12:23:37 +00:00
|
|
|
::std::stack< WizardState > aOldStateHistory = m_pImpl->aStateHistory;
|
2004-05-19 13:01:49 +00:00
|
|
|
|
|
|
|
WizardState nCurrentRollbackState = getCurrentState();
|
|
|
|
while ( nCurrentRollbackState != _nTargetState )
|
|
|
|
{
|
|
|
|
DBG_ASSERT( !aTravelVirtually.empty(), "OWizardMachine::skipBackwardUntil: this target state does not exist in the history!" );
|
|
|
|
nCurrentRollbackState = aTravelVirtually.top();
|
|
|
|
aTravelVirtually.pop();
|
|
|
|
}
|
2004-10-27 12:23:37 +00:00
|
|
|
m_pImpl->aStateHistory = aTravelVirtually;
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( !ShowPage( _nTargetState ) )
|
2004-10-27 12:23:37 +00:00
|
|
|
{
|
|
|
|
m_pImpl->aStateHistory = aOldStateHistory;
|
2004-05-19 13:01:49 +00:00
|
|
|
return sal_False;
|
2004-10-27 12:23:37 +00:00
|
|
|
}
|
2004-05-19 13:01:49 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::skipUntil( WizardState _nTargetState )
|
|
|
|
{
|
2004-09-20 12:38:16 +00:00
|
|
|
WizardState nCurrentState = getCurrentState();
|
|
|
|
|
2004-05-19 13:01:49 +00:00
|
|
|
// alowed to leave the current page?
|
2004-09-20 12:38:16 +00:00
|
|
|
if ( !prepareLeaveCurrentState( nCurrentState < _nTargetState ? eTravelForward : eTravelBackward ) )
|
2004-05-19 13:01:49 +00:00
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
// don't travel directly on m_pImpl->aStateHistory, in case something goes wrong
|
|
|
|
::std::stack< WizardState > aTravelVirtually = m_pImpl->aStateHistory;
|
2004-10-27 12:23:37 +00:00
|
|
|
::std::stack< WizardState > aOldStateHistory = m_pImpl->aStateHistory;
|
2004-05-19 13:01:49 +00:00
|
|
|
while ( nCurrentState != _nTargetState )
|
|
|
|
{
|
|
|
|
WizardState nNextState = determineNextState( nCurrentState );
|
|
|
|
if ( WZS_INVALID_STATE == nNextState )
|
|
|
|
{
|
|
|
|
DBG_ERROR( "OWizardMachine::skipUntil: the given target state does not exist!" );
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
// remember the skipped state in the history
|
|
|
|
aTravelVirtually.push( nCurrentState );
|
|
|
|
|
|
|
|
// get the next state
|
|
|
|
nCurrentState = nNextState;
|
|
|
|
}
|
2004-10-27 12:23:37 +00:00
|
|
|
m_pImpl->aStateHistory = aTravelVirtually;
|
2004-05-19 13:01:49 +00:00
|
|
|
// show the target page
|
|
|
|
if ( !ShowPage( nCurrentState ) )
|
|
|
|
{
|
|
|
|
// argh! prepareLeaveCurrentPage succeeded, determineNextState succeeded,
|
|
|
|
// but ShowPage doesn't? Somebody behaves very strange here ....
|
|
|
|
DBG_ERROR( "OWizardMachine::skipUntil: very unpolite ...." );
|
2004-10-27 12:23:37 +00:00
|
|
|
m_pImpl->aStateHistory = aOldStateHistory;
|
2004-05-19 13:01:49 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
2001-02-15 13:08:36 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2001-02-23 07:21:21 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::skip(sal_Int32 _nSteps)
|
|
|
|
{
|
|
|
|
DBG_ASSERT(_nSteps > 0, "OWizardMachine::skip: invalid number of steps!");
|
|
|
|
// alowed to leave the current page?
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( !prepareLeaveCurrentState( eTravelForward ) )
|
2001-02-23 07:21:21 +00:00
|
|
|
return sal_False;
|
|
|
|
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nCurrentState = getCurrentState();
|
|
|
|
WizardState nNextState = determineNextState(nCurrentState);
|
2001-02-23 07:21:21 +00:00
|
|
|
// loop _nSteps steps
|
|
|
|
while (_nSteps-- > 0)
|
|
|
|
{
|
|
|
|
if (WZS_INVALID_STATE == nNextState)
|
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
// remember the skipped state in the history
|
2001-08-02 09:37:38 +00:00
|
|
|
m_pImpl->aStateHistory.push(nCurrentState);
|
2001-02-23 07:21:21 +00:00
|
|
|
|
|
|
|
// get the next state
|
|
|
|
nCurrentState = nNextState;
|
|
|
|
nNextState = determineNextState(nCurrentState);
|
|
|
|
}
|
|
|
|
|
|
|
|
// show the (n+1)th page
|
2001-02-23 09:55:00 +00:00
|
|
|
if (!ShowPage(nCurrentState))
|
2001-02-23 07:21:21 +00:00
|
|
|
{
|
|
|
|
// TODO: this leaves us in a state where we have no current page and an inconsistent state history.
|
|
|
|
// Perhaps we should rollback the skipping here ....
|
|
|
|
DBG_ERROR("OWizardMachine::skip: very unpolite ....");
|
|
|
|
// if somebody does a skip and then does not allow to leave ...
|
|
|
|
// (can't be a commit error, as we've already committed the current page. So if ShowPage fails here,
|
|
|
|
// somebody behaves really strange ...)
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
// all fine
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::travelNext()
|
|
|
|
{
|
2004-05-19 13:01:49 +00:00
|
|
|
// allowed to leave the current page?
|
|
|
|
if ( !prepareLeaveCurrentState( eTravelForward ) )
|
2001-02-15 13:08:36 +00:00
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
// determine the next state to travel to
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nCurrentState = getCurrentState();
|
|
|
|
WizardState nNextState = determineNextState(nCurrentState);
|
2001-02-15 13:08:36 +00:00
|
|
|
if (WZS_INVALID_STATE == nNextState)
|
|
|
|
return sal_False;
|
|
|
|
|
2004-08-02 13:37:20 +00:00
|
|
|
// the state history is used by the enterState method
|
|
|
|
// all fine
|
|
|
|
m_pImpl->aStateHistory.push(nCurrentState);
|
2001-02-15 13:08:36 +00:00
|
|
|
if (!ShowPage(nNextState))
|
2004-08-02 13:37:20 +00:00
|
|
|
{
|
|
|
|
m_pImpl->aStateHistory.pop();
|
2001-02-15 13:08:36 +00:00
|
|
|
return sal_False;
|
2004-08-02 13:37:20 +00:00
|
|
|
}
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
sal_Bool OWizardMachine::travelPrevious()
|
|
|
|
{
|
2001-08-02 09:37:38 +00:00
|
|
|
DBG_ASSERT(m_pImpl->aStateHistory.size() > 0, "OWizardMachine::travelPrevious: have no previous page!");
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
// alowed to leave the current page?
|
2004-05-19 13:01:49 +00:00
|
|
|
if ( !prepareLeaveCurrentState( eTravelBackward ) )
|
2001-02-15 13:08:36 +00:00
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
// the next state to switch to
|
2004-05-19 13:01:49 +00:00
|
|
|
WizardState nPreviousState = m_pImpl->aStateHistory.top();
|
2001-02-15 13:08:36 +00:00
|
|
|
|
2004-08-02 13:37:20 +00:00
|
|
|
// the state history is used by the enterState method
|
|
|
|
m_pImpl->aStateHistory.pop();
|
2001-02-15 13:08:36 +00:00
|
|
|
// show this page
|
|
|
|
if (!ShowPage(nPreviousState))
|
2004-08-02 13:37:20 +00:00
|
|
|
{
|
|
|
|
m_pImpl->aStateHistory.push(nPreviousState);
|
2001-02-15 13:08:36 +00:00
|
|
|
return sal_False;
|
2004-08-02 13:37:20 +00:00
|
|
|
}
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
// all fine
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2004-09-20 12:38:16 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void OWizardMachine::removePageFromHistory( WizardState nToRemove )
|
|
|
|
{
|
|
|
|
|
|
|
|
::std::stack< WizardState > aTemp;
|
|
|
|
while(!m_pImpl->aStateHistory.empty())
|
|
|
|
{
|
|
|
|
WizardState nPreviousState = m_pImpl->aStateHistory.top();
|
|
|
|
m_pImpl->aStateHistory.pop();
|
|
|
|
if(nPreviousState != nToRemove)
|
|
|
|
aTemp.push( nPreviousState );
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
while(!aTemp.empty())
|
|
|
|
{
|
|
|
|
m_pImpl->aStateHistory.push( aTemp.top() );
|
|
|
|
aTemp.pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-15 13:08:36 +00:00
|
|
|
//---------------------------------------------------------------------
|
2006-06-19 20:00:47 +00:00
|
|
|
IMPL_LINK(OWizardMachine, OnPrevPage, PushButton*, EMPTYARG)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
2005-03-11 09:42:17 +00:00
|
|
|
if( IsInCallOfLink() )
|
|
|
|
return 0;
|
|
|
|
SetInCallOfLink( true );
|
|
|
|
sal_Int32 nRet = travelPrevious();
|
|
|
|
SetInCallOfLink( false );
|
|
|
|
return nRet;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2006-06-19 20:00:47 +00:00
|
|
|
IMPL_LINK(OWizardMachine, OnNextPage, PushButton*, EMPTYARG)
|
2001-02-15 13:08:36 +00:00
|
|
|
{
|
2005-03-11 09:42:17 +00:00
|
|
|
if( IsInCallOfLink() )
|
|
|
|
return 0;
|
|
|
|
SetInCallOfLink( true );
|
|
|
|
sal_Int32 nRet = travelNext();
|
|
|
|
SetInCallOfLink( false );
|
|
|
|
return nRet;
|
2001-02-15 13:08:36 +00:00
|
|
|
}
|
2004-08-02 13:37:20 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
IWizardPage* OWizardMachine::getWizardPage(TabPage* _pCurrentPage) const
|
|
|
|
{
|
|
|
|
OWizardPage* pPage = static_cast<OWizardPage*>(_pCurrentPage);
|
|
|
|
return pPage;
|
|
|
|
}
|
2005-03-11 09:42:17 +00:00
|
|
|
/*-- 23.02.2005 10:50:17---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
bool OWizardMachine::IsInCallOfLink() const
|
|
|
|
{
|
|
|
|
return m_pImpl->m_bInCallOfLink;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 23.02.2005 10:48:01---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void OWizardMachine::SetInCallOfLink( bool bSet )
|
|
|
|
{
|
|
|
|
DBG_ASSERT( bSet != m_pImpl->m_bInCallOfLink, "OWizardMachine::SetInCallOfLink - state already set" );
|
|
|
|
m_pImpl->m_bInCallOfLink = bSet;
|
|
|
|
}
|
2001-02-15 13:08:36 +00:00
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace svt
|
|
|
|
//.........................................................................
|