Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Progressbar color

    Hello SmartGWT experts,

    Does anyone know how to change color of a Progressbar? The default color is green. I would like to use a different color. I tried using methods setBackgroundColor(String) and setEdgeCenterBackgroundColor(String), but no luck so far.

    Thanks in advance,
    Roman.

    #2
    I am also looking for a way to change the progressbar color. If someone could please update this thread with the answer that would be great.


    Brett Baudin

    Comment


      #3
      Hi Guys,

      It's media-based. Right click in Firefox and choose properties for the quickest route to the relevant files (see the Skinning Guide for details, including this tip).

      Comment


        #4
        That reply must assume some knowledge that I don't have. Considering the amount of money we are paying for the highest level of support I can only find your answer unsatisfactory.

        Comment


          #5
          If you would like to actually solve this problem, can you indicate what part of the reply you didn't understand? The progressbar is based on media (as in, image files) and we gave you instructions on how to find to the files involved, and the Skinning Guide gives an overview of how components are skinned.

          Are you expecting a tutorial in how image files are modified, and how to use the relevant (third-party) tools? Can you clarify your expectations here?

          PS. You bought the second highest level of support.

          Comment


            #6
            Decided it was easier to just create my own. Below is a very basic progress bar.
            Code:
            import com.smartgwt.client.widgets.layout.HStack;
            
            public class ProgressBar extends HStack {
            	private final HStack progressHStack = new HStack();
            	private int width;
            
            	public ProgressBar(final int width, final int height, final String color) {
            		super();
            		this.setWidth(width);
            		this.width = width - 2;
            		this.setHeight(height);
            		progressHStack.setBackgroundColor(color);
            		progressHStack.setWidth(1); // Not sure why this needs this to be greater than 0
            		this.addMember(progressHStack);
            	}
            
            	public void setPercentDone(int percent) {
            		percent = Math.min(100, percent);
            		final int progressWidth =  (width * percent)/100 ;
            		progressHStack.setWidth(progressWidth);
            	}
            
            	public void setProgressColor(final String color) {
            		progressHStack.setBackgroundColor(color);
            	}
            }

            Comment

            Working...
            X