Showing the cursor in the Edit Widget

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

  • Showing the cursor in the Edit Widget

    Hello to all,

    I have a very simple problem:

    I want to show the static default cursor in the Edit widget without any blinking. I use emWin 5.22.

    The Edit widget contains and displays 3 characters already.

    The source:
    hEdit = EDIT_CreateEx(10, 5, MaschNamePixelWidth, 30, hClientWin, WM_CF_SHOW,0,0,MaschineNameLen);
    EDIT_SetFont(hEdit,StdFont);
    EDIT_SetText(hEdit,&M[MIdx].Name[0]); //von der aktuellen Maschine den Namen anzeigen
    EDIT_SetCursorAtChar(hEdit,2)

    The text is therafter displayed correct but no cursor.
    Gui_Exec() is called regularly.

    In order to display the cursor:
    Does the cursor have to be enabled explicitly?
    Do I have to switch the Edit widget from text mode to edit mode?

    I am happy for any help for this issue

    Thanks
    Andy
  • Good Morning,

    Adrian thank you for your answer!
    Actually I just found it in Widget_Edit.c by myself.....

    Please One question with blinking cursor.
    I use MDK_ARM from Keil with RTOS.
    The RTOS provides timer functions.
    In order not to interfere with RTOS I did not configure GUI_X_GetTime() in emWin.

    How can I get a blinking cursor in this environment?

    Have a nice day

    Andy
  • Hello Andy,

    In order to use timers in emWin, a timing base is required. Since you use an RTOS I would recommend you to adapt the GUI_X_GetTime() function to call the RTOS related "GetTime" function. For details on how to implement GUI_X_GetTime(), please refer to the chapter "Configuration" in the emWin user manual.

    Otherwise you can also use a timer interrupt to count a variable which is then returned by GUI_X_GetTime().

    Best regards,
    Adrian