mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Convert FormMathsBitmap to the new scheme.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7179 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8b5b727d52
commit
256064c765
@ -1,16 +1,17 @@
|
|||||||
2003-06-17 Angus Leeming <leeming@lyx.org>
|
2003-06-17 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* FormMathsBitmap.[Ch]:
|
||||||
* FormMathsDelim.[Ch]:
|
* FormMathsDelim.[Ch]:
|
||||||
* forms/form_maths_delim.fd:
|
* forms/form_maths_delim.fd:
|
||||||
* FormMathsMatrix.[Ch]:
|
* FormMathsMatrix.[Ch]:
|
||||||
* forms/form_maths_matrix.fd:
|
* forms/form_maths_matrix.fd:
|
||||||
* FormMathsPanel.C:
|
* FormMathsPanel.[Ch]:
|
||||||
* FormMathsSpace.[Ch]:
|
* FormMathsSpace.[Ch]:
|
||||||
* forms/form_maths_space.fd:
|
* forms/form_maths_space.fd:
|
||||||
* FormMathsStyle.[Ch]:
|
* FormMathsStyle.[Ch]:
|
||||||
* forms/form_maths_style.fd:
|
* forms/form_maths_style.fd:
|
||||||
* Dialogs.C: convert FormMathsDelim, FormMathsMatrix, FormMathsSpace and
|
* Dialogs.C: convert FormMathsBitmap, FormMathsDelim, FormMathsMatrix,
|
||||||
FormMathsStyle to the new Dialog-based scheme.
|
FormMathsSpace and FormMathsStyle to the new Dialog-based scheme.
|
||||||
|
|
||||||
2003-06-12 Angus Leeming <leeming@lyx.org>
|
2003-06-12 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "FormGraphics.h"
|
#include "FormGraphics.h"
|
||||||
#include "FormInclude.h"
|
#include "FormInclude.h"
|
||||||
#include "FormLog.h"
|
#include "FormLog.h"
|
||||||
|
#include "FormMathsBitmap.h"
|
||||||
#include "FormMathsDelim.h"
|
#include "FormMathsDelim.h"
|
||||||
#include "FormMathsMatrix.h"
|
#include "FormMathsMatrix.h"
|
||||||
#include "FormMathsSpace.h"
|
#include "FormMathsSpace.h"
|
||||||
@ -78,12 +79,40 @@
|
|||||||
#include "xformsBC.h"
|
#include "xformsBC.h"
|
||||||
#include "ButtonController.h"
|
#include "ButtonController.h"
|
||||||
|
|
||||||
|
#include "arrows.xbm"
|
||||||
|
#include "bop.xbm"
|
||||||
|
#include "brel.xbm"
|
||||||
|
#include "deco.xbm"
|
||||||
|
#include "dots.xbm"
|
||||||
|
#include "greek.xbm"
|
||||||
|
#include "misc.xbm"
|
||||||
|
#include "varsz.xbm"
|
||||||
|
|
||||||
|
#include "ams_misc.xbm"
|
||||||
|
#include "ams_arrows.xbm"
|
||||||
|
#include "ams_rel.xbm"
|
||||||
|
#include "ams_nrel.xbm"
|
||||||
|
#include "ams_ops.xbm"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
FormMathsBitmap * createFormBitmap(Dialog & parent, string const & title,
|
||||||
|
char const * const * data, int size)
|
||||||
|
{
|
||||||
|
char const * const * const end = data + size;
|
||||||
|
return new FormMathsBitmap(parent, title, std::vector<string>(data, end));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
||||||
"character", "citation", "error", "errorlist" , "ert", "external", "file",
|
"character", "citation", "error", "errorlist" , "ert", "external", "file",
|
||||||
"float", "graphics", "include", "index", "label", "log",
|
"float", "graphics", "include", "index", "label", "log",
|
||||||
|
"mathaccents", "matharrows", "mathoperators", "mathrelations", "mathgreek",
|
||||||
|
"mathmisc", "mathdots", "mathbigoperators", "mathamsmisc",
|
||||||
|
"mathamsarrows", "mathamsrelations", "mathamsnegatedrelations", "mathamsoperators",
|
||||||
"mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
|
"mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
|
||||||
"minipage", "paragraph", "ref", "tabular", "tabularcreate",
|
"minipage", "paragraph", "ref", "tabular", "tabularcreate",
|
||||||
|
|
||||||
@ -105,7 +134,6 @@ private:
|
|||||||
char const * name_;
|
char const * name_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace anon
|
} // namespace anon
|
||||||
|
|
||||||
|
|
||||||
@ -194,6 +222,167 @@ Dialog * Dialogs::build(string const & name)
|
|||||||
dialog->setController(new ControlLog(*dialog));
|
dialog->setController(new ControlLog(*dialog));
|
||||||
dialog->setView(new FormLog(*dialog));
|
dialog->setView(new FormLog(*dialog));
|
||||||
dialog->bc().bp(new OkCancelPolicy);
|
dialog->bc().bp(new OkCancelPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathaccents") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Maths Decorations & Accents"),
|
||||||
|
latex_deco, nr_latex_deco);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(10, 4, 3, deco2_width, deco2_height, deco2_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "matharrows") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Arrows"), latex_arrow, nr_latex_arrow);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(20, 5, 4, arrow_width, arrow_height, arrow_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(7, 2, 4, larrow_width, larrow_height, larrow_bits, false));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(4, 2, 2, darrow_width, darrow_height, darrow_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathoperators") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Binary Ops"),
|
||||||
|
latex_bop, nr_latex_bop);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathrelations") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Binary Relations"),
|
||||||
|
latex_brel, nr_latex_brel);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathgreek") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Greek"),
|
||||||
|
latex_greek, nr_latex_greek);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(28, 7, 4, greek_width, greek_height, greek_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathmisc") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Misc"),
|
||||||
|
latex_misc, nr_latex_misc);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(5, 5, 1, misc4_width, misc4_height, misc4_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(6, 3, 2, misc2_width, misc2_height, misc2_bits, false));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(4, 2, 2, misc3_width, misc3_height, misc3_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathdots") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Dots"),
|
||||||
|
latex_dots, nr_latex_dots);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathbigoperators") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("Big Operators"),
|
||||||
|
latex_varsz, nr_latex_varsz);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathamsmisc") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("AMS Misc"),
|
||||||
|
latex_ams_misc, nr_latex_ams_misc);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(26, 3, 9, ams7_width, ams7_height, ams7_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathamsarrows") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("AMS Arrows"),
|
||||||
|
latex_ams_arrows, nr_latex_ams_arrows);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true));
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(6, 3, 2, ams3_width, ams3_height, ams3_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathamsrelations") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("AMS Relations"),
|
||||||
|
latex_ams_rel, nr_latex_ams_rel);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathamsnegatedrelations") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("AMS Negated Rel"),
|
||||||
|
latex_ams_nrel, nr_latex_ams_nrel);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
|
} else if (name == "mathamsoperators") {
|
||||||
|
FormMathsBitmap * bitmap =
|
||||||
|
createFormBitmap(*dialog, _("AMS Operators"),
|
||||||
|
latex_ams_ops, nr_latex_ams_ops);
|
||||||
|
bitmap->addBitmap(
|
||||||
|
BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true));
|
||||||
|
|
||||||
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
|
dialog->setView(bitmap);
|
||||||
|
dialog->bc().bp(new IgnorantPolicy);
|
||||||
|
|
||||||
} else if (name == "mathdelimiter") {
|
} else if (name == "mathdelimiter") {
|
||||||
dialog->setController(new ControlMath2(*dialog));
|
dialog->setController(new ControlMath2(*dialog));
|
||||||
dialog->setView(new FormMathsDelim(*dialog));
|
dialog->setView(new FormMathsDelim(*dialog));
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "FormMathsBitmap.h"
|
#include "FormMathsBitmap.h"
|
||||||
#include "ControlMath.h"
|
#include "ControlMath2.h"
|
||||||
#include "xformsBC.h"
|
#include "xformsBC.h"
|
||||||
|
|
||||||
#include "bmtable.h"
|
#include "bmtable.h"
|
||||||
@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
|
extern "C" void C_FormDialogView_CancelCB(FL_OBJECT *, long);
|
||||||
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
|
extern "C" void C_FormDialogView_InputCB(FL_OBJECT *, long);
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::max;
|
using std::max;
|
||||||
@ -40,11 +40,11 @@ FD_maths_bitmap::~FD_maths_bitmap()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef FormCB<ControlMathSub, FormDB<FD_maths_bitmap> > base_class;
|
typedef FormController<ControlMath2, FormView<FD_maths_bitmap> > base_class;
|
||||||
|
|
||||||
|
|
||||||
FormMathsBitmap::FormMathsBitmap(string const & t, vector<string> const & l)
|
FormMathsBitmap::FormMathsBitmap(Dialog & parent, string const & t, vector<string> const & l)
|
||||||
: base_class(t, false),
|
: base_class(parent, t, false),
|
||||||
latex_(l), ww_(0), x_(0), y_(0), w_(0), h_(0)
|
latex_(l), ww_(0), x_(0), y_(0), w_(0), h_(0)
|
||||||
{
|
{
|
||||||
ww_ = 2 * FL_abs(FL_BOUND_WIDTH);
|
ww_ = 2 * FL_abs(FL_BOUND_WIDTH);
|
||||||
@ -53,17 +53,16 @@ FormMathsBitmap::FormMathsBitmap(string const & t, vector<string> const & l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormMathsBitmap::addBitmap(int nt, int nx, int ny, int bw, int bh,
|
void FormMathsBitmap::addBitmap(BitmapStore const & bm)
|
||||||
unsigned char const * data, bool vert)
|
|
||||||
{
|
{
|
||||||
bitmaps_.push_back(BitmapStore(nt, nx, ny, bw, bh, data, vert));
|
bitmaps_.push_back(bm);
|
||||||
|
|
||||||
int wx = bw + ww_ / 2;
|
int wx = bm.bw + ww_ / 2;
|
||||||
int wy = bh + ww_ / 2;
|
int wy = bm.bh + ww_ / 2;
|
||||||
wx += (wx % nx);
|
wx += (wx % bm.nx);
|
||||||
wy += (wy % ny);
|
wy += (wy % bm.ny);
|
||||||
|
|
||||||
if (vert) {
|
if (bm.vert) {
|
||||||
y_ += wy + 8;
|
y_ += wy + 8;
|
||||||
h_ = max(y_, h_);
|
h_ = max(y_, h_);
|
||||||
w_ = max(x_ + wx + ww_, w_);
|
w_ = max(x_ + wx + ww_, w_);
|
||||||
@ -109,14 +108,13 @@ void FormMathsBitmap::build()
|
|||||||
idex(label).c_str());
|
idex(label).c_str());
|
||||||
fl_set_button_shortcut(fdui->button_close, scex(label).c_str(), 1);
|
fl_set_button_shortcut(fdui->button_close, scex(label).c_str(), 1);
|
||||||
fl_set_object_lsize(fdui->button_close, FL_NORMAL_SIZE);
|
fl_set_object_lsize(fdui->button_close, FL_NORMAL_SIZE);
|
||||||
fl_set_object_callback(fdui->button_close, C_FormBaseCancelCB, 0);
|
fl_set_object_callback(fdui->button_close, C_FormDialogView_CancelCB, 0);
|
||||||
|
|
||||||
fl_end_form();
|
fl_end_form();
|
||||||
|
|
||||||
fdui->form->fdui = fdui;
|
fdui->form->fdui = fdui;
|
||||||
|
|
||||||
dialog_.reset(fdui);
|
dialog_.reset(fdui);
|
||||||
bcview().setCancel(dialog_->button_close);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,7 +143,7 @@ FL_OBJECT * FormMathsBitmap::buildBitmap(BitmapStore const & bmstore)
|
|||||||
fl_set_bmtable_data(obj, bmstore.nx, bmstore.ny, bmstore.bw, bmstore.bh,
|
fl_set_bmtable_data(obj, bmstore.nx, bmstore.ny, bmstore.bw, bmstore.bh,
|
||||||
bmstore.data);
|
bmstore.data);
|
||||||
fl_set_bmtable_maxitems(obj, bmstore.nt);
|
fl_set_bmtable_maxitems(obj, bmstore.nt);
|
||||||
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
|
fl_set_object_callback(obj, C_FormDialogView_InputCB, 0);
|
||||||
|
|
||||||
if (bmstore.vert) {
|
if (bmstore.vert) {
|
||||||
y_ += wy + 8;
|
y_ += wy + 8;
|
||||||
@ -180,10 +178,10 @@ void FormMathsBitmap::apply()
|
|||||||
string::size_type const i = latex_chosen_.find(' ');
|
string::size_type const i = latex_chosen_.find(' ');
|
||||||
if (i != string::npos) {
|
if (i != string::npos) {
|
||||||
controller().dispatchFunc(LFUN_MATH_MODE);
|
controller().dispatchFunc(LFUN_MATH_MODE);
|
||||||
controller().insertSymbol(latex_chosen_.substr(0,i));
|
controller().dispatchInsert(latex_chosen_.substr(0,i));
|
||||||
controller().insertSymbol(latex_chosen_.substr(i + 1), false);
|
controller().dispatchInsert('\\' + latex_chosen_.substr(i + 1));
|
||||||
} else
|
} else
|
||||||
controller().insertSymbol(latex_chosen_);
|
controller().dispatchInsert(latex_chosen_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
#define FORM_MATHSBITMAP_H
|
#define FORM_MATHSBITMAP_H
|
||||||
|
|
||||||
|
|
||||||
#include "FormBase.h"
|
#include "FormDialogView.h"
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
struct BitmapStore
|
struct BitmapStore
|
||||||
{
|
{
|
||||||
BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
|
BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
|
||||||
@ -49,16 +50,15 @@ struct FD_maths_bitmap
|
|||||||
* This class provides an XForms implementation of a maths bitmap form.
|
* This class provides an XForms implementation of a maths bitmap form.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ControlMathSub;
|
class ControlMath2;
|
||||||
|
|
||||||
class FormMathsBitmap : public FormCB<ControlMathSub, FormDB<FD_maths_bitmap> >
|
class FormMathsBitmap
|
||||||
{
|
: public FormController<ControlMath2, FormView<FD_maths_bitmap> > {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
FormMathsBitmap(string const &, std::vector<string> const &);
|
FormMathsBitmap(Dialog &, string const &, std::vector<string> const &);
|
||||||
///
|
///
|
||||||
void addBitmap(int, int, int, int, int, unsigned char const *,
|
void addBitmap(BitmapStore const &);
|
||||||
bool = true);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
|
@ -19,13 +19,6 @@
|
|||||||
#include "forms/form_maths_panel.h"
|
#include "forms/form_maths_panel.h"
|
||||||
#include "xformsBC.h"
|
#include "xformsBC.h"
|
||||||
|
|
||||||
#include "FormMathsBitmap.h"
|
|
||||||
|
|
||||||
#include "forms/form_maths_delim.h"
|
|
||||||
#include "forms/form_maths_matrix.h"
|
|
||||||
#include "forms/form_maths_space.h"
|
|
||||||
#include "forms/form_maths_style.h"
|
|
||||||
|
|
||||||
#include "lyx_forms.h"
|
#include "lyx_forms.h"
|
||||||
|
|
||||||
#include "deco.xpm"
|
#include "deco.xpm"
|
||||||
@ -39,21 +32,6 @@
|
|||||||
#include "sub.xpm"
|
#include "sub.xpm"
|
||||||
#include "super.xpm"
|
#include "super.xpm"
|
||||||
|
|
||||||
#include "arrows.xbm"
|
|
||||||
#include "bop.xbm"
|
|
||||||
#include "brel.xbm"
|
|
||||||
#include "deco.xbm"
|
|
||||||
#include "dots.xbm"
|
|
||||||
#include "greek.xbm"
|
|
||||||
#include "misc.xbm"
|
|
||||||
#include "varsz.xbm"
|
|
||||||
|
|
||||||
#include "ams_misc.xbm"
|
|
||||||
#include "ams_arrows.xbm"
|
|
||||||
#include "ams_rel.xbm"
|
|
||||||
#include "ams_nrel.xbm"
|
|
||||||
#include "ams_ops.xbm"
|
|
||||||
|
|
||||||
|
|
||||||
typedef FormCB<ControlMath, FormDB<FD_maths_panel> > base_class;
|
typedef FormCB<ControlMath, FormDB<FD_maths_panel> > base_class;
|
||||||
|
|
||||||
@ -62,22 +40,6 @@ FormMathsPanel::FormMathsPanel()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
FormMathsBitmap * FormMathsPanel::addDaughter(void * key,
|
|
||||||
string const & title,
|
|
||||||
char const * const * data,
|
|
||||||
int size)
|
|
||||||
{
|
|
||||||
char const * const * const end = data + size;
|
|
||||||
FormMathsBitmap * const view =
|
|
||||||
new FormMathsBitmap(title, std::vector<string>(data, end));
|
|
||||||
|
|
||||||
controller().addDaughter(key, view,
|
|
||||||
new xformsBC(controller().bc()),
|
|
||||||
new IgnorantPolicy);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FormMathsPanel::build()
|
void FormMathsPanel::build()
|
||||||
{
|
{
|
||||||
dialog_.reset(build_maths_panel(this));
|
dialog_.reset(build_maths_panel(this));
|
||||||
@ -106,103 +68,43 @@ void FormMathsPanel::build()
|
|||||||
const_cast<char**>(matrix));
|
const_cast<char**>(matrix));
|
||||||
fl_set_pixmap_data(dialog_->button_equation,
|
fl_set_pixmap_data(dialog_->button_equation,
|
||||||
const_cast<char**>(equation));
|
const_cast<char**>(equation));
|
||||||
|
|
||||||
FormMathsBitmap * bitmap;
|
|
||||||
bitmap = addDaughter(dialog_->button_deco,
|
|
||||||
_("Maths Decorations & Accents"),
|
|
||||||
latex_deco, nr_latex_deco);
|
|
||||||
bitmap->addBitmap(12, 3, 4, deco1_width, deco1_height, deco1_bits);
|
|
||||||
bitmap->addBitmap(10, 4, 3, deco2_width, deco2_height, deco2_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_arrow, _("Arrows"),
|
|
||||||
latex_arrow, nr_latex_arrow);
|
|
||||||
bitmap->addBitmap(20, 5, 4, arrow_width, arrow_height, arrow_bits);
|
|
||||||
bitmap->addBitmap(7, 2, 4, larrow_width, larrow_height, larrow_bits,
|
|
||||||
false);
|
|
||||||
bitmap->addBitmap(4, 2, 2, darrow_width, darrow_height, darrow_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_boperator, _("Binary Ops"),
|
|
||||||
latex_bop, nr_latex_bop);
|
|
||||||
bitmap->addBitmap(31, 4, 8, bop_width, bop_height, bop_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_brelats, _("Bin Relations"),
|
|
||||||
latex_brel, nr_latex_brel);
|
|
||||||
bitmap->addBitmap(35, 4, 9, brel_width, brel_height, brel_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_greek, _("Greek"),
|
|
||||||
latex_greek, nr_latex_greek);
|
|
||||||
bitmap->addBitmap(11, 6, 2, Greek_width, Greek_height, Greek_bits);
|
|
||||||
bitmap->addBitmap(28, 7, 4, greek_width, greek_height, greek_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_misc,_("Misc"),
|
|
||||||
latex_misc, nr_latex_misc);
|
|
||||||
bitmap->addBitmap(29, 5, 6, misc_width, misc_height, misc_bits);
|
|
||||||
bitmap->addBitmap(5, 5, 1, misc4_width, misc4_height, misc4_bits);
|
|
||||||
bitmap->addBitmap(6, 3, 2, misc2_width, misc2_height, misc2_bits,
|
|
||||||
false);
|
|
||||||
bitmap->addBitmap(4, 2, 2, misc3_width, misc3_height, misc3_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_dots, _("Dots"),
|
|
||||||
latex_dots, nr_latex_dots);
|
|
||||||
bitmap->addBitmap(4, 4, 1, dots_width, dots_height, dots_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_varsize, _("Big Operators"),
|
|
||||||
latex_varsz, nr_latex_varsz);
|
|
||||||
bitmap->addBitmap(14, 3, 5, varsz_width, varsz_height, varsz_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_ams_misc, _("AMS Misc"),
|
|
||||||
latex_ams_misc, nr_latex_ams_misc);
|
|
||||||
bitmap->addBitmap(9, 5, 2, ams1_width, ams1_height, ams1_bits);
|
|
||||||
bitmap->addBitmap(26, 3, 9, ams7_width, ams7_height, ams7_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_ams_arrows, _("AMS Arrows"),
|
|
||||||
latex_ams_arrows, nr_latex_ams_arrows);
|
|
||||||
bitmap->addBitmap(32, 3, 11, ams2_width, ams2_height, ams2_bits);
|
|
||||||
bitmap->addBitmap(6, 3, 2, ams3_width, ams3_height, ams3_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_ams_brel, _("AMS Relations"),
|
|
||||||
latex_ams_rel, nr_latex_ams_rel);
|
|
||||||
bitmap->addBitmap(66, 6, 11, ams_rel_width, ams_rel_height,
|
|
||||||
ams_rel_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_ams_nrel, _("AMS Negated Rel"),
|
|
||||||
latex_ams_nrel, nr_latex_ams_nrel);
|
|
||||||
bitmap->addBitmap(51, 6, 9, ams_nrel_width, ams_nrel_height,
|
|
||||||
ams_nrel_bits);
|
|
||||||
|
|
||||||
bitmap = addDaughter(dialog_->button_ams_ops, _("AMS Operators"),
|
|
||||||
latex_ams_ops, nr_latex_ams_ops);
|
|
||||||
bitmap->addBitmap(23, 3, 8, ams_ops_width, ams_ops_height,
|
|
||||||
ams_ops_bits);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ButtonPolicy::SMInput FormMathsPanel::input(FL_OBJECT * ob, long)
|
ButtonPolicy::SMInput FormMathsPanel::input(FL_OBJECT * ob, long)
|
||||||
{
|
{
|
||||||
if (ob == dialog_->button_arrow ||
|
if (ob == dialog_->button_arrow) {
|
||||||
ob == dialog_->button_boperator ||
|
controller().showDialog("matharrows");
|
||||||
ob == dialog_->button_brelats ||
|
} else if (ob == dialog_->button_deco) {
|
||||||
ob == dialog_->button_greek ||
|
controller().showDialog("mathaccents");
|
||||||
ob == dialog_->button_misc ||
|
} else if (ob == dialog_->button_boperator) {
|
||||||
ob == dialog_->button_dots ||
|
controller().showDialog("mathoperators");
|
||||||
ob == dialog_->button_varsize ||
|
} else if (ob == dialog_->button_brelats) {
|
||||||
ob == dialog_->button_ams_misc ||
|
controller().showDialog("mathrelations");
|
||||||
ob == dialog_->button_ams_arrows ||
|
} else if (ob == dialog_->button_greek) {
|
||||||
ob == dialog_->button_ams_brel ||
|
controller().showDialog("mathgreek");
|
||||||
ob == dialog_->button_ams_nrel ||
|
} else if (ob == dialog_->button_misc) {
|
||||||
ob == dialog_->button_ams_ops ||
|
controller().showDialog("mathmisc");
|
||||||
ob == dialog_->button_deco) {
|
} else if (ob == dialog_->button_dots) {
|
||||||
controller().showDaughter(ob);
|
controller().showDialog("mathdots");
|
||||||
|
} else if (ob == dialog_->button_varsize) {
|
||||||
|
controller().showDialog("mathbigoperators");
|
||||||
|
} else if (ob == dialog_->button_ams_misc) {
|
||||||
|
controller().showDialog("mathamsmisc");
|
||||||
|
} else if (ob == dialog_->button_ams_arrows) {
|
||||||
|
controller().showDialog("mathamsarrows");
|
||||||
|
} else if (ob == dialog_->button_ams_brel) {
|
||||||
|
controller().showDialog("mathamsrelations");
|
||||||
|
} else if (ob == dialog_->button_ams_nrel) {
|
||||||
|
controller().showDialog("mathamsnegatedrelations");
|
||||||
|
} else if (ob == dialog_->button_ams_ops) {
|
||||||
|
controller().showDialog("mathamsoperators");
|
||||||
} else if (ob == dialog_->button_delim) {
|
} else if (ob == dialog_->button_delim) {
|
||||||
controller().showDialog("mathdelimiter");
|
controller().showDialog("mathdelimiter");
|
||||||
|
|
||||||
} else if (ob == dialog_->button_matrix) {
|
} else if (ob == dialog_->button_matrix) {
|
||||||
controller().showDialog("mathmatrix");
|
controller().showDialog("mathmatrix");
|
||||||
|
|
||||||
} else if (ob == dialog_->button_space) {
|
} else if (ob == dialog_->button_space) {
|
||||||
controller().showDialog("mathspace");
|
controller().showDialog("mathspace");
|
||||||
|
|
||||||
} else if (ob == dialog_->button_style) {
|
} else if (ob == dialog_->button_style) {
|
||||||
controller().showDialog("mathstyle");
|
controller().showDialog("mathstyle");
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
class ControlMath;
|
class ControlMath;
|
||||||
struct FD_maths_panel;
|
struct FD_maths_panel;
|
||||||
class FormMathsBitmap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides an XForms implementation of the maths panel.
|
* This class provides an XForms implementation of the maths panel.
|
||||||
@ -39,12 +38,6 @@ private:
|
|||||||
virtual void build();
|
virtual void build();
|
||||||
///
|
///
|
||||||
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
|
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
|
||||||
|
|
||||||
/** Add a bitmap dialog to the store of all daughters_ and
|
|
||||||
* return a pointer to the dialog, so that bitmaps can be added to it.
|
|
||||||
*/
|
|
||||||
FormMathsBitmap * addDaughter(void * button, string const & title,
|
|
||||||
char const * const * data, int size);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FORM_MATHSPANEL_H
|
#endif // FORM_MATHSPANEL_H
|
||||||
|
Loading…
Reference in New Issue
Block a user