29 lines
850 B
C++
29 lines
850 B
C++
#include "Globals.h"
|
|
#include "Instance.h"
|
|
#include "ModeSelectionListener.h"
|
|
#include "Application.h"
|
|
|
|
void ModeSelectionListener::onButton1MouseClick(BaseButtonInstance* button)
|
|
{
|
|
//CoordinateFrame frame = g_usableApp->g3dCamera.getCoordinateFrame();
|
|
int mode = g_usableApp->getMode();
|
|
|
|
std::vector<Instance*> instances_2D = g_dataModel->getGuiRoot()->getAllChildren();
|
|
for(size_t i = 0; i < instances_2D.size(); i++)
|
|
{
|
|
if(instances_2D.at(i)->name == "Cursor" || instances_2D.at(i)->name == "Resize" || instances_2D.at(i)->name == "Arrows")
|
|
{
|
|
BaseButtonInstance* button = (BaseButtonInstance*)instances_2D.at(i);
|
|
button->selected = false;
|
|
}
|
|
}
|
|
|
|
button->selected = true;
|
|
if(button->name == "Cursor")
|
|
mode = CURSOR;
|
|
else if(button->name == "Resize")
|
|
mode = RESIZE;
|
|
else if(button->name == "Arrows")
|
|
mode = ARROWS;
|
|
}
|