It seems that all of a sudden the behaviour of wxListCtrl's selection
is strange (on Linux at least). If a list item is selected by
some other action (e.g. selection in the timeline) and then you click
another directly in the list, both are selected.
This "fix" seems to work on Linux at least - also setting
wxLIST_STATE_FOCUSED as well as wxLIST_STATE_SELECTED. I don't know
why this works.
{
auto content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
{
auto content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
- if (content[i] == wc.lock ()) {
- _content->SetItemState (i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
- } else {
- _content->SetItemState (i, 0, wxLIST_STATE_SELECTED);
- }
+ set_selected_state(i, content[i] == wc.lock());
auto content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
auto content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
- if (find(cl.begin(), cl.end(), content[i]) != cl.end()) {
- _content->SetItemState (i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
- } else {
- _content->SetItemState (i, 0, wxLIST_STATE_SELECTED);
- }
+ set_selected_state(i, find(cl.begin(), cl.end(), content[i]) != cl.end());
}
_no_check_selection = false;
}
_no_check_selection = false;
_content->InsertItem (item);
if (i.get() == selected_content) {
_content->InsertItem (item);
if (i.get() == selected_content) {
- _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+ set_selected_state(t, true);
}
if (!valid || needs_kdm || needs_assets) {
}
if (!valid || needs_kdm || needs_assets) {
if (!selected_content && !content.empty ()) {
/* Select the item of content if none was selected before */
if (!selected_content && !content.empty ()) {
/* Select the item of content if none was selected before */
- _content->SetItemState (0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+ set_selected_state(0, true);
+void
+ContentPanel::set_selected_state(int item, bool state)
+{
+ _content->SetItemState(item, state ? wxLIST_STATE_SELECTED : 0, wxLIST_STATE_SELECTED);
+ _content->SetItemState(item, state ? wxLIST_STATE_FOCUSED : 0, wxLIST_STATE_FOCUSED);
+}
+
+
LimitedSplitter::LimitedSplitter (wxWindow* parent)
: wxSplitterWindow (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxSP_3DSASH | wxSP_LIVE_UPDATE)
, _first_shown (false)
LimitedSplitter::LimitedSplitter (wxWindow* parent)
: wxSplitterWindow (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxSP_3DSASH | wxSP_LIVE_UPDATE)
, _first_shown (false)
void setup ();
void setup_sensitivity ();
void setup ();
void setup_sensitivity ();
+ void set_selected_state(int item, bool state);
void add_files (std::vector<boost::filesystem::path>);
std::list<ContentSubPanel *> panels () const;
void add_files (std::vector<boost::filesystem::path>);
std::list<ContentSubPanel *> panels () const;