|
Sint32 | CRM64Pro::GUIMgr::info (Sint32 idGUI=0) |
|
Sint32 | CRM64Pro::GUIMgr::create (const string &sName, Uint32 iType=GUI_PANEL) |
|
Sint32 | CRM64Pro::GUIMgr::close (Sint32 idGUI) |
|
Sint32 | CRM64Pro::GUIMgr::getNum () |
|
Sint32 | CRM64Pro::GUIMgr::setName (Sint32 idGUI, const string &sName) |
|
PanelObj * | CRM64Pro::GUIMgr::getPanel (Sint32 idGUI=0) |
|
Sint32 | CRM64Pro::GUIMgr::getPanelFocus () |
|
Sint32 | CRM64Pro::GUIMgr::setPanelFocus (Sint32 idGUI) |
|
ConsoleObj * | CRM64Pro::GUIMgr::getConsole (Sint32 idGUI=GUI_CONSOLE) |
|
DebugWindowObj * | CRM64Pro::GUIMgr::getDebugWindow (Sint32 idGUI=0) |
|
Sint32 | CRM64Pro::GUIMgr::load (const string &sFileCDC, const string &sName) |
|
Sint32 | CRM64Pro::GUIMgr::load (Sint32 idCDC, const string &sName) |
|
Sint32 | CRM64Pro::GUIMgr::getFontWhiteAA () |
|
Sint32 | CRM64Pro::GUIMgr::getFontBlack () |
|
Sint32 | CRM64Pro::GUIMgr::getIconInfo () |
|
Sint32 | CRM64Pro::GUIMgr::getIconWarning () |
|
Sint32 | CRM64Pro::GUIMgr::getIconError () |
|
Sint32 | CRM64Pro::ConsoleObj::info (Sint32 iMode=0) |
|
Sint32 | CRM64Pro::ConsoleObj::getName (string &sName) |
|
Uint32 | CRM64Pro::ConsoleObj::getID () |
|
Sint32 | CRM64Pro::ConsoleObj::attachTo (Sint32 idScreen) |
|
Sint32 | CRM64Pro::ConsoleObj::print (const char *format,...) |
|
Sint32 | CRM64Pro::ConsoleObj::vPrint (const char *format, va_list args) |
|
Sint32 | CRM64Pro::ConsoleObj::addCmdHandler (const string &sCommandName, const string &sCommandHelp, Sint32(*cmdFunc)(vector< string > *, ConsoleObj *pCon)) |
|
Sint32 | CRM64Pro::ConsoleObj::executeCmd (const string &) |
|
Sint32 | CRM64Pro::DebugWindowObj::info (Sint32 iMode=0) |
|
Sint32 | CRM64Pro::DebugWindowObj::getName (string &sName) |
|
Uint32 | CRM64Pro::DebugWindowObj::getID () |
|
Sint32 | CRM64Pro::DebugWindowObj::addWatch (const string &sName, Sint32 *iIntegerVar, double *dDoubleVar=nullptr) |
|
Sint32 | CRM64Pro::DebugWindowObj::removeWatch (const string &sName) |
|
Sint32 | CRM64Pro::DebugWindowObj::attachTo (Sint32 idScreen) |
|
Sint32 | CRM64Pro::DebugWindowObj::setRefreshInterval (Sint32) |
|
Sint32 | CRM64Pro::DebugWindowObj::getRefreshInterval () |
|
Sint32 | CRM64Pro::PanelObj::info (Sint32 iMode=0) |
|
Sint32 | CRM64Pro::PanelObj::getName (string &sName) |
|
Uint32 | CRM64Pro::PanelObj::getID () |
|
Sint32 | CRM64Pro::PanelObj::attachTo (Sint32 idScreen) |
|
Sint32 | CRM64Pro::PanelObj::createWidget (const string &sName, eWidgetType eWT, Sint32 iWID) |
|
Widget * | CRM64Pro::PanelObj::getWidget (Sint32 iWID) |
|
Sint32 | CRM64Pro::PanelObj::closeWidget (Sint32 iWID) |
|
Sint32 | CRM64Pro::PanelObj::type (ePanelType ePT=PT_RETRIEVE, Sint32 iTime=0) |
|
Sint32 | CRM64Pro::PanelObj::save (const string &sFileCDC) |
|
Sint32 | CRM64Pro::PanelObj::save (Sint32 idCDC) |
|
Console and DebugWindow are automatically rendered on top of everything and Panel objects are by default also rendered automatically but if you want to have a better control of the rendering order, you can override this setting with autoRender() and manually render your Panel objects on the desired order. The Log Manager handles the creation/destruction of Log Objects and always owns a default log named "default" although it is not initialized.
All CRM64Pro GDK modules use this default log for messages and information output.
// TODO The client application can use the default log or create any number of additional log objects using the Log Manager.
A good practice is to initialize the default log using LogObj::init() right after Main::Instance() in order to capture all the GDK initialization messages.
The default log can not be released, and once initialized you can stop the log output using LogObj::pause() method.
There is an useful mode where all the return error codes are logged automatically using the default log if you link against a GDK debug version and set eLogLevel to LL_HIGH.
This is a standard manager: objects are not shared and must be unique using its name as the key, in other words, you can not create an object with the same name of another one already created.
Only a single instance of the Log Manager exists which is created once Main is instantiated.
You can get a reference to this manager using Main::ILogMgr() method.
- Note
- The Log Manager and default log are automatically released when Main::Terminate() is called.
At this time, any resource still loaded, will be released avoding a resource leak.
explicar los eventos de retorno con sus valores explicar estado de cada boton que grafico contiene usar en el hilo principal consolas son como un textbox, capturan el foco de input text pero dejan el resto funcionar panel is shared, debugw y consola no
#define GUI_PANEL 0x42000000 |
#define GUI_CONSOLE 0x44000000 |
#define GUI_DEBUGWINDOW 0x48000000 |
Panel Type.
Enumerator |
---|
PT_RETRIEVE |
Used for getting current panel type.
|
PT_MODELESS |
Modeless panel. When it gets the focus, it does not block the input for others panels.
|
PT_MODAL |
Modal panel. When it gets the focus, it blocks the input for others panels on the same screen.
|
PT_EPHEMERAL |
Ephemeral and modeless panel. It lasts the given time duration.
|
Sint32 CRM64Pro::GUIMgr::info |
( |
Sint32 |
iMode = 0 | ) |
|
Request GUI Manager information.
For displaying the information, it uses the default log.
- Parameters
-
iMode | -1 for displaying only Manager information.
0 for displaying Manager and all Objects information. This is the default value.
idGUI for displaying Manager and given Object id information. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::create |
( |
const string & |
sName, |
|
|
Uint32 |
iType = GUI_PANEL |
|
) |
| |
Creates a new GUI object.
- Parameters
-
sName | The name for the GUI object (e.g. 'myPanel' or 'myDebugWindow').
The object name must be unique and with a maximum size of 64 characters or will be truncated. |
iType | GUI Object type (GUI_PANEL, GUI_CONSOLE or GUI_DEBUGWINDOW) OR'ed with the version: 10 means 1.0 which is the only version supported (as of now).
GUI_PANEL is the default value and if no version is set, it uses v1.0. |
- Returns
- greater than 0 on success(the GUI id) or a negative error code on failure.
- Note
- By default, all GUI Objects are attached to the default screen but it can be changed anytime using PanelObj::attachTo(), ConsoleObj::attachTo() and DebugWindowObj::attachTo() methods.
Created objects have the baseWidget status set to enabled but hidden (C64_STATUS_HIDDEN).
Sint32 CRM64Pro::GUIMgr::close |
( |
Sint32 |
idGUI | ) |
|
Close and destroy a GUI object.
- Parameters
-
idGUI | 0 for closing all GUI objects or the GUI id.
The default console is automatically created and can not be removed with this method.
As the GUI Manager has the ability of sharing a PanelObj id, if the panel is shared, it will not be removed till the last owner call this method. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- If you forget to close an object, it will be automatically closed once the GDK is terminated.
Sint32 CRM64Pro::GUIMgr::getNum |
( |
| ) |
|
Get number of loaded objects.
- Returns
- the number of log objects.
Sint32 CRM64Pro::GUIMgr::setName |
( |
Sint32 |
idGUI, |
|
|
const string & |
sName |
|
) |
| |
Change the object name.
- Parameters
-
idGUI | GUI id.
It can be a Panel, Console or DebugWindow |
sName | The name to give to the Panel object (e.g. 'myPanel').
The object name must be unique and with a maximum size of 64 characters or will be truncated. |
- Returns
- 0 on success or a negative error code on failure.
PanelObj * CRM64Pro::GUIMgr::getPanel |
( |
Sint32 |
idGUI = 0 | ) |
|
Get a pointer to a Panel using its handler.
- Parameters
-
- Returns
- nullptr the Panel was not found.
-
A pointer to the Panel object.
Sint32 CRM64Pro::GUIMgr::getPanelFocus |
( |
| ) |
|
Get the GUI Panel id with the focus.
- Returns
- greater than 0 on success(the GUI Panel id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::setPanelFocus |
( |
Sint32 |
idGUI | ) |
|
Set the focus on the given GUI Panel id.
- Parameters
-
idGUI | the GUI Panel id. In order to get the focus, the panel must be shown. |
- Returns
- 0 on success or a negative error code on failure.
ConsoleObj * CRM64Pro::GUIMgr::getConsole |
( |
Sint32 |
idGUI = GUI_CONSOLE | ) |
|
Get a pointer to a Console using its handler.
By default it returns the default console.
- Parameters
-
- Returns
- nullptr the Console was not found.
-
A pointer to the Console object.
DebugWindowObj * CRM64Pro::GUIMgr::getDebugWindow |
( |
Sint32 |
idGUI = 0 | ) |
|
Get a pointer to a DebugWindow using its handler.
- Parameters
-
idGUI | GUI id. With GUI_CONSOLE (default value), it returns the default console. |
- Returns
- nullptr the DebugWindow was not found.
-
A pointer to the DebugWindow object.
Sint32 CRM64Pro::GUIMgr::load |
( |
const string & |
sFileCDC, |
|
|
const string & |
sName |
|
) |
| |
Load a panel and its widgets stored in a CDC file.
The GUI Manager has the ability of sharing PanelObj ids based on the name as the key, so before trying to load a new one, it checks if it is already loaded for sharing it.
- Parameters
-
sFileCDC | string containing the [directory]+filename.
Directory separators '\' and '/' are supported. |
sName | string with the panel name (maximum size of 64 characters). |
- Returns
- 0 or greater on success(the PanelObj id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::load |
( |
Sint32 |
idCDC, |
|
|
const string & |
sName |
|
) |
| |
Load a panel and its widgets stored in a CDC file.
The GUI Manager has the ability of sharing PanelObj ids based on the name as the key, so before trying to load a new one, it checks if it is already loaded for sharing it.
- Parameters
-
idCDC | CDC id. |
sName | string with the panel name (maximum size of 64 characters). |
- Returns
- 0 or greater on success(the PanelObj id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::getFontWhiteAA |
( |
| ) |
|
Get the built-in white font.
Internally, it is used by default for all GUI systems.
It is created from a CourierNew 10 with antialiasing.
- Returns
- greater than 0 on success(the Font id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::getFontBlack |
( |
| ) |
|
Get the built-in black font.
It is created from an Arial 12 without antialising.
- Returns
- greater than 0 on success(the Font id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::getIconInfo |
( |
| ) |
|
Get the built-in info icon.
- Returns
- greater than 0 on success(the image id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::getIconWarning |
( |
| ) |
|
Get the built-in warning icon.
- Returns
- greater than 0 on success(the image id) or a negative error code on failure.
Sint32 CRM64Pro::GUIMgr::getIconError |
( |
| ) |
|
Get the built-in error icon.
- Returns
- greater than 0 on success(the image id) or a negative error code on failure.
Sint32 CRM64Pro::ConsoleObj::info |
( |
Sint32 |
iMode = 0 | ) |
|
Request Console information.
For displaying the information, it uses the default log.
- Parameters
-
iMode | unused for the time being. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConsoleObj::getName |
( |
string & |
sName | ) |
|
Get the name.
- Parameters
-
sName | a string containing the object name. |
- Returns
- 0 on success or a negative error code on failure.
Uint32 CRM64Pro::ConsoleObj::getID |
( |
| ) |
|
Get the ID.
- Returns
- the object ID.
Sint32 CRM64Pro::ConsoleObj::attachTo |
( |
Sint32 |
idScreen | ) |
|
Attach this console to a screen.
- Parameters
-
idScreen | a valid screen handle.
By default, the console is attached to the default screen(0). |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConsoleObj::print |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Print a formatted message to the console.
- Parameters
-
format | format control, same as printf() function. |
... | optional arguments, same as printf() function. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- If the baseWidget is disabled (C64_STATUS_DISABLED), this method does nothing.
Sint32 CRM64Pro::ConsoleObj::vPrint |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
Print a formatted message to the console.
- Parameters
-
format | format control, same as printf() function. |
args | pointer to list of arguments, same as vprintf() function. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- If the baseWidget is disabled (C64_STATUS_DISABLED), this method does nothing.
Sint32 CRM64Pro::ConsoleObj::addCmdHandler |
( |
const string & |
sCommandName, |
|
|
const string & |
sCommandHelp, |
|
|
Sint32(*)(vector< string > *, ConsoleObj *pCon) |
cmdFunc |
|
) |
| |
Add a new command handler to the console.
- Parameters
-
sCommandName | string with the command name (must be unique).
There are some internal and reserved commands:
-
'con' - Console control.
-
'dw' - Debug Window control.
-
'help' - List all commands.
|
sCommandHelp | string with a brief command description. |
cmdFunc | pointer to the function handler.
The vector<string*> parameter contains the full tokenized command and ConsoleObj*, a pointer to the console that called it.
Must return 0 when succeed or a negative value on error. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConsoleObj::executeCmd |
( |
const string & |
sCmd | ) |
|
Execute a command on this console.
- Parameters
-
sCmd | string with the command plus arguments to be executed by this console. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- If the baseWidget is disabled (C64_STATUS_DISABLED), this method does nothing.
Sint32 CRM64Pro::DebugWindowObj::info |
( |
Sint32 |
iMode = 0 | ) |
|
Request DebugWindow information.
For displaying the information, it uses the default log.
- Parameters
-
iMode | unused for the time being. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::DebugWindowObj::getName |
( |
string & |
sName | ) |
|
Get the name.
- Parameters
-
sName | a string containing the object name. |
- Returns
- 0 on success or a negative error code on failure.
Uint32 CRM64Pro::DebugWindowObj::getID |
( |
| ) |
|
Get the ID.
- Returns
- the object ID.
Sint32 CRM64Pro::DebugWindowObj::addWatch |
( |
const string & |
sName, |
|
|
Sint32 * |
iIntegerVar, |
|
|
double * |
dDoubleVar = nullptr |
|
) |
| |
Add a watch.
- Parameters
-
sName | watch name. Must be unique. |
iIntegerVar | a pointer to an integer variable to be associated to this watch. nullptr for doing nothing. |
dDoubleVar | a pointer to a double variable to be associated to this watch. nullptr for doing nothing. |
- Returns
- 0 on sucess or a negative error code on failure.
- Note
- If the baseWidget is disabled (C64_STATUS_DISABLED), this method does nothing.
Sint32 CRM64Pro::DebugWindowObj::removeWatch |
( |
const string & |
sName | ) |
|
Remove a watch.
- Parameters
-
- Returns
- 0 on success or a negative error code on failure.
- Note
- If the baseWidget is disabled (C64_STATUS_DISABLED), this method does nothing.
Sint32 CRM64Pro::DebugWindowObj::attachTo |
( |
Sint32 |
idScreen | ) |
|
Attach this debugwindow to a screen.
- Parameters
-
idScreen | a valid screen handle.
By default, the debugwindow is attached to the default screen(0). |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::DebugWindowObj::setRefreshInterval |
( |
Sint32 |
iRefresh | ) |
|
Set the refresh interval.
- Parameters
-
iRefresh | time interval in milliseconds for refreshing the value of the watches. By default it is set to 500ms. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::DebugWindowObj::getRefreshInterval |
( |
| ) |
|
Get the refresh interval.
- Returns
- 0 or greater on success(the refresh interval) or a negative error code on failure.
Sint32 CRM64Pro::PanelObj::info |
( |
Sint32 |
iMode = 0 | ) |
|
Request Panel information.
For displaying the information, it uses the default log.
- Parameters
-
iMode | unused for the time being. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::PanelObj::getName |
( |
string & |
sName | ) |
|
Get the name.
- Parameters
-
sName | a string containing the object name. |
- Returns
- 0 on success or a negative error code on failure.
Uint32 CRM64Pro::PanelObj::getID |
( |
| ) |
|
Get the ID.
- Returns
- the object ID.
Sint32 CRM64Pro::PanelObj::attachTo |
( |
Sint32 |
idScreen | ) |
|
Attach this panel to a screen.
- Parameters
-
idScreen | a valid screen handle.
By default, the panel is attached to the default screen(0). |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::PanelObj::createWidget |
( |
const string & |
sName, |
|
|
eWidgetType |
eWT, |
|
|
Sint32 |
iWID |
|
) |
| |
Create a widget.
- Parameters
-
sName | The name for the widget.
The object name must be unique and with a maximum size of 64 characters or will be truncated. |
eWT | Widget type. Check eWidgetType for further information. |
iWID | unsigned integer with the unique Widget ID. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- Different widget versions could be present but at creation time, we always use the newer one available although older ones can still be loaded.
Created widgets have the status set to enabled but hidden (C64_STATUS_HIDDEN).
Widget * CRM64Pro::PanelObj::getWidget |
( |
Sint32 |
iWID | ) |
|
Get a pointer to a Widget using its handler.
- Parameters
-
- Returns
- nullptr the Widget was not found.
-
A pointer to the Widget object.
Sint32 CRM64Pro::PanelObj::closeWidget |
( |
Sint32 |
iWID | ) |
|
Close and destroy a Widget.
- Parameters
-
iWID | 0 for closing all Widgets or the Widget id. |
- Returns
- 0 on success or a negative error code on failure.
- Note
- If you forget to close a widget, it will be automatically closed once the panel is closed.
Set or get panel type.
- Parameters
-
ePT | Panel type. Check ePanelType for further information. |
iTime | Time to live (in milliseconds) for a panel type PT_EPHIMERAL.
The minimum value is 1000ms. |
- Returns
- 0 on success or a negative error code on failure.
Sint32 CRM64Pro::PanelObj::save |
( |
const string & |
sFileCDC | ) |
|
Save the panel and all its widgets to a CDC file.
Widgets images/sprites will also be saved in to the same CDC file.
- Parameters
-
sFileCDC | string containing the [directory]+filename+[extension].
Directory separators '\' and '/' are supported. |
- Returns
- 0 or greater on success or a negative error code on failure.
- Note
- If the panel, widget or any associated image/sprite already exist, they will be overwritten.
Sint32 CRM64Pro::PanelObj::save |
( |
Sint32 |
idCDC | ) |
|
Save the panel and all its widgets to a CDC file.
Widgets images/sprites will also be saved in to the same CDC file.
- Parameters
-
- Returns
- 0 or greater on success or a negative error code on failure.
- Note
- If the panel, widget or any associated image/sprite already exist, they will be overwritten.