#include "starappl.h"
#include "starmenu.h"
#include "starfsel.h"
#include "struc/starpasr.h"
#include "gui/messageb.h"
#include "gui/button.h"

extern int lineno;
extern char* yytext;

@implementation WDCSTARFileSelectBox

- doSelectedAux
{
  char *fileName;
  id parser, application, result=self;
  fileName=[self getFileName];
  application=[self getApplicationObject];
  parser=[application getSTARParser];
  if (fileName)
    {
      if (![parser perform : sel_get_uid([self getActionMessage]) 
	    with : (id)fileName])
	{
	  [[self getMessageBox] 
	   setMessage : "line %d : parse error at %s", 
	   (void*)lineno, 
	   (void*)yytext, 
	   0];
	  [[self getMessageBox] popUp];
	  result=0;
	}
      else
	{
	  // just get dictionary for now, (demo purpose)
	  [[[application getMainMenu]
	    getMenuNamed : "ListMenu"]
	   addButtonBasedOn : [parser getCurrentParsingFile]];
	}
    }
  return result;
}

@end
