From: Jean-Marc Lasgouttes Date: Thu, 6 Sep 2001 12:42:47 +0000 (+0000) Subject: do not display obsolete layouts in combox + small stuff X-Git-Tag: 1.6.10~20651 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e297ba53fbda25fc3750c6bd133b1c126e72e01e;p=features.git do not display obsolete layouts in combox + small stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2699 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 4e114484a7..a4dcb4cfa5 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,12 @@ +2001-09-06 Jean-Marc Lasgouttes + + * examples/da_splash.lyx: new translation from Claus Hindsgaul + + * ui/default.ui: comment out reference manual from the help menu + (the reference manual is now obsolete). + + * layouts/cv.layout: add ObsoletedBy version of SubSection + 2001-09-05 Jean-Marc Lasgouttes * kbd/koi8-r.kmap: update from Vitaly Lipatov diff --git a/lib/examples/da_splash.lyx b/lib/examples/da_splash.lyx new file mode 100644 index 0000000000..d578940b99 --- /dev/null +++ b/lib/examples/da_splash.lyx @@ -0,0 +1,175 @@ +#LyX 1.1 created this file. For more info see http://www.lyx.org/ +\lyxformat 218 +\textclass article +\language danish +\inputencoding default +\fontscheme default +\graphics default +\paperfontsize default +\spacing single +\papersize Default +\paperpackage a4 +\use_geometry 0 +\use_amsmath 0 +\paperorientation portrait +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\defskip medskip +\quotes_language english +\quotes_times 2 +\papercolumns 1 +\papersides 1 +\paperpagestyle default + +\layout Title + +Velkommen til LyX! +\layout Section* + +7 ting du bør vide om brugen af LyX +\layout Enumerate + +LyX indeholder grundig dokumentation --- brug den! Start med +\family sans +\bar under +H +\bar default +jælp\SpecialChar \menuseparator + +\bar under +I +\bar default +ntroduktion +\family default +, som vil give dig et meget kort overblik over dokumentationen\SpecialChar \@. + Lær derefter + om LyX med +\family sans + +\bar under +H +\bar default +jælp\SpecialChar \menuseparator + +\bar under +G +\bar default +ennemgang\SpecialChar \@. + +\layout Enumerate + +LyX er, hvad vi kalder en +\begin_inset Quotes eld +\end_inset + +dokument behandler +\begin_inset Quotes erd +\end_inset + +\SpecialChar \@. + Den er grundlæggende forskellig fra almindelige tekstbehandlere --- på + en måde letter det skrivning af dokumenter\SpecialChar \@. + Men bare rolig, den er kun en + smule anderledes\SpecialChar \@. + Dokumentationen vil gøre dette tydeligt for dig +\begin_float footnote +\layout Standard + +Fik vi nævnt, at du bør læse dokumentationen? +\end_float +. +\layout Enumerate + +Resultaterne fra LyX ser fantastiske ud! Vælg +\family sans +\bar under +V +\bar default +is\SpecialChar \menuseparator + +\bar under +D +\bar default +VI +\family default + nu, så kan du selv se. +\layout Enumerate + +Ja, LyX kan efterligne (næsten) al LaTeX's funktioner\SpecialChar \@. + Og ja, LyX kan importere + LaTeX-filer\SpecialChar \@. + Erfarne LaTeX-brugere kan skimme resten af +\emph on +Gennemgangen +\emph default + og derefter læse afsnittet +\begin_inset Quotes eld +\end_inset + +LyX for LaTeX-brugere +\begin_inset Quotes erd +\end_inset + +\SpecialChar \@. + (Alle andre: bare rolig, du behøver ikke at kende noget til LaTeX for at + kunne bruge LyX\SpecialChar \@. +) +\layout Enumerate + +Yes, LyX can mimic (almost) all LaTeX functionality. + And yes, LyX can import LaTeX files. + Experienced LaTeX users should skim the rest of the +\emph on +Tutorial +\emph default +, then read the +\begin_inset Quotes eld +\end_inset + +LyX for LaTeX Users +\begin_inset Quotes erd +\end_inset + + chapter. + (Everyone else: don't worry, you don't need to know LaTeX to use LyX.) +\layout Enumerate + +LyX har mange funktioner for dem, der læser eller skriver på andre sprog + end engelsk\SpecialChar \@. + Derover kan tastebindinger, værktøjslinie og mange andre egenskaber + kan ændres (de fleste ved at rette i +\family typewriter +lyxrc +\family default +-filen). + Se +\family sans +\bar under +H +\bar default +jælp\SpecialChar \menuseparator + +\bar under +P +\bar default +ersonliggørelse +\family default + for detaljer\SpecialChar \@. + +\layout Enumerate + +LyX's hjemmeside er på +\family typewriter + +\begin_inset LatexCommand \url{http://www.lyx.org/} + +\end_inset + + +\family default +\SpecialChar \@. + Find oplysninger om LyX, abonnér på LyX's postlister, tag en grafisk rundtur + m.m\SpecialChar \@. + +\the_end diff --git a/lib/layouts/cv.layout b/lib/layouts/cv.layout index ab74d1b289..e681a8a843 100644 --- a/lib/layouts/cv.layout +++ b/lib/layouts/cv.layout @@ -53,6 +53,11 @@ Style Subsection LeftMargin MMM End +# we used to have this version with wrong case +Style SubSection + ObsoletedBy Subsection +End + # Topic style definition Style Topic Margin Manual diff --git a/lib/ui/default.ui b/lib/ui/default.ui index 3be80218eb..2d20d8d936 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -1,7 +1,7 @@ -# This is the default LyX user interface definition file. The syntax -# should be straightforward enough. The menubar "main_nobuffer" (if it -# exists) is used when there is no buffer open; otherwise, the menubar -# "main" is used. +# This is the default LyX user interface definition file. -*- text -*- +# The syntax should be straightforward enough. The menubar +# "main_nobuffer" (if it exists) is used when there is no buffer open; +# otherwise, the menubar "main" is used. Menuset @@ -323,7 +323,7 @@ Menuset Item "User's Guide|U" "help-open UserGuide" Item "Extended Features|E" "help-open Extended" Item "Customization|C" "help-open Customization" - Item "Reference Manual|R" "help-open Reference" +# Item "Reference Manual|R" "help-open Reference" Item "FAQ|F" "help-open FAQ" Item "Table of Contents|a" "help-open TOC" Item "Known Bugs|K" "help-open BUGS" diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index e706cc2565..d9ad8b43a2 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,14 @@ +2001-09-06 Jean-Marc Lasgouttes + + * Toolbar_pimpl.C (updateLayoutList): do not display obsolete + layouts + (layoutSelected): remove the numeric argument and use the text of + the combox entry instead. + + * combox.C: lowercase a few remaining methods, rename select_text + to select + * several files: propagate these changes + 2001-09-03 Angus Leeming * FormPreferences.C: add fl_set_input_return to input_paperoption. diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index 57aa52abc2..01fe39f2f8 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -100,7 +100,7 @@ void FormCharacter::build() cit != language.end(); ++cit) { combo_language2_->addto(*cit); } - combo_language2_->select_text(*language.begin()); + combo_language2_->select(*language.begin()); // Manage the ok, apply and cancel/close buttons bc().setApply(dialog_->button_apply); @@ -171,7 +171,7 @@ void FormCharacter::update() pos = int(findPos(color_, controller().getColor())); fl_set_choice(dialog_->choice_color, pos+1); - combo_language2_->select_text(controller().getLanguage()); + combo_language2_->select(controller().getLanguage()); fl_set_button(dialog_->check_toggle_all, controller().getToggleAll()); } diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index b88a029bcd..9e1bc808f4 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -610,7 +610,7 @@ void FormDocument::class_update(BufferParams const & params) LyXTextClass const & tclass = textclasslist.TextClass(params.textclass); - combo_doc_class->select_text( + combo_doc_class->select( textclasslist.DescOfClass(params.textclass)); fl_set_choice_text(class_->choice_doc_fonts, params.fonts.c_str()); fl_clear_choice(class_->choice_doc_fontsize); @@ -698,7 +698,7 @@ void FormDocument::language_update(BufferParams const & params) if (!language_.get()) return; - combo_language->select_text(params.language->lang()); + combo_language->select(params.language->lang()); fl_set_choice_text(language_->choice_inputenc, params.inputenc.c_str()); fl_set_choice(language_->choice_quotes_language, params.quotes_language + 1); fl_set_button(language_->radio_single, 0); diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index fe1d60ddce..0d113c6072 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -1781,7 +1781,7 @@ void FormPreferences::Language::update() fl_set_button(dialog_->check_use_kbmap, lyxrc.use_kbmap); - combo_default_lang->select_text(lyxrc.default_language); + combo_default_lang->select(lyxrc.default_language); if (lyxrc.use_kbmap) { fl_set_input(dialog_->input_kbmap1, diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index dae43e651a..11896ca641 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -146,18 +146,17 @@ extern "C" int C_Toolbar_BubblePost(FL_OBJECT * ob, int event, // this one is not "C" because combox callbacks are really C++ %-| -void Toolbar::Pimpl::layoutSelectedCB(int sel, void * arg, Combox *) +void Toolbar::Pimpl::layoutSelectedCB(int, void * arg, Combox *) { Toolbar::Pimpl * tb = reinterpret_cast(arg); - tb->layoutSelected(sel); + tb->layoutSelected(); } -void Toolbar::Pimpl::layoutSelected(int sel) +void Toolbar::Pimpl::layoutSelected() { - string const tmp = tostr(sel); - owner->getLyXFunc()->dispatch(LFUN_LAYOUTNO, tmp); + owner->getLyXFunc()->dispatch(LFUN_LAYOUT, combox->getline()); } @@ -218,8 +217,12 @@ void Toolbar::Pimpl::update() void Toolbar::Pimpl::setLayout(int layout) { - if (combox) - combox->select(layout+1); + if (combox) { + LyXTextClass const & tc = + textclasslist.TextClass(owner->buffer()-> + params.textclass); + combox->select(tc[layout].name()); + } } @@ -237,14 +240,13 @@ void Toolbar::Pimpl::updateLayoutList(bool force) LyXTextClass::const_iterator end = tc.end(); for (LyXTextClass::const_iterator cit = tc.begin(); cit != end; ++cit) { + // ignore obsolete entries if (cit->obsoleted_by().empty()) combox->addline(_(cit->name())); - else - combox->addline("@N" + _(cit->name())); } } // we need to do this. - combox->Redraw(); + combox->redraw(); } @@ -252,7 +254,7 @@ void Toolbar::Pimpl::clearLayoutList() { if (combox) { combox->clear(); - combox->Redraw(); + combox->redraw(); } } @@ -260,7 +262,7 @@ void Toolbar::Pimpl::clearLayoutList() void Toolbar::Pimpl::openLayoutList() { if (combox) - combox->Show(); + combox->show(); } diff --git a/src/frontends/xforms/Toolbar_pimpl.h b/src/frontends/xforms/Toolbar_pimpl.h index b2a58b7aaf..6eea76f594 100644 --- a/src/frontends/xforms/Toolbar_pimpl.h +++ b/src/frontends/xforms/Toolbar_pimpl.h @@ -70,8 +70,8 @@ public: void openLayoutList(); /// Erase the layout list void clearLayoutList(); - /// and the non-static version - void layoutSelected(int); + /// the non-static version of layoutSelectedCB + void layoutSelected(); /// struct toolbarItem diff --git a/src/frontends/xforms/combox.C b/src/frontends/xforms/combox.C index eac8d17352..9f1c54b79c 100644 --- a/src/frontends/xforms/combox.C +++ b/src/frontends/xforms/combox.C @@ -126,7 +126,7 @@ void Combox::addline(string const & text) } -bool Combox::select_text(string const & t) +bool Combox::select(string const & t) { if (!browser || t.empty()) return false; int const maxline = fl_get_browser_maxline(browser); @@ -158,7 +158,7 @@ void Combox::select(int i) void Combox::add(int x, int y, int w, int hmin, int hmax, FL_OBJECT * tabfolder1_, FL_OBJECT * tabfolder2_) { - // Store these for later use in working round an xforms bug in Show() + // Store these for later use in working round an xforms bug in show() tabfolder1 = tabfolder1_; tabfolder2 = tabfolder2_; @@ -243,14 +243,14 @@ Window save_window; } // namespace anon -void Combox::Redraw() +void Combox::redraw() { if (browser) fl_redraw_object(browser); if (button) fl_redraw_object(button); if (label) fl_redraw_object(label); } -void Combox::Show() +void Combox::show() { if (_pre) _pre(); @@ -305,7 +305,7 @@ void Combox::Show() XFlush(fl_get_display()); } -void Combox::Hide(int who) +void Combox::hide(int who) { if (!who && browser && label) { sel = fl_get_browser(browser); @@ -394,12 +394,12 @@ void Combox::combo_cb(FL_OBJECT * ob, long data) combo->cb_arg, combo); break; } - default: combo->Show(); break; + default: combo->show(); break; } break; } case 2: - combo->Hide(); + combo->hide(); break; } } @@ -422,7 +422,7 @@ int Combox::peek_event(FL_FORM * form, void * xev) static_cast(xev)->xbutton.x - ob->x > ob->w || static_cast(xev)->xbutton.y - ob->y < 0 || static_cast(xev)->xbutton.y - ob->y > ob->h)) { - combo->Hide(1); + combo->hide(1); return 1; } @@ -466,10 +466,10 @@ int Combox::peek_event(FL_FORM * form, void * xev) fl_get_browser(combo->browser)); return 1; case XK_Return: - combo->Hide(); + combo->hide(); return 1; case XK_Escape: - combo->Hide(1); + combo->hide(1); return 1; } return 0; diff --git a/src/frontends/xforms/combox.h b/src/frontends/xforms/combox.h index 8810d841ad..a98592530a 100644 --- a/src/frontends/xforms/combox.h +++ b/src/frontends/xforms/combox.h @@ -83,7 +83,7 @@ public: /// Select an arbitrary item void select(int); /// - bool select_text(string const &); + bool select(string const &); /// Clear all the list void clear(); @@ -117,9 +117,9 @@ public: /// void shortcut(string const &, int); /// - void Redraw(); + void redraw(); /// - void Show(); + void show(); /// static void combo_cb(FL_OBJECT *, long); /// @@ -128,7 +128,7 @@ public: static int peek_event(FL_FORM *, void *); protected: /// At least Hide should not be public - void Hide(int who = 0); + void hide(int who = 0); /// FL_OBJECT * browser; private: