in a CALCULATOR stack as a response to Roger Guay's posting on the Use-List:
- -
The three "buttons" (they are really images) down the bottom will, at least, annoy someone.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller



Code: Select all
on mouseUp
   put "5" after fld "fWORK"
   select after fld "fWORK"
end mouseUp
Code: Select all
on mouseUp
   focus fld "fWORK"
   set the itemDelimiter to " "
   put item 4 of the selectedChunk into FRONTCHAR
   if FRONTCHAR is not 1 then
      select char FRONTCHAR to (FRONTCHAR - 1) of fld "fWORK"
   end if
   focus fld "fWORK"
end mouseUp
Code: Select all
on mouseUp
   put the number of chars in fld "fWORK" into SSUM
   focus fld "fWORK"
   set the itemDelimiter to " "
   put item 2 of the selectedChunk into BACKCHAR
   if BACKCHAR is not SSUM then
      select char (BACKCHAR + 1) to BACKCHAR of fld "fWORK"
   end if
   focus fld "fWORK"
end mouseUp
Code: Select all
on mouseUp
   set the itemDelimiter to " "
   put item 2 of the selectedChunk into Z4
   delete char Z4 of fld "fWORK"
end mouseUp

Code: Select all
on mouseUp
   set the itemDelimiter to " "
   put item 2 of the selectedChunk into Z4
   delete char Z4 of fld "fWORK"
end mouseUp
so, obviously, that needs looking at.your "left-arrow' emulation gets it wrong if there is a chunk selection active.

Now, if I have this in the field "fWORK" script:your "left-arrow' emulation gets it wrong if there is a chunk selection active.
Code: Select all
on mouseEnter
   focus on fld "gg"
end mouseEnterCode: Select all
on mouseDown
   focus on fld "gg"
end mouseDown
on mouseUp
   focus on fld "gg"
end mouseUp
Code: Select all
on mouseEnter
   set the lockText of fld "fWORK" to true
end mouseEnter
on mouseLeave
   set the lockText of fld "fWORK" to false
end mouseLeave
Code: Select all
on mouseEnter
   set the lockText of fld "fWORK" to true
end mouseEnter
on mouseLeave
   set the lockText of fld "fWORK" to false
end mouseLeave
Code: Select all
on mouseUp
   focus fld "fWORK"
   set the lockText of fld "fWORK" to false
   set the itemDelimiter to " "
   put item 4 of the selectedChunk into FRONTCHAR
   if FRONTCHAR is not 1 then
      select char FRONTCHAR to (FRONTCHAR - 1) of fld "fWORK"
   end if
   focus fld "fWORK"
   set the lockText of fld "fWORK" to true
end mouseUp

1. Some "real prickly types" round these parts.Don't you mean "my cooperating version ..."; surely the use-list is about helpful cooperatin and collaborative suggestions, not about competing



Yes, the "whole 'locktext' thing is weird' . . .1. the whole 'locktext' thing is weird, and causes various anomalies.
When I first open the stack, and click in the field, I can type digits and have them appear in the field, as you'd expect. But once I've clicked on an 'arrow-emulator' the field becomes locked and one can no longer type in characters. Clicking *outside* the field will then free it up again, so typing becomes possible.
That is a pain-in-the-bum as, yes, the insertion point ('iBeam') does disappear when the lockText is true,2. disappearing iBeam.
If I position the ibeam in the middle of the text in the field, and use one of the arrow emulator buttons, the iBeam moves properly - but then disappears (perhaps when the 'locktext' is set true).

Code: Select all
on mouseUp
   set the lockText of fld "fWORK" to false
   set the itemDelimiter to " "
   put item 2 of the selectedChunk into Z4
   put "0" after char (Z4 - 1) of fld "fWORK"
   set the lockText of fld "fWORK" to true
end mouseUp
Code: Select all
on openCard
   set the lockText of fld "fWORK" to true
   select after fld "fWORK"
end openCard
This is odd; over 'here' on a Macintosh machine (macOS 12.1)Clicking *outside* the field will then free it up again, so typing becomes possible.
