Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   SmartDashboard - Changing Default Text Color on Smart Dashboard (http://www.chiefdelphi.com/forums/showthread.php?t=131715)

Asymons 26-12-2014 20:18

SmartDashboard - Changing Default Text Color on Smart Dashboard
 
Hello,

I hope everyone is having a relaxing winter break. I have a small question regarding the smart dashboard, more specifically the text inputted into it. I would like to know, if possible, how to change the text color to support a black background of some sort. I'm relatively new to the Smart Dashboard, being the first year we are implementing it with our robot so I'm unsure if this is a beginner type question or what not; however, I was wondering the possibility of this. Mind you this is not a mandatory issue, as it only serves to be ascetically pleasing in the driver station. The only work around I've found is to input a string of some sort

Code:

SmartDashboard.putString(" ", " ");
to get that white box background; however if there is a way to change the text, that would be most preferable.

Here's an image to what I am talking about if I'm not making much sense.
(Note the right half of label being covered by a black background)



TL;DR I want to change the default text color of label and the commands.

EDIT: Robot is programmed in Java to clarify.

Ben Wolsieffer 27-12-2014 10:46

Re: SmartDashboard - Changing Default Text Color on Smart Dashboard
 
There is no builtin way to do it AFAIK, but its not hard to write an extension that adds that a new property for color.

An extension is simply a jar file that contains classes that extend from "Widget" and is in an "extensions" directory next to "SmartDashboard.jar". I'll try to write one to show you what I mean.

Ben Wolsieffer 27-12-2014 11:29

Re: SmartDashboard - Changing Default Text Color on Smart Dashboard
 
1 Attachment(s)
Ok, here's an example for you to work off of. Its a label with a new property that sets the text color. If you uncomment the commented lines, it allows you to set the background color too. The zip contains the compiled jar and the source code.

I hope this helps. There isn't that much documentation for the internals of the SmartDashboard, but if you look through the source, its not that hard to understand.

Asymons 27-12-2014 12:57

Re: SmartDashboard - Changing Default Text Color on Smart Dashboard
 
Quote:

Originally Posted by lopsided98 (Post 1417221)
Ok, here's an example for you to work off of. Its a label with a new property that sets the text color. If you uncomment the commented lines, it allows you to set the background color too. The zip contains the compiled jar and the source code.

I hope this helps. There isn't that much documentation for the internals of the SmartDashboard, but if you look through the source, its not that hard to understand.

Thank you very much!

I'll be sure to look at the code you wrote up and see what you mean. This is a huge help, thank you.


All times are GMT -5. The time now is 09:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi