| 24 | const float COMBO_ALPHA_COEF = 4.0f; |
| 25 | |
| 26 | void ComboBox::initialiseOverride() |
| 27 | { |
| 28 | Base::initialiseOverride(); |
| 29 | |
| 30 | ///@wskin_child{ComboBox, Button, Button} Кнопка для выпадающего списка. |
| 31 | assignWidget(mButton, "Button"); |
| 32 | if (mButton != nullptr) |
| 33 | { |
| 34 | mButton->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyButtonPressed); |
| 35 | } |
| 36 | |
| 37 | ///@wskin_child{ComboBox, ListBox, List} Выпадающий список. |
| 38 | assignWidget(mList, "List"); |
| 39 | |
| 40 | if (mList == nullptr) |
| 41 | { |
| 42 | std::string_view list_skin = getUserString("ListSkin"); |
| 43 | std::string_view list_layer = getUserString("ListLayer"); |
| 44 | |
| 45 | mList = static_cast<ListBox*>(_createSkinWidget( |
| 46 | WidgetStyle::Popup, |
| 47 | ListBox::getClassTypeName(), |
| 48 | list_skin, |
| 49 | IntCoord(), |
| 50 | Align::Default, |
| 51 | list_layer)); |
| 52 | } |
| 53 | |
| 54 | if (mList != nullptr) |
| 55 | { |
| 56 | mList->setActivateOnClick(true); |
| 57 | |
| 58 | mList->setVisible(false); |
| 59 | mList->eventKeyLostFocus += newDelegate(this, &ComboBox::notifyListLostFocus); |
| 60 | mList->eventListSelectAccept += newDelegate(this, &ComboBox::notifyListSelectAccept); |
| 61 | mList->eventListMouseItemActivate += newDelegate(this, &ComboBox::notifyListMouseItemActivate); |
| 62 | mList->eventListChangePosition += newDelegate(this, &ComboBox::notifyListChangePosition); |
| 63 | |
| 64 | mList->setNeedToolTip(true); |
| 65 | mList->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip); |
| 66 | } |
| 67 | |
| 68 | // подписываем дочерние классы на скролл |
| 69 | if (mScrollViewClient != nullptr) |
| 70 | { |
| 71 | mScrollViewClient->eventMouseWheel += newDelegate(this, &ComboBox::notifyMouseWheel); |
| 72 | mScrollViewClient->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyMousePressed); |
| 73 | |
| 74 | mScrollViewClient->setNeedToolTip(true); |
| 75 | mScrollViewClient->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip); |
| 76 | } |
| 77 | |
| 78 | // подписываемся на изменения текста |
| 79 | eventEditTextChange += newDelegate(this, &ComboBox::notifyEditTextChange); |
| 80 | } |
| 81 | |
| 82 | void ComboBox::shutdownOverride() |
| 83 | { |
nothing calls this directly
no test coverage detected