Enum extender

Tired of having to write extends methods for enums by hand ?
Or want to add an enum more quickly by just typing lines of text ?
Enum extender is my little helper tool for Xojo to make this possible

Completely open source so anyone can see how this works

2 Likes

Thanks, Norm. I could have used this last week. I know it’ll save me lots of time going forward.

the Extends Writer was posted 20 days ago but I think I forgot to post a link here about it :slight_smile:

It sounds interesting, but how about a few sentences in the ReadMe to briefly describe what it does and how one might benefit from it :slight_smile:

1 Like

Stuff with things to do stuff :slight_smile:

Added a description
Its a pretty simple tool in reality
Drag an enum from the IDE onto the Extender window and it will write code for you that can be either an extends methods OR a pair of methods for cases where you dont want to add a module with Extends methods

The other window is just a text area that lets you type lines that it can turn into an enum you can paste rather than click type click type click type in the Enum editor in the Xojo IDE

Nice! Thanks for sharing

No problem

I’m sure things will evolve as I run into stuff I need

Some things I have in mind

  • copy & paste of C enumerations (possibly other languages?) for use in Xojo. I’m thinking primarily of uses for declares where there are long lists of enumerated values in C headers that need to be converted.

  • a feature where dragging out of the window puts a copy on the clipboard automagically for both windows so you can just drag from there to the IDE and you’re done (havent quite sorted HOW I would make this work but thats the basic idea)

You lost me there, I woke up in slow motion this morning.

I want to make it so just dragging from the enumeration editor window to the IDE puts the right kind of drag item in the drag clipboard so it can just be dragged & dropped

This would be instead of having to be pasted as it is now

I’m just not sure about how I’ll make the UI work

Gotcha! I have no idea either LOL

This is a great utility app! One that I wish I’d had six months ago when working on a project with a ton of enums.

Often I’d just edit the text version of whatever project item
But I had a few hundred to add and write extends for and decided to make this a little easier for myself :slight_smile:

Are you aware of the online tool Wayne Golding wrote? It’s not working right now unfortunately, but he links to a video in this post: https://forum.xojo.com/53776-store-an-enum-value/p2#p435752

Some great features including population of pop-up menus, menuitems, and segmented controls.

Sort of :slight_smile:
I dont use exported code files - drag & drop to write the extends
My intent is to make it so you can also drag & drop from the writer to the IDE
No imports & exports required

Yeah, I got that the the UI is different. I just thought the extra outputs were nice ideas.