]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / lyx_cb.C
index 5e951fef58d11705a95815994941fe77518d5a4c..22d31e4fbc617e5a43e3859a5ac36cd0cad2699c 100644 (file)
@@ -54,17 +54,12 @@ extern Combox * combo_language2;
 extern BufferList bufferlist;
 extern void show_symbols_form();
 extern FD_form_character * fd_form_character;
-extern FD_form_preamble * fd_form_preamble;
 extern FD_form_figure * fd_form_figure;
 
 extern BufferView * current_view; // called too many times in this file...
 
 extern void DeleteSimpleCutBuffer(); /* for the cleanup when exiting */
 
-#if 0
-extern bool send_fax(string const & fname, string const & sendcmd);
-#endif
-
 extern void MenuSendto();
 
 // this should be static, but I need it in buffer.C
@@ -300,32 +295,6 @@ int MenuRunChktex(Buffer * buffer)
 }
 
 
-#if 0
-void MenuFax(Buffer * buffer)
-{
-       // Generate postscript file
-       if (!Exporter::Export(buffer, "ps", true))
-               return;
-
-       // Send fax
-       string const ps = OnlyFilename(ChangeExtension(buffer->fileName(), 
-                                                      ".ps"));
-
-       string path = OnlyPath (buffer->fileName());
-       if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
-               path = buffer->tmppath;
-       }
-       Path p(path);
-       if (!lyxrc.fax_program.empty()) {
-                string help2 = subst(lyxrc.fax_program, "$$FName", ps);
-                help2 += " &";
-                Systemcalls one(Systemcalls::System, help2);
-       } else
-               send_fax(ps, lyxrc.fax_command);
-}
-#endif
-
-
 void QuitLyX()
 {
        lyxerr.debug() << "Running QuitLyX." << endl;
@@ -505,7 +474,7 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
        bv->hideCursor();
        
        // clear the selection
-       bv->beforeChange();
+       bv->beforeChange(bv->text);
        if (!asParagraph)
                bv->text->InsertStringA(bv, tmpstr);
        else
@@ -625,58 +594,6 @@ void MenuLayoutCharacter()
 }
 
 
-bool UpdateLayoutPreamble(BufferView * bv)
-{
-       bool update = true;
-       if (!bv->available())
-               update = false;
-
-       if (update) {
-               fl_set_input(fd_form_preamble->input_preamble,
-                            bv->buffer()->params.preamble.c_str());
-
-               if (bv->buffer()->isReadonly()) {
-                       fl_deactivate_object(fd_form_preamble->input_preamble);
-                       fl_deactivate_object(fd_form_preamble->button_ok);
-                       fl_deactivate_object(fd_form_preamble->button_apply);
-                       fl_set_object_lcol(fd_form_preamble->button_ok, FL_INACTIVE);
-                       fl_set_object_lcol(fd_form_preamble->button_apply, FL_INACTIVE);
-               } else {
-                       fl_activate_object(fd_form_preamble->input_preamble);
-                       fl_activate_object(fd_form_preamble->button_ok);
-                       fl_activate_object(fd_form_preamble->button_apply);
-                       fl_set_object_lcol(fd_form_preamble->button_ok, FL_BLACK);
-                       fl_set_object_lcol(fd_form_preamble->button_apply, FL_BLACK);
-               }
-       } else if (fd_form_preamble->form_preamble->visible) {
-               fl_hide_form(fd_form_preamble->form_preamble);
-       }
-       return update;
-}
-
-
-void MenuLayoutPreamble()
-{
-       static int ow = -1, oh;
-
-       if (UpdateLayoutPreamble(current_view)) {
-               if (fd_form_preamble->form_preamble->visible) {
-                       fl_raise_form(fd_form_preamble->form_preamble);
-               } else {
-                       fl_show_form(fd_form_preamble->form_preamble,
-                                    FL_PLACE_MOUSE | FL_FREE_SIZE,
-                                    FL_TRANSIENT,
-                                    _("LaTeX Preamble"));
-                       if (ow < 0) {
-                               ow = fd_form_preamble->form_preamble->w;
-                               oh = fd_form_preamble->form_preamble->h;
-                       }
-                       fl_set_form_minsize(fd_form_preamble->form_preamble,
-                                           ow, oh);
-               }
-       }
-}
-
 
 void MenuLayoutSave(BufferView * bv)
 {
@@ -815,35 +732,6 @@ void CharacterOKCB(FL_OBJECT * ob, long data)
 }
 
 
-/* callbacks for form form_preamble */
-
-extern "C"
-void PreambleCancelCB(FL_OBJECT *, long)
-{
-       fl_hide_form(fd_form_preamble->form_preamble);
-}
-
-
-extern "C"
-void PreambleApplyCB(FL_OBJECT *, long)
-{
-       if (!current_view->available())
-               return;
-       
-       current_view->buffer()->params.preamble = 
-               fl_get_input(fd_form_preamble->input_preamble);
-       current_view->buffer()->markDirty();
-       current_view->owner()->getMiniBuffer()->Set(_("LaTeX preamble set"));
-}
-
-   
-extern "C"
-void PreambleOKCB(FL_OBJECT * ob, long data)
-{
-       PreambleApplyCB(ob, data);
-       PreambleCancelCB(ob, data);
-}
-
 
 void Figure()
 {
@@ -879,7 +767,7 @@ void FigureApplyCB(FL_OBJECT *, long)
        
        current_view->hideCursor();
        current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR);
-       current_view->beforeChange();
+       current_view->beforeChange(current_view->text);
       
        current_view->text->SetCursorParUndo(current_view->buffer()); 
        current_view->text->FreezeUndo();