MyGUI: MyGUI_ScrollBar.cpp Source File

MyGUI 3.2.2

MyGUI_ScrollBar.cpp
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #include "MyGUI_Precompiled.h"
8 #include "MyGUI_ScrollBar.h"
9 #include "MyGUI_InputManager.h"
10 #include "MyGUI_Button.h"
11 #include "MyGUI_ResourceSkin.h"
12 #include "MyGUI_ControllerRepeatClick.h"
13 #include "MyGUI_ControllerManager.h"
14
15 namespace MyGUI
16 {
17
18 ScrollBar::ScrollBar() :
19 mWidgetStart(nullptr),
20 mWidgetEnd(nullptr),
21 mWidgetTrack(nullptr),
22 mWidgetFirstPart(nullptr),
23 mWidgetSecondPart(nullptr),
24 mSkinRangeStart(0),
25 mSkinRangeEnd(0),
26 mScrollRange(0),
27 mScrollPosition(0),
28 mScrollPage(0),
29 mScrollViewPage(0),
30 mScrollWheelPage(0),
31 mEnableRepeat(true),
32 mRepeatTriggerTime(0.f),
33 mRepeatStepTime(0.f),
34 mMinTrackSize(0),
35 mMoveToClick(false),
36 mVerticalAlignment(true)
37 {
38 }
39
40 void ScrollBar::initialiseOverride()
41 {
42 Base::initialiseOverride();
43
44 // при нуле, будет игнорировать кнопки
45 mScrollPage = 1;
46 mScrollViewPage = 1;
47 mScrollWheelPage = 1;
48 mMinTrackSize = 0;
49 mSkinRangeStart = 0;
50 mSkinRangeEnd = 0;
51
52 mRepeatTriggerTime = 0.5f;
53 mRepeatStepTime = 0.1f;
54
56 assignWidget(mWidgetStart, "Start");
57 if (mWidgetStart != nullptr)
58 {
59 mWidgetStart->eventMouseButtonPressed += newDelegate(this, &ScrollBar::notifyMousePressed);
60 mWidgetStart->eventMouseButtonReleased += newDelegate(this, &ScrollBar::notifyMouseReleased);
61 mWidgetStart->eventMouseWheel += newDelegate(this, &ScrollBar::notifyMouseWheel);
62 }
63
65 assignWidget(mWidgetEnd, "End");
66 if (mWidgetEnd != nullptr)
67 {
68 mWidgetEnd->eventMouseButtonPressed += newDelegate(this, &ScrollBar::notifyMousePressed);
69 mWidgetEnd->eventMouseButtonReleased += newDelegate(this, &ScrollBar::notifyMouseReleased);
70 mWidgetEnd->eventMouseWheel += newDelegate(this, &ScrollBar::notifyMouseWheel);
71 }
72
74 assignWidget(mWidgetTrack, "Track");
75 if (mWidgetTrack)
76 {
77 mWidgetTrack->eventMouseDrag += newDelegate(this, &ScrollBar::notifyMouseDrag);
78 mWidgetTrack->eventMouseButtonPressed += newDelegate(this, &ScrollBar::notifyMousePressed);
79 mWidgetTrack->eventMouseButtonReleased += newDelegate(this, &ScrollBar::notifyMouseReleased);
80 mWidgetTrack->eventMouseWheel += newDelegate(this, &ScrollBar::notifyMouseWheel);
81 mWidgetTrack->setVisible(false);
82 }
83
85 assignWidget(mWidgetFirstPart, "FirstPart");
86 if (mWidgetFirstPart != nullptr)
87 {
88 mWidgetFirstPart->eventMouseButtonPressed += newDelegate(this, &ScrollBar::notifyMousePressed);
89 mWidgetFirstPart->eventMouseButtonReleased += newDelegate(this, &ScrollBar::notifyMouseReleased);
90 mWidgetFirstPart->eventMouseWheel += newDelegate(this, &ScrollBar::notifyMouseWheel);
91 }
92
94 assignWidget(mWidgetSecondPart, "SecondPart");
95 if (mWidgetSecondPart != nullptr)
96 {
97 mWidgetSecondPart->eventMouseButtonPressed += newDelegate(this, &ScrollBar::notifyMousePressed);
98 mWidgetSecondPart->eventMouseButtonReleased += newDelegate(this, &ScrollBar::notifyMouseReleased);
99 mWidgetSecondPart->eventMouseWheel += newDelegate(this, &ScrollBar::notifyMouseWheel);
100 }
101
102 if (isUserString("MinTrackSize"))
103 mMinTrackSize = utility::parseValue<int>(getUserString("MinTrackSize"));
104
105 if (isUserString("TrackRangeMargins"))
106 utility::parseComplex<size_t>(getUserString("TrackRangeMargins"), mSkinRangeStart, mSkinRangeEnd);
107
108 if (mWidgetTrack != nullptr)
109 {
110 if (mWidgetTrack->isUserString("MinTrackSize"))
111 mMinTrackSize = utility::parseValue<int>(mWidgetTrack->getUserString("MinTrackSize"));
112 }
113 }
114
115 void ScrollBar::shutdownOverride()
116 {
117 mWidgetStart = nullptr;
118 mWidgetEnd = nullptr;
119 mWidgetTrack = nullptr;
120 mWidgetFirstPart = nullptr;
121 mWidgetSecondPart = nullptr;
122
123 Base::shutdownOverride();
124 }
125
126 void ScrollBar::updateTrack()
127 {
128 if (mWidgetTrack == nullptr)
129 return;
130
131 _forcePick(mWidgetTrack);
132 // размер диапазана в пикселях
133 int pos = getLineSize();
134
135 if (mVerticalAlignment)
136 {
137 // скрываем если диапазан маленький или места мало
138 if ((mScrollRange < 2) || (pos <= mWidgetTrack->getHeight()))
139 {
140 mWidgetTrack->setVisible(false);
141 if (nullptr != mWidgetFirstPart)
142 mWidgetFirstPart->setSize(mWidgetFirstPart->getWidth(), pos / 2);
143 if (nullptr != mWidgetSecondPart)
144 mWidgetSecondPart->setCoord(mWidgetSecondPart->getLeft(), pos / 2 + (int)mSkinRangeStart, mWidgetSecondPart->getWidth(), pos - pos / 2);
145 return;
146 }
147 // если скрыт то покажем
148 if (!mWidgetTrack->getVisible())
149 mWidgetTrack->setVisible(true);
150
151 // и обновляем позицию
152 pos = (int)(((size_t)(pos - getTrackSize()) * mScrollPosition) / (mScrollRange - 1) + mSkinRangeStart);
153
154 mWidgetTrack->setPosition(mWidgetTrack->getLeft(), pos);
155 if (nullptr != mWidgetFirstPart)
156 {
157 int height = pos - mWidgetFirstPart->getTop();
158 mWidgetFirstPart->setSize(mWidgetFirstPart->getWidth(), height);
159 }
160 if (nullptr != mWidgetSecondPart)
161 {
162 int top = pos + mWidgetTrack->getHeight();
163 int height = mWidgetSecondPart->getHeight() + mWidgetSecondPart->getTop() - top;
164 mWidgetSecondPart->setCoord(mWidgetSecondPart->getLeft(), top, mWidgetSecondPart->getWidth(), height);
165 }
166 }
167 else
168 {
169 // скрываем если диапазан маленький или места мало
170 if ((mScrollRange < 2) || (pos <= mWidgetTrack->getWidth()))
171 {
172 mWidgetTrack->setVisible(false);
173 if (nullptr != mWidgetFirstPart)
174 mWidgetFirstPart->setSize(pos / 2, mWidgetFirstPart->getHeight());
175 if (nullptr != mWidgetSecondPart)
176 mWidgetSecondPart->setCoord(pos / 2 + (int)mSkinRangeStart, mWidgetSecondPart->getTop(), pos - pos / 2, mWidgetSecondPart->getHeight());
177 return;
178 }
179 // если скрыт то покажем
180 if (!mWidgetTrack->getVisible())
181 mWidgetTrack->setVisible(true);
182
183 // и обновляем позицию
184 pos = (int)(((size_t)(pos - getTrackSize()) * mScrollPosition) / (mScrollRange - 1) + mSkinRangeStart);
185
186 mWidgetTrack->setPosition(pos, mWidgetTrack->getTop());
187 if (nullptr != mWidgetFirstPart)
188 {
189 int height = pos - mWidgetFirstPart->getLeft();
190 mWidgetFirstPart->setSize(height, mWidgetFirstPart->getHeight());
191 }
192 if (nullptr != mWidgetSecondPart)
193 {
194 int top = pos + mWidgetTrack->getWidth();
195 int height = mWidgetSecondPart->getWidth() + mWidgetSecondPart->getLeft() - top;
196 mWidgetSecondPart->setCoord(top, mWidgetSecondPart->getTop(), height, mWidgetSecondPart->getHeight());
197 }
198 }
199 }
200
201 void ScrollBar::TrackMove(int _left, int _top)
202 {
203 if (mWidgetTrack == nullptr)
204 return;
205
206 const IntPoint& point = InputManager::getInstance().getLastPressedPosition(MouseButton::Left);
207
208 if (mVerticalAlignment)
209 {
210 // расчитываем позицию виджета
211 int start = mPreActionOffset.top + (_top - point.top);
212 if (start < (int)mSkinRangeStart)
213 start = (int)mSkinRangeStart;
214 else if (start > (getTrackPlaceLength() - (int)mSkinRangeEnd - mWidgetTrack->getHeight()))
215 start = (getTrackPlaceLength() - (int)mSkinRangeEnd - mWidgetTrack->getHeight());
216 if (mWidgetTrack->getTop() != start)
217 mWidgetTrack->setPosition(mWidgetTrack->getLeft(), start);
218
219 // расчитываем положение соответствующее позиции
220 // плюс пол позиции
221 int pos = start - (int)mSkinRangeStart + (getLineSize() - getTrackSize()) / (((int)mScrollRange - 1) * 2);
222 // высчитываем ближайшее значение и обновляем
223 pos = pos * (int)(mScrollRange - 1) / (getLineSize() - getTrackSize());
224
225 // проверяем на выходы и изменения
226 if (pos < 0)
227 pos = 0;
228 else if (pos >= (int)mScrollRange)
229 pos = (int)mScrollRange - 1;
230 if (pos == (int)mScrollPosition)
231 return;
232
233 mScrollPosition = pos;
234 }
235 else
236 {
237 // расчитываем позицию виджета
238 int start = mPreActionOffset.left + (_left - point.left);
239 if (start < (int)mSkinRangeStart)
240 start = (int)mSkinRangeStart;
241 else if (start > (getTrackPlaceLength() - (int)mSkinRangeEnd - mWidgetTrack->getWidth()))
242 start = (getTrackPlaceLength() - (int)mSkinRangeEnd - mWidgetTrack->getWidth());
243 if (mWidgetTrack->getLeft() != start)
244 mWidgetTrack->setPosition(IntPoint(start, mWidgetTrack->getTop()));
245
246 // расчитываем положение соответствующее позиции
247 // плюс пол позиции
248 int pos = start - (int)mSkinRangeStart + (getLineSize() - getTrackSize()) / (((int)mScrollRange - 1) * 2);
249 // высчитываем ближайшее значение и обновляем
250 pos = pos * (int)(mScrollRange - 1) / (getLineSize() - getTrackSize());
251
252 // проверяем на выходы и изменения
253 if (pos < 0)
254 pos = 0;
255 else if (pos >= (int)mScrollRange)
256 pos = (int)mScrollRange - 1;
257 if (pos == (int)mScrollPosition)
258 return;
259
260 mScrollPosition = pos;
261 }
262
263 updateTrack();
264
265 // отсылаем событие
266 eventScrollChangePosition(this, (int)mScrollPosition);
267 }
268
269 void ScrollBar::notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id)
270 {
271 // диспечерезируем нажатие своих детей как свое
272 eventMouseButtonPressed(this, _left, _top, _id);
273
274 if (MouseButton::Left != _id)
275 return;
276
277 if (mEnableRepeat && _sender != mWidgetTrack)
278 {
279 ControllerItem* item = ControllerManager::getInstance().createItem(ControllerRepeatClick::getClassTypeName());
280 ControllerRepeatClick* controller = item->castType<ControllerRepeatClick>();
281 controller->eventRepeatClick += newDelegate(this, &ScrollBar::repeatClick);
282 controller->setRepeat(mRepeatTriggerTime, mRepeatStepTime);
283 ControllerManager::getInstance().addItem(_sender, controller);
284 }
285
286 if (mMoveToClick &&
287 _sender != mWidgetTrack &&
288 _sender != mWidgetStart &&
289 _sender != mWidgetEnd)
290 {
291 if (mWidgetTrack != nullptr)
292 {
293 mPreActionOffset = InputManager::getInstance().getLastPressedPosition(MouseButton::Left);
294 const IntPoint& point = InputManager::getInstance().getMousePositionByLayer() - mWidgetTrack->getParent()->getAbsolutePosition();
295
296 mPreActionOffset.left -= getTrackSize() / 2;
297 mPreActionOffset.top -= getTrackSize() / 2;
298
299 TrackMove(point.left, point.top);
300 }
301 }
302 else if (_sender == mWidgetStart)
303 {
304 widgetStartPressed();
305 }
306 else if (_sender == mWidgetEnd)
307 {
308 widgetEndPressed();
309 }
310 else if (_sender == mWidgetFirstPart)
311 {
312 widgetFirstPartPressed();
313 }
314 else if (_sender == mWidgetSecondPart)
315 {
316 widgetSecondPartPressed();
317 }
318 else if (_sender == mWidgetTrack)
319 {
320 mPreActionOffset.left = _sender->getLeft();
321 mPreActionOffset.top = _sender->getTop();
322 }
323 }
324
325 void ScrollBar::notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id)
326 {
327 updateTrack();
328 MyGUI::ControllerManager::getInstance().removeItem(_sender);
329 }
330
331 void ScrollBar::notifyMouseDrag(Widget* _sender, int _left, int _top, MouseButton _id)
332 {
333 if (_id == MouseButton::Left)
334 TrackMove(_left, _top);
335 }
336
337 void ScrollBar::setScrollRange(size_t _range)
338 {
339 if (_range == mScrollRange)
340 return;
341
342 mScrollRange = _range;
343 mScrollPosition = (mScrollPosition < mScrollRange) ? mScrollPosition : 0;
344 updateTrack();
345 }
346
347 void ScrollBar::setScrollPosition(size_t _position)
348 {
349 if (_position == mScrollPosition)
350 return;
351
352 if (_position >= mScrollRange)
353 _position = 0;
354
355 mScrollPosition = _position;
356 updateTrack();
357 }
358
359 void ScrollBar::setPosition(const IntPoint& _point)
360 {
361 Base::setPosition(_point);
362 }
363
364 void ScrollBar::setSize(const IntSize& _size)
365 {
366 Base::setSize(_size);
367 // обновляем трек
368 updateTrack();
369 }
370
371 void ScrollBar::setCoord(const IntCoord& _coord)
372 {
373 Base::setCoord(_coord);
374 // обновляем трек
375 updateTrack();
376 }
377
378 void ScrollBar::setTrackSize(int _size)
379 {
380 if (mWidgetTrack != nullptr)
381 {
382 if (mVerticalAlignment)
383 mWidgetTrack->setSize(mWidgetTrack->getWidth(), ((int)_size < (int)mMinTrackSize) ? (int)mMinTrackSize : (int)_size);
384 else
385 mWidgetTrack->setSize(((int)_size < (int)mMinTrackSize) ? (int)mMinTrackSize : (int)_size, mWidgetTrack->getHeight());
386 }
387 updateTrack();
388 }
389
390 void ScrollBar::setRepeatTriggerTime(float time)
391 {
392 mRepeatTriggerTime = time;
393 }
394
395 void ScrollBar::setRepeatStepTime(float time)
396 {
397 mRepeatStepTime = time;
398 }
399
400 float ScrollBar::getRepeatTriggerTime(float time) const
401 {
402 return mRepeatTriggerTime;
403 }
404
405 float ScrollBar::getRepeatStepTime(float time) const
406 {
407 return mRepeatStepTime;
408 }
409
410 void ScrollBar::setRepeatEnabled(bool enabled)
411 {
412 mEnableRepeat = enabled;
413 }
414
415 bool ScrollBar::getRepeatEnabled() const
416 {
417 return mEnableRepeat;
418 }
419
420 int ScrollBar::getTrackSize() const
421 {
422 if (mWidgetTrack != nullptr)
423 {
424 if (mVerticalAlignment)
425 return mWidgetTrack->getHeight();
426 else
427 return mWidgetTrack->getWidth();
428 }
429 return 1;
430 }
431
432 int ScrollBar::getLineSize() const
433 {
434 return getTrackPlaceLength() - (int)(mSkinRangeStart + mSkinRangeEnd);
435 }
436
437 void ScrollBar::onMouseWheel(int _rel)
438 {
439 notifyMouseWheel(nullptr, _rel);
440
441 Base::onMouseWheel(_rel);
442 }
443
444 void ScrollBar::notifyMouseWheel(Widget* _sender, int _rel)
445 {
446 if (mScrollRange < 2)
447 return;
448
449 int offset = mScrollPosition;
450 if (_rel < 0)
451 offset += mScrollWheelPage;
452 else
453 offset -= mScrollWheelPage;
454
455 if (offset < 0)
456 offset = 0;
457 else if (offset > (int)(mScrollRange - 1))
458 offset = mScrollRange - 1;
459
460 if ((size_t)offset != mScrollPosition)
461 {
462 mScrollPosition = offset;
463 // оповещаем
464 eventScrollChangePosition(this, (int)mScrollPosition);
465 updateTrack();
466 }
467 }
468
469 void ScrollBar::repeatClick(Widget *_widget, ControllerItem *_controller)
470 {
471 if (_widget == mWidgetStart)
472 widgetStartPressed();
473 else if (_widget == mWidgetEnd)
474 widgetEndPressed();
475 else if (_widget == mWidgetFirstPart)
476 widgetFirstPartPressed();
477 else if (_widget == mWidgetSecondPart)
478 widgetSecondPartPressed();
479 }
480
481 void ScrollBar::widgetStartPressed()
482 {
483 // минимальное значение
484 if (mScrollPosition == 0)
485 return;
486
487 // расчитываем следующее положение
488 if (mScrollPosition > mScrollPage)
489 mScrollPosition -= mScrollPage;
490 else
491 mScrollPosition = 0;
492
493 // оповещаем
494 eventScrollChangePosition(this, (int)mScrollPosition);
495 updateTrack();
496 }
497
498 void ScrollBar::widgetEndPressed()
499 {
500 // максимальное значение
501 if ((mScrollRange < 2) || (mScrollPosition >= (mScrollRange - 1)))
502 return;
503
504 // расчитываем следующее положение
505 if ((mScrollPosition + mScrollPage) < (mScrollRange - 1))
506 mScrollPosition += mScrollPage;
507 else
508 mScrollPosition = mScrollRange - 1;
509
510 // оповещаем
511 eventScrollChangePosition(this, (int)mScrollPosition);
512 updateTrack();
513 }
514
515 void ScrollBar::widgetFirstPartPressed()
516 {
517 // минимальное значение
518 if (mScrollPosition == 0)
519 return;
520
521 // расчитываем следующее положение
522 if (mScrollPosition > mScrollViewPage)
523 mScrollPosition -= mScrollViewPage;
524 else
525 mScrollPosition = 0;
526
527 // оповещаем
528 eventScrollChangePosition(this, (int)mScrollPosition);
529 updateTrack();
530 }
531
532 void ScrollBar::widgetSecondPartPressed()
533 {
534 // максимальное значение
535 if ((mScrollRange < 2) || (mScrollPosition >= (mScrollRange - 1)))
536 return;
537
538 // расчитываем следующее положение
539 if ((mScrollPosition + mScrollViewPage) < (mScrollRange - 1))
540 mScrollPosition += mScrollViewPage;
541 else
542 mScrollPosition = mScrollRange - 1;
543
544 // оповещаем
545 eventScrollChangePosition(this, (int)mScrollPosition);
546 updateTrack();
547 }
548
549 void ScrollBar::setPropertyOverride(const std::string& _key, const std::string& _value)
550 {
552 if (_key == "Range")
553 setScrollRange(utility::parseValue<size_t>(_value));
554
556 else if (_key == "RangePosition")
557 setScrollPosition(utility::parseValue<size_t>(_value));
558
560 else if (_key == "Page")
561 setScrollPage(utility::parseValue<size_t>(_value));
562
564 else if (_key == "ViewPage")
565 setScrollViewPage(utility::parseValue<size_t>(_value));
566
568 else if (_key == "WheelPage")
569 setScrollWheelPage(utility::parseValue<size_t>(_value));
570
572 else if (_key == "MoveToClick")
573 setMoveToClick(utility::parseValue<bool>(_value));
574
576 else if (_key == "VerticalAlignment")
577 setVerticalAlignment(utility::parseValue<bool>(_value));
578
580 else if (_key == "Repeat")
581 setRepeatEnabled(utility::parseValue<bool>(_value));
582
584 else if (_key == "RepeatTriggerTime")
585 setRepeatTriggerTime(utility::parseValue<float>(_value));
586
588 else if (_key == "RepeatStepTime")
589 setRepeatStepTime(utility::parseValue<float>(_value));
590
591 else
592 {
593 Base::setPropertyOverride(_key, _value);
594 return;
595 }
596
597 eventChangeProperty(this, _key, _value);
598 }
599
600 size_t ScrollBar::getScrollRange() const
601 {
602 return mScrollRange;
603 }
604
605 size_t ScrollBar::getScrollPosition() const
606 {
607 return mScrollPosition;
608 }
609
610 void ScrollBar::setScrollPage(size_t _value)
611 {
612 mScrollPage = _value;
613 }
614
615 size_t ScrollBar::getScrollPage() const
616 {
617 return mScrollPage;
618 }
619
620 void ScrollBar::setScrollViewPage(size_t _value)
621 {
622 mScrollViewPage = _value;
623 }
624
625 size_t ScrollBar::getScrollViewPage() const
626 {
627 return mScrollViewPage;
628 }
629
630 void ScrollBar::setScrollWheelPage(size_t _value)
631 {
632 mScrollWheelPage = _value;
633 }
634 size_t ScrollBar::getScrollWheelPage() const
635 {
636 return mScrollWheelPage;
637 }
638
639 void ScrollBar::setMinTrackSize(int _value)
640 {
641 mMinTrackSize = _value;
642 }
643
644 int ScrollBar::getMinTrackSize() const
645 {
646 return mMinTrackSize;
647 }
648
649 void ScrollBar::setMoveToClick(bool _value)
650 {
651 mMoveToClick = _value;
652 }
653
654 bool ScrollBar::getMoveToClick() const
655 {
656 return mMoveToClick;
657 }
658
659 void ScrollBar::setPosition(int _left, int _top)
660 {
661 setPosition(IntPoint(_left, _top));
662 }
663
664 void ScrollBar::setSize(int _width, int _height)
665 {
666 setSize(IntSize(_width, _height));
667 }
668
669 void ScrollBar::setCoord(int _left, int _top, int _width, int _height)
670 {
671 setCoord(IntCoord(_left, _top, _width, _height));
672 }
673
674 int ScrollBar::getTrackPlaceLength() const
675 {
676 if (mWidgetTrack != nullptr)
677 {
678 if (mVerticalAlignment)
679 return mWidgetTrack->getParent()->getHeight();
680 else
681 return mWidgetTrack->getParent()->getWidth();
682 }
683 return 0;
684 }
685
686 void ScrollBar::setVerticalAlignment(bool _value)
687 {
688 mVerticalAlignment = _value;
689
690 updateTrack();
691 }
692
693 bool ScrollBar::getVerticalAlignment() const
694 {
695 return mVerticalAlignment;
696 }
697
698 } // namespace MyGUI
MyGUI::ScrollBar::getTrackSize
int getTrackSize() const
Definition: MyGUI_ScrollBar.cpp:420
MyGUI::Singleton< InputManager >::getInstance
static InputManager & getInstance()
Definition: MyGUI_Singleton.h:38
MyGUI::Widget::getParent
Widget * getParent() const
Definition: MyGUI_Widget.cpp:1275
MyGUI::WidgetInput::eventMouseButtonReleased
EventHandle_WidgetIntIntButton eventMouseButtonReleased
Definition: MyGUI_WidgetInput.h:163
MyGUI::ScrollBar::setScrollViewPage
void setScrollViewPage(size_t _value)
Definition: MyGUI_ScrollBar.cpp:620
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition: MyGUI_WidgetInput.h:154
MyGUI::ScrollBar::mScrollWheelPage
size_t mScrollWheelPage
Definition: MyGUI_ScrollBar.h:177
MyGUI::ControllerRepeatClick::getClassTypeName
static const std::string & getClassTypeName()
Definition: MyGUI_ControllerRepeatClick.h:24
MyGUI::ScrollBar::onMouseWheel
virtual void onMouseWheel(int _rel)
Definition: MyGUI_ScrollBar.cpp:437
MyGUI::ScrollBar::setRepeatEnabled
void setRepeatEnabled(bool enabled)
Definition: MyGUI_ScrollBar.cpp:410
MyGUI_ControllerManager.h
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition: MyGUI_Types.h:35
MyGUI::ScrollBar::setTrackSize
void setTrackSize(int _value)
Definition: MyGUI_ScrollBar.cpp:378
MyGUI::ScrollBar::eventScrollChangePosition
EventHandle_ScrollBarPtrSizeT eventScrollChangePosition
Definition: MyGUI_ScrollBar.h:130
MyGUI::Widget::setPosition
virtual void setPosition(const IntPoint &_value)
Definition: MyGUI_Widget.cpp:635
MyGUI::ScrollBar::setRepeatStepTime
void setRepeatStepTime(float time)
Definition: MyGUI_ScrollBar.cpp:395
MyGUI::ICroppedRectangle::getAbsolutePosition
const IntPoint & getAbsolutePosition() const
Definition: MyGUI_ICroppedRectangle.h:67
MyGUI::ScrollBar::getTrackPlaceLength
int getTrackPlaceLength() const
Definition: MyGUI_ScrollBar.cpp:674
MyGUI::types::TPoint::top
T top
Definition: MyGUI_TPoint.h:21
MyGUI::ScrollBar::mEnableRepeat
bool mEnableRepeat
Definition: MyGUI_ScrollBar.h:179
MyGUI::ScrollBar::mPreActionOffset
IntPoint mPreActionOffset
Definition: MyGUI_ScrollBar.h:167
MyGUI::ScrollBar::mMinTrackSize
int mMinTrackSize
Definition: MyGUI_ScrollBar.h:183
MyGUI::ScrollBar::mWidgetStart
Button * mWidgetStart
Definition: MyGUI_ScrollBar.h:159
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition: MyGUI_Widget.h:266
MyGUI::ScrollBar::setSize
virtual void setSize(const IntSize &_value)
Definition: MyGUI_ScrollBar.cpp:364
MyGUI::ScrollBar::mRepeatStepTime
float mRepeatStepTime
Definition: MyGUI_ScrollBar.h:181
MyGUI::ScrollBar::notifyMouseReleased
void notifyMouseReleased(Widget *_sender, int _left, int _top, MouseButton _id)
Definition: MyGUI_ScrollBar.cpp:325
MyGUI::ScrollBar::mMoveToClick
bool mMoveToClick
Definition: MyGUI_ScrollBar.h:184
MyGUI::ScrollBar::setMoveToClick
void setMoveToClick(bool _value)
Definition: MyGUI_ScrollBar.cpp:649
MyGUI::ScrollBar::ScrollBar
ScrollBar()
Definition: MyGUI_ScrollBar.cpp:18
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:29
MyGUI::ScrollBar::getLineSize
int getLineSize() const
Definition: MyGUI_ScrollBar.cpp:432
MyGUI::types::TPoint< int >
MyGUI::ControllerItem
Definition: MyGUI_ControllerItem.h:25
MyGUI::ScrollBar::setScrollWheelPage
void setScrollWheelPage(size_t _value)
Definition: MyGUI_ScrollBar.cpp:630
MyGUI_ControllerRepeatClick.h
MyGUI::IntSize
types::TSize< int > IntSize
Definition: MyGUI_Types.h:29
MyGUI::ScrollBar::shutdownOverride
virtual void shutdownOverride()
Definition: MyGUI_ScrollBar.cpp:115
MyGUI::ScrollBar::getScrollPage
size_t getScrollPage() const
Definition: MyGUI_ScrollBar.cpp:615
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:28
MyGUI::ScrollBar::getMinTrackSize
int getMinTrackSize() const
Definition: MyGUI_ScrollBar.cpp:644
MyGUI::ScrollBar::getMoveToClick
bool getMoveToClick() const
Definition: MyGUI_ScrollBar.cpp:654
MyGUI_Precompiled.h
MyGUI::Widget::_forcePick
void _forcePick(Widget *_widget)
Definition: MyGUI_Widget.cpp:516
MyGUI::ScrollBar::mWidgetSecondPart
Widget * mWidgetSecondPart
Definition: MyGUI_ScrollBar.h:164
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:15
MyGUI::ScrollBar::setVerticalAlignment
void setVerticalAlignment(bool _value)
Definition: MyGUI_ScrollBar.cpp:686
MyGUI::ScrollBar::setRepeatTriggerTime
void setRepeatTriggerTime(float time)
Definition: MyGUI_ScrollBar.cpp:390
MyGUI::ScrollBar::notifyMousePressed
void notifyMousePressed(Widget *_sender, int _left, int _top, MouseButton _id)
Definition: MyGUI_ScrollBar.cpp:269
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition: MyGUI_Types.h:26
MyGUI::ScrollBar::getScrollWheelPage
size_t getScrollWheelPage() const
Definition: MyGUI_ScrollBar.cpp:634
MyGUI::ScrollBar::getScrollRange
size_t getScrollRange() const
Definition: MyGUI_ScrollBar.cpp:600
MyGUI_InputManager.h
MyGUI::types::TPoint::left
T left
Definition: MyGUI_TPoint.h:20
MyGUI::InputManager::getMousePositionByLayer
IntPoint getMousePositionByLayer()
Definition: MyGUI_InputManager.cpp:596
MyGUI::Widget::setVisible
virtual void setVisible(bool _value)
Definition: MyGUI_Widget.cpp:965
MyGUI::ScrollBar::getRepeatEnabled
bool getRepeatEnabled() const
Definition: MyGUI_ScrollBar.cpp:415
MyGUI_Button.h
MyGUI::WidgetInput::eventMouseDrag
EventPairAddParameter< EventHandle_WidgetIntInt, EventHandle_WidgetIntIntButton > eventMouseDrag
Definition: MyGUI_WidgetInput.h:130
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:18
MyGUI::ScrollBar::mRepeatTriggerTime
float mRepeatTriggerTime
Definition: MyGUI_ScrollBar.h:180
MyGUI_ScrollBar.h
MyGUI::ScrollBar::setScrollPosition
void setScrollPosition(size_t _value)
Definition: MyGUI_ScrollBar.cpp:347
MyGUI::UserData::isUserString
bool isUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:52
MyGUI::ScrollBar::getRepeatStepTime
float getRepeatStepTime(float time) const
Definition: MyGUI_ScrollBar.cpp:405
MyGUI::ScrollBar::getRepeatTriggerTime
float getRepeatTriggerTime(float time) const
Definition: MyGUI_ScrollBar.cpp:400
MyGUI::types::TSize< int >
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:29
MyGUI::ScrollBar::setPropertyOverride
virtual void setPropertyOverride(const std::string &_key, const std::string &_value)
Definition: MyGUI_ScrollBar.cpp:549
MyGUI::Widget::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_Widget.cpp:689
MyGUI::Widget::setSize
virtual void setSize(const IntSize &_value)
Definition: MyGUI_Widget.cpp:652
MyGUI::Widget::assignWidget
void assignWidget(T *&_widget, const std::string &_name)
Definition: MyGUI_Widget.h:328
MyGUI::ControllerRepeatClick::setRepeat
void setRepeat(float init, float step)
Definition: MyGUI_ControllerRepeatClick.cpp:40
MyGUI::ControllerManager::createItem
ControllerItem * createItem(const std::string &_type)
Definition: MyGUI_ControllerManager.cpp:72
MyGUI::ControllerManager::addItem
void addItem(Widget *_widget, ControllerItem *_item)
Definition: MyGUI_ControllerManager.cpp:78
MyGUI::ControllerRepeatClick::eventRepeatClick
EventHandle_RepeatClick eventRepeatClick
Definition: MyGUI_ControllerRepeatClick.h:45
MyGUI::ScrollBar::initialiseOverride
virtual void initialiseOverride()
Definition: MyGUI_ScrollBar.cpp:40
MyGUI::InputManager::getLastPressedPosition
const IntPoint & getLastPressedPosition(MouseButton _id) const
Definition: MyGUI_InputManager.cpp:638
MyGUI::ICroppedRectangle::getTop
int getTop() const
Definition: MyGUI_ICroppedRectangle.h:104
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition: MyGUI_ICroppedRectangle.h:119
MyGUI::ScrollBar::setScrollRange
void setScrollRange(size_t _value)
Definition: MyGUI_ScrollBar.cpp:337
MyGUI::Widget::getVisible
bool getVisible() const
Definition: MyGUI_Widget.cpp:1250
MyGUI::ScrollBar::setScrollPage
void setScrollPage(size_t _value)
Definition: MyGUI_ScrollBar.cpp:610
MyGUI::ScrollBar::setPosition
virtual void setPosition(const IntPoint &_value)
Definition: MyGUI_ScrollBar.cpp:359
MyGUI::MouseButton::Left
Definition: MyGUI_MouseButton.h:21
MyGUI::ScrollBar::mScrollRange
size_t mScrollRange
Definition: MyGUI_ScrollBar.h:173
MyGUI::types::TCoord< int >
MyGUI::ScrollBar::mScrollPage
size_t mScrollPage
Definition: MyGUI_ScrollBar.h:175
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition: MyGUI_ICroppedRectangle.h:114
MyGUI::ScrollBar::mVerticalAlignment
bool mVerticalAlignment
Definition: MyGUI_ScrollBar.h:186
MyGUI::ScrollBar::mScrollViewPage
size_t mScrollViewPage
Definition: MyGUI_ScrollBar.h:176
MyGUI::ScrollBar::notifyMouseWheel
void notifyMouseWheel(Widget *_sender, int _rel)
Definition: MyGUI_ScrollBar.cpp:444
MyGUI::ScrollBar::setMinTrackSize
void setMinTrackSize(int _value)
Definition: MyGUI_ScrollBar.cpp:639
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition: MyGUI_WidgetInput.h:145
MyGUI::ScrollBar::mWidgetTrack
Button * mWidgetTrack
Definition: MyGUI_ScrollBar.h:161
MyGUI::ICroppedRectangle::getLeft
int getLeft() const
Definition: MyGUI_ICroppedRectangle.h:94
MyGUI::ScrollBar::getVerticalAlignment
bool getVerticalAlignment() const
Definition: MyGUI_ScrollBar.cpp:693
MyGUI
Definition: MyGUI_ActionController.h:14
MyGUI::ScrollBar::mWidgetEnd
Button * mWidgetEnd
Definition: MyGUI_ScrollBar.h:160
MyGUI::ScrollBar::updateTrack
void updateTrack()
Definition: MyGUI_ScrollBar.cpp:126
newDelegate
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS delegates::IDelegateMYGUI_SUFFIX MYGUI_TEMPLATE_ARGS * newDelegate(void(*_func)(MYGUI_PARAMS))
Definition: MyGUI_DelegateImplement.h:117
MyGUI::ScrollBar::notifyMouseDrag
void notifyMouseDrag(Widget *_sender, int _left, int _top, MouseButton _id)
Definition: MyGUI_ScrollBar.cpp:331
MyGUI::ScrollBar::mWidgetFirstPart
Widget * mWidgetFirstPart
Definition: MyGUI_ScrollBar.h:163
MyGUI::ScrollBar::getScrollPosition
size_t getScrollPosition() const
Definition: MyGUI_ScrollBar.cpp:605
MyGUI::ScrollBar::TrackMove
void TrackMove(int _left, int _top)
Definition: MyGUI_ScrollBar.cpp:201
MyGUI::ControllerManager::removeItem
void removeItem(Widget *_widget)
Definition: MyGUI_ControllerManager.cpp:105
MyGUI::ScrollBar::mSkinRangeEnd
size_t mSkinRangeEnd
Definition: MyGUI_ScrollBar.h:171
MyGUI::ScrollBar::getScrollViewPage
size_t getScrollViewPage() const
Definition: MyGUI_ScrollBar.cpp:625
MyGUI::ScrollBar::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_ScrollBar.cpp:371
MyGUI::ControllerRepeatClick
Definition: MyGUI_ControllerRepeatClick.h:21
MyGUI_ResourceSkin.h
MyGUI::ScrollBar::mScrollPosition
size_t mScrollPosition
Definition: MyGUI_ScrollBar.h:174
MyGUI::ScrollBar::mSkinRangeStart
size_t mSkinRangeStart
Definition: MyGUI_ScrollBar.h:170