mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
floatlist work + handle lyxfuncs with args.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1984 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
407dc56e97
commit
52153a589b
@ -1,3 +1,7 @@
|
||||
2001-05-04 Lars Gullik Bjřnnes <larsbj@birdstep.com>
|
||||
|
||||
* ui/default.ui: add FloatInsert and FloatListInsert
|
||||
|
||||
2001-04-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* examples/eu_splash.lyx: update from Dooteo
|
||||
|
@ -201,19 +201,12 @@ Menuset
|
||||
End
|
||||
|
||||
Menu "insert_floats"
|
||||
Item "Figure|F" "float-insert figure"
|
||||
Item "Table|T" "float-insert table"
|
||||
Item "Wide Figure|W" "float-insert wide-fig"
|
||||
Item "Wide Table|d" "float-insert wide-tab"
|
||||
Separator
|
||||
Item "Algorithm|A" "float-insert algorithm"
|
||||
FloatInsert
|
||||
End
|
||||
|
||||
Menu "insert_toc"
|
||||
Item "Table of Contents|C" "toc-insert"
|
||||
Item "List of Figures|F" "lof-insert"
|
||||
Item "List of Tables|T" "lot-insert"
|
||||
Item "List of Algorithms|A" "loa-insert"
|
||||
FloatListInsert
|
||||
Item "Index List|I" "index-print"
|
||||
Item "BibTeX Reference...|B" "bibtex-insert"
|
||||
End
|
||||
|
@ -10,8 +10,8 @@ src/CutAndPaste.C
|
||||
src/debug.C
|
||||
src/exporter.C
|
||||
src/ext_l10n.h
|
||||
src/figureForm.C
|
||||
src/figure_form.C
|
||||
src/figureForm.C
|
||||
src/FontLoader.C
|
||||
src/frontends/controllers/ButtonController.h
|
||||
src/frontends/controllers/character.C
|
||||
@ -90,67 +90,67 @@ src/frontends/qt2/paragraphdlgimpl.C
|
||||
src/frontends/qt2/tabularcreatedlgimpl.C
|
||||
src/frontends/xforms/combox.C
|
||||
src/frontends/xforms/FileDialog.C
|
||||
src/frontends/xforms/FormBibitem.C
|
||||
src/frontends/xforms/form_bibitem.C
|
||||
src/frontends/xforms/FormBibtex.C
|
||||
src/frontends/xforms/FormBibitem.C
|
||||
src/frontends/xforms/form_bibtex.C
|
||||
src/frontends/xforms/FormBibtex.C
|
||||
src/frontends/xforms/form_browser.C
|
||||
src/frontends/xforms/FormCharacter.C
|
||||
src/frontends/xforms/form_character.C
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/FormCharacter.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/FormCopyright.C
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/form_copyright.C
|
||||
src/frontends/xforms/FormCredits.C
|
||||
src/frontends/xforms/FormCopyright.C
|
||||
src/frontends/xforms/form_credits.C
|
||||
src/frontends/xforms/FormDocument.C
|
||||
src/frontends/xforms/FormCredits.C
|
||||
src/frontends/xforms/form_document.C
|
||||
src/frontends/xforms/FormError.C
|
||||
src/frontends/xforms/FormDocument.C
|
||||
src/frontends/xforms/form_error.C
|
||||
src/frontends/xforms/FormExternal.C
|
||||
src/frontends/xforms/FormError.C
|
||||
src/frontends/xforms/form_external.C
|
||||
src/frontends/xforms/FormFiledialog.C
|
||||
src/frontends/xforms/FormExternal.C
|
||||
src/frontends/xforms/form_filedialog.C
|
||||
src/frontends/xforms/FormGraphics.C
|
||||
src/frontends/xforms/FormFiledialog.C
|
||||
src/frontends/xforms/form_graphics.C
|
||||
src/frontends/xforms/FormInclude.C
|
||||
src/frontends/xforms/FormGraphics.C
|
||||
src/frontends/xforms/form_include.C
|
||||
src/frontends/xforms/FormIndex.C
|
||||
src/frontends/xforms/FormInclude.C
|
||||
src/frontends/xforms/form_index.C
|
||||
src/frontends/xforms/FormIndex.C
|
||||
src/frontends/xforms/FormLog.C
|
||||
src/frontends/xforms/FormMathsBitmap.C
|
||||
src/frontends/xforms/FormMathsDeco.C
|
||||
src/frontends/xforms/form_maths_deco.C
|
||||
src/frontends/xforms/FormMathsDelim.C
|
||||
src/frontends/xforms/FormMathsDeco.C
|
||||
src/frontends/xforms/form_maths_delim.C
|
||||
src/frontends/xforms/FormMathsMatrix.C
|
||||
src/frontends/xforms/FormMathsDelim.C
|
||||
src/frontends/xforms/form_maths_matrix.C
|
||||
src/frontends/xforms/FormMathsPanel.C
|
||||
src/frontends/xforms/FormMathsMatrix.C
|
||||
src/frontends/xforms/form_maths_panel.C
|
||||
src/frontends/xforms/FormMathsSpace.C
|
||||
src/frontends/xforms/FormMathsPanel.C
|
||||
src/frontends/xforms/form_maths_space.C
|
||||
src/frontends/xforms/FormMinipage.C
|
||||
src/frontends/xforms/FormMathsSpace.C
|
||||
src/frontends/xforms/form_minipage.C
|
||||
src/frontends/xforms/FormParagraph.C
|
||||
src/frontends/xforms/FormMinipage.C
|
||||
src/frontends/xforms/form_paragraph.C
|
||||
src/frontends/xforms/FormPreamble.C
|
||||
src/frontends/xforms/FormParagraph.C
|
||||
src/frontends/xforms/form_preamble.C
|
||||
src/frontends/xforms/FormPreferences.C
|
||||
src/frontends/xforms/FormPreamble.C
|
||||
src/frontends/xforms/form_preferences.C
|
||||
src/frontends/xforms/FormPrint.C
|
||||
src/frontends/xforms/FormPreferences.C
|
||||
src/frontends/xforms/form_print.C
|
||||
src/frontends/xforms/FormRef.C
|
||||
src/frontends/xforms/FormPrint.C
|
||||
src/frontends/xforms/form_ref.C
|
||||
src/frontends/xforms/FormSearch.C
|
||||
src/frontends/xforms/FormRef.C
|
||||
src/frontends/xforms/form_search.C
|
||||
src/frontends/xforms/FormTabular.C
|
||||
src/frontends/xforms/FormSearch.C
|
||||
src/frontends/xforms/form_tabular.C
|
||||
src/frontends/xforms/FormTabularCreate.C
|
||||
src/frontends/xforms/FormTabular.C
|
||||
src/frontends/xforms/form_tabular_create.C
|
||||
src/frontends/xforms/FormToc.C
|
||||
src/frontends/xforms/FormTabularCreate.C
|
||||
src/frontends/xforms/form_toc.C
|
||||
src/frontends/xforms/FormUrl.C
|
||||
src/frontends/xforms/FormToc.C
|
||||
src/frontends/xforms/form_url.C
|
||||
src/frontends/xforms/FormUrl.C
|
||||
src/frontends/xforms/FormVCLog.C
|
||||
src/frontends/xforms/input_validators.C
|
||||
src/frontends/xforms/Menubar_pimpl.C
|
||||
@ -166,6 +166,7 @@ src/insets/inseterror.C
|
||||
src/insets/insetert.C
|
||||
src/insets/insetexternal.C
|
||||
src/insets/insetfloat.C
|
||||
src/insets/insetfloatlist.C
|
||||
src/insets/insetfoot.C
|
||||
src/insets/insetgraphics.C
|
||||
src/insets/insetinclude.C
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "insets/insettabular.h"
|
||||
#include "insets/insettheorem.h"
|
||||
#include "insets/insetcaption.h"
|
||||
#include "insets/insetfloatlist.h"
|
||||
#include "mathed/formulamacro.h"
|
||||
#include "gettext.h"
|
||||
|
||||
@ -1428,21 +1429,9 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
break;
|
||||
|
||||
case LFUN_TOC_INSERT:
|
||||
case LFUN_LOA_INSERT:
|
||||
case LFUN_LOF_INSERT:
|
||||
case LFUN_LOT_INSERT:
|
||||
{
|
||||
InsetCommandParams p;
|
||||
|
||||
if (action == LFUN_TOC_INSERT )
|
||||
p.setCmdName("tableofcontents");
|
||||
else if (action == LFUN_LOA_INSERT )
|
||||
p.setCmdName("listof{algorithm}{List of Algorithms}");
|
||||
else if (action == LFUN_LOF_INSERT )
|
||||
p.setCmdName("listoffigures");
|
||||
else
|
||||
p.setCmdName("listoftables");
|
||||
|
||||
Inset * inset = new InsetTOC(p);
|
||||
if (!bv_->insertInset(inset, "Standard", true))
|
||||
delete inset;
|
||||
@ -2868,6 +2857,15 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_FLOAT_LIST:
|
||||
{
|
||||
// We should check the argument for validity. (Lgb)
|
||||
Inset * inset = new InsetFloatList(argument);
|
||||
if (!bv_->insertInset(inset, "Standard", true))
|
||||
delete inset;
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_INSERT_NOTE:
|
||||
bv_->insertNote();
|
||||
break;
|
||||
|
@ -1,3 +1,34 @@
|
||||
2001-05-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* minibuffer.C (peek_event): temporarily reduce the functionality
|
||||
of the minibuffer (to allow args on lfuns)
|
||||
|
||||
* commandtags.h: remove LFUN_LOA_INSERT, LFUN_LOF_INSERT,
|
||||
LFUN_LOT_INSERT. add LFUN_FLOAT_LIST
|
||||
|
||||
* buffer.C (readInset): add compability reading of old float
|
||||
lists, add reading of new style float list.
|
||||
(readInset): avoid reevaluation of inscmd.getCmdName()
|
||||
(getLists): reindent
|
||||
|
||||
* MenuBackend.C (MenuItem): implement parsing of
|
||||
md_floatlistinsert and md_floatinsert.
|
||||
(expand::LastFiles): move initalizaton of iterators out of loop,
|
||||
avoid reevaluation.
|
||||
(expand::Documents): introduce typdedef vector<string> Strings,
|
||||
and use it.
|
||||
(expand::ExportFormats): introduce typedef vector<Format const *>
|
||||
Formats, and use it.
|
||||
(expand): implement FloatListInsert and FloatInsert.
|
||||
|
||||
* LyXAction.C (init): remove entries for LFUN_LOA_INSERT,
|
||||
LFUN_LOA_VIEW, LFUN_LOF_INSERT, LFUN_LOFVIEW, LFUN_LOT_INSERT,
|
||||
LFUN_LOTVIEW. Add entry for LFUN_FLOAT_LIST
|
||||
|
||||
* BufferView_pimpl.C (Dispatch::LFUN_TOC_INSERT): remvoe the float
|
||||
handling.
|
||||
(Dispatch::LFUN_FLOAT_LIST): implement
|
||||
|
||||
2001-04-28 Kayvan A. Sylvan <kayvan@sylvan.com>
|
||||
|
||||
* LaTeX.C (run): Fix problem with --export code.
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1998-2000 The LyX Team.
|
||||
* Copyright 1998-2001 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1998-2000 The LyX Team.
|
||||
* Copyright 1998-2001 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
@ -272,18 +272,6 @@ void LyXAction::init()
|
||||
{ LFUN_ENDSEL, "line-end-select",
|
||||
N_("Select to end of line"), ReadOnly },
|
||||
{ LFUN_INSET_LIST, "list-insert", "", Noop },
|
||||
{ LFUN_LOA_INSERT, "loa-insert",
|
||||
N_("Insert list of algorithms"), Noop },
|
||||
{ LFUN_LOAVIEW, "loa-view",
|
||||
N_("View list of algorithms"), ReadOnly },
|
||||
{ LFUN_LOF_INSERT, "lof-insert",
|
||||
N_("Insert list of figures"), Noop },
|
||||
{ LFUN_LOFVIEW, "lof-view",
|
||||
N_("View list of figures"), ReadOnly },
|
||||
{ LFUN_LOT_INSERT, "lot-insert",
|
||||
N_("Insert list of tables"), Noop },
|
||||
{ LFUN_LOTVIEW, "lot-view",
|
||||
N_("View list of tables"), ReadOnly },
|
||||
{ LFUN_QUIT, "lyx-quit", N_("Exit"), NoBuffer },
|
||||
{ LFUN_INSET_MARGINAL, "marginalnote-insert",
|
||||
N_("Insert Marginalnote"), Noop },
|
||||
@ -418,6 +406,7 @@ void LyXAction::init()
|
||||
N_("Pop old message and show it in the minibuffer"),
|
||||
NoBuffer },
|
||||
{ LFUN_TRANSPOSE_CHARS, "chars-transpose", "", Noop },
|
||||
{ LFUN_FLOAT_LIST, "float-list", "Insert a float list", Noop },
|
||||
{ LFUN_NOACTION, "", "", Noop }
|
||||
};
|
||||
|
||||
|
@ -4,18 +4,17 @@
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2000 The LyX Team.
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include <memory>
|
||||
#include "support/LAssert.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "lyxlex.h"
|
||||
#include "LyXAction.h"
|
||||
@ -26,6 +25,8 @@
|
||||
#include "converter.h"
|
||||
#include "exporter.h"
|
||||
#include "importer.h"
|
||||
#include "FloatList.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/lyxfunctional.h"
|
||||
|
||||
@ -56,6 +57,8 @@ MenuItem::MenuItem(Kind kind, string const & label,
|
||||
case UpdateFormats:
|
||||
case ExportFormats:
|
||||
case ImportFormats:
|
||||
case FloatListInsert:
|
||||
case FloatInsert:
|
||||
break;
|
||||
case Command:
|
||||
action_ = lyxaction.LookupFunc(command);
|
||||
@ -97,6 +100,8 @@ Menu & Menu::read(LyXLex & lex)
|
||||
md_toc,
|
||||
md_updateformats,
|
||||
md_viewformats,
|
||||
md_floatlistinsert,
|
||||
md_floatinsert,
|
||||
md_last
|
||||
};
|
||||
|
||||
@ -104,6 +109,8 @@ Menu & Menu::read(LyXLex & lex)
|
||||
{ "documents", md_documents },
|
||||
{ "end", md_endmenu },
|
||||
{ "exportformats", md_exportformats },
|
||||
{ "floatinsert", md_floatinsert },
|
||||
{ "floatlistinsert", md_floatlistinsert },
|
||||
{ "importformats", md_importformats },
|
||||
{ "item", md_item },
|
||||
{ "lastfiles", md_lastfiles },
|
||||
@ -129,7 +136,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
// fallback to md_item
|
||||
case md_item: {
|
||||
lex.next();
|
||||
string name = _(lex.GetString());
|
||||
string const name = _(lex.GetString());
|
||||
lex.next();
|
||||
string const command = lex.GetString();
|
||||
add(MenuItem(MenuItem::Command, name,
|
||||
@ -170,6 +177,14 @@ Menu & Menu::read(LyXLex & lex)
|
||||
add(MenuItem(MenuItem::ImportFormats));
|
||||
break;
|
||||
|
||||
case md_floatlistinsert:
|
||||
add(MenuItem(MenuItem::FloatListInsert));
|
||||
break;
|
||||
|
||||
case md_floatinsert:
|
||||
add(MenuItem(MenuItem::FloatInsert));
|
||||
break;
|
||||
|
||||
case md_submenu: {
|
||||
lex.next();
|
||||
string mlabel = _(lex.GetString());
|
||||
@ -239,9 +254,10 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
switch ((*cit).kind()) {
|
||||
case MenuItem::Lastfiles: {
|
||||
int ii = 1;
|
||||
for (LastFiles::const_iterator lfit = lastfiles->begin();
|
||||
lfit != lastfiles->end() && ii < 10;
|
||||
++lfit, ++ii) {
|
||||
LastFiles::const_iterator lfit = lastfiles->begin();
|
||||
LastFiles::const_iterator end = lastfiles->end();
|
||||
|
||||
for (; lfit != end && ii < 10; ++lfit, ++ii) {
|
||||
string const label = tostr(ii) + ". "
|
||||
+ MakeDisplayPath((*lfit), 30)
|
||||
+ '|' + tostr(ii);
|
||||
@ -255,7 +271,9 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
break;
|
||||
|
||||
case MenuItem::Documents: {
|
||||
vector<string> const names = bufferlist.getFileNames();
|
||||
typedef vector<string> Strings;
|
||||
|
||||
Strings const names = bufferlist.getFileNames();
|
||||
|
||||
if (names.empty()) {
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
@ -264,10 +282,12 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
break;
|
||||
}
|
||||
|
||||
for (vector<string>::const_iterator docit = names.begin();
|
||||
docit != names.end() ; ++docit) {
|
||||
int const action =
|
||||
lyxaction.getPseudoAction(LFUN_SWITCHBUFFER, *docit);
|
||||
Strings::const_iterator docit = names.begin();
|
||||
Strings::const_iterator end = names.end();
|
||||
for (; docit != end ; ++docit) {
|
||||
int const action = lyxaction
|
||||
.getPseudoAction(LFUN_SWITCHBUFFER,
|
||||
*docit);
|
||||
string const label =
|
||||
MakeDisplayPath(*docit, 30);
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
@ -280,7 +300,10 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
case MenuItem::ViewFormats:
|
||||
case MenuItem::UpdateFormats:
|
||||
case MenuItem::ExportFormats: {
|
||||
vector<Format const *> formats;
|
||||
typedef vector<Format const *> Formats;
|
||||
|
||||
Formats formats;
|
||||
|
||||
kb_action action;
|
||||
switch ((*cit).kind()) {
|
||||
case MenuItem::ImportFormats:
|
||||
@ -301,8 +324,10 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
}
|
||||
sort(formats.begin(), formats.end(), compare_format());
|
||||
|
||||
for (vector<Format const *>::const_iterator fit = formats.begin();
|
||||
fit != formats.end() ; ++fit) {
|
||||
Formats::const_iterator fit = formats.begin();
|
||||
Formats::const_iterator end = formats.end();
|
||||
|
||||
for (; fit != end ; ++fit) {
|
||||
if ((*fit)->dummy())
|
||||
continue;
|
||||
string label = (*fit)->prettyname();
|
||||
@ -314,13 +339,45 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
if (!(*fit)->shortcut().empty())
|
||||
label += "|" + (*fit)->shortcut();
|
||||
int const action2 = lyxaction.
|
||||
getPseudoAction(action, (*fit)->name());
|
||||
getPseudoAction(action,
|
||||
(*fit)->name());
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
label, action2));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MenuItem::FloatListInsert:
|
||||
{
|
||||
FloatList::const_iterator cit = floatList.begin();
|
||||
FloatList::const_iterator end = floatList.end();
|
||||
for (; cit != end; ++cit) {
|
||||
int const action = lyxaction
|
||||
.getPseudoAction(LFUN_FLOAT_LIST,
|
||||
cit->second.type());
|
||||
string label = "List of ";
|
||||
label += cit->second.name();
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
label, action));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MenuItem::FloatInsert:
|
||||
{
|
||||
FloatList::const_iterator cit = floatList.begin();
|
||||
FloatList::const_iterator end = floatList.end();
|
||||
for (; cit != end; ++cit) {
|
||||
int const action = lyxaction
|
||||
.getPseudoAction(LFUN_INSET_FLOAT,
|
||||
cit->second.type());
|
||||
string const label = cit->second.name();
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
label, action));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
tomenu.add(*cit);
|
||||
}
|
||||
@ -331,6 +388,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
checkShortcuts();
|
||||
}
|
||||
|
||||
|
||||
bool Menu::hasSubmenu(string const & name) const
|
||||
{
|
||||
return find_if(begin(), end(),
|
||||
|
@ -55,7 +55,13 @@ public:
|
||||
ExportFormats,
|
||||
/** This is a list of importable formats
|
||||
typically for the File->Export menu. */
|
||||
ImportFormats
|
||||
ImportFormats,
|
||||
/** This is the list of floats that we can
|
||||
insert a list for. */
|
||||
FloatListInsert,
|
||||
/** This is the list of floats that we can
|
||||
insert. */
|
||||
FloatInsert
|
||||
};
|
||||
/// Create a Command type MenuItem
|
||||
MenuItem(Kind kind,
|
||||
|
@ -70,9 +70,6 @@ void ToolbarDefaults::init()
|
||||
|
||||
add(LFUN_FIGURE);
|
||||
add(LFUN_DIALOG_TABULAR_INSERT);
|
||||
#if 0
|
||||
//add(LFUN_MELT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
47
src/buffer.C
47
src/buffer.C
@ -77,6 +77,7 @@
|
||||
#include "insets/insettabular.h"
|
||||
#include "insets/insettheorem.h"
|
||||
#include "insets/insetcaption.h"
|
||||
#include "insets/insetfloatlist.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/path.h"
|
||||
#include "LaTeX.h"
|
||||
@ -1181,40 +1182,44 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
|
||||
InsetCommandParams inscmd;
|
||||
inscmd.Read(lex);
|
||||
|
||||
if (inscmd.getCmdName() == "cite") {
|
||||
string const cmdName = inscmd.getCmdName();
|
||||
|
||||
if (cmdName == "cite") {
|
||||
inset = new InsetCitation(inscmd);
|
||||
} else if (inscmd.getCmdName() == "bibitem") {
|
||||
} else if (cmdName == "bibitem") {
|
||||
lex.printError("Wrong place for bibitem");
|
||||
inset = new InsetBibKey(inscmd);
|
||||
} else if (inscmd.getCmdName() == "BibTeX") {
|
||||
} else if (cmdName == "BibTeX") {
|
||||
inset = new InsetBibtex(inscmd);
|
||||
} else if (inscmd.getCmdName() == "index") {
|
||||
} else if (cmdName == "index") {
|
||||
inset = new InsetIndex(inscmd);
|
||||
} else if (inscmd.getCmdName() == "include") {
|
||||
} else if (cmdName == "include") {
|
||||
inset = new InsetInclude(inscmd, *this);
|
||||
} else if (inscmd.getCmdName() == "label") {
|
||||
} else if (cmdName == "label") {
|
||||
inset = new InsetLabel(inscmd);
|
||||
} else if (inscmd.getCmdName() == "url"
|
||||
|| inscmd.getCmdName() == "htmlurl") {
|
||||
} else if (cmdName == "url"
|
||||
|| cmdName == "htmlurl") {
|
||||
inset = new InsetUrl(inscmd);
|
||||
} else if (inscmd.getCmdName() == "ref"
|
||||
|| inscmd.getCmdName() == "pageref"
|
||||
|| inscmd.getCmdName() == "vref"
|
||||
|| inscmd.getCmdName() == "vpageref"
|
||||
|| inscmd.getCmdName() == "prettyref") {
|
||||
} else if (cmdName == "ref"
|
||||
|| cmdName == "pageref"
|
||||
|| cmdName == "vref"
|
||||
|| cmdName == "vpageref"
|
||||
|| cmdName == "prettyref") {
|
||||
if (!inscmd.getOptions().empty()
|
||||
|| !inscmd.getContents().empty()) {
|
||||
inset = new InsetRef(inscmd, *this);
|
||||
}
|
||||
} else if (inscmd.getCmdName() == "tableofcontents"
|
||||
|| inscmd.getCmdName() == "listofalgorithms"
|
||||
|| inscmd.getCmdName() == "listoffigures"
|
||||
|| inscmd.getCmdName() == "listoftables"
|
||||
|| inscmd.getCmdName() == "listof{algorithm}{List of Algorithms}") {
|
||||
} else if (cmdName == "tableofcontents") {
|
||||
inset = new InsetTOC(inscmd);
|
||||
} else if (inscmd.getCmdName() == "printindex") {
|
||||
} else if (cmdName == "listofalgorithms") {
|
||||
inset = new InsetFloatList("algorithm");
|
||||
} else if (cmdName == "listoffigures") {
|
||||
inset = new InsetFloatList("figure");
|
||||
} else if (cmdName == "listoftables") {
|
||||
inset = new InsetFloatList("table");
|
||||
} else if (cmdName == "printindex") {
|
||||
inset = new InsetPrintIndex(inscmd);
|
||||
} else if (inscmd.getCmdName() == "lyxparent") {
|
||||
} else if (cmdName == "lyxparent") {
|
||||
inset = new InsetParent(inscmd, *this);
|
||||
}
|
||||
} else {
|
||||
@ -1257,6 +1262,8 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
|
||||
inset = new InsetCaption;
|
||||
} else if (tmptok == "GRAPHICS") {
|
||||
inset = new InsetGraphics;
|
||||
} else if (tmptok == "FloatList") {
|
||||
inset = new InsetFloatList;
|
||||
}
|
||||
|
||||
if (inset) inset->Read(this, lex);
|
||||
|
@ -144,9 +144,6 @@ enum kb_action {
|
||||
LFUN_MATH_EXTERN, // Andre' 20010424
|
||||
LFUN_MATH_PANEL,
|
||||
LFUN_FIGURE,
|
||||
#if 0
|
||||
LFUN_MELT,
|
||||
#endif
|
||||
LFUN_DELETE_WORD_FORWARD,
|
||||
LFUN_DELETE_WORD_BACKWARD,
|
||||
LFUN_DELETE_LINE_FORWARD,
|
||||
@ -208,9 +205,7 @@ enum kb_action {
|
||||
LFUN_CHILD_INSERT, // Ale 970521
|
||||
LFUN_CHILDOPEN, // Ale 970528
|
||||
LFUN_TOC_INSERT, // Lgb 97-05-27
|
||||
LFUN_LOA_INSERT, // Bernhard 97-08-07
|
||||
LFUN_LOF_INSERT, // Lgb 97-05-27
|
||||
LFUN_LOT_INSERT, // Lgb 97-05-27
|
||||
LFUN_FLOAT_LIST, // Lgb 20010503
|
||||
LFUN_READ_ONLY_TOGGLE, // Lgb 97-05-27
|
||||
LFUN_BIBDB_ADD, // Ale 970530
|
||||
LFUN_BIBDB_DEL, // Ale 970530
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-05-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* ControlToc.C (getType): remove support for old float list.
|
||||
|
||||
2001-04-26 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* ControlButtons.h: no longer include ButtonControllerBase.h, ViewBase.h
|
||||
|
@ -92,7 +92,7 @@ Buffer::SingleList const ControlToc::getContents(string const & type) const
|
||||
namespace toc
|
||||
{
|
||||
|
||||
string getType(string const & cmdName)
|
||||
string const getType(string const & cmdName)
|
||||
{
|
||||
string type;
|
||||
|
||||
@ -101,16 +101,7 @@ string getType(string const & cmdName)
|
||||
if (cmdName == "tableofcontents" )
|
||||
type = "TOC";
|
||||
|
||||
else if (cmdName == "listofalgorithms" )
|
||||
type = "algorithm";
|
||||
|
||||
else if (cmdName == "listoffigures" )
|
||||
type = "figure";
|
||||
|
||||
else
|
||||
type = "table";
|
||||
|
||||
return type;
|
||||
return cmdName;
|
||||
}
|
||||
|
||||
} // namespace toc
|
||||
|
@ -1,3 +1,4 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
@ -43,7 +44,7 @@ namespace toc
|
||||
{
|
||||
/** Given the cmdName of the TOC param, returns the type used
|
||||
by ControlToc::getContents() */
|
||||
string getType(string const & cmdName);
|
||||
string const getType(string const & cmdName);
|
||||
|
||||
} // namespace toc
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-05-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* Menubar_pimpl.C (add_toc): use name and not type with float.
|
||||
(create_submenu): correct call of new object
|
||||
(create_submenu): add FloatListInsert and FloatInsert to dummy clause.
|
||||
|
||||
2001-05-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* FormParagraph.[Ch]: remove !NO_PEXTRA and !NEW_INSETS cruft
|
||||
|
@ -1,3 +1,4 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
@ -30,7 +31,6 @@ class FormToc : public FormCB<ControlToc, FormDB<FD_form_toc> > {
|
||||
public:
|
||||
///
|
||||
FormToc(ControlToc &);
|
||||
|
||||
private:
|
||||
/// not needed
|
||||
virtual void apply() {}
|
||||
|
@ -3,9 +3,9 @@
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright (C) 1999 The LyX Team.
|
||||
* Copyright 1999-2001 The LyX Team.
|
||||
*
|
||||
*======================================================*/
|
||||
* ======================================================*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -15,18 +15,19 @@
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include "support/lstrings.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "debug.h"
|
||||
#include "Menubar_pimpl.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "LyXAction.h"
|
||||
#include "kbmap.h"
|
||||
#include "buffer.h"
|
||||
#include "Dialogs.h"
|
||||
#include "LyXView.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "Menubar_pimpl.h"
|
||||
#include "FloatList.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "gettext.h"
|
||||
#include "debug.h"
|
||||
|
||||
using std::endl;
|
||||
using std::vector;
|
||||
@ -41,21 +42,21 @@ extern LyXAction lyxaction;
|
||||
namespace {
|
||||
|
||||
// Some constants
|
||||
const int MENU_LABEL_SIZE = FL_NORMAL_SIZE;
|
||||
const int mheight = 30;
|
||||
const int mbheight= 22;
|
||||
int const MENU_LABEL_SIZE = FL_NORMAL_SIZE;
|
||||
int const mheight = 30;
|
||||
int const mbheight= 22;
|
||||
// where to place the menubar?
|
||||
const int yloc = (mheight - mbheight)/2; //air + bw;
|
||||
const int mbadd = 20; // menu button add (to width)
|
||||
int const yloc = (mheight - mbheight)/2; //air + bw;
|
||||
int const mbadd = 20; // menu button add (to width)
|
||||
// Some space between buttons on the menubar
|
||||
const int air = 2;
|
||||
int const air = 2;
|
||||
char const * menu_tabstop = "aa";
|
||||
char const * default_tabstop = "aaaaaaaa";
|
||||
// We do not want to mix position values in a menu (like the index of
|
||||
// a submenu) with the action numbers which convey actual information.
|
||||
// Therefore we offset all the action values by an arbitrary large
|
||||
// constant.
|
||||
const int action_offset = 1000;
|
||||
int const action_offset = 1000;
|
||||
|
||||
// This is used a few times below.
|
||||
inline
|
||||
@ -94,7 +95,7 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
|
||||
}
|
||||
|
||||
|
||||
void Menubar::Pimpl::makeMenubar(Menu const &menu)
|
||||
void Menubar::Pimpl::makeMenubar(Menu const & menu)
|
||||
{
|
||||
FL_FORM * form = owner_->getForm();
|
||||
int moffset = 0;
|
||||
@ -106,17 +107,18 @@ void Menubar::Pimpl::makeMenubar(Menu const &menu)
|
||||
fl_set_object_gravity(frame, NorthWestGravity,
|
||||
NorthEastGravity);
|
||||
|
||||
for (Menu::const_iterator i = menu.begin();
|
||||
i != menu.end(); ++i) {
|
||||
Menu::const_iterator i = menu.begin();
|
||||
Menu::const_iterator end = menu.end();
|
||||
for (; i != end; ++i) {
|
||||
FL_OBJECT * obj;
|
||||
if (i->kind() != MenuItem::Submenu) {
|
||||
lyxerr << "ERROR: Menubar::Pimpl::createMenubar:"
|
||||
" only submenus can appear in a menubar";
|
||||
break;
|
||||
}
|
||||
string label = i->label();
|
||||
string shortcut = "#" + i->shortcut();
|
||||
int width = string_width(label);
|
||||
string const label = i->label();
|
||||
string const shortcut = "#" + i->shortcut();
|
||||
int const width = string_width(label);
|
||||
obj = fl_add_button(FL_MENU_BUTTON,
|
||||
air + moffset, yloc,
|
||||
width + mbadd,
|
||||
@ -133,14 +135,15 @@ void Menubar::Pimpl::makeMenubar(Menu const &menu)
|
||||
fl_set_object_shortcut(obj, shortcut.c_str(), 1);
|
||||
fl_set_object_callback(obj, C_Menubar_Pimpl_MenuCallback, 1);
|
||||
|
||||
boost::shared_ptr<ItemInfo> iteminfo(new ItemInfo(this,
|
||||
new MenuItem(*i), obj));
|
||||
boost::shared_ptr<ItemInfo>
|
||||
iteminfo(new ItemInfo(this, new MenuItem(*i), obj));
|
||||
buttonlist_.push_back(iteminfo);
|
||||
obj->u_vdata = iteminfo.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Menubar::Pimpl::set(string const & menu_name)
|
||||
{
|
||||
lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set "
|
||||
@ -168,12 +171,12 @@ void Menubar::Pimpl::set(string const & menu_name)
|
||||
current_group_ = mbit->second;
|
||||
lyxerr[Debug::GUI] << "Menubar::Pimpl::set: Menubar set."
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
} else
|
||||
lyxerr [Debug::GUI] << "Menubar::Pimpl::set: Nothing to do."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
void Menubar::Pimpl::openByName(string const & name)
|
||||
{
|
||||
if (menubackend_->getMenu(current_menu_name_).hasSubmenu(name)) {
|
||||
@ -319,60 +322,6 @@ void add_toc2(int menu, string const & extra_label,
|
||||
void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
||||
vector<int> & smn, Window win)
|
||||
{
|
||||
#if 0
|
||||
//xgettext:no-c-format
|
||||
static char const * MenuNames[3] = { N_("List of Figures%m"),
|
||||
//xgettext:no-c-format
|
||||
N_("List of Tables%m"),
|
||||
//xgettext:no-c-format
|
||||
N_("List of Algorithms%m") };
|
||||
|
||||
vector<vector<Buffer::TocItem> > toc_list =
|
||||
owner_->buffer()->getTocList();
|
||||
|
||||
// Handle LOF/LOT/LOA
|
||||
int max_nonempty = 0;
|
||||
for (int i = 1; i <= 3; ++i)
|
||||
if (!toc_list[i].empty())
|
||||
max_nonempty = i;
|
||||
|
||||
for (int j = 1; j <= 3; ++j)
|
||||
if (!toc_list[j].empty()) {
|
||||
int menu2 = get_new_submenu(smn, win);
|
||||
for (size_type i = 0; i < toc_list[j].size(); ++i) {
|
||||
if (i > max_number_of_items) {
|
||||
fl_addtopup(menu2, ". . .%d");
|
||||
break;
|
||||
}
|
||||
int const action = lyxaction.
|
||||
getPseudoAction(LFUN_GOTO_PARAGRAPH,
|
||||
tostr(toc_list[j][i].par->id()));
|
||||
string label = fixlabel(toc_list[j][i].str);
|
||||
label = limit_string_length(label);
|
||||
label += "%x" + tostr(action + action_offset);
|
||||
fl_addtopup(menu2, label.c_str());
|
||||
}
|
||||
if (j == max_nonempty) {
|
||||
string label = _(MenuNames[j - 1]);
|
||||
label += "%l";
|
||||
fl_addtopup(menu, label.c_str(), menu2);
|
||||
} else
|
||||
fl_addtopup(menu, _(MenuNames[j - 1]), menu2);
|
||||
}
|
||||
|
||||
// Handle normal TOC
|
||||
if (max_nonempty == 0 && toc_list[0].empty()) {
|
||||
fl_addtopup(menu, (_("No Table of Contents%i")
|
||||
+ extra_label).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
add_toc2(menu, extra_label, smn, win,
|
||||
toc_list[0], 0, toc_list[0].size(), 0);
|
||||
#else
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning Fix Me! (Lgb)
|
||||
#endif
|
||||
Buffer::Lists toc_list = owner_->buffer()->getLists();
|
||||
Buffer::Lists::const_iterator cit = toc_list.begin();
|
||||
Buffer::Lists::const_iterator end = toc_list.end();
|
||||
@ -380,6 +329,7 @@ void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
||||
// Handle this elsewhere
|
||||
if (cit->first == "TOC") continue;
|
||||
|
||||
// All the rest is for floats
|
||||
int menu2 = get_new_submenu(smn, win);
|
||||
Buffer::SingleList::const_iterator ccit = cit->second.begin();
|
||||
Buffer::SingleList::const_iterator eend = cit->second.end();
|
||||
@ -393,7 +343,7 @@ void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
||||
label += "%x" + tostr(action + action_offset);
|
||||
fl_addtopup(menu2, label.c_str());
|
||||
}
|
||||
string const m = cit->first + "%m";
|
||||
string const m = floatList[cit->first]->second.name() + "%m";
|
||||
fl_addtopup(menu, m.c_str(), menu2);
|
||||
}
|
||||
|
||||
@ -408,10 +358,9 @@ void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
||||
add_toc2(menu, extra_label, smn, win,
|
||||
cit->second, 0, cit->second.size(), 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
|
||||
string const & menu_name,
|
||||
vector<int> & smn)
|
||||
@ -421,10 +370,10 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
|
||||
<< menu_name << "'" << endl;
|
||||
return -1;
|
||||
}
|
||||
Menu md = Menu();
|
||||
Menu md;
|
||||
menubackend_->getMenu(menu_name).expand(md, owner_->buffer());
|
||||
|
||||
int menu = get_new_submenu(smn, win);
|
||||
int const menu = get_new_submenu(smn, win);
|
||||
fl_setpup_softedge(menu, true);
|
||||
fl_setpup_bw(menu, -1);
|
||||
lyxerr[Debug::GUI] << "Adding menu " << menu
|
||||
@ -438,8 +387,8 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
|
||||
for (Menu::const_iterator i = md.begin(); i != end; ++i) {
|
||||
MenuItem const & item = (*i);
|
||||
if (item.kind() == MenuItem::Command) {
|
||||
string label = item.label() + '\t';
|
||||
int width = string_width(label);
|
||||
string const label = item.label() + '\t';
|
||||
int const width = string_width(label);
|
||||
if (width > max_width) {
|
||||
max_width = width;
|
||||
widest_label = label;
|
||||
@ -538,8 +487,7 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
|
||||
label += "%h";
|
||||
fl_addtopup(menu, label.c_str(),
|
||||
submenu, shortcut.c_str());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fl_addtopup(menu, label.c_str(), submenu);
|
||||
}
|
||||
break;
|
||||
@ -560,6 +508,8 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
|
||||
case MenuItem::UpdateFormats:
|
||||
case MenuItem::ExportFormats:
|
||||
case MenuItem::ImportFormats:
|
||||
case MenuItem::FloatListInsert:
|
||||
case MenuItem::FloatInsert:
|
||||
lyxerr << "Menubar::Pimpl::create_submenu: "
|
||||
"this should not happen" << endl;
|
||||
break;
|
||||
|
@ -84,6 +84,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
bool Importer::IsImportable(string const & format)
|
||||
{
|
||||
@ -96,6 +97,7 @@ bool Importer::IsImportable(string const & format)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
vector<Format const *> const Importer::GetImportableFormats()
|
||||
{
|
||||
vector<string> loaders = Loaders();
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-05-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* lyxinset.h: remve LOF_CODE, LOT_CODE, LOA_CODE, add
|
||||
FLOAT_LIST_CODE, renumber code list.
|
||||
|
||||
* insettoc.C (getScreenLabel): remove support for float lists
|
||||
(LyxCode): ditto
|
||||
(Ascii): ditto
|
||||
|
||||
* insetfloatlist.[Ch]: new files
|
||||
|
||||
* Makefile.am (libinsets_la_SOURCES): add insetfloatlist.[Ch]
|
||||
|
||||
2001-04-27 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* insettabular.C (LocalDispatch):
|
||||
|
@ -33,6 +33,8 @@ libinsets_la_SOURCES = \
|
||||
insetexternal.h \
|
||||
insetfloat.h \
|
||||
insetfloat.C \
|
||||
insetfloatlist.C \
|
||||
insetfloatlist.h \
|
||||
insetfoot.C \
|
||||
insetfoot.h \
|
||||
insetfootlike.C \
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "debug.h"
|
||||
#include "BufferView.h"
|
||||
#include "Painter.h"
|
||||
#include "support/LAssert.h"
|
||||
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
@ -25,11 +26,15 @@ using std::endl;
|
||||
|
||||
int InsetButton::ascent(BufferView * bv, LyXFont const &) const
|
||||
{
|
||||
lyx::Assert(bv);
|
||||
|
||||
LyXFont font(LyXFont::ALL_SANE);
|
||||
font.decSize();
|
||||
|
||||
int width, ascent, descent;
|
||||
string s = getScreenLabel();
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
string const s = getScreenLabel();
|
||||
|
||||
if (Editable()) {
|
||||
bv->painter().buttonText(0, 0, s, font,
|
||||
@ -45,11 +50,15 @@ int InsetButton::ascent(BufferView * bv, LyXFont const &) const
|
||||
|
||||
int InsetButton::descent(BufferView * bv, LyXFont const &) const
|
||||
{
|
||||
lyx::Assert(bv);
|
||||
|
||||
LyXFont font(LyXFont::ALL_SANE);
|
||||
font.decSize();
|
||||
|
||||
int width, ascent, descent;
|
||||
string s = getScreenLabel();
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
string const s = getScreenLabel();
|
||||
|
||||
if (Editable()) {
|
||||
bv->painter().buttonText(0, 0, s, font,
|
||||
@ -65,13 +74,15 @@ int InsetButton::descent(BufferView * bv, LyXFont const &) const
|
||||
|
||||
int InsetButton::width(BufferView * bv, LyXFont const &) const
|
||||
{
|
||||
lyx::Assert(bv);
|
||||
|
||||
LyXFont font(LyXFont::ALL_SANE);
|
||||
font.decSize();
|
||||
|
||||
int width, ascent, descent;
|
||||
string s = getScreenLabel();
|
||||
//if (!bv)
|
||||
// int(s.length());
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
string const s = getScreenLabel();
|
||||
|
||||
if (Editable()) {
|
||||
bv->painter().buttonText(0, 0, s, font,
|
||||
@ -88,18 +99,20 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const
|
||||
void InsetButton::draw(BufferView * bv, LyXFont const &,
|
||||
int baseline, float & x, bool) const
|
||||
{
|
||||
lyx::Assert(bv);
|
||||
|
||||
Painter & pain = bv->painter();
|
||||
// Draw it as a box with the LaTeX text
|
||||
LyXFont font(LyXFont::ALL_SANE);
|
||||
font.setColor(LColor::command).decSize();
|
||||
|
||||
int width;
|
||||
string s = getScreenLabel();
|
||||
string const s = getScreenLabel();
|
||||
|
||||
if (Editable()) {
|
||||
pain.buttonText(int(x)+2, baseline, s, font, true, width);
|
||||
pain.buttonText(int(x) + 2, baseline, s, font, true, width);
|
||||
} else {
|
||||
pain.rectText(int(x)+2, baseline, s, font,
|
||||
pain.rectText(int(x) + 2, baseline, s, font,
|
||||
LColor::commandbg, LColor::commandframe,
|
||||
true, width);
|
||||
}
|
||||
|
115
src/insets/insetfloatlist.C
Normal file
115
src/insets/insetfloatlist.C
Normal file
@ -0,0 +1,115 @@
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include "insetfloatlist.h"
|
||||
#include "FloatList.h"
|
||||
#include "buffer.h"
|
||||
#include "gettext.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
string const InsetFloatList::getScreenLabel() const
|
||||
{
|
||||
string const guiName = floatList[float_type]->second.name();
|
||||
if (!guiName.empty()) {
|
||||
string const res = _("List of ") + guiName;
|
||||
return res;
|
||||
}
|
||||
return _("ERROR nonexistant float type!");
|
||||
}
|
||||
|
||||
|
||||
Inset::Code InsetFloatList::LyxCode() const
|
||||
{
|
||||
return Inset::FLOAT_LIST_CODE;
|
||||
}
|
||||
|
||||
|
||||
void InsetFloatList::Write(Buffer const *, ostream & os) const
|
||||
{
|
||||
os << "FloatList " << float_type << "\n";
|
||||
}
|
||||
|
||||
|
||||
void InsetFloatList::Read(Buffer const *, LyXLex & lex)
|
||||
{
|
||||
string token;
|
||||
|
||||
if (lex.EatLine()) {
|
||||
float_type = lex.GetString();
|
||||
lyxerr << "FloatList::float_type: " << float_type << endl;
|
||||
} else
|
||||
lex.printError("InsetFloatList: Parse error: `$$Token'");
|
||||
while (lex.IsOK()) {
|
||||
lex.nextToken();
|
||||
token = lex.GetString();
|
||||
if (token == "\\end_inset")
|
||||
break;
|
||||
}
|
||||
if (token != "\\end_inset") {
|
||||
lex.printError("Missing \\end_inset at this point. "
|
||||
"Read: `$$Token'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InsetFloatList::Edit(BufferView *, int, int, unsigned int)
|
||||
{
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning Implement me please.
|
||||
#endif
|
||||
#if 0
|
||||
bv->owner()->getDialogs()->showFloatList(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int InsetFloatList::Latex(Buffer const *, ostream & os, bool, bool) const
|
||||
{
|
||||
FloatList::const_iterator cit = floatList[float_type];
|
||||
|
||||
|
||||
if (cit != floatList.end()) {
|
||||
if (cit->second.builtin()) {
|
||||
// Only two different types allowed here:
|
||||
string const type = cit->second.type();
|
||||
if (type == "table") {
|
||||
os << "\\listoftables\n";
|
||||
} else if (type == "figure") {
|
||||
os << "\\listoffigures\n";
|
||||
} else {
|
||||
os << "%% unknown builtin float\n";
|
||||
}
|
||||
} else {
|
||||
os << "\\listof{" << float_type << "}{"
|
||||
<< _("List of ") << cit->second.name() << "}\n";
|
||||
}
|
||||
} else {
|
||||
os << "%%\\listof{" << float_type << "}{"
|
||||
<< _("List of ") << cit->second.name() << "}\n";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int InsetFloatList::Ascii(Buffer const * buffer, std::ostream & os, int) const
|
||||
{
|
||||
os << getScreenLabel() << "\n\n";
|
||||
|
||||
Buffer::Lists const toc_list = buffer->getLists();
|
||||
Buffer::Lists::const_iterator cit =
|
||||
toc_list.find(float_type);
|
||||
if (cit != toc_list.end()) {
|
||||
Buffer::SingleList::const_iterator ccit = cit->second.begin();
|
||||
Buffer::SingleList::const_iterator end = cit->second.end();
|
||||
for (; ccit != end; ++ccit)
|
||||
os << string(4 * ccit->depth, ' ')
|
||||
<< ccit->str << "\n";
|
||||
}
|
||||
|
||||
os << "\n";
|
||||
return 0;
|
||||
}
|
60
src/insets/insetfloatlist.h
Normal file
60
src/insets/insetfloatlist.h
Normal file
@ -0,0 +1,60 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Word Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1996-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef INSET_FLOATLIST_H
|
||||
#define INSET_FLOATLIST_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "insetbutton.h"
|
||||
|
||||
/** Used to insert table of contents
|
||||
*/
|
||||
class InsetFloatList : public InsetButton {
|
||||
public:
|
||||
///
|
||||
InsetFloatList() {}
|
||||
///
|
||||
InsetFloatList(string const & type)
|
||||
: float_type(type) {}
|
||||
///
|
||||
Inset * Clone(Buffer const &) const {
|
||||
return new InsetFloatList(*this);
|
||||
}
|
||||
///
|
||||
string const getScreenLabel() const;
|
||||
///
|
||||
void Edit(BufferView * bv, int, int, unsigned int);
|
||||
///
|
||||
EDITABLE Editable() const { return IS_EDITABLE; }
|
||||
///
|
||||
bool display() const { return true; }
|
||||
///
|
||||
Inset::Code LyxCode() const;
|
||||
///
|
||||
void Write(Buffer const *, ostream &) const;
|
||||
///
|
||||
void Read(Buffer const *, LyXLex &);
|
||||
///
|
||||
int Latex(Buffer const *, ostream &, bool, bool) const;
|
||||
///
|
||||
int Linuxdoc(Buffer const *, ostream &) const { return 0; }
|
||||
///
|
||||
int DocBook(Buffer const *, ostream &) const { return 0; }
|
||||
///
|
||||
int Ascii(Buffer const *, std::ostream &, int linelen) const;
|
||||
private:
|
||||
string float_type;
|
||||
};
|
||||
|
||||
#endif
|
@ -20,12 +20,7 @@ string const InsetTOC::getScreenLabel() const
|
||||
|
||||
if (cmdname == "tableofcontents")
|
||||
return _("Table of Contents");
|
||||
else if (cmdname == "listof{algorithm}{List of Algorithms}")
|
||||
return _("List of Algorithms");
|
||||
else if (cmdname == "listoffigures")
|
||||
return _("List of Figures");
|
||||
else
|
||||
return _("List of Tables");
|
||||
return _("Unknown toc list");
|
||||
}
|
||||
|
||||
|
||||
@ -34,12 +29,7 @@ Inset::Code InsetTOC::LyxCode() const
|
||||
string const cmdname(getCmdName());
|
||||
if (cmdname == "tableofcontents")
|
||||
return Inset::TOC_CODE;
|
||||
else if (cmdname == "listof{algorithm}{List of Algorithms}")
|
||||
return Inset::LOA_CODE;
|
||||
else if (cmdname == "listoffigures")
|
||||
return Inset::LOF_CODE;
|
||||
else
|
||||
return Inset::LOT_CODE;
|
||||
return Inset::NO_CODE;
|
||||
}
|
||||
|
||||
|
||||
@ -53,39 +43,10 @@ int InsetTOC::Ascii(Buffer const * buffer, std::ostream & os, int) const
|
||||
{
|
||||
os << getScreenLabel() << "\n\n";
|
||||
|
||||
#if 0
|
||||
Buffer::TocType type;
|
||||
string cmdname = getCmdName();
|
||||
if (cmdname == "tableofcontents")
|
||||
type = Buffer::TOC_TOC;
|
||||
else if (cmdname == "listof{algorithm}{List of Algorithms}")
|
||||
type = Buffer::TOC_LOA;
|
||||
else if (cmdname == "listoffigures")
|
||||
type = Buffer::TOC_LOF;
|
||||
else
|
||||
type = Buffer::TOC_LOT;
|
||||
|
||||
vector<vector<Buffer::TocItem> > const toc_list =
|
||||
buffer->getTocList();
|
||||
vector<Buffer::TocItem> const & toc = toc_list[type];
|
||||
for (vector<Buffer::TocItem>::const_iterator it = toc.begin();
|
||||
it != toc.end(); ++it)
|
||||
os << string(4 * it->depth, ' ') << it->str << endl;
|
||||
#else
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning Fix Me! (Lgb)
|
||||
#endif
|
||||
string type;
|
||||
string const cmdname = getCmdName();
|
||||
if (cmdname == "tableofcontents")
|
||||
type = "TOC";
|
||||
else if (cmdname == "listof{algorithm}{List of Algorithms}")
|
||||
type = "LOA";
|
||||
else if (cmdname == "listoffigures")
|
||||
type = "LOF";
|
||||
else
|
||||
type = "LOT";
|
||||
|
||||
Buffer::Lists const toc_list = buffer->getLists();
|
||||
Buffer::Lists::const_iterator cit =
|
||||
toc_list.find(type);
|
||||
@ -96,7 +57,7 @@ int InsetTOC::Ascii(Buffer const * buffer, std::ostream & os, int) const
|
||||
os << string(4 * ccit->depth, ' ')
|
||||
<< ccit->str << "\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
os << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
@ -45,71 +45,67 @@ public:
|
||||
///
|
||||
TOC_CODE, // do these insets really need a code? (ale)
|
||||
///
|
||||
LOF_CODE, // 2
|
||||
///
|
||||
LOT_CODE,
|
||||
///
|
||||
LOA_CODE,
|
||||
///
|
||||
QUOTE_CODE, // 5
|
||||
QUOTE_CODE,
|
||||
///
|
||||
MARK_CODE,
|
||||
///
|
||||
REF_CODE,
|
||||
REF_CODE, // 5
|
||||
///
|
||||
URL_CODE,
|
||||
///
|
||||
HTMLURL_CODE,
|
||||
///
|
||||
SEPARATOR_CODE, // 10
|
||||
SEPARATOR_CODE,
|
||||
///
|
||||
ENDING_CODE,
|
||||
///
|
||||
LABEL_CODE,
|
||||
LABEL_CODE, // 10
|
||||
///
|
||||
IGNORE_CODE,
|
||||
///
|
||||
ACCENT_CODE,
|
||||
///
|
||||
MATH_CODE, // 15
|
||||
MATH_CODE,
|
||||
///
|
||||
INDEX_CODE,
|
||||
///
|
||||
INCLUDE_CODE,
|
||||
INCLUDE_CODE, // 15
|
||||
///
|
||||
GRAPHICS_CODE,
|
||||
///
|
||||
PARENT_CODE,
|
||||
///
|
||||
BIBTEX_CODE, // 20
|
||||
BIBTEX_CODE,
|
||||
///
|
||||
TEXT_CODE,
|
||||
///
|
||||
ERT_CODE,
|
||||
ERT_CODE, // 20
|
||||
///
|
||||
FOOT_CODE,
|
||||
///
|
||||
MARGIN_CODE,
|
||||
///
|
||||
FLOAT_CODE, // 25
|
||||
FLOAT_CODE,
|
||||
///
|
||||
MINIPAGE_CODE,
|
||||
///
|
||||
SPECIALCHAR_CODE,
|
||||
SPECIALCHAR_CODE, // 25
|
||||
///
|
||||
TABULAR_CODE,
|
||||
///
|
||||
EXTERNAL_CODE,
|
||||
///
|
||||
THEOREM_CODE, // 30
|
||||
THEOREM_CODE,
|
||||
///
|
||||
CAPTION_CODE,
|
||||
///
|
||||
MATHMACRO_CODE,
|
||||
MATHMACRO_CODE, // 30
|
||||
///
|
||||
ERROR_CODE,
|
||||
///
|
||||
CITE_CODE
|
||||
CITE_CODE,
|
||||
///
|
||||
FLOAT_LIST_CODE
|
||||
};
|
||||
|
||||
///
|
||||
@ -130,7 +126,7 @@ public:
|
||||
|
||||
///
|
||||
Inset() : top_x(0), top_baseline(0), scx(0), owner_(0) {}
|
||||
///
|
||||
/// Virtual base destructor
|
||||
virtual ~Inset() {}
|
||||
///
|
||||
virtual int ascent(BufferView *, LyXFont const &) const = 0;
|
||||
|
@ -456,10 +456,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_INSERTFOOTNOTE:
|
||||
#if 0
|
||||
case LFUN_FOOTMELT:
|
||||
case LFUN_MARGINMELT:
|
||||
#endif
|
||||
// Disable insertion of floats in a tabular.
|
||||
disable = false;
|
||||
if (owner->view()->theLockingInset()) {
|
||||
@ -918,21 +914,26 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_TOCVIEW:
|
||||
#if 0
|
||||
case LFUN_LOFVIEW:
|
||||
case LFUN_LOTVIEW:
|
||||
case LFUN_LOAVIEW:
|
||||
#endif
|
||||
{
|
||||
InsetCommandParams p;
|
||||
|
||||
#if 0
|
||||
if (action == LFUN_TOCVIEW)
|
||||
#endif
|
||||
p.setCmdName("tableofcontents");
|
||||
#if 0
|
||||
else if (action == LFUN_LOAVIEW )
|
||||
p.setCmdName("listof{algorithm}{List of Algorithms}");
|
||||
else if (action == LFUN_LOFVIEW)
|
||||
p.setCmdName("listoffigures");
|
||||
else
|
||||
p.setCmdName("listoftables");
|
||||
|
||||
#endif
|
||||
owner->getDialogs()->createTOC(p.getAsString());
|
||||
break;
|
||||
}
|
||||
|
@ -174,6 +174,10 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
|
||||
case 13:
|
||||
case XK_Return:
|
||||
{
|
||||
#if 0
|
||||
// This will go in again in a little while
|
||||
// we need to be able to declare what types
|
||||
// of argumetns LFUN's should have first. (Lgb)
|
||||
// First check for match
|
||||
vector<string>::const_iterator cit =
|
||||
std::find(completion_.begin(),
|
||||
@ -185,12 +189,15 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
|
||||
string const tmp = input + _(" [no match]");
|
||||
fl_set_input(ob, tmp.c_str());
|
||||
} else {
|
||||
#endif
|
||||
// Return the inputted string
|
||||
deactivate();
|
||||
owner_->view()->focus(true);
|
||||
history_->push_back(input);
|
||||
stringReady.emit(input);
|
||||
# if 0
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
case XK_space:
|
||||
|
Loading…
Reference in New Issue
Block a user