Deck.cxx (52d13b84) | Deck.cxx (3fac691d) |
---|---|
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 --- 206 unchanged lines hidden (view full) --- 215{ 216 (void)rEvent; 217 RequestLayout(); 218} 219 220 221 222 | 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 --- 206 unchanged lines hidden (view full) --- 215{ 216 (void)rEvent; 217 RequestLayout(); 218} 219 220 221 222 |
223long Deck::Notify (NotifyEvent& rEvent) 224{ 225 if (rEvent.GetType() != EVENT_COMMAND) 226 return sal_False; 227 228 CommandEvent* pCommandEvent = reinterpret_cast<CommandEvent*>(rEvent.GetData()); 229 if (pCommandEvent == NULL) 230 return sal_False; 231 232 switch (pCommandEvent->GetCommand()) 233 { 234 case COMMAND_WHEEL: 235 { 236 if ( ! mpVerticalScrollBar 237 || ! mpVerticalScrollBar->IsVisible()) 238 return sal_False; 239 240 // Ignore all wheel commands from outside the vertical 241 // scroll bar. Otherwise after a scroll we might land on 242 // a spin field and subsequent wheel events would change 243 // the value of that control. 244 if (rEvent.GetWindow() != mpVerticalScrollBar.get()) 245 return sal_True; 246 247 // Get the wheel data and check that it describes a valid 248 // vertical scroll. 249 const CommandWheelData* pData = pCommandEvent->GetWheelData(); 250 if (pData==NULL 251 || pData->GetModifier() 252 || pData->GetMode() != COMMAND_WHEEL_SCROLL 253 || pData->IsHorz()) 254 return sal_False; 255 256 // Execute the actual scroll action. 257 long nDelta = pData->GetDelta(); 258 mpVerticalScrollBar->DoScroll( 259 mpVerticalScrollBar->GetThumbPos() - nDelta); 260 return sal_True; 261 } 262 263 default: 264 break; 265 } 266 267 return sal_False; 268} 269 270 271 272 |
|
223void Deck::SetPanels (const SharedPanelContainer& rPanels) 224{ 225 maPanels = rPanels; 226 227 RequestLayout(); 228} 229 230 --- 40 unchanged lines hidden (view full) --- 271 { 272 // Get vertical extent of the panel. 273 sal_Int32 nPanelTop (rPanel.GetPosPixel().Y()); 274 const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1); 275 // Add the title bar into the extent. 276 if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible()) 277 nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y(); 278 | 273void Deck::SetPanels (const SharedPanelContainer& rPanels) 274{ 275 maPanels = rPanels; 276 277 RequestLayout(); 278} 279 280 --- 40 unchanged lines hidden (view full) --- 321 { 322 // Get vertical extent of the panel. 323 sal_Int32 nPanelTop (rPanel.GetPosPixel().Y()); 324 const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1); 325 // Add the title bar into the extent. 326 if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible()) 327 nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y(); 328 |
279 | |
280 // Determine what the new thumb position should be like. 281 // When the whole panel does not fit then make its top visible 282 // and it off at the bottom. 283 sal_Int32 nNewThumbPos (mpVerticalScrollBar->GetThumbPos()); 284 if (nPanelBottom >= nNewThumbPos+mpVerticalScrollBar->GetVisibleSize()) 285 nNewThumbPos = nPanelBottom - mpVerticalScrollBar->GetVisibleSize(); 286 if (nPanelTop < nNewThumbPos) 287 nNewThumbPos = nPanelTop; --- 126 unchanged lines hidden (view full) --- 414 415 416 417void Deck::ScrollContainerWindow::SetSeparators (const ::std::vector<sal_Int32>& rSeparators) 418{ 419 maSeparators = rSeparators; 420} 421 | 329 // Determine what the new thumb position should be like. 330 // When the whole panel does not fit then make its top visible 331 // and it off at the bottom. 332 sal_Int32 nNewThumbPos (mpVerticalScrollBar->GetThumbPos()); 333 if (nPanelBottom >= nNewThumbPos+mpVerticalScrollBar->GetVisibleSize()) 334 nNewThumbPos = nPanelBottom - mpVerticalScrollBar->GetVisibleSize(); 335 if (nPanelTop < nNewThumbPos) 336 nNewThumbPos = nPanelTop; --- 126 unchanged lines hidden (view full) --- 463 464 465 466void Deck::ScrollContainerWindow::SetSeparators (const ::std::vector<sal_Int32>& rSeparators) 467{ 468 maSeparators = rSeparators; 469} 470 |
471 |
|
422} } // end of namespace sfx2::sidebar | 472} } // end of namespace sfx2::sidebar |