Repository navigation
Change the background and font color of an output number or string #664
|
I´m trying to change the background and font colors of output strings and numbers but everything I tried failed miserably. virtualTerminalClient->send_change_background_colour(DataMask_1001, 2); // Change the background to green Any attempt to change the background of an output number or string fails and the background of those objects still remain white as set in the .iop file. The same line above but with an Output Number or String ObjectID instead of a DataMask ID doesn´t change the object´s background color. As well, for changing the text color of an output string or number, I tried to use this: virtualTerminalClient->send_change_font_attributes(FontAttributes_23000, 2, isobus::VirtualTerminalClient::FontSize::Size48x64, 0, 0); And this does not change the text color as well. Curious is that if I change the styleBitField from 0x00 to something else, it does work good for changing the Bold, Italic and so on, which tells me at least something was processed in the VT side. Any help in pointing the right way to change the color of objects is appreciated. |
Replies: 1 comment 1 reply
|
Hello there!
So, the Here are two additional ways to change the background color of something like an output number though:
Does changing the font attribute's colour attribute work? Its attribute ID is Another option on this would be to add another font attribute to the object pool with the color you want and instead switch which font attribute is being used by the number or string. |
Hello there!
So, the
send_change_background_colourfunction only works on output numbers and strings if the transparent bit is set to 0 in the iop. If you're using our example object pool or something based on that, then they are all probably set to 1, so it will appear that it is not working. I'd maybe check on that first? If you have the object properly configured in the iop, it'd be interesting to look at the responses coming back from the VT to see if it's telling you about an error in your command.Here are two additional ways to change the background color of something like an output number though: