summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-08-09 20:17:26 +0200
committerCarl Hetherington <cth@carlh.net>2024-08-17 12:59:25 +0200
commitcd404bc33e755c1fc8b5f70e967286f8f1f2ebec (patch)
tree949d9972be21525780e9a17368d3d3789ec2d65a
parentdfa2f1418cc40b65068d2eb9431ab1d79247dbbf (diff)
Add Choice::size().
-rw-r--r--src/wx/dcpomatic_choice.cc10
-rw-r--r--src/wx/dcpomatic_choice.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc
index 52aaa4fc4..c458296f6 100644
--- a/src/wx/dcpomatic_choice.cc
+++ b/src/wx/dcpomatic_choice.cc
@@ -159,3 +159,13 @@ Choice::clear()
Clear();
}
+
+int
+Choice::size() const
+{
+ if (_needs_clearing) {
+ return 0;
+ }
+ return GetCount();
+}
+
diff --git a/src/wx/dcpomatic_choice.h b/src/wx/dcpomatic_choice.h
index 5417c1aa2..fde6a8cbb 100644
--- a/src/wx/dcpomatic_choice.h
+++ b/src/wx/dcpomatic_choice.h
@@ -40,6 +40,7 @@ public:
void set_entries(wxArrayString const& entries);
void clear();
+ int size() const;
void set(int index);
void set_by_data(wxString const& data);