| 78 | } |
| 79 | |
| 80 | void TreeControl::initialiseOverride() |
| 81 | { |
| 82 | Base::initialiseOverride(); |
| 83 | |
| 84 | // FIXME перенесенно из конструктора, проверить смену скина |
| 85 | mpRoot = new Node(this); |
| 86 | |
| 87 | //FIXME |
| 88 | setNeedKeyFocus(true); |
| 89 | |
| 90 | assignWidget(mpWidgetScroll, "VScroll"); |
| 91 | if (mpWidgetScroll != nullptr) |
| 92 | { |
| 93 | mpWidgetScroll->eventScrollChangePosition += newDelegate(this, &TreeControl::notifyScrollChangePosition); |
| 94 | mpWidgetScroll->eventMouseButtonPressed += newDelegate(this, &TreeControl::notifyMousePressed); |
| 95 | } |
| 96 | |
| 97 | if (getClientWidget() != nullptr) |
| 98 | { |
| 99 | getClientWidget()->eventMouseButtonPressed += newDelegate(this, &TreeControl::notifyMousePressed); |
| 100 | } |
| 101 | |
| 102 | MYGUI_ASSERT(nullptr != mpWidgetScroll, "Child VScroll not found in skin (TreeControl must have VScroll)"); |
| 103 | MYGUI_ASSERT( |
| 104 | nullptr != getClientWidget(), |
| 105 | "Child Widget Client not found in skin (TreeControl must have Client)"); |
| 106 | |
| 107 | if (isUserString("SkinLine")) |
| 108 | mstrSkinLine.assign(getUserString("SkinLine")); |
| 109 | if (isUserString("HeightLine")) |
| 110 | mnItemHeight = utility::parseValue<int>(getUserString("HeightLine")); |
| 111 | if (isUserString("LevelOffset")) |
| 112 | mnLevelOffset = utility::parseValue<int>(getUserString("LevelOffset")); |
| 113 | |
| 114 | MYGUI_ASSERT(!mstrSkinLine.empty(), "SkinLine property not found (TreeControl must have SkinLine property)"); |
| 115 | |
| 116 | if (mnItemHeight < 1) |
| 117 | mnItemHeight = 1; |
| 118 | |
| 119 | mpWidgetScroll->setScrollPage((size_t)mnItemHeight); |
| 120 | mpWidgetScroll->setScrollViewPage((size_t)mnItemHeight); |
| 121 | |
| 122 | invalidate(); |
| 123 | } |
| 124 | |
| 125 | void TreeControl::shutdownOverride() |
| 126 | { |
nothing calls this directly
no test coverage detected