position fr a click in an editable field

thierry douez at wanadoo.fr
Fri Oct 1 12:31:03 EDT 2004


Hi,

>> Any help would be very much appreciated...

KM> Let me see if i understand you correctly...

almost, almost... as usual :-)

KM> put the selectedchunk into hereweare
KM> if word 4 of hereweare > word 2 of hereweare then
KM>     ## no selection, just a blinking cursor...
KM> end if

KM> Hope this helped...(?)


Well, look above: I've find kind of solution for the problem.
When one Right-Click on an editable field, the selectionChanged
is not called; neither the selectedchunk refreshed ????

So, after lots of tries, i found this one :
add the instruction : "Click at the clickLoc" in the mouseup handler
which obviously do the right job....
i would have liked to do this in a mousedown handler, but this
work around does not work.

Now, the customer can right-click anywhere in the text, the selection
is made and i can do some text processing to fill up the contextual menu...

So, another question :-)  is this a bug ?

thank you and enjoy your week-end,

-------------------------------
on selectionChanged
 put " selectionChanged: " && the selectedChunk  into field "R"
end selectionChanged

on mouseUp
  click at the clickLoc
  SetTheContextPopUp
end mouseUp
 
on SetTheContextPopUp
  if the mousetext is not empty then select the mousetext

  put word 2 of the selectedChunk  into c1
  put word 4 of the selectedChunk  into C2

  put c1 & " - " & c2  & \
      cr & "selectedChunk: " & the selectedChunk & cr & \
      "mousetext: " & the mouseText  & \
      cr & "clickChunk: " & the clickChunk  & \
      cr & "clickText: " & the clickText  &\
      cr & "selectedText: " & the selectedText &\
      cr & "XXX"  \
      into theMenu
  put cr & "-" & cr & "exit" after theMenu
  put theMenu into control "ContextButton"
  popup button "ContextButton"
   

Best regards,  thierry



More information about the use-livecode mailing list