| 24 | const int WINDOW_SNAP_DISTANSE = 10; |
| 25 | |
| 26 | void Window::initialiseOverride() |
| 27 | { |
| 28 | Base::initialiseOverride(); |
| 29 | |
| 30 | // FIXME нам нужен фокус клавы |
| 31 | setNeedKeyFocus(true); |
| 32 | |
| 33 | // дефолтные размеры |
| 34 | mMinmax.set( |
| 35 | (std::numeric_limits<int>::min)(), |
| 36 | (std::numeric_limits<int>::min)(), |
| 37 | (std::numeric_limits<int>::max)(), |
| 38 | (std::numeric_limits<int>::max)()); |
| 39 | |
| 40 | bool main_move = false; |
| 41 | if (isUserString("MainMove")) |
| 42 | { |
| 43 | setUserString("Scale", "1 1 0 0"); |
| 44 | main_move = true; |
| 45 | } |
| 46 | |
| 47 | if (getClientWidget() != nullptr) |
| 48 | { |
| 49 | if (main_move) |
| 50 | { |
| 51 | getClientWidget()->setUserString("Scale", "1 1 0 0"); |
| 52 | getClientWidget()->eventMouseButtonPressed += newDelegate(this, &Window::notifyMousePressed); |
| 53 | getClientWidget()->eventMouseButtonReleased += newDelegate(this, &Window::notifyMouseReleased); |
| 54 | getClientWidget()->eventMouseDrag += newDelegate(this, &Window::notifyMouseDrag); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | ///@wskin_child{Window, TextBox, Caption} Caption for window. |
| 59 | assignWidget(mWidgetCaption, "Caption"); |
| 60 | if (mWidgetCaption != nullptr) |
| 61 | { |
| 62 | mWidgetCaption->setUserString("Scale", "1 1 0 0"); |
| 63 | mWidgetCaption->eventMouseButtonPressed += newDelegate(this, &Window::notifyMousePressed); |
| 64 | mWidgetCaption->eventMouseButtonReleased += newDelegate(this, &Window::notifyMouseReleased); |
| 65 | mWidgetCaption->eventMouseDrag += newDelegate(this, &Window::notifyMouseDrag); |
| 66 | } |
| 67 | |
| 68 | VectorWidgetPtr buttons = getSkinWidgetsByName("Button"); |
| 69 | for (auto& button : buttons) |
| 70 | { |
| 71 | button->eventMouseButtonClick += newDelegate(this, &Window::notifyPressedButtonEvent); |
| 72 | } |
| 73 | |
| 74 | VectorWidgetPtr actions = getSkinWidgetsByName("Action"); |
| 75 | for (auto& action : actions) |
| 76 | { |
| 77 | action->eventMouseButtonPressed += newDelegate(this, &Window::notifyMousePressed); |
| 78 | action->eventMouseButtonReleased += newDelegate(this, &Window::notifyMouseReleased); |
| 79 | action->eventMouseDrag += newDelegate(this, &Window::notifyMouseDrag); |
| 80 | action->eventMouseWheel += newDelegate(this, &Window::notifyMouseWheel); |
| 81 | } |
| 82 | |
| 83 | constexpr size_t countNames = 8; |
nothing calls this directly
no test coverage detected