Added lyx-func tabular-feature for menu structure.

Use f.ex. tabular-feature align-left (for left aligning the actual column)
Some small fixes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@936 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-07-28 14:28:54 +00:00
parent ef59101fe7
commit 68eddbdf73
11 changed files with 227 additions and 59 deletions

View File

@ -1,3 +1,12 @@
2000-07-28 Juergen Vigna <jug@sad.it>
* src/insets/insettabular.C (LocalDispatch):
(TabularFeatures): added support for lyx-functions of tabular features.
(cellstart): refixed this function after someone wrongly changed it.
* src/commandtags.h:
* src/LyXAction.C (init): added support for tabular-features
2000-07-28 Allan Rae <rae@lyx.org> 2000-07-28 Allan Rae <rae@lyx.org>
* src/frontends/xforms/FormPreferences.C (build): Setup input return * src/frontends/xforms/FormPreferences.C (build): Setup input return

View File

@ -26,6 +26,7 @@ src/ext_l10n.h
src/filedlg.C src/filedlg.C
src/FontLoader.C src/FontLoader.C
src/form1.C src/form1.C
src/frontends/gnome/Menubar_pimpl.C
src/frontends/xforms/FormCitation.C src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_citation.C src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C src/frontends/xforms/FormCopyright.C
@ -34,6 +35,11 @@ src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_preferences.C src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_print.C src/frontends/xforms/form_print.C
src/frontends/xforms/forms/form_citation.C
src/frontends/xforms/forms/form_copyright.C
src/frontends/xforms/forms/form_preferences.C
src/frontends/xforms/forms/form_print.C
src/frontends/xforms/forms/form_tabular.C
src/frontends/xforms/FormTabular.C src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular.C src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormUrl.C src/frontends/xforms/FormUrl.C

View File

@ -381,6 +381,8 @@ void LyXAction::init()
#ifndef NEW_TABULAR #ifndef NEW_TABULAR
{ LFUN_TABLE, "table-insert", N_("Insert Table"), Noop }, { LFUN_TABLE, "table-insert", N_("Insert Table"), Noop },
#endif #endif
{ LFUN_TABULAR_FEATURE, "tabular-feature",
N_("Tabular Features"), Noop },
{ LFUN_INSET_TABULAR, "tabular-insert", { LFUN_INSET_TABULAR, "tabular-insert",
N_("Insert a new Tabular Inset"), Noop }, N_("Insert a new Tabular Inset"), Noop },
{ LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop }, { LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop },

View File

@ -271,6 +271,7 @@ enum kb_action {
LFUN_INSET_CAPTION, // Lgb 20000718 LFUN_INSET_CAPTION, // Lgb 20000718
LFUN_SWITCHBUFFER, // and where is this comming from? LFUN_SWITCHBUFFER, // and where is this comming from?
LFUN_INSERT_URL, // Angus 20000726 LFUN_INSERT_URL, // Angus 20000726
LFUN_TABULAR_FEATURE, // Jug 20000728
LFUN_LASTACTION /* this marks the end of the table */ LFUN_LASTACTION /* this marks the end of the table */
}; };

View File

