tpecholt / imrad

ImRAD is a GUI builder for the ImGui library
GNU General Public License v3.0
914 stars 29 forks source link

Preview for generated code. #4

Closed RicoP closed 1 year ago

RicoP commented 1 year ago

It would be nice to have a button that shows a preview of the generated code.

This can be handy in cases when I quickly want to mockup a design in imrad and just want to copy and paste the generated code into my existing codebase.

tpecholt commented 1 year ago

I agree it might be useful and I guess you just want to preview a dialog Draw function to make the feature easy to use.

However for modal dialogs ImRAD currently generates supporting code like requestOpen, requestClose logic and calls a callback when dialog was closed by a button with modal result set. These need extra fields which are only declared in the generated class found in the header file so showing a preview of cpp file will show incomplete code which won't compile without few modifications. I assume this is not a problem?

tpecholt commented 1 year ago

I have created a basic preview functionality. There is a new button on the toolbar. Can you check if it fulfills your needs?

RicoP commented 1 year ago

Yes! I gonna check it when I have the time~