Form editor and not only
I need to make a form editor.
The main idea: The user describes the dialog in a text file - positions of the controls etc. (this is not a .rc file, it will be my own text format) and also maybe describes the actions that may be taken at specific events (maybe only standartized and only the more simple ones, like a mouse click at a specified button, so no need to specify a whole window function). He describes them in some format that my program may interpret using something like
void CMyProgram::Interpret(CAction action);
and void CAction::Deserialize(string s); :)
So.
What my program has to do is to interpret that dialog description in runtime and create it and make it interactive, of course - and accept events from that dialog.
Has anyone ever implemented something like this?
I think for simply reading and creating the dialog I need something like class CCustomDialog that will be a container for controls and will be able to deserialize itself from a file, together with the actions description and one window function for all created custom dialogs (I mean, every created dialog will have the same pointer to window function) that will ask the other part of my program interpret the actions (let's assume I have it already done, or at least know how to do it).
What I really have to know is if you have some tips on constructing dialogs in runtime etc. - I read MSDN about CreateDialogIndirect and it seemed very complicated to me - it is possible to read through it and even understand but I am always not sure that I have not missed something very important, so any tips would be appreciated. As I have understood, I also need to have all my resources in my executable already when calling CreateDialogIndirect, can I modify the resources in runtime or add new ones?
I am pretty sure someone will ask what for do I need it :)
I am writing a course project with 2 friends - a visual programming language. Actually it looks like a graph of connected blocks; there are 'system' blocks like EnterPin, ExitPin, Branch (splits the execution into several threads), Collect (all input threads go to the output pin of the block and execute blocks lying on that path), Sync (waits for all input threads to finish and only then continues execution on the output pin), If (I guess you know what 'If' does) etc. Several simple blocks like SimpleInput, MessageBox... Besides, the user can of course write his own block libraries (DLLs) and all that should work. Of course, you can use a created module as a block in an other module. You can also manually describe module structure in XML.
Every block and module has a set of properties and local variables that it can evaluate - properties in the block owner's context, local variables in the block's own context including properties.... etc.
Actually, all that works already.
The problem is that at the moment our visual programming language doesn't have any visual interface and it seems rather strange that a program that gives out a message box with 'Hello world' or - at its best - two concurrent streams writing 'Hello world' and then synchronizing and saying 'Done' - weights about 400kb in sources :)
Since we've almost completed the basics of program 'core', we are now writing the GUI for it. While the friends are writing GUI, I am writing 'standard' module libraries, one of them being 'custom dialogs'.
BTW one more question: Does anyone know where I can download a control like C++ Builder's form property editor, I think you remember it, something like this:
----------------------
| |Block1 \/ | |
----------------------
|prop1 | type1 |val1 |
|prop2 | type2 |val2 |
.....
, desirably with abilities to add new properties and of course I would like to have the ability to edit property values not only as plain text but also as sets (CheckListBox), enums (ComboBox) and something more custom like color.
I am pretty sure someone has already written such a component and it is impatiently waiting to be used in our project :) Not that I am so lazy to look through MSDN for a week and write it myself but we have not so much time for that.
The main idea: The user describes the dialog in a text file - positions of the controls etc. (this is not a .rc file, it will be my own text format) and also maybe describes the actions that may be taken at specific events (maybe only standartized and only the more simple ones, like a mouse click at a specified button, so no need to specify a whole window function). He describes them in some format that my program may interpret using something like
void CMyProgram::Interpret(CAction action);
and void CAction::Deserialize(string s); :)
So.
What my program has to do is to interpret that dialog description in runtime and create it and make it interactive, of course - and accept events from that dialog.
Has anyone ever implemented something like this?
I think for simply reading and creating the dialog I need something like class CCustomDialog that will be a container for controls and will be able to deserialize itself from a file, together with the actions description and one window function for all created custom dialogs (I mean, every created dialog will have the same pointer to window function) that will ask the other part of my program interpret the actions (let's assume I have it already done, or at least know how to do it).
What I really have to know is if you have some tips on constructing dialogs in runtime etc. - I read MSDN about CreateDialogIndirect and it seemed very complicated to me - it is possible to read through it and even understand but I am always not sure that I have not missed something very important, so any tips would be appreciated. As I have understood, I also need to have all my resources in my executable already when calling CreateDialogIndirect, can I modify the resources in runtime or add new ones?
I am pretty sure someone will ask what for do I need it :)
I am writing a course project with 2 friends - a visual programming language. Actually it looks like a graph of connected blocks; there are 'system' blocks like EnterPin, ExitPin, Branch (splits the execution into several threads), Collect (all input threads go to the output pin of the block and execute blocks lying on that path), Sync (waits for all input threads to finish and only then continues execution on the output pin), If (I guess you know what 'If' does) etc. Several simple blocks like SimpleInput, MessageBox... Besides, the user can of course write his own block libraries (DLLs) and all that should work. Of course, you can use a created module as a block in an other module. You can also manually describe module structure in XML.
Every block and module has a set of properties and local variables that it can evaluate - properties in the block owner's context, local variables in the block's own context including properties.... etc.
Actually, all that works already.
The problem is that at the moment our visual programming language doesn't have any visual interface and it seems rather strange that a program that gives out a message box with 'Hello world' or - at its best - two concurrent streams writing 'Hello world' and then synchronizing and saying 'Done' - weights about 400kb in sources :)
Since we've almost completed the basics of program 'core', we are now writing the GUI for it. While the friends are writing GUI, I am writing 'standard' module libraries, one of them being 'custom dialogs'.
BTW one more question: Does anyone know where I can download a control like C++ Builder's form property editor, I think you remember it, something like this:
----------------------
| |Block1 \/ | |
----------------------
|prop1 | type1 |val1 |
|prop2 | type2 |val2 |
.....
, desirably with abilities to add new properties and of course I would like to have the ability to edit property values not only as plain text but also as sets (CheckListBox), enums (ComboBox) and something more custom like color.
I am pretty sure someone has already written such a component and it is impatiently waiting to be used in our project :) Not that I am so lazy to look through MSDN for a week and write it myself but we have not so much time for that.
