The framework includes simple methods to transform a C++ program with command line arguments into a basic application. The features that can be easily added are:
- CLI to GUI : Input arguments through a GUI
- Loop progress to GUI : Show and control progression of loops.
- Status infos to GUI : Show status messages
- Use program recurrently to simulate an interactive mode
Go to full example for an exhaustive example.
The framework includes a simple method to transform the command line arguments of a main
into a basic GUI. The framework allows a flexible CLI approach, and can manage saving and loading of the arguments as presented just above.
Example : CLI to GUI
Without relying on Qt, a simple parsing of a 'main' parametrization can be done.
Example : CLI parametrization
An example detailing how to use all the features managed by a Glove application can be found here.
The GLOVE_APP
macro transforms a program into a GUI application. To be used at the very beginning of the main.
Depending on your needs, several declinaison of the macro exist:
GLOVE_APP
: Enables Glove application by setting "-glove" as CLI argumentGLOVE_APP_PARAM(Tparametrization)
: same asGLOVE_APP
, adds CLI arguments by-pass through a parametrization widget defined by Tparametrization.
To create an application than can be launched using no cli arguments (double clicking on the app for instance), add the macro #define GLOVE_APP_AUTO true
before calling GLOVE_APP
.
Default is false
.
To run the program recurrently, add the macro #define GLOVE_APP_RECURRENT_MODE true
before calling GLOVE_APP
.
Applies only if GLOVE_APP_THREAD_MODE
is set to true.
Default is false
.
If GLOVE_APP_RECURRENT_MODE
is set to true
, the macro defines the type of the variable to be kept across all recurrent runs.
One can for example define a structure in charge of keeping data from a run to another. Set #define GLOVE_APP_RECURRENT_TYPE Type
before calling GLOVE_APP
.
Default is int
.
To run the initial program in the same initial thread, add the macro #define GLOVE_APP_THREAD_MODE false
before calling GLOVE_APP
.
However, it will disable progress and status features. Input parametrization using a dedicated widget will still be active though.
Default is true
.
Use #pragma GLOVE_APP_MSVC_NO_CONSOLE
before int main
to disable terminal when using MSVC.
Use a parameter of the CLI parametrization as a location where to save the configuration file in addition to execution location.
Example: GLOVE_APP_CLI_PARAMETRIZATION_OUTPUT_DIRECTORY(ParametersCLI, "-O")
. With ParametersCLI
being the CLI parametrization.
If the parameter does not exist in the CLI parametrization, returns an empty string.