18 #define thisTTClass TTUiInfo
19 #define thisTTClassName "UiInfo"
20 #define thisTTClassTags "ui info"
22 TT_MODULAR_CONSTRUCTOR,
24 mHighlight(kTTSym_none)
26 if (arguments.size() == 1)
28 mObject = (t_ui*)(
TTPtr(arguments[0]));
47 rect = (t_rect*)malloc(
sizeof(t_rect));
51 rect->height =
TTUInt32(newValue[1]);
53 object_attr_set_rect((t_object*)mObject, _sym_presentation_rect, rect);
57 jbox_redraw(&mObject->box);
88 if (modelObject.
valid()) {
108 if (inputValue.
size() == 0) {
109 TTLogWarning(
"j.ui - Missing argument when attempting to set highlight color.");
114 if (newHighlight != mHighlight) {
116 if (newHighlight ==
TTSymbol(
"none")) {
117 mHighlight = newHighlight;
120 else if (newHighlight ==
TTSymbol(
"red")) {
121 mHighlight = newHighlight;
122 jrgba_set(&mObject->highlightcolor, 1., 0., 0., 1.);
125 else if (newHighlight ==
TTSymbol(
"orange")) {
126 mHighlight = newHighlight;
127 jrgba_set(&mObject->highlightcolor, 1., 0.5, 0., 1.);
130 else if (newHighlight ==
TTSymbol(
"yellow")) {
131 mHighlight = newHighlight;
132 jrgba_set(&mObject->highlightcolor, 1., 1., 0., 1.);
135 else if (newHighlight ==
TTSymbol(
"chartreuseGreen")) {
136 mHighlight = newHighlight;
137 jrgba_set(&mObject->highlightcolor, 0.5, 1., 0., 1.);
140 else if (newHighlight ==
TTSymbol(
"green")) {
141 mHighlight = newHighlight;
142 jrgba_set(&mObject->highlightcolor, 0., 1., 0., 1.);
145 else if (newHighlight ==
TTSymbol(
"springGreen")) {
146 mHighlight = newHighlight;
147 jrgba_set(&mObject->highlightcolor, 0., 1., 0.5, 1.);
150 else if (newHighlight ==
TTSymbol(
"cyan")) {
151 mHighlight = newHighlight;
152 jrgba_set(&mObject->highlightcolor, 0., 1., 1., 1.);
155 else if (newHighlight ==
TTSymbol(
"azure")) {
156 mHighlight = newHighlight;
157 jrgba_set(&mObject->highlightcolor, 0., 0.5, 1., 1.);
160 else if (newHighlight ==
TTSymbol(
"blue")) {
161 mHighlight = newHighlight;
162 jrgba_set(&mObject->highlightcolor, 0., 0., 1., 1.);
165 else if (newHighlight ==
TTSymbol(
"violet")) {
166 mHighlight = newHighlight;
167 jrgba_set(&mObject->highlightcolor, 0.5, 0., 1., 1.);
170 else if (newHighlight ==
TTSymbol(
"magenta")) {
171 mHighlight = newHighlight;
172 jrgba_set(&mObject->highlightcolor, 1., 0., 1., 1.);
175 else if (newHighlight ==
TTSymbol(
"rose")) {
176 mHighlight = newHighlight;
177 jrgba_set(&mObject->highlightcolor, 1., 0., 0.5, 1.);
180 else if (newHighlight ==
TTSymbol(
"black")) {
181 mHighlight = newHighlight;
182 jrgba_set(&mObject->highlightcolor, 0., 0., 0., 1.);
185 else if (newHighlight ==
TTSymbol(
"white")) {
186 mHighlight = newHighlight;
187 jrgba_set(&mObject->highlightcolor, 1., 1., 1., 1.);
190 else if (newHighlight ==
TTSymbol(
"jamoma")) {
191 mHighlight = newHighlight;
192 jrgba_set(&mObject->highlightcolor, 0.62, 0., 0.36, 1.);
196 TTLogWarning(
"j.ui - unknown color used for highlighting.\n");
201 jbox_redraw(&mObject->box);
211 if (mObject->patcher_panel) {
214 atom_setsym(&a, gensym((
char*)mObject->viewAddress.c_str()));
215 object_attr_setvalueof(mObject->patcher_panel, _sym_title, 1, &a);
216 object_method(mObject->patcher_panel, _sym_vis);
A base class for j.ui info.
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Create and use Jamoma object instances.
TTObject & getObject()
Get the object binded by this node.
size_type size() const noexcept
Return the number of elements.
This is a special type used by TTAttribute to indicate that a value is a TTValue and is locally maint...
void append(const T &anElementValueToAppend)
Insert a single TTElement at the end.
void * TTPtr
A generic pointer.
TTErr getSize(TTValue &value)
Attribute accessor.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Boolean (1/0) or (true/false) flag.
TTErr setSize(const TTValue &newValue)
Attribute accessor.
TTErr setHighlight(const TTValue &inputValue)
Set highlight color.
void TTFOUNDATION_EXPORT TTLogWarning(TTImmutableCString message,...)
Platform and host independent method for posting warnings.
void TTFOUNDATION_EXPORT TTLogMessage(TTImmutableCString message,...)
Platform and host independent method for posting log messages.
TTErr setFreeze(const TTValue &newValue)
Attribute accessor.
Something went wrong, but what exactly is not known. Typically used for context-specific problems...
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
std::uint32_t TTUInt32
32 bit unsigned integer
#define addAttributeWithSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom setter...
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
TTErr Panel()
Open the ui panel.
TTBoolean valid() const
Determine if the object contained by this TTObject is truly ready for use.
#define accessApplicationLocalDirectory
Access to the local application directory.
[doxygenAppendixC_copyExample]
#define addAttributeWithGetterAndSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom getter and sett...