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 214 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
  • 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,

    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
  • 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.