combobox.cxx (ad3a95a3) | combobox.cxx (a68b38df) |
---|---|
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 --- 201 unchanged lines hidden (view full) --- 210 pLBParent = mpFloatWin; 211 mpImplLB = new ImplListBox( pLBParent, nListStyle|WB_SIMPLEMODE ); 212 mpImplLB->SetPosPixel( Point() ); 213 mpImplLB->SetSelectHdl( LINK( this, ComboBox, ImplSelectHdl ) ); 214 mpImplLB->SetCancelHdl( LINK( this, ComboBox, ImplCancelHdl ) ); 215 mpImplLB->SetDoubleClickHdl( LINK( this, ComboBox, ImplDoubleClickHdl ) ); 216 mpImplLB->SetUserDrawHdl( LINK( this, ComboBox, ImplUserDrawHdl ) ); 217 mpImplLB->SetSelectionChangedHdl( LINK( this, ComboBox, ImplSelectionChangedHdl ) ); | 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 --- 201 unchanged lines hidden (view full) --- 210 pLBParent = mpFloatWin; 211 mpImplLB = new ImplListBox( pLBParent, nListStyle|WB_SIMPLEMODE ); 212 mpImplLB->SetPosPixel( Point() ); 213 mpImplLB->SetSelectHdl( LINK( this, ComboBox, ImplSelectHdl ) ); 214 mpImplLB->SetCancelHdl( LINK( this, ComboBox, ImplCancelHdl ) ); 215 mpImplLB->SetDoubleClickHdl( LINK( this, ComboBox, ImplDoubleClickHdl ) ); 216 mpImplLB->SetUserDrawHdl( LINK( this, ComboBox, ImplUserDrawHdl ) ); 217 mpImplLB->SetSelectionChangedHdl( LINK( this, ComboBox, ImplSelectionChangedHdl ) ); |
218//IAccessibility2 Implementation 2009----- 219 mpImplLB->SetListItemSelectHdl( LINK( this, ComboBox, ImplListItemSelectHdl ) ); 220//-----IAccessibility2 Implementation 2009 | |
221 mpImplLB->Show(); 222 223 if ( mpFloatWin ) 224 mpFloatWin->SetImplListBox( mpImplLB ); 225 else 226 mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True ); 227 228 ImplCalcEditHeight(); --- 42 unchanged lines hidden (view full) --- 271} 272 273// ----------------------------------------------------------------------- 274 275sal_Bool ComboBox::IsAutocompleteEnabled() const 276{ 277 return mpSubEdit->GetAutocompleteHdl().IsSet(); 278} | 218 mpImplLB->Show(); 219 220 if ( mpFloatWin ) 221 mpFloatWin->SetImplListBox( mpImplLB ); 222 else 223 mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True ); 224 225 ImplCalcEditHeight(); --- 42 unchanged lines hidden (view full) --- 268} 269 270// ----------------------------------------------------------------------- 271 272sal_Bool ComboBox::IsAutocompleteEnabled() const 273{ 274 return mpSubEdit->GetAutocompleteHdl().IsSet(); 275} |
279//IAccessibility2 Implementation 2009----- 280void ComboBox::SetMpSubEditAccessibleName(String &aName) 281{ 282 if(mpSubEdit!=NULL) 283 mpSubEdit->SetAccessibleName(aName); 284} 285//-----IAccessibility2 Implementation 2009 | 276 |
286// ----------------------------------------------------------------------- 287 288IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG ) 289{ 290 ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); 291 mpSubEdit->GrabFocus(); 292 if ( !mpImplLB->GetEntryList()->GetMRUCount() ) 293 ImplUpdateFloatSelection(); --- 178 unchanged lines hidden (view full) --- 472 mbSyntheticModify = sal_True; 473 Modify(); 474 mbSyntheticModify = sal_False; 475 Select(); 476 } 477 478 return 0; 479} | 277// ----------------------------------------------------------------------- 278 279IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG ) 280{ 281 ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN ); 282 mpSubEdit->GrabFocus(); 283 if ( !mpImplLB->GetEntryList()->GetMRUCount() ) 284 ImplUpdateFloatSelection(); --- 178 unchanged lines hidden (view full) --- 463 mbSyntheticModify = sal_True; 464 Modify(); 465 mbSyntheticModify = sal_False; 466 Select(); 467 } 468 469 return 0; 470} |
480//IAccessibility2 Implementation 2009----- 481IMPL_LINK( ComboBox, ImplListItemSelectHdl, void*, EMPTYARG ) 482{ 483 ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT ); 484 return 1; 485} 486//-----IAccessibility2 Implementation 2009 | 471 |
487// ----------------------------------------------------------------------- 488 489IMPL_LINK( ComboBox, ImplCancelHdl, void*, EMPTYARG ) 490{ 491 if( IsInDropDown() ) 492 mpFloatWin->EndPopupMode(); 493 494 return 1; --- 61 unchanged lines hidden (view full) --- 556// ----------------------------------------------------------------------- 557 558void ComboBox::EnableAutoSize( sal_Bool bAuto ) 559{ 560 mbDDAutoSize = bAuto; 561 if ( mpFloatWin ) 562 { 563 if ( bAuto && !mpFloatWin->GetDropDownLineCount() ) | 472// ----------------------------------------------------------------------- 473 474IMPL_LINK( ComboBox, ImplCancelHdl, void*, EMPTYARG ) 475{ 476 if( IsInDropDown() ) 477 mpFloatWin->EndPopupMode(); 478 479 return 1; --- 61 unchanged lines hidden (view full) --- 541// ----------------------------------------------------------------------- 542 543void ComboBox::EnableAutoSize( sal_Bool bAuto ) 544{ 545 mbDDAutoSize = bAuto; 546 if ( mpFloatWin ) 547 { 548 if ( bAuto && !mpFloatWin->GetDropDownLineCount() ) |
564 mpFloatWin->SetDropDownLineCount( 5 ); | 549 { 550 // Adapt to GetListBoxMaximumLineCount here; was on fixed number of five before 551 AdaptDropDownLineCountToMaximum(); 552 } |
565 else if ( !bAuto ) | 553 else if ( !bAuto ) |
554 { |
|
566 mpFloatWin->SetDropDownLineCount( 0 ); | 555 mpFloatWin->SetDropDownLineCount( 0 ); |
556 } |
|
567 } 568} 569 570// ----------------------------------------------------------------------- 571 572void ComboBox::EnableDDAutoWidth( sal_Bool b ) 573{ 574 if ( mpFloatWin ) --- 13 unchanged lines hidden (view full) --- 588void ComboBox::SetDropDownLineCount( sal_uInt16 nLines ) 589{ 590 if ( mpFloatWin ) 591 mpFloatWin->SetDropDownLineCount( nLines ); 592} 593 594// ----------------------------------------------------------------------- 595 | 557 } 558} 559 560// ----------------------------------------------------------------------- 561 562void ComboBox::EnableDDAutoWidth( sal_Bool b ) 563{ 564 if ( mpFloatWin ) --- 13 unchanged lines hidden (view full) --- 578void ComboBox::SetDropDownLineCount( sal_uInt16 nLines ) 579{ 580 if ( mpFloatWin ) 581 mpFloatWin->SetDropDownLineCount( nLines ); 582} 583 584// ----------------------------------------------------------------------- 585 |
586void ComboBox::AdaptDropDownLineCountToMaximum() 587{ 588 // adapt to maximum allowed number 589 SetDropDownLineCount(std::min(GetEntryCount(), GetSettings().GetStyleSettings().GetListBoxMaximumLineCount())); 590} 591 592// ----------------------------------------------------------------------- 593 |
|
596sal_uInt16 ComboBox::GetDropDownLineCount() const 597{ 598 sal_uInt16 nLines = 0; 599 if ( mpFloatWin ) 600 nLines = mpFloatWin->GetDropDownLineCount(); 601 return nLines; 602} 603 --- 813 unchanged lines hidden (view full) --- 1417 1418// ----------------------------------------------------------------------- 1419 1420sal_uInt16 ComboBox::GetMaxMRUCount() const 1421{ 1422 return mpImplLB->GetMaxMRUCount(); 1423} 1424 | 594sal_uInt16 ComboBox::GetDropDownLineCount() const 595{ 596 sal_uInt16 nLines = 0; 597 if ( mpFloatWin ) 598 nLines = mpFloatWin->GetDropDownLineCount(); 599 return nLines; 600} 601 --- 813 unchanged lines hidden (view full) --- 1415 1416// ----------------------------------------------------------------------- 1417 1418sal_uInt16 ComboBox::GetMaxMRUCount() const 1419{ 1420 return mpImplLB->GetMaxMRUCount(); 1421} 1422 |
1425//IAccessibility2 Implementation 2009----- 1426sal_uInt16 ComboBox::GetMRUCount() const 1427{ 1428 return mpImplLB->GetEntryList()->GetMRUCount(); 1429} 1430//-----IAccessibility2 Implementation 2009 | |
1431// ----------------------------------------------------------------------- 1432 1433sal_uInt16 ComboBox::GetDisplayLineCount() const 1434{ 1435 return mpImplLB->GetDisplayLineCount(); 1436} 1437 1438// ----------------------------------------------------------------------- --- 168 unchanged lines hidden --- | 1423// ----------------------------------------------------------------------- 1424 1425sal_uInt16 ComboBox::GetDisplayLineCount() const 1426{ 1427 return mpImplLB->GetDisplayLineCount(); 1428} 1429 1430// ----------------------------------------------------------------------- --- 168 unchanged lines hidden --- |