Disabling mouse events.

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
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Disabling mouse events.

Post by tasdvl9 » Wed Apr 23, 2014 1:30 am

Hello All,

I'm trying to disable all mouse messages when I am accessing a very large database using dbGet.

I'd like the cursor to show busy and not give the user the ability to click on the window my data grid resides on.

Any reccomendations?

Thanks!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10335
Joined: Wed May 06, 2009 2:28 pm

Re: Disabling mouse events.

Post by dunbarx » Wed Apr 23, 2014 2:30 am

Hi.

Busy cursor, eh?

Do you plan on something blocking, like:

Code: Select all

on mouseUp
   repeat until the optionkey is down
      set cursor to busy
wait 1
   end repeat 
end mouseUp
If you put this into a button, you are locked out of doing just about everything until that optionKey goes down. I assume you would invoke this inside another handler, of course. Is this OK for you? I did mean everything...

Craig Newman

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Disabling mouse events.

Post by tasdvl9 » Wed Apr 23, 2014 3:00 am

Hi Craig,

Thanks for the reply.

Basically what I am trying to do is set my cursor to busy or waiting while I access a very large database.
I would like to 'lock out' the user from being able to click on my card Window until the query from the data base has been completed
and my data grid has been filled up.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Disabling mouse events.

Post by Dixie » Wed Apr 23, 2014 3:58 am

Have a read of 'flushEvents" in the dictionary...:-)
Example of using from the dictionary...

Code: Select all

  on mouseUp
-- ...lengthy handler goes here...
-- get rid of clicks since the handler started:
   put flushEvents("mouseUp") into temp
  end mouseUp

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10335
Joined: Wed May 06, 2009 2:28 pm

Re: Disabling mouse events.

Post by dunbarx » Wed Apr 23, 2014 5:02 am

Ah, Dixie has a much more "natural" solution. I ha forgotten about "flushEvents". You need to explicitly name each event that you want to preclude, however. My "old fashioned" method is more like a stubborn mule.

Craig

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Disabling mouse events.

Post by [-hh] » Wed Apr 23, 2014 2:55 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:03 pm, edited 1 time in total.
shiftLock happens

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Disabling mouse events.

Post by tasdvl9 » Wed Apr 23, 2014 3:17 pm

Thanks, Guys!

I wasn't even aware of the 'lock messages' command.

I think I have what I need to make substantial progress.

Much appreciated :)

Post Reply