mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
character2.diff.gz
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1625 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
81d01da199
commit
f65b7ff4ab
@ -1,3 +1,9 @@
|
||||
2001-02-26 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
|
||||
|
||||
* layout_forms.fd: delete
|
||||
* layout_forms.h.patch: delete
|
||||
* makefile: remove layout_forms.fd and layout_forms.h.patch
|
||||
|
||||
2001-02-20 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* layout_forms.[fd,h.patch]: strip out preamble form.
|
||||
|
@ -1,6 +0,0 @@
|
||||
7,8c7,8
|
||||
< extern void CharacterApplyCB(FL_OBJECT *, long);
|
||||
< extern void CharacterCloseCB(FL_OBJECT *, long);
|
||||
---
|
||||
> extern "C" void CharacterApplyCB(FL_OBJECT *, long);
|
||||
> extern "C" void CharacterCloseCB(FL_OBJECT *, long);
|
@ -18,15 +18,15 @@ SHELL = /bin/sh
|
||||
FDESIGN = fdesign
|
||||
|
||||
SRCS = bibforms.fd credits_form.fd form1.fd include_form.fd \
|
||||
log_form.fd layout_forms.fd lyx.fd math_forms.fd \
|
||||
log_form.fd lyx.fd math_forms.fd \
|
||||
print_form.fd sp_form.fd
|
||||
|
||||
OBJS = bibforms.c credits_form.c form1.c include_form.c \
|
||||
log_form.c layout_forms.c lyx.c math_forms.c \
|
||||
log_form.c lyx.c math_forms.c \
|
||||
print_form.c sp_form.c
|
||||
|
||||
COBJS = bibforms.C credits_form.C form1.C include_form.C \
|
||||
log_form.C layout_forms.C lyx.C math_forms.C \
|
||||
log_form.C lyx.C math_forms.C \
|
||||
print_form.C sp_form.C
|
||||
|
||||
all:
|
||||
|
@ -76,6 +76,8 @@ src/frontends/xforms/FormBibitem.C
|
||||
src/frontends/xforms/form_bibtex.C
|
||||
src/frontends/xforms/FormBibtex.C
|
||||
src/frontends/xforms/form_browser.C
|
||||
src/frontends/xforms/form_character.C
|
||||
src/frontends/xforms/FormCharacter.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/form_copyright.C
|
||||
@ -145,7 +147,6 @@ src/kbsequence.C
|
||||
src/language.C
|
||||
src/LaTeX.C
|
||||
src/layout.C
|
||||
src/layout_forms.C
|
||||
src/LColor.C
|
||||
src/LyXAction.C
|
||||
src/lyx.C
|
||||
@ -154,7 +155,6 @@ src/lyxfont.C
|
||||
src/lyxfr0.C
|
||||
src/lyxfr1.C
|
||||
src/lyxfunc.C
|
||||
src/lyx_gui.C
|
||||
src/lyx_gui_misc.C
|
||||
src/lyx_main.C
|
||||
src/lyxrc.C
|
||||
|
@ -1596,9 +1596,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
break;
|
||||
|
||||
case LFUN_FREE:
|
||||
Free(bv_);
|
||||
setState();
|
||||
owner_->showState();
|
||||
owner_->getDialogs()->setUserFreeFont();
|
||||
break;
|
||||
|
||||
case LFUN_TEX:
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-02-23 Edwin Leuven <leuven@fee.uva.nl>
|
||||
|
||||
* layout_forms.[Ch]: removed
|
||||
* lyx_cb.[Ch]: out character
|
||||
* lyx_gui.C: out character
|
||||
* lyx_gui_misc.C: out character
|
||||
* bufferview_funcs.C: : out character,
|
||||
added toggleall as parameter in ToggleAndShow
|
||||
|
||||
2001-02-26 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* lyxfunc.C (getStatus): Fix the LFUN_EXPORT case.
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "minibuffer.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "debug.h"
|
||||
#include "layout_forms.h"
|
||||
#include "intl.h"
|
||||
#include "lyxrc.h"
|
||||
#include "support/filetools.h" // OnlyFilename()
|
||||
|
@ -136,8 +136,6 @@ lyx_SOURCES = \
|
||||
lastfiles.h \
|
||||
layout.C \
|
||||
layout.h \
|
||||
layout_forms.C \
|
||||
layout_forms.h \
|
||||
lyx.C \
|
||||
lyx.h \
|
||||
lyx_cb.C \
|
||||
|
@ -25,9 +25,7 @@
|
||||
#include "buffer.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "lyx_cb.h"
|
||||
#include "layout_forms.h"
|
||||
|
||||
extern FD_form_character * fd_form_character;
|
||||
|
||||
#ifndef NEW_INSETS
|
||||
void Foot(BufferView * bv)
|
||||
@ -147,12 +145,6 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
|
||||
}
|
||||
|
||||
|
||||
void Free(BufferView * bv)
|
||||
{
|
||||
ToggleAndShow(bv, UserFreeFont(bv->buffer()->params));
|
||||
}
|
||||
|
||||
|
||||
// How should this actually work? Should it prohibit input in all BufferViews,
|
||||
// or just in the current one? If "just the current one", then it should be
|
||||
// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
|
||||
@ -177,11 +169,6 @@ void ProhibitInput(BufferView * bv)
|
||||
XDefineCursor(fl_get_display(), bv->owner()->getForm()->window,
|
||||
cursor);
|
||||
|
||||
if (fd_form_character->form_character->visible)
|
||||
XDefineCursor(fl_get_display(),
|
||||
fd_form_character->form_character->window,
|
||||
cursor);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_deactivate_all_forms();
|
||||
}
|
||||
@ -193,10 +180,6 @@ void AllowInput(BufferView * bv)
|
||||
|
||||
XUndefineCursor(fl_get_display(), bv->owner()->getForm()->window);
|
||||
|
||||
if (fd_form_character->form_character->visible)
|
||||
XUndefineCursor(fl_get_display(),
|
||||
fd_form_character->form_character->window);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_activate_all_forms();
|
||||
}
|
||||
@ -303,7 +286,7 @@ string const CurrentState(BufferView * bv)
|
||||
/* -------> Does the actual toggle job of the XxxCB() calls above.
|
||||
* Also shows the current font state.
|
||||
*/
|
||||
void ToggleAndShow(BufferView * bv, LyXFont const & font)
|
||||
void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall=true)
|
||||
{
|
||||
if (bv->available()) {
|
||||
LyXText * text = bv->getLyXText();
|
||||
|
@ -53,8 +53,6 @@ extern void Tex(BufferView *);
|
||||
///
|
||||
extern void changeDepth(BufferView *, LyXText *, int);
|
||||
///
|
||||
extern void Free(BufferView *);
|
||||
///
|
||||
extern void ProhibitInput(BufferView *);
|
||||
///
|
||||
extern void AllowInput(BufferView *);
|
||||
@ -73,5 +71,5 @@ extern void FontSize(BufferView *, string const &);
|
||||
/// Returns the current font and depth as a message.
|
||||
extern string const CurrentState(BufferView *);
|
||||
///
|
||||
extern void ToggleAndShow(BufferView *, LyXFont const &);
|
||||
extern void ToggleAndShow(BufferView *, LyXFont const &, bool toggleall=true);
|
||||
#endif
|
||||
|
@ -89,7 +89,7 @@ void Combox::remove()
|
||||
}
|
||||
|
||||
lyxerr.debug() << "Label: " << label << endl;
|
||||
if (label && label!= button) {
|
||||
if (label && label != button) {
|
||||
fl_delete_object(label);
|
||||
fl_free_object(label);
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-02-23 Edwin Leuven <leuven@fee.uva.nl)
|
||||
|
||||
* Dialogs.h: setUserFreeFont, showLayoutCharacter
|
||||
|
||||
2001-02-19 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* DialogBase.h: derived from noncopyable, rather than deriving
|
||||
|
@ -116,6 +116,10 @@ public:
|
||||
Signal0<void> showLayoutDocument;
|
||||
///
|
||||
Signal0<void> showLayoutParagraph;
|
||||
///
|
||||
Signal0<void> showLayoutCharacter;
|
||||
///
|
||||
Signal0<void> setUserFreeFont;
|
||||
/// show the version control log
|
||||
Signal0<void> showVCLogFile;
|
||||
/// show the LaTeX log or build file
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-02-23 Edwin Leuven <leuven@fee.uva.nl>
|
||||
|
||||
* Dialogs.C: added layoutcharacter
|
||||
* FormCharacter.C: added
|
||||
* FormCharacter.h: added
|
||||
* form_character.C: added
|
||||
* form_character.h: added
|
||||
* forms/form_character.fd: added
|
||||
|
||||
2001-02-23 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* FormPreferences.C: Handle lyxrc.language_use_babel and
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "FormBibitem.h"
|
||||
#include "FormBibtex.h"
|
||||
#include "FormCitation.h"
|
||||
#include "FormCharacter.h"
|
||||
#include "FormCopyright.h"
|
||||
#include "FormDocument.h"
|
||||
#include "FormError.h"
|
||||
@ -53,6 +54,7 @@ Dialogs::Dialogs(LyXView * lv)
|
||||
{
|
||||
dialogs_.push_back(new FormBibitem(lv, this));
|
||||
dialogs_.push_back(new FormBibtex(lv, this));
|
||||
dialogs_.push_back(new FormCharacter(lv, this));
|
||||
dialogs_.push_back(new FormCitation(lv, this));
|
||||
dialogs_.push_back(new FormCopyright(lv, this));
|
||||
dialogs_.push_back(new FormDocument(lv, this));
|
||||
|
223
src/frontends/xforms/FormCharacter.C
Normal file
223
src/frontends/xforms/FormCharacter.C
Normal file
@ -0,0 +1,223 @@
|
||||
/**
|
||||
* \file FormCharacter.C
|
||||
* Copyright 2001 The LyX Team.
|
||||
* See the file COPYING.
|
||||
*
|
||||
* \author Edwin Leuven, leuven@fee.uva.nl
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG_
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#include "FormCharacter.h"
|
||||
#include "form_character.h"
|
||||
#include "bufferview_funcs.h"
|
||||
#include "Dialogs.h"
|
||||
#include "Liason.h"
|
||||
#include "LyXView.h"
|
||||
#include "buffer.h"
|
||||
#include "lyxtext.h"
|
||||
#include "language.h"
|
||||
#include "combox.h"
|
||||
|
||||
#ifdef CXX_WORKING_NAMESPACES
|
||||
using Liason::setMinibuffer;
|
||||
#endif
|
||||
|
||||
|
||||
FormCharacter::FormCharacter(LyXView * lv, Dialogs * d)
|
||||
: FormBaseBD(lv, d, _("Character Layout"),
|
||||
new NoRepeatedApplyReadOnlyPolicy),
|
||||
dialog_(0), combo_language2(0)
|
||||
{
|
||||
// let the popup be shown
|
||||
// This is a permanent connection so we won't bother
|
||||
// storing a copy because we won't be disconnecting.
|
||||
d->showLayoutCharacter.connect(slot(this, &FormCharacter::show));
|
||||
// for LFUN_FREE
|
||||
d->setUserFreeFont.connect(slot(this, &FormCharacter::apply));
|
||||
}
|
||||
|
||||
|
||||
FormCharacter::~FormCharacter()
|
||||
{
|
||||
delete dialog_;
|
||||
delete combo_language2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
FL_FORM * FormCharacter::form() const
|
||||
{
|
||||
if (dialog_)
|
||||
return dialog_->form;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FormCharacter::build()
|
||||
{
|
||||
dialog_ = build_character();
|
||||
// Workaround dumb xforms sizing bug
|
||||
minw_ = form()->w;
|
||||
minh_ = form()->h;
|
||||
// Manage the ok, apply and cancel/close buttons
|
||||
bc_.setApply(dialog_->button_apply);
|
||||
bc_.setCancel(dialog_->button_close);
|
||||
bc_.refresh();
|
||||
bc_.addReadOnly (dialog_->check_toggle_all);
|
||||
|
||||
fl_addto_choice(dialog_->choice_family,
|
||||
_(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
|
||||
fl_addto_choice(dialog_->choice_series,
|
||||
_(" No change %l| Medium | Bold %l| Reset "));
|
||||
fl_addto_choice(dialog_->choice_shape,
|
||||
_(" No change %l| Upright | Italic | Slanted | Small Caps "
|
||||
"%l| Reset "));
|
||||
fl_addto_choice(dialog_->choice_size,
|
||||
_(" No change %l| Tiny | Smallest | Smaller | Small "
|
||||
"| Normal | Large | Larger | Largest | Huge | Huger "
|
||||
"%l| Increase | Decrease | Reset "));
|
||||
fl_addto_choice(dialog_->choice_bar,
|
||||
_(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
|
||||
fl_addto_choice(dialog_->choice_color,
|
||||
_(" No change %l| No color | Black | White | Red | Green "
|
||||
"| Blue | Cyan | Magenta | Yellow %l| Reset "));
|
||||
fl_addto_choice(dialog_->choice_language,
|
||||
_(" English %l| German | French "));
|
||||
|
||||
// insert default language box manually
|
||||
fl_addto_form(dialog_->form);
|
||||
FL_OBJECT * ob = dialog_->choice_language;
|
||||
combo_language2 = new Combox(FL_COMBOX_DROPLIST);
|
||||
combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
|
||||
combo_language2->shortcut("#L", 1);
|
||||
fl_end_form();
|
||||
|
||||
// build up the combox entries
|
||||
combo_language2->addline(_("No change"));
|
||||
combo_language2->addline(_("Reset"));
|
||||
for (Languages::const_iterator cit = languages.begin();
|
||||
cit != languages.end(); ++cit) {
|
||||
combo_language2->addto((*cit).second.lang());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void FormCharacter::apply()
|
||||
{
|
||||
if (!lv_->view()->available() || !dialog_)
|
||||
return;
|
||||
|
||||
LyXFont font(LyXFont::ALL_IGNORE);
|
||||
|
||||
int pos = fl_get_choice(dialog_->choice_family);
|
||||
switch (pos) {
|
||||
case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
|
||||
case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
|
||||
case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
|
||||
case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
|
||||
case 5: font.setFamily(LyXFont::INHERIT_FAMILY); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(dialog_->choice_series);
|
||||
switch (pos) {
|
||||
case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
|
||||
case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
|
||||
case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
|
||||
case 4: font.setSeries(LyXFont::INHERIT_SERIES); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(dialog_->choice_shape);
|
||||
switch (pos) {
|
||||
case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
|
||||
case 2: font.setShape(LyXFont::UP_SHAPE); break;
|
||||
case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
|
||||
case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
|
||||
case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
|
||||
case 6: font.setShape(LyXFont::INHERIT_SHAPE); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(dialog_->choice_size);
|
||||
switch (pos) {
|
||||
case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
|
||||
case 2: font.setSize(LyXFont::SIZE_TINY); break;
|
||||
case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
|
||||
case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
|
||||
case 5: font.setSize(LyXFont::SIZE_SMALL); break;
|
||||
case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
|
||||
case 7: font.setSize(LyXFont::SIZE_LARGE); break;
|
||||
case 8: font.setSize(LyXFont::SIZE_LARGER); break;
|
||||
case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
|
||||
case 10: font.setSize(LyXFont::SIZE_HUGE); break;
|
||||
case 11: font.setSize(LyXFont::SIZE_HUGER); break;
|
||||
case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
|
||||
case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
|
||||
case 14: font.setSize(LyXFont::INHERIT_SIZE); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(dialog_->choice_bar);
|
||||
switch (pos) {
|
||||
case 1: font.setEmph(LyXFont::IGNORE);
|
||||
font.setUnderbar(LyXFont::IGNORE);
|
||||
font.setNoun(LyXFont::IGNORE);
|
||||
font.setLatex(LyXFont::IGNORE);
|
||||
break;
|
||||
case 2: font.setEmph(LyXFont::TOGGLE); break;
|
||||
case 3: font.setUnderbar(LyXFont::TOGGLE); break;
|
||||
case 4: font.setNoun(LyXFont::TOGGLE); break;
|
||||
case 5: font.setLatex(LyXFont::TOGGLE); break;
|
||||
case 6: font.setEmph(LyXFont::INHERIT);
|
||||
font.setUnderbar(LyXFont::INHERIT);
|
||||
font.setNoun(LyXFont::INHERIT);
|
||||
font.setLatex(LyXFont::INHERIT);
|
||||
break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(dialog_->choice_color);
|
||||
switch (pos) {
|
||||
case 1: font.setColor(LColor::ignore); break;
|
||||
case 2: font.setColor(LColor::none); break;
|
||||
case 3: font.setColor(LColor::black); break;
|
||||
case 4: font.setColor(LColor::white); break;
|
||||
case 5: font.setColor(LColor::red); break;
|
||||
case 6: font.setColor(LColor::green); break;
|
||||
case 7: font.setColor(LColor::blue); break;
|
||||
case 8: font.setColor(LColor::cyan); break;
|
||||
case 9: font.setColor(LColor::magenta); break;
|
||||
case 10: font.setColor(LColor::yellow); break;
|
||||
case 11: font.setColor(LColor::inherit); break;
|
||||
}
|
||||
|
||||
int const choice = combo_language2->get();
|
||||
if (choice == 1)
|
||||
font.setLanguage(ignore_language);
|
||||
else if (choice == 2)
|
||||
font.setLanguage(lv_->buffer()->params.language);
|
||||
else
|
||||
font.setLanguage(languages.getLanguage(combo_language2->getline()));
|
||||
|
||||
|
||||
bool toggleall = fl_get_button(dialog_->check_toggle_all);
|
||||
ToggleAndShow(lv_->view(), font, toggleall);
|
||||
lv_->view()->setState();
|
||||
lv_->buffer()->markDirty();
|
||||
setMinibuffer(lv_, _("Character set"));
|
||||
}
|
||||
|
||||
|
||||
void FormCharacter::update()
|
||||
{
|
||||
if (!dialog_)
|
||||
return;
|
||||
|
||||
bc_.readOnly(lv_->buffer()->isReadonly());
|
||||
}
|
||||
|
||||
|
58
src/frontends/xforms/FormCharacter.h
Normal file
58
src/frontends/xforms/FormCharacter.h
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* \file FormCharacter.h
|
||||
* Copyright 2001 The LyX Team.
|
||||
* See the file COPYING.
|
||||
*
|
||||
* \author Edwin Leuven, leuven@fee.uva.nl
|
||||
*/
|
||||
|
||||
#ifndef FORM_CHARACTER_H
|
||||
#define FORM_CHARACTER_H
|
||||
|
||||
#include "FormBase.h"
|
||||
|
||||
#ifdef __GNUG_
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
|
||||
class LyXView;
|
||||
class Dialogs;
|
||||
class Combox;
|
||||
struct FD_form_character;
|
||||
|
||||
/**
|
||||
* This class provides an XForms implementation of the FormCharacter Dialog.
|
||||
* The character dialog allows users to change the character settings
|
||||
* in their documents.
|
||||
*/
|
||||
class FormCharacter : public FormBaseBD {
|
||||
public:
|
||||
///
|
||||
FormCharacter(LyXView *, Dialogs *);
|
||||
///
|
||||
~FormCharacter();
|
||||
|
||||
private:
|
||||
|
||||
/// Build the popup
|
||||
virtual void build();
|
||||
|
||||
/// Apply from popup
|
||||
virtual void apply();
|
||||
|
||||
/// Update the popup.
|
||||
virtual void update();
|
||||
|
||||
/// Pointer to the actual instantiation of the xform's form
|
||||
virtual FL_FORM * form() const;
|
||||
|
||||
FD_form_character * build_character();
|
||||
|
||||
/// Real GUI implementation.
|
||||
FD_form_character * dialog_;
|
||||
|
||||
Combox * combo_language2;
|
||||
};
|
||||
|
||||
#endif
|
@ -32,6 +32,10 @@ libxforms_la_SOURCES = \
|
||||
FormBrowser.h \
|
||||
form_browser.C \
|
||||
form_browser.h \
|
||||
FormCharacter.C \
|
||||
FormCharacter.h \
|
||||
form_character.C \
|
||||
form_character.h \
|
||||
FormCitation.C \
|
||||
FormCitation.h \
|
||||
form_citation.C \
|
||||
|
135
src/frontends/xforms/form_character.C
Normal file
135
src/frontends/xforms/form_character.C
Normal file
@ -0,0 +1,135 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
|
||||
/* Form definition file generated with fdesign. */
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
#include <stdlib.h>
|
||||
#include "form_character.h"
|
||||
#include "FormCharacter.h"
|
||||
|
||||
FD_form_character::~FD_form_character()
|
||||
{
|
||||
if ( form->visible ) fl_hide_form( form );
|
||||
fl_free_form( form );
|
||||
}
|
||||
|
||||
|
||||
FD_form_character * FormCharacter::build_character()
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_character *fdui = new FD_form_character;
|
||||
|
||||
fdui->form = fl_bgn_form(FL_NO_BOX, 300, 415);
|
||||
fdui->form->u_vdata = this;
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 415, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 240, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
{
|
||||
char const * const dummy = N_("Family:|#F");
|
||||
fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 15, 191, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Series:|#S");
|
||||
fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Shape:|#H");
|
||||
fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Size:|#Z");
|
||||
fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Misc:|#M");
|
||||
fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Apply|#A");
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Cancel|#N");
|
||||
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Color:|#C");
|
||||
fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
{
|
||||
char const * const dummy = N_("Toggle on all these|#T");
|
||||
fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
||||
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled"));
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 325, 280, 45, _("These are always toggled"));
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_end_form();
|
||||
|
||||
fdui->form->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
@ -1,19 +1,20 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
|
||||
/** Header file generated with fdesign **/
|
||||
|
||||
#ifndef FD_form_character_h_
|
||||
#define FD_form_character_h_
|
||||
|
||||
/** Callbacks, globals and object handlers **/
|
||||
extern "C" void CharacterApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void CharacterCloseCB(FL_OBJECT *, long);
|
||||
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
|
||||
extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
|
||||
|
||||
|
||||
/**** Forms and Objects ****/
|
||||
typedef struct {
|
||||
FL_FORM *form_character;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
struct FD_form_character {
|
||||
~FD_form_character();
|
||||
|
||||
FL_FORM *form;
|
||||
FL_OBJECT *choice_family;
|
||||
FL_OBJECT *choice_series;
|
||||
FL_OBJECT *choice_shape;
|
||||
@ -24,8 +25,6 @@ typedef struct {
|
||||
FL_OBJECT *choice_color;
|
||||
FL_OBJECT *check_toggle_all;
|
||||
FL_OBJECT *choice_language;
|
||||
} FD_form_character;
|
||||
|
||||
extern FD_form_character * create_form_form_character(void);
|
||||
};
|
||||
|
||||
#endif /* FD_form_character_h_ */
|
@ -64,8 +64,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_family
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
@ -82,8 +82,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_series
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
@ -100,8 +100,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_shape
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
@ -118,8 +118,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_size
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
@ -136,8 +136,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_bar
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
@ -154,7 +154,7 @@ shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_SouthEast FL_SouthEast
|
||||
name: button_apply
|
||||
callback: CharacterApplyCB
|
||||
callback: C_FormBaseApplyCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
@ -167,12 +167,12 @@ alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Close
|
||||
label: Cancel|#N
|
||||
shortcut: ^M
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_SouthEast FL_SouthEast
|
||||
name: button_close
|
||||
callback: CharacterCloseCB
|
||||
callback: C_FormBaseCancelCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
@ -190,8 +190,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_color
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHECKBUTTON
|
||||
@ -208,8 +208,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: check_toggle_all
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
@ -226,8 +226,8 @@ shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name: choice_language
|
||||
callback:
|
||||
argument:
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_LABELFRAME
|
||||
@ -265,4 +265,5 @@ name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
==============================
|
||||
create_the_forms
|
@ -1,82 +0,0 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
|
||||
/* Form definition file generated with fdesign. */
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
#include <cstdlib>
|
||||
#include "layout_forms.h"
|
||||
|
||||
FD_form_character *create_form_form_character(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_character *fdui = (FD_form_character *) fl_calloc(1, sizeof(FD_form_character));
|
||||
|
||||
fdui->form_character = fl_bgn_form(FL_NO_BOX, 300, 415);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 415, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 240, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 15, 191, 30, idex(_("Family:|#F")));fl_set_button_shortcut(obj, scex(_("Family:|#F")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_("Series:|#S")));fl_set_button_shortcut(obj, scex(_("Series:|#S")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_("Shape:|#H")));fl_set_button_shortcut(obj, scex(_("Shape:|#H")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_("Size:|#Z")));fl_set_button_shortcut(obj, scex(_("Size:|#Z")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_("Misc:|#M")));fl_set_button_shortcut(obj, scex(_("Misc:|#M")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, CharacterApplyCB, 0);
|
||||
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, _("Close"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, CharacterCloseCB, 0);
|
||||
fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_("Color:|#C")));fl_set_button_shortcut(obj, scex(_("Color:|#C")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_("Toggle on all these|#T")));fl_set_button_shortcut(obj, scex(_("Toggle on all these|#T")), 1);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled"));
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 325, 280, 45, _("These are always toggled"));
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
|
||||
fl_end_form();
|
||||
|
||||
fdui->form_character->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
154
src/lyx_cb.C
154
src/lyx_cb.C
@ -16,7 +16,6 @@
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
#include "lyx.h"
|
||||
#include "layout_forms.h"
|
||||
#include "lyx_main.h"
|
||||
#include "lyx_cb.h"
|
||||
#include "insets/insetlabel.h"
|
||||
@ -49,11 +48,8 @@ using std::vector;
|
||||
using std::sort;
|
||||
using std::equal;
|
||||
|
||||
extern Combox * combo_language;
|
||||
extern Combox * combo_language2;
|
||||
extern BufferList bufferlist;
|
||||
extern void show_symbols_form();
|
||||
extern FD_form_character * fd_form_character;
|
||||
extern FD_form_figure * fd_form_figure;
|
||||
|
||||
extern BufferView * current_view; // called too many times in this file...
|
||||
@ -70,10 +66,6 @@ char ascii_type; /* for selection notify callbacks */
|
||||
|
||||
bool scrolling = false;
|
||||
|
||||
// This is used to make the dreaded font toggle problem hopefully go
|
||||
// away. Definitely not the best solution, but I think it sorta works.
|
||||
bool toggleall = true;
|
||||
|
||||
/*
|
||||
This is the inset locking stuff needed for mathed --------------------
|
||||
|
||||
@ -575,26 +567,6 @@ void LayoutsCB(int sel, void *, Combox *)
|
||||
}
|
||||
|
||||
|
||||
void MenuLayoutCharacter()
|
||||
{
|
||||
static int ow = -1, oh;
|
||||
|
||||
if (fd_form_character->form_character->visible) {
|
||||
fl_raise_form(fd_form_character->form_character);
|
||||
} else {
|
||||
fl_show_form(fd_form_character->form_character,
|
||||
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
|
||||
_("Character Style"));
|
||||
if (ow < 0) {
|
||||
ow = fd_form_character->form_character->w;
|
||||
oh = fd_form_character->form_character->h;
|
||||
}
|
||||
fl_set_form_minsize(fd_form_character->form_character, ow, oh);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MenuLayoutSave(BufferView * bv)
|
||||
{
|
||||
if (!bv->available())
|
||||
@ -607,132 +579,6 @@ void MenuLayoutSave(BufferView * bv)
|
||||
}
|
||||
|
||||
|
||||
// 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 const UserFreeFont(BufferParams const & params)
|
||||
{
|
||||
LyXFont font(LyXFont::ALL_IGNORE);
|
||||
|
||||
int pos = fl_get_choice(fd_form_character->choice_family);
|
||||
switch (pos) {
|
||||
case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
|
||||
case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
|
||||
case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
|
||||
case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
|
||||
case 5: font.setFamily(LyXFont::INHERIT_FAMILY); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(fd_form_character->choice_series);
|
||||
switch (pos) {
|
||||
case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
|
||||
case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
|
||||
case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
|
||||
case 4: font.setSeries(LyXFont::INHERIT_SERIES); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(fd_form_character->choice_shape);
|
||||
switch (pos) {
|
||||
case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
|
||||
case 2: font.setShape(LyXFont::UP_SHAPE); break;
|
||||
case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
|
||||
case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
|
||||
case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
|
||||
case 6: font.setShape(LyXFont::INHERIT_SHAPE); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(fd_form_character->choice_size);
|
||||
switch (pos) {
|
||||
case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
|
||||
case 2: font.setSize(LyXFont::SIZE_TINY); break;
|
||||
case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
|
||||
case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
|
||||
case 5: font.setSize(LyXFont::SIZE_SMALL); break;
|
||||
case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
|
||||
case 7: font.setSize(LyXFont::SIZE_LARGE); break;
|
||||
case 8: font.setSize(LyXFont::SIZE_LARGER); break;
|
||||
case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
|
||||
case 10: font.setSize(LyXFont::SIZE_HUGE); break;
|
||||
case 11: font.setSize(LyXFont::SIZE_HUGER); break;
|
||||
case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
|
||||
case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
|
||||
case 14: font.setSize(LyXFont::INHERIT_SIZE); break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(fd_form_character->choice_bar);
|
||||
switch (pos) {
|
||||
case 1: font.setEmph(LyXFont::IGNORE);
|
||||
font.setUnderbar(LyXFont::IGNORE);
|
||||
font.setNoun(LyXFont::IGNORE);
|
||||
font.setLatex(LyXFont::IGNORE);
|
||||
break;
|
||||
case 2: font.setEmph(LyXFont::TOGGLE); break;
|
||||
case 3: font.setUnderbar(LyXFont::TOGGLE); break;
|
||||
case 4: font.setNoun(LyXFont::TOGGLE); break;
|
||||
case 5: font.setLatex(LyXFont::TOGGLE); break;
|
||||
case 6: font.setEmph(LyXFont::INHERIT);
|
||||
font.setUnderbar(LyXFont::INHERIT);
|
||||
font.setNoun(LyXFont::INHERIT);
|
||||
font.setLatex(LyXFont::INHERIT);
|
||||
break;
|
||||
}
|
||||
|
||||
pos = fl_get_choice(fd_form_character->choice_color);
|
||||
switch (pos) {
|
||||
case 1: font.setColor(LColor::ignore); break;
|
||||
case 2: font.setColor(LColor::none); break;
|
||||
case 3: font.setColor(LColor::black); break;
|
||||
case 4: font.setColor(LColor::white); break;
|
||||
case 5: font.setColor(LColor::red); break;
|
||||
case 6: font.setColor(LColor::green); break;
|
||||
case 7: font.setColor(LColor::blue); break;
|
||||
case 8: font.setColor(LColor::cyan); break;
|
||||
case 9: font.setColor(LColor::magenta); break;
|
||||
case 10: font.setColor(LColor::yellow); break;
|
||||
case 11: font.setColor(LColor::inherit); break;
|
||||
}
|
||||
|
||||
int const choice = combo_language2->get();
|
||||
if (choice == 1)
|
||||
font.setLanguage(ignore_language);
|
||||
else if (choice == 2)
|
||||
font.setLanguage(params.language);
|
||||
else
|
||||
font.setLanguage(languages.getLanguage(combo_language2->getline()));
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
|
||||
/* callbacks for form form_character */
|
||||
|
||||
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(current_view->buffer()->params));
|
||||
current_view->setState();
|
||||
toggleall = true;
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
void CharacterCloseCB(FL_OBJECT *, long)
|
||||
{
|
||||
fl_hide_form(fd_form_character->form_character);
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
void CharacterOKCB(FL_OBJECT * ob, long data)
|
||||
{
|
||||
CharacterApplyCB(ob, data);
|
||||
CharacterCloseCB(ob, data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Figure()
|
||||
{
|
||||
if (fd_form_figure->form_figure->visible) {
|
||||
|
@ -19,8 +19,6 @@ extern bool toggleall;
|
||||
///
|
||||
extern bool BindFileSet;
|
||||
///
|
||||
extern LyXFont const UserFreeFont(BufferParams const & params);
|
||||
///
|
||||
void ShowMessage(Buffer const * buf,
|
||||
string const & msg1,
|
||||
string const & msg2 = string(),
|
||||
@ -48,8 +46,6 @@ void MenuLayoutCharacter();
|
||||
///
|
||||
void MenuLayoutSave(BufferView * bv);
|
||||
///
|
||||
LyXFont const UserFreeFont(BufferParams const & params);
|
||||
///
|
||||
void Figure();
|
||||
///
|
||||
void Reconfigure(BufferView * bv);
|
||||
|
@ -16,14 +16,13 @@
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
//#include <fcntl.h>
|
||||
#include "lyx_gui.h"
|
||||
#include FORMS_H_LOCATION
|
||||
#include "support/filetools.h"
|
||||
#include "combox.h"
|
||||
#include "lyx.h"
|
||||
#include "form1.h"
|
||||
#include "layout_forms.h"
|
||||
#include "print_form.h"
|
||||
#include "tex-strings.h"
|
||||
#include "lyx_main.h"
|
||||
@ -47,11 +46,8 @@
|
||||
|
||||
using std::endl;
|
||||
|
||||
FD_form_character * fd_form_character;
|
||||
FD_form_sendto * fd_form_sendto;
|
||||
FD_form_figure * fd_form_figure;
|
||||
Combox * combo_language;
|
||||
Combox * combo_language2;
|
||||
|
||||
extern LyXServer * lyxserver;
|
||||
extern bool finished; // flag, that we are quitting the program
|
||||
@ -278,53 +274,6 @@ void LyXGUI::create_forms()
|
||||
// Create forms
|
||||
//
|
||||
|
||||
// the character form
|
||||
fd_form_character = create_form_form_character();
|
||||
fl_set_form_atclose(fd_form_character->form_character,
|
||||
CancelCloseBoxCB, 0);
|
||||
fl_addto_choice(fd_form_character->choice_family,
|
||||
_(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
|
||||
fl_addto_choice(fd_form_character->choice_series,
|
||||
_(" No change %l| Medium | Bold %l| Reset "));
|
||||
fl_addto_choice(fd_form_character->choice_shape,
|
||||
_(" No change %l| Upright | Italic | Slanted | Small Caps "
|
||||
"%l| Reset "));
|
||||
fl_addto_choice(fd_form_character->choice_size,
|
||||
_(" No change %l| Tiny | Smallest | Smaller | Small "
|
||||
"| Normal | Large | Larger | Largest | Huge | Huger "
|
||||
"%l| Increase | Decrease | Reset "));
|
||||
fl_addto_choice(fd_form_character->choice_bar,
|
||||
_(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
|
||||
fl_addto_choice(fd_form_character->choice_color,
|
||||
_(" No change %l| No color | Black | White | Red | Green "
|
||||
"| Blue | Cyan | Magenta | Yellow %l| Reset "));
|
||||
// Appears to need initialising to avoid seg fault when dialog is
|
||||
// launched. Over-written by combo_language2, below
|
||||
fl_addto_choice(fd_form_character->choice_language,
|
||||
_(" English %l| German | French "));
|
||||
fl_set_form_minsize(fd_form_character->form_character,
|
||||
fd_form_character->form_character->w,
|
||||
fd_form_character->form_character->h);
|
||||
lyxerr[Debug::INIT] << "Initializing form_character::combox..." << endl;
|
||||
fl_addto_form(fd_form_character->form_character);
|
||||
combo_language2 = new Combox(FL_COMBOX_DROPLIST);
|
||||
FL_OBJECT * ob = fd_form_character->choice_language;
|
||||
combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
|
||||
combo_language2->shortcut("#L", 1);
|
||||
fl_end_form();
|
||||
lyxerr[Debug::INIT] << "Initializing form_character...done" << endl;
|
||||
|
||||
// build up the combox entries
|
||||
combo_language2->addline(_("No change"));
|
||||
combo_language2->addline(_("Reset"));
|
||||
for (Languages::const_iterator cit = languages.begin();
|
||||
cit != languages.end(); ++cit) {
|
||||
#ifdef DO_USE_DEFAULT_LANGUAGE
|
||||
if ((*cit).second.lang() != "default")
|
||||
#endif
|
||||
combo_language2->addto((*cit).second.lang());
|
||||
}
|
||||
|
||||
// the sendto form
|
||||
fd_form_sendto = create_form_form_sendto();
|
||||
fl_set_form_atclose(fd_form_sendto->form_sendto, CancelCloseBoxCB, 0);
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "credits_form.h"
|
||||
#include "form1.h"
|
||||
#include "gettext.h"
|
||||
#include "layout_forms.h"
|
||||
#include "lyx.h"
|
||||
#include "lyx_cb.h"
|
||||
#include "lyx_main.h"
|
||||
@ -41,7 +40,6 @@ using std::endl;
|
||||
|
||||
extern BufferView * current_view;
|
||||
|
||||
extern FD_form_character * fd_form_character;
|
||||
extern FD_form_credits * fd_form_credits;
|
||||
extern FD_form_figure * fd_form_figure;
|
||||
extern FD_form_sendto * fd_form_sendto;
|
||||
@ -70,9 +68,6 @@ void RedrawAllBufferRelatedDialogs()
|
||||
if (fd_delim && fd_delim->delim->visible) {
|
||||
fl_redraw_form(fd_delim->delim);
|
||||
}
|
||||
if (fd_form_character->form_character->visible) {
|
||||
fl_redraw_form(fd_form_character->form_character);
|
||||
}
|
||||
if (fd_form_credits && fd_form_credits->form_credits->visible) {
|
||||
fl_redraw_form(fd_form_credits->form_credits);
|
||||
}
|
||||
@ -111,9 +106,6 @@ void CloseAllBufferRelatedDialogs()
|
||||
// have been created otherwise hiding one could cause a crash
|
||||
// need the visible check otherwise XForms prints a warning
|
||||
// if hiding an invisible form
|
||||
if (fd_form_character->form_character->visible) {
|
||||
fl_hide_form(fd_form_character->form_character);
|
||||
}
|
||||
if (fd_form_figure->form_figure->visible) {
|
||||
fl_hide_form(fd_form_figure->form_figure);
|
||||
}
|
||||
@ -159,9 +151,6 @@ void updateAllVisibleBufferRelatedDialogs(bool)
|
||||
{
|
||||
if (current_view->buffer() && current_view->buffer()->isReadonly()) {
|
||||
// a little crude perhaps but it works. ARRae
|
||||
if (fd_form_character->form_character->visible) {
|
||||
fl_hide_form(fd_form_character->form_character);
|
||||
}
|
||||
#ifndef ALWAYS_CLOSE_MATH_PANELS
|
||||
// The math popups should be closed only if we switch
|
||||
// to a readonly buffer
|
||||
|
@ -957,9 +957,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_FREE:
|
||||
Free(owner->view());
|
||||
owner->view()->setState();
|
||||
owner->showState();
|
||||
owner->getDialogs()->setUserFreeFont();
|
||||
break;
|
||||
|
||||
case LFUN_TEX:
|
||||
@ -1159,7 +1157,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_CHARACTER:
|
||||
MenuLayoutCharacter();
|
||||
owner->getDialogs()->showLayoutCharacter();
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_TABULAR:
|
||||
|
@ -151,7 +151,8 @@ void MathMacro::GetXY(int & x, int & y) const
|
||||
bool MathMacro::Permit(short f) const
|
||||
{
|
||||
return (nargs_ > 0) ?
|
||||
tmplate_->getMacroPar(idx_)->Permit(f) : MathParInset::Permit(f);
|
||||
tmplate_->getMacroPar(idx_)->Permit(f) :
|
||||
MathParInset::Permit(f);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user