Hello,
I am attempting to allow users to click on a disabled text Field to get the click line
then there is a button to delete the line that was clicked on.
It would be cool if the line was highlighted or changed color but its not mandatory.
CODE IN THE TEXT FIELD :
global gLine
on mouseup
select the clickLine
put the value of the clickLine into gLine
end mouseup
CODE IN THE BUTTON :
global gLine
on mouseUp
delete line gLine of fld "Inv1"
end mouseUp
Bonus points if anyone knows how to disable a field without making the contents of the field "greyscale"
THANKS!
Clickline problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Clickline problem
Hi,
don't "Disable" it - set it to "Lock text" & "List behaviour"!
No script required in the field.
In the button just this:
Have fun!
don't "Disable" it - set it to "Lock text" & "List behaviour"!
No script required in the field.
In the button just this:
Code: Select all
delete line (word 2 of the selectedline of fld "MyField") of fld "MyField"
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: Clickline problem
Thanks AxWald!
I will lock text instead of disable.
I had seen some other posts talking about delete (word 2 of .... And I didn't understand cause I want to delete the line not word 2. Now I understand that word 2 is actually referencing the clickline not the field.
Problem solved Thanks A lot
I will lock text instead of disable.
I had seen some other posts talking about delete (word 2 of .... And I didn't understand cause I want to delete the line not word 2. Now I understand that word 2 is actually referencing the clickline not the field.
Problem solved Thanks A lot
Re: Clickline problem
Hi,
OK, it's a strange expression, right. But let's have a look:
"the selectedline" returns something like "line 2 of field 3". Would be cool if we just could write:
Looks quite OK, but for whatever reason it doesn't work at all. And with " of fld "MyField"" added it doesn't even compile ...
(I'm sure some Guru will come soon with a more elegant solution ...)
So, "the selectedline of fld "MyField"" returns "line 2 of field 3".
"Word 2" of it is "2" (words are delimited by spaces).
So, basically, we "delete line 2 of fld "MyField""
We could also:
For more fun, try above mentioned "delete the selectedLine" in a mouseup handler in the field ...
Hope I could add to the confusion Have fun!
OK, it's a strange expression, right. But let's have a look:
Code: Select all
delete line (word 2 of the selectedline of fld "MyField") of fld "MyField"
Code: Select all
delete the selectedLine
(I'm sure some Guru will come soon with a more elegant solution ...)
So, "the selectedline of fld "MyField"" returns "line 2 of field 3".
"Word 2" of it is "2" (words are delimited by spaces).
So, basically, we "delete line 2 of fld "MyField""
We could also:
Code: Select all
do "delete " & the selectedline of fld "MyField"
For more fun, try above mentioned "delete the selectedLine" in a mouseup handler in the field ...
Hope I could add to the confusion Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Clickline problem
This works too, though it may be just as confusing:
Code: Select all
delete line (the hilitedline of me) of me
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com