Home AMX User Forum NetLinx Studio

More Password Questions

I would like to give the user the ability to edit the names of the buttons on their TP. I currently have it set up where if they push and hold a button for 1 second, the keyboard opens up and allows them to type in a new name. I would like to password protect the edit feature. In the HOLD[10]: section, I included this line:
SEND_COMMAND dvTP, "'^BPP-36,3'". Ultimately, I would like to use a button array to catch any of the buttons they were trying to edit, I was just using one button as a test. Herein lies the problem. If I put the password line in the code, it doesn't matter if it is in the PUSH: sction or the HOLD: section, it automatically pops up the password keypad no matter what. Is there a way to make this work or am I going to need to make an "Edit" button that encompasses the whole page, as in "Press the edit button, enter the password, and then touch the button you want to change."

Comments

  • staticatticstaticattic Posts: 200
    OK, I am about ready to start smashing things. First, "SEND_COMMAND dvTP, "'^BPP-1,3'" seems to be sporadic. And this, "SEND_COMMAND dvTP, "'^BPP-',nEditButton,',3'" doesn't work at all. Please, can someone tell me what I am doing wrong? I have a bad habit of making things more complicated than they need to be, and this may be a perfect example of this. All I want to do is give the user the option to choose to password protect buttons. Is this possible?
  • staticatticstaticattic Posts: 200
    I had picked up my laptop and was about to smash it into oblivion when I happened to look upon my monitor one last time. It was then that the revelation came. This line: SEND_COMMAND dvTP, "'^BPP-',nEditButton,',3'" is missing 4 little letters. ITOA. "'Oh I see', said the blind man". At this point, I think I need to take a break, regroup, and come back at this with a fresh mind.
  • ericmedleyericmedley Posts: 4,177
    I have a pretty hard rule that says, "Don't flounder on something for more than 10 minutes." If I find myself doing that, I force myself to move to something else or get away from it somehow.

    It almost always works!
  • ondrovicondrovic Posts: 217
    ericmedley wrote: »
    I have a pretty hard rule that says, "Don't flounder on something for more than 10 minutes." If I find myself doing that, I force myself to move to something else or get away from it somehow.

    It almost always works!

    That's a great rule to live by, I too find myself doing that :)
  • yuriyuri Posts: 861
    OK, I am about ready to start smashing things. First, "SEND_COMMAND dvTP, "'^BPP-1,3'" seems to be sporadic. And this, "SEND_COMMAND dvTP, "'^BPP-',nEditButton,',3'" doesn't work at all. Please, can someone tell me what I am doing wrong? I have a bad habit of making things more complicated than they need to be, and this may be a perfect example of this. All I want to do is give the user the option to choose to password protect buttons. Is this possible?

    guessing nEditButton is an INTEGER, i can tell you why that doesn't work (*hint*hint*)

    What i would do is this:
    Make a button to enable "edit-mode". That button would be password protected. Once the button is pressed/held/whatever you set a flag in your software, which enables the user to press a button to edit the text.
    After one button is changed, reset the flag to enable "normal" operation
  • staticatticstaticattic Posts: 200
    Yeah, that is exactly what I ended up doing. My original intent was to allow the user to hold down a button for 1 second and that would automatically start "edit" mode. That option worked really well until I started trying to add passwords. Once password protection gets added to a button, that takes power over everything. Now matter where the password option is, PRESS: or HOLD:, if the button is flagged as needing a password, the password must be entered before anything can be done. That being the case, causing an action in a HOLD: doesn't work if the button is password protected. And really, now that I have had a night to reflect on all that I did yesterday, the password issues really do make sense. When I think about it, if the button has a password flag associated with it, by asking for a password when pushed it is really only doing what it was told to do, challange for a password. With a password protected "Edit Buttons" button, I get the same effect and can maintain positive control. As I said earlier, either in this thread or somewhere else, I sometimes make things more complicated than they need to be. I get all of these great ideas in my head (at least they seem great at the time ;) ) and then spend the better part of a day trying to get all fancy with the code to get to the same end result that could have been accomplished much easier. On the positive side, I do learn from the experience though. This week has been the first time I have ever worked with passwords, keyboard entries, and labelling buttons through the code. So, even though I felt like smashing my laptop to bits, I did learn new things. :D
  • yuriyuri Posts: 861
    are you sure you don't have ADHD or something :p You write like a madman ;)
  • staticatticstaticattic Posts: 200
    Of course I do. Isn' that like a prerequisite for becoming a programmer? ;)
  • richsrichs Posts: 13
    http://www.laptop-repair.info/rugged_laptops.html

    Quote:
    Originally Posted by staticattic
    "So, even though I felt like smashing my laptop to bits, I did learn new things."

    ...you might want to look at hardened laptops: http://www.laptop-repair.info/rugged_laptops.html. Some of us need to use only these!
  • a_riot42a_riot42 Posts: 1,624
    ericmedley wrote: »
    I have a pretty hard rule that says, "Don't flounder on something for more than 10 minutes." If I find myself doing that, I force myself to move to something else or get away from it somehow.

    It almost always works!

    Interesting methodolgy.

    My methodology is this. Just before I do something I ask myself "Would an idiot do this?" If the answer is yes, then I do not do that.
    Paul
Sign In or Register to comment.