Hi! I was working on a personal password protection program for my calc,
and i was hoping that someone could tell me how to make a Enter Password box in the center of the screen like the MirageOS shell uses, I just want it to look good and hopefully function like it, meaning that it should show a asterisk or a masked char instead of my pass, and that it accepts enter to send the pass, finally since i don't know any ASM, i was hoping i could do it in pure ti-basic (ti-84+ if it matters)

Thanks for the help!
It wouldn't be hard. First you got to divide the height and width of the screen by 2 so you can find the center(I think 28 is the height center). Then, if you want a 8 pixel high text box, then you subtract 4 and add 4, so you get a Horizontal 24, Horizontal 32. Same concept for the width. But, maybe use line( instead of Horizontal & Vertical.

As for the masked character, that's easy to. You'll need two strings: one for the password and another to display the masked characters.

I recommend you learn ASM though, anyone would be able to change and learn your password by looking at the source. Locking programs these days doesn't help much since (almost?) every Shell can unlock them.
I would assume that you could use the ASM DCS library. The libs would be great for GUI creation but the asm would be great for the more useful aspects of a password system

http://dcs.cemetech.net/index.php?title=GUI_Tools

also, comic, I think only DCS can do that
If you're willing to use hybrid libraries, you could use the DCSB GUI libraries (specifically this). If you want to stick with pure TI-Basic, you'll need to write a custom input routine using getKey and store it in a string, and draw the masking character on the screen based on how long your input string is.
souvik1997 wrote:
If you're willing to use hybrid libraries, you could use the DCSB GUI libraries (specifically this). If you want to stick with pure TI-Basic, you'll need to write a custom input routine using getKey and store it in a string, and draw the masking character on the screen based on how long your input string is.


Of course, the TI-Basic password system is easily circumvented with a simple press of the ON button.
But not the DCSB GUI libs Wink I think in those, if you are inputting text and press On, it just turns the screen off. And you get pretty GUIs Very Happy
_player1537 wrote:
But not the DCSB GUI libs Wink I think in those, if you are inputting text and press On, it just turns the screen off. And you get pretty GUIs Very Happy


Ah, true, but not pure TI-Basic Smile

Although I don't think that even hybrid basic can have the same power of ASM. Not that I am one to talk >.>
It can, and does have the same power Smile There's a Celtic instruction to execute ASM code. But, even without that, there's another Celtic instruction to save data into an appvar, and you can mangle the letters there as much as you want/put some sort of protection on it.
_player1537 wrote:
It can, and does have the same power Smile There's a Celtic instruction to execute ASM code. But, even without that, there's another Celtic instruction to save data into an appvar, and you can mangle the letters there as much as you want/put some sort of protection on it.


Oooh, really? Celtic can do that? Hmm.. I never knew that. Good to learn something new each day
comicIDIOT wrote:

I recommend you learn ASM though, anyone would be able to change and learn your password by looking at the source. Locking programs these days doesn't help much since (almost?) every Shell can unlock them.


Thank you for the help! It makes perfect sense! Also, I'm going to lock it as it is only a program for me, no-one else :p Finally, To the others, thanks for the help, however i'll just use onblock to block off any on key crashes Smile

Also, can someone please help me design the GUI? I don't have much of a design sense, you can use the doors library if you wish >.<
You could use a list with a checksum to make sure it hasent been changed
Rhombus P. wrote:
You could use a list with a checksum to make sure it hasent been changed


Well, that is a good idea, but i won't need it as its only for my calc Smile
As everyone has been saying, I very highly recommend that you use the DCSB Libs to do this; it even already has a password prompt GUI item.
You could easily only make asterisks. Since you should be using getKey, which would display nothing. so a simple piece of code for that piece would be.


Code:

Repeat Ans=105
getKey
If Ans
Then
Text(R,C,*
C+3->C
End
End

If that does not make sense, let me know. I am very tired. if that was stated already, just remove this. I did not read all the posts.

oh
and for the password to be remembered

Code:

Repeat Ans=105
getKey
If Ans
Then
Ans->LPASS1(1+dim(LPASS1)
Text(R,C,*
C+3->C
End
End
If min(LPASS1=LPASS)
return //or whatever you want to do if the password is right.

That assumes that LPASS is the password that is saved, Later I can post my Password program for you if you would like.

Also a list is the best bet, otherwise you would always have 1 string less that you cannot use with other programs.
Aes_Sedia5 wrote:
You could easily only make asterisks. Since you should be using getKey, which would display nothing. so a simple piece of code for that piece would be.


Code:

Repeat Ans=105
getKey
If Ans
Then
Text(R,C,*
C+3->C
End
End

If that does not make sense, let me know. I am very tired. if that was stated already, just remove this. I did not read all the posts.

oh
and for the password to be remembered

Code:

Repeat Ans=105
getKey
If Ans
Then
Ans->LPASS1(1+dim(LPASS1)
Text(R,C,*
C+3->C
End
End
If min(LPASS1=LPASS)
return //or whatever you want to do if the password is right.

That assumes that LPASS is the password that is saved, Later I can post my Password program for you if you would like.


It makes sense, thanks for the help!
Your welcome. Let me know if you need anymore help. Alsi one thing i forgot, by using my code you can use every button except on and enter for your password, makes it a lot harder to guess.
I know, thanks for the help!
I'll just use onblock to disable it.
In this case, I'd argue that a list is _not_ the best answer, seeing as the OP already said that he's okay with hybrid libraries. Check the online SDK for commands that you can use and their output. I'll try to throw together some code later, but I don't want it to just be copied verbatim, but rather for it to be learned from Smile
I'm fine with no code for the access system, i just need help drawing the
textbox/prompt in the middle of the screen using code, the rest i can do myself Smile
Oh sorry player I did not notice that.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement