]> git.lyx.org Git - features.git/commitdiff
Language patch from Dekel and fixed formula[macro] as I forgot yesterday.
authorJürgen Vigna <jug@sad.it>
Thu, 22 Jun 2000 09:30:43 +0000 (09:30 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 22 Jun 2000 09:30:43 +0000 (09:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@827 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/bufferview_funcs.C
src/lyx_cb.C
src/lyx_cb.h
src/lyx_gui.C
src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulamacro.C
src/mathed/formulamacro.h

index 7f16f75021812f49385cb1c84d4ffe039765f6a9..b9f48eac0ec25b4e9a7b48d9ba3b4fceacfe512d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-22  Juergen Vigna  <jug@sad.it>
+
+       * src/mathed/formulamacro.[Ch]:
+       * src/mathed/formula.[Ch]: changed prototype of draw() and GetCursorPos
+
 2000-06-21  Juergen Vigna  <jug@sad.it>
 
        * src/text.C (GetVisibleRow): look if I should clear the area or not
@@ -8,6 +13,14 @@
 
        * src/text2.C (UpdateInset): return bool insted of int
 
+2000-06-20  Dekel Tsur  <dekel@math.tau.ac.il>
+
+       * src/lyx_gui.C (create_forms): Add "Reset" option to the language 
+       combox in the character popup
+
+       * src/lyx_cb.C (UserFreeFont): Add argument to the method:
+       BufferParams const & params
+
 2000-06-20  Juergen Vigna  <jug@sad.it>
 
        * src/insets/insettext.C (SetParagraphData): set insetowner on
index 67782547a678b3ea0ee7f8504da5e655ea0d9375..74fb3de3878875ead3a59d46d8b28ca4ccdc04c0 100644 (file)
@@ -122,7 +122,7 @@ void changeDepth(BufferView * bv, int decInc)
 
 void Free(BufferView * bv)
 {
-       ToggleAndShow(bv, UserFreeFont());
+       ToggleAndShow(bv, UserFreeFont(bv->buffer()->params));
 }
 
 
index 73d595d2f7bae9778cc2813ea64fa63446a5ad36..12cef90b2bb487dcd01914f22ef31bb17e00463a 100644 (file)
@@ -1910,7 +1910,7 @@ void MenuLayoutSave()
 
 // This is both GUI and LyXFont dependent. Don't know where to put it. (Asger)
 // Well, it's mostly GUI dependent, so I guess it will stay here. (Asger)
-LyXFont UserFreeFont()
+LyXFont UserFreeFont(BufferParams const & params)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
 
@@ -1992,20 +1992,18 @@ LyXFont UserFreeFont()
        case 11: font.setColor(LColor::inherit); break;
        }
 
-       string language = combo_language2->getline();
-       Languages::iterator lit = languages.find(language);
-       if (lit != languages.end()) 
-               font.setLanguage(&(*lit).second);
-       else
-               font.setLanguage(ignore_language);
-
+       int choice = combo_language2->get();
+       if (choice == 1)
+               font.setLanguage(ignore_language);
+       else if (choice == 2)
+               font.setLanguage(params.language_info);
+       else
+               font.setLanguage(&languages[combo_language2->getline()]);
 
        return font; 
 }
 
 
-
-
 /* callbacks for form form_title */
 extern "C" void TimerCB(FL_OBJECT *, long)
 {
@@ -2168,7 +2166,7 @@ extern "C" void CharacterApplyCB(FL_OBJECT *, long)
        // we set toggleall locally here, since it should be true for
        // all other uses of ToggleAndShow() (JMarc)
        toggleall = fl_get_button(fd_form_character->check_toggle_all);
-       ToggleAndShow(current_view, UserFreeFont());
+       ToggleAndShow(current_view, UserFreeFont(current_view->buffer()->params));
        current_view->setState();
        toggleall = true;
 }
index 295c80d4dbb50b143fe4da31cfba149847284ab8..e0fcb07b7ad16c5ee769df04dce962ca79f08e9d 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef LYX_CB_H
 #define LYX_CB_H
 
+class BufferParams;
+
 ///
 extern bool quitting;
 extern bool toggleall;
