/******************************************************************************* * Copyright 1991-1996 by ORCA Software, Inc. * * * * All rights reserved. May not be reproduced or distributed, in printed or * * electronic form, without permission of ORCA Software, Inc. May not be * * distributed as object code, separately or linked with other object modules, * * without permission. * *******************************************************************************/ #include "xi.h" static struct s_error_entry { int errcode; char *text; } error_table[] = { { 1000, "Error: Problem 1000" }, { 1001, "Warning: Problem 1001" }, { 1002, "Error: XI_TEXT internal error" }, { 20001, "XI: internal object deletion error" }, { 20002, "Internal XI error" }, { 20003, "Internal error" }, { 20004, "Internal XI error" }, { 20005, "Internal error" }, { 20006, "Attempting to move to disabled or invisible object" }, { 20007, "Attempting to move to disabled or invisible object" }, { 20008, "XI: unknown STX callback" }, { 20009, "XI: unknown LM callback" }, { 20010, "Non-column object sent to xi_column_set_pixel_width" }, { 20011, "Can't create empty container" }, { 20012, "Containers can only contain buttons" }, { 20013, "Can't mix button types in a container" }, { 20014, "Not enough room in container for buttons" }, { 20015, "Internal XI error" }, { 20016, "xi_create: Invalid XI_OBJ_TYPE" }, { 20017, "Invalid XI object passed to xi_delete" }, { 20018, "Invalid object passed to xi_get_attrib" }, { 20019, "xi_get_def_rect: Invalid XI_OBJ_TYPE in tree" }, { 20020, "Non-list object passed to xi_get_list_info" }, { 20021, "xi_get_rect: Invalid XI_OBJ_TYPE in tree" }, { 20022, "Invalid object passed to xi_get_sel" }, { 20023, "xi_get_text not implemented for XIT_ROW" }, { 20024, "Invalidate object passed to xi_scroll_rec" }, { 20025, "Invalidate object passed to xi_delete_row" }, { 20026, "Invalidate object passed to xi_insert_row" }, { 20027, "Invalid object passed to xi_set_attrib" }, { 20028, "Invalid object passed to xi_set_sel" }, { 20029, "xi_set_text not implemented for XIT_ROW" }, { 20030, "Internal focus error" }, { 20031, "Non-list object sent to xi_set_fixed_columns" }, { 20032, "button height exceeds container height" }, { 20033, "button width exceeds container width" }, { 20034, "height must be at least 8 form units" }, { 20035, "Buttons won't fit in container" }, { 20036, "xi_container_reorient() passed wrong object type" }, { 20037, "Invalidate object passed to xi_scroll_internal" }, { 20038, "Non-list object sent to xi_get_fixed_columns" }, { 20039, "Non-interface object sent to xi_itf_closing_is" }, { 20050, "xi_create: Rectangles cannot have children" }, { 20051, "xi_create: Lines cannot have children" }, { 20052, "xi_create: Buttons cannot have children" }, { 20053, "xi_create: Fields cannot have children" }, { 20055, "xi_create: Static text controls cannot have children" }, { 20056, "xi_create: Columns cannot have children" }, { 20088, "xi_set_icon: Invalid object" }, { 20089, "Too many radio buttons in a container" }, { 20090, "create_window returned NULL" }, { 20091, "Window information corrupt" }, { 20092, "Window information corrupt" }, { 20094, "Window information corrupt" }, { 20095, "XinAppSystemSetupInit was not provided." }, { 20101, "Invalid interface passed to xi_add_form_def" }, { 20102, "Invalid interface passed to xi_add_list_def" }, { 20103, "Invalid list passed to xi_add_column_def" }, { 20104, "Invalid form passed to xi_add_field_def" }, { 20105, "Invalid interface passed to xi_add_container_def" }, { 20106, "Invalid parent passed to xi_add_button_def" }, { 20107, "Invalid interface passed to xi_add_text_def" }, { 20108, "Invalid interface passed to xi_add_line_def" }, { 20109, "Groups must have at least one member" }, { 20110, "Invalid interface passed to xi_add_group_def" }, { 20111, "Invalid interface passed to xi_add_rect_def" }, { 20112, "Invalid field buffer size" }, { 20201, "Out of memory" }, { 20907, "lm_get_attrib: Invalid LM part" }, { 20908, "Attempting to get text from an invalid cell" }, { 20915, "Invalid column number passed to lm_delete_column" }, { 20917, "lm_set_buf_size: Invalid LM part" }, { 20918, "lm_cell_request: Invalid LM part" }, { 20919, "xi_insert_row called with get_all_records set to TRUE" }, { 20920, "xi_delete_row called with get_all_records set to TRUE" }, { 20921, "lm_focus_cell_set called when list does not have focus" }, { 30101, "Internal focus error" }, { 30201, "Internal TEXT error" }, { 30202, "Internal TEXT error" }, { 30203, "Internal error" }, { 30205, "txt_caret called with disabled field" }, { 30206, "Invalid TXT passed to txt_event" }, { 30207, "xi_get_obj: Invalid cid" }, { 30208, "width or height required with grid" }, { 30209, "lm_start_edit: Internal error, called with focus not poperly set" }, { 0, "Unknown Error" } }; char * XinErrorCodeLookup( int errcode ) { struct s_error_entry *entry; static char temp[30]; for ( entry = error_table; entry->errcode != 0 && entry->errcode != errcode; entry++ ) ; if ( entry->errcode == 0 ) { sprintf( temp, "XIN Error %d", errcode ); return temp; } return entry->text; } BOOLEAN XinErrorDefaultHandler( int errcode, XinSeverity severity, long app_data ) { BOOLEAN terminate = FALSE; NOREF( app_data ); if ( severity == XinSeverityFatal ) { terminate = TRUE; XinDialogError( "%s", XinErrorCodeLookup( errcode ) ); } else { if ( XinDialogAsk( "Continue", "Terminate", NULL, "%s", XinErrorCodeLookup( errcode ) ) == XinResponse2 ) terminate = TRUE; } return terminate; }