[Libreoffice-commits] .: 4 commits - dbaccess/source desktop/Module_desktop.mk desktop/source desktop/uiconfig desktop/UI_deployment.mk desktop/util padmin/source sd/source svtools/inc svtools/Library_svt.mk svtools/Package_inc.mk svtools/source sw/source toolkit/source vcl/inc vcl/Library_vcl.mk vcl/Package_inc.mk vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 13 01:49:40 PST 2012
dbaccess/source/ext/macromigration/rangeprogressbar.hxx | 2
desktop/Module_desktop.mk | 1
desktop/UI_deployment.mk | 16
desktop/source/deployment/gui/dp_gui.hrc | 15
desktop/source/deployment/gui/dp_gui_dialog2.cxx | 310 +++--------
desktop/source/deployment/gui/dp_gui_dialog2.hxx | 30 -
desktop/source/deployment/gui/dp_gui_dialog2.src | 96 ---
desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 31 +
desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 5
desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 6
desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx | 2
desktop/source/inc/helpid.hrc | 1
desktop/uiconfig/ui/ExtensionManager.ui | 304 ++++++++++
desktop/util/hidother.src | 1
padmin/source/progress.hxx | 3
sd/source/ui/inc/BreakDlg.hxx | 2
sd/source/ui/inc/vectdlg.hxx | 2
svtools/Library_svt.mk | 1
svtools/Package_inc.mk | 1
svtools/inc/svtools/prgsbar.hxx | 94 ---
svtools/source/control/prgsbar.cxx | 249 --------
svtools/source/uno/unoiface.cxx | 2
sw/source/ui/dbui/mmoutputpage.hxx | 2
toolkit/source/awt/vclxwindows.cxx | 6
vcl/Library_vcl.mk | 1
vcl/Package_inc.mk | 1
vcl/inc/vcl/fixedhyper.hxx | 2
vcl/inc/vcl/prgsbar.hxx | 92 +++
vcl/source/control/fixedhyper.cxx | 8
vcl/source/control/prgsbar.cxx | 249 ++++++++
vcl/source/window/builder.cxx | 12
vcl/source/window/layout.cxx | 46 -
32 files changed, 863 insertions(+), 730 deletions(-)
New commits:
commit 1e1bcd008ec2767a24bebbd5f3059d73cc54f6df
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 13 09:44:35 2012 +0000
favour expandables over non-expandables for shrinking scenario
if grid contents change their mind and want to be bigger than
available space, then somethings got to give, prefer expandables
as shrinkables too
Change-Id: Iefd87adb722548c11df04f194cf6d6e17665289a
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 548e06e..be6cbe4 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -729,24 +729,27 @@ void VclGrid::setAllocation(const Size& rAllocation)
for (sal_Int32 x = 0; x < nMaxX; ++x)
aWidths[x].m_nValue = nAvailableWidth/nMaxX;
}
- else
+ else if (rAllocation.Width() != aRequisition.Width())
{
- long nExtraWidth = 0;
+ sal_Int32 nExpandables = 0;
+ for (sal_Int32 x = 0; x < nMaxX; ++x)
+ if (aWidths[x].m_bExpand)
+ ++nExpandables;
+ long nExtraWidthForExpanders = nExpandables ? (rAllocation.Width() - aRequisition.Width()) / nExpandables : 0;
+
if (rAllocation.Width() < aRequisition.Width())
- nExtraWidth = (rAllocation.Width() - aRequisition.Width()) / nMaxX;
- else
{
- sal_Int32 nExpandables = 0;
+ long nExtraWidth = (rAllocation.Width() - aRequisition.Width() - nExtraWidthForExpanders * nExpandables) / nMaxX;
+
for (sal_Int32 x = 0; x < nMaxX; ++x)
- if (aWidths[x].m_bExpand)
- ++nExpandables;
- nExtraWidth = nExpandables ? (rAllocation.Width() - aRequisition.Width()) / nExpandables : 0;
+ aWidths[x].m_nValue += nExtraWidth;
}
- if (nExtraWidth)
+
+ if (nExtraWidthForExpanders)
{
for (sal_Int32 x = 0; x < nMaxX; ++x)
if (aWidths[x].m_bExpand)
- aWidths[x].m_nValue += nExtraWidth;
+ aWidths[x].m_nValue += nExtraWidthForExpanders;
}
}
@@ -756,24 +759,27 @@ void VclGrid::setAllocation(const Size& rAllocation)
for (sal_Int32 y = 0; y < nMaxY; ++y)
aHeights[y].m_nValue = nAvailableHeight/nMaxY;
}
- else
+ else if (rAllocation.Height() != aRequisition.Height())
{
- long nExtraHeight = 0;
+ sal_Int32 nExpandables = 0;
+ for (sal_Int32 y = 0; y < nMaxY; ++y)
+ if (aHeights[y].m_bExpand)
+ ++nExpandables;
+ long nExtraHeightForExpanders = nExpandables ? (rAllocation.Height() - aRequisition.Height()) / nExpandables : 0;
+
if (rAllocation.Height() < aRequisition.Height())
- nExtraHeight = (rAllocation.Height() - aRequisition.Height()) / nMaxY;
- else
{
- sal_Int32 nExpandables = 0;
+ long nExtraHeight = (rAllocation.Height() - aRequisition.Height() - nExtraHeightForExpanders * nExpandables) / nMaxY;
+
for (sal_Int32 y = 0; y < nMaxY; ++y)
- if (aHeights[y].m_bExpand)
- ++nExpandables;
- nExtraHeight = nExpandables ? (rAllocation.Height() - aRequisition.Height()) / nExpandables : 0;
+ aHeights[y].m_nValue += nExtraHeight;
}
- if (nExtraHeight)
+
+ if (nExtraHeightForExpanders)
{
for (sal_Int32 y = 0; y < nMaxY; ++y)
if (aHeights[y].m_bExpand)
- aHeights[y].m_nValue += nExtraHeight;
+ aHeights[y].m_nValue += nExtraHeightForExpanders;
}
}
commit 19f4ebd8a54da0ae03b9cc8481613e5cd20ee1e7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 12 21:17:37 2012 +0000
use SetControlForeground instead of SetTextColor
because that's persistent across unrelated style
changes otherwise setting e.g. alignment will
reset the color to default black
Change-Id: I2b975c3914a59a93e54d72aa0975a066b5edf533
diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx
index 87aa06f..9bfd0b8 100644
--- a/vcl/source/control/fixedhyper.cxx
+++ b/vcl/source/control/fixedhyper.cxx
@@ -49,7 +49,7 @@ void FixedHyperlink::Initialize()
aFont.SetUnderline( UNDERLINE_SINGLE );
SetControlFont( aFont );
// changes the color to light blue
- SetTextColor( Color( COL_LIGHTBLUE ) );
+ SetControlForeground( Color( COL_LIGHTBLUE ) );
// calculates text len
m_nTextLen = GetCtrlTextWidth( GetText() );
}
@@ -85,7 +85,7 @@ void FixedHyperlink::GetFocus()
void FixedHyperlink::LoseFocus()
{
- SetTextColor( Color( COL_LIGHTBLUE ) );
+ SetTextColor( GetControlForeground() );
Paint( Rectangle( Point(), GetSizePixel() ) );
HideFocus();
}
commit b1cf29092494e59a59b4f8f5786a7617ed270073
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 12 21:12:31 2012 +0000
merge SetDescription into SetText
that way the display text always matches the link text
Change-Id: I3f4901803bd9354d2cd0fc29d7d91ccd8e3def54
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index b251506..2d6c30d 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -573,7 +573,7 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
pEntry->m_pPublisher->SetBackground();
pEntry->m_pPublisher->SetPaintTransparent( true );
pEntry->m_pPublisher->SetURL( pEntry->m_sPublisherURL );
- pEntry->m_pPublisher->SetDescription( pEntry->m_sPublisher );
+ pEntry->m_pPublisher->SetText( pEntry->m_sPublisher );
Size aSize = FixedText::CalcMinimumTextSize( pEntry->m_pPublisher );
pEntry->m_pPublisher->SetSizePixel( aSize );
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index c9b5c4f..8762acc 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -966,7 +966,7 @@ void UpdateDialog::clearDescription()
String sEmpty;
m_PublisherLabel.Hide();
m_PublisherLink.Hide();
- m_PublisherLink.SetDescription( sEmpty );
+ m_PublisherLink.SetText( sEmpty );
m_PublisherLink.SetURL( sEmpty );
m_ReleaseNotesLabel.Hide();
m_ReleaseNotesLink.Hide();
@@ -1015,7 +1015,7 @@ bool UpdateDialog::showDescription(std::pair< rtl::OUString, rtl::OUString > con
{
m_PublisherLabel.Show();
m_PublisherLink.Show();
- m_PublisherLink.SetDescription( sPub );
+ m_PublisherLink.SetText( sPub );
m_PublisherLink.SetURL( sURL );
bPublisher = true;
}
@@ -1054,7 +1054,7 @@ bool UpdateDialog::showDescription( const String& rDescription, bool bWithPublis
m_descriptions.SetPosSizePixel( aNewPos, aNewSize );
}
m_descriptions.Show();
- m_descriptions.SetDescription( rDescription );
+ m_descriptions.SetText( rDescription );
return true;
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 4177481..aa69a69 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2955,8 +2955,8 @@ void VCLXFixedHyperlink::setText( const ::rtl::OUString& Text ) throw(::com::sun
SolarMutexGuard aGuard;
FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
- if ( pBase )
- pBase->SetDescription( Text );
+ if (pBase)
+ pBase->SetText(Text);
}
::rtl::OUString VCLXFixedHyperlink::getText() throw(::com::sun::star::uno::RuntimeException)
@@ -3084,7 +3084,7 @@ void VCLXFixedHyperlink::setProperty( const ::rtl::OUString& PropertyName, const
{
::rtl::OUString sNewLabel;
if ( Value >>= sNewLabel )
- pBase->SetDescription( sNewLabel );
+ pBase->SetText(sNewLabel);
break;
}
diff --git a/vcl/inc/vcl/fixedhyper.hxx b/vcl/inc/vcl/fixedhyper.hxx
index 2f53ba2..1d609f0 100644
--- a/vcl/inc/vcl/fixedhyper.hxx
+++ b/vcl/inc/vcl/fixedhyper.hxx
@@ -119,7 +119,7 @@
OUString GetURL() const;
/** sets new text and recalculates the text length. */
- void SetDescription(const OUString& rNewDescription);
+ virtual void SetText(const String& rNewDescription);
};
#endif
diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx
index 18de8a6..87aa06f 100644
--- a/vcl/source/control/fixedhyper.cxx
+++ b/vcl/source/control/fixedhyper.cxx
@@ -115,9 +115,9 @@ OUString FixedHyperlink::GetURL() const
return m_sURL;
}
-void FixedHyperlink::SetDescription(const OUString& rNewDescription)
+void FixedHyperlink::SetText(const String& rNewDescription)
{
- SetText(rNewDescription);
+ FixedText::SetText(rNewDescription);
m_nTextLen = GetCtrlTextWidth(GetText());
}
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index aa33c16..76ee4ad 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -705,7 +705,7 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
}
else if (name == "GtkLinkButton")
- pWindow = new FixedHyperlink(pParent);
+ pWindow = new FixedHyperlink(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK|WB_NOLABEL);
else if (name == "GtkComboBox")
{
extractModel(id, rMap);
commit f88473c56a718574e3cf45725f568cb4e1397aa4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 12 14:48:31 2012 +0000
convert extension dialog to .ui
Change-Id: I4d938be9e960f421398dd40bbcf1b3cadc643de1
diff --git a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
index 5c3585a..de93416 100644
--- a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
+++ b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
@@ -20,7 +20,7 @@
#ifndef DBACCESS_RANGEPROGRESSBAR_HXX
#define DBACCESS_RANGEPROGRESSBAR_HXX
-#include <svtools/prgsbar.hxx>
+#include <vcl/prgsbar.hxx>
//........................................................................
namespace dbmm
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index cb067b3..1122360 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -37,6 +37,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
Library_sofficeapp \
Library_spl \
Package_intro \
+ UI_deployment \
Zip_brand \
Zip_brand_dev \
))
diff --git a/desktop/UI_deployment.mk b/desktop/UI_deployment.mk
new file mode 100644
index 0000000..c06e91f
--- /dev/null
+++ b/desktop/UI_deployment.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UI_UI,desktop))
+
+$(eval $(call gb_UI_add_uifiles,desktop,\
+ desktop/uiconfig/ui/ExtensionManager \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index 08c557e..0adbea5 100644
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -23,21 +23,14 @@
#include "helpid.hrc"
// Package Manager Dialog:
-#define RID_DLG_EXTENSION_MANAGER RID_DEPLOYMENT_GUI_START
#define RID_DLG_UPDATE_REQUIRED (RID_DEPLOYMENT_GUI_START + 11)
#define RID_EM_BTN_CLOSE 10
#define RID_EM_BTN_HELP 11
-#define RID_EM_BTN_ADD 12
-#define RID_EM_BTN_CHECK_UPDATES 13
-#define RID_EM_BTN_CANCEL 15
-#define RID_EM_FT_TYPE_EXTENSIONS 16
-#define RID_EM_CBX_BUNDLED 17
-#define RID_EM_CBX_SHARED 18
-#define RID_EM_CBX_USER 19
-#define RID_EM_FT_GET_EXTENSIONS 20
-#define RID_EM_FT_PROGRESS 21
-#define RID_EM_FT_MSG 22
+#define RID_EM_BTN_CHECK_UPDATES 12
+#define RID_EM_BTN_CANCEL 13
+#define RID_EM_FT_PROGRESS 14
+#define RID_EM_FT_MSG 15
// local RIDs:
#define PB_LICENSE_DOWN 50
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index b7d924a..442f349 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -152,9 +152,11 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
DECL_DLLPRIVATE_LINK( HandleHyperlink, FixedHyperlink * );
public:
- ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager );
+ ExtBoxWithBtns_Impl(Window* pParent);
~ExtBoxWithBtns_Impl();
+ void InitFromDialog(ExtMgrDialog *pParentDialog);
+
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual long Notify( NotifyEvent& rNEvt );
@@ -166,15 +168,23 @@ public:
void enableButtons( bool bEnable );
};
+ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl(Window* pParent)
+ : ExtensionBox_Impl(pParent)
+ , m_bInterfaceLocked(false)
+ , m_pOptionsBtn(NULL)
+ , m_pEnableBtn(NULL)
+ , m_pRemoveBtn(NULL)
+ , m_pParent(NULL)
+{
+}
+
//------------------------------------------------------------------------------
-ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager ) :
- ExtensionBox_Impl( pParent, pManager ),
- m_bInterfaceLocked( false ),
- m_pOptionsBtn( NULL ),
- m_pEnableBtn( NULL ),
- m_pRemoveBtn( NULL ),
- m_pParent( pParent )
+void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog)
{
+ setExtensionManager(pParentDialog->getExtensionManager());
+
+ m_pParent = pParentDialog;
+
m_pOptionsBtn = new PushButton( this, WB_TABSTOP );
m_pEnableBtn = new PushButton( this, WB_TABSTOP );
m_pRemoveBtn = new PushButton( this, WB_TABSTOP );
@@ -203,6 +213,12 @@ ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionMan
SetScrollHdl( LINK( this, ExtBoxWithBtns_Impl, ScrollHdl ) );
}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeExtBoxWithBtns(Window *pParent, VclBuilder::stringmap &)
+{
+ return new ExtBoxWithBtns_Impl(pParent);
+}
+
//------------------------------------------------------------------------------
ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl()
{
@@ -700,79 +716,53 @@ void DialogHelper::PostUserEvent( const Link& rLink, void* pCaller )
//------------------------------------------------------------------------------
// ExtMgrDialog
//------------------------------------------------------------------------------
-ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
- ModelessDialog( pParent, getResId( RID_DLG_EXTENSION_MANAGER ) ),
- DialogHelper( pManager->getContext(), (Dialog*) this ),
- m_aAddBtn( this, getResId( RID_EM_BTN_ADD ) ),
- m_aUpdateBtn( this, getResId( RID_EM_BTN_CHECK_UPDATES ) ),
- m_aCloseBtn( this, getResId( RID_EM_BTN_CLOSE ) ),
- m_aHelpBtn( this, getResId( RID_EM_BTN_HELP ) ),
- m_aDivider( this ),
- m_aDivider2(this),
- m_aTypeOfExtTxt( this , getResId( RID_EM_FT_TYPE_EXTENSIONS ) ),
- m_aBundledCbx(this, getResId (RID_EM_CBX_BUNDLED)),
- m_aSharedCbx(this, getResId (RID_EM_CBX_SHARED)),
- m_aUserCbx (this, getResId (RID_EM_CBX_USER)),
- m_aGetExtensions( this, getResId( RID_EM_FT_GET_EXTENSIONS ) ),
- m_aProgressText( this, getResId( RID_EM_FT_PROGRESS ) ),
- m_aProgressBar( this, WB_BORDER + WB_3DLOOK ),
- m_aCancelBtn( this, getResId( RID_EM_BTN_CANCEL ) ),
- m_sAddPackages( getResourceString( RID_STR_ADD_PACKAGES ) ),
- m_bHasProgress( false ),
- m_bProgressChanged( false ),
- m_bStartProgress( false ),
- m_bStopProgress( false ),
- m_bEnableWarning( false ),
- m_bDisableWarning( false ),
- m_bDeleteWarning( false ),
- m_nProgress( 0 ),
- m_pManager( pManager )
-{
- // free local resources (RID < 256):
- FreeResource();
-
- m_pExtensionBox = new ExtBoxWithBtns_Impl( this, pManager );
+ExtMgrDialog::ExtMgrDialog(Window *pParent, TheExtensionManager *pManager)
+ : ModelessDialog(pParent, "ExtensionManagerDialog", "desktop/ui/ExtensionManager.ui")
+ , DialogHelper(pManager->getContext(), (Dialog*) this)
+ , m_sAddPackages(getResourceString(RID_STR_ADD_PACKAGES))
+ , m_bHasProgress(false)
+ , m_bProgressChanged(false)
+ , m_bStartProgress(false)
+ , m_bStopProgress(false)
+ , m_bEnableWarning(false)
+ , m_bDisableWarning(false)
+ , m_bDeleteWarning(false)
+ , m_nProgress(0)
+ , m_pManager(pManager)
+{
+ get(m_pExtensionBox, "extensions");
+ get(m_pAddBtn, "add");
+ get(m_pUpdateBtn, "update");
+ get(m_pCloseBtn, "close");
+ get(m_pBundledCbx, "bundled");
+ get(m_pSharedCbx, "shared");
+ get(m_pUserCbx, "user");
+ get(m_pGetExtensions, "getextensions");
+ get(m_pProgressText, "progressft");
+ get(m_pProgressBar, "progressbar");
+ get(m_pCancelBtn, "cancel");
+
+ m_pExtensionBox->InitFromDialog(this);
m_pExtensionBox->SetHyperlinkHdl( LINK( this, ExtMgrDialog, HandleHyperlink ) );
- m_aAddBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleAddBtn ) );
- m_aUpdateBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleUpdateBtn ) );
- m_aGetExtensions.SetClickHdl( LINK( this, ExtMgrDialog, HandleHyperlink ) );
- m_aCancelBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleCancelBtn ) );
-
- m_aBundledCbx.SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
- m_aSharedCbx.SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
- m_aUserCbx.SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
-
- // resize update button
- Size aBtnSize = m_aUpdateBtn.GetSizePixel();
- String sTitle = m_aUpdateBtn.GetText();
- long nWidth = m_aUpdateBtn.GetCtrlTextWidth( sTitle );
- nWidth += 2 * m_aUpdateBtn.GetTextHeight();
- if ( nWidth > aBtnSize.Width() )
- m_aUpdateBtn.SetSizePixel( Size( nWidth, aBtnSize.Height() ) );
+ m_pAddBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleAddBtn ) );
+ m_pCloseBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleCloseBtn ) );
- // minimum size:
- SetMinOutputSizePixel(
- Size( // width:
- (3 * m_aHelpBtn.GetSizePixel().Width()) +
- m_aUpdateBtn.GetSizePixel().Width() +
- (5 * RSC_SP_DLG_INNERBORDER_LEFT ),
- // height:
- (1 * m_aHelpBtn.GetSizePixel().Height()) +
- (1 * m_aGetExtensions.GetSizePixel().Height()) +
- (1 * m_pExtensionBox->GetMinOutputSizePixel().Height()) +
- (3 * RSC_SP_DLG_INNERBORDER_TOP) ) );
+ m_pUpdateBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleUpdateBtn ) );
+ m_pGetExtensions->SetClickHdl( LINK( this, ExtMgrDialog, HandleHyperlink ) );
+ m_pCancelBtn->SetClickHdl( LINK( this, ExtMgrDialog, HandleCancelBtn ) );
- m_aDivider.Show();
- m_aDivider2.Show();
+ m_pBundledCbx->SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
+ m_pSharedCbx->SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
+ m_pUserCbx->SetClickHdl( LINK( this, ExtMgrDialog, HandleExtTypeCbx ) );
- m_aBundledCbx.Check( true );
- m_aSharedCbx.Check( true );
- m_aUserCbx.Check( true );
+ m_pBundledCbx->Check( true );
+ m_pSharedCbx->Check( true );
+ m_pUserCbx->Check( true );
- m_aProgressBar.Hide();
+ m_pProgressBar->Hide();
- m_aUpdateBtn.Enable( false );
+ m_pUpdateBtn->Enable(false);
m_aTimeoutTimer.SetTimeout( 500 ); // mSec
m_aTimeoutTimer.SetTimeoutHdl( LINK( this, ExtMgrDialog, TimeOutHdl ) );
@@ -782,13 +772,12 @@ ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
ExtMgrDialog::~ExtMgrDialog()
{
m_aTimeoutTimer.Stop();
- delete m_pExtensionBox;
}
//------------------------------------------------------------------------------
void ExtMgrDialog::setGetExtensionsURL( const ::rtl::OUString &rURL )
{
- m_aGetExtensions.SetURL( rURL );
+ m_pGetExtensions->SetURL( rURL );
}
//------------------------------------------------------------------------------
@@ -797,19 +786,19 @@ long ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage
{
const SolarMutexGuard aGuard;
- m_aUpdateBtn.Enable( true );
+ m_pUpdateBtn->Enable(true);
m_pExtensionBox->removeEntry(xPackage);
- if (m_aBundledCbx.IsChecked() && xPackage->getRepositoryName().equals( BUNDLED_PACKAGE_MANAGER ))
+ if (m_pBundledCbx->IsChecked() && xPackage->getRepositoryName().equals( BUNDLED_PACKAGE_MANAGER ))
{
return m_pExtensionBox->addEntry( xPackage, bLicenseMissing );
}
- else if (m_aSharedCbx.IsChecked() && xPackage->getRepositoryName().equals( SHARED_PACKAGE_MANAGER ))
+ else if (m_pSharedCbx->IsChecked() && xPackage->getRepositoryName().equals( SHARED_PACKAGE_MANAGER ))
{
return m_pExtensionBox->addEntry( xPackage, bLicenseMissing );
}
- else if (m_aUserCbx.IsChecked() && xPackage->getRepositoryName().equals( USER_PACKAGE_MANAGER ))
+ else if (m_pUserCbx->IsChecked() && xPackage->getRepositoryName().equals( USER_PACKAGE_MANAGER ))
{
return m_pExtensionBox->addEntry( xPackage, bLicenseMissing );
}
@@ -1009,6 +998,13 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn)
return 1;
}
+IMPL_LINK_NOARG(ExtMgrDialog, HandleCloseBtn)
+{
+ Close();
+ return 1;
+}
+
+
// ------------------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
{
@@ -1020,8 +1016,8 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
if ( m_bStopProgress )
{
- if ( m_aProgressBar.IsVisible() )
- m_aProgressBar.SetValue( 100 );
+ if ( m_pProgressBar->IsVisible() )
+ m_pProgressBar->SetValue( 100 );
m_xAbortChannel.clear();
OSL_TRACE( " startProgress handler: stop" );
@@ -1031,9 +1027,9 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
OSL_TRACE( " startProgress handler: start" );
}
- m_aCancelBtn.Enable( bLockInterface );
- m_aAddBtn.Enable( !bLockInterface );
- m_aUpdateBtn.Enable( !bLockInterface && m_pExtensionBox->getItemCount() );
+ m_pCancelBtn->Enable( bLockInterface );
+ m_pAddBtn->Enable( !bLockInterface );
+ m_pUpdateBtn->Enable( !bLockInterface && m_pExtensionBox->getItemCount() );
m_pExtensionBox->enableButtons( !bLockInterface );
clearEventID();
@@ -1136,30 +1132,30 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl)
{
m_bHasProgress = false;
m_bStopProgress = false;
- m_aProgressText.Hide();
- m_aProgressBar.Hide();
- m_aCancelBtn.Hide();
+ m_pProgressText->Hide();
+ m_pProgressBar->Hide();
+ m_pCancelBtn->Hide();
}
else
{
if ( m_bProgressChanged )
{
m_bProgressChanged = false;
- m_aProgressText.SetText( m_sProgressText );
+ m_pProgressText->SetText(m_sProgressText);
}
if ( m_bStartProgress )
{
m_bStartProgress = false;
m_bHasProgress = true;
- m_aProgressBar.Show();
- m_aProgressText.Show();
- m_aCancelBtn.Enable();
- m_aCancelBtn.Show();
+ m_pProgressBar->Show();
+ m_pProgressText->Show();
+ m_pCancelBtn->Enable();
+ m_pCancelBtn->Show();
}
- if ( m_aProgressBar.IsVisible() )
- m_aProgressBar.SetValue( (sal_uInt16) m_nProgress );
+ if ( m_pProgressBar->IsVisible() )
+ m_pProgressBar->SetValue( (sal_uInt16) m_nProgress );
m_aTimeoutTimer.Start();
}
@@ -1169,126 +1165,6 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl)
//------------------------------------------------------------------------------
// VCL::Window / Dialog
-void ExtMgrDialog::Resize()
-{
- Size aTotalSize( GetOutputSizePixel() );
- Size aBtnSize( m_aHelpBtn.GetSizePixel() );
- Size aUpdBtnSize( m_aUpdateBtn.GetSizePixel() );
- long offsetX;
-
-// last row of the box, lower 4 buttons
-
- Point aPos( RSC_SP_DLG_INNERBORDER_LEFT,
- aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_BOTTOM - aBtnSize.Height() );
-
- m_aHelpBtn.SetPosPixel( aPos );
-
- aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - aBtnSize.Width();
- m_aCloseBtn.SetPosPixel( aPos );
-
- aPos.X() -= ( RSC_SP_CTRL_X + aUpdBtnSize.Width() );
- m_aUpdateBtn.SetPosPixel( aPos );
-
- aPos.X() -= ( RSC_SP_CTRL_GROUP_X + aBtnSize.Width() );
- m_aAddBtn.SetPosPixel( aPos );
-
-// horizontal line above lower buttons
-
- Size aDivSize( aTotalSize.Width(), LINE_SIZE );
- aPos = Point( 0, aPos.Y() - LINE_SIZE - RSC_SP_DLG_INNERBORDER_BOTTOM );
- m_aDivider.SetPosSizePixel( aPos, aDivSize );
-
-// text "get more extensions"
-
- Size aFTSize( m_aGetExtensions.CalcMinimumSize() );
-// aPos = Point( RSC_SP_DLG_INNERBORDER_LEFT, aPos.Y() - RSC_CD_FIXEDTEXT_HEIGHT - 2*RSC_SP_DLG_INNERBORDER_BOTTOM );
- aPos = Point( RSC_SP_DLG_INNERBORDER_LEFT, aPos.Y() - RSC_CD_PUSHBUTTON_HEIGHT - 2*RSC_SP_DLG_INNERBORDER_BOTTOM );
-
- m_aGetExtensions.SetPosSizePixel( aPos, aFTSize );
-
-// installation progress bar + cancel button , on the right of the text to get extensions
-
- aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - aBtnSize.Width();
- m_aCancelBtn.SetPosPixel( Point( aPos.X(), aPos.Y() - ((aBtnSize.Height()-aFTSize.Height())/2) ) );
-
- // Calc progress height
- long nProgressHeight = aFTSize.Height();
-
- if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
- {
- ImplControlValue aValue;
- Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() );
- Rectangle aNativeControlRegion, aNativeContentRegion;
- if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
- CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) != sal_False )
- {
- nProgressHeight = aNativeControlRegion.GetHeight();
- }
- }
-
- if ( nProgressHeight < PROGRESS_HEIGHT )
- nProgressHeight = PROGRESS_HEIGHT;
-
- aPos.X() -= ( RSC_SP_CTRL_GROUP_Y + PROGRESS_WIDTH );
- m_aProgressBar.SetPosSizePixel( Point( aPos.X(), aPos.Y() - ((nProgressHeight-aFTSize.Height())/2) ),
- Size( PROGRESS_WIDTH, nProgressHeight ) );
-
- Rectangle aRect1( m_aGetExtensions.GetPosPixel(), m_aGetExtensions.GetSizePixel() );
- Rectangle aRect2( m_aProgressBar.GetPosPixel(), m_aProgressBar.GetSizePixel() );
-
- aFTSize.Width() = ( aRect2.Left() - aRect1.Right() ) - 2*RSC_SP_DLG_INNERBORDER_LEFT;
- aPos.X() = aRect1.Right() + RSC_SP_DLG_INNERBORDER_LEFT;
- m_aProgressText.SetPosSizePixel( aPos, aFTSize );
-
-// checkboxes + text "type of extensions"
-
- long nWidth = m_aBundledCbx.GetCtrlTextWidth( m_aBundledCbx.GetText() );
- Size aBCBSize(m_aBundledCbx.GetSizePixel());
- aBCBSize.Width() = nWidth + 30;
- m_aBundledCbx.SetSizePixel( aBCBSize );
-
- nWidth = m_aSharedCbx.GetCtrlTextWidth( m_aSharedCbx.GetText() );
- Size aSCBSize(m_aSharedCbx.GetSizePixel());
- aSCBSize.Width() = nWidth + 30;
- m_aSharedCbx.SetSizePixel( aSCBSize );
-
- nWidth = m_aUserCbx.GetCtrlTextWidth( m_aUserCbx.GetText() );
- Size aUCBSize(m_aUserCbx.GetSizePixel());
- aUCBSize.Width() = nWidth + 30;
- m_aUserCbx.SetSizePixel( aUCBSize );
-
- offsetX = 0.5*(aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT - 3*RSC_SP_CTRL_GROUP_X - aBCBSize.Width() - aSCBSize.Width() - aUCBSize.Width() );
-
- aPos = Point(offsetX, aPos.Y() - RSC_CD_CHECKBOX_HEIGHT - 2*RSC_SP_DLG_INNERBORDER_BOTTOM);
- m_aBundledCbx.SetPosPixel( aPos );
- aPos.X() += aBCBSize.Width() + 3 * RSC_SP_CTRL_GROUP_X;
- m_aSharedCbx.SetPosPixel( aPos );
- aPos.X() += aSCBSize.Width() + 3 * RSC_SP_CTRL_GROUP_X;
- m_aUserCbx.SetPosPixel( aPos );
-
- Size aFTTypeOfExtSize(m_aTypeOfExtTxt.GetSizePixel());
- aPos = Point(RSC_SP_DLG_INNERBORDER_LEFT , aPos.Y() - RSC_CD_FIXEDTEXT_HEIGHT - 2*RSC_SP_DLG_INNERBORDER_BOTTOM);
-
- m_aTypeOfExtTxt.SetPosSizePixel(aPos, aFTTypeOfExtSize);
-
- aPos.X() = RSC_SP_DLG_INNERBORDER_LEFT + aFTTypeOfExtSize.Width();
- aPos.Y() = aPos.Y() + RSC_CD_FIXEDTEXT_HEIGHT;
- aDivSize.Width() = aTotalSize.Width() - aFTTypeOfExtSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT;
- m_aDivider2.SetPosSizePixel( aPos , aDivSize );
-
-// extension listbox
-
- Size aSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT,
- aTotalSize.Height() - aBtnSize.Height() - LINE_SIZE - aBtnSize.Height()
- - aBCBSize.Height() - aFTTypeOfExtSize.Height()
- - RSC_SP_DLG_INNERBORDER_TOP - 5*RSC_SP_DLG_INNERBORDER_BOTTOM );
-
- m_pExtensionBox->SetSizePixel(aSize );
-
-}
-//------------------------------------------------------------------------------
-// VCL::Window / Dialog
long ExtMgrDialog::Notify( NotifyEvent& rNEvt )
{
@@ -1303,12 +1179,12 @@ long ExtMgrDialog::Notify( NotifyEvent& rNEvt )
if ( nKeyCode == KEY_TAB )
{
if ( aKeyCode.IsShift() ) {
- if ( m_aAddBtn.HasFocus() ) {
+ if ( m_pAddBtn->HasFocus() ) {
m_pExtensionBox->GrabFocus();
bHandled = true;
}
} else {
- if ( m_aGetExtensions.HasFocus() ) {
+ if ( m_pGetExtensions->HasFocus() ) {
m_pExtensionBox->GrabFocus();
bHandled = true;
}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 542e040..8f8dd89 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -33,9 +33,9 @@
#include "vcl/button.hxx"
#include "vcl/fixed.hxx"
#include "vcl/fixedhyper.hxx"
+#include "vcl/prgsbar.hxx"
#include "vcl/timer.hxx"
-#include "svtools/prgsbar.hxx"
#include "svtools/svmedit.hxx"
#include "osl/conditn.hxx"
@@ -108,20 +108,16 @@ class ExtMgrDialog : public ModelessDialog,
public DialogHelper
{
ExtBoxWithBtns_Impl *m_pExtensionBox;
- PushButton m_aAddBtn;
- PushButton m_aUpdateBtn;
- OKButton m_aCloseBtn;
- HelpButton m_aHelpBtn;
- FixedLine m_aDivider;
- FixedLine m_aDivider2;
- FixedText m_aTypeOfExtTxt;
- CheckBox m_aBundledCbx;
- CheckBox m_aSharedCbx;
- CheckBox m_aUserCbx;
- FixedHyperlink m_aGetExtensions;
- FixedText m_aProgressText;
- ProgressBar m_aProgressBar;
- CancelButton m_aCancelBtn;
+ PushButton *m_pAddBtn;
+ PushButton *m_pUpdateBtn;
+ PushButton *m_pCloseBtn;
+ CheckBox *m_pBundledCbx;
+ CheckBox *m_pSharedCbx;
+ CheckBox *m_pUserCbx;
+ FixedHyperlink *m_pGetExtensions;
+ FixedText *m_pProgressText;
+ ProgressBar *m_pProgressBar;
+ CancelButton *m_pCancelBtn;
const String m_sAddPackages;
String m_sProgressText;
String m_sLastFolderURL;
@@ -144,6 +140,7 @@ class ExtMgrDialog : public ModelessDialog,
DECL_DLLPRIVATE_LINK( HandleAddBtn, void * );
DECL_DLLPRIVATE_LINK( HandleUpdateBtn, void * );
DECL_DLLPRIVATE_LINK( HandleCancelBtn, void * );
+ DECL_DLLPRIVATE_LINK( HandleCloseBtn, void * );
DECL_DLLPRIVATE_LINK( HandleExtTypeCbx, void * );
DECL_DLLPRIVATE_LINK( HandleHyperlink, FixedHyperlink * );
DECL_DLLPRIVATE_LINK(TimeOutHdl, void *);
@@ -153,7 +150,6 @@ public:
ExtMgrDialog( Window * pParent, TheExtensionManager *pManager );
virtual ~ExtMgrDialog();
- virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
virtual sal_Bool Close();
@@ -173,6 +169,8 @@ public:
bool updatePackage(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
bool acceptLicense(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ TheExtensionManager* getExtensionManager() const { return m_pManager; }
+
virtual void prepareChecking();
virtual void checkEntries();
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index 1be415a..134ed1f 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -28,102 +28,6 @@
#include "svtools/controldims.hrc"
#include "dp_gui.hrc"
-ModelessDialog RID_DLG_EXTENSION_MANAGER
-{
- HelpId = HID_PACKAGE_MANAGER;
- Text [ en-US ] = "Extension Manager";
-
- Size = MAP_APPFONT( 300, 250 );
- OutputSize = TRUE;
- SVLook = TRUE;
- Moveable = TRUE;
- Closeable = TRUE;
- Sizeable = TRUE;
- Hide = TRUE;
-
- FixedText RID_EM_FT_TYPE_EXTENSIONS
- {
- NoLabel = FALSE;
- TabStop = TRUE;
- Text [ en-US ] = "Type of Extension";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT );
- };
- CheckBox RID_EM_CBX_BUNDLED
- {
- HelpID = "desktop:CheckBox:RID_DLG_EXTENSION_MANAGER:RID_EM_CBX_BUNDLED";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- TabStop = TRUE ;
- Text [ en-US ] = "~Installation" ;
- };
- CheckBox RID_EM_CBX_SHARED
- {
- HelpID = "desktop:CheckBox:RID_DLG_EXTENSION_MANAGER:RID_EM_CBX_SHARED";
- TabStop = TRUE ;
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Shared" ;
- };
- CheckBox RID_EM_CBX_USER
- {
- HelpID = "desktop:CheckBox:RID_DLG_EXTENSION_MANAGER:RID_EM_CBX_USER";
- TabStop = TRUE ;
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~User" ;
- };
-
- PushButton RID_EM_BTN_ADD
- {
- HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_ADD";
- TabStop = TRUE;
- Text [ en-US ] = "~Add...";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-
- PushButton RID_EM_BTN_CHECK_UPDATES
- {
- HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_CHECK_UPDATES";
- TabStop = TRUE;
- Text [ en-US ] = "~Check for Updates...";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-
- FixedText RID_EM_FT_GET_EXTENSIONS
- {
- NoLabel = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "Get more extensions online...";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT );
- };
-
- FixedText RID_EM_FT_PROGRESS
- {
- Hide = TRUE;
- Right = TRUE;
- Text [ en-US ] = "Adding %EXTENSION_NAME";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT );
- };
-
- CancelButton RID_EM_BTN_CANCEL
- {
- TabStop = TRUE;
- Hide = TRUE;
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-
- OKButton RID_EM_BTN_CLOSE
- {
- TabStop = TRUE;
- DefButton = TRUE;
- Text [ en-US ] = "Close";
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-
- HelpButton RID_EM_BTN_HELP
- {
- TabStop = TRUE;
- Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-};
-
ModalDialog RID_DLG_UPDATE_REQUIRED
{
HelpId = HID_PACKAGE_MANAGER_UPD_REQ;
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 4163dc5..b251506 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -168,7 +168,7 @@ ExtensionRemovedListener::~ExtensionRemovedListener()
//------------------------------------------------------------------------------
// ExtensionBox_Impl
//------------------------------------------------------------------------------
-ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager ) :
+ExtensionBox_Impl::ExtensionBox_Impl( Window* pParent, TheExtensionManager *pManager ) :
IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
m_bHasScrollBar( false ),
m_bHasActive( false ),
@@ -187,6 +187,33 @@ ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pMan
m_pScrollBar( NULL ),
m_pManager( pManager )
{
+ Init();
+}
+
+ExtensionBox_Impl::ExtensionBox_Impl(Window* pParent) :
+ IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
+ m_bHasScrollBar( false ),
+ m_bHasActive( false ),
+ m_bNeedsRecalc( true ),
+ m_bInCheckMode( false ),
+ m_bAdjustActive( false ),
+ m_bInDelete( false ),
+ m_nActive( 0 ),
+ m_nTopIndex( 0 ),
+ m_nActiveHeight( 0 ),
+ m_nExtraHeight( 2 ),
+ m_aSharedImage( DialogHelper::getResId( RID_IMG_SHARED ) ),
+ m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
+ m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
+ m_aDefaultImage( DialogHelper::getResId( RID_IMG_EXTENSION ) ),
+ m_pScrollBar( NULL ),
+ m_pManager( NULL )
+{
+ Init();
+}
+
+void ExtensionBox_Impl::Init()
+{
SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
m_pScrollBar = new ScrollBar( this, WB_VERT );
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 2ca3da7..6104eb0 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -178,8 +178,10 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
void checkIndex(sal_Int32 pos) const;
+ void Init();
public:
- ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager );
+ ExtensionBox_Impl(Window* pParent);
+ ExtensionBox_Impl(Window* pParent, TheExtensionManager *pManager);
~ExtensionBox_Impl();
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -211,6 +213,7 @@ public:
void checkEntries();
TheExtensionManager* getExtensionManager() const { return m_pManager; }
+ void setExtensionManager(TheExtensionManager* pManager) { m_pManager = pManager; }
//===================================================================================
//These functions are used for automatic testing
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index d1e4e44..c0d24b2 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
@@ -24,7 +24,7 @@
#include "vcl/button.hxx"
#include "vcl/fixed.hxx"
#include "vcl/dialog.hxx"
-#include "svtools/prgsbar.hxx"
+#include "vcl/prgsbar.hxx"
#include "rtl/ref.hxx"
#include <vector>
diff --git a/desktop/source/inc/helpid.hrc b/desktop/source/inc/helpid.hrc
index 90ff582..768c573 100644
--- a/desktop/source/inc/helpid.hrc
+++ b/desktop/source/inc/helpid.hrc
@@ -19,7 +19,6 @@
#ifndef INCLUDED_DESKTOP_HELPID_HRC
#define INCLUDED_DESKTOP_HELPID_HRC
-#define HID_PACKAGE_MANAGER "DESKTOP_HID_PACKAGE_MANAGER"
#define HID_PACKAGE_MANAGER_TREELISTBOX "DESKTOP_HID_PACKAGE_MANAGER_TREELISTBOX"
#define HID_PACKAGE_MANAGER_PROGRESS "DESKTOP_HID_PACKAGE_MANAGER_PROGRESS"
#define HID_PACKAGE_MANAGER_PROGRESS_CANCEL "DESKTOP_HID_PACKAGE_MANAGER_PROGRESS_CANCEL"
diff --git a/desktop/uiconfig/ui/ExtensionManager.ui b/desktop/uiconfig/ui/ExtensionManager.ui
new file mode 100644
index 0000000..fc33697
--- /dev/null
+++ b/desktop/uiconfig/ui/ExtensionManager.ui
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="ExtensionManagerDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Extension Manager</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="add">
+ <property name="label" translatable="yes">Add...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="update">
+ <property name="label" translatable="yes">Check for updates...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close">
+ <property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="deploymentgui:ExtBoxWithBtns" id="extensions">
+ <property name="width_request">600</property>
+ <property name="height_request">320</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="shared">
+ <property name="label" translatable="yes">Shared</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">center</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="user">
+ <property name="label" translatable="yes">User</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">start</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="bundled">
+ <property name="label" translatable="yes">Installation</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">end</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Type of Extension</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="progressft">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="margin_left">50</property>
+ <property name="label" translatable="yes">Adding %EXTENSION_NAME</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkProgressBar" id="progressbar">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLinkButton" id="getextensions">
+ <property name="label" translatable="yes">Get more extensions online...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="0">add</action-widget>
+ <action-widget response="0">update</action-widget>
+ <action-widget response="0">close</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/desktop/util/hidother.src b/desktop/util/hidother.src
index 3e314f4..f2607b0 100644
--- a/desktop/util/hidother.src
+++ b/desktop/util/hidother.src
@@ -18,7 +18,6 @@
#include "../source/inc/helpid.hrc"
-hidspecial HID_PACKAGE_MANAGER { HelpID = HID_PACKAGE_MANAGER; };
hidspecial HID_PACKAGE_MANAGER_MENU_ITEM { HelpID = HID_PACKAGE_MANAGER_MENU_ITEM; };
hidspecial HID_PACKAGE_MANAGER_TREELISTBOX { HelpID = HID_PACKAGE_MANAGER_TREELISTBOX; };
hidspecial HID_PACKAGE_MANAGER_PROGRESS { HelpID = HID_PACKAGE_MANAGER_PROGRESS; };
diff --git a/padmin/source/progress.hxx b/padmin/source/progress.hxx
index dcb8a09..a5f383b 100644
--- a/padmin/source/progress.hxx
+++ b/padmin/source/progress.hxx
@@ -23,8 +23,7 @@
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
#include "vcl/button.hxx"
-
-#include "svtools/prgsbar.hxx"
+#include "vcl/prgsbar.hxx"
namespace padmin {
diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx
index 5e7f415..b4d3757 100644
--- a/sd/source/ui/inc/BreakDlg.hxx
+++ b/sd/source/ui/inc/BreakDlg.hxx
@@ -34,7 +34,7 @@
#include <svx/dlgctrl.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
-#include <svtools/prgsbar.hxx>
+#include <vcl/prgsbar.hxx>
#include <vcl/edit.hxx>
#include <svtools/stdctrl.hxx>
#include <sfx2/basedlgs.hxx>
diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx
index 0806a39..a74114f 100644
--- a/sd/source/ui/inc/vectdlg.hxx
+++ b/sd/source/ui/inc/vectdlg.hxx
@@ -36,8 +36,8 @@
#include <vcl/field.hxx>
#include <vcl/dialog.hxx>
#include <vcl/gdimtf.hxx>
+#include <vcl/prgsbar.hxx>
#include <svx/graphctl.hxx>
-#include <svtools/prgsbar.hxx>
namespace sd {
class DrawDocShell;
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 4916808..56fd3c0 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -119,7 +119,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/control/hyperlabel \
svtools/source/control/indexentryres \
svtools/source/control/inettbc \
- svtools/source/control/prgsbar \
svtools/source/control/roadmap \
svtools/source/control/ruler \
svtools/source/control/scriptedtext \
diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk
index 3aeb5d3..7ec94d3 100644
--- a/svtools/Package_inc.mk
+++ b/svtools/Package_inc.mk
@@ -115,7 +115,6 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/place.hxx,svtools/plac
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/PlaceEditDialog.hxx,svtools/PlaceEditDialog.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupmenucontrollerbase.hxx,svtools/popupmenucontrollerbase.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupwindowcontroller.hxx,svtools/popupwindowcontroller.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prgsbar.hxx,svtools/prgsbar.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printoptions.hxx,svtools/printoptions.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prnsetup.hxx,svtools/prnsetup.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/roadmap.hxx,svtools/roadmap.hxx))
diff --git a/svtools/inc/svtools/prgsbar.hxx b/svtools/inc/svtools/prgsbar.hxx
deleted file mode 100644
index 1f4b311..0000000
--- a/svtools/inc/svtools/prgsbar.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _PRGSBAR_HXX
-#define _PRGSBAR_HXX
-
-#include "svtools/svtdllapi.h"
-#include <vcl/window.hxx>
-
-/*************************************************************************
-
-Beschreibung
-============
-
-class ProgressBar
-
-Diese Klasse dient zur Anzeige einer Progress-Anzeige.
-
---------------------------------------------------------------------------
-
-WinBits
-
-WB_BORDER Border um das Fenster
-WB_3DLOOK 3D-Darstellung
-
---------------------------------------------------------------------------
-
-Methoden
-
-Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
-groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
-
-*************************************************************************/
-
-// -----------
-// - WinBits -
-// -----------
-
-#define WB_STDPROGRESSBAR WB_BORDER
-
-// ---------------
-// - ProgressBar -
-// ---------------
-
-class SVT_DLLPUBLIC ProgressBar : public Window
-{
-private:
- Point maPos;
- long mnPrgsWidth;
- long mnPrgsHeight;
- sal_uInt16 mnPercent;
- sal_uInt16 mnPercentCount;
- sal_Bool mbCalcNew;
-
-#ifdef _SV_PRGSBAR_CXX
- using Window::ImplInit;
- SVT_DLLPRIVATE void ImplInit();
- SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- SVT_DLLPRIVATE void ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
-#endif
-
-public:
- ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
- ProgressBar( Window* pParent, const ResId& rResId );
- ~ProgressBar();
-
- virtual void Paint( const Rectangle& rRect );
- virtual void Resize();
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
- void SetValue( sal_uInt16 nNewPercent );
- sal_uInt16 GetValue() const { return mnPercent; }
-};
-
-#endif // _PRGSBAR_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx
deleted file mode 100644
index 18881a0..0000000
--- a/svtools/source/control/prgsbar.cxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#define _SV_PRGSBAR_CXX
-
-#include <tools/debug.hxx>
-#include <vcl/status.hxx>
-#include <svtools/prgsbar.hxx>
-
-// =======================================================================
-
-#define PROGRESSBAR_OFFSET 3
-#define PROGRESSBAR_WIN_OFFSET 2
-
-// =======================================================================
-
-void ProgressBar::ImplInit()
-{
- mnPercent = 0;
- mbCalcNew = sal_True;
-
- ImplInitSettings( sal_True, sal_True, sal_True );
-}
-
-static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle )
-{
- WinBits nOutStyle = nOrgStyle;
- if( pParent && (nOrgStyle & WB_BORDER) != 0 )
- {
- if( pParent->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
- nOutStyle &= WB_BORDER;
- }
- return nOutStyle;
-}
-
-// -----------------------------------------------------------------------
-
-ProgressBar::ProgressBar( Window* pParent, WinBits nWinStyle ) :
- Window( pParent, clearProgressBarBorder( pParent, nWinStyle ) )
-{
- SetOutputSizePixel( Size( 150, 20 ) );
- ImplInit();
-}
-
-// -----------------------------------------------------------------------
-
-ProgressBar::ProgressBar( Window* pParent, const ResId& rResId ) :
- Window( pParent, rResId )
-{
- ImplInit();
-}
-
-// -----------------------------------------------------------------------
-
-ProgressBar::~ProgressBar()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
-{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
- if ( bFont )
- {
- Font aFont;
- aFont = rStyleSettings.GetAppFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-*/
-
- if ( bBackground )
- {
- if( !IsControlBackground() &&
- IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
- {
- if( (GetStyle() & WB_BORDER) )
- SetBorderStyle( WINDOW_BORDER_REMOVEBORDER );
- EnableChildTransparentMode( sal_True );
- SetPaintTransparent( sal_True );
- SetBackground();
- SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- }
- else
- {
- Color aColor;
- if ( IsControlBackground() )
- aColor = GetControlBackground();
- else
- aColor = rStyleSettings.GetFaceColor();
- SetBackground( aColor );
- }
- }
-
- if ( bForeground || bFont )
- {
- Color aColor = rStyleSettings.GetHighlightColor();
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- if ( aColor.IsRGBEqual( GetBackground().GetColor() ) )
- {
- if ( aColor.GetLuminance() > 100 )
- aColor.DecreaseLuminance( 64 );
- else
- aColor.IncreaseLuminance( 64 );
- }
- SetLineColor();
- SetFillColor( aColor );
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
- SetTextColor( aColor );
- SetTextFillColor();
-*/
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
-{
- if ( mbCalcNew )
- {
- mbCalcNew = sal_False;
-
- Size aSize = GetOutputSizePixel();
- mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2);
- mnPrgsWidth = (mnPrgsHeight*2)/3;
- maPos.Y() = PROGRESSBAR_WIN_OFFSET;
- long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET);
- sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
- if ( nMaxCount <= 1 )
- nMaxCount = 1;
- else
- {
- while ( ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET)) > nMaxWidth )
- nMaxCount--;
- }
- mnPercentCount = 10000/nMaxCount;
- nMaxWidth = ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET))-PROGRESSBAR_OFFSET;
- maPos.X() = (aSize.Width()-nMaxWidth)/2;
- }
-
- ::DrawProgress( this, maPos, PROGRESSBAR_OFFSET, mnPrgsWidth, mnPrgsHeight,
- nOldPerc*100, nNewPerc*100, mnPercentCount,
- Rectangle( Point(), GetSizePixel() ) );
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::Paint( const Rectangle& )
-{
- ImplDrawProgress( 0, mnPercent );
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::Resize()
-{
- mbCalcNew = sal_True;
- if ( IsReallyVisible() )
- Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::SetValue( sal_uInt16 nNewPercent )
-{
- DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
-
- if ( nNewPercent < mnPercent )
- {
- mbCalcNew = sal_True;
- mnPercent = nNewPercent;
- if ( IsReallyVisible() )
- {
- Invalidate();
- Update();
- }
- }
- else
- {
- ImplDrawProgress( mnPercent, nNewPercent );
- mnPercent = nNewPercent;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::StateChanged( StateChangedType nType )
-{
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
- if ( (nType == STATE_CHANGE_ZOOM) ||
- (nType == STATE_CHANGE_CONTROLFONT) )
- {
- ImplInitSettings( sal_True, sal_False, sal_False );
- Invalidate();
- }
- else
-*/
- if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
- {
- ImplInitSettings( sal_False, sal_True, sal_False );
- Invalidate();
- }
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- {
- ImplInitSettings( sal_False, sal_False, sal_True );
- Invalidate();
- }
-
- Window::StateChanged( nType );
-}
-
-// -----------------------------------------------------------------------
-
-void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- ImplInitSettings( sal_True, sal_True, sal_True );
- Invalidate();
- }
-
- Window::DataChanged( rDCEvt );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index bb05a95..9034f13 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -29,6 +29,7 @@
#include <tools/debug.hxx>
#include <vcl/fixedhyper.hxx>
+#include <vcl/prgsbar.hxx>
#include <vcl/svapp.hxx>
#include <svtools/svmedit.hxx>
#include <unoiface.hxx>
@@ -43,7 +44,6 @@
#include <svtools/fmtfield.hxx>
#include <svl/numuno.hxx>
#include <svtools/calendar.hxx>
-#include <svtools/prgsbar.hxx>
#include <svtools/treelistbox.hxx>
#include "treecontrolpeer.hxx"
#include "svtxgridcontrol.hxx"
diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx
index 0babb24..1a9bf7f 100644
--- a/sw/source/ui/dbui/mmoutputpage.hxx
+++ b/sw/source/ui/dbui/mmoutputpage.hxx
@@ -33,11 +33,11 @@
#include <vcl/combobox.hxx>
#include <vcl/field.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/prgsbar.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/basedlgs.hxx>
#include <svtools/svtabbx.hxx>
#include <svtools/headbar.hxx>
-#include <svtools/prgsbar.hxx>
#include "swdllapi.h"
#include "mailmergehelper.hxx"
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 212eb8e..004325a 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -140,6 +140,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/control/menubtn \
vcl/source/control/morebtn \
vcl/source/control/quickselectionengine \
+ vcl/source/control/prgsbar \
vcl/source/control/scrbar \
vcl/source/control/slider \
vcl/source/control/spinbtn \
diff --git a/vcl/Package_inc.mk b/vcl/Package_inc.mk
index a079a7a..1c488be 100644
--- a/vcl/Package_inc.mk
+++ b/vcl/Package_inc.mk
@@ -106,6 +106,7 @@ $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/pngwrite.hxx,vcl/pngwrite.hxx)
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/pointr.hxx,vcl/pointr.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/popupmenuwindow.hxx,vcl/popupmenuwindow.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/ppdparser.hxx,vcl/ppdparser.hxx))
+$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/prgsbar.hxx,vcl/prgsbar.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/printerinfomanager.hxx,vcl/printerinfomanager.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/print.hxx,vcl/print.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/prntypes.hxx,vcl/prntypes.hxx))
diff --git a/vcl/inc/vcl/prgsbar.hxx b/vcl/inc/vcl/prgsbar.hxx
new file mode 100644
index 0000000..fb68670
--- /dev/null
+++ b/vcl/inc/vcl/prgsbar.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _PRGSBAR_HXX
+#define _PRGSBAR_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class ProgressBar
+
+Diese Klasse dient zur Anzeige einer Progress-Anzeige.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Border um das Fenster
+WB_3DLOOK 3D-Darstellung
+
+--------------------------------------------------------------------------
+
+Methoden
+
+Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
+groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
+
+*************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_STDPROGRESSBAR WB_BORDER
+
+// ---------------
+// - ProgressBar -
+// ---------------
+
+class VCL_DLLPUBLIC ProgressBar : public Window
+{
+private:
+ Point maPos;
+ long mnPrgsWidth;
+ long mnPrgsHeight;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbCalcNew;
+
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit();
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
+
+public:
+ ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
+ ProgressBar( Window* pParent, const ResId& rResId );
+ ~ProgressBar();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetValue( sal_uInt16 nNewPercent );
+ sal_uInt16 GetValue() const { return mnPercent; }
+};
+
+#endif // _PRGSBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
new file mode 100644
index 0000000..5b0d04c
--- /dev/null
+++ b/vcl/source/control/prgsbar.cxx
@@ -0,0 +1,249 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#define _SV_PRGSBAR_CXX
+
+#include <tools/debug.hxx>
+#include <vcl/status.hxx>
+#include <vcl/prgsbar.hxx>
+
+// =======================================================================
+
+#define PROGRESSBAR_OFFSET 3
+#define PROGRESSBAR_WIN_OFFSET 2
+
+// =======================================================================
+
+void ProgressBar::ImplInit()
+{
+ mnPercent = 0;
+ mbCalcNew = sal_True;
+
+ ImplInitSettings( sal_True, sal_True, sal_True );
+}
+
+static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle )
+{
+ WinBits nOutStyle = nOrgStyle;
+ if( pParent && (nOrgStyle & WB_BORDER) != 0 )
+ {
+ if( pParent->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ nOutStyle &= WB_BORDER;
+ }
+ return nOutStyle;
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::ProgressBar( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, clearProgressBarBorder( pParent, nWinStyle ) )
+{
+ SetOutputSizePixel( Size( 150, 20 ) );
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::ProgressBar( Window* pParent, const ResId& rResId ) :
+ Window( pParent, rResId )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::~ProgressBar()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetAppFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+*/
+
+ if ( bBackground )
+ {
+ if( !IsControlBackground() &&
+ IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ {
+ if( (GetStyle() & WB_BORDER) )
+ SetBorderStyle( WINDOW_BORDER_REMOVEBORDER );
+ EnableChildTransparentMode( sal_True );
+ SetPaintTransparent( sal_True );
+ SetBackground();
+ SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+ }
+ else
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+ }
+
+ if ( bForeground || bFont )
+ {
+ Color aColor = rStyleSettings.GetHighlightColor();
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ if ( aColor.IsRGBEqual( GetBackground().GetColor() ) )
+ {
+ if ( aColor.GetLuminance() > 100 )
+ aColor.DecreaseLuminance( 64 );
+ else
+ aColor.IncreaseLuminance( 64 );
+ }
+ SetLineColor();
+ SetFillColor( aColor );
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ SetTextColor( aColor );
+ SetTextFillColor();
+*/
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
+{
+ if ( mbCalcNew )
+ {
+ mbCalcNew = sal_False;
+
+ Size aSize = GetOutputSizePixel();
+ mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2);
+ mnPrgsWidth = (mnPrgsHeight*2)/3;
+ maPos.Y() = PROGRESSBAR_WIN_OFFSET;
+ long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET);
+ sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
+ if ( nMaxCount <= 1 )
+ nMaxCount = 1;
+ else
+ {
+ while ( ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET)) > nMaxWidth )
+ nMaxCount--;
+ }
+ mnPercentCount = 10000/nMaxCount;
+ nMaxWidth = ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET))-PROGRESSBAR_OFFSET;
+ maPos.X() = (aSize.Width()-nMaxWidth)/2;
+ }
+
+ ::DrawProgress( this, maPos, PROGRESSBAR_OFFSET, mnPrgsWidth, mnPrgsHeight,
+ nOldPerc*100, nNewPerc*100, mnPercentCount,
+ Rectangle( Point(), GetSizePixel() ) );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::Paint( const Rectangle& )
+{
+ ImplDrawProgress( 0, mnPercent );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::Resize()
+{
+ mbCalcNew = sal_True;
+ if ( IsReallyVisible() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::SetValue( sal_uInt16 nNewPercent )
+{
+ DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
+
+ if ( nNewPercent < mnPercent )
+ {
+ mbCalcNew = sal_True;
+ mnPercent = nNewPercent;
+ if ( IsReallyVisible() )
+ {
+ Invalidate();
+ Update();
+ }
+ }
+ else
+ {
+ ImplDrawProgress( mnPercent, nNewPercent );
+ mnPercent = nNewPercent;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::StateChanged( StateChangedType nType )
+{
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( sal_True, sal_False, sal_False );
+ Invalidate();
+ }
+ else
+*/
+ if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( sal_False, sal_True, sal_False );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( sal_False, sal_False, sal_True );
+ Invalidate();
+ }
+
+ Window::StateChanged( nType );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings( sal_True, sal_True, sal_True );
+ Invalidate();
+ }
+
+ Window::DataChanged( rDCEvt );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 55c9ecb..aa33c16 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -20,6 +20,7 @@
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/menubtn.hxx>
+#include <vcl/prgsbar.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx>
#include <vcl/tabctrl.hxx>
@@ -765,6 +766,15 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
else
pWindow = new ScrollBar(pParent, WB_HORZ);
}
+ else if (name == "GtkProgressBar")
+ {
+ extractScrollAdjustment(id, rMap);
+ bVertical = extractOrientation(rMap);
+ if (bVertical)
+ pWindow = new ProgressBar(pParent, WB_VERT);
+ else
+ pWindow = new ProgressBar(pParent, WB_HORZ);
+ }
else if (name == "GtkScrolledWindow")
{
pWindow = new VclScrolledWindow(pParent);
More information about the Libreoffice-commits
mailing list