#include "insets/insetref.h"
#include "insets/insettabular.h"
#include "tabular.h"
+#include "exporter.h"
#include "frontends/Dialogs.h"
using std::vector;
+using std::pair;
using std::endl;
using std::max;
using std::min;
using std::sort;
-extern FD_form_screen * fd_form_screen;
extern BufferList bufferlist;
// I would really prefere to see most or all of these 'extern's disappear.
}
-void Menus::ScreenOptions()
-{
- static int ow = -1, oh;
-
- // this is not very nice....
- fl_set_input(fd_form_screen->input_roman,
- lyxrc.roman_font_name.c_str());
- fl_set_input(fd_form_screen->input_sans,
- lyxrc.sans_font_name.c_str());
- fl_set_input(fd_form_screen->input_typewriter,
- lyxrc.typewriter_font_name.c_str());
- fl_set_input(fd_form_screen->input_font_norm,
- lyxrc.font_norm.c_str());
- char tmpstring[10];
- sprintf(tmpstring, "%d", lyxrc.zoom);
- fl_set_input(fd_form_screen->intinput_size, tmpstring);
- if (fd_form_screen->form_screen->visible) {
- fl_raise_form(fd_form_screen->form_screen);
- } else {
- fl_show_form(fd_form_screen->form_screen,
- FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
- _("Screen Options"));
- if (ow < 0) {
- ow = fd_form_screen->form_screen->w;
- oh = fd_form_screen->form_screen->h;
- }
- fl_set_form_minsize(fd_form_screen->form_screen, ow, oh);
- }
-}
-
-
//
// Here comes all the menu callbacks.
//
fl_setpup_shortcut(SubFileImport, 34, scex(_("FIM|Dd#d#D")));
// Export sub-menu
-
+#ifdef NEW_EXPORT
+ int SubFileExport = fl_defpup(FL_ObjWin(ob),
+ _("Export%t"));
+ vector<pair<string,string> > formats =
+ Exporter::GetExportableFormats(tmpbuffer);
+ for (vector<pair<string,string> >::size_type i = 0;
+ i < formats.size(); ++i) {
+ string entry = _("as ")
+ + formats[i].second
+ + "%x" + tostr(1000+i);
+ fl_addtopup(SubFileExport, entry.c_str());
+ }
+#else
// remember to make this handle linuxdoc too.
// and now docbook also.
+
int SubFileExport = 0;
if (!LinuxDoc && !DocBook)
SubFileExport= fl_defpup(FL_ObjWin(ob),
"|as PostScript...%x42"
"|as Ascii Text...%x43"
"|as HTML...%x44"));
-
fl_setpup_shortcut(SubFileExport, 40, scex(_("FEX|Ll#l#L")));
fl_setpup_shortcut(SubFileExport, 41, scex(_("FEX|Dd#d#D")));
fl_setpup_shortcut(SubFileExport, 42, scex(_("FEX|Pp#p#P")));
if (!LinuxDoc && !DocBook) {
fl_setpup_shortcut(SubFileExport, 45, scex(_("FEX|mM#m#M")));
}
+#endif
int FileMenu = fl_defpup(FL_ObjWin(ob),
_("New..."
if ( lyxrc.linuxdoc_to_lyx_command == "none")
fl_setpup_mode(SubFileImport, 34, FL_PUP_GREY);
+#ifndef NEW_EXPORT
if (!hasLaTeX) {
// Disable export dvi and export postscript
fl_setpup_mode(SubFileExport, 41, FL_PUP_GREY);
// Disable export HTML
fl_setpup_mode(SubFileExport, 44, FL_PUP_GREY);
}
+#endif
// xgettext:no-c-format
fl_addtopup(FileMenu, _("|Import%m"), SubFileImport);
case 5: tmpfunc->Dispatch(LFUN_MENUWRITE); break;
case 6: tmpfunc->Dispatch(LFUN_MENUWRITEAS); break;
case 7: tmpfunc->Dispatch(LFUN_MENURELOAD); break;
+#ifdef NEW_EXPORT
+ case 8: tmpfunc->Dispatch(LFUN_PREVIEW, "dvi"); break;
+ case 9: tmpfunc->Dispatch(LFUN_PREVIEW, "ps"); break;
+ case 10: tmpfunc->Dispatch(LFUN_UPDATE, "dvi"); break;
+ case 11: tmpfunc->Dispatch(LFUN_UPDATE, "ps"); break;
+#else
case 8: tmpfunc->Dispatch(LFUN_PREVIEW); break;
case 9: tmpfunc->Dispatch(LFUN_PREVIEWPS); break;
case 10: tmpfunc->Dispatch(LFUN_RUNLATEX); break;
case 11: tmpfunc->Dispatch(LFUN_RUNDVIPS); break;
+#endif
case 12: tmpfunc->Dispatch(LFUN_BUILDPROG); break;
case 13: tmpfunc->Dispatch(LFUN_MENUPRINT); break;
case 14: tmpfunc->Dispatch(LFUN_FAX); break;
break;
case 34: tmpfunc->Dispatch(LFUN_IMPORT, "linuxdoc");
break;
+#ifdef NEW_EXPORT
+ case 18:
+ tmpfunc->Dispatch(LFUN_QUIT);
+ break;
+ default:
+ if (choice >= 1000)
+ tmpfunc->Dispatch(LFUN_EXPORT,
+ formats[choice-1000].first.c_str());
+ else
+ men->currentView()
+ ->buffer(bufferlist
+ .loadLyXFile((*lastfiles)[choice - 18]));
+ break;
+#else
case 16: // export menu
case 40:
if (!LinuxDoc && !DocBook)
->buffer(bufferlist
.loadLyXFile((*lastfiles)[choice - 18]));
break;
+#endif
}
fl_freepup(SubFileImport);
fl_freepup(SubFileExport);
case 26: men->currentView()->allFloats(0, 1); break;
case 27: tmpfunc->Dispatch(LFUN_REMOVEERRORS); break;
#endif
- case 31: tmpfunc->Dispatch(LFUN_TABLE); break;
+ case 31: tmpfunc->Dispatch(LFUN_DIALOG_TABULAR_INSERT); break;
// this is really temporary. We need new function in keybind.C
// These should set the minibuffer, too.
case 32: case 33: case 34:
men->currentView()->hideCursor();
switch (choice) {
case 1: tmpfunc->Dispatch(LFUN_FIGURE); break;
- case 2: tmpfunc->Dispatch(LFUN_TABLE); break;
+ case 2: tmpfunc->Dispatch(LFUN_DIALOG_TABULAR_INSERT); break;
case 3: tmpfunc->Dispatch(LFUN_CHILDINSERT); break;
case 4: // Insert ASCII file submenu
break;
case 12: tmpfunc->Dispatch(LFUN_INSERT_NOTE); break;
case 13: tmpfunc->Dispatch(LFUN_INSERT_LABEL); break;
- case 14: tmpfunc->Dispatch(LFUN_REF_CREATE); break;
+ case 14: tmpfunc->Dispatch(LFUN_REF_INSERT); break;
case 15: tmpfunc->Dispatch(LFUN_CITATION_CREATE); break;
case 16: tmpfunc->Dispatch(LFUN_INDEX_CREATE); break;
case 17: tmpfunc->Dispatch(LFUN_INDEX_INSERT_LAST); break;
LyXFunc * tmpfunc = men->_view->getLyXFunc();
int OptionsMenu = fl_defpup(FL_ObjWin(ob),
- _("Screen Fonts..."
- "|Spellchecker Options..."
+ _("|Spellchecker Options..."
"|Keyboard...%l"
"|Reconfigure"
"|Preferences"));
- fl_setpup_shortcut(OptionsMenu, 1, scex(_("OM|Ff#f#F")));
- fl_setpup_shortcut(OptionsMenu, 2, scex(_("OM|Ss#s#S")));
- fl_setpup_shortcut(OptionsMenu, 3, scex(_("OM|Kk#k#K")));
- fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Rr#r#R")));
- fl_setpup_shortcut(OptionsMenu, 5, scex(_("OM|Pp#p#P")));
+ fl_setpup_shortcut(OptionsMenu, 1, scex(_("OM|Ss#s#S")));
+ fl_setpup_shortcut(OptionsMenu, 2, scex(_("OM|Kk#k#K")));
+ fl_setpup_shortcut(OptionsMenu, 3, scex(_("OM|Rr#r#R")));
+ fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Pp#p#P")));
if(lyxrc.isp_command == "none")
fl_setpup_mode(OptionsMenu, 2, FL_PUP_GREY);
fl_set_object_boxtype(ob, FL_FLAT_BOX);
fl_redraw_object(ob);
switch (choice){
- case 1: men->ScreenOptions(); break;
- case 2: SpellCheckerOptions(); break;
- case 3: men->_view->getIntl()->MenuKeymap(); break;
- case 4: tmpfunc->Dispatch(LFUN_RECONFIGURE); break;
- case 5: men->_view->getDialogs()->showPreferences(); break;
+ case 1: SpellCheckerOptions(); break;
+ case 2: men->_view->getIntl()->MenuKeymap(); break;
+ case 3: tmpfunc->Dispatch(LFUN_RECONFIGURE); break;
+ case 4: men->_view->getDialogs()->showPreferences(); break;
default: break;
}
fl_freepup(OptionsMenu);