From: Jürgen Vigna Date: Thu, 22 Jun 2000 09:30:43 +0000 (+0000) Subject: Language patch from Dekel and fixed formula[macro] as I forgot yesterday. X-Git-Tag: 1.6.10~22162 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=87207b19395778ce091ba43b51ffe24dbbb3db90;p=features.git Language patch from Dekel and fixed formula[macro] as I forgot yesterday. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@827 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 7f16f75021..b9f48eac0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-06-22 Juergen Vigna + + * src/mathed/formulamacro.[Ch]: + * src/mathed/formula.[Ch]: changed prototype of draw() and GetCursorPos + 2000-06-21 Juergen Vigna * 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 + + * 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 * src/insets/insettext.C (SetParagraphData): set insetowner on diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 67782547a6..74fb3de387 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -122,7 +122,7 @@ void changeDepth(BufferView * bv, int decInc) void Free(BufferView * bv) { - ToggleAndShow(bv, UserFreeFont()); + ToggleAndShow(bv, UserFreeFont(bv->buffer()->params)); } diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 73d595d2f7..12cef90b2b 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -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; } diff --git a/src/lyx_cb.h b/src/lyx_cb.h index 295c80d4db..e0fcb07b7a 100644 --- a/src/lyx_cb.h +++ b/src/lyx_cb.h @@ -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 diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 18b007ae4c..e80bc7a0a1 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -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()); diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 74e2cc0ce4..4980f5c7d9 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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; diff --git a/src/mathed/formula.h b/src/mathed/formula.h index 5cb6a47b8d..5d96703cf3 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -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); /// diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 503fa7be6d..6f7e06bd8b 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -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); diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index 7f2342dfc8..ecbf0ea60e 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -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); ///