]> git.lyx.org Git - features.git/commitdiff
Added OpenInsetDialog() function for UpdatableInset's and implemented it
authorJürgen Vigna <jug@sad.it>
Mon, 26 Mar 2001 14:47:34 +0000 (14:47 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 26 Mar 2001 14:47:34 +0000 (14:47 +0000)
for InsetText, InsetTabular and InsetMinipage.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1828 a592a061-630c-0410-9148-cb99ea01b6c8

po/POTFILES.in
src/insets/ChangeLog
src/insets/insetminipage.C
src/insets/insetminipage.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/lyxinset.h

index 7b50b589dc7039560c68e52506ff18aaa816c03c..07541bd66be879473f84719bd08c834957bf4126 100644 (file)
@@ -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
index 0ef55349de32be50eb0ef784bf800b89998ad4e3..f684408326f73036b02d6c6572bda30ef8958f6c 100644 (file)
@@ -1,3 +1,13 @@
+2001-03-26  Juergen Vigna  <jug@sad.it>
+
+       * 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  <a.leeming@ic.ac.uk>
 
        * insetinclude.[Ch]: rename InsetInclude::InsetIncludeParams as
index 3424835567afcf4082e2007c02ea3f66666da368..ffec4c3848da64cfda4fe47d6294be023903043c 100644 (file)
@@ -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<InsetMinipage *>(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);
index 14333f96fa9804c5afa786665f7490e1d13b2bd1..e324f27a3efba19168a0d3b192ca0103e967e017 100644 (file)
@@ -90,6 +90,8 @@ public:
        int getMaxWidth(Painter &, UpdatableInset const *) const;
        ///
        bool needFullRow() const { return false; }
+       ///
+       bool ShowInsetDialog(BufferView *) const;
 private:
        ///
        Position pos_;
index e8e33174ef1fbac17ced72810b5bb05eee889883..cce5b9affc976ddaccdae88fde4a7fd115c91d24 100644 (file)
@@ -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<InsetTabular *>(this));
+    return true;
+}
+
+
 void InsetTabular::OpenLayoutDialog(BufferView * bv) const
 {
     if (the_locking_inset) {
index 929ac624ed2a370708d9988a1d276ac8378da519..da12246a229dd727a7940d651df379d0ed7e730a 100644 (file)
@@ -169,6 +169,8 @@ public:
     ///
     void OpenLayoutDialog(BufferView *) const;
     ///
+    bool ShowInsetDialog(BufferView *) const;
+    ///
     LyXFunc::func_status getStatus(string const & argument) const;
 
     //
index 9fa4836a43a7ac0af09264597fb4024c3ecb1edf..5a7dd6ac1f38a1d7a28f18688fea891783a6b058 100644 (file)
@@ -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) {
index cbc66e44ac3453aa319fdd2951d3e1a53cd8b1ec..e464507de04cb465f507cac45844a2b8ab6b2d0b 100644 (file)
@@ -176,6 +176,8 @@ public:
     ///
     void resizeLyXText(BufferView *) const;
     ///
+    bool ShowInsetDialog(BufferView *) const;
+    ///
     LyXParagraph * par;
     ///
     mutable int need_update;
index a4804875bb00b7f5e70fe03bd6723a241d31b278..240b08841ef0c779f19fe65a802d004915073567 100644 (file)
@@ -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:
        ///