]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormGraphics.C
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[lyx.git] / src / frontends / xforms / FormGraphics.C
index 11051e81ae57d7a35336a37526b5615122b28a8b..936c19bdcd954bc2799ddba8054ca0702fce7fa4 100644 (file)
 
 using std::endl;
 
-static double const tol = 1.0e-08;
+namespace {
+
+// Zero test for double precision numbers
+double const tol = 1.0e-08;
+
+// The maximum digits for the image scale
+int const SCALE_MAXDIGITS = 3;
+
+// The maximum digits for the image width
+int const WIDTH_MAXDIGITS = 3;
+
+// The maximum digits for the image height
+int const HEIGHT_MAXDIGITS = 3;
+
+// The max characters in the rotation angle (minus sign and 3 digits)
+int const ROTATE_MAXCHARS = 4;
+
+// The maximum characters in a filename.
+int const FILENAME_MAXCHARS = 1024;
+} // namespace anon
+
 
 typedef FormCB<ControlGraphics, FormDB<FD_form_graphics> > base_class;
 
@@ -241,7 +262,13 @@ void FormGraphics::update()
                fl_set_input(dialog_->input_width, number.c_str());
 
                int pos = 1;
+               //use inch as default with US papersizes in lyxrc
+               if (lyxrc.default_papersize < 3)
+                       pos = 2;
                switch (igp.widthResize) {
+               case InsetGraphicsParams::CM:
+                       pos = 1; break;
+
                case InsetGraphicsParams::INCH:
                        pos = 2; break;
 
@@ -263,7 +290,13 @@ void FormGraphics::update()
                fl_set_input(dialog_->input_height, number.c_str());
 
                pos = 1;
+               //use inch as default with US papersizes in lyxrc
+               if (lyxrc.default_papersize < 3)
+                       pos = 2;
                switch (igp.heightResize) {
+               case InsetGraphicsParams::CM:
+                       pos = 1; break;
+
                case InsetGraphicsParams::INCH:
                        pos = 2; break;