Scripting full xPopup editor with xTextreplace Thread last updated on 2007-12-06 20:50:30

Posted by member 256241 on 2007-12-06 13:19:39

Hi, I'm hoping to make a popup in my theme customizable from within the theme, without messing around in .RC files. I'm keen on doing this because EVERY other thing in my theme can be changed in-theme, without opening notepad - which I see as something quite important if you're ever going to gather anyone but tech-heads to using my theme (and Litestep).


I know it's a big task, but I was thinking I could do it using xTextreplace (use xtextreplace already to generate a dynamic popup of all weather locations)to output the right info for the popup.


There are a couple of issues which I know will be troubling for me. The first is that there would be a dynamic number of entries in each submenu. I've never created anything dynamic in Litestep (a dynamic sized array), and don't know if it's possible. I created a customizable set of quicklaunch buttons but it only works since there's always only 20 of them, so I can manually define 20 values... Without knowing how many there will be, definitions can't be made.

So, my thoughts were something like:

|------------| |-------------| |----------------|

those represent each sub folder (games, tools, internet apps etc) which will contain the defined shortcuts. Something like right click on the item brings up a comdlg to browse to the new entry, which is then added to that popup submenu - or stack, underneath each parent folder would be listed the comprising popup entries.

Apart from the issue of a dynamic number of entries, the other thoughts that struck me as potential obstacles were deleting entries and having the list sorted into alphabetical order, without retaining the order they were added in.


I haven't actively started making this yet, I'm just after general advice/pointers. I've managed to get this far in my theme just using MZscript - is something like this only going to be possible with LUA? Or maybe something that would be easier in C++ or VB? I saw that there was a similar app called LSPE however it won't work for me on two counts - first - it 100% crashes (for me), and second, my popup contains hooked items and other code which wouldn't be recognised as a nortmal popup.


So, has any other theme done anything like this? Does anyone have any input on this vague matter which they'd be willing to share with me?


Thanks for reading the long post.

Posted by member 256241 on 2007-12-06 14:33:30 link

Having spoken on IRC... It seems this would need a proper scripting language... so I'm considering writing a c++ app to do it..

It seems like another option would be just to make a folder, and allow the user to add shortcuts to the menus like that, and have the popup read from the folder (although at the moment I'm certain if I can do that with my popup, as there's plenty of other stuff going on in the root of that popup; hooking etc).

Posted by member 1 on 2007-12-06 17:48:05 link

Instead of going the C++ route...I would look into LSLUA. Never used LUA myself but I hear it is a powerful scripting language and might just do what you need without having to compile an app. ((Because there are people like me that would feel uncomfortable with running an app like that.))

Posted by member 212670 on 2007-12-06 20:50:30 link

Not sure if this'll be helpful at all, but it was a good start.

http://lspe.sourceforge.net/