Skip to content

Commit

Permalink
Add ability to turn off the "effect indicator" for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Jan 22, 2025
1 parent 326d8ca commit 8773478
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 91 deletions.
94 changes: 56 additions & 38 deletions xLights/preferences/EffectsGridSettingsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
//(*InternalHeaders(EffectsGridSettingsPanel)
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/gbsizer.h>
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/string.h>
//*)
Expand All @@ -23,15 +23,16 @@
#include "../xLightsMain.h"

//(*IdInit(EffectsGridSettingsPanel)
const long EffectsGridSettingsPanel::ID_CHOICE1 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX1 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX2 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX3 = wxNewId();
const long EffectsGridSettingsPanel::ID_STATICTEXT1 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX4 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX6 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHECKBOX5 = wxNewId();
const long EffectsGridSettingsPanel::ID_CHOICE2 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHOICE1 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX1 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX2 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX7 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX3 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_STATICTEXT1 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHOICE2 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX4 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX6 = wxNewId();
const wxWindowID EffectsGridSettingsPanel::ID_CHECKBOX5 = wxNewId();
//*)

BEGIN_EVENT_TABLE(EffectsGridSettingsPanel,wxPanel)
Expand All @@ -42,56 +43,64 @@ END_EVENT_TABLE()
EffectsGridSettingsPanel::EffectsGridSettingsPanel(wxWindow* parent, xLightsFrame *f, wxWindowID id,const wxPoint& pos,const wxSize& size) : frame(f)
{
//(*Initialize(EffectsGridSettingsPanel)
wxGridBagSizer* GridBagSizer1;
wxGridSizer* GridSizer1;
wxStaticText* StaticText5;

Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id"));
GridBagSizer1 = new wxGridBagSizer(0, 0);
Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY"));
GridSizer1 = new wxGridSizer(0, 2, 0, 0);
StaticText5 = new wxStaticText(this, wxID_ANY, _("Spacing"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
GridBagSizer1->Add(StaticText5, wxGBPosition(0, 0), wxDefaultSpan, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(StaticText5, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSpacingChoice = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
GridSpacingChoice->Append(_("Extra Small"));
GridSpacingChoice->Append(_("Small"));
GridSpacingChoice->SetSelection( GridSpacingChoice->Append(_("Medium")) );
GridSpacingChoice->Append(_("Large"));
GridSpacingChoice->Append(_("Extra Large"));
GridBagSizer1->Add(GridSpacingChoice, wxGBPosition(0, 1), wxDefaultSpan, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(GridSpacingChoice, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
IconBackgroundsCheckBox = new wxCheckBox(this, ID_CHECKBOX1, _("Icon Backgrounds"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
IconBackgroundsCheckBox->SetValue(false);
GridBagSizer1->Add(IconBackgroundsCheckBox, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(IconBackgroundsCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
NodeValuesCheckBox = new wxCheckBox(this, ID_CHECKBOX2, _("Node Values"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
NodeValuesCheckBox->SetValue(false);
GridBagSizer1->Add(NodeValuesCheckBox, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(NodeValuesCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
GroupEffectIndicator = new wxCheckBox(this, ID_CHECKBOX7, _("Group Effect Indicator"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7"));
GroupEffectIndicator->SetValue(true);
GridSizer1->Add(GroupEffectIndicator, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SnapToTimingCheckBox = new wxCheckBox(this, ID_CHECKBOX3, _("Snap to Timing Marks"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3"));
SnapToTimingCheckBox->SetValue(false);
GridBagSizer1->Add(SnapToTimingCheckBox, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(SnapToTimingCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Double Click Mode"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
GridBagSizer1->Add(StaticText1, wxGBPosition(4, 0), wxDefaultSpan, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(StaticText1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
DoubleClickChoice = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2"));
DoubleClickChoice->Append(_("Edit Text"));
DoubleClickChoice->SetSelection( DoubleClickChoice->Append(_("Play Timing")) );
GridSizer1->Add(DoubleClickChoice, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SmallWaveformCheckBox = new wxCheckBox(this, ID_CHECKBOX4, _("Small Waveform"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX4"));
SmallWaveformCheckBox->SetValue(false);
GridBagSizer1->Add(SmallWaveformCheckBox, wxGBPosition(5, 0), wxGBSpan(1, 2), wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(SmallWaveformCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
TransistionMarksCheckBox = new wxCheckBox(this, ID_CHECKBOX6, _("Display Transition Marks"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
TransistionMarksCheckBox->SetValue(true);
GridBagSizer1->Add(TransistionMarksCheckBox, wxGBPosition(6, 0), wxGBSpan(1, 2), wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(TransistionMarksCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
GridSizer1->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
ColorUpdateWarnCheckBox = new wxCheckBox(this, ID_CHECKBOX5, _("Hide Color Update Warning"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5"));
ColorUpdateWarnCheckBox->SetValue(false);
GridBagSizer1->Add(ColorUpdateWarnCheckBox, wxGBPosition(7, 0), wxDefaultSpan, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
DoubleClickChoice = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2"));
DoubleClickChoice->Append(_("Edit Text"));
DoubleClickChoice->SetSelection( DoubleClickChoice->Append(_("Play Timing")) );
GridBagSizer1->Add(DoubleClickChoice, wxGBPosition(4, 1), wxDefaultSpan, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(GridBagSizer1);
GridBagSizer1->Fit(this);
GridBagSizer1->SetSizeHints(this);

Connect(ID_CHOICE1,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnGridSpacingChoiceSelect);
Connect(ID_CHECKBOX1,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnIconBackgroundsCheckBoxClick);
Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnNodeValuesCheckBoxClick);
Connect(ID_CHECKBOX3,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnSnapToTimingCheckBoxClick);
Connect(ID_CHECKBOX4,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnSmallWaveformCheckBoxClick);
Connect(ID_CHECKBOX6,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnTransistionMarksCheckBoxClick);
Connect(ID_CHECKBOX5,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnColorUpdateWarnCheckBoxClick);
Connect(ID_CHOICE2,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&EffectsGridSettingsPanel::OnDoubleClickChoiceSelect);
GridSizer1->Add(ColorUpdateWarnCheckBox, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(GridSizer1);

Connect(ID_CHOICE1, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnGridSpacingChoiceSelect);
Connect(ID_CHECKBOX1, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnIconBackgroundsCheckBoxClick);
Connect(ID_CHECKBOX2, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnNodeValuesCheckBoxClick);
Connect(ID_CHECKBOX7, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnGroupEffectIndicatorClick);
Connect(ID_CHECKBOX3, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnSnapToTimingCheckBoxClick);
Connect(ID_CHOICE2, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnDoubleClickChoiceSelect);
Connect(ID_CHECKBOX4, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnSmallWaveformCheckBoxClick);
Connect(ID_CHECKBOX6, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnTransistionMarksCheckBoxClick);
Connect(ID_CHECKBOX5, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&EffectsGridSettingsPanel::OnColorUpdateWarnCheckBoxClick);
//*)
}

Expand All @@ -110,6 +119,7 @@ bool EffectsGridSettingsPanel::TransferDataToWindow() {
SnapToTimingCheckBox->SetValue(frame->SnapToTimingMarks());
TransistionMarksCheckBox->SetValue(!frame->IsSuppressFadeHints());
ColorUpdateWarnCheckBox->SetValue(frame->SuppressColorWarn());
GroupEffectIndicator->SetValue(frame->ShowGroupEffectIndicator());
int gs = frame->GridSpacing();
switch (gs) {
case 48:
Expand Down Expand Up @@ -157,6 +167,7 @@ bool EffectsGridSettingsPanel::TransferDataFromWindow() {
frame->SetSnapToTimingMarks(SnapToTimingCheckBox->IsChecked());
frame->SetSuppressFadeHints(!TransistionMarksCheckBox->IsChecked());
frame->SetSuppressColorWarn(ColorUpdateWarnCheckBox->IsChecked());
frame->SetShowGroupEffectIndicator(GroupEffectIndicator->IsChecked());
return true;
}

Expand Down Expand Up @@ -216,3 +227,10 @@ void EffectsGridSettingsPanel::OnColorUpdateWarnCheckBoxClick(wxCommandEvent& ev
TransferDataFromWindow();
}
}

void EffectsGridSettingsPanel::OnGroupEffectIndicatorClick(wxCommandEvent& event)
{
if (wxPreferencesEditor::ShouldApplyChangesImmediately()) {
TransferDataFromWindow();
}
}
23 changes: 13 additions & 10 deletions xLights/preferences/EffectsGridSettingsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <wx/panel.h>
class wxCheckBox;
class wxChoice;
class wxGridBagSizer;
class wxGridSizer;
class wxStaticText;
//*)

Expand All @@ -28,6 +28,7 @@ class EffectsGridSettingsPanel: public wxPanel

//(*Declarations(EffectsGridSettingsPanel)
wxCheckBox* ColorUpdateWarnCheckBox;
wxCheckBox* GroupEffectIndicator;
wxCheckBox* IconBackgroundsCheckBox;
wxCheckBox* NodeValuesCheckBox;
wxCheckBox* SmallWaveformCheckBox;
Expand All @@ -44,15 +45,16 @@ class EffectsGridSettingsPanel: public wxPanel
protected:

//(*Identifiers(EffectsGridSettingsPanel)
static const long ID_CHOICE1;
static const long ID_CHECKBOX1;
static const long ID_CHECKBOX2;
static const long ID_CHECKBOX3;
static const long ID_STATICTEXT1;
static const long ID_CHECKBOX4;
static const long ID_CHECKBOX6;
static const long ID_CHECKBOX5;
static const long ID_CHOICE2;
static const wxWindowID ID_CHOICE1;
static const wxWindowID ID_CHECKBOX1;
static const wxWindowID ID_CHECKBOX2;
static const wxWindowID ID_CHECKBOX7;
static const wxWindowID ID_CHECKBOX3;
static const wxWindowID ID_STATICTEXT1;
static const wxWindowID ID_CHOICE2;
static const wxWindowID ID_CHECKBOX4;
static const wxWindowID ID_CHECKBOX6;
static const wxWindowID ID_CHECKBOX5;
//*)

private:
Expand All @@ -68,6 +70,7 @@ class EffectsGridSettingsPanel: public wxPanel
void OnTransistionMarksCheckBoxClick(wxCommandEvent& event);
void OnDoubleClickChoiceSelect(wxCommandEvent& event);
void OnColorUpdateWarnCheckBoxClick(wxCommandEvent& event);
void OnGroupEffectIndicatorClick(wxCommandEvent& event);
//*)

DECLARE_EVENT_TABLE()
Expand Down
5 changes: 1 addition & 4 deletions xLights/sequencer/RowHeading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,11 +1738,8 @@ void RowHeading::render( wxPaintEvent& event )
}

bool hasEffects = rowInfo->element->HasEffects();
if (!hasEffects && m->GetDisplayAs() == "ModelGroup")
{
if (!hasEffects && groupEffectIndicator && m->GetDisplayAs() == "ModelGroup") {
// model groups are only marked if model group has direct effects or the model with effects is otherwise hidden in the view
hasEffects = rowInfo->element->HasEffects();

int view = mSequenceElements->GetCurrentView();
ModelGroup* mg = dynamic_cast<ModelGroup*>(m);
auto models = mg->ModelNames();
Expand Down
4 changes: 4 additions & 0 deletions xLights/sequencer/RowHeading.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class RowHeading : public wxWindow
void SetCanPaste(bool value) { mCanPaste = value; }
void ToggleExpand(Element * element);
void SelectTiming(int timing);

void SetShowGroupEffectIndicator(bool b) { groupEffectIndicator = b; }

static int rowHeadingSize;

Expand Down Expand Up @@ -78,6 +80,8 @@ class RowHeading : public wxWindow
bool mCanPaste = false;
const int _minRowHeadingWidth = 158;
bool _dragging = false;
bool groupEffectIndicator = true;


static const long ID_ROW_MNU_INSERT_LAYER_ABOVE;
static const long ID_ROW_MNU_INSERT_LAYER_BELOW;
Expand Down
Loading

1 comment on commit 8773478

@derwin12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on disabling this (drawing the yellow & drawing the effect backgrounds) when doing a batch render? Why bother going thru that code just for a batch render?

Please sign in to comment.