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

#include "Fl_Text_Edit_Window.H"
#include <string.h>

void Fl_Text_Edit_Window::cb_return_button_i(Fl_Return_Button*, void*) {
  hide();
}
void Fl_Text_Edit_Window::cb_return_button(Fl_Return_Button* o, void* v) {
  ((Fl_Text_Edit_Window*)(o->parent()->parent()))->cb_return_button_i(o,v);
}
Fl_Text_Edit_Window::Fl_Text_Edit_Window(int X, int Y, int W, int H, const char *L)
  : Fl_Double_Window(X, Y, W, H, L) {
  _Fl_Text_Edit_Window();
}

Fl_Text_Edit_Window::Fl_Text_Edit_Window(int W, int H, const char *L)
  : Fl_Double_Window(0, 0, W, H, L) {
  clear_flag(16);
  _Fl_Text_Edit_Window();
}

Fl_Text_Edit_Window::Fl_Text_Edit_Window()
  : Fl_Double_Window(0, 0, 355, 410, 0) {
  clear_flag(16);
  _Fl_Text_Edit_Window();
}

void Fl_Text_Edit_Window::_Fl_Text_Edit_Window() {
this->box(FL_FLAT_BOX);
this->color(FL_BACKGROUND_COLOR);
this->selection_color(FL_BACKGROUND_COLOR);
this->labeltype(FL_NO_LABEL);
this->labelfont(0);
this->labelsize(14);
this->labelcolor(FL_FOREGROUND_COLOR);
this->align(Fl_Align(FL_ALIGN_TOP));
this->when(FL_WHEN_RELEASE);
{ title_box = new Fl_Box(5, 7, 345, 28, "<title>");
} // Fl_Box* title_box
{ Fl_Text_Editor* o = text_editor = new Fl_Text_Editor(5, 37, 345, 341);
  Fl_Group::current()->resizable(text_editor);
  o->buffer( new Fl_Text_Buffer );
} // Fl_Text_Editor* text_editor
{ Fl_Group* o = new Fl_Group(5, 383, 345, 27);
  { return_button = new Fl_Return_Button(250, 383, 100, 25, "<return>");
    return_button->callback((Fl_Callback*)cb_return_button);
  } // Fl_Return_Button* return_button
  { Fl_Box* o = new Fl_Box(5, 386, 240, 19, "<empty>");
    Fl_Group::current()->resizable(o);
    o->labeltype( FL_NO_LABEL );
  } // Fl_Box* o
  o->end();
} // Fl_Group* o
this->size_range( 0, 0, 400, 400 );
set_modal();
end();
}

char * fl_text_edit( const char *title, const char *button_text, const char *initial_text, int W , int H ) {
  Fl_Text_Edit_Window tew( 355, 410, title );
  
  tew.size( W, H );
  tew.return_button->label( button_text );
  tew.title_box->label( title );
  if ( initial_text )
  	tew.text_editor->buffer()->text( initial_text );
  
  tew.show();
  
  while ( tew.shown() )
  	Fl::wait();
  	
  return strdup( tew.text_editor->buffer()->text() );
}
