]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/FormError.h
Clean-up of the button controller.
[lyx.git] / src / frontends / gnome / FormError.h
index ba2d2ab5b5e0e074a0c330ad41c69ef2ee87fc91..e8a57302d34b708a556794769b1c4e77ffd7cf27 100644 (file)
@@ -1,13 +1,15 @@
 // -*- C++ -*-
 /* This file is part of
- * ====================================================== 
+ * =================================================
+ * 
+ *          LyX, The Document Processor
+ *          Copyright 1995 Matthias Ettrich.
+ *          Copyright 1995-2000 The LyX Team.
  *
- *           LyX, The Document Processor
+ * ================================================= 
  *
- *           Copyright 2000 The LyX Team.
- *
- * ======================================================
- */
+ * \author Baruch Even
+ * */
 
 #ifndef FORMERROR_H
 #define FORMERROR_H
 #pragma interface
 #endif
 
-#include "DialogBase.h"
-#include "LString.h"
-#include "boost/utility.hpp"
-#include "insets/inseterror.h"
+#include "ControlError.h"
+#include "GnomeBase.h"
 
-#include <gtk--/container.h>
+namespace Gtk {
+class Button;
+class Text;
+}
 
-/** This class provides an Gnome implementation of the FormError Dialog.
+/**
+ * This class implements the dialog to show error messages.
  */
-class FormError : public DialogBase, public noncopyable {
+class FormError : public FormCB<ControlError> {
 public:
-  ///
-  FormError(LyXView *, Dialogs *);
-  ///
-  ~FormError();
+       ///
+       FormError(ControlError & c);
+       ///
+       ~FormError() {};
+
+       void apply() {};
+       void update();
+       
 private:
-  /// Slot launching dialog to an existing inset
-  void showInset( InsetError * const );
-  
-  /// Update dialog before showing it
-  virtual void update(bool = false);
-  /// Apply from dialog (modify or create inset)
-  virtual void apply();
-  /// Explicitly free the dialog.
-  void free();
-  /// Create the dialog if necessary, update it and display it.
-  void show();
-  /// Hide the dialog.
-  void hide();
-  
-  /** Which LyXFunc do we use?
-      We could modify Dialogs to have a visible LyXFunc* instead and
-      save a couple of bytes per dialog.
-  */
-  LyXView * lv_;
-  /** Which Dialogs do we belong to?
-      Used so we can get at the signals we have to connect to.
-  */
-  Dialogs * d_;
-  /// pointer to the inset passed through showInset (if any)
-  InsetError * inset_;
-  /// Update connection.
-  Connection u_;
-  /// Hide connection.
-  Connection h_;
-  /// inset::hide connection.
-  Connection ih_;
+       /// Build the dialog
+       void build();
+
+       /// Returns true if the dialog input is in a valid state.
+       bool validate() const {return true;};
+
 
-  /// Real GUI implementation.
-  Gtk::Container * dialog_;
+       void CloseClicked() { CancelButton(); }
+       
+       /// The close button
+       Gtk::Button * close_btn() const;
+       Gtk::Text * textarea() const;
 };
 
 #endif