MULTIEDIT cursor problem

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

  • MULTIEDIT cursor problem

    Hi

    I could not enable the Cursor blink in MultiEdit widget. Moreover, there is no coloring support for the cursor (though exists in Edit widget).
    Cursor seems to be created with gray color but not blinking.
    Here is my MultiEdit widget creation procedure:
    Any help ?

    WM_HWIN hWin = MULTIEDIT_CreateEx(x0, y0, xSize, ySize * numLines, hParent,WM_CF_SHOW, MULTIEDIT_CF_INSERT, GUI_ID_MULTIEDIT0, maxLength, NULL);
    if (!hWin)
    {
    log_error("Cannot create EditBox");
    return NULL;
    }

    WM_SetCallback(hWin, Gui_EditWindow_cbf);
    MULTIEDIT_SetInsertMode(hWin, 1);
    MULTIEDIT_SetFont(hWin, &GUI__FONT_BIG);
    MULTIEDIT_SetBkColor(hWin, 0, GUI_WHITE);
    MULTIEDIT_SetMaxNumChars(hWin, maxLength);
    MULTIEDIT_SetInsertMode(hWin, 1);
    MULTIEDIT_SetWrapWord(hWin);
    MULTIEDIT_SetAutoScrollV(hWin, 1);
    MULTIEDIT_SetFocussable(hWin, 1);
    MULTIEDIT_EnableBlink(hWin, 300, 1);
    WIDGET_SetEffect(hWin, &WIDGET_Effect_None);


    Thanks
    Regards

    The post was edited 2 times, last by kyasar5 ().

  • Hi,

    I gave it a try, but on my side it is working.
    Unfortunately, I don't know your callback function, maybe there is something wrong. Also, I don't know the font you are using.

    You might want to double check these two things (callback, font)?

    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.
  • hi Thanks for reply,

    I changed the font but nothing changed. Callback of the widget seems to be fine.
    Could you send us a working example ?
    There is no example in Emwin Samples with blinking Cursor enabled.

    Thanks
    Regards
  • Hi,

    I used almost the same code as you:

    C Source Code

    1. #include "DIALOG.h"
    2. /*********************************************************************
    3. *
    4. * MainTask
    5. */
    6. void MainTask(void) {
    7. WM_HWIN hWin;
    8. int xSize;
    9. int ySize;
    10. #ifdef WIN32
    11. WM_SetCreateFlags(WM_CF_MEMDEV);
    12. #endif
    13. GUI_Init();
    14. xSize = LCD_GetXSize();
    15. ySize = LCD_GetYSize();
    16. hWin = MULTIEDIT_CreateEx(30, 30, xSize - 60, ySize - 60, WM_HBKWIN, WM_CF_SHOW, MULTIEDIT_CF_INSERT, GUI_ID_MULTIEDIT0, 200, NULL);
    17. //WM_SetCallback(hWin, Gui_EditWindow_cbf);
    18. MULTIEDIT_SetInsertMode(hWin, 1);
    19. //MULTIEDIT_SetFont(hWin, &GUI__FONT_BIG);
    20. MULTIEDIT_SetBkColor(hWin, 0, GUI_WHITE);
    21. MULTIEDIT_SetMaxNumChars(hWin, 200);
    22. MULTIEDIT_SetInsertMode(hWin, 1);
    23. MULTIEDIT_SetWrapWord(hWin);
    24. MULTIEDIT_SetAutoScrollV(hWin, 1);
    25. MULTIEDIT_SetFocussable(hWin, 1);
    26. MULTIEDIT_EnableBlink(hWin, 300, 1);
    27. WIDGET_SetEffect(hWin, &WIDGET_Effect_None);
    28. //
    29. // Set focus to the MULTIEDIT widget, without focus it is not blinking
    30. //
    31. WM_SetFocus(hWin);
    32. while (1) {
    33. GUI_Delay(50);
    34. }
    35. }
    Display All


    The cursor is only blinking if the MULTIEDIT widget has the focus. This is true after touching it, clicking it with a mouse or calling WM_SetFocus(hWin).

    Which version of emWin are you using?

    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.