Martin's patches, Part II

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3290 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-01-03 16:17:16 +00:00
parent b63592b7d8
commit 0a24eab88f
6 changed files with 95 additions and 24 deletions

View File

@ -41,6 +41,8 @@
#include "matrix.xpm"
#include "space.xpm"
#include "sqrt.xpm"
#include "sub.xpm"
#include "super.xpm"
#include "arrows.xbm"
#include "bop.xbm"
@ -137,6 +139,10 @@ void FormMathsPanel::build()
const_cast<char**>(sqrt_xpm));
fl_set_pixmap_data(dialog_->button_frac,
const_cast<char**>(frac));
fl_set_pixmap_data(dialog_->button_super,
const_cast<char**>(super_xpm));
fl_set_pixmap_data(dialog_->button_sub,
const_cast<char**>(sub_xpm));
fl_set_pixmap_data(dialog_->button_delim,
const_cast<char**>(delim));
fl_set_pixmap_data(dialog_->button_deco,
@ -224,6 +230,20 @@ bool FormMathsPanel::input(FL_OBJECT *, long data)
insertSymbol("sqrt");
break;
case MM_SUPER:
lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
break;
case MM_SUB:
lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
break;
case MM_SUBSUPER:
lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
lv_->getLyXFunc()->dispatch(LFUN_LEFT);
lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
break;
case MM_DELIM:
if (active_ && active_ != delim_.get())
active_->hide();

View File

@ -39,6 +39,9 @@ enum MathsCallbackValues {
MM_FRAC,
MM_SQRT,
MM_DELIM,
MM_SUPER,
MM_SUB,
MM_SUBSUPER,
MM_MATRIX,
MM_EQU,
MM_DECO,

View File

@ -42,6 +42,8 @@ using std::strstr;
#include "dots.xbm"
#include "mathed/math_parser.h"
#include "frac.xpm"
#include "sub.xpm"
#include "super.xpm"
#include "sqrt.xpm"
#include "delim.xbm"
#include "delim.xpm"
@ -146,6 +148,8 @@ static char const ** mathed_get_pixmap_from_icon(int d)
switch (d) {
case MM_FRAC: return frac;
case MM_SQRT: return sqrt_xpm;
case MM_SUPER: return super_xpm;
case MM_SUB: return sub_xpm;
case MM_DELIM: return delim;
case MM_MATRIX: return matrix;
case MM_EQU: return equation;

View File

@ -22,13 +22,13 @@ FD_form_maths_panel * FormMathsPanel::build_maths_panel()
FL_OBJECT *obj;
FD_form_maths_panel *fdui = new FD_form_maths_panel;
fdui->form = fl_bgn_form(FL_NO_BOX, 274, 226);
fdui->form = fl_bgn_form(FL_NO_BOX, 260, 180);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 274, 226, "");
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 100, 180, 80, 30, _("Close "));
obj = fl_add_box(FL_UP_BOX, 0, 0, 260, 180, "");
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 170, 140, 80, 30, _("Close "));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0);
fdui->browser_funcs = obj = fl_add_browser(FL_SELECT_BROWSER, 170, 30, 90, 140, _("Functions"));
fdui->browser_funcs = obj = fl_add_browser(FL_SELECT_BROWSER, 170, 30, 80, 100, _("Functions"));
fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_FUNC);
fl_set_browser_hscrollbar(obj, FL_OFF);
@ -52,26 +52,26 @@ FD_form_maths_panel * FormMathsPanel::build_maths_panel()
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_TIMESITALIC_STYLE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_MISC);
fdui->button_equation = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 130, 50, 30, 30, "");
fdui->button_equation = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 130, 40, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_EQU);
fdui->button_sqrt = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 20, 30, 30, "");
fdui->button_sqrt = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 10, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_SQRT);
fdui->button_frac = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 20, 30, 30, "");
fdui->button_frac = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 10, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_lcolor(obj, FL_COL1);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_FRAC);
fdui->button_delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 70, 20, 30, 30, "");
fdui->button_delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 70, 10, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_DELIM);
fdui->button_matrix = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 50, 30, 30, "");
fdui->button_matrix = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 100, 40, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_MATRIX);
fdui->button_deco = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 100, 20, 30, 30, "");
fdui->button_deco = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 100, 10, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_DECO);
fdui->button_space = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 130, 20, 30, 30, "");
fdui->button_space = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 130, 10, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_SPACE);
fdui->button_dots = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 140, 50, 30, _("Dots"));
@ -82,6 +82,12 @@ FD_form_maths_panel * FormMathsPanel::build_maths_panel()
fl_set_object_lsize(obj, 0);
fl_set_object_lstyle(obj, 15);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_VARSIZE);
fdui->button_sub = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 40, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_SUB);
fdui->button_super = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 40, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_SUPER);
fl_end_form();
fdui->form->fdui = fdui;

View File

@ -30,6 +30,8 @@ struct FD_form_maths_panel {
FL_OBJECT *button_space;
FL_OBJECT *button_dots;
FL_OBJECT *button_varsize;
FL_OBJECT *button_sub;
FL_OBJECT *button_super;
};
#endif /* FD_form_maths_panel_h_ */

View File

@ -8,14 +8,14 @@ Unit of measure: FL_COORD_PIXEL
=============== FORM ===============
Name: form_maths_panel
Width: 274
Height: 226
Number of Objects: 17
Width: 260
Height: 180
Number of Objects: 19
--------------------
class: FL_BOX
type: UP_BOX
box: 0 0 274 226
box: 0 0 260 180
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -33,7 +33,7 @@ argument:
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
box: 100 180 80 30
box: 170 140 80 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -51,7 +51,7 @@ argument: 0
--------------------
class: FL_BROWSER
type: SELECT_BROWSER
box: 170 30 90 140
box: 170 30 80 100
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP
@ -160,7 +160,7 @@ argument: MM_MISC
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 130 50 30 30
box: 130 40 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -178,7 +178,7 @@ argument: MM_EQU
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 10 20 30 30
box: 10 10 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -196,7 +196,7 @@ argument: MM_SQRT
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 40 20 30 30
box: 40 10 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -214,7 +214,7 @@ argument: MM_FRAC
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 70 20 30 30
box: 70 10 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -232,7 +232,7 @@ argument: MM_DELIM
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 10 50 30 30
box: 100 40 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -250,7 +250,7 @@ argument: MM_MATRIX
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 100 20 30 30
box: 100 10 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -268,7 +268,7 @@ argument: MM_DECO
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 130 20 30 30
box: 130 10 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
@ -319,5 +319,41 @@ name: button_varsize
callback: C_FormBaseDeprecatedInputCB
argument: MM_VARSIZE
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 40 40 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_sub
callback: C_FormBaseDeprecatedInputCB
argument: MM_SUB
--------------------
class: FL_PIXMAPBUTTON
type: NORMAL_BUTTON
box: 10 40 30 30
boxtype: FL_UP_BOX
colors: FL_MCOL FL_BLUE
alignment: FL_ALIGN_BOTTOM
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_super
callback: C_FormBaseDeprecatedInputCB
argument: MM_SUPER
==============================
create_the_forms