EDIT, MULTIEDIT widgets - problem by input cyrillic letters.

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

    • EDIT, MULTIEDIT widgets - problem by input cyrillic letters.


      I have converted TTF-font for visualisation of cyrillic symbols (UTF-codepage).
      Also I used at program start a routine GUI_UC_SetEncodeUTF8() for correct visualisation of cyrillic symbols.

      It works well.

      But if I use "input text" widgets EDIT or MULTIEDIT then after switching MS-Windows to cyrillic keyboard layout they both show extended ASCII-letters instead of cyrillic, despite that font table does contain cyrillic letters. See picture for understand the problem. Starting text at left side is not entered by keyboard, it comes outside from file. And red-marked parts - this is keyboard input (cyrillic kbd-layout in Windows).

      I suppose, that problem is in codes of keyboard, which Windows-driver sends to emWin-routine, I use Windows emWin-simulator.

      What should I do for fix the problem?

      If I use EDIT-widget then I couldn't find a solution for how to show right tail of string if its length exceeds width of widget.

      Also I would like to know if it is possible to get ySize (height) of current selected (highlighted) item of MENU-widget? I did not find a way to do it.
      • MULTIEDIT-1.png

        5.74 kB, 320×240, viewed 79 times

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

    • Hi,

      If you set a callback function for the MULTIEDIT widget like below, what values do you get for 'key'?

      C Source Code

      1. static void _cbMultiEdit(WM_MESSAGE * pMsg) {
      2. WM_KEY_INFO * pInfo;
      3. int Key;
      4. switch (pMsg->MsgId) {
      5. case WM_KEY:
      6. pInfo = (WM_KEY_INFO *)pMsg->Data.p;
      7. Key = pInfo->Key;
      8. MULTIEDIT_Callback(pMsg);
      9. break;
      10. default:
      11. MULTIEDIT_Callback(pMsg);
      12. break;
      13. }
      14. }
      Display All

      It is kinda hard for me to reproduce this. If I set my keyboard to cyrillic I always get a 0x3f except the digits. This results in a question mark..

      If I manually store key messages with the proper unicode for a cyrillic character it seems to work.

      C Source Code

      1. void MainTask(void) {
      2. GUI_Init();
      3. WM_SetCallback(WM_HBKWIN, _cbBk);
      4. GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
      5. while (1) {
      6. GUI_Delay(1000);
      7. GUI_StoreKeyMsg(0x0410, 1);
      8. GUI_StoreKeyMsg(0x0410, 0);
      9. GUI_Delay(1000);
      10. GUI_StoreKeyMsg(0x0424, 1);
      11. GUI_StoreKeyMsg(0x0424, 0);
      12. }
      13. }
      Display All
      Unfortunately, it seems that the simulation converts keyboard input into ASCII character before calling GUI_StoreKeyMsg(). This would exclude cyrillic characters and results in strange characters.

      You could try to write something like a conversion table from the latin keyboard to a cyrillic one.