2006-07-13 16:02:37 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
|
|
*
|
|
|
|
* $RCSfile: dp_gui_dependencydialog.cxx,v $
|
|
|
|
*
|
2006-09-17 08:38:58 +00:00
|
|
|
* $Revision: 1.4 $
|
2006-07-13 16:02:37 +00:00
|
|
|
*
|
2006-09-17 08:38:58 +00:00
|
|
|
* last change: $Author: obo $ $Date: 2006-09-17 09:38:58 $
|
2006-07-13 16:02:37 +00:00
|
|
|
*
|
|
|
|
* 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 2006 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
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 08:38:58 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_desktop.hxx"
|
|
|
|
|
2006-07-13 16:02:37 +00:00
|
|
|
#include "sal/config.h"
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "rtl/ustring.hxx"
|
|
|
|
#include "tools/gen.hxx"
|
|
|
|
#include "tools/resid.hxx"
|
|
|
|
#include "tools/resmgr.hxx"
|
|
|
|
#include "tools/solar.h"
|
|
|
|
#include "tools/string.hxx"
|
|
|
|
#include "vcl/dialog.hxx"
|
|
|
|
|
|
|
|
#include "dp_gui.hrc"
|
|
|
|
#include "dp_gui_dependencydialog.hxx"
|
|
|
|
|
|
|
|
class Window;
|
|
|
|
|
|
|
|
using dp_gui::DependencyDialog;
|
|
|
|
|
|
|
|
DependencyDialog::DependencyDialog(
|
|
|
|
Window * parent, std::vector< rtl::OUString > const & dependencies):
|
|
|
|
ModalDialog(
|
|
|
|
parent,
|
|
|
|
ResId(
|
|
|
|
RID_DLG_DEPENDENCIES,
|
|
|
|
ResMgr::CreateResMgr("deploymentgui" LIBRARY_SOLARUPD()))),
|
|
|
|
m_text(this, ResId(RID_DLG_DEPENDENCIES_TEXT)),
|
|
|
|
m_list(this, ResId(RID_DLG_DEPENDENCIES_LIST)),
|
|
|
|
m_ok(this, ResId(RID_DLG_DEPENDENCIES_OK)),
|
|
|
|
m_listDelta(
|
|
|
|
GetOutputSizePixel().Width() - m_list.GetSizePixel().Width(),
|
|
|
|
GetOutputSizePixel().Height() - m_list.GetSizePixel().Height())
|
|
|
|
{
|
|
|
|
SetMinOutputSizePixel(GetOutputSizePixel());
|
|
|
|
m_list.SetReadOnly();
|
|
|
|
for (std::vector< rtl::OUString >::const_iterator i(dependencies.begin());
|
|
|
|
i != dependencies.end(); ++i)
|
|
|
|
{
|
|
|
|
m_list.InsertEntry(
|
|
|
|
i->getLength() == 0
|
|
|
|
? String(ResId(RID_DLG_DEPENDENCIES_UNKNOWN)) : String(*i));
|
|
|
|
}
|
2006-08-11 16:16:05 +00:00
|
|
|
FreeResource();
|
2006-07-13 16:02:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DependencyDialog::~DependencyDialog() {}
|
|
|
|
|
|
|
|
void DependencyDialog::Resize() {
|
|
|
|
long n = m_ok.GetPosPixel().Y() -
|
|
|
|
(m_list.GetPosPixel().Y() + m_list.GetSizePixel().Height());
|
|
|
|
m_list.SetSizePixel(
|
|
|
|
Size(
|
|
|
|
GetOutputSizePixel().Width() - m_listDelta.Width(),
|
|
|
|
GetOutputSizePixel().Height() - m_listDelta.Height()));
|
|
|
|
m_ok.SetPosPixel(
|
|
|
|
Point(
|
|
|
|
(m_list.GetPosPixel().X() +
|
|
|
|
(m_list.GetSizePixel().Width() - m_ok.GetSizePixel().Width()) / 2),
|
|
|
|
m_list.GetPosPixel().Y() + m_list.GetSizePixel().Height() + n));
|
|
|
|
}
|