]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormDocument.C
Swap two printer related help messages.
[lyx.git] / src / frontends / xforms / FormDocument.C
index 3452f6ee573e4b54c7532ca05f74a25e72fe95a9..b144834f81f986e5e7b8d1a036d0d9f372b05045 100644 (file)
@@ -73,6 +73,19 @@ FormDocument::~FormDocument()
 }
 
 
+void FormDocument::redraw()
+{
+       if( form() && form()->visible )
+               fl_redraw_form( form() );
+       else
+               return;
+
+       FL_FORM * outer_form = fl_get_active_folder(dialog_->tabbed_folder);
+       if (outer_form && outer_form->visible)
+               fl_redraw_form( outer_form );
+}
+
+
 FL_FORM * FormDocument::form() const
 {
     if (dialog_) return dialog_->form;
@@ -87,7 +100,7 @@ void FormDocument::build()
     // the tabbed folder
     dialog_ = build_tabbed_document();
 
-    // manage the restore, ok, apply and cancel/close buttons
+    // Manage the restore, ok, apply, restore and cancel/close buttons
     bc_.setOK(dialog_->button_ok);
     bc_.setApply(dialog_->button_apply);
     bc_.setCancel(dialog_->button_cancel);
@@ -108,15 +121,15 @@ void FormDocument::build()
                      "| A4 small Margins (only portrait) "
                      "| A4 very small Margins (only portrait) "
                      "| A4 very wide margins (only portrait) "));
-    fl_set_input_return(paper_->input_custom_width, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_custom_height, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_top_margin, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_bottom_margin, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_left_margin, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_right_margin, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_head_height, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_head_sep, FL_RETURN_ALWAYS);
-    fl_set_input_return(paper_->input_foot_skip, FL_RETURN_ALWAYS);
+    fl_set_input_return(paper_->input_custom_width, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_custom_height, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_top_margin, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_bottom_margin, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_left_margin, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_right_margin, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_head_height, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_head_sep, FL_RETURN_CHANGED);
+    fl_set_input_return(paper_->input_foot_skip, FL_RETURN_CHANGED);
 
     bc_.addReadOnly (paper_->choice_paperpackage);
     bc_.addReadOnly (paper_->greoup_radio_orientation);
@@ -143,7 +156,8 @@ void FormDocument::build()
     obj = class_->choice_doc_class;
     fl_addto_form(class_->form);
     combo_doc_class = new Combox(FL_COMBOX_DROPLIST);
-    combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400);
+    combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400,
+                        dialog_->tabbed_folder);
     combo_doc_class->shortcut("#C",1);
     combo_doc_class->setcallback(ComboInputCB, this);
     fl_end_form();
@@ -170,8 +184,9 @@ void FormDocument::build()
                    "default|empty|plain|headings|fancy");
     fl_addto_choice(class_->choice_doc_skip,
                    _(" Smallskip | Medskip | Bigskip | Length "));
-    fl_set_input_return(class_->input_doc_skip, FL_RETURN_ALWAYS);
-    fl_set_input_return(class_->input_doc_spacing, FL_RETURN_ALWAYS);
+    fl_set_input_return(class_->input_doc_extra, FL_RETURN_CHANGED);
+    fl_set_input_return(class_->input_doc_skip, FL_RETURN_CHANGED);
+    fl_set_input_return(class_->input_doc_spacing, FL_RETURN_CHANGED);
 
     bc_.addReadOnly (class_->radio_doc_indent);
     bc_.addReadOnly (class_->radio_doc_skip);
@@ -201,7 +216,8 @@ void FormDocument::build()
     obj = language_->choice_language;
     fl_addto_form(language_->form);
     combo_language = new Combox(FL_COMBOX_DROPLIST);
-    combo_language->add(obj->x, obj->y, obj->w, obj->h, 400);
+    combo_language->add(obj->x, obj->y, obj->w, obj->h, 400,
+                       dialog_->tabbed_folder);
     combo_language->shortcut("#L",1);
     combo_language->setcallback(ComboInputCB, this);
     fl_end_form();
@@ -209,7 +225,7 @@ void FormDocument::build()
 #ifdef DO_USE_DEFAULT_LANGUAGE
     combo_language->addto("default");
 #endif
-    for(Languages::const_iterator cit = languages.begin();
+    for (Languages::const_iterator cit = languages.begin();
        cit != languages.end(); ++cit) {
        combo_language->addto((*cit).second.lang());
     }
@@ -223,6 +239,7 @@ void FormDocument::build()
 
     // the document options form
     options_ = build_doc_options();
+    fl_set_input_return(options_->input_float_placement, FL_RETURN_CHANGED);
     fl_set_counter_bounds(options_->slider_secnumdepth,-2,5);
     fl_set_counter_bounds(options_->slider_tocdepth,-1,5);
     fl_set_counter_step(options_->slider_secnumdepth,1,1);
@@ -324,7 +341,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
 {
        State cb = static_cast<State>( data );
 
-       switch( cb ) {
+       switch (cb) {
        case CHECKCHOICECLASS:
                CheckChoiceClass(ob, 0);
                break;
@@ -355,7 +372,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
                break;
        }
        
-       switch( data ) {
+       switch (data) {
        case INPUT:
        case CHECKCHOICECLASS:
        case CHOICEBULLETSIZE:
@@ -476,7 +493,7 @@ bool FormDocument::class_apply()
                params.sides = LyXTextClass::OneSide;
        
        Spacing tmpSpacing = params.spacing;
-       switch(fl_get_choice(class_->choice_doc_spacing)) {
+       switch (fl_get_choice(class_->choice_doc_spacing)) {
        case 1:
                lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
                params.spacing.set(Spacing::Single);
@@ -536,7 +553,7 @@ bool FormDocument::language_apply()
     InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
     bool redo = false;
 
-    switch(fl_get_choice(language_->choice_quotes_language) - 1) {
+    switch (fl_get_choice(language_->choice_quotes_language) - 1) {
     case 0:
        lga = InsetQuotes::EnglishQ;
        break;
@@ -672,7 +689,7 @@ void FormDocument::class_update(BufferParams const & params)
     }
     fl_set_button(class_->radio_doc_sides_one, 0);
     fl_set_button(class_->radio_doc_sides_two, 0);
-    if (params.sides == 2)
+    if (params.sides == LyXTextClass::TwoSides)
        fl_set_button(class_->radio_doc_sides_two, 1);
     else
        fl_set_button(class_->radio_doc_sides_one, 1);
@@ -816,6 +833,7 @@ void FormDocument::checkReadOnly()
 
 void FormDocument::checkMarginValues()
 {
+#if 0
     int const allEmpty = (!strlen(fl_get_input(paper_->input_top_margin)) &&
                !strlen(fl_get_input(paper_->input_bottom_margin)) &&
                !strlen(fl_get_input(paper_->input_left_margin)) &&
@@ -827,8 +845,10 @@ void FormDocument::checkMarginValues()
                !strlen(fl_get_input(paper_->input_custom_height)));
     if (!allEmpty)
        fl_set_button(paper_->push_use_geometry, 1);
+#endif
 }
 
+
 bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
 {
     string str;
@@ -952,13 +972,13 @@ void FormDocument::BulletDepth(FL_OBJECT * ob, State cb)
     BufferParams & param = lv_->buffer()->params;
 
     int data = 0;
-    ifcb == BULLETDEPTH1 )
+    if (cb == BULLETDEPTH1 )
            data = 0;
-    else if ( cb == BULLETDEPTH2 )
+    else if (cb == BULLETDEPTH2 )
            data = 1;
-    else if ( cb == BULLETDEPTH3 )
+    else if (cb == BULLETDEPTH3 )
            data = 2;
-    else if ( cb == BULLETDEPTH4 )
+    else if (cb == BULLETDEPTH4 )
            data = 3;
 
     switch (fl_get_button_numb(ob)) {
@@ -981,17 +1001,17 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb)
     /* by the user. (eg. standard.xpm, psnfss1.xpm etc...)           */
     
     int data = 0;
-    ifcb == BULLETPANEL1 )
+    if (cb == BULLETPANEL1 )
            data = 0;
-    else if ( cb == BULLETPANEL2 )
+    else if (cb == BULLETPANEL2 )
            data = 1;
-    else if ( cb == BULLETPANEL3 )
+    else if (cb == BULLETPANEL3 )
            data = 2;
-    else if ( cb == BULLETPANEL4 )
+    else if (cb == BULLETPANEL4 )
            data = 3;
-    else if ( cb == BULLETPANEL5 )
+    else if (cb == BULLETPANEL5 )
            data = 4;
-    else if ( cb == BULLETPANEL6 )
+    else if (cb == BULLETPANEL6 )
            data = 5;
 
     if (data != current_bullet_panel) {