| 13 | { |
| 14 | |
| 15 | WorkspaceControl::WorkspaceControl(MyGUI::Widget* _parent) : |
| 16 | TextureToolControlLE(_parent) |
| 17 | { |
| 18 | MyGUI::IntSize size = SettingsManager::getInstance().getValue<MyGUI::IntSize>("Settings/WorkspaceTextureSize"); |
| 19 | |
| 20 | setRttLayerSize(size); |
| 21 | |
| 22 | setTextureName(SettingsManager::getInstance().getValue("Workspace/TextureName")); |
| 23 | setTextureRegion(MyGUI::IntCoord(0, 0, size.width, size.height)); |
| 24 | |
| 25 | addSelectorControl(mAreaSelectorControl); |
| 26 | mAreaSelectorControl->eventChangePosition += MyGUI::newDelegate(this, &WorkspaceControl::notifyChangePosition); |
| 27 | |
| 28 | addSelectorControl(mPositionSelectorCreatorControl); |
| 29 | mPositionSelectorCreatorControl->setEnabled(false); |
| 30 | mPositionSelectorCreatorControl->setVisible(false); |
| 31 | |
| 32 | WidgetSelectorManager::getInstance().eventChangeSelectedWidget += |
| 33 | MyGUI::newDelegate(this, &WorkspaceControl::notifyChangeSelectedWidget); |
| 34 | notifyChangeSelectedWidget(nullptr); |
| 35 | |
| 36 | EditorWidgets::getInstance().eventChangeWidgetCoord += |
| 37 | MyGUI::newDelegate(this, &WorkspaceControl::notifyPropertyChangeCoord); |
| 38 | |
| 39 | CommandManager::getInstance().getEvent("Command_MoveLeft")->connect(this, &WorkspaceControl::Command_MoveLeft); |
| 40 | CommandManager::getInstance() |
| 41 | .getEvent("Command_MoveRight") |
| 42 | ->connect(this, &WorkspaceControl::Command_MoveRight); |
| 43 | CommandManager::getInstance().getEvent("Command_MoveTop")->connect(this, &WorkspaceControl::Command_MoveTop); |
| 44 | CommandManager::getInstance() |
| 45 | .getEvent("Command_MoveBottom") |
| 46 | ->connect(this, &WorkspaceControl::Command_MoveBottom); |
| 47 | CommandManager::getInstance().getEvent("Command_SizeLeft")->connect(this, &WorkspaceControl::Command_SizeLeft); |
| 48 | CommandManager::getInstance() |
| 49 | .getEvent("Command_SizeRight") |
| 50 | ->connect(this, &WorkspaceControl::Command_SizeRight); |
| 51 | CommandManager::getInstance().getEvent("Command_SizeTop")->connect(this, &WorkspaceControl::Command_SizeTop); |
| 52 | CommandManager::getInstance() |
| 53 | .getEvent("Command_SizeBottom") |
| 54 | ->connect(this, &WorkspaceControl::Command_SizeBottom); |
| 55 | |
| 56 | CommandManager::getInstance() |
| 57 | .getEvent("Command_GridMoveLeft") |
| 58 | ->connect(this, &WorkspaceControl::Command_GridMoveLeft); |
| 59 | CommandManager::getInstance() |
| 60 | .getEvent("Command_GridMoveRight") |
| 61 | ->connect(this, &WorkspaceControl::Command_GridMoveRight); |
| 62 | CommandManager::getInstance() |
| 63 | .getEvent("Command_GridMoveTop") |
| 64 | ->connect(this, &WorkspaceControl::Command_GridMoveTop); |
| 65 | CommandManager::getInstance() |
| 66 | .getEvent("Command_GridMoveBottom") |
| 67 | ->connect(this, &WorkspaceControl::Command_GridMoveBottom); |
| 68 | CommandManager::getInstance() |
| 69 | .getEvent("Command_GridSizeLeft") |
| 70 | ->connect(this, &WorkspaceControl::Command_GridSizeLeft); |
| 71 | CommandManager::getInstance() |
| 72 | .getEvent("Command_GridSizeRight") |
nothing calls this directly
no test coverage detected