On Friday 16 August 2002 11:59 am, Rob Lahaye wrote: > Hi, > > I have attached a patch for the new graphics dialog. > Main focus of the patch is the layout. I desperately need > help to implement the (new) items, since I have no clue how > and where to do that properly, without breaking too much. > > So the layout is there. I needed to introduce one new param, > called "int lyxdisplay" in insetgrahpicsParams.h, to handle > the new LyX display choice selector. > > A lot of buttons have been removed, but most of their code > is still there. So I bet a tremendous cleanup can be done, > but I haven't touched that part. > > Many of the new features are not yet interpreted. For example: > > - the lyxdisplay choice selection; is not done properly yet (how?)
You mean this? fl_addto_choice(file_->choice_lyxdisplay, "Default|Monochrome|Grayscale|Color|Do not display"); You need spaces between the strings I believe: " Default | Monochrome | Grayscale | Color | Do not display "); > - initialize size defaults to original image size for both, LyX and LaTeX > output: lyxscale = 100 %, width = 100 %, height = <blank>, lyxdisplay = > Default. You should set the default values in the insetgraphicsParams::init(): Incidentally, you should igp::lyxdisplay should have type DisplayType. void InsetGraphicsParams::init() { + lyxscale = 100; + if (lyxrc.display_graphics = "color") + lyxdisplay = COLOR; + else if (lyxrc.display_graphics = "...") + ... + ... } Thereafter fl_set_input(file_->input_lyxscale, tostr(scale).c_str()); fl_set_choice(file_->choice_lyxdisplay, igp.lyxdisplay); will just work. > - width/height/aspect_ratio need a more intelligent button policy: > if only one of width/height given, disable aspect_ratio button > and keep aspect ratio by default > if both, width and height,are given, enable aspect_ratio button > and do not deform image if button is checked. You'll have to hard-code this in FormGraphics::input I'm afraid. something like this: if (ob == file_->input_width || ob == ile_->input_height) { string const width = trim(getString(file_->input_width)); string const height = trim(getString(file_->input_height));getString( bool const enable = width.empty() || height.empty(); setEnabled(file_->check_aspectratio, enable); } > - rotation: ignore rotation when rotation_angle is zero. Why? why won't igp.rotateAngle = strToInt(getString(extra_->input_rotate_angle)); just do? Do you mean in the LaTeX output? Why not if (params.rotateAngle != 0) output rotation That should get you started. Angus