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
24 #include "frontends/DialogBase.h"
25 //#include "form_graphics.h"
26 #include "RadioButtonGroup.h"
33 // same arguement as in Dialogs.h s/LyX/UI/
37 struct FD_form_graphics;
39 /** This class provides an XForms implementation of the FormGraphics Dialog.
41 class FormGraphics: public DialogBase {
43 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
44 FormGraphics(LyXView *, Dialogs *);
48 static int WMHideCB(FL_FORM *, void *);
50 static void OKCB(FL_OBJECT *, long);
52 static void ApplyCB(FL_OBJECT *, long);
54 static void CancelCB(FL_OBJECT *, long);
56 static void BrowseCB(FL_OBJECT *, long);
58 static void AdvancedOptionsCB(FL_OBJECT *, long);
60 static void InputCB(FL_OBJECT *, long);
65 : widthButtons(5), heightButtons(4), displayButtons(4) {}
67 FormGraphics(FormGraphics const &) : DialogBase() {}
69 /// The maximum digits for the image width (cm, inch, percent)
74 /// The maximum digits for the image height (cm, inch, percent)
79 /// The maximum characters in the rotation angle (minus sign and 3 digits)
84 /// The maximum characters in a filename.
87 FILENAME_MAXCHARS = 1024
90 /**@name Slot Methods */
92 /// Save the active inset and show the dialog.
93 void showDialog(InsetGraphics * inset);
94 /// Create the dialog if necessary, update it and display it.
102 /**@name Callback methods */
104 /// Apply the changes to the inset.
106 /// Verify that the input is correct. If not disable ok/apply buttons.
108 /// Open the file browse dialog to select an image file.
115 FD_form_graphics * build_graphics();
116 /// Explicitly free the dialog.
118 /// Display a file browser dialog and return the file chosen.
119 string browseFile(string const & filename);
123 /// Real GUI implementation.
124 FD_form_graphics * dialog_;
125 /** Which LyXFunc do we use?
126 We could modify Dialogs to have a visible LyXFunc* instead and
127 save a couple of bytes per dialog.
130 /** Which Dialogs do we belong to?
131 Used so we can get at the signals we have to connect to.
134 /** Which Inset do we belong to?
135 Used to set and update data to/from the inset.
137 InsetGraphics * inset_;
138 /// The radio buttons groups
139 RadioButtonGroup widthButtons;
141 RadioButtonGroup heightButtons;
143 RadioButtonGroup displayButtons;
145 /// Inset Hide connection, connected to the calling inset hide signal.
149 /// Update connection.
151 /// Last used figure path
152 string last_image_path;