diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-04 13:06:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-09 13:28:35 +0100 |
commit | 1efeb17837c22499f00299c033ae59ba3910f7d7 (patch) | |
tree | a8db0b758e942b3b14fba26129dc51a95ff5c10c /basctl | |
parent | 4da3e0a0e5b2260c26186890724978bfd00f796c (diff) |
weld Property Browser
Replaced the odd HyperlinkField Edit whose text can be clicked on to activate
listeners, with an ordinary Edit and a Button beside it which can be clicked
instead to do that. I couldn't find a real world use of this HyperlinkField in
the forms or control properties, nor in casual experimentation in the sidebar
in the basicide dialog editor.
Also replaced the other strange Edit-alike TextView with a real Edit entry and
a dropdown which can be used to support entry of multi-line labels
Change-Id: Iad5265e404f6de14c8e760d617dbad49cd6ddead
Reviewed-on: https://gerrit.libreoffice.org/82213
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/dlged/propbrw.cxx | 52 | ||||
-rw-r--r-- | basctl/source/inc/propbrw.hxx | 5 |
2 files changed, 16 insertions, 41 deletions
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx index c6565dda2a70..2f7ff78ab52b 100644 --- a/basctl/source/dlged/propbrw.cxx +++ b/basctl/source/dlged/propbrw.cxx @@ -85,6 +85,7 @@ const long WIN_BORDER = 2; PropBrw::PropBrw (DialogWindowLayout& rLayout_): DockingWindow(&rLayout_), + m_xContentArea(VclPtr<VclVBox>::Create(this)), m_bInitialStateChange(true), m_xContextDocument(SfxViewShell::Current() ? SfxViewShell::Current()->GetCurrentDocument() : Reference<XModel>()), pView(nullptr) @@ -93,11 +94,18 @@ PropBrw::PropBrw (DialogWindowLayout& rLayout_): SetMinOutputSizePixel(Size(STD_MIN_SIZE_X,STD_MIN_SIZE_Y)); SetOutputSizePixel(aPropWinSize); + // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under" + // transparent children of the widget + m_xContentArea->SetControlBackground(m_xContentArea->GetSettings().GetStyleSettings().GetWindowColor()); + m_xContentArea->SetBackground(m_xContentArea->GetControlBackground()); + m_xContentArea->SetStyle(m_xContentArea->GetStyle() & ~WB_CLIPCHILDREN); + m_xContentArea->Show(); + try { // create a frame wrapper for myself m_xMeAsFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); - m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); + m_xMeAsFrame->initialize(VCLUnoHelper::GetInterface(m_xContentArea)); m_xMeAsFrame->setName( "form property browser" ); // change name! } catch (const Exception&) @@ -126,7 +134,7 @@ void PropBrw::ImplReCreateController() // a ComponentContext for the ::cppu::ContextEntry_Init aHandlerContextInfo[] = { - ::cppu::ContextEntry_Init( "DialogParentWindow", Any( VCLUnoHelper::GetInterface ( this ) ) ), + ::cppu::ContextEntry_Init( "DialogParentWindow", Any(VCLUnoHelper::GetInterface(this))), ::cppu::ContextEntry_Init( "ContextDocument", Any( m_xContextDocument ) ) }; Reference< XComponentContext > xInspectorContext( @@ -153,8 +161,6 @@ void PropBrw::ImplReCreateController() else { xAsXController->attachFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) ); - m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow(); - DBG_ASSERT(m_xBrowserComponentWindow.is(), "PropBrw::PropBrw: attached the controller, but have no component window!"); } } @@ -163,13 +169,8 @@ void PropBrw::ImplReCreateController() aPropWinSize.AdjustWidth( -(2*WIN_BORDER) ); aPropWinSize.AdjustHeight( -(2*WIN_BORDER) ); - if ( m_xBrowserComponentWindow.is() ) - { - m_xBrowserComponentWindow->setPosSize(aPropWinPos.X(), aPropWinPos.Y(), aPropWinSize.Width(), aPropWinSize.Height(), - css::awt::PosSize::WIDTH | css::awt::PosSize::HEIGHT | - css::awt::PosSize::X | css::awt::PosSize::Y); - m_xBrowserComponentWindow->setVisible(true); - } + VclContainer::setLayoutAllocation(*m_xContentArea, aPropWinPos, aPropWinSize); + m_xContentArea->Show(); } catch (const Exception&) { @@ -177,20 +178,16 @@ void PropBrw::ImplReCreateController() try { ::comphelper::disposeComponent(m_xBrowserController); - ::comphelper::disposeComponent(m_xBrowserComponentWindow); } catch(const Exception&) { } m_xBrowserController.clear(); - m_xBrowserComponentWindow.clear(); } - Resize(); } - PropBrw::~PropBrw() { disposeOnce(); @@ -200,6 +197,7 @@ void PropBrw::dispose() { if ( m_xBrowserController.is() ) ImplDestroyController(); + m_xContentArea.disposeAndClear(); DockingWindow::dispose(); } @@ -227,7 +225,6 @@ void PropBrw::ImplDestroyController() m_xBrowserController.clear(); } - bool PropBrw::Close() { ImplDestroyController(); @@ -238,7 +235,6 @@ bool PropBrw::Close() return DockingWindow::Close(); } - Sequence< Reference< XInterface > > PropBrw::CreateMultiSelectionSequence( const SdrMarkList& _rMarkList ) { @@ -430,25 +426,6 @@ OUString PropBrw::GetHeadlineName( const Reference< XPropertySet >& _rxObject ) return aName; } - -void PropBrw::Resize() -{ - DockingWindow::Resize(); - - // adjust size - Size aSize_ = GetOutputSizePixel(); - Size aPropWinSize( aSize_ ); - aPropWinSize.AdjustWidth( -(2*WIN_BORDER) ); - aPropWinSize.AdjustHeight( -(2*WIN_BORDER) ); - - if (m_xBrowserComponentWindow.is()) - { - m_xBrowserComponentWindow->setPosSize(0, 0, aPropWinSize.Width(), aPropWinSize.Height(), - css::awt::PosSize::WIDTH | css::awt::PosSize::HEIGHT); - } -} - - void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView* pNewView ) { Reference< XModel > xContextDocument( _rxContextDocument ); @@ -482,8 +459,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView // set focus on initialization if ( m_bInitialStateChange ) { - if ( m_xBrowserComponentWindow.is() ) - m_xBrowserComponentWindow->setFocus(); + m_xContentArea->GrabFocus(); m_bInitialStateChange = false; } diff --git a/basctl/source/inc/propbrw.hxx b/basctl/source/inc/propbrw.hxx index 123b477bed92..6bc9066527ce 100644 --- a/basctl/source/inc/propbrw.hxx +++ b/basctl/source/inc/propbrw.hxx @@ -29,6 +29,7 @@ #include <svl/lstner.hxx> #include <svl/SfxBroadcaster.hxx> #include <svx/svdmark.hxx> +#include <vcl/layout.hxx> #include "bastypes.hxx" class SfxBindings; @@ -43,19 +44,17 @@ class DialogWindowLayout; class PropBrw final : public DockingWindow, public SfxListener, public SfxBroadcaster { private: + VclPtr<VclBox> m_xContentArea; bool m_bInitialStateChange; css::uno::Reference< css::frame::XFrame2 > m_xMeAsFrame; css::uno::Reference< css::beans::XPropertySet > m_xBrowserController; - css::uno::Reference< css::awt::XWindow > - m_xBrowserComponentWindow; css::uno::Reference< css::frame::XModel > m_xContextDocument; SdrView* pView; - virtual void Resize() override; virtual bool Close() override; typedef std::vector< css::uno::Reference< css::uno::XInterface> > InterfaceArray; |