X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbullet_forms_cb.C;h=761f322514f53bf7040472ca21f4d5f9f0b14ea0;hb=e059c633b01937f450ff9fa873cfc6b773aa74cc;hp=04954de7aabfa7d91e64c820c87f899f2abd6493;hpb=0eccdd1c3613e5170deb77b22174dd0afde833e9;p=lyx.git diff --git a/src/bullet_forms_cb.C b/src/bullet_forms_cb.C index 04954de7aa..761f322514 100644 --- a/src/bullet_forms_cb.C +++ b/src/bullet_forms_cb.C @@ -11,9 +11,8 @@ #include "gettext.h" #include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert -extern int mono_video; -extern BufferView *current_view; -FD_form_bullet *fd_form_bullet; +extern BufferView * current_view; +FD_form_bullet * fd_form_bullet; static int current_bullet_panel; static int current_bullet_depth; @@ -23,12 +22,11 @@ static int current_bullet_depth; void bulletForm() { if (!fd_form_bullet) { - if (!mono_video - && (XpmVersion < 4 - || (XpmVersion == 4 && XpmRevision < 7))) { + if ((XpmVersion < 4 + || (XpmVersion == 4 && XpmRevision < 7))) { WriteAlert(_("Sorry, your libXpm is too old."), _("This feature requires xpm-4.7 (a.k.a 3.4g) or newer."), - _("Try running LyX in mono mode (lyx -Mono).")); + ""); return; } fd_form_bullet = create_form_form_bullet(); @@ -47,7 +45,7 @@ void bulletForm() } else { fl_show_form(fd_form_bullet->form_bullet, - FL_PLACE_MOUSE,FL_FULLBORDER, + FL_PLACE_MOUSE, FL_FULLBORDER, _("Itemize Bullet Selection")); } } @@ -61,8 +59,8 @@ bool updateBulletForm() } if (!current_view->available()) { update = false; - } else if (current_view->currentBuffer()->isReadonly() - || current_view->currentBuffer()->isLinuxDoc()) { + } else if (current_view->buffer()->isReadonly() + || current_view->buffer()->isLinuxDoc()) { fl_deactivate_object (fd_form_bullet->button_ok); fl_deactivate_object (fd_form_bullet->button_apply); fl_set_object_lcol (fd_form_bullet->button_ok, FL_INACTIVE); @@ -85,10 +83,10 @@ bool updateBulletForm() // any settings that need doing each time fl_set_button(fd_form_bullet->radio_bullet_depth_1, 1); fl_set_input(fd_form_bullet->input_bullet_latex, - current_view->currentBuffer() + current_view->buffer() ->params.user_defined_bullets[0].c_str()); fl_set_choice(fd_form_bullet->choice_bullet_size, - current_view->currentBuffer() + current_view->buffer() ->params.user_defined_bullets[0].getSize() + 2); } else { if (fd_form_bullet->form_bullet->visible) { @@ -110,15 +108,15 @@ void BulletOKCB(FL_OBJECT *ob, long data) void BulletApplyCB(FL_OBJECT * /*ob*/, long /*data*/ ) { - /* update the bullet settings */ - BufferParams & param = current_view->currentBuffer()->params; + // update the bullet settings + BufferParams & param = current_view->buffer()->params; // a little bit of loop unrolling param.user_defined_bullets[0] = param.temp_bullets[0]; param.user_defined_bullets[1] = param.temp_bullets[1]; param.user_defined_bullets[2] = param.temp_bullets[2]; param.user_defined_bullets[3] = param.temp_bullets[3]; - current_view->currentBuffer()->markDirty(); + current_view->buffer()->markDirty(); } @@ -126,7 +124,7 @@ void BulletCancelCB(FL_OBJECT * /*ob*/, long /*data*/ ) { fl_hide_form(fd_form_bullet->form_bullet); // this avoids confusion when reopening - BufferParams & param = current_view->currentBuffer()->params; + BufferParams & param = current_view->buffer()->params; param.temp_bullets[0] = param.user_defined_bullets[0]; param.temp_bullets[1] = param.user_defined_bullets[1]; param.temp_bullets[2] = param.user_defined_bullets[2]; @@ -136,8 +134,8 @@ void BulletCancelCB(FL_OBJECT * /*ob*/, long /*data*/ ) void InputBulletLaTeXCB(FL_OBJECT *, long) { - /* fill-in code for callback */ - BufferParams & param = current_view->currentBuffer()->params; + // fill-in code for callback + BufferParams & param = current_view->buffer()->params; param.temp_bullets[current_bullet_depth].setText( fl_get_input(fd_form_bullet->input_bullet_latex)); @@ -146,7 +144,7 @@ void InputBulletLaTeXCB(FL_OBJECT *, long) void ChoiceBulletSizeCB(FL_OBJECT * ob, long /*data*/ ) { - BufferParams & param = current_view->currentBuffer()->params; + BufferParams & param = current_view->buffer()->params; // convert from 1-6 range to -1-4 param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2); @@ -155,7 +153,7 @@ void ChoiceBulletSizeCB(FL_OBJECT * ob, long /*data*/ ) } -void BulletDepthCB(FL_OBJECT *ob, long data) +void BulletDepthCB(FL_OBJECT * ob, long data) { /* Should I do the following: */ /* 1. change to the panel that the current bullet belongs in */ @@ -165,7 +163,7 @@ void BulletDepthCB(FL_OBJECT *ob, long data) /* */ /* I'm inclined to just go with 3 and 4 at the moment and */ /* maybe try to support the others later */ - BufferParams & param = current_view->currentBuffer()->params; + BufferParams & param = current_view->buffer()->params; switch (fl_get_button_numb(ob)) { case 3: @@ -220,16 +218,9 @@ void BulletPanelCB(FL_OBJECT * /*ob*/, long data) new_panel = "standard"; break; } - if (mono_video) { - new_panel += ".xbm"; - fl_set_bmtable_file(fd_form_bullet->bmtable_bullet_panel, 6, 6, - LibFileSearch("images", new_panel.c_str()).c_str()); - } - else { - new_panel += ".xpm"; - fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6, - LibFileSearch("images", new_panel.c_str()).c_str()); - } + new_panel += ".xpm"; + fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6, + LibFileSearch("images", new_panel.c_str()).c_str()); fl_redraw_object(fd_form_bullet->bmtable_bullet_panel); fl_unfreeze_form(fd_form_bullet->form_bullet); } @@ -242,7 +233,7 @@ void BulletBMTableCB(FL_OBJECT *ob, long /*data*/ ) /* to that extracted from the current chosen position of the BMTable */ /* Don't forget to free the button's old pixmap first. */ - BufferParams & param = current_view->currentBuffer()->params; + BufferParams & param = current_view->buffer()->params; int bmtable_button = fl_get_bmtable(ob); /* try to keep the button held down till another is pushed */