野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6585|回复: 4

按钮内容显示乱码

[复制链接]
发表于 2017-11-20 12:11:43 | 显示全部楼层 |阅读模式
求助火哥,按钮我写了英文内容 就只是Button,怎么显示不对啊,还有编辑框,我写的也是,Button 但是 显示的是 ButtoN,这些是什么原因啊。我就移植的 是 06. emWin_touch_V5.28_ARGB1555 这个程序,底层只是改了下引脚配置,static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
  { FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, 0, 800, 480, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 0, 0, 60, 60, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button", ID_BUTTON_1, 730, 0, 60, 60, 0, 0x0, 0 },
  { EDIT_CreateIndirect, "Edit", ID_EDIT_0, 304, 89, 80, 20, 0, 0x64, 0 },
  // USER START (Optionally insert additional widgets)
  // USER END
};

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/

// USER START (Optionally insert additional static code)
// USER END

/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;
  // USER START (Optionally insert additional variables)
  // USER END

  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:
    //
    // Initialization of 'Framewin'
    //
    hItem = pMsg->hWin;
    FRAMEWIN_SetTitleVis(hItem, 0);
    //
    // Initialization of 'Button'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
    BUTTON_SetFont(hItem, GUI_FONT_13_ASCII);
    BUTTON_SetText(hItem, "Button");
    //
    // Initialization of 'Button'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
    BUTTON_SetText(hItem, "Button");
    BUTTON_SetFont(hItem, GUI_FONT_13_ASCII);
    //
    // Initialization of 'Edit'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
    EDIT_SetText(hItem, "Button");
    // USER START (Optionally insert additional code for further widget initialization)
    // USER END
    break;

  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case ID_BUTTON_0: // Notifications sent by 'Button'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_1: // Notifications sent by 'Button'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_EDIT_0: // Notifications sent by 'Edit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    // USER START (Optionally insert additional code for further Ids)
    // USER END
    }
    break;
  // USER START (Optionally insert additional message handling)
  // USER END
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}


/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       CreateWin
*/
void CreateWin(void)
{
//  GUI_SelectLayer(1);
  GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_GetDesktopWindowEx(1), 0, 0);
        GUI_Delay(10);

        while(1)
        {
                GUI_Delay(100);
        }
}

QQ图片20171120113552.jpg
回复

使用道具 举报

发表于 2017-11-20 14:26:06 | 显示全部楼层
这么神奇。。这样的我没遇到过
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-11-20 15:32:08 | 显示全部楼层
我看了,用了 19-LTDC—液晶显示英文(字库在内部FLASH) 这个程序是可以正常显示的,不知道,为什么用emwin的程序,就有问题
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-11-21 22:57:17 | 显示全部楼层
flyleaf 发表于 2017-11-20 14:26
这么神奇。。这样的我没遇到过

火哥,发现问题了,应该是我的SDRAM 那块有问题,我用内部内存就没有问题,用外部SDRAM 就显示有错误
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-11-21 23:02:43 | 显示全部楼层
flyleaf 发表于 2017-11-20 14:26
这么神奇。。这样的我没遇到过

我问下,如果SDRAM的数据线,DA0-DA15没有按照引脚一一对应,DA0-15顺序打乱了,方便布线了,这个有影响吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-5-8 07:03 , Processed in 0.080977 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表