]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/XFormsView.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / XFormsView.C
index 8cf898ee30c0b0c76dc80576caf39f402a4565c3..7971cf91ffe87e883c6b69480745732a653f0ae5 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "XFormsView.h"
 #include FORMS_H_LOCATION
@@ -27,7 +24,7 @@
 #include "frontends/Timeout.h"
 #include "frontends/Dialogs.h"
 #include "MenuBackend.h"
-#include "ToolbarDefaults.h"
+#include "ToolbarBackend.h"
 #include "lyxfunc.h"
 #include "bufferview_funcs.h"
 #include "BufferView.h"
@@ -145,7 +142,7 @@ void XFormsView::create_form_form_main(int width, int height)
 
        menubar_.reset(new Menubar(this, menubackend));
 
-       toolbar_.reset(new Toolbar(this, air, 30 + air + bw, toolbardefaults));
+       toolbar_.reset(new Toolbar(this, air, 30 + air + bw, toolbarbackend));
 
        int const ywork = 60 + 2 * air + bw;
        int const workheight = height - ywork - (25 + 2 * air);
@@ -154,7 +151,7 @@ void XFormsView::create_form_form_main(int width, int height)
                width - 3 * air, workheight));
        ::current_view = bufferview_.get();
 
-       minibuffer_.reset(new XMiniBuffer(this, *controlcommand_,
+       minibuffer_.reset(new XMiniBuffer(*controlcommand_,
                air, height - (25 + air), width - (2 * air), 25));
 
        //  assign an icon to main form
@@ -176,8 +173,6 @@ void XFormsView::create_form_form_main(int width, int height)
        fl_set_form_minsize(getForm(), 50, 50);
 
        fl_end_form();
-
-       minibuffer_->dd_init();
 }
 
 
@@ -200,40 +195,34 @@ void XFormsView::show_view_state()
 }
 
 
-// How should this actually work? Should it prohibit input in all BufferViews,
-// or just in the current one? If "just the current one", then it should be
-// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
-// run "prohibitInput" on all LyXViews which will run prohibitInput on all
-// BufferViews. Or is it perhaps just the (input in) BufferViews in the
-// current LyXView that should be prohibited (Lgb) (This applies to
-// "allowInput" as well.)
-void XFormsView::prohibitInput() const
+void XFormsView::busy(bool yes) const
 {
-       view()->hideCursor();
+       if (yes) {
+               view()->hideCursor();
 
-       static Cursor cursor;
-       static bool cursor_undefined = true;
+               static Cursor cursor;
+               static bool cursor_undefined = true;
 
-       if (cursor_undefined) {
-               cursor = XCreateFontCursor(fl_get_display(), XC_watch);
-               XFlush(fl_get_display());
-               cursor_undefined = false;
-       }
+               if (cursor_undefined) {
+                       cursor = XCreateFontCursor(fl_get_display(), XC_watch);
+                       XFlush(fl_get_display());
+                       cursor_undefined = false;
+               }
 
-       /* set the cursor to the watch for all forms and the canvas */
-       XDefineCursor(fl_get_display(), getForm()->window, cursor);
-
-       XFlush(fl_get_display());
-       fl_deactivate_all_forms();
-}
+               /// set the cursor to the watch for all forms and the canvas
+               XDefineCursor(fl_get_display(), getForm()->window, cursor);
 
+               XFlush(fl_get_display());
 
-void XFormsView::allowInput() const
-{
-       /* reset the cursor from the watch for all forms and the canvas */
+               /// we only need to deactivate to prevent resetting the cursor
+               /// to I-beam over the workarea
+               fl_deactivate_all_forms();
+       } else {
+               /// reset the cursor from the watch for all forms and the canvas
 
-       XUndefineCursor(fl_get_display(), getForm()->window);
+               XUndefineCursor(fl_get_display(), getForm()->window);
 
-       XFlush(fl_get_display());
-       fl_activate_all_forms();
+               XFlush(fl_get_display());
+               fl_activate_all_forms();
+       }
 }