This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GRLIB Slider Widget Question

Hi,

I am using LM4F212H5BBFIG and trying to use grlib slider widget. I am hoping that the slider widget is more efficient than re-paint the background and re-draw the slide for the long term. My question are:

1. I have a ruler background with a triangle tip slide. The examples from the slider widget only show the rectangle side, Do you have any recommendation to have the triangle tip to attach to the end of the slider? The outside part of the triangle tip should not cover the ruler background.

2. Does grlib support drawing of triangles?

3. Widget message queue and process associate with slider widget seems straight forward. My software is a super loop application with IAR EWARM. Is there any limitation or constraint that I should aware for the widget message queue and process?

Thanks,

Dennis

  • Dennis,

    1. I'm not clear on exactly what you want to do here. The slider widget must fit within a rectangle on the display but you can use two images for the selected and unselected portions of the slider and you can make those images look any shape you want. If you can post a drawing showing what you are trying to do, I can probably offer better suggestions.

    2. No - grlib today has no triangle drawing primitives. You would have to draw triangles using a collection of GrLineDraw calls or by storing your triangle as an image and drawing it with GrImageDraw.

    3. I can't think of any specific limitations or constraints other than the obvious one which is that you need to call WidgetMessageQueueProcess() often enough that your queue doesn't fill up. By default, the queue holds 16 messages so, for example, if you call WidgetPaint() 20 times between calls to WidgetMessageQueueProcess(), you will have problems (4 of your paint messages will be lost).

  • Hi Dave,

    Thanks for the inputs. My challenge on item 1 and 2 is my ruler back ground which has horizontal lines that will be cover up by the knife triangle tip. Look like I can't not use a pattern background since the outside area of the triangle image is not transparent.

    Understood on item 3.

    Thanks,

    Dennis

  • It would surprise me if you couldn't do what you are trying to do. If you create two images in Photoshop or some other editor, each containing the ruler but only one having the triangular overlay (presumably this is the slider bar?) then you should be able to use these in the slider widget to give the appearance of the slider moving across a static background. Again, if you can offer a mock-up of the look you are trying to get, I can probably offer better advice.

  • Hi Dave,

    I uploaded a sample what I am trying to do.

    Thanks,

    Dennis

  • Ah, now I see - thanks! You are correct that you cannot use the existing slider widget to accomplish what you are looking for. One assumption in the current slider is that there's either a horizontal or vertical line separating the two portions of the widget progress bar. In your case, you need an angled line.

    While you can't use today's slider, it would be pretty easy to copy the existing slider.c/.h and create your own version that did support this. Change the behavior model such that you have a static background image (the ruler) and a transparent progress bar image (the angled "knife") and, rather than revealing the progress bar as the slider position is set, move the progress image up and down, clipping it at the bottom. I'm pretty sure you could accomplish this by reworking the paint function and making very minor changes in the widget definition structure. You should, of course, rename the widget so that it won't clash with the existing slider.

    Good luck!

  • Thank you for your inputs, Dave.

    Dennis

  • Hi Dave,

    Is there a way for me to remove the attached JPG in this post?

    Thanks,

    Dennis

  • If you edit the post, you should find a "remove" link next to the filename on the "Options" tab. If you can't, let me know and I can do it for you.

  • Thank you, Dave. You have a great day.

    Dennis