// generated by Fast Light User Interface Designer (fluid) version 1.0302

#include "comp_ui.h"
#include <string>
#include "comp_txt.h"
#include <FL/Fl_File_Chooser.H>

Fl_Double_Window *main_window=(Fl_Double_Window *)0;

Fl_Button *btnRefFile=(Fl_Button *)0;

static void cb_btnRefFile(Fl_Button*, void*) {
  char *fname = fl_file_chooser(
  "Reference file",
  "*",
  "randomtext.txt",
  0);
reference_file->value(fname);
}

Fl_File_Input *reference_file=(Fl_File_Input *)0;

Fl_Button *btnCompFile=(Fl_Button *)0;

static void cb_btnCompFile(Fl_Button*, void*) {
  char *fname = fl_file_chooser(
  "Comparison file",
  "*",
  "test.txt",
  0);
compare_file->value(fname);
}

Fl_File_Input *compare_file=(Fl_File_Input *)0;

Fl_Button *btnCompare=(Fl_Button *)0;

static void cb_btnCompare(Fl_Button*, void*) {
  std::string results;
txtREPORT->value("");
txtREPORT->redraw();
Fl::flush();
comp_txt(reference_file->value(),
         compare_file->value(),
         results);
txtREPORT->value(results.c_str());
}

Fl_Output *txtREPORT=(Fl_Output *)0;

Fl_Button *btnExit=(Fl_Button *)0;

static void cb_btnExit(Fl_Button*, void*) {
  main_window->hide();
}

Fl_Double_Window* make_comptext_win() {
  { main_window = new Fl_Double_Window(590, 155, "Compare Text");
    { btnRefFile = new Fl_Button(3, 20, 85, 24, "Expected");
      btnRefFile->callback((Fl_Callback*)cb_btnRefFile);
    } // Fl_Button* btnRefFile
    { reference_file = new Fl_File_Input(90, 7, 495, 40);
    } // Fl_File_Input* reference_file
    { btnCompFile = new Fl_Button(3, 71, 85, 24, "Received");
      btnCompFile->callback((Fl_Callback*)cb_btnCompFile);
    } // Fl_Button* btnCompFile
    { compare_file = new Fl_File_Input(90, 58, 495, 40);
    } // Fl_File_Input* compare_file
    { btnCompare = new Fl_Button(3, 120, 85, 24, "Compare");
      btnCompare->callback((Fl_Callback*)cb_btnCompare);
    } // Fl_Button* btnCompare
    { txtREPORT = new Fl_Output(90, 120, 410, 24, "Results");
      txtREPORT->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Output* txtREPORT
    { btnExit = new Fl_Button(505, 120, 80, 24, "Exit");
      btnExit->callback((Fl_Callback*)cb_btnExit);
    } // Fl_Button* btnExit
    main_window->end();
  } // Fl_Double_Window* main_window
  return main_window;
}
