[[ DataGrid 2 ]] Edit mode and swipe actions.#1861
[[ DataGrid 2 ]] Edit mode and swipe actions.#1861livecodeali merged 1 commit intolivecode:developfrom
Conversation
5c24500 to
655d400
Compare
4b651ad to
37b6f03
Compare
| Associations: datagrid, datagrid commands | ||
|
|
||
| Syntax: dispatch "RowSwipeShowControlForIndexAndSide" to group "DataGrid" with | ||
| <row index>, {left | right} |
There was a problem hiding this comment.
I think "left" and "right" should be in quotes here
| <EditModeActionSelectControlClicked> if you wish to perform a custom behavior. | ||
|
|
||
| pTarget is the target of the click. Use this to determine where in the action | ||
| control the user clicked. |
There was a problem hiding this comment.
You can put the info about pTarget in a
Parameters:
pTarget:
section
| <EditModeActionControlClicked> if you wish to perform a custom behavior. | ||
|
|
||
| pTarget is the target of the click. Use this to determine where in the action | ||
| control the user clicked. |
|
|
||
| <pIndex> is the index of the reordered row. <pStartLineNo> is the original line | ||
| sequence number of the row within the data grid. <pNewLineNo> is the new line | ||
| sequence number of the row within the data grid. |
There was a problem hiding this comment.
These should be documented as parameters
| local sReorderStartIndex | ||
| local sReorderStartLine | ||
| local sReorderLastHoverLine | ||
| local sReoderMouseMoveInProgress |
There was a problem hiding this comment.
Not a bug as you've been consistent, but there's a typo in this variable name
There was a problem hiding this comment.
Haha, reoder. I'm an idiot.
| local sReorderScrollPollMsgID | ||
|
|
||
| constant kReorderScrollPollRate = 30 | ||
| constant kReoderScrollPollMargin = 30 |
| local sCustomisableControlsInitialised | ||
| local sCustomisableControlsA | ||
| local sConstomisableControlsSingletonsA | ||
| local sConstomisableControlsSingletonCopyMapA |
There was a problem hiding this comment.
Some constomisable rather than customisables here
There was a problem hiding this comment.
It's not even close. Where did the n come from?
There was a problem hiding this comment.
Haha, looks like your fingers got so used to typing constant. I do it all the type with local when I'm trying to lock messages- locak messages all the time
|
This looks great as far as I can tell, other than a couple of docs things and non-critical typos. One minor suggestion I have is that the |
|
@livecodeali Yeah, I wasn't sure about that. I originally had them as functions since they return a result - it makes sense. But then figured there wasn't really any context elsewhere for doing something similar: The programmer implementing a function that's called by LiveCode felt a bit weird. Handling messages sent by LiveCode felt more typical. I don't think either method is particularly nice, so I'm happy to go either way. As you say, it's just a single word change (along with docs updates). I don't know if anyone else has an opinion. |
37b6f03 to
404b67a
Compare
The DataGrid has been extended to include a new edit mode and swipe actions. The following properties have been added to the DataGrid: - set the dgEditMode of group "dg" to <true|false> - set the dgProps["animate actions"] of group "dg" to <true|false> - set the dgProps["enable swipe"] of group "dg" to <true|false> - set the dgProps["edit mode action control"] of group "dg" to <control id> - set the dgProps["edit mode action select control"] of group "dg" to <control id> - set the dgProps["edit mode reorder control"] of group "dg" to <control id> - set the dgProps["left swipe control"] of group "dg" to <control id> - set the dgProps["right swipe control"] of group "dg" to <control id> The following commands have been added to the DataGrid: - dispatch "EditModeShowActionControlForIndex" to group "dg" with <index> - dispatch "EditModeShowActionControlForIndex" to group "dg" with <true|false> - dispatch "RowSwipeShowControlForIndexAndSide" to group "dg" with <index>, <left|right> - dispatch "RowSwipeHideControl" to group "dg" with <true|false> The following messages are sent to the DataGrid: - on EditModeReorderStarted pIndex, pLineNo - on EditModeReorderCompleted pIndex, pStartLineNo, pNewLineNo The following messages are sent to the appropriate row control of the DataGrid: - on EditModeActionSelectControlClicked pTarget - on EditModeActionControlClicked pTarget - on EditModeActionControlHidden - on RowSwipedRight - on RowSwipedLeft - on RowLeftSwipeControlClicked pTarget - on RowRightSwipeControlClicked pTarget - on RowLeftSwipeControlHidden - on RowRightSwipeControlHidden The following messages are sent to the each row control of the DataGrid, allowing for control customisation: - on GetEditModeActionControl - on GetEditModeActionSelectControl - on GetEditModeReorderControl - on GetLeftSwipeControl - on GetRightSwipeControl revdatagridlibrary.rev has been updated to include the new behaviours and an updated template row behaviour script.
404b67a to
8089bd6
Compare
|
@livecodemichael The precedent in my head is |
|
@livecode-vulcan review ok 8089bd6 |
|
💙 review by @livecodeali ok 8089bd6 |
The DataGrid has been extended to include a new edit mode and swipe actions.
The following properties have been added to the DataGrid:
The following commands have been added to the DataGrid:
The following messages are sent to the DataGrid:
The following messages are sent to the appropriate row control of the DataGrid:
The LayoutControl message sent to the row control has been updated to add a second parameter:
The following messages are sent to the each row control of the DataGrid, allowing for control customisation:
revdatagridlibrary.rev has been updated to include the new behaviours and an updated template row behaviour script.