Exemplo n.º 1
0
void ConnectionTool::mouseDoubleClickEvent(KoPointerEvent *event)
{
    if (m_editMode == EditConnectionPoint) {
        repaintDecorations();

        //quit EditConnectionPoint mode when double click blank region on canvas
        if (!m_currentShape) {
            resetEditMode();
            return;
        }

        //add connection point when double click a shape
        //remove connection point when double click a existed connection point
        int handleId = handleAtPoint(m_currentShape, event->point);
        if (handleId < 0) {
            QPointF mousePos = canvas()->snapGuide()->snap(event->point, event->modifiers());
            QPointF point = m_currentShape->documentToShape(mousePos);
            canvas()->addCommand(new AddConnectionPointCommand(m_currentShape, point));
        } else {
            canvas()->addCommand(new RemoveConnectionPointCommand(m_currentShape, handleId));
        }
        setEditMode(m_editMode, m_currentShape, -1);
    } else {
        //deactivate connection tool when double click blank region on canvas
        KoShape *hitShape = findShapeAtPosition(event->point);
        if (!hitShape) {
            deactivate();
            emit done();
        } else if (dynamic_cast<KoConnectionShape*>(hitShape)) {
            repaintDecorations();
            setEditMode(EditConnection, m_currentShape, -1);
            //TODO: temporarily activate text tool to edit connection path
        }
    }
}
Exemplo n.º 2
0
Allocations::Allocations(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Allocations)
{
    ui->setupUi(this);
    ui->dateEdit->setDateTime(QDateTime::currentDateTime());

    setEditMode(false);
    setAllocationId(0);
    setItemId(0);

    ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);

    items_model = 0;
    locations_model = 0;
    operators_model = 0;
    logger = 0;

    loadItems();
    loadLocations();
    loadOperators();

    ui->to_operator_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);
    ui->to_location_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);

    connect(ui->filter_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setItemsFilter(QString)));
}
void __fastcall TfrmRequestCompetitorsListEdit::bbtnEditClick(
      TObject *Sender)
{
    //-- Изменить выбранного пользователя
    //перейти в режим редактирования
    setEditMode();

    TCompetitor* edited = (TCompetitor*)(competitorsList->Items[strgrdCompetitorsList->Row - 1]);

    //Текущая персоналия
    dmCurrentState->setPerson(edited->getPerson()); 

    //Скопировать данные из таблицы в поля ввода
    lbledtSurname->Text = edited->getPerson().getSurname();
    lbledtName->Text = edited->getPerson().getName();
    lbledtPatronymic->Text = edited->getPerson().getPatronymic();
    dtpDOB->DateTime = edited->getPerson().getDob();
    chboxFemale->Checked = edited->getPerson().getFemale();
    medtWeight->Text = edited->getWeight();
    selectSkillById(edited->getSkill().getId());
    //Изменить значение возраста в поле его отображения
    dtpDOBChange(NULL);

    TList * fvids = edited->getFightVersion();
    //Пройтись по списку и расставить чекбоксы
    checkedFightVersion(fvids);
    destroyList(fvids, etFIGHTVERSION);
}
Exemplo n.º 4
0
/**
\param emp
\param parent
\return
**/
TrabajadorView::TrabajadorView ( BfCompany *emp, QWidget *parent )
        : BfForm ( emp, parent )
{
    BL_FUNC_DEBUG

    setTitleName ( _ ( "Trabajador" ) );
    setDbTableName ( "trabajador" );
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );
    mui_tab->setDisabled ( true );
    /// Disparamos los plugins.
    int res = g_plugins->run ( "TrabajadorView_TrabajadorView", this );
    if ( res != 0 ) {
        return;
    } // end if
    m_archivoimagen = "";
    setEditMode();
    m_cursortrabajadores = NULL;
    m_item = NULL;
    res = g_plugins->run ( "TrabajadorView_TrabajadorView_Post", this );
    if ( res != 0 ) {
        return;
    } // end if
    pintar();
    insertWindow ( windowTitle(), this, false );
    blScript(this);
    
}
Exemplo n.º 5
0
/**
\param comp
\param parent
\param selectMode
**/
TipoArticuloList::TipoArticuloList ( BfCompany *comp, QWidget *parent, bool selectMode )
        : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    setupUi ( this );
    m_listTipos->setColumnCount ( 3 );
    QStringList headers;
    headers << _ ( "Id" ) << _ ( "Codigo" ) << _ ( "Descripcion" );
    m_listTipos->setHeaderLabels ( headers );
    m_semaforoPintar = FALSE;
    m_idtipo = "";

    mui_codigotipo_articulo->setEnabled ( FALSE );
    mui_desctipo_articulo->setEnabled ( FALSE );
    if ( selectMode ) {
        setSelectMode();
        groupBox1->hide();
        mui_detalles->hide();
        mui_crear->hide();
        mui_guardar->hide();
        mui_borrar->hide();
        mui_cancelar->hide();
        mui_aceptar->hide();
    } else {
        setEditMode();
        setAttribute ( Qt::WA_DeleteOnClose );
        mainCompany()->insertWindow ( windowTitle(), this, FALSE );
    } // end if
    pintar();
    blScript(this);
    
}
Exemplo n.º 6
0
/**
\param emp
\param parent
**/
BancoView::BancoView ( BfCompany *emp, QWidget *parent )
        : BfForm ( emp, parent )
{
    BL_FUNC_DEBUG
    setTitleName ( _ ( "Banco" ) );
    /// Indicamos que vamos a operar con la tabla banco para que los permisos se traten adecuadamente.
    setDbTableName ( "banco" );
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );
    groupBox1->setDisabled ( true );
    setEditMode();
    m_cursorbancos = NULL;
    m_item = NULL;

    /// Disparamos los plugins.
    int res = g_plugins->run ( "BancoView_BancoView", this );
    if ( res != 0 ) {
        return;
    } // end if

    pintar();
    insertWindow ( windowTitle(), this );
    blScript(this);
    
}
Exemplo n.º 7
0
/**
\param emp
\param parent
**/
FPagoView::FPagoView ( BfCompany *emp, QWidget *parent )
        : BfForm ( emp, parent )
{
    BL_FUNC_DEBUG
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );
    groupBox1->setDisabled ( TRUE );
    setTitleName ( _ ( "Forma de Pago" ) );
    setDbTableName ( "forma_pago" );
    setEditMode();
    m_cursorFPagoView = NULL;
    m_item = NULL;

    /// Inicializamos el banco.
    mui_idbanco->setMainCompany ( emp );

    /// Disparamos los plugins.
    int res = g_plugins->run ( "FPagoView_FPagoView", this );
    if ( res != 0 ) {
        return;
    } // end if

    insertWindow ( windowTitle(), this );
    pintar();
    blScript(this);
    
}
VOID editItem(HWND hwnd) {
   CHAR buf[360];
   PSZ pModule;
   if (0 <= (iEditItem = getSelectedItemData(hwnd, buf, sizeof(buf), &pModule))) {
      setEditMode(hwnd, TRUE);
      DlgItemTextSet(hwnd, EF_CLASSNAME, buf);
      DlgItemTextSet(hwnd, EF_MODULENAME, pModule);
   } /* endif */
}
Exemplo n.º 9
0
void ConnectionTool::mouseReleaseEvent(KoPointerEvent *event)
{
    if (m_currentStrategy) {
        if (m_editMode == CreateConnection) {
            // check if connection handles have a minimal distance
            KoConnectionShape * connectionShape = dynamic_cast<KoConnectionShape*>(m_currentShape);
            Q_ASSERT(connectionShape);
            // get both handle positions in document coordinates
            QPointF p1 = connectionShape->shapeToDocument(connectionShape->handlePosition(0));
            QPointF p2 = connectionShape->shapeToDocument(connectionShape->handlePosition(1));
            int grabDistance = grabSensitivity();
            // use grabbing sensitivity as minimal distance threshold
            if (squareDistance(p1, p2) < grabDistance*grabDistance) {
                // minimal distance was not reached, so we have to undo the started work:
                // - cleanup and delete the strategy
                // - remove connection shape from shape manager and delete it
                // - reset edit mode to last state
                delete m_currentStrategy;
                m_currentStrategy = 0;
                repaintDecorations();
                canvas()->shapeManager()->remove(m_currentShape);
                setEditMode(m_editMode, connectionShape->firstShape(), connectionShape->firstConnectionId());
                repaintDecorations();
                delete connectionShape;
                return;
            } else {
                // finalize adding the new connection shape with an undo command
                KUndo2Command * cmd = canvas()->shapeController()->addShape(m_currentShape);
                canvas()->addCommand(cmd);
                setEditMode(EditConnection, m_currentShape, KoConnectionShape::StartHandle);
            }
        }
        m_currentStrategy->finishInteraction(event->modifiers());
        // TODO: Add parent command to KoInteractionStrategy::createCommand
        // so that we can have a single command to undo for the user
        KUndo2Command *command = m_currentStrategy->createCommand();
        if (command)
            canvas()->addCommand(command);
        delete m_currentStrategy;
        m_currentStrategy = 0;
    }
    updateStatusText();
}
Exemplo n.º 10
0
void CLineEdit::setCanEdit(bool p)
{
  if (p == _canEdit)
    return;

  if (!p)
    setEditMode(false);

  _canEdit=p;

  sUpdateMenu();
}
Exemplo n.º 11
0
/**
\param comp
\param parent
\param selectMode
**/
FamiliasView::FamiliasView ( BfCompany *comp, QWidget *parent, bool selectMode )
        : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    setupUi ( this );
    m_listFamilias->setColumnCount ( 3 );
    QStringList headers;
    headers << _ ( "Nombre" ) << _ ( "Codigo" ) << _ ( "Descripcion" ) << _ ( "Id familia" ) << _ ( "Codigo completo" );
    m_listFamilias->setHeaderLabels ( headers );

    m_listFamilias->setColumnWidth ( 0, 200 );
    m_listFamilias->setColumnWidth ( 1, 100 );

    m_listFamilias->setColumnHidden ( COL_IDFAMILIA, TRUE );
    m_listFamilias->setColumnHidden ( COL_CODFAMILIA, TRUE );
    m_listFamilias->setColumnHidden ( COL_PRODUCTOFISICOFAMILIA, TRUE );

    m_semaforoPintar = FALSE;

    m_idfamilia = "";

    mui_nomFamilia->setEnabled ( FALSE );
    mui_descFamilia->setEnabled ( FALSE );
    mui_codCompletoFamilia->setEnabled ( FALSE );
    mui_codFamilia->setEnabled ( FALSE );
    
    /// Disparamos los plugins.
    int res = g_plugins->run ( "FamiliasView_FamiliasView", this );
    if ( res != 0 ) {
	return;
    } // end if

    if ( selectMode ) {
        setSelectMode();
        mui_tab->hide();
//        mui_detalles->hide();
//        mui_crear->hide();
//        mui_guardar->hide();
        mui_borrar->hide();
        mui_cancelar->hide();
        mui_aceptar->hide();
        mui_imprimir->hide();
    } else {
        setEditMode();
        setAttribute ( Qt::WA_DeleteOnClose );
        mainCompany()->insertWindow ( windowTitle(), this, FALSE );
    } // end if

    pintar();
    blScript(this);
    
}
Exemplo n.º 12
0
void CLineEdit::setCanEdit(bool p)
{
  if (p == _canEdit)
    return;

  if (_x_metrics && _x_metrics->value("CRMAccountNumberGeneration") == "A")
    _canEdit = false;
  else
    _canEdit = p;

  if (! _canEdit) // need 'if' so we don't arbitrarily turn on edit mode
    setEditMode(false);
}
void ChatGuiCtrl::show( bool en )
{
    if ( en )
    {
        _p_wnd->show();
        // restore the mode
        setEditMode( _editMode );
    }
    else
    {
        //! TODO: centralize this task! other gui elements are also attached to main window.
        _p_wnd->hide();
    }
}
Exemplo n.º 14
0
void CustInfo::sNewClicked()
{
  setEditMode(true);
  setId(-1);
  if(((_x_metrics && 
       _x_metrics->value("CRMAccountNumberGeneration") == "A") ||
      (_x_metrics->value("CRMAccountNumberGeneration") == "O"))
   && _customerNumberEdit->text().isEmpty() )
  {
    XSqlQuery num;
    num.exec("SELECT fetchCRMAccountNumber() AS number;");
    if (num.first())
      _customerNumberEdit->setText(num.value("number").toString());
  }
}
Exemplo n.º 15
0
ImgEditWindow::ImgEditWindow(string winName, CvSize winSize) : UIWindow(winName, winSize) {

    m_vignetPt     = cvPoint(0, 0);
    m_bokehFirstPt = cvPoint(0, 0);
    m_bokehSecPt   = cvPoint(0, 0);

    needUpdateVignet = false;
    needUpdateBokeh  = false;


    setEditMode(VIGNET_EDIT);
    setEditModeText("Vignet Mode");

    m_rightClickCnt = 0;

}
Exemplo n.º 16
0
/**
\param comp
\param parent
\param selectMode
**/
PartidasView::PartidasView ( BfCompany *comp, QWidget *parent, bool selectMode )
        : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    setupUi ( this );
    m_listPartidas->setColumnCount ( 3 );
    QStringList headers;
    headers << _ ( "Nombre" ) << _ ( "Codigo" ) << _ ( "Descripcion" ) << _ ( "Id partida" ) << _ ( "Codigo completo" );
    m_listPartidas->setHeaderLabels ( headers );

    m_listPartidas->setColumnWidth ( 0, 200 );
    m_listPartidas->setColumnWidth ( 1, 100 );

    m_listPartidas->setColumnHidden ( COL_IDPARTIDA, true );
    m_listPartidas->setColumnHidden ( COL_CODIGOPARTIDA, true );

    m_semaforoPintar = false;

    m_idpartida = "";

    mui_nombrePartida->setEnabled ( false );
    mui_descPartida->setEnabled ( false );
    mui_codigoCompletoPartida->setEnabled ( false );
    mui_codigoPartida->setEnabled ( false );


    if ( selectMode ) {
        setSelectMode();
        groupBox1->hide();
        mui_detalles->hide();
        mui_crear->hide();
        mui_guardar->hide();
        mui_borrar->hide();
        mui_cancelar->hide();
        mui_aceptar->hide();
        mui_imprimir->hide();
    } else {
        setEditMode();
        setAttribute ( Qt::WA_DeleteOnClose );
        mainCompany()->insertWindow ( windowTitle(), this, false );
    } // end if

    pintar();
    blScript(this);
    
}
Exemplo n.º 17
0
// --------------------------------------------------------------------------------------------------------------------------------------
void CGpsGpsdWidget::on_tbApply_clicked()
{
    setEditMode(false);
    bool isconnected = m_src->isGpsConnected();
    if(isconnected)  m_src->disconnectGps();

    if(ui->cbAutoconnect->isChecked()       != m_src->autoConnect())     m_src->setAutoConnect    (ui->cbAutoconnect->isChecked()     );
    if(ui->pwColor->selectedColor()         != m_src->color())           m_src->setColor          (ui->pwColor->selectedColor()       );
    if(ui->leHost->text()                   != m_src->host())            m_src->setHost           (ui->leHost->text()                 );
    if(ui->lePort->text().toInt()           != m_src->port())            m_src->setPort           (ui->lePort->text().toInt()         );
    if(ui->leUpdatePeriod->text().toInt()   != m_src->updatePeriod())    m_src->setUpdatePeriod   (ui->leUpdatePeriod->text().toInt() );
    if(ui->pwIconSelect->icon().cacheKey()  != m_src->icon().cacheKey()) m_src->setIcon           (ui->pwIconSelect->icon()           );
    if(ui->leName->text()                   != m_src->name())            m_src->setName           (ui->leName->text()                 );

    if(isconnected) m_src->connectGps();
    fillValues();
}
Exemplo n.º 18
0
/*
 * Clear all the metadata widgets
 */
