ComboBox - How to lock it ? - Solved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

ComboBox - How to lock it ? - Solved

Post by zgdzgdzgd » Wed Nov 22, 2017 1:39 pm

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.
Last edited by zgdzgdzgd on Wed Nov 22, 2017 3:25 pm, edited 1 time in total.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ComboBox - How to lock it ?

Post by Klaus » 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

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ?

Post by zgdzgdzgd » Wed Nov 22, 2017 2:00 pm

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

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ComboBox - How to lock it ?

Post by Klaus » 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

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ?

Post by zgdzgdzgd » Wed Nov 22, 2017 2:19 pm

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

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ComboBox - How to lock it ?

Post by Klaus » 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)

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ComboBox - How to lock it ?

Post by Klaus » Wed Nov 22, 2017 2:21 pm

As I wrote, I am a Mac guy, so I can't and won't open any EXE.

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ?

Post by zgdzgdzgd » Wed Nov 22, 2017 3:24 pm

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)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: ComboBox - How to lock it ? - Solved

Post by dunbarx » 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

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ? - Solved

Post by zgdzgdzgd » Wed Nov 22, 2017 5:06 pm

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

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ? - Solved

Post by zgdzgdzgd » Wed Nov 22, 2017 5:23 pm

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
Last edited by zgdzgdzgd on Wed Nov 22, 2017 5:29 pm, edited 1 time in total.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ComboBox - How to lock it ? - Solved

Post by Klaus » 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!

zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: ComboBox - How to lock it ? - Solved

Post by zgdzgdzgd » Wed Nov 22, 2017 5:38 pm

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!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”