Exemplo n.º 1
0
void frmMain::OnPropRightClick(wxListEvent &event)
{
	OnPropSelChanged(event);

	if (currentObject)
		doPopup(properties, event.GetPoint(), currentObject);
}
Exemplo n.º 2
0
////////////////////////////////////////////////////////////////////////////////
// This handler will display a popup menu for the item at the mouse position
////////////////////////////////////////////////////////////////////////////////
void frmMain::OnSelRightClick(wxTreeEvent& event)
{
    wxTreeItemId item = event.GetItem();
    if (item != browser->GetSelection())
    {
        browser->SelectItem(item);
        currentObject = browser->GetObject(item);
    }

    if (currentObject)
        doPopup(browser, event.GetPoint(), currentObject);
}
Exemplo n.º 3
0
/**
 * Отправка приглашения поиграть выбранному джиду
 */
void GameSessions::sendInvite(const int account, const QString &full_jid, const QString &element)
{
    QString new_id = newId(true);
    if (!regGameSession(StatusInviteSend, account, full_jid, new_id, element)) {
        emit doPopup(getLastError());
        return;
    }
    emit sendStanza(account, QString("<iq type=\"set\" to=\"%1\" id=\"%2\"><create xmlns=\"games:board\" id=\"%3\" type=\"%4\" color=\"%5\"></create></iq>")
            .arg(XML::escapeString(full_jid))
            .arg(new_id)
            .arg(constProtoId)
            .arg(constProtoType)
            .arg(element));
}
Exemplo n.º 4
0
void FixHeaderView::mousePressEvent(QMouseEvent *me)
{
  QModelIndex index;
  if (me->button() == Qt::RightButton) {
    index = indexAt(me->pos());
    int logicalIndex = logicalIndexAt(me->pos());
    if (logicalIndex >  0) { // want double click for column 0
                               // as it toggles filter

      me->accept();
      emit doPopup(logicalIndex,me->globalPos());
    }
  }
  else
    QHeaderView::mousePressEvent(me);
}
Exemplo n.º 5
0
////////////////////////////////////////////////////////////////////////////////
// This handler will display a popup menu for the item at the mouse position
////////////////////////////////////////////////////////////////////////////////
void frmMain::OnSelRightClick(wxTreeEvent &event)
{
	wxTreeItemId item = event.GetItem();
	if (item != browser->GetSelection())
	{
		browser->SelectItem(item);

		// Prevent changes to "currentObject" by "execSelchange" function by another
		// thread. Will hold the lock until we have the actual object in hand.
		s_currentObjectMutex.Lock();
		currentObject = browser->GetObject(item);
		s_currentObjectMutex.Unlock();
	}

	if (currentObject)
		doPopup(browser, event.GetPoint(), currentObject);
}
Exemplo n.º 6
0
////////////////////////////////////////////////////////////////////////////////
// This handler will display a popup menu for the currently selected item
////////////////////////////////////////////////////////////////////////////////
void frmMain::OnContextMenu(wxCommandEvent &event)
{
	wxPoint point;

	if (FindFocus() == browser)
	{
		wxRect rect;
		wxTreeItemId item = browser->GetSelection();

		browser->GetBoundingRect(item, rect);
		point = rect.GetPosition();
		wxPoint origin = GetClientAreaOrigin();

		// Because this Tree is inside a vertical splitter, we
		// must compensate for the size of the other elements
		point.x += origin.x;
		point.y += origin.y;

		doPopup(this, point, browser->GetObject(item));
	}

}
Exemplo n.º 7
0
void TodoView::doMouseEvent(QMouseEvent *e)
{
  editor->hide();
  priList->hide();
  editingFlag = FALSE;
  int c, r;

  c = findCol(e->x());
  if (count()==0) 
      r=-1;
  else
      r = findRow(e->y());
  // BL: workaround a bug in KTabListBox -- no !!!
  
  if (e->button() == RightButton)
    doPopup(r,c);
  else {
    //if ((y >= 0) && (x >= 0))
    // updateItem(y,x);
    ;
  }
}
Exemplo n.º 8
0
void BoxContainerItem::mouseButtonPressed(Qt::ButtonState state)
{
    int button;
    if(state & Qt::LeftButton)
        button = 0;
    else if(state & Qt::RightButton)
        button = 2;
    else if(state & Qt::MidButton)
        button = 1;
    else
        return; //Invalid mouse button

    if(_recheckSettings[ button ])
        doRecheck();
    if(_resetSettings[ button ])
        doReset();
    if(_viewSettings[ button ])
        doView();
    if(_runSettings[ button ])
        runCommand();
    if(_popupSettings[ button ])
        doPopup();
}
Exemplo n.º 9
0
ImportScreen::ImportScreen(const CompanyDefn& company)
    : QMainWindow(0, "ImportScreen", WType_TopLevel | WDestructiveClose)
{
    _import = new DataImport(company, this);
    connect(_import, SIGNAL(message(int,QString,QString)),
	    SLOT(slotMessage(int,QString,QString)));

    QFrame* frame = new QFrame(this);
    QFrame* file = new QFrame(frame);

    QLabel* fileLabel = new QLabel(tr("Import File:"), file);
    _filePath = new LineEdit(file);
    _filePath->addPopup(Key_F9, tr("browse"));
    fileLabel->setBuddy(_filePath);
    connect(_filePath, SIGNAL(doPopup(QKeySequence)), SLOT(slotOpenFile()));

    QPushButton* browse = new QPushButton("...", file);
    browse->setFocusPolicy(ClickFocus);
    connect(browse, SIGNAL(clicked()), SLOT(slotOpenFile()));

    QGridLayout* fileGrid = new QGridLayout(file);
    fileGrid->setMargin(6);
    fileGrid->setSpacing(6);
    fileGrid->setColStretch(1, 1);
    fileGrid->addWidget(fileLabel, 0, 0);
    fileGrid->addWidget(_filePath, 0, 1);
    fileGrid->addWidget(browse, 0, 2);

    // TODO: add data types

    _log = new ListView(frame);
    _log->addNumberColumn(tr("Count"), 8);
    _log->addTextColumn(tr("Severity"), 12);
    _log->addTextColumn(tr("Data Type"), 16);
    _log->addTextColumn(tr("Data Name"), 20);
    _log->addTextColumn(tr("Message"), 30);
    _log->setAllColumnsShowFocus(true);
    _log->setShowSortIndicator(true);

    QFrame* buttons = new QFrame(frame);
    QPushButton* import = new QPushButton(tr("&Import"), buttons);
    QPushButton* close = new QPushButton(tr("&Close"), buttons);

    connect(import, SIGNAL(clicked()), SLOT(slotImport()));
    connect(close, SIGNAL(clicked()), SLOT(close()));

    QGridLayout* buttonGrid = new QGridLayout(buttons);
    buttonGrid->setSpacing(6);
    buttonGrid->setMargin(6);
    buttonGrid->setColStretch(0, 1);
    buttonGrid->addWidget(import, 0, 1);
    buttonGrid->addWidget(close, 0, 2);

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(6);
    grid->setMargin(6);
    grid->setRowStretch(1, 1);
    grid->addWidget(file, 0, 0);
    grid->addWidget(_log, 1, 0);
    grid->addWidget(buttons, 2, 0);

    _filePath->setFocus();

    setCentralWidget(frame);
    setCaption(tr("Data Import: " + company.name()));
}
Exemplo n.º 10
0
void BoxContainerItem::popup()
{
    doPopup();
}