Logo Search packages:      
Sourcecode: patchage version File versions  Download package

bool PatchBay::PatchBayArea::port_event ( GdkEvent *  event,
Port port 
) [virtual]

m_invisible_cursor

Definition at line 355 of file PatchBayArea.cpp.

References PatchBay::Port::hilite(), PatchBay::Port::popup_menu(), and ports_joined().

{
      static bool port_dragging = false;
      bool handled = true;
      
      switch (event->type) {
      
      case GDK_BUTTON_PRESS:
            if (event->button.button == 1) {
                  port_dragging = true;
            } else if (event->button.button == 3) {
                  m_active_port = port;
                  port->popup_menu(event->button.button, event->button.time);
            } else {
                  handled = false;
            }
            break;

      case GDK_BUTTON_RELEASE:
            if (port_dragging) {
                  if (m_clicked_port == NULL) {
                        active_port(port);
                        m_clicked_port = port;
                  } else {
                        ports_joined(port, m_clicked_port);
                        m_clicked_port = NULL;
                        active_port(NULL);
                  }
                  port_dragging = false;
            } else {
                  handled = false;
            }
            break;

      case GDK_ENTER_NOTIFY:
            if (port != m_active_port)
                  port->hilite(true);
            break;

      case GDK_LEAVE_NOTIFY:
            if (port_dragging) {
                  m_connection_dragging = true;
                  m_clicked_port = port;
                  
                  assert(m_drag_connection == NULL);
                  
                  m_base_rect.grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
                        /**m_invisible_cursor*/Gdk::Cursor(Gdk::TOP_TEE), event->button.time);

                  port_dragging = false;
            } else {
                  if (port != m_active_port)
                        port->hilite(false);
            }
            break;

      default:
            handled = false;
      }
      
      return handled;
}


Generated by  Doxygen 1.6.0   Back to index