NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
cellvalueshader.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2022 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#ifndef CELLVALUESHADER_HPP
20#define CELLVALUESHADER_HPP
21
22#include <wx/dialog.h>
23#include <wx/notebook.h>
24#include <wx/clrpicker.h>
25#include <wx/statline.h>
26#include "grouppanel.hpp"
27#include "../../kernel/core/ui/language.hpp"
28#include "../../kernel/core/utils/stringtools.hpp"
29
30extern double g_pixelScale;
31
32
33
40{
42 {
57 };
58
60 std::vector<mu::value_type> m_vals;
61 std::vector<wxString> m_strs;
62};
63
64
71{
72 private:
73 std::vector<wxColour> m_colorArray;
75
86 wxColour interpolateColor(double val, bool excl) const
87 {
88 if (isnan(val) || isinf(val))
89 return *wxWHITE;
90
91 // Scale to number of colours
92 val *= m_colorArray.size() - 1 - (excl*2); // 5-2-1 => 3
93
94 // Get index and fraction
95 int index = std::floor(val); // 3
96 double part = val - index;
97 index += excl; // 4
98
99 // Safety part
100 if (index+1 >= (int)m_colorArray.size() || (excl && part && index+2 >= (int)m_colorArray.size()))
101 return m_colorArray.back();
102 else if (index < excl)
103 return m_colorArray.front();
104
105 // Calculate the interpolation
106 return wxColour((1.0-part) * m_colorArray[index].Red() + part * m_colorArray[index+1].Red(),
107 (1.0-part) * m_colorArray[index].Green() + part * m_colorArray[index+1].Green(),
108 (1.0-part) * m_colorArray[index].Blue() + part * m_colorArray[index+1].Blue());
109 }
110
111 public:
113 CellValueShader(const std::vector<wxColour>& colors, const CellValueShaderCondition& cond) : m_colorArray(colors), m_condition(cond) {}
115
123 bool isActive() const
124 {
125 return m_colorArray.size();
126 }
127
136 wxColour getColour(const mu::value_type& val) const
137 {
138 switch (m_condition.m_type)
139 {
141 {
142 if (std::find(m_condition.m_vals.begin(), m_condition.m_vals.end(), val) != m_condition.m_vals.end())
143 return m_colorArray.front();
144
145 break;
146 }
148 {
149 if (std::find(m_condition.m_vals.begin(), m_condition.m_vals.end(), val) != m_condition.m_vals.end())
150 return *wxWHITE;
151
152 return m_colorArray.front();
153 }
155 {
156 if (val.real() < m_condition.m_vals.front().real())
157 return m_colorArray.front();
158
159 break;
160 }
162 {
163 if (val.real() > m_condition.m_vals.front().real())
164 return m_colorArray.front();
165
166 break;
167 }
169 {
170 if (val.real() <= m_condition.m_vals.front().real())
171 return m_colorArray.front();
172
173 break;
174 }
176 {
177 if (val.real() >= m_condition.m_vals.front().real())
178 return m_colorArray.front();
179
180 break;
181 }
183 {
184 return interpolateColor((val.real() - m_condition.m_vals.front().real())
185 / (m_condition.m_vals.back().real()-m_condition.m_vals.front().real()), false);
186 }
188 {
189 return interpolateColor((val.real() - m_condition.m_vals.front().real())
190 / (m_condition.m_vals.back().real()-m_condition.m_vals.front().real()), true);
191 }
193 {
194 return interpolateColor((val.imag() - m_condition.m_vals.front().imag())
195 / (m_condition.m_vals.back().imag()-m_condition.m_vals.front().imag()), false);
196 }
198 {
199 return interpolateColor((val.imag() - m_condition.m_vals.front().imag())
200 / (m_condition.m_vals.back().imag()-m_condition.m_vals.front().imag()), true);
201 }
202 }
203
204 return *wxWHITE;
205 }
206
215 wxColour getColour(const wxString& strVal) const
216 {
217 auto removeQuotes = [](const wxString& strVal) {return strVal[0] == '"' && strVal[strVal.length()-1] == '"'
218 ? strVal.substr(1, strVal.length()-2) : strVal;};
220 {
221 if (std::find(m_condition.m_strs.begin(), m_condition.m_strs.end(), removeQuotes(strVal)) != m_condition.m_strs.end())
222 return m_colorArray.front();
223 }
225 {
226 if (std::find(m_condition.m_strs.begin(), m_condition.m_strs.end(), removeQuotes(strVal)) != m_condition.m_strs.end())
227 return *wxWHITE;
228
229 return m_colorArray.front();
230 }
232 {
233 for (const auto& sStr : m_condition.m_strs)
234 {
235 if (strVal.find(sStr) != std::string::npos)
236 return m_colorArray.front();
237 }
238 }
240 {
241 for (const auto& sStr : m_condition.m_strs)
242 {
243 if (strVal.find(sStr) != std::string::npos)
244 return *wxWHITE;
245 }
246
247 return m_colorArray.front();
248 }
249
250 return *wxWHITE;
251 }
252};
253
254
260class CellValueShaderDialog : public wxDialog
261{
262 private:
264 wxNotebook* m_book;
265
266 // Single values page attributes
267 wxChoice* m_lt_gt_choice;
269 wxColourPickerCtrl* m_lt_gt_colour;
270
271 // Intervall page attributes
274 wxColourPickerCtrl* m_interval_col[3];
275
276 // Excl-intervall page attributes
279 wxColourPickerCtrl* m_interval_col_excl[5];
280
281 // Statics to be updated everytime the
282 // user clicks on "Apply"
283 static wxColour LEVELCOLOUR;
284 static wxColour LOWERCOLOUR;
285 static wxColour MINCOLOUR;
286 static wxColour MEDCOLOUR;
287 static wxColour MAXCOLOUR;
288 static wxColour HIGHERCOLOUR;
289 static bool USEALLCOLOURS;
290
291 const size_t FIELDWIDTH = 120;
292
293
298 enum
299 {
303 };
304
313 {
314 GroupPanel* _panel = new GroupPanel(m_book);
315
316 // Create the condition box
317 wxStaticBoxSizer* hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_CONDITION"), wxVERTICAL, _panel, _panel->getMainSizer(), 0);
318 wxBoxSizer* condSizer = _panel->createGroup(wxHORIZONTAL, hsizer, 0);
319 _panel->AddStaticText(hsizer->GetStaticBox(), condSizer, _guilang.get("GUI_DLG_CVS_VALUES"));
320
321 // Define the possible comparisons
322 wxArrayString lt_gt;
323 lt_gt.Add("<");
324 lt_gt.Add("<=");
325 lt_gt.Add(">");
326 lt_gt.Add(">=");
327 lt_gt.Add("==");
328 lt_gt.Add("!=");
329 lt_gt.Add(_guilang.get("GUI_DLG_CVS_LT_GT_EQ_CONTAINS"));
330 lt_gt.Add(_guilang.get("GUI_DLG_CVS_LT_GT_EQ_NOT_CONTAINS"));
331
332 // Create the dropdown containing the possible comparisons
333 m_lt_gt_choice = _panel->CreateChoices(hsizer->GetStaticBox(), condSizer, lt_gt);
334 m_lt_gt_choice->SetSelection(0);
335
336 m_lt_gt_value = _panel->CreateTextInput(hsizer->GetStaticBox(), condSizer, _guilang.get("GUI_DLG_CVS_LT_GT_EQ_VALUE"), wxEmptyString, 0, wxID_ANY, wxSize(320, -1));
337
338 // We accept multiple values here: show a description
339 _panel->AddStaticText(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_LT_GT_EQ_VALUE_EXP"));
340
341 hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_COLORS"), wxHORIZONTAL, _panel, _panel->getMainSizer(), 0);
342 m_lt_gt_colour = new wxColourPickerCtrl(hsizer->GetStaticBox(), wxID_ANY);
343 m_lt_gt_colour->SetColour(LEVELCOLOUR);
344 hsizer->Add(m_lt_gt_colour, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
345
346 m_book->AddPage(_panel, _guilang.get("GUI_DLG_CVS_LT_GT_EQ"));
347 }
348
358 void createIntervalPage(double minVal, double maxVal)
359 {
360 GroupPanel* _panel = new GroupPanel(m_book);
361
362 wxStaticBoxSizer* hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_CONDITION"), wxHORIZONTAL, _panel, _panel->getMainSizer(), 0);
363 // Create the condition box
364 m_interval_start = _panel->CreateTextInput(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_INTERVAL_START"), toString(minVal, 5), 0, wxID_ANY, wxSize(FIELDWIDTH, -1));
365 _panel->AddStaticText(hsizer->GetStaticBox(), hsizer, "<= " + _guilang.get("GUI_DLG_CVS_VALUES") + " <=");
366 m_interval_end = _panel->CreateTextInput(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_INTERVAL_END"), toString(maxVal, 5), 0, wxID_ANY, wxSize(FIELDWIDTH, -1));
367
368 hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_COLORS"), wxVERTICAL, _panel, _panel->getMainSizer(), 0);
369 wxBoxSizer* colorsizer = _panel->createGroup(wxHORIZONTAL, hsizer, 0);
370
371 // Create three colour pickers
372 for (size_t i = 0; i < 3; i++)
373 m_interval_col[i] = new wxColourPickerCtrl(hsizer->GetStaticBox(), wxID_ANY);
374
375 // Set the statics as colours and change the enable state
376 // of the middle picker
377 m_interval_col[0]->SetColour(MINCOLOUR);
378 m_interval_col[1]->SetColour(MEDCOLOUR);
379 m_interval_col[1]->Enable(USEALLCOLOURS);
380 m_interval_col[2]->SetColour(MAXCOLOUR);
381
382 // Add the pickers to the sizer
383 for (size_t i = 0; i < 3; i++)
384 colorsizer->Add(m_interval_col[i], 0, wxALIGN_CENTER | wxALL, 5);
385
386 wxCheckBox* check = _panel->CreateCheckBox(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_COLOR_COUNT", "3"));
387 check->SetValue(USEALLCOLOURS);
388
389 m_book->AddPage(_panel, _guilang.get("GUI_DLG_CVS_INTERVAL"));
390 }
391
401 void createIntervalExclPage(double minVal, double maxVal)
402 {
403 GroupPanel* _panel = new GroupPanel(m_book);
404
405 // Create the condition box
406 wxStaticBoxSizer* hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_CONDITION"), wxHORIZONTAL, _panel, _panel->getMainSizer(), 0);
407 m_interval_start_excl = _panel->CreateTextInput(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_INTERVAL_EXCL_START"), toString(minVal, 5), 0, wxID_ANY, wxSize(FIELDWIDTH, -1));
408 _panel->AddStaticText(hsizer->GetStaticBox(), hsizer, "<= " + _guilang.get("GUI_DLG_CVS_VALUES") + " <=");
409 m_interval_end_excl = _panel->CreateTextInput(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_INTERVAL_EXCL_END"), toString(maxVal, 5), 0, wxID_ANY, wxSize(FIELDWIDTH, -1));
410
411 hsizer = _panel->createGroup(_guilang.get("GUI_DLG_CVS_COLORS"), wxVERTICAL, _panel, _panel->getMainSizer(), 0);
412 wxBoxSizer* colorsizer = _panel->createGroup(wxHORIZONTAL, hsizer, 0);
413
414 // Create 5 colour pickers
415 for (size_t i = 0; i < 5; i++)
416 m_interval_col_excl[i] = new wxColourPickerCtrl(hsizer->GetStaticBox(), wxID_ANY);
417
418 // Set the statics as colours and change the enable state
419 // of the middle picker
420 m_interval_col_excl[0]->SetColour(LOWERCOLOUR);
421 m_interval_col_excl[1]->SetColour(MINCOLOUR);
422 m_interval_col_excl[2]->SetColour(MEDCOLOUR);
424 m_interval_col_excl[3]->SetColour(MAXCOLOUR);
425 m_interval_col_excl[4]->SetColour(HIGHERCOLOUR);
426
427 // Add the first picker followed by a separating line
428 colorsizer->Add(m_interval_col_excl[0], 0, wxALIGN_CENTER | wxALL, 5);
429 wxStaticLine* line = new wxStaticLine(hsizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVERTICAL);
430 colorsizer->Add(line, 0, wxEXPAND | wxALL, 5);
431
432 // Add the middle three pickers
433 for (size_t i = 1; i < 4; i++)
434 colorsizer->Add(m_interval_col_excl[i], 0, wxALIGN_CENTER | wxALL, 5);
435
436 // Add anoother separating line and the last picker
437 line = new wxStaticLine(hsizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVERTICAL);
438 colorsizer->Add(line, 0, wxEXPAND | wxALL, 5);
439 colorsizer->Add(m_interval_col_excl[4], 0, wxALIGN_CENTER | wxALL, 5);
440
441 wxCheckBox* check = _panel->CreateCheckBox(hsizer->GetStaticBox(), hsizer, _guilang.get("GUI_DLG_CVS_COLOR_COUNT", "5"));
442 check->SetValue(USEALLCOLOURS);
443
444 m_book->AddPage(_panel, _guilang.get("GUI_DLG_CVS_INTERVAL_EXCL"));
445 }
446
455 void OnCheckBox(wxCommandEvent& event)
456 {
457 if (m_book->GetSelection() == INTERVAL)
458 m_interval_col[1]->Enable(event.IsChecked());
459 else if (m_book->GetSelection() == INTERVAL_EXCL)
460 m_interval_col_excl[2]->Enable(event.IsChecked());
461 }
462
463
464 public:
474 CellValueShaderDialog(wxWindow* parent, double minVal, double maxVal, wxWindowID id = wxID_ANY) : wxDialog(parent, id, _guilang.get("GUI_DLG_CVS_HEAD"))
475 {
476 wxBoxSizer* vsizer = new wxBoxSizer(wxVERTICAL);
477 SetSizer(vsizer);
478 m_book = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(640*g_pixelScale, 220*g_pixelScale));
479
480 // Create the various pages containing different shader conditions
482 createIntervalPage(minVal, maxVal);
483 createIntervalExclPage(minVal, maxVal);
484
485 vsizer->Add(m_book, 0, wxALL, 5);
486
487 // Select the single condition page
488 m_book->SetSelection(LT_GT_EQ);
489
490 // Create the apply and cancel buttons
491 wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
492 vsizer->Add(buttonSizer, 0, wxALIGN_RIGHT | wxALL, 0);
493 wxButton* okButton = new wxButton(this, wxID_OK, _guilang.get("GUI_OPTIONS_OK"), wxDefaultPosition, wxDefaultSize, 0);
494 wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _guilang.get("GUI_OPTIONS_CANCEL"), wxDefaultPosition, wxDefaultSize, 0);
495 buttonSizer->Add(okButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
496 buttonSizer->Add(cancelButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
497 vsizer->SetSizeHints(this);
498 }
499
509 void OnButtonClick(wxCommandEvent& event)
510 {
511 if (event.GetId() == wxID_OK)
512 {
513 // Prepare the needed internals for the
514 // shader
516 std::vector<wxColour> colors;
517
518 int sel = m_book->GetSelection();
519
520 switch (sel)
521 {
522 case LT_GT_EQ:
523 {
524 // Extract the value and convert multiple values into
525 // a vector
526 std::string val = m_lt_gt_value->GetValue().ToStdString();
527
528 if (!val.length())
529 break;
530
531 std::vector<std::string> vecVal;
532
533 if (val.front() == '{' && val.back() == '}')
534 vecVal = toStrVector(val);
535 else
536 vecVal.push_back(val);
537
538 if (!vecVal.size())
539 break;
540
541 // Get colour and update the statics
542 colors.push_back(m_lt_gt_colour->GetColour());
543 LEVELCOLOUR = m_lt_gt_colour->GetColour();
544
545 // Get the string from the dropdown
546 wxString condType = m_lt_gt_choice->GetString(m_lt_gt_choice->GetSelection());
547
548 // Determine the correct condition depending on the
549 // dropdown and the type of the comparison value
550 if (condType == "<")
552 else if (condType == ">")
554 else if (condType == "<=")
556 else if (condType == ">=")
558 else if (condType == "==" && (isConvertible(vecVal.front(), CONVTYPE_VALUE)
559 || isConvertible(vecVal.front(), CONVTYPE_DATE_TIME)))
561 else if (condType == "==")
563 else if (condType == "!=" && (isConvertible(vecVal.front(), CONVTYPE_VALUE)
564 || isConvertible(vecVal.front(), CONVTYPE_DATE_TIME)))
566 else if (condType == "!=")
568 else if (condType == _guilang.get("GUI_DLG_CVS_LT_GT_EQ_CONTAINS"))
570 else if (condType == _guilang.get("GUI_DLG_CVS_LT_GT_EQ_NOT_CONTAINS"))
572
573 // Insert the comparison values into the internal vectors
574 for (const auto& s : vecVal)
575 {
577 cond.m_vals.push_back(to_double(StrToTime(s)));
578 else if (isConvertible(s, CONVTYPE_VALUE))
579 cond.m_vals.push_back(StrToCmplx(s));
580 else
581 cond.m_strs.push_back(s);
582 }
583
584 break;
585 }
586 case INTERVAL:
587 {
588 // Get the colours
589 for (size_t i = 0; i < 3; i++)
590 {
591 if (m_interval_col[i]->IsEnabled())
592 colors.push_back(m_interval_col[i]->GetColour());
593 }
594
595 // Update statics
596 MINCOLOUR = m_interval_col[0]->GetColour();
597
598 if (m_interval_col[1]->IsEnabled())
599 MEDCOLOUR = m_interval_col[1]->GetColour();
600
601 MAXCOLOUR = m_interval_col[2]->GetColour();
602 USEALLCOLOURS = m_interval_col[1]->IsEnabled();
603
604 // Get the values
605 std::string val_start = m_interval_start->GetValue().ToStdString();
606 std::string val_end = m_interval_end->GetValue().ToStdString();
607
608 // Set the correct condition
610
611 // Convert the values into internal types
612 if (isConvertible(val_start, CONVTYPE_DATE_TIME))
613 cond.m_vals.push_back(to_double(StrToTime(val_start)));
614 else if (isConvertible(val_start, CONVTYPE_VALUE))
615 cond.m_vals.push_back(StrToCmplx(val_start));
616 else
617 cond.m_vals.push_back(NAN);
618
619 if (isConvertible(val_end, CONVTYPE_DATE_TIME))
620 cond.m_vals.push_back(to_double(StrToTime(val_end)));
621 else if (isConvertible(val_end, CONVTYPE_VALUE))
622 cond.m_vals.push_back(StrToCmplx(val_end));
623 else
624 cond.m_vals.push_back(NAN);
625
626 break;
627 }
628 case INTERVAL_EXCL:
629 {
630 // Get the colours
631 for (size_t i = 0; i < 5; i++)
632 {
633 if (m_interval_col_excl[i]->IsEnabled())
634 colors.push_back(m_interval_col_excl[i]->GetColour());
635 }
636
637 // Update statics
638 LOWERCOLOUR = m_interval_col_excl[0]->GetColour();
639 MINCOLOUR = m_interval_col_excl[1]->GetColour();
640
641 if (m_interval_col_excl[2]->IsEnabled())
642 MEDCOLOUR = m_interval_col_excl[2]->GetColour();
643
644 MAXCOLOUR = m_interval_col_excl[3]->GetColour();
645 HIGHERCOLOUR = m_interval_col_excl[4]->GetColour();
646 USEALLCOLOURS = m_interval_col_excl[2]->IsEnabled();
647
648 // Get the values
649 std::string val_start = m_interval_start_excl->GetValue().ToStdString();
650 std::string val_end = m_interval_end_excl->GetValue().ToStdString();
651
652 // Set the correct condition
654
655 // Convert the values into internal types
656 if (isConvertible(val_start, CONVTYPE_DATE_TIME))
657 cond.m_vals.push_back(to_double(StrToTime(val_start)));
658 else if (isConvertible(val_start, CONVTYPE_VALUE))
659 cond.m_vals.push_back(StrToCmplx(val_start));
660 else
661 cond.m_vals.push_back(NAN);
662
663 if (isConvertible(val_end, CONVTYPE_DATE_TIME))
664 cond.m_vals.push_back(to_double(StrToTime(val_end)));
665 else if (isConvertible(val_end, CONVTYPE_VALUE))
666 cond.m_vals.push_back(StrToCmplx(val_end));
667 else
668 cond.m_vals.push_back(NAN);
669
670 break;
671 }
672 }
673
674 m_shader = CellValueShader(colors, cond);
675 }
676
677 // Return the ID of the clicked button
678 EndModal(event.GetId());
679 }
680
689 {
690 return m_shader;
691 }
692
694};
695
696
697BEGIN_EVENT_TABLE(CellValueShaderDialog, wxDialog)
699 EVT_CHECKBOX(-1, CellValueShaderDialog::OnCheckBox)
701
702
703wxColour CellValueShaderDialog::LEVELCOLOUR = wxColour(128,128,255);
704wxColour CellValueShaderDialog::LOWERCOLOUR = wxColour(64,64,64);
705wxColour CellValueShaderDialog::MINCOLOUR = wxColour(128,0,0);
706wxColour CellValueShaderDialog::MEDCOLOUR = wxColour(255,128,0);
707wxColour CellValueShaderDialog::MAXCOLOUR = wxColour(255,255,128);
708wxColour CellValueShaderDialog::HIGHERCOLOUR = wxColour(255,255,255);
709bool CellValueShaderDialog::USEALLCOLOURS = false;
710
711#endif // CELLVALUESHADER_HPP
double g_pixelScale
This class implements the dialog for choosing the shader properties of the selected cells.
static wxColour LOWERCOLOUR
const CellValueShader & getShader() const
Get a reference to the internally available shader instance.
void createIntervalPage(double minVal, double maxVal)
This private member function creates the interval page.
CellValueShader m_shader
void createIntervalExclPage(double minVal, double maxVal)
This private member function creates the excluded interval page.
static wxColour HIGHERCOLOUR
static wxColour MAXCOLOUR
wxColourPickerCtrl * m_lt_gt_colour
wxColourPickerCtrl * m_interval_col[3]
CellValueShaderDialog(wxWindow *parent, double minVal, double maxVal, wxWindowID id=wxID_ANY)
Create the dialog.
void OnCheckBox(wxCommandEvent &event)
Event handler for the colour count checkboxes.
void createLtGtPage()
This private member function creates the single value comparison page.
void OnButtonClick(wxCommandEvent &event)
Event handler for the apply and cancel buttons. Will create a valid shader if the user clicked on app...
static wxColour LEVELCOLOUR
wxColourPickerCtrl * m_interval_col_excl[5]
TextField * m_interval_start_excl
static wxColour MEDCOLOUR
static wxColour MINCOLOUR
A class to handle value-based cell shading using a custom colorscheme and custom conditions.
wxColour getColour(const wxString &strVal) const
Calulate the colour for a string value.
std::vector< wxColour > m_colorArray
CellValueShader(const CellValueShader &shader)
wxColour getColour(const mu::value_type &val) const
Calculate the colour for a numerical value.
bool isActive() const
Detect, whether this shader is actually active or an empty shader.
wxColour interpolateColor(double val, bool excl) const
Calculate the cell background colour depending on their value and using linear interpolation.
CellValueShader(const std::vector< wxColour > &colors, const CellValueShaderCondition &cond)
CellValueShaderCondition m_condition
This class simplifies the creation of simple windows and creates a common layout among all windows.
Definition: grouppanel.hpp:188
wxStaticText * AddStaticText(wxWindow *parent, wxSizer *sizer, const wxString &text, int id=wxID_STATIC, int alignment=wxALIGN_CENTER_VERTICAL)
Add some static test to the current sizer and window.
Definition: grouppanel.cpp:140
wxChoice * CreateChoices(wxWindow *parent, wxSizer *sizer, const wxArrayString &choices, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a dropdown list.
Definition: grouppanel.cpp:495
wxCheckBox * CreateCheckBox(wxWindow *parent, wxSizer *sizer, const wxString &description, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a usual checkbox.
Definition: grouppanel.cpp:316
wxBoxSizer * getMainSizer()
Return the pointer to the current main layout sizer.
Definition: grouppanel.cpp:104
wxStaticBoxSizer * createGroup(const wxString &sGroupName, int orient=wxVERTICAL, wxWindow *parent=nullptr, wxSizer *sizer=nullptr, int expand=0)
Member function to create a group (a static box with a label) in the panel.
Definition: grouppanel.cpp:161
TextField * CreateTextInput(wxWindow *parent, wxSizer *sizer, const wxString &description, const wxString &sDefault=wxEmptyString, int nStyle=0, int id=wxID_ANY, const wxSize &size=wxSize(310,-1), int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a text input.
Definition: grouppanel.cpp:285
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
Definition: language.cpp:292
This class is a extension to the standard wxTextCtrl to combine it with a read- and changeable label.
Definition: grouppanel.hpp:113
double to_double(sys_time_point tp)
Convert a sys_time_point to a double. The double is returned in units of seconds.
Language _guilang
CONSTCD14 std::enable_if< detail::no_overflow< Period, typenameTo::period >::value, To >::type floor(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1251
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:251
bool isnan(const value_type &v)
Definition: muParserDef.h:379
bool isinf(const value_type &v)
Definition: muParserDef.h:374
std::string get(const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord)
Get the contents of a URL.
Definition: http.cpp:251
std::vector< std::string > toStrVector(std::string sString)
This function converts a std::string into a std::vector, where the string shall be passed as "{x,...
sys_time_point StrToTime(const std::string &sString)
Convert a string to a sys_time_point.
bool isConvertible(const std::string &sStr, ConvertibleType type)
This function checks, whether a string can be converted to the selected ConvertibleType.
std::complex< double > StrToCmplx(const std::string &sString)
Converts a string into a complex number.
@ CONVTYPE_DATE_TIME
Definition: stringtools.hpp:45
@ CONVTYPE_VALUE
Definition: stringtools.hpp:44
Represents the basic settings needed by the CellValueShader class to actually calculate the cell shad...
std::vector< mu::value_type > m_vals
std::vector< wxString > m_strs
std::string toString(int)
Converts an integer to a string without the Settings bloat.
END_EVENT_TABLE()