diff --git a/src/AlarmMaskComponent.cpp b/src/AlarmMaskComponent.cpp index 46417ef..09755d0 100644 --- a/src/AlarmMaskComponent.cpp +++ b/src/AlarmMaskComponent.cpp @@ -19,7 +19,7 @@ void AlarmMaskComponent::on_content_changed(bool initial) { for (std::uint16_t i = 0; i < this->get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask != child->get_object_type())) { @@ -41,7 +41,7 @@ void AlarmMaskComponent::on_content_changed(bool initial) void AlarmMaskComponent::paint(Graphics &g) { - auto vtColour = colourTable.get_colour(backgroundColor); + auto vtColour = parentWorkingSet->get_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } diff --git a/src/ButtonComponent.cpp b/src/ButtonComponent.cpp index 1e2bf60..a1d37eb 100644 --- a/src/ButtonComponent.cpp +++ b/src/ButtonComponent.cpp @@ -16,7 +16,7 @@ ButtonComponent::ButtonComponent(std::shared_ptrget_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -33,7 +33,7 @@ ButtonComponent::ButtonComponent(std::shared_ptrget_colour(backgroundColor); if (true == get_option(Options::TransparentBackground)) { @@ -46,7 +46,7 @@ void ButtonComponent::paint(Graphics &g) if (false == get_option(Options::NoBorder)) { - vtColour = colourTable.get_colour(get_border_colour()); + vtColour = parentWorkingSet->get_colour(get_border_colour()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); g.drawRect(0, 0, get_width(), get_height(), 4); } diff --git a/src/ContainerComponent.cpp b/src/ContainerComponent.cpp index 066af1e..65e9c7e 100644 --- a/src/ContainerComponent.cpp +++ b/src/ContainerComponent.cpp @@ -15,7 +15,7 @@ ContainerComponent::ContainerComponent(std::shared_ptrget_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { diff --git a/src/DataMaskComponent.cpp b/src/DataMaskComponent.cpp index a1e840d..bc30d2a 100644 --- a/src/DataMaskComponent.cpp +++ b/src/DataMaskComponent.cpp @@ -19,7 +19,7 @@ void DataMaskComponent::on_content_changed(bool initial) { for (std::uint16_t i = 0; i < this->get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask != child->get_object_type())) { @@ -41,7 +41,7 @@ void DataMaskComponent::on_content_changed(bool initial) void DataMaskComponent::paint(Graphics &g) { - auto vtColour = colourTable.get_colour(backgroundColor); + auto vtColour = parentWorkingSet->get_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } diff --git a/src/DataMaskRenderAreaComponent.cpp b/src/DataMaskRenderAreaComponent.cpp index 9f69654..e4877b1 100644 --- a/src/DataMaskRenderAreaComponent.cpp +++ b/src/DataMaskRenderAreaComponent.cpp @@ -150,7 +150,7 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event) for (std::uint32_t i = 0; i < clickedList->get_number_children(); i++) { - auto child = clickedList->get_object_by_id(clickedList->get_child_id(static_cast(i))); + auto child = clickedList->get_object_by_id(clickedList->get_child_id(static_cast(i)), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -181,7 +181,7 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event) if (isobus::NULL_OBJECT_ID != clickedList->get_variable_reference()) { - auto child = clickedList->get_object_by_id(clickedList->get_variable_reference()); + auto child = clickedList->get_object_by_id(clickedList->get_variable_reference(), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -224,7 +224,7 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event) for (std::uint16_t i = 0; i < clickedNumber->get_number_children(); i++) { - auto child = clickedNumber->get_object_by_id(clickedNumber->get_child_id(i)); + auto child = clickedNumber->get_object_by_id(clickedNumber->get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -259,7 +259,7 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event) for (std::uint32_t i = 0; i < clickedNumber->get_number_children(); i++) { - auto child = clickedNumber->get_object_by_id(clickedNumber->get_child_id(static_cast(i))); + auto child = clickedNumber->get_object_by_id(clickedNumber->get_child_id(static_cast(i)), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())) { @@ -307,7 +307,7 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event) for (std::uint16_t i = 0; i < clickedBool->get_number_children(); i++) { - auto child = clickedBool->get_object_by_id(clickedBool->get_child_id(i)); + auto child = clickedBool->get_object_by_id(clickedBool->get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -383,7 +383,7 @@ std::shared_ptr DataMaskRenderAreaComponent::getClickedChildRe for (std::uint16_t i = 0; i < object->get_number_children(); i++) { - auto child = object->get_object_by_id(object->get_child_id(i)); + auto child = object->get_object_by_id(object->get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (objectCanBeClicked(child)) && diff --git a/src/InputBooleanComponent.cpp b/src/InputBooleanComponent.cpp index af84593..5acffa2 100644 --- a/src/InputBooleanComponent.cpp +++ b/src/InputBooleanComponent.cpp @@ -18,7 +18,7 @@ InputBooleanComponent::InputBooleanComponent(std::shared_ptrget_colour(get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); g.drawRect(0, 0, static_cast(get_width()), static_cast(get_height()), 0); @@ -26,11 +26,11 @@ void InputBooleanComponent::paint(Graphics &g) // Change colour to foreground colour if present for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::FontAttributes == child->get_object_type())) { - vtColour = colourTable.get_colour(std::static_pointer_cast(child)->get_background_color()); + vtColour = parentWorkingSet->get_colour(std::static_pointer_cast(child)->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); break; } @@ -40,7 +40,7 @@ void InputBooleanComponent::paint(Graphics &g) // Change use number variable if one was provided for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())) { diff --git a/src/InputListComponent.cpp b/src/InputListComponent.cpp index 01c3e46..84739fa 100644 --- a/src/InputListComponent.cpp +++ b/src/InputListComponent.cpp @@ -36,7 +36,7 @@ void InputListComponent::onChanged(bool initial) if (isobus::NULL_OBJECT_ID != get_variable_reference()) { - auto child = get_object_by_id(get_variable_reference()); + auto child = get_object_by_id(get_variable_reference(), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -51,7 +51,7 @@ void InputListComponent::onChanged(bool initial) (selectedIndex < static_cast(get_number_children()))) { // The number variable will always be the first one - auto listItem = get_object_by_id(get_child_id(static_cast(selectedIndex))); + auto listItem = get_object_by_id(get_child_id(static_cast(selectedIndex)), parentWorkingSet->get_object_tree()); childComponent = JuceManagedWorkingSetCache::create_component(parentWorkingSet, listItem); if (nullptr != childComponent) diff --git a/src/InputNumberComponent.cpp b/src/InputNumberComponent.cpp index 528d396..6723c52 100644 --- a/src/InputNumberComponent.cpp +++ b/src/InputNumberComponent.cpp @@ -28,7 +28,7 @@ void InputNumberComponent::paint(Graphics &g) { if (isOpaque()) { - auto vtColour = colourTable.get_colour(backgroundColor); + auto vtColour = parentWorkingSet->get_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } @@ -38,7 +38,7 @@ void InputNumberComponent::paint(Graphics &g) // Get font data for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -46,7 +46,7 @@ void InputNumberComponent::paint(Graphics &g) { auto font = std::static_pointer_cast(child); - auto colour = colourTable.get_colour(font->get_background_color()); + auto colour = parentWorkingSet->get_colour(font->get_background_color()); Font juceFont(Font::getDefaultMonospacedFontName(), font->get_font_height_pixels(), Font::FontStyleFlags::plain); auto fontWidth = juceFont.getStringWidthFloat("1"); juceFont.setHorizontalScale(static_cast(font->get_font_width_pixels()) / fontWidth); diff --git a/src/KeyComponent.cpp b/src/KeyComponent.cpp index 7a72b11..42c9e22 100644 --- a/src/KeyComponent.cpp +++ b/src/KeyComponent.cpp @@ -16,7 +16,7 @@ KeyComponent::KeyComponent(std::shared_ptrget_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -33,7 +33,7 @@ KeyComponent::KeyComponent(std::shared_ptrget_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } diff --git a/src/ObjectPointerComponent.cpp b/src/ObjectPointerComponent.cpp index 15d8c61..fea4698 100644 --- a/src/ObjectPointerComponent.cpp +++ b/src/ObjectPointerComponent.cpp @@ -16,7 +16,7 @@ ObjectPointerComponent::ObjectPointerComponent(std::shared_ptrget_object_tree()); if (nullptr != child) { diff --git a/src/OutputEllipseComponent.cpp b/src/OutputEllipseComponent.cpp index 24e541d..08c4c07 100644 --- a/src/OutputEllipseComponent.cpp +++ b/src/OutputEllipseComponent.cpp @@ -18,13 +18,13 @@ void OutputEllipseComponent::paint(Graphics &g) // Ensure we fill first, then draw the outline if needed for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::FillAttributes == child->get_object_type())) { auto fill = std::static_pointer_cast(child); - auto vtColour = colourTable.get_colour(fill->get_background_color()); + auto vtColour = parentWorkingSet->get_colour(fill->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); g.fillEllipse(0, 0, get_width(), get_height()); } @@ -32,13 +32,13 @@ void OutputEllipseComponent::paint(Graphics &g) for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::LineAttributes == child->get_object_type())) { auto line = std::static_pointer_cast(child); - auto vtColour = colourTable.get_colour(line->get_background_color()); + auto vtColour = parentWorkingSet->get_colour(line->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); g.drawEllipse(0, 0, get_width(), get_height(), line->get_width()); } diff --git a/src/OutputLineComponent.cpp b/src/OutputLineComponent.cpp index 9fd122b..a0d2dfc 100644 --- a/src/OutputLineComponent.cpp +++ b/src/OutputLineComponent.cpp @@ -16,7 +16,7 @@ void OutputLineComponent::paint(Graphics &g) { for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::LineAttributes == child->get_object_type())) { @@ -24,7 +24,7 @@ void OutputLineComponent::paint(Graphics &g) { auto line = std::static_pointer_cast(child); - auto vtColour = colourTable.get_colour(line->get_background_color()); + auto vtColour = parentWorkingSet->get_colour(line->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); if (LineDirection::BottomLeftToTopRight == get_line_direction()) diff --git a/src/OutputLinearBarGraphComponent.cpp b/src/OutputLinearBarGraphComponent.cpp index 65a30ab..6bc2210 100644 --- a/src/OutputLinearBarGraphComponent.cpp +++ b/src/OutputLinearBarGraphComponent.cpp @@ -17,13 +17,13 @@ OutputLinearBarGraphComponent::OutputLinearBarGraphComponent(std::shared_ptr(get_value()) / static_cast(get_max_value()); - auto vtBackgroundColour = colourTable.get_colour(get_colour()); - auto vtTargetLineColour = colourTable.get_colour(get_target_line_colour()); + auto vtBackgroundColour = parentWorkingSet->get_colour(get_colour()); + auto vtTargetLineColour = parentWorkingSet->get_colour(get_target_line_colour()); g.setColour(Colour::fromFloatRGBA(vtBackgroundColour.r, vtBackgroundColour.g, vtBackgroundColour.b, 1.0)); for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())) { diff --git a/src/OutputMeterComponent.cpp b/src/OutputMeterComponent.cpp index fb1f5da..b4c8fed 100644 --- a/src/OutputMeterComponent.cpp +++ b/src/OutputMeterComponent.cpp @@ -19,7 +19,7 @@ void OutputMeterComponent::paint(Graphics &g) { if (get_option(Options::DrawBorder)) { - auto vtColour = colourTable.get_colour(get_border_colour()); + auto vtColour = parentWorkingSet->get_colour(get_border_colour()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); g.drawRect(0, 0, static_cast(get_width()), static_cast(get_height()), 1); } @@ -50,14 +50,14 @@ void OutputMeterComponent::paint(Graphics &g) std::uint32_t needleValue = get_value(); if ((this->get_number_children() > 0) && (0xFFFF != this->get_child_id(0))) { - auto varNum = this->get_object_by_id(this->get_child_id(0)); + auto varNum = this->get_object_by_id(this->get_child_id(0), parentWorkingSet->get_object_tree()); if ((nullptr != varNum) && (isobus::VirtualTerminalObjectType::NumberVariable == varNum->get_object_type())) { needleValue = std::static_pointer_cast(varNum)->get_value(); } } - auto vtColour = colourTable.get_colour(get_needle_colour()); + auto vtColour = parentWorkingSet->get_colour(get_needle_colour()); Path needlePath; float endVtAngleDeg = get_end_angle() * 2.0f; float startVtAngleDeg = get_start_angle() * 2.0f; diff --git a/src/OutputNumberComponent.cpp b/src/OutputNumberComponent.cpp index b8c5bb1..ff5499a 100644 --- a/src/OutputNumberComponent.cpp +++ b/src/OutputNumberComponent.cpp @@ -28,7 +28,7 @@ void OutputNumberComponent::paint(Graphics &g) { if (isOpaque()) { - auto vtColour = colourTable.get_colour(backgroundColor); + auto vtColour = parentWorkingSet->get_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } @@ -38,7 +38,7 @@ void OutputNumberComponent::paint(Graphics &g) // Get font data for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -46,7 +46,7 @@ void OutputNumberComponent::paint(Graphics &g) { auto font = std::static_pointer_cast(child); - auto colour = colourTable.get_colour(font->get_colour()); + auto colour = parentWorkingSet->get_colour(font->get_colour()); Font juceFont(Font::getDefaultMonospacedFontName(), font->get_font_height_pixels(), Font::FontStyleFlags::plain); auto fontWidth = juceFont.getStringWidthFloat("1"); juceFont.setHorizontalScale(static_cast(font->get_font_width_pixels()) / fontWidth); diff --git a/src/OutputPolygonComponent.cpp b/src/OutputPolygonComponent.cpp index 641faa0..e5d5211 100644 --- a/src/OutputPolygonComponent.cpp +++ b/src/OutputPolygonComponent.cpp @@ -23,13 +23,13 @@ void OutputPolygonComponent::paint(Graphics &g) for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::LineAttributes == child->get_object_type())) { auto line = std::static_pointer_cast(child); lineWidth = line->get_width(); - auto lineAttributeColour = colourTable.get_colour(line->get_background_color()); + auto lineAttributeColour = parentWorkingSet->get_colour(line->get_background_color()); lineColour = Colour::fromFloatRGBA(lineAttributeColour.r, lineAttributeColour.g, lineAttributeColour.b, 1.0); break; @@ -59,13 +59,13 @@ void OutputPolygonComponent::paint(Graphics &g) for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::FillAttributes == child->get_object_type())) { auto fill = std::static_pointer_cast(child); - auto vtColour = colourTable.get_colour(fill->get_background_color()); + auto vtColour = parentWorkingSet->get_colour(fill->get_background_color()); g.setFillType(FillType(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f))); g.fillPath(polygonPath); break; diff --git a/src/OutputRectangleComponent.cpp b/src/OutputRectangleComponent.cpp index 7dbf9e0..6d6c959 100644 --- a/src/OutputRectangleComponent.cpp +++ b/src/OutputRectangleComponent.cpp @@ -14,18 +14,18 @@ OutputRectangleComponent::OutputRectangleComponent(std::shared_ptrget_colour(backgroundColor); bool isOpaque = false; for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::FillAttributes == child->get_object_type())) { auto fill = std::static_pointer_cast(child); - vtColour = colourTable.get_colour(fill->get_background_color()); + vtColour = parentWorkingSet->get_colour(fill->get_background_color()); switch (std::static_pointer_cast(child)->get_type()) { case isobus::FillAttributes::FillType::FillWithPatternGivenByFillPatternAttribute: @@ -38,12 +38,12 @@ void OutputRectangleComponent::paint(Graphics &g) { for (std::uint16_t j = 0; j < get_number_children(); j++) { - auto childLineAttributes = get_object_by_id(get_child_id(j)); + auto childLineAttributes = get_object_by_id(get_child_id(j), parentWorkingSet->get_object_tree()); if ((nullptr != childLineAttributes) && (isobus::VirtualTerminalObjectType::LineAttributes == childLineAttributes->get_object_type())) { auto line = std::static_pointer_cast(childLineAttributes); - vtColour = colourTable.get_colour(line->get_background_color()); + vtColour = parentWorkingSet->get_colour(line->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0)); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); break; @@ -74,7 +74,7 @@ void OutputRectangleComponent::paint(Graphics &g) for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::LineAttributes == child->get_object_type())) { @@ -83,7 +83,7 @@ void OutputRectangleComponent::paint(Graphics &g) if (0 != line->get_width()) { bool anyLineSuppressed = (0 != get_line_suppression_bitfield()); - vtColour = colourTable.get_colour(line->get_background_color()); + vtColour = parentWorkingSet->get_colour(line->get_background_color()); g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0)); if (!anyLineSuppressed) diff --git a/src/OutputStringComponent.cpp b/src/OutputStringComponent.cpp index 8a062e5..72ce0cf 100644 --- a/src/OutputStringComponent.cpp +++ b/src/OutputStringComponent.cpp @@ -20,7 +20,7 @@ void OutputStringComponent::paint(Graphics &g) if (!get_option(Options::Transparent)) { - auto vtColour = colourTable.get_colour(get_background_color()); + auto vtColour = parentWorkingSet->get_colour(get_background_color()); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } @@ -29,7 +29,7 @@ void OutputStringComponent::paint(Graphics &g) // Get font data for (std::uint16_t i = 0; i < get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -37,7 +37,7 @@ void OutputStringComponent::paint(Graphics &g) { auto font = std::static_pointer_cast(child); - auto colour = colourTable.get_colour(font->get_colour()); + auto colour = parentWorkingSet->get_colour(font->get_colour()); Font juceFont; int fontStyleFlags = Font::FontStyleFlags::plain; diff --git a/src/PictureGraphicComponent.cpp b/src/PictureGraphicComponent.cpp index 47302f4..9aee6b5 100644 --- a/src/PictureGraphicComponent.cpp +++ b/src/PictureGraphicComponent.cpp @@ -24,7 +24,7 @@ void PictureGraphicComponent::generate_and_store_image() { for (std::uint_fast16_t j = 0; j < get_actual_width(); j++) { - auto vtColour = colourTable.get_colour(rawPictureGraphicData.at(pixelIndex)); + auto vtColour = parentWorkingSet->get_colour(rawPictureGraphicData.at(pixelIndex)); if (transparencyEnabled) { reconstructedImage.setPixelAt(j, i, Colour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, rawPictureGraphicData.at(pixelIndex) == this->get_transparency_colour() ? 0.0f : 1.0f))); diff --git a/src/ServerMainComponent.cpp b/src/ServerMainComponent.cpp index 147ec5a..72a9127 100644 --- a/src/ServerMainComponent.cpp +++ b/src/ServerMainComponent.cpp @@ -713,7 +713,7 @@ void ServerMainComponent::on_change_active_mask_callback(std::shared_ptrget_number_children(); i++) { - auto child = activeMask->get_object_by_id(activeMask->get_child_id(i)); + auto child = activeMask->get_object_by_id(activeMask->get_child_id(i), affectedWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask == child->get_object_type())) { diff --git a/src/SoftKeyMaskComponent.cpp b/src/SoftKeyMaskComponent.cpp index f0580c7..0b174c5 100644 --- a/src/SoftKeyMaskComponent.cpp +++ b/src/SoftKeyMaskComponent.cpp @@ -19,7 +19,7 @@ void SoftKeyMaskComponent::on_content_changed(bool initial) { for (std::uint16_t i = 0; i < this->get_number_children(); i++) { - auto child = get_object_by_id(get_child_id(i)); + auto child = get_object_by_id(get_child_id(i), parentWorkingSet->get_object_tree()); if (nullptr != child) { @@ -41,7 +41,7 @@ void SoftKeyMaskComponent::on_content_changed(bool initial) void SoftKeyMaskComponent::paint(Graphics &g) { - auto vtColour = colourTable.get_colour(backgroundColor); + auto vtColour = parentWorkingSet->get_colour(backgroundColor); g.fillAll(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); } diff --git a/src/SoftkeyMaskRenderArea.cpp b/src/SoftkeyMaskRenderArea.cpp index a2d9c76..bf5646d 100644 --- a/src/SoftkeyMaskRenderArea.cpp +++ b/src/SoftkeyMaskRenderArea.cpp @@ -28,7 +28,7 @@ void SoftKeyMaskRenderAreaComponent::on_change_active_mask(std::shared_ptrget_number_children(); i++) { - auto child = activeMask->get_object_by_id(activeMask->get_child_id(i)); + auto child = activeMask->get_object_by_id(activeMask->get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask == child->get_object_type())) { @@ -65,7 +65,7 @@ void SoftKeyMaskRenderAreaComponent::mouseDown(const MouseEvent &event) for (std::uint16_t i = 0; i < activeMask->get_number_children(); i++) { - auto child = activeMask->get_object_by_id(activeMask->get_child_id(i)); + auto child = activeMask->get_object_by_id(activeMask->get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask == child->get_object_type())) { @@ -109,7 +109,7 @@ void SoftKeyMaskRenderAreaComponent::mouseUp(const MouseEvent &event) for (std::uint16_t i = 0; i < activeMask->get_number_children(); i++) { - auto child = activeMask->get_object_by_id(activeMask->get_child_id(i)); + auto child = activeMask->get_object_by_id(activeMask->get_child_id(i), parentWorkingSet->get_object_tree()); if ((nullptr != child) && (isobus::VirtualTerminalObjectType::SoftKeyMask == child->get_object_type())) { @@ -151,7 +151,7 @@ std::shared_ptr SoftKeyMaskRenderAreaComponent::getClickedChil for (std::uint16_t i = 0; i < object->get_number_children(); i++) { - auto child = object->get_object_by_id(object->get_child_id(i)); + auto child = object->get_object_by_id(object->get_child_id(i), parentWorkingSet->get_object_tree()); // Knowing the location requires some knowledge of how the mask is displaying each key... diff --git a/src/WorkingSetComponent.cpp b/src/WorkingSetComponent.cpp index c3a0024..4e2bc21 100644 --- a/src/WorkingSetComponent.cpp +++ b/src/WorkingSetComponent.cpp @@ -14,7 +14,7 @@ WorkingSetComponent::WorkingSetComponent(std::shared_ptrget_colour(get_background_color()); auto background = Colour(vtColour.r, vtColour.g, vtColour.b, 1.0f); g.setColour(background); g.fillAll(); diff --git a/src/WorkingSetSelectorComponent.cpp b/src/WorkingSetSelectorComponent.cpp index cba5ace..feac4f8 100644 --- a/src/WorkingSetSelectorComponent.cpp +++ b/src/WorkingSetSelectorComponent.cpp @@ -22,7 +22,7 @@ void WorkingSetSelectorComponent::add_working_set_to_draw(std::shared_ptrget_number_children(); i++) { - auto childObject = JuceManagedWorkingSetCache::create_component(workingSet, workingSetObject->get_object_by_id(workingSetObject->get_child_id(i))); + auto childObject = JuceManagedWorkingSetCache::create_component(workingSet, workingSetObject->get_object_by_id(workingSetObject->get_child_id(i), workingSet->get_object_tree())); children.back().childComponents.push_back(childObject); childObject->setTopLeftPosition(4 + 15 + workingSetObject->get_child_x(i), (static_cast(children.size()) - 1) * 80 + 10 + 7 + workingSetObject->get_child_y(i)); addAndMakeVisible(*childObject); @@ -74,7 +74,7 @@ void WorkingSetSelectorComponent::redraw() for (std::uint16_t i = 0; i < workingSetObject->get_number_children(); i++) { - auto childObject = JuceManagedWorkingSetCache::create_component(workingSet.workingSet, workingSetObject->get_object_by_id(workingSetObject->get_child_id(i))); + auto childObject = JuceManagedWorkingSetCache::create_component(workingSet.workingSet, workingSetObject->get_object_by_id(workingSetObject->get_child_id(i), workingSet.workingSet->get_object_tree())); workingSet.childComponents.push_back(childObject); childObject->setTopLeftPosition(4 + 15 + workingSetObject->get_child_x(i), workingSetIndex * 80 + 10 + 7 + workingSetObject->get_child_y(i)); addAndMakeVisible(*childObject);