void MetaPanel::clear()
{
    title_text->clear();
    artist_text->clear();
    genre_text->clear();
    copyright_text->clear();
    collection_text->clear();
    seqnum_text->clear();
    description_text->clear();
    date_text->clear();
    language_text->clear();
    nowplaying_text->clear();
    publisher_text->clear();

    setEditMode( false );
    emit uriSet( "" );
}
Exemplo n.º 19
0
//--------------------------------------------------------------
void testApp::keyPressed(int key){
//    if(key <= 49+N_LAYER) { // Top row num key 1 = 49
//        editLayer = key-49;
//        ofLog() << "Set Layer to " << editLayer;
//    }
    
    switch(key) {
        case '`':
            setEditMode(!getEditMode()); break;
        case 'x':
            resetCurrent(); break;
        case 'd':
            debug = !debug; cam->toggleGui(debug); break;
        case 'z':
            saveEditted(); break;
        case 'q':
            if(debug) editPoly = 0; else editCanvas = 0; break;
        case 'w':
            if(debug) editPoly = 1; else editCanvas = 1; break;
        case 'e':
            if(debug) editPoly = 2; else editCanvas = 2; break;
        case 'r':
            if(debug) editPoly = 3; else editCanvas = 3; break;
//        case '[':
            //exportSettings(); break;
        case ']':
            reloadSettings(); ofClear(0); break;
        case 'c':
            cam->closePoints(editPoly); break;
        case 'C':
            cam->resetCircle(); break;
        case 'f':
            fullscreen = !fullscreen;
            ofSetFullscreen(fullscreen);
            break;
        case 'v':
            part->increaseUpper(); break;
        case 'b':
            part->decreaseUpper(); break;
        case 'n':
            part->increaseLower(); break;
        case 'm':
            part->decreaseLower(); break;
    }
}
Exemplo n.º 20
0
/**
\param emp
\param parent
**/
TiposocioView::TiposocioView ( BfCompany *emp, QWidget *parent )
        : BfForm ( emp, parent )
{
    BL_FUNC_DEBUG
    setTitleName ( _ ( "Tipos de socio" ) );
    /// Indicamos que vamos a operar con la tabla tiposocio para que los permisos se traten adecuadamente.
    setDbTableName ( "tiposocio" );
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );
    groupBox1->setDisabled ( true );
    setEditMode();
    m_cursortiposocio = NULL;
    m_item = NULL;
    pintar();
    insertWindow ( windowTitle(), this );
    blScript(this);
    
}
Exemplo n.º 21
0
tileset::tileset(dataconfigs *conf, int type, QWidget *parent, int baseSize, int rows, int cols, QGraphicsScene *scene) :
    QWidget(parent)
{
    mode = GFX_Staff;
    scn = scene;
    if(scene != nullptr)
    {
        if(QString(scn->metaObject()->className()) == "LvlScene") mode = GFX_Level;
        else if(QString(scn->metaObject()->className()) == "WldScene") mode = GFX_World;
    }

    setEditMode(true);
    m_baseSize = baseSize;
    m_rows = rows;
    m_cols = cols;
    m_conf = conf;
    m_type = type;
    updateSize();
}
Exemplo n.º 22
0
void CustInfo::setCanEdit(bool p)
{
  if (_canEdit == p)
    return;
    
  if (!p)
    _edit->setChecked(false);

  _canEdit=p;
    
  _info->setHidden(p);
  _edit->setVisible(p);
  _new->setVisible(p);
  if (!p)
  {
    _delete->setVisible(false);
    setEditMode(false);
  }
}
Exemplo n.º 23
0
/*
 * Clear all the metadata widgets
 */
