diff --git a/ChangeLog b/ChangeLog index 75ef23c418..ee33f1f804 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-01-12 John Levon + + * configure.in: change for Aiksaurus 0.14 + 2002-01-08 Jean-Marc Lasgouttes * configure.in: remove test for -lpt on SCO. Hopefully it is not diff --git a/configure.in b/configure.in index 9ac69afd0c..4877da3d8e 100644 --- a/configure.in +++ b/configure.in @@ -112,12 +112,12 @@ dnl -lc and -lm as args to the compiler AC_CHECK_LIB(m, sin) AC_CHECK_LIB(c, fopen) AC_ARG_WITH(aiksaurus, - [ --without-aiksaurus do not use the AikSaurus library], + [ --without-aiksaurus do not use the Aiksaurus library], [lyx_use_aiksaurus=$withval]) if test x$lyx_use_aiksaurus != xno; then -AC_CHECK_LIB(AikSaurus, main, +AC_CHECK_LIB(Aiksaurus, main, [AC_DEFINE(HAVE_LIBAIKSAURUS,,[Define this if you have the AikSaurus library]) - AIKSAURUS_LIBS="-lAikSaurus -lbz2" + AIKSAURUS_LIBS="-lAiksaurus -lbz2" ],,"-lbz2") fi AC_SUBST(AIKSAURUS_LIBS) diff --git a/src/ChangeLog b/src/ChangeLog index 8e97bb3d4e..d71edadeaa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-01-13 John Levon + + * Thesaurus.h: + * Thesaurus.C: update for Aiksaurus 0.14 + 2002-01-13 Lars Gullik Bjønnes * text2.C (firstParagraph): removed member function, all uses diff --git a/src/Thesaurus.C b/src/Thesaurus.C index 785332c510..e41ecf5fb0 100644 --- a/src/Thesaurus.C +++ b/src/Thesaurus.C @@ -10,31 +10,15 @@ #include "Thesaurus.h" +#include + Thesaurus thesaurus; #ifdef HAVE_LIBAIKSAURUS -Thesaurus::ThesaurusEntry::ThesaurusEntry(string const & ent, char part) - : entry(ent), pos(Thesaurus::NONE) -{ - if (part & AikSaurus::Unknown) - pos |= OTHER; - if (part & AikSaurus::Other) - pos |= OTHER; - if (part & AikSaurus::Noun) - pos |= NOUN; - if (part & AikSaurus::Verb) - pos |= VERB; - if (part & AikSaurus::Adjective) - pos |= ADJECTIVE; - if (part & AikSaurus::Adverb) - pos |= ADVERB; -} - - Thesaurus::Thesaurus() { - aik_ = new AikSaurus; + aik_ = new Aiksaurus; } @@ -44,31 +28,46 @@ Thesaurus::~Thesaurus() } -std::vector Thesaurus::lookup(string const & text) +Thesaurus::Meanings Thesaurus::lookup(string const & text) { - std::vector entries; + Meanings meanings; if (!aik_->find(text.c_str())) - return entries; + return meanings; - char pos; + // weird api, but ... + + int prev_meaning = -1; + int cur_meaning; + string meaning; - string ret = aik_->next(pos); + // correct, returns "" at the end + string ret = aik_->next(cur_meaning); + while (!ret.empty()) { - entries.push_back(ThesaurusEntry(ret, pos)); - ret = aik_->next(pos); + if (cur_meaning != prev_meaning) { + meaning = ret; + ret = aik_->next(cur_meaning); + prev_meaning = cur_meaning; + } else { + if (ret != text) { + meanings[meaning].push_back(ret); + } + } + + ret = aik_->next(cur_meaning); } - return entries; + for (Meanings::iterator it = meanings.begin(); + it != meanings.end(); ++it) { + std::sort(it->second.begin(), it->second.end()); + } + + return meanings; } #else -Thesaurus::ThesaurusEntry::ThesaurusEntry(string const &, char) -{ -} - - Thesaurus::Thesaurus() { } @@ -79,10 +78,9 @@ Thesaurus::~Thesaurus() } -std::vector -Thesaurus::lookup(string const & /*text*/) +Thesaurus::Meanings Thesaurus::lookup(string const &) { - return std::vector(); + return Meanings(); } #endif // HAVE_LIBAIKSAURUS diff --git a/src/Thesaurus.h b/src/Thesaurus.h index 2a897f01ba..083fcef223 100644 --- a/src/Thesaurus.h +++ b/src/Thesaurus.h @@ -11,10 +11,11 @@ #define THESAURUS_H #include +#include #include "LString.h" #ifdef HAVE_LIBAIKSAURUS -#include "AikSaurus.h" +#include "Aiksaurus.h" #endif /** @@ -28,38 +29,16 @@ public: /// ~Thesaurus(); - /** - * enum of possible part of speech types - */ - enum POS { - NONE = 0x0, - OTHER = 0x01, - NOUN = 0x02, - VERB = 0x04, - ADJECTIVE = 0x08, - ADVERB = 0x10 - }; - - /** - * an individual entry from the thesaurus - */ - struct ThesaurusEntry { - /// - ThesaurusEntry(const string & ent, char pos); - /// the actual entry - string entry; - /// entry's part of speech - int pos; - }; - + typedef std::map > Meanings; + /** * look up some text in the thesaurus */ - std::vector lookup(string const & text); + Meanings lookup(string const & text); private: #ifdef HAVE_LIBAIKSAURUS - AikSaurus * aik_; + Aiksaurus * aik_; #endif }; diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index a4c537f120..46bbb93905 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2002-01-12 John Levon + + * ControlThesaurus.h: + * ControlThesaurus.C: update to Aiksaurus 0.14 + 2002-01-07 Angus Leeming * ControlSpellchecker.C (clearParams): show the closing message diff --git a/src/frontends/controllers/ControlThesaurus.C b/src/frontends/controllers/ControlThesaurus.C index c905829561..d780619795 100644 --- a/src/frontends/controllers/ControlThesaurus.C +++ b/src/frontends/controllers/ControlThesaurus.C @@ -59,21 +59,10 @@ void ControlThesaurus::replace(string const & newstr) } -std::vector -ControlThesaurus::getEntries(string const & str, Thesaurus::POS pos) +Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str) { if (str != laststr_) - entries_ = thesaurus.lookup(str); + meanings_ = thesaurus.lookup(str); - laststr_ = str; - - std::vector strs; - - for (std::vector::const_iterator it = entries_.begin(); - it != entries_.end(); ++it) { - if (it->pos & pos) - strs.push_back(it->entry); - } - - return strs; + return meanings_; } diff --git a/src/frontends/controllers/ControlThesaurus.h b/src/frontends/controllers/ControlThesaurus.h index 5c316b2d22..ca26ed6c28 100644 --- a/src/frontends/controllers/ControlThesaurus.h +++ b/src/frontends/controllers/ControlThesaurus.h @@ -34,41 +34,20 @@ public: /// show dialog virtual void showEntry(string const & str); - /// get noun entries - std::vector getNouns(string const & str) { - return getEntries(str, Thesaurus::NOUN); - } - /// get verb entries - std::vector getVerbs(string const & str) { - return getEntries(str, Thesaurus::VERB); - } - /// get adjective entries - std::vector getAdjectives(string const & str) { - return getEntries(str, Thesaurus::ADJECTIVE); - } - /// get adverb entries - std::vector getAdverbs(string const & str) { - return getEntries(str, Thesaurus::ADVERB); - } - /// get other entries - std::vector getOthers(string const & str) { - return getEntries(str, Thesaurus::OTHER); - } - + /// get meanings + Thesaurus::Meanings const & getMeanings(string const & str); + /// the text string const & text() { return oldstr_; } private: - /// get entries for a str - std::vector getEntries(string const & str, Thesaurus::POS pos); - /// last string looked up string laststr_; /// entries for last string - std::vector entries_; + Thesaurus::Meanings meanings_; /// original string string oldstr_; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 5c57ea32fd..6185cccdf7 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,11 @@ +2002-01-13 John Levon + + * FormThesaurus.C: + * FormThesaurus.h: + * form_thesaurus.h: + * form_thesaurus.C: + * forms/form_thesaurus.fd: update to Aiksaurus 0.14 + 2002-01-12 Jean-Marc Lasgouttes * Toolbar_pimpl.C (setPixmap): simplify a bit diff --git a/src/frontends/xforms/FormThesaurus.C b/src/frontends/xforms/FormThesaurus.C index c385da9677..239677dca7 100644 --- a/src/frontends/xforms/FormThesaurus.C +++ b/src/frontends/xforms/FormThesaurus.C @@ -21,7 +21,7 @@ #include "form_thesaurus.h" #include "debug.h" -typedef FormCB > base_class; +typedef FormCB > base_class; FormThesaurus::FormThesaurus(ControlThesaurus & c) : base_class(c, _("LyX: Thesaurus"), false), @@ -32,37 +32,13 @@ FormThesaurus::FormThesaurus(ControlThesaurus & c) void FormThesaurus::build() { - dialog_.reset(build_tabbed_thesaurus()); - noun_.reset(build_noun()); - verb_.reset(build_verb()); - adjective_.reset(build_adjective()); - adverb_.reset(build_adverb()); - other_.reset(build_other()); - + dialog_.reset(build_thesaurus()); + // Manage the ok, apply and cancel/close buttons bc().setCancel(dialog_->button_close); bc().addReadOnly(dialog_->input_replace); fl_set_input_return(dialog_->input_entry, FL_RETURN_END_CHANGED); - - fl_addto_tabfolder(dialog_->tabbed_folder, _("Nouns"), noun_->form); - fl_addto_tabfolder(dialog_->tabbed_folder, _("Verbs"), verb_->form); - fl_addto_tabfolder(dialog_->tabbed_folder, _("Adjectives"), adjective_->form); - fl_addto_tabfolder(dialog_->tabbed_folder, _("Adverbs"), adverb_->form); - fl_addto_tabfolder(dialog_->tabbed_folder, _("Other"), other_->form); -} - - -void FormThesaurus::redraw() -{ - if (form() && form()->visible) - fl_redraw_form(form()); - else - return; - - FL_FORM * form = fl_get_active_folder(dialog_->tabbed_folder); - if (form && form->visible) - fl_redraw_form(form); } @@ -74,62 +50,35 @@ void FormThesaurus::update() string const & str_ = controller().text(); setEnabled(dialog_->button_replace, !str_.empty()); fl_set_input(dialog_->input_replace, ""); - updateEntries(str_); + updateMeanings(str_); } -void FormThesaurus::updateEntries(string const & str) +void FormThesaurus::updateMeanings(string const & str) { + fl_clear_browser(dialog_->browser_meanings); + fl_set_input(dialog_->input_entry, str.c_str()); - fl_clear_browser(noun_->browser_noun); - fl_clear_browser(verb_->browser_verb); - fl_clear_browser(adjective_->browser_adjective); - fl_clear_browser(adverb_->browser_adverb); - fl_clear_browser(other_->browser_other); + fl_set_browser_topline(dialog_->browser_meanings, 1); - fl_set_browser_topline(noun_->browser_noun, 1); - fl_set_browser_topline(verb_->browser_verb, 1); - fl_set_browser_topline(adjective_->browser_adjective, 1); - fl_set_browser_topline(adverb_->browser_adverb, 1); - fl_set_browser_topline(other_->browser_other, 1); + fl_freeze_form(form()); - fl_freeze_form(noun_->form); - fl_freeze_form(verb_->form); - fl_freeze_form(adverb_->form); - fl_freeze_form(adjective_->form); - fl_freeze_form(other_->form); - - std::vector nouns = controller().getNouns(str); - for (std::vector::const_iterator it = nouns.begin(); it != nouns.end(); ++it) - fl_add_browser_line(noun_->browser_noun, it->c_str()); - - std::vector verbs = controller().getVerbs(str); - for (std::vector::const_iterator it = verbs.begin(); it != verbs.end(); ++it) - fl_add_browser_line(verb_->browser_verb, it->c_str()); - - std::vector adjectives = controller().getAdjectives(str); - for (std::vector::const_iterator it = adjectives.begin(); it != adjectives.end(); ++it) - fl_add_browser_line(adjective_->browser_adjective, it->c_str()); - - std::vector adverbs = controller().getAdverbs(str); - for (std::vector::const_iterator it = adverbs.begin(); it != adverbs.end(); ++it) - fl_add_browser_line(adverb_->browser_adverb, it->c_str()); - - std::vector others = controller().getOthers(str); - for (std::vector::const_iterator it = others.begin(); it != others.end(); ++it) - fl_add_browser_line(other_->browser_other, it->c_str()); - - fl_unfreeze_form(noun_->form); - fl_unfreeze_form(verb_->form); - fl_unfreeze_form(adverb_->form); - fl_unfreeze_form(adjective_->form); - fl_unfreeze_form(other_->form); - fl_redraw_form(noun_->form); - fl_redraw_form(verb_->form); - fl_redraw_form(adverb_->form); - fl_redraw_form(adjective_->form); - fl_redraw_form(other_->form); + Thesaurus::Meanings meanings = controller().getMeanings(str); + + for (Thesaurus::Meanings::const_iterator cit = meanings.begin(); + cit != meanings.end(); ++cit) { + fl_add_browser_line(dialog_->browser_meanings, cit->first.c_str()); + for (std::vector::const_iterator cit2 = cit->second.begin(); + cit2 != cit->second.end(); ++cit2) { + string ent = " "; + ent += *cit2; + fl_add_browser_line(dialog_->browser_meanings, ent.c_str()); + } + } + + fl_unfreeze_form(form()); + fl_redraw_form(form()); } @@ -174,11 +123,12 @@ void FormThesaurus::setReplace(string const & templ, string const & nstr) ButtonPolicy::SMInput FormThesaurus::input(FL_OBJECT * obj, long) { - FL_OBJECT * browser = 0; - if (obj == dialog_->input_entry) { - updateEntries(fl_get_input(dialog_->input_entry)); - if (string(fl_get_input(dialog_->input_entry)).empty()) { + string s = strip(frontStrip(fl_get_input(dialog_->input_entry))); + + updateMeanings(s); + + if (s.empty()) { fl_set_input(dialog_->input_replace, ""); return ButtonPolicy::SMI_APPLY; } @@ -187,26 +137,20 @@ ButtonPolicy::SMInput FormThesaurus::input(FL_OBJECT * obj, long) if (!rep.empty()) controller().replace(fl_get_input(dialog_->input_replace)); clickline_ = -1; - updateEntries(rep); + updateMeanings(rep); return ButtonPolicy::SMI_APPLY; - } else if (obj == noun_->browser_noun || - obj == verb_->browser_verb || - obj == adjective_->browser_adjective || - obj == adverb_->browser_adverb || - obj == other_->browser_other) { - browser = obj; + } else if (obj != dialog_->browser_meanings) { + return ButtonPolicy::SMI_NOOP; } - if (browser) { - setReplace(fl_get_input(dialog_->input_entry), - fl_get_browser_line(browser, fl_get_browser(browser))); + setReplace(fl_get_input(dialog_->input_entry), + strip(frontStrip(fl_get_browser_line(obj, fl_get_browser(obj))))); - if (clickline_ == fl_get_browser(browser)) { - updateEntries(fl_get_input(dialog_->input_replace)); - clickline_ = -1; - } else { - clickline_ = fl_get_browser(browser); - } + if (clickline_ == fl_get_browser(obj)) { + updateMeanings(fl_get_input(dialog_->input_replace)); + clickline_ = -1; + } else { + clickline_ = fl_get_browser(obj); } return ButtonPolicy::SMI_VALID; diff --git a/src/frontends/xforms/FormThesaurus.h b/src/frontends/xforms/FormThesaurus.h index 897c667a18..99923dcad5 100644 --- a/src/frontends/xforms/FormThesaurus.h +++ b/src/frontends/xforms/FormThesaurus.h @@ -17,7 +17,7 @@ #include "FormBase.h" class ControlThesaurus; -struct FD_form_tabbed_thesaurus; +struct FD_form_thesaurus; struct FD_form_noun; struct FD_form_verb; struct FD_form_adjective; @@ -26,7 +26,7 @@ struct FD_form_other; /** This class provides an XForms implementation of the Thesaurus dialog. */ -class FormThesaurus : public FormCB > { +class FormThesaurus : public FormCB > { public: /// FormThesaurus(ControlThesaurus &); @@ -38,33 +38,19 @@ private: virtual void build(); /// update dialog virtual void update(); - /// redraw - virtual void redraw(); + + /// dialog build + FD_form_thesaurus * build_thesaurus(); /// set the replace word properly void setReplace(const string & templ, const string & nstr); /// update browser entries - void updateEntries(const string & str); + void updateMeanings(const string & str); /// Filter the inputs virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); - /// Fdesign generated methods - FD_form_tabbed_thesaurus * build_tabbed_thesaurus(); - FD_form_noun * build_noun(); - FD_form_verb * build_verb(); - FD_form_adjective * build_adjective(); - FD_form_adverb * build_adverb(); - FD_form_other * build_other(); - - /// Real GUI implementations of sub-forms - boost::scoped_ptr noun_; - boost::scoped_ptr verb_; - boost::scoped_ptr adjective_; - boost::scoped_ptr adverb_; - boost::scoped_ptr other_; - /// for double click handling int clickline_; diff --git a/src/frontends/xforms/form_thesaurus.C b/src/frontends/xforms/form_thesaurus.C index bc1d5e56a4..e09d99f824 100644 --- a/src/frontends/xforms/form_thesaurus.C +++ b/src/frontends/xforms/form_thesaurus.C @@ -10,24 +10,22 @@ #include "form_thesaurus.h" #include "FormThesaurus.h" -FD_form_tabbed_thesaurus::~FD_form_tabbed_thesaurus() +FD_form_thesaurus::~FD_form_thesaurus() { if ( form->visible ) fl_hide_form( form ); fl_free_form( form ); } -FD_form_tabbed_thesaurus * FormThesaurus::build_tabbed_thesaurus() +FD_form_thesaurus * FormThesaurus::build_thesaurus() { FL_OBJECT *obj; - FD_form_tabbed_thesaurus *fdui = new FD_form_tabbed_thesaurus; + FD_form_thesaurus *fdui = new FD_form_thesaurus; fdui->form = fl_bgn_form(FL_NO_BOX, 465, 450); fdui->form->u_vdata = this; obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, ""); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 15, 55, 440, 310, _("Tabbed folder")); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); { char const * const dummy = N_("Replace|^R"); fdui->button_replace = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 375, 100, 30, idex(_(dummy))); @@ -50,140 +48,11 @@ FD_form_tabbed_thesaurus * FormThesaurus::build_tabbed_thesaurus() fdui->input_replace = obj = fl_add_input(FL_NORMAL_INPUT, 75, 375, 260, 30, _("Selection :")); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fl_end_form(); - - fdui->form->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_noun::~FD_form_noun() -{ - if ( form->visible ) fl_hide_form( form ); - fl_free_form( form ); -} - - -FD_form_noun * FormThesaurus::build_noun() -{ - FL_OBJECT *obj; - FD_form_noun *fdui = new FD_form_noun; - - fdui->form = fl_bgn_form(FL_NO_BOX, 440, 290); - fdui->form->u_vdata = this; - obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 290, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->browser_noun = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, 440, 290, ""); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fl_end_form(); - - fdui->form->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_verb::~FD_form_verb() -{ - if ( form->visible ) fl_hide_form( form ); - fl_free_form( form ); -} - - -FD_form_verb * FormThesaurus::build_verb() -{ - FL_OBJECT *obj; - FD_form_verb *fdui = new FD_form_verb; - - fdui->form = fl_bgn_form(FL_NO_BOX, 440, 290); - fdui->form->u_vdata = this; - obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 290, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->browser_verb = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, 440, 290, ""); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fl_end_form(); - - fdui->form->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_adjective::~FD_form_adjective() -{ - if ( form->visible ) fl_hide_form( form ); - fl_free_form( form ); -} - - -FD_form_adjective * FormThesaurus::build_adjective() -{ - FL_OBJECT *obj; - FD_form_adjective *fdui = new FD_form_adjective; - - fdui->form = fl_bgn_form(FL_NO_BOX, 440, 290); - fdui->form->u_vdata = this; - obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 290, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->browser_adjective = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, 440, 290, ""); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fl_end_form(); - - fdui->form->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_adverb::~FD_form_adverb() -{ - if ( form->visible ) fl_hide_form( form ); - fl_free_form( form ); -} - - -FD_form_adverb * FormThesaurus::build_adverb() -{ - FL_OBJECT *obj; - FD_form_adverb *fdui = new FD_form_adverb; - - fdui->form = fl_bgn_form(FL_NO_BOX, 440, 290); - fdui->form->u_vdata = this; - obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 290, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->browser_adverb = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, 440, 290, ""); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fl_end_form(); - - fdui->form->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_other::~FD_form_other() -{ - if ( form->visible ) fl_hide_form( form ); - fl_free_form( form ); -} - - -FD_form_other * FormThesaurus::build_other() -{ - FL_OBJECT *obj; - FD_form_other *fdui = new FD_form_other; - - fdui->form = fl_bgn_form(FL_NO_BOX, 440, 290); - fdui->form->u_vdata = this; - obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 290, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); - fdui->browser_other = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, 440, 290, ""); - fl_set_object_resize(obj, FL_RESIZE_NONE); + { + char const * const dummy = N_("Meanings|#M"); + fdui->browser_meanings = obj = fl_add_browser(FL_SELECT_BROWSER, 15, 50, 440, 305, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } fl_set_object_callback(obj, C_FormBaseInputCB, 0); fl_end_form(); diff --git a/src/frontends/xforms/form_thesaurus.h b/src/frontends/xforms/form_thesaurus.h index 45d109b76c..d1ae364f4a 100644 --- a/src/frontends/xforms/form_thesaurus.h +++ b/src/frontends/xforms/form_thesaurus.h @@ -1,64 +1,24 @@ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext /** Header file generated with fdesign **/ -#ifndef FD_form_tabbed_thesaurus_h_ -#define FD_form_tabbed_thesaurus_h_ +#ifndef FD_form_thesaurus_h_ +#define FD_form_thesaurus_h_ /** Callbacks, globals and object handlers **/ extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); - -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); - -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); - -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); - -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); - /**** Forms and Objects ****/ -struct FD_form_tabbed_thesaurus { - ~FD_form_tabbed_thesaurus(); +struct FD_form_thesaurus { + ~FD_form_thesaurus(); FL_FORM *form; - FL_OBJECT *tabbed_folder; FL_OBJECT *button_replace; FL_OBJECT *button_close; FL_OBJECT *input_entry; FL_OBJECT *input_replace; -}; -struct FD_form_noun { - ~FD_form_noun(); - - FL_FORM *form; - FL_OBJECT *browser_noun; -}; -struct FD_form_verb { - ~FD_form_verb(); - - FL_FORM *form; - FL_OBJECT *browser_verb; -}; -struct FD_form_adjective { - ~FD_form_adjective(); - - FL_FORM *form; - FL_OBJECT *browser_adjective; -}; -struct FD_form_adverb { - ~FD_form_adverb(); - - FL_FORM *form; - FL_OBJECT *browser_adverb; -}; -struct FD_form_other { - ~FD_form_other(); - - FL_FORM *form; - FL_OBJECT *browser_other; + FL_OBJECT *browser_meanings; }; -#endif /* FD_form_tabbed_thesaurus_h_ */ +#endif /* FD_form_thesaurus_h_ */ diff --git a/src/frontends/xforms/forms/form_thesaurus.fd b/src/frontends/xforms/forms/form_thesaurus.fd index ff3eb6558b..7bc779ef86 100644 --- a/src/frontends/xforms/forms/form_thesaurus.fd +++ b/src/frontends/xforms/forms/form_thesaurus.fd @@ -3,12 +3,12 @@ Magic: 13000 Internal Form Definition File (do not change) -Number of forms: 6 +Number of forms: 1 Unit of measure: FL_COORD_PIXEL SnapGrid: 5 =============== FORM =============== -Name: form_tabbed_thesaurus +Name: form_thesaurus Width: 465 Height: 450 Number of Objects: 6 @@ -31,24 +31,6 @@ name: callback: argument: --------------------- -class: FL_TABFOLDER -type: TOP_TABFOLDER -box: 15 55 440 310 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Tabbed folder -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NorthWest -name: tabbed_folder -callback: -argument: - -------------------- class: FL_BUTTON type: NORMAL_BUTTON @@ -121,213 +103,21 @@ name: input_replace callback: C_FormBaseInputCB argument: 0 -=============== FORM =============== -Name: form_noun -Width: 440 -Height: 290 -Number of Objects: 2 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 440 290 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_NorthWest -name: -callback: -argument: - -------------------- class: FL_BROWSER -type: HOLD_BROWSER -box: 0 0 440 290 +type: SELECT_BROWSER +box: 15 50 440 305 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NoGravity FL_NoGravity -name: browser_noun -callback: C_FormBaseInputCB -argument: 0 - -=============== FORM =============== -Name: form_verb -Width: 440 -Height: 290 -Number of Objects: 2 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 440 290 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: +label: Meanings|#M shortcut: resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_NorthWest -name: -callback: -argument: - --------------------- -class: FL_BROWSER -type: HOLD_BROWSER -box: 0 0 440 290 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_BOTTOM -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity -name: browser_verb -callback: C_FormBaseInputCB -argument: 0 - -=============== FORM =============== -Name: form_adjective -Width: 440 -Height: 290 -Number of Objects: 2 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 440 290 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_NorthWest -name: -callback: -argument: - --------------------- -class: FL_BROWSER -type: HOLD_BROWSER -box: 0 0 440 290 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_BOTTOM -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NoGravity FL_NoGravity -name: browser_adjective -callback: C_FormBaseInputCB -argument: 0 - -=============== FORM =============== -Name: form_adverb -Width: 440 -Height: 290 -Number of Objects: 2 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 440 290 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_NorthWest -name: -callback: -argument: - --------------------- -class: FL_BROWSER -type: HOLD_BROWSER -box: 0 0 440 290 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_BOTTOM -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NoGravity FL_NoGravity -name: browser_adverb -callback: C_FormBaseInputCB -argument: 0 - -=============== FORM =============== -Name: form_other -Width: 440 -Height: 290 -Number of Objects: 2 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 440 290 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_NorthWest -name: -callback: -argument: - --------------------- -class: FL_BROWSER -type: HOLD_BROWSER -box: 0 0 440 290 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_BOTTOM -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NoGravity FL_NoGravity -name: browser_other +name: browser_meanings callback: C_FormBaseInputCB argument: 0