-
Notifications
You must be signed in to change notification settings - Fork 12
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
#93 add form generator #94
#93 add form generator #94
Conversation
double in C translates to cdouble in nim, not cfloat.
Okay, this is a first draft that basically recreates the sidebar as before. My next step will be to see if I can't move from a custom |
@can-lehmann I've got a... let's say first draft working for auto-generating ExpanderRows per entry for a given type seq[T]. I'm honestly not too sure what to make of this. Then again, I don't think this should happen too often. |
I've decided to just move over to the approach where you defined a custom Added a general custom |
#91 (comment) also applies here, so I would personally prefer to merge this after the JSON discussion and then move any discussions & changes to #95. |
A fully generic approach using T and SomeNumber does the job better and covers more ground.
It now no longer is one that represents tuples etc. as JSON and parses that back. Instead, it now provides a dummy widget that will explain to the user that they must implement a `toFormField` proc with a more elaborate tooltip.
Ohhh merge this into #95 and close this PR? Works for me. |
Basically, if you tell me now this looks okay with the new |
Sounds good. |
Merged into branch of #95, closing this PR. |
This PR adds a generic proc that generates a Box with a List of Widgets for every field in a given object.
Which mostly means for every field in a given
<Widget>State
.This autoform was only used in the
Scale.nim
example for now, other examples shall be updated in a separate PR to keep these small and easily reviewable.The reasoning for why I chose a generic proc rather than writing a generic viewable I laid out in #93
This PR actually only adds an autoform.nim file, but as this branch is one that branched off the one for #90 it contains the same changes as that one.
This PR depends on #90 as #90 provides the scale.nim example and that was what I used as reference to implement this.
As per the usual, it's all up for change regardless. Even if I already have #95, I should be able to relatively simply adjust that to whatever we decide here as I'm semi-sure the concept of "take in a state, iterate over it and spit out a widget based on that" will remain.
closes #93