From 1608fcf229cfdf329102419937a180bd075eddf0 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 23 May 2001 13:19:14 +0000 Subject: [PATCH] small bug fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@2022 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 12 +++++ lib/ui/default.ui | 4 +- src/frontends/xforms/FormCitation.C | 32 ++++-------- src/frontends/xforms/form_citation.C | 30 +++-------- src/frontends/xforms/form_citation.h | 2 - src/frontends/xforms/forms/form_citation.fd | 56 ++++----------------- 6 files changed, 41 insertions(+), 95 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63533e1103..8d4d3f9188 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-05-23 Angus Leeming + + * src/frontends/xforms/FormCitation.C: + * src/frontends/xforms/forms/form_citation.fd: + tweaks to activate Ok,Apply buttons when text is entered. + Removed natbib cruft as it's now in a branch and was deactivated + anyway. + +2001-05-22 Jean-Marc Lasgouttes + + * lib/ui/default.ui: fix Insert>File>Ascii entries. + 2001-05-22 Peter Suetterlin * lib/templates/aa.lyx: rename from aapaper.lyx diff --git a/lib/ui/default.ui b/lib/ui/default.ui index ce1f2ecfbb..b6b4127db7 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -203,8 +203,8 @@ Menuset Menu "insert_file" Item "LyX Document...|X" "file-insert" - Item "Ascii as Lines...|L" "file-insert-ascii lines" - Item "Ascii as Paragraphs...|P" "file-insert-ascii paragraphs" + Item "Ascii as Lines...|L" "file-insert-ascii line" + Item "Ascii as Paragraphs...|P" "file-insert-ascii paragraph" End # diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index bb802fa68b..b3a49a878b 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -83,6 +83,8 @@ void FormCitation::build() minw_ = form()->w; minh_ = form()->h; + fl_set_input_return(dialog_->textAftr, FL_RETURN_CHANGED); + // Manage the ok, apply, restore and cancel/close buttons bc_.setOK(dialog_->button_ok); bc_.setApply(dialog_->button_apply); @@ -94,7 +96,6 @@ void FormCitation::build() bc_.addReadOnly(dialog_->delBtn); bc_.addReadOnly(dialog_->upBtn); bc_.addReadOnly(dialog_->downBtn); - bc_.addReadOnly(dialog_->textBefore); bc_.addReadOnly(dialog_->textAftr); } @@ -222,7 +223,6 @@ void FormCitation::setCiteButtons( State status ) const void FormCitation::setSize( int hbrsr, bool bibPresent ) const { - bool const natbib = false; // will eventually be input hbrsr = max( hbrsr, 175 ); // limit max size of cite/bib brsrs // dh1, dh2, dh3 are the vertical separation between elements. @@ -230,22 +230,18 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const // so they are not changed by dynamic resizing static int const dh1 = 30; // top of form to top of cite/bib brsrs; // bottom of cite/bib brsrs to top of info; - // bottom of info to top next element; - // bottom of style to top textBefore; + // bottom of info to top text; // bottom of text to top ok/cancel buttons. - static int const dh2 = 10; // bottom of textBefore to top textAftr; - // bottom of ok/cancel buttons to bottom form + static int const dh2 = 10; // bottom of ok/cancel buttons to bottom form static int const dh3 = 5; // spacing between add/delete/... buttons. int const wbrsr = dialog_->citeBrsr->w; static int const hinfo = dialog_->infoBrsr->h; - static int const hstyle = dialog_->style->h; static int const htext = dialog_->textAftr->h; static int const hok = dialog_->button_ok->h; int hform = dh1 + hbrsr + dh1; if (bibPresent ) hform += hinfo + dh1; - if (natbib ) hform += hstyle + dh1 + htext + dh2; hform += htext + dh1 + hok + dh2; if (hform != minh_) { @@ -283,20 +279,6 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const } else fl_hide_object( dialog_->infoBrsr ); - if (natbib) { - x = dialog_->style->x; - fl_set_object_position( dialog_->style, x, y ); - fl_show_object( dialog_->style ); - x = dialog_->textBefore->x; - y += hstyle + dh1; - fl_set_object_position( dialog_->textBefore, x, y ); - fl_show_object( dialog_->textBefore ); - y += htext + dh2; - } else { - fl_hide_object( dialog_->style ); - fl_hide_object( dialog_->textBefore ); - } - x = dialog_->textAftr->x; fl_set_object_position( dialog_->textAftr, x, y ); @@ -315,7 +297,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const #ifdef WITH_WARNINGS #warning convert this to use the buttoncontroller #endif -bool FormCitation::input( FL_OBJECT *, long data ) +bool FormCitation::input( FL_OBJECT * ob, long data ) { bool activate = false; State cb = static_cast( data ); @@ -463,6 +445,10 @@ bool FormCitation::input( FL_OBJECT *, long data ) default: break; } + + // Fix (23 May 2001) to activate buttons when text is entered. Angus + if (ob == dialog_->textAftr) activate = true; + return activate; } diff --git a/src/frontends/xforms/form_citation.C b/src/frontends/xforms/form_citation.C index a42b253118..73a1547ac6 100644 --- a/src/frontends/xforms/form_citation.C +++ b/src/frontends/xforms/form_citation.C @@ -22,9 +22,9 @@ FD_form_citation * FormCitation::build_citation() FL_OBJECT *obj; FD_form_citation *fdui = new FD_form_citation; - fdui->form = fl_bgn_form(FL_NO_BOX, 435, 665); + fdui->form = fl_bgn_form(FL_NO_BOX, 435, 565); fdui->form->u_vdata = this; - fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 435, 665, ""); + fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 435, 565, ""); { char const * const dummy = N_("Inset keys|#I"); fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 300, idex(_(dummy))); @@ -67,48 +67,34 @@ FD_form_citation * FormCitation::build_citation() fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); fl_set_object_resize(obj, FL_RESIZE_NONE); - { - char const * const dummy = N_("Citation style|#s"); - fdui->style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 470, 130, 30, idex(_(dummy))); - fl_set_button_shortcut(obj, scex(_(dummy)), 1); - } - fl_set_object_boxtype(obj, FL_DOWN_BOX); - fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); - fl_set_object_resize(obj, FL_RESIZE_NONE); - { - char const * const dummy = N_("Text before|#T"); - fdui->textBefore = obj = fl_add_input(FL_NORMAL_INPUT, 100, 520, 250, 30, idex(_(dummy))); - fl_set_button_shortcut(obj, scex(_(dummy)), 1); - } - fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); - fl_set_object_resize(obj, FL_RESIZE_NONE); { char const * const dummy = N_("Text after|#e"); - fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 570, 250, 30, idex(_(dummy))); + fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 470, 250, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); fl_set_object_resize(obj, FL_RESIZE_NONE); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); { char const * const dummy = N_("Restore|#R"); - fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 630, 90, 30, idex(_(dummy))); + fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 525, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 630, 90, 30, _("OK")); + fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 525, 90, 30, _("OK")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_callback(obj, C_FormBaseOKCB, 0); { char const * const dummy = N_("Apply|#A"); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 630, 90, 30, idex(_(dummy))); + fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 525, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_callback(obj, C_FormBaseApplyCB, 0); { char const * const dummy = N_("Cancel|#C^["); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, idex(_(dummy))); + fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 525, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); diff --git a/src/frontends/xforms/form_citation.h b/src/frontends/xforms/form_citation.h index 2ed52ae311..7af4df532e 100644 --- a/src/frontends/xforms/form_citation.h +++ b/src/frontends/xforms/form_citation.h @@ -25,8 +25,6 @@ struct FD_form_citation { FL_OBJECT *upBtn; FL_OBJECT *downBtn; FL_OBJECT *infoBrsr; - FL_OBJECT *style; - FL_OBJECT *textBefore; FL_OBJECT *textAftr; FL_OBJECT *button_restore; FL_OBJECT *button_ok; diff --git a/src/frontends/xforms/forms/form_citation.fd b/src/frontends/xforms/forms/form_citation.fd index 29ea49335c..e0cb08108c 100644 --- a/src/frontends/xforms/forms/form_citation.fd +++ b/src/frontends/xforms/forms/form_citation.fd @@ -9,13 +9,13 @@ Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form_citation Width: 435 -Height: 665 -Number of Objects: 15 +Height: 565 +Number of Objects: 13 -------------------- class: FL_BOX type: UP_BOX -box: 0 0 435 665 +box: 0 0 435 565 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -156,46 +156,10 @@ name: infoBrsr callback: argument: --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 160 470 130 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Citation style|#s -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthWest FL_SouthEast -name: style -callback: -argument: - -------------------- class: FL_INPUT type: NORMAL_INPUT -box: 100 520 250 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Text before|#T -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthWest FL_SouthEast -name: textBefore -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 100 570 250 30 +box: 100 470 250 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT @@ -207,13 +171,13 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_SouthEast name: textAftr -callback: -argument: +callback: C_FormBaseInputCB +argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 10 630 90 30 +box: 10 525 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -231,7 +195,7 @@ argument: 0 -------------------- class: FL_BUTTON type: RETURN_BUTTON -box: 130 630 90 30 +box: 130 525 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -249,7 +213,7 @@ argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 230 630 90 30 +box: 230 525 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -267,7 +231,7 @@ argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 330 630 90 30 +box: 330 525 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER