| 67 | } |
| 68 | |
| 69 | void EditBox::initialiseOverride() |
| 70 | { |
| 71 | Base::initialiseOverride(); |
| 72 | |
| 73 | mOriginalPointer = getPointer(); |
| 74 | |
| 75 | // FIXME нам нужен фокус клавы |
| 76 | setNeedKeyFocus(true); |
| 77 | |
| 78 | assignWidget(mScrollViewClient, "Client"); |
| 79 | if (getClientWidget() != nullptr) |
| 80 | { |
| 81 | getClientWidget()->eventMouseSetFocus += newDelegate(this, &EditBox::notifyMouseSetFocus); |
| 82 | getClientWidget()->eventMouseLostFocus += newDelegate(this, &EditBox::notifyMouseLostFocus); |
| 83 | getClientWidget()->eventMouseButtonPressed += newDelegate(this, &EditBox::notifyMousePressed); |
| 84 | getClientWidget()->eventMouseButtonReleased += newDelegate(this, &EditBox::notifyMouseReleased); |
| 85 | getClientWidget()->eventMouseDrag += newDelegate(this, &EditBox::notifyMouseDrag); |
| 86 | getClientWidget()->eventMouseButtonDoubleClick += newDelegate(this, &EditBox::notifyMouseButtonDoubleClick); |
| 87 | getClientWidget()->eventMouseWheel += newDelegate(this, &EditBox::notifyMouseWheel); |
| 88 | } |
| 89 | |
| 90 | ///@wskin_child{EditBox, ScrollBar, VScroll} Вертикальная полоса прокрутки. |
| 91 | assignWidget(mVScroll, "VScroll"); |
| 92 | if (mVScroll != nullptr) |
| 93 | { |
| 94 | mVScroll->eventScrollChangePosition += newDelegate(this, &EditBox::notifyScrollChangePosition); |
| 95 | } |
| 96 | |
| 97 | ///@wskin_child{EditBox, ScrollBar, HScroll} Горизонтальная полоса прокрутки. |
| 98 | assignWidget(mHScroll, "HScroll"); |
| 99 | if (mHScroll != nullptr) |
| 100 | { |
| 101 | mHScroll->eventScrollChangePosition += newDelegate(this, &EditBox::notifyScrollChangePosition); |
| 102 | } |
| 103 | |
| 104 | mClientText = getSubWidgetText(); |
| 105 | if (getClientWidget() != nullptr) |
| 106 | { |
| 107 | ISubWidgetText* text = getClientWidget()->getSubWidgetText(); |
| 108 | if (text) |
| 109 | mClientText = text; |
| 110 | } |
| 111 | |
| 112 | updateScrollSize(); |
| 113 | |
| 114 | // первоначальная инициализация курсора |
| 115 | if (mClientText != nullptr) |
| 116 | mClientText->setCursorPosition(mCursorPosition); |
| 117 | |
| 118 | updateSelectText(); |
| 119 | } |
| 120 | |
| 121 | void EditBox::shutdownOverride() |
| 122 | { |
nothing calls this directly
no test coverage detected