- Language = new Combox(FL_COMBOX_DROPLIST);
- Language2 = new Combox(FL_COMBOX_DROPLIST);
- Language->setcallback(LCombo, this);
- Language2->setcallback(LCombo, this);
-
- fd_form_keymap = create_form_KeyMap();
-
- // Add the Intl* pointer
- fd_form_keymap->AcceptChset->u_vdata =
- fd_form_keymap->Charset->u_vdata =
- fd_form_keymap->Accept->u_vdata =
- fd_form_keymap->OtherKeymap->u_vdata =
- fd_form_keymap->KeyOnBtn->u_vdata =
- fd_form_keymap->KeyOffBtn->u_vdata =
- fd_form_keymap->KeyOnBtn2->u_vdata = this;
-
- // add the callbacks.
- fl_set_object_callback(fd_form_keymap->AcceptChset,
- C_Intl_DispatchCallback, 27);
- fl_set_object_callback(fd_form_keymap->Charset,
- C_Intl_DispatchCallback, 26);
- fl_set_object_callback(fd_form_keymap->Accept,
- C_Intl_DispatchCallback, 0);
-
- fl_set_object_callback(fd_form_keymap->KeyOnBtn,
- C_Intl_DispatchCallback, 23);
- fl_set_object_callback(fd_form_keymap->KeyOffBtn,
- C_Intl_DispatchCallback, 3);
- fl_set_object_callback(fd_form_keymap->KeyOnBtn2,
- C_Intl_DispatchCallback, 43);
-
- // Make sure pressing the close box does not kill LyX. (RvdK)
- fl_set_form_atclose(fd_form_keymap->KeyMap, CancelCloseBoxCB, 0);
-
- fl_hide_object(fd_form_keymap->KeymapErr);
- fl_hide_object(fd_form_keymap->ChsetErr);
- fl_set_input(fd_form_keymap->Charset, lyxrc.font_norm.c_str());
-
- // Adds two comboxes to the keyboard map
- fl_addto_form(fd_form_keymap->KeyMap);
- Language->add(120, 30, 160, 30, 300); // Primary
- Language2->add(120, 110, 160, 30, 300); // Secondary
- fl_end_form();
-
- int n = 0;
- // Default is not in the language map
-#ifdef DO_USE_DEFAULT_LANGUAGE
- Language->addto("default");
- Language2->addto("default");
- ++n;
-#endif
- for (Languages::const_iterator cit = languages.begin();
- cit != languages.end(); ++cit) {
- Language->addto((*cit).second.lang());
- Language2->addto((*cit).second.lang());
- ++n;
- }
-
- Language->addto(_("other..."));
- Language2->addto(_("other..."));
- otherkeymap = n + 1;
- if (!Language->select_text(prim_lang)) {
- Language->select(n + 1);
- fl_set_input(fd_form_keymap->OtherKeymap, prim_lang.c_str());
- }
- else
- trans->SetPrimary(prim_lang);
-
- if (!Language2->select_text(sec_lang)) {
- Language2->select(n + 1);
- fl_set_input(fd_form_keymap->OtherKeymap2, sec_lang.c_str());
- }
- else
- trans->SetSecondary(sec_lang);
-