Skip to content

Commit c2f4342

Browse files
committed
Added W_DECLARE_OPERATORS_FOR_FLAGS(AuxWindowProperties) for more ergonomic use of that enum.
1 parent 3f5d61f commit c2f4342

34 files changed

+81
-88
lines changed

InterSpec/AuxWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ enum AuxWindowProperties
8383
EnableResize = 0x40
8484
};//enum AuxWindowProperties
8585

86+
W_DECLARE_OPERATORS_FOR_FLAGS(AuxWindowProperties);
87+
8688
/** AuxWindow is a resizeable, moveable, collapsable window, which is a
8789
specialization of a WDialog window to suit our purposes.
8890
AuxWindow was created due to the observation that using jQuery to make

src/AddNewPeakDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const float AddNewPeakDialog::m_maxfwhm = 450.0f; //reasonable range of peak wi
7070

7171
AddNewPeakDialog::AddNewPeakDialog( const float initialEnergy, const std::string &ref_line_hint )
7272
: AuxWindow( WString::tr("anpd-dialog-add-peak-title"),
73-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::IsModal)
73+
(AuxWindowProperties::IsModal
7474
| AuxWindowProperties::TabletNotFullScreen
7575
| AuxWindowProperties::DisableCollapse) ),
7676
m_renderFlags( 0 ),

src/ColorThemeWindow.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ namespace
150150

151151

152152
ColorThemeWindow::ColorThemeWindow( InterSpec *interspec )
153-
: AuxWindow( WString::tr("ctw-window-title"), Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::TabletNotFullScreen) | AuxWindowProperties::SetCloseable ),
153+
: AuxWindow( WString::tr("ctw-window-title"), AuxWindowProperties::TabletNotFullScreen | AuxWindowProperties::SetCloseable ),
154154
m_interspec(interspec),
155155
m_menu( nullptr ),
156156
m_edit( nullptr ),
@@ -407,8 +407,9 @@ void ColorThemeWindow::removeThemeCallback()
407407
const long long dbIndex = item->theme()->dbIndex;
408408

409409
AuxWindow *conf = new AuxWindow( WString::tr("ctw-delete-confirm-title").arg(name),
410-
WFlags<AuxWindowProperties>(AuxWindowProperties::DisableCollapse)
411-
| AuxWindowProperties::IsModal | AuxWindowProperties::TabletNotFullScreen );
410+
AuxWindowProperties::DisableCollapse
411+
| AuxWindowProperties::IsModal
412+
| AuxWindowProperties::TabletNotFullScreen );
412413

413414
auto doDelete = [this,dbIndex,item,conf](){
414415
if( dbIndex >= 0 )
@@ -471,8 +472,9 @@ void ColorThemeWindow::uploadThemeCallback()
471472

472473
//1) Make a dialog to allow user to select a file.
473474
AuxWindow *window = new AuxWindow( WString::tr("ctw-upload-title"),
474-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::IsModal)
475-
| AuxWindowProperties::TabletNotFullScreen | AuxWindowProperties::DisableCollapse
475+
(AuxWindowProperties::IsModal
476+
| AuxWindowProperties::TabletNotFullScreen
477+
| AuxWindowProperties::DisableCollapse
476478
| AuxWindowProperties::SetCloseable) );
477479

478480
WContainerWidget *contents = window->contents();

src/DbFileBrowser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ DbFileBrowser::DbFileBrowser( SpecMeasManager *manager,
197197
InterSpec *viewer,
198198
std::shared_ptr<SpectraFileHeader> header)
199199
: AuxWindow( WString::tr("smm-prev-states-window-title"),
200-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::DisableCollapse)
201-
| AuxWindowProperties::EnableResize
202-
| AuxWindowProperties::SetCloseable) ),
200+
(AuxWindowProperties::DisableCollapse
201+
| AuxWindowProperties::EnableResize
202+
| AuxWindowProperties::SetCloseable) ),
203203
m_factory( nullptr )
204204
{
205205
wApp->useStyleSheet( "InterSpec_resources/DbFileBrowser.css" );

src/DecayActivityDiv.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,10 @@ class CsvDownloadGui : public AuxWindow
14891489
public:
14901490

14911491
CsvDownloadGui( DecayActivityDiv *parent )
1492-
: AuxWindow( "CSV Export", (Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::IsModal) | AuxWindowProperties::TabletNotFullScreen | AuxWindowProperties::DisableCollapse | AuxWindowProperties::SetCloseable) ),
1492+
: AuxWindow( "CSV Export", (AuxWindowProperties::IsModal
1493+
| AuxWindowProperties::TabletNotFullScreen
1494+
| AuxWindowProperties::DisableCollapse
1495+
| AuxWindowProperties::SetCloseable) ),
14931496
m_parent( parent ),
14941497
m_csvResouce( nullptr ),
14951498
m_ageEdit( nullptr )
@@ -1760,7 +1763,7 @@ void DecayActivityDiv::init()
17601763
m_createNewNuclideButton = new WPushButton( WString::tr("dad-add-nucs") );
17611764
m_clearNuclidesButton = new WPushButton( WString::tr(isPhone ? "Clear" : "dad-remove-all") );
17621765
m_nuclideSelectDialog = new AuxWindow( WString::tr("dad-sel-nuc-window-title"),
1763-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::TabletNotFullScreen) | AuxWindowProperties::DisableCollapse) );
1766+
(AuxWindowProperties::TabletNotFullScreen | AuxWindowProperties::DisableCollapse) );
17641767

17651768
m_nuclideSelect = new DecaySelectNuclide( isPhone, nullptr, m_nuclideSelectDialog );
17661769
m_decayLegend = new WContainerWidget();

src/DecayChainChart.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,7 @@ pair<AuxWindow *, DecayChainChart *>
338338

339339
DecayChainChart *chart = new DecayChainChart();
340340

341-
AuxWindow *window = new AuxWindow( title,
342-
(Wt::WFlags<AuxWindowProperties>( AuxWindowProperties::DisableCollapse )
343-
| AuxWindowProperties::EnableResize) );
341+
AuxWindow *window = new AuxWindow( title, (AuxWindowProperties::DisableCollapse | AuxWindowProperties::EnableResize) );
344342

345343
WPushButton *close = window->addCloseButtonToFooter();
346344
close->clicked().connect( boost::bind( &AuxWindow::hide, window ) );
@@ -798,7 +796,7 @@ void DecayChainChart::showPossibleParents( const SandiaDecay::Nuclide *nuclide )
798796
const double wh = 0.65*interspec->renderedHeight();
799797

800798
Wt::WFlags<AuxWindowProperties> windowProp
801-
= Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::IsModal)
799+
= AuxWindowProperties::IsModal
802800
| AuxWindowProperties::DisableCollapse
803801
| AuxWindowProperties::SetCloseable
804802
| AuxWindowProperties::EnableResize;

src/DecayWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ using namespace std;
5959

6060
DecayWindow::DecayWindow( InterSpec *viewer )
6161
: AuxWindow( WString::tr("window-title-nuc-decay"),
62-
//(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::IsModal) | AuxWindowProperties::DisableCollapse) ),
63-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::DisableCollapse)
62+
//(AuxWindowProperties::IsModal | AuxWindowProperties::DisableCollapse) ),
63+
(AuxWindowProperties::DisableCollapse
6464
| AuxWindowProperties::EnableResize
6565
| AuxWindowProperties::SetCloseable) ),
6666
m_activityDiv( 0 )

src/DetectionLimitSimple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ DetectionLimitSimpleWindow::DetectionLimitSimpleWindow( MaterialDB *materialDB,
105105
Wt::WSuggestionPopup *materialSuggestion,
106106
InterSpec *viewer )
107107
: AuxWindow( WString::tr("window-title-simple-mda"),
108-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::TabletNotFullScreen)
108+
(AuxWindowProperties::TabletNotFullScreen
109109
| AuxWindowProperties::SetCloseable
110110
| AuxWindowProperties::DisableCollapse) )
111111
{

src/DetectionLimitTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ DetectionLimitWindow::DetectionLimitWindow( InterSpec *viewer,
966966
MaterialDB *materialDB,
967967
WSuggestionPopup *materialSuggest )
968968
: AuxWindow( "Detection Confidence Tool",
969-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::TabletNotFullScreen)
969+
(AuxWindowProperties::TabletNotFullScreen
970970
| AuxWindowProperties::SetCloseable
971971
| AuxWindowProperties::DisableCollapse) ),
972972
m_tool( nullptr )

src/DoseCalcWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ DoseCalcWindow::DoseCalcWindow( MaterialDB *materialDB,
222222
Wt::WSuggestionPopup *materialSuggestion,
223223
InterSpec *viewer )
224224
: AuxWindow( WString::tr("window-title-dose-calc"),
225-
(Wt::WFlags<AuxWindowProperties>(AuxWindowProperties::TabletNotFullScreen)
225+
(AuxWindowProperties::TabletNotFullScreen
226226
| AuxWindowProperties::SetCloseable
227227
| AuxWindowProperties::DisableCollapse) )
228228
{

0 commit comments

Comments
 (0)