Index: fluid/CMakeLists.txt
===================================================================
--- fluid/CMakeLists.txt	(revision 11810)
+++ fluid/CMakeLists.txt	(working copy)
@@ -22,6 +22,8 @@
     Fl_Group_Type.cxx
     Fl_Menu_Type.cxx
     Fl_Type.cxx
+    ExternalCodeEditor_UNIX.cxx
+    ExternalCodeEditor_WIN32.cxx
     Fl_Widget_Type.cxx
     Fl_Window_Type.cxx
     Fluid_Image.cxx
Index: fluid/Fl_Function_Type.cxx
===================================================================
--- fluid/Fl_Function_Type.cxx	(revision 11810)
+++ fluid/Fl_Function_Type.cxx	(working copy)
@@ -15,17 +15,25 @@
 //
 //     http://www.fltk.org/str.php
 //
-
 #include <FL/Fl.H>
+#include <FL/Fl_Window.H>
 #include <FL/Fl_Preferences.H>
 #include <FL/Fl_File_Chooser.H>
 #include "Fl_Type.h"
 #include <FL/fl_show_input.H>
 #include <FL/Fl_File_Chooser.H>
+#include "alignment_panel.h"
 #include "../src/flstring.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
+#ifdef WIN32
+  #include "ExternalCodeEditor_WIN32.h"
+#else
+  #include "ExternalCodeEditor_UNIX.h"
+#endif
+
 extern int i18n_type;
 extern const char* i18n_include;
 extern const char* i18n_function;
@@ -38,6 +46,7 @@
 extern void redraw_browser();
 extern void goto_source_dir();
 extern void leave_source_dir();
+extern Fl_Window *main_window;
 
 ////////////////////////////////////////////////////////////////
 // quick check of any C code for legality, returns an error message
@@ -434,6 +443,14 @@
 }
 
 void Fl_Code_Type::open() {
+  // Using an external code editor? Open it..
+  if ( G_use_external_editor && G_external_editor_command[0] ) {
+    const char *cmd = G_external_editor_command;
+    const char *code = name();
+    if ( editor_.open_editor(cmd, code) == 0 )
+      return;   // return if editor opened ok, fallthru to built-in if not
+  }
+  // Use built-in code editor..
   if (!code_panel) make_code_panel();
   const char *text = name();
   code_input->buffer()->text( text ? text : "" );
@@ -459,9 +476,23 @@
 
 Fl_Code_Type Fl_Code_type;
 
+void Fl_Code_Type::write() {
+  // External editor changes? If so, load changes into ram, update mtime/size
+  if ( handle_editor_changes() == 1 ) {
+    main_window->redraw();    // tell fluid to redraw; edits may affect tree's contents
+  }
+  Fl_Type::write();
+}
+
 void Fl_Code_Type::write_code1() {
+  // External editor changes? If so, load changes into ram, update mtime/size
+  if ( handle_editor_changes() == 1 ) {
+    main_window->redraw();    // tell fluid to redraw; edits may affect tree's contents
+  }
+
   const char* c = name();
   if (!c) return;
+
   const char *pch;
   const char *ind = indent();
   while( (pch=strchr(c,'\n')) )
Index: fluid/Fl_Type.cxx
===================================================================
--- fluid/Fl_Type.cxx	(revision 11810)
+++ fluid/Fl_Type.cxx	(working copy)
@@ -756,6 +756,7 @@
 int Fl_Type::is_menu_button() const {return 0;}
 int Fl_Type::is_group() const {return 0;}
 int Fl_Type::is_window() const {return 0;}
+int Fl_Type::is_code() const {return 0;}
 int Fl_Type::is_code_block() const {return 0;}
 int Fl_Type::is_decl_block() const {return 0;}
 int Fl_Type::is_comment() const {return 0;}
Index: fluid/Fl_Type.h
===================================================================
--- fluid/Fl_Type.h	(revision 11810)
+++ fluid/Fl_Type.h	(working copy)
@@ -32,6 +32,12 @@
 #include <FL/fl_draw.H>
 #include <stdarg.h>
 
+#ifdef WIN32
+  #include "ExternalCodeEditor_WIN32.h"
+#else
+  #include "ExternalCodeEditor_UNIX.h"
+#endif
+
 void set_modflag(int mf);
 
 class Fl_Type {
@@ -109,7 +115,7 @@
   virtual void open();	// what happens when you double-click
 
   // read and write data to a saved file:
-  void write();
+  virtual void write();
   virtual void write_properties();
   virtual void read_property(const char *);
   virtual int read_fdesign(const char*, const char*);
@@ -143,6 +149,7 @@
   virtual int is_menu_button() const;
   virtual int is_group() const;
   virtual int is_window() const;
+  virtual int is_code() const;
   virtual int is_code_block() const;
   virtual int is_decl_block() const;
   virtual int is_comment() const;
@@ -185,15 +192,56 @@
 };
 
 class Fl_Code_Type : public Fl_Type {
+  ExternalCodeEditor editor_;
 public:
   Fl_Type *make();
+  void write();
   void write_code1();
   void write_code2();
   void open();
   virtual const char *type_name() {return "code";}
   int is_code_block() const {return 0;}
+  int is_code() const {return 1;}
   int pixmapID() { return 8; }
   virtual int is_public() const;
+  // See if external editor is open
+  int is_editing() {
+    return editor_.is_editing();
+  }
+  // Reap the editor's pid
+  // Returns:
+  //   -2 -- editor not open
+  //   -1 -- wait failed
+  //    0 -- process still running
+  //   >0 -- process finished + reaped (returns pid)
+  //
+  int reap_editor() {
+    return editor_.reap_editor();
+  }
+  // Handle external editor file modifications
+  // If changed, record keeping is updated and file's contents is loaded into ram
+  //
+  // Returns:
+  //     0 -- file unchanged or not editing
+  //     1 -- file changed, internal records updated, 'code' has new content
+  //    -1 -- error getting file info (get_ms_errmsg() has reason)
+  //
+  // TODO: Figure out how saving a fluid file can be intercepted to grab 
+  //       current contents of editor file..
+  //
+  int handle_editor_changes() {
+    const char *newcode = 0;
+    switch ( editor_.handle_changes(&newcode) ) {
+      case 1: {            // (1)=changed
+        name(newcode);     // update value in ram
+        free((void*)newcode);
+        return 1;
+      }
+      case -1: return -1;  // (-1)=error -- couldn't read file (dialog showed reason)
+      default: break;      // (0)=no change
+    }
+    return 0;
+  }
 };
 
 class Fl_CodeBlock_Type : public Fl_Type {
Index: fluid/Makefile
===================================================================
--- fluid/Makefile	(revision 11810)
+++ fluid/Makefile	(working copy)
@@ -18,6 +18,8 @@
 
 CPPFILES = \
 	CodeEditor.cxx \
+	ExternalCodeEditor_UNIX.cxx \
+	ExternalCodeEditor_WIN32.cxx \
 	Fl_Function_Type.cxx \
 	Fl_Group_Type.cxx \
 	Fl_Menu_Type.cxx \
Index: fluid/about_panel.cxx
===================================================================
--- fluid/about_panel.cxx	(revision 11810)
+++ fluid/about_panel.cxx	(working copy)
@@ -251,7 +251,10 @@
 "     ........................................................................\
 ..............     "
 };
-static Fl_Pixmap image_fluid(idata_fluid);
+static Fl_Image *image_fluid() {
+  static Fl_Image *image = new Fl_Pixmap(idata_fluid);
+  return image;
+}
 
 static void cb_View(Fl_Button*, void*) {
   show_help("license.html");
@@ -267,7 +270,7 @@
     about_panel->selection_color(FL_DARK1);
     about_panel->hotspot(about_panel);
     { Fl_Box* o = new Fl_Box(10, 10, 115, 120);
-      o->image(image_fluid);
+      o->image( image_fluid() );
     } // Fl_Box* o
     { Fl_Box* o = new Fl_Box(135, 10, 205, 75, "FLTK User\nInterface Designer\nVersion x.x.x");
       o->color((Fl_Color)12);
Index: fluid/alignment_panel.cxx
===================================================================
--- fluid/alignment_panel.cxx	(revision 11810)
+++ fluid/alignment_panel.cxx	(working copy)
@@ -197,12 +197,29 @@
 load_history();
 }
 
+Fl_Check_Button *use_external_editor_button=(Fl_Check_Button *)0;
+
+static void cb_use_external_editor_button(Fl_Check_Button*, void*) {
+  G_use_external_editor = use_external_editor_button->value();
+fluid_prefs.set("use_external_editor", G_use_external_editor);
+redraw_browser();
+}
+
+Fl_Input *editor_command_input=(Fl_Input *)0;
+
+static void cb_editor_command_input(Fl_Input*, void*) {
+  strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
+G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
+fluid_prefs.set("external_editor_command", G_external_editor_command);
+redraw_browser();
+}
+
 static void cb_Close1(Fl_Button*, void*) {
   settings_window->hide();
 }
 
 Fl_Double_Window* make_settings_window() {
-  { settings_window = new Fl_Double_Window(349, 241, "GUI Settings");
+  { Fl_Double_Window* o = settings_window = new Fl_Double_Window(360, 355, "GUI Settings");
     { scheme_choice = new Fl_Choice(140, 10, 115, 25, "Scheme: ");
       scheme_choice->down_box(FL_BORDER_BOX);
       scheme_choice->labelfont(1);
@@ -213,7 +230,7 @@
       scheme_choice->value(s);
       scheme_cb(0, 0);
     } // Fl_Choice* scheme_choice
-    { Fl_Group* o = new Fl_Group(116, 43, 220, 126);
+    { Fl_Group* o = new Fl_Group(20, 43, 330, 161);
       o->labelfont(1);
       o->align(Fl_Align(FL_ALIGN_CENTER));
       { Fl_Box* o = new Fl_Box(140, 43, 1, 25, "Options: ");
@@ -271,10 +288,36 @@
       recent_spinner->maximum(10);
       recent_spinner->value(c);
     } // Fl_Spinner* recent_spinner
-    { Fl_Button* o = new Fl_Button(276, 205, 64, 25, "Close");
+    { Fl_Group* o = new Fl_Group(10, 210, 337, 95);
+      o->box(FL_THIN_UP_BOX);
+      o->color(FL_DARK1);
+      { use_external_editor_button = new Fl_Check_Button(25, 218, 209, 22, "Use external editor?");
+        use_external_editor_button->down_box(FL_DOWN_BOX);
+        use_external_editor_button->labelsize(12);
+        use_external_editor_button->callback((Fl_Callback*)cb_use_external_editor_button);
+        fluid_prefs.get("use_external_editor", G_use_external_editor, 0);
+        use_external_editor_button->value(G_use_external_editor);
+      } // Fl_Check_Button* use_external_editor_button
+      { editor_command_input = new Fl_Input(25, 264, 305, 21, "Editor Command");
+        editor_command_input->tooltip("The editor command to open your external text editor.\nInclude any necessary \
+flags to ensure your editor does not background itself.\nExamples:\n    gvim -\
+f\n    gedit\n emacs");
+        editor_command_input->labelsize(12);
+        editor_command_input->textsize(12);
+        editor_command_input->callback((Fl_Callback*)cb_editor_command_input);
+        editor_command_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+        editor_command_input->when(FL_WHEN_CHANGED);
+        fluid_prefs.get("external_editor_command", G_external_editor_command, "", sizeof(G_external_editor_command)-1);
+        editor_command_input->value(G_external_editor_command);
+      } // Fl_Input* editor_command_input
+      o->end();
+      Fl_Group::current()->resizable(o);
+    } // Fl_Group* o
+    { Fl_Button* o = new Fl_Button(285, 320, 64, 25, "Close");
       o->tooltip("Close this dialog.");
       o->callback((Fl_Callback*)cb_Close1);
     } // Fl_Button* o
+    o->size_range(o->w(), o->h());
     settings_window->set_non_modal();
     settings_window->end();
   } // Fl_Double_Window* settings_window
Index: fluid/alignment_panel.fl
===================================================================
--- fluid/alignment_panel.fl	(revision 11810)
+++ fluid/alignment_panel.fl	(working copy)
@@ -46,6 +46,12 @@
 decl {extern int show_comments;} {public local
 }
 
+decl {extern int G_use_external_editor;} {public local
+}
+
+decl {extern char G_external_editor_command[512];} {public local
+}
+
 decl {extern int show_coredevmenus;} {public local
 }
 
@@ -161,7 +167,8 @@
 Function {make_settings_window()} {} {
   Fl_Window settings_window {
     label {GUI Settings} open
-    xywh {393 191 349 241} type Double hide non_modal
+    xywh {355 85 360 355} type Double resizable
+    code0 {o->size_range(o->w(), o->h());} non_modal visible
   } {
     Fl_Choice scheme_choice {
       label {Scheme: }
@@ -194,7 +201,7 @@
       }
     }
     Fl_Group {} {open
-      xywh {116 43 220 126} labelfont 1 align 0
+      xywh {20 43 330 161} labelfont 1 align 0
     } {
       Fl_Box {} {
         label {Options: }
@@ -254,10 +261,38 @@
       code2 {recent_spinner->maximum(10);}
       code3 {recent_spinner->value(c);}
     }
+    Fl_Group {} {open
+      xywh {10 210 337 95} box THIN_UP_BOX color 47 resizable
+    } {
+      Fl_Check_Button use_external_editor_button {
+        label {Use external editor?}
+        callback {G_use_external_editor = use_external_editor_button->value();
+fluid_prefs.set("use_external_editor", G_use_external_editor);
+redraw_browser();}
+        xywh {25 218 209 22} down_box DOWN_BOX labelsize 12
+        code1 {fluid_prefs.get("use_external_editor", G_use_external_editor, 0);}
+        code2 {use_external_editor_button->value(G_use_external_editor);}
+      }
+      Fl_Input editor_command_input {
+        label {Editor Command}
+        callback {strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
+G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
+fluid_prefs.set("external_editor_command", G_external_editor_command);
+redraw_browser();} selected
+        tooltip {The editor command to open your external text editor.
+Include any necessary flags to ensure your editor does not background itself.
+Examples:
+    gvim -f
+    gedit
+ emacs} xywh {25 264 305 21} labelsize 12 align 5 when 1 textsize 12
+        code1 {fluid_prefs.get("external_editor_command", G_external_editor_command, "", sizeof(G_external_editor_command)-1);}
+        code2 {editor_command_input->value(G_external_editor_command);}
+      }
+    }
     Fl_Button {} {
       label Close
       callback {settings_window->hide();}
-      tooltip {Close this dialog.} xywh {276 205 64 25}
+      tooltip {Close this dialog.} xywh {285 320 64 25}
     }
   }
 }
Index: fluid/alignment_panel.h
===================================================================
--- fluid/alignment_panel.h	(revision 11810)
+++ fluid/alignment_panel.h	(working copy)
@@ -27,6 +27,8 @@
 extern void load_history();
 extern void redraw_browser();
 extern int show_comments;
+extern int G_use_external_editor;
+extern char G_external_editor_command[512];
 extern int show_coredevmenus;
 extern struct Fl_Menu_Item *dbmanager_item;
 extern Fl_Preferences fluid_prefs;
@@ -73,6 +75,8 @@
 extern Fl_Check_Button *show_comments_button;
 #include <FL/Fl_Spinner.H>
 extern Fl_Spinner *recent_spinner;
+extern Fl_Check_Button *use_external_editor_button;
+extern Fl_Input *editor_command_input;
 Fl_Double_Window* make_settings_window();
 extern Fl_Menu_Item menu_scheme_choice[];
 extern Fl_Double_Window *shell_window;
Index: fluid/fluid.cxx
===================================================================
--- fluid/fluid.cxx	(revision 11810)
+++ fluid/fluid.cxx	(working copy)
@@ -83,6 +83,9 @@
 #endif // HAVE_LIBPNG && HAVE_LIBZ
 }
 
+//
+// Globals..
+//
 static Fl_Help_Dialog *help_dialog = 0;
 
 Fl_Preferences	fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid");
@@ -91,6 +94,9 @@
 int snap = 1;
 int show_guides = 1;
 int show_comments = 1;
+int G_use_external_editor = 0;
+int G_debug = 0;
+char G_external_editor_command[512];
 int show_coredevmenus = 1;
 
 // File history info...
@@ -185,6 +191,41 @@
   return name[which];
 }
 
+// Timer to watch for external editor modifications
+//    If one or more external editors open, check if their files were modified.
+//    If so: reload to ram, update size/mtime records, and change fluid's 'modified' state.
+//
+static void external_editor_timer(void*) {
+  int editors_open = ExternalCodeEditor::editors_open();
+  if ( G_debug ) printf("--- TIMER --- External editors open=%d\n", editors_open);
+  if ( editors_open > 0 ) {
+    // Walk tree looking for files modified by external editors.
+    int modified = 0;
+    for (Fl_Type *p = Fl_Type::first; p; p = p->next) {
+      if ( p->is_code() ) {
+        Fl_Code_Type *code = (Fl_Code_Type*)p;
+        // Code changed by external editor?
+        if ( code->handle_editor_changes() ) {	// updates ram, file size/mtime
+          modified++;
+        }
+        if ( code->is_editing() ) {             // editor open?
+          code->reap_editor();                  // Try to reap; maybe it recently closed
+        }
+      }
+    }
+    if ( modified ) set_modflag(1);
+  }
+  // Repeat timeout if editors still open
+  //    The ExternalCodeEditor class handles start/stopping timer, we just
+  //    repeat_timeout() if it's already on. NOTE: above code may have reaped
+  //    only open editor, which would disable further timeouts. So *recheck*
+  //    if editors still open, to ensure we don't accidentally re-enable them.
+  //
+  if ( ExternalCodeEditor::editors_open() ) {
+    Fl::repeat_timeout(2.0, external_editor_timer);
+  }
+}
+
 void save_cb(Fl_Widget *, void *v) {
   Fl_Native_File_Chooser fnfc;
   const char *c = filename;
@@ -371,6 +412,10 @@
 }
 
 void exit_cb(Fl_Widget *,void *) {
+
+  // Stop any external editor update timers
+  ExternalCodeEditor::stop_update_timer();
+
   if (modflag)
     switch (fl_choice("Do you want to save changes to this user\n"
                       "interface before exiting?", "Cancel",
@@ -404,6 +449,12 @@
 
   undo_clear();
 
+  // Destroy tree
+  //    Doing so causes dtors to automatically close all external editors
+  //    and cleans up editor tmp files. Then remove fluid tmpdir /last/.
+  delete_all();
+  ExternalCodeEditor::tmpdir_clear();
+
   exit(0);
 }
 
@@ -1711,7 +1762,6 @@
 }
 #endif
 
-
 int main(int argc,char **argv) {
   int i = 1;
   
@@ -1800,6 +1850,9 @@
   signal(SIGINT,sigint);
 #endif
 
+  // Set (but do not start) timer callback for external editor updates
+  ExternalCodeEditor::set_update_timer_callback(external_editor_timer);
+
   grid_cb(horizontal_input, 0); // Makes sure that windows get snap params...
 
 #ifdef WIN32
Index: fluid/print_panel.cxx
===================================================================
--- fluid/print_panel.cxx	(revision 11810)
+++ fluid/print_panel.cxx	(working copy)
@@ -158,7 +158,10 @@
 "   %%%%%%%%\'\'********   ",
 "     %%%%%%  ******     "
 };
-static Fl_Pixmap image_print_color(idata_print_color);
+static Fl_Image *image_print_color() {
+  static Fl_Image *image = new Fl_Pixmap(idata_print_color);
+  return image;
+}
 
 static const char *idata_print_gray[] = {
 "24 24 17 1",
@@ -204,7 +207,10 @@
 "   %%%%%%%%\'\'********   ",
 "     %%%%%%  ******     "
 };
-static Fl_Pixmap image_print_gray(idata_print_gray);
+static Fl_Image *image_print_gray() {
+  static Fl_Image *image = new Fl_Pixmap(idata_print_gray);
+  return image;
+}
 
 Fl_Button *print_output_mode[4]={(Fl_Button *)0};
 
@@ -457,7 +463,7 @@
         print_output_mode[0]->value(1);
         print_output_mode[0]->color(FL_BACKGROUND2_COLOR);
         print_output_mode[0]->selection_color(FL_FOREGROUND_COLOR);
-        print_output_mode[0]->image(image_print_color);
+        print_output_mode[0]->image( image_print_color() );
       } // Fl_Button* print_output_mode[0]
       { print_output_mode[1] = new Fl_Button(150, 50, 40, 30);
         print_output_mode[1]->type(102);
@@ -465,7 +471,7 @@
         print_output_mode[1]->down_box(FL_BORDER_BOX);
         print_output_mode[1]->color(FL_BACKGROUND2_COLOR);
         print_output_mode[1]->selection_color(FL_FOREGROUND_COLOR);
-        print_output_mode[1]->image(image_print_color);
+        print_output_mode[1]->image( image_print_color() );
       } // Fl_Button* print_output_mode[1]
       { print_output_mode[2] = new Fl_Button(200, 45, 30, 40);
         print_output_mode[2]->type(102);
@@ -473,7 +479,7 @@
         print_output_mode[2]->down_box(FL_BORDER_BOX);
         print_output_mode[2]->color(FL_BACKGROUND2_COLOR);
         print_output_mode[2]->selection_color(FL_FOREGROUND_COLOR);
-        print_output_mode[2]->image(image_print_gray);
+        print_output_mode[2]->image( image_print_gray() );
       } // Fl_Button* print_output_mode[2]
       { print_output_mode[3] = new Fl_Button(240, 50, 40, 30);
         print_output_mode[3]->type(102);
@@ -481,7 +487,7 @@
         print_output_mode[3]->down_box(FL_BORDER_BOX);
         print_output_mode[3]->color(FL_BACKGROUND2_COLOR);
         print_output_mode[3]->selection_color(FL_FOREGROUND_COLOR);
-        print_output_mode[3]->image(image_print_gray);
+        print_output_mode[3]->image( image_print_gray() );
       } // Fl_Button* print_output_mode[3]
       o->end();
     } // Fl_Group* o
Index: ide/VisualC2008/fluid.vcproj
===================================================================
--- ide/VisualC2008/fluid.vcproj	(revision 11810)
+++ ide/VisualC2008/fluid.vcproj	(working copy)
@@ -964,6 +964,50 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\..\fluid\ExternalCodeEditor_WIN32.cxx"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					Optimization="0"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					FavorSizeOrSpeed="0"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Debug Cairo|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					Optimization="0"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release Cairo|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					FavorSizeOrSpeed="0"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\..\fluid\fluid.cxx"
 			>
 			<FileConfiguration
Index: ide/VisualC2010/fluid.vcxproj
===================================================================
--- ide/VisualC2010/fluid.vcxproj	(revision 11810)
+++ ide/VisualC2010/fluid.vcxproj	(working copy)
@@ -317,6 +317,7 @@
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
+    <ClCompile Include="..\..\fluid\ExternalCodeEditor_WIN32.cxx" />
     <ClCompile Include="..\..\fluid\factory.cxx">
       <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Cairo|Win32'">Disabled</Optimization>
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Cairo|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -530,4 +531,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
Index: ide/VisualC6/Fluid.dsp
===================================================================
--- ide/VisualC6/Fluid.dsp	(revision 11810)
+++ ide/VisualC6/Fluid.dsp	(working copy)
@@ -147,6 +147,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\fluid\ExternalCodeEditor_WIN32.cxx
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\fluid\fluid.cxx
 # End Source File
 # Begin Source File
Index: ide/Xcode4/FLTK.xcodeproj/project.pbxproj
===================================================================
--- ide/Xcode4/FLTK.xcodeproj/project.pbxproj	(revision 11810)
+++ ide/Xcode4/FLTK.xcodeproj/project.pbxproj	(working copy)
@@ -105,6 +105,7 @@
 		2832E97111DB41A4B13A4EFE /* keyboard_ui.fl in Sources */ = {isa = PBXBuildFile; fileRef = 7B084447C58E292798B27283 /* keyboard_ui.fl */; };
 		285B384349B0FC5FCE9C9FCE /* fl_open_uri.cxx in Sources */ = {isa = PBXBuildFile; fileRef = FAD24127A06F3F9F0EEB843A /* fl_open_uri.cxx */; };
 		291FA24A9E91A2036BC718A2 /* Fl_Overlay_Window.cxx in Sources */ = {isa = PBXBuildFile; fileRef = D1C792936D427CC48581BFAE /* Fl_Overlay_Window.cxx */; };
+		292AEA641D3592410000763E /* ExternalCodeEditor_UNIX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 294EA3171D358DAD00052964 /* ExternalCodeEditor_UNIX.cxx */; };
 		29303C4480E0BBEB9E29EE7B /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = EBC0D2C965EDD6503B0CF519 /* vsnprintf.c */; };
 		299CB8A2848CB844BCEC7829 /* Fl_Paged_Device.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 6C1C9A4F054C48CDD6A2DE44 /* Fl_Paged_Device.cxx */; };
 		29A99477531233BE9391CE66 /* Fl_Slider.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 5AF5119D08DFC92EA1032671 /* Fl_Slider.cxx */; };
@@ -4368,6 +4369,8 @@
 		28AFF174A53E38CCB7475C19 /* jdmaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jdmaster.c; path = ../../jpeg/jdmaster.c; sourceTree = SOURCE_ROOT; };
 		28E8F2802DEA5334F914BE98 /* Fl_grab.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_grab.cxx; path = ../../src/Fl_grab.cxx; sourceTree = SOURCE_ROOT; };
 		28F3E4EBB6E5F8420624A5DA /* Fl_Scrollbar.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Scrollbar.H; path = ../../FL/Fl_Scrollbar.H; sourceTree = SOURCE_ROOT; };
+		292AEA661D3592D20000763E /* ExternalCodeEditor_UNIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalCodeEditor_UNIX.h; path = ../../fluid/ExternalCodeEditor_UNIX.h; sourceTree = SOURCE_ROOT; };
+		294EA3171D358DAD00052964 /* ExternalCodeEditor_UNIX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExternalCodeEditor_UNIX.cxx; path = ../../fluid/ExternalCodeEditor_UNIX.cxx; sourceTree = SOURCE_ROOT; };
 		29E61287C1F4A1123829C900 /* glut_font.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glut_font.cxx; path = ../../src/glut_font.cxx; sourceTree = SOURCE_ROOT; };
 		2A3CEBA07E8AE9BF4C002531 /* CubeMain.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CubeMain.cxx; path = ../../test/CubeMain.cxx; sourceTree = SOURCE_ROOT; };
 		2A5CB08352A0DBD0980FC770 /* pngpread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngpread.c; path = ../../png/pngpread.c; sourceTree = SOURCE_ROOT; };
@@ -5906,6 +5909,7 @@
 			isa = PBXGroup;
 			children = (
 				2D8189C8293D1D51B5409B28 /* CodeEditor.h */,
+				292AEA661D3592D20000763E /* ExternalCodeEditor_UNIX.h */,
 				40E462179ABB6A6D0FBD72FE /* Fl_Type.h */,
 				9E4DE1CE4D10CA89D0D13AC7 /* Fl_Widget_Type.h */,
 				D638C69E37B67C905C806560 /* Fluid_Image.h */,
@@ -6761,6 +6765,7 @@
 			children = (
 				1C04F9887FB96BE57051A4CE /* Headers */,
 				CC0C80DA4DD31B6B2DB91096 /* CodeEditor.cxx */,
+				294EA3171D358DAD00052964 /* ExternalCodeEditor_UNIX.cxx */,
 				C9F1464F0E6A4DCD77AF72B8 /* Fl_Function_Type.cxx */,
 				80E4ACCB50A295390EC9C1AB /* Fl_Group_Type.cxx */,
 				88F715478C4F84C8E55B0820 /* Fl_Menu_Type.cxx */,
@@ -6781,8 +6786,11 @@
 				102D0B1D203936477107B2D8 /* widget_panel.cxx */,
 				80CD4956321634F723D3C40B /* fluid.icns */,
 			);
+			indentWidth = 2;
 			name = Fluid;
 			sourceTree = "<group>";
+			tabWidth = 8;
+			wrapsLines = 0;
 		};
 		D2331A75FD2049BA77D86D61 /* resize */ = {
 			isa = PBXGroup;
@@ -10448,6 +10456,7 @@
 				BB6A1C570A202678C7BCB4D5 /* Fl_Function_Type.cxx in Sources */,
 				D98529E8EBA39A388937F437 /* Fl_Group_Type.cxx in Sources */,
 				91D17317EFB32F4E9E022744 /* Fl_Menu_Type.cxx in Sources */,
+				292AEA641D3592410000763E /* ExternalCodeEditor_UNIX.cxx in Sources */,
 				8AB3C564389AED897174FFF2 /* Fl_Type.cxx in Sources */,
 				12593F9F94BE42F4E595B444 /* Fl_Widget_Type.cxx in Sources */,
 				5DE12673768A18EB41C6186E /* Fl_Window_Type.cxx in Sources */,
@@ -14445,6 +14454,7 @@
 				);
 				INFOPLIST_FILE = "plists/Fluid-Info.plist";
 				INSTALL_PATH = "$(HOME)/Applications";
+				MACOSX_DEPLOYMENT_TARGET = 10.10;
 				OTHER_LDFLAGS = "";
 				PRODUCT_NAME = Fluid;
 				SDKROOT = "";
@@ -14562,6 +14572,7 @@
 				);
 				INFOPLIST_FILE = "plists/Fluid-Info.plist";
 				INSTALL_PATH = "$(HOME)/Applications";
+				MACOSX_DEPLOYMENT_TARGET = 10.10;
 				OTHER_LDFLAGS = "";
 				PRODUCT_NAME = Fluid;
 				SDKROOT = "";
