• AVR Freaks

Hot!Harmony Keypad

Author
bblessing
Super Member
  • Total Posts : 741
  • Reward points : 0
  • Joined: 2008/12/04 06:44:21
  • Location: Cincinnati, OH
  • Status: offline
2018/01/16 00:55:30 (permalink)
0

Harmony Keypad

Background: MPLAB X IDE v4.05, XC32 v1.44B, Harmony v2.05, PIC32MZ2064DAG176, Newhaven NHD-4.3-480272EF-ASXN#-T display
 
A couple of observations. The keypad configuration dialog seems a little messed up. If I click on a cell, the other fields become inaccessible. It's like they're greyed out. Very strange. Changing the size of the dialog fixes it, but doing this for every edit is annoying.
 
Also, I get errors because this function is generated in libaria_init: laKeyPadWidget_SetKeyDrawBackground. This function doesn't exist. Also strange.
 
No worries about this, I just wanted a keypad with no background.
#1

7 Replies Related Threads

    Ed@Microchip
    Super Member
    • Total Posts : 162
    • Reward points : 0
    • Joined: 2017/04/06 09:39:29
    • Location: 0
    • Status: offline
    Re: Harmony Keypad 2018/01/16 10:40:04 (permalink)
    0
    Hi bblessing,
     
      Thank you for reporting these issues.
     
      We're able to reproduce the issue with the keypad configuration dialog box and will work on a fix. The issue with the generated function laKeyPadWidget_SetKeyDrawBackground will also need to be fixed. It should be calling laKeyPadWidget_SetKeyBackgroundType().
     
     
    Thanks,
     
    Ed
    #2
    kuku
    Senior Member
    • Total Posts : 143
    • Reward points : 0
    • Joined: 2012/03/03 08:05:54
    • Location: 0
    • Status: offline
    Re: Harmony Keypad 2018/01/18 03:29:01 (permalink)
    0
    I confirm, but with bit a patience a made simple keypad. If key settings will vanish then I go out from configuration dialog and try again. Also, it works better if we start change from "text string" dialog box.
    Presed/Relased image is show only for first key, but in real app I see all. 
     
    I see also else issue(?) in keypad. My keypad is on else screen and their layer backgrount is set to "none". Now, when I touch keypad then I see that my button (60l) in previous screen also react. Look like is only pushed. 
    I cannot add link to yt so paste this: watch?v=R50JcNjJaYA
     
    In touch topic... :)
    Any idea why my text backgroud on button are change if I touch else button?. Paste this in yt: watch?v=icECh9cFOgI
     
    In button event I change only flag, and in my screen i have:
     
     if( EE.Flags.PowerSelection ){
      laButtonWidget_SetText(BUT_PowerAutoMan, laString_CreateFromID(string_StringAuto));
     }else{
      laButtonWidget_SetText(BUT_PowerAutoMan, laString_CreateFromID(string_StringManual));
     }

    post edited by kuku - 2018/01/18 03:39:22

    Attached Image(s)

    #3
    bblessing
    Super Member
    • Total Posts : 741
    • Reward points : 0
    • Joined: 2008/12/04 06:44:21
    • Location: Cincinnati, OH
    • Status: offline
    Re: Harmony Keypad 2018/01/18 14:51:00 (permalink)
    0
    The documentation seems a little unclear regarding this enumeration laKeyPadCellAction, or perhaps it is my lack of mental power with two jobs and a little one to deal with. Between this and the calls to laEditWidget_xxxx functions, my gut tells me that something is keeping track of all of the key clicks for a keypad widget. Is this the case? I'm curious because it would make my keyclick event very simple: just display on a separate label what the string contains and I'm done.
     
    As it stands, the code below allows me to enter in numbers just like a calculator. I'm curious if this is the most correct and efficient way to do it.
     
    void KeyPadWidgetSecurityCallback(laKeyPadWidget* pad, laButtonWidget* btn, uint32_t row, uint32_t col)
    {
        laString *lblText;
        lblText = laString_New(NULL);
        if (LA_KEYPAD_CELL_ACTION_CLEAR == laKeyPadWidget_GetKeyAction(pad, row, col))
        {
            laString_Clear(lblText);
            laLabelWidget_SetText(LabelWidgetSecurityValue, *lblText);
        }
        else
        {
            laString *str = laKeyPadWidget_GetKeyValue(pad, row, col);
            laLabelWidget_GetText(LabelWidgetSecurityValue, lblText);
            laString_Append(lblText, str);
            laLabelWidget_SetText(LabelWidgetSecurityValue, *lblText);
            laString_Destroy(str);
        }
        laString_Destroy(lblText);
    }

    #4
    bblessing
    Super Member
    • Total Posts : 741
    • Reward points : 0
    • Joined: 2008/12/04 06:44:21
    • Location: Cincinnati, OH
    • Status: offline
    Re: Harmony Keypad 2018/01/18 16:01:20 (permalink)
    0
    kuku,
     
        I have to say that your layout and artwork are beautiful! Did you do that all yourself, use SEGGER, or something else? I get it if you can't because it's proprietary or some such. One of the things that we're trying to do in tandem with the screens is make the artwork look polished. I thought it looked great until I saw your design. Back to the drawing board for us :-).
    #5
    kuku
    Senior Member
    • Total Posts : 143
    • Reward points : 0
    • Joined: 2012/03/03 08:05:54
    • Location: 0
    • Status: offline
    Re: Harmony Keypad 2018/01/19 01:22:05 (permalink)
    0
    Formally, keypad use "focus" parameter and back preset key to last touched TextField, without work from programmer side. Focus sit in laScreen struct. (or similar, I dont remember and cannot check now, but for focus you have proper function when you give pointer to widget only). 
     
    In short. Value who can be change on "user screen" I store as/in button widget. In thier press event I copy string (use it to init keypad text field), take pointer to value, remember last use screen and call keypad screen.
    In keypad init screen I made focus manually to text field who is show on keypad screen (I no need to touch it).
    In keypad routine I only read value from text field- check if it falls within my range of values. If is in range then I unlock return button who is made as standard button widget (no keypad button), and... back to last show screen. No other work with keypad button.
     
    Append, clear function for each keypad button you can set in keypad tool box.
     
    I made this keypad for fun and test, but in fact is not much ugly. Ask google for "clipart color button". I made only resize and color masking for corner. Now I see how it looks, and will be easier to draw own candy icon later.
    Shot me your @ on PM, I will send you this project if you want.
    post edited by kuku - 2018/01/19 01:24:14
    #6
    bblessing
    Super Member
    • Total Posts : 741
    • Reward points : 0
    • Joined: 2008/12/04 06:44:21
    • Location: Cincinnati, OH
    • Status: offline
    Re: Harmony Keypad 2018/01/19 06:10:46 (permalink)
    0
    kuku
    Formally, keypad use "focus" parameter and back preset key to last touched TextField, without work from programmer side. Focus sit in laScreen struct. (or similar, I dont remember and cannot check now, but for focus you have proper function when you give pointer to widget only). 
     
    In short. Value who can be change on "user screen" I store as/in button widget. In thier press event I copy string (use it to init keypad text field), take pointer to value, remember last use screen and call keypad screen.
    In keypad init screen I made focus manually to text field who is show on keypad screen (I no need to touch it).
    In keypad routine I only read value from text field- check if it falls within my range of values. If is in range then I unlock return button who is made as standard button widget (no keypad button), and... back to last show screen. No other work with keypad button.
     
    Append, clear function for each keypad button you can set in keypad tool box.
     
    I made this keypad for fun and test, but in fact is not much ugly. Ask google for "clipart color button". I made only resize and color masking for corner. Now I see how it looks, and will be easier to draw own candy icon later.
    Shot me your @ on PM, I will send you this project if you want.


    That's basically what I do with my function above. It's really not difficult, but I was just thinking that if the widget kept track of keystrokes in an laString object then it would be less work overall. For example, if you press "3", "2", "1", there would be an laString object embedded within the keypad structure that is accumulating those values up to some limit. Additionally, the user could access this string through some get function. At the same time, an laString to char buffer would be helpful so that the underlying subroutines can manipulate more easily that which has been entered: currently, I have a separate buffer that keeps track of key strokes as chars. I then use atoi or atof as necessary.
     
    At the end of the day, it is relatively easy to work with the keypad widget so most of this can be added to some wish list.
    #7
    vvvarmab
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2011/02/20 22:23:35
    • Location: 0
    • Status: offline
    Re: Harmony Keypad 2020/06/23 05:43:41 (permalink)
    0
    Hi Kuku, will you please provide me background, how and which tools you used to develop these screens. I am working on handheld display devices using PIC32MZ micro with 7 Inch custom display and using MPLAB Harmony 2.06 tool for developing Screens. Harmony has very limited options for KEYPAD & Textfield widget. 
    I am trying to create Keyboard pop-up with click on Textfield Widget. 
     
     
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5