Difference between revisions of "Datagrid Plugin"
Line 12: | Line 12: | ||
4. Add to that plugin a method with this signature: | 4. Add to that plugin a method with this signature: | ||
+ | |||
''class DataGridTable *My_Datagrid_Generator(string GridID, string Parms, void *ExtraData, int *iPK_Variable, string *sValue_To_Assign, class Message *pMessage);'' | ''class DataGridTable *My_Datagrid_Generator(string GridID, string Parms, void *ExtraData, int *iPK_Variable, string *sValue_To_Assign, class Message *pMessage);'' | ||
+ | |||
In that method, you have to create a DatagridTable object, create cells (DataGridCell objects) and assign them to the datagrid: | In that method, you have to create a DatagridTable object, create cells (DataGridCell objects) and assign them to the datagrid: | ||
Revision as of 10:44, 23 June 2006
This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto. |
How to create a datagrid generator
1. Add a new record in Datagrid table from pluto_main database.
2. Then you'll have to use our sql2cpp tool to regenerates pluto_main database wrapper project. To confirm that it worked, go to pluto_main/Define_Database.h and scroll down, searching for the record you've just added. A new constant should be define there for your datagrid. Then commit that header file. Note: It is recommended to add that record on our main server rather that on your local server. If you choose the second solution, you'll need to use sqlCVS in order to synchronize your database with our database.
3. Once this step is done, you can go ahead and choose the plugin which handles better the type of datagrid you want to create. Let's say you want to display a list with files from the harddrive; in this case you'll might want to choose File_Grids_Plugin. If it's related with some infrared stuff, Infrared_Plugin you'll be you choise. If the datagrid you want to create doesn't seem to match any plugin scope, General_Info_Plugin is the best choice.
4. Add to that plugin a method with this signature:
class DataGridTable *My_Datagrid_Generator(string GridID, string Parms, void *ExtraData, int *iPK_Variable, string *sValue_To_Assign, class Message *pMessage);
In that method, you have to create a DatagridTable object, create cells (DataGridCell objects) and assign them to the datagrid:
DataGridTable *pDataGrid = new DataGridTable(); ... DataGridCell *pCell = new DataGridCell(sTextToDisplay, sCellValue); pDataGrid->SetData(nColumn, nRow, pCell); ...
//in the end, just return the datagrid //Datagrid_Plugin will deallocate the memory for datagrid once this was serialized and sent to Orbiter return pDataGrid