Kaydet (Commit) cf1e9315 authored tarafından Caolán McNamara's avatar Caolán McNamara

orientation is always vertical

üst 88cf101f
...@@ -838,191 +838,6 @@ void PresenterVerticalScrollBar::PaintComposite( ...@@ -838,191 +838,6 @@ void PresenterVerticalScrollBar::PaintComposite(
GetBitmap(eArea, rpEndBitmaps)); GetBitmap(eArea, rpEndBitmaps));
} }
//===== PresenterHorizontalScrollBar ============================================
PresenterHorizontalScrollBar::PresenterHorizontalScrollBar (
const Reference<XComponentContext>& rxComponentContext,
const Reference<awt::XWindow>& rxParentWindow,
const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager,
const ::boost::function<void(double)>& rThumbMotionListener)
: PresenterScrollBar(rxComponentContext, rxParentWindow, rpPaintManager, rThumbMotionListener),
mnScrollBarHeight(0)
{
}
PresenterHorizontalScrollBar::~PresenterHorizontalScrollBar (void)
{
}
double PresenterHorizontalScrollBar::GetDragDistance (const sal_Int32 nX, const sal_Int32 nY) const
{
(void)nY;
const double nDistance (nX - maDragAnchor.X);
if (nDistance == 0)
return 0;
else
{
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
const double nBarHeight (aWindowBox.Height);
const double nPagerWidth (aWindowBox.Width - 2*nBarHeight);
const double nDragDistance (mnTotalSize / nPagerWidth * nDistance);
if (nDragDistance + mnThumbPosition < 0)
return -mnThumbPosition;
else if (mnThumbPosition + nDragDistance > mnTotalSize-mnThumbSize)
return mnTotalSize-mnThumbSize-mnThumbPosition;
else
return nDragDistance;
}
}
void PresenterHorizontalScrollBar::UpdateDragAnchor (const double nDragDistance)
{
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
const double nBarHeight (aWindowBox.Height);
const double nPagerWidth (aWindowBox.Width - 2*nBarHeight);
maDragAnchor.X += nDragDistance * nPagerWidth / mnTotalSize;
}
sal_Int32 PresenterHorizontalScrollBar::GetSize (void) const
{
return mnScrollBarHeight;
}
geometry::RealPoint2D PresenterHorizontalScrollBar::GetPoint (
const double nMajor, const double nMinor) const
{
return geometry::RealPoint2D(nMajor, nMinor);
}
double PresenterHorizontalScrollBar::GetMajor (const double nX, const double nY) const
{
(void)nY;
return nX;
}
double PresenterHorizontalScrollBar::GetMinor (const double nX, const double nY) const
{
(void)nX;
return nY;
}
void PresenterHorizontalScrollBar::UpdateBorders (void)
{
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
double nRight = aWindowBox.Width;
const double nGap (2);
if (mpNextButtonDescriptor.get() != NULL)
{
Reference<rendering::XBitmap> xBitmap (mpNextButtonDescriptor->GetNormalBitmap());
if (xBitmap.is())
{
geometry::IntegerSize2D aSize (xBitmap->getSize());
maBox[NextButton] = geometry::RealRectangle2D(
nRight - aSize.Width,0, nRight, aWindowBox.Height);
nRight -= aSize.Width + nGap;
}
}
if (mpPrevButtonDescriptor.get() != NULL)
{
Reference<rendering::XBitmap> xBitmap (mpPrevButtonDescriptor->GetNormalBitmap());
if (xBitmap.is())
{
geometry::IntegerSize2D aSize (xBitmap->getSize());
maBox[PrevButton] = geometry::RealRectangle2D(
nRight - aSize.Width,0, nRight, aWindowBox.Height);
nRight -= aSize.Width + nGap;
}
}
const double nPagerWidth (nRight);
maBox[Pager] = geometry::RealRectangle2D(
0,0, nRight, aWindowBox.Height);
if (mnTotalSize == 0)
{
maBox[Thumb] = maBox[Pager];
// Set up the enabled/disabled states.
maEnabledState[PrevButton] = false;
maEnabledState[PagerUp] = false;
maEnabledState[NextButton] = false;
maEnabledState[PagerDown] = false;
maEnabledState[Thumb] = false;
}
else
{
const double nThumbSize = ::std::min(mnThumbSize,mnTotalSize);
const double nThumbPosition = ::std::min(::std::max(0.0,mnThumbPosition), mnTotalSize - nThumbSize);
maBox[Thumb] = geometry::RealRectangle2D(
(nThumbPosition) / mnTotalSize * nPagerWidth, 0,
(nThumbPosition+nThumbSize) / mnTotalSize * nPagerWidth, aWindowBox.Height);
// Set up the enabled/disabled states.
maEnabledState[PrevButton] = nThumbPosition>0;
maEnabledState[PagerUp] = nThumbPosition>0;
maEnabledState[NextButton] = nThumbPosition+nThumbSize < mnTotalSize;
maEnabledState[PagerDown] = nThumbPosition+nThumbSize < mnTotalSize;
maEnabledState[Thumb] = nThumbSize < mnTotalSize;
}
maBox[PagerUp] = geometry::RealRectangle2D(
maBox[Pager].X1, maBox[Pager].Y1, maBox[Thumb].X1-1, maBox[Pager].Y2);
maBox[PagerDown] = geometry::RealRectangle2D(
maBox[Thumb].X2+1, maBox[Pager].Y1, maBox[Pager].X2, maBox[Pager].Y2);
maBox[Total] = PresenterGeometryHelper::Union(
PresenterGeometryHelper::Union(maBox[PrevButton], maBox[NextButton]),
maBox[Pager]);
}
void PresenterHorizontalScrollBar::UpdateBitmaps (void)
{
if (mpBitmaps.get() != NULL)
{
mpPrevButtonDescriptor = mpBitmaps->GetBitmap(A2S("Left"));
mpNextButtonDescriptor = mpBitmaps->GetBitmap(A2S("Right"));
mpPagerStartDescriptor = mpBitmaps->GetBitmap(A2S("PagerLeft"));
mpPagerCenterDescriptor = mpBitmaps->GetBitmap(A2S("PagerHorizontal"));
mpPagerEndDescriptor = mpBitmaps->GetBitmap(A2S("PagerRight"));
mpThumbStartDescriptor = mpBitmaps->GetBitmap(A2S("ThumbLeft"));
mpThumbCenterDescriptor = mpBitmaps->GetBitmap(A2S("ThumbHorizontal"));
mpThumbEndDescriptor = mpBitmaps->GetBitmap(A2S("ThumbRight"));
mnScrollBarHeight = 0;
UpdateWidthOrHeight(mnScrollBarHeight, mpPrevButtonDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpNextButtonDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpPagerStartDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpPagerCenterDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpPagerEndDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpThumbStartDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpThumbCenterDescriptor);
UpdateWidthOrHeight(mnScrollBarHeight, mpThumbEndDescriptor);
if (mnScrollBarHeight == 0)
mnScrollBarHeight = 20;
}
}
void PresenterHorizontalScrollBar::PaintComposite(
const css::awt::Rectangle& rUpdateBox,
const Area eArea,
const SharedBitmapDescriptor& rpStartBitmaps,
const SharedBitmapDescriptor& rpCenterBitmaps,
const SharedBitmapDescriptor& rpEndBitmaps)
{
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
geometry::RealRectangle2D aBox (GetRectangle(eArea));
aBox.X1 += aWindowBox.X;
aBox.Y1 += aWindowBox.Y;
aBox.X2 += aWindowBox.X;
aBox.Y2 += aWindowBox.Y;
PresenterUIPainter::PaintHorizontalBitmapComposite(
mxCanvas,
rUpdateBox,
PresenterGeometryHelper::ConvertRectangle(aBox),
GetBitmap(eArea, rpStartBitmaps),
GetBitmap(eArea, rpCenterBitmaps),
GetBitmap(eArea, rpEndBitmaps));
}
//===== PresenterScrollBar::MousePressRepeater ================================ //===== PresenterScrollBar::MousePressRepeater ================================
PresenterScrollBar::MousePressRepeater::MousePressRepeater ( PresenterScrollBar::MousePressRepeater::MousePressRepeater (
......
...@@ -285,38 +285,6 @@ private: ...@@ -285,38 +285,6 @@ private:
sal_Int32 mnScrollBarWidth; sal_Int32 mnScrollBarWidth;
}; };
/** A horizontal scroll bar.
*/
class PresenterHorizontalScrollBar : public PresenterScrollBar
{
public:
PresenterHorizontalScrollBar (
const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager,
const ::boost::function<void(double)>& rThumbMotionListener);
virtual ~PresenterHorizontalScrollBar (void);
virtual sal_Int32 GetSize (void) const;
protected:
virtual double GetDragDistance (const sal_Int32 nX, const sal_Int32 nY) const;
virtual void UpdateDragAnchor (const double nDragDistance);
virtual css::geometry::RealPoint2D GetPoint (const double nMajor, const double nMinor) const;
virtual double GetMinor (const double nX, const double nY) const;
virtual double GetMajor (const double nX, const double nY) const;
virtual void UpdateBorders (void);
virtual void UpdateBitmaps (void);
virtual void PaintComposite(
const css::awt::Rectangle& rRepaintBox,
const Area eArea,
const SharedBitmapDescriptor& rpStartBitmaps,
const SharedBitmapDescriptor& rpCenterBitmaps,
const SharedBitmapDescriptor& rpEndBitmaps);
private:
sal_Int32 mnScrollBarHeight;
};
} } // end of namespace ::sdext::presenter } } // end of namespace ::sdext::presenter
#endif #endif
......
...@@ -176,7 +176,6 @@ private: ...@@ -176,7 +176,6 @@ private:
bool mbIsLayoutPending; bool mbIsLayoutPending;
class Layout; class Layout;
::boost::shared_ptr<Layout> mpLayout; ::boost::shared_ptr<Layout> mpLayout;
::rtl::Reference<PresenterScrollBar> mpHorizontalScrollBar;
::rtl::Reference<PresenterScrollBar> mpVerticalScrollBar; ::rtl::Reference<PresenterScrollBar> mpVerticalScrollBar;
::rtl::Reference<PresenterButton> mpCloseButton; ::rtl::Reference<PresenterButton> mpCloseButton;
class MouseOverManager; class MouseOverManager;
......
...@@ -957,7 +957,6 @@ sdext::presenter::PresenterAnimation::PresenterAnimation(unsigned long, unsigned ...@@ -957,7 +957,6 @@ sdext::presenter::PresenterAnimation::PresenterAnimation(unsigned long, unsigned
sdext::presenter::PresenterAnimator::AddAnimation(boost::shared_ptr<sdext::presenter::PresenterAnimation> const&) sdext::presenter::PresenterAnimator::AddAnimation(boost::shared_ptr<sdext::presenter::PresenterAnimation> const&)
sdext::presenter::PresenterController::GetAnimator() const sdext::presenter::PresenterController::GetAnimator() const
sdext::presenter::PresenterGeometryHelper::Union(com::sun::star::awt::Rectangle const&, com::sun::star::awt::Rectangle const&) sdext::presenter::PresenterGeometryHelper::Union(com::sun::star::awt::Rectangle const&, com::sun::star::awt::Rectangle const&)
sdext::presenter::PresenterHorizontalScrollBar::PresenterHorizontalScrollBar(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, boost::shared_ptr<sdext::presenter::PresenterPaintManager> const&, boost::function<void (double)> const&)
sdext::presenter::PresenterSprite::GetLocation() const sdext::presenter::PresenterSprite::GetLocation() const
sdext::presenter::PresenterSprite::GetSize() const sdext::presenter::PresenterSprite::GetSize() const
sdext::presenter::PresenterSprite::SetAlpha(double) sdext::presenter::PresenterSprite::SetAlpha(double)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment