EmWin (Ucgui) Edit Control numeric mode-symbol edit worldsing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.