CommandGui 0.1 review
DownloadCommandGui is a package of classes that intercept and show asynchronous process output errors from graphical applications. Usage
|
|
CommandGui is a package of classes that intercept and show asynchronous process output errors from graphical applications.
Usage
The main class is "CCommandGui" class; it includes the public methods to set the GUI's graphical properties (see CCommandGui.h) and the public method to open the window, execute the command and view corresponding output (ExecViewComm(...)).
The auxiliary class "CCommandGuiTimer" is not directly available but it is used by the CCommandGui class.
The utility class "CProcessManager" includes generic methods as methods to start processes and put the corresponding output in a string and methods to now the children processes hierarchy and relative status.
The sense of the classes is allowing to execute some command or program inside the application and follow the execution with output or errors in graphical interface without opening a shell. The GUI can terminate all of the started processes ("Cancel button") and show our termination status.
Exemple
Example of use:
#include "wx/wx.h"
#include "CCommandGui.h"
...
//Create and set output window
CCommandGui* gui;
gui=new CCommandGui(NULL,-1,"MyProcess");
gui->SetInitList("Started MyProcess...");
gui->SetEndList("MyProcess Terminated...");
gui->SetTimeOut(500);
gui->SetLineWidth(500);
gui->SetListHeigth(500);
//Prepare command parameters
wxArrayString parameters;
parameters.Add("P1");
parameters.Add("P2");
parameters.Add("P3");
...
//Asyncronous command exec and open output window modal
int ret=gui->ExecViewComm("MyProcess",parameters);
//Analyse error
if(retDestroy();
...
All of the classes are based on libraries wxWidgets for graphical objects and some efficient class (wxString, wxArrayString, wxInputStream, wxOutputStream...).
The classes can be used only after the installation of the package wx_gtk-2.4 or different version.
CommandGui 0.1 search tags