void MetaPanel::clear()
{
    title_text->clear();
    artist_text->clear();
    genre_text->clear();
    copyright_text->clear();
    collection_text->clear();
    seqnum_text->clear();
    seqtot_text->clear();
    description_text->clear();
    date_text->clear();
    language_text->clear();
    nowplaying_text->clear();
    publisher_text->clear();
    encodedby_text->clear();
    art_cover->clear();
    fingerprintButton->setVisible( false );

    setEditMode( false );
    emit uriSet( "" );
}
Exemplo n.º 24
0
SCgScene::SCgScene(QUndoStack *undoStack, QObject *parent) :
    QGraphicsScene(parent),
    mMode(0),
    mUndoStack(undoStack),
    mIsGridDrawn(false),
    mIsIdtfModelDirty(true),
    mCursor(0,0)
{
    mSceneModes.fill(0,(int)Mode_Count);

    mSceneModes[Mode_Bus] = new SCgBusMode(this);
    mSceneModes[Mode_Pair] = new SCgPairMode(this);
    mSceneModes[Mode_Contour] = new SCgContourMode(this);
    mSceneModes[Mode_Select] = new SCgSelectMode(this);
    mSceneModes[Mode_InsertTemplate] = new SCgInsertMode(this);
    mSceneModes[Mode_Clone] = new SCgCloneMode(this);

    setEditMode(Mode_Select);
    // grid foreground
    //setBackgroundBrush(QBrush(QColor(204, 255, 204, 164), Qt::CrossPattern));
    //    connect(this, SIGNAL(selectionChanged()), this, SLOT(ensureSelectedItemVisible()));
}
Exemplo n.º 25
0
void MTable::endEdit( int row, int col, bool accept, bool replace )
{
    QWidget *editor = cellWidget( row, col );
    if ( !editor ) return;
    if (!editor->inherits("QComboBox")){
         QTable::endEdit( row, col, accept, replace );
         zap(editor);
         //if (editor) delete editor;// <== this seems neccessary to return control to the Table
         return;
    }
    else{
             setCellContentFromEditor( row, col );
              if ( row == currEditRow() && col == currEditCol() )
	     setEditMode( NotEditing, -1, -1 );
              viewport()->setFocus();
              updateCell( row, col );
              clearCellWidget( row, col );
              zap (editor);
              //if (editor) delete editor;// <== this seems neccessary to return control to the Table
               emit valueChanged( row, col );
    }
}
Exemplo n.º 26
0
void CLineEdit::setCanEdit(bool p)
{
  if (p == _canEdit || !_x_metrics)
    return;

  if (p)
  {
    if (_x_privileges && _subtype == CRMAcctLineEdit::Cust)
      _canEdit = _x_privileges->check("MaintainCustomerMasters");
    else if (_x_privileges && _subtype == CRMAcctLineEdit::Prospect)
      _canEdit = _x_privileges->check("MaintainProspectMasters");
    else if (_x_privileges)
      _canEdit = _x_privileges->check("MaintainCustomerMasters") ||
                 _x_privileges->check("MaintainProspectMasters");
  }
  else
    _canEdit=p;

if (!_canEdit)
  setEditMode(false);

  sUpdateMenu();
}
Exemplo n.º 27
0
/*
 * Clear all the metadata widgets
 */
void MetaPanel::clear()
{
    title_text->clear();
    artist_text->clear();
    genre_text->clear();
    copyright_text->clear();
    collection_text->clear();
    seqnum_text->clear();
    seqtot_text->clear();
    disconnect( description_text, SIGNAL(textChanged()), this,
                SLOT(enterEditMode()) );
    description_text->clear();
    CONNECT( description_text, textChanged(), this, enterEditMode() );
    date_text->clear();
    language_text->clear();
    nowplaying_text->clear();
    publisher_text->clear();
    encodedby_text->clear();
    art_cover->clear();
    fingerprintButton->setVisible( false );

    setEditMode( false );
    emit uriSet( "" );
}
Exemplo n.º 28
0
void MetaPanel::enterEditMode()
{
    setEditMode( true );
}
Exemplo n.º 29
0
void EditableLabel::mouseDoubleClickEvent ( QMouseEvent *  ) {
	setEditMode();
}
Exemplo n.º 30
0
void MetaPanel::fingerprintUpdate( input_item_t *p_item )
{
    update( p_item );
    setEditMode( true );
}