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
This commit is contained in:
Jürgen Vigna 2000-06-22 09:30:43 +00:00
parent ccfdb2a78a
commit 87207b1939
9 changed files with 37 additions and 21 deletions

View File

@ -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

View File

@ -122,7 +122,7 @@ void changeDepth(BufferView * bv, int decInc)
void Free(BufferView * bv)
{
ToggleAndShow(bv, UserFreeFont());
ToggleAndShow(bv, UserFreeFont(bv->buffer()->params));
}

View 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;
}

View 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

View 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());

View 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;

View 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);
///

View 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);

View 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);
///