EmWin (Ucgui) edit control in the numerical mode of negative value editing, if the keyboard keys can be set to a separate "-", "+" key, so that the normal editing of positive and negative numbers, but to do not set the two keys, edit the value of editing will be more trouble, you can use the "Up" key and "down" Key to modify the symbol, but the cursor can not be moved to the back of the value bit, you must use the "left" key and "right" key to move the cursor, in the embedded keys are limited, if not set up alone "+", "+", "left", "right" key, then only through the code to complete the shift, by To manually move the cursor while modifying the symbol bit:
?
/*********************************************************************
*
* Cbedit Edit Control callback
*/
Static void cbEdit0 (wm_message * pMsg) {
???? Switch (pMsg-MsgId) {
???? Case Wm_key:
???????? if ((wm_key_info *) (pMsg,Data. P)),pressedcnt ! = 0)
???????????? break;
???????? Switch ((wm_key_info *) (pMsg,Data. P),Key) {
???????? Case Gui_key_enter:
???????????? pretreattemperature = edit_getvalue(widgetsitembuf[0]);
???????????? Wm_setfocus (widgetsitembuf[1]);????
???????????? break;
???????? Case gui_key_up:
???????? Case Gui_key_down:
???????????? if ((wm_key_info *) (pMsg,Data. P),pressedcnt = = 0)
???????????????? if (edit_getcursorcharpos(widgetsitembuf[0]) = = 0)
???????????????????? Edit_setcursoratchar (widgetsitembuf[0],1);
???????????? break;
????????}
???? break;
????}
???? Edit_callback (pMsg);
}
?
EmWin (Ucgui) Edit Control numeric mode-symbol edit worldsing