コード例 #1
0
ファイル: grafo.cpp プロジェクト: cosa65/3aalgo3
int Grafo::valor_de_pintar(int v1, int color){//
  assert(existe_vertice(v1));
  int colOrig = dame_color(v1);
  int conf = conflictos(v1);
  pintar(v1,  color);
  int res = conf - conflictos(v1);
  pintar(v1,colOrig);
  return res;
}
コード例 #2
0
int main() {

    int n;
    char x[]="\033[1;37m.\033[1;32m", O[]="▓"; // ▆ ▇ ▉ ⬣ ◼ ▉

    printf("Alfombra de Sierpinski \n");

    printf("ingrese el nivel (minimo 1, maximo 3):\n");
    scanf("%d",&n);

    printf ("\033[1J"); //BORRA LA TERMINAL
    //printf ("\033[47m"); //color de fondo blanco
    printf ("\033[1;32m");
    pintar(I,I,F,x);


    for (int k = 0; k < n; k++) {

        int i = 0;
        int ni=cn;
        while (i < ni) {

            /*printf ("\033[%d;%dH",cn,60);
            printf("%d .- primer punto %d\n",cn,puntos[i]);
            printf ("\033[%d;%dH",cn,80);
            printf("segundo punto %d\n", puntos[i+1]);*/
            dividir(puntos[i],puntos[i+1]);

            i+=1;
        }

        ni++;


        for (int i = ni; i < cn; i+=2) {
            for (int j = ni; j <= cn; j+=2) {
                pintar(puntos[i],puntos[j],puntos[j+1],O);
            }
        }

        sort(puntos);

        /*if (k==n-1){
        for (int j = 0; j <= cn; j++){
        	printf ("\033[%d;%dH",j+1,100);
        	printf("punto fulano::: %d\n", puntos[j]);;
        }
        }*/

    }

    printf ("\033[1;37m");
    printf ("\033[%d;%dH",F+2,1);

    //system("pause");
    return 0;
}
コード例 #3
0
int main(int argc, char *argv[]) {

    FILE *fichero;
    char sopa[NMAX][NMAX];
    int opcion;
    char nombre_de_fichero[0x20];
    srand(time(NULL));
    int sopa_cargada = 0; // 0 equivale a falso, cualquier cosa != 0 es verdadero

    do {
        switch(opcion = leer_menu()) {
        case crear:
            cabecera("Nueva Sopa");
            rellenar(sopa);
            sopa_cargada = 1;
            pintar(sopa);
            break;
        case abrir:
            imprimir_directorio("./");
            printf("Elige un fichero sopa: ");
            scanf(" %s", nombre_de_fichero);
            fichero = fopen(nombre_de_fichero, "r");
            leer(fichero, sopa);
            sopa_cargada = 1;
            fclose(fichero);
            break;
        case ver:
            if (sopa_cargada) {
                cabecera("Sopa Activa");
                pintar(sopa);
            } else
                inform("De momento no hay ninguna sopa cargada.");
            break;
        case guardar:
            if (sopa_cargada) {
                imprimir_directorio("./");
                printf("Elige un nombre para guardar la sopa: ");
                scanf(" %s", nombre_de_fichero);
                fichero = fopen(nombre_de_fichero, "w");
                escribir(fichero, sopa);
                fclose(fichero);
                inform("Fichero Guardado.");
            } else
                inform("De momento no hay ninguna sopa cargada.");
            break;
        }
    } while(opcion != salir);

    return EXIT_SUCCESS;
}
コード例 #4
0
void MainWindow::on_actionCargarSopa_triggered()
{
    QString pathSopa = QFileDialog::getOpenFileName(this,"Open a Text File",":/","*.txt");

    this->logical = new SoupResolver(&this->dictio,this);

    connect(this->logical,SIGNAL(pintar(QList<QPoint>)),this,SLOT(pintar(QList<QPoint>)));

    if(!pathSopa.isEmpty() && this->logical!=0)
    {
        this->logical->loadSoup(pathSopa);
        this->loadSoup();
    }
}
コード例 #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);
    
}
コード例 #6
0
ファイル: reciboview.cpp プロジェクト: JustDevZero/bulmages
/** inicializa todos los componentes de la clase.
    Resetea el sistema de control de cambios para que considere que no hay cambios por parte del usuario.
    Mete la ventana en el workSpace.
*/
ReciboView::ReciboView ( BfCompany *comp, QWidget *parent ) : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG

    setAttribute ( Qt::WA_DeleteOnClose );

    try {
        setupUi ( this );
        blCenterOnScreen ( this );

        setTitleName ( _ ( "Recibo" ) );
        setDbTableName ( "recibo" );
        setDbFieldId ( "idrecibo" );
        addDbField ( "idrecibo", BlDbField::DbInt, BlDbField::DbPrimaryKey, _ ( "ID recibo" ) );
        addDbField ( "cantrecibo", BlDbField::DbNumeric, BlDbField::DbNothing, _ ( "Cantidad" ) );
        addDbField ( "idcliente", BlDbField::DbInt, BlDbField::DbNotNull, _ ( "ID cliente" ) );
        addDbField ( "idforma_pago", BlDbField::DbInt, BlDbField::DbNotNull, _ ( "ID Forma Pago" ) );
        addDbField ( "descrecibo", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Descripcion" ) );
        addDbField ( "fecharecibo", BlDbField::DbDate, BlDbField::DbNothing, _ ( "Fecha de creacion" ) );
        addDbField ( "pagadorecibo", BlDbField::DbBoolean, BlDbField::DbNothing, _ ( "Pagado" ) );
        addDbField ( "devueltorecibo", BlDbField::DbBoolean, BlDbField::DbNothing, _ ( "Devuelto" ) );

        insertWindow ( windowTitle(), this, false );

        mui_idforma_pago->setMainCompany ( comp );

        /// Establecemos los parametros de busqueda de Profesor
        mui_idcliente->setMainCompany ( comp );
        mui_idcliente->setLabel ( _ ( "Tutor/Socio:" ) );
        mui_idcliente->setTableName ( "cliente" );
	mui_idcliente->setFieldId( "idcliente" );
	mui_idcliente->m_valores["cifcliente"] = "";
        mui_idcliente->m_valores["nomcliente"] = "";
	mui_idcliente->m_valores["apellido1cliente"] = "";
	mui_idcliente->m_valores["apellido2cliente"] = "";
	mui_idcliente->setMask("[cifcliente] .- [apellido1cliente] [apellido2cliente], [nomcliente]");

        /// Activamos el listado de lineas de recibo
        mui_list->setMainCompany( comp );
        mui_list->setDbTableName ( "lrecibo" );
        mui_list->setDbFieldId ( "idlrecibo" );
        mui_list->addSubFormHeader ( "idlrecibo", BlDbField::DbInt, BlDbField::DbPrimaryKey , BlSubFormHeader::DbHideView, _ ( "Identificador" ) );
        mui_list->addSubFormHeader ( "idrecibo", BlDbField::DbInt, BlDbField::DbNothing , BlSubFormHeader::DbHideView, _ ( "ID recibo" ) );
        mui_list->addSubFormHeader ( "cantlrecibo", BlDbField::DbNumeric, BlDbField::DbNotNull, BlSubFormHeader::DbNone, _ ( "Cantidad Linea Recibo" ) );
        mui_list->addSubFormHeader ( "conceptolrecibo", BlDbField::DbVarChar, BlDbField::DbNotNull, BlSubFormHeader::DbNone, _ ( "Concepto" ) );

        mui_list->setInsert ( true );
        mui_list->setOrdenEnabled ( true );

        mui_list->load("SELECT * from lrecibo WHERE 1=2");

        pintar();
        dialogChanges_readValues();
	blScript(this);
    } catch ( ... ) {
        blMsgInfo ( _ ( "Error al crear el recibo" ), this );
    } // end try

    
}
コード例 #7
0
ファイル: devolucion.cpp プロジェクト: JustDevZero/bulmages
void Devolucion::on_mui_browser_anchorClicked ( const QUrl &anchor )
{
    if ( anchor.queryItemValue ( "op" ) == "minus" ) {

        if ( m_ticket->dbValue ( "idalbaran" ).isEmpty() ) return;
        int sizein = m_ticket->listaLineas()->size();
        for ( int i = 0; i < sizein; ++i ) {
            BlDbRecord *item = m_ticket->listaLineas() ->at ( i );
            if ( item->dbValue ( "numlalbaran" ) == anchor.queryItemValue ( "numlalbaran" ) ) {
                BlDbRecord *nitem = m_ticket->agregarLinea();
                QList<BlDbField *> *lista = item->lista();
                for ( int j = 0; j < lista->size(); ++j ) {
                    BlDbField * camp = lista->at ( j );
                    if ( camp->fieldName() != "numlalbaran" ) {
                        nitem->setDbValue ( camp->fieldName(), camp->fieldValue() );
                    } // end if
                    if ( camp->fieldName() == "cantlalbaran" && camp->fieldValue().toFloat() > 0 ) {
                        nitem->setDbValue ( camp->fieldName(), "-1" );
                    }// end if
                } // end if
            } // end for
        }// end for

    } // end if

    pintar();
}
コード例 #8
0
ファイル: bancoview.cpp プロジェクト: JustDevZero/bulmages
/**
\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);
    
}
コード例 #9
0
RutaComercialView::RutaComercialView ( QWidget *parent )
        : BfForm ( ((BfBulmaFact *) g_main)->company(), parent )
{
    BL_FUNC_DEBUG
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );

    setTitleName ( _ ( "Ruta comercial" ) );
    setDbTableName ( "rutacomercial" );
    setDbFieldId ( "idrutacomercial" );
    addDbField ( "idrutacomercial", BlDbField::DbInt, BlDbField::DbPrimaryKey, _ ( "Identificador" ) );
    addDbField ( "fecharutacomercial", BlDbField::DbDate, BlDbField::DbNotNull, _ ( "Fecha" ) );
    addDbField ( "idcliente", BlDbField::DbInt, BlDbField::DbNotNull, _ ( "Familia" ) );
    addDbField ( "comentariosrutacomercial", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Comentarios" ) );
    addDbField ( "horarutacomercial", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Hora" ) );
    addDbField ( "refrutacomercial",  BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Referencia" ) );

    
    /// Establecemos los parametros de busqueda del Cliente
    mui_idcliente->setMainCompany ( ((BfBulmaFact *) g_main)->company() );
    mui_idcliente->setLabel ( _ ( "Cliente:" ) );
    mui_idcliente->setTableName ( "cliente" );
    mui_idcliente->m_valores["cifcliente"] = "";
    mui_idcliente->m_valores["nomcliente"] = "";

    pintar();
    dialogChanges_readValues();
    blScript(this);
    
}
コード例 #10
0
/** inicializa todos los componentes de la clase.
    Resetea el sistema de control de cambios para que considere que no hay cambios por parte del usuario.
    Mete la ventana en el workSpace.
*/
ConvocatoriaView::ConvocatoriaView ( BfCompany *comp, QWidget *parent )
        : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    setAttribute ( Qt::WA_DeleteOnClose );
    try {
        setupUi ( this );
        blCenterOnScreen ( this );

        setTitleName ( _ ( "Convocatoria" ) );
        setDbTableName ( "actividad" );
        setDbFieldId ( "idactividad" );
        addDbField ( "idactividad", BlDbField::DbInt, BlDbField::DbPrimaryKey, _ ( "ID actividad" ) );
        addDbField ( "nombreactividad", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Nombre del actividad" ) );
        addDbField ( "idprofesor", BlDbField::DbInt, BlDbField::DbNotNull, _ ( "Id profesor" ) );

        insertWindow ( windowTitle(), this, false );

        /// Establecemos los parametros de busqueda de Profesor
        mui_idprofesor->setMainCompany ( comp );
        mui_idprofesor->setLabel ( _ ( "Profesor:" ) );
        mui_idprofesor->setTableName ( "profesor" );
        mui_idprofesor->m_valores["nombreprofesor"] = "";


        pintar();
        dialogChanges_readValues();
	blScript(this);
    } catch ( ... ) {
        blMsgInfo ( _ ( "Error al crear el actividad" ), this );
    } // end try
    
}
コード例 #11
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);
    
}
コード例 #12
0
ファイル: fpagoview.cpp プロジェクト: trifolio6/Bulmages
/**
\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);
    
}
コード例 #13
0
ファイル: tank.cpp プロジェクト: AlbertoLastres/c-programs
int main(int argc, char *argv[]){

    struct TMovil proyectil = {
       {10, 0},
       {0, 0},
       {0, -10}
    };

    /* Preguntar la velocidad inicialmente */
   printf("Velocidad Inicial (vx,vy): ");
   scanf(" %lf,%lf", 
         &proyectil.velocidad.x, 
         &proyectil.velocidad.y);

   initscr();
   clear();

   /* Cada segundo saber lo que ha variado la velocidad y la posicion */
   while(proyectil.posicion.y >= 0){
       pintar(proyectil);

       proyectil.velocidad.x += proyectil.aceleracion.x * DELTA_T;
       proyectil.velocidad.y += proyectil.aceleracion.y * DELTA_T;
       proyectil.posicion.x  += proyectil.velocidad.x   * DELTA_T;
       proyectil.posicion.y  += proyectil.velocidad.y   * DELTA_T;
   }

   getch();
   endwin();

    return EXIT_SUCCESS;
}
コード例 #14
0
ファイル: TablaModelR.cpp プロジェクト: Teide2/teide2
 QVariant TablaModelR::data(const QModelIndex &index, int role) const
 {
   if (!index.isValid())
     return QVariant();
   if (role == Qt::TextAlignmentRole)
     return int(Qt::AlignCenter);
   if (role == Qt::DisplayRole)
     return distances[index.row()][index.column()];
   if (role == Qt::BackgroundRole) {
     if ((index.row() == 0) || (index.column() == 0))
       return QColor(Qt::green);
     if (Todos)
       return QColor(pintar(index.row()-1, index.column()-1, index));
     else
       return QColor(pintar(VectorPosReg[index.row()]-1, index.column()-1, index));
   }
   return QVariant();
 }
