diff options
Diffstat (limited to 'dbaccess/source/ui/browser/brwview.cxx')
-rw-r--r-- | dbaccess/source/ui/browser/brwview.cxx | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 01b17fd7c544..19ec1ef44a5a 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -21,9 +21,7 @@ #include <sbagrid.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/types.hxx> -#include <vcl/fixed.hxx> #include <vcl/split.hxx> -#include "dbtreeview.hxx" #include <strings.hxx> #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/awt/XControlContainer.hpp> @@ -34,7 +32,6 @@ using namespace dbaui; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::form; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -72,7 +69,6 @@ UnoDataBrowserView::UnoDataBrowserView( vcl::Window* pParent, ,m_pTreeView(nullptr) ,m_pSplitter(nullptr) ,m_pVclControl(nullptr) - ,m_pStatus(nullptr) { } @@ -125,8 +121,6 @@ void UnoDataBrowserView::dispose() m_pSplitter.disposeAndClear(); setTreeView(nullptr); - m_pStatus.disposeAndClear(); - try { ::comphelper::disposeComponent(m_xGrid); @@ -141,7 +135,7 @@ void UnoDataBrowserView::dispose() IMPL_LINK_NOARG( UnoDataBrowserView, SplitHdl, Splitter*, void ) { - long nYPos = m_pSplitter->GetPosPixel().Y(); + tools::Long nYPos = m_pSplitter->GetPosPixel().Y(); m_pSplitter->SetPosPixel( Point( m_pSplitter->GetSplitPosPixel(), nYPos ) ); Resize(); } @@ -153,12 +147,12 @@ void UnoDataBrowserView::setSplitter(Splitter* _pSplitter) LINK( this, UnoDataBrowserView, SplitHdl ).Call(m_pSplitter); } -void UnoDataBrowserView::setTreeView(DBTreeView* _pTreeView) +void UnoDataBrowserView::setTreeView(InterimDBTreeListBox* pTreeView) { - if (m_pTreeView.get() != _pTreeView) + if (m_pTreeView.get() != pTreeView) { m_pTreeView.disposeAndClear(); - m_pTreeView = _pTreeView; + m_pTreeView = pTreeView; } } @@ -168,10 +162,11 @@ void UnoDataBrowserView::showStatus( const OUString& _rStatus ) hideStatus(); else { - if (!m_pStatus) - m_pStatus = VclPtr<FixedText>::Create(this); - m_pStatus->SetText(_rStatus); - m_pStatus->Show(); + if (!m_pTreeView) + return; + weld::Label& rLabel = m_pTreeView->GetStatusBar(); + rLabel.set_label(_rStatus); + rLabel.show(); Resize(); PaintImmediately(); } @@ -179,10 +174,15 @@ void UnoDataBrowserView::showStatus( const OUString& _rStatus ) void UnoDataBrowserView::hideStatus() { - if (!m_pStatus || !m_pStatus->IsVisible()) + if (!m_pTreeView) + return; + weld::Label& rLabel = m_pTreeView->GetStatusBar(); + if (!rLabel.get_visible()) + { // nothing to do return; - m_pStatus->Hide(); + } + rLabel.hide(); Resize(); PaintImmediately(); } @@ -212,20 +212,12 @@ void UnoDataBrowserView::resizeDocumentView(tools::Rectangle& _rPlayground) Point aTreeViewPos( aPlaygroundPos ); Size aTreeViewSize( aSplitPos.X(), aPlaygroundSize.Height() ); - // the status pos and size - if (m_pStatus && m_pStatus->IsVisible()) - { - Size aStatusSize(aPlaygroundPos.X(), GetTextHeight() + 2); - aStatusSize = LogicToPixel(aStatusSize, MapMode(MapUnit::MapAppFont)); - aStatusSize.setWidth( aTreeViewSize.Width() - 2 - 2 ); - - Point aStatusPos( aPlaygroundPos.X() + 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() ); - m_pStatus->SetPosSizePixel( aStatusPos, aStatusSize ); - aTreeViewSize.AdjustHeight( -(aStatusSize.Height()) ); - } - // set the size of treelistbox m_pTreeView->SetPosSizePixel( aTreeViewPos, aTreeViewSize ); + // Call this to trigger InterimItemWindow::Layout immediately, and + // not later on idle so the statusbar will be shown to explain + // a long delay on opening databases + m_pTreeView->Resize(); //set the size of the splitter m_pSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aPlaygroundSize.Height() ) ); @@ -258,11 +250,11 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const Reference< css::awt::XWindowPeer > xPeer = m_xGrid->getPeer(); if ( xPeer.is() ) { - SbaXGridPeer* pPeer = comphelper::getUnoTunnelImplementation<SbaXGridPeer>(xPeer); + SbaXGridPeer* pPeer = dynamic_cast<SbaXGridPeer*>(xPeer.get()); UnoDataBrowserView* pTHIS = const_cast<UnoDataBrowserView*>(this); if ( pPeer ) { - m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow().get()); + m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow()); pTHIS->startComponentListening(VCLUnoHelper::GetInterface(m_pVclControl)); } } @@ -299,7 +291,7 @@ void UnoDataBrowserView::_disposing( const css::lang::EventObject& /*_rSource*/ bool UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) { bool bDone = false; - if(rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) + if(rNEvt.GetType() == NotifyEventType::KEYINPUT) { bool bGrabAllowed = isGrabVclControlFocusAllowed(this); if ( bGrabAllowed ) |