The Tool_DB_Class class enable you to draw a tool that will display a tree of the current classes in the database. The tool will also enable you to select classes from that tree.
The variables of the Tool_DB_Class class are:
|
int list_nb ; |
// Number of lines in the class list |
|
DB_List *list_pt ; |
// pointer to each of the list's classes |
The methods of the Tool_DB_Class class are:
|
Tool_DB_Class() ;
|
Constructor |
|
~Tool_DB_Clasee() ;
|
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 UPDATE_CUR_WINDOW UPDATE_DB |
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_Class class is given in the Samples\SliceO Tools\DB Class demo directory.
The tool_db_class_ctrl.cpp file from the DB Class demo
|