@ -149,17 +149,18 @@ _("Credits...|e");
_("Version...|V"); _("Version...|V");
_(""); _("");
_("A&A"); _("A&A");
_("ACT");
_("AT_RISE:");
_("Abstract"); _("Abstract");
_("Accepted"); _("Accepted");
_("Acknowledgement"); _("Acknowledgement");
_("Acknowledgement(s)");
_("Acknowledgement*"); _("Acknowledgement*");
_("Acknowledgement-numbered"); _("Acknowledgement-numbered");
_("Acknowledgement(s)");
_("Acknowledgements");
_("Acknowledgement-unnumbered"); _("Acknowledgement-unnumbered");
_("Acknowledgements");
_("Acknowledgments"); _("Acknowledgments");
_("Acnowledgement"); _("Acnowledgement");
_("ACT");
_("Addchap"); _("Addchap");
_("Addchap*"); _("Addchap*");
_("Addition"); _("Addition");
@ -177,15 +178,15 @@ _("Anlagen");
_("Anrede"); _("Anrede");
_("Appendices"); _("Appendices");
_("Appendix"); _("Appendix");
_("AT_RISE:");
_("Author"); _("Author");
_("AuthorRunning");
_("Author_Email"); _("Author_Email");
_("Author_Running"); _("Author_Running");
_("AuthorRunning");
_("Author_URL"); _("Author_URL");
_("Axiom"); _("Axiom");
_("Axiom-numbered"); _("Axiom-numbered");
_("Axiom-plain"); _("Axiom-plain");
_("BLZ");
_("Backaddress"); _("Backaddress");
_("Bank"); _("Bank");
_("BankAccount"); _("BankAccount");
@ -193,13 +194,12 @@ _("BankCode");
_("Betreff"); _("Betreff");
_("Bibliography"); _("Bibliography");
_("Biography"); _("Biography");
_("BLZ");
_("Brieftext"); _("Brieftext");
_("CC");
_("CURTAIN");
_("Caption"); _("Caption");
_("Case"); _("Case");
_("Case-numbered"); _("Case-numbered");
_("CC");
_("cc");
_("CenteredCaption"); _("CenteredCaption");
_("Chapter"); _("Chapter");
_("Chapter*"); _("Chapter*");
@ -239,7 +239,6 @@ _("Criterion-plain");
_("CrossList"); _("CrossList");
_("Current"); _("Current");
_("Current_Address"); _("Current_Address");
_("CURTAIN");
_("Customer"); _("Customer");
_("Data"); _("Data");
_("Date"); _("Date");
@ -254,10 +253,10 @@ _("Definition-unnumbered");
_("Description"); _("Description");
_("Dialogue"); _("Dialogue");
_("EMail"); _("EMail");
_("EXT.");
_("Email"); _("Email");
_("Encl"); _("Encl");
_("Encl."); _("Encl.");
_("encl");
_("End_All_Slides"); _("End_All_Slides");
_("Enumerate"); _("Enumerate");
_("Example"); _("Example");
@ -268,48 +267,43 @@ _("Example-unnumbered");
_("Exercise"); _("Exercise");
_("Exercise-numbered"); _("Exercise-numbered");
_("Exercise-plain"); _("Exercise-plain");
_("EXT.");
_("Extratitle"); _("Extratitle");
_("FADE_IN:");
_("FADE_OUT:");
_("Fact"); _("Fact");
_("Fact*"); _("Fact*");
_("Fact-numbered"); _("Fact-numbered");
_("Fact-plain"); _("Fact-plain");
_("Fact-unnumbered"); _("Fact-unnumbered");
_("FADE_IN:");
_("FADE_OUT:");
_("FigCaption"); _("FigCaption");
_("first");
_("FirstAuthor"); _("FirstAuthor");
_("FirstName"); _("FirstName");
_("FitBitmap"); _("FitBitmap");
_("FitFigure"); _("FitFigure");
_("Foilhead"); _("Foilhead");
_("foilhead");
_("Footernote"); _("Footernote");
_("FourAffiliations"); _("FourAffiliations");
_("FourAuthors"); _("FourAuthors");
_("Gruss"); _("Gruss");
_("Headnote");
_("HTTP"); _("HTTP");
_("Headnote");
_("INT.");
_("Idea"); _("Idea");
_("IhrSchreiben"); _("IhrSchreiben");
_("IhrZeichen"); _("IhrZeichen");
_("Institute"); _("Institute");
_("Institution"); _("Institution");
_("INT.");
_("InvisibleText"); _("InvisibleText");
_("Invoice"); _("Invoice");
_("Itemize"); _("Itemize");
_("Journal"); _("Journal");
_("journal");
_("Keywords"); _("Keywords");
_("Konto"); _("Konto");
_("Labeling");
_("Land");
_("landscape");
_("LandscapeSlide");
_("LaTeX"); _("LaTeX");
_("LaTeX_Title"); _("LaTeX_Title");
_("Labeling");
_("Land");
_("LandscapeSlide");
_("Lemma"); _("Lemma");
_("Lemma*"); _("Lemma*");
_("Lemma-numbered"); _("Lemma-numbered");
@ -328,10 +322,8 @@ _("MarkBoth");
_("MathLetters"); _("MathLetters");
_("MeinZeichen"); _("MeinZeichen");
_("Minisec"); _("Minisec");
_("modying");
_("msnumber");
_("My_Address");
_("MyRef"); _("MyRef");
_("My_Address");
_("Myref"); _("Myref");
_("Name"); _("Name");
_("Narrative"); _("Narrative");
@ -341,18 +333,18 @@ _("Note");
_("Note*"); _("Note*");
_("Note-numbered"); _("Note-numbered");
_("Note-plain"); _("Note-plain");
_("Note-unnumbered");
_("NoteToEditor"); _("NoteToEditor");
_("Notetoeditor"); _("Notetoeditor");
_("Note-unnumbered");
_("Offprint"); _("Offprint");
_("Offprints"); _("Offprints");
_("Offsets"); _("Offsets");
_("offsets");
_("Oggetto"); _("Oggetto");
_("Opening"); _("Opening");
_("Ort"); _("Ort");
_("Overlay"); _("Overlay");
_("PACS"); _("PACS");
_("PS");
_("Paragraph"); _("Paragraph");
_("Paragraph*"); _("Paragraph*");
_("Paragraph-numbered"); _("Paragraph-numbered");
@ -363,8 +355,8 @@ _("Petit");
_("Phone"); _("Phone");
_("Place"); _("Place");
_("PlaceFigure"); _("PlaceFigure");
_("Placefigure");
_("PlaceTable"); _("PlaceTable");
_("Placefigure");
_("Placetable"); _("Placetable");
_("PortraitSlide"); _("PortraitSlide");
_("PostalCommend"); _("PostalCommend");
@ -381,12 +373,11 @@ _("Proposition*");
_("Proposition-numbered"); _("Proposition-numbered");
_("Proposition-plain"); _("Proposition-plain");
_("Proposition-unnumbered"); _("Proposition-unnumbered");
_("PS");
_("ps");
_("Publishers"); _("Publishers");
_("Question"); _("Question");
_("Quotation"); _("Quotation");
_("Quote"); _("Quote");
_("REVTEX_Title");
_("Received"); _("Received");
_("Recieved"); _("Recieved");
_("Recieved/Accepted"); _("Recieved/Accepted");
@ -396,17 +387,17 @@ _("Remark");
_("Remark*"); _("Remark*");
_("Remark-numbered"); _("Remark-numbered");
_("Remark-plain"); _("Remark-plain");
_("Remarks");
_("Remark-unnumbered"); _("Remark-unnumbered");
_("Remarks");
_("RetourAdresse"); _("RetourAdresse");
_("ReturnAddress"); _("ReturnAddress");
_("REVTEX_Title");
_("Right_Address");
_("RightHeader"); _("RightHeader");
_("Right_Address");
_("Rotatefoilhead"); _("Rotatefoilhead");
_("Running_LaTeX_Title"); _("Running_LaTeX_Title");
_("SCENE"); _("SCENE");
_("SCENE*"); _("SCENE*");
_("SGML");
_("Scrap"); _("Scrap");
_("Section"); _("Section");
_("Section*"); _("Section*");
@ -414,11 +405,10 @@ _("Section-numbered");
_("Send"); _("Send");
_("Send_To_Address"); _("Send_To_Address");
_("Seriate"); _("Seriate");
_("SGML");
_("ShortFoilhead"); _("ShortFoilhead");
_("Shortfoilhead");
_("ShortRotatefoilhead"); _("ShortRotatefoilhead");
_("ShortTitle"); _("ShortTitle");
_("Shortfoilhead");
_("Signature"); _("Signature");
_("Slide"); _("Slide");
_("Slide*"); _("Slide*");
@ -434,26 +424,26 @@ _("State");
_("Strasse"); _("Strasse");
_("Street"); _("Street");
_("Style"); _("Style");
_("style"); _("SubSection");
_("SubTitle");
_("Subitle"); _("Subitle");
_("Subject"); _("Subject");
_("Subjectclass"); _("Subjectclass");
_("Subparagraph"); _("Subparagraph");
_("Subparagraph*"); _("Subparagraph*");
_("SubSection");
_("Subsection"); _("Subsection");
_("Subsection*"); _("Subsection*");
_("Subsection-numbered"); _("Subsection-numbered");
_("Subsubsection"); _("Subsubsection");
_("Subsubsection*"); _("Subsubsection*");
_("Subsubsection-numbered"); _("Subsubsection-numbered");
_("SubTitle");
_("Subtitle"); _("Subtitle");
_("Suggested"); _("Suggested");
_("Summary"); _("Summary");
_("Summary-numbered"); _("Summary-numbered");
_("Surname"); _("Surname");
_("surname"); _("TOC_Author");
_("TOC_Title");
_("TableComments"); _("TableComments");
_("TableRefs"); _("TableRefs");
_("Telefax"); _("Telefax");
@ -465,8 +455,8 @@ _("Theorem");
_("Theorem*"); _("Theorem*");
_("Theorem-numbered"); _("Theorem-numbered");
_("Theorem-plain"); _("Theorem-plain");
_("TheoremTemplate");
_("Theorem-unnumbered"); _("Theorem-unnumbered");
_("TheoremTemplate");
_("Thesaurus"); _("Thesaurus");
_("ThickLine"); _("ThickLine");
_("This"); _("This");
@ -474,29 +464,39 @@ _("ThreeAffiliations");
_("ThreeAuthors"); _("ThreeAuthors");
_("TickList"); _("TickList");
_("Title"); _("Title");
_("Titlehead");
_("Title_Running"); _("Title_Running");
_("TOC_Author"); _("Titlehead");
_("TOC_Title");
_("Town"); _("Town");
_("Transition");
_("Trans_Keywords"); _("Trans_Keywords");
_("Transition");
_("Translated"); _("Translated");
_("TranslatedAbstract"); _("TranslatedAbstract");
_("Translated_Title"); _("Translated_Title");
_("Translator"); _("Translator");
_("TwoAffiliations"); _("TwoAffiliations");
_("TwoAuthors"); _("TwoAuthors");
_("URL");
_("Unterschrift"); _("Unterschrift");
_("Uppertitleback"); _("Uppertitleback");
_("URL");
_("Use"); _("Use");
_("Verbatim"); _("Verbatim");
_("Verse"); _("Verse");
_("Verteiler"); _("Verteiler");
_("VisibleText"); _("VisibleText");
_("YourMail"); _("YourMail");
_("Yourmail");
_("YourRef"); _("YourRef");
_("Yourmail");
_("Yourref"); _("Yourref");
_("Zusatz"); _("Zusatz");
_("cc");
_("encl");
_("first");
_("foilhead");
_("journal");
_("landscape");
_("modying");
_("msnumber");
_("offsets");
_("ps");
_("style");
_("surname");

