OpenEdv-开源电子网

标题: 如何在UCGUI中改变EDIT的值 [打印本页]

作者: 益力多3号    时间: 2015-4-16 14:44
标题: 如何在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;
  }
}


作者: 正点原子    时间: 2015-4-16 22:40
帮顶。。。。
作者: styleno1    时间: 2015-4-17 09:20
哪行代码发生了异常?
作者: 业未央    时间: 2015-4-21 11:49
回调函数中怎么进行重绘啊,你加上重绘消息试一下




欢迎光临 OpenEdv-开源电子网 (http://47.111.11.73/) Powered by Discuz! X3.4