-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
559c1e2
commit 6282844
Showing
14 changed files
with
483 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//================================================================================================ | ||
/// @file NumberComponent.hpp | ||
/// | ||
/// @brief Common functions for drawing numbers | ||
/// @author Miklos Marton | ||
/// | ||
/// @copyright 2024 Adrian Del Grosso | ||
//================================================================================================ | ||
#ifndef NUMBER_COMPONENT_HPP | ||
#define NUMBER_COMPONENT_HPP | ||
|
||
#include "isobus/isobus/isobus_virtual_terminal_objects.hpp" | ||
#include "isobus/isobus/isobus_virtual_terminal_server_managed_working_set.hpp" | ||
#include "TextDrawingComponent.hpp" | ||
|
||
#include "JuceHeader.h" | ||
|
||
class NumberComponent : public TextDrawingComponent | ||
{ | ||
public: | ||
NumberComponent(std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> workingSet); | ||
|
||
void paint(Graphics &g) override; | ||
|
||
protected: | ||
std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> parentWorkingSet; | ||
|
||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NumberComponent) | ||
}; | ||
|
||
#endif // NUMBER_COMPONENT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//================================================================================================ | ||
/// @file TextDawingComponent.hpp | ||
/// | ||
/// @brief Common functions for drawing numbers | ||
/// @author Miklos Marton | ||
/// | ||
//================================================================================================ | ||
#ifndef TEXTDRAWING_COMPONENT_HPP | ||
#define TEXTDRAWING_COMPONENT_HPP | ||
|
||
#include "isobus/isobus/isobus_virtual_terminal_objects.hpp" | ||
#include "isobus/isobus/isobus_virtual_terminal_server_managed_working_set.hpp" | ||
|
||
#include "JuceHeader.h" | ||
|
||
class TextDrawingComponent : public Component | ||
{ | ||
public: | ||
TextDrawingComponent(std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> workingSet); | ||
|
||
void setSourceObject(isobus::VTObject *newSourceObject); | ||
|
||
protected: | ||
static Justification convert_justification(isobus::TextualVTObject::HorizontalJustification horizontalJustification, | ||
isobus::TextualVTObject::VerticalJustification verticalJustification); | ||
uint8_t prepare_text_painting(Graphics &g, | ||
std::shared_ptr<isobus::FontAttributes> font_attributes, | ||
char referenceCharForWidthCalc); | ||
|
||
void paintText(Graphics &g, const std::string &text, bool enabled = true); | ||
std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> parentWorkingSet; | ||
isobus::VTObject *sourceObject; | ||
|
||
void drawStrikeThrough(Graphics &g, int w, int h, const String &str, isobus::TextualVTObject::HorizontalJustification justification); | ||
|
||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(TextDrawingComponent) | ||
}; | ||
|
||
#endif // TEXTDRAWING_COMPONENT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.