summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-14 13:36:10 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-09-14 22:07:14 +0200
commitd6a83d3f91336e23b51bfc3b3d58da799760829f (patch)
tree4873e64f7b8f44eb8c4c47138a9c186cc8dc6284 /vcl
parent96369e97a014a279db61b8e37bc54270f7beaccb (diff)
convert UserDrawHdl to boost signals2
Note that ImplListBox::userDrawSignal is connected to ImplListBoxWindow::userDrawSignal to forward the signal, just like the Link was previously forwarded. Change-Id: Ic8fc6f51e309bc34fb4e39c13745302649991d0a
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/ilstbox.hxx15
-rw-r--r--vcl/source/control/combobox.cxx5
-rw-r--r--vcl/source/control/ilstbox.cxx6
-rw-r--r--vcl/source/control/lstbox.cxx7
4 files changed, 14 insertions, 19 deletions
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index c8a49a4fa56e..2b049357ab7c 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -233,7 +233,6 @@ private:
Link maSelectHdl;
Link maCancelHdl;
Link maDoubleClickHdl;
- Link maUserDrawHdl;
Link maMRUChangedHdl;
Link maFocusHdl;
Link maListItemSelectHdl;
@@ -342,13 +341,13 @@ public:
const Link& GetCancelHdl() const { return maCancelHdl; }
void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
- void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
- const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
void SetFocusHdl( const Link& rLink ) { maFocusHdl = rLink ; }
const Link& GetFocusHdl() const { return maFocusHdl; }
+ boost::signals2::signal< void ( UserDrawEvent* ) > userDrawSignal;
+
void SetListItemSelectHdl( const Link& rLink ) { maListItemSelectHdl = rLink ; }
const Link& GetListItemSelectHdl() const { return maListItemSelectHdl; }
bool IsSelectionChanged() const { return mbSelectionChanged; }
@@ -478,8 +477,8 @@ public:
const Link& GetCancelHdl() const { return maLBWindow.GetCancelHdl(); }
void SetDoubleClickHdl( const Link& rLink ) { maLBWindow.SetDoubleClickHdl( rLink ); }
const Link& GetDoubleClickHdl() const { return maLBWindow.GetDoubleClickHdl(); }
- void SetUserDrawHdl( const Link& rLink ) { maLBWindow.SetUserDrawHdl( rLink ); }
- const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); }
+
+ boost::signals2::signal< void ( UserDrawEvent* ) > userDrawSignal;
void SetFocusHdl( const Link& rLink ) { maLBWindow.SetFocusHdl( rLink ); }
const Link& GetFocusHdl() const { return maLBWindow.GetFocusHdl(); }
@@ -555,8 +554,6 @@ private:
Rectangle maFocusRect;
Size maUserItemSize;
- Link maUserDrawHdl;
-
/// bitfield
bool mbUserDrawEnabled : 1;
bool mbInUserDraw : 1;
@@ -589,9 +586,7 @@ public:
virtual void MBDown();
boost::signals2::signal< void ( ImplWin* ) > buttonDownSignal;
-
- void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
- const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
+ boost::signals2::signal< void ( UserDrawEvent* ) > userDrawSignal;
void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
const Size& GetUserItemSize() const { return maUserItemSize; }
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 0ac87c7f203b..700fe04f5569 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -180,7 +180,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectHdl( LINK( this, ComboBox, ImplSelectHdl ) );
mpImplLB->SetCancelHdl( LINK( this, ComboBox, ImplCancelHdl ) );
mpImplLB->SetDoubleClickHdl( LINK( this, ComboBox, ImplDoubleClickHdl ) );
- mpImplLB->SetUserDrawHdl( LINK( this, ComboBox, ImplUserDrawHdl ) );
+ mpImplLB->userDrawSignal.connect( boost::bind( &ComboBox::ImplUserDrawHandler, this, _1 ) );
mpImplLB->SetSelectionChangedHdl( LINK( this, ComboBox, ImplSelectionChangedHdl ) );
mpImplLB->SetListItemSelectHdl( LINK( this, ComboBox, ImplListItemSelectHdl ) );
mpImplLB->Show();
@@ -1221,10 +1221,9 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, s
}
-IMPL_LINK( ComboBox, ImplUserDrawHdl, UserDrawEvent*, pEvent )
+void::ComboBox::ImplUserDrawHandler( UserDrawEvent* pEvent )
{
UserDraw( *pEvent );
- return 1;
}
void ComboBox::UserDraw( const UserDrawEvent& )
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index bbc1f2ad5e53..75c7d2cbe16e 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1739,7 +1739,7 @@ void ImplListBoxWindow::ImplPaint( sal_Int32 nPos, bool bErase, bool bLayout )
nCurr = sal::static_int_cast<sal_Int32>( nCurr - GetEntryList()->GetMRUCount());
UserDrawEvent aUDEvt( this, aRect, nPos, nCurr );
- maUserDrawHdl.Call( &aUDEvt );
+ userDrawSignal( &aUDEvt );
mbInUserDraw = false;
}
else
@@ -2132,6 +2132,8 @@ ImplListBox::ImplListBox( Window* pParent, WinBits nWinStyle ) :
Control( pParent, nWinStyle ),
maLBWindow( this, nWinStyle&(~WB_BORDER) )
{
+ maLBWindow.userDrawSignal.connect( userDrawSignal );
+
// for native widget rendering we must be able to detect this window type
SetType( WINDOW_LISTBOXWINDOW );
@@ -2737,7 +2739,7 @@ void ImplWin::ImplDraw( bool bLayout )
{
mbInUserDraw = true;
UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 );
- maUserDrawHdl.Call( &aUDEvt );
+ userDrawSignal( &aUDEvt );
mbInUserDraw = false;
}
else
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index ef18971d37fa..02a54ba59ced 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -137,7 +137,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplWin = new ImplWin( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER );
mpImplWin->buttonDownSignal.connect( boost::bind( &ListBox::ImplClickButtonHandler, this, _1 ));
- mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
+ mpImplWin->userDrawSignal.connect( boost::bind( &ListBox::ImplUserDrawHandler, this, _1 ) );
mpImplWin->Show();
mpImplWin->GetDropTarget()->addDropTargetListener(xDrop);
mpImplWin->SetEdgeBlending(GetEdgeBlending());
@@ -157,7 +157,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetScrollHdl( LINK( this, ListBox, ImplScrollHdl ) );
mpImplLB->SetCancelHdl( LINK( this, ListBox, ImplCancelHdl ) );
mpImplLB->SetDoubleClickHdl( LINK( this, ListBox, ImplDoubleClickHdl ) );
- mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
+ mpImplLB->userDrawSignal.connect( boost::bind( &ListBox::ImplUserDrawHandler, this, _1 ) );
mpImplLB->SetFocusHdl( LINK( this, ListBox, ImplFocusHdl ) );
mpImplLB->SetListItemSelectHdl( LINK( this, ListBox, ImplListItemSelectHdl ) );
mpImplLB->SetPosPixel( Point() );
@@ -1360,10 +1360,9 @@ void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
}
}
-IMPL_LINK( ListBox, ImplUserDrawHdl, UserDrawEvent*, pEvent )
+void ListBox::ImplUserDrawHandler( UserDrawEvent* pEvent )
{
UserDraw( *pEvent );
- return 1;
}
void ListBox::UserDraw( const UserDrawEvent& )