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: heatherlaine, Klaus, FourthWorld, kevinmiller

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

Lock ComboBox but enable mouse scroll

Post by zgdzgdzgd » Tue Jan 02, 2018 4:07 pm

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: 6031
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Lock ComboBox but enable mouse scroll

Post by FourthWorld » Tue Jan 02, 2018 4:17 pm

An option control does that.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

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

Re: Lock ComboBox but enable mouse scroll

Post by zgdzgdzgd » Tue Jan 02, 2018 4:25 pm

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

Return to “Getting Started with LiveCode - Complete Beginners”