コード例 #15
0
ファイル: pagoview.cpp プロジェクト: JustDevZero/bulmages
/**
\param comp
\param parent
**/
PagoView::PagoView ( BfCompany *comp, QWidget *parent )
        :  BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    try {
        setAttribute ( Qt::WA_DeleteOnClose );
        setupUi ( this );
        blCenterOnScreen ( this );
        /// Usurpamos la identidad de mlist y ponemos nuestro propio widget con sus cosillas.
        mui_idproveedor->setMainCompany ( comp );
        mui_refpago->setMainCompany ( comp );
        mui_idbanco->setMainCompany ( comp );

        setTitleName ( _ ( "Pago" ) );
        setDbTableName ( "pago" );
        setDbFieldId ( "idpago" );
        addDbField ( "idpago", BlDbField::DbInt, BlDbField::DbPrimaryKey, _ ( "Id pago" ) );
        addDbField ( "idproveedor", BlDbField::DbInt, BlDbField::DbNotNull, _ ( "Id proveedor" ) );
        addDbField ( "previsionpago", BlDbField::DbBoolean, BlDbField::DbNothing, _ ( "Previcion de pago" ) );
        addDbField ( "fechapago", BlDbField::DbDate, BlDbField::DbNothing, _ ( "Fecha de pago" ) );
        addDbField ( "refpago", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Referencia de pago" ) );
        addDbField ( "cantpago", BlDbField::DbNumeric, BlDbField::DbNotNull, _ ( "Cantidad" ) );
        addDbField ( "comentpago", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Comentario del pago" ) );
        addDbField ( "idbanco", BlDbField::DbInt, BlDbField::DbNothing, _ ( "Banco" ) );
        addDbField ( "idforma_pago", BlDbField::DbInt, BlDbField::DbNothing, _ ( "Forma de pago" ) );
	
        /// Disparamos los plugins.
        int res = g_plugins->run ( "PagoView_PagoView", this );
        if ( res != 0 ) {
            return;
        } // end if
	
        /// Establecemos los parametros de busqueda del Cliente
        mui_idproveedor->setLabel ( _ ( "Proveedor:" ) );
        mui_idproveedor->setTableName ( "proveedor" );
        mui_idproveedor->m_valores["cifproveedor"] = "";
        mui_idproveedor->m_valores["nomproveedor"] = "";

	mui_idforma_pago->setMainCompany( comp );
        mui_idforma_pago->setQuery ( "SELECT * FROM forma_pago ORDER BY descforma_pago" );
        mui_idforma_pago->setTableName ( "forma_pago" );
        mui_idforma_pago->setFieldId ( "idforma_pago" );
        mui_idforma_pago->m_valores["descforma_pago"] = "";
        mui_idforma_pago->setAllowNull ( false );
        mui_idforma_pago->setId ( "" );
	
	
        insertWindow ( windowTitle(), this, false );
        pintar();
        dialogChanges_readValues();
	blScript(this);
    } catch ( ... ) {
        blMsgInfo ( _ ( "Error al crear el pago" ), this );
    } // end try

    
}
コード例 #16
0
void AlbaranProveedorView::inicializar()
{
    BL_FUNC_DEBUG
    subform2->inicializar();
    m_descuentos->inicializar();
    pintar();
    dialogChanges_readValues();
    
}
コード例 #17
0
ファイル: facturaview.cpp プロジェクト: JustDevZero/bulmages
void FacturaView::inicializar()
{
    BL_FUNC_DEBUG
    subform2->inicializar();
    m_descuentos->inicializar();
    pintar();
    dialogChanges_readValues();
    
}
コード例 #18
0
int main(int argc, const char **argv){
    //Realizar un programa que multiplique una matriz de a=4x3 b=4x5  para obtener una matriz c de 4x5
    system("clear");
    int AF = 4,
        AC = 3,
        BF = 3,
        BC = 5,
        solucion = 0,
        multiplicacion = 0,
        resultado = 0; 
    /*printf("Filas de A: ");
    scanf(" %i", &AF);
    printf("Columnas de A: ");
    scanf(" %i", &AC);
    printf("Filas de B: ");
    scanf(" %i", &BF);
    printf("Columnas de B: ");
    scanf(" %i", &BC);
    printf("MATRIZ A:\n");*/
    if(AC == BF){
        int matriz_a[AF][AC];
        int matriz_b[BF][BC];
        int matriz_c[AF][BC];

        for(int fila = 0; fila < AF; fila ++){
            for(int columna = 0; columna < AC; columna++){
                printf("Introduzca valor en fila %i, columna %i = ", fila + 1, columna + 1);
                scanf(" %i", &matriz_a[fila][columna]);
            }
        }

        printf("\nMATRIZ B:\n");
        for(int fila = 0; fila < BF; fila ++){
            for(int columna = 0; columna < BC; columna++){
                printf("Introduzca valor en fila %i, columna %i = ", fila, columna);
                scanf(" %i", &matriz_b[fila][columna]);
            }
        }
        //Multiplicar
        for(int fila = 0; fila < AF; fila++ )
            for(int columna = 0; columna < BC; columna++){
                solucion = 0;
                    for(int k = 0; k < AC; k++){
                        multiplicacion = matriz_a[fila][k] * matriz_b[k][columna];
                        solucion += multiplicacion;
                    }    
                    matriz_c[fila][columna] = solucion;
            } 

        pintar(matriz_c[AF][BC]);
        }
    else printf("\nMatriz incorrecta\n\n");
        return EXIT_SUCCESS;
}
コード例 #19
0
int ciclo (){
  if(buffer_in && buffer_in->m_imagen != 0) {
	buffer_out= filtro->Filtrar(buffer_in->m_imagen, buffer_in->m_alto ,buffer_in->m_ancho, buffer_in->m_bytes);
	buffer_out->ancho = buffer_in->m_ancho;
  buffer_out->alto = buffer_in->m_alto;	
  buffer_out->bytes = buffer_in->m_bytes;  
  pintar(); 
  }
  PON_ERROR("Ciclo en el modulo de gestos.\n");
  return 0;
}
コード例 #20
0
ファイル: main.c プロジェクト: juanjomartinf/conecta4
void a_jugar(){
 int lector;

    pintar();
while(juego){
        printf("Introduce la columna donde quiera poner su ficha (fichas restantes %d):", n_fichas);
    scanf("%d",&lector);
    while(!meter_ficha(1,lector)){
        scanf("%d", &lector);
    }
    //meter_ficha(2,lector);
     if(comprobar(1)){

        juego=0;
     }
        pintar();

}
        printf("HA GANADO MAMONA!");
        reset();
}
コード例 #21
0
ファイル: familiasview.cpp プロジェクト: trifolio6/Bulmages
/**
\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);
    
}
コード例 #22
0
ファイル: control.cpp プロジェクト: lcasassa/Simulador
void Control::paintEvent(QPaintEvent *) {
    QPainter p;
//    float radio;

//    radio = (this->width()/this->height()) < 1 ? this->width() : this->height();

    p.begin(this);
    p.scale(40,-40);
    p.translate(0, -4);

    pintar(&p);
    p.end();
}
コード例 #23
0
ファイル: partidasview.cpp プロジェクト: JustDevZero/bulmages
/**
\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);
    
}
コード例 #24
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: pintar((*reinterpret_cast< QList<QPoint>(*)>(_a[1]))); break;
        case 1: on_Resolver_clicked(); break;
        case 2: on_actionCargarSopa_triggered(); break;
        case 3: loadSoup(); break;
        case 4: on_actionCargarDiccionario_triggered(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
コード例 #25
0
ファイル: mticket.cpp プロジェクト: trifolio6/Bulmages
MTicket::MTicket ( BtCompany *company, QWidget *parent ) : BlWidget ( company, parent )
{
    BL_FUNC_DEBUG
    
    m_btCompany = company;
    
    setupUi ( this );
    setFocusPolicy ( Qt::NoFocus );
    m_btCompany->pWorkspace() ->addSubWindow ( this );
    g_plugins->run ( "MTicket_MTicket_Post", this );
    
    m_parent = parent;
    
    mui_plainText->setVisible(FALSE);
    mui_frame->setVisible(FALSE);

    pintar();
}
コード例 #26
0
ファイル: devolucion.cpp プロジェクト: JustDevZero/bulmages
void Devolucion::on_mui_ref_returnPressed()
{
    if ( m_ticket )  {
        delete m_ticket;
        m_ticket = NULL;
    } // end if

    QString query1 = "SELECT * FROM albaran WHERE refalbaran = '" + mui_ref->text() + "'";

    BlDbRecordSet *curs = mainCompany()->loadQuery ( query1 );
    if ( !curs->eof() ) {
        m_ticket = new BtTicket ( mainCompany(), NULL );
        m_ticket->load ( curs->value( "idalbaran" ) );
    }
    delete curs;
    m_totalin = "";
    pintar();
}
コード例 #27
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);
    
}
コード例 #28
0
/**
\param comp
\param parent
**/
VencimientoCView::VencimientoCView ( BfCompany *comp, QWidget *parent )
        :  BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    try {
        setAttribute ( Qt::WA_DeleteOnClose );
        setupUi ( this );
        blCenterOnScreen ( this );

        /// Usurpamos la identidad de mlist y ponemos nuestro propio widget con sus cosillas.
        mui_refvencimientoc->setMainCompany ( comp );


        /// Establecemos los parametros de busqueda del Cliente
        mui_idcliente->setMainCompany ( comp );
        mui_idcliente->setLabel ( _ ( "Cliente:" ) );
        mui_idcliente->setTableName ( "cliente" );
        mui_idcliente->m_valores["cifcliente"] = "";
        mui_idcliente->m_valores["nomcliente"] = "";
 
        setTitleName ( tr ( "Vencimiento" ) );
        setDbTableName ( "vencimientoc" );
        setDbFieldId ( "idvencimientoc" );
        addDbField ( "idvencimientoc", BlDbField::DbInt, BlDbField::DbPrimaryKey, QApplication::translate ( "Cobro", "Id cobro" ) );
        addDbField ( "refvencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Cobro", "Referencia de vencimiento" ) );
        addDbField ( "descvencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Cobro", "Descripcion" ) );
        addDbField ( "comentvencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Cobro", "Comentarios" ) );
        addDbField ( "fechavencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Cobro", "Fecha de vencimiento" ) );
        addDbField ( "fechaefvencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Cobro", "Fecha efectiva" ) );
        addDbField ( "estadovencimientoc", BlDbField::DbVarChar, BlDbField::DbNothing, QApplication::translate ( "Vencimiento", "Estado de vencimiento" ) );
        addDbField ( "cantvencimientoc", BlDbField::DbNumeric, BlDbField::DbNothing, QApplication::translate ( "Vencimiento", "Cantidad de vencimiento" ) );
        addDbField ( "idcliente", BlDbField::DbInt, BlDbField::DbNothing, QApplication::translate ( "Vencimiento", "idcliente de Vencimiento" ) );
        insertWindow ( windowTitle(), this, false );
        pintar();
        dialogChanges_readValues();
	blScript(this);
    } catch ( ... ) {
        blMsgInfo ( tr ( "Error al crear el pago" ), this );
    } // end try
    
}
コード例 #29
0
ファイル: tres_en_v3.cpp プロジェクト: rbg01/programs-de-c
int main(int argc, const char **argv){

    char *tablero = NULL;

    tablero = (char *) realloc(tablero, 9 * sizeof(char));

    /* Poner el tablero a cero*/
    for (int f=0; f<3; f++)
        for (int c=0; c<3; c++)
            *(tablero+(f * MAX + c)) = '_';

    for (int vez=0; vez<3; vez++){
        pedir(tablero, 'x');
        pedir(tablero, 'o');
        pintar(tablero);
    }


    free(tablero);
    return EXIT_SUCCESS;
}
コード例 #30
0
/** inicializa todos los componentes de la clase.
    Resetea el sistema de control de cambios para que considere que no hay cambios por parte del usuario.
    Mete la ventana en el workSpace.
*/
ConvReunionView::ConvReunionView ( BfCompany *comp, QWidget *parent ) : BfForm ( comp, parent )
{
    BL_FUNC_DEBUG
    
    setAttribute ( Qt::WA_DeleteOnClose );
    
    try {
    
        setupUi ( this );
        blCenterOnScreen ( this );

        setTitleName ( _ ( "Convocatoria de reunion" ) );
        setDbTableName ( "reunion" );
        setDbFieldId ( "idreunion" );
        addDbField ( "idreunion", BlDbField::DbInt, BlDbField::DbPrimaryKey, _ ( "ID reunion" ) );
        addDbField ( "fecha1convocatoriareunion", BlDbField::DbDate, BlDbField::DbNotNull, _ ( "Fecha 1a Convocatoria" ) );
        addDbField ( "fecha2convocatoriareunion", BlDbField::DbDate, BlDbField::DbNothing, _ ( "Fecha 2a Convocatoria" ) );
        addDbField ( "hora1convocatoriareunion", BlDbField::DbVarChar, BlDbField::DbNotNull, _ ( "Hora 1a Convocatoria" ) );
        addDbField ( "hora2convocatoriareunion", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Hora 2a Convocatoria" ) );
        addDbField ( "tiporeunion", BlDbField::DbVarChar, BlDbField::DbNotNull, _ ( "Tipo" ) );
        addDbField ( "conceptoreunion", BlDbField::DbVarChar, BlDbField::DbNotNull, _ ( "Concepto" ) );
        addDbField ( "resolucionreunion", BlDbField::DbVarChar, BlDbField::DbNothing, _ ( "Resolucion" ) );

        mui_list->setMainCompany( comp );
        mui_list->setDbTableName ( "asistentereunion" );
        mui_list->setDbFieldId ( "idasistentereunion" );
        mui_list->addSubFormHeader ( "idasistentereunion", BlDbField::DbInt, BlDbField::DbPrimaryKey, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "ID asistentereunion" ) );
        mui_list->addSubFormHeader ( "idreunion", BlDbField::DbInt, BlDbField::DbNothing, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "ID Reunion" ) );
        mui_list->addSubFormHeader ( "idcliente", BlDbField::DbInt, BlDbField::DbNotNull | BlDbField::DbRequired, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "ID Socio" ) );
        mui_list->addSubFormHeader ( "nomcliente", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone, _ ( "Nombre Socio" ) );

        mui_list->setInsert ( TRUE );
        mui_list->setDelete ( TRUE );
        mui_list->setSortingEnabled ( FALSE );

	 /// Hacemos una carga vacia para que se inicie bien el subformulario
         mui_list->load("SELECT * from asistentereunion NATURAL LEFT JOIN cliente WHERE 1 = 2");

        mui_ordendia->setMainCompany( comp );
        mui_ordendia->setDbTableName ( "ordendiareunion" );
        mui_ordendia->setDbFieldId ( "idordendiareunion" );
        mui_ordendia->addSubFormHeader ( "idordendiareunion", BlDbField::DbInt, BlDbField::DbPrimaryKey, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "ID Orden del dia" ) );
        mui_ordendia->addSubFormHeader ( "idreunion", BlDbField::DbInt, BlDbField::DbNothing, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "ID Reunion" ) );
        mui_ordendia->addSubFormHeader ( "conceptoordendiareunion", BlDbField::DbVarChar, BlDbField::DbRequired, BlSubFormHeader::DbNone, _ ( "Concepto" ) );
        mui_ordendia->addSubFormHeader ( "textoordendiareunion", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone, _ ( "Texto" ) );
        mui_ordendia->addSubFormHeader ( "resolucionordendiareunion", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone, _ ( "Resolucion" ) );

        mui_ordendia->setInsert ( TRUE );
        mui_ordendia->setDelete ( TRUE );
        mui_ordendia->setSortingEnabled ( FALSE );
        
	 /// Hacemos una carga vacia para que se inicie bien el subformulario
         mui_ordendia->load("SELECT * from ordendiareunion WHERE 1 = 2");

        insertWindow ( windowTitle(), this, FALSE );
        pintar();
        dialogChanges_readValues();
        blScript(this);
    } catch ( ... ) {
    
        blMsgInfo ( _ ( "Error al crear la reunion" ), this );
        
    } // end try
    
    
}