Page 1 of 1

ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 1:39 pm
by zgdzgdzgd
Hello,

How to make ComBox locked so user can't type in the field just select it but don't change or delete it, i know it can be made because i have a similar program ?

Capture.JPG
Capture2.JPG
Thank you.

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 1:43 pm
by Klaus
Hi zgdzgdzgd,

1. welcome to the forum! :D

2. You can't! Simply because this is the nature of a "combo box"!
If you do not want the user to enter/delete an entry, use a "Pulldown menu",
"Popup menu" or "Option menu" button.


Best

Klaus

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 2:00 pm
by zgdzgdzgd
Hello,

i have compiled .exe file but i don't have source code, it can be done.
I uploaded it to file sharing:
https://file.io/x062KI
or
http://www.filetolink.com/2766a6b161

or

https://1fichier.com/?i70vbmekq0

Don't be afraid it's not a virus or something. Run it in your sandbox or virtual OS it's a small standalone program.
Klaus wrote:
Wed Nov 22, 2017 1:43 pm
Hi zgdzgdzgd,

1. welcome to the forum! :D

2. You can't! Simply because this is the nature of a "combo box"!
If you do not want the user to enter/delete an entry, use a "Pulldown menu",
"Popup menu" or "Option menu" button.


Best

Klaus

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 2:12 pm
by Klaus
Hi zgdzgdzgd,

I am a Mac guy, so no dice with an EXE :D
Is this EXE made with Livecode?

But as I said, being editable is the nature of a combo box and as a user I would think the app does not work correctly if it suddely is NOT!

P.S.
I examined the link (will surely not click right away!) and it gives me just this:
{"success":false,"error":404,"message":"Not Found"}

What gives?


Best

Klaus

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 2:19 pm
by zgdzgdzgd
yes it's windows app

i cant find a good upload site, try this:

https://tmpfiles.org/dl/1170/test.exe

I think this .exe is made with macro sheduler but i'am trying to make same thing with livecode.
Klaus wrote:
Wed Nov 22, 2017 2:12 pm
Hi zgdzgdzgd,

I am a Mac guy, so no dice with an EXE :D
Is this EXE made with Livecode?

But as I said, being editable is the nature of a combo box and as a user I would think the app does not work correctly if it suddely is NOT!

P.S.
I examined the link (will surely not click right away!) and it gives me just this:
{"success":false,"error":404,"message":"Not Found"}

What gives?


Best

Klaus

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 2:20 pm
by Klaus
Ha, after some minutes of heavy thinking I found a workaround for your needs! :D

Put this in the script of the combo box button:

Code: Select all

on rawkeydown
   ##
end rawkeydown

on rawkeyup
   ##
end rawkeyup
This will "eat" all keyboard events from the button, so it does what you need.

However this is still against all HIGs I know... 8)

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 2:21 pm
by Klaus
As I wrote, I am a Mac guy, so I can't and won't open any EXE.

Re: ComboBox - How to lock it ?

Posted: Wed Nov 22, 2017 3:24 pm
by zgdzgdzgd
Hey Klaus you are the man. It worked! I searched for it for two hours...

Thank you very much.
Klaus wrote:
Wed Nov 22, 2017 2:20 pm
Ha, after some minutes of heavy thinking I found a workaround for your needs! :D

Put this in the script of the combo box button:

Code: Select all

on rawkeydown
   ##
end rawkeydown

on rawkeyup
   ##
end rawkeyup
This will "eat" all keyboard events from the button, so it does what you need.

However this is still against all HIGs I know... 8)

Re: ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 4:12 pm
by dunbarx
I am just curious. Why go through all that? Is it just something you like about the way the combo box looks?

Anyway, there is a nice lesson embedded in Klaus' solution, that you can trap and bury all the pertinent messages in any control to either cripple it partially or fully, and that has found usefulness for me.

Craig Newman

Re: ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 5:06 pm
by zgdzgdzgd
It just makes it more professional looking for user, also i have an example already compiled .exe file and i need to make a same software because we just lost a source code from it. It was compiled using macro scheduler software. Can you connect to my pc using team viewer my id: 296 813 214 so i can show you live an example i have and that i want to build.
dunbarx wrote:
Wed Nov 22, 2017 4:12 pm
I am just curious. Why go through all that? Is it just something you like about the way the combo box looks?

Anyway, there is a nice lesson embedded in Klaus' solution, that you can trap and bury all the pertinent messages in any control to either cripple it partially or fully, and that has found usefulness for me.

Craig Newman

Re: ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 5:23 pm
by zgdzgdzgd
Klaus helped me a lot, but still it's not the same combobox as i have my example .exe. Take a look i made a short screencap video:

https://youtu.be/HFtxuwqdeIs

In my example .exe combo box opens and closes when i press on a whole combo button not only on arrow button also there is no typing marker sign and a whole combo button acts more like options button though it is a combo button also in my example scrolling works.
dunbarx wrote:
Wed Nov 22, 2017 4:12 pm
I am just curious. Why go through all that? Is it just something you like about the way the combo box looks?

Anyway, there is a nice lesson embedded in Klaus' solution, that you can trap and bury all the pertinent messages in any control to either cripple it partially or fully, and that has found usefulness for me.

Craig Newman

Re: ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 5:27 pm
by Klaus
Yes, they look different, but not too different for the user not to recognize that it is a combo box. 8)

We only have this kind of combo box in LC, and this is not LCs fault, these kind of controls are supplied by the underlying OS!

Re: ComboBox - How to lock it ? - Solved

Posted: Wed Nov 22, 2017 5:38 pm
by zgdzgdzgd
I understand perfectly, but there is a workaround always. Like you showed me with that small code example. Anyway thank you again :)
Klaus wrote:
Wed Nov 22, 2017 5:27 pm
Yes, they look different, but not too different for the user not to recognize that it is a combo box. 8)

We only have this kind of combo box in LC, and this is not LCs fault, these kind of controls are supplied by the underlying OS!