Changeset 223 in PSPA


Ignore:
Timestamp:
Dec 21, 2012, 4:21:50 PM (12 years ago)
Author:
garnier
Message:

Modifications sur les elements draggables

Location:
Interface_Web/trunk/pspaWT
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r35 r223  
    77
    88
     921 December 2012  Laurent Garnier
     10- Pas mal de modification coté physique par Guy et François
     11- Par rapport à la dernière revision :
     12  o GWt_LigneFaiseau : Ajout d'une imag de fond  plutot que orange.
     13  o Ajout d'une nouvelle classe GWt_draggableImage (tout est dit)
     14  o Suppression des bordures pointillées dans les éléments
     15
    91617 Octobre 2012  Laurent Garnier
    1017- Affichage d'un Dialog lors du clic sur le bouton Drift
  • Interface_Web/trunk/pspaWT/cmt/requirements

    r207 r223  
    1717
    1818
    19 macro lib_PSPSLib_cppflags " ${Wt_cflags} ${boost_cflags} -DTHREADED -DDRAWWT_BUILD " Linux-x86_64  " ${Wt_cflags} ${boost_cflags} -DTHREADED -DDRAWWT_BUILD -DHAS_IMAGEMAGIC"
     19macro lib_PSPSLib_cppflags " ${Wt_cflags} ${boost_cflags} -DTHREADED -DDRAWWT_BUILD  -DHAS_IMAGEMAGIC -DPSPA_DEBUG" Linux-x86_64  " ${Wt_cflags} ${boost_cflags} -DTHREADED -DDRAWWT_BUILD -DHAS_IMAGEMAGIC"
    2020#macro PSPSLib_shlibflags   " ${Wt_linkopts} ${boost_linkopts} ${dld_linkopts} -F/System/Library/Frameworks "
    2121
    2222#macro PSPSLib_linkopts     " -L${PSPAWTROOT}/$(Platform_bin) -lPSPSLib "
    2323
    24 application pspaWT bareParticle.cc particleBeam.cc GWt_cell.cc GWt_rfgun.cc GWt_soleno.cc GWt_bend.cc GWt_beam.cc GWt_globalParameters.cc GWt_drift.cc GWt_abstractElement.cc dataManager.cc elementsCollection.cc elementDrift.cc elementCell.cc elementRfgun.cc elementSoleno.cc elementBend.cc elementBeam.cc globalParameters.cc abstractElement.cc GWt_LigneFaisceau.cc GWt_pspaApplication.cc GWt_dropZoneLigneFaiseau.cc GWt_dialog.cc nomdElements.cc nomDeLogiciel.cc transportMoments.cc main.cc use_cppflags='" ${lib_PSPSLib_cppflags}"'
     24application pspaWT bareParticle.cc particleBeam.cc GWt_cell.cc GWt_rfgun.cc GWt_soleno.cc GWt_bend.cc GWt_beam.cc GWt_globalParameters.cc GWt_drift.cc GWt_abstractElement.cc dataManager.cc elementsCollection.cc elementDrift.cc elementCell.cc elementRfgun.cc elementSoleno.cc elementBend.cc elementBeam.cc globalParameters.cc abstractElement.cc GWt_LigneFaisceau.cc GWt_pspaApplication.cc GWt_dropZoneLigneFaiseau.cc GWt_draggableImage.cc GWt_dialog.cc nomdElements.cc nomDeLogiciel.cc transportMoments.cc main.cc use_cppflags='" ${lib_PSPSLib_cppflags}"'
    2525
    2626macro DrawWt_linkopts " ${PSPSLib_linkopts} ${Wt_linkopts} ${boost_linkopts} ${dld_linkopts}"
  • Interface_Web/trunk/pspaWT/src/GWt_LigneFaisceau.cc

    r198 r223  
    2424
    2525  hbox_ = new WHBoxLayout();
    26   //  decorationStyle().setBackgroundColor (WColor("orange"));
     26  //  decorationStyle().setBackgroundColor (WColor(245,245,245));
     27  decorationStyle().setBackgroundImage (WApplication::appRoot()+"../icons/background.png");
    2728  setLayout(hbox_);
    2829
  • Interface_Web/trunk/pspaWT/src/GWt_dropZoneLigneFaiseau.cc

    r199 r223  
    1818    abstractElement_(NULL)
    1919{
    20   //  decorationStyle().setBackgroundColor (WColor("yellow"));
    2120  resize(5,5);
    2221  cout<<"new GWt_dropZoneLigneFaiseau : "<< this << endl;
     
    2423  // connect mouse events
    2524
    26   setMouseOverDelay(500);       
     25  //  setMouseOverDelay(100);   
    2726  mouseWentOver().connect(this, &GWt_dropZoneLigneFaiseau::mouseOver);
    2827  mouseWentUp().connect(this, &GWt_dropZoneLigneFaiseau::mouseUp);
     
    5958void GWt_dropZoneLigneFaiseau::mouseOver(const WMouseEvent& e)
    6059{
     60  decorationStyle().setCursor(OpenHandCursor);
    6161  // Add text
    6262  if (insertMessage_) {
     
    6464      insertMessage_->show();
    6565      resize(insertMessage_->width(),insertMessage_->height());
     66    } else {
     67      decorationStyle().setCursor(OpenHandCursor);
    6668    }
    6769  }
     
    7072  }
    7173
    72   decorationStyle().setBorder (WBorder (WBorder::Dashed, WBorder::Medium,WColor(blue)));
    73 
    74   pspa_->addConsoleMessage("mouse Over");
    75   cout << " GWt_dropZoneLigneFaiseau::mouseOver" << endl;
     74
     75#ifdef PSPA_DEBUG
     76  pspa_->addConsoleMessage("GWt_dropZoneLigneFaiseau::mouseOver");
     77#endif
    7678}
    7779
     
    8486      resize(10,10);
    8587    }
    86     decorationStyle().setBorder (WBorder (WBorder::Dashed, WBorder::Medium,WColor(255,255,255,255)));
    87   } else {
    88     decorationStyle().setBorder (WBorder (WBorder::Solid, WBorder::Thin,WColor(200,200,200)));
    8988  }
    9089  if (insertMessage_) {
     
    9493    linkImage_->show();
    9594  }
     95  decorationStyle().setCursor(ArrowCursor);
     96
     97#ifdef PSPA_DEBUG
    9698  pspa_->addConsoleMessage("GWt_dropZoneLigneFaiseau::mouseOut");
     99#endif
    97100}
    98101
    99102void GWt_dropZoneLigneFaiseau::mouseIsDragged(const WMouseEvent& e)
    100103{
     104#ifdef PSPA_DEBUG
    101105  pspa_->addConsoleMessage(" GWt_dropZoneLigneFaiseau::mouseDragged");
     106#endif
    102107}
    103108
    104109void GWt_dropZoneLigneFaiseau::mouseUp(const WMouseEvent& e)
    105110{
     111#ifdef PSPA_DEBUG
    106112  pspa_->addConsoleMessage("GWt_dropZoneLigneFaiseau::mouseOut up");
     113#endif
    107114}
    108115
    109116void GWt_dropZoneLigneFaiseau::mouseDown(const WMouseEvent& e)
    110117{
     118#ifdef PSPA_DEBUG
    111119  pspa_->addConsoleMessage("GWt_dropZoneLigneFaiseau::mouseDown up");
     120#endif
    112121}
    113122
    114123void GWt_dropZoneLigneFaiseau::dropEvent(WDropEvent evt)
    115124{
     125#ifdef PSPA_DEBUG
    116126  pspa_->addConsoleMessage(" GWt_dropZoneLigneFaiseau::dropEvent");
     127#endif
    117128
    118129  nomdElements e(evt.mimeType());
     
    200211    layout->setStretchFactor(this,0);           
    201212
     213    // change background
     214    decorationStyle().setBackgroundColor (WColor("white"));
     215
     216    // remove border
     217    decorationStyle().setBorder (WBorder (WBorder::None));
     218
    202219
    203220    // insert after
     
    225242  }
    226243
    227   // update border
    228   decorationStyle().setBorder (WBorder (WBorder::Solid, WBorder::Thin,WColor(200,200,200)));
    229244
    230245
     
    292307  WBoxLayout* layout = ((WBoxLayout*)(wc->layout()));
    293308 
     309#ifdef PSPA_DEBUG
    294310  pspa_->addConsoleMessage("remove from drag Zone");
    295311  cout << "remove from drag Zone id" << layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (other))) << " count:" << layout->count()<< endl;
    296 
     312#endif
    297313  // first element
    298314  if (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (other))) == 1) {
    299315    if (layout->itemAt (2)) {
    300316      layout->removeItem (layout->itemAt(2));
     317#ifdef PSPA_DEBUG
    301318  pspa_->addConsoleMessage("remove first link");
     319#endif
    302320    }
    303321   
     
    306324    if (layout->itemAt (layout->count()-3)) {
    307325      layout->removeItem (layout->itemAt(layout->count()-3));
     326#ifdef PSPA_DEBUG
    308327  pspa_->addConsoleMessage("remove last link");
     328#endif
    309329    }
    310330  }
     
    313333  if (layout->findWidgetItem (other)) {
    314334    layout->removeItem (layout->itemAt(layout->indexOf((WLayoutItem*)(layout->findWidgetItem (other)))));
     335#ifdef PSPA_DEBUG
    315336    pspa_->addConsoleMessage("remove drop zone");
     337#endif
    316338  }
    317339
  • Interface_Web/trunk/pspaWT/src/GWt_pspaApplication.cc

    r222 r223  
    77#include "GWt_globalParameters.h"
    88#include "GWt_dialog.h"
     9#include "GWt_draggableImage.h"
    910#include "particleBeam.h"
    1011#include "bareParticle.h"
     
    4950 
    5051  WContainerWidget *w = root();
    51   w->setStyleClass("PSPA");
     52  useStyleSheet (WApplication::appRoot()+"../include/pspa.css");       
    5253  dtmanage_ = new dataManager();
    5354
     
    143144void PspaApplication::createDragImage(const char *url,const char *smallurl,const char *mimeType,WContainerWidget *p,WString name)
    144145{
    145   WImage *result = new WImage(url,p);
     146  GWt_draggableImage *result = new GWt_draggableImage(url,p);
    146147  WImage *dragImage = new WImage(smallurl,p);
    147148
     
    152153  cout << "createDragImage" << dragImage<<endl;
    153154  result->setDraggable(mimeType,dragImage,true);
     155
    154156}
    155157
Note: See TracChangeset for help on using the changeset viewer.