est of the buffer style n");
// Either the user deleted some text, or the last character
// on the line changed styles, so reparse the
// remainder of the buffer. (text); (style); = textbuf-> length (); = textbuf-> text_range (start, end); = stylebuf-> text_range (start, end); _parse (text, style, end - start);> replace (start, end, style);
((Fl_Text_Editor *) cbArg) -> redisplay_range (start, end);
} (text); (style);
}
// Editor window functions and class.save_cb (); saveas_cb (); find2_cb (Fl_Widget *, void *); replall_cb (Fl_Widget *, void *); replace2_cb (Fl_Widget *, void *) ; replcan_cb (Fl_Widget *, void *); EditorWindow: public Fl_Double_Window {: (int w, int h, const char * t);
~ EditorWindow (); _Window * replace_dlg; _Input * replace_find; _Input * replace_with; _Button * replace_all; _Return_Button * replace_next; _Button * replace_cancel; _Text_Editor * editor; search [256];
}; :: EditorWindow (int w, int h, const char * t): Fl_Double_Window (w, h, t) {_dlg = new Fl_Window (300, 105, "Replace"); _find = new Fl_Input (80, 10, 210, 25, "Find:"); _find-> align (FL_ALIGN_LEFT); _with = new Fl_Input (80, 40, 210, 25, "Replace:") ; _with-> align (FL_ALIGN_LEFT); _all = new Fl_Button (10, 70, 90, 25, "Replace All"); _all-> callback ((Fl_Callback *) replall_cb, this); _next = new Fl_Return_Button ( 105, 70, 120, 25, "Replace Next"); _next-> callback ((Fl_Callback *) replace2_cb, this); _cancel = new Fl_Button (230, 70, 60, 25, "Cancel"); _cancel -> callback ((Fl_Callback *) replcan_cb, this); _dlg-> end (); _dlg-> set_non_modal (); = 0;
* search = (char) 0; ();
} :: ~ EditorWindow () {replace_dlg;
} check_save (void) {(! changed) return 1; r = fl_choice ("The current file has not been saved. n"
"Would you like to save it now?",
"Cancel", "Save", "Don't Save"); (r == 1) {_cb ();// Save the file.! changed;
} (r == 2)? 1: 0;
} loading = 0; load_file (const char * newfile, int ipos) {= 1; insert = (ipos! = - 1); = insert; (! insert) strcpy (filename, " "); r; (! insert) r = textbuf-> loadfile (newfile); r = textbuf-> insertfile (newfile, ipos);
// changed = changed | | textbuf-> input_file_was_transcoded; (r) _alert ("Error reading from file '% s ': n% s.", newfile, strerror (errno)); (! insert) strcpy (filename, newfile); = 0;> call_modify_callbacks ();
} save_file (const char * newfile) {(textbuf-> savefile (newfile)) _alert ("Error writing to file '% s ': n% s.", newfile, strerror (errno)); (filename, newfile); = 0;> call_modify_callbacks ();
} c...