|
From: Tatsuro M. <tma...@ya...> - 2010-01-28 00:54:24
|
Hello Bastian Maerkisch --- Bastian Maerkisch wrote: > Hello > > I understand that you use cygwin to compile gnuplot on windows. It would > be great if you could include readline (or editline) in your build for > "gnuplot.exe". This is now standard on Linux and is one of the things I > am sorely missing on windows. > > Regards > Bastian I do not use cygwin to build gnuplot binaries native to windows. I am using msys + mingw + mingw gcc to build them. I use cygwin when I build cygwin version of gnuplot. For building of gnuplot on the above platform, ./configure-make procedure is not used but it uses customized makefile (makefile.mgw) and config.h (config.mgw is override to config.h in make process.). In makefile.mgw, there is no description of the readline feature. I have a windows version libreadline libraries provides by GnuWin32 project. I will try it Perhaps I have to add -DHAVE_LIBREADLINE to complier flag, add include and library path and add -lreadline in linker flag. Of cource, I will try it only for gnuplot.exe and do not want to do for wgnuplot[_pipes].exe. I do not know whether it will be successful or not. Please wait keeping your expectations low. If you or someone gives me suggestions for the matter, it will be welcome. Regards Tatsuro Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-01 10:37:45
|
Hello --- Tatsuro MATSUOKA <tma...@ya...> wrote: > > BTW, I found the my fix for 'pause mouse' shows different results whether gnuplot is built > with > wxt or > without wxt. I will fix it. The my completely comes from my miss operation. Sorry for the noise. Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-02 08:14:42
|
Hello In gnuplot.exe on windows, we can break pause for key board like 'pause -1' by any key. In the manual or the help of pause, it can be broken by only the return key. Is it desirable to correct code of pause command for keyboard only be broken by the return key? In current state, pause for keyboard on gnuplo.exe by calling term->waitforinput(). In term->waitforinput(), ConsoleGetch() is used. Why I use term->waitforinput() but not fgets(buf, strlen(buf), stdin) is the way to get command strings from the prompt gnuplot.exe for windows. It gets commant strings though ConsoleGetch() so that using fgets(buf, strlen(buf), stdin) gave failure to get command string after pause for key board. If it is desirable that pause command for keyboard only be broken by return key, I will fix it using a loop when return code gotten from term->waitforinput(). Any comments? Regards Tatsuro --- Tatsuro MATSUOKA wrote: > Hello > > --- Tatsuro MATSUOKA <tma...@ya...> wrote: > > > > BTW, I found the my fix for 'pause mouse' shows different results whether gnuplot is built > > with > > wxt or > > without wxt. I will fix it. > > The my completely comes from my miss operation. Sorry for the noise. > > Regards > > Tatsuro > > > -------------------------------------- > Get the new Internet Explorer 8 optimized for Yahoo! JAPAN > http://pr.mail.yahoo.co.jp/ie8/ > -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Petr M. <mi...@ph...> - 2010-02-02 08:46:02
|
> In gnuplot.exe on windows, we can break pause for key board like 'pause -1' by any key. > In the manual or the help of pause, it can be broken by only the return key. > > Is it desirable to correct code of pause command for keyboard only be broken by the return key? > > In current state, pause for keyboard on gnuplo.exe by calling term->waitforinput(). > In term->waitforinput(), ConsoleGetch() is used. > > Why I use term->waitforinput() but not fgets(buf, strlen(buf), stdin) is the way to get command > strings from the prompt gnuplot.exe for windows. It gets commant strings though ConsoleGetch() so > that using fgets(buf, strlen(buf), stdin) gave failure to get command string after pause for key > board. > > If it is desirable that pause command for keyboard only be broken by return key, I will fix it using > a loop when return code gotten from term->waitforinput(). I think the loop waiting for Enter is the most appropriate solution. --- PM |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-02 08:56:10
|
Hello --- Petr Mikulik wrote: > > I think the loop waiting for Enter is the most appropriate solution. OK. I am now quite occupied due to the end of winter term of the university. I will post the patch in the weekend. Thanks! Tatsuro -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-03 00:46:26
Attachments:
command.c.Enter.diff
|
Hello --- Tatsuro MATSUOKA wrote: > I am now quite occupied due to the end of winter term of the university. > I will post the patch in the weekend. Although I stated as the above, I have done it. Only enter key breaks 'pause -1'. Regards Tatsuro -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-03 08:33:47
|
Hello I have applied the patch for 'pause -1' to the current cvs source (Latest ChangeLog Date 2010-02-02) and uploaded on the web. http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/ Regards Tatsuro --- Tatsuro MATSUOKA <tma...@ya...> wrote: > Hello > > --- Tatsuro MATSUOKA wrote: > > > I am now quite occupied due to the end of winter term of the university. > > I will post the patch in the weekend. > > Although I stated as the above, I have done it. > > Only enter key breaks 'pause -1'. > > Regards > > Tatsuro > > > -------------------------------------- > VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] > http://pr.mail.yahoo.co.jp/olympic/ -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Benjamin L. <lin...@gm...> - 2010-02-02 09:09:17
Attachments:
pasteword.png
|
> Hans-Bernhard Bröker wrote: > > Benjamin Lindner wrote: > > > > [about wgnuplot 4.4 candidate:] > >> There is still one issue open I believe: > >> - Copying to clipboard as metafile is broken. > > > > Broken how, exactly? > > > > in the way that the command > > plot sin(x) with linespoints, cos(x) with linespoints > > produces the attached term window, but when doing Options->Copy to > Clipboard > and then pasting as Metafile in openoffice the result looks like the > second attachment. and if pasted into microsoft word, then the result looks like the attached png. This certainly looks better than when pasted into OO but it's also broken as the text disappears, and the marker points also. benjamin -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser |
|
From: Benjamin L. <lin...@gm...> - 2010-02-03 14:05:57
Attachments:
gp_emf-clipboard-copying.patch
pasteemfword.png
|
> >
> > One observation on gnuplot 4.4: this list has been much taken up
> > with somewhat arcane problems on Windows.
>
> That's 'cos Windows is in the worst shape.
nevertheless gnuplot works very nicely, and it's good to have it
avilable, so bear with us windows users ...
Back to the copy-to-clipboard-as-emf issue.
I have attached a patch, which (for the current 4.5.0 CVS sources)
creates an enhanced metafile instead of a metafile and stores
this in the clipboard. It still has some debugging statements
included, so it's a testing version of a patch.
set term windows enhanced font ",14"
set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
plot sin(x) with linespoints, cos(x) with linespoints
This works for me using wxp and microsoft word (see png) even with
enhanced text.
(BTW you can still paste as simple metafile if you like, since
windows can obviously convert on-the-fly between the two)
It would be interesting to see if this also works on other systems.
benjamin
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
|
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-03 16:15:56
|
On Wednesday 03 February 2010, Benjamin Lindner wrote:
> > >
> > > One observation on gnuplot 4.4: this list has been much taken up
> > > with somewhat arcane problems on Windows.
> >
> > That's 'cos Windows is in the worst shape.
>
> nevertheless gnuplot works very nicely, and it's good to have it
> avilable, so bear with us windows users ...
I think you may have misunderstood me.
The point is that fewer people are working on the Windows-specific
parts of gnuplot, so the code is in worse shape than the more
general routines. I consider it a good thing that the list has
recently attracted more discussion of Windows problems, because
that's where the attention is most needed.
> I have attached a patch, which (for the current 4.5.0 CVS sources)
> creates an enhanced metafile instead of a metafile and stores
> this in the clipboard. It still has some debugging statements
> included, so it's a testing version of a patch.
>
> set term windows enhanced font ",14"
> set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
> plot sin(x) with linespoints, cos(x) with linespoints
>
> This works for me using wxp and microsoft word (see png) even with
> enhanced text.
Sounds good!
Ethan
|
|
From: Tatsuro M. <tma...@ya...> - 2010-02-04 04:22:23
|
Hello --- Ethan Merritt wrote: > On Wednesday 03 February 2010, Benjamin Lindner wrote: > > > > > > > > One observation on gnuplot 4.4: this list has been much taken up > > > > with somewhat arcane problems on Windows. > > > > > > That's 'cos Windows is in the worst shape. > > > > nevertheless gnuplot works very nicely, and it's good to have it > > avilable, so bear with us windows users ... > > I think you may have misunderstood me. > The point is that fewer people are working on the Windows-specific > parts of gnuplot, so the code is in worse shape than the more > general routines. I consider it a good thing that the list has > recently attracted more discussion of Windows problems, because > that's where the attention is most needed. As for the pause mouse routine for 'pause mouse' that I have worked on it with Petr, the code for windows seems to be not smart. In my idea, it is better described it in win.trm and wxt.trm (or wxt_gui.cpp) and the part of platform dependent code is better to be small as possible. If people agree it, I'll try the change. Regards Tatsuro -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-04 07:48:39
Attachments:
splot20100204.png
|
Hello
I have tried the patch.
set term windows enhanced font ",14"
set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
plot sin(x) with linespoints, cos(x) with linespoints
worked fine!!!!!!!.
However, I have tried
set xrange [-pi:pi]
set yrange [-pi:pi]
splot sin(x*x+y*y)/(x*x+y*y)
was broken as a attachment file.
Perhaps the patch seems not to work correct for splot.
Regards
Tatsuro
Tatsuro
--- Benjamin Lindner <lin...@gm...> wrote:
> > >
> > > One observation on gnuplot 4.4: this list has been much taken up
> > > with somewhat arcane problems on Windows.
> >
> > That's 'cos Windows is in the worst shape.
>
> nevertheless gnuplot works very nicely, and it's good to have it
> avilable, so bear with us windows users ...
>
> Back to the copy-to-clipboard-as-emf issue.
>
> I have attached a patch, which (for the current 4.5.0 CVS sources)
> creates an enhanced metafile instead of a metafile and stores
> this in the clipboard. It still has some debugging statements
> included, so it's a testing version of a patch.
>
> set term windows enhanced font ",14"
> set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
> plot sin(x) with linespoints, cos(x) with linespoints
>
> This works for me using wxp and microsoft word (see png) even with
> enhanced text.
>
> (BTW you can still paste as simple metafile if you like, since
> windows can obviously convert on-the-fly between the two)
>
> It would be interesting to see if this also works on other systems.
>
> benjamin
> --
> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
> > ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
--------------------------------------
VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi]
http://pr.mail.yahoo.co.jp/olympic/ |
|
From: Benjamin L. <lin...@gm...> - 2010-02-07 18:46:37
Attachments:
gp_emf-clipboard-copying.patch
|
Tatsuro MATSUOKA wrote:
> Hello
>
> I have tried the patch.
>
> set term windows enhanced font ",14"
> set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
> plot sin(x) with linespoints, cos(x) with linespoints
>
> worked fine!!!!!!!.
>
>
> However, I have tried
> set xrange [-pi:pi]
> set yrange [-pi:pi]
> splot sin(x*x+y*y)/(x*x+y*y)
>
> was broken as a attachment file.
Thanks for the report.
I modified my patch and now I see the expected behaviour
with plot (lines + image), splot (surface+pm3d).
I also added the keyboard shortcut Ctrl+C for copying to clipboard.
benjamin
|
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-07 19:08:56
|
On Sunday 07 February 2010, Benjamin Lindner wrote:
> Tatsuro MATSUOKA wrote:
> > Hello
> >
> > I have tried the patch.
> >
> > set term windows enhanced font ",14"
> > set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
> > plot sin(x) with linespoints, cos(x) with linespoints
> >
> > worked fine!!!!!!!.
> >
> >
> > However, I have tried
> > set xrange [-pi:pi]
> > set yrange [-pi:pi]
> > splot sin(x*x+y*y)/(x*x+y*y)
> >
> > was broken as a attachment file.
>
> Thanks for the report.
>
> I modified my patch and now I see the expected behaviour
> with plot (lines + image), splot (surface+pm3d).
Very good.
> I also added the keyboard shortcut Ctrl+C for copying to clipboard.
Er...
Ctrl+C is currently documented as having another, quite different meaning.
True, it apparently isn't working properly under Windows,
but re-assigning it to "copy to clipboard" further confuses the issue.
Actually, now that I think about it...
Is it possible that the reason Ctrl+C is having problems is that
some layer is trying to interpret it as "copy" at the same time
another layer is trying to interpret it as "break to command line"?
Should we give up on trying to make Ctrl-C == "break to command line"
work under Windows?
Ethan
>
> benjamin
>
>
>
|
|
From: Benjamin L. <lin...@gm...> - 2010-02-07 19:49:37
|
Ethan Merritt wrote:
> On Sunday 07 February 2010, Benjamin Lindner wrote:
>> Tatsuro MATSUOKA wrote:
>>> Hello
>>>
>>> I have tried the patch.
>>>
>>> set term windows enhanced font ",14"
>>> set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5
>>> plot sin(x) with linespoints, cos(x) with linespoints
>>>
>>> worked fine!!!!!!!.
>>>
>>>
>>> However, I have tried
>>> set xrange [-pi:pi]
>>> set yrange [-pi:pi]
>>> splot sin(x*x+y*y)/(x*x+y*y)
>>>
>>> was broken as a attachment file.
>> Thanks for the report.
>>
>> I modified my patch and now I see the expected behaviour
>> with plot (lines + image), splot (surface+pm3d).
>
> Very good.
>
>> I also added the keyboard shortcut Ctrl+C for copying to clipboard.
>
> Er...
> Ctrl+C is currently documented as having another, quite different meaning.
> True, it apparently isn't working properly under Windows,
> but re-assigning it to "copy to clipboard" further confuses the issue.
Well, actually, for a windows GUI application Ctrl+C means "copy to
clipboard"
That has been so since I don't know when, and I believe that a decent
GUI application should follow the commonly used basic shortcuts.
Coming from the windows world I find it more confusing if an application
does not follow these "standards".
It's like Ctrl+O meaning "Open", Ctrl+S "save", Ctrl+C
copy-to-clipboard, Ctrl+V paste-from-clipboard, F1 meaning "help" etc
So having the feature that copies something to clipboard I think it
should have the shortcut Ctrl+C.
I know that in the non-windows world it has a completely different
interpretation, but it's a windows GUI application here, and I think
it should follow windows' behaviour.
> Actually, now that I think about it...
> Is it possible that the reason Ctrl+C is having problems is that
> some layer is trying to interpret it as "copy" at the same time
> another layer is trying to interpret it as "break to command line"?
I can't really tell...
> Should we give up on trying to make Ctrl-C == "break to command line"
> work under Windows?
One has to distinguish *which* application window we are
talking about.
The shortcut I implemented in the patch concerns the graph window only.
The text window (showing the prompt and doing the user-input) has a
separate keyboard-shortcut handling queue. And Pressing Ctrl+C within
the text window can have a completely different meaning than in the
graph window. And the text window then can be either the console OR
again a graphical window (for the GUI application).
Pressing Ctrl+C in the GUI-text window currently has no effect, but
pressing ESC bails to the "command line" (as it is a gui application
there's no real command line in a console sense)
- again like I'd expect from a windows application (yes, talking about
"standards" again...)
benjamin
|
|
From: Petr M. <mi...@ph...> - 2010-02-07 22:28:27
|
> Well, actually, for a windows GUI application Ctrl+C means "copy to > clipboard" That has been so since I don't know when, and I believe that a > decent GUI application should follow the commonly used basic shortcuts. > Coming from the windows world I find it more confusing if an application > does not follow these "standards". It's like Ctrl+O meaning "Open", Ctrl+S > "save", Ctrl+C copy-to-clipboard, Ctrl+V paste-from-clipboard, F1 meaning > "help" etc Well, there is possibly a funny story about copy and paste? It is Ctrl-Insert and Shift-Insert for ages. On Mac it is Apple-C and Apple-V. When has M$ got an idea it's too difficult for people to press the Insert key ... and Win key was on available on old keyboards? The -Insert shortcuts are still working even they seem not to be documented! > > Should we give up on trying to make Ctrl-C == "break to command line" > > work under Windows? > > One has to distinguish *which* application window we are > talking about. > The shortcut I implemented in the patch concerns the graph window only. > The text window (showing the prompt and doing the user-input) has a > separate keyboard-shortcut handling queue. And Pressing Ctrl+C within > the text window can have a completely different meaning than in the > graph window. And the text window then can be either the console OR > again a graphical window (for the GUI application). > > Pressing Ctrl+C in the GUI-text window currently has no effect, but > pressing ESC bails to the "command line" (as it is a gui application > there's no real command line in a console sense) > - again like I'd expect from a windows application (yes, talking about > "standards" again...) Ctrl-C in graph window should copy graph to clipboard (win, wxt, ...). In command window, it has to break the command. --- PM |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2010-02-08 23:18:27
|
Petr Mikulik wrote: > key ... and Win key was on available on old keyboards? The -Insert shortcuts > are still working even they seem not to be documented! wgnuplot does document them, of sorts: as hints in the context menu of the text window (right-click into the text menu, or select "Options->" from the text window's program menu (top-left corner icon). |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2010-02-08 22:49:54
|
Benjamin Lindner wrote: > Well, actually, for a windows GUI application Ctrl+C means "copy to > clipboard" Nowadays --- but wgnuplot is older than that tradition. Back then Ctrl-Insert meant copy. And it still does, in just about any application, including wgnuplot. And wgnuplot is a GUI application only by necessity, not by choice. It's a console application forced into a GUI corset because that was the only way to create a Windows application at all, back in the day (we're talking about 16-bit Windows here). > Coming from the windows world I find it more confusing if an application > does not follow these "standards". Well, something's gotta give. A massively portable program like gnuplot can't follow each and every platform's conventions completely. In the long time wgnuplot.exe has been around, the "standard" on MS Windows has changed several times over --- roughly every two years, when either a new version of Windows or Office hits the streets. In the same time, wgnuplot barely changed at all. That's both a strength and a weakness. It means it still looks and feels the same to people accustomed to it from way back when, but it also means that it'll alienate newcomers to some extent. |
|
From: Tatsuro M. <tma...@ya...> - 2010-02-08 02:39:38
|
Hello I have confirmed that your patch works for 3d plots. I have upload binaries with the patch on the web. http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/ Regards Tatsuro --- Benjamin Lindner wrote: > Tatsuro MATSUOKA wrote: > > Hello > > > > I have tried the patch. > > > > set term windows enhanced font ",14" > > set label 1 "e^{i{/symbol p}} = -1" at graph 0.1,0.5 > > plot sin(x) with linespoints, cos(x) with linespoints > > > > worked fine!!!!!!!. > > > > > > However, I have tried > > set xrange [-pi:pi] > > set yrange [-pi:pi] > > splot sin(x*x+y*y)/(x*x+y*y) > > > > was broken as a attachment file. > > Thanks for the report. > > I modified my patch and now I see the expected behaviour > with plot (lines + image), splot (surface+pm3d). > > I also added the keyboard shortcut Ctrl+C for copying to clipboard. > > benjamin > > > > testing EMF clipboard copying > > diff --git a/src/win/wgraph.c b/src/win/wgraph.c > --- a/src/win/wgraph.c > +++ b/src/win/wgraph.c > @@ -389,7 +389,7 @@ > M_GRAPH_TO_TOP, "Bring to &Top"); > AppendMenu(lpgw->hPopMenu, MF_STRING | (lpgw->color ? MF_CHECKED : MF_UNCHECKED), > M_COLOR, "C&olor"); > - AppendMenu(lpgw->hPopMenu, MF_STRING, M_COPY_CLIP, "&Copy to Clipboard"); > + AppendMenu(lpgw->hPopMenu, MF_STRING, M_COPY_CLIP, "&Copy to Clipboard (Ctrl+C)"); > #if WINVER >= 0x030a > AppendMenu(lpgw->hPopMenu, MF_STRING, M_BACKGROUND, "&Background..."); > AppendMenu(lpgw->hPopMenu, MF_STRING, M_CHOOSE_FONT, "Choose &Font..."); > @@ -646,6 +646,38 @@ > if (rect->bottom < rect->top) rect->bottom = rect->top; > } > > +static void > +GetPlotRectInMM(LPGW lpgw, LPRECT rect, HDC hdc) > +{ > + GetPlotRect (lpgw, rect); > + > + /* Taken from > + http://msdn.microsoft.com/en-us/library/dd183519(VS.85).aspx > + */ > + > + // Determine the picture frame dimensions. > + // iWidthMM is the display width in millimeters. > + // iHeightMM is the display height in millimeters. > + // iWidthPels is the display width in pixels. > + // iHeightPels is the display height in pixels > + > + int iWidthMM = GetDeviceCaps(hdc, HORZSIZE); > + int iHeightMM = GetDeviceCaps(hdc, VERTSIZE); > + int iWidthPels = GetDeviceCaps(hdc, HORZRES); > + int iHeightPels = GetDeviceCaps(hdc, VERTRES); > + > + // Convert client coordinates to .01-mm units. > + // Use iWidthMM, iWidthPels, iHeightMM, and > + // iHeightPels to determine the number of > + // .01-millimeter units per pixel in the x- > + // and y-directions. > + > + rect->left = (rect->left * iWidthMM * 100)/iWidthPels; > + rect->top = (rect->top * iHeightMM * 100)/iHeightPels; > + rect->right = (rect->right * iWidthMM * 100)/iWidthPels; > + rect->bottom = (rect->bottom * iHeightMM * 100)/iHeightPels; > +} > + > > static void > MakeFonts(LPGW lpgw, LPRECT lprect, HDC hdc) > @@ -1362,12 +1394,10 @@ > static void > CopyClip(LPGW lpgw) > { > - RECT rect; > - HDC mem; > + RECT rect, mfrect; > + HDC mem, hmf; > HBITMAP bitmap; > - HANDLE hmf; > - GLOBALHANDLE hGMem; > - LPMETAFILEPICT lpMFP; > + HENHMETAFILE hemf; > HWND hwnd; > HDC hdc; > > @@ -1400,49 +1430,23 @@ > } > DeleteDC(mem); > > - /* OK, bitmap done, now create a Metafile context at full theoretical resolution > - * of the Windows terminal (24000 x 18000 pixels), and redraw the whole > - * plot into that. */ > + /* OK, bitmap done, now create an enhanced Metafile context > + * and redraw the whole plot into that. > + */ > { > /* make copy of window's main status struct for modification */ > GW gwclip = *lpgw; > - int windowfontsize = MulDiv(lpgw->fontsize, GetDeviceCaps(hdc, LOGPIXELSY), 72); > - int i; > > - gwclip.fontsize = MulDiv(windowfontsize, lpgw->ymax, rect.bottom); > gwclip.hfonth = gwclip.hfontv = 0; > - > - /* HBB 981203: scale up pens as well... */ > - for (i = 0; i < WGNUMPENS + 2; i++) { > - if(gwclip.monopen[i].lopnWidth.x > 1) > - gwclip.monopen[i].lopnWidth.x = > - MulDiv(gwclip.monopen[i].lopnWidth.x, > - gwclip.xmax, rect.right-rect.left); > - if(gwclip.colorpen[i].lopnWidth.x > 1) > - gwclip.colorpen[i].lopnWidth.x = > - MulDiv(gwclip.colorpen[i].lopnWidth.x, > - gwclip.xmax, rect.right-rect.left); > - } > - > - rect.right = lpgw->xmax; > - rect.bottom = lpgw->ymax; > - > MakePens(&gwclip, hdc); > MakeFonts(&gwclip, &rect, hdc); > > - ReleaseDC(hwnd, hdc); > + GetPlotRectInMM(lpgw, &mfrect, hdc); > > - hdc = CreateMetaFile((LPSTR)NULL); > + hmf = CreateEnhMetaFile(hdc, (LPCTSTR)NULL, &mfrect, (LPCTSTR)NULL); > + drawgraph(&gwclip, hmf, (LPRECT) &rect); > + hemf = CloseEnhMetaFile(hmf); > > -/* HBB 981203: According to Petzold, Metafiles shouldn't contain SetMapMode() calls: */ > - /*SetMapMode(hdc, MM_ANISOTROPIC);*/ > -#ifdef WIN32 > - SetWindowExtEx(hdc, rect.right, rect.bottom, (LPSIZE)NULL); > -#else > - SetWindowExt(hdc, rect.right, rect.bottom); > -#endif > - drawgraph(&gwclip, hdc, (LPRECT) &rect); > - hmf = CloseMetaFile(hdc); > DestroyFonts(&gwclip); > DestroyPens(&gwclip); > } > @@ -1450,23 +1454,13 @@ > /* Now we have the Metafile and Bitmap prepared, post their contents to > * the Clipboard */ > > - hGMem = GlobalAlloc(GMEM_MOVEABLE, (DWORD)sizeof(METAFILEPICT)); > - lpMFP = (LPMETAFILEPICT) GlobalLock(hGMem); > - hdc = GetDC(hwnd); /* get window size */ > - GetPlotRect(lpgw, &rect); > - /* in MM_ANISOTROPIC, xExt & yExt give suggested size in 0.01mm units */ > - lpMFP->mm = MM_ANISOTROPIC; > - lpMFP->xExt = MulDiv(rect.right-rect.left, 2540, GetDeviceCaps(hdc, LOGPIXELSX)); > - lpMFP->yExt = MulDiv(rect.bottom-rect.top, 2540, GetDeviceCaps(hdc, LOGPIXELSY)); > - lpMFP->hMF = hmf; > - ReleaseDC(hwnd, hdc); > - GlobalUnlock(hGMem); > - > OpenClipboard(hwnd); > EmptyClipboard(); > - SetClipboardData(CF_METAFILEPICT,hGMem); > + SetClipboardData(CF_ENHMETAFILE,hemf); > SetClipboardData(CF_BITMAP, bitmap); > CloseClipboard(); > + ReleaseDC(hwnd, hdc); > + DeleteEnhMetaFile(hemf); > return; > } > > @@ -2244,6 +2238,15 @@ > break; > case WM_KEYDOWN: > { > + if (GetKeyState(VK_CONTROL) < 0) { > + switch(wParam) { > + case 'C': > + /* Ctrl-C: Copy to Clipboard */ > + SendMessage(hwnd,WM_COMMAND,M_COPY_CLIP,0L); > + break; > + } /* switch(wparam) */ > + } /* if(Ctrl) */ > + else { > /* First, look for a change in modifier status */ > unsigned int modifier_mask = 0; > modifier_mask = ((GetKeyState(VK_SHIFT) < 0) ? Mod_Shift : 0 ) > @@ -2254,6 +2257,7 @@ > last_modifier_mask = modifier_mask; > } > } > + } > switch (wParam) { > case VK_BACK: > Wnd_exec_event(lpgw, lParam, GE_keypress, GP_BackSpace); > diff --git a/term/win.trm b/term/win.trm > --- a/term/win.trm > +++ b/term/win.trm > @@ -982,7 +982,7 @@ > " `Color` when checked enables color linestyles. When unchecked it forces", > " monochrome linestyles.", > "", > -" `Copy to Clipboard` copies a bitmap and a Metafile picture.", > +" `Copy to Clipboard` copies a bitmap and an enhanced Metafile picture.", > "", > " `Background...` sets the window background color.", > "", > -------------------------------------- VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi] http://pr.mail.yahoo.co.jp/olympic/ |