From: Jürgen Vigna Date: Mon, 26 Mar 2001 14:47:34 +0000 (+0000) Subject: Added OpenInsetDialog() function for UpdatableInset's and implemented it X-Git-Tag: 1.6.10~21399 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2f8ddf78eaf11e68eb31b56d2ef0a934782119c4;p=features.git Added OpenInsetDialog() function for UpdatableInset's and implemented it for InsetText, InsetTabular and InsetMinipage. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1828 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/po/POTFILES.in b/po/POTFILES.in index 7b50b589dc..07541bd66b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -68,7 +68,6 @@ src/frontends/kde/urldlg.C src/frontends/qt2/FileDialog.C src/frontends/qt2/FormCharacter.C src/frontends/qt2/FormCitation.C -src/frontends/qt2/FormCopyright.C src/frontends/qt2/FormDocument.C src/frontends/qt2/FormIndex.C src/frontends/qt2/FormParagraph.C @@ -82,67 +81,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 diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 0ef55349de..f684408326 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,13 @@ +2001-03-26 Juergen Vigna + + * lyxinset.h: added ShowInsetDialog() function in UpdatableInset. + + * insettext.C (ShowInsetDialog): implemented above function. + + * insettabular.C (ShowInsetDialog): ditto + + * insetminipage.C (ShowInsetDialog): ditto + 2001-03-23 Angus Leeming * insetinclude.[Ch]: rename InsetInclude::InsetIncludeParams as diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index 3424835567..ffec4c3848 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -339,22 +339,19 @@ void InsetMinipage::widthp(string const & ll) } +bool InsetMinipage::ShowInsetDialog(BufferView * bv) const +{ + if (!inset->ShowInsetDialog(bv)) + bv->owner()->getDialogs()->showMinipage(const_cast(this)); + return true; +} + + void InsetMinipage::InsetButtonRelease(BufferView * bv, int x, int y, int button) { if (button == 3) { -#if 0 -// we have to check first if we have a locking inset and if this locking inset -// has a popup menu with the 3rd button - if (the_locking_inset) { - UpdatableInset * i; - if ((i=the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))) { - i->InsetButtonRelease(bv, x, y, button); - return; - } - } -#endif - bv->owner()->getDialogs()->showMinipage(this); + ShowInsetDialog(bv); return; } InsetCollapsable::InsetButtonRelease(bv, x, y, button); diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index 14333f96fa..e324f27a3e 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -90,6 +90,8 @@ public: int getMaxWidth(Painter &, UpdatableInset const *) const; /// bool needFullRow() const { return false; } + /// + bool ShowInsetDialog(BufferView *) const; private: /// Position pos_; diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index e8e33174ef..cce5b9affc 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -763,6 +763,9 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, ShowInsetCursor(bv); return result; } + // this to avoid compiler warnings. + default: + break; } if (the_locking_inset) { @@ -1852,6 +1855,14 @@ LyXText * InsetTabular::getLyXText(BufferView const * bv, bool const recursive) } +bool InsetTabular::ShowInsetDialog(BufferView * bv) const +{ + if (!the_locking_inset || !the_locking_inset->ShowInsetDialog(bv)) + bv->owner()->getDialogs()->showTabular(const_cast(this)); + return true; +} + + void InsetTabular::OpenLayoutDialog(BufferView * bv) const { if (the_locking_inset) { diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 929ac624ed..da12246a22 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -169,6 +169,8 @@ public: /// void OpenLayoutDialog(BufferView *) const; /// + bool ShowInsetDialog(BufferView *) const; + /// LyXFunc::func_status getStatus(string const & argument) const; // diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 9fa4836a43..5a7dd6ac1f 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1434,6 +1434,14 @@ UpdatableInset * InsetText::GetFirstLockingInsetOfType(Inset::Code c) } +bool InsetText::ShowInsetDialog(BufferView * bv) const +{ + if (the_locking_inset) + return the_locking_inset->ShowInsetDialog(bv); + return false; +} + + void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall) { if (TEXT(bv)->selection) { diff --git a/src/insets/insettext.h b/src/insets/insettext.h index cbc66e44ac..e464507de0 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -176,6 +176,8 @@ public: /// void resizeLyXText(BufferView *) const; /// + bool ShowInsetDialog(BufferView *) const; + /// LyXParagraph * par; /// mutable int need_update; diff --git a/src/insets/lyxinset.h b/src/insets/lyxinset.h index a4804875bb..240b08841e 100644 --- a/src/insets/lyxinset.h +++ b/src/insets/lyxinset.h @@ -364,6 +364,8 @@ public: virtual int getMaxWidth(Painter & pain, UpdatableInset const *) const; /// int scroll() const { return scx; } + /// + virtual bool ShowInsetDialog(BufferView *) const { return false; } protected: ///