Skip to content

Commit 4e69f07

Browse files
committed
Made so selected text in <input> fields can't be "dragged", which could then trigger the file upload JS stuff, which made no sense.
1 parent 6a53bca commit 4e69f07

27 files changed

+147
-3
lines changed

src/ColorThemeWidget.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
7777
cell = table->elementAt(row, 1);
7878
cell->setColumnSpan(2);
7979
m_themeTitle = new WLineEdit("Title not assigned", cell);
80+
m_themeTitle->setAttributeValue( "ondragstart", "return false" );
8081
label->setBuddy(m_themeTitle);
8182
m_themeTitle->setWidth(WLength(95, WLength::Percentage));
8283

@@ -85,7 +86,8 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
8586
label = new WLabel("Description",cell);
8687
cell = table->elementAt(row, 1);
8788
cell->setColumnSpan(2);
88-
m_themeDescription = new WLineEdit("Desc not assigned", cell);
89+
m_themeDescription = new WLineEdit("Desc not assigned", cell);
90+
m_themeDescription->setAttributeValue( "ondragstart", "return false" );
8991
label->setBuddy(m_themeDescription);
9092
m_themeDescription->setWidth(WLength(95, WLength::Percentage));
9193

@@ -456,6 +458,7 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
456458
{
457459
cell = table->elementAt(i,0);
458460
m_specificRefLineName[i] = new WLineEdit( cell );
461+
m_specificRefLineName[i]->setAttributeValue( "ondragstart", "return false" );
459462
nuclideSuggest->forEdit( m_specificRefLineName[i], WSuggestionPopup::Editing );
460463
m_specificRefLineName[i]->changed().connect( boost::bind( &ColorThemeWidget::specificRefLineSourceChangedCallback, this, i ) );
461464
m_specificRefLineName[i]->enterPressed().connect( boost::bind( &ColorThemeWidget::specificRefLineSourceChangedCallback, this, i ) );

src/CompactFileManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ CompactFileManager::CompactFileManager( SpecMeasManager *fileManager,
190190

191191
m_displayedPreTexts[typeindex] = new WText( m_sampleDivs[typeindex] );
192192
WLineEdit *edit = new WLineEdit( m_sampleDivs[typeindex] );
193+
edit->setAttributeValue( "ondragstart", "return false" );
193194
edit->addStyleClass( "SampleNumInput" );
194195
edit->setValidator( validator );
195196
edit->setAutoComplete( false );

src/DbFileBrowser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ void SnapshotBrowser::startEditSelected()
881881

882882
WLabel *label = new WLabel( "Name" );
883883
WLineEdit *nameEdit = new WLineEdit();
884+
nameEdit->setAttributeValue( "ondragstart", "return false" );
884885
nameEdit->setEmptyText( "(Name to store under)" );
885886
nameEdit->setText( state->name );
886887
layout->addWidget( label, 0, 0 );

src/DecayActivityDiv.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ class DateLengthCalculator : public WContainerWidget
532532
m_layout->addWidget( label, 2, 0, AlignMiddle );
533533

534534
m_duration = new WLineEdit();
535+
536+
m_duration->setAttributeValue( "ondragstart", "return false" );
535537
#if( BUILD_AS_OSX_APP || IOS )
536538
m_duration->setAttributeValue( "autocorrect", "off" );
537539
m_duration->setAttributeValue( "spellcheck", "off" );
@@ -875,6 +877,7 @@ class DateLengthCalculator : public WContainerWidget
875877

876878
cell = nuctbl->elementAt(1 + rowOffset, 1);
877879
WLineEdit *activityEdit = new WLineEdit(cell);
880+
activityEdit->setAttributeValue( "ondragstart", "return false" );
878881
#if( BUILD_AS_OSX_APP || IOS )
879882
activityEdit->setAttributeValue( "autocorrect", "off" );
880883
activityEdit->setAttributeValue( "spellcheck", "off" );
@@ -944,6 +947,7 @@ class DateLengthCalculator : public WContainerWidget
944947

945948
cell = nuctbl->elementAt(2 + rowOffset, 1);
946949
WLineEdit *ageEdit = new WLineEdit(cell);
950+
ageEdit->setAttributeValue( "ondragstart", "return false" );
947951
#if( BUILD_AS_OSX_APP || IOS )
948952
ageEdit->setAttributeValue( "autocorrect", "off" );
949953
ageEdit->setAttributeValue( "spellcheck", "off" );
@@ -1508,6 +1512,7 @@ class CsvDownloadGui : public AuxWindow
15081512

15091513
el = table->elementAt(0,1);
15101514
m_ageEdit = new WLineEdit( timeSpanStr, el );
1515+
m_ageEdit->setAttributeValue( "ondragstart", "return false" );
15111516
#if( BUILD_AS_OSX_APP || IOS )
15121517
m_ageEdit->setAttributeValue( "autocorrect", "off" );
15131518
m_ageEdit->setAttributeValue( "spellcheck", "off" );
@@ -1716,6 +1721,7 @@ void DecayActivityDiv::init()
17161721
//Initialize all member widgets; will assign parentage later on
17171722
// m_nuclides( 0 ),
17181723
m_displayTimeLength = new WLineEdit( "" );
1724+
m_displayTimeLength->setAttributeValue( "ondragstart", "return false" );
17191725
#if( BUILD_AS_OSX_APP || IOS )
17201726
m_displayTimeLength->setAttributeValue( "autocorrect", "off" );
17211727
m_displayTimeLength->setAttributeValue( "spellcheck", "off" );

src/DecaySelectNuclideDiv.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ void DecaySelectNuclide::init()
226226
Wt::XHTMLUnsafeText );
227227
m_isotopeSearch = new WLineEdit();
228228

229+
m_nuclideActivityEdit->setAttributeValue( "ondragstart", "return false" );
230+
m_nuclideAgeEdit->setAttributeValue( "ondragstart", "return false" );
231+
m_isotopeSearch->setAttributeValue( "ondragstart", "return false" );
229232
#if( BUILD_AS_OSX_APP || IOS )
230233
m_nuclideActivityEdit->setAttributeValue( "autocorrect", "off" );
231234
m_nuclideActivityEdit->setAttributeValue( "spellcheck", "off" );

src/DoseCalcWidget.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ class GammaSourceEnter : public Wt::WContainerWidget
251251
label->addStyleClass( "DoseFieldLabel" );
252252
m_nuclideEdit = new WLineEdit();
253253
m_nuclideEdit->setAutoComplete( false );
254+
m_nuclideEdit->setAttributeValue( "ondragstart", "return false" );
254255
#if( BUILD_AS_OSX_APP || IOS )
255256
m_nuclideEdit->setAttributeValue( "autocorrect", "off" );
256257
m_nuclideEdit->setAttributeValue( "spellcheck", "off" );
@@ -264,7 +265,9 @@ class GammaSourceEnter : public Wt::WContainerWidget
264265
layout->addWidget( label, 1, 0, AlignMiddle );
265266
label->addStyleClass( "DoseFieldLabel" );
266267
m_nuclideAgeEdit = new WLineEdit();
268+
267269
m_nuclideAgeEdit->setAutoComplete( false );
270+
m_nuclideAgeEdit->setAttributeValue( "ondragstart", "return false" );
268271
#if( BUILD_AS_OSX_APP || IOS )
269272
m_nuclideAgeEdit->setAttributeValue( "autocorrect", "off" );
270273
m_nuclideAgeEdit->setAttributeValue( "spellcheck", "off" );
@@ -971,7 +974,9 @@ void DoseCalcWidget::init()
971974

972975

973976
m_doseEnter = new WLineEdit( m_enterWidgets[i] );
977+
974978
m_doseEnter->setAutoComplete( false );
979+
m_doseEnter->setAttributeValue( "ondragstart", "return false" );
975980
#if( BUILD_AS_OSX_APP || IOS )
976981
m_doseEnter->setAttributeValue( "autocorrect", "off" );
977982
m_doseEnter->setAttributeValue( "spellcheck", "off" );
@@ -1022,7 +1027,9 @@ void DoseCalcWidget::init()
10221027

10231028
m_activityEnter = new WLineEdit( m_enterWidgets[i] );
10241029
m_activityEnter->addStyleClass( "DoseEnterTxt" );
1030+
10251031
m_activityEnter->setAutoComplete( false );
1032+
m_activityEnter->setAttributeValue( "ondragstart", "return false" );
10261033
#if( BUILD_AS_OSX_APP || IOS )
10271034
m_activityEnter->setAttributeValue( "autocorrect", "off" );
10281035
m_activityEnter->setAttributeValue( "spellcheck", "off" );
@@ -1096,7 +1103,9 @@ void DoseCalcWidget::init()
10961103

10971104

10981105
m_distanceEnter = new WLineEdit( "100 cm" );
1106+
10991107
m_distanceEnter->setAutoComplete( false );
1108+
m_distanceEnter->setAttributeValue( "ondragstart", "return false" );
11001109
#if( BUILD_AS_OSX_APP || IOS )
11011110
m_distanceEnter->setAttributeValue( "autocorrect", "off" );
11021111
m_distanceEnter->setAttributeValue( "spellcheck", "off" );

src/DrfSelect.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,8 @@ GadrasDirectory::GadrasDirectory( std::string directory, GadrasDetSelect *parent
17761776

17771777
#if( BUILD_FOR_WEB_DEPLOYMENT || defined(IOS) )
17781778
#else
1779+
m_directoryEdit->setAttributeValue( "ondragstart", "return false" );
1780+
17791781
WContainerWidget *topdiv = new WContainerWidget( this );
17801782
m_deleteBtn = new WPushButton( topdiv );
17811783
m_deleteBtn->addStyleClass( "closeicon-wtdefault" );
@@ -2469,6 +2471,7 @@ DrfSelect::DrfSelect( std::shared_ptr<DetectorPeakResponse> currentDet,
24692471
m_detectorDiameter = new WLineEdit( "0 cm", m_detectrDiameterDiv );
24702472
label->setBuddy( m_detectorDiameter );
24712473

2474+
m_detectorDiameter->setAttributeValue( "ondragstart", "return false" );
24722475
#if( BUILD_AS_OSX_APP || IOS )
24732476
m_detectorDiameter->setAttributeValue( "autocorrect", "off" );
24742477
m_detectorDiameter->setAttributeValue( "spellcheck", "off" );
@@ -2486,6 +2489,7 @@ DrfSelect::DrfSelect( std::shared_ptr<DetectorPeakResponse> currentDet,
24862489
m_uploadedDetName = new WLineEdit( m_uploadedDetNameDiv );
24872490
label->setBuddy( m_uploadedDetName );
24882491

2492+
m_uploadedDetName->setAttributeValue( "ondragstart", "return false" );
24892493
#if( BUILD_AS_OSX_APP || IOS )
24902494
m_uploadedDetName->setAttributeValue( "autocorrect", "off" );
24912495
m_uploadedDetName->setAttributeValue( "spellcheck", "off" );
@@ -2535,6 +2539,7 @@ DrfSelect::DrfSelect( std::shared_ptr<DetectorPeakResponse> currentDet,
25352539
m_detectorManualFunctionName = new WLineEdit( cell );
25362540
label->setBuddy( m_detectorManualFunctionName );
25372541

2542+
m_detectorManualFunctionName->setAttributeValue( "ondragstart", "return false" );
25382543
#if( BUILD_AS_OSX_APP || IOS )
25392544
m_detectorManualFunctionName->setAttributeValue( "autocorrect", "off" );
25402545
m_detectorManualFunctionName->setAttributeValue( "spellcheck", "off" );
@@ -2584,6 +2589,8 @@ DrfSelect::DrfSelect( std::shared_ptr<DetectorPeakResponse> currentDet,
25842589
m_detectorManualDescription->setWidth( WLength(100,WLength::Percentage) );
25852590
m_detectorManualDescription->setEmptyText( "Description of this detector response" );
25862591
m_detectorManualDescription->changed().connect(boost::bind(&DrfSelect::verifyManualDefinition, this));
2592+
2593+
m_detectorManualDescription->setAttributeValue( "ondragstart", "return false" );
25872594
#if( BUILD_AS_OSX_APP || IOS )
25882595
m_detectorManualDescription->setAttributeValue( "autocorrect", "off" );
25892596
m_detectorManualDescription->setAttributeValue( "spellcheck", "off" );
@@ -2600,6 +2607,8 @@ DrfSelect::DrfSelect( std::shared_ptr<DetectorPeakResponse> currentDet,
26002607
m_detectorManualDiameterText->setValidator( distValidator );
26012608
m_detectorManualDiameterText->blurred().connect(boost::bind(&DrfSelect::verifyManualDefinition, this));
26022609
m_detectorManualDiameterText->enterPressed().connect(boost::bind(&DrfSelect::verifyManualDefinition, this));
2610+
2611+
m_detectorManualDiameterText->setAttributeValue( "ondragstart", "return false" );
26032612
#if( BUILD_AS_OSX_APP || IOS )
26042613
m_detectorManualDiameterText->setAttributeValue( "autocorrect", "off" );
26052614
m_detectorManualDiameterText->setAttributeValue( "spellcheck", "off" );

src/EnergyCalMultiFile.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ EnergyCalMultiFile::EnergyCalMultiFile( EnergyCalTool *cal, AuxWindow *parent )
203203
WGridLayout *fitForLayout = new WGridLayout( fitFor );
204204

205205

206-
for( size_t i = 0; i < ns_min_num_coef; ++i )
206+
for( int i = 0; i < static_cast<int>(ns_min_num_coef); ++i )
207207
{
208208
WLabel *label = 0;
209209
switch( i )
@@ -216,6 +216,8 @@ EnergyCalMultiFile::EnergyCalMultiFile( EnergyCalTool *cal, AuxWindow *parent )
216216
}//switch( i )
217217

218218
auto coefval = new WLineEdit();
219+
220+
coefval->setAttributeValue( "ondragstart", "return false" );
219221
#if( BUILD_AS_OSX_APP || IOS )
220222
coefval->setAttributeValue( "autocorrect", "off" );
221223
coefval->setAttributeValue( "spellcheck", "off" );

src/FluxTool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,8 @@ void FluxToolWidget::init()
944944
m_distance = new WLineEdit( "100 cm", distCell );
945945
m_distance->addStyleClass( "FluxDistanceEnter" );
946946
label->setBuddy(m_distance);
947+
948+
m_distance->setAttributeValue( "ondragstart", "return false" );
947949
#if( BUILD_AS_OSX_APP || IOS )
948950
m_distance->setAttributeValue( "autocorrect", "off" );
949951
m_distance->setAttributeValue( "spellcheck", "off" );

src/GammaXsGui.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ GammaXsGui::GammaXsGui( MaterialDB *materialDB,
8787
const bool showToolTips = InterSpecUser::preferenceValue<bool>( "ShowTooltips", m_specViewer );
8888

8989
m_energyEdit = new WLineEdit( "100" );
90+
9091
m_energyEdit->setAutoComplete( false );
92+
m_energyEdit->setAttributeValue( "ondragstart", "return false" );
9193
#if( BUILD_AS_OSX_APP || IOS )
9294
m_energyEdit->setAttributeValue( "autocorrect", "off" );
9395
m_energyEdit->setAttributeValue( "spellcheck", "off" );
@@ -120,7 +122,9 @@ GammaXsGui::GammaXsGui( MaterialDB *materialDB,
120122
HelpSystem::attachToolTipOn( label, tooltip, showToolTips );
121123
m_layout->addWidget( label, row, 0, 1, 1, AlignLeft );
122124
m_materialEdit = new WLineEdit( "C0.5H0.2Ni0.3" );
125+
123126
m_materialEdit->setAutoComplete( false );
127+
m_materialEdit->setAttributeValue( "ondragstart", "return false" );
124128
#if( BUILD_AS_OSX_APP || IOS )
125129
m_materialEdit->setAttributeValue( "autocorrect", "off" );
126130
m_materialEdit->setAttributeValue( "spellcheck", "off" );
@@ -215,7 +219,9 @@ GammaXsGui::GammaXsGui( MaterialDB *materialDB,
215219
label = new WLabel( "Density:" );
216220
m_layout->addWidget( label, row, 0, 1, 1, AlignLeft );
217221
m_density = new WLineEdit();
222+
218223
m_density->setAutoComplete( false );
224+
m_density->setAttributeValue( "ondragstart", "return false" );
219225
#if( BUILD_AS_OSX_APP || IOS )
220226
m_density->setAttributeValue( "autocorrect", "off" );
221227
m_density->setAttributeValue( "spellcheck", "off" );
@@ -242,7 +248,9 @@ GammaXsGui::GammaXsGui( MaterialDB *materialDB,
242248
label = new WLabel( "Thickness:" );
243249
m_layout->addWidget( label, row, 0, 1, 1, AlignLeft );
244250
m_distance = new WLineEdit( "1 cm" );
251+
245252
m_distance->setAutoComplete( false );
253+
m_distance->setAttributeValue( "ondragstart", "return false" );
246254
#if( BUILD_AS_OSX_APP || IOS )
247255
m_distance->setAttributeValue( "autocorrect", "off" );
248256
m_distance->setAttributeValue( "spellcheck", "off" );
@@ -287,7 +295,9 @@ GammaXsGui::GammaXsGui( MaterialDB *materialDB,
287295
m_detectorLabel[detectorCount] = new WLabel( "Distance" );
288296
m_layout->addWidget( m_detectorLabel[detectorCount] , row, 0, 1, 1, AlignLeft );
289297
m_detectorDistance = new WLineEdit("2 cm");
298+
290299
m_detectorDistance->setAutoComplete( false );
300+
m_detectorDistance->setAttributeValue( "ondragstart", "return false" );
291301
#if( BUILD_AS_OSX_APP || IOS )
292302
m_detectorDistance->setAttributeValue( "autocorrect", "off" );
293303
m_detectorDistance->setAttributeValue( "spellcheck", "off" );

0 commit comments

Comments
 (0)