Lock ComboBox but enable mouse scroll

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

Lock ComboBox but enable mouse scroll

Post by zgdzgdzgd »

Hello,

i want to lock the combobox so user can't change text inside, but i when i lock it the scroling with mouse doesn't work anymore :/

This is my code:

Code: Select all

on rawKeyDown theKeyNumber
  if theKeyNumber is 65308 then answer down  -- mouse wheel down
  else if theKeyNumber is 65309 then answer up  -- mouse wheel up
  else ## -- locks combobox
  end if
end rawKeyDown
Last edited by zgdzgdzgd on Tue Jan 02, 2018 4:25 pm, edited 1 time in total.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Lock ComboBox but enable mouse scroll

Post by FourthWorld »

An option control does that.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
zgdzgdzgd
Posts: 20
Joined: Wed Nov 22, 2017 1:26 pm

Re: Lock ComboBox but enable mouse scroll

Post by zgdzgdzgd »

Nevermind i think i got it:

Code: Select all

on rawKeyDown theKeyNumber
  if theKeyNumber is 65308 then pass rawKeyDown -- mouse wheel down (65308 key reiškia pelės ratukas žemyn)
  else if theKeyNumber is 65309 then pass rawKeyDown -- mouse wheel up (65309 key reiškia pelės ratukas aukštyn)
  else ## -- lock combobox text
  end if
end rawKeyDown
on rawkeyup
   ##
   end rawkeyup
Post Reply