3 * FormGraphics Interface Class
6 * ======================================================
8 * LyX, The Document Processor
10 * Copyright 1995 Matthias Ettrich
11 * Copyright 1995-2000 The LyX Team.
13 * ======================================================
16 #ifndef FORMGRAPHICS_H
17 #define FORMGRAPHICS_H
20 #include "RadioButtonGroup.h"
21 #include "ButtonPolicies.h"
22 #include "FormInset.h"
28 // Forward declarations for classes we use only as pointers.
31 struct FD_form_graphics;
33 /** This class provides an XForms implementation of the FormGraphics Dialog.
35 * @Author Baruch Even <baruch.even@writeme.com>
37 class FormGraphics : public FormInset {
39 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
40 FormGraphics(LyXView *, Dialogs *);
45 /// The maximum digits for the image width (cm, inch, percent)
50 /// The maximum digits for the image height (cm, inch, percent)
55 /// The maximum characters in the rotation angle (minus sign and 3 digits)
60 /// The maximum characters in a filename.
63 FILENAME_MAXCHARS = 1024
78 virtual bool input( FL_OBJECT *, long );
80 virtual void update();
84 /// Disconnect signals. Also perform any necessary housekeeping.
85 virtual void disconnect();
87 /// Save the active inset and show the dialog.
88 void showDialog(InsetGraphics *);
89 /// Explicitly free the dialog.
91 /// Verify that the input is correct. If not disable ok/apply buttons.
93 /// Open the file browse dialog to select an image file.
95 /// Display a file browser dialog and return the file chosen.
96 string browseFile(string const & filename);
98 /// Pointer to the actual instantiation of the xform's form
99 virtual FL_FORM * form() const;
100 /// Fdesign generated method
101 FD_form_graphics * build_graphics();
103 /// Real GUI implementation.
104 FD_form_graphics * dialog_;
105 /** Which Inset do we belong to?
106 Used to set and update data to/from the inset.
108 InsetGraphics * inset_;
109 /// The radio buttons groups
110 RadioButtonGroup widthButtons;
112 RadioButtonGroup heightButtons;
114 RadioButtonGroup displayButtons;
115 /// Last used figure path
116 string last_image_path;