#include "lyxparagraph.h"
#include "gettext.h"
#include "lyxtext.h"
+#include "LyXView.h"
extern FD_form_paragraph_extra * fd_form_paragraph_extra;
-extern MiniBuffer * minibuffer;
extern BufferView * current_view;
-extern void BeforeChange();
static bool CheckInputWidth();
-inline void DeactivateParagraphExtraButtons ()
+inline
+void DeactivateParagraphExtraButtons ()
{
fl_deactivate_object(fd_form_paragraph_extra->button_ok);
fl_deactivate_object(fd_form_paragraph_extra->button_apply);
fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_INACTIVE);
}
-inline void ActivateParagraphExtraButtons ()
+inline
+void ActivateParagraphExtraButtons ()
{
fl_activate_object(fd_form_paragraph_extra->button_ok);
fl_activate_object(fd_form_paragraph_extra->button_apply);
fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_BLACK);
}
-inline void DisableParagraphExtra ()
+inline
+void DisableParagraphExtra ()
{
DeactivateParagraphExtraButtons();
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_startmp);
}
-inline void EnableParagraphExtra ()
+inline
+void EnableParagraphExtra ()
{
ActivateParagraphExtraButtons();
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_startmp);
}
+
bool UpdateParagraphExtra()
{
bool update = false;
- if (current_view->getScreen() && current_view->available()) {
+ if (current_view->available()) {
update = true;
- LyXParagraph * par = current_view->text->cursor.par;
+ LyXParagraph * par = current_view->text->cursor.par();
EnableParagraphExtra();
void ParagraphExtraApplyCB(FL_OBJECT *, long)
{
- if (current_view->getScreen() && current_view->available()) {
+ if (current_view->available()) {
FD_form_paragraph_extra const * fd = fd_form_paragraph_extra;
char const * width = fl_get_input(fd->input_pextra_width);
char const * widthp = fl_get_input(fd->input_pextra_widthp);
} else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt)) {
type = LyXParagraph::PEXTRA_FLOATFLT;
}
- text->SetParagraphExtraOpt(type, width, widthp, alignment, hfill,
+ text->SetParagraphExtraOpt(current_view, type, width, widthp, alignment, hfill,
start_minipage);
- current_view->update(1);
- minibuffer->Set(_("ParagraphExtra layout set"));
+ current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ current_view->owner()->getMiniBuffer()->
+ Set(_("ParagraphExtra layout set"));
}
return;
}
}
-static bool CheckInputWidth()
+static
+bool CheckInputWidth()
{
string s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width);
string s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp);