[Libreoffice-commits] core.git: include/svtools svtools/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 6 12:53:09 UTC 2020
include/svtools/brwbox.hxx | 87 ++++++++++++++++++++++++++++++++++++--
svtools/source/brwbox/brwbox1.cxx | 2
svtools/source/brwbox/datwin.cxx | 4 +
svtools/source/brwbox/datwin.hxx | 81 -----------------------------------
4 files changed, 89 insertions(+), 85 deletions(-)
New commits:
commit 35a6e10a42408331de5be54a878a8ee200f0743f
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jul 5 19:51:26 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jul 6 14:52:15 2020 +0200
expose that GetDataWindow is always a BrowserDataWin
Change-Id: I63e29131dc5186dcb72b06f6425479271f191b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98170
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 0b0d3af6fb2e..df19ecf02a1b 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -26,6 +26,7 @@
#include <vcl/event.hxx>
#include <vcl/headbar.hxx>
#include <vcl/transfer.hxx>
+#include <vcl/timer.hxx>
#include <vcl/AccessibleBrowseBoxObjType.hxx>
#include <vcl/accessibletableprovider.hxx>
#include <vector>
@@ -36,7 +37,6 @@
#include <o3tl/typed_flags_set.hxx>
class BrowserColumn;
-class BrowserDataWin;
class BrowserHeader;
class ScrollBar;
class StatusBar;
@@ -137,6 +137,88 @@ public:
const tools::Rectangle& GetRect() const { return aRect; }
};
+class BrowseBox;
+class ScrollBarBox;
+class BrowserMouseEvent;
+
+class BrowserDataWin
+ :public Control
+ ,public DragSourceHelper
+ ,public DropTargetHelper
+{
+public:
+ VclPtr<BrowserHeader> pHeaderBar; // only for BrowserMode::HEADERBAR_NEW
+ VclPtr<ScrollBarBox> pCornerWin; // Window in the corner btw the ScrollBars
+ bool bInDtor;
+ AutoTimer aMouseTimer; // recalls MouseMove on dragging out
+ MouseEvent aRepeatEvt; // a MouseEvent to repeat
+ Point aLastMousePos; // prevents pseudo-MouseMoves
+
+ OUString aRealRowCount; // to show in VScrollBar
+
+ std::vector<tools::Rectangle> aInvalidRegion; // invalidated Rectangles during !UpdateMode
+ bool bInPaint; // TRUE while in Paint
+ bool bInCommand; // TRUE while in Command
+ bool bNoHScroll; // no horizontal scrollbar
+ bool bNoVScroll; // no vertical scrollbar
+ bool bAutoHScroll; // autohide horizontaler Scrollbar
+ bool bAutoVScroll; // autohide horizontaler Scrollbar
+ bool bUpdateMode; // not SV-UpdateMode because of Invalidate()
+ bool bAutoSizeLastCol; // last column always fills up window
+ bool bResizeOnPaint; // outstanding resize-event
+ bool bUpdateOnUnlock; // Update() while locked
+ bool bInUpdateScrollbars; // prevents recursions
+ bool bHadRecursion; // a recursion occurred
+ bool bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop currently
+ sal_uInt16 nUpdateLock; // lock count, don't call Control::Update()!
+ short nCursorHidden; // new counter for DoHide/ShowCursor
+
+ long m_nDragRowDividerLimit;
+ long m_nDragRowDividerOffset;
+
+public:
+ explicit BrowserDataWin( BrowseBox* pParent );
+ virtual ~BrowserDataWin() override;
+ virtual void dispose() override;
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void RequestHelp( const HelpEvent& rHEvt ) override;
+ virtual void Command( const CommandEvent& rEvt ) override;
+ virtual void MouseButtonDown( const MouseEvent& rEvt ) override;
+ virtual void MouseMove( const MouseEvent& rEvt ) override;
+ DECL_LINK( RepeatedMouseMove, Timer *, void );
+
+ virtual void MouseButtonUp( const MouseEvent& rEvt ) override;
+ virtual void KeyInput( const KeyEvent& rEvt ) override;
+ virtual void Tracking( const TrackingEvent& rTEvt ) override;
+
+ // DropTargetHelper overridables
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
+
+ // DragSourceHelper overridables
+ virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) override;
+
+
+ BrowseEvent CreateBrowseEvent( const Point& rPosPixel );
+ BrowseBox* GetParent() const;
+ const OUString& GetRealRowCount() const { return aRealRowCount; }
+
+ void SetUpdateMode( bool bMode );
+ bool GetUpdateMode() const { return bUpdateMode; }
+ void EnterUpdateLock() { ++nUpdateLock; }
+ void LeaveUpdateLock();
+ void Update();
+ void DoOutstandingInvalidations();
+ void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
+ void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
+ using Control::Invalidate;
+
+protected:
+ void StartRowDividerDrag( const Point& _rStartPos );
+ bool ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
+};
class BrowserMouseEvent: public MouseEvent, public BrowseEvent
{
@@ -161,7 +243,6 @@ public:
BrowserExecuteDropEvent( BrowserDataWin* pWin, const ExecuteDropEvent& rEvt );
};
-
// TODO
// The whole selection thingie in this class is somewhat... suspicious to me.
// some oddities:
@@ -487,7 +568,7 @@ public:
bool IsResizing() const { return bResizing; }
// access to positions of fields, column and rows
- vcl::Window& GetDataWindow() const;
+ BrowserDataWin& GetDataWindow() const;
tools::Rectangle GetRowRectPixel( long nRow ) const;
tools::Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId,
bool bRelToBrowser = true) const;
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 78ed723a7987..17392a79db0e 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2331,7 +2331,7 @@ sal_uInt16 BrowseBox::GetVisibleRows() const
return static_cast<sal_uInt16>((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1);
}
-vcl::Window& BrowseBox::GetDataWindow() const
+BrowserDataWin& BrowseBox::GetDataWindow() const
{
return *pDataWin;
}
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index f22ddb19e370..80350e4a31cb 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -288,6 +288,10 @@ void BrowserDataWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
}
}
+BrowseBox* BrowserDataWin::GetParent() const
+{
+ return static_cast<BrowseBox*>(Window::GetParent());
+}
BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
{
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 1105708cc5a5..34e30c1812f5 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -80,87 +80,6 @@ public:
};
-class BrowserDataWin
- :public Control
- ,public DragSourceHelper
- ,public DropTargetHelper
-{
-public:
- VclPtr<BrowserHeader> pHeaderBar; // only for BrowserMode::HEADERBAR_NEW
- VclPtr<ScrollBarBox> pCornerWin; // Window in the corner btw the ScrollBars
- bool bInDtor;
- AutoTimer aMouseTimer; // recalls MouseMove on dragging out
- MouseEvent aRepeatEvt; // a MouseEvent to repeat
- Point aLastMousePos; // prevents pseudo-MouseMoves
-
- OUString aRealRowCount; // to show in VScrollBar
-
- std::vector<tools::Rectangle> aInvalidRegion; // invalidated Rectangles during !UpdateMode
- bool bInPaint; // TRUE while in Paint
- bool bInCommand; // TRUE while in Command
- bool bNoHScroll; // no horizontal scrollbar
- bool bNoVScroll; // no vertical scrollbar
- bool bAutoHScroll; // autohide horizontaler Scrollbar
- bool bAutoVScroll; // autohide horizontaler Scrollbar
- bool bUpdateMode; // not SV-UpdateMode because of Invalidate()
- bool bAutoSizeLastCol; // last column always fills up window
- bool bResizeOnPaint; // outstanding resize-event
- bool bUpdateOnUnlock; // Update() while locked
- bool bInUpdateScrollbars; // prevents recursions
- bool bHadRecursion; // a recursion occurred
- bool bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop currently
- sal_uInt16 nUpdateLock; // lock count, don't call Control::Update()!
- short nCursorHidden; // new counter for DoHide/ShowCursor
-
- long m_nDragRowDividerLimit;
- long m_nDragRowDividerOffset;
-
-public:
- explicit BrowserDataWin( BrowseBox* pParent );
- virtual ~BrowserDataWin() override;
- virtual void dispose() override;
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
- virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
- virtual void RequestHelp( const HelpEvent& rHEvt ) override;
- virtual void Command( const CommandEvent& rEvt ) override;
- virtual void MouseButtonDown( const MouseEvent& rEvt ) override;
- virtual void MouseMove( const MouseEvent& rEvt ) override;
- DECL_LINK( RepeatedMouseMove, Timer *, void );
-
- virtual void MouseButtonUp( const MouseEvent& rEvt ) override;
- virtual void KeyInput( const KeyEvent& rEvt ) override;
- virtual void Tracking( const TrackingEvent& rTEvt ) override;
-
- // DropTargetHelper overridables
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
- virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
-
- // DragSourceHelper overridables
- virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) override;
-
-
- BrowseEvent CreateBrowseEvent( const Point& rPosPixel );
- BrowseBox* GetParent() const
- { return static_cast<BrowseBox*>( Window::GetParent() ); }
- const OUString& GetRealRowCount() const { return aRealRowCount; }
-
- void SetUpdateMode( bool bMode );
- bool GetUpdateMode() const { return bUpdateMode; }
- void EnterUpdateLock() { ++nUpdateLock; }
- void LeaveUpdateLock();
- void Update();
- void DoOutstandingInvalidations();
- void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
- void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
- using Control::Invalidate;
-
-protected:
- void StartRowDividerDrag( const Point& _rStartPos );
- bool ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
-};
-
-
class BrowserScrollBar: public ScrollBar
{
sal_uLong _nLastPos;
More information about the Libreoffice-commits
mailing list