嵌入式学习小组
直播中

林明

7年用户 153经验值
私信 关注

怎么成功在UCGUI中改变EDIT的值?

我想按键一按下去就改变EDIT中的值,但我像下面这样写,按键一暗下去就会死机,不知道问什么,有没有人能说一下?
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 'Edit'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
//   EDIT_SetText(hItem, "123");
EDIT_SetDecMode(hItem,0,0,1000,0,0);
EDIT_SetValue(hItem, 23);
    // 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:
// EDIT_SetDecMode(hItem,0,0,1000,0,0);
EDIT_SetValue(hItem, 800);
//GUI_Exec1();
//GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
//EDIT_SetValue(hItem, 23);
//EDIT_SetText(hItem, "ad");
        // 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;
  }
}

回帖(3)

崔丽

2019-8-16 09:22:43
帮顶。。。。
举报

乔军

2019-8-16 09:34:25
哪行代码发生了异常?
举报

云静京

2019-8-16 09:41:05
回调函数中怎么进行重绘啊,你加上重绘消息试一下
举报

更多回帖

发帖
×
20
完善资料,
赚取积分