Archive: CodeMate?


23rd July 2003 10:52 UTC

CodeMate?
I wondered wheter i should write a prog to make avs coding easier.

Some functions would be:

-resizeable editor windows
-template code fragments
-? (your idea)

I partially started already, but i'd like to know wheter there's any need for this as some of you already did part of it with resource hacking.

Just tell me.


23rd July 2003 11:10 UTC

So would avs be running under and when you make the changes in codemate they change in AVS as well? Or is it like a copy&paste thing :P

Anyway... i think... i would find it useful to resize the docking window so i could have the editor and the avs window all together, due to my small resolution this would be helpful to me. But i dunno, it sounds pretty far out idea... The whole codemate thing sound great tho, i would probably use it (if it doesn't give me any error msg's in a languange i know nothing about, heh heh :p)


23rd July 2003 11:23 UTC

Sounds pretty good,especially the resizable docking window.


23rd July 2003 11:23 UTC

The resizing and repositioning thing is possible, this is what i started with. This should be detailed available for SSC and DM's

Templates would be copy&paste of course but for multiple editing windows, so you can have an empty 3D SSC/DM

The CodeMate itself should be just a tiny window or a systray icon to do the settings once or to refresh if nessecary.


23rd July 2003 13:17 UTC

Tried this once (got the syntax highlighting working already) but it kept crashing AVS. But my approach was to replace the actual editboxes with a different control inside the dialog, so it was in-place.

I don't think I'll finish it though, so here's my code. The parser is complete and will work for any rich-edit box...

Maybe this is useful ;).


Btw, the colors are bad, I know, but this was just a test palette to try it out ;).


23rd July 2003 14:28 UTC

Thanx, i'm gonna check this. Will be usefull although i'll have to convert this to Delphi.


24th July 2003 12:21 UTC

Ok, had a look at this in detail now. I don't think in-place replacing will really work, because replacing means you gotta link all the event messages back up / simulate them which is a pain in the ass.

Unlike Hotlist i'd want this to be a public project, in fact i ask all programming skilled avsers to join in if they like.

For compatibillity reasons, i'll skip the idea of doing this in Delphi, i'll use C++ instead.

As soon as the main parts are converted, i'll post this here so you can start working out functions and stuff.

So who's gonna be in???


25th July 2003 05:06 UTC

Magic.X if i can be a beta tester you will be my hero


25th July 2003 08:36 UTC

I will post all results here, so anyone can do testing.

I'm on vacation for the next 2 weeks, but I'll keep up work meanwhile so you'll get some results afterwards (and maybe i'll manage to post something earlier)


25th July 2003 19:51 UTC

Magic.X: actually in-place replacing should still be possible, but I don't think my method of sharing the message loop across the threads is a good idea. I think you'd have to hook into the message loop instead and pass them on that way.


26th July 2003 08:11 UTC

um... i am a little confused. how is this program supposed to make avs coding easier?


26th July 2003 22:34 UTC

Syntax highlighting, easy insertion of often-used code (3d conversion). Looking at the code UnConeD posted explains a lot.


27th July 2003 06:51 UTC

i would look at the code, but it would be greek to me (i wonder if people in greece use that term)


27th July 2003 18:40 UTC

Not really. Just read the comments. That's how I figured out the features


1st August 2003 19:31 UTC

Originally posted by UnConeD
I think you'd have to hook into the message loop instead and pass them on that way.
Not to forge that you'll need to unhook the original elements to avoid confirmation message conflicts.
Anyway, hooking messageloops is actually a bit above my programming skills. What i'd thought of instead is eventually creating replacement objects. If any change occurs, the content will be pasted to the original elements and (if nessecary) faked confirmation messages will be send to the parent handle.

3rd August 2003 00:37 UTC

<.< >.> ^.^ sounds right.... hehe Just keep up the work and Ill tell ya what i think of it! :D


13th August 2003 13:04 UTC

Here is the current state of Work.

Within the rar you'll find my CBuilder Sources, as well as the compiled Project and a example SettingFile.

The Main Settings are done.
You can adjust the Editor to your needs with an optional autoapply mode.
Note that this is not optimized yet and shall be a lot faster later on.
The settings are already saveable.

Now i need to do the same with the specific SSC and DM Structures.

If these things are done, i'll try to figure out how i can insert UnConeD's codemaster control-replacemant can be added.

Any test reports or co-works on this project are appreciated.


13th August 2003 16:08 UTC

cant you give us a zip file? i dont have winrar:rolleyes:
i wanna see it!:(


14th August 2003 06:07 UTC

Here is it. But i had to remove some temp files that are used for builder settings. They willl be crecreated anyway.


14th August 2003 16:53 UTC

Some quick stuff:
- Use proper names, both for objects and filenames. Makes it easier for others to work with your code.

- Don't put settings in a file in the root C:\ drive. Use the registry, or if you really want to use a file, put it in the user's local-settings folder (you can retrieve its path using the Shell API, SHGetSpecialFolderLocation-something something if I recall correctly).

- Store your settings in a semi-self-descriptive format. XML is encouraged. You can use TinyXML for basic XML functionality (works for me), though I did apply a couple of changes for UTF-8/Unicode compatibility.

- In almost all cases, having to repeat code 10-20 times with almost no modifications is a sure sign of bad programming. Integrated IDE's like Borland's Builder usually allow you to make this mistake easily.


14th August 2003 17:33 UTC

Originally posted by Magic.X
Note that this is not optimized yet and shall be a lot faster later on.
I just tried to get it working quickly.

Actually i have a lot of calls to the same function refreshing the entire editor settings.

later on, this shall be optimized so only the changed object will be affected.

I tried to retrieve a wm_settext message of the components editor, to find out wheter a SSC or DM is activated and react. Everything failed yet. I'll keep working on this.

Of course i can add registry support but i wanted to make settings general save and loadable, therefore i need files.

15th August 2003 14:09 UTC

Is this done in Borland C++ builder? You have microsoft visuall c++


15th August 2003 19:35 UTC

Actually Magic.X, if you look at the message snooping part of my code, you should be able to retrieve any message you wish. It was only the insertion of the new control which caused massive failiure, but simply watching existing messages shouldn't be a problem.


18th August 2003 07:24 UTC

@ Shreyas, yes it is. I didnt like to use VC.

@ Unconed: i actually did but i have'nt got any useable results yet.

Reading the Help led to:

PeekMessage does not retrieve messages for windows that belong to other threads.
Neither does getmessage.

I'll see wheter i can get any solution to avoid the use of another ape.

18th August 2003 14:32 UTC

Sorry, too late to edit.

Anyway, continous namechecking and renaming works well.

So i will rename changed effect layouts to name+char(255) to recognize optimized and not otpimized settings.


22nd September 2003 12:38 UTC

Project abandoned
As we have a new avs version by now, most of program serves no purpose anymore.

Furthermore i'd need to redo most of the stuff to keep the positioning working as lots of things changed in the editor.

If anyone wants to do this, go ahead please. I don't feel like continouing/redoing this.

Considering UnConeD's code highlighting, i'd love to see it in the final version of avs2.7 but thats up to justin now.

Thanx for your ideas anyway.