|
From: Daniel J S. <dan...@ie...> - 2014-10-24 21:35:08
|
On 10/24/2014 01:18 AM, Philipp K. Janert wrote: > > I'd like to drum up support for a feature that I > don't have the prerequisites to implement myself, > but that might not be very difficult to do for > somebody with the right background. > > I think it would be wonderful if both current > interactive terminals (Qt and wxt) would allow > the user to "save" the current graph to file in > a range of file formats (basically PNG and PDF). > > The way I imagine this would be similar to the > way most (if not all) current GUI applications > handle this action: when the user selects the > corresponding menu entry or presses the button, > a file selection dialog pops up, in which the > user can select/enter the path- and filename > under which to save the graph, and also the > file format. Hit "Ok", and the file is created. I just compiled gnuplot for WXT... It looks like wxWidgets terminal is quite similar to Qt and it shouldn't be too difficult to make them consistent. One would need to use the GUI features that come with the library and wxWidgets has a file dialog: http://docs.wxwidgets.org/3.0/classwx_file_dialog.html So that part is easy. I'd say that perhaps some thought should be put into what the desired layout is though--agreeing on that is probably the difficult part. I consider x11 interactive and a few years ago I wrote a patch to enhance the clipboard for that terminal. What I recall of X11 is that the format saved to clipboard wasn't really decided until the calling program wanted to paste, at which point the X11 term would provide the suitable format. Anyway, I had programmed the shortcut keys Cntrl-A to highlight the graph with the typical bluish tint and Cntrl-C to paste to the clipboard. The point was to make working with the terminal much more fluent. One thing to be careful of is the fact that saving to PDF (which is certainly welcome in my opinion because the first word of PDF means "portable") in the Qt terminal isn't using the PDF terminal. There are no colors in the PDF output via Qt, whereas the PDF terminal creates a PDF output with colors. Do we want as setup in which the interactive terminals use the PDF terminal, or a setup in which the interactive terminals use their own custom PDF output? Some other comments: Right now, WXT is not copying anything to clipboard. While the Qt terminal copies so that the plot image appears in a WYSIWYG word processor, WXT terminal doesn't create anything. Also the WXT terminal has a fixed aspect ratio where Qt terminal does not. The aspect ratio for WXT (and PDF terminal output) seems much more wide/flat than it used to. The default pen color is now magenta where for years it was red. Was that change intentional? Dan |