Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[ WidgetImpExp ]] Added ability to import / export widget state as a… #2345

Merged

Conversation

Projects
None yet
5 participants
@runrevmark
Copy link
Contributor

commented Jun 2, 2015

You can now do:
export to array tVar
and
import widget from array tVar

The former will create an array with two keys $kind and $state representing the widget's internal state.

The latter will create a widget from such a widget internal state array.

[[ WidgetImpExp ]] Added ability to import / export widget state as a…
…rrays.

You can now do:
  export <widget> to array tVar
and
  import widget from array tVar

The former will create an array with two keys $kind and $state representing the widget's internal state.

The latter will create a widget from such a widget internal state array.
Merge branch 'develop' into feature-impexp_widget_array
Conflicts:
	engine/src/parseerrors.h

@runrevmark runrevmark added this to the 8.0.0-dp-3 milestone Jun 2, 2015

@runrevmark

This comment has been minimized.

Copy link
Contributor Author

commented Jun 2, 2015

I just realised - I need to add the mapping from LCB type-world to LCS type-world to this!

@peter-b peter-b modified the milestones: 8.0.0-dp-3, 8.0.0-dp-4 Aug 20, 2015

@peter-b peter-b modified the milestones: 8.0.0-dp-4, 8.0.0-dp-5 Aug 28, 2015

@livecode-vulcan

This comment has been minimized.

Copy link

commented Aug 31, 2015

📝 Hi @runrevmark, I haven't been able to verify that you've signed our LiveCode Contributor's Agreement.

If you have previously signed the Contributor's Agreement, I may not be able to detect it because you haven't linked your GitHub account to your LiveCode account.

Please see the information for contributors for more information.

@montegoulding

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2015

@runrevmark looking forward to this being merged in. If I read bind right if the kind isn't loaded the state will be retained anyway so that at some point when the kind is available it can be initialised with the correct state. Is that correct?

@livecodefraser

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

What still needs to be done with this PR?

@runrevmark

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2015

@montegoulding: That's correct. If the engine doesn't know the type of widget at load time, then it won't instantiate an instance of the widget but will retain the state array which it was saved with. Although it doesn't happen yet, at some point the engine will go through and automagically instantiate any widgets when the appropriate extension is loaded. At the moment, if an appropriate extension isn't loaded at the point the widget is, it will remain inert until the stack is reloaded.

(The import from array command does exactly the same as when loading the object from a stackfile - so you can use it to create widgets which are 'unknown type', the given state will be preserved).

@runrevmark

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2015

@livecodefraser: I think it is okay as it is for now. It isn't quite finished on two fronts - deciding whether $state and $kind are the correct way to go to annotate the array and extending support to all object types. The main reason for adding this at the moment was so that @montegoulding could get lcVCS working with widgets, a purpose for which this should be sufficient.

runrevmark added some commits Sep 1, 2015

else
else if (format == EX_OBJECT)
{
// COMPILE-TODO

This comment has been minimized.

Copy link
@livecodefraser

livecodefraser Sep 1, 2015

Member

Is there something we can do here to indicate an error?

This comment has been minimized.

Copy link
@runrevmark

runrevmark Sep 1, 2015

Author Contributor

That code isn't used at the moment - it is part of the 'compile' stuff for later use when translating scripts.

@livecodefraser

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

@runrevmark runrevmark removed the WIP label Sep 1, 2015

@livecode-vulcan

This comment has been minimized.

Copy link

commented Sep 1, 2015

📝 Hi @runrevmark, I haven't been able to verify that you've signed our LiveCode Contributor's Agreement.

If you have previously signed the Contributor's Agreement, I may not be able to detect it because you haven't linked your GitHub account to your LiveCode account.

Please see the information for contributors for more information.

@livecode-vulcan

This comment has been minimized.

Copy link

commented Sep 1, 2015

💙 review by @livecodefraser ok d0fcd78

livecode-vulcan added a commit that referenced this pull request Sep 1, 2015

Auto-merge pull request #2345 from runrevmark/feature-impexp_widget_a…
…rray

[[ WidgetImpExp ]] Added ability to import / export widget state as a…

You can now do:
  export <widget> to array tVar
and
  import widget from array tVar

The former will create an array with two keys $kind and $state representing the widget's internal state.

The latter will create a widget from such a widget internal state array.
@livecode-vulcan

This comment has been minimized.

Copy link

commented Sep 1, 2015

😎 test success d0fcd78

@livecodefraser

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

I'm curious as to how this managed to build when there are merge conflicts...

Merge branch 'develop' into feature-impexp_widget_array
Conflicts:
	engine/src/parseerrors.h
@runrevmark

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2015

Hmmm - that is puzzling! Maybe it built before the is really stuff was integrated (the conflict was due to parseerrors.h)

@livecodefraser

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

@livecode-vulcan

This comment has been minimized.

Copy link

commented Sep 1, 2015

💙 review by @livecodefraser ok 622a8e4

livecode-vulcan added a commit that referenced this pull request Sep 1, 2015

Auto-merge pull request #2345 from runrevmark/feature-impexp_widget_a…
…rray

[[ WidgetImpExp ]] Added ability to import / export widget state as a…

You can now do:
  export <widget> to array tVar
and
  import widget from array tVar

The former will create an array with two keys $kind and $state representing the widget's internal state.

The latter will create a widget from such a widget internal state array.
@livecode-vulcan

This comment has been minimized.

Copy link

commented Sep 1, 2015

😎 test success 622a8e4

livecodefraser added a commit that referenced this pull request Sep 2, 2015

Merge pull request #2345 from runrevmark/feature-impexp_widget_array
[[ WidgetImpExp ]] Added ability to import / export widget state as a…

@livecodefraser livecodefraser merged commit 03321ae into livecode:develop Sep 2, 2015

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/vulcan/cla Contributor Agreement signed by @runrevmark
continuous-integration/vulcan/pr The Vulcan build succeeded on 7 builders
continuous-integration/vulcan/review Approved by reviewer @livecodefraser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.