From 5985f12d1143dbfe0ddf1c05192bda7d5aa14895 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Mon, 5 May 2008 12:18:02 -0500 Subject: [PATCH] Add Fl_Text_Edit_Window widget. --- FL/Fl_Text_Edit_Window.fl | 50 +++++++++++++++++++++++++++++++++++++++ FL/makefile.inc | 1 + 2 files changed, 51 insertions(+) create mode 100644 FL/Fl_Text_Edit_Window.fl diff --git a/FL/Fl_Text_Edit_Window.fl b/FL/Fl_Text_Edit_Window.fl new file mode 100644 index 0000000..3f8487f --- /dev/null +++ b/FL/Fl_Text_Edit_Window.fl @@ -0,0 +1,50 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.H} +code_name {.C} +decl {\#include } {} + +widget_class Fl_Text_Edit_Window {open + xywh {787 474 355 410} type Double resizable + code0 {this->size_range( 0, 0, 400, 400 );} + class Fl_Window modal visible +} { + Fl_Box title_box { + label {} + xywh {5 7 345 45} + } + Fl_Text_Editor text_editor { + xywh {5 58 345 320} resizable + code0 {o->buffer( new Fl_Text_Buffer );} + } + Fl_Group {} {open + xywh {5 383 345 27} + } { + Fl_Return_Button return_button { + label {<return>} + callback {hide();} + xywh {250 383 100 25} + } + Fl_Box {} { + label {<empty>} + xywh {5 386 240 19} resizable + code0 {o->labeltype( FL_NO_LABEL );} + } + } +} + +Function {fl_text_edit( const char *title, const char *button_text, const char *initial_text )} {open selected C return_type {char *} +} { + code {Fl_Text_Edit_Window tew( 0, 0, 355, 410, title ); + +tew.return_button->label( button_text ); +tew.title_box->label( title ); +tew.text_editor->buffer()->text( initial_text ); + +tew.show(); + +while ( tew.shown() ) + Fl::wait(); + +return strdup( tew.text_editor->buffer()->text() );} {} +} diff --git a/FL/makefile.inc b/FL/makefile.inc index 7f5c72b..3df5a45 100644 --- a/FL/makefile.inc +++ b/FL/makefile.inc @@ -2,6 +2,7 @@ FL_SRCS= \ FL/Fl_Scalepack.C \ FL/Fl_Arc_Dial.C \ + FL/Fl_Text_Edit_Window.C \ FL/Boxtypes.C \ FL_OBJS := $(FL_SRCS:.C=.o)