GUI Editor
GUI Editor must be simple enough to be used by analyst and designer.
All GUI elements are stored in the layouts. On the low level layout is an XML string (or any other format).
The layout can contain images and video.
You can set shape, colors and animation for the element for the next events:
- mouse is on the element;
- click on the element;
- move element;
- element is selected.
You can create scenarios using layouts: you can imitate behavior of your program. You can convert scenarios to the source code.
Adaptive design: you can create various views of your window or element for several sizes of them (in pixels or mm).
Localization
You can set the text objects as translatable (watch the video).
Then you can create translations for them using G5 Studio.
And then you can use the method main.setLocale with the name of the language.
Language syntax
Main
You have to import the library "main" in your project and to create one (and only one) class that inherits the class "Main".
This class will be created automatically when the application is started.
In the constructor you can create threads and windows, or you can use the constructor as a classical function main:
The class "Main" contains the next methods and fields:
- exit( ): stop the program and all threads;
- exitEvent: you can connect your function or method to this pointer;
- environment: structure with OS name, path and etc;
- setLocale: you can set the language at any time, all the text fields will be changed automatically and immediately.
Restrictions
You can set restrictions for variables, structures, functions and methods:
You can restrict:
- input and output values;
- run time of the function or method.
If restriction is
violated exception will be generated.
Physical variables
You can declare the physical variables or use it from libraries:
The compiler checks all types and can convert km to mm.
Class
The key word "public" is used by default:
You can set a value of fields in the class declaration.
You can create objects too.
The default copy constructor is forbidden.
Destructor is always virtual.
Fields can be public, but "Read only".
Operators
You can create new key words and composite operators. You can use any symbols for them.
Exception
You can throw any class and catch it using "trap" (watch the video).
The special class Error contains:
- error code;
- error text;
- error path: the list of the functions in stack with parameters.
Functions and methods have hidden parameters: address of the traps. When you throw an exception correct trap will be found immediately.
Multithreading
You can define any method as "async" and it's safe.
You can use the object in several threads and it's safe.
If the variable is using in several threads, it's automatically became "Volatile".
You can use the template class "Tread" that contains:
- run: a pointer to the function for executing;
- exitEvent: you can connect your function or method to this pointer;
- terminate( )
Pointers to the function
You can connect to the pointer:
- a function;
- a method of the object. It will be executed for this object;
- an operator.
Global resource
An object can be defined as "global" for the project:
- application configuration;
- logger;
- console or window;
- any other.
Objects and pointers
All object are stored in the object pools that are generating automatically.
Object contains hidden fields:
- object type: integer number, 8 bytes, it's creating during the compilation randomly;
- object version: integer, 8 bytes. It's incriminating when object is destroying;
- number of pointers to itself. Object will be returned to the object pool, if it's zero.
The pointer to the object is not an address. It's a structure that contains:
If object is destroyed you can not call it using the pointer, because versions became different.
Libraries
You can import libraries using this syntax (Python style):
Name spaces in the library are not necessary.
You can find and download a library from the LibStore (watch the video).
All public libraries will be downloaded automatically during the compilation.
Version control system
All files of the source code contain an ID (GUID). All lines in the file contain an ID (GUID). It helps VCS to control changes.
You can commit an empty directory.