2007/05/29 12:44:38 os 1.5.222.2: RESYNC: (1.5-1.6); FILE MERGED 2007/03/26 12:09:02 tl 1.5.222.1: #i69287# warning-free code
125 lines
3.9 KiB
C++
125 lines
3.9 KiB
C++
/*************************************************************************
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: syncbtn.cxx,v $
|
|
*
|
|
* $Revision: 1.7 $
|
|
*
|
|
* last change: $Author: hr $ $Date: 2007-09-27 11:45:19 $
|
|
*
|
|
* The Contents of this file are made available subject to
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
|
*
|
|
*
|
|
* GNU Lesser General Public License Version 2.1
|
|
* =============================================
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
*
|
|
* 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.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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
|
|
*
|
|
************************************************************************/
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
|
|
|
|
|
#ifndef _SFXVIEWFRM_HXX //autogen
|
|
#include <sfx2/viewfrm.hxx>
|
|
#endif
|
|
#ifndef _SFXDISPATCH_HXX //autogen
|
|
#include <sfx2/dispatch.hxx>
|
|
#endif
|
|
|
|
#include "cmdid.h"
|
|
#include "swmodule.hxx"
|
|
#include "view.hxx"
|
|
#include "edtwin.hxx"
|
|
#include "label.hrc"
|
|
|
|
#define _SYNCDLG
|
|
#include "syncbtn.hxx"
|
|
#include "swtypes.hxx"
|
|
|
|
SFX_IMPL_FLOATINGWINDOW( SwSyncChildWin, FN_SYNC_LABELS )
|
|
|
|
/*------------------------------------------------------------------------
|
|
Beschreibung:
|
|
------------------------------------------------------------------------*/
|
|
|
|
SwSyncChildWin::SwSyncChildWin( Window* _pParent,
|
|
USHORT nId,
|
|
SfxBindings* pBindings,
|
|
SfxChildWinInfo* pInfo ) :
|
|
SfxChildWindow( _pParent, nId )
|
|
{
|
|
pWindow = new SwSyncBtnDlg( pBindings, this, _pParent);
|
|
|
|
if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
|
|
{
|
|
SwView* pActiveView = ::GetActiveView();
|
|
if(pActiveView)
|
|
{
|
|
const SwEditWin &rEditWin = pActiveView->GetEditWin();
|
|
pWindow->SetPosPixel(rEditWin.OutputToScreenPixel(Point(0, 0)));
|
|
}
|
|
else
|
|
pWindow->SetPosPixel(_pParent->OutputToScreenPixel(Point(0, 0)));
|
|
pInfo->aPos = pWindow->GetPosPixel();
|
|
pInfo->aSize = pWindow->GetSizePixel();
|
|
}
|
|
|
|
((SwSyncBtnDlg *)pWindow)->Initialize(pInfo);
|
|
|
|
pWindow->Show();
|
|
}
|
|
|
|
/*------------------------------------------------------------------------
|
|
Beschreibung:
|
|
------------------------------------------------------------------------*/
|
|
|
|
SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings,
|
|
SfxChildWindow* pChild,
|
|
Window *pParent) :
|
|
SfxFloatingWindow(_pBindings, pChild, pParent, SW_RES(DLG_SYNC_BTN)),
|
|
aSyncBtn (this, SW_RES(BTN_SYNC ))
|
|
{
|
|
FreeResource();
|
|
aSyncBtn.SetClickHdl(LINK(this, SwSyncBtnDlg, BtnHdl));
|
|
}
|
|
|
|
/*------------------------------------------------------------------------
|
|
Beschreibung:
|
|
------------------------------------------------------------------------*/
|
|
|
|
__EXPORT SwSyncBtnDlg::~SwSyncBtnDlg()
|
|
{
|
|
}
|
|
|
|
/*--------------------------------------------------------------------
|
|
Beschreibung:
|
|
--------------------------------------------------------------------*/
|
|
|
|
IMPL_LINK( SwSyncBtnDlg, BtnHdl, PushButton *, EMPTYARG )
|
|
{
|
|
SfxViewFrame::Current()->GetDispatcher()->Execute(FN_UPDATE_ALL_LINKS, SFX_CALLMODE_ASYNCHRON);
|
|
return 0;
|
|
}
|
|
|
|
|