View File

@ -1,2 +1,6 @@
Makefile Makefile
Makefile.in Makefile.in
*.deps
*.lo
.libs
libgnome.la

View File

@ -44,11 +44,68 @@ using std::max;
using std::endl; using std::endl;
using std::swap; using std::swap;
struct tabular_features {
int action;
string feature;
};
//static tabular_features * tabularFeatures = 0;
static tabular_features tabularFeatures[] =
{
{ LyXTabular::APPEND_ROW, "append-row" },
{ LyXTabular::APPEND_COLUMN, "append-column" },
{ LyXTabular::DELETE_ROW, "delete-row" },
{ LyXTabular::DELETE_COLUMN, "delete-column" },
{ LyXTabular::TOGGLE_LINE_TOP, "toggle-line-top" },
{ LyXTabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom" },
{ LyXTabular::TOGGLE_LINE_LEFT, "toggle-line-left" },
{ LyXTabular::TOGGLE_LINE_RIGHT, "toggle-line-right" },
{ LyXTabular::ALIGN_LEFT, "align-left" },
{ LyXTabular::ALIGN_RIGHT, "align-right" },
{ LyXTabular::ALIGN_CENTER, "align-center" },
{ LyXTabular::VALIGN_TOP, "valign-top" },
{ LyXTabular::VALIGN_BOTTOM, "valign-bottom" },
{ LyXTabular::VALIGN_CENTER, "valign-center" },
{ LyXTabular::M_TOGGLE_LINE_TOP, "m-toggle-line-top" },
{ LyXTabular::M_TOGGLE_LINE_BOTTOM, "m-toggle-line-bottom" },
{ LyXTabular::M_TOGGLE_LINE_LEFT, "m-toggle-line-left" },
{ LyXTabular::M_TOGGLE_LINE_RIGHT, "m-toggle-line-right" },
{ LyXTabular::M_ALIGN_LEFT, "m-align-left" },
{ LyXTabular::M_ALIGN_RIGHT, "m-align-right" },
{ LyXTabular::M_ALIGN_CENTER, "m-align-center" },
{ LyXTabular::M_VALIGN_TOP, "m-valign-top" },
{ LyXTabular::M_VALIGN_BOTTOM, "m-valign-bottom" },
{ LyXTabular::M_VALIGN_CENTER, "m-valign-center" },
{ LyXTabular::DELETE_TABULAR, "delete-tabular" },
{ LyXTabular::MULTICOLUMN, "multicolumn" },
{ LyXTabular::SET_ALL_LINES, "set-all-lines" },
{ LyXTabular::UNSET_ALL_LINES, "unset-all-lines" },
{ LyXTabular::SET_LONGTABULAR, "set-longtabular" },
{ LyXTabular::UNSET_LONGTABULAR, "unset-longtabular" },
{ LyXTabular::SET_PWIDTH, "set-pwidth" },
{ LyXTabular::SET_MPWIDTH, "set-mpwidth" },
{ LyXTabular::SET_ROTATE_TABULAR, "set-rotate-tabular" },
{ LyXTabular::UNSET_ROTATE_TABULAR, "unset-rotate-tabular" },
{ LyXTabular::SET_ROTATE_CELL, "set-rotate-cell" },
{ LyXTabular::UNSET_ROTATE_CELL, "unset-rotate-cell" },
{ LyXTabular::SET_LINEBREAKS, "set-linebreaks" },
{ LyXTabular::SET_LTHEAD, "set-lthead" },
{ LyXTabular::SET_LTFIRSTHEAD, "set-ltfirsthead" },
{ LyXTabular::SET_LTFOOT, "set-ltfoot" },
{ LyXTabular::SET_LTLASTFOOT, "set-ltlastfoot" },
{ LyXTabular::SET_LTNEWPAGE, "set-ltnewpage" },
{ LyXTabular::SET_SPECIAL_COLUMN, "set-special-column" },
{ LyXTabular::SET_SPECIAL_MULTI, "set-special-multi" },
{ LyXTabular::LAST_ACTION, "" }
};
//#define cellstart(p) ((p % 2) == 0) //#define cellstart(p) ((p % 2) == 0)
static inline static inline
bool cellstart(LyXParagraph::size_type p) bool cellstart(LyXParagraph::size_type p)
{ {
return ((p & 2) == 0); return ((p % 2) == 0);
} }
@ -71,6 +128,7 @@ InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0; sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
dialogs_ = 0; dialogs_ = 0;
need_update = INIT; need_update = INIT;
initFeatures();
} }
@ -90,6 +148,61 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer * buf)
} }
void InsetTabular::initFeatures()
{
if (tabularFeatures)
return;
tabular_features tf[] = {
{ LyXTabular::APPEND_ROW, "append-row" },
{ LyXTabular::APPEND_COLUMN, "append-column" },
{ LyXTabular::DELETE_ROW, "delete-row" },
{ LyXTabular::DELETE_COLUMN, "delete-column" },
{ LyXTabular::TOGGLE_LINE_TOP, "toggle-line-top" },
{ LyXTabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom" },
{ LyXTabular::TOGGLE_LINE_LEFT, "toggle-line-left" },
{ LyXTabular::TOGGLE_LINE_RIGHT, "toggle-line-right" },
{ LyXTabular::ALIGN_LEFT, "align-left" },
{ LyXTabular::ALIGN_RIGHT, "align-right" },
{ LyXTabular::ALIGN_CENTER, "align-center" },
{ LyXTabular::VALIGN_TOP, "valign-top" },
{ LyXTabular::VALIGN_BOTTOM, "valign-bottom" },
{ LyXTabular::VALIGN_CENTER, "valign-center" },
{ LyXTabular::M_TOGGLE_LINE_TOP, "m-toggle-line-top" },
{ LyXTabular::M_TOGGLE_LINE_BOTTOM, "m-toggle-line-bottom" },
{ LyXTabular::M_TOGGLE_LINE_LEFT, "m-toggle-line-left" },
{ LyXTabular::M_TOGGLE_LINE_RIGHT, "m-toggle-line-right" },
{ LyXTabular::M_ALIGN_LEFT, "m-align-left" },
{ LyXTabular::M_ALIGN_RIGHT, "m-align-right" },
{ LyXTabular::M_ALIGN_CENTER, "m-align-center" },
{ LyXTabular::M_VALIGN_TOP, "m-valign-top" },
{ LyXTabular::M_VALIGN_BOTTOM, "m-valign-bottom" },
{ LyXTabular::M_VALIGN_CENTER, "m-valign-center" },
{ LyXTabular::DELETE_TABULAR, "delete-tabular" },
{ LyXTabular::MULTICOLUMN, "multicolumn" },
{ LyXTabular::SET_ALL_LINES, "set-all-lines" },
{ LyXTabular::UNSET_ALL_LINES, "unset-all-lines" },
{ LyXTabular::SET_LONGTABULAR, "set-longtabular" },
{ LyXTabular::UNSET_LONGTABULAR, "unset-longtabular" },
{ LyXTabular::SET_PWIDTH, "set-pwidth" },
{ LyXTabular::SET_MPWIDTH, "set-mpwidth" },
{ LyXTabular::SET_ROTATE_TABULAR, "set-rotate-tabular" },
{ LyXTabular::UNSET_ROTATE_TABULAR, "unset-rotate-tabular" },
{ LyXTabular::SET_ROTATE_CELL, "set-rotate-cell" },
{ LyXTabular::UNSET_ROTATE_CELL, "unset-rotate-cell" },
{ LyXTabular::SET_LINEBREAKS, "set-linebreaks" },
{ LyXTabular::SET_LTHEAD, "set-lthead" },
{ LyXTabular::SET_LTFIRSTHEAD, "set-ltfirsthead" },
{ LyXTabular::SET_LTFOOT, "set-ltfoot" },
{ LyXTabular::SET_LTLASTFOOT, "set-ltlastfoot" },
{ LyXTabular::SET_LTNEWPAGE, "set-ltnewpage" },
{ LyXTabular::SET_SPECIAL_COLUMN, "set-special-column" },
{ LyXTabular::SET_SPECIAL_MULTI, "set-special-multi" },
{ LyXTabular::LAST_ACTION, "" }
};
}
InsetTabular::~InsetTabular() InsetTabular::~InsetTabular()
{ {
delete tabular; delete tabular;
@ -722,6 +835,11 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
dialogs_->showTabular(this); dialogs_->showTabular(this);
} }
break; break;
case LFUN_TABULAR_FEATURE:
if (!TabularFeatures(bv, arg))
result = UNDISPATCHED;
break;
default: default:
result = UNDISPATCHED; result = UNDISPATCHED;
break; break;
@ -1031,6 +1149,28 @@ void InsetTabular::SetFont(BufferView * bv, LyXFont const & font, bool tall)
} }
bool InsetTabular::TabularFeatures(BufferView * bv, string what)
{
int action = LyXTabular::LAST_ACTION;
string val;
int i;
for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
tabularFeatures[i].feature.length())) {
action = tabularFeatures[i].action;
break;
}
}
if (action == LyXTabular::LAST_ACTION)
return false;
val = frontStrip(what.substr(tabularFeatures[i].feature.length()));
TabularFeatures(bv, action, val);
return true;
}
void InsetTabular::TabularFeatures(BufferView * bv, int feature, string val) void InsetTabular::TabularFeatures(BufferView * bv, int feature, string val)
{ {
int int
@ -1405,10 +1545,9 @@ int InsetTabular::getMaxWidth(Painter & pain,
if (cell >= n) if (cell >= n)
return -1; return -1;
int w = GetMaxWidthOfCell(pain, cell); int w = GetMaxWidthOfCell(pain, cell);
// this because text insets remove the xpos from the maxwidth because if (w > 0)
// otherwise the would not break good!!! // because the inset then subtracts it's top_x
// w += getCellXPos(cell) + tabular->GetBeginningOfTextInCell(cell); w += inset->x();
// w += inset->x();
return w; return w;
} }

View File

@ -148,6 +148,8 @@ public:
/// ///
void ToggleInsetCursor(BufferView *); void ToggleInsetCursor(BufferView *);
/// ///
bool TabularFeatures(BufferView * bv, string what);
///
void TabularFeatures(BufferView * bv, int feature, string val = string()); void TabularFeatures(BufferView * bv, int feature, string val = string());
/// ///
int GetActCell() { return actcell; } int GetActCell() { return actcell; }
@ -167,6 +169,7 @@ public:
LyXTabular * tabular; LyXTabular * tabular;
private: private:
bool calculate_dimensions_of_cells(BufferView *, LyXFont const &, bool calculate_dimensions_of_cells(BufferView *, LyXFont const &,
bool =false) const; bool =false) const;
/// ///
@ -206,6 +209,8 @@ private:
int GetMaxWidthOfCell(Painter &, int cell) const; int GetMaxWidthOfCell(Painter &, int cell) const;
/// ///
void recomputeTextInsets(BufferView *, const LyXFont &) const; void recomputeTextInsets(BufferView *, const LyXFont &) const;
///
void initFeatures();
/// ///
/// Private structures and variables /// Private structures and variables

View File

@ -234,19 +234,14 @@ int InsetText::textWidth(Painter & pain) const
{ {
int w = getMaxWidth(pain, this); int w = getMaxWidth(pain, this);
if (w < 0) { if (w < 0) {
// printf("WW1: %d\n",w);
return w; return w;
} }
#if 1
if (owner()) { if (owner()) {
w = w - top_x + owner()->x(); w = w - top_x + owner()->x();
// printf("WW2: %d\n",w); return w;
return w; // - top_x + owner()->x();
} }
#endif
w -= (2 * TEXT_TO_INSET_OFFSET); w -= (2 * TEXT_TO_INSET_OFFSET);
// printf("WW2: %d\n",w); return w - top_x;
return w - top_x; // - top_x - (2 * TEXT_TO_INSET_OFFSET);
} }

View File

@ -911,6 +911,12 @@ string LyXFunc::Dispatch(int ac,
#endif #endif
break; break;
case LFUN_TABULAR_FEATURE:
// this is not handled here as this funktion is only aktive
// if we have a locking_inset and that one is (or contains)
// a tabular-inset
break;
case LFUN_FIGURE: case LFUN_FIGURE:
Figure(); Figure();
break; break;

View File

@ -75,7 +75,8 @@ public:
SET_LTLASTFOOT, SET_LTLASTFOOT,
SET_LTNEWPAGE, SET_LTNEWPAGE,
SET_SPECIAL_COLUMN, SET_SPECIAL_COLUMN,
SET_SPECIAL_MULTI SET_SPECIAL_MULTI,
LAST_ACTION
}; };
enum { enum {