Browse Source

changed select behaviour - left-click replaces selection with individual device, right click always pulls up menu(as opposed to ctrl-right click), and shift works as modifier as well as ctrl for both drag and individual select

master
aj_genius 21 years ago
parent
commit
3352a2e76c
2 changed files with 21 additions and 13 deletions
  1. +2
    -2
      GUI/Widgets/Fl_Canvas.C
  2. +19
    -11
      GUI/Widgets/Fl_Canvas.h

+ 2
- 2
GUI/Widgets/Fl_Canvas.C View File

@@ -603,7 +603,7 @@ int Fl_Canvas::handle(int event)
m_HaveSelection = false;
}

if ((Fl::event_state() & FL_CTRL) != 0)
if (((Fl::event_state() & FL_CTRL) != 0) || ((Fl::event_state() & FL_SHIFT) != 0))
{
m_Selecting = true;
m_StartSelectX=Fl::event_x();
@@ -700,7 +700,7 @@ int Fl_Canvas::handle(int event)
}
}

if ((Fl::event_button()==3) && (event==FL_PUSH) && ((Fl::event_state() & FL_CTRL) != 0))
if ((Fl::event_button()==3) && (event==FL_PUSH))
{
PopupEditMenu(this);
}


+ 19
- 11
GUI/Widgets/Fl_Canvas.h View File

@@ -204,27 +204,35 @@ private:
PopupEditMenu(widget->parent());
}
if ((widget) && (button==1) && ((shift_state & FL_CTRL) != 0))
{
if ((widget) && (button==1))
{
int ID = ((Fl_DeviceGUI*)(widget->parent()))->GetID();
std::vector<int>::iterator device_iter = std::find(m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), ID);

if (m_HaveSelection)
{
if (device_iter != m_Selection.m_DeviceIds.end())
m_Selection.m_DeviceIds.erase(device_iter);
if (((shift_state & FL_SHIFT) != 0) || ((shift_state & FL_CTRL) != 0))
{
if (m_HaveSelection)
{
if (device_iter != m_Selection.m_DeviceIds.end())
m_Selection.m_DeviceIds.erase(device_iter);
else
m_Selection.m_DeviceIds.push_back(ID);
}
else
m_Selection.m_DeviceIds.push_back(ID);
}
{
m_Selection.Clear();
m_HaveSelection = true;
m_Selection.m_DeviceIds.push_back(ID);
}
}
else
{
m_Selection.Clear();
m_HaveSelection = true;
m_Selection.m_DeviceIds.push_back(ID);
}
redraw();
}
redraw();
}
}

inline void cb_DeleteDeviceGroup_i();


Loading…
Cancel
Save