3 * FormGraphics Interface Class
6 * ======================================================
8 * LyX, The Document Processor
10 * Copyright 1995 Matthias Ettrich
11 * Copyright 1995-2000 The LyX Team.
13 * This file Copyright 2000
15 * ======================================================
18 #ifndef FORMGRAPHICS_H
19 #define FORMGRAPHICS_H
23 #include "frontends/DialogBase.h"
24 //#include "form_graphics.h"
25 #include "RadioButtonGroup.h"
32 // same arguement as in Dialogs.h s/LyX/UI/
36 struct FD_form_graphics;
38 /** This class provides an XForms implementation of the FormGraphics Dialog.
40 class FormGraphics: public DialogBase {
42 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
43 FormGraphics(LyXView *, Dialogs *);
47 static int WMHideCB(FL_FORM *, void *);
49 static void OKCB(FL_OBJECT *, long);
51 static void ApplyCB(FL_OBJECT *, long);
53 static void CancelCB(FL_OBJECT *, long);
55 static void BrowseCB(FL_OBJECT *, long);
57 static void AdvancedOptionsCB(FL_OBJECT *, long);
59 static void InputCB(FL_OBJECT *, long);
64 : widthButtons(5), heightButtons(4), displayButtons(4) {}
66 FormGraphics(FormGraphics const &) : DialogBase() {}
68 /// The maximum digits for the image width (cm, inch, percent)
73 /// The maximum digits for the image height (cm, inch, percent)
78 /// The maximum characters in the rotation angle (minus sign and 3 digits)
83 /// The maximum characters in a filename.
86 FILENAME_MAXCHARS = 1024
89 /**@name Slot Methods */
91 /// Save the active inset and show the dialog.
92 void showDialog(InsetGraphics * inset);
93 /// Create the dialog if necessary, update it and display it.
101 /**@name Callback methods */
103 /// Apply the changes to the inset.
105 /// Verify that the input is correct. If not disable ok/apply buttons.
107 /// Open the file browse dialog to select an image file.
114 FD_form_graphics * build_graphics();
115 /// Explicitly free the dialog.
117 /// Display a file browser dialog and return the file chosen.
118 string browseFile(string const & filename);
122 /// Real GUI implementation.
123 FD_form_graphics * dialog_;
124 /** Which LyXFunc do we use?
125 We could modify Dialogs to have a visible LyXFunc* instead and
126 save a couple of bytes per dialog.
129 /** Which Dialogs do we belong to?
130 Used so we can get at the signals we have to connect to.
133 /** Which Inset do we belong to?
134 Used to set and update data to/from the inset.
136 InsetGraphics * inset_;
137 /// The radio buttons groups
138 RadioButtonGroup widthButtons;
140 RadioButtonGroup heightButtons;
142 RadioButtonGroup displayButtons;
144 /// Inset Hide connection, connected to the calling inset hide signal.
148 /// Update connection.
150 /// Last used figure path
151 string last_image_path;