Example #1
0
bool ThemeChooser::keyPressEvent(QKeyEvent *event)
{
    if (GetFocusWidget()->keyPressEvent(event))
        return true;

    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("Theme Chooser", event, actions);

    for (int i = 0; i < actions.size() && !handled; ++i)
    {
        QString action = actions[i];
        handled = true;

        if (action == "MENU")
            showPopupMenu();
        else if (action == "DELETE")
            removeTheme();
        else if ((action == "ESCAPE") &&
                 (m_fullPreviewShowing))
        {
            toggleFullscreenPreview();
        }
        else
            handled = false;
    }

    if (!handled && MythScreenType::keyPressEvent(event))
        handled = true;

    return handled;
}
Example #2
0
void JucerTreeViewBase::itemClicked (const MouseEvent& e)
{
    if (e.mods.isPopupMenu())
    {
        if (getOwnerView()->getNumSelectedItems() > 1)
            showMultiSelectionPopupMenu();
        else
            showPopupMenu();
    }
}
void ComponentOverlayComponent::mouseDown (const MouseEvent& e)
{
    dragging = false;
    mouseDownSelectStatus = layout.getSelectedSet().addToSelectionOnMouseDown (target, e.mods);

    if (e.mods.isPopupMenu())
    {
        showPopupMenu();
        return; // this may be deleted now..
    }
}
Example #4
0
void BCMLabel::mouseDown(const MouseEvent& event)
{
    if (event.mods.isPopupMenu())
    {
        grabKeyboardFocus();
        showPopupMenu();
    }
    else
    {
        Label::mouseDown(event);
    }
}
Example #5
0
void CtrlrXYSurface::mouseDown (const MouseEvent& e)
{
    //[UserCode_mouseDown] -- Add your code here...
	if (e.mods.isPopupMenu())
	{
		showPopupMenu();
	}
	else if (e.eventComponent == this)
	{
		surfaceModulator->setCentrePosition (e.x, e.y);
		surfaceModulator->mouseDown (e);
		repaint();
	}
    //[/UserCode_mouseDown]
}
void PaintElement::mouseDown (const MouseEvent& e)
{
    dragging = false;

    if (owner != nullptr)
    {
        owner->getSelectedPoints().deselectAll();
        mouseDownSelectStatus = owner->getSelectedElements().addToSelectionOnMouseDown (this, e.mods);
    }

    if (e.mods.isPopupMenu())
    {
        showPopupMenu();
        return; // this may be deleted now..
    }
}
Example #7
0
void PathPointComponent::mouseDown (const MouseEvent& e)
{
    dragging = false;

    if (e.mods.isPopupMenu())
    {
        showPopupMenu();
        return; // this may be deleted now..
    }

    dragX = getX() + getWidth() / 2;
    dragY = getY() + getHeight() / 2;

    mouseDownSelectStatus = routine->getSelectedPoints().addToSelectionOnMouseDown (path->points [index], e.mods);

    owner->getDocument()->beginTransaction();
}
Example #8
0
TopLevel::TopLevel() /*FOLD00*/
  : KTMainWindow()
{
    KConfig *kc = kapp->getConfig();
    kc->setGroup("General");
    bPopupAtMouse = kc->readBoolEntry("PopupAtMousePosition", false);
  
    QSlast = "";
    pQPMmenu = new QPopupMenu(0x0, "main_menu");
    connect(pQPMmenu, SIGNAL(activated(int)),
            this, SLOT(clickedMenu(int)));

    pQPMsubMenu = new QPopupMenu(0x0, "sub_menu");
    connect(pQPMsubMenu, SIGNAL(activated(int)),
	    this, SLOT(clickedSubMenu(int)));
    pQPMsubMenu->setCheckable(true);
    pQPMsubMenu->insertItem(i18n("Shortcut..."), CONFIG_ITEM);
    pQPMsubMenu->insertItem(i18n("Popup at mouse position"), POPUP_ITEM);
    pQPMsubMenu->setItemChecked(POPUP_ITEM, bPopupAtMouse);
    pQPMsubMenu->insertSeparator();
    pQPMsubMenu->insertItem(i18n("Quit"), QUIT_ITEM);
    
    pQPMmenu->insertItem(i18n("Clipboard History"), pQPMsubMenu);
    pQPMmenu->insertSeparator();
    pQIDclipData = new QIntDict<QString>();
    pQIDclipData->setAutoDelete(TRUE);
    QSempty = i18n("<empty clipboard>");
    bClipEmpty = ((QString)kapp->clipboard()->text()).simplifyWhiteSpace().isEmpty();
    if(bClipEmpty)
        kapp->clipboard()->setText(QSempty);
    newClipData();
    pQTcheck = new QTimer(this, "timer");
    pQTcheck->start(1000, FALSE);
    connect(pQTcheck, SIGNAL(timeout()),
            this, SLOT(newClipData()));
    pQPpic = new QPixmap(mouse);

    globalKeys = new KGlobalAccel();
    globalKeys->insertItem(i18n("Select clipboard contents"),
				"select-clipboard", "CTRL+ALT+V");
    globalKeys->connectItem("select-clipboard", this, SLOT(showPopupMenu()));
    globalKeys->readSettings();
}
Example #9
0
void KonqSidebarHistoryModule::showPopupMenu()
{
    showPopupMenu( EntryContextMenu | ModuleContextMenu, QCursor::pos() );
}
Example #10
0
bool KonqSidebarHistoryModule::handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *,
                                                          const QPoint& pos )
{
    showPopupMenu( ModuleContextMenu, pos );
    return true;
}
Example #11
0
/**
 * Event delegation
 *
 * @param e The event to be identified and processed
 *
 */
bool SelectTool::processEvent(QEvent* e)
{
  KivioCanvas* canvas = view()->canvasWidget();
  QMouseEvent *m;

  switch (e->type())
  {
    case QEvent::MouseButtonDblClick:
      m = (QMouseEvent *)e;

      if( m->button() == LeftButton ) {
        leftDoubleClick(m->pos());
      }

      canvas->setFocus();
      return true;
      break;

    case QEvent::MouseButtonPress:
      m = (QMouseEvent *)e;

      if( m->button() == RightButton ) {
        showPopupMenu(m->globalPos());
      } else if( m->button() == LeftButton ) {
        if(m->state() & ControlButton) {
          m_controlKey = true;
        } else {
          m_controlKey = false;
        }

        mousePress( m->pos() );
      }

      canvas->setFocus();
      return true;
      break;

    case QEvent::MouseButtonRelease:
      mouseRelease( ((QMouseEvent *)e)->pos() );
      canvas->setFocus();
      return true;
      break;

    case QEvent::MouseMove:
      mouseMove( static_cast<QMouseEvent*>(e));
      return true;
      break;

    case QEvent::KeyPress:
      if((static_cast<QKeyEvent*>(e)->key() >= Key_Left) && (static_cast<QKeyEvent*>(e)->key() <= Key_Down)) {
        keyPress(static_cast<QKeyEvent*>(e));
        return true;
      }
      break;

    default:
      break;
  }

  return false;
}