OpenAlbum 1.0.b

/home/manuel/PFC/open-album/OpenAlbum-Unix/formtextoclass.cpp

00001 #include <QtGui>
00002 #include <QFont>
00003 #include "formtextoclass.h"
00004 #include "ui_formtextoclass.h"
00005 #include "formprincipal.h"
00006 #include "ui_formprincipal.h"
00007 #include "error.h"
00008 #include "controladorresolucion.h"
00009 
00010 class controladorResolucion;
00011 
00012 formTextoClass::formTextoClass(QWidget *parent, QString nombrePlantilla_, controladorResolucion *controlador_, QDir directoriodetrabajo) :
00013     QDialog(parent),
00014     ui(new Ui::formTextoClass)
00015 {
00016     ui->setupUi(this);
00017     negfront=false;
00018     negtras=false;
00019     neglat=false;
00020     curfront=false;
00021     curtras=false;
00022     curlat=false;
00023     subfront=false;
00024     subtras=false;
00025     sublat=false;
00026     textfront="";
00027     texttras="";
00028     textlat="";
00029     coloreadotextofron=false;
00030     coloreadotextotras=false;
00031     coloreadotextolat=false;
00032     this->formularioFinalizadoCorrectamente=false;
00033     ui->lineEditFrontal->setFocus();
00034     this->nombrePlantilla=nombrePlantilla_;
00035     this->controlador=controlador_;
00036     this->setDimensiones();
00037     this->ui->groupBox_2->setStyle(new QWindowsStyle);
00038     this->ui->groupBox_3->setStyle(new QWindowsStyle);
00039     this->ui->groupBox_5->setStyle(new QWindowsStyle);
00040     this->ui->groupBox_6->setStyle(new QWindowsStyle);
00041     this->ui->groupBox->setStyle(new QWindowsStyle);
00042     this->ui->groupBox_4->setStyle(new QWindowsStyle);
00043     this->ui->viewPlantilla->setStyle(new QWindowsStyle);
00044     this->ui->viewPlantillaLateral->setStyle(new QWindowsStyle);
00045     this->ui->viewPlantillaTrasero->setStyle(new QWindowsStyle);
00046     QImage *img=new QImage();
00047     QImage *img2=new QImage();
00048     QImage *img3=new QImage();
00049     int size=nombrePlantilla_.remove(".xml").size();
00050     QString tras, lat;
00051     tras=nombrePlantilla_;
00052     lat=nombrePlantilla_;
00053     int sizenew=lat.remove(lat.section("/", -1)).size();
00054     img->load(nombrePlantilla_.insert(size,"_text_fron.png"));
00055     img2->load(tras.insert(size,"_text_tras.png"));
00056     img3->load(lat.insert(sizenew,"template_text_lat.png"));
00057     
00058     QGraphicsScene *scena=new QGraphicsScene();
00059     QGraphicsScene *scena2=new QGraphicsScene();
00060     QGraphicsScene *scena3=new QGraphicsScene();
00061     ui->viewPlantilla->setScene(scena);
00062     ui->viewPlantillaTrasero->setScene(scena2);
00063     ui->viewPlantillaLateral->setScene(scena3);
00064     QPixmap image=QPixmap::fromImage(*img);
00065     QPixmap image2=QPixmap::fromImage(*img2);
00066     QPixmap image3=QPixmap::fromImage(*img3);
00067     int W=this->controlador->getWformTextoClass();
00068     int H=this->controlador->getHformTextoClass();
00069     ui->viewPlantilla->scene()->addPixmap(image.scaled((127*W)/510, (104*H)/390, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00070     ui->viewPlantillaTrasero->scene()->addPixmap(image2.scaled((127*W)/510, (104*H)/390, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00071     ui->viewPlantillaLateral->scene()->addPixmap(image3.scaled((127*W)/510, (104*H)/390, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00072     this->ffront=this->ui->fontComboBoxFrontal->currentFont();
00073     this->flat=this->ui->fontComboBoxLateral->currentFont();
00074     this->ftras=this->ui->fontComboBoxTrasero->currentFont();
00075     QFont aux=this->ffront;
00076     aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00077     this->ui->letraFrontal->setFont(aux);
00078     QFont aux2=this->ftras;
00079     aux2.setPointSize((78*this->controlador->getWformTextoClass())/510);
00080     this->ui->letraTrasera->setFont(aux2);
00081     QFont aux3=this->flat;
00082     aux3.setPointSize((78*this->controlador->getWformTextoClass())/510);
00083     this->ui->letraLateral->setFont(aux3);
00084     Parser p(this->nombrePlantilla.toStdString(), this);
00085     ticpp::Element* element=p.root();
00086     std::string tfrontal=p.get_attribute("texto_fron", element);
00087     std::string tlateral=p.get_attribute("texto_lat", element);
00088     std::string ttrasero=p.get_attribute("texto_tras", element);
00089     int resta=0;
00090     if(tfrontal=="no"){
00091         this->ui->tabWidgetTexto->removeTab(0);
00092         resta++;
00093     }
00094     if(tlateral=="no"){
00095         this->ui->tabWidgetTexto->removeTab(1-resta);
00096         resta++;
00097     }
00098     if(ttrasero=="no"){
00099         this->ui->tabWidgetTexto->removeTab(2-resta);
00100     }
00101     delete img;
00102     delete img2;
00103     delete img3;
00104     QIcon *iconoVentana=new QIcon(directoriodetrabajo.absolutePath() + "/data/iconlargue.png");
00105     this->setWindowIcon(*iconoVentana);
00106     delete iconoVentana;
00107 }
00108 
00109 formTextoClass::~formTextoClass()
00110 {
00111     for(int i=0; i< ui->viewPlantilla->items().size(); i++){
00112         delete ui->viewPlantilla->items().at(i);
00113     }
00114     delete ui->viewPlantilla->scene();
00115     delete ui->viewPlantilla;
00116     
00117     for(int i=0; i< ui->viewPlantillaLateral->items().size(); i++){
00118         delete ui->viewPlantillaLateral->items().at(i);
00119     }
00120     delete ui->viewPlantillaLateral->scene();
00121     delete ui->viewPlantillaLateral;
00122     
00123     for(int i=0; i< ui->viewPlantillaTrasero->items().size(); i++){
00124         delete ui->viewPlantillaTrasero->items().at(i);
00125     }
00126     delete ui->viewPlantillaTrasero->scene();
00127     delete ui->viewPlantillaTrasero;
00128     delete ui;
00129 }
00130 
00131 void formTextoClass::FocusTab(){
00132     if(this->ui->tabFrontal->isVisible()){
00133     this->ui->lineEditFrontal->setFocus();
00134     }
00135     if(this->ui->tabLateral->isVisible()){
00136     this->ui->lineEditLateral->setFocus();
00137     }
00138     if(this->ui->tabTrasero->isVisible()){
00139     this->ui->lineEditTrasero->setFocus();
00140     }
00141 }
00142 
00143 void formTextoClass::setDimensiones(){
00144     this->setFixedSize(this->controlador->getWformTextoClass(), this->controlador->getHformTextoClass());
00145     int W=this->controlador->getWformTextoClass();
00146     int H=this->controlador->getHformTextoClass();
00147     int x,y;
00148     x=this->ui->tabWidgetTexto->x();
00149     y=this->ui->tabWidgetTexto->y();
00150     this->ui->tabWidgetTexto->setGeometry((x*W)/510, (y*H)/390, (481*W)/510, (331*H)/390);
00151     x=this->ui->labelTextoFron->x();
00152     y=this->ui->labelTextoFron->y();
00153     this->ui->labelTextoFron->setGeometry((x*W)/510, (y*H)/390, (171*W)/510, (51*H)/390);
00154     x=this->ui->labelTextoLat->x();
00155     y=this->ui->labelTextoLat->y();
00156     this->ui->labelTextoLat->setGeometry((x*W)/510, (y*H)/390, (171*W)/510, (51*H)/390);
00157     x=this->ui->labelTextoTras->x();
00158     y=this->ui->labelTextoTras->y();
00159     this->ui->labelTextoTras->setGeometry((x*W)/510, (y*H)/390, (171*W)/510, (51*H)/390);
00160     x=this->ui->fontComboBoxFrontal->x();
00161     y=this->ui->fontComboBoxFrontal->y();
00162     this->ui->fontComboBoxFrontal->setGeometry((x*W)/510, (y*H)/390, (221*W)/510, (27*H)/390);
00163     x=this->ui->fontComboBoxLateral->x();
00164     y=this->ui->fontComboBoxLateral->y();
00165     this->ui->fontComboBoxLateral->setGeometry((x*W)/510, (y*H)/390, (221*W)/510, (27*H)/390);
00166     x=this->ui->fontComboBoxTrasero->x();
00167     y=this->ui->fontComboBoxTrasero->y();
00168     this->ui->fontComboBoxTrasero->setGeometry((x*W)/510, (y*H)/390, (221*W)/510, (27*H)/390);
00169     x=this->ui->groupBox_2->x();
00170     y=this->ui->groupBox_2->y();
00171     this->ui->groupBox_2->setGeometry((x*W)/510, (y*H)/390, (241*W)/510, (201*H)/390);
00172     x=this->ui->groupBox_3->x();
00173     y=this->ui->groupBox_3->y();
00174     this->ui->groupBox_3->setGeometry((x*W)/510, (y*H)/390, (241*W)/510, (201*H)/390);
00175     x=this->ui->groupBox_5->x();
00176     y=this->ui->groupBox_5->y();
00177     this->ui->groupBox_5->setGeometry((x*W)/510, (y*H)/390, (241*W)/510, (201*H)/390);
00178     x=this->ui->viewPlantilla->x();
00179     y=this->ui->viewPlantilla->y();
00180     this->ui->viewPlantilla->setGeometry((x*W)/510, (y*H)/390, (127*W)/510, (104*H)/390);
00181     x=this->ui->viewPlantillaLateral->x();
00182     y=this->ui->viewPlantillaLateral->y();
00183     this->ui->viewPlantillaLateral->setGeometry((x*W)/510, (y*H)/390, (127*W)/510, (104*H)/390);
00184     x=this->ui->viewPlantillaTrasero->x();
00185     y=this->ui->viewPlantillaTrasero->y();
00186     this->ui->viewPlantillaTrasero->setGeometry((x*W)/510, (y*H)/390, (127*W)/510, (104*H)/390);
00187     x=this->ui->pushColorTextF->x();
00188     y=this->ui->pushColorTextF->y();
00189     this->ui->pushColorTextF->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (27*H)/390);
00190     x=this->ui->pushColorTextT->x();
00191     y=this->ui->pushColorTextT->y();
00192     this->ui->pushColorTextT->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (27*H)/390);
00193     x=this->ui->pushColorTextL->x();
00194     y=this->ui->pushColorTextL->y();
00195     this->ui->pushColorTextL->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (27*H)/390);
00196     x=this->ui->groupBox->x();
00197     y=this->ui->groupBox->y();
00198     this->ui->groupBox->setGeometry((x*W)/510, (y*H)/390, (431*W)/510, (61*H)/390);
00199     x=this->ui->groupBox_4->x();
00200     y=this->ui->groupBox_4->y();
00201     this->ui->groupBox_4->setGeometry((x*W)/510, (y*H)/390, (431*W)/510, (61*H)/390);
00202     x=this->ui->groupBox_6->x();
00203     y=this->ui->groupBox_6->y();
00204     this->ui->groupBox_6->setGeometry((x*W)/510, (y*H)/390, (431*W)/510, (61*H)/390);
00205     x=this->ui->lineEditFrontal->x();
00206     y=this->ui->lineEditFrontal->y();
00207     this->ui->lineEditFrontal->setGeometry((x*W)/510, (y*H)/390, (411*W)/510, (27*H)/390);
00208     x=this->ui->lineEditLateral->x();
00209     y=this->ui->lineEditLateral->y();
00210     this->ui->lineEditLateral->setGeometry((x*W)/510, (y*H)/390, (411*W)/510, (27*H)/390);
00211     x=this->ui->lineEditTrasero->x();
00212     y=this->ui->lineEditTrasero->y();
00213     this->ui->lineEditTrasero->setGeometry((x*W)/510, (y*H)/390, (411*W)/510, (27*H)/390);
00214     x=this->ui->letraFrontal->x();
00215     y=this->ui->letraFrontal->y();
00216     this->ui->letraFrontal->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (121*H)/390);
00217     x=this->ui->letraLateral->x();
00218     y=this->ui->letraLateral->y();
00219     this->ui->letraLateral->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (121*H)/390);
00220     x=this->ui->letraTrasera->x();
00221     y=this->ui->letraTrasera->y();
00222     this->ui->letraTrasera->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (121*H)/390);
00223     x=this->ui->checkBoxCursivaFrontal->x();
00224     y=this->ui->checkBoxCursivaFrontal->y();
00225     this->ui->checkBoxCursivaFrontal->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00226     x=this->ui->checkBoxCursivaLateral->x();
00227     y=this->ui->checkBoxCursivaLateral->y();
00228     this->ui->checkBoxCursivaLateral->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00229     x=this->ui->checkBoxCursivaTrasero->x();
00230     y=this->ui->checkBoxCursivaTrasero->y();
00231     this->ui->checkBoxCursivaTrasero->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00232     x=this->ui->checkBoxNegritaFrontal->x();
00233     y=this->ui->checkBoxNegritaFrontal->y();
00234     this->ui->checkBoxNegritaFrontal->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00235     x=this->ui->checkBoxNegritaLateral->x();
00236     y=this->ui->checkBoxNegritaLateral->y();
00237     this->ui->checkBoxNegritaLateral->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00238     x=this->ui->checkBoxNegritaTrasero->x();
00239     y=this->ui->checkBoxNegritaTrasero->y();
00240     this->ui->checkBoxNegritaTrasero->setGeometry((x*W)/510, (y*H)/390, (94*W)/510, (22*H)/390);
00241     x=this->ui->checkBoxSubrayadoFrontal->x();
00242     y=this->ui->checkBoxSubrayadoFrontal->y();
00243     this->ui->checkBoxSubrayadoFrontal->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (22*H)/390);
00244     x=this->ui->checkBoxSubrayadoLateral->x();
00245     y=this->ui->checkBoxSubrayadoLateral->y();
00246     this->ui->checkBoxSubrayadoLateral->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (22*H)/390);
00247     x=this->ui->checkBoxSubrayadoTrasero->x();
00248     y=this->ui->checkBoxSubrayadoTrasero->y();
00249     this->ui->checkBoxSubrayadoTrasero->setGeometry((x*W)/510, (y*H)/390, (101*W)/510, (22*H)/390);
00250     x=this->ui->pushButtonAceptarTexto->x();
00251     y=this->ui->pushButtonAceptarTexto->y();
00252     this->ui->pushButtonAceptarTexto->setGeometry((x*W)/510, (y*H)/390, (93*W)/510, (27*H)/390);
00253     x=this->ui->pushButtonCancelarTexto->x();
00254     y=this->ui->pushButtonCancelarTexto->y();
00255     this->ui->pushButtonCancelarTexto->setGeometry((x*W)/510, (y*H)/390, (93*W)/510, (27*H)/390);
00256    
00257 }
00258 
00259 void formTextoClass::Aceptar(){
00260     EstablecerTextos();
00261     this->formularioFinalizadoCorrectamente=true;
00262     close();
00263 }
00264 
00265 bool formTextoClass::formularioAceptado(){
00266     return this->formularioFinalizadoCorrectamente;
00267 }
00268 
00269 void formTextoClass::PushSeleccionFuenteFrontal(){
00270 
00271     ui->lineEditFrontal->setFont(ui->fontComboBoxFrontal->currentFont());
00272     
00273     QFont aux=this->ui->letraFrontal->font();
00274     QFont def=ui->fontComboBoxFrontal->currentFont();
00275     if(aux.bold()){
00276         def.setBold(true);
00277     }else{
00278         def.setBold(false);
00279     }
00280     if(aux.italic()){
00281         def.setItalic(true);
00282     }else{
00283         def.setItalic(false);
00284     }
00285     if(aux.underline()){
00286         def.setUnderline(true);
00287     }else{
00288         def.setUnderline(false);
00289     }
00290     def.setPointSize((78*this->controlador->getWformTextoClass())/510);
00291     this->ui->letraFrontal->setFont(def);
00292     this->ui->lineEditFrontal->setFocus();
00293 }
00294 
00295 void formTextoClass::PushSeleccionFuenteLateral(){
00296 
00297     ui->lineEditLateral->setFont(ui->fontComboBoxLateral->currentFont());
00298     QFont aux=this->ui->letraLateral->font();
00299     QFont def=ui->fontComboBoxLateral->currentFont();
00300     if(aux.bold()){
00301         def.setBold(true);
00302     }else{
00303         def.setBold(false);
00304     }
00305     if(aux.italic()){
00306         def.setItalic(true);
00307     }else{
00308         def.setItalic(false);
00309     }
00310     if(aux.underline()){
00311         def.setUnderline(true);
00312     }else{
00313         def.setUnderline(false);
00314     }
00315     def.setPointSize((78*this->controlador->getWformTextoClass())/510);
00316     this->ui->letraLateral->setFont(def);
00317     this->ui->lineEditLateral->setFocus();
00318 }
00319 
00320 void formTextoClass::PushSeleccionFuenteTrasera(){
00321 
00322     ui->lineEditTrasero->setFont(ui->fontComboBoxTrasero->currentFont());
00323     QFont aux=this->ui->letraTrasera->font();
00324     QFont def=ui->fontComboBoxTrasero->currentFont();
00325     if(aux.bold()){
00326         def.setBold(true);
00327     }else{
00328         def.setBold(false);
00329     }
00330     if(aux.italic()){
00331         def.setItalic(true);
00332     }else{
00333         def.setItalic(false);
00334     }
00335     if(aux.underline()){
00336         def.setUnderline(true);
00337     }else{
00338         def.setUnderline(false);
00339     }
00340     def.setPointSize((78*this->controlador->getWformTextoClass())/510);
00341     this->ui->letraTrasera->setFont(def);
00342     this->ui->lineEditTrasero->setFocus();
00343 }
00344 
00345 void formTextoClass::PushNegritaFrontal(){
00346     if(ui->checkBoxNegritaFrontal->isChecked()){
00347         
00348         QFont aux=this->ui->letraFrontal->font();
00349         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00350         aux.setBold(true);
00351         this->ui->letraFrontal->setFont(aux);
00352     }else{
00353         QFont aux=this->ui->letraFrontal->font();
00354         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00355         aux.setBold(false);
00356         this->ui->letraFrontal->setFont(aux);
00357     }
00358     this->ui->lineEditFrontal->setFocus();
00359 }
00360 
00361 void formTextoClass::PushNegritaLateral(){
00362     if(ui->checkBoxNegritaLateral->isChecked()){
00363         
00364         QFont aux=this->ui->letraLateral->font();
00365         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00366         aux.setBold(true);
00367         this->ui->letraLateral->setFont(aux);
00368     }else{
00369        QFont aux=this->ui->letraLateral->font();
00370         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00371         aux.setBold(false);
00372         this->ui->letraLateral->setFont(aux);
00373     }
00374     this->ui->lineEditLateral->setFocus();
00375 }
00376 
00377 void formTextoClass::PushSubrayadoLateral(){
00378     if(ui->checkBoxSubrayadoLateral->isChecked()){
00379         
00380         QFont aux=this->ui->letraLateral->font();
00381         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00382         aux.setUnderline(true);
00383         this->ui->letraLateral->setFont(aux);
00384     }else{
00385        QFont aux=this->ui->letraLateral->font();
00386         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00387         aux.setUnderline(false);
00388         this->ui->letraLateral->setFont(aux);
00389     }
00390     this->ui->lineEditLateral->setFocus();
00391 }
00392 
00393 void formTextoClass::PushSubrayadoFrontal(){
00394     if(ui->checkBoxSubrayadoFrontal->isChecked()){
00395         
00396         QFont aux=this->ui->letraFrontal->font();
00397         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00398         aux.setUnderline(true);
00399         this->ui->letraFrontal->setFont(aux);
00400     }else{
00401         QFont aux=this->ui->letraFrontal->font();
00402         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00403         aux.setUnderline(false);
00404         this->ui->letraFrontal->setFont(aux);
00405     }
00406     this->ui->lineEditFrontal->setFocus();
00407 }
00408 
00409 void formTextoClass::PushCursivaFrontal(){
00410      if(ui->checkBoxCursivaFrontal->isChecked()){
00411         
00412         QFont aux=this->ui->letraFrontal->font();
00413         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00414         aux.setItalic(true);
00415         this->ui->letraFrontal->setFont(aux);
00416     }else{
00417         QFont aux=this->ui->letraFrontal->font();
00418         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00419         aux.setItalic(false);
00420         this->ui->letraFrontal->setFont(aux);
00421     }
00422      this->ui->lineEditFrontal->setFocus();
00423 }
00424 
00425 void formTextoClass::PushCursivaTrasera(){
00426      if(ui->checkBoxCursivaTrasero->isChecked()){
00427         
00428         QFont aux=this->ui->letraTrasera->font();
00429         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00430         aux.setItalic(true);
00431         this->ui->letraTrasera->setFont(aux);
00432     }else{
00433         QFont aux=this->ui->letraTrasera->font();
00434         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00435         aux.setItalic(false);
00436         this->ui->letraTrasera->setFont(aux);
00437     }
00438      this->ui->lineEditTrasero->setFocus();
00439 }
00440 
00441 void formTextoClass::PushCursivaLateral(){
00442     if(ui->checkBoxCursivaLateral->isChecked()){
00443         
00444         QFont aux=this->ui->letraLateral->font();
00445         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00446         aux.setItalic(true);
00447         this->ui->letraLateral->setFont(aux);
00448     }else{
00449        QFont aux=this->ui->letraLateral->font();
00450         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00451         aux.setItalic(false);
00452         this->ui->letraLateral->setFont(aux);
00453     }
00454     this->ui->lineEditLateral->setFocus();
00455 }
00456 
00457 
00458 void formTextoClass::PushSubrayadoTrasera(){
00459     if(ui->checkBoxSubrayadoTrasero->isChecked()){
00460         
00461         QFont aux=this->ui->letraTrasera->font();
00462         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00463         aux.setUnderline(true);
00464         this->ui->letraTrasera->setFont(aux);
00465     }else{
00466         QFont aux=this->ui->letraTrasera->font();
00467         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00468         aux.setUnderline(false);
00469         this->ui->letraTrasera->setFont(aux);
00470     }
00471     this->ui->lineEditTrasero->setFocus();
00472 }
00473 
00474 void formTextoClass::PushNegritaTrasera(){
00475     if(ui->checkBoxNegritaTrasero->isChecked()){
00476         
00477         QFont aux=this->ui->letraTrasera->font();
00478         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00479         aux.setBold(true);
00480         this->ui->letraTrasera->setFont(aux);
00481     }else{
00482         QFont aux=this->ui->letraTrasera->font();
00483         aux.setPointSize((78*this->controlador->getWformTextoClass())/510);
00484         aux.setBold(false);
00485         this->ui->letraTrasera->setFont(aux);
00486     }
00487     this->ui->lineEditTrasero->setFocus();
00488 }
00489 
00490 void formTextoClass::EstablecerTextos(){
00491     
00492     if(ui->checkBoxCursivaFrontal->isChecked()){
00493         curfront=true;
00494     }
00495     if(ui->checkBoxNegritaFrontal->isChecked()){
00496         negfront=true;
00497     }
00498     if(ui->checkBoxSubrayadoFrontal->isChecked()){
00499         subfront=true;
00500     }
00501     ffront=ui->fontComboBoxFrontal->currentFont();
00502     textfront=ui->lineEditFrontal->text();
00503 
00504 
00505     if(ui->checkBoxCursivaTrasero->isChecked()){
00506         curtras=true;
00507     }
00508     if(ui->checkBoxNegritaTrasero->isChecked()){
00509         negtras=true;
00510     }
00511     if(ui->checkBoxSubrayadoTrasero->isChecked()){
00512         subtras=true;
00513     }
00514     ftras=ui->fontComboBoxTrasero->currentFont();
00515     texttras=ui->lineEditTrasero->text();
00516 
00517 
00518     if(ui->checkBoxCursivaLateral->isChecked()){
00519         curlat=true;
00520     }
00521     if(ui->checkBoxNegritaLateral->isChecked()){
00522         neglat=true;
00523     }
00524     if(ui->checkBoxSubrayadoLateral->isChecked()){
00525         sublat=true;
00526     }
00527     flat=ui->fontComboBoxLateral->currentFont();
00528     textlat=ui->lineEditLateral->text();
00529 }
00530 
00531 void formTextoClass::PushSeleccionColorF(){
00532     try{
00533     QColorDialog *SeleccionColor= new QColorDialog(this);
00534     SeleccionColor->exec();
00535     colortextofron= SeleccionColor->selectedColor();
00536     coloreadotextofron=true;
00537     QPalette pal;
00538     pal.setColor(QPalette::WindowText, colortextofron);
00539     this->ui->letraFrontal->setPalette(pal);
00540     this->ui->lineEditFrontal->setFocus();
00541     delete SeleccionColor;
00542     }catch(std::exception& e){
00543                 Error *err=new Error(2, e.what(), this);
00544                 err->LanzarDialogo();
00545                 delete err;
00546                 exit(1);
00547     }
00548 }
00549 
00550 void formTextoClass::PushSeleccionColorL(){
00551     try{
00552     QColorDialog *SeleccionColor= new QColorDialog(this);
00553     SeleccionColor->exec();
00554     colortextolat= SeleccionColor->selectedColor();
00555     coloreadotextolat=true;
00556     QPalette pal;
00557     pal.setColor(QPalette::WindowText, colortextolat);
00558     this->ui->letraLateral->setPalette(pal);
00559     this->ui->lineEditLateral->setFocus();
00560     delete SeleccionColor;
00561     }catch(std::exception& e){
00562                 Error *err=new Error(2, e.what(), this);
00563                 err->LanzarDialogo();
00564                 delete err;
00565                 exit(1);
00566     }
00567 }
00568 
00569 void formTextoClass::PushSeleccionColorT(){
00570     try{
00571     QColorDialog *SeleccionColor= new QColorDialog(this);
00572     SeleccionColor->exec();
00573     colortextotras= SeleccionColor->selectedColor();
00574     coloreadotextotras=true;
00575     QPalette pal;
00576     pal.setColor(QPalette::WindowText, colortextotras);
00577     this->ui->letraTrasera->setPalette(pal);
00578     this->ui->lineEditTrasero->setFocus();
00579     delete SeleccionColor;
00580     }catch(std::exception& e){
00581                 Error *err=new Error(2, e.what(), this);
00582                 err->LanzarDialogo();
00583                 delete err;
00584                 exit(1);
00585     }
00586 }
 Todo Clases Archivos Funciones Variables