lstbox.cxx (9f62ea84) lstbox.cxx (ad3a95a3)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 156 unchanged lines hidden (view full) ---

165 if ( mpFloatWin )
166 pLBParent = mpFloatWin;
167 mpImplLB = new ImplListBox( pLBParent, nStyle&(~WB_BORDER) );
168 mpImplLB->SetSelectHdl( LINK( this, ListBox, ImplSelectHdl ) );
169 mpImplLB->SetScrollHdl( LINK( this, ListBox, ImplScrollHdl ) );
170 mpImplLB->SetCancelHdl( LINK( this, ListBox, ImplCancelHdl ) );
171 mpImplLB->SetDoubleClickHdl( LINK( this, ListBox, ImplDoubleClickHdl ) );
172 mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 156 unchanged lines hidden (view full) ---

165 if ( mpFloatWin )
166 pLBParent = mpFloatWin;
167 mpImplLB = new ImplListBox( pLBParent, nStyle&(~WB_BORDER) );
168 mpImplLB->SetSelectHdl( LINK( this, ListBox, ImplSelectHdl ) );
169 mpImplLB->SetScrollHdl( LINK( this, ListBox, ImplScrollHdl ) );
170 mpImplLB->SetCancelHdl( LINK( this, ListBox, ImplCancelHdl ) );
171 mpImplLB->SetDoubleClickHdl( LINK( this, ListBox, ImplDoubleClickHdl ) );
172 mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
173//IAccessibility2 Implementation 2009-----
174 mpImplLB->SetFocusHdl( LINK( this, ListBox, ImplFocusHdl ) );
175 mpImplLB->SetListItemSelectHdl( LINK( this, ListBox, ImplListItemSelectHdl ) );
176//-----IAccessibility2 Implementation 2009
173 mpImplLB->SetPosPixel( Point() );
174 mpImplLB->Show();
175
176 mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
177 mpImplLB->SetDropTraget(xDrop);
178
179 if ( mpFloatWin )
180 {

--- 62 unchanged lines hidden (view full) ---

243 mpImplWin->Invalidate();
244 }
245
246 if ( ( !IsTravelSelect() || mpImplLB->IsSelectionChanged() ) || ( bPopup && !IsMultiSelectionEnabled() ) )
247 Select();
248
249 return 1;
250}
177 mpImplLB->SetPosPixel( Point() );
178 mpImplLB->Show();
179
180 mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
181 mpImplLB->SetDropTraget(xDrop);
182
183 if ( mpFloatWin )
184 {

--- 62 unchanged lines hidden (view full) ---

247 mpImplWin->Invalidate();
248 }
249
250 if ( ( !IsTravelSelect() || mpImplLB->IsSelectionChanged() ) || ( bPopup && !IsMultiSelectionEnabled() ) )
251 Select();
252
253 return 1;
254}
255//IAccessibility2 Implementation 2009-----
256IMPL_LINK( ListBox, ImplFocusHdl, void *, nPos )
257{
258 ImplCallEventListeners( VCLEVENT_LISTBOX_FOCUS , nPos);
259 return 1;
260}
261IMPL_LINK( ListBox, ImplListItemSelectHdl, void*, EMPTYARG )
262{
263 ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT );
264 return 1;
265}
266//-----IAccessibility2 Implementation 2009
251
252// -----------------------------------------------------------------------
253
254IMPL_LINK( ListBox, ImplScrollHdl, void*, EMPTYARG )
255{
256 ImplCallEventListeners( VCLEVENT_LISTBOX_SCROLLED );
257 return 1;
258}

--- 782 unchanged lines hidden (view full) ---

1041 if( IsDropDownBox() )
1042 {
1043 mpImplWin->SetItemPos( LISTBOX_ENTRY_NOTFOUND );
1044 mpImplWin->SetString( ImplGetSVEmptyStr() );
1045 Image aImage;
1046 mpImplWin->SetImage( aImage );
1047 mpImplWin->Invalidate();
1048 }
267
268// -----------------------------------------------------------------------
269
270IMPL_LINK( ListBox, ImplScrollHdl, void*, EMPTYARG )
271{
272 ImplCallEventListeners( VCLEVENT_LISTBOX_SCROLLED );
273 return 1;
274}

--- 782 unchanged lines hidden (view full) ---

1057 if( IsDropDownBox() )
1058 {
1059 mpImplWin->SetItemPos( LISTBOX_ENTRY_NOTFOUND );
1060 mpImplWin->SetString( ImplGetSVEmptyStr() );
1061 Image aImage;
1062 mpImplWin->SetImage( aImage );
1063 mpImplWin->Invalidate();
1064 }
1065 // IAccessible2 implementation 2009
1066 NotifyVCLEvent( VCLEVENT_LISTBOX_STATEUPDATE);
1049}
1050
1051// -----------------------------------------------------------------------
1052
1053sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
1054{
1055 sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
1056 nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());

--- 128 unchanged lines hidden (view full) ---

1185 SelectEntryPos( GetEntryPos( rStr ), bSelect );
1186}
1187
1188// -----------------------------------------------------------------------
1189
1190void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
1191{
1192 if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
1067}
1068
1069// -----------------------------------------------------------------------
1070
1071sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
1072{
1073 sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
1074 nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());

--- 128 unchanged lines hidden (view full) ---

1203 SelectEntryPos( GetEntryPos( rStr ), bSelect );
1204}
1205
1206// -----------------------------------------------------------------------
1207
1208void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
1209{
1210 if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
1211 {
1212 // IAccessible2 implementation 2009
1213 sal_uInt16 oldSelectCount = GetSelectEntryCount(), newSelectCount = 0, nCurrentPos = mpImplLB->GetCurrentPos();
1193 mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
1214 mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
1215 newSelectCount = GetSelectEntryCount();
1216 if (oldSelectCount == 0 && newSelectCount > 0)
1217 NotifyVCLEvent( VCLEVENT_LISTBOX_STATEUPDATE);
1218 //Only when bSelect == true, send both Selection & Focus events
1219 if (nCurrentPos != nPos && bSelect)
1220 {
1221 ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT, reinterpret_cast<void*>(nPos));
1222 if (HasFocus())
1223 ImplCallEventListeners( VCLEVENT_LISTBOX_FOCUS, reinterpret_cast<void*>(nPos));
1224 }
1225 }
1194}
1195
1196// -----------------------------------------------------------------------
1197
1198void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
1199{
1200 mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
1201}

--- 384 unchanged lines hidden (view full) ---

1586}
1587
1588// -----------------------------------------------------------------------
1589
1590sal_uInt16 ListBox::GetMaxMRUCount() const
1591{
1592 return mpImplLB->GetMaxMRUCount();
1593}
1226}
1227
1228// -----------------------------------------------------------------------
1229
1230void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
1231{
1232 mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
1233}

--- 384 unchanged lines hidden (view full) ---

1618}
1619
1620// -----------------------------------------------------------------------
1621
1622sal_uInt16 ListBox::GetMaxMRUCount() const
1623{
1624 return mpImplLB->GetMaxMRUCount();
1625}
1626//IAccessibility2 Implementation 2009-----
1627sal_uInt16 ListBox::GetMRUCount() const
1628{
1629 return mpImplLB->GetEntryList()->GetMRUCount();
1630}
1631//-----IAccessibility2 Implementation 2009
1594
1595// -----------------------------------------------------------------------
1596
1597sal_uInt16 ListBox::GetDisplayLineCount() const
1598{
1599 return mpImplLB->GetDisplayLineCount();
1600}
1601

--- 47 unchanged lines hidden ---
1632
1633// -----------------------------------------------------------------------
1634
1635sal_uInt16 ListBox::GetDisplayLineCount() const
1636{
1637 return mpImplLB->GetDisplayLineCount();
1638}
1639

--- 47 unchanged lines hidden ---