edit a field while another object is selected

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
raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

edit a field while another object is selected

Post by raugert » Sun Mar 18, 2018 5:13 pm

I am working in "pointer mode" during runtime to allow editing of objects, but I would like to edit the text in a "field" while keeping the other object selected.

I set the field to "cantSelect" so that the other object remains selected. Now when I click in the field, the cursor is visible in the field but I can't add any text to it..

thanks for the usual help.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9834
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: edit a field while another object is selected

Post by FourthWorld » Sun Mar 18, 2018 6:09 pm

Reproduced here. Not sure if it's a bug per se, but there's an argument that it should be considered a bug given that the goal of cantSelect is to allow an object to behave as though the browse tool is selected, and the browse tool is the only one which allows text entry.

You might consider submitting a bug report on that. Given that this behavior has been in place since cantSelect was first implemented the team may recategorize it as an enhancement request. Either way, unless this is something that's especially easy to remedy, I wouldn't expect an engine change for this any time soon (very rarely needed, and v9 just went into RC so the earliest this could be considered would be weeks away in the v10 cycle).

I can think of two workarounds:

a) Move the field to a borderless palette window, dynamically positioned when the stack beneath it moves.

b) Dynamically change the global tool property from pointer to browse when the mouse enters the field. To preserve the selection you can do something like:

Code: Select all

on mouseEnter
   lock screen
   put the selectedObjects into tSelObjs
   choose browse tool
   repeat for each line tObj in tSelObjs
      set the selected of tObj to true
   end repeat
end mouseEnter
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: edit a field while another object is selected

Post by bogs » Sun Mar 18, 2018 6:43 pm

Erm, 3rd choice, use the message box to change the contents :D
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9834
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: edit a field while another object is selected

Post by FourthWorld » Sun Mar 18, 2018 6:52 pm

bogs wrote:
Sun Mar 18, 2018 6:43 pm
Erm, 3rd choice, use the message box to change the contents :D
Difficult in a runtime environment without a Message Box, but indeed some external means of editing field contents, such as we see in spreadsheets, may not be bad.

Still nice to directly interact, though. Users love the direct interaction of see-and-click, without having to think about other regions of the screen than the one they want to change.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: edit a field while another object is selected

Post by raugert » Sun Mar 18, 2018 7:08 pm

Thanks very much Richard,

I was thinking it should behave like that as well. I'll submit a bug/request report. Your workaround (b) works good for what I'm doing.

much appreciated!
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: edit a field while another object is selected

Post by bogs » Sun Mar 18, 2018 7:26 pm

FourthWorld wrote:
Sun Mar 18, 2018 6:52 pm
Still nice to directly interact, though. Users love the direct interaction of see-and-click, without having to think about other regions of the screen than the one they want to change.
True that.
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”