diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-01-11 22:50:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-11 22:50:29 +0100 |
| commit | 80c463b76284aa87f892fb331877c2caf5cc2771 (patch) | |
| tree | 3d278e61e102260dccd8c6a75f21b46d85c78151 /src/wx | |
| parent | fb415933fc53d55f25b46d00065fc39ffda43eb4 (diff) | |
Attempt to rationalise menu IDs and avoid duplicates.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/audio_mapping_view.cc | 11 | ||||
| -rw-r--r-- | src/wx/content_menu.cc | 7 | ||||
| -rw-r--r-- | src/wx/id.h | 27 | ||||
| -rw-r--r-- | src/wx/markers_panel.cc | 3 |
4 files changed, 38 insertions, 10 deletions
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index 6f4a39b1e..188bf57cf 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -26,6 +26,7 @@ #include "audio_gain_dialog.h" #include "audio_mapping_view.h" +#include "id.h" #include "wx_util.h" #include "lib/audio_mapping.h" #include "lib/maths_util.h" @@ -63,11 +64,11 @@ static constexpr auto COLUMN_PADDING = 16; enum { - ID_off = 1, - ID_minus6dB = 2, - ID_0dB = 3, - ID_plus3dB = 4, - ID_edit = 5 + ID_off = DCPOMATIC_AUDIO_GAIN_MENU, + ID_minus6dB, + ID_0dB, + ID_plus3dB, + ID_edit }; diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index c0479ac83..b096ecae6 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -26,6 +26,7 @@ #include "dir_dialog.h" #include "file_dialog.h" #include "film_viewer.h" +#include "id.h" #include "repeat_dialog.h" #include "timeline_video_content_view.h" #include "timeline_audio_content_view.h" @@ -74,8 +75,7 @@ using namespace dcpomatic; enum { - /* Start at 256 so we can have IDs on _cpl_menu from 1 to 255 */ - ID_repeat = 256, + ID_repeat = DCPOMATIC_CONTENT_MENU, ID_join, ID_find_missing, ID_properties, @@ -168,8 +168,7 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList try { auto cpls = dcp::find_and_resolve_cpls (dcp->directories(), true); _choose_cpl->Enable (cpls.size() > 1); - /* We can't have 0 as a menu item ID on OS X */ - int id = 1; + int id = DCPOMATIC_CPL_MENU; for (auto i: cpls) { auto item = _cpl_menu->AppendRadioItem ( id++, diff --git a/src/wx/id.h b/src/wx/id.h new file mode 100644 index 000000000..99aa25855 --- /dev/null +++ b/src/wx/id.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2024 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#define DCPOMATIC_MARKERS_PANEL_MENU wxID_HIGHEST +#define DCPOMATIC_MAIN_MENU (wxID_HIGHEST + 500) +#define DCPOMATIC_CPL_MENU (wxID_HIGHEST + 1000) +#define DCPOMATIC_CONTENT_MENU (wxID_HIGHEST + 1500) +#define DCPOMATIC_AUDIO_GAIN_MENU (wxID_HIGHEST + 2000) + diff --git a/src/wx/markers_panel.cc b/src/wx/markers_panel.cc index 463f06758..42a3ce8ae 100644 --- a/src/wx/markers_panel.cc +++ b/src/wx/markers_panel.cc @@ -20,6 +20,7 @@ #include "film_viewer.h" +#include "id.h" #include "markers.h" #include "markers_panel.h" #include "wx_util.h" @@ -41,7 +42,7 @@ using namespace boost::placeholders; enum { - ID_move_marker_to_current_position, + ID_move_marker_to_current_position = DCPOMATIC_MARKERS_PANEL_MENU, ID_remove_marker, ID_add_marker, /* Leave some space after this one as we use an ID for each marker type |
