summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/charmapacc.cxx4
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx4
-rw-r--r--svx/source/dialog/charmap.cxx90
-rw-r--r--svx/source/dialog/dlgctrl.cxx100
-rw-r--r--svx/source/dialog/graphctl.cxx18
-rw-r--r--svx/source/dialog/searchcharmap.cxx29
6 files changed, 111 insertions, 134 deletions
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index bb560b9e820d..568e5a1dfe43 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -121,7 +121,7 @@ css::awt::Rectangle SvxShowCharSetAcc::implGetBounds()
if (m_pParent)
{
const Point aOutPos;//( m_pParent->GetPosPixel() );
- Size aOutSize( m_pParent->GetSize());
+ Size aOutSize( m_pParent->GetOutputSizePixel());
aRet.X = aOutPos.X();
aRet.Y = aOutPos.Y();
@@ -549,7 +549,7 @@ awt::Rectangle SvxShowCharSetItemAcc::implGetBounds( )
if( mpParent )
{
tools::Rectangle aRect( mpParent->maRect );
- tools::Rectangle aParentRect(Point(), mpParent->mrParent.GetSize());
+ tools::Rectangle aParentRect(Point(), mpParent->mrParent.GetOutputSizePixel());
aRect.Intersection( aParentRect );
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index 62ae619a6c00..06cd902e7c54 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -916,8 +916,8 @@ awt::Rectangle RectCtlAccessibleContext::implGetBounds()
if (mpRepr)
{
- const Point aOutPos;//( mpRepr->GetPosPixel() );
- Size aOutSize( mpRepr->GetSize());
+ const Point aOutPos;
+ Size aOutSize(mpRepr->GetOutputSizePixel());
aRet.X = aOutPos.X();
aRet.Y = aOutPos.Y();
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 1a3521b45ffa..fa9c3cebede3 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -59,9 +59,14 @@ sal_uInt32& SvxShowCharSet::getSelectedChar()
return cSelectedChar;
}
-SvxShowCharSet::SvxShowCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
- const OString& rScrollId, const VclPtr<VirtualDevice>& rVirDev)
+FactoryFunction SvxShowCharSet::GetUITestFactory() const
+{
+ return SvxShowCharSetUIObject::create;
+}
+
+SvxShowCharSet::SvxShowCharSet(weld::ScrolledWindow* pScrolledWindow, const VclPtr<VirtualDevice>& rVirDev)
: mxVirDev(rVirDev)
+ , mxScrollArea(pScrolledWindow)
, mxContext(comphelper::getProcessComponentContext())
, maFontSize(0, 0)
, maPosition(0,0)
@@ -69,24 +74,16 @@ SvxShowCharSet::SvxShowCharSet(weld::Builder& rBuilder, const OString& rDrawingI
, mbUpdateForeground(true)
, mbUpdateBackground(true)
{
- mxDrawingArea.reset(rBuilder.weld_drawing_area(rDrawingId, CreateAccessible(), SvxShowCharSetUIObject::create, this));
- mxScrollArea.reset(rBuilder.weld_scrolled_window(rScrollId));
-
init();
mxScrollArea->set_user_managed_scrolling();
+}
- mxDrawingArea->connect_size_allocate(LINK(this, SvxShowCharSet, DoResize));
- mxDrawingArea->connect_draw(LINK(this, SvxShowCharSet, DoPaint));
- mxDrawingArea->connect_mouse_press(LINK(this, SvxShowCharSet, DoMouseButtonDown));
- mxDrawingArea->connect_mouse_move(LINK(this, SvxShowCharSet, DoMouseMove));
- mxDrawingArea->connect_mouse_release(LINK(this, SvxShowCharSet, DoMouseButtonUp));
- mxDrawingArea->connect_key_press(LINK(this, SvxShowCharSet, DoKeyDown));
- mxDrawingArea->connect_focus_in(LINK(this, SvxShowCharSet, DoGetFocus));
- mxDrawingArea->connect_focus_out(LINK(this, SvxShowCharSet, DoLoseFocus));
-
- mxScrollArea->set_size_request(COLUMN_COUNT * mxDrawingArea->get_approximate_digit_width() * 4,
- ROW_COUNT * mxDrawingArea->get_text_height() * 2);
+void SvxShowCharSet::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+ mxScrollArea->set_size_request(COLUMN_COUNT * pDrawingArea->get_approximate_digit_width() * 4,
+ ROW_COUNT * pDrawingArea->get_text_height() * 2);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void SvxShowCharSet::init()
@@ -102,32 +99,30 @@ void SvxShowCharSet::init()
bDrag = false;
}
-IMPL_LINK(SvxShowCharSet, DoResize, const Size&, rSize, void)
+void SvxShowCharSet::Resize()
{
- maSize = rSize;
mbRecalculateFont = true;
- mxDrawingArea->queue_draw();
}
-IMPL_LINK_NOARG(SvxShowCharSet, DoGetFocus, weld::Widget&, void)
+void SvxShowCharSet::GetFocus()
{
SelectIndex(nSelectedIndex, true);
}
-IMPL_LINK_NOARG(SvxShowCharSet, DoLoseFocus, weld::Widget&, void)
+void SvxShowCharSet::LoseFocus()
{
SelectIndex(nSelectedIndex);
}
-IMPL_LINK(SvxShowCharSet, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
+void SvxShowCharSet::MouseButtonDown(const MouseEvent& rMEvt)
{
if ( rMEvt.IsLeft() )
{
if ( rMEvt.GetClicks() == 1 )
{
- mxDrawingArea->grab_focus();
+ GrabFocus();
bDrag = true;
- mxDrawingArea->grab_add();
+ grab_add();
int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
// Fire the focus event
@@ -138,7 +133,7 @@ IMPL_LINK(SvxShowCharSet, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
aDoubleClkHdl.Call( this );
}
- if(rMEvt.IsRight())
+ if (rMEvt.IsRight())
{
Point aPosition (rMEvt.GetPosPixel());
maPosition = aPosition;
@@ -149,24 +144,24 @@ IMPL_LINK(SvxShowCharSet, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
}
}
-IMPL_LINK(SvxShowCharSet, DoMouseButtonUp, const MouseEvent&, rMEvt, void)
+void SvxShowCharSet::MouseButtonUp(const MouseEvent& rMEvt)
{
if ( bDrag && rMEvt.IsLeft() )
{
// released mouse over character map
- if ( tools::Rectangle(Point(), maSize).IsInside(rMEvt.GetPosPixel()))
+ if ( tools::Rectangle(Point(), GetOutputSizePixel()).IsInside(rMEvt.GetPosPixel()))
aSelectHdl.Call( this );
- mxDrawingArea->grab_remove();
+ grab_remove();
bDrag = false;
}
}
-IMPL_LINK(SvxShowCharSet, DoMouseMove, const MouseEvent&, rMEvt, void)
+void SvxShowCharSet::MouseMove(const MouseEvent& rMEvt)
{
if ( rMEvt.IsLeft() && bDrag )
{
Point aPos = rMEvt.GetPosPixel();
- Size aSize = maSize;
+ Size aSize = GetOutputSizePixel();
if ( aPos.X() < 0 )
aPos.setX( 0 );
@@ -226,7 +221,7 @@ bool SvxShowCharSet::isFavChar(const OUString& sTitle, const OUString& rFont)
void SvxShowCharSet::createContextMenu()
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(mxDrawingArea.get(), "svx/ui/charsetmenu.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/charsetmenu.ui"));
std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu("charsetmenu"));
sal_UCS4 cChar = GetSelectCharacter();
@@ -236,9 +231,9 @@ void SvxShowCharSet::createContextMenu()
else
xItemMenu->show("remove", false);
- ContextMenuSelect(xItemMenu->popup_at_rect(mxDrawingArea.get(), tools::Rectangle(maPosition, Size(1,1))));
- mxDrawingArea->grab_focus();
- mxDrawingArea->queue_draw();
+ ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(maPosition, Size(1,1))));
+ GrabFocus();
+ Invalidate();
}
void SvxShowCharSet::ContextMenuSelect(const OString& rIdent)
@@ -389,7 +384,7 @@ int SvxShowCharSet::PixelToMapIndex( const Point& point) const
return (nBase + ((point.X() - m_nXGap)/nX) + ((point.Y() - m_nYGap)/nY) * COLUMN_COUNT);
}
-IMPL_LINK(SvxShowCharSet, DoKeyDown, const KeyEvent&, rKEvt, bool)
+bool SvxShowCharSet::KeyInput(const KeyEvent& rKEvt)
{
vcl::KeyCode aCode = rKEvt.GetKeyCode();
@@ -458,9 +453,8 @@ IMPL_LINK(SvxShowCharSet, DoKeyDown, const KeyEvent&, rKEvt, bool)
return bRet;
}
-IMPL_LINK(SvxShowCharSet, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SvxShowCharSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
InitSettings(rRenderContext);
RecalculateFont(rRenderContext);
DrawChars_Impl(rRenderContext, FirstInView(), LastInView());
@@ -470,12 +464,12 @@ void SvxShowCharSet::SetFont( const vcl::Font& rFont )
{
maFont = rFont;
mbRecalculateFont = true;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
void SvxShowCharSet::DeSelect()
{
- mxDrawingArea->queue_draw();
+ Invalidate();
}
// stretch a grid rectangle if its at the edge to fill unused space
@@ -514,7 +508,7 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1,
if (n1 > LastInView() || n2 < FirstInView())
return;
- Size aOutputSize(maSize);
+ Size aOutputSize(GetOutputSizePixel());
int i;
for (i = 1; i < COLUMN_COUNT; ++i)
@@ -663,7 +657,7 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
if (nSelectedIndex >= 0)
getSelectedChar() = mxFontCharMap->GetCharFromIndex(nSelectedIndex);
- Size aSize(maSize);
+ Size aSize(GetOutputSizePixel());
vcl::Font aFont = maFont;
aFont.SetWeight(WEIGHT_LIGHT);
@@ -707,7 +701,7 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus)
int nNewPos = nMapIndex / COLUMN_COUNT;
mxScrollArea->vadjustment_set_value(nNewPos);
nSelectedIndex = bFocus ? nMapIndex+1 : -1;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if( nNewIndex < FirstInView() )
{
@@ -716,7 +710,7 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus)
int nDelta = (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT;
mxScrollArea->vadjustment_set_value(nOldPos - nDelta);
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if( nNewIndex > LastInView() )
{
@@ -727,17 +721,17 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus)
if( nNewIndex < mxFontCharMap->GetCharCount() )
{
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if (nOldPos != mxScrollArea->vadjustment_get_value())
{
- mxDrawingArea->queue_draw();
+ Invalidate();
}
}
else
{
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
if( nSelectedIndex >= 0 )
@@ -785,7 +779,7 @@ void SvxShowCharSet::SelectCharacter( sal_UCS4 cNew )
SelectIndex( nMapIndex );
// move selected item to top row if not in focus
mxScrollArea->vadjustment_set_value(nMapIndex / COLUMN_COUNT);
- mxDrawingArea->queue_draw();
+ Invalidate();
}
IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow&, void)
@@ -809,7 +803,7 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow&, void)
SelectIndex( (LastInView() - COLUMN_COUNT + 1) + (nSelectedIndex % COLUMN_COUNT) );
}
- mxDrawingArea->queue_draw();
+ Invalidate();
}
SvxShowCharSet::~SvxShowCharSet()
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index c6612b7e0b61..389e6ec06857 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -652,7 +652,7 @@ BitmapEx& RectCtl::GetRectBitmap()
return *pBitmap;
}
-RectCtl::RectCtl(weld::Builder& rBuilder, const OString& rDrawingId, SvxTabPage* pPage, RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircle)
+RectCtl::RectCtl(SvxTabPage* pPage, RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircle)
: m_pPage(pPage)
, nBorderWidth(Application::GetDefaultDevice()->LogicToPixel(Size(nBorder, 0), MapMode(MapUnit::Map100thMM)).Width())
, nRadius(Application::GetDefaultDevice()->LogicToPixel(Size(nCircle, 0), MapMode(MapUnit::Map100thMM)).Width())
@@ -661,18 +661,13 @@ RectCtl::RectCtl(weld::Builder& rBuilder, const OString& rDrawingId, SvxTabPage*
, m_nState(CTL_STATE::NONE)
, mbCompleteDisable(false)
{
- m_xControl.reset(rBuilder.weld_drawing_area(rDrawingId, CreateAccessible()));
- m_xControl->connect_style_updated(LINK(this, RectCtl, MarkToResetSettings));
- m_xControl->connect_draw(LINK(this, RectCtl, DoPaint));
- m_xControl->connect_size_allocate(LINK(this, RectCtl, DoResize));
- m_xControl->connect_mouse_press(LINK(this, RectCtl, DoMouseButtonDown));
- m_xControl->connect_key_press(LINK(this, RectCtl, DoKeyDown));
- m_xControl->connect_focus_in(LINK(this, RectCtl, DoGetFocus));
- m_xControl->connect_focus_out(LINK(this, RectCtl, DoLoseFocus));
- m_xControl->connect_focus_rect(LINK(this, RectCtl, DoFocusRect));
-
- m_xControl->set_size_request(m_xControl->get_approximate_digit_width() * 25, m_xControl->get_text_height() * 5);
- Resize_Impl();
+}
+
+void RectCtl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 25,
+ pDrawingArea->get_text_height() * 5);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void RectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircle)
@@ -690,29 +685,29 @@ RectCtl::~RectCtl()
pAccContext.clear();
}
-IMPL_LINK(RectCtl, DoResize, const Size&, rSize, void)
+void RectCtl::Resize()
{
- m_aSize = rSize;
Resize_Impl();
}
void RectCtl::Resize_Impl()
{
+ Size aSize(GetOutputSizePixel());
+
aPtLT = Point( 0 + nBorderWidth, 0 + nBorderWidth );
- aPtMT = Point( m_aSize.Width() / 2, 0 + nBorderWidth );
- aPtRT = Point( m_aSize.Width() - nBorderWidth, 0 + nBorderWidth );
+ aPtMT = Point( aSize.Width() / 2, 0 + nBorderWidth );
+ aPtRT = Point( aSize.Width() - nBorderWidth, 0 + nBorderWidth );
- aPtLM = Point( 0 + nBorderWidth, m_aSize.Height() / 2 );
- aPtMM = Point( m_aSize.Width() / 2, m_aSize.Height() / 2 );
- aPtRM = Point( m_aSize.Width() - nBorderWidth, m_aSize.Height() / 2 );
+ aPtLM = Point( 0 + nBorderWidth, aSize.Height() / 2 );
+ aPtMM = Point( aSize.Width() / 2, aSize.Height() / 2 );
+ aPtRM = Point( aSize.Width() - nBorderWidth, aSize.Height() / 2 );
- aPtLB = Point( 0 + nBorderWidth, m_aSize.Height() - nBorderWidth );
- aPtMB = Point( m_aSize.Width() / 2, m_aSize.Height() - nBorderWidth );
- aPtRB = Point( m_aSize.Width() - nBorderWidth, m_aSize.Height() - nBorderWidth );
+ aPtLB = Point( 0 + nBorderWidth, aSize.Height() - nBorderWidth );
+ aPtMB = Point( aSize.Width() / 2, aSize.Height() - nBorderWidth );
+ aPtRB = Point( aSize.Width() - nBorderWidth, aSize.Height() - nBorderWidth );
Reset();
- MarkToResetSettings(*m_xControl);
- m_xControl->queue_draw();
+ StyleUpdated();
}
void RectCtl::InitRectBitmap()
@@ -762,10 +757,11 @@ void RectCtl::InitRectBitmap()
pBitmap->Replace( aColorAry1, aColorAry2, 7 );
}
-IMPL_LINK_NOARG(RectCtl, MarkToResetSettings, weld::Widget&, void)
+void RectCtl::StyleUpdated()
{
delete pBitmap;
pBitmap = nullptr; // forces new creating of bitmap
+ CustomWidgetController::StyleUpdated();
}
void RectCtl::InitSettings(vcl::RenderContext& rRenderContext)
@@ -779,7 +775,7 @@ void RectCtl::InitSettings(vcl::RenderContext& rRenderContext)
// The clicked rectangle (3 x 3) is determined and the parent (dialog)
// is notified that the item was changed
-IMPL_LINK(RectCtl, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
+void RectCtl::MouseButtonDown(const MouseEvent& rMEvt)
{
// CompletelyDisabled() added to have a disabled state for RectCtl
if(!IsCompletelyDisabled())
@@ -789,11 +785,11 @@ IMPL_LINK(RectCtl, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
SetActualRP( eRP );
if (m_pPage)
- m_pPage->PointChanged(m_xControl.get(), eRP);
+ m_pPage->PointChanged(GetDrawingArea(), eRP);
}
}
-IMPL_LINK(RectCtl, DoKeyDown, const KeyEvent&, rKeyEvt, bool)
+bool RectCtl::KeyInput(const KeyEvent& rKeyEvt)
{
// CompletelyDisabled() added to have a disabled state for RectCtl
if (IsCompletelyDisabled())
@@ -871,16 +867,14 @@ IMPL_LINK(RectCtl, DoKeyDown, const KeyEvent&, rKeyEvt, bool)
SetActualRP( eNewRP );
if (m_pPage)
- m_pPage->PointChanged(m_xControl.get(), eRP);
+ m_pPage->PointChanged(GetDrawingArea(), eRP);
}
return true;
}
// the control (rectangle with 9 circles)
-IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void RectCtl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
-
InitSettings(rRenderContext);
Point aPtDiff(1, 1);
@@ -891,14 +885,14 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
rRenderContext.SetFillColor(rStyles.GetDialogColor());
rRenderContext.DrawRect(tools::Rectangle(Point(0,0), rRenderContext.GetOutputSize()));
- if (m_xControl->get_sensitive())
+ if (IsEnabled())
rRenderContext.SetLineColor(rStyles.GetLabelTextColor());
else
rRenderContext.SetLineColor(rStyles.GetShadowColor());
rRenderContext.SetFillColor();
- if (!m_xControl->get_sensitive())
+ if (!IsEnabled())
{
Color aOldCol = rRenderContext.GetLineColor();
rRenderContext.SetLineColor(rStyles.GetLightColor());
@@ -912,7 +906,7 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
Size aBtnSize(11, 11);
Size aDstBtnSize(aBtnSize);
Point aToCenter(aDstBtnSize.Width() >> 1, aDstBtnSize.Height() >> 1);
- Point aBtnPnt1(m_xControl->get_sensitive() ? 0 : 22, 0);
+ Point aBtnPnt1(IsEnabled() ? 0 : 22, 0);
Point aBtnPnt2(11, 0);
Point aBtnPnt3(22, 0);
@@ -954,7 +948,7 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
// CompletelyDisabled() added to have a disabled state for SvxRectCtl
if (!IsCompletelyDisabled())
{
- if (m_xControl->get_sensitive())
+ if (IsEnabled())
{
Point aCenterPt(aPtNew);
aCenterPt -= aToCenter;
@@ -964,10 +958,10 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
}
}
-IMPL_LINK(RectCtl, DoFocusRect, weld::Widget&, rControl, tools::Rectangle)
+tools::Rectangle RectCtl::GetFocusRect()
{
tools::Rectangle aRet;
- if (rControl.has_focus())
+ if (HasFocus())
aRet = CalculateFocusRectangle();
return aRet;
}
@@ -1012,9 +1006,9 @@ Point RectCtl::SetActualRPWithoutInvalidate( RectPoint eNewRP )
return aPtLast;
}
-IMPL_LINK_NOARG(RectCtl, DoGetFocus, weld::Widget&, void)
+void RectCtl::GetFocus()
{
- m_xControl->queue_draw();
+ Invalidate();
// Send accessibility event.
if (pAccContext.is())
@@ -1023,9 +1017,9 @@ IMPL_LINK_NOARG(RectCtl, DoGetFocus, weld::Widget&, void)
}
}
-IMPL_LINK_NOARG(RectCtl, DoLoseFocus, weld::Widget&, void)
+void RectCtl::LoseFocus()
{
- m_xControl->queue_draw();
+ Invalidate();
}
Point RectCtl::GetApproxLogPtFromPixPt( const Point& rPt ) const
@@ -1034,11 +1028,13 @@ Point RectCtl::GetApproxLogPtFromPixPt( const Point& rPt ) const
long x;
long y;
+ Size aSize(GetOutputSizePixel());
+
if( !( m_nState & CTL_STATE::NOHORZ ) )
{
- if( aPt.X() < m_aSize.Width() / 3 )
+ if( aPt.X() < aSize.Width() / 3 )
x = aPtLT.X();
- else if( aPt.X() < m_aSize.Width() * 2 / 3 )
+ else if( aPt.X() < aSize.Width() * 2 / 3 )
x = aPtMM.X();
else
x = aPtRB.X();
@@ -1048,9 +1044,9 @@ Point RectCtl::GetApproxLogPtFromPixPt( const Point& rPt ) const
if( !( m_nState & CTL_STATE::NOVERT ) )
{
- if( aPt.Y() < m_aSize.Height() / 3 )
+ if( aPt.Y() < aSize.Height() / 3 )
y = aPtLT.Y();
- else if( aPt.Y() < m_aSize.Height() * 2 / 3 )
+ else if( aPt.Y() < aSize.Height() * 2 / 3 )
y = aPtMM.Y();
else
y = aPtRB.Y();
@@ -1086,7 +1082,7 @@ void RectCtl::Reset()
{
aPtNew = GetPointFromRP( eDefRP );
eRP = eDefRP;
- m_xControl->queue_draw();
+ Invalidate();
}
// Returns the currently selected RectPoint
@@ -1096,7 +1092,7 @@ void RectCtl::SetActualRP( RectPoint eNewRP )
{
SetActualRPWithoutInvalidate(eNewRP);
- m_xControl->queue_draw();
+ Invalidate();
// notify accessibility object about change
if (pAccContext.is())
@@ -1117,10 +1113,10 @@ void RectCtl::SetState( CTL_STATE nState )
_aPtNew.setY( aPtMM.Y() );
eRP = GetRPFromPoint( _aPtNew );
- m_xControl->queue_draw();
+ Invalidate();
if (m_pPage)
- m_pPage->PointChanged(m_xControl.get(), eRP);
+ m_pPage->PointChanged(GetDrawingArea(), eRP);
}
tools::Rectangle RectCtl::CalculateFocusRectangle() const
@@ -1164,7 +1160,7 @@ RectPoint RectCtl::GetApproxRPFromPixPt( const css::awt::Point& r ) const
void RectCtl::DoCompletelyDisable(bool bNew)
{
mbCompleteDisable = bNew;
- m_xControl->queue_draw();
+ Invalidate();
}
// Control for editing bitmaps
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index e656d0e18673..45fd6f18d107 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -771,23 +771,13 @@ css::uno::Reference< css::accessibility::XAccessible > GraphCtrl::CreateAccessib
return mpAccContext.get();
}
-SvxGraphCtrl::SvxGraphCtrl(weld::Builder& rBuilder, const OString& rDrawingId)
+SvxGraphCtrl::SvxGraphCtrl()
: aMap100(MapUnit::Map100thMM)
- , mxDrawingArea(rBuilder.weld_drawing_area(rDrawingId))
{
- mxDrawingArea->connect_size_allocate(LINK(this, SvxGraphCtrl, DoResize));
- mxDrawingArea->connect_draw(LINK(this, SvxGraphCtrl, DoPaint));
}
-IMPL_LINK(SvxGraphCtrl, DoResize, const Size&, rSize, void)
+void SvxGraphCtrl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- maSize = rSize;
- mxDrawingArea->queue_draw();
-}
-
-IMPL_LINK(SvxGraphCtrl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
-{
- vcl::RenderContext& rRenderContext = aPayload.first;
rRenderContext.Erase();
const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
// #i73381# in non-SdrMode, paint to local directly
@@ -796,7 +786,7 @@ IMPL_LINK(SvxGraphCtrl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
MapMode aDisplayMap( aMap100 );
Point aNewPos;
Size aNewSize;
- const Size aWinSize = Application::GetDefaultDevice()->PixelToLogic( maSize, aMap100 );
+ const Size aWinSize = Application::GetDefaultDevice()->PixelToLogic(GetOutputSizePixel(), aMap100);
const long nWidth = aWinSize.Width();
const long nHeight = aWinSize.Height();
double fGrfWH = static_cast<double>(aGraphSize.Width()) / aGraphSize.Height();
@@ -841,7 +831,7 @@ void SvxGraphCtrl::SetGraphic(const Graphic& rGraphic)
else
aGraphSize = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 );
- mxDrawingArea->queue_draw();
+ Invalidate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx
index a3c887869ccb..cf9faf363673 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -46,12 +46,10 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
-SvxSearchCharSet::SvxSearchCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
- const OString& rScrollId, const VclPtr<VirtualDevice>& rVirDev)
- : SvxShowCharSet(rBuilder, rDrawingId, rScrollId, rVirDev)
+SvxSearchCharSet::SvxSearchCharSet(weld::ScrolledWindow* pScrolledWindow, const VclPtr<VirtualDevice>& rVirDev)
+ : SvxShowCharSet(pScrolledWindow, rVirDev)
, nCount(0)
{
- mxDrawingArea->connect_key_press(LINK(this, SvxSearchCharSet, DoKeyDown));
}
int SvxSearchCharSet::LastInView() const
@@ -64,7 +62,7 @@ int SvxSearchCharSet::LastInView() const
return nIndex;
}
-IMPL_LINK(SvxSearchCharSet, DoKeyDown, const KeyEvent&, rKEvt, bool)
+bool SvxSearchCharSet::KeyInput(const KeyEvent& rKEvt)
{
vcl::KeyCode aCode = rKEvt.GetKeyCode();
@@ -152,12 +150,11 @@ void SvxSearchCharSet::SelectCharacter( const Subset* sub )
aHighHdl.Call(this);
// move selected item to top row if not in focus
//TO.DO aVscrollSB->SetThumbPos( nMapIndex / COLUMN_COUNT );
- mxDrawingArea->queue_draw();
+ Invalidate();
}
-IMPL_LINK(SvxSearchCharSet, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SvxSearchCharSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
InitSettings(rRenderContext);
RecalculateFont(rRenderContext);
DrawChars_Impl(rRenderContext, FirstInView(), LastInView());
@@ -168,7 +165,7 @@ void SvxSearchCharSet::DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1
if (n1 > LastInView() || n2 < FirstInView())
return;
- Size aOutputSize(maSize);
+ Size aOutputSize(GetOutputSizePixel());
int i;
for (i = 1; i < COLUMN_COUNT; ++i)
@@ -302,7 +299,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
if (!mbRecalculateFont)
return;
- Size aSize(maSize);
+ Size aSize(GetOutputSizePixel());
vcl::Font aFont = rRenderContext.GetFont();
aFont.SetWeight(WEIGHT_LIGHT);
@@ -339,7 +336,7 @@ void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus)
{
mxScrollArea->vadjustment_set_value(0);
nSelectedIndex = bFocus ? 0 : -1;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if( nNewIndex < FirstInView() )
{
@@ -348,7 +345,7 @@ void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus)
int nDelta = (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT;
mxScrollArea->vadjustment_set_value(nOldPos - nDelta);
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if( nNewIndex > LastInView() )
{
@@ -360,17 +357,17 @@ void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus)
if( nNewIndex < nCount )
{
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
else if (nOldPos != mxScrollArea->vadjustment_get_value())
{
- mxDrawingArea->queue_draw();
+ Invalidate();
}
}
else
{
nSelectedIndex = nNewIndex;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
if( nSelectedIndex >= 0 )
@@ -434,7 +431,7 @@ void SvxSearchCharSet::ClearPreviousData()
{
m_aItemList.clear();
nCount = 0;
- mxDrawingArea->queue_draw();
+ Invalidate();
}
void SvxSearchCharSet::AppendCharToList(sal_UCS4 sChar)