Updation related to custom designed widget

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Updation related to custom designed widget

    Hello,


    As show in image i've designed a widget which contains 5 text elements.Here Text5 is changing frequently and very fast interval.Which one is best method for updating it.Memory device is enabled.


    1. Using WM_InvalidatingRect

    2. Deactivate WM -> Update Window -> Activate WM


    Having Confusion related to GUI_xxx Functions
    1. Does GUI_xxx functions wait for HSYNC or VSYNC signal to update Or it will update directly whenever they were executing.


    Thank You,
    Images
    • TestWidget.png

      2.58 kB, 150×120, viewed 329 times
  • Hi,

    I have attached a sample which shows how you could achieve what you want.

    1. WM_Invalidaterect() is one way. Just invalidate the area of Text5.

    2. Deactivating the window manager is not the best idea.

    Having Confusion related to GUI_xxx Functions

    1. Does GUI_xxx functions wait for HSYNC or VSYNC signal to update Or it will updatedirectly whenever they were executing.
    It depends..

    In general the GUI_xxx functions will draw directly to the LCD, but:

    If you have activated automatic use of memory devices (e.g. by calling WM_SetCreateFlags(WM_CF_MEMDEV)) all drawing operations will be performed into a memory device and once finished the whole memory device gets displayed.

    If you have multi buffering enabled all drawing operations will be done into the backbuffer. On a VSYNC signal the backbuffer gets visible. Of course multi buffering needs to be configured properly in your LCDConf.c.

    Sometimes this isn't useful while debugging (cause you don't see the output directly). In this case you can disable memory devices or multi buffering temporarily.

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Well I'm using different method for creating widget.
    I'm Creating a window and drawing all of this texts in its callback by calling GUI_DisplayStringxx() function.

    Is there any way to update only text5 in window callback or any other option?
    I've to Invalidate whole window and this process takes time
  • Hi,

    take a look into the file attached. There I call WM_InvalidateRect() to redraw only a small part of a window. Each time the window gets redrawn it changes its back ground color. Since just a small part is invalid only the back ground of the center text changes the color.

    Regards,
    Sven
    Files
    • TextinWindow.zip

      (952 Byte, downloaded 330 times, last: )
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    You should enable transparency only for those window which really need it. Otherwise the windows will be redrawn too when the background changes.

    Also you can use WM_CF_CONST_OUTLINE this will prevent windows with transparency from being redrawn. Do not use this if the window has semi transparency (e.g. like an AA edge).

    Please take a look at the create flag description below the description of WM_CreateWindow() ind the emWin user manual.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • This process call Paint event whenever WM_InvalidateRect() function executes even when transparency disabled.
    It consumes much more time than available.

    I've created custom graph widget for fill type look with transparency flag disabled.
    For fill type look i'm drawing line from offset to value.
    Is there any way that i can only draw single line and update it to display.