You have used Visual Studio's Form Designer, right? You know, where you click a picture of a button on the left, plop it down on the form, then edit its properties on the right? That is what I am trying to duplicate.
And no, this is **not** something that the system isn't intended to do. Its a feature built into "all" control containers. VB and other development systems go to rediculous lengths talking about how to "check" if the container you place something on is in "design" or "runtime" mode, so that you can make it behaviour correctly in both environments. The problem is, MS doesn't, apparently, want you using your own application to develop forms. They want you to use "their" designer, so that you have to buy, "their" compilers, so they design "their" controls with an extra check, which tries to determine of you have a license to "design", not just "run" them. Third party controls, which are not part of those with VB, or VC++, do not look for that license key, so can be created in "either" mode.
Its a copy protection scheme, intended to make sure that you must have MS' software to design forms, not an inherent requirement of ActiveX or something internal to the system. I can for example use the utility to create controls from other companies, even in "design mode", just not those from the VB runtimes. The ones for VB, you have to create in "run mode", but its not clear if you can then "switch" to design mode after.
Now, one solution is to use the form designer supplied with .NET. However, that would require everyone to not only install LuaCOM, but also .NET, and some older OS's, like 95, which can run Mushclient, can't run .NET. And of course, since I would be using MS' designer, I would be stuck with their behavour. My preference would have been to design the entire "designer" in Lua, since that would allow me more flexibility. Instead, I may be forced to write in C++ to do it. This hardly makes it something the system "doesn't allow", it just makes the means to get there unneccessarilly complicated and time consuming. But, people "have" done it. I have read articles from people that have, but none of them give any actual code and one involved a dll to be instanced in VB, which provided the feature. The book is out of print, the name of it I don't remember and the guy that wrote it has a irritating habit of using the name Patron for his examples, in every book he ever writes, so trying to find the code using Google won't net you the code from that specific book.
Mind you, it can still be done, with some limitations. For example, one textbox control doesn't let you set it for multiline in run mode, only while in design mode, and there is no way to create a version with multiline already set. Creating a basic window should be trivial, with the right code. Creating some other things..., a bit harder. But you have three options: 1 - manually code the layout into your script, i.e. "obj.top = 0, obj.left = 12", 2- use my idea but manually "design" the layout, i.e.:
<form>
<button
top = 0
left = 0
...>
</button>
</form>
then have a block of script to load and create all the needed stuff, OR 3- use my idea, entirely, where a plugin can let you create, place, then save the layout of the above, so that the other block of code can read it in and produce the final result.
All are possibilities. 1 and 2 are hardly coder friendly, never mind easy to manage for someone only learning how. The last one "should" be possible, but MS' rediculous paranoia and copy protection schemes keep getting in the way.
Is that clearer? |