/***************************************************************************** FILE : $Source: /projects/higgs1/SNNS/CVS/SNNS/xgui/sources/bn_basics.c,v $ SHORTNAME : bn_basics SNNS VERSION : 4.2 PURPOSE : Provides general procedures for the BigNet Tool NOTES : AUTHOR : Kai-Uwe Herrmann DATE : 15.1.1993 CHANGED BY : Ralf Huebner RCS VERSION : $Revision: 2.10 $ LAST CHANGE : $Date: 1998/03/03 14:09:42 $ Copyright (c) 1990-1995 SNNS Group, IPVR, Univ. Stuttgart, FRG Copyright (c) 1996-1998 SNNS Group, WSI, Univ. Tuebingen, FRG ******************************************************************************/ #include #include #include #include #include #include #include "ui.h" #include "kr_ui.h" #include "ui_mainP.h" #include "ui_xWidgets.h" #include "ui_fileP.h" #include "ui_display.h" #include "ui_event.h" #include "ui_selection.h" #include "ui_netUpdate.h" #include "ui_status.h" #include "ui_confirmer.h" #include "bn_basics.ph" /***************************************************************************** FUNCTION : bn_basics_createART PURPOSE : create ART1 panel NOTES : calling function has to allocate memory for unitWidget and rowWidget arrays. UPDATE : 20.1.1993 ******************************************************************************/ void bn_basics_createART(int model, Widget *baseWidget,int *already_open, Widget unitWidget[], Widget rowWidget[], XtCallbackProc CreateCallbackProc, XtCallbackProc DoneCallbackProc ) { Widget artpanel, artform, button, dummy1x, dummy1y; Widget dummy2x, dummy3, dummy4, dummy5; Arg args[10]; Cardinal n = 0; char buf[40]; int colwidth = 12; int Width, Height; int NoOfDialogRows; int i; char Name[4][20]; char ModelName[20]; switch (model) { case ART1_MODEL: sprintf(ModelName,"ART 1"); Width = 314; Height = 103; NoOfDialogRows = 2; strcpy(Name[0],"F1 layer: "); strcpy(Name[1],"F2 layer: "); break; case ART2_MODEL: sprintf(ModelName,"ART 2"); Width = 314; Height = 124; NoOfDialogRows = 2; strcpy(Name[0],"F1 layer: "); strcpy(Name[1],"F2 layer: "); break; case ARTMAP_MODEL: sprintf(ModelName,"ARTMAP"); Width = 314; Height = 149; NoOfDialogRows = 4; strcpy(Name[0],"F1a layer: "); strcpy(Name[1],"F2a layer: "); strcpy(Name[2],"F1b layer: "); strcpy(Name[3],"F2b layer: "); break; default: *baseWidget = NULL; *already_open = 0; return; } /*switch*/ if(*already_open) { XRaiseWindow (XtDisplay (*baseWidget), XtWindow (*baseWidget)); return; } sprintf(buf,"SNNS BigNet (%s)", ModelName); *baseWidget = XtCreatePopupShell(buf, topLevelShellWidgetClass, ui_toplevel, args, n); artform = XtCreateManagedWidget("box", boxWidgetClass, *baseWidget, args,n); artpanel = XtCreateManagedWidget("form", formWidgetClass, artform, NULL, 0); /* Headings */ dummy1y = dummy1x = ui_xCreateLabelItem (" ",artpanel, colwidth*8, NULL, NULL); dummy2x = ui_xCreateLabelItem ("No. of units", artpanel, colwidth*8, dummy1x, NULL); dummy3 = ui_xCreateLabelItem ("No. of rows", artpanel, colwidth*8, dummy2x, NULL); /* dialog rows */ for (i=0; i