Edit mode action control

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
marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Edit mode action control

Post by marksmithhfx » Sun Aug 30, 2020 9:28 pm

According to the documentation:
Use edit mode action select control to specify the action select control to display when the data grid is in edit mode. This defaults to a red stop icon. Set to empty to prevent the action select control from being displayed.
If I set it to empty, and then change my mind, how do I set it back again? (ie. what is the long id of the "edit mode action select control"?)

Thanks
m
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Edit mode action control

Post by marksmithhfx » Sun Aug 30, 2020 9:48 pm

Related question.

When the default Edit Mode Action Control (a red stop icon) is selected, a "Delete" button appears on the right. Does anyone know if we can hook into that code? I need to add some functionality to this "delete" action. And short of just disabling the whole thing and rolling my own (not terrible, but why? when you have the code sitting somewhere) I can't see a way to do it.

Cheer, and thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Edit mode action control

Post by Simon Knight » Tue Sep 01, 2020 7:08 am

Re your first question:

try

Code: Select all

   get the  dgProp["edit mode action control"] of group "myDataGrid" 
   put it into field "results"
   put it into tMyVar
store it in your variable (tMyVar) for use in the future.

Oops I have just noticed that it returns a group that does not work.
best wishes
Skids

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Edit mode action control

Post by Simon Knight » Tue Sep 01, 2020 8:23 am

Hi again,

So I was on the correct track : The code above will post an ID to a group in the datagrid templates. e.g.
group id 1010 of card id 1005 of stack "Data Grid Templates 1598941616835"
Copy this text (your version not mine!) and then open up the inspector on your datagrid.
Next display the custom properties and select dgProps from the drop down.
Scroll down and find "edit mode action control"
select this and paste the text you just copied.
Lastly press the refresh (datagrid) button otherwise your recent change will not be displayed.

I'm working on doing this from script and will post when I have a solution.
best wishes
Skids

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Edit mode action control

Post by Simon Knight » Tue Sep 01, 2020 8:49 am

So from script you need to ensure that the custom property is set to a text value.

e.g.

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598941616835" & quote into tString
Note the use of the constant "quote" to place a double quote character into the variable tString

See the code in button reset in my crude sample stack .

S
Attachments
dgExample.livecode.zip
example resetting edit mode action control
(8.02 KiB) Downloaded 194 times
best wishes
Skids

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Edit mode action control

Post by marksmithhfx » Tue Sep 01, 2020 8:33 pm

Simon Knight wrote:
Tue Sep 01, 2020 8:49 am
So from script you need to ensure that the custom property is set to a text value.

e.g.

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598941616835" & quote into tString
Note the use of the constant "quote" to place a double quote character into the variable tString

See the code in button reset in my crude sample stack .

S
Simon, thanks for your work on this. That's tons of great information. So I was able to track down the ID of the control following your advice and have attached it. So, just to be sure, using this information I would set it back to the "stop icon" by saying:

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598001738686" & quote into it
set the dgProp["edit mode action control"] of group "DataGrid 1" to it
I'll have to give it a try. Thanks so much, I really appreciate it.

Mark
Attachments
Screen Shot 2020-09-01 at 9.58.30 AM.png
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Edit mode action control

Post by Simon Knight » Wed Sep 02, 2020 2:19 pm

Hi,

Yes I think that should work. I probably would not use the "it" variable because Livecode is free to write to it and I like to keep a close check on my variables.

best wishes

Simon
best wishes
Skids

Post Reply