@@ -9,7 +11,7 @@ extern bool toggleall;
 // When still false after reading lyxrc, warn user
 //about failing \bind_file command. RVDK_PATCH_5
 extern bool BindFileSet;
-extern LyXFont UserFreeFont();
+extern LyXFont UserFreeFont(BufferParams const & params);
 
 #endif
 
index 18b007ae4c9cbc7a90cb488273872e24931a3d8c..e80bc7a0a16c7c9c89cafda8a8a26f1d5700cd34 100644 (file)
@@ -399,7 +399,8 @@ void LyXGUI::create_forms()
 
        // "default" is not part of the languages array any more.
        combo_language->addto("default");
-       combo_language2->addto("No change");
+       combo_language2->addto(_("No change"));
+       combo_language2->addto(_("Reset"));
        for(Languages::const_iterator cit = languages.begin();
            cit != languages.end(); ++cit) {
                combo_language->addto((*cit).second.lang().c_str());
index 74e2cc0ce4a39932e542c1e407eb52f1e298fd71..4980f5c7d9bd2a414d5175cf7fb56e68baac17ee 100644 (file)
@@ -403,9 +403,10 @@ int InsetFormula::width(Painter &, LyXFont const & f) const
 }
 
 
-void InsetFormula::draw(Painter & pain, LyXFont const & f,
+void InsetFormula::draw(BufferView * bv, LyXFont const & f,
                        int baseline, float & x) const
 {
+       Painter & pain = bv->painter();
        // Seems commenting out solves a problem.
        LyXFont font = mathed_get_font(LM_TC_TEXTRM, LM_ST_TEXT);
        font.setSize(f.size());
@@ -507,7 +508,7 @@ void InsetFormula::InsertSymbol(BufferView * bv, char const * s)
 }
 
    
-void InsetFormula::GetCursorPos(int& x, int& y) const
+void InsetFormula::GetCursorPos(BufferView *, int& x, int& y) const
 {
     mathcursor->GetPos(x, y);
     x -= par->xo; 
index 5cb6a47b8d885726a9713d6f992b2dffbb9c5908..5d96703cf305a3289a81bca1bc8272e8a88e11bf 100644 (file)
@@ -47,7 +47,7 @@ public:
        ///
        int width(Painter &, LyXFont const &) const;
        ///
-       void draw(Painter &, LyXFont const &, int baseline, float & x) const;
+       void draw(BufferView *,LyXFont const &, int baseline, float & x) const;
        ///
        void Write(Buffer const *, std::ostream &) const;
        ///
@@ -88,7 +88,7 @@ public:
        ///
        void HideInsetCursor(BufferView *);
        ///
-       void GetCursorPos(int &, int &) const;
+       void GetCursorPos(BufferView *, int &, int &) const;
        ///
        void ToggleInsetSelection(BufferView * bv);
        ///
index 503fa7be6d147087a5c980c415889a79f216c387..6f7e06bd8b3910d59d42a8b8369a2043561ff764 100644 (file)
@@ -146,14 +146,15 @@ int InsetFormulaMacro::width(Painter & pain, LyXFont const & f) const
 }
 
 
-void InsetFormulaMacro::draw(Painter & pain, LyXFont const & f,
+void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
                             int baseline, float & x) const
 {
+       Painter & pain = bv->painter();
        LyXFont font(f);
        tmacro->update();
        if (opened) {
                tmacro->setEditMode(true);
-               InsetFormula::draw(pain, font, baseline, x);
+               InsetFormula::draw(bv, font, baseline, x);
                tmacro->setEditMode(false);     
        } else {
                font.setColor(LColor::math);
index 7f2342dfc8ed22dee84884e8ba67b045dbb08d91..ecbf0ea60e284d2a7e77a50610f41e5f55f31faf 100644 (file)
@@ -43,7 +43,7 @@ public:
        ///
        int width(Painter &, LyXFont const &) const;
        ///
-       void draw(Painter &, LyXFont const &, int baseline, float & x) const;
+       void draw(BufferView *,LyXFont const &, int baseline, float & x) const;
        ///
        void Read(Buffer const *, LyXLex & lex);
         ///