How to add a line drawing in an existing Text window

  • I am very new using emWin and I have the following question:

    I have a text window with a text "Measurement"

    ta = TEXT_CreateEx(140, 100, 150, 20, myProc->win, WM_CF_SHOW, GUI_TA_LEFT | GUI_TA_VCENTER, id++, "Measurement");
    TEXT_SetFont(ta, FONT4);
    TEXT_SetBkColor(ta, 0xccffff);


    and I would like to add a line above the label "Measurement" in order to inform that what follows is an "average value" (let's assume that I cannot use a more elegant solution applying the proper set of fonts for this purpose).

    How can I achieve this goal? I read some comments regarding using the callback of the window. However, I could not see a simple piece of code demonstrating how to do this.

    Any hints?

    Thank you

  • Hi,

    You could overwrite the callback function of the TEXT widget. For all events except WM_PAINT you should call the default text widget callback function TEXT_Callback(). Within the WM_PAINT event the default function should be called first and then other things could be drawn on top. The sample WIDGET_ButtonRound() shows how to overwrite a callback function.

    Regards, Jörg

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!