The Tool_DB_File class enable you display a graphical view of the files currently loaded in sliceOmatic. By clciking on one of these files, you can select the matching frames in the database. Inversely, selecting frames in the database will change the value of the check marks beside the file's names.
The files are displayed as a 3 level structure:
·The first level is the directory where the file reside.
·The second level is the name of the file
·The third level is the frames (images) contained in the file.
The variables of the Tool_DB_File class are:
|
int list_nb ; |
// |
|
DB_List *list_pt ; |
// |
The methods of the Tool_DB_File class are:
|
Tool_DB_File() ;
|
Constructor |
|
~Tool_DB_File() ;
|
Destructor |
|
int Read( void ) ;
|
// There is no "Read" method for this class |
The methods shared with the other SliceO_Tool classes are:
|
int Click( int up_down ) ; |
You must call this method if the user has activated a mouse button while the cursor is inside the tool |
|
void Draw( void ) ;
|
This method will draw the tool |
|
int Height( unsigned short nb=10 ) ; |
This method returns the height (in pixel) of the tool. The "nb" parameter defines how many lines of information will be displayed. |
|
int Keyboard( int key ) ; |
You must call this method if the user has activated a keyboard key while the cursor is inside the tool |
|
void Leave( void ) ;
|
You must call this method if the user move the cursor outside of the tool |
|
int Motion( int up_down ) ;
|
You must call this method if the user move the cursor inside the tool |
|
int Resize( Boxs *box ) ; |
You must call this method to resize the tool. The tool will reside inside the bounding box of the "Boxs" class. |
|
int Scroll( int val ) ; |
You must call this method if the user has activated the mouse wheel while the cursor is inside the tool |
|
void Update( UInt64 flag ) |
You must call this method when external events change the content of the tool. The "flag" parameter is the "Update Flag" defining these changes. The update should be called if one of the following flags are changed: UPDATE_ALL_TOOLS UPDATE_SELECTION // the selected frames have changed UPDATE_DATA_GLI // the GLI data of a frame has changed UPDATE_THRESHOLD UPDATE_COLOR_TAG // the color associated with the TAGs has changed UPDATE_CUR_TAG // the current TAG has changed UPDATE_CURSOR // the cursor has moved (needed for the white line) UPDATE_COLOR_WORK |
The DB_List structure is composed of:
|
typedef struct DB_List {
|
|
|
unsigned short state ; unsigned short select ; unsigned short line ; unsigned short type ; unsigned short level ; unsigned short child_nb ; unsigned short child_id ; unsigned short child_tot ;
|
// expand, collapse // off, partial, on // line displayed // root, frame... // nesting level // nb of immediate children (next level) // id of this "child" (/vs/ previous level) // total number of childs (all levels) |
|
void *back_pt ;
|
// pointer to the original structure |
|
unsigned int color ; char *title ; char *name ; char *icon ;
|
// default color for this title
|
|
unsigned short text_nb ; int *text_offset ; unsigned int *text_color ; char **text_title ; char **text_data ;
|
// user associated data // horizontal pos of this text // default color for this title
|
|
} DB_List ; |
|
The values of the "select" variable are:
|
TOOL_LIST_SELECT_OFF TOOL_LIST_SELECT_ON TOOL_LIST_SELECT_PARTIAL TOOL_LIST_SELECT_DELETE
|
// Neither this element nor any of its children are selected // This element and all its children are selected // Only some of the children are selected // This element is selected for deletion |
The values of the "state" variable are:
|
TOOL_LIST_STATE_COLLAPSED TOOL_LIST_STATE_EXPAND TOOL_LIST_STATE_LEAF TOOL_LIST_STATE_LAST TOOL_LIST_STATE_NO_ACCESS |
// The children of this branch are not displayed // The children of this branch are displayed // This element has no children // This is the last element at this level of the list // This element can not be selected |
An example of the usage of the Tool_DB_File class is given in the Samples\SliceO Tools\DB_File demo directory.
The tool_db_file_ctrl.cpp file from the Tool_DB